agent-relay 1.1.0 → 1.2.3
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.
- package/.gitattributes +3 -0
- package/.nvmrc +1 -0
- package/.trajectories/completed/2026-01/traj_1dviorhnkcb5.json +65 -0
- package/.trajectories/completed/2026-01/traj_1dviorhnkcb5.md +37 -0
- package/.trajectories/completed/2026-01/traj_1k5if5snst2e.json +65 -0
- package/.trajectories/completed/2026-01/traj_1k5if5snst2e.md +37 -0
- package/.trajectories/completed/2026-01/traj_1rp3rges5811.json +49 -0
- package/.trajectories/completed/2026-01/traj_1rp3rges5811.md +31 -0
- package/.trajectories/completed/2026-01/traj_22bhyulruouw.json +113 -0
- package/.trajectories/completed/2026-01/traj_22bhyulruouw.md +57 -0
- package/.trajectories/completed/2026-01/traj_2dao7ddgnta0.json +53 -0
- package/.trajectories/completed/2026-01/traj_2dao7ddgnta0.md +32 -0
- package/.trajectories/completed/2026-01/traj_3t0440mjeunc.json +26 -0
- package/.trajectories/completed/2026-01/traj_3t0440mjeunc.md +6 -0
- package/.trajectories/completed/2026-01/traj_45x9494d9xnr.json +47 -0
- package/.trajectories/completed/2026-01/traj_45x9494d9xnr.md +32 -0
- package/.trajectories/completed/2026-01/traj_4aa0bb77s4nh.json +53 -0
- package/.trajectories/completed/2026-01/traj_4aa0bb77s4nh.md +32 -0
- package/.trajectories/completed/2026-01/traj_5lhmzq8rxpqv.json +59 -0
- package/.trajectories/completed/2026-01/traj_5lhmzq8rxpqv.md +33 -0
- package/.trajectories/completed/2026-01/traj_5vr4e9erb1fs.json +53 -0
- package/.trajectories/completed/2026-01/traj_5vr4e9erb1fs.md +32 -0
- package/.trajectories/completed/2026-01/traj_6fgiwdoklvym.json +48 -0
- package/.trajectories/completed/2026-01/traj_6fgiwdoklvym.md +24 -0
- package/.trajectories/completed/2026-01/traj_7ludwvz45veh.json +209 -0
- package/.trajectories/completed/2026-01/traj_7ludwvz45veh.md +97 -0
- package/.trajectories/completed/2026-01/traj_9921cuhel0pj.json +48 -0
- package/.trajectories/completed/2026-01/traj_9921cuhel0pj.md +24 -0
- package/.trajectories/completed/2026-01/traj_ajs7zqfux4wc.json +49 -0
- package/.trajectories/completed/2026-01/traj_ajs7zqfux4wc.md +23 -0
- package/.trajectories/completed/2026-01/traj_cvtqhlwcq9s0.json +53 -0
- package/.trajectories/completed/2026-01/traj_cvtqhlwcq9s0.md +32 -0
- package/.trajectories/completed/2026-01/traj_cxofprm2m2en.json +49 -0
- package/.trajectories/completed/2026-01/traj_cxofprm2m2en.md +31 -0
- package/.trajectories/completed/2026-01/traj_d2hhz3k0vrhn.json +26 -0
- package/.trajectories/completed/2026-01/traj_d2hhz3k0vrhn.md +6 -0
- package/.trajectories/completed/2026-01/traj_dfuvww9pege5.json +59 -0
- package/.trajectories/completed/2026-01/traj_dfuvww9pege5.md +37 -0
- package/.trajectories/completed/2026-01/traj_g0fisy9h51mf.json +77 -0
- package/.trajectories/completed/2026-01/traj_g0fisy9h51mf.md +42 -0
- package/.trajectories/completed/2026-01/traj_gjdre5voouod.json +53 -0
- package/.trajectories/completed/2026-01/traj_gjdre5voouod.md +32 -0
- package/.trajectories/completed/2026-01/traj_gtlyqtta3x8l.json +25 -0
- package/.trajectories/completed/2026-01/traj_gtlyqtta3x8l.md +15 -0
- package/.trajectories/completed/2026-01/traj_h4xijiuip3w4.json +101 -0
- package/.trajectories/completed/2026-01/traj_h4xijiuip3w4.md +44 -0
- package/.trajectories/completed/2026-01/traj_hhxte7w4gjjx.json +22 -0
- package/.trajectories/completed/2026-01/traj_hhxte7w4gjjx.md +5 -0
- package/.trajectories/completed/2026-01/traj_hpungyhoj6v5.json +53 -0
- package/.trajectories/completed/2026-01/traj_hpungyhoj6v5.md +32 -0
- package/.trajectories/completed/2026-01/traj_m2xkjv0w2sq7.json +25 -0
- package/.trajectories/completed/2026-01/traj_m2xkjv0w2sq7.md +15 -0
- package/.trajectories/completed/2026-01/traj_noq5zbvnrdvz.json +53 -0
- package/.trajectories/completed/2026-01/traj_noq5zbvnrdvz.md +32 -0
- package/.trajectories/completed/2026-01/traj_ntbs6ppopf46.json +53 -0
- package/.trajectories/completed/2026-01/traj_ntbs6ppopf46.md +32 -0
- package/.trajectories/completed/2026-01/traj_ozd98si6a7ns.json +48 -0
- package/.trajectories/completed/2026-01/traj_ozd98si6a7ns.md +24 -0
- package/.trajectories/completed/2026-01/traj_prdza7a5cxp5.json +53 -0
- package/.trajectories/completed/2026-01/traj_prdza7a5cxp5.md +32 -0
- package/.trajectories/completed/2026-01/traj_qb3twvvywfwi.json +77 -0
- package/.trajectories/completed/2026-01/traj_qb3twvvywfwi.md +42 -0
- package/.trajectories/completed/2026-01/traj_qft54mi7nfor.json +53 -0
- package/.trajectories/completed/2026-01/traj_qft54mi7nfor.md +32 -0
- package/.trajectories/completed/2026-01/traj_qx9uhf8whhxo.json +83 -0
- package/.trajectories/completed/2026-01/traj_qx9uhf8whhxo.md +47 -0
- package/.trajectories/completed/2026-01/traj_rd9toccj18a0.json +59 -0
- package/.trajectories/completed/2026-01/traj_rd9toccj18a0.md +37 -0
- package/.trajectories/completed/2026-01/traj_rt4fiw3ecp50.json +48 -0
- package/.trajectories/completed/2026-01/traj_rt4fiw3ecp50.md +16 -0
- package/.trajectories/completed/2026-01/traj_st8j35b0hrlc.json +59 -0
- package/.trajectories/completed/2026-01/traj_st8j35b0hrlc.md +37 -0
- package/.trajectories/completed/2026-01/traj_t1yy8m7hbuxp.json +53 -0
- package/.trajectories/completed/2026-01/traj_t1yy8m7hbuxp.md +32 -0
- package/.trajectories/completed/2026-01/traj_tmux_orchestrator_analysis.json +84 -0
- package/.trajectories/completed/2026-01/traj_tmux_orchestrator_analysis.md +109 -0
- package/.trajectories/completed/2026-01/traj_u9n9eqasw16k.json +53 -0
- package/.trajectories/completed/2026-01/traj_u9n9eqasw16k.md +32 -0
- package/.trajectories/completed/2026-01/traj_v87hypnongqx.json +71 -0
- package/.trajectories/completed/2026-01/traj_v87hypnongqx.md +42 -0
- package/.trajectories/completed/2026-01/traj_wkp2fgzdyinb.json +53 -0
- package/.trajectories/completed/2026-01/traj_wkp2fgzdyinb.md +32 -0
- package/.trajectories/completed/2026-01/traj_x14t8w8rn7xg.json +20 -0
- package/.trajectories/completed/2026-01/traj_x14t8w8rn7xg.md +6 -0
- package/.trajectories/completed/2026-01/traj_xnwbznkvv8ua.json +175 -0
- package/.trajectories/completed/2026-01/traj_xnwbznkvv8ua.md +82 -0
- package/.trajectories/completed/2026-01/traj_ysjc8zaeqtd3.json +47 -0
- package/.trajectories/completed/2026-01/traj_ysjc8zaeqtd3.md +32 -0
- package/.trajectories/completed/2026-01/traj_yvdadtvdgnz3.json +59 -0
- package/.trajectories/completed/2026-01/traj_yvdadtvdgnz3.md +37 -0
- package/.trajectories/completed/2026-01/traj_z0vcw1wrzide.json +53 -0
- package/.trajectories/completed/2026-01/traj_z0vcw1wrzide.md +32 -0
- package/.trajectories/index.json +314 -0
- package/ARCHITECTURE.md +1245 -0
- package/README.md +1 -1
- package/TESTING.md +278 -0
- package/deploy/init-db.sql +5 -0
- package/deploy/scripts/setup-fly-workspaces.sh +69 -0
- package/deploy/scripts/setup-railway.sh +75 -0
- package/deploy/workspace/entrypoint-browser.sh +118 -0
- package/deploy/workspace/entrypoint.sh +348 -0
- package/deploy/workspace/git-credential-relay +111 -0
- package/dist/bridge/spawner.d.ts +53 -0
- package/dist/bridge/spawner.js +203 -19
- package/dist/bridge/types.d.ts +12 -0
- package/dist/cli/index.js +618 -5
- package/dist/cloud/api/auth.d.ts +3 -2
- package/dist/cloud/api/auth.js +10 -98
- package/dist/cloud/api/billing.js +30 -9
- package/dist/cloud/api/cli-pty-runner.d.ts +54 -0
- package/dist/cloud/api/cli-pty-runner.js +119 -0
- package/dist/cloud/api/codex-auth-helper.d.ts +15 -0
- package/dist/cloud/api/codex-auth-helper.js +100 -0
- package/dist/cloud/api/generic-webhooks.d.ts +8 -0
- package/dist/cloud/api/generic-webhooks.js +129 -0
- package/dist/cloud/api/git.d.ts +8 -0
- package/dist/cloud/api/git.js +152 -0
- package/dist/cloud/api/github-app.d.ts +11 -0
- package/dist/cloud/api/github-app.js +189 -0
- package/dist/cloud/api/middleware/planLimits.d.ts +7 -0
- package/dist/cloud/api/middleware/planLimits.js +39 -1
- package/dist/cloud/api/monitoring.d.ts +11 -0
- package/dist/cloud/api/monitoring.js +578 -0
- package/dist/cloud/api/nango-auth.d.ts +9 -0
- package/dist/cloud/api/nango-auth.js +377 -0
- package/dist/cloud/api/onboarding.d.ts +8 -1
- package/dist/cloud/api/onboarding.js +313 -119
- package/dist/cloud/api/policy.d.ts +8 -0
- package/dist/cloud/api/policy.js +229 -0
- package/dist/cloud/api/providers.js +114 -42
- package/dist/cloud/api/repos.d.ts +1 -0
- package/dist/cloud/api/repos.js +186 -0
- package/dist/cloud/api/test-helpers.d.ts +10 -0
- package/dist/cloud/api/test-helpers.js +575 -0
- package/dist/cloud/api/webhooks.d.ts +8 -0
- package/dist/cloud/api/webhooks.js +645 -0
- package/dist/cloud/api/workspaces.js +320 -12
- package/dist/cloud/billing/plans.js +32 -19
- package/dist/cloud/billing/types.d.ts +9 -3
- package/dist/cloud/config.d.ts +9 -2
- package/dist/cloud/config.js +13 -4
- package/dist/cloud/db/drizzle.d.ts +84 -1
- package/dist/cloud/db/drizzle.js +470 -0
- package/dist/cloud/db/index.d.ts +9 -4
- package/dist/cloud/db/index.js +11 -3
- package/dist/cloud/db/schema.d.ts +3283 -556
- package/dist/cloud/db/schema.js +314 -1
- package/dist/cloud/index.d.ts +1 -0
- package/dist/cloud/index.js +2 -0
- package/dist/cloud/provisioner/index.d.ts +56 -0
- package/dist/cloud/provisioner/index.js +676 -34
- package/dist/cloud/server.d.ts +1 -0
- package/dist/cloud/server.js +362 -13
- package/dist/cloud/services/auto-scaler.d.ts +152 -0
- package/dist/cloud/services/auto-scaler.js +439 -0
- package/dist/cloud/services/capacity-manager.d.ts +148 -0
- package/dist/cloud/services/capacity-manager.js +449 -0
- package/dist/cloud/services/ci-agent-spawner.d.ts +49 -0
- package/dist/cloud/services/ci-agent-spawner.js +373 -0
- package/dist/cloud/services/index.d.ts +12 -0
- package/dist/cloud/services/index.js +15 -0
- package/dist/cloud/services/mention-handler.d.ts +65 -0
- package/dist/cloud/services/mention-handler.js +405 -0
- package/dist/cloud/services/nango.d.ts +186 -0
- package/dist/cloud/services/nango.js +344 -0
- package/dist/cloud/services/persistence.d.ts +131 -0
- package/dist/cloud/services/persistence.js +200 -0
- package/dist/cloud/services/planLimits.d.ts +37 -0
- package/dist/cloud/services/planLimits.js +86 -5
- package/dist/cloud/services/scaling-orchestrator.d.ts +159 -0
- package/dist/cloud/services/scaling-orchestrator.js +502 -0
- package/dist/cloud/services/scaling-policy.d.ts +121 -0
- package/dist/cloud/services/scaling-policy.js +415 -0
- package/dist/cloud/vault/index.js +1 -1
- package/dist/cloud/webhooks/index.d.ts +24 -0
- package/dist/cloud/webhooks/index.js +29 -0
- package/dist/cloud/webhooks/parsers/github.d.ts +8 -0
- package/dist/cloud/webhooks/parsers/github.js +234 -0
- package/dist/cloud/webhooks/parsers/index.d.ts +23 -0
- package/dist/cloud/webhooks/parsers/index.js +30 -0
- package/dist/cloud/webhooks/parsers/linear.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/linear.js +258 -0
- package/dist/cloud/webhooks/parsers/slack.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/slack.js +214 -0
- package/dist/cloud/webhooks/responders/github.d.ts +8 -0
- package/dist/cloud/webhooks/responders/github.js +73 -0
- package/dist/cloud/webhooks/responders/index.d.ts +23 -0
- package/dist/cloud/webhooks/responders/index.js +30 -0
- package/dist/cloud/webhooks/responders/linear.d.ts +9 -0
- package/dist/cloud/webhooks/responders/linear.js +149 -0
- package/dist/cloud/webhooks/responders/slack.d.ts +20 -0
- package/dist/cloud/webhooks/responders/slack.js +178 -0
- package/dist/cloud/webhooks/router.d.ts +25 -0
- package/dist/cloud/webhooks/router.js +504 -0
- package/dist/cloud/webhooks/rules-engine.d.ts +24 -0
- package/dist/cloud/webhooks/rules-engine.js +287 -0
- package/dist/cloud/webhooks/types.d.ts +186 -0
- package/dist/cloud/webhooks/types.js +8 -0
- package/dist/continuity/formatter.d.ts +51 -0
- package/dist/continuity/formatter.js +313 -0
- package/dist/continuity/handoff-store.d.ts +67 -0
- package/dist/continuity/handoff-store.js +472 -0
- package/dist/continuity/index.d.ts +45 -0
- package/dist/continuity/index.js +48 -0
- package/dist/continuity/ledger-store.d.ts +110 -0
- package/dist/continuity/ledger-store.js +500 -0
- package/dist/continuity/manager.d.ts +178 -0
- package/dist/continuity/manager.js +562 -0
- package/dist/continuity/parser.d.ts +76 -0
- package/dist/continuity/parser.js +579 -0
- package/dist/continuity/types.d.ts +180 -0
- package/dist/continuity/types.js +9 -0
- package/dist/daemon/agent-manager.d.ts +27 -0
- package/dist/daemon/agent-manager.js +107 -6
- package/dist/daemon/agent-registry.d.ts +32 -0
- package/dist/daemon/agent-registry.js +42 -2
- package/dist/daemon/api.d.ts +12 -0
- package/dist/daemon/api.js +131 -2
- package/dist/daemon/cli-auth.d.ts +67 -0
- package/dist/daemon/cli-auth.js +537 -0
- package/dist/daemon/cloud-sync.js +9 -7
- package/dist/daemon/orchestrator.js +30 -0
- package/dist/daemon/router.d.ts +5 -0
- package/dist/daemon/router.js +78 -26
- package/dist/daemon/server.d.ts +5 -0
- package/dist/daemon/server.js +9 -1
- package/dist/daemon/services/browser-testing.d.ts +88 -0
- package/dist/daemon/services/browser-testing.js +244 -0
- package/dist/daemon/services/container-spawner.d.ts +135 -0
- package/dist/daemon/services/container-spawner.js +313 -0
- package/dist/daemon/types.d.ts +5 -1
- package/dist/dashboard/out/404.html +1 -1
- package/dist/dashboard/out/_next/static/chunks/116-2502180def231162.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/282-980c2eb8fff20123.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/699-3b1cd6618a45d259.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/724-2dae7627550ab88f.js +9 -0
- package/dist/dashboard/out/_next/static/chunks/766-1f2dd8cb7f766b0b.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/onboarding/page-3fdfa60e53f2810d.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/page-e6381e5a6e1fbcfd.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-3538dfe0ffe984b8.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/history/{page-b6edd4dde8d08194.js → page-abb9ab2d329f56e9.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/app/layout-c0d118c0f92d969c.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/login/page-c22d080201cbd9fb.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-67a3e98d9a43a6ed.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/page-77e9c65420a06cfb.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-b08ed1c34d14434a.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-e88bc117ef7671c3.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/signup/page-68d34f50baa8ab6b.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +18 -0
- package/dist/dashboard/out/_next/static/chunks/{main-app-5d692157a8eb1fd9.js → main-app-6e8e8d3ef4e0192a.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/{main-c2f423b9c9f4591b.js → main-ed4e1fb6f29c34cf.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +1 -0
- package/dist/dashboard/out/_next/static/css/29852f26181969a0.css +1 -0
- package/dist/dashboard/out/_next/static/css/7c3ae9e8617d42a5.css +1 -0
- package/dist/dashboard/out/app/onboarding.html +1 -0
- package/dist/dashboard/out/app/onboarding.txt +7 -0
- package/dist/dashboard/out/app.html +1 -14
- package/dist/dashboard/out/app.txt +2 -2
- package/dist/dashboard/out/connect-repos.html +1 -0
- package/dist/dashboard/out/connect-repos.txt +7 -0
- package/dist/dashboard/out/history.html +1 -1
- package/dist/dashboard/out/history.txt +2 -2
- package/dist/dashboard/out/index.html +1 -1
- package/dist/dashboard/out/index.txt +2 -2
- package/dist/dashboard/out/login.html +6 -0
- package/dist/dashboard/out/login.txt +7 -0
- package/dist/dashboard/out/metrics.html +1 -1
- package/dist/dashboard/out/metrics.txt +2 -2
- package/dist/dashboard/out/pricing.html +3 -3
- package/dist/dashboard/out/pricing.txt +2 -2
- package/dist/dashboard/out/providers.html +1 -0
- package/dist/dashboard/out/providers.txt +7 -0
- package/dist/dashboard/out/signup.html +6 -0
- package/dist/dashboard/out/signup.txt +7 -0
- package/dist/dashboard-server/server.js +1308 -8
- package/dist/hooks/emitter.d.ts +40 -0
- package/dist/hooks/emitter.js +63 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/registry.d.ts +173 -0
- package/dist/hooks/registry.js +476 -0
- package/dist/hooks/trajectory-hooks.d.ts +52 -0
- package/dist/hooks/trajectory-hooks.js +183 -0
- package/dist/hooks/types.d.ts +141 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/memory/adapters/index.d.ts +8 -0
- package/dist/memory/adapters/index.js +8 -0
- package/dist/memory/adapters/inmemory.d.ts +59 -0
- package/dist/memory/adapters/inmemory.js +195 -0
- package/dist/memory/adapters/supermemory.d.ts +71 -0
- package/dist/memory/adapters/supermemory.js +338 -0
- package/dist/memory/factory.d.ts +48 -0
- package/dist/memory/factory.js +143 -0
- package/dist/memory/index.d.ts +32 -0
- package/dist/memory/index.js +32 -0
- package/dist/memory/memory-hooks.d.ts +60 -0
- package/dist/memory/memory-hooks.js +313 -0
- package/dist/memory/service.d.ts +49 -0
- package/dist/memory/service.js +146 -0
- package/dist/memory/types.d.ts +195 -0
- package/dist/memory/types.js +8 -0
- package/dist/policy/agent-policy.d.ts +225 -0
- package/dist/policy/agent-policy.js +665 -0
- package/dist/policy/cloud-policy-fetcher.d.ts +12 -0
- package/dist/policy/cloud-policy-fetcher.js +64 -0
- package/dist/resiliency/crash-insights.d.ts +156 -0
- package/dist/resiliency/crash-insights.js +492 -0
- package/dist/resiliency/gossip-health.d.ts +137 -0
- package/dist/resiliency/gossip-health.js +241 -0
- package/dist/resiliency/index.d.ts +5 -0
- package/dist/resiliency/index.js +5 -0
- package/dist/resiliency/leader-watchdog.d.ts +109 -0
- package/dist/resiliency/leader-watchdog.js +189 -0
- package/dist/resiliency/memory-monitor.d.ts +172 -0
- package/dist/resiliency/memory-monitor.js +593 -0
- package/dist/resiliency/stateless-lead.d.ts +149 -0
- package/dist/resiliency/stateless-lead.js +308 -0
- package/dist/resiliency/supervisor.d.ts +38 -0
- package/dist/resiliency/supervisor.js +122 -0
- package/dist/shared/cli-auth-config.d.ts +91 -0
- package/dist/shared/cli-auth-config.js +264 -0
- package/dist/storage/adapter.d.ts +1 -1
- package/dist/trajectory/config.d.ts +84 -0
- package/dist/trajectory/config.js +163 -0
- package/dist/trajectory/index.d.ts +8 -0
- package/dist/trajectory/index.js +8 -0
- package/dist/trajectory/integration.d.ts +292 -0
- package/dist/trajectory/integration.js +834 -0
- package/dist/utils/logger.js +1 -1
- package/dist/utils/project-namespace.d.ts +24 -0
- package/dist/utils/project-namespace.js +84 -0
- package/dist/wrapper/parser.d.ts +10 -0
- package/dist/wrapper/parser.js +100 -33
- package/dist/wrapper/pty-wrapper.d.ts +197 -16
- package/dist/wrapper/pty-wrapper.js +943 -106
- package/dist/wrapper/shared.d.ts +165 -0
- package/dist/wrapper/shared.js +270 -0
- package/dist/wrapper/tmux-wrapper.d.ts +73 -11
- package/dist/wrapper/tmux-wrapper.js +541 -120
- package/package.json +16 -16
- package/scripts/postinstall.js +60 -0
- package/test-push.txt +1 -0
- package/bin/tmux +0 -0
- package/dist/bridge/config.d.ts.map +0 -1
- package/dist/bridge/config.js.map +0 -1
- package/dist/bridge/index.d.ts.map +0 -1
- package/dist/bridge/index.js.map +0 -1
- package/dist/bridge/multi-project-client.d.ts.map +0 -1
- package/dist/bridge/multi-project-client.js.map +0 -1
- package/dist/bridge/shadow-cli.d.ts.map +0 -1
- package/dist/bridge/shadow-cli.js.map +0 -1
- package/dist/bridge/shadow-config.d.ts.map +0 -1
- package/dist/bridge/shadow-config.js.map +0 -1
- package/dist/bridge/spawner.d.ts.map +0 -1
- package/dist/bridge/spawner.js.map +0 -1
- package/dist/bridge/teams-config.d.ts.map +0 -1
- package/dist/bridge/teams-config.js.map +0 -1
- package/dist/bridge/types.d.ts.map +0 -1
- package/dist/bridge/types.js.map +0 -1
- package/dist/bridge/utils.d.ts.map +0 -1
- package/dist/bridge/utils.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/cloud/api/auth.d.ts.map +0 -1
- package/dist/cloud/api/auth.js.map +0 -1
- package/dist/cloud/api/billing.d.ts.map +0 -1
- package/dist/cloud/api/billing.js.map +0 -1
- package/dist/cloud/api/coordinators.d.ts.map +0 -1
- package/dist/cloud/api/coordinators.js.map +0 -1
- package/dist/cloud/api/daemons.d.ts.map +0 -1
- package/dist/cloud/api/daemons.js.map +0 -1
- package/dist/cloud/api/middleware/planLimits.d.ts.map +0 -1
- package/dist/cloud/api/middleware/planLimits.js.map +0 -1
- package/dist/cloud/api/onboarding.d.ts.map +0 -1
- package/dist/cloud/api/onboarding.js.map +0 -1
- package/dist/cloud/api/providers.d.ts.map +0 -1
- package/dist/cloud/api/providers.js.map +0 -1
- package/dist/cloud/api/repos.d.ts.map +0 -1
- package/dist/cloud/api/repos.js.map +0 -1
- package/dist/cloud/api/teams.d.ts.map +0 -1
- package/dist/cloud/api/teams.js.map +0 -1
- package/dist/cloud/api/usage.d.ts.map +0 -1
- package/dist/cloud/api/usage.js.map +0 -1
- package/dist/cloud/api/workspaces.d.ts.map +0 -1
- package/dist/cloud/api/workspaces.js.map +0 -1
- package/dist/cloud/billing/index.d.ts.map +0 -1
- package/dist/cloud/billing/index.js.map +0 -1
- package/dist/cloud/billing/plans.d.ts.map +0 -1
- package/dist/cloud/billing/plans.js.map +0 -1
- package/dist/cloud/billing/service.d.ts.map +0 -1
- package/dist/cloud/billing/service.js.map +0 -1
- package/dist/cloud/billing/types.d.ts.map +0 -1
- package/dist/cloud/billing/types.js.map +0 -1
- package/dist/cloud/config.d.ts.map +0 -1
- package/dist/cloud/config.js.map +0 -1
- package/dist/cloud/db/drizzle.d.ts.map +0 -1
- package/dist/cloud/db/drizzle.js.map +0 -1
- package/dist/cloud/db/index.d.ts.map +0 -1
- package/dist/cloud/db/index.js.map +0 -1
- package/dist/cloud/db/schema.d.ts.map +0 -1
- package/dist/cloud/db/schema.js.map +0 -1
- package/dist/cloud/index.d.ts.map +0 -1
- package/dist/cloud/index.js.map +0 -1
- package/dist/cloud/provisioner/index.d.ts.map +0 -1
- package/dist/cloud/provisioner/index.js.map +0 -1
- package/dist/cloud/server.d.ts.map +0 -1
- package/dist/cloud/server.js.map +0 -1
- package/dist/cloud/services/coordinator.d.ts.map +0 -1
- package/dist/cloud/services/coordinator.js.map +0 -1
- package/dist/cloud/services/planLimits.d.ts.map +0 -1
- package/dist/cloud/services/planLimits.js.map +0 -1
- package/dist/cloud/vault/index.d.ts.map +0 -1
- package/dist/cloud/vault/index.js.map +0 -1
- package/dist/daemon/agent-manager.d.ts.map +0 -1
- package/dist/daemon/agent-manager.js.map +0 -1
- package/dist/daemon/agent-registry.d.ts.map +0 -1
- package/dist/daemon/agent-registry.js.map +0 -1
- package/dist/daemon/api.d.ts.map +0 -1
- package/dist/daemon/api.js.map +0 -1
- package/dist/daemon/auth.d.ts.map +0 -1
- package/dist/daemon/auth.js.map +0 -1
- package/dist/daemon/cloud-sync.d.ts.map +0 -1
- package/dist/daemon/cloud-sync.js.map +0 -1
- package/dist/daemon/connection.d.ts.map +0 -1
- package/dist/daemon/connection.js.map +0 -1
- package/dist/daemon/index.d.ts.map +0 -1
- package/dist/daemon/index.js.map +0 -1
- package/dist/daemon/orchestrator.d.ts.map +0 -1
- package/dist/daemon/orchestrator.js.map +0 -1
- package/dist/daemon/registry.d.ts.map +0 -1
- package/dist/daemon/registry.js.map +0 -1
- package/dist/daemon/router.d.ts.map +0 -1
- package/dist/daemon/router.js.map +0 -1
- package/dist/daemon/server.d.ts.map +0 -1
- package/dist/daemon/server.js.map +0 -1
- package/dist/daemon/types.d.ts.map +0 -1
- package/dist/daemon/types.js.map +0 -1
- package/dist/daemon/workspace-manager.d.ts.map +0 -1
- package/dist/daemon/workspace-manager.js.map +0 -1
- package/dist/dashboard/out/_next/static/chunks/693-7b3301d8f6bc5014.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/713-f78477eb185f1f4d.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/766-e53e1cfe39b0b5b5.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/900-037c64bfd797fb2a.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/page-e3d9e1f4466b9bae.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/layout-2433bb48965f4333.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-e68825a81db67ba1.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/page-cc108bf68c8a657f.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-d80e03a5297f95b6.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/webpack-a5acc2831d094776.js +0 -1
- package/dist/dashboard/out/_next/static/css/79b80143647a07d7.css +0 -1
- package/dist/dashboard/out/_next/static/css/8cf277370ad48cfe.css +0 -1
- package/dist/dashboard-server/metrics.d.ts.map +0 -1
- package/dist/dashboard-server/metrics.js.map +0 -1
- package/dist/dashboard-server/needs-attention.d.ts.map +0 -1
- package/dist/dashboard-server/needs-attention.js.map +0 -1
- package/dist/dashboard-server/server.d.ts.map +0 -1
- package/dist/dashboard-server/server.js.map +0 -1
- package/dist/dashboard-server/start.d.ts.map +0 -1
- package/dist/dashboard-server/start.js.map +0 -1
- package/dist/hooks/inbox-check/hook.d.ts.map +0 -1
- package/dist/hooks/inbox-check/hook.js.map +0 -1
- package/dist/hooks/inbox-check/index.d.ts.map +0 -1
- package/dist/hooks/inbox-check/index.js.map +0 -1
- package/dist/hooks/inbox-check/types.d.ts.map +0 -1
- package/dist/hooks/inbox-check/types.js.map +0 -1
- package/dist/hooks/inbox-check/utils.d.ts.map +0 -1
- package/dist/hooks/inbox-check/utils.js.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/types.d.ts.map +0 -1
- package/dist/hooks/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/protocol/framing.d.ts.map +0 -1
- package/dist/protocol/framing.js.map +0 -1
- package/dist/protocol/index.d.ts.map +0 -1
- package/dist/protocol/index.js.map +0 -1
- package/dist/protocol/types.d.ts.map +0 -1
- package/dist/protocol/types.js.map +0 -1
- package/dist/resiliency/context-persistence.d.ts.map +0 -1
- package/dist/resiliency/context-persistence.js.map +0 -1
- package/dist/resiliency/health-monitor.d.ts.map +0 -1
- package/dist/resiliency/health-monitor.js.map +0 -1
- package/dist/resiliency/index.d.ts.map +0 -1
- package/dist/resiliency/index.js.map +0 -1
- package/dist/resiliency/logger.d.ts.map +0 -1
- package/dist/resiliency/logger.js.map +0 -1
- package/dist/resiliency/metrics.d.ts.map +0 -1
- package/dist/resiliency/metrics.js.map +0 -1
- package/dist/resiliency/provider-context.d.ts.map +0 -1
- package/dist/resiliency/provider-context.js.map +0 -1
- package/dist/resiliency/supervisor.d.ts.map +0 -1
- package/dist/resiliency/supervisor.js.map +0 -1
- package/dist/state/agent-state.d.ts.map +0 -1
- package/dist/state/agent-state.js.map +0 -1
- package/dist/storage/adapter.d.ts.map +0 -1
- package/dist/storage/adapter.js.map +0 -1
- package/dist/storage/sqlite-adapter.d.ts.map +0 -1
- package/dist/storage/sqlite-adapter.js.map +0 -1
- package/dist/utils/agent-config.d.ts.map +0 -1
- package/dist/utils/agent-config.js.map +0 -1
- package/dist/utils/command-resolver.d.ts.map +0 -1
- package/dist/utils/command-resolver.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/name-generator.d.ts.map +0 -1
- package/dist/utils/name-generator.js.map +0 -1
- package/dist/utils/project-namespace.d.ts.map +0 -1
- package/dist/utils/project-namespace.js.map +0 -1
- package/dist/utils/tmux-resolver.d.ts.map +0 -1
- package/dist/utils/tmux-resolver.js.map +0 -1
- package/dist/utils/update-checker.d.ts.map +0 -1
- package/dist/utils/update-checker.js.map +0 -1
- package/dist/wrapper/client.d.ts.map +0 -1
- package/dist/wrapper/client.js.map +0 -1
- package/dist/wrapper/inbox.d.ts.map +0 -1
- package/dist/wrapper/inbox.js.map +0 -1
- package/dist/wrapper/index.d.ts.map +0 -1
- package/dist/wrapper/index.js.map +0 -1
- package/dist/wrapper/parser.d.ts.map +0 -1
- package/dist/wrapper/parser.js.map +0 -1
- package/dist/wrapper/pty-wrapper.d.ts.map +0 -1
- package/dist/wrapper/pty-wrapper.js.map +0 -1
- package/dist/wrapper/tmux-wrapper.d.ts.map +0 -1
- package/dist/wrapper/tmux-wrapper.js.map +0 -1
- package/docs/AGENTS.md +0 -513
- package/docs/ARCHITECTURE_DECISIONS.md +0 -175
- package/docs/CHANGELOG.md +0 -11
- package/docs/CLI-SIMPLIFICATION-COMPLETE.md +0 -48
- package/docs/CLOUD-ARCHITECTURE.md +0 -652
- package/docs/CLOUD-ONBOARDING-DESIGN.md +0 -1983
- package/docs/COMPETITIVE_ANALYSIS.md +0 -897
- package/docs/CONTRIBUTING.md +0 -151
- package/docs/DESIGN_BRIDGE_STAFFING.md +0 -878
- package/docs/DESIGN_V2.md +0 -1079
- package/docs/INTEGRATION-GUIDE.md +0 -926
- package/docs/MONETIZATION.md +0 -1679
- package/docs/PROPOSAL-trajectories.md +0 -1582
- package/docs/PROTOCOL.md +0 -325
- package/docs/SCALING_ANALYSIS.md +0 -280
- package/docs/TESTING_PRESENCE_FEATURES.md +0 -327
- package/docs/TMUX_IMPLEMENTATION_NOTES.md +0 -364
- package/docs/TMUX_IMPROVEMENTS.md +0 -968
- package/docs/agent-relay-snippet.md +0 -168
- package/docs/competitive-analysis-mcp-agent-mail.md +0 -389
- package/docs/dashboard-v2-plan.md +0 -179
- package/docs/guides/CLOUD.md +0 -236
- package/docs/guides/LOCAL.md +0 -535
- package/docs/guides/SELF-HOSTED.md +0 -494
- package/docs/proposals/shadow-as-subagent.md +0 -765
- package/docs/proposals/slack-bot-integration.md +0 -1457
- package/docs/removable-code-analysis.md +0 -24
- package/scripts/dev/PUBLIC_RELEASE_PLAN.md +0 -88
- package/scripts/dev/dev-team-setup.sh +0 -431
- package/scripts/e2e-test.sh +0 -119
- package/scripts/games/game-protocol.md +0 -79
- package/scripts/games/hearts-setup.sh +0 -264
- package/scripts/tictactoe-setup.sh +0 -181
- /package/dist/dashboard/out/_next/static/chunks/{117-b2cd8d6485aacf2b.js → 117-f7b8ab0809342e77.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{648-8f3f26864ce515e5.js → 648-5cc6e1921389a58a.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/_not-found/{page-0b990dbb71d72a98.js → page-53b8a69f76db17d0.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{fd9d1056-bf46c09eb57e019c.js → fd9d1056-609918ca7b6280bb.js} +0 -0
- /package/dist/dashboard/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → wPgKJtcOmTFLpUncDg16A}/_buildManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → wPgKJtcOmTFLpUncDg16A}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared CLI Auth Configuration
|
|
3
|
+
*
|
|
4
|
+
* Provider-specific CLI commands and patterns for OAuth authentication.
|
|
5
|
+
* Used by both the cloud API and workspace daemon.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Interactive prompt handler configuration
|
|
9
|
+
* Defines patterns to detect prompts and responses to send
|
|
10
|
+
*/
|
|
11
|
+
export interface PromptHandler {
|
|
12
|
+
/** Pattern to detect in CLI output (case-insensitive) */
|
|
13
|
+
pattern: RegExp;
|
|
14
|
+
/** Response to send (e.g., '\r' for enter, 'y\r' for yes+enter) */
|
|
15
|
+
response: string;
|
|
16
|
+
/** Delay before sending response (ms) */
|
|
17
|
+
delay?: number;
|
|
18
|
+
/** Description for logging/debugging */
|
|
19
|
+
description: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* CLI auth configuration for each provider
|
|
23
|
+
*/
|
|
24
|
+
export interface CLIAuthConfig {
|
|
25
|
+
/** CLI command to run */
|
|
26
|
+
command: string;
|
|
27
|
+
/** Arguments to pass */
|
|
28
|
+
args: string[];
|
|
29
|
+
/** Alternative args for device flow (if supported) */
|
|
30
|
+
deviceFlowArgs?: string[];
|
|
31
|
+
/** Pattern to extract auth URL from output */
|
|
32
|
+
urlPattern: RegExp;
|
|
33
|
+
/** Path to credentials file (for reading after auth) */
|
|
34
|
+
credentialPath?: string;
|
|
35
|
+
/** Display name for UI */
|
|
36
|
+
displayName: string;
|
|
37
|
+
/** Interactive prompts to auto-respond to */
|
|
38
|
+
prompts: PromptHandler[];
|
|
39
|
+
/** Success indicators in output */
|
|
40
|
+
successPatterns: RegExp[];
|
|
41
|
+
/** How long to wait for URL to appear (ms) */
|
|
42
|
+
waitTimeout: number;
|
|
43
|
+
/** Whether this provider supports device flow */
|
|
44
|
+
supportsDeviceFlow?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* CLI commands and URL patterns for each provider
|
|
48
|
+
*
|
|
49
|
+
* Each CLI tool outputs an OAuth URL when run without credentials.
|
|
50
|
+
* We capture stdout/stderr and extract the URL using regex patterns.
|
|
51
|
+
*
|
|
52
|
+
* IMPORTANT: These CLIs are interactive - they output the auth URL then wait
|
|
53
|
+
* for the user to complete OAuth in their browser. We capture the URL and
|
|
54
|
+
* display it in a popup for the user.
|
|
55
|
+
*/
|
|
56
|
+
export declare const CLI_AUTH_CONFIG: Record<string, CLIAuthConfig>;
|
|
57
|
+
/**
|
|
58
|
+
* Strip ANSI escape codes from text
|
|
59
|
+
*/
|
|
60
|
+
export declare function stripAnsiCodes(text: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* Check if text matches any success pattern
|
|
63
|
+
*/
|
|
64
|
+
export declare function matchesSuccessPattern(text: string, patterns: RegExp[]): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Find matching prompt handler that hasn't been responded to yet
|
|
67
|
+
*/
|
|
68
|
+
export declare function findMatchingPrompt(text: string, prompts: PromptHandler[], respondedPrompts: Set<string>): PromptHandler | null;
|
|
69
|
+
/**
|
|
70
|
+
* Get list of supported provider IDs
|
|
71
|
+
*/
|
|
72
|
+
export declare function getSupportedProviderIds(): string[];
|
|
73
|
+
/**
|
|
74
|
+
* Get list of supported providers with details
|
|
75
|
+
*/
|
|
76
|
+
export declare function getSupportedProviders(): {
|
|
77
|
+
id: string;
|
|
78
|
+
displayName: string;
|
|
79
|
+
command: string;
|
|
80
|
+
}[];
|
|
81
|
+
/**
|
|
82
|
+
* Validate a provider's CLI auth configuration
|
|
83
|
+
* Returns null if valid, or an error message if invalid
|
|
84
|
+
*/
|
|
85
|
+
export declare function validateProviderConfig(providerId: string, config: CLIAuthConfig): string | null;
|
|
86
|
+
/**
|
|
87
|
+
* Validate all provider configurations
|
|
88
|
+
* Returns array of error messages (empty if all valid)
|
|
89
|
+
*/
|
|
90
|
+
export declare function validateAllProviderConfigs(): string[];
|
|
91
|
+
//# sourceMappingURL=cli-auth-config.d.ts.map
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared CLI Auth Configuration
|
|
3
|
+
*
|
|
4
|
+
* Provider-specific CLI commands and patterns for OAuth authentication.
|
|
5
|
+
* Used by both the cloud API and workspace daemon.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* CLI commands and URL patterns for each provider
|
|
9
|
+
*
|
|
10
|
+
* Each CLI tool outputs an OAuth URL when run without credentials.
|
|
11
|
+
* We capture stdout/stderr and extract the URL using regex patterns.
|
|
12
|
+
*
|
|
13
|
+
* IMPORTANT: These CLIs are interactive - they output the auth URL then wait
|
|
14
|
+
* for the user to complete OAuth in their browser. We capture the URL and
|
|
15
|
+
* display it in a popup for the user.
|
|
16
|
+
*/
|
|
17
|
+
export const CLI_AUTH_CONFIG = {
|
|
18
|
+
anthropic: {
|
|
19
|
+
command: 'claude',
|
|
20
|
+
args: [],
|
|
21
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
22
|
+
credentialPath: '~/.claude/.credentials.json',
|
|
23
|
+
displayName: 'Claude',
|
|
24
|
+
waitTimeout: 30000, // Claude can take a while to show the auth URL
|
|
25
|
+
prompts: [
|
|
26
|
+
{
|
|
27
|
+
// Claude Code version selection - accept default (recommended)
|
|
28
|
+
pattern: /which\s*version|claude\s*code\s*version|select.*version/i,
|
|
29
|
+
response: '\r',
|
|
30
|
+
delay: 100,
|
|
31
|
+
description: 'Version selection prompt',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
pattern: /dark\s*(mode|theme)/i,
|
|
35
|
+
response: '\r', // Press enter to accept default
|
|
36
|
+
delay: 100,
|
|
37
|
+
description: 'Dark mode prompt',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
// Login method selection - "Select login method:" with Claude account or Console options
|
|
41
|
+
pattern: /select\s*login\s*method|how\s*would\s*you\s*like\s*to\s*authenticate|choose.*auth.*method|select.*auth|subscription\s*or.*api\s*key/i,
|
|
42
|
+
response: '\r', // Press enter for first option (Claude account with subscription)
|
|
43
|
+
delay: 100,
|
|
44
|
+
description: 'Login method selection',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
// Login success - press enter to continue
|
|
48
|
+
pattern: /login\s*successful|logged\s*in.*press\s*enter|press\s*enter\s*to\s*continue/i,
|
|
49
|
+
response: '\r',
|
|
50
|
+
delay: 200,
|
|
51
|
+
description: 'Login success prompt',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
// Trust directory - matches various trust prompts including:
|
|
55
|
+
// "Quick safety check: Is this a project you created or one you trust?"
|
|
56
|
+
// "Yes, I trust this folder"
|
|
57
|
+
// "Do you trust the files in this folder?"
|
|
58
|
+
pattern: /trust\s*(this|the)?\s*(files|directory|folder|workspace)|do\s*you\s*trust|safety\s*check|yes,?\s*i\s*trust/i,
|
|
59
|
+
response: '\r', // Press enter for first option (Yes, proceed)
|
|
60
|
+
delay: 300, // Slightly longer delay for menu to render
|
|
61
|
+
description: 'Trust directory prompt',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
// "Ready to code here?" permission prompt - asks for file access permission
|
|
65
|
+
// Shows "Yes, continue" / "No, exit" options with "Enter to confirm"
|
|
66
|
+
// This is different from trust directory - it's about granting file permissions
|
|
67
|
+
pattern: /ready\s*to\s*code\s*here|permission\s*to\s*work\s*with\s*your\s*files|yes,?\s*continue/i,
|
|
68
|
+
response: '\r', // Press enter to accept "Yes, continue" (already selected)
|
|
69
|
+
delay: 300,
|
|
70
|
+
description: 'Ready to code permission prompt',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
// Fallback: Any "press enter" or "enter to confirm/continue" prompt
|
|
74
|
+
// Keep this LAST so more specific handlers match first
|
|
75
|
+
pattern: /press\s*enter|enter\s*to\s*(confirm|continue|proceed)|hit\s*enter/i,
|
|
76
|
+
response: '\r',
|
|
77
|
+
delay: 300,
|
|
78
|
+
description: 'Generic enter prompt',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i, /you.*(?:are|now).*logged/i],
|
|
82
|
+
},
|
|
83
|
+
openai: {
|
|
84
|
+
command: 'codex',
|
|
85
|
+
args: ['login'], // Standard OAuth flow
|
|
86
|
+
deviceFlowArgs: ['login', '--device-auth'], // Device auth for headless/container environments
|
|
87
|
+
supportsDeviceFlow: true,
|
|
88
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
89
|
+
credentialPath: '~/.codex/auth.json',
|
|
90
|
+
displayName: 'Codex',
|
|
91
|
+
waitTimeout: 30000,
|
|
92
|
+
prompts: [
|
|
93
|
+
{
|
|
94
|
+
pattern: /trust\s*(this|the)\s*(directory|folder|workspace)/i,
|
|
95
|
+
response: 'y\r',
|
|
96
|
+
delay: 100,
|
|
97
|
+
description: 'Trust directory prompt',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i],
|
|
101
|
+
},
|
|
102
|
+
google: {
|
|
103
|
+
command: 'gemini',
|
|
104
|
+
args: [],
|
|
105
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
106
|
+
displayName: 'Gemini',
|
|
107
|
+
waitTimeout: 30000,
|
|
108
|
+
prompts: [
|
|
109
|
+
{
|
|
110
|
+
pattern: /login\s*with\s*google|google\s*account|choose.*auth/i,
|
|
111
|
+
response: '\r', // Select first option (Login with Google)
|
|
112
|
+
delay: 200,
|
|
113
|
+
description: 'Auth method selection',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i],
|
|
117
|
+
},
|
|
118
|
+
opencode: {
|
|
119
|
+
command: 'opencode',
|
|
120
|
+
args: ['auth', 'login'],
|
|
121
|
+
// OpenCode redirects to provider OAuth pages (Anthropic, OpenAI, Google)
|
|
122
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
123
|
+
credentialPath: '~/.local/share/opencode/auth.json',
|
|
124
|
+
displayName: 'OpenCode',
|
|
125
|
+
waitTimeout: 30000,
|
|
126
|
+
prompts: [
|
|
127
|
+
{
|
|
128
|
+
pattern: /select.*provider|choose.*provider|which.*provider/i,
|
|
129
|
+
response: '\r', // Select first provider (OpenCode Zen - recommended)
|
|
130
|
+
delay: 300,
|
|
131
|
+
description: 'Provider selection',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
pattern: /opencode\s*zen|recommended/i,
|
|
135
|
+
response: '\r', // Confirm provider selection
|
|
136
|
+
delay: 200,
|
|
137
|
+
description: 'Confirm provider',
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
// Success patterns include credential added and existing credentials list
|
|
141
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i, /credential\s*added/i, /\d+\s*credentials?/i],
|
|
142
|
+
},
|
|
143
|
+
droid: {
|
|
144
|
+
command: 'droid',
|
|
145
|
+
args: ['--login'],
|
|
146
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
147
|
+
displayName: 'Droid',
|
|
148
|
+
waitTimeout: 30000,
|
|
149
|
+
prompts: [
|
|
150
|
+
{
|
|
151
|
+
pattern: /sign\s*in|log\s*in|authenticate/i,
|
|
152
|
+
response: '\r',
|
|
153
|
+
delay: 200,
|
|
154
|
+
description: 'Login prompt',
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i],
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Strip ANSI escape codes from text
|
|
162
|
+
*/
|
|
163
|
+
export function stripAnsiCodes(text) {
|
|
164
|
+
// eslint-disable-next-line no-control-regex
|
|
165
|
+
return text.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, '');
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Check if text matches any success pattern
|
|
169
|
+
*/
|
|
170
|
+
export function matchesSuccessPattern(text, patterns) {
|
|
171
|
+
const cleanText = stripAnsiCodes(text).toLowerCase();
|
|
172
|
+
return patterns.some((p) => p.test(cleanText));
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Find matching prompt handler that hasn't been responded to yet
|
|
176
|
+
*/
|
|
177
|
+
export function findMatchingPrompt(text, prompts, respondedPrompts) {
|
|
178
|
+
const cleanText = stripAnsiCodes(text);
|
|
179
|
+
for (const prompt of prompts) {
|
|
180
|
+
if (respondedPrompts.has(prompt.description))
|
|
181
|
+
continue;
|
|
182
|
+
if (prompt.pattern.test(cleanText)) {
|
|
183
|
+
return prompt;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Get list of supported provider IDs
|
|
190
|
+
*/
|
|
191
|
+
export function getSupportedProviderIds() {
|
|
192
|
+
return Object.keys(CLI_AUTH_CONFIG);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Get list of supported providers with details
|
|
196
|
+
*/
|
|
197
|
+
export function getSupportedProviders() {
|
|
198
|
+
return Object.entries(CLI_AUTH_CONFIG).map(([id, config]) => ({
|
|
199
|
+
id,
|
|
200
|
+
displayName: config.displayName,
|
|
201
|
+
command: config.command,
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Validate a provider's CLI auth configuration
|
|
206
|
+
* Returns null if valid, or an error message if invalid
|
|
207
|
+
*/
|
|
208
|
+
export function validateProviderConfig(providerId, config) {
|
|
209
|
+
if (!config.command || typeof config.command !== 'string') {
|
|
210
|
+
return `${providerId}: missing or invalid 'command'`;
|
|
211
|
+
}
|
|
212
|
+
if (!Array.isArray(config.args)) {
|
|
213
|
+
return `${providerId}: 'args' must be an array`;
|
|
214
|
+
}
|
|
215
|
+
if (!(config.urlPattern instanceof RegExp)) {
|
|
216
|
+
return `${providerId}: 'urlPattern' must be a RegExp`;
|
|
217
|
+
}
|
|
218
|
+
// Check urlPattern has a capture group
|
|
219
|
+
const testUrl = 'https://example.com/test';
|
|
220
|
+
const match = testUrl.match(config.urlPattern);
|
|
221
|
+
if (!match || !match[1]) {
|
|
222
|
+
return `${providerId}: 'urlPattern' must have a capture group - got ${config.urlPattern}`;
|
|
223
|
+
}
|
|
224
|
+
if (!config.displayName || typeof config.displayName !== 'string') {
|
|
225
|
+
return `${providerId}: missing or invalid 'displayName'`;
|
|
226
|
+
}
|
|
227
|
+
if (typeof config.waitTimeout !== 'number' || config.waitTimeout <= 0) {
|
|
228
|
+
return `${providerId}: 'waitTimeout' must be a positive number`;
|
|
229
|
+
}
|
|
230
|
+
if (!Array.isArray(config.prompts)) {
|
|
231
|
+
return `${providerId}: 'prompts' must be an array`;
|
|
232
|
+
}
|
|
233
|
+
for (let i = 0; i < config.prompts.length; i++) {
|
|
234
|
+
const prompt = config.prompts[i];
|
|
235
|
+
if (!(prompt.pattern instanceof RegExp)) {
|
|
236
|
+
return `${providerId}: prompt[${i}].pattern must be a RegExp`;
|
|
237
|
+
}
|
|
238
|
+
if (typeof prompt.response !== 'string') {
|
|
239
|
+
return `${providerId}: prompt[${i}].response must be a string`;
|
|
240
|
+
}
|
|
241
|
+
if (!prompt.description) {
|
|
242
|
+
return `${providerId}: prompt[${i}].description is required`;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (!Array.isArray(config.successPatterns)) {
|
|
246
|
+
return `${providerId}: 'successPatterns' must be an array`;
|
|
247
|
+
}
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Validate all provider configurations
|
|
252
|
+
* Returns array of error messages (empty if all valid)
|
|
253
|
+
*/
|
|
254
|
+
export function validateAllProviderConfigs() {
|
|
255
|
+
const errors = [];
|
|
256
|
+
for (const [id, config] of Object.entries(CLI_AUTH_CONFIG)) {
|
|
257
|
+
const error = validateProviderConfig(id, config);
|
|
258
|
+
if (error) {
|
|
259
|
+
errors.push(error);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return errors;
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=cli-auth-config.js.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trajectory Configuration
|
|
3
|
+
*
|
|
4
|
+
* Handles repo-level opt-in/opt-out for trajectory storage.
|
|
5
|
+
* When trajectories are opt-out (not in source control), they're stored
|
|
6
|
+
* in the user's home directory instead of the repo.
|
|
7
|
+
*
|
|
8
|
+
* DECISIONS:
|
|
9
|
+
* 1. Default behavior: trajectories are OPT-OUT (stored outside repo)
|
|
10
|
+
* - Reasoning: Most repos won't want trajectory files in source control
|
|
11
|
+
* - Users must explicitly opt-in to store in repo
|
|
12
|
+
*
|
|
13
|
+
* 2. Setting location: .relay/config.json in repo root
|
|
14
|
+
* - Reasoning: Keeps relay config separate from .claude/ which may have other uses
|
|
15
|
+
* - Alternative considered: .claude/settings.json - rejected to avoid conflicts
|
|
16
|
+
*
|
|
17
|
+
* 3. User-level storage: ~/.config/agent-relay/trajectories/<project-hash>/
|
|
18
|
+
* - Reasoning: XDG-compliant, project-isolated, survives repo deletion
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Relay config structure
|
|
22
|
+
*/
|
|
23
|
+
export interface RelayConfig {
|
|
24
|
+
/** Trajectory settings */
|
|
25
|
+
trajectories?: {
|
|
26
|
+
/**
|
|
27
|
+
* Whether to store trajectories in the repo (.trajectories/)
|
|
28
|
+
* Default: false (stored in ~/.config/agent-relay/trajectories/)
|
|
29
|
+
*/
|
|
30
|
+
storeInRepo?: boolean;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the relay config file path
|
|
35
|
+
*/
|
|
36
|
+
export declare function getRelayConfigPath(projectRoot?: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Read the relay config from the repo
|
|
39
|
+
*/
|
|
40
|
+
export declare function readRelayConfig(projectRoot?: string): RelayConfig;
|
|
41
|
+
/**
|
|
42
|
+
* Check if trajectories should be stored in the repo
|
|
43
|
+
*/
|
|
44
|
+
export declare function shouldStoreInRepo(projectRoot?: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Get a hash of the project path for user-level storage isolation
|
|
47
|
+
*/
|
|
48
|
+
export declare function getProjectHash(projectRoot?: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Get the user-level trajectories directory
|
|
51
|
+
*/
|
|
52
|
+
export declare function getUserTrajectoriesDir(projectRoot?: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* Get the repo-level trajectories directory
|
|
55
|
+
*/
|
|
56
|
+
export declare function getRepoTrajectoriesDir(projectRoot?: string): string;
|
|
57
|
+
/**
|
|
58
|
+
* Get the primary trajectories directory based on config
|
|
59
|
+
* This is where new trajectories will be written
|
|
60
|
+
*/
|
|
61
|
+
export declare function getPrimaryTrajectoriesDir(projectRoot?: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Get all trajectories directories (for reading)
|
|
64
|
+
* Returns both repo and user-level if they exist
|
|
65
|
+
*/
|
|
66
|
+
export declare function getAllTrajectoriesDirs(projectRoot?: string): string[];
|
|
67
|
+
/**
|
|
68
|
+
* Ensure the primary trajectories directory exists
|
|
69
|
+
*/
|
|
70
|
+
export declare function ensureTrajectoriesDir(projectRoot?: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* Get trajectory environment variables for trail CLI
|
|
73
|
+
* Sets TRAJECTORIES_DATA_DIR to the appropriate location
|
|
74
|
+
*/
|
|
75
|
+
export declare function getTrajectoryEnvVars(projectRoot?: string): Record<string, string>;
|
|
76
|
+
/**
|
|
77
|
+
* Check if project has opted into repo-level trajectory storage
|
|
78
|
+
*/
|
|
79
|
+
export declare function isTrajectoryOptedIn(projectRoot?: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Get a human-readable description of where trajectories are stored
|
|
82
|
+
*/
|
|
83
|
+
export declare function getTrajectoriesStorageDescription(projectRoot?: string): string;
|
|
84
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trajectory Configuration
|
|
3
|
+
*
|
|
4
|
+
* Handles repo-level opt-in/opt-out for trajectory storage.
|
|
5
|
+
* When trajectories are opt-out (not in source control), they're stored
|
|
6
|
+
* in the user's home directory instead of the repo.
|
|
7
|
+
*
|
|
8
|
+
* DECISIONS:
|
|
9
|
+
* 1. Default behavior: trajectories are OPT-OUT (stored outside repo)
|
|
10
|
+
* - Reasoning: Most repos won't want trajectory files in source control
|
|
11
|
+
* - Users must explicitly opt-in to store in repo
|
|
12
|
+
*
|
|
13
|
+
* 2. Setting location: .relay/config.json in repo root
|
|
14
|
+
* - Reasoning: Keeps relay config separate from .claude/ which may have other uses
|
|
15
|
+
* - Alternative considered: .claude/settings.json - rejected to avoid conflicts
|
|
16
|
+
*
|
|
17
|
+
* 3. User-level storage: ~/.config/agent-relay/trajectories/<project-hash>/
|
|
18
|
+
* - Reasoning: XDG-compliant, project-isolated, survives repo deletion
|
|
19
|
+
*/
|
|
20
|
+
import { existsSync, readFileSync, mkdirSync, statSync } from 'node:fs';
|
|
21
|
+
import { join } from 'node:path';
|
|
22
|
+
import { homedir } from 'node:os';
|
|
23
|
+
import { createHash } from 'node:crypto';
|
|
24
|
+
import { getProjectPaths } from '../utils/project-namespace.js';
|
|
25
|
+
/**
|
|
26
|
+
* Cache for config to avoid repeated file reads
|
|
27
|
+
*/
|
|
28
|
+
let configCache = null;
|
|
29
|
+
/**
|
|
30
|
+
* Get the relay config file path
|
|
31
|
+
*/
|
|
32
|
+
export function getRelayConfigPath(projectRoot) {
|
|
33
|
+
const root = projectRoot ?? getProjectPaths().projectRoot;
|
|
34
|
+
return join(root, '.relay', 'config.json');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Read the relay config from the repo
|
|
38
|
+
*/
|
|
39
|
+
export function readRelayConfig(projectRoot) {
|
|
40
|
+
const configPath = getRelayConfigPath(projectRoot);
|
|
41
|
+
// Check cache
|
|
42
|
+
if (configCache && configCache.path === configPath) {
|
|
43
|
+
try {
|
|
44
|
+
const stat = statSync(configPath);
|
|
45
|
+
if (stat.mtimeMs === configCache.mtime) {
|
|
46
|
+
return configCache.config;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// File may not exist or be readable
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
if (!existsSync(configPath)) {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
58
|
+
const config = JSON.parse(content);
|
|
59
|
+
// Update cache
|
|
60
|
+
try {
|
|
61
|
+
const stat = statSync(configPath);
|
|
62
|
+
configCache = { path: configPath, config, mtime: stat.mtimeMs };
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// Ignore cache update failures
|
|
66
|
+
}
|
|
67
|
+
return config;
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
console.warn('[trajectory-config] Failed to read config:', err);
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Check if trajectories should be stored in the repo
|
|
76
|
+
*/
|
|
77
|
+
export function shouldStoreInRepo(projectRoot) {
|
|
78
|
+
const config = readRelayConfig(projectRoot);
|
|
79
|
+
// Default to false - trajectories are stored outside repo by default
|
|
80
|
+
return config.trajectories?.storeInRepo === true;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get a hash of the project path for user-level storage isolation
|
|
84
|
+
*/
|
|
85
|
+
export function getProjectHash(projectRoot) {
|
|
86
|
+
const root = projectRoot ?? getProjectPaths().projectRoot;
|
|
87
|
+
return createHash('sha256').update(root).digest('hex').slice(0, 16);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get the user-level trajectories directory
|
|
91
|
+
*/
|
|
92
|
+
export function getUserTrajectoriesDir(projectRoot) {
|
|
93
|
+
const projectHash = getProjectHash(projectRoot);
|
|
94
|
+
const configDir = process.env.XDG_CONFIG_HOME || join(homedir(), '.config');
|
|
95
|
+
return join(configDir, 'agent-relay', 'trajectories', projectHash);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get the repo-level trajectories directory
|
|
99
|
+
*/
|
|
100
|
+
export function getRepoTrajectoriesDir(projectRoot) {
|
|
101
|
+
const root = projectRoot ?? getProjectPaths().projectRoot;
|
|
102
|
+
return join(root, '.trajectories');
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get the primary trajectories directory based on config
|
|
106
|
+
* This is where new trajectories will be written
|
|
107
|
+
*/
|
|
108
|
+
export function getPrimaryTrajectoriesDir(projectRoot) {
|
|
109
|
+
if (shouldStoreInRepo(projectRoot)) {
|
|
110
|
+
return getRepoTrajectoriesDir(projectRoot);
|
|
111
|
+
}
|
|
112
|
+
return getUserTrajectoriesDir(projectRoot);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get all trajectories directories (for reading)
|
|
116
|
+
* Returns both repo and user-level if they exist
|
|
117
|
+
*/
|
|
118
|
+
export function getAllTrajectoriesDirs(projectRoot) {
|
|
119
|
+
const dirs = [];
|
|
120
|
+
const repoDir = getRepoTrajectoriesDir(projectRoot);
|
|
121
|
+
if (existsSync(repoDir)) {
|
|
122
|
+
dirs.push(repoDir);
|
|
123
|
+
}
|
|
124
|
+
const userDir = getUserTrajectoriesDir(projectRoot);
|
|
125
|
+
if (existsSync(userDir)) {
|
|
126
|
+
dirs.push(userDir);
|
|
127
|
+
}
|
|
128
|
+
return dirs;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Ensure the primary trajectories directory exists
|
|
132
|
+
*/
|
|
133
|
+
export function ensureTrajectoriesDir(projectRoot) {
|
|
134
|
+
const dir = getPrimaryTrajectoriesDir(projectRoot);
|
|
135
|
+
mkdirSync(dir, { recursive: true });
|
|
136
|
+
return dir;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get trajectory environment variables for trail CLI
|
|
140
|
+
* Sets TRAJECTORIES_DATA_DIR to the appropriate location
|
|
141
|
+
*/
|
|
142
|
+
export function getTrajectoryEnvVars(projectRoot) {
|
|
143
|
+
const dataDir = getPrimaryTrajectoriesDir(projectRoot);
|
|
144
|
+
return {
|
|
145
|
+
TRAJECTORIES_DATA_DIR: dataDir,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Check if project has opted into repo-level trajectory storage
|
|
150
|
+
*/
|
|
151
|
+
export function isTrajectoryOptedIn(projectRoot) {
|
|
152
|
+
return shouldStoreInRepo(projectRoot);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Get a human-readable description of where trajectories are stored
|
|
156
|
+
*/
|
|
157
|
+
export function getTrajectoriesStorageDescription(projectRoot) {
|
|
158
|
+
if (shouldStoreInRepo(projectRoot)) {
|
|
159
|
+
return `repo (.trajectories/)`;
|
|
160
|
+
}
|
|
161
|
+
return `user (~/.config/agent-relay/trajectories/)`;
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=config.js.map
|