brindle 0.5.2__tar.gz → 0.5.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {brindle-0.5.2 → brindle-0.5.3}/PKG-INFO +1 -1
- {brindle-0.5.2 → brindle-0.5.3}/pyproject.toml +1 -1
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/agents.py +44 -26
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/antigravity.py +1 -1
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/cloud_login.py +21 -8
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/config.py +9 -5
- brindle-0.5.3/src/brindle/connections.py +533 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/api-schema.json +1912 -802
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/lifecycle.py +2 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/routes_actions.py +252 -84
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/routes_read.py +88 -17
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/session_review.py +23 -23
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/db.py +18 -2
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/gates.py +26 -10
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/key_check.py +27 -10
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/keys_cmds.py +61 -3
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/keystore.py +82 -3
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/native/runner.py +2 -2
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/org_permissions.py +22 -2
- brindle-0.5.3/src/brindle/permission_grants.py +1523 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/permission_groups.py +18 -15
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/permissions.py +207 -69
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/team_policy.py +55 -3
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/profiles.py +7 -1
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/providers.py +23 -1
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/providers_install.py +6 -1
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/service/dto.py +115 -1
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/service/inbox.py +41 -3
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/service/permissions.py +47 -4
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/tmux.py +50 -2
- brindle-0.5.2/src/brindle/permission_grants.py +0 -803
- {brindle-0.5.2 → brindle-0.5.3}/.gitignore +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/LICENSE +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/README.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/SCHEDULE-A +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/__init__.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/__main__.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/account.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/airgap.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/assembler.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/assets/braid_dark.png +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/assets/braid_light.png +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/autopilot.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/budget.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/__init__.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/backend-auditor.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/coordinator.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/developer-codex.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/developer-fable.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/developer-gemini.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/developer-heavy.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/developer-light.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/developer-local.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/developer-opencode.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/developer-sonnet.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/developer.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/qa.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/reviewer-codex.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/reviewer-gemini.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/reviewer-local.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/reviewer-opencode.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/reviewer.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/subagent.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_agents/supervisor.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_rules/__init__.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_rules/security/backend.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_rules/style/minimal-diff.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/builtin_rules/tests/only.md +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/bus.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/check_scope.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/ci_adapters.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/ci_client.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/ci_federation.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/ci_hosts.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/cli.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/clone.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/cloud_credential.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/codemap.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/codemap_docs.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/codex_hook.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/company_identity.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/company_login.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/conflicts.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/coordinator.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/cost.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/cost_estimate.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/cull.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/__init__.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/app.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/auth.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/events.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/holds.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/peer.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/routes_org_permissions.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/schema.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/daemon/terminal.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/debuglog.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/demo.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/detect.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/doctor.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/entry.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/escapes.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/events.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/git.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/guardrails.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/history.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/identity_lock.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/inbox.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/kb.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/knowledge.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/launch_health.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/learned_rules.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/learning.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/legacy.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/local_setup.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/login_pause.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/mcp_server.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/model_access.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/model_availability.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/native/__init__.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/native/catalog.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/native/client.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/native/loop.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/native/lsp.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/native/permissions.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/native/serve.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/native/tools.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/opencode.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pane_auth.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/permission_asks.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/permission_routing.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/picker.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pipeline.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/plugins.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/policy.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pool.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/preflight.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pricing.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/__init__.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/_files.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/account.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/audit_chain.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/audit_export.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/auth.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/brief_learning.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/cost_centers.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/credentials.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/features.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/keys.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/learning.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/license.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/loopback.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/managed_models.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/org_profiles.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/orgkey.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/rollout.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/route_health.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/settings_sync.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/status.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/pro/team_events.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/procs.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/prompt_answer.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/provider_homes.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/quota.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/repo_cmds.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/repos.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/rewind.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/rule_checks.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/savings.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/scratch.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/secrets.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/self_serve.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/service/__init__.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/service/errors.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/service/routing.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/service/sessions.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/services.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/sessions.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/sidebar_follow.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/sidebar_logo.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/signin_pause.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/status_cache.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/tasks.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/updates.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/upgrade.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/usage.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/view.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/wake.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/watch.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/watch_costs.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/web/__init__.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/web/chat.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/web/dashboard.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/web/diff.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/web/server.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/web/static/app.js +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/web/static/index.html +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/worker_models.py +0 -0
- {brindle-0.5.2 → brindle-0.5.3}/src/brindle/workspaces.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: brindle
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: Run coding agents in parallel, each on its own git branch, with a supervisor that delegates, reviews, and merges
|
|
5
5
|
Project-URL: Homepage, https://pawdelta.com/brindle/
|
|
6
6
|
Project-URL: Documentation, https://pawdelta.com/brindle/docs/recommended-use
|
|
@@ -648,29 +648,39 @@ def _open_window(db: DB, agent: Agent, ws: Workspace, name: str, argv: list[str]
|
|
|
648
648
|
from brindle import inbox
|
|
649
649
|
|
|
650
650
|
argv = inbox.without_launcher_inbox(argv)
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
tag=(AGENT_TAG, agent.id),
|
|
656
|
-
keep=credentials,
|
|
657
|
-
**({"allow": allow} if allow is not None else {}),
|
|
658
|
-
**({"deny": deny} if deny else {}))
|
|
659
|
-
agent.__dict__.pop("_pane_environment", None)
|
|
660
|
-
# The pane id only means anything on the server that issued it (a
|
|
661
|
-
# resumed agent may come back on a different one), so record both.
|
|
662
|
-
server = tmux.current_server()
|
|
663
|
-
db.update_agent(agent.id, tmux_window=target, tmux_server=server)
|
|
664
|
-
agent.tmux_window, agent.tmux_server = target, server
|
|
665
|
-
if get_provider(agent.provider).startup_prompts and not agent.headless:
|
|
666
|
-
from brindle import prompt_answer
|
|
667
|
-
|
|
668
|
-
prompt_answer.launched(db, agent)
|
|
651
|
+
# The sidebar splits the window after the CLI's pane exists: hold the CLI
|
|
652
|
+
# until then, or a resumed chat drew its conversation at the full width
|
|
653
|
+
# and was resized under it, which Claude Code shows as a blank screen (#264).
|
|
654
|
+
gate = None
|
|
669
655
|
if watch_pane:
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
656
|
+
argv, gate = tmux.gated(argv)
|
|
657
|
+
tmux.ensure_session(ws.tmux_session, ws.path, workspaces.workspace_env(ws))
|
|
658
|
+
try:
|
|
659
|
+
env, credentials, allow, deny, org_env = _window_environment(agent, ws, m)
|
|
660
|
+
with secrets.org_key(org_env):
|
|
661
|
+
target = tmux.new_window(ws.tmux_session, name, ws.path, argv, env,
|
|
662
|
+
tag=(AGENT_TAG, agent.id),
|
|
663
|
+
keep=credentials,
|
|
664
|
+
**({"allow": allow} if allow is not None else {}),
|
|
665
|
+
**({"deny": deny} if deny else {}))
|
|
666
|
+
agent.__dict__.pop("_pane_environment", None)
|
|
667
|
+
# The pane id only means anything on the server that issued it (a
|
|
668
|
+
# resumed agent may come back on a different one), so record both.
|
|
669
|
+
server = tmux.current_server()
|
|
670
|
+
db.update_agent(agent.id, tmux_window=target, tmux_server=server)
|
|
671
|
+
agent.tmux_window, agent.tmux_server = target, server
|
|
672
|
+
if get_provider(agent.provider).startup_prompts and not agent.headless:
|
|
673
|
+
from brindle import prompt_answer
|
|
674
|
+
|
|
675
|
+
prompt_answer.launched(db, agent)
|
|
676
|
+
if watch_pane:
|
|
677
|
+
try:
|
|
678
|
+
_ensure_sidebar(db, root_of(db, agent.id), ws, target)
|
|
679
|
+
except Exception:
|
|
680
|
+
pass
|
|
681
|
+
finally:
|
|
682
|
+
if gate:
|
|
683
|
+
tmux.open_gate(gate)
|
|
674
684
|
tmux.apply_theme(ws.tmux_session)
|
|
675
685
|
return target
|
|
676
686
|
|
|
@@ -3462,7 +3472,7 @@ def _pre_tool_policy(db: DB, agent: Agent, ws: Workspace | None, payload: dict,
|
|
|
3462
3472
|
cfg = load_repo_config(ws.repo_root)
|
|
3463
3473
|
if cfg.permission_policy != "on":
|
|
3464
3474
|
return None
|
|
3465
|
-
req = permissions.from_claude(payload, worktree=ws.path, repo_root=ws.repo_root)
|
|
3475
|
+
req = permissions.from_claude(payload, worktree=ws.path, repo_root=ws.repo_root, agent=agent.id)
|
|
3466
3476
|
if req is None:
|
|
3467
3477
|
return None
|
|
3468
3478
|
try:
|
|
@@ -3546,7 +3556,7 @@ def permission_request_decision(db: DB, agent: Agent, payload: dict,
|
|
|
3546
3556
|
if provider == "codex":
|
|
3547
3557
|
# No tool_use_id in Codex's payload: nothing to pair an approval
|
|
3548
3558
|
# with, so nothing is kept for learning.
|
|
3549
|
-
reqs = permissions.from_codex(payload, worktree=ws.path, repo_root=ws.repo_root)
|
|
3559
|
+
reqs = permissions.from_codex(payload, worktree=ws.path, repo_root=ws.repo_root, agent=agent.id)
|
|
3550
3560
|
if not reqs:
|
|
3551
3561
|
return None
|
|
3552
3562
|
rules = [*permissions.all_rules(ws.repo_root), *profile_rules]
|
|
@@ -3629,7 +3639,7 @@ def permission_request_decision(db: DB, agent: Agent, payload: dict,
|
|
|
3629
3639
|
if provider == "opencode":
|
|
3630
3640
|
# Asked before every tool call, not only those OpenCode would prompt
|
|
3631
3641
|
# for, so only a deny is answered (and recorded): the rest is OpenCode's own.
|
|
3632
|
-
reqs = permissions.from_opencode(payload, worktree=ws.path, repo_root=ws.repo_root)
|
|
3642
|
+
reqs = permissions.from_opencode(payload, worktree=ws.path, repo_root=ws.repo_root, agent=agent.id)
|
|
3633
3643
|
if not reqs:
|
|
3634
3644
|
return None
|
|
3635
3645
|
rules = [*permissions.all_rules(ws.repo_root), *profile_rules]
|
|
@@ -3650,7 +3660,7 @@ def permission_request_decision(db: DB, agent: Agent, payload: dict,
|
|
|
3650
3660
|
_record_permission(db, agent, ws, req.summary(), f"deny: {decision.reason}")
|
|
3651
3661
|
_note_decision(db, agent, ws, req.kind, req.summary(), decision)
|
|
3652
3662
|
return {"decision": "deny", "reason": f"brindle: {decision.reason}"}
|
|
3653
|
-
req = permissions.from_claude(payload, worktree=ws.path, repo_root=ws.repo_root)
|
|
3663
|
+
req = permissions.from_claude(payload, worktree=ws.path, repo_root=ws.repo_root, agent=agent.id)
|
|
3654
3664
|
if req is None:
|
|
3655
3665
|
return None
|
|
3656
3666
|
if policy:
|
|
@@ -4000,6 +4010,13 @@ def _stop_decision(db: DB, agent: Agent, payload: dict, via_inbox: bool = False,
|
|
|
4000
4010
|
return None
|
|
4001
4011
|
|
|
4002
4012
|
|
|
4013
|
+
def _retest_keys(provider: str) -> None:
|
|
4014
|
+
"""An auth failure may mean a stored key was revoked: check the provider's stored keys again."""
|
|
4015
|
+
from brindle import keys_cmds
|
|
4016
|
+
|
|
4017
|
+
keys_cmds.retest_provider(provider)
|
|
4018
|
+
|
|
4019
|
+
|
|
4003
4020
|
def handle_hook(db: DB, agent_id: str, event: str, payload: dict) -> dict | None:
|
|
4004
4021
|
"""Called from ``brindle _hook <event>`` inside the agent's own process tree.
|
|
4005
4022
|
Returns JSON for Claude Code to read on stdout, or None."""
|
|
@@ -4233,6 +4250,7 @@ def handle_hook(db: DB, agent_id: str, event: str, payload: dict) -> dict | None
|
|
|
4233
4250
|
from brindle import providers, autopilot as pilot
|
|
4234
4251
|
if is_auth:
|
|
4235
4252
|
providers.invalidate_signed_in(agent.provider)
|
|
4253
|
+
_retest_keys(agent.provider)
|
|
4236
4254
|
err_desc = payload.get("error_details") or payload.get("error") or payload.get("error_type") or "401/403"
|
|
4237
4255
|
msg = (
|
|
4238
4256
|
f"[brindle] Agent {agent_id} encountered an authentication failure "
|
|
@@ -413,7 +413,7 @@ def pre_tool_decision(db, agent_id: str | None, payload: object, strict: bool =
|
|
|
413
413
|
cfg = load_repo_config(ws.repo_root)
|
|
414
414
|
if cfg.permission_policy != "on" and not strict:
|
|
415
415
|
return output(None)
|
|
416
|
-
req = permissions.from_agy(payload, worktree=ws.path, repo_root=ws.repo_root)
|
|
416
|
+
req = permissions.from_agy(payload, worktree=ws.path, repo_root=ws.repo_root, agent=agent.id)
|
|
417
417
|
rules = [*permissions.all_rules(ws.repo_root), *profile_rules_for(agent.profile, ws.repo_root)]
|
|
418
418
|
escalate = False
|
|
419
419
|
if strict:
|
|
@@ -191,6 +191,9 @@ def login_command(env: Mapping[str, str]) -> list[str] | None:
|
|
|
191
191
|
project = (full.get("GOOGLE_CLOUD_PROJECT") if full.get("BRINDLE_CLOUD_ROUTE") == "vertex"
|
|
192
192
|
else full.get("ANTHROPIC_VERTEX_PROJECT_ID"))
|
|
193
193
|
return ["gcloud", "auth", "application-default", "login", *(["--project", project] if project else [])]
|
|
194
|
+
if route == "foundry" and not (full.get("ANTHROPIC_FOUNDRY_API_KEY") or full.get("AZURE_FEDERATED_TOKEN_FILE")):
|
|
195
|
+
# Claude on Foundry signs in with the Azure CLI's login (in AZURE_CONFIG_DIR).
|
|
196
|
+
return azure_login_command(full)
|
|
194
197
|
if route == "azure":
|
|
195
198
|
from brindle import opencode
|
|
196
199
|
|
|
@@ -217,30 +220,40 @@ def interactive_sign_in(*, env: Mapping[str, str] | None = None, run=None, probe
|
|
|
217
220
|
The child also holds the lock, so losing the wrapper cannot permit another
|
|
218
221
|
login while the cloud CLI still runs. An existing login is left alone.
|
|
219
222
|
"""
|
|
223
|
+
return requested_sign_in(env=env, run=run, probe=probe)[1]
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def requested_sign_in(*, env: Mapping[str, str] | None = None, run=None, probe=None,
|
|
227
|
+
say=print) -> tuple[str, int]:
|
|
228
|
+
"""The sign-in the person asked for, a first one or a renewal: ``(outcome,
|
|
229
|
+
exit code)``, outcome "signed in", "failed", "waiting" (one is already
|
|
230
|
+
running for this login) or "manual" (another system owns this identity).
|
|
231
|
+
``run(argv, env=, pass_fds=)`` runs the cloud CLI, holding the lock."""
|
|
220
232
|
full = {**os.environ, **(env or {})}
|
|
221
233
|
command = login_command(full)
|
|
222
234
|
lg = _login(None, full, None)
|
|
223
235
|
if command is None or lg is None:
|
|
224
|
-
|
|
225
|
-
return 1
|
|
236
|
+
say("Refresh this identity's configured credentials directly.")
|
|
237
|
+
return "manual", 1
|
|
226
238
|
lg.lock.parent.mkdir(parents=True, exist_ok=True)
|
|
227
239
|
fd = os.open(lg.lock, os.O_RDWR | os.O_CREAT, 0o600)
|
|
228
240
|
try:
|
|
229
241
|
if not _locked(fd):
|
|
230
|
-
|
|
231
|
-
return 1
|
|
242
|
+
say("A cloud sign-in is already running. Finish it in its existing browser or terminal.")
|
|
243
|
+
return "waiting", 1
|
|
232
244
|
lg.write({"lapse": lg.fingerprint(), "opened_at": time.time(), "interactive": True})
|
|
233
245
|
if lg.provider == "azure":
|
|
234
246
|
s = status("azure", env=full, run=probe or run_bounded)
|
|
235
247
|
if not s.ok:
|
|
236
248
|
code = (run or subprocess.run)(azure_login_command(full), env=full, pass_fds=(fd,)).returncode
|
|
237
249
|
if code:
|
|
238
|
-
return code
|
|
250
|
+
return "failed", code
|
|
239
251
|
s = status("azure", env=full, run=probe or run_bounded)
|
|
240
252
|
if not s.ok:
|
|
241
|
-
|
|
242
|
-
return 1
|
|
243
|
-
|
|
253
|
+
say(s.note)
|
|
254
|
+
return "failed", 1
|
|
255
|
+
code = (run or subprocess.run)(command, env=full, pass_fds=(fd,)).returncode
|
|
256
|
+
return ("failed" if code else "signed in"), code
|
|
244
257
|
finally:
|
|
245
258
|
os.close(fd)
|
|
246
259
|
|
|
@@ -195,9 +195,6 @@ class RepoConfig:
|
|
|
195
195
|
local_models: bool = True
|
|
196
196
|
delete_merged_branches: bool = True # removing a worktree deletes its branch once fully merged into its base
|
|
197
197
|
pr_footer: bool = True # `brindle pr` ends the PR body with one "built with brindle" line
|
|
198
|
-
# Open a session's PR on its own once it is ready (never where the org's policy
|
|
199
|
-
# requires a human review; see brindle.daemon.session_review.auto_pr).
|
|
200
|
-
auto_pr: bool = False
|
|
201
198
|
sidebar: str = "left" # where the dashboard sits: "left" of the chat or "bottom"
|
|
202
199
|
# Standing rules for the supervisor ("fix review findings without asking", ...):
|
|
203
200
|
# ~/.brindle/config.json's, then the repo's, then config.local.json's, all kept.
|
|
@@ -386,7 +383,7 @@ def load_repo_config(repo_root: str | Path, *, user_only: bool = False, branch:
|
|
|
386
383
|
"check_concurrency",
|
|
387
384
|
"usage_limit", "pool_size", "graphify", "graphify_auto_refresh", "stale_after", "pipeline",
|
|
388
385
|
"review_rounds", "review_start_delay", "fable_escalation", "goal_audit", "overlap", "coordinator", "local_models", "merge_into",
|
|
389
|
-
"auto_merge_default_branch", "delete_merged_branches", "delegation", "max_weight", "sidebar", "pr_footer", "
|
|
386
|
+
"auto_merge_default_branch", "delete_merged_branches", "delegation", "max_weight", "sidebar", "pr_footer", "plan_first", "learning",
|
|
390
387
|
"learning_candidates", "limit_cooldown_minutes", "message_delivery", "permission_policy",
|
|
391
388
|
"permission_hold_seconds", "permission_supervisor_hold_seconds", "agy_approvals",
|
|
392
389
|
"learned_rules_repeats", "learned_rules_profile", "exclude_providers",
|
|
@@ -500,6 +497,13 @@ _USER_WRITE = threading.Lock()
|
|
|
500
497
|
|
|
501
498
|
def set_user(key: str, value: object) -> Path:
|
|
502
499
|
"""Set one key in ``~/.brindle/config.json`` (other keys are kept)."""
|
|
500
|
+
return update_user(key, lambda _: value)
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
def update_user(key: str, change) -> Path:
|
|
504
|
+
"""Set one key in ``~/.brindle/config.json`` to ``change(its value now)``,
|
|
505
|
+
read and written under the one writer lock, so a change to part of a
|
|
506
|
+
nested setting never loses another made at the same time."""
|
|
503
507
|
path = user_config_path()
|
|
504
508
|
if os.environ.get("BRINDLE_AGENT_ID"):
|
|
505
509
|
# A brindle agent's CLI call must not change the person's own settings.
|
|
@@ -508,7 +512,7 @@ def set_user(key: str, value: object) -> Path:
|
|
|
508
512
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
509
513
|
with _USER_WRITE: # daemon actions run in threads: one read-modify-replace at a time
|
|
510
514
|
data = _read_json(path)
|
|
511
|
-
data[key] =
|
|
515
|
+
data[key] = change(data.get(key))
|
|
512
516
|
# A unique temp file replaced into place, so a reader never sees half a file.
|
|
513
517
|
fd, tmp = tempfile.mkstemp(dir=path.parent, prefix=path.name + ".", suffix=".tmp")
|
|
514
518
|
try:
|