agent-relay 1.6.0 → 2.0.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/.cursor/mcp.json +11 -0
- package/.gitleaks.toml +26 -0
- package/.mcp.json +11 -0
- package/.nvmrc +1 -1
- package/.turbo/cache/013415461711937f-meta.json +1 -0
- package/.turbo/cache/013415461711937f.tar.zst +0 -0
- package/.turbo/cache/0562b1ff326acd6d-meta.json +1 -0
- package/.turbo/cache/0562b1ff326acd6d.tar.zst +0 -0
- package/.turbo/cache/0b46e0e17254882f-meta.json +1 -0
- package/.turbo/cache/0b46e0e17254882f.tar.zst +0 -0
- package/.turbo/cache/3799eda981d53d14-meta.json +1 -0
- package/.turbo/cache/3799eda981d53d14.tar.zst +0 -0
- package/.turbo/cache/47e9d8f404ed064d-meta.json +1 -0
- package/.turbo/cache/47e9d8f404ed064d.tar.zst +0 -0
- package/.turbo/cache/4cde1d1e5b298099-meta.json +1 -0
- package/.turbo/cache/4cde1d1e5b298099.tar.zst +0 -0
- package/.turbo/cache/538eea955c0936ef-meta.json +1 -0
- package/.turbo/cache/538eea955c0936ef.tar.zst +0 -0
- package/.turbo/cache/5dceac7f229f5d5d-meta.json +1 -0
- package/.turbo/cache/5dceac7f229f5d5d.tar.zst +0 -0
- package/.turbo/cache/64c15b201819367d-meta.json +1 -0
- package/.turbo/cache/64c15b201819367d.tar.zst +0 -0
- package/.turbo/cache/6d6a21a05efca434-meta.json +1 -0
- package/.turbo/cache/6d6a21a05efca434.tar.zst +0 -0
- package/.turbo/cache/7562610cb03ec040-meta.json +1 -0
- package/.turbo/cache/7562610cb03ec040.tar.zst +0 -0
- package/.turbo/cache/81a2456e17af4d7f-meta.json +1 -0
- package/.turbo/cache/81a2456e17af4d7f.tar.zst +0 -0
- package/.turbo/cache/823fc2a7b12f724c-meta.json +1 -0
- package/.turbo/cache/823fc2a7b12f724c.tar.zst +0 -0
- package/.turbo/cache/9daad16a073d1f91-meta.json +1 -0
- package/.turbo/cache/9daad16a073d1f91.tar.zst +0 -0
- package/.turbo/cache/b81ccbab0a606b60-meta.json +1 -0
- package/.turbo/cache/b81ccbab0a606b60.tar.zst +0 -0
- package/.turbo/cache/cf98487988bfcf91-meta.json +1 -0
- package/.turbo/cache/cf98487988bfcf91.tar.zst +0 -0
- package/.turbo/cache/cfdf7c57dca71f27-meta.json +1 -0
- package/.turbo/cache/cfdf7c57dca71f27.tar.zst +0 -0
- package/.turbo/cache/d3063ef43811b1e5-meta.json +1 -0
- package/.turbo/cache/d3063ef43811b1e5.tar.zst +0 -0
- package/.turbo/cache/de28892eb7678e65-meta.json +1 -0
- package/.turbo/cache/de28892eb7678e65.tar.zst +0 -0
- package/.turbo/cache/ec29adce408132ba-meta.json +1 -0
- package/.turbo/cache/ec29adce408132ba.tar.zst +0 -0
- package/.turbo/cache/f70450d8d305f172-meta.json +1 -0
- package/.turbo/cache/f70450d8d305f172.tar.zst +0 -0
- package/.turbo/cache/fe384d5d6b7a983a-meta.json +1 -0
- package/.turbo/cache/fe384d5d6b7a983a.tar.zst +0 -0
- package/ARCHITECTURE.md +10 -10
- package/CHANGELOG.md +38 -0
- package/LICENSE +185 -17
- package/README.md +43 -5
- package/SESSION_HANDOFF.md +67 -0
- package/bin/relay-pty +0 -0
- package/bin/relay-pty-darwin-arm64 +0 -0
- package/bin/relay-pty-darwin-x64 +0 -0
- package/bin/relay-pty-linux-x64 +0 -0
- package/deploy/workspace/entrypoint.sh +79 -11
- package/deploy/workspace/git-credential-relay +152 -27
- package/deploy/workspace/git-credential-relay.test.sh +230 -0
- package/dist/dashboard/out/404.html +1 -1
- package/dist/dashboard/out/_next/static/chunks/116-a883fca163f3a5bc.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/320-900169c942e31422.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/631-af51bad94027527a.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/766-2aea80818f7eb0d8.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/891-5cb1513eeb97a891.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/page-2e525b1dcc790967.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/page-4e64923d73c35bc9.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-e65a0010da6ea5be.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/providers/setup/[provider]/page-84161c802b020a1f.js +1 -0
- package/dist/dashboard/out/_next/static/css/99c2552394077586.css +1 -0
- package/dist/dashboard/out/app/onboarding.html +1 -1
- package/dist/dashboard/out/app/onboarding.txt +1 -1
- package/dist/dashboard/out/app.html +1 -1
- package/dist/dashboard/out/app.txt +2 -2
- package/dist/dashboard/out/cloud/link.html +1 -1
- package/dist/dashboard/out/cloud/link.txt +2 -2
- package/dist/dashboard/out/connect-repos.html +1 -1
- package/dist/dashboard/out/connect-repos.txt +1 -1
- 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 +2 -2
- package/dist/dashboard/out/login.txt +1 -1
- 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/setup/claude.html +1 -1
- package/dist/dashboard/out/providers/setup/claude.txt +2 -2
- package/dist/dashboard/out/providers/setup/codex.html +1 -1
- package/dist/dashboard/out/providers/setup/codex.txt +2 -2
- package/dist/dashboard/out/providers/setup/cursor.html +1 -0
- package/dist/dashboard/out/providers/setup/cursor.txt +8 -0
- package/dist/dashboard/out/providers.html +1 -1
- package/dist/dashboard/out/providers.txt +2 -2
- package/dist/dashboard/out/signup.html +2 -2
- package/dist/dashboard/out/signup.txt +1 -1
- package/dist/src/bridge/index.d.ts +8 -0
- package/dist/src/bridge/index.js +8 -0
- package/dist/src/cli/index.js +3089 -0
- package/dist/src/cloud/index.d.ts +8 -0
- package/dist/src/cloud/index.js +8 -0
- package/dist/src/config/relay-config.d.ts +5 -0
- package/dist/src/config/relay-config.js +5 -0
- package/dist/src/continuity/index.d.ts +5 -0
- package/dist/src/continuity/index.js +5 -0
- package/dist/src/daemon/index.d.ts +8 -0
- package/dist/src/daemon/index.js +9 -0
- package/dist/src/dashboard-server/index.d.ts +8 -0
- package/dist/src/dashboard-server/index.js +8 -0
- package/dist/src/hooks/index.d.ts +10 -0
- package/dist/src/hooks/index.js +10 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/index.js +16 -0
- package/dist/src/memory/index.d.ts +5 -0
- package/dist/src/memory/index.js +5 -0
- package/dist/src/policy/index.d.ts +5 -0
- package/dist/src/policy/index.js +5 -0
- package/dist/src/protocol/index.d.ts +8 -0
- package/dist/src/protocol/index.js +8 -0
- package/dist/src/resiliency/index.d.ts +5 -0
- package/dist/src/resiliency/index.js +5 -0
- package/dist/src/shared/cli-auth-config.d.ts +5 -0
- package/dist/src/shared/cli-auth-config.js +5 -0
- package/dist/src/state/index.d.ts +5 -0
- package/dist/src/state/index.js +5 -0
- package/dist/src/storage/index.d.ts +8 -0
- package/dist/src/storage/index.js +8 -0
- package/dist/src/trajectory/index.d.ts +5 -0
- package/dist/src/trajectory/index.js +5 -0
- package/dist/src/utils/index.d.ts +5 -0
- package/dist/src/utils/index.js +5 -0
- package/dist/src/wrapper/index.d.ts +8 -0
- package/dist/src/wrapper/index.js +11 -0
- package/package.json +64 -19
- package/packages/api-types/dist/index.d.ts +21 -0
- package/packages/api-types/dist/index.js +22 -0
- package/packages/api-types/dist/schemas/agent.d.ts +259 -0
- package/packages/api-types/dist/schemas/agent.js +102 -0
- package/packages/api-types/dist/schemas/api.d.ts +290 -0
- package/packages/api-types/dist/schemas/api.js +162 -0
- package/packages/api-types/dist/schemas/decision.d.ts +230 -0
- package/packages/api-types/dist/schemas/decision.js +104 -0
- package/packages/api-types/dist/schemas/fleet.d.ts +615 -0
- package/packages/api-types/dist/schemas/fleet.js +71 -0
- package/packages/api-types/dist/schemas/history.d.ts +180 -0
- package/packages/api-types/dist/schemas/history.js +72 -0
- package/packages/api-types/dist/schemas/index.d.ts +14 -0
- package/packages/api-types/dist/schemas/index.js +22 -0
- package/packages/api-types/dist/schemas/message.d.ts +456 -0
- package/packages/api-types/dist/schemas/message.js +88 -0
- package/packages/api-types/dist/schemas/session.d.ts +60 -0
- package/packages/api-types/dist/schemas/session.js +36 -0
- package/packages/api-types/dist/schemas/task.d.ts +111 -0
- package/packages/api-types/dist/schemas/task.js +64 -0
- package/packages/api-types/package.json +61 -0
- package/packages/api-types/scripts/generate-openapi.ts +106 -0
- package/packages/bridge/dist/index.d.ts +8 -0
- package/packages/bridge/dist/index.js +9 -0
- package/packages/bridge/dist/multi-project-client.d.ts +99 -0
- package/packages/bridge/dist/multi-project-client.js +389 -0
- package/packages/bridge/dist/shadow-cli.js +75 -0
- package/packages/bridge/dist/spawner.d.ts +210 -0
- package/packages/bridge/dist/spawner.js +1276 -0
- package/packages/bridge/dist/types.d.ts +131 -0
- package/packages/bridge/dist/utils.d.ts +15 -0
- package/packages/bridge/dist/utils.js +60 -0
- package/packages/bridge/package.json +40 -0
- package/packages/cloud/dist/api/admin.js +225 -0
- package/packages/cloud/dist/api/billing.js +564 -0
- package/packages/cloud/dist/api/cli-pty-runner.d.ts +53 -0
- package/packages/cloud/dist/api/cli-pty-runner.js +193 -0
- package/packages/cloud/dist/api/codex-auth-helper.js +327 -0
- package/packages/cloud/dist/api/consensus.js +261 -0
- package/packages/cloud/dist/api/coordinators.js +750 -0
- package/packages/cloud/dist/api/daemons.js +535 -0
- package/packages/cloud/dist/api/generic-webhooks.js +129 -0
- package/packages/cloud/dist/api/github-app.js +223 -0
- package/packages/cloud/dist/api/monitoring.js +578 -0
- package/packages/cloud/dist/api/nango-auth.js +674 -0
- package/packages/cloud/dist/api/onboarding.d.ts +15 -0
- package/packages/cloud/dist/api/onboarding.js +679 -0
- package/packages/cloud/dist/api/policy.js +229 -0
- package/packages/cloud/dist/api/provider-env.d.ts +14 -0
- package/packages/cloud/dist/api/provider-env.js +75 -0
- package/packages/cloud/dist/api/providers.js +564 -0
- package/packages/cloud/dist/api/repos.js +577 -0
- package/packages/cloud/dist/api/sessions.d.ts +11 -0
- package/packages/cloud/dist/api/sessions.js +302 -0
- package/packages/cloud/dist/api/teams.js +281 -0
- package/packages/cloud/dist/api/test-helpers.js +745 -0
- package/packages/cloud/dist/api/workspaces.js +1799 -0
- package/packages/cloud/dist/billing/plans.js +245 -0
- package/packages/cloud/dist/config.d.ts +5 -0
- package/packages/cloud/dist/config.js +5 -0
- package/packages/cloud/dist/db/drizzle.d.ts +256 -0
- package/packages/cloud/dist/db/drizzle.js +1286 -0
- package/packages/cloud/dist/db/schema.d.ts +4873 -0
- package/packages/cloud/dist/db/schema.js +620 -0
- package/packages/cloud/dist/index.d.ts +11 -0
- package/packages/cloud/dist/index.js +38 -0
- package/packages/cloud/dist/provisioner/index.d.ts +207 -0
- package/packages/cloud/dist/provisioner/index.js +2114 -0
- package/packages/cloud/dist/server.js +1924 -0
- package/packages/cloud/dist/services/index.d.ts +17 -0
- package/packages/cloud/dist/services/index.js +25 -0
- package/packages/cloud/dist/services/intro-expiration.d.ts +60 -0
- package/packages/cloud/dist/services/intro-expiration.js +252 -0
- package/packages/cloud/dist/services/nango.d.ts +201 -0
- package/packages/cloud/dist/services/nango.js +392 -0
- package/packages/cloud/dist/services/persistence.d.ts +131 -0
- package/packages/cloud/dist/shims/consensus.d.ts +23 -0
- package/packages/cloud/dist/shims/consensus.js +5 -0
- package/packages/cloud/package.json +55 -0
- package/packages/config/dist/bridge-config.d.ts +52 -0
- package/packages/config/dist/bridge-config.js +143 -0
- package/packages/config/dist/bridge-utils.d.ts +30 -0
- package/packages/config/dist/bridge-utils.js +54 -0
- package/packages/config/dist/cli-auth-config.js +391 -0
- package/packages/config/dist/cloud-config.d.ts +75 -0
- package/packages/config/dist/cloud-config.js +109 -0
- package/packages/config/dist/index.d.ts +13 -0
- package/packages/config/dist/index.js +13 -0
- package/packages/config/dist/project-namespace.d.ts +73 -0
- package/packages/config/dist/project-namespace.js +280 -0
- package/packages/config/dist/relay-config.d.ts +25 -0
- package/packages/config/dist/relay-config.js +25 -0
- package/packages/config/dist/relay-file-writer.d.ts +200 -0
- package/packages/config/dist/relay-file-writer.js +407 -0
- package/packages/config/dist/schemas.d.ts +672 -0
- package/packages/config/dist/schemas.js +180 -0
- package/packages/config/dist/shadow-config.d.ts +87 -0
- package/packages/config/dist/trajectory-config.d.ts +102 -0
- package/packages/config/dist/trajectory-config.js +185 -0
- package/packages/config/package.json +98 -0
- package/packages/continuity/dist/index.d.ts +9 -0
- package/packages/continuity/dist/index.js +9 -0
- package/packages/continuity/dist/types.d.ts +180 -0
- package/packages/continuity/dist/types.js +2 -0
- package/packages/continuity/package.json +32 -0
- package/packages/daemon/dist/agent-manager.d.ts +134 -0
- package/packages/daemon/dist/agent-manager.js +578 -0
- package/packages/daemon/dist/agent-registry.js +213 -0
- package/packages/daemon/dist/api.d.ts +106 -0
- package/packages/daemon/dist/api.js +876 -0
- package/packages/daemon/dist/channel-membership-store.d.ts +55 -0
- package/packages/daemon/dist/channel-membership-store.js +176 -0
- package/packages/daemon/dist/cli-auth.d.ts +89 -0
- package/packages/daemon/dist/cli-auth.js +792 -0
- package/packages/daemon/dist/cloud-sync.d.ts +150 -0
- package/packages/daemon/dist/cloud-sync.js +446 -0
- package/packages/daemon/dist/connection.d.ts +130 -0
- package/packages/daemon/dist/connection.js +438 -0
- package/packages/daemon/dist/consensus-integration.js +371 -0
- package/packages/daemon/dist/delivery-tracker.d.ts +34 -0
- package/packages/daemon/dist/delivery-tracker.js +104 -0
- package/packages/daemon/dist/enhanced-features.d.ts +118 -0
- package/packages/daemon/dist/enhanced-features.js +176 -0
- package/packages/daemon/dist/index.d.ts +31 -0
- package/packages/daemon/dist/index.js +37 -0
- package/packages/daemon/dist/migrations/index.d.ts +73 -0
- package/packages/daemon/dist/migrations/index.js +241 -0
- package/packages/daemon/dist/orchestrator.d.ts +217 -0
- package/packages/daemon/dist/orchestrator.js +1143 -0
- package/packages/daemon/dist/relay-ledger.d.ts +261 -0
- package/packages/daemon/dist/relay-ledger.js +532 -0
- package/packages/daemon/dist/relay-watchdog.d.ts +125 -0
- package/packages/daemon/dist/relay-watchdog.js +611 -0
- package/packages/daemon/dist/repo-manager.js +384 -0
- package/packages/daemon/dist/router.d.ts +370 -0
- package/packages/daemon/dist/router.js +1437 -0
- package/packages/daemon/dist/server.d.ts +174 -0
- package/packages/daemon/dist/server.js +1001 -0
- package/packages/daemon/dist/spawn-manager.d.ts +78 -0
- package/packages/daemon/dist/spawn-manager.js +165 -0
- package/packages/daemon/dist/sync-queue.d.ts +116 -0
- package/packages/daemon/dist/sync-queue.js +361 -0
- package/packages/daemon/dist/types.d.ts +133 -0
- package/packages/daemon/dist/workspace-manager.js +314 -0
- package/packages/daemon/package.json +52 -0
- package/packages/dashboard/README.md +48 -0
- package/packages/dashboard/dist/health-worker-manager.d.ts +62 -0
- package/packages/dashboard/dist/health-worker-manager.js +144 -0
- package/packages/dashboard/dist/health-worker.d.ts +9 -0
- package/packages/dashboard/dist/health-worker.js +79 -0
- package/packages/dashboard/dist/index.d.ts +20 -0
- package/packages/dashboard/dist/index.js +19 -0
- package/packages/dashboard/dist/metrics.d.ts +105 -0
- package/packages/dashboard/dist/metrics.js +193 -0
- package/packages/dashboard/dist/needs-attention.d.ts +24 -0
- package/packages/dashboard/dist/needs-attention.js +78 -0
- package/packages/dashboard/dist/server.d.ts +25 -0
- package/packages/dashboard/dist/server.js +5107 -0
- package/packages/dashboard/dist/start.d.ts +6 -0
- package/packages/dashboard/dist/start.js +13 -0
- package/packages/dashboard/dist/types/threading.d.ts +8 -0
- package/packages/dashboard/dist/types/threading.js +2 -0
- package/packages/dashboard/dist/user-bridge.d.ts +154 -0
- package/packages/dashboard/dist/user-bridge.js +372 -0
- package/packages/dashboard/package.json +72 -0
- package/packages/dashboard/ui/.next/BUILD_ID +1 -0
- package/packages/dashboard/ui/.next/app-build-manifest.json +135 -0
- package/packages/dashboard/ui/.next/app-path-routes-manifest.json +1 -0
- package/packages/dashboard/ui/.next/build-manifest.json +32 -0
- package/packages/dashboard/ui/.next/cache/config.json +7 -0
- package/packages/dashboard/ui/.next/cache/eslint/.cache_1asv1h5 +1 -0
- package/packages/dashboard/ui/.next/cache/webpack/client-production/0.pack +0 -0
- package/packages/dashboard/ui/.next/cache/webpack/client-production/index.pack +0 -0
- package/packages/dashboard/ui/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/packages/dashboard/ui/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/packages/dashboard/ui/.next/cache/webpack/server-production/0.pack +0 -0
- package/packages/dashboard/ui/.next/cache/webpack/server-production/index.pack +0 -0
- package/packages/dashboard/ui/.next/export-detail.json +1 -0
- package/packages/dashboard/ui/.next/export-marker.json +1 -0
- package/packages/dashboard/ui/.next/images-manifest.json +1 -0
- package/packages/dashboard/ui/.next/next-minimal-server.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/next-server.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/package.json +1 -0
- package/packages/dashboard/ui/.next/prerender-manifest.json +1 -0
- package/packages/dashboard/ui/.next/react-loadable-manifest.json +1970 -0
- package/packages/dashboard/ui/.next/required-server-files.json +1 -0
- package/packages/dashboard/ui/.next/routes-manifest.json +1 -0
- package/packages/dashboard/ui/.next/server/app/_not-found/page.js +1 -0
- package/packages/dashboard/ui/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/_not-found.html +1 -0
- package/packages/dashboard/ui/.next/server/app/_not-found.meta +6 -0
- package/packages/dashboard/ui/.next/server/app/_not-found.rsc +9 -0
- package/packages/dashboard/ui/.next/server/app/app/onboarding/page.js +6 -0
- package/packages/dashboard/ui/.next/server/app/app/onboarding/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/app/onboarding/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/app/onboarding.html +1 -0
- package/packages/dashboard/ui/.next/server/app/app/onboarding.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/app/onboarding.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/app/page.js +436 -0
- package/packages/dashboard/ui/.next/server/app/app/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/app/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/app.html +1 -0
- package/packages/dashboard/ui/.next/server/app/app.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/app.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/apple-icon.png/route.js +12 -0
- package/packages/dashboard/ui/.next/server/app/apple-icon.png/route.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/apple-icon.png.body +0 -0
- package/packages/dashboard/ui/.next/server/app/apple-icon.png.meta +1 -0
- package/packages/dashboard/ui/.next/server/app/cloud/link/page.js +1 -0
- package/packages/dashboard/ui/.next/server/app/cloud/link/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/cloud/link/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/cloud/link.html +1 -0
- package/packages/dashboard/ui/.next/server/app/cloud/link.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/cloud/link.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/connect-repos/page.js +6 -0
- package/packages/dashboard/ui/.next/server/app/connect-repos/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/connect-repos/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/connect-repos.html +1 -0
- package/packages/dashboard/ui/.next/server/app/connect-repos.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/connect-repos.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/history/page.js +1 -0
- package/packages/dashboard/ui/.next/server/app/history/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/history/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/history.html +1 -0
- package/packages/dashboard/ui/.next/server/app/history.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/history.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/index.html +1 -0
- package/packages/dashboard/ui/.next/server/app/index.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/index.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/login/page.js +6 -0
- package/packages/dashboard/ui/.next/server/app/login/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/login/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/login.html +5 -0
- package/packages/dashboard/ui/.next/server/app/login.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/login.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/metrics/page.js +1 -0
- package/packages/dashboard/ui/.next/server/app/metrics/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/metrics/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/metrics.html +1 -0
- package/packages/dashboard/ui/.next/server/app/metrics.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/metrics.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/page.js +1 -0
- package/packages/dashboard/ui/.next/server/app/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/pricing/page.js +5 -0
- package/packages/dashboard/ui/.next/server/app/pricing/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/pricing/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/pricing.html +13 -0
- package/packages/dashboard/ui/.next/server/app/pricing.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/pricing.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/providers/page.js +2 -0
- package/packages/dashboard/ui/.next/server/app/providers/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/providers/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/[provider]/page.js +1 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/[provider]/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/[provider]/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/claude.html +1 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/claude.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/claude.rsc +8 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/codex.html +1 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/codex.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/codex.rsc +8 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/cursor.html +1 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/cursor.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/providers/setup/cursor.rsc +8 -0
- package/packages/dashboard/ui/.next/server/app/providers.html +1 -0
- package/packages/dashboard/ui/.next/server/app/providers.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/providers.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app/signup/page.js +6 -0
- package/packages/dashboard/ui/.next/server/app/signup/page.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/app/signup/page_client-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/app/signup.html +6 -0
- package/packages/dashboard/ui/.next/server/app/signup.meta +5 -0
- package/packages/dashboard/ui/.next/server/app/signup.rsc +7 -0
- package/packages/dashboard/ui/.next/server/app-paths-manifest.json +16 -0
- package/packages/dashboard/ui/.next/server/chunks/190.js +1 -0
- package/packages/dashboard/ui/.next/server/chunks/205.js +1 -0
- package/packages/dashboard/ui/.next/server/chunks/251.js +9 -0
- package/packages/dashboard/ui/.next/server/chunks/288.js +1 -0
- package/packages/dashboard/ui/.next/server/chunks/434.js +1 -0
- package/packages/dashboard/ui/.next/server/chunks/471.js +2 -0
- package/packages/dashboard/ui/.next/server/chunks/621.js +1 -0
- package/packages/dashboard/ui/.next/server/chunks/680.js +5 -0
- package/packages/dashboard/ui/.next/server/chunks/682.js +6 -0
- package/packages/dashboard/ui/.next/server/chunks/684.js +1 -0
- package/packages/dashboard/ui/.next/server/chunks/71.js +196 -0
- package/packages/dashboard/ui/.next/server/chunks/711.js +1 -0
- package/packages/dashboard/ui/.next/server/chunks/90.js +17 -0
- package/packages/dashboard/ui/.next/server/chunks/948.js +2 -0
- package/packages/dashboard/ui/.next/server/chunks/font-manifest.json +1 -0
- package/packages/dashboard/ui/.next/server/font-manifest.json +1 -0
- package/packages/dashboard/ui/.next/server/functions-config-manifest.json +1 -0
- package/packages/dashboard/ui/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/middleware-build-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/middleware-manifest.json +6 -0
- package/packages/dashboard/ui/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/next-font-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/next-font-manifest.json +1 -0
- package/packages/dashboard/ui/.next/server/pages/404.html +1 -0
- package/packages/dashboard/ui/.next/server/pages/500.html +1 -0
- package/packages/dashboard/ui/.next/server/pages/_app.js +1 -0
- package/packages/dashboard/ui/.next/server/pages/_app.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/pages/_document.js +1 -0
- package/packages/dashboard/ui/.next/server/pages/_document.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/pages/_error.js +1 -0
- package/packages/dashboard/ui/.next/server/pages/_error.js.nft.json +1 -0
- package/packages/dashboard/ui/.next/server/pages-manifest.json +1 -0
- package/packages/dashboard/ui/.next/server/server-reference-manifest.js +1 -0
- package/packages/dashboard/ui/.next/server/server-reference-manifest.json +1 -0
- package/packages/dashboard/ui/.next/server/webpack-runtime.js +1 -0
- package/packages/dashboard/ui/.next/static/HR7W9z1PPVPFqUboUVZFZ/_buildManifest.js +1 -0
- package/packages/dashboard/ui/.next/static/HR7W9z1PPVPFqUboUVZFZ/_ssgManifest.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/116-a883fca163f3a5bc.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/117-c8afed19e821a35d.js +2 -0
- package/packages/dashboard/ui/.next/static/chunks/282-980c2eb8fff20123.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/532-bace199897eeab37.js +9 -0
- package/packages/dashboard/ui/.next/static/chunks/631-af51bad94027527a.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/648-acb2ff9f77cbfbd3.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/677-30e60cb0b47875b6.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/766-2aea80818f7eb0d8.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/83-4f08122d4e7e79a6.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/847-f1f467060f32afff.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/891-5cb1513eeb97a891.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/_not-found/page-60501fddbafba9dc.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/app/onboarding/page-9914652442f7e4fb.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/app/page-44813aa26ad19681.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/cloud/link/page-fa1d5842aa90e8a6.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/connect-repos/page-113060009ef35bc2.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/history/page-9965d2483011b846.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/layout-6b91e33784c20610.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/login/page-a0ca6f7ca6a100b8.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/metrics/page-1e37ef8e73940b40.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/page-7993778218818ace.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/pricing/page-9db3ebdfa567a7c9.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/providers/page-bcf46064ac4474ce.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/providers/setup/[provider]/page-4dbe33f0f7691b7c.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/app/signup/page-1ede2205b58649ca.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/e868780c-48e5f147c90a3a41.js +18 -0
- package/packages/dashboard/ui/.next/static/chunks/fd9d1056-609918ca7b6280bb.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/framework-f66176bb897dc684.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/main-5a40a5ae29646e1b.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/main-app-fdbeb09028f57c9f.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/pages/_app-72b849fbd24ac258.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/pages/_error-7ba65e1336b92748.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/packages/dashboard/ui/.next/static/chunks/webpack-1cdd8ed57114d5e1.js +1 -0
- package/packages/dashboard/ui/.next/static/css/4034f236dd1a3178.css +1 -0
- package/packages/dashboard/ui/.next/static/css/99c2552394077586.css +1 -0
- package/packages/dashboard/ui/.next/trace +63 -0
- package/packages/dashboard/ui/.next/types/app/app/onboarding/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/app/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/cloud/link/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/connect-repos/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/history/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/layout.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/login/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/metrics/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/pricing/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/providers/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/providers/setup/[provider]/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/app/signup/page.ts +79 -0
- package/packages/dashboard/ui/.next/types/package.json +1 -0
- package/packages/dashboard/ui/app/app/onboarding/page.tsx +394 -0
- package/packages/dashboard/ui/app/app/page.tsx +667 -0
- package/packages/dashboard/ui/app/apple-icon.png +0 -0
- package/packages/dashboard/ui/app/cloud/link/page.tsx +464 -0
- package/packages/dashboard/ui/app/connect-repos/page.tsx +410 -0
- package/packages/dashboard/ui/app/favicon.png +0 -0
- package/packages/dashboard/ui/app/globals.css +59 -0
- package/packages/dashboard/ui/app/history/page.tsx +658 -0
- package/packages/dashboard/ui/app/layout.tsx +25 -0
- package/packages/dashboard/ui/app/login/page.tsx +280 -0
- package/packages/dashboard/ui/app/metrics/page.tsx +751 -0
- package/packages/dashboard/ui/app/page.tsx +59 -0
- package/packages/dashboard/ui/app/pricing/page.tsx +7 -0
- package/packages/dashboard/ui/app/providers/page.tsx +193 -0
- package/packages/dashboard/ui/app/providers/setup/[provider]/ProviderSetupClient.tsx +148 -0
- package/packages/dashboard/ui/app/providers/setup/[provider]/constants.ts +35 -0
- package/packages/dashboard/ui/app/providers/setup/[provider]/page.tsx +42 -0
- package/packages/dashboard/ui/app/signup/page.tsx +343 -0
- package/packages/dashboard/ui/index.ts +49 -0
- package/packages/dashboard/ui/landing/LandingPage.tsx +713 -0
- package/packages/dashboard/ui/landing/PricingPage.tsx +559 -0
- package/packages/dashboard/ui/landing/index.ts +6 -0
- package/packages/dashboard/ui/landing/styles.css +2850 -0
- package/packages/dashboard/ui/lib/agent-merge.ts +35 -0
- package/packages/dashboard/ui/lib/api.ts +1155 -0
- package/packages/dashboard/ui/lib/cloudApi.ts +876 -0
- package/packages/dashboard/ui/lib/colors.ts +218 -0
- package/packages/dashboard/ui/lib/hierarchy.ts +242 -0
- package/packages/dashboard/ui/lib/stuckDetection.ts +142 -0
- package/packages/dashboard/ui/next-env.d.ts +5 -0
- package/packages/dashboard/ui/next.config.js +41 -0
- package/packages/dashboard/ui/package-lock.json +2882 -0
- package/packages/dashboard/ui/package.json +33 -0
- package/packages/dashboard/ui/postcss.config.js +5 -0
- package/packages/dashboard/ui/react-components/ActivityFeed.tsx +216 -0
- package/packages/dashboard/ui/react-components/AddWorkspaceModal.tsx +170 -0
- package/packages/dashboard/ui/react-components/AgentCard.tsx +587 -0
- package/packages/dashboard/ui/react-components/AgentList.tsx +411 -0
- package/packages/dashboard/ui/react-components/AgentProfilePanel.tsx +564 -0
- package/packages/dashboard/ui/react-components/App.tsx +3447 -0
- package/packages/dashboard/ui/react-components/BillingPanel.tsx +922 -0
- package/packages/dashboard/ui/react-components/BillingResult.tsx +447 -0
- package/packages/dashboard/ui/react-components/BroadcastComposer.tsx +690 -0
- package/packages/dashboard/ui/react-components/ChannelAdminPanel.tsx +773 -0
- package/packages/dashboard/ui/react-components/ChannelBrowser.tsx +385 -0
- package/packages/dashboard/ui/react-components/ChannelChat.tsx +307 -0
- package/packages/dashboard/ui/react-components/ChannelSidebar.tsx +399 -0
- package/packages/dashboard/ui/react-components/CloudSessionProvider.tsx +130 -0
- package/packages/dashboard/ui/react-components/CommandPalette.tsx +815 -0
- package/packages/dashboard/ui/react-components/ConfirmationDialog.tsx +133 -0
- package/packages/dashboard/ui/react-components/ConversationHistory.tsx +518 -0
- package/packages/dashboard/ui/react-components/CoordinatorPanel.tsx +944 -0
- package/packages/dashboard/ui/react-components/DecisionQueue.tsx +717 -0
- package/packages/dashboard/ui/react-components/DirectMessageView.tsx +164 -0
- package/packages/dashboard/ui/react-components/FileAutocomplete.tsx +368 -0
- package/packages/dashboard/ui/react-components/FleetOverview.tsx +278 -0
- package/packages/dashboard/ui/react-components/LogViewer.tsx +310 -0
- package/packages/dashboard/ui/react-components/LogViewerPanel.tsx +482 -0
- package/packages/dashboard/ui/react-components/Logo.tsx +284 -0
- package/packages/dashboard/ui/react-components/MentionAutocomplete.tsx +384 -0
- package/packages/dashboard/ui/react-components/MessageList.tsx +649 -0
- package/packages/dashboard/ui/react-components/MessageSenderName.tsx +91 -0
- package/packages/dashboard/ui/react-components/MessageStatusIndicator.tsx +142 -0
- package/packages/dashboard/ui/react-components/NewConversationModal.tsx +400 -0
- package/packages/dashboard/ui/react-components/NotificationToast.tsx +488 -0
- package/packages/dashboard/ui/react-components/OnlineUsersIndicator.tsx +164 -0
- package/packages/dashboard/ui/react-components/Pagination.tsx +124 -0
- package/packages/dashboard/ui/react-components/PricingPlans.tsx +386 -0
- package/packages/dashboard/ui/react-components/ProjectList.tsx +625 -0
- package/packages/dashboard/ui/react-components/ProviderAuthFlow.tsx +843 -0
- package/packages/dashboard/ui/react-components/ProviderConnectionList.tsx +363 -0
- package/packages/dashboard/ui/react-components/ProvisioningProgress.tsx +730 -0
- package/packages/dashboard/ui/react-components/RepoAccessPanel.tsx +392 -0
- package/packages/dashboard/ui/react-components/ServerCard.tsx +202 -0
- package/packages/dashboard/ui/react-components/SessionExpiredModal.tsx +128 -0
- package/packages/dashboard/ui/react-components/SpawnModal.tsx +704 -0
- package/packages/dashboard/ui/react-components/TaskAssignmentUI.tsx +375 -0
- package/packages/dashboard/ui/react-components/TerminalProviderSetup.tsx +608 -0
- package/packages/dashboard/ui/react-components/ThemeProvider.tsx +325 -0
- package/packages/dashboard/ui/react-components/ThinkingIndicator.tsx +231 -0
- package/packages/dashboard/ui/react-components/ThreadList.tsx +198 -0
- package/packages/dashboard/ui/react-components/ThreadPanel.tsx +346 -0
- package/packages/dashboard/ui/react-components/TrajectoryViewer.tsx +698 -0
- package/packages/dashboard/ui/react-components/TypingIndicator.tsx +69 -0
- package/packages/dashboard/ui/react-components/UsageBanner.tsx +231 -0
- package/packages/dashboard/ui/react-components/UserProfilePanel.tsx +233 -0
- package/packages/dashboard/ui/react-components/WorkspaceContext.tsx +107 -0
- package/packages/dashboard/ui/react-components/WorkspaceSelector.tsx +234 -0
- package/packages/dashboard/ui/react-components/WorkspaceStatusIndicator.tsx +370 -0
- package/packages/dashboard/ui/react-components/XTermInteractive.tsx +510 -0
- package/packages/dashboard/ui/react-components/XTermLogViewer.tsx +719 -0
- package/packages/dashboard/ui/react-components/channels/ChannelDialogs.tsx +1411 -0
- package/packages/dashboard/ui/react-components/channels/ChannelHeader.tsx +317 -0
- package/packages/dashboard/ui/react-components/channels/ChannelMessageList.tsx +463 -0
- package/packages/dashboard/ui/react-components/channels/ChannelViewV1.tsx +146 -0
- package/packages/dashboard/ui/react-components/channels/MessageInput.tsx +288 -0
- package/packages/dashboard/ui/react-components/channels/SearchInput.tsx +172 -0
- package/packages/dashboard/ui/react-components/channels/SearchResults.tsx +336 -0
- package/packages/dashboard/ui/react-components/channels/api.ts +697 -0
- package/packages/dashboard/ui/react-components/channels/index.ts +76 -0
- package/packages/dashboard/ui/react-components/channels/mockApi.ts +344 -0
- package/packages/dashboard/ui/react-components/channels/types.ts +566 -0
- package/packages/dashboard/ui/react-components/hooks/index.ts +57 -0
- package/packages/dashboard/ui/react-components/hooks/useAgentLogs.ts +394 -0
- package/packages/dashboard/ui/react-components/hooks/useAgents.ts +127 -0
- package/packages/dashboard/ui/react-components/hooks/useBroadcastDedup.ts +86 -0
- package/packages/dashboard/ui/react-components/hooks/useChannelAdmin.ts +329 -0
- package/packages/dashboard/ui/react-components/hooks/useChannelBrowser.ts +239 -0
- package/packages/dashboard/ui/react-components/hooks/useChannelCommands.ts +138 -0
- package/packages/dashboard/ui/react-components/hooks/useChannels.ts +328 -0
- package/packages/dashboard/ui/react-components/hooks/useDebounce.ts +29 -0
- package/packages/dashboard/ui/react-components/hooks/useDirectMessage.ts +141 -0
- package/packages/dashboard/ui/react-components/hooks/useMessages.ts +309 -0
- package/packages/dashboard/ui/react-components/hooks/useOrchestrator.ts +364 -0
- package/packages/dashboard/ui/react-components/hooks/usePinnedAgents.ts +140 -0
- package/packages/dashboard/ui/react-components/hooks/usePresence.ts +340 -0
- package/packages/dashboard/ui/react-components/hooks/useRecentRepos.ts +130 -0
- package/packages/dashboard/ui/react-components/hooks/useSession.ts +209 -0
- package/packages/dashboard/ui/react-components/hooks/useTrajectory.ts +265 -0
- package/packages/dashboard/ui/react-components/hooks/useWebSocket.ts +169 -0
- package/packages/dashboard/ui/react-components/hooks/useWorkspaceMembers.ts +120 -0
- package/packages/dashboard/ui/react-components/hooks/useWorkspaceRepos.ts +73 -0
- package/packages/dashboard/ui/react-components/hooks/useWorkspaceStatus.ts +237 -0
- package/packages/dashboard/ui/react-components/index.ts +81 -0
- package/packages/dashboard/ui/react-components/layout/Header.tsx +355 -0
- package/packages/dashboard/ui/react-components/layout/RepoContextHeader.tsx +361 -0
- package/packages/dashboard/ui/react-components/layout/Sidebar.archive.test.tsx +126 -0
- package/packages/dashboard/ui/react-components/layout/Sidebar.test.tsx +691 -0
- package/packages/dashboard/ui/react-components/layout/Sidebar.tsx +930 -0
- package/packages/dashboard/ui/react-components/layout/index.ts +7 -0
- package/packages/dashboard/ui/react-components/settings/BillingSettingsPanel.tsx +564 -0
- package/packages/dashboard/ui/react-components/settings/SettingsPage.tsx +544 -0
- package/packages/dashboard/ui/react-components/settings/TeamSettingsPanel.tsx +560 -0
- package/packages/dashboard/ui/react-components/settings/WorkspaceSettingsPanel.tsx +1329 -0
- package/packages/dashboard/ui/react-components/settings/index.ts +11 -0
- package/packages/dashboard/ui/react-components/settings/types.ts +53 -0
- package/packages/dashboard/ui/react-components/utils/messageFormatting.tsx +370 -0
- package/packages/dashboard/ui/tailwind.config.js +148 -0
- package/packages/dashboard/ui/types/index.ts +304 -0
- package/packages/dashboard/ui/types/threading.ts +7 -0
- package/packages/dashboard/ui-dist/404.html +1 -0
- package/packages/dashboard/ui-dist/_next/static/HR7W9z1PPVPFqUboUVZFZ/_buildManifest.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/HR7W9z1PPVPFqUboUVZFZ/_ssgManifest.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/ZCFjHbkF8yDKS2md3lVgb/_buildManifest.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/ZCFjHbkF8yDKS2md3lVgb/_ssgManifest.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/116-a883fca163f3a5bc.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/117-c8afed19e821a35d.js +2 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/282-980c2eb8fff20123.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/320-900169c942e31422.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/532-bace199897eeab37.js +9 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/631-af51bad94027527a.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/648-acb2ff9f77cbfbd3.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/677-30e60cb0b47875b6.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/766-2aea80818f7eb0d8.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/83-4f08122d4e7e79a6.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/847-f1f467060f32afff.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/891-5cb1513eeb97a891.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/_not-found/page-60501fddbafba9dc.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/app/onboarding/page-9914652442f7e4fb.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/app/onboarding/page-f746f29e01fffc43.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/app/page-2e525b1dcc790967.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/app/page-44813aa26ad19681.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/cloud/link/page-5011ae044b90449d.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/cloud/link/page-fa1d5842aa90e8a6.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/connect-repos/page-03ac6f35a6654ea6.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/connect-repos/page-113060009ef35bc2.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/history/page-9965d2483011b846.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/history/page-b2ce7c96ed0931da.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/layout-6b91e33784c20610.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/layout-c0d118c0f92d969c.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/login/page-6ec54eee75877971.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/login/page-a0ca6f7ca6a100b8.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/metrics/page-1e37ef8e73940b40.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/metrics/page-bf2cb1e5915bc92d.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/page-4e64923d73c35bc9.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/page-7993778218818ace.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/pricing/page-0efa024c28ba4597.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/pricing/page-9db3ebdfa567a7c9.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/providers/page-bcf46064ac4474ce.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/providers/page-e65a0010da6ea5be.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/providers/setup/[provider]/page-4dbe33f0f7691b7c.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/providers/setup/[provider]/page-84161c802b020a1f.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/signup/page-18a4665665f6be11.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/app/signup/page-1ede2205b58649ca.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/e868780c-48e5f147c90a3a41.js +18 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/fd9d1056-609918ca7b6280bb.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/framework-f66176bb897dc684.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/main-5a40a5ae29646e1b.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/main-app-6e8e8d3ef4e0192a.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/main-app-fdbeb09028f57c9f.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/pages/_app-72b849fbd24ac258.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/pages/_error-7ba65e1336b92748.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +1 -0
- package/packages/dashboard/ui-dist/_next/static/css/4034f236dd1a3178.css +1 -0
- package/packages/dashboard/ui-dist/_next/static/css/99c2552394077586.css +1 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-128.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-256.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-32.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-512.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-64.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo.svg +45 -0
- package/packages/dashboard/ui-dist/alt-logos/logo.svg +38 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-128.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-256.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-32.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-512.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-64.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo.svg +38 -0
- package/packages/dashboard/ui-dist/app/onboarding.html +1 -0
- package/packages/dashboard/ui-dist/app/onboarding.txt +7 -0
- package/packages/dashboard/ui-dist/app.html +1 -0
- package/packages/dashboard/ui-dist/app.txt +7 -0
- package/packages/dashboard/ui-dist/apple-icon.png +0 -0
- package/packages/dashboard/ui-dist/cloud/link.html +1 -0
- package/packages/dashboard/ui-dist/cloud/link.txt +7 -0
- package/packages/dashboard/ui-dist/connect-repos.html +1 -0
- package/packages/dashboard/ui-dist/connect-repos.txt +7 -0
- package/packages/dashboard/ui-dist/history.html +1 -0
- package/packages/dashboard/ui-dist/history.txt +7 -0
- package/packages/dashboard/ui-dist/index.html +1 -0
- package/packages/dashboard/ui-dist/index.txt +7 -0
- package/packages/dashboard/ui-dist/login.html +5 -0
- package/packages/dashboard/ui-dist/login.txt +7 -0
- package/packages/dashboard/ui-dist/metrics.html +1 -0
- package/packages/dashboard/ui-dist/metrics.txt +7 -0
- package/packages/dashboard/ui-dist/pricing.html +13 -0
- package/packages/dashboard/ui-dist/pricing.txt +7 -0
- package/packages/dashboard/ui-dist/providers/setup/claude.html +1 -0
- package/packages/dashboard/ui-dist/providers/setup/claude.txt +8 -0
- package/packages/dashboard/ui-dist/providers/setup/codex.html +1 -0
- package/packages/dashboard/ui-dist/providers/setup/codex.txt +8 -0
- package/packages/dashboard/ui-dist/providers/setup/cursor.html +1 -0
- package/packages/dashboard/ui-dist/providers/setup/cursor.txt +8 -0
- package/packages/dashboard/ui-dist/providers.html +1 -0
- package/packages/dashboard/ui-dist/providers.txt +7 -0
- package/packages/dashboard/ui-dist/signup.html +6 -0
- package/packages/dashboard/ui-dist/signup.txt +7 -0
- package/packages/dashboard-server/dist/health-worker-manager.d.ts +62 -0
- package/packages/dashboard-server/dist/health-worker-manager.js +144 -0
- package/packages/dashboard-server/dist/health-worker.d.ts +9 -0
- package/packages/dashboard-server/dist/health-worker.js +79 -0
- package/packages/dashboard-server/dist/index.d.ts +18 -0
- package/packages/dashboard-server/dist/index.js +17 -0
- package/packages/dashboard-server/dist/server.js +5099 -0
- package/packages/dashboard-server/dist/start.js +13 -0
- package/packages/dashboard-server/dist/types/threading.d.ts +8 -0
- package/packages/dashboard-server/dist/types/threading.js +2 -0
- package/packages/dashboard-server/dist/user-bridge.d.ts +154 -0
- package/packages/dashboard-server/dist/user-bridge.js +372 -0
- package/packages/dashboard-server/package.json +49 -0
- package/packages/hooks/dist/browser.d.ts +2 -0
- package/packages/hooks/dist/browser.js +3 -0
- package/packages/hooks/dist/index.d.ts +11 -0
- package/packages/hooks/dist/index.js +11 -0
- package/packages/hooks/dist/registry.js +476 -0
- package/packages/hooks/dist/trajectory-hooks.js +183 -0
- package/packages/hooks/dist/types.d.ts +285 -0
- package/packages/hooks/dist/types.js +10 -0
- package/packages/hooks/package.json +52 -0
- package/packages/mcp/LICENSE +190 -0
- package/packages/mcp/README.md +214 -0
- package/packages/mcp/SPEC.md +1922 -0
- package/packages/mcp/STAFFING_PLAN.md +294 -0
- package/packages/mcp/dist/bin.d.ts +12 -0
- package/packages/mcp/dist/bin.js +127 -0
- package/packages/mcp/dist/client.d.ts +68 -0
- package/packages/mcp/dist/client.js +115 -0
- package/packages/mcp/dist/cloud.d.ts +108 -0
- package/packages/mcp/dist/cloud.js +279 -0
- package/packages/mcp/dist/errors.d.ts +27 -0
- package/packages/mcp/dist/errors.js +48 -0
- package/packages/mcp/dist/index.d.ts +10 -0
- package/packages/mcp/dist/index.js +16 -0
- package/packages/mcp/dist/install-cli.d.ts +35 -0
- package/packages/mcp/dist/install-cli.js +157 -0
- package/packages/mcp/dist/install.d.ts +101 -0
- package/packages/mcp/dist/install.js +398 -0
- package/packages/mcp/dist/prompts/index.d.ts +2 -0
- package/packages/mcp/dist/prompts/index.js +2 -0
- package/packages/mcp/dist/prompts/protocol.d.ts +11 -0
- package/packages/mcp/dist/prompts/protocol.js +168 -0
- package/packages/mcp/dist/resources/agents.d.ts +11 -0
- package/packages/mcp/dist/resources/agents.js +17 -0
- package/packages/mcp/dist/resources/inbox.d.ts +11 -0
- package/packages/mcp/dist/resources/inbox.js +17 -0
- package/packages/mcp/dist/resources/index.d.ts +4 -0
- package/packages/mcp/dist/resources/index.js +4 -0
- package/packages/mcp/dist/resources/project.d.ts +11 -0
- package/packages/mcp/dist/resources/project.js +21 -0
- package/packages/mcp/dist/server.d.ts +19 -0
- package/packages/mcp/dist/server.js +215 -0
- package/packages/mcp/dist/simple.d.ts +173 -0
- package/packages/mcp/dist/simple.js +120 -0
- package/packages/mcp/dist/tools/index.d.ts +10 -0
- package/packages/mcp/dist/tools/index.js +10 -0
- package/packages/mcp/dist/tools/relay-health.d.ts +23 -0
- package/packages/mcp/dist/tools/relay-health.js +138 -0
- package/packages/mcp/dist/tools/relay-inbox.d.ts +26 -0
- package/packages/mcp/dist/tools/relay-inbox.js +58 -0
- package/packages/mcp/dist/tools/relay-logs.d.ts +20 -0
- package/packages/mcp/dist/tools/relay-logs.js +88 -0
- package/packages/mcp/dist/tools/relay-metrics.d.ts +20 -0
- package/packages/mcp/dist/tools/relay-metrics.js +135 -0
- package/packages/mcp/dist/tools/relay-release.d.ts +20 -0
- package/packages/mcp/dist/tools/relay-release.js +44 -0
- package/packages/mcp/dist/tools/relay-send.d.ts +29 -0
- package/packages/mcp/dist/tools/relay-send.js +71 -0
- package/packages/mcp/dist/tools/relay-spawn.d.ts +36 -0
- package/packages/mcp/dist/tools/relay-spawn.js +73 -0
- package/packages/mcp/dist/tools/relay-status.d.ts +11 -0
- package/packages/mcp/dist/tools/relay-status.js +43 -0
- package/packages/mcp/dist/tools/relay-who.d.ts +20 -0
- package/packages/mcp/dist/tools/relay-who.js +47 -0
- package/packages/mcp/package.json +69 -0
- package/packages/memory/dist/memory-hooks.d.ts +60 -0
- package/packages/memory/package.json +35 -0
- package/packages/policy/dist/agent-policy.js +665 -0
- package/packages/policy/dist/index.d.ts +12 -0
- package/packages/policy/dist/index.js +12 -0
- package/packages/policy/package.json +35 -0
- package/packages/protocol/dist/channels.d.ts +137 -0
- package/packages/protocol/dist/channels.js +154 -0
- package/packages/protocol/dist/framing.d.ts +80 -0
- package/packages/protocol/dist/framing.js +206 -0
- package/packages/protocol/dist/index.d.ts +5 -0
- package/packages/protocol/dist/index.js +5 -0
- package/packages/protocol/dist/relay-pty-schemas.d.ts +258 -0
- package/packages/protocol/dist/types.d.ts +341 -0
- package/packages/protocol/dist/types.js +8 -0
- package/packages/protocol/package.json +56 -0
- package/packages/resiliency/dist/memory-monitor.js +599 -0
- package/packages/resiliency/dist/provider-context.d.ts +100 -0
- package/packages/resiliency/package.json +33 -0
- package/packages/sdk/README.md +171 -0
- package/packages/sdk/dist/client.d.ts +181 -0
- package/packages/sdk/dist/client.js +695 -0
- package/packages/sdk/dist/index.d.ts +32 -0
- package/packages/sdk/dist/index.js +36 -0
- package/packages/sdk/dist/protocol/framing.d.ts +80 -0
- package/packages/sdk/dist/protocol/framing.js +206 -0
- package/packages/sdk/dist/protocol/index.d.ts +6 -0
- package/packages/sdk/dist/protocol/index.js +6 -0
- package/packages/sdk/dist/protocol/types.d.ts +341 -0
- package/packages/sdk/dist/protocol/types.js +8 -0
- package/packages/sdk/dist/standalone.d.ts +87 -0
- package/packages/sdk/dist/standalone.js +126 -0
- package/packages/sdk/package.json +80 -0
- package/packages/spawner/API.md +256 -0
- package/packages/spawner/dist/index.d.ts +8 -0
- package/packages/spawner/dist/index.js +8 -0
- package/packages/spawner/dist/types.d.ts +552 -0
- package/packages/spawner/dist/types.js +193 -0
- package/packages/spawner/package.json +47 -0
- package/packages/state/dist/agent-state.js +120 -0
- package/packages/state/dist/index.d.ts +8 -0
- package/packages/state/dist/index.js +8 -0
- package/packages/state/package.json +32 -0
- package/packages/storage/dist/adapter.d.ts +156 -0
- package/packages/storage/dist/batched-sqlite-adapter.d.ts +75 -0
- package/packages/storage/dist/batched-sqlite-adapter.js +189 -0
- package/packages/storage/dist/index.d.ts +5 -0
- package/packages/storage/dist/index.js +6 -0
- package/packages/storage/dist/sqlite-adapter.d.ts +113 -0
- package/packages/storage/dist/sqlite-adapter.js +752 -0
- package/packages/storage/package.json +69 -0
- package/packages/trajectory/dist/index.d.ts +2 -0
- package/packages/trajectory/dist/index.js +2 -0
- package/packages/trajectory/dist/integration.js +987 -0
- package/packages/trajectory/package.json +35 -0
- package/packages/user-directory/dist/index.d.ts +7 -0
- package/packages/user-directory/dist/index.js +7 -0
- package/packages/user-directory/dist/user-directory.d.ts +121 -0
- package/packages/user-directory/dist/user-directory.js +267 -0
- package/packages/user-directory/package.json +35 -0
- package/packages/utils/dist/command-resolver.js +80 -0
- package/packages/utils/dist/error-tracking.d.ts +103 -0
- package/packages/utils/dist/error-tracking.js +149 -0
- package/packages/utils/dist/index.d.ts +9 -0
- package/packages/utils/dist/index.js +9 -0
- package/packages/utils/dist/model-mapping.d.ts +28 -0
- package/packages/utils/dist/model-mapping.js +55 -0
- package/packages/utils/package.json +75 -0
- package/packages/wrapper/dist/__fixtures__/claude-outputs.d.ts +49 -0
- package/packages/wrapper/dist/__fixtures__/claude-outputs.js +443 -0
- package/packages/wrapper/dist/__fixtures__/codex-outputs.d.ts +9 -0
- package/packages/wrapper/dist/__fixtures__/codex-outputs.js +94 -0
- package/packages/wrapper/dist/__fixtures__/gemini-outputs.d.ts +19 -0
- package/packages/wrapper/dist/__fixtures__/gemini-outputs.js +144 -0
- package/packages/wrapper/dist/__fixtures__/index.d.ts +68 -0
- package/packages/wrapper/dist/__fixtures__/index.js +44 -0
- package/packages/wrapper/dist/base-wrapper.d.ts +225 -0
- package/packages/wrapper/dist/base-wrapper.js +572 -0
- package/packages/wrapper/dist/client.d.ts +254 -0
- package/packages/wrapper/dist/client.js +801 -0
- package/packages/wrapper/dist/id-generator.d.ts +35 -0
- package/packages/wrapper/dist/id-generator.js +60 -0
- package/packages/wrapper/dist/idle-detector.d.ts +110 -0
- package/packages/wrapper/dist/idle-detector.js +304 -0
- package/packages/wrapper/dist/index.d.ts +37 -0
- package/packages/wrapper/dist/index.js +47 -0
- package/packages/wrapper/dist/parser.d.ts +236 -0
- package/packages/wrapper/dist/parser.js +1238 -0
- package/packages/wrapper/dist/relay-pty-orchestrator.d.ts +407 -0
- package/packages/wrapper/dist/relay-pty-orchestrator.js +1885 -0
- package/packages/wrapper/dist/shared.d.ts +201 -0
- package/packages/wrapper/dist/shared.js +341 -0
- package/packages/wrapper/dist/stuck-detector.d.ts +161 -0
- package/packages/wrapper/dist/stuck-detector.js +402 -0
- package/packages/wrapper/dist/tmux-wrapper.d.ts +345 -0
- package/packages/wrapper/dist/tmux-wrapper.js +1747 -0
- package/packages/wrapper/dist/trajectory-integration.d.ts +292 -0
- package/packages/wrapper/dist/trajectory-integration.js +979 -0
- package/packages/wrapper/dist/wrapper-types.d.ts +41 -0
- package/packages/wrapper/dist/wrapper-types.js +7 -0
- package/packages/wrapper/package.json +63 -0
- package/scripts/setup-stripe-products.ts +312 -0
- package/scripts/stress-test-orchestrator-integration.mts +1366 -0
- package/scripts/stress-test-orchestrator.mjs +584 -0
- package/scripts/stress-test-relay-pty.sh +452 -0
- package/scripts/verify-schema.js +1 -1
- package/turbo.json +37 -0
- package/dist/bridge/config.d.ts +0 -41
- package/dist/bridge/config.js +0 -143
- package/dist/bridge/index.d.ts +0 -10
- package/dist/bridge/index.js +0 -10
- package/dist/bridge/multi-project-client.d.ts +0 -99
- package/dist/bridge/multi-project-client.js +0 -389
- package/dist/bridge/shadow-cli.js +0 -75
- package/dist/bridge/shadow-config.d.ts +0 -87
- package/dist/bridge/spawner.d.ts +0 -186
- package/dist/bridge/spawner.js +0 -920
- package/dist/bridge/types.d.ts +0 -129
- package/dist/bridge/utils.d.ts +0 -30
- package/dist/bridge/utils.js +0 -54
- package/dist/cli/index.js +0 -2784
- package/dist/cloud/api/admin.js +0 -225
- package/dist/cloud/api/billing.js +0 -564
- package/dist/cloud/api/cli-pty-runner.d.ts +0 -54
- package/dist/cloud/api/cli-pty-runner.js +0 -119
- package/dist/cloud/api/codex-auth-helper.js +0 -327
- package/dist/cloud/api/consensus.js +0 -259
- package/dist/cloud/api/coordinators.js +0 -749
- package/dist/cloud/api/daemons.js +0 -535
- package/dist/cloud/api/generic-webhooks.js +0 -129
- package/dist/cloud/api/github-app.js +0 -223
- package/dist/cloud/api/monitoring.js +0 -578
- package/dist/cloud/api/nango-auth.js +0 -658
- package/dist/cloud/api/onboarding.d.ts +0 -15
- package/dist/cloud/api/onboarding.js +0 -666
- package/dist/cloud/api/policy.js +0 -229
- package/dist/cloud/api/provider-env.d.ts +0 -5
- package/dist/cloud/api/provider-env.js +0 -27
- package/dist/cloud/api/providers.js +0 -511
- package/dist/cloud/api/repos.js +0 -576
- package/dist/cloud/api/teams.js +0 -279
- package/dist/cloud/api/test-helpers.js +0 -745
- package/dist/cloud/api/workspaces.js +0 -1783
- package/dist/cloud/billing/plans.js +0 -245
- package/dist/cloud/config.d.ts +0 -75
- package/dist/cloud/config.js +0 -109
- package/dist/cloud/db/drizzle.d.ts +0 -246
- package/dist/cloud/db/drizzle.js +0 -1249
- package/dist/cloud/db/schema.d.ts +0 -4854
- package/dist/cloud/db/schema.js +0 -610
- package/dist/cloud/index.d.ts +0 -11
- package/dist/cloud/index.js +0 -38
- package/dist/cloud/provisioner/index.d.ts +0 -207
- package/dist/cloud/provisioner/index.js +0 -2069
- package/dist/cloud/server.js +0 -1599
- package/dist/cloud/services/index.d.ts +0 -17
- package/dist/cloud/services/index.js +0 -25
- package/dist/cloud/services/intro-expiration.d.ts +0 -55
- package/dist/cloud/services/intro-expiration.js +0 -211
- package/dist/cloud/services/nango.d.ts +0 -199
- package/dist/cloud/services/nango.js +0 -382
- package/dist/cloud/services/persistence.d.ts +0 -131
- package/dist/config/relay-config.d.ts +0 -23
- package/dist/config/relay-config.js +0 -23
- package/dist/continuity/index.d.ts +0 -45
- package/dist/continuity/index.js +0 -48
- package/dist/continuity/types.d.ts +0 -180
- package/dist/continuity/types.js +0 -9
- package/dist/daemon/agent-manager.d.ts +0 -134
- package/dist/daemon/agent-manager.js +0 -564
- package/dist/daemon/agent-registry.js +0 -213
- package/dist/daemon/api.d.ts +0 -83
- package/dist/daemon/api.js +0 -780
- package/dist/daemon/channel-membership-store.d.ts +0 -48
- package/dist/daemon/channel-membership-store.js +0 -149
- package/dist/daemon/cli-auth.d.ts +0 -82
- package/dist/daemon/cli-auth.js +0 -700
- package/dist/daemon/cloud-sync.d.ts +0 -150
- package/dist/daemon/cloud-sync.js +0 -424
- package/dist/daemon/connection.d.ts +0 -130
- package/dist/daemon/connection.js +0 -438
- package/dist/daemon/consensus-integration.js +0 -371
- package/dist/daemon/delivery-tracker.d.ts +0 -34
- package/dist/daemon/delivery-tracker.js +0 -104
- package/dist/daemon/enhanced-features.d.ts +0 -118
- package/dist/daemon/enhanced-features.js +0 -178
- package/dist/daemon/index.d.ts +0 -14
- package/dist/daemon/index.js +0 -17
- package/dist/daemon/orchestrator.d.ts +0 -157
- package/dist/daemon/orchestrator.js +0 -792
- package/dist/daemon/repo-manager.js +0 -384
- package/dist/daemon/router.d.ts +0 -358
- package/dist/daemon/router.js +0 -1333
- package/dist/daemon/server.d.ts +0 -159
- package/dist/daemon/server.js +0 -788
- package/dist/daemon/services/browser-testing.d.ts +0 -88
- package/dist/daemon/services/browser-testing.js +0 -244
- package/dist/daemon/services/container-spawner.d.ts +0 -135
- package/dist/daemon/services/container-spawner.js +0 -313
- package/dist/daemon/sync-queue.d.ts +0 -116
- package/dist/daemon/sync-queue.js +0 -361
- package/dist/daemon/types.d.ts +0 -131
- package/dist/daemon/user-directory.d.ts +0 -111
- package/dist/daemon/user-directory.js +0 -233
- package/dist/daemon/workspace-manager.js +0 -314
- package/dist/dashboard/out/_next/static/chunks/116-eacf84a131b80db9.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/64-f4268c2ac6f4d7d4.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/766-aa7c8c9900ff5f53.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/891-a024fbe4b619cf6f.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/page-ffad986adfcc8b31.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/page-671037943b2f2e43.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-57cbd738c6a73859.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/providers/setup/[provider]/page-5ab0854472b402b0.js +0 -1
- package/dist/dashboard/out/_next/static/css/8f9ed310f454e5a5.css +0 -1
- package/dist/dashboard-server/server.js +0 -4806
- package/dist/dashboard-server/start.js +0 -13
- package/dist/dashboard-server/user-bridge.d.ts +0 -138
- package/dist/dashboard-server/user-bridge.js +0 -348
- package/dist/hooks/index.d.ts +0 -10
- package/dist/hooks/index.js +0 -10
- package/dist/hooks/registry.js +0 -476
- package/dist/hooks/trajectory-hooks.js +0 -183
- package/dist/hooks/types.d.ts +0 -284
- package/dist/hooks/types.js +0 -8
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -16
- package/dist/memory/memory-hooks.d.ts +0 -60
- package/dist/policy/agent-policy.js +0 -665
- package/dist/protocol/channels.d.ts +0 -211
- package/dist/protocol/channels.js +0 -154
- package/dist/protocol/framing.d.ts +0 -94
- package/dist/protocol/framing.js +0 -240
- package/dist/protocol/index.d.ts +0 -4
- package/dist/protocol/index.js +0 -4
- package/dist/protocol/relay-pty-schemas.d.ts +0 -209
- package/dist/protocol/types.d.ts +0 -168
- package/dist/protocol/types.js +0 -6
- package/dist/resiliency/memory-monitor.js +0 -593
- package/dist/resiliency/provider-context.d.ts +0 -100
- package/dist/shared/cli-auth-config.js +0 -320
- package/dist/state/agent-state.js +0 -120
- package/dist/storage/adapter.d.ts +0 -154
- package/dist/storage/batched-sqlite-adapter.d.ts +0 -71
- package/dist/storage/batched-sqlite-adapter.js +0 -183
- package/dist/storage/sqlite-adapter.d.ts +0 -107
- package/dist/storage/sqlite-adapter.js +0 -717
- package/dist/trajectory/config.d.ts +0 -102
- package/dist/trajectory/config.js +0 -185
- package/dist/trajectory/index.d.ts +0 -8
- package/dist/trajectory/index.js +0 -8
- package/dist/trajectory/integration.js +0 -987
- package/dist/utils/command-resolver.js +0 -76
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.js +0 -4
- package/dist/utils/project-namespace.d.ts +0 -70
- package/dist/utils/project-namespace.js +0 -216
- package/dist/wrapper/base-wrapper.d.ts +0 -217
- package/dist/wrapper/base-wrapper.js +0 -538
- package/dist/wrapper/client.d.ts +0 -199
- package/dist/wrapper/client.js +0 -677
- package/dist/wrapper/idle-detector.d.ts +0 -102
- package/dist/wrapper/idle-detector.js +0 -279
- package/dist/wrapper/index.d.ts +0 -4
- package/dist/wrapper/index.js +0 -7
- package/dist/wrapper/parser.d.ts +0 -230
- package/dist/wrapper/parser.js +0 -1178
- package/dist/wrapper/pty-wrapper.d.ts +0 -343
- package/dist/wrapper/pty-wrapper.js +0 -1593
- package/dist/wrapper/relay-pty-orchestrator.d.ts +0 -296
- package/dist/wrapper/relay-pty-orchestrator.js +0 -1088
- package/dist/wrapper/shared.d.ts +0 -168
- package/dist/wrapper/shared.js +0 -291
- package/dist/wrapper/stuck-detector.d.ts +0 -101
- package/dist/wrapper/stuck-detector.js +0 -228
- package/dist/wrapper/tmux-wrapper.d.ts +0 -344
- package/dist/wrapper/tmux-wrapper.js +0 -1711
- /package/dist/dashboard/out/_next/static/{BffXAqxm-_rUlj2mAnK26 → ZCFjHbkF8yDKS2md3lVgb}/_buildManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/{BffXAqxm-_rUlj2mAnK26 → ZCFjHbkF8yDKS2md3lVgb}/_ssgManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/cloud/link/{page-cfeb437f08a12ed9.js → page-5011ae044b90449d.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/history/{page-240f91e8b06ba8ac.js → page-b2ce7c96ed0931da.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/metrics/{page-82938ab8fcf44694.js → page-bf2cb1e5915bc92d.js} +0 -0
- /package/dist/{cli → src/cli}/index.d.ts +0 -0
- /package/dist/{health-worker-manager.d.ts → src/health-worker-manager.d.ts} +0 -0
- /package/dist/{health-worker-manager.js → src/health-worker-manager.js} +0 -0
- /package/dist/{health-worker.d.ts → src/health-worker.d.ts} +0 -0
- /package/dist/{health-worker.js → src/health-worker.js} +0 -0
- /package/{dist/bridge → packages/bridge/dist}/shadow-cli.d.ts +0 -0
- /package/{dist/bridge → packages/bridge/dist}/types.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/admin.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/auth.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/auth.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/billing.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/codex-auth-helper.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/consensus.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/coordinators.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/daemons.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/generic-webhooks.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/git.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/git.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/github-app.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/middleware/planLimits.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/middleware/planLimits.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/monitoring.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/nango-auth.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/policy.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/providers.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/repos.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/teams.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/test-helpers.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/usage.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/usage.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/webhooks.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/webhooks.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/api/workspaces.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/billing/index.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/billing/index.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/billing/plans.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/billing/service.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/billing/service.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/billing/types.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/billing/types.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/db/bulk-ingest.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/db/bulk-ingest.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/db/index.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/db/index.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/server.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/auto-scaler.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/auto-scaler.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/capacity-manager.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/capacity-manager.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/ci-agent-spawner.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/ci-agent-spawner.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/cloud-message-bus.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/cloud-message-bus.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/compute-enforcement.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/compute-enforcement.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/coordinator.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/coordinator.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/mention-handler.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/mention-handler.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/persistence.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/planLimits.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/planLimits.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/presence-registry.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/presence-registry.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/scaling-orchestrator.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/scaling-orchestrator.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/scaling-policy.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/scaling-policy.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/ssh-security.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/ssh-security.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/workspace-keepalive.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/services/workspace-keepalive.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/index.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/index.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/parsers/github.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/parsers/github.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/parsers/index.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/parsers/index.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/parsers/linear.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/parsers/linear.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/parsers/slack.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/parsers/slack.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/responders/github.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/responders/github.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/responders/index.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/responders/index.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/responders/linear.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/responders/linear.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/responders/slack.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/responders/slack.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/router.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/router.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/rules-engine.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/rules-engine.js +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/types.d.ts +0 -0
- /package/{dist/cloud → packages/cloud/dist}/webhooks/types.js +0 -0
- /package/{dist/utils → packages/config/dist}/agent-config.d.ts +0 -0
- /package/{dist/utils → packages/config/dist}/agent-config.js +0 -0
- /package/{dist/shared → packages/config/dist}/cli-auth-config.d.ts +0 -0
- /package/{dist/bridge → packages/config/dist}/shadow-config.js +0 -0
- /package/{dist/bridge → packages/config/dist}/teams-config.d.ts +0 -0
- /package/{dist/bridge → packages/config/dist}/teams-config.js +0 -0
- /package/{dist/continuity → packages/continuity/dist}/formatter.d.ts +0 -0
- /package/{dist/continuity → packages/continuity/dist}/formatter.js +0 -0
- /package/{dist/continuity → packages/continuity/dist}/handoff-store.d.ts +0 -0
- /package/{dist/continuity → packages/continuity/dist}/handoff-store.js +0 -0
- /package/{dist/continuity → packages/continuity/dist}/ledger-store.d.ts +0 -0
- /package/{dist/continuity → packages/continuity/dist}/ledger-store.js +0 -0
- /package/{dist/continuity → packages/continuity/dist}/manager.d.ts +0 -0
- /package/{dist/continuity → packages/continuity/dist}/manager.js +0 -0
- /package/{dist/continuity → packages/continuity/dist}/parser.d.ts +0 -0
- /package/{dist/continuity → packages/continuity/dist}/parser.js +0 -0
- /package/{dist/daemon → packages/daemon/dist}/agent-registry.d.ts +0 -0
- /package/{dist/daemon → packages/daemon/dist}/agent-signing.d.ts +0 -0
- /package/{dist/daemon → packages/daemon/dist}/agent-signing.js +0 -0
- /package/{dist/daemon → packages/daemon/dist}/auth.d.ts +0 -0
- /package/{dist/daemon → packages/daemon/dist}/auth.js +0 -0
- /package/{dist/daemon → packages/daemon/dist}/consensus-integration.d.ts +0 -0
- /package/{dist/daemon → packages/daemon/dist}/consensus.d.ts +0 -0
- /package/{dist/daemon → packages/daemon/dist}/consensus.js +0 -0
- /package/{dist/daemon → packages/daemon/dist}/rate-limiter.d.ts +0 -0
- /package/{dist/daemon → packages/daemon/dist}/rate-limiter.js +0 -0
- /package/{dist/daemon → packages/daemon/dist}/registry.d.ts +0 -0
- /package/{dist/daemon → packages/daemon/dist}/registry.js +0 -0
- /package/{dist/daemon → packages/daemon/dist}/repo-manager.d.ts +0 -0
- /package/{dist/daemon → packages/daemon/dist}/types.js +0 -0
- /package/{dist/daemon → packages/daemon/dist}/workspace-manager.d.ts +0 -0
- /package/{dist/dashboard-server → packages/dashboard-server/dist}/metrics.d.ts +0 -0
- /package/{dist/dashboard-server → packages/dashboard-server/dist}/metrics.js +0 -0
- /package/{dist/dashboard-server → packages/dashboard-server/dist}/needs-attention.d.ts +0 -0
- /package/{dist/dashboard-server → packages/dashboard-server/dist}/needs-attention.js +0 -0
- /package/{dist/dashboard-server → packages/dashboard-server/dist}/server.d.ts +0 -0
- /package/{dist/dashboard-server → packages/dashboard-server/dist}/start.d.ts +0 -0
- /package/{dist/hooks → packages/hooks/dist}/emitter.d.ts +0 -0
- /package/{dist/hooks → packages/hooks/dist}/emitter.js +0 -0
- /package/{dist/hooks → packages/hooks/dist}/inbox-check/hook.d.ts +0 -0
- /package/{dist/hooks → packages/hooks/dist}/inbox-check/hook.js +0 -0
- /package/{dist/hooks → packages/hooks/dist}/inbox-check/index.d.ts +0 -0
- /package/{dist/hooks → packages/hooks/dist}/inbox-check/index.js +0 -0
- /package/{dist/hooks → packages/hooks/dist}/inbox-check/types.d.ts +0 -0
- /package/{dist/hooks → packages/hooks/dist}/inbox-check/types.js +0 -0
- /package/{dist/hooks → packages/hooks/dist}/inbox-check/utils.d.ts +0 -0
- /package/{dist/hooks → packages/hooks/dist}/inbox-check/utils.js +0 -0
- /package/{dist/hooks → packages/hooks/dist}/registry.d.ts +0 -0
- /package/{dist/hooks → packages/hooks/dist}/trajectory-hooks.d.ts +0 -0
- /package/{dist/memory → packages/memory/dist}/adapters/index.d.ts +0 -0
- /package/{dist/memory → packages/memory/dist}/adapters/index.js +0 -0
- /package/{dist/memory → packages/memory/dist}/adapters/inmemory.d.ts +0 -0
- /package/{dist/memory → packages/memory/dist}/adapters/inmemory.js +0 -0
- /package/{dist/memory → packages/memory/dist}/adapters/supermemory.d.ts +0 -0
- /package/{dist/memory → packages/memory/dist}/adapters/supermemory.js +0 -0
- /package/{dist/memory → packages/memory/dist}/context-compaction.d.ts +0 -0
- /package/{dist/memory → packages/memory/dist}/context-compaction.js +0 -0
- /package/{dist/memory → packages/memory/dist}/factory.d.ts +0 -0
- /package/{dist/memory → packages/memory/dist}/factory.js +0 -0
- /package/{dist/memory → packages/memory/dist}/index.d.ts +0 -0
- /package/{dist/memory → packages/memory/dist}/index.js +0 -0
- /package/{dist/memory → packages/memory/dist}/memory-hooks.js +0 -0
- /package/{dist/memory → packages/memory/dist}/service.d.ts +0 -0
- /package/{dist/memory → packages/memory/dist}/service.js +0 -0
- /package/{dist/memory → packages/memory/dist}/types.d.ts +0 -0
- /package/{dist/memory → packages/memory/dist}/types.js +0 -0
- /package/{dist/policy → packages/policy/dist}/agent-policy.d.ts +0 -0
- /package/{dist/policy → packages/policy/dist}/cloud-policy-fetcher.d.ts +0 -0
- /package/{dist/policy → packages/policy/dist}/cloud-policy-fetcher.js +0 -0
- /package/{dist/utils → packages/protocol/dist}/id-generator.d.ts +0 -0
- /package/{dist/utils → packages/protocol/dist}/id-generator.js +0 -0
- /package/{dist/protocol → packages/protocol/dist}/relay-pty-schemas.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/context-persistence.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/context-persistence.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/crash-insights.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/crash-insights.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/gossip-health.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/gossip-health.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/health-monitor.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/health-monitor.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/index.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/index.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/leader-watchdog.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/leader-watchdog.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/logger.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/logger.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/memory-monitor.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/metrics.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/metrics.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/provider-context.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/stateless-lead.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/stateless-lead.js +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/supervisor.d.ts +0 -0
- /package/{dist/resiliency → packages/resiliency/dist}/supervisor.js +0 -0
- /package/{dist/state → packages/state/dist}/agent-state.d.ts +0 -0
- /package/{dist/storage → packages/storage/dist}/adapter.js +0 -0
- /package/{dist/storage → packages/storage/dist}/dead-letter-queue.d.ts +0 -0
- /package/{dist/storage → packages/storage/dist}/dead-letter-queue.js +0 -0
- /package/{dist/storage → packages/storage/dist}/dlq-adapter.d.ts +0 -0
- /package/{dist/storage → packages/storage/dist}/dlq-adapter.js +0 -0
- /package/{dist/trajectory → packages/trajectory/dist}/integration.d.ts +0 -0
- /package/{dist/utils → packages/utils/dist}/command-resolver.d.ts +0 -0
- /package/{dist/utils → packages/utils/dist}/git-remote.d.ts +0 -0
- /package/{dist/utils → packages/utils/dist}/git-remote.js +0 -0
- /package/{dist/utils → packages/utils/dist}/logger.d.ts +0 -0
- /package/{dist/utils → packages/utils/dist}/logger.js +0 -0
- /package/{dist/utils → packages/utils/dist}/name-generator.d.ts +0 -0
- /package/{dist/utils → packages/utils/dist}/name-generator.js +0 -0
- /package/{dist/utils → packages/utils/dist}/precompiled-patterns.d.ts +0 -0
- /package/{dist/utils → packages/utils/dist}/precompiled-patterns.js +0 -0
- /package/{dist/utils → packages/utils/dist}/update-checker.d.ts +0 -0
- /package/{dist/utils → packages/utils/dist}/update-checker.js +0 -0
- /package/{dist/wrapper → packages/wrapper/dist}/auth-detection.d.ts +0 -0
- /package/{dist/wrapper → packages/wrapper/dist}/auth-detection.js +0 -0
- /package/{dist/wrapper → packages/wrapper/dist}/inbox.d.ts +0 -0
- /package/{dist/wrapper → packages/wrapper/dist}/inbox.js +0 -0
- /package/{dist/wrapper → packages/wrapper/dist}/prompt-composer.d.ts +0 -0
- /package/{dist/wrapper → packages/wrapper/dist}/prompt-composer.js +0 -0
- /package/{dist/utils → packages/wrapper/dist}/tmux-resolver.d.ts +0 -0
- /package/{dist/utils → packages/wrapper/dist}/tmux-resolver.js +0 -0
package/dist/daemon/router.js
DELETED
|
@@ -1,1333 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Message router for the agent relay daemon.
|
|
3
|
-
* Handles routing messages between agents, topic subscriptions, and broadcast.
|
|
4
|
-
*/
|
|
5
|
-
import { generateId } from '../utils/id-generator.js';
|
|
6
|
-
import { PROTOCOL_VERSION, } from '../protocol/types.js';
|
|
7
|
-
import { routerLog } from '../utils/logger.js';
|
|
8
|
-
import { RateLimiter, NoOpRateLimiter } from './rate-limiter.js';
|
|
9
|
-
import * as crypto from 'node:crypto';
|
|
10
|
-
import { DeliveryTracker, } from './delivery-tracker.js';
|
|
11
|
-
export class Router {
|
|
12
|
-
storage;
|
|
13
|
-
channelMembershipStore;
|
|
14
|
-
connections = new Map(); // connectionId -> Connection
|
|
15
|
-
agents = new Map(); // agentName -> Connection
|
|
16
|
-
subscriptions = new Map(); // topic -> Set<agentName>
|
|
17
|
-
processingAgents = new Map(); // agentName -> processing state
|
|
18
|
-
registry;
|
|
19
|
-
crossMachineHandler;
|
|
20
|
-
deliveryTracker;
|
|
21
|
-
/** Shadow relationships: primaryAgent -> list of shadow configs */
|
|
22
|
-
shadowsByPrimary = new Map();
|
|
23
|
-
/** Reverse lookup: shadowAgent -> primaryAgent (for cleanup) */
|
|
24
|
-
primaryByShadow = new Map();
|
|
25
|
-
/** Channel membership: channel -> Set of member names */
|
|
26
|
-
channels = new Map();
|
|
27
|
-
/** User entities (human users, not agents) */
|
|
28
|
-
users = new Map();
|
|
29
|
-
/** Reverse lookup: member name -> Set of channels they're in */
|
|
30
|
-
memberChannels = new Map();
|
|
31
|
-
/**
|
|
32
|
-
* Agents that are currently being spawned but haven't completed HELLO yet.
|
|
33
|
-
* Maps agent name to timestamp when spawn started.
|
|
34
|
-
* Messages sent to these agents will be queued for delivery after HELLO completes.
|
|
35
|
-
*/
|
|
36
|
-
spawningAgents = new Map();
|
|
37
|
-
/** Default timeout for processing indicator (30 seconds) */
|
|
38
|
-
static PROCESSING_TIMEOUT_MS = 30_000;
|
|
39
|
-
/** Timeout for spawning agent entries (60 seconds) */
|
|
40
|
-
static SPAWNING_TIMEOUT_MS = 60_000;
|
|
41
|
-
/** Callback when processing state changes (for real-time dashboard updates) */
|
|
42
|
-
onProcessingStateChange;
|
|
43
|
-
/** Rate limiter for per-agent throttling */
|
|
44
|
-
rateLimiter;
|
|
45
|
-
constructor(options = {}) {
|
|
46
|
-
this.storage = options.storage;
|
|
47
|
-
this.channelMembershipStore = options.channelMembershipStore;
|
|
48
|
-
this.registry = options.registry;
|
|
49
|
-
this.onProcessingStateChange = options.onProcessingStateChange;
|
|
50
|
-
this.crossMachineHandler = options.crossMachineHandler;
|
|
51
|
-
this.deliveryTracker = new DeliveryTracker({
|
|
52
|
-
storage: this.storage,
|
|
53
|
-
delivery: options.delivery,
|
|
54
|
-
getConnection: (id) => this.connections.get(id),
|
|
55
|
-
});
|
|
56
|
-
// Initialize rate limiter (null = disabled)
|
|
57
|
-
this.rateLimiter = options.rateLimit === null
|
|
58
|
-
? new NoOpRateLimiter()
|
|
59
|
-
: new RateLimiter(options.rateLimit);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Restore channel memberships from persisted storage.
|
|
63
|
-
*/
|
|
64
|
-
async restoreChannelMemberships() {
|
|
65
|
-
if (!this.storage && !this.channelMembershipStore)
|
|
66
|
-
return;
|
|
67
|
-
try {
|
|
68
|
-
if (this.channelMembershipStore) {
|
|
69
|
-
const memberships = await this.channelMembershipStore.loadMemberships();
|
|
70
|
-
for (const membership of memberships) {
|
|
71
|
-
this.handleMembershipUpdate({
|
|
72
|
-
channel: membership.channel,
|
|
73
|
-
member: membership.member,
|
|
74
|
-
action: 'join',
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (this.storage) {
|
|
79
|
-
const messages = await this.storage.getMessages({ order: 'asc' });
|
|
80
|
-
for (const msg of messages) {
|
|
81
|
-
const channel = msg.to;
|
|
82
|
-
const data = msg.data;
|
|
83
|
-
const membership = data?._channelMembership;
|
|
84
|
-
if (!channel || !membership?.member) {
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
const action = membership.action ?? 'join';
|
|
88
|
-
this.handleMembershipUpdate({
|
|
89
|
-
channel,
|
|
90
|
-
member: membership.member,
|
|
91
|
-
action,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
catch (err) {
|
|
97
|
-
routerLog.error('Failed to restore channel memberships', { error: String(err) });
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Set or update the cross-machine handler.
|
|
102
|
-
*/
|
|
103
|
-
setCrossMachineHandler(handler) {
|
|
104
|
-
this.crossMachineHandler = handler;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Mark an agent as spawning (before HELLO completes).
|
|
108
|
-
* Messages sent to this agent will be queued for delivery after registration.
|
|
109
|
-
*/
|
|
110
|
-
markSpawning(agentName) {
|
|
111
|
-
this.spawningAgents.set(agentName, Date.now());
|
|
112
|
-
routerLog.info(`Agent marked as spawning: ${agentName}`, {
|
|
113
|
-
currentSpawning: Array.from(this.spawningAgents.keys()),
|
|
114
|
-
});
|
|
115
|
-
// Clean up stale spawning entries
|
|
116
|
-
this.cleanupStaleSpawning();
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Clear the spawning flag for an agent.
|
|
120
|
-
* Called when agent completes registration or spawn fails.
|
|
121
|
-
*/
|
|
122
|
-
clearSpawning(agentName) {
|
|
123
|
-
if (this.spawningAgents.delete(agentName)) {
|
|
124
|
-
routerLog.debug(`Agent spawning flag cleared: ${agentName}`);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Check if an agent is currently spawning.
|
|
129
|
-
*/
|
|
130
|
-
isSpawning(agentName) {
|
|
131
|
-
const timestamp = this.spawningAgents.get(agentName);
|
|
132
|
-
if (!timestamp)
|
|
133
|
-
return false;
|
|
134
|
-
// Check if spawn has timed out
|
|
135
|
-
if (Date.now() - timestamp > Router.SPAWNING_TIMEOUT_MS) {
|
|
136
|
-
this.spawningAgents.delete(agentName);
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Clean up spawning entries older than SPAWNING_TIMEOUT_MS.
|
|
143
|
-
*/
|
|
144
|
-
cleanupStaleSpawning() {
|
|
145
|
-
const now = Date.now();
|
|
146
|
-
for (const [name, timestamp] of this.spawningAgents) {
|
|
147
|
-
if (now - timestamp > Router.SPAWNING_TIMEOUT_MS) {
|
|
148
|
-
this.spawningAgents.delete(name);
|
|
149
|
-
routerLog.debug(`Cleaned up stale spawning entry: ${name}`);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Register a connection after successful handshake.
|
|
155
|
-
*/
|
|
156
|
-
register(connection) {
|
|
157
|
-
this.connections.set(connection.id, connection);
|
|
158
|
-
if (connection.agentName) {
|
|
159
|
-
const isUser = connection.entityType === 'user';
|
|
160
|
-
if (isUser) {
|
|
161
|
-
// Handle existing user connection with same name (disconnect old)
|
|
162
|
-
const existingUser = this.users.get(connection.agentName);
|
|
163
|
-
if (existingUser && existingUser.id !== connection.id) {
|
|
164
|
-
existingUser.close();
|
|
165
|
-
this.connections.delete(existingUser.id);
|
|
166
|
-
}
|
|
167
|
-
this.users.set(connection.agentName, connection);
|
|
168
|
-
routerLog.info(`User registered: ${connection.agentName}`);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
// Handle existing agent connection with same name (disconnect old)
|
|
172
|
-
const existing = this.agents.get(connection.agentName);
|
|
173
|
-
if (existing && existing.id !== connection.id) {
|
|
174
|
-
existing.close();
|
|
175
|
-
this.connections.delete(existing.id);
|
|
176
|
-
}
|
|
177
|
-
this.agents.set(connection.agentName, connection);
|
|
178
|
-
// Clear spawning flag now that agent has completed registration
|
|
179
|
-
this.clearSpawning(connection.agentName);
|
|
180
|
-
this.registry?.registerOrUpdate({
|
|
181
|
-
name: connection.agentName,
|
|
182
|
-
cli: connection.cli,
|
|
183
|
-
program: connection.program,
|
|
184
|
-
model: connection.model,
|
|
185
|
-
task: connection.task,
|
|
186
|
-
workingDirectory: connection.workingDirectory,
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Unregister a connection.
|
|
193
|
-
*/
|
|
194
|
-
unregister(connection) {
|
|
195
|
-
this.connections.delete(connection.id);
|
|
196
|
-
if (connection.agentName) {
|
|
197
|
-
const isUser = connection.entityType === 'user';
|
|
198
|
-
let wasCurrentConnection = false;
|
|
199
|
-
if (isUser) {
|
|
200
|
-
const currentUser = this.users.get(connection.agentName);
|
|
201
|
-
if (currentUser?.id === connection.id) {
|
|
202
|
-
this.users.delete(connection.agentName);
|
|
203
|
-
wasCurrentConnection = true;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
else {
|
|
207
|
-
const current = this.agents.get(connection.agentName);
|
|
208
|
-
if (current?.id === connection.id) {
|
|
209
|
-
this.agents.delete(connection.agentName);
|
|
210
|
-
wasCurrentConnection = true;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
// Only clean up channel/subscription state if this was the current connection.
|
|
214
|
-
// If a new connection replaced this one, we don't want to remove channel memberships
|
|
215
|
-
// that the new connection should inherit.
|
|
216
|
-
if (wasCurrentConnection) {
|
|
217
|
-
// Remove from all subscriptions
|
|
218
|
-
for (const subscribers of this.subscriptions.values()) {
|
|
219
|
-
subscribers.delete(connection.agentName);
|
|
220
|
-
}
|
|
221
|
-
// Remove from all channels and notify remaining members
|
|
222
|
-
this.removeFromAllChannels(connection.agentName);
|
|
223
|
-
// Clean up shadow relationships
|
|
224
|
-
this.unbindShadow(connection.agentName);
|
|
225
|
-
// Clear processing state
|
|
226
|
-
this.clearProcessing(connection.agentName);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
this.clearPendingForConnection(connection.id);
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Remove a member from all channels they're in.
|
|
233
|
-
*/
|
|
234
|
-
removeFromAllChannels(memberName) {
|
|
235
|
-
const memberChannelSet = this.memberChannels.get(memberName);
|
|
236
|
-
if (!memberChannelSet)
|
|
237
|
-
return;
|
|
238
|
-
for (const channelName of memberChannelSet) {
|
|
239
|
-
const members = this.channels.get(channelName);
|
|
240
|
-
if (members) {
|
|
241
|
-
members.delete(memberName);
|
|
242
|
-
// Clean up empty channels
|
|
243
|
-
if (members.size === 0) {
|
|
244
|
-
this.channels.delete(channelName);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
this.memberChannels.delete(memberName);
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Subscribe an agent to a topic.
|
|
252
|
-
*/
|
|
253
|
-
subscribe(agentName, topic) {
|
|
254
|
-
let subscribers = this.subscriptions.get(topic);
|
|
255
|
-
if (!subscribers) {
|
|
256
|
-
subscribers = new Set();
|
|
257
|
-
this.subscriptions.set(topic, subscribers);
|
|
258
|
-
}
|
|
259
|
-
subscribers.add(agentName);
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Unsubscribe an agent from a topic.
|
|
263
|
-
*/
|
|
264
|
-
unsubscribe(agentName, topic) {
|
|
265
|
-
const subscribers = this.subscriptions.get(topic);
|
|
266
|
-
if (subscribers) {
|
|
267
|
-
subscribers.delete(agentName);
|
|
268
|
-
if (subscribers.size === 0) {
|
|
269
|
-
this.subscriptions.delete(topic);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Bind a shadow agent to a primary agent.
|
|
275
|
-
* The shadow will receive copies of messages to/from the primary.
|
|
276
|
-
*/
|
|
277
|
-
bindShadow(shadowAgent, primaryAgent, options = {}) {
|
|
278
|
-
// Clean up any existing shadow binding for this shadow
|
|
279
|
-
this.unbindShadow(shadowAgent);
|
|
280
|
-
const relationship = {
|
|
281
|
-
shadowAgent,
|
|
282
|
-
primaryAgent,
|
|
283
|
-
speakOn: options.speakOn ?? ['EXPLICIT_ASK'],
|
|
284
|
-
receiveIncoming: options.receiveIncoming ?? true,
|
|
285
|
-
receiveOutgoing: options.receiveOutgoing ?? true,
|
|
286
|
-
};
|
|
287
|
-
// Add to primary's shadow list
|
|
288
|
-
let shadows = this.shadowsByPrimary.get(primaryAgent);
|
|
289
|
-
if (!shadows) {
|
|
290
|
-
shadows = [];
|
|
291
|
-
this.shadowsByPrimary.set(primaryAgent, shadows);
|
|
292
|
-
}
|
|
293
|
-
shadows.push(relationship);
|
|
294
|
-
// Set reverse lookup
|
|
295
|
-
this.primaryByShadow.set(shadowAgent, primaryAgent);
|
|
296
|
-
routerLog.info(`Shadow bound: ${shadowAgent} -> ${primaryAgent}`, { speakOn: relationship.speakOn });
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Unbind a shadow agent from its primary.
|
|
300
|
-
*/
|
|
301
|
-
unbindShadow(shadowAgent) {
|
|
302
|
-
const primaryAgent = this.primaryByShadow.get(shadowAgent);
|
|
303
|
-
if (!primaryAgent)
|
|
304
|
-
return;
|
|
305
|
-
// Remove from primary's shadow list
|
|
306
|
-
const shadows = this.shadowsByPrimary.get(primaryAgent);
|
|
307
|
-
if (shadows) {
|
|
308
|
-
const updatedShadows = shadows.filter(s => s.shadowAgent !== shadowAgent);
|
|
309
|
-
if (updatedShadows.length === 0) {
|
|
310
|
-
this.shadowsByPrimary.delete(primaryAgent);
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
this.shadowsByPrimary.set(primaryAgent, updatedShadows);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
// Remove reverse lookup
|
|
317
|
-
this.primaryByShadow.delete(shadowAgent);
|
|
318
|
-
routerLog.info(`Shadow unbound: ${shadowAgent} from ${primaryAgent}`);
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Get all shadows for a primary agent.
|
|
322
|
-
*/
|
|
323
|
-
getShadowsForPrimary(primaryAgent) {
|
|
324
|
-
return this.shadowsByPrimary.get(primaryAgent) ?? [];
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Get the primary agent for a shadow, if any.
|
|
328
|
-
*/
|
|
329
|
-
getPrimaryForShadow(shadowAgent) {
|
|
330
|
-
return this.primaryByShadow.get(shadowAgent);
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Emit a trigger event for an agent's shadows.
|
|
334
|
-
* Shadows configured to speakOn this trigger will receive a notification.
|
|
335
|
-
* @param primaryAgent The agent whose shadows should be notified
|
|
336
|
-
* @param trigger The trigger event that occurred
|
|
337
|
-
* @param context Optional context data about the trigger
|
|
338
|
-
*/
|
|
339
|
-
emitShadowTrigger(primaryAgent, trigger, context) {
|
|
340
|
-
const shadows = this.shadowsByPrimary.get(primaryAgent);
|
|
341
|
-
if (!shadows || shadows.length === 0)
|
|
342
|
-
return;
|
|
343
|
-
for (const shadow of shadows) {
|
|
344
|
-
// Check if this shadow is configured to speak on this trigger
|
|
345
|
-
if (!shadow.speakOn.includes(trigger) && !shadow.speakOn.includes('ALL_MESSAGES')) {
|
|
346
|
-
continue;
|
|
347
|
-
}
|
|
348
|
-
const target = this.agents.get(shadow.shadowAgent);
|
|
349
|
-
if (!target)
|
|
350
|
-
continue;
|
|
351
|
-
// Create a trigger notification envelope
|
|
352
|
-
const triggerEnvelope = {
|
|
353
|
-
v: PROTOCOL_VERSION,
|
|
354
|
-
type: 'SEND',
|
|
355
|
-
id: generateId(),
|
|
356
|
-
ts: Date.now(),
|
|
357
|
-
from: primaryAgent,
|
|
358
|
-
to: shadow.shadowAgent,
|
|
359
|
-
payload: {
|
|
360
|
-
kind: 'action',
|
|
361
|
-
body: `SHADOW_TRIGGER:${trigger}`,
|
|
362
|
-
data: {
|
|
363
|
-
_shadowTrigger: trigger,
|
|
364
|
-
_shadowOf: primaryAgent,
|
|
365
|
-
_triggerContext: context,
|
|
366
|
-
},
|
|
367
|
-
},
|
|
368
|
-
};
|
|
369
|
-
const deliver = this.createDeliverEnvelope(primaryAgent, shadow.shadowAgent, triggerEnvelope, target);
|
|
370
|
-
const sent = target.send(deliver);
|
|
371
|
-
if (sent) {
|
|
372
|
-
this.trackDelivery(target, deliver);
|
|
373
|
-
routerLog.debug(`Shadow trigger ${trigger} sent to ${shadow.shadowAgent}`, { primary: primaryAgent });
|
|
374
|
-
// Set processing state for triggered shadows - they're expected to respond
|
|
375
|
-
this.setProcessing(shadow.shadowAgent, deliver.id);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Check if a shadow should speak based on a specific trigger.
|
|
381
|
-
*/
|
|
382
|
-
shouldShadowSpeak(shadowAgent, trigger) {
|
|
383
|
-
const primaryAgent = this.primaryByShadow.get(shadowAgent);
|
|
384
|
-
if (!primaryAgent)
|
|
385
|
-
return true; // Not a shadow, can always speak
|
|
386
|
-
const shadows = this.shadowsByPrimary.get(primaryAgent);
|
|
387
|
-
if (!shadows)
|
|
388
|
-
return true;
|
|
389
|
-
const relationship = shadows.find(s => s.shadowAgent === shadowAgent);
|
|
390
|
-
if (!relationship)
|
|
391
|
-
return true;
|
|
392
|
-
return relationship.speakOn.includes(trigger) || relationship.speakOn.includes('ALL_MESSAGES');
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Route a SEND message to its destination(s).
|
|
396
|
-
*/
|
|
397
|
-
route(from, envelope) {
|
|
398
|
-
const senderName = from.agentName;
|
|
399
|
-
if (!senderName) {
|
|
400
|
-
routerLog.warn('Dropping message - sender has no name');
|
|
401
|
-
return;
|
|
402
|
-
}
|
|
403
|
-
// Check rate limit
|
|
404
|
-
if (!this.rateLimiter.tryAcquire(senderName)) {
|
|
405
|
-
routerLog.warn(`Rate limited: ${senderName}`);
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
// Agent is responding - clear their processing state
|
|
409
|
-
this.clearProcessing(senderName);
|
|
410
|
-
this.registry?.recordSend(senderName);
|
|
411
|
-
const to = envelope.to;
|
|
412
|
-
const topic = envelope.topic;
|
|
413
|
-
routerLog.info(`Route ${senderName} -> ${to}`, { preview: envelope.payload.body?.substring(0, 50) });
|
|
414
|
-
if (to === '*') {
|
|
415
|
-
// Broadcast to all (except sender)
|
|
416
|
-
this.broadcast(senderName, envelope, topic);
|
|
417
|
-
}
|
|
418
|
-
else if (to) {
|
|
419
|
-
// Direct message
|
|
420
|
-
this.sendDirect(senderName, to, envelope);
|
|
421
|
-
}
|
|
422
|
-
// Route copies to shadows of the sender (outgoing messages)
|
|
423
|
-
this.routeToShadows(senderName, envelope, 'outgoing');
|
|
424
|
-
// Route copies to shadows of the recipient (incoming messages)
|
|
425
|
-
if (to && to !== '*') {
|
|
426
|
-
this.routeToShadows(to, envelope, 'incoming', senderName);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
/**
|
|
430
|
-
* Route a copy of a message to shadows of an agent.
|
|
431
|
-
* @param primaryAgent The primary agent whose shadows should receive the message
|
|
432
|
-
* @param envelope The original message envelope
|
|
433
|
-
* @param direction Whether this is an 'incoming' or 'outgoing' message for the primary
|
|
434
|
-
* @param actualFrom Override the 'from' field (for incoming messages, use original sender)
|
|
435
|
-
*/
|
|
436
|
-
routeToShadows(primaryAgent, envelope, direction, actualFrom) {
|
|
437
|
-
const shadows = this.shadowsByPrimary.get(primaryAgent);
|
|
438
|
-
if (!shadows || shadows.length === 0)
|
|
439
|
-
return;
|
|
440
|
-
for (const shadow of shadows) {
|
|
441
|
-
// Check if shadow wants this direction
|
|
442
|
-
if (direction === 'incoming' && shadow.receiveIncoming === false)
|
|
443
|
-
continue;
|
|
444
|
-
if (direction === 'outgoing' && shadow.receiveOutgoing === false)
|
|
445
|
-
continue;
|
|
446
|
-
// Don't send to self
|
|
447
|
-
if (shadow.shadowAgent === (actualFrom ?? primaryAgent))
|
|
448
|
-
continue;
|
|
449
|
-
const target = this.agents.get(shadow.shadowAgent);
|
|
450
|
-
if (!target)
|
|
451
|
-
continue;
|
|
452
|
-
// Create a shadow copy envelope with metadata indicating it's a shadow copy
|
|
453
|
-
const shadowEnvelope = {
|
|
454
|
-
...envelope,
|
|
455
|
-
payload: {
|
|
456
|
-
...envelope.payload,
|
|
457
|
-
data: {
|
|
458
|
-
...envelope.payload.data,
|
|
459
|
-
_shadowCopy: true,
|
|
460
|
-
_shadowOf: primaryAgent,
|
|
461
|
-
_shadowDirection: direction,
|
|
462
|
-
},
|
|
463
|
-
},
|
|
464
|
-
};
|
|
465
|
-
const deliver = this.createDeliverEnvelope(actualFrom ?? primaryAgent, shadow.shadowAgent, shadowEnvelope, target);
|
|
466
|
-
const sent = target.send(deliver);
|
|
467
|
-
if (sent) {
|
|
468
|
-
this.trackDelivery(target, deliver);
|
|
469
|
-
routerLog.debug(`Shadow copy to ${shadow.shadowAgent}`, { direction, primary: primaryAgent });
|
|
470
|
-
// Note: Don't set processing state for shadow copies - shadow stays passive
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
/**
|
|
475
|
-
* Send a direct message to a specific agent.
|
|
476
|
-
*
|
|
477
|
-
* If the target agent is offline but known (has connected before),
|
|
478
|
-
* the message is persisted for delivery when the agent reconnects.
|
|
479
|
-
* This prevents silent message drops during brief disconnections or spawn timing issues.
|
|
480
|
-
*/
|
|
481
|
-
sendDirect(from, to, envelope) {
|
|
482
|
-
const target = this.agents.get(to) ?? this.users.get(to);
|
|
483
|
-
const isUserTarget = target?.entityType === 'user';
|
|
484
|
-
// If agent not found locally, check if it's on a remote machine
|
|
485
|
-
if (!target) {
|
|
486
|
-
const remoteAgent = this.crossMachineHandler?.isRemoteAgent(to);
|
|
487
|
-
if (remoteAgent) {
|
|
488
|
-
routerLog.info(`Routing to remote agent: ${to}`, { daemonName: remoteAgent.daemonName });
|
|
489
|
-
return this.sendToRemoteAgent(from, to, envelope, remoteAgent);
|
|
490
|
-
}
|
|
491
|
-
// Also check if it's a remote user (human connected via cloud dashboard)
|
|
492
|
-
const remoteUser = this.crossMachineHandler?.isRemoteUser?.(to);
|
|
493
|
-
if (remoteUser) {
|
|
494
|
-
routerLog.info(`Routing to remote user: ${to}`, { daemonName: remoteUser.daemonName });
|
|
495
|
-
return this.sendToRemoteAgent(from, to, envelope, remoteUser);
|
|
496
|
-
}
|
|
497
|
-
// Check if this is a known agent (has connected before) - queue for later delivery
|
|
498
|
-
// This prevents message drops during brief disconnections or spawn timing issues
|
|
499
|
-
if (this.registry?.has(to)) {
|
|
500
|
-
routerLog.info(`Target "${to}" offline but known, queueing message for delivery on reconnect`);
|
|
501
|
-
this.persistMessageForOfflineAgent(from, to, envelope);
|
|
502
|
-
return true; // Message accepted (queued), not dropped
|
|
503
|
-
}
|
|
504
|
-
// Check if agent is currently spawning (pre-HELLO) - queue for delivery after registration
|
|
505
|
-
// This handles the race condition between spawn completion and HELLO handshake
|
|
506
|
-
const spawning = this.isSpawning(to);
|
|
507
|
-
routerLog.debug(`Spawning check for "${to}": ${spawning}`, {
|
|
508
|
-
spawningAgents: Array.from(this.spawningAgents.keys()),
|
|
509
|
-
hasStorage: !!this.storage,
|
|
510
|
-
});
|
|
511
|
-
if (spawning) {
|
|
512
|
-
routerLog.info(`Target "${to}" is spawning, queueing message for delivery after registration`);
|
|
513
|
-
this.persistMessageForOfflineAgent(from, to, envelope);
|
|
514
|
-
return true; // Message accepted (queued), not dropped
|
|
515
|
-
}
|
|
516
|
-
routerLog.warn(`Target "${to}" not found and unknown`, { availableAgents: Array.from(this.agents.keys()), spawningAgents: Array.from(this.spawningAgents.keys()) });
|
|
517
|
-
return false;
|
|
518
|
-
}
|
|
519
|
-
const deliver = this.createDeliverEnvelope(from, to, envelope, target);
|
|
520
|
-
const sent = target.send(deliver);
|
|
521
|
-
routerLog.info(`Delivered ${from} -> ${to}`, { success: sent, preview: envelope.payload.body?.substring(0, 40) });
|
|
522
|
-
this.persistDeliverEnvelope(deliver);
|
|
523
|
-
if (sent) {
|
|
524
|
-
this.trackDelivery(target, deliver);
|
|
525
|
-
this.registry?.recordReceive(to);
|
|
526
|
-
// Only mark AI agents as processing; humans don't need processing indicators
|
|
527
|
-
if (!isUserTarget) {
|
|
528
|
-
this.setProcessing(to, deliver.id);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
return sent;
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* Send a message to an agent on a remote machine via cloud.
|
|
535
|
-
*/
|
|
536
|
-
sendToRemoteAgent(from, to, envelope, remoteAgent) {
|
|
537
|
-
if (!this.crossMachineHandler) {
|
|
538
|
-
routerLog.warn('Cross-machine handler not available');
|
|
539
|
-
return false;
|
|
540
|
-
}
|
|
541
|
-
// Send asynchronously via cloud
|
|
542
|
-
this.crossMachineHandler.sendCrossMachineMessage(remoteAgent.daemonId, to, from, envelope.payload.body, {
|
|
543
|
-
topic: envelope.topic,
|
|
544
|
-
thread: envelope.payload.thread,
|
|
545
|
-
kind: envelope.payload.kind,
|
|
546
|
-
data: envelope.payload.data,
|
|
547
|
-
originalId: envelope.id,
|
|
548
|
-
}).then((sent) => {
|
|
549
|
-
if (sent) {
|
|
550
|
-
routerLog.info(`Cross-machine message sent to ${to}`, { daemonName: remoteAgent.daemonName });
|
|
551
|
-
// Persist as cross-machine message
|
|
552
|
-
this.storage?.saveMessage({
|
|
553
|
-
id: envelope.id || `cross-${Date.now()}`,
|
|
554
|
-
ts: Date.now(),
|
|
555
|
-
from,
|
|
556
|
-
to,
|
|
557
|
-
topic: envelope.topic,
|
|
558
|
-
kind: envelope.payload.kind,
|
|
559
|
-
body: envelope.payload.body,
|
|
560
|
-
data: {
|
|
561
|
-
...envelope.payload.data,
|
|
562
|
-
_crossMachine: true,
|
|
563
|
-
_targetDaemon: remoteAgent.daemonId,
|
|
564
|
-
_targetDaemonName: remoteAgent.daemonName,
|
|
565
|
-
},
|
|
566
|
-
thread: envelope.payload.thread,
|
|
567
|
-
status: 'unread',
|
|
568
|
-
is_urgent: false,
|
|
569
|
-
is_broadcast: false,
|
|
570
|
-
}).catch(err => routerLog.error('Failed to persist cross-machine message', { error: String(err) }));
|
|
571
|
-
}
|
|
572
|
-
else {
|
|
573
|
-
routerLog.error(`Failed to send cross-machine message to ${to}`);
|
|
574
|
-
}
|
|
575
|
-
}).catch(err => {
|
|
576
|
-
routerLog.error('Cross-machine send error', { error: String(err) });
|
|
577
|
-
});
|
|
578
|
-
// Return true immediately - message is queued
|
|
579
|
-
return true;
|
|
580
|
-
}
|
|
581
|
-
/**
|
|
582
|
-
* Broadcast to all agents (optionally filtered by topic subscription).
|
|
583
|
-
*/
|
|
584
|
-
broadcast(from, envelope, topic) {
|
|
585
|
-
// Build recipients list from both agents and users
|
|
586
|
-
const recipients = topic
|
|
587
|
-
? this.subscriptions.get(topic) ?? new Set()
|
|
588
|
-
: new Set([...this.agents.keys(), ...this.users.keys()]);
|
|
589
|
-
for (const recipientName of recipients) {
|
|
590
|
-
if (recipientName === from)
|
|
591
|
-
continue; // Don't send to self
|
|
592
|
-
// Check both agents and users maps (consistent with sendDirect)
|
|
593
|
-
const target = this.agents.get(recipientName) ?? this.users.get(recipientName);
|
|
594
|
-
if (target) {
|
|
595
|
-
const isUserTarget = target.entityType === 'user';
|
|
596
|
-
const deliver = this.createDeliverEnvelope(from, recipientName, envelope, target);
|
|
597
|
-
const sent = target.send(deliver);
|
|
598
|
-
this.persistDeliverEnvelope(deliver, true); // Mark as broadcast
|
|
599
|
-
if (sent) {
|
|
600
|
-
this.trackDelivery(target, deliver);
|
|
601
|
-
this.registry?.recordReceive(recipientName);
|
|
602
|
-
// Only mark AI agents as processing; humans don't need processing indicators
|
|
603
|
-
if (!isUserTarget) {
|
|
604
|
-
this.setProcessing(recipientName, deliver.id);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* Create a DELIVER envelope from a SEND.
|
|
612
|
-
*/
|
|
613
|
-
createDeliverEnvelope(from, to, original, target) {
|
|
614
|
-
// Preserve the original 'to' field for broadcasts so agents know to reply to '*'
|
|
615
|
-
const originalTo = original.to;
|
|
616
|
-
return {
|
|
617
|
-
v: PROTOCOL_VERSION,
|
|
618
|
-
type: 'DELIVER',
|
|
619
|
-
id: generateId(),
|
|
620
|
-
ts: Date.now(),
|
|
621
|
-
from,
|
|
622
|
-
to,
|
|
623
|
-
topic: original.topic,
|
|
624
|
-
payload: original.payload,
|
|
625
|
-
payload_meta: original.payload_meta,
|
|
626
|
-
delivery: {
|
|
627
|
-
seq: target.getNextSeq(original.topic ?? 'default', from),
|
|
628
|
-
session_id: target.sessionId,
|
|
629
|
-
originalTo: originalTo !== to ? originalTo : undefined, // Only include if different
|
|
630
|
-
},
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
/**
|
|
634
|
-
* Persist a delivered message if storage is configured.
|
|
635
|
-
*/
|
|
636
|
-
persistDeliverEnvelope(envelope, isBroadcast = false) {
|
|
637
|
-
if (!this.storage)
|
|
638
|
-
return;
|
|
639
|
-
this.storage.saveMessage({
|
|
640
|
-
id: envelope.id,
|
|
641
|
-
ts: envelope.ts,
|
|
642
|
-
from: envelope.from ?? 'unknown',
|
|
643
|
-
to: envelope.to ?? 'unknown',
|
|
644
|
-
topic: envelope.topic,
|
|
645
|
-
kind: envelope.payload.kind,
|
|
646
|
-
body: envelope.payload.body,
|
|
647
|
-
data: envelope.payload.data,
|
|
648
|
-
payloadMeta: envelope.payload_meta,
|
|
649
|
-
thread: envelope.payload.thread,
|
|
650
|
-
deliverySeq: envelope.delivery.seq,
|
|
651
|
-
deliverySessionId: envelope.delivery.session_id,
|
|
652
|
-
sessionId: envelope.delivery.session_id,
|
|
653
|
-
status: 'unread',
|
|
654
|
-
is_urgent: false,
|
|
655
|
-
is_broadcast: isBroadcast || envelope.to === '*',
|
|
656
|
-
}).catch((err) => {
|
|
657
|
-
routerLog.error('Failed to persist message', { error: String(err) });
|
|
658
|
-
});
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* Persist a message for an offline agent.
|
|
662
|
-
* Called when a message is sent to a known agent that is not currently connected.
|
|
663
|
-
* The message is marked with _offlineQueued and will be delivered when the agent reconnects.
|
|
664
|
-
*/
|
|
665
|
-
persistMessageForOfflineAgent(from, to, envelope) {
|
|
666
|
-
if (!this.storage) {
|
|
667
|
-
routerLog.warn('Cannot queue offline message: no storage configured');
|
|
668
|
-
return;
|
|
669
|
-
}
|
|
670
|
-
routerLog.info(`Persisting offline message for "${to}"`, {
|
|
671
|
-
from,
|
|
672
|
-
messageId: envelope.id,
|
|
673
|
-
bodyPreview: envelope.payload.body?.substring(0, 50),
|
|
674
|
-
});
|
|
675
|
-
this.storage.saveMessage({
|
|
676
|
-
id: envelope.id || generateId(),
|
|
677
|
-
ts: Date.now(),
|
|
678
|
-
from,
|
|
679
|
-
to,
|
|
680
|
-
topic: envelope.topic,
|
|
681
|
-
kind: envelope.payload.kind,
|
|
682
|
-
body: envelope.payload.body,
|
|
683
|
-
data: {
|
|
684
|
-
...envelope.payload.data,
|
|
685
|
-
_offlineQueued: true, // Mark as queued for offline delivery
|
|
686
|
-
_queuedAt: Date.now(),
|
|
687
|
-
},
|
|
688
|
-
payloadMeta: envelope.payload_meta,
|
|
689
|
-
thread: envelope.payload.thread,
|
|
690
|
-
status: 'unread', // Unread = pending delivery
|
|
691
|
-
is_urgent: false,
|
|
692
|
-
is_broadcast: false,
|
|
693
|
-
}).catch((err) => {
|
|
694
|
-
routerLog.error('Failed to persist offline message', { error: String(err), to });
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Deliver pending messages to an agent that just connected.
|
|
699
|
-
* Queries for unread messages addressed to this agent that were queued while offline.
|
|
700
|
-
* This handles messages that were sent while the agent was offline.
|
|
701
|
-
*/
|
|
702
|
-
async deliverPendingMessages(connection) {
|
|
703
|
-
const agentName = connection.agentName;
|
|
704
|
-
if (!agentName)
|
|
705
|
-
return;
|
|
706
|
-
if (!this.storage?.getMessages)
|
|
707
|
-
return;
|
|
708
|
-
try {
|
|
709
|
-
// Query for unread messages addressed to this agent
|
|
710
|
-
const pendingMessages = await this.storage.getMessages({
|
|
711
|
-
to: agentName,
|
|
712
|
-
unreadOnly: true,
|
|
713
|
-
order: 'asc', // Deliver oldest first
|
|
714
|
-
});
|
|
715
|
-
// Filter to only include offline-queued messages (not already-delivered unacked messages)
|
|
716
|
-
const offlineMessages = pendingMessages.filter(msg => msg.data?._offlineQueued === true).sort((a, b) => a.ts - b.ts);
|
|
717
|
-
if (offlineMessages.length === 0)
|
|
718
|
-
return;
|
|
719
|
-
routerLog.info(`Delivering ${offlineMessages.length} pending messages to ${agentName}`);
|
|
720
|
-
for (const msg of offlineMessages) {
|
|
721
|
-
// Create deliver envelope
|
|
722
|
-
const deliverEnvelope = {
|
|
723
|
-
v: PROTOCOL_VERSION,
|
|
724
|
-
type: 'DELIVER',
|
|
725
|
-
id: generateId(),
|
|
726
|
-
ts: Date.now(),
|
|
727
|
-
from: msg.from,
|
|
728
|
-
to: agentName,
|
|
729
|
-
topic: msg.topic,
|
|
730
|
-
payload: {
|
|
731
|
-
body: msg.body,
|
|
732
|
-
kind: msg.kind,
|
|
733
|
-
data: msg.data,
|
|
734
|
-
thread: msg.thread,
|
|
735
|
-
},
|
|
736
|
-
payload_meta: msg.payloadMeta,
|
|
737
|
-
delivery: {
|
|
738
|
-
seq: connection.getNextSeq(msg.topic ?? 'default', msg.from),
|
|
739
|
-
session_id: connection.sessionId,
|
|
740
|
-
},
|
|
741
|
-
};
|
|
742
|
-
const sent = connection.send(deliverEnvelope);
|
|
743
|
-
if (sent) {
|
|
744
|
-
this.trackDelivery(connection, deliverEnvelope);
|
|
745
|
-
this.registry?.recordReceive(agentName);
|
|
746
|
-
this.setProcessing(agentName, deliverEnvelope.id);
|
|
747
|
-
// Mark original message as delivered (update status)
|
|
748
|
-
if (this.storage.updateMessageStatus) {
|
|
749
|
-
await this.storage.updateMessageStatus(msg.id, 'read');
|
|
750
|
-
}
|
|
751
|
-
routerLog.info(`Delivered pending message to ${agentName}`, {
|
|
752
|
-
from: msg.from,
|
|
753
|
-
preview: msg.body.substring(0, 40),
|
|
754
|
-
});
|
|
755
|
-
}
|
|
756
|
-
else {
|
|
757
|
-
routerLog.warn(`Failed to deliver pending message to ${agentName}`);
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
catch (err) {
|
|
762
|
-
routerLog.error('Failed to deliver pending messages', { error: String(err), agentName });
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
/**
|
|
766
|
-
* Get list of connected agent names.
|
|
767
|
-
*/
|
|
768
|
-
getAgents() {
|
|
769
|
-
return Array.from(this.agents.keys());
|
|
770
|
-
}
|
|
771
|
-
/**
|
|
772
|
-
* Get connection by agent name.
|
|
773
|
-
*/
|
|
774
|
-
getConnection(agentName) {
|
|
775
|
-
return this.agents.get(agentName);
|
|
776
|
-
}
|
|
777
|
-
/**
|
|
778
|
-
* Get number of active connections.
|
|
779
|
-
*/
|
|
780
|
-
get connectionCount() {
|
|
781
|
-
return this.connections.size;
|
|
782
|
-
}
|
|
783
|
-
get pendingDeliveryCount() {
|
|
784
|
-
return this.deliveryTracker.pendingCount;
|
|
785
|
-
}
|
|
786
|
-
/**
|
|
787
|
-
* Get rate limiter statistics.
|
|
788
|
-
*/
|
|
789
|
-
getRateLimiterStats() {
|
|
790
|
-
return this.rateLimiter.getStats();
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* Reset rate limit for a specific agent (admin operation).
|
|
794
|
-
*/
|
|
795
|
-
resetRateLimit(agentName) {
|
|
796
|
-
this.rateLimiter.reset(agentName);
|
|
797
|
-
}
|
|
798
|
-
/**
|
|
799
|
-
* Get list of agents currently processing (thinking).
|
|
800
|
-
* Returns an object with agent names as keys and processing info as values.
|
|
801
|
-
*/
|
|
802
|
-
getProcessingAgents() {
|
|
803
|
-
const result = {};
|
|
804
|
-
for (const [name, state] of this.processingAgents.entries()) {
|
|
805
|
-
result[name] = { startedAt: state.startedAt, messageId: state.messageId };
|
|
806
|
-
}
|
|
807
|
-
return result;
|
|
808
|
-
}
|
|
809
|
-
/**
|
|
810
|
-
* Check if a specific agent is processing.
|
|
811
|
-
*/
|
|
812
|
-
isAgentProcessing(agentName) {
|
|
813
|
-
return this.processingAgents.has(agentName);
|
|
814
|
-
}
|
|
815
|
-
/**
|
|
816
|
-
* Mark an agent as processing (called when they receive a message).
|
|
817
|
-
*/
|
|
818
|
-
setProcessing(agentName, messageId) {
|
|
819
|
-
// Clear any existing processing state
|
|
820
|
-
this.clearProcessing(agentName);
|
|
821
|
-
const timer = setTimeout(() => {
|
|
822
|
-
this.clearProcessing(agentName);
|
|
823
|
-
routerLog.warn(`Processing timeout for ${agentName}`);
|
|
824
|
-
}, Router.PROCESSING_TIMEOUT_MS);
|
|
825
|
-
this.processingAgents.set(agentName, {
|
|
826
|
-
startedAt: Date.now(),
|
|
827
|
-
messageId,
|
|
828
|
-
timer,
|
|
829
|
-
});
|
|
830
|
-
routerLog.debug(`${agentName} started processing`, { messageId });
|
|
831
|
-
this.onProcessingStateChange?.();
|
|
832
|
-
}
|
|
833
|
-
/**
|
|
834
|
-
* Clear processing state for an agent (called when they send a message).
|
|
835
|
-
*/
|
|
836
|
-
clearProcessing(agentName) {
|
|
837
|
-
const state = this.processingAgents.get(agentName);
|
|
838
|
-
if (state) {
|
|
839
|
-
if (state.timer) {
|
|
840
|
-
clearTimeout(state.timer);
|
|
841
|
-
}
|
|
842
|
-
this.processingAgents.delete(agentName);
|
|
843
|
-
routerLog.debug(`${agentName} finished processing`);
|
|
844
|
-
this.onProcessingStateChange?.();
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
/**
|
|
848
|
-
* Handle ACK for previously delivered messages.
|
|
849
|
-
*/
|
|
850
|
-
handleAck(connection, envelope) {
|
|
851
|
-
const ackId = envelope.payload.ack_id;
|
|
852
|
-
this.deliveryTracker.handleAck(connection.id, ackId);
|
|
853
|
-
}
|
|
854
|
-
/**
|
|
855
|
-
* Clear pending deliveries for a connection (e.g., on disconnect).
|
|
856
|
-
*/
|
|
857
|
-
clearPendingForConnection(connectionId) {
|
|
858
|
-
this.deliveryTracker.clearPendingForConnection(connectionId);
|
|
859
|
-
}
|
|
860
|
-
/**
|
|
861
|
-
* Track a delivery and schedule retries until ACKed or TTL/attempts exhausted.
|
|
862
|
-
*/
|
|
863
|
-
trackDelivery(target, deliver) {
|
|
864
|
-
this.deliveryTracker.track(target, deliver);
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Broadcast a system message to all connected agents.
|
|
868
|
-
* Used for system notifications like agent death announcements.
|
|
869
|
-
*/
|
|
870
|
-
broadcastSystemMessage(message, data) {
|
|
871
|
-
const envelope = {
|
|
872
|
-
v: PROTOCOL_VERSION,
|
|
873
|
-
type: 'SEND',
|
|
874
|
-
id: generateId(),
|
|
875
|
-
ts: Date.now(),
|
|
876
|
-
from: '_system',
|
|
877
|
-
to: '*',
|
|
878
|
-
payload: {
|
|
879
|
-
kind: 'message',
|
|
880
|
-
body: message,
|
|
881
|
-
data: {
|
|
882
|
-
...data,
|
|
883
|
-
_isSystemMessage: true,
|
|
884
|
-
},
|
|
885
|
-
},
|
|
886
|
-
};
|
|
887
|
-
// Broadcast to all agents
|
|
888
|
-
for (const [agentName, connection] of this.agents.entries()) {
|
|
889
|
-
const deliver = this.createDeliverEnvelope('_system', agentName, envelope, connection);
|
|
890
|
-
const sent = connection.send(deliver);
|
|
891
|
-
if (sent) {
|
|
892
|
-
routerLog.debug(`System broadcast sent to ${agentName}`);
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
/**
|
|
897
|
-
* Replay any pending (unacked) messages for a resumed session.
|
|
898
|
-
*/
|
|
899
|
-
async replayPending(connection) {
|
|
900
|
-
if (!this.storage?.getPendingMessagesForSession || !connection.agentName) {
|
|
901
|
-
return;
|
|
902
|
-
}
|
|
903
|
-
const pending = await this.storage.getPendingMessagesForSession(connection.agentName, connection.sessionId);
|
|
904
|
-
if (!pending.length)
|
|
905
|
-
return;
|
|
906
|
-
routerLog.info(`Replaying ${pending.length} messages to ${connection.agentName}`);
|
|
907
|
-
for (const msg of pending) {
|
|
908
|
-
const deliver = {
|
|
909
|
-
v: PROTOCOL_VERSION,
|
|
910
|
-
type: 'DELIVER',
|
|
911
|
-
id: msg.id,
|
|
912
|
-
ts: msg.ts,
|
|
913
|
-
from: msg.from,
|
|
914
|
-
to: msg.to,
|
|
915
|
-
topic: msg.topic,
|
|
916
|
-
payload: {
|
|
917
|
-
kind: msg.kind,
|
|
918
|
-
body: msg.body,
|
|
919
|
-
data: msg.data,
|
|
920
|
-
thread: msg.thread,
|
|
921
|
-
},
|
|
922
|
-
payload_meta: msg.payloadMeta,
|
|
923
|
-
delivery: {
|
|
924
|
-
seq: msg.deliverySeq ?? connection.getNextSeq(msg.topic ?? 'default', msg.from),
|
|
925
|
-
session_id: msg.deliverySessionId ?? connection.sessionId,
|
|
926
|
-
},
|
|
927
|
-
};
|
|
928
|
-
const sent = connection.send(deliver);
|
|
929
|
-
if (sent) {
|
|
930
|
-
this.trackDelivery(connection, deliver);
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
// ==================== Channel Methods ====================
|
|
935
|
-
/**
|
|
936
|
-
* Handle a CHANNEL_JOIN message.
|
|
937
|
-
* Adds the member to the channel and notifies existing members.
|
|
938
|
-
* If payload.member is set, adds that member (admin mode).
|
|
939
|
-
* Otherwise, adds the connection's agent name.
|
|
940
|
-
*/
|
|
941
|
-
handleChannelJoin(connection, envelope) {
|
|
942
|
-
// Use payload.member if provided (admin mode), otherwise use connection's name
|
|
943
|
-
const memberName = envelope.payload.member ?? connection.agentName;
|
|
944
|
-
if (!memberName) {
|
|
945
|
-
routerLog.warn('CHANNEL_JOIN from connection without name and no member specified');
|
|
946
|
-
return;
|
|
947
|
-
}
|
|
948
|
-
const channel = envelope.payload.channel;
|
|
949
|
-
const isAdminJoin = Boolean(envelope.payload.member);
|
|
950
|
-
// Get or create channel
|
|
951
|
-
let members = this.channels.get(channel);
|
|
952
|
-
if (!members) {
|
|
953
|
-
members = new Set();
|
|
954
|
-
this.channels.set(channel, members);
|
|
955
|
-
}
|
|
956
|
-
// Check if already a member
|
|
957
|
-
if (members.has(memberName)) {
|
|
958
|
-
routerLog.debug(`${memberName} already in ${channel}`);
|
|
959
|
-
return;
|
|
960
|
-
}
|
|
961
|
-
// Only notify existing members for non-admin joins (agents joining themselves)
|
|
962
|
-
// Admin joins are silent to avoid spamming notifications when syncing
|
|
963
|
-
if (!isAdminJoin) {
|
|
964
|
-
const existingMembers = members ? Array.from(members) : [];
|
|
965
|
-
for (const existingMember of existingMembers) {
|
|
966
|
-
const memberConn = this.getConnectionByName(existingMember);
|
|
967
|
-
if (memberConn) {
|
|
968
|
-
const joinNotification = {
|
|
969
|
-
v: PROTOCOL_VERSION,
|
|
970
|
-
type: 'CHANNEL_JOIN',
|
|
971
|
-
id: generateId(),
|
|
972
|
-
ts: Date.now(),
|
|
973
|
-
from: memberName,
|
|
974
|
-
payload: envelope.payload,
|
|
975
|
-
};
|
|
976
|
-
memberConn.send(joinNotification);
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
const added = this.addChannelMember(channel, memberName, { persist: true });
|
|
981
|
-
if (!added) {
|
|
982
|
-
routerLog.debug(`${memberName} already in ${channel}`);
|
|
983
|
-
return;
|
|
984
|
-
}
|
|
985
|
-
routerLog.info(`${memberName} joined ${channel} (${this.channels.get(channel)?.size ?? 0} members)${isAdminJoin ? ' [admin]' : ''}`);
|
|
986
|
-
}
|
|
987
|
-
/**
|
|
988
|
-
* Handle a CHANNEL_LEAVE message.
|
|
989
|
-
* Removes the member from the channel and notifies remaining members.
|
|
990
|
-
* If payload.member is provided, removes that member instead (admin mode).
|
|
991
|
-
*/
|
|
992
|
-
handleChannelLeave(connection, envelope) {
|
|
993
|
-
// Use payload.member if provided (admin mode), otherwise use connection's name
|
|
994
|
-
const memberName = envelope.payload.member ?? connection.agentName;
|
|
995
|
-
if (!memberName) {
|
|
996
|
-
routerLog.warn('CHANNEL_LEAVE from connection without name and no member specified');
|
|
997
|
-
return;
|
|
998
|
-
}
|
|
999
|
-
const channel = envelope.payload.channel;
|
|
1000
|
-
const isAdminRemove = Boolean(envelope.payload.member);
|
|
1001
|
-
const members = this.channels.get(channel);
|
|
1002
|
-
if (!members || !members.has(memberName)) {
|
|
1003
|
-
routerLog.debug(`${memberName} not in ${channel}, ignoring leave`);
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
const removed = this.removeChannelMember(channel, memberName, { persist: true });
|
|
1007
|
-
if (!removed) {
|
|
1008
|
-
routerLog.debug(`${memberName} not in ${channel}, ignoring leave`);
|
|
1009
|
-
return;
|
|
1010
|
-
}
|
|
1011
|
-
// Only notify remaining members for non-admin removes
|
|
1012
|
-
// Admin removes are silent to avoid spamming notifications
|
|
1013
|
-
if (!isAdminRemove) {
|
|
1014
|
-
const remainingMembers = this.channels.get(channel);
|
|
1015
|
-
if (remainingMembers) {
|
|
1016
|
-
for (const remainingMember of remainingMembers) {
|
|
1017
|
-
const memberConn = this.getConnectionByName(remainingMember);
|
|
1018
|
-
if (memberConn) {
|
|
1019
|
-
const leaveNotification = {
|
|
1020
|
-
v: PROTOCOL_VERSION,
|
|
1021
|
-
type: 'CHANNEL_LEAVE',
|
|
1022
|
-
id: generateId(),
|
|
1023
|
-
ts: Date.now(),
|
|
1024
|
-
from: memberName,
|
|
1025
|
-
payload: envelope.payload,
|
|
1026
|
-
};
|
|
1027
|
-
memberConn.send(leaveNotification);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
routerLog.info(`${memberName} left ${channel}${isAdminRemove ? ' [admin]' : ''}`);
|
|
1033
|
-
}
|
|
1034
|
-
/**
|
|
1035
|
-
* Route a channel message to all members except the sender.
|
|
1036
|
-
*/
|
|
1037
|
-
routeChannelMessage(connection, envelope) {
|
|
1038
|
-
const senderName = connection.agentName;
|
|
1039
|
-
if (!senderName) {
|
|
1040
|
-
routerLog.warn('CHANNEL_MESSAGE from connection without name');
|
|
1041
|
-
return;
|
|
1042
|
-
}
|
|
1043
|
-
const channel = envelope.payload.channel;
|
|
1044
|
-
const members = this.channels.get(channel);
|
|
1045
|
-
routerLog.info(`routeChannelMessage: channel=${channel} sender=${senderName} members=${members ? Array.from(members).join(',') : 'NONE'}`);
|
|
1046
|
-
if (!members) {
|
|
1047
|
-
routerLog.warn(`Message to non-existent channel ${channel} (available channels: ${Array.from(this.channels.keys()).join(', ')})`);
|
|
1048
|
-
return;
|
|
1049
|
-
}
|
|
1050
|
-
// Case-insensitive membership check
|
|
1051
|
-
const senderMemberName = this.findMemberInSet(members, senderName);
|
|
1052
|
-
if (!senderMemberName) {
|
|
1053
|
-
routerLog.warn(`${senderName} not a member of ${channel} (members: ${Array.from(members).join(', ')})`);
|
|
1054
|
-
return;
|
|
1055
|
-
}
|
|
1056
|
-
// Route to all members except the sender (no echo)
|
|
1057
|
-
const allMembers = Array.from(members);
|
|
1058
|
-
routerLog.info(`Routing channel message from ${senderName} to ${channel}`, {
|
|
1059
|
-
totalMembers: allMembers.length,
|
|
1060
|
-
members: allMembers,
|
|
1061
|
-
});
|
|
1062
|
-
let deliveredCount = 0;
|
|
1063
|
-
const undeliveredMembers = [];
|
|
1064
|
-
const connectedAgents = Array.from(this.agents.keys());
|
|
1065
|
-
const connectedUsers = Array.from(this.users.keys());
|
|
1066
|
-
routerLog.info(`Connected entities: agents=[${connectedAgents.join(',')}] users=[${connectedUsers.join(',')}]`);
|
|
1067
|
-
for (const memberName of members) {
|
|
1068
|
-
// Case-insensitive comparison to skip sender
|
|
1069
|
-
if (this.namesMatch(memberName, senderName)) {
|
|
1070
|
-
continue;
|
|
1071
|
-
}
|
|
1072
|
-
const memberConn = this.getConnectionByName(memberName);
|
|
1073
|
-
if (memberConn) {
|
|
1074
|
-
const deliverEnvelope = {
|
|
1075
|
-
v: PROTOCOL_VERSION,
|
|
1076
|
-
type: 'CHANNEL_MESSAGE',
|
|
1077
|
-
id: generateId(),
|
|
1078
|
-
ts: Date.now(),
|
|
1079
|
-
from: senderName,
|
|
1080
|
-
payload: envelope.payload,
|
|
1081
|
-
};
|
|
1082
|
-
const sent = memberConn.send(deliverEnvelope);
|
|
1083
|
-
if (sent) {
|
|
1084
|
-
deliveredCount++;
|
|
1085
|
-
routerLog.info(`Delivered to ${memberName} (${memberConn.entityType || 'agent'})`);
|
|
1086
|
-
}
|
|
1087
|
-
else {
|
|
1088
|
-
routerLog.warn(`Failed to send to ${memberName}`);
|
|
1089
|
-
undeliveredMembers.push(memberName);
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
else {
|
|
1093
|
-
routerLog.warn(`Member ${memberName} is registered in channel but NOT connected to daemon - message not delivered`);
|
|
1094
|
-
undeliveredMembers.push(memberName);
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
// Persist channel message
|
|
1098
|
-
this.persistChannelMessage(envelope, senderName);
|
|
1099
|
-
const recipientCount = allMembers.length - 1; // Exclude sender
|
|
1100
|
-
routerLog.info(`${senderName} -> ${channel}: delivered to ${deliveredCount}/${recipientCount} members`);
|
|
1101
|
-
// Log warning if some members didn't receive the message
|
|
1102
|
-
if (undeliveredMembers.length > 0) {
|
|
1103
|
-
routerLog.warn(`Channel message undelivered to: [${undeliveredMembers.join(', ')}] - these agents may need to reconnect to the relay daemon`);
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
/**
|
|
1107
|
-
* Persist a channel message to storage.
|
|
1108
|
-
*/
|
|
1109
|
-
persistChannelMessage(envelope, from) {
|
|
1110
|
-
if (!this.storage)
|
|
1111
|
-
return;
|
|
1112
|
-
const payloadData = {
|
|
1113
|
-
...envelope.payload.data,
|
|
1114
|
-
_isChannelMessage: true,
|
|
1115
|
-
_channel: envelope.payload.channel,
|
|
1116
|
-
_mentions: envelope.payload.mentions,
|
|
1117
|
-
};
|
|
1118
|
-
this.storage.saveMessage({
|
|
1119
|
-
id: envelope.id,
|
|
1120
|
-
ts: envelope.ts,
|
|
1121
|
-
from,
|
|
1122
|
-
to: envelope.payload.channel, // Channel name as "to"
|
|
1123
|
-
topic: undefined,
|
|
1124
|
-
kind: 'message',
|
|
1125
|
-
body: envelope.payload.body,
|
|
1126
|
-
data: payloadData,
|
|
1127
|
-
thread: envelope.payload.thread,
|
|
1128
|
-
status: 'unread',
|
|
1129
|
-
is_urgent: false,
|
|
1130
|
-
is_broadcast: true, // Channel messages are effectively broadcasts
|
|
1131
|
-
}).catch((err) => {
|
|
1132
|
-
routerLog.error('Failed to persist channel message', { error: String(err) });
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
persistChannelMembership(channel, member, action, opts) {
|
|
1136
|
-
if (this.storage) {
|
|
1137
|
-
this.storage.saveMessage({
|
|
1138
|
-
id: crypto.randomUUID(),
|
|
1139
|
-
ts: Date.now(),
|
|
1140
|
-
from: '__system__',
|
|
1141
|
-
to: channel,
|
|
1142
|
-
topic: undefined,
|
|
1143
|
-
kind: 'state', // membership events stored as state
|
|
1144
|
-
body: `${action}:${member}`,
|
|
1145
|
-
data: {
|
|
1146
|
-
_channelMembership: {
|
|
1147
|
-
member,
|
|
1148
|
-
action,
|
|
1149
|
-
invitedBy: opts?.invitedBy,
|
|
1150
|
-
},
|
|
1151
|
-
},
|
|
1152
|
-
status: 'read',
|
|
1153
|
-
is_urgent: false,
|
|
1154
|
-
is_broadcast: true,
|
|
1155
|
-
}).catch((err) => {
|
|
1156
|
-
routerLog.error('Failed to persist channel membership', { error: String(err) });
|
|
1157
|
-
});
|
|
1158
|
-
}
|
|
1159
|
-
if (this.channelMembershipStore) {
|
|
1160
|
-
const persistPromise = action === 'leave'
|
|
1161
|
-
? this.channelMembershipStore.removeMember(channel, member)
|
|
1162
|
-
: this.channelMembershipStore.addMember(channel, member);
|
|
1163
|
-
persistPromise.catch((err) => {
|
|
1164
|
-
routerLog.error('Failed to sync channel membership to cloud store', {
|
|
1165
|
-
channel,
|
|
1166
|
-
member,
|
|
1167
|
-
action,
|
|
1168
|
-
error: err instanceof Error ? err.message : String(err),
|
|
1169
|
-
});
|
|
1170
|
-
});
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
/**
|
|
1174
|
-
* Get all members of a channel.
|
|
1175
|
-
*/
|
|
1176
|
-
getChannelMembers(channel) {
|
|
1177
|
-
const members = this.channels.get(channel);
|
|
1178
|
-
return members ? Array.from(members) : [];
|
|
1179
|
-
}
|
|
1180
|
-
/**
|
|
1181
|
-
* Get all channels.
|
|
1182
|
-
*/
|
|
1183
|
-
getChannels() {
|
|
1184
|
-
return Array.from(this.channels.keys());
|
|
1185
|
-
}
|
|
1186
|
-
/**
|
|
1187
|
-
* Get all channels a member is in.
|
|
1188
|
-
*/
|
|
1189
|
-
getChannelsForMember(memberName) {
|
|
1190
|
-
const channels = this.memberChannels.get(memberName);
|
|
1191
|
-
return channels ? Array.from(channels) : [];
|
|
1192
|
-
}
|
|
1193
|
-
/**
|
|
1194
|
-
* Check if a name belongs to a user (not an agent).
|
|
1195
|
-
*/
|
|
1196
|
-
isUser(name) {
|
|
1197
|
-
return this.users.has(name);
|
|
1198
|
-
}
|
|
1199
|
-
/**
|
|
1200
|
-
* Check if a name belongs to an agent (not a user).
|
|
1201
|
-
*/
|
|
1202
|
-
isAgent(name) {
|
|
1203
|
-
return this.agents.has(name);
|
|
1204
|
-
}
|
|
1205
|
-
/**
|
|
1206
|
-
* Get list of connected user names (human users only).
|
|
1207
|
-
*/
|
|
1208
|
-
getUsers() {
|
|
1209
|
-
return Array.from(this.users.keys());
|
|
1210
|
-
}
|
|
1211
|
-
/**
|
|
1212
|
-
* Get a connection by name (checks both agents and users).
|
|
1213
|
-
* Uses case-insensitive lookup to handle mismatched casing.
|
|
1214
|
-
*/
|
|
1215
|
-
getConnectionByName(name) {
|
|
1216
|
-
// Try exact match first
|
|
1217
|
-
const exact = this.agents.get(name) ?? this.users.get(name);
|
|
1218
|
-
if (exact)
|
|
1219
|
-
return exact;
|
|
1220
|
-
// Fall back to case-insensitive search
|
|
1221
|
-
const lowerName = name.toLowerCase();
|
|
1222
|
-
for (const [key, conn] of this.agents) {
|
|
1223
|
-
if (key.toLowerCase() === lowerName)
|
|
1224
|
-
return conn;
|
|
1225
|
-
}
|
|
1226
|
-
for (const [key, conn] of this.users) {
|
|
1227
|
-
if (key.toLowerCase() === lowerName)
|
|
1228
|
-
return conn;
|
|
1229
|
-
}
|
|
1230
|
-
return undefined;
|
|
1231
|
-
}
|
|
1232
|
-
/**
|
|
1233
|
-
* Check if a member is in a Set (case-insensitive).
|
|
1234
|
-
* Returns the actual stored name if found, undefined otherwise.
|
|
1235
|
-
*/
|
|
1236
|
-
findMemberInSet(members, name) {
|
|
1237
|
-
// Try exact match first
|
|
1238
|
-
if (members.has(name))
|
|
1239
|
-
return name;
|
|
1240
|
-
// Fall back to case-insensitive search
|
|
1241
|
-
const lowerName = name.toLowerCase();
|
|
1242
|
-
for (const member of members) {
|
|
1243
|
-
if (member.toLowerCase() === lowerName)
|
|
1244
|
-
return member;
|
|
1245
|
-
}
|
|
1246
|
-
return undefined;
|
|
1247
|
-
}
|
|
1248
|
-
/**
|
|
1249
|
-
* Check if two names match (case-insensitive).
|
|
1250
|
-
*/
|
|
1251
|
-
namesMatch(a, b) {
|
|
1252
|
-
return a.toLowerCase() === b.toLowerCase();
|
|
1253
|
-
}
|
|
1254
|
-
/**
|
|
1255
|
-
* Auto-join a member to a channel without notifications.
|
|
1256
|
-
* Used for default channel membership (e.g., #general).
|
|
1257
|
-
* @param memberName - The agent or user name to add
|
|
1258
|
-
* @param channel - The channel to join (e.g., '#general')
|
|
1259
|
-
*/
|
|
1260
|
-
autoJoinChannel(memberName, channel, options) {
|
|
1261
|
-
// Get or create channel
|
|
1262
|
-
let members = this.channels.get(channel);
|
|
1263
|
-
if (!members) {
|
|
1264
|
-
members = new Set();
|
|
1265
|
-
this.channels.set(channel, members);
|
|
1266
|
-
}
|
|
1267
|
-
// Check if already a member
|
|
1268
|
-
const added = this.addChannelMember(channel, memberName, { persist: options?.persist });
|
|
1269
|
-
if (added) {
|
|
1270
|
-
routerLog.debug(`Auto-joined ${memberName} to ${channel}`);
|
|
1271
|
-
}
|
|
1272
|
-
}
|
|
1273
|
-
addChannelMember(channel, memberName, options) {
|
|
1274
|
-
let members = this.channels.get(channel);
|
|
1275
|
-
if (!members) {
|
|
1276
|
-
members = new Set();
|
|
1277
|
-
this.channels.set(channel, members);
|
|
1278
|
-
}
|
|
1279
|
-
// Case-insensitive check for existing membership
|
|
1280
|
-
const existingMember = this.findMemberInSet(members, memberName);
|
|
1281
|
-
if (existingMember) {
|
|
1282
|
-
return false;
|
|
1283
|
-
}
|
|
1284
|
-
members.add(memberName);
|
|
1285
|
-
const memberChannelSet = this.memberChannels.get(memberName) ?? new Set();
|
|
1286
|
-
memberChannelSet.add(channel);
|
|
1287
|
-
this.memberChannels.set(memberName, memberChannelSet);
|
|
1288
|
-
if (options?.persist ?? true) {
|
|
1289
|
-
this.persistChannelMembership(channel, memberName, 'join');
|
|
1290
|
-
}
|
|
1291
|
-
return true;
|
|
1292
|
-
}
|
|
1293
|
-
removeChannelMember(channel, memberName, options) {
|
|
1294
|
-
const members = this.channels.get(channel);
|
|
1295
|
-
if (!members) {
|
|
1296
|
-
return false;
|
|
1297
|
-
}
|
|
1298
|
-
// Case-insensitive lookup to find actual stored name
|
|
1299
|
-
const actualMemberName = this.findMemberInSet(members, memberName);
|
|
1300
|
-
if (!actualMemberName) {
|
|
1301
|
-
return false;
|
|
1302
|
-
}
|
|
1303
|
-
members.delete(actualMemberName);
|
|
1304
|
-
if (members.size === 0) {
|
|
1305
|
-
this.channels.delete(channel);
|
|
1306
|
-
}
|
|
1307
|
-
// Also try case-insensitive for memberChannels cleanup
|
|
1308
|
-
const memberChannelSet = this.memberChannels.get(actualMemberName) ?? this.memberChannels.get(memberName);
|
|
1309
|
-
if (memberChannelSet) {
|
|
1310
|
-
memberChannelSet.delete(channel);
|
|
1311
|
-
if (memberChannelSet.size === 0) {
|
|
1312
|
-
this.memberChannels.delete(actualMemberName);
|
|
1313
|
-
this.memberChannels.delete(memberName); // Clean up both potential keys
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
if (options?.persist ?? true) {
|
|
1317
|
-
this.persistChannelMembership(channel, actualMemberName, 'leave');
|
|
1318
|
-
}
|
|
1319
|
-
return true;
|
|
1320
|
-
}
|
|
1321
|
-
handleMembershipUpdate(update) {
|
|
1322
|
-
if (!update.channel || !update.member) {
|
|
1323
|
-
return;
|
|
1324
|
-
}
|
|
1325
|
-
if (update.action === 'leave') {
|
|
1326
|
-
this.removeChannelMember(update.channel, update.member, { persist: false });
|
|
1327
|
-
}
|
|
1328
|
-
else {
|
|
1329
|
-
this.addChannelMember(update.channel, update.member, { persist: false });
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
//# sourceMappingURL=router.js.map
|