Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ curl -fsSL https://gumloop.com/cli/import-logins.sh | sh

Cookies only: local storage and IndexedDB stay on your machine, so sites that keep the session there ask the agent to sign in once, after which the agent's browser keeps it. Imported cookies are encrypted with the profile's own key before storage and are never shown back in the UI or API; sign-ins the agent picks up while running are saved back to the same profile. Rename, remove sites from, or delete profiles on the Secrets page in Gumloop.

### Let your agents' browser go out through this computer

Sites that only accept sign-ins from your network or your IP can be reached by linking this computer: your agents' browser connects to them from here. On macOS or Linux, after `gumloop login`:

```bash
gumloop browser proxy link # automatically runs in the background on startup
gumloop browser proxy status
gumloop browser proxy unlink
```

On Linux without a systemd user session, such as a container, `link` can't run it in the background. Run `gumloop browser proxy connect` and keep it open instead.

The computer only opens connections to public addresses on ports 80 and 443. Its key stays in the OS keychain. `gumloop logout` unlinks it. A network that inspects TLS traffic can't be used, since sites would show the agent's browser certificate errors.

### Sync a folder into your Brain

Mirror a local directory into a file-upload Brain source. Files are compared by name and sha256, so a re-run uploads only what changed; indexing starts on its own after each upload.
Expand Down
1 change: 1 addition & 0 deletions docs/client-capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The feature parity audit adds client adapters over existing APIs and selected ba
| Company Brain search and uploaded-file sources | `client.brain` | `gumloop brain` |
| Generated file metadata, downloads, rename, delete, versions, and sharing | `client.artifacts` | `gumloop artifacts` |
| Personal browser profile CRUD and existing listing/cookie import | `client.browser_profiles` | `gumloop browser` |
| Linking this computer for agents' browser traffic | `client.linked_proxies` (register and delete only) | `gumloop browser proxy` |
| Connected Brain source inspection, sync history, issues, indexed children, and sync requests | `client.brain` | `gumloop brain sources` |
| Integration trigger catalog, account selection/configuration, and run history | `client.agents` trigger methods | `gumloop agents triggers` |
| Team and organization membership discovery | `client.teams.list`, `client.organizations.list` | `gumloop teams list`, `gumloop organizations list` |
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ classifiers = [
"Programming Language :: Python :: 3.13",
]
dependencies = [
# The linked proxy trusts certifi's roots only, never the OS store.
"certifi>=2024.2.2",
"cryptography>=42.0.0",
"httpx>=0.24.1",
"httpx-sse>=0.4.0",
Expand All @@ -31,6 +33,7 @@ dependencies = [
"rich",
"click>=8.0",
"typer>=0.25.1,<0.30",
"websockets>=14",
]

[tool.hatch.version]
Expand Down
4 changes: 4 additions & 0 deletions src/gumloop/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from gumloop.resources import AsyncChat
from gumloop.resources import AsyncDecisions
from gumloop.resources import AsyncEvaluations
from gumloop.resources import AsyncLinkedProxies
from gumloop.resources import AsyncMCP
from gumloop.resources import AsyncModels
from gumloop.resources import AsyncOrganizations
Expand All @@ -36,6 +37,7 @@
from gumloop.resources import Chat
from gumloop.resources import Decisions
from gumloop.resources import Evaluations
from gumloop.resources import LinkedProxies
from gumloop.resources import Models
from gumloop.resources import Organizations
from gumloop.resources import Sessions
Expand Down Expand Up @@ -120,6 +122,7 @@ def __init__(
self.artifacts = Artifacts(self._http)
self.brain = Brain(self._http)
self.browser_profiles = BrowserProfiles(self._http)
self.linked_proxies = LinkedProxies(self._http)
self.oauth = OAuth(base_url=self.base_url, timeout=self.timeout)

def close(self) -> None:
Expand Down Expand Up @@ -188,6 +191,7 @@ def __init__(
self.artifacts = AsyncArtifacts(self._http)
self.brain = AsyncBrain(self._http)
self.browser_profiles = AsyncBrowserProfiles(self._http)
self.linked_proxies = AsyncLinkedProxies(self._http)
self.oauth = OAuth(base_url=self.base_url, timeout=self.timeout)

async def __aenter__(self) -> AsyncGumloop:
Expand Down
2 changes: 1 addition & 1 deletion src/gumloop/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import annotations

__version__ = "0.5.15"
__version__ = "0.5.16"
27 changes: 25 additions & 2 deletions src/gumloop/cli/commands/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
from typing import Annotated
from typing import Literal

import httpx
import questionary
import typer
from rich.markup import escape as escape_markup
from rich.prompt import Prompt

from gumloop import Gumloop
from gumloop import GumloopError
from gumloop.cli.commands.linked_proxy import remove_linked_proxy
from gumloop.cli.console import console
from gumloop.cli.console import print_json
from gumloop.cli.context import CliContext
Expand All @@ -18,6 +21,7 @@
from gumloop.cli.credentials import keyring_backend_name
from gumloop.cli.credentials import save_credentials
from gumloop.cli.errors import exit_with_error
from gumloop.cli.linked_proxy_key import backend_host
from gumloop.cli.oauth import DEFAULT_REDIRECT_PORT
from gumloop.cli.oauth import perform_oauth_login
from gumloop.cli.oauth import revoke_oauth_token
Expand Down Expand Up @@ -202,9 +206,17 @@ def logout(
typer.Option("--json", help="Print the result as JSON."),
] = False,
) -> None:
"""Clear stored Gumloop credentials."""
"""Clear stored Gumloop credentials, and unlink this computer."""
cli: CliContext = ctx.obj

# Before the revoke, which would leave no login to delete the linked proxy with.
linked_proxy_removed = False
linked_proxy_error: str | None = None
try:
linked_proxy_removed = remove_linked_proxy(cli, backend_host(cli.effective_base_url))
except (GumloopError, httpx.HTTPError) as error:
linked_proxy_error = str(error)

# Server-side revoke first so the refresh token can't outlive the
# local logout. Revoke failures never block the local clear.
oauth_revoked = False
Expand All @@ -220,9 +232,15 @@ def logout(

clear_credentials()

payload: dict[str, object] = {"status": "ok", "oauth_revoked": oauth_revoked}
payload: dict[str, object] = {
"status": "ok",
"oauth_revoked": oauth_revoked,
"linked_proxy_removed": linked_proxy_removed,
}
if revoke_failed:
payload["oauth_revoke_failed"] = True
if linked_proxy_error is not None:
payload["linked_proxy_remove_failed"] = True

if json_output:
print_json(payload)
Expand All @@ -234,3 +252,8 @@ def logout(
"[yellow]Note:[/yellow] could not reach the server to revoke the refresh token; "
"it will remain valid until it expires."
)
if linked_proxy_error is not None:
console.print(
"[yellow]Note:[/yellow] could not unlink this computer "
f"({escape_markup(linked_proxy_error)}). Log in again and run `gumloop browser proxy unlink`."
)
4 changes: 3 additions & 1 deletion src/gumloop/cli/commands/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from gumloop.browser_logins import extract_site_cookies
from gumloop.browser_logins import site_of_url
from gumloop.browser_logins.chromium_cookies import KeychainAccessError
from gumloop.cli.commands.linked_proxy import proxy_app
from gumloop.cli.console import console
from gumloop.cli.console import print_json
from gumloop.cli.context import CliContext
Expand All @@ -28,12 +29,13 @@
from gumloop.types import BrowserProfileImportSummary

browser_app = typer.Typer(
help="Bring your browser sign-ins to Gumloop agents.",
help="Bring your browser sign-ins, and this computer's network, to Gumloop agents.",
no_args_is_help=True,
rich_markup_mode="rich",
)
profiles_app = typer.Typer(help="Manage browser profiles.", no_args_is_help=True, rich_markup_mode="rich")
browser_app.add_typer(profiles_app, name="profiles")
browser_app.add_typer(proxy_app, name="proxy")


def _pick_local_profile(browser: str | None, browser_profile: str | None, *, non_interactive: bool) -> LocalProfile:
Expand Down
Loading