agent-relay 1.1.0 → 1.2.0
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/README.md +1 -1
- package/dist/bridge/spawner.d.ts +53 -0
- package/dist/bridge/spawner.d.ts.map +1 -1
- package/dist/bridge/spawner.js +203 -19
- package/dist/bridge/spawner.js.map +1 -1
- package/dist/bridge/types.d.ts +12 -0
- package/dist/bridge/types.d.ts.map +1 -1
- package/dist/cli/index.js +401 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cloud/api/auth.d.ts +3 -2
- package/dist/cloud/api/auth.d.ts.map +1 -1
- package/dist/cloud/api/auth.js +10 -98
- package/dist/cloud/api/auth.js.map +1 -1
- package/dist/cloud/api/cli-pty-runner.d.ts +54 -0
- package/dist/cloud/api/cli-pty-runner.d.ts.map +1 -0
- package/dist/cloud/api/cli-pty-runner.js +119 -0
- package/dist/cloud/api/cli-pty-runner.js.map +1 -0
- package/dist/cloud/api/generic-webhooks.d.ts +8 -0
- package/dist/cloud/api/generic-webhooks.d.ts.map +1 -0
- package/dist/cloud/api/generic-webhooks.js +129 -0
- package/dist/cloud/api/generic-webhooks.js.map +1 -0
- package/dist/cloud/api/git.d.ts +8 -0
- package/dist/cloud/api/git.d.ts.map +1 -0
- package/dist/cloud/api/git.js +131 -0
- package/dist/cloud/api/git.js.map +1 -0
- package/dist/cloud/api/github-app.d.ts +11 -0
- package/dist/cloud/api/github-app.d.ts.map +1 -0
- package/dist/cloud/api/github-app.js +189 -0
- package/dist/cloud/api/github-app.js.map +1 -0
- package/dist/cloud/api/middleware/planLimits.d.ts +7 -0
- package/dist/cloud/api/middleware/planLimits.d.ts.map +1 -1
- package/dist/cloud/api/middleware/planLimits.js +39 -1
- package/dist/cloud/api/middleware/planLimits.js.map +1 -1
- package/dist/cloud/api/monitoring.d.ts +11 -0
- package/dist/cloud/api/monitoring.d.ts.map +1 -0
- package/dist/cloud/api/monitoring.js +578 -0
- package/dist/cloud/api/monitoring.js.map +1 -0
- package/dist/cloud/api/nango-auth.d.ts +9 -0
- package/dist/cloud/api/nango-auth.d.ts.map +1 -0
- package/dist/cloud/api/nango-auth.js +377 -0
- package/dist/cloud/api/nango-auth.js.map +1 -0
- package/dist/cloud/api/onboarding.d.ts +8 -1
- package/dist/cloud/api/onboarding.d.ts.map +1 -1
- package/dist/cloud/api/onboarding.js +300 -119
- package/dist/cloud/api/onboarding.js.map +1 -1
- package/dist/cloud/api/policy.d.ts +8 -0
- package/dist/cloud/api/policy.d.ts.map +1 -0
- package/dist/cloud/api/policy.js +229 -0
- package/dist/cloud/api/policy.js.map +1 -0
- package/dist/cloud/api/providers.js +114 -42
- package/dist/cloud/api/providers.js.map +1 -1
- package/dist/cloud/api/test-helpers.d.ts +10 -0
- package/dist/cloud/api/test-helpers.d.ts.map +1 -0
- package/dist/cloud/api/test-helpers.js +575 -0
- package/dist/cloud/api/test-helpers.js.map +1 -0
- package/dist/cloud/api/webhooks.d.ts +7 -0
- package/dist/cloud/api/webhooks.d.ts.map +1 -0
- package/dist/cloud/api/webhooks.js +496 -0
- package/dist/cloud/api/webhooks.js.map +1 -0
- package/dist/cloud/api/workspaces.js +225 -8
- package/dist/cloud/api/workspaces.js.map +1 -1
- package/dist/cloud/billing/plans.d.ts.map +1 -1
- package/dist/cloud/billing/plans.js +13 -0
- package/dist/cloud/billing/plans.js.map +1 -1
- package/dist/cloud/billing/types.d.ts +9 -3
- package/dist/cloud/billing/types.d.ts.map +1 -1
- package/dist/cloud/config.d.ts +9 -2
- package/dist/cloud/config.d.ts.map +1 -1
- package/dist/cloud/config.js +13 -4
- package/dist/cloud/config.js.map +1 -1
- package/dist/cloud/db/drizzle.d.ts +84 -1
- package/dist/cloud/db/drizzle.d.ts.map +1 -1
- package/dist/cloud/db/drizzle.js +470 -0
- package/dist/cloud/db/drizzle.js.map +1 -1
- package/dist/cloud/db/index.d.ts +9 -4
- package/dist/cloud/db/index.d.ts.map +1 -1
- package/dist/cloud/db/index.js +11 -3
- package/dist/cloud/db/index.js.map +1 -1
- package/dist/cloud/db/schema.d.ts +3283 -556
- package/dist/cloud/db/schema.d.ts.map +1 -1
- package/dist/cloud/db/schema.js +314 -1
- package/dist/cloud/db/schema.js.map +1 -1
- package/dist/cloud/index.d.ts +1 -0
- package/dist/cloud/index.d.ts.map +1 -1
- package/dist/cloud/index.js +2 -0
- package/dist/cloud/index.js.map +1 -1
- package/dist/cloud/provisioner/index.d.ts +24 -0
- package/dist/cloud/provisioner/index.d.ts.map +1 -1
- package/dist/cloud/provisioner/index.js +319 -18
- package/dist/cloud/provisioner/index.js.map +1 -1
- package/dist/cloud/server.d.ts +1 -0
- package/dist/cloud/server.d.ts.map +1 -1
- package/dist/cloud/server.js +357 -13
- package/dist/cloud/server.js.map +1 -1
- package/dist/cloud/services/auto-scaler.d.ts +152 -0
- package/dist/cloud/services/auto-scaler.d.ts.map +1 -0
- package/dist/cloud/services/auto-scaler.js +439 -0
- package/dist/cloud/services/auto-scaler.js.map +1 -0
- package/dist/cloud/services/capacity-manager.d.ts +148 -0
- package/dist/cloud/services/capacity-manager.d.ts.map +1 -0
- package/dist/cloud/services/capacity-manager.js +449 -0
- package/dist/cloud/services/capacity-manager.js.map +1 -0
- package/dist/cloud/services/ci-agent-spawner.d.ts +49 -0
- package/dist/cloud/services/ci-agent-spawner.d.ts.map +1 -0
- package/dist/cloud/services/ci-agent-spawner.js +373 -0
- package/dist/cloud/services/ci-agent-spawner.js.map +1 -0
- package/dist/cloud/services/index.d.ts +12 -0
- package/dist/cloud/services/index.d.ts.map +1 -0
- package/dist/cloud/services/index.js +15 -0
- package/dist/cloud/services/index.js.map +1 -0
- package/dist/cloud/services/mention-handler.d.ts +65 -0
- package/dist/cloud/services/mention-handler.d.ts.map +1 -0
- package/dist/cloud/services/mention-handler.js +405 -0
- package/dist/cloud/services/mention-handler.js.map +1 -0
- package/dist/cloud/services/nango.d.ts +126 -0
- package/dist/cloud/services/nango.d.ts.map +1 -0
- package/dist/cloud/services/nango.js +191 -0
- package/dist/cloud/services/nango.js.map +1 -0
- package/dist/cloud/services/persistence.d.ts +131 -0
- package/dist/cloud/services/persistence.d.ts.map +1 -0
- package/dist/cloud/services/persistence.js +200 -0
- package/dist/cloud/services/persistence.js.map +1 -0
- package/dist/cloud/services/planLimits.d.ts +15 -0
- package/dist/cloud/services/planLimits.d.ts.map +1 -1
- package/dist/cloud/services/planLimits.js +28 -0
- package/dist/cloud/services/planLimits.js.map +1 -1
- package/dist/cloud/services/scaling-orchestrator.d.ts +159 -0
- package/dist/cloud/services/scaling-orchestrator.d.ts.map +1 -0
- package/dist/cloud/services/scaling-orchestrator.js +502 -0
- package/dist/cloud/services/scaling-orchestrator.js.map +1 -0
- package/dist/cloud/services/scaling-policy.d.ts +121 -0
- package/dist/cloud/services/scaling-policy.d.ts.map +1 -0
- package/dist/cloud/services/scaling-policy.js +415 -0
- package/dist/cloud/services/scaling-policy.js.map +1 -0
- package/dist/cloud/vault/index.js +1 -1
- package/dist/cloud/vault/index.js.map +1 -1
- package/dist/cloud/webhooks/index.d.ts +24 -0
- package/dist/cloud/webhooks/index.d.ts.map +1 -0
- package/dist/cloud/webhooks/index.js +29 -0
- package/dist/cloud/webhooks/index.js.map +1 -0
- package/dist/cloud/webhooks/parsers/github.d.ts +8 -0
- package/dist/cloud/webhooks/parsers/github.d.ts.map +1 -0
- package/dist/cloud/webhooks/parsers/github.js +234 -0
- package/dist/cloud/webhooks/parsers/github.js.map +1 -0
- package/dist/cloud/webhooks/parsers/index.d.ts +23 -0
- package/dist/cloud/webhooks/parsers/index.d.ts.map +1 -0
- package/dist/cloud/webhooks/parsers/index.js +30 -0
- package/dist/cloud/webhooks/parsers/index.js.map +1 -0
- package/dist/cloud/webhooks/parsers/linear.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/linear.d.ts.map +1 -0
- package/dist/cloud/webhooks/parsers/linear.js +258 -0
- package/dist/cloud/webhooks/parsers/linear.js.map +1 -0
- package/dist/cloud/webhooks/parsers/slack.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/slack.d.ts.map +1 -0
- package/dist/cloud/webhooks/parsers/slack.js +214 -0
- package/dist/cloud/webhooks/parsers/slack.js.map +1 -0
- package/dist/cloud/webhooks/responders/github.d.ts +8 -0
- package/dist/cloud/webhooks/responders/github.d.ts.map +1 -0
- package/dist/cloud/webhooks/responders/github.js +73 -0
- package/dist/cloud/webhooks/responders/github.js.map +1 -0
- package/dist/cloud/webhooks/responders/index.d.ts +23 -0
- package/dist/cloud/webhooks/responders/index.d.ts.map +1 -0
- package/dist/cloud/webhooks/responders/index.js +30 -0
- package/dist/cloud/webhooks/responders/index.js.map +1 -0
- package/dist/cloud/webhooks/responders/linear.d.ts +9 -0
- package/dist/cloud/webhooks/responders/linear.d.ts.map +1 -0
- package/dist/cloud/webhooks/responders/linear.js +149 -0
- package/dist/cloud/webhooks/responders/linear.js.map +1 -0
- package/dist/cloud/webhooks/responders/slack.d.ts +20 -0
- package/dist/cloud/webhooks/responders/slack.d.ts.map +1 -0
- package/dist/cloud/webhooks/responders/slack.js +178 -0
- package/dist/cloud/webhooks/responders/slack.js.map +1 -0
- package/dist/cloud/webhooks/router.d.ts +25 -0
- package/dist/cloud/webhooks/router.d.ts.map +1 -0
- package/dist/cloud/webhooks/router.js +504 -0
- package/dist/cloud/webhooks/router.js.map +1 -0
- package/dist/cloud/webhooks/rules-engine.d.ts +24 -0
- package/dist/cloud/webhooks/rules-engine.d.ts.map +1 -0
- package/dist/cloud/webhooks/rules-engine.js +287 -0
- package/dist/cloud/webhooks/rules-engine.js.map +1 -0
- package/dist/cloud/webhooks/types.d.ts +186 -0
- package/dist/cloud/webhooks/types.d.ts.map +1 -0
- package/dist/cloud/webhooks/types.js +8 -0
- package/dist/cloud/webhooks/types.js.map +1 -0
- package/dist/continuity/formatter.d.ts +51 -0
- package/dist/continuity/formatter.d.ts.map +1 -0
- package/dist/continuity/formatter.js +313 -0
- package/dist/continuity/formatter.js.map +1 -0
- package/dist/continuity/handoff-store.d.ts +67 -0
- package/dist/continuity/handoff-store.d.ts.map +1 -0
- package/dist/continuity/handoff-store.js +472 -0
- package/dist/continuity/handoff-store.js.map +1 -0
- package/dist/continuity/index.d.ts +45 -0
- package/dist/continuity/index.d.ts.map +1 -0
- package/dist/continuity/index.js +48 -0
- package/dist/continuity/index.js.map +1 -0
- package/dist/continuity/ledger-store.d.ts +110 -0
- package/dist/continuity/ledger-store.d.ts.map +1 -0
- package/dist/continuity/ledger-store.js +500 -0
- package/dist/continuity/ledger-store.js.map +1 -0
- package/dist/continuity/manager.d.ts +178 -0
- package/dist/continuity/manager.d.ts.map +1 -0
- package/dist/continuity/manager.js +562 -0
- package/dist/continuity/manager.js.map +1 -0
- package/dist/continuity/parser.d.ts +76 -0
- package/dist/continuity/parser.d.ts.map +1 -0
- package/dist/continuity/parser.js +579 -0
- package/dist/continuity/parser.js.map +1 -0
- package/dist/continuity/types.d.ts +180 -0
- package/dist/continuity/types.d.ts.map +1 -0
- package/dist/continuity/types.js +9 -0
- package/dist/continuity/types.js.map +1 -0
- package/dist/daemon/agent-manager.d.ts +27 -0
- package/dist/daemon/agent-manager.d.ts.map +1 -1
- package/dist/daemon/agent-manager.js +107 -6
- package/dist/daemon/agent-manager.js.map +1 -1
- package/dist/daemon/agent-registry.d.ts +32 -0
- package/dist/daemon/agent-registry.d.ts.map +1 -1
- package/dist/daemon/agent-registry.js +42 -2
- package/dist/daemon/agent-registry.js.map +1 -1
- package/dist/daemon/api.d.ts +12 -0
- package/dist/daemon/api.d.ts.map +1 -1
- package/dist/daemon/api.js +131 -2
- package/dist/daemon/api.js.map +1 -1
- package/dist/daemon/cli-auth.d.ts +67 -0
- package/dist/daemon/cli-auth.d.ts.map +1 -0
- package/dist/daemon/cli-auth.js +537 -0
- package/dist/daemon/cli-auth.js.map +1 -0
- package/dist/daemon/cloud-sync.d.ts.map +1 -1
- package/dist/daemon/cloud-sync.js +9 -7
- package/dist/daemon/cloud-sync.js.map +1 -1
- package/dist/daemon/orchestrator.d.ts.map +1 -1
- package/dist/daemon/orchestrator.js +30 -0
- package/dist/daemon/orchestrator.js.map +1 -1
- package/dist/daemon/router.d.ts +5 -0
- package/dist/daemon/router.d.ts.map +1 -1
- package/dist/daemon/router.js +78 -26
- package/dist/daemon/router.js.map +1 -1
- package/dist/daemon/server.d.ts +5 -0
- package/dist/daemon/server.d.ts.map +1 -1
- package/dist/daemon/server.js +9 -1
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/services/browser-testing.d.ts +88 -0
- package/dist/daemon/services/browser-testing.d.ts.map +1 -0
- package/dist/daemon/services/browser-testing.js +244 -0
- package/dist/daemon/services/browser-testing.js.map +1 -0
- package/dist/daemon/services/container-spawner.d.ts +135 -0
- package/dist/daemon/services/container-spawner.d.ts.map +1 -0
- package/dist/daemon/services/container-spawner.js +313 -0
- package/dist/daemon/services/container-spawner.js.map +1 -0
- package/dist/daemon/types.d.ts +5 -1
- package/dist/daemon/types.d.ts.map +1 -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/480-2d4111711d4e473c.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/724-73c1ee5f60abe860.js +9 -0
- package/dist/dashboard/out/_next/static/chunks/766-c3a14283c88d815b.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/page-7120be68bea622f3.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-dc2e3a1a22478efc.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/history/{page-b6edd4dde8d08194.js → page-56a8b4616a90dc43.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/app/login/page-3eac37ea6f5dd153.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-1081dd190a331a91.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/page-daf87e86f783f980.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-b68a681526eb145e.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/signup/page-fee4ed1709070bcd.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +18 -0
- package/dist/dashboard/out/_next/static/chunks/{main-c2f423b9c9f4591b.js → main-97850e03d723ea8c.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/411ce23ffeae9f76.css +1 -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 +2 -2
- 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.d.ts.map +1 -1
- package/dist/dashboard-server/server.js +1308 -8
- package/dist/dashboard-server/server.js.map +1 -1
- package/dist/hooks/emitter.d.ts +40 -0
- package/dist/hooks/emitter.d.ts.map +1 -0
- package/dist/hooks/emitter.js +63 -0
- package/dist/hooks/emitter.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/registry.d.ts +173 -0
- package/dist/hooks/registry.d.ts.map +1 -0
- package/dist/hooks/registry.js +476 -0
- package/dist/hooks/registry.js.map +1 -0
- package/dist/hooks/trajectory-hooks.d.ts +52 -0
- package/dist/hooks/trajectory-hooks.d.ts.map +1 -0
- package/dist/hooks/trajectory-hooks.js +183 -0
- package/dist/hooks/trajectory-hooks.js.map +1 -0
- package/dist/hooks/types.d.ts +141 -0
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/memory/adapters/index.d.ts +8 -0
- package/dist/memory/adapters/index.d.ts.map +1 -0
- package/dist/memory/adapters/index.js +8 -0
- package/dist/memory/adapters/index.js.map +1 -0
- package/dist/memory/adapters/inmemory.d.ts +59 -0
- package/dist/memory/adapters/inmemory.d.ts.map +1 -0
- package/dist/memory/adapters/inmemory.js +195 -0
- package/dist/memory/adapters/inmemory.js.map +1 -0
- package/dist/memory/adapters/supermemory.d.ts +71 -0
- package/dist/memory/adapters/supermemory.d.ts.map +1 -0
- package/dist/memory/adapters/supermemory.js +338 -0
- package/dist/memory/adapters/supermemory.js.map +1 -0
- package/dist/memory/factory.d.ts +48 -0
- package/dist/memory/factory.d.ts.map +1 -0
- package/dist/memory/factory.js +143 -0
- package/dist/memory/factory.js.map +1 -0
- package/dist/memory/index.d.ts +32 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +32 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/memory-hooks.d.ts +60 -0
- package/dist/memory/memory-hooks.d.ts.map +1 -0
- package/dist/memory/memory-hooks.js +313 -0
- package/dist/memory/memory-hooks.js.map +1 -0
- package/dist/memory/service.d.ts +49 -0
- package/dist/memory/service.d.ts.map +1 -0
- package/dist/memory/service.js +146 -0
- package/dist/memory/service.js.map +1 -0
- package/dist/memory/types.d.ts +195 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +8 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/policy/agent-policy.d.ts +225 -0
- package/dist/policy/agent-policy.d.ts.map +1 -0
- package/dist/policy/agent-policy.js +665 -0
- package/dist/policy/agent-policy.js.map +1 -0
- package/dist/policy/cloud-policy-fetcher.d.ts +12 -0
- package/dist/policy/cloud-policy-fetcher.d.ts.map +1 -0
- package/dist/policy/cloud-policy-fetcher.js +64 -0
- package/dist/policy/cloud-policy-fetcher.js.map +1 -0
- package/dist/resiliency/crash-insights.d.ts +156 -0
- package/dist/resiliency/crash-insights.d.ts.map +1 -0
- package/dist/resiliency/crash-insights.js +492 -0
- package/dist/resiliency/crash-insights.js.map +1 -0
- package/dist/resiliency/gossip-health.d.ts +137 -0
- package/dist/resiliency/gossip-health.d.ts.map +1 -0
- package/dist/resiliency/gossip-health.js +241 -0
- package/dist/resiliency/gossip-health.js.map +1 -0
- package/dist/resiliency/index.d.ts +5 -0
- package/dist/resiliency/index.d.ts.map +1 -1
- package/dist/resiliency/index.js +5 -0
- package/dist/resiliency/index.js.map +1 -1
- package/dist/resiliency/leader-watchdog.d.ts +109 -0
- package/dist/resiliency/leader-watchdog.d.ts.map +1 -0
- package/dist/resiliency/leader-watchdog.js +189 -0
- package/dist/resiliency/leader-watchdog.js.map +1 -0
- package/dist/resiliency/memory-monitor.d.ts +172 -0
- package/dist/resiliency/memory-monitor.d.ts.map +1 -0
- package/dist/resiliency/memory-monitor.js +593 -0
- package/dist/resiliency/memory-monitor.js.map +1 -0
- package/dist/resiliency/stateless-lead.d.ts +149 -0
- package/dist/resiliency/stateless-lead.d.ts.map +1 -0
- package/dist/resiliency/stateless-lead.js +308 -0
- package/dist/resiliency/stateless-lead.js.map +1 -0
- package/dist/resiliency/supervisor.d.ts +38 -0
- package/dist/resiliency/supervisor.d.ts.map +1 -1
- package/dist/resiliency/supervisor.js +122 -0
- package/dist/resiliency/supervisor.js.map +1 -1
- package/dist/shared/cli-auth-config.d.ts +91 -0
- package/dist/shared/cli-auth-config.d.ts.map +1 -0
- package/dist/shared/cli-auth-config.js +264 -0
- package/dist/shared/cli-auth-config.js.map +1 -0
- package/dist/storage/adapter.d.ts +1 -1
- package/dist/storage/adapter.d.ts.map +1 -1
- package/dist/trajectory/config.d.ts +84 -0
- package/dist/trajectory/config.d.ts.map +1 -0
- package/dist/trajectory/config.js +163 -0
- package/dist/trajectory/config.js.map +1 -0
- package/dist/trajectory/index.d.ts +8 -0
- package/dist/trajectory/index.d.ts.map +1 -0
- package/dist/trajectory/index.js +8 -0
- package/dist/trajectory/index.js.map +1 -0
- package/dist/trajectory/integration.d.ts +292 -0
- package/dist/trajectory/integration.d.ts.map +1 -0
- package/dist/trajectory/integration.js +834 -0
- package/dist/trajectory/integration.js.map +1 -0
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/project-namespace.d.ts +24 -0
- package/dist/utils/project-namespace.d.ts.map +1 -1
- package/dist/utils/project-namespace.js +84 -0
- package/dist/utils/project-namespace.js.map +1 -1
- package/dist/wrapper/parser.d.ts +10 -0
- package/dist/wrapper/parser.d.ts.map +1 -1
- package/dist/wrapper/parser.js +100 -33
- package/dist/wrapper/parser.js.map +1 -1
- package/dist/wrapper/pty-wrapper.d.ts +197 -16
- package/dist/wrapper/pty-wrapper.d.ts.map +1 -1
- package/dist/wrapper/pty-wrapper.js +943 -106
- package/dist/wrapper/pty-wrapper.js.map +1 -1
- package/dist/wrapper/shared.d.ts +165 -0
- package/dist/wrapper/shared.d.ts.map +1 -0
- package/dist/wrapper/shared.js +270 -0
- package/dist/wrapper/shared.js.map +1 -0
- package/dist/wrapper/tmux-wrapper.d.ts +73 -11
- package/dist/wrapper/tmux-wrapper.d.ts.map +1 -1
- package/dist/wrapper/tmux-wrapper.js +541 -120
- package/dist/wrapper/tmux-wrapper.js.map +1 -1
- package/docs/CLOUD-ARCHITECTURE.md +152 -0
- package/docs/HOOKS_API.md +394 -0
- package/docs/WRAPPER_EVENTS.md +358 -0
- package/docs/agent-policy-snippet.md +40 -0
- package/docs/agent-relay-protocol.md +238 -0
- package/docs/agent-relay-snippet.md +53 -47
- package/docs/archive/EXECUTIVE_SUMMARY.md +358 -0
- package/docs/archive/ROADMAP.md +329 -0
- package/docs/competitive/GASTOWN.md +451 -0
- package/docs/{COMPETITIVE_ANALYSIS.md → competitive/OVERVIEW.md} +1 -0
- package/docs/competitive/README.md +34 -0
- package/docs/competitive/TMUX_ORCHESTRATOR.md +605 -0
- package/docs/dashboard.png +0 -0
- package/docs/design/ci-failure-webhooks.md +812 -0
- package/docs/design/comprehensive-integrations.md +238 -0
- package/docs/design/e2b-sandbox-integration.md +504 -0
- package/docs/design/github-app-permissions.md +264 -0
- package/docs/local-testing.md +428 -0
- package/docs/proposals/continuous-claude-integration.md +622 -0
- package/docs/proposals/custom-commands.md +368 -0
- package/docs/tasks/global-skills-system.tasks.md +230 -0
- package/docs/tasks/webhook-integrations.tasks.md +184 -0
- package/docs/tasks/workspace-capabilities.tasks.md +121 -0
- package/docs/testing/RESILIENCY-TEST-PLAN-2026-01-01.md +366 -0
- package/package.json +16 -7
- package/scripts/cloud-setup.sh +96 -0
- package/scripts/manual-qa.sh +293 -0
- package/scripts/postinstall.js +60 -0
- package/scripts/run-cloud-qa.sh +220 -0
- package/scripts/test-cli-auth/Dockerfile +44 -0
- package/scripts/test-cli-auth/Dockerfile.real +79 -0
- package/scripts/test-cli-auth/README.md +286 -0
- package/scripts/test-cli-auth/ci-test-real-clis.ts +251 -0
- package/scripts/test-cli-auth/ci-test-runner.ts +263 -0
- package/scripts/test-cli-auth/mock-cli.sh +147 -0
- package/scripts/test-cli-auth/package.json +14 -0
- package/scripts/test-cli-auth/test-oauth-flow.ts +220 -0
- package/scripts/test-pty-input-auto.js +222 -0
- package/scripts/test-pty-input.js +150 -0
- 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/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/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/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → H5aWG0udPB4iOUIl_gytz}/_buildManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → H5aWG0udPB4iOUIl_gytz}/_ssgManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{117-b2cd8d6485aacf2b.js → 117-b100311aff8d5c61.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{648-8f3f26864ce515e5.js → 648-a13d3c2b1be45466.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/_not-found/{page-0b990dbb71d72a98.js → page-a4973f3e3c82fb67.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/pricing/{page-d80e03a5297f95b6.js → page-4d72d5a5d8a9b618.js} +0 -0
- /package/docs/{CHANGELOG.md → archive/CHANGELOG.md} +0 -0
- /package/docs/{CLI-SIMPLIFICATION-COMPLETE.md → archive/CLI-SIMPLIFICATION-COMPLETE.md} +0 -0
- /package/docs/{DESIGN_BRIDGE_STAFFING.md → archive/DESIGN_BRIDGE_STAFFING.md} +0 -0
- /package/docs/{DESIGN_V2.md → archive/DESIGN_V2.md} +0 -0
- /package/docs/{MONETIZATION.md → archive/MONETIZATION.md} +0 -0
- /package/docs/{PROPOSAL-trajectories.md → archive/PROPOSAL-trajectories.md} +0 -0
- /package/docs/{SCALING_ANALYSIS.md → archive/SCALING_ANALYSIS.md} +0 -0
- /package/docs/{TESTING_PRESENCE_FEATURES.md → archive/TESTING_PRESENCE_FEATURES.md} +0 -0
- /package/docs/{TMUX_IMPLEMENTATION_NOTES.md → archive/TMUX_IMPLEMENTATION_NOTES.md} +0 -0
- /package/docs/{TMUX_IMPROVEMENTS.md → archive/TMUX_IMPROVEMENTS.md} +0 -0
- /package/docs/{dashboard-v2-plan.md → archive/dashboard-v2-plan.md} +0 -0
- /package/docs/{removable-code-analysis.md → archive/removable-code-analysis.md} +0 -0
- /package/docs/{competitive-analysis-mcp-agent-mail.md → competitive/MCP_AGENT_MAIL.md} +0 -0
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
# Proposal: CLI-Agnostic Continuity System
|
|
2
|
+
|
|
3
|
+
**Issue:** agent-relay-317
|
|
4
|
+
**Status:** Proposed
|
|
5
|
+
**Priority:** 1 (High)
|
|
6
|
+
**Type:** Feature Epic
|
|
7
|
+
|
|
8
|
+
## Executive Summary
|
|
9
|
+
|
|
10
|
+
Integrate session continuity and context management into Agent Relay at the **relay layer**, making it work for **any CLI** (Claude, Codex, Gemini, custom agents). This addresses context degradation without requiring CLI-specific hooks.
|
|
11
|
+
|
|
12
|
+
## Problem Statement
|
|
13
|
+
|
|
14
|
+
All LLM-based CLIs suffer from context degradation:
|
|
15
|
+
- **Claude Code**: Lossy compaction summaries
|
|
16
|
+
- **Codex CLI**: Fixed context window, no persistence
|
|
17
|
+
- **Gemini CLI**: Similar context limitations
|
|
18
|
+
|
|
19
|
+
For long-running agent tasks, this leads to:
|
|
20
|
+
- Lost architectural decisions
|
|
21
|
+
- Forgotten implementation details
|
|
22
|
+
- Repeated mistakes
|
|
23
|
+
- Broken continuity across sessions
|
|
24
|
+
|
|
25
|
+
## Design Principle: CLI-Agnostic
|
|
26
|
+
|
|
27
|
+
Unlike Continuous-Claude-v2 which uses Claude Code hooks, we implement continuity at the **relay layer**:
|
|
28
|
+
|
|
29
|
+
| Approach | Continuous-Claude-v2 | Agent Relay (this proposal) |
|
|
30
|
+
|----------|----------------------|----------------------------|
|
|
31
|
+
| Integration point | Claude Code hooks | Relay wrapper/protocol |
|
|
32
|
+
| CLI support | Claude only | Any CLI |
|
|
33
|
+
| Trigger mechanism | Hook events | Output patterns + relay messages |
|
|
34
|
+
| Context injection | Hook injection | Message injection via PTY |
|
|
35
|
+
|
|
36
|
+
## Relationship to Trajectory System (PR #38)
|
|
37
|
+
|
|
38
|
+
This proposal is designed to **complement** the trajectory system (PR #38), not replace it:
|
|
39
|
+
|
|
40
|
+
| System | Scope | Focus |
|
|
41
|
+
|--------|-------|-------|
|
|
42
|
+
| **Trajectory** | Within-session | Decision tracking, PDERO phases |
|
|
43
|
+
| **Continuity** | Cross-session | State persistence, context reload |
|
|
44
|
+
|
|
45
|
+
### How They Work Together
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
49
|
+
│ Agent Work Session │
|
|
50
|
+
├─────────────────────────────────────────────────────────────┤
|
|
51
|
+
│ TRAJECTORY (within-session, fine-grained) │
|
|
52
|
+
│ ├─ Plan phase: "Implement auth" │
|
|
53
|
+
│ ├─ Design phase: "Use JWT + refresh tokens" │
|
|
54
|
+
│ ├─ Execute phase: [decisions, tool calls, code] │
|
|
55
|
+
│ ├─ Review phase: "Tests pass" │
|
|
56
|
+
│ └─ Observe phase: "Performance good" │
|
|
57
|
+
│ │ │
|
|
58
|
+
│ ▼ (on completion or context limit) │
|
|
59
|
+
│ CONTINUITY (cross-session, coarse-grained) │
|
|
60
|
+
│ └─ Handoff auto-generated from trajectory │
|
|
61
|
+
│ ├─ Summary: trajectory.summary │
|
|
62
|
+
│ ├─ Decisions: trajectory.decisions[] │
|
|
63
|
+
│ ├─ Phase: trajectory.currentPhase │
|
|
64
|
+
│ └─ Next steps: derived from PDERO state │
|
|
65
|
+
└─────────────────────────────────────────────────────────────┘
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Integration Points
|
|
69
|
+
|
|
70
|
+
1. **Trajectory completion → Auto-handoff**
|
|
71
|
+
- When `trail complete` is called, auto-generate a handoff
|
|
72
|
+
- Include trajectory summary, decisions, learnings
|
|
73
|
+
|
|
74
|
+
2. **Hooks system shared**
|
|
75
|
+
- Use trajectory's hooks (PR #38) for continuity triggers
|
|
76
|
+
- `onAgentStop` → save ledger
|
|
77
|
+
- `onMessageSent` → update ledger
|
|
78
|
+
|
|
79
|
+
3. **Memory adapters optional backend**
|
|
80
|
+
- Continuity can optionally use trajectory's memory adapters
|
|
81
|
+
- Default: SQLite + FTS5 (local, searchable)
|
|
82
|
+
- Optional: supermemory.ai (cloud, semantic search)
|
|
83
|
+
|
|
84
|
+
4. **PDERO phases inform ledger**
|
|
85
|
+
- Ledger's `currentTask` maps to trajectory's current phase
|
|
86
|
+
- Decisions from trajectory populate ledger's `keyDecisions`
|
|
87
|
+
|
|
88
|
+
### Non-Overlapping Responsibilities
|
|
89
|
+
|
|
90
|
+
| Trajectory Handles | Continuity Handles |
|
|
91
|
+
|-------------------|-------------------|
|
|
92
|
+
| PDERO phase transitions | Cross-session state reload |
|
|
93
|
+
| Decision recording | Handoff document creation |
|
|
94
|
+
| `trail` CLI integration | Context injection on spawn |
|
|
95
|
+
| Fine-grained step tracking | FTS5 searchable history |
|
|
96
|
+
|
|
97
|
+
## Core Concepts
|
|
98
|
+
|
|
99
|
+
### Philosophy: "Clear, Don't Compact"
|
|
100
|
+
|
|
101
|
+
Instead of relying on lossy summarization:
|
|
102
|
+
1. Explicitly save state before context fills up
|
|
103
|
+
2. Clear/restart the agent with fresh context
|
|
104
|
+
3. Inject continuity context on startup
|
|
105
|
+
|
|
106
|
+
### Key Components
|
|
107
|
+
|
|
108
|
+
| Component | Purpose | Persistence |
|
|
109
|
+
|-----------|---------|-------------|
|
|
110
|
+
| **Ledgers** | Within-session state snapshots | Per-agent, ephemeral |
|
|
111
|
+
| **Handoffs** | Cross-session transfer documents | Permanent, searchable |
|
|
112
|
+
| **Artifact Index** | SQLite+FTS5 knowledge base | Permanent |
|
|
113
|
+
| **Continuity Protocol** | Relay message extensions | N/A |
|
|
114
|
+
| **Trajectory Bridge** | Integration with PR #38 | Via hooks |
|
|
115
|
+
|
|
116
|
+
## Integration Architecture
|
|
117
|
+
|
|
118
|
+
### Layer 1: Output Pattern Detection
|
|
119
|
+
|
|
120
|
+
Extend the existing `->relay:` pattern system:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
# Agent requests handoff creation
|
|
124
|
+
->continuity:save <<<
|
|
125
|
+
Current task: Implementing auth module
|
|
126
|
+
Completed: User model, JWT utils
|
|
127
|
+
Next: Login endpoint
|
|
128
|
+
Key decision: Using refresh tokens
|
|
129
|
+
>>>
|
|
130
|
+
|
|
131
|
+
# Agent requests context reload
|
|
132
|
+
->continuity:load
|
|
133
|
+
|
|
134
|
+
# Agent marks uncertainty
|
|
135
|
+
->continuity:uncertain "API rate limit handling unclear"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Implementation:** Extend `src/wrapper/parser.ts`
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
interface ContinuityCommand {
|
|
142
|
+
type: 'save' | 'load' | 'uncertain' | 'search';
|
|
143
|
+
content?: string;
|
|
144
|
+
query?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function parseContinuityCommand(output: string): ContinuityCommand | null;
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Layer 2: Relay Protocol Extensions
|
|
151
|
+
|
|
152
|
+
Add continuity message types to the protocol:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
// src/protocol/types.ts
|
|
156
|
+
type MessageType =
|
|
157
|
+
| 'MESSAGE'
|
|
158
|
+
| 'ACK'
|
|
159
|
+
| 'NACK'
|
|
160
|
+
// New continuity types
|
|
161
|
+
| 'CONTINUITY_SAVE' // Agent saves state
|
|
162
|
+
| 'CONTINUITY_LOAD' // Agent requests context
|
|
163
|
+
| 'CONTINUITY_SEARCH' // Agent searches history
|
|
164
|
+
| 'CONTINUITY_INJECT'; // Daemon injects context
|
|
165
|
+
|
|
166
|
+
interface ContinuitySavePayload {
|
|
167
|
+
agentName: string;
|
|
168
|
+
ledger: Ledger;
|
|
169
|
+
createHandoff: boolean;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
interface ContinuityInjectPayload {
|
|
173
|
+
agentName: string;
|
|
174
|
+
context: string; // Markdown to inject
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Layer 3: Wrapper-Level Automation
|
|
179
|
+
|
|
180
|
+
The `TmuxWrapper` monitors agents and handles continuity:
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
// src/wrapper/tmux-wrapper.ts additions
|
|
184
|
+
|
|
185
|
+
class TmuxWrapper {
|
|
186
|
+
private continuityManager: ContinuityManager;
|
|
187
|
+
|
|
188
|
+
// Monitor output for continuity patterns
|
|
189
|
+
private handleOutput(output: string) {
|
|
190
|
+
const cmd = parseContinuityCommand(output);
|
|
191
|
+
if (cmd) {
|
|
192
|
+
this.handleContinuityCommand(cmd);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Inject context on agent spawn
|
|
197
|
+
async spawnAgent(config: AgentConfig) {
|
|
198
|
+
await this.startTmuxSession();
|
|
199
|
+
|
|
200
|
+
// Load and inject continuity context
|
|
201
|
+
const context = await this.continuityManager.getStartupContext(config.name);
|
|
202
|
+
if (context) {
|
|
203
|
+
await this.injectMessage(context);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
await this.startAgentProcess(config);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Auto-save before agent restart
|
|
210
|
+
async restartAgent(agentName: string, reason: string) {
|
|
211
|
+
// Save current state
|
|
212
|
+
await this.continuityManager.autoSave(agentName, reason);
|
|
213
|
+
|
|
214
|
+
// Restart with fresh context
|
|
215
|
+
await this.killAgent(agentName);
|
|
216
|
+
await this.spawnAgent({ name: agentName, ... });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Layer 4: Continuity Manager
|
|
222
|
+
|
|
223
|
+
Central service managing state persistence:
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
// src/continuity/manager.ts
|
|
227
|
+
class ContinuityManager {
|
|
228
|
+
private ledgerStore: LedgerStore;
|
|
229
|
+
private handoffStore: HandoffStore;
|
|
230
|
+
private artifactIndex: ArtifactIndex;
|
|
231
|
+
|
|
232
|
+
// Get context to inject on agent startup
|
|
233
|
+
async getStartupContext(agentName: string): Promise<string | null> {
|
|
234
|
+
const ledger = await this.ledgerStore.load(agentName);
|
|
235
|
+
const handoff = await this.handoffStore.getLatest(agentName);
|
|
236
|
+
const learnings = await this.artifactIndex.getRelevantLearnings(agentName);
|
|
237
|
+
|
|
238
|
+
if (!ledger && !handoff) return null;
|
|
239
|
+
|
|
240
|
+
return this.formatStartupContext({ ledger, handoff, learnings });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Save agent state (called via relay protocol or output pattern)
|
|
244
|
+
async save(agentName: string, content: string, createHandoff: boolean) {
|
|
245
|
+
const ledger = this.parseLedger(content);
|
|
246
|
+
await this.ledgerStore.save(agentName, ledger);
|
|
247
|
+
|
|
248
|
+
if (createHandoff) {
|
|
249
|
+
const handoff = this.createHandoff(agentName, ledger);
|
|
250
|
+
await this.handoffStore.save(handoff);
|
|
251
|
+
await this.artifactIndex.index(handoff);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Auto-save triggered by wrapper (restart, crash, etc.)
|
|
256
|
+
async autoSave(agentName: string, reason: string) {
|
|
257
|
+
// Request state from agent via injected prompt
|
|
258
|
+
// Or save last known state from ledger
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Search across all handoffs
|
|
262
|
+
async search(query: string): Promise<Handoff[]> {
|
|
263
|
+
return this.artifactIndex.search(query);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Data Structures
|
|
269
|
+
|
|
270
|
+
### Ledger (Within-Session)
|
|
271
|
+
|
|
272
|
+
```typescript
|
|
273
|
+
interface Ledger {
|
|
274
|
+
agentName: string;
|
|
275
|
+
sessionId: string;
|
|
276
|
+
cli: string; // 'claude' | 'codex' | 'gemini' | string
|
|
277
|
+
|
|
278
|
+
// State
|
|
279
|
+
currentTask: string;
|
|
280
|
+
completed: string[];
|
|
281
|
+
inProgress: string[];
|
|
282
|
+
blocked: string[];
|
|
283
|
+
|
|
284
|
+
// Decisions & Context
|
|
285
|
+
keyDecisions: Decision[];
|
|
286
|
+
uncertainItems: string[]; // Things to verify
|
|
287
|
+
fileContext: FileRef[]; // Recently touched files
|
|
288
|
+
|
|
289
|
+
updatedAt: Date;
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Handoff (Cross-Session)
|
|
294
|
+
|
|
295
|
+
```typescript
|
|
296
|
+
interface Handoff {
|
|
297
|
+
id: string;
|
|
298
|
+
agentName: string;
|
|
299
|
+
cli: string;
|
|
300
|
+
|
|
301
|
+
// Content
|
|
302
|
+
summary: string;
|
|
303
|
+
taskDescription: string;
|
|
304
|
+
completedWork: string[];
|
|
305
|
+
nextSteps: string[];
|
|
306
|
+
|
|
307
|
+
// References
|
|
308
|
+
fileReferences: FileRef[];
|
|
309
|
+
decisions: Decision[];
|
|
310
|
+
relatedHandoffs: string[]; // Links to previous handoffs
|
|
311
|
+
|
|
312
|
+
// Metadata
|
|
313
|
+
createdAt: Date;
|
|
314
|
+
triggerReason: 'manual' | 'auto_restart' | 'context_limit' | 'crash';
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### File Structure
|
|
319
|
+
|
|
320
|
+
```
|
|
321
|
+
.agent-relay/
|
|
322
|
+
├── continuity/
|
|
323
|
+
│ ├── ledgers/
|
|
324
|
+
│ │ ├── Alice.json # Per-agent current state
|
|
325
|
+
│ │ └── Bob.json
|
|
326
|
+
│ ├── handoffs/
|
|
327
|
+
│ │ ├── Alice/
|
|
328
|
+
│ │ │ ├── 2025-12-31-auth-module.md
|
|
329
|
+
│ │ │ └── 2025-12-30-user-model.md
|
|
330
|
+
│ │ └── Bob/
|
|
331
|
+
│ │ └── 2025-12-31-api-endpoints.md
|
|
332
|
+
│ └── artifact-index.db # SQLite + FTS5
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Agent Instructions (CLI-Agnostic)
|
|
336
|
+
|
|
337
|
+
Add to agent system prompts via CLAUDE.md / agent config:
|
|
338
|
+
|
|
339
|
+
```markdown
|
|
340
|
+
# Session Continuity
|
|
341
|
+
|
|
342
|
+
You have access to a continuity system that preserves your work across sessions.
|
|
343
|
+
|
|
344
|
+
## Saving State
|
|
345
|
+
|
|
346
|
+
When you want to save your current progress (recommended before long operations):
|
|
347
|
+
|
|
348
|
+
\```
|
|
349
|
+
->continuity:save <<<
|
|
350
|
+
Current task: [what you're working on]
|
|
351
|
+
Completed: [what's done]
|
|
352
|
+
In progress: [what's partially done]
|
|
353
|
+
Next steps: [what comes next]
|
|
354
|
+
Key decisions: [important choices made]
|
|
355
|
+
Uncertain: [things to verify]
|
|
356
|
+
Files: [key files with line numbers]
|
|
357
|
+
>>>
|
|
358
|
+
\```
|
|
359
|
+
|
|
360
|
+
## Loading Previous Context
|
|
361
|
+
|
|
362
|
+
To load your previous session state:
|
|
363
|
+
\```
|
|
364
|
+
->continuity:load
|
|
365
|
+
\```
|
|
366
|
+
|
|
367
|
+
## Searching History
|
|
368
|
+
|
|
369
|
+
To search past handoffs and decisions:
|
|
370
|
+
\```
|
|
371
|
+
->continuity:search "authentication patterns"
|
|
372
|
+
\```
|
|
373
|
+
|
|
374
|
+
The relay system will inject context automatically on session start.
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
## Dashboard Integration
|
|
378
|
+
|
|
379
|
+
### Components
|
|
380
|
+
|
|
381
|
+
```typescript
|
|
382
|
+
// Context meter showing agent "freshness"
|
|
383
|
+
interface AgentContextMeterProps {
|
|
384
|
+
agentName: string;
|
|
385
|
+
hasLedger: boolean;
|
|
386
|
+
lastHandoff: Date | null;
|
|
387
|
+
handoffCount: number;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Handoff browser with search
|
|
391
|
+
interface HandoffBrowserProps {
|
|
392
|
+
agentName?: string;
|
|
393
|
+
onSelect: (handoff: Handoff) => void;
|
|
394
|
+
onInject: (handoff: Handoff, targetAgent: string) => void;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// Ledger viewer showing current agent state
|
|
398
|
+
interface LedgerViewerProps {
|
|
399
|
+
agentName: string;
|
|
400
|
+
ledger: Ledger | null;
|
|
401
|
+
onRefresh: () => void;
|
|
402
|
+
onCreateHandoff: () => void;
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### API Endpoints
|
|
407
|
+
|
|
408
|
+
```typescript
|
|
409
|
+
// Continuity API routes
|
|
410
|
+
router.get('/continuity/:agent/ledger', getLedger);
|
|
411
|
+
router.post('/continuity/:agent/ledger', saveLedger);
|
|
412
|
+
router.get('/continuity/:agent/handoffs', getHandoffs);
|
|
413
|
+
router.post('/continuity/:agent/handoff', createHandoff);
|
|
414
|
+
router.get('/continuity/search', searchHandoffs);
|
|
415
|
+
router.post('/continuity/:agent/inject', injectContext);
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
## CLI Commands
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
# View agent's current ledger
|
|
422
|
+
agent-relay continuity ledger Alice
|
|
423
|
+
|
|
424
|
+
# List handoffs for an agent
|
|
425
|
+
agent-relay continuity handoffs Alice
|
|
426
|
+
|
|
427
|
+
# Search all handoffs
|
|
428
|
+
agent-relay continuity search "authentication"
|
|
429
|
+
|
|
430
|
+
# Manually create handoff for agent
|
|
431
|
+
agent-relay continuity save Alice --reason "manual checkpoint"
|
|
432
|
+
|
|
433
|
+
# Inject context into running agent
|
|
434
|
+
agent-relay continuity inject Alice --handoff <handoff-id>
|
|
435
|
+
|
|
436
|
+
# Clear continuity data for agent
|
|
437
|
+
agent-relay continuity clear Alice
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
## Implementation Roadmap
|
|
441
|
+
|
|
442
|
+
### Milestone 1: Core Infrastructure
|
|
443
|
+
- [ ] `ContinuityManager` class
|
|
444
|
+
- [ ] `LedgerStore` with JSON file backend
|
|
445
|
+
- [ ] `HandoffStore` with markdown files
|
|
446
|
+
- [ ] Directory structure initialization
|
|
447
|
+
|
|
448
|
+
### Milestone 2: Protocol Integration
|
|
449
|
+
- [ ] Output pattern parser (`->continuity:` commands)
|
|
450
|
+
- [ ] Protocol message types
|
|
451
|
+
- [ ] Router handling for continuity messages
|
|
452
|
+
|
|
453
|
+
### Milestone 3: Wrapper Integration
|
|
454
|
+
- [ ] Context injection on spawn
|
|
455
|
+
- [ ] Auto-save on restart/crash
|
|
456
|
+
- [ ] Output monitoring for continuity patterns
|
|
457
|
+
|
|
458
|
+
### Milestone 4: Artifact Index
|
|
459
|
+
- [ ] SQLite + FTS5 schema
|
|
460
|
+
- [ ] Handoff indexing
|
|
461
|
+
- [ ] Search API
|
|
462
|
+
|
|
463
|
+
### Milestone 5: Dashboard & CLI
|
|
464
|
+
- [ ] `AgentContextMeter` component
|
|
465
|
+
- [ ] `HandoffBrowser` component
|
|
466
|
+
- [ ] `LedgerViewer` component
|
|
467
|
+
- [ ] CLI commands
|
|
468
|
+
|
|
469
|
+
### Milestone 6: Advanced Features
|
|
470
|
+
- [ ] Cross-agent context sharing
|
|
471
|
+
- [ ] Learning extraction
|
|
472
|
+
- [ ] Automatic context limit detection
|
|
473
|
+
|
|
474
|
+
## Trajectory Bridge (PR #38 Integration)
|
|
475
|
+
|
|
476
|
+
### Bridge Implementation
|
|
477
|
+
|
|
478
|
+
```typescript
|
|
479
|
+
// src/continuity/trajectory-bridge.ts
|
|
480
|
+
import { getTrajectoryStatus, type CompleteTrajectoryOptions } from '../trajectory/integration.js';
|
|
481
|
+
import type { HookContext } from '../hooks/types.js';
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Bridge between trajectory system and continuity system.
|
|
485
|
+
* Automatically creates handoffs from trajectory data.
|
|
486
|
+
*/
|
|
487
|
+
export class TrajectoryBridge {
|
|
488
|
+
constructor(
|
|
489
|
+
private continuityManager: ContinuityManager,
|
|
490
|
+
private hookRegistry: HookRegistry
|
|
491
|
+
) {
|
|
492
|
+
this.registerHooks();
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
private registerHooks() {
|
|
496
|
+
// When trajectory completes, create handoff
|
|
497
|
+
this.hookRegistry.register('onTrajectoryComplete', async (ctx, data) => {
|
|
498
|
+
const handoff = await this.createHandoffFromTrajectory(
|
|
499
|
+
ctx.agentId,
|
|
500
|
+
data.trajectory
|
|
501
|
+
);
|
|
502
|
+
await this.continuityManager.saveHandoff(handoff);
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
// When agent stops, save ledger with trajectory context
|
|
506
|
+
this.hookRegistry.register('onAgentStop', async (ctx) => {
|
|
507
|
+
const trajectoryStatus = await getTrajectoryStatus();
|
|
508
|
+
if (trajectoryStatus.active) {
|
|
509
|
+
await this.continuityManager.saveLedger(ctx.agentId, {
|
|
510
|
+
currentPhase: trajectoryStatus.phase,
|
|
511
|
+
trajectoryId: trajectoryStatus.trajectoryId,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
async createHandoffFromTrajectory(
|
|
518
|
+
agentName: string,
|
|
519
|
+
trajectory: TrajectoryData
|
|
520
|
+
): Promise<Handoff> {
|
|
521
|
+
return {
|
|
522
|
+
id: generateId(),
|
|
523
|
+
agentName,
|
|
524
|
+
cli: trajectory.agent || 'unknown',
|
|
525
|
+
summary: trajectory.summary || '',
|
|
526
|
+
taskDescription: trajectory.task?.title || '',
|
|
527
|
+
completedWork: trajectory.completedSteps || [],
|
|
528
|
+
nextSteps: this.deriveNextSteps(trajectory),
|
|
529
|
+
fileReferences: trajectory.filesModified || [],
|
|
530
|
+
decisions: trajectory.decisions || [],
|
|
531
|
+
relatedHandoffs: [],
|
|
532
|
+
createdAt: new Date(),
|
|
533
|
+
triggerReason: 'trajectory_complete',
|
|
534
|
+
// Trajectory-specific fields
|
|
535
|
+
trajectoryId: trajectory.id,
|
|
536
|
+
pderoPhase: trajectory.currentPhase,
|
|
537
|
+
confidence: trajectory.confidence,
|
|
538
|
+
learnings: trajectory.learnings,
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### Handoff Extended for Trajectory
|
|
545
|
+
|
|
546
|
+
```typescript
|
|
547
|
+
interface Handoff {
|
|
548
|
+
// ... existing fields ...
|
|
549
|
+
|
|
550
|
+
// Trajectory integration (optional, present if from trajectory)
|
|
551
|
+
trajectoryId?: string;
|
|
552
|
+
pderoPhase?: PDEROPhase;
|
|
553
|
+
confidence?: number;
|
|
554
|
+
learnings?: string[];
|
|
555
|
+
}
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
## Files to Create/Modify
|
|
559
|
+
|
|
560
|
+
### New Files
|
|
561
|
+
```
|
|
562
|
+
src/continuity/
|
|
563
|
+
├── index.ts
|
|
564
|
+
├── manager.ts
|
|
565
|
+
├── ledger-store.ts
|
|
566
|
+
├── handoff-store.ts
|
|
567
|
+
├── artifact-index.ts
|
|
568
|
+
├── parser.ts # Continuity command parsing
|
|
569
|
+
├── formatter.ts # Context formatting for injection
|
|
570
|
+
└── trajectory-bridge.ts # Integration with PR #38
|
|
571
|
+
|
|
572
|
+
src/dashboard/react-components/
|
|
573
|
+
├── AgentContextMeter.tsx
|
|
574
|
+
├── LedgerViewer.tsx
|
|
575
|
+
└── HandoffBrowser.tsx
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
### Modified Files
|
|
579
|
+
```
|
|
580
|
+
src/wrapper/parser.ts # Add continuity pattern parsing
|
|
581
|
+
src/wrapper/tmux-wrapper.ts # Add continuity handling
|
|
582
|
+
src/protocol/types.ts # Add continuity message types
|
|
583
|
+
src/daemon/router.ts # Handle continuity messages
|
|
584
|
+
src/daemon/server.ts # Add continuity API endpoints
|
|
585
|
+
src/cli/index.ts # Add continuity commands
|
|
586
|
+
src/hooks/registry.ts # Register continuity hooks (PR #38)
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
## CLI Support Matrix
|
|
590
|
+
|
|
591
|
+
| Feature | Claude | Codex | Gemini | Custom |
|
|
592
|
+
|---------|--------|-------|--------|--------|
|
|
593
|
+
| Output pattern detection | ✅ | ✅ | ✅ | ✅ |
|
|
594
|
+
| Context injection | ✅ | ✅ | ✅ | ✅ |
|
|
595
|
+
| Auto-save on restart | ✅ | ✅ | ✅ | ✅ |
|
|
596
|
+
| Manual save command | ✅ | ✅ | ✅ | ✅ |
|
|
597
|
+
| Handoff search | ✅ | ✅ | ✅ | ✅ |
|
|
598
|
+
|
|
599
|
+
## Success Metrics
|
|
600
|
+
|
|
601
|
+
1. **CLI-agnostic**: Works with Claude, Codex, Gemini without modification
|
|
602
|
+
2. **Seamless restarts**: Agents resume work after restart within 1 message
|
|
603
|
+
3. **Searchable history**: Find past decisions in <100ms
|
|
604
|
+
4. **Zero data loss**: No state lost across 10+ restart cycles
|
|
605
|
+
5. **Dashboard visibility**: Real-time continuity status for all agents
|
|
606
|
+
|
|
607
|
+
## Risks & Mitigations
|
|
608
|
+
|
|
609
|
+
| Risk | Mitigation |
|
|
610
|
+
|------|------------|
|
|
611
|
+
| Output parsing fragility | Well-defined patterns, fuzzy matching |
|
|
612
|
+
| Context injection timing | Wait for agent ready signal |
|
|
613
|
+
| Storage growth | Auto-archive, configurable retention |
|
|
614
|
+
| Cross-CLI compatibility | Test matrix, fallback behaviors |
|
|
615
|
+
|
|
616
|
+
## References
|
|
617
|
+
|
|
618
|
+
- [Continuous-Claude-v2](https://github.com/parcadei/Continuous-Claude-v2)
|
|
619
|
+
- [Agent Relay Architecture](../ARCHITECTURE.md)
|
|
620
|
+
- [Relay Protocol Spec](../protocol/README.md)
|
|
621
|
+
- [Trajectory Integration PR #38](https://github.com/AgentWorkforce/relay/pull/38)
|
|
622
|
+
- [Agent Trajectories Package](https://github.com/steveyegge/agent-trajectories)
|