agent-relay 1.1.0 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +3 -0
- package/.nvmrc +1 -0
- package/.trajectories/completed/2026-01/traj_1dviorhnkcb5.json +65 -0
- package/.trajectories/completed/2026-01/traj_1dviorhnkcb5.md +37 -0
- package/.trajectories/completed/2026-01/traj_1k5if5snst2e.json +65 -0
- package/.trajectories/completed/2026-01/traj_1k5if5snst2e.md +37 -0
- package/.trajectories/completed/2026-01/traj_1rp3rges5811.json +49 -0
- package/.trajectories/completed/2026-01/traj_1rp3rges5811.md +31 -0
- package/.trajectories/completed/2026-01/traj_22bhyulruouw.json +113 -0
- package/.trajectories/completed/2026-01/traj_22bhyulruouw.md +57 -0
- package/.trajectories/completed/2026-01/traj_2dao7ddgnta0.json +53 -0
- package/.trajectories/completed/2026-01/traj_2dao7ddgnta0.md +32 -0
- package/.trajectories/completed/2026-01/traj_3t0440mjeunc.json +26 -0
- package/.trajectories/completed/2026-01/traj_3t0440mjeunc.md +6 -0
- package/.trajectories/completed/2026-01/traj_45x9494d9xnr.json +47 -0
- package/.trajectories/completed/2026-01/traj_45x9494d9xnr.md +32 -0
- package/.trajectories/completed/2026-01/traj_4aa0bb77s4nh.json +53 -0
- package/.trajectories/completed/2026-01/traj_4aa0bb77s4nh.md +32 -0
- package/.trajectories/completed/2026-01/traj_5lhmzq8rxpqv.json +59 -0
- package/.trajectories/completed/2026-01/traj_5lhmzq8rxpqv.md +33 -0
- package/.trajectories/completed/2026-01/traj_5vr4e9erb1fs.json +53 -0
- package/.trajectories/completed/2026-01/traj_5vr4e9erb1fs.md +32 -0
- package/.trajectories/completed/2026-01/traj_6fgiwdoklvym.json +48 -0
- package/.trajectories/completed/2026-01/traj_6fgiwdoklvym.md +24 -0
- package/.trajectories/completed/2026-01/traj_7ludwvz45veh.json +209 -0
- package/.trajectories/completed/2026-01/traj_7ludwvz45veh.md +97 -0
- package/.trajectories/completed/2026-01/traj_9921cuhel0pj.json +48 -0
- package/.trajectories/completed/2026-01/traj_9921cuhel0pj.md +24 -0
- package/.trajectories/completed/2026-01/traj_ajs7zqfux4wc.json +49 -0
- package/.trajectories/completed/2026-01/traj_ajs7zqfux4wc.md +23 -0
- package/.trajectories/completed/2026-01/traj_cvtqhlwcq9s0.json +53 -0
- package/.trajectories/completed/2026-01/traj_cvtqhlwcq9s0.md +32 -0
- package/.trajectories/completed/2026-01/traj_cxofprm2m2en.json +49 -0
- package/.trajectories/completed/2026-01/traj_cxofprm2m2en.md +31 -0
- package/.trajectories/completed/2026-01/traj_d2hhz3k0vrhn.json +26 -0
- package/.trajectories/completed/2026-01/traj_d2hhz3k0vrhn.md +6 -0
- package/.trajectories/completed/2026-01/traj_dfuvww9pege5.json +59 -0
- package/.trajectories/completed/2026-01/traj_dfuvww9pege5.md +37 -0
- package/.trajectories/completed/2026-01/traj_g0fisy9h51mf.json +77 -0
- package/.trajectories/completed/2026-01/traj_g0fisy9h51mf.md +42 -0
- package/.trajectories/completed/2026-01/traj_gjdre5voouod.json +53 -0
- package/.trajectories/completed/2026-01/traj_gjdre5voouod.md +32 -0
- package/.trajectories/completed/2026-01/traj_gtlyqtta3x8l.json +25 -0
- package/.trajectories/completed/2026-01/traj_gtlyqtta3x8l.md +15 -0
- package/.trajectories/completed/2026-01/traj_h4xijiuip3w4.json +101 -0
- package/.trajectories/completed/2026-01/traj_h4xijiuip3w4.md +44 -0
- package/.trajectories/completed/2026-01/traj_hhxte7w4gjjx.json +22 -0
- package/.trajectories/completed/2026-01/traj_hhxte7w4gjjx.md +5 -0
- package/.trajectories/completed/2026-01/traj_hpungyhoj6v5.json +53 -0
- package/.trajectories/completed/2026-01/traj_hpungyhoj6v5.md +32 -0
- package/.trajectories/completed/2026-01/traj_m2xkjv0w2sq7.json +25 -0
- package/.trajectories/completed/2026-01/traj_m2xkjv0w2sq7.md +15 -0
- package/.trajectories/completed/2026-01/traj_noq5zbvnrdvz.json +53 -0
- package/.trajectories/completed/2026-01/traj_noq5zbvnrdvz.md +32 -0
- package/.trajectories/completed/2026-01/traj_ntbs6ppopf46.json +53 -0
- package/.trajectories/completed/2026-01/traj_ntbs6ppopf46.md +32 -0
- package/.trajectories/completed/2026-01/traj_ozd98si6a7ns.json +48 -0
- package/.trajectories/completed/2026-01/traj_ozd98si6a7ns.md +24 -0
- package/.trajectories/completed/2026-01/traj_prdza7a5cxp5.json +53 -0
- package/.trajectories/completed/2026-01/traj_prdza7a5cxp5.md +32 -0
- package/.trajectories/completed/2026-01/traj_qb3twvvywfwi.json +77 -0
- package/.trajectories/completed/2026-01/traj_qb3twvvywfwi.md +42 -0
- package/.trajectories/completed/2026-01/traj_qft54mi7nfor.json +53 -0
- package/.trajectories/completed/2026-01/traj_qft54mi7nfor.md +32 -0
- package/.trajectories/completed/2026-01/traj_qx9uhf8whhxo.json +83 -0
- package/.trajectories/completed/2026-01/traj_qx9uhf8whhxo.md +47 -0
- package/.trajectories/completed/2026-01/traj_rd9toccj18a0.json +59 -0
- package/.trajectories/completed/2026-01/traj_rd9toccj18a0.md +37 -0
- package/.trajectories/completed/2026-01/traj_rt4fiw3ecp50.json +48 -0
- package/.trajectories/completed/2026-01/traj_rt4fiw3ecp50.md +16 -0
- package/.trajectories/completed/2026-01/traj_st8j35b0hrlc.json +59 -0
- package/.trajectories/completed/2026-01/traj_st8j35b0hrlc.md +37 -0
- package/.trajectories/completed/2026-01/traj_t1yy8m7hbuxp.json +53 -0
- package/.trajectories/completed/2026-01/traj_t1yy8m7hbuxp.md +32 -0
- package/.trajectories/completed/2026-01/traj_tmux_orchestrator_analysis.json +84 -0
- package/.trajectories/completed/2026-01/traj_tmux_orchestrator_analysis.md +109 -0
- package/.trajectories/completed/2026-01/traj_u9n9eqasw16k.json +53 -0
- package/.trajectories/completed/2026-01/traj_u9n9eqasw16k.md +32 -0
- package/.trajectories/completed/2026-01/traj_v87hypnongqx.json +71 -0
- package/.trajectories/completed/2026-01/traj_v87hypnongqx.md +42 -0
- package/.trajectories/completed/2026-01/traj_wkp2fgzdyinb.json +53 -0
- package/.trajectories/completed/2026-01/traj_wkp2fgzdyinb.md +32 -0
- package/.trajectories/completed/2026-01/traj_x14t8w8rn7xg.json +20 -0
- package/.trajectories/completed/2026-01/traj_x14t8w8rn7xg.md +6 -0
- package/.trajectories/completed/2026-01/traj_xnwbznkvv8ua.json +175 -0
- package/.trajectories/completed/2026-01/traj_xnwbznkvv8ua.md +82 -0
- package/.trajectories/completed/2026-01/traj_ysjc8zaeqtd3.json +47 -0
- package/.trajectories/completed/2026-01/traj_ysjc8zaeqtd3.md +32 -0
- package/.trajectories/completed/2026-01/traj_yvdadtvdgnz3.json +59 -0
- package/.trajectories/completed/2026-01/traj_yvdadtvdgnz3.md +37 -0
- package/.trajectories/completed/2026-01/traj_z0vcw1wrzide.json +53 -0
- package/.trajectories/completed/2026-01/traj_z0vcw1wrzide.md +32 -0
- package/.trajectories/index.json +314 -0
- package/ARCHITECTURE.md +1245 -0
- package/README.md +1 -1
- package/TESTING.md +278 -0
- package/deploy/init-db.sql +5 -0
- package/deploy/scripts/setup-fly-workspaces.sh +69 -0
- package/deploy/scripts/setup-railway.sh +75 -0
- package/deploy/workspace/entrypoint-browser.sh +118 -0
- package/deploy/workspace/entrypoint.sh +348 -0
- package/deploy/workspace/git-credential-relay +111 -0
- package/dist/bridge/spawner.d.ts +53 -0
- package/dist/bridge/spawner.js +203 -19
- package/dist/bridge/types.d.ts +12 -0
- package/dist/cli/index.js +618 -5
- package/dist/cloud/api/auth.d.ts +3 -2
- package/dist/cloud/api/auth.js +10 -98
- package/dist/cloud/api/billing.js +30 -9
- package/dist/cloud/api/cli-pty-runner.d.ts +54 -0
- package/dist/cloud/api/cli-pty-runner.js +119 -0
- package/dist/cloud/api/codex-auth-helper.d.ts +15 -0
- package/dist/cloud/api/codex-auth-helper.js +100 -0
- package/dist/cloud/api/generic-webhooks.d.ts +8 -0
- package/dist/cloud/api/generic-webhooks.js +129 -0
- package/dist/cloud/api/git.d.ts +8 -0
- package/dist/cloud/api/git.js +152 -0
- package/dist/cloud/api/github-app.d.ts +11 -0
- package/dist/cloud/api/github-app.js +189 -0
- package/dist/cloud/api/middleware/planLimits.d.ts +7 -0
- package/dist/cloud/api/middleware/planLimits.js +39 -1
- package/dist/cloud/api/monitoring.d.ts +11 -0
- package/dist/cloud/api/monitoring.js +578 -0
- package/dist/cloud/api/nango-auth.d.ts +9 -0
- package/dist/cloud/api/nango-auth.js +377 -0
- package/dist/cloud/api/onboarding.d.ts +8 -1
- package/dist/cloud/api/onboarding.js +313 -119
- package/dist/cloud/api/policy.d.ts +8 -0
- package/dist/cloud/api/policy.js +229 -0
- package/dist/cloud/api/providers.js +114 -42
- package/dist/cloud/api/repos.d.ts +1 -0
- package/dist/cloud/api/repos.js +186 -0
- package/dist/cloud/api/test-helpers.d.ts +10 -0
- package/dist/cloud/api/test-helpers.js +575 -0
- package/dist/cloud/api/webhooks.d.ts +8 -0
- package/dist/cloud/api/webhooks.js +645 -0
- package/dist/cloud/api/workspaces.js +320 -12
- package/dist/cloud/billing/plans.js +32 -19
- package/dist/cloud/billing/types.d.ts +9 -3
- package/dist/cloud/config.d.ts +9 -2
- package/dist/cloud/config.js +13 -4
- package/dist/cloud/db/drizzle.d.ts +84 -1
- package/dist/cloud/db/drizzle.js +470 -0
- package/dist/cloud/db/index.d.ts +9 -4
- package/dist/cloud/db/index.js +11 -3
- package/dist/cloud/db/schema.d.ts +3283 -556
- package/dist/cloud/db/schema.js +314 -1
- package/dist/cloud/index.d.ts +1 -0
- package/dist/cloud/index.js +2 -0
- package/dist/cloud/provisioner/index.d.ts +56 -0
- package/dist/cloud/provisioner/index.js +676 -34
- package/dist/cloud/server.d.ts +1 -0
- package/dist/cloud/server.js +362 -13
- package/dist/cloud/services/auto-scaler.d.ts +152 -0
- package/dist/cloud/services/auto-scaler.js +439 -0
- package/dist/cloud/services/capacity-manager.d.ts +148 -0
- package/dist/cloud/services/capacity-manager.js +449 -0
- package/dist/cloud/services/ci-agent-spawner.d.ts +49 -0
- package/dist/cloud/services/ci-agent-spawner.js +373 -0
- package/dist/cloud/services/index.d.ts +12 -0
- package/dist/cloud/services/index.js +15 -0
- package/dist/cloud/services/mention-handler.d.ts +65 -0
- package/dist/cloud/services/mention-handler.js +405 -0
- package/dist/cloud/services/nango.d.ts +186 -0
- package/dist/cloud/services/nango.js +344 -0
- package/dist/cloud/services/persistence.d.ts +131 -0
- package/dist/cloud/services/persistence.js +200 -0
- package/dist/cloud/services/planLimits.d.ts +37 -0
- package/dist/cloud/services/planLimits.js +86 -5
- package/dist/cloud/services/scaling-orchestrator.d.ts +159 -0
- package/dist/cloud/services/scaling-orchestrator.js +502 -0
- package/dist/cloud/services/scaling-policy.d.ts +121 -0
- package/dist/cloud/services/scaling-policy.js +415 -0
- package/dist/cloud/vault/index.js +1 -1
- package/dist/cloud/webhooks/index.d.ts +24 -0
- package/dist/cloud/webhooks/index.js +29 -0
- package/dist/cloud/webhooks/parsers/github.d.ts +8 -0
- package/dist/cloud/webhooks/parsers/github.js +234 -0
- package/dist/cloud/webhooks/parsers/index.d.ts +23 -0
- package/dist/cloud/webhooks/parsers/index.js +30 -0
- package/dist/cloud/webhooks/parsers/linear.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/linear.js +258 -0
- package/dist/cloud/webhooks/parsers/slack.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/slack.js +214 -0
- package/dist/cloud/webhooks/responders/github.d.ts +8 -0
- package/dist/cloud/webhooks/responders/github.js +73 -0
- package/dist/cloud/webhooks/responders/index.d.ts +23 -0
- package/dist/cloud/webhooks/responders/index.js +30 -0
- package/dist/cloud/webhooks/responders/linear.d.ts +9 -0
- package/dist/cloud/webhooks/responders/linear.js +149 -0
- package/dist/cloud/webhooks/responders/slack.d.ts +20 -0
- package/dist/cloud/webhooks/responders/slack.js +178 -0
- package/dist/cloud/webhooks/router.d.ts +25 -0
- package/dist/cloud/webhooks/router.js +504 -0
- package/dist/cloud/webhooks/rules-engine.d.ts +24 -0
- package/dist/cloud/webhooks/rules-engine.js +287 -0
- package/dist/cloud/webhooks/types.d.ts +186 -0
- package/dist/cloud/webhooks/types.js +8 -0
- package/dist/continuity/formatter.d.ts +51 -0
- package/dist/continuity/formatter.js +313 -0
- package/dist/continuity/handoff-store.d.ts +67 -0
- package/dist/continuity/handoff-store.js +472 -0
- package/dist/continuity/index.d.ts +45 -0
- package/dist/continuity/index.js +48 -0
- package/dist/continuity/ledger-store.d.ts +110 -0
- package/dist/continuity/ledger-store.js +500 -0
- package/dist/continuity/manager.d.ts +178 -0
- package/dist/continuity/manager.js +562 -0
- package/dist/continuity/parser.d.ts +76 -0
- package/dist/continuity/parser.js +579 -0
- package/dist/continuity/types.d.ts +180 -0
- package/dist/continuity/types.js +9 -0
- package/dist/daemon/agent-manager.d.ts +27 -0
- package/dist/daemon/agent-manager.js +107 -6
- package/dist/daemon/agent-registry.d.ts +32 -0
- package/dist/daemon/agent-registry.js +42 -2
- package/dist/daemon/api.d.ts +12 -0
- package/dist/daemon/api.js +131 -2
- package/dist/daemon/cli-auth.d.ts +67 -0
- package/dist/daemon/cli-auth.js +537 -0
- package/dist/daemon/cloud-sync.js +9 -7
- package/dist/daemon/orchestrator.js +30 -0
- package/dist/daemon/router.d.ts +5 -0
- package/dist/daemon/router.js +78 -26
- package/dist/daemon/server.d.ts +5 -0
- package/dist/daemon/server.js +9 -1
- package/dist/daemon/services/browser-testing.d.ts +88 -0
- package/dist/daemon/services/browser-testing.js +244 -0
- package/dist/daemon/services/container-spawner.d.ts +135 -0
- package/dist/daemon/services/container-spawner.js +313 -0
- package/dist/daemon/types.d.ts +5 -1
- package/dist/dashboard/out/404.html +1 -1
- package/dist/dashboard/out/_next/static/chunks/116-2502180def231162.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/282-980c2eb8fff20123.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/699-3b1cd6618a45d259.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/724-2dae7627550ab88f.js +9 -0
- package/dist/dashboard/out/_next/static/chunks/766-1f2dd8cb7f766b0b.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/onboarding/page-3fdfa60e53f2810d.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/page-e6381e5a6e1fbcfd.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-3538dfe0ffe984b8.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/history/{page-b6edd4dde8d08194.js → page-abb9ab2d329f56e9.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/app/layout-c0d118c0f92d969c.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/login/page-c22d080201cbd9fb.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-67a3e98d9a43a6ed.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/page-77e9c65420a06cfb.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-b08ed1c34d14434a.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-e88bc117ef7671c3.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/signup/page-68d34f50baa8ab6b.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +18 -0
- package/dist/dashboard/out/_next/static/chunks/{main-app-5d692157a8eb1fd9.js → main-app-6e8e8d3ef4e0192a.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/{main-c2f423b9c9f4591b.js → main-ed4e1fb6f29c34cf.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +1 -0
- package/dist/dashboard/out/_next/static/css/29852f26181969a0.css +1 -0
- package/dist/dashboard/out/_next/static/css/7c3ae9e8617d42a5.css +1 -0
- package/dist/dashboard/out/app/onboarding.html +1 -0
- package/dist/dashboard/out/app/onboarding.txt +7 -0
- package/dist/dashboard/out/app.html +1 -14
- package/dist/dashboard/out/app.txt +2 -2
- package/dist/dashboard/out/connect-repos.html +1 -0
- package/dist/dashboard/out/connect-repos.txt +7 -0
- package/dist/dashboard/out/history.html +1 -1
- package/dist/dashboard/out/history.txt +2 -2
- package/dist/dashboard/out/index.html +1 -1
- package/dist/dashboard/out/index.txt +2 -2
- package/dist/dashboard/out/login.html +6 -0
- package/dist/dashboard/out/login.txt +7 -0
- package/dist/dashboard/out/metrics.html +1 -1
- package/dist/dashboard/out/metrics.txt +2 -2
- package/dist/dashboard/out/pricing.html +3 -3
- package/dist/dashboard/out/pricing.txt +2 -2
- package/dist/dashboard/out/providers.html +1 -0
- package/dist/dashboard/out/providers.txt +7 -0
- package/dist/dashboard/out/signup.html +6 -0
- package/dist/dashboard/out/signup.txt +7 -0
- package/dist/dashboard-server/server.js +1308 -8
- package/dist/hooks/emitter.d.ts +40 -0
- package/dist/hooks/emitter.js +63 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/registry.d.ts +173 -0
- package/dist/hooks/registry.js +476 -0
- package/dist/hooks/trajectory-hooks.d.ts +52 -0
- package/dist/hooks/trajectory-hooks.js +183 -0
- package/dist/hooks/types.d.ts +141 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/memory/adapters/index.d.ts +8 -0
- package/dist/memory/adapters/index.js +8 -0
- package/dist/memory/adapters/inmemory.d.ts +59 -0
- package/dist/memory/adapters/inmemory.js +195 -0
- package/dist/memory/adapters/supermemory.d.ts +71 -0
- package/dist/memory/adapters/supermemory.js +338 -0
- package/dist/memory/factory.d.ts +48 -0
- package/dist/memory/factory.js +143 -0
- package/dist/memory/index.d.ts +32 -0
- package/dist/memory/index.js +32 -0
- package/dist/memory/memory-hooks.d.ts +60 -0
- package/dist/memory/memory-hooks.js +313 -0
- package/dist/memory/service.d.ts +49 -0
- package/dist/memory/service.js +146 -0
- package/dist/memory/types.d.ts +195 -0
- package/dist/memory/types.js +8 -0
- package/dist/policy/agent-policy.d.ts +225 -0
- package/dist/policy/agent-policy.js +665 -0
- package/dist/policy/cloud-policy-fetcher.d.ts +12 -0
- package/dist/policy/cloud-policy-fetcher.js +64 -0
- package/dist/resiliency/crash-insights.d.ts +156 -0
- package/dist/resiliency/crash-insights.js +492 -0
- package/dist/resiliency/gossip-health.d.ts +137 -0
- package/dist/resiliency/gossip-health.js +241 -0
- package/dist/resiliency/index.d.ts +5 -0
- package/dist/resiliency/index.js +5 -0
- package/dist/resiliency/leader-watchdog.d.ts +109 -0
- package/dist/resiliency/leader-watchdog.js +189 -0
- package/dist/resiliency/memory-monitor.d.ts +172 -0
- package/dist/resiliency/memory-monitor.js +593 -0
- package/dist/resiliency/stateless-lead.d.ts +149 -0
- package/dist/resiliency/stateless-lead.js +308 -0
- package/dist/resiliency/supervisor.d.ts +38 -0
- package/dist/resiliency/supervisor.js +122 -0
- package/dist/shared/cli-auth-config.d.ts +91 -0
- package/dist/shared/cli-auth-config.js +264 -0
- package/dist/storage/adapter.d.ts +1 -1
- package/dist/trajectory/config.d.ts +84 -0
- package/dist/trajectory/config.js +163 -0
- package/dist/trajectory/index.d.ts +8 -0
- package/dist/trajectory/index.js +8 -0
- package/dist/trajectory/integration.d.ts +292 -0
- package/dist/trajectory/integration.js +834 -0
- package/dist/utils/logger.js +1 -1
- package/dist/utils/project-namespace.d.ts +24 -0
- package/dist/utils/project-namespace.js +84 -0
- package/dist/wrapper/parser.d.ts +10 -0
- package/dist/wrapper/parser.js +100 -33
- package/dist/wrapper/pty-wrapper.d.ts +197 -16
- package/dist/wrapper/pty-wrapper.js +943 -106
- package/dist/wrapper/shared.d.ts +165 -0
- package/dist/wrapper/shared.js +270 -0
- package/dist/wrapper/tmux-wrapper.d.ts +73 -11
- package/dist/wrapper/tmux-wrapper.js +541 -120
- package/package.json +16 -16
- package/scripts/postinstall.js +60 -0
- package/test-push.txt +1 -0
- package/bin/tmux +0 -0
- package/dist/bridge/config.d.ts.map +0 -1
- package/dist/bridge/config.js.map +0 -1
- package/dist/bridge/index.d.ts.map +0 -1
- package/dist/bridge/index.js.map +0 -1
- package/dist/bridge/multi-project-client.d.ts.map +0 -1
- package/dist/bridge/multi-project-client.js.map +0 -1
- package/dist/bridge/shadow-cli.d.ts.map +0 -1
- package/dist/bridge/shadow-cli.js.map +0 -1
- package/dist/bridge/shadow-config.d.ts.map +0 -1
- package/dist/bridge/shadow-config.js.map +0 -1
- package/dist/bridge/spawner.d.ts.map +0 -1
- package/dist/bridge/spawner.js.map +0 -1
- package/dist/bridge/teams-config.d.ts.map +0 -1
- package/dist/bridge/teams-config.js.map +0 -1
- package/dist/bridge/types.d.ts.map +0 -1
- package/dist/bridge/types.js.map +0 -1
- package/dist/bridge/utils.d.ts.map +0 -1
- package/dist/bridge/utils.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/cloud/api/auth.d.ts.map +0 -1
- package/dist/cloud/api/auth.js.map +0 -1
- package/dist/cloud/api/billing.d.ts.map +0 -1
- package/dist/cloud/api/billing.js.map +0 -1
- package/dist/cloud/api/coordinators.d.ts.map +0 -1
- package/dist/cloud/api/coordinators.js.map +0 -1
- package/dist/cloud/api/daemons.d.ts.map +0 -1
- package/dist/cloud/api/daemons.js.map +0 -1
- package/dist/cloud/api/middleware/planLimits.d.ts.map +0 -1
- package/dist/cloud/api/middleware/planLimits.js.map +0 -1
- package/dist/cloud/api/onboarding.d.ts.map +0 -1
- package/dist/cloud/api/onboarding.js.map +0 -1
- package/dist/cloud/api/providers.d.ts.map +0 -1
- package/dist/cloud/api/providers.js.map +0 -1
- package/dist/cloud/api/repos.d.ts.map +0 -1
- package/dist/cloud/api/repos.js.map +0 -1
- package/dist/cloud/api/teams.d.ts.map +0 -1
- package/dist/cloud/api/teams.js.map +0 -1
- package/dist/cloud/api/usage.d.ts.map +0 -1
- package/dist/cloud/api/usage.js.map +0 -1
- package/dist/cloud/api/workspaces.d.ts.map +0 -1
- package/dist/cloud/api/workspaces.js.map +0 -1
- package/dist/cloud/billing/index.d.ts.map +0 -1
- package/dist/cloud/billing/index.js.map +0 -1
- package/dist/cloud/billing/plans.d.ts.map +0 -1
- package/dist/cloud/billing/plans.js.map +0 -1
- package/dist/cloud/billing/service.d.ts.map +0 -1
- package/dist/cloud/billing/service.js.map +0 -1
- package/dist/cloud/billing/types.d.ts.map +0 -1
- package/dist/cloud/billing/types.js.map +0 -1
- package/dist/cloud/config.d.ts.map +0 -1
- package/dist/cloud/config.js.map +0 -1
- package/dist/cloud/db/drizzle.d.ts.map +0 -1
- package/dist/cloud/db/drizzle.js.map +0 -1
- package/dist/cloud/db/index.d.ts.map +0 -1
- package/dist/cloud/db/index.js.map +0 -1
- package/dist/cloud/db/schema.d.ts.map +0 -1
- package/dist/cloud/db/schema.js.map +0 -1
- package/dist/cloud/index.d.ts.map +0 -1
- package/dist/cloud/index.js.map +0 -1
- package/dist/cloud/provisioner/index.d.ts.map +0 -1
- package/dist/cloud/provisioner/index.js.map +0 -1
- package/dist/cloud/server.d.ts.map +0 -1
- package/dist/cloud/server.js.map +0 -1
- package/dist/cloud/services/coordinator.d.ts.map +0 -1
- package/dist/cloud/services/coordinator.js.map +0 -1
- package/dist/cloud/services/planLimits.d.ts.map +0 -1
- package/dist/cloud/services/planLimits.js.map +0 -1
- package/dist/cloud/vault/index.d.ts.map +0 -1
- package/dist/cloud/vault/index.js.map +0 -1
- package/dist/daemon/agent-manager.d.ts.map +0 -1
- package/dist/daemon/agent-manager.js.map +0 -1
- package/dist/daemon/agent-registry.d.ts.map +0 -1
- package/dist/daemon/agent-registry.js.map +0 -1
- package/dist/daemon/api.d.ts.map +0 -1
- package/dist/daemon/api.js.map +0 -1
- package/dist/daemon/auth.d.ts.map +0 -1
- package/dist/daemon/auth.js.map +0 -1
- package/dist/daemon/cloud-sync.d.ts.map +0 -1
- package/dist/daemon/cloud-sync.js.map +0 -1
- package/dist/daemon/connection.d.ts.map +0 -1
- package/dist/daemon/connection.js.map +0 -1
- package/dist/daemon/index.d.ts.map +0 -1
- package/dist/daemon/index.js.map +0 -1
- package/dist/daemon/orchestrator.d.ts.map +0 -1
- package/dist/daemon/orchestrator.js.map +0 -1
- package/dist/daemon/registry.d.ts.map +0 -1
- package/dist/daemon/registry.js.map +0 -1
- package/dist/daemon/router.d.ts.map +0 -1
- package/dist/daemon/router.js.map +0 -1
- package/dist/daemon/server.d.ts.map +0 -1
- package/dist/daemon/server.js.map +0 -1
- package/dist/daemon/types.d.ts.map +0 -1
- package/dist/daemon/types.js.map +0 -1
- package/dist/daemon/workspace-manager.d.ts.map +0 -1
- package/dist/daemon/workspace-manager.js.map +0 -1
- package/dist/dashboard/out/_next/static/chunks/693-7b3301d8f6bc5014.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/713-f78477eb185f1f4d.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/766-e53e1cfe39b0b5b5.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/900-037c64bfd797fb2a.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/page-e3d9e1f4466b9bae.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/layout-2433bb48965f4333.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-e68825a81db67ba1.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/page-cc108bf68c8a657f.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-d80e03a5297f95b6.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/webpack-a5acc2831d094776.js +0 -1
- package/dist/dashboard/out/_next/static/css/79b80143647a07d7.css +0 -1
- package/dist/dashboard/out/_next/static/css/8cf277370ad48cfe.css +0 -1
- package/dist/dashboard-server/metrics.d.ts.map +0 -1
- package/dist/dashboard-server/metrics.js.map +0 -1
- package/dist/dashboard-server/needs-attention.d.ts.map +0 -1
- package/dist/dashboard-server/needs-attention.js.map +0 -1
- package/dist/dashboard-server/server.d.ts.map +0 -1
- package/dist/dashboard-server/server.js.map +0 -1
- package/dist/dashboard-server/start.d.ts.map +0 -1
- package/dist/dashboard-server/start.js.map +0 -1
- package/dist/hooks/inbox-check/hook.d.ts.map +0 -1
- package/dist/hooks/inbox-check/hook.js.map +0 -1
- package/dist/hooks/inbox-check/index.d.ts.map +0 -1
- package/dist/hooks/inbox-check/index.js.map +0 -1
- package/dist/hooks/inbox-check/types.d.ts.map +0 -1
- package/dist/hooks/inbox-check/types.js.map +0 -1
- package/dist/hooks/inbox-check/utils.d.ts.map +0 -1
- package/dist/hooks/inbox-check/utils.js.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/types.d.ts.map +0 -1
- package/dist/hooks/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/protocol/framing.d.ts.map +0 -1
- package/dist/protocol/framing.js.map +0 -1
- package/dist/protocol/index.d.ts.map +0 -1
- package/dist/protocol/index.js.map +0 -1
- package/dist/protocol/types.d.ts.map +0 -1
- package/dist/protocol/types.js.map +0 -1
- package/dist/resiliency/context-persistence.d.ts.map +0 -1
- package/dist/resiliency/context-persistence.js.map +0 -1
- package/dist/resiliency/health-monitor.d.ts.map +0 -1
- package/dist/resiliency/health-monitor.js.map +0 -1
- package/dist/resiliency/index.d.ts.map +0 -1
- package/dist/resiliency/index.js.map +0 -1
- package/dist/resiliency/logger.d.ts.map +0 -1
- package/dist/resiliency/logger.js.map +0 -1
- package/dist/resiliency/metrics.d.ts.map +0 -1
- package/dist/resiliency/metrics.js.map +0 -1
- package/dist/resiliency/provider-context.d.ts.map +0 -1
- package/dist/resiliency/provider-context.js.map +0 -1
- package/dist/resiliency/supervisor.d.ts.map +0 -1
- package/dist/resiliency/supervisor.js.map +0 -1
- package/dist/state/agent-state.d.ts.map +0 -1
- package/dist/state/agent-state.js.map +0 -1
- package/dist/storage/adapter.d.ts.map +0 -1
- package/dist/storage/adapter.js.map +0 -1
- package/dist/storage/sqlite-adapter.d.ts.map +0 -1
- package/dist/storage/sqlite-adapter.js.map +0 -1
- package/dist/utils/agent-config.d.ts.map +0 -1
- package/dist/utils/agent-config.js.map +0 -1
- package/dist/utils/command-resolver.d.ts.map +0 -1
- package/dist/utils/command-resolver.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/name-generator.d.ts.map +0 -1
- package/dist/utils/name-generator.js.map +0 -1
- package/dist/utils/project-namespace.d.ts.map +0 -1
- package/dist/utils/project-namespace.js.map +0 -1
- package/dist/utils/tmux-resolver.d.ts.map +0 -1
- package/dist/utils/tmux-resolver.js.map +0 -1
- package/dist/utils/update-checker.d.ts.map +0 -1
- package/dist/utils/update-checker.js.map +0 -1
- package/dist/wrapper/client.d.ts.map +0 -1
- package/dist/wrapper/client.js.map +0 -1
- package/dist/wrapper/inbox.d.ts.map +0 -1
- package/dist/wrapper/inbox.js.map +0 -1
- package/dist/wrapper/index.d.ts.map +0 -1
- package/dist/wrapper/index.js.map +0 -1
- package/dist/wrapper/parser.d.ts.map +0 -1
- package/dist/wrapper/parser.js.map +0 -1
- package/dist/wrapper/pty-wrapper.d.ts.map +0 -1
- package/dist/wrapper/pty-wrapper.js.map +0 -1
- package/dist/wrapper/tmux-wrapper.d.ts.map +0 -1
- package/dist/wrapper/tmux-wrapper.js.map +0 -1
- package/docs/AGENTS.md +0 -513
- package/docs/ARCHITECTURE_DECISIONS.md +0 -175
- package/docs/CHANGELOG.md +0 -11
- package/docs/CLI-SIMPLIFICATION-COMPLETE.md +0 -48
- package/docs/CLOUD-ARCHITECTURE.md +0 -652
- package/docs/CLOUD-ONBOARDING-DESIGN.md +0 -1983
- package/docs/COMPETITIVE_ANALYSIS.md +0 -897
- package/docs/CONTRIBUTING.md +0 -151
- package/docs/DESIGN_BRIDGE_STAFFING.md +0 -878
- package/docs/DESIGN_V2.md +0 -1079
- package/docs/INTEGRATION-GUIDE.md +0 -926
- package/docs/MONETIZATION.md +0 -1679
- package/docs/PROPOSAL-trajectories.md +0 -1582
- package/docs/PROTOCOL.md +0 -325
- package/docs/SCALING_ANALYSIS.md +0 -280
- package/docs/TESTING_PRESENCE_FEATURES.md +0 -327
- package/docs/TMUX_IMPLEMENTATION_NOTES.md +0 -364
- package/docs/TMUX_IMPROVEMENTS.md +0 -968
- package/docs/agent-relay-snippet.md +0 -168
- package/docs/competitive-analysis-mcp-agent-mail.md +0 -389
- package/docs/dashboard-v2-plan.md +0 -179
- package/docs/guides/CLOUD.md +0 -236
- package/docs/guides/LOCAL.md +0 -535
- package/docs/guides/SELF-HOSTED.md +0 -494
- package/docs/proposals/shadow-as-subagent.md +0 -765
- package/docs/proposals/slack-bot-integration.md +0 -1457
- package/docs/removable-code-analysis.md +0 -24
- package/scripts/dev/PUBLIC_RELEASE_PLAN.md +0 -88
- package/scripts/dev/dev-team-setup.sh +0 -431
- package/scripts/e2e-test.sh +0 -119
- package/scripts/games/game-protocol.md +0 -79
- package/scripts/games/hearts-setup.sh +0 -264
- package/scripts/tictactoe-setup.sh +0 -181
- /package/dist/dashboard/out/_next/static/chunks/{117-b2cd8d6485aacf2b.js → 117-f7b8ab0809342e77.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{648-8f3f26864ce515e5.js → 648-5cc6e1921389a58a.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/_not-found/{page-0b990dbb71d72a98.js → page-53b8a69f76db17d0.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{fd9d1056-bf46c09eb57e019c.js → fd9d1056-609918ca7b6280bb.js} +0 -0
- /package/dist/dashboard/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → wPgKJtcOmTFLpUncDg16A}/_buildManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → wPgKJtcOmTFLpUncDg16A}/_ssgManifest.js +0 -0
|
@@ -1,926 +0,0 @@
|
|
|
1
|
-
# Agent Infrastructure Integration Guide
|
|
2
|
-
|
|
3
|
-
How to integrate agent-relay, claude-mem, and agent-trajectories into a cohesive stack.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## The Stack at a Glance
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
11
|
-
│ YOUR AGENT (Claude Code, Codex, Gemini, etc.) │
|
|
12
|
-
├─────────────────────────────────────────────────────────────────┤
|
|
13
|
-
│ │ │
|
|
14
|
-
│ ┌────────────┴────────────┐ │
|
|
15
|
-
│ ▼ ▼ │
|
|
16
|
-
│ ┌─────────────────┐ ┌─────────────────┐ │
|
|
17
|
-
│ │ CLAUDE-MEM │ │ AGENT-RELAY │ │
|
|
18
|
-
│ │ (Observations) │ │ (Messaging) │ │
|
|
19
|
-
│ │ │ │ │ │
|
|
20
|
-
│ │ • Tool calls │ │ • ->relay: <<< │ │
|
|
21
|
-
│ │ • Concepts │ │ • Broadcasting │ │
|
|
22
|
-
│ │ • Sessions │ │ • Persistence │ │
|
|
23
|
-
│ └────────┬────────┘ └────────┬────────┘ │
|
|
24
|
-
│ │ │ │
|
|
25
|
-
│ └──────────┬─────────────┘ │
|
|
26
|
-
│ ▼ │
|
|
27
|
-
│ ┌─────────────────────┐ │
|
|
28
|
-
│ │ AGENT-TRAJECTORIES │ │
|
|
29
|
-
│ │ (Narratives) │ │
|
|
30
|
-
│ │ │ │
|
|
31
|
-
│ │ • Task stories │ │
|
|
32
|
-
│ │ • Decisions │ │
|
|
33
|
-
│ │ • Retrospectives │ │
|
|
34
|
-
│ │ • Workspace │ │
|
|
35
|
-
│ └─────────────────────┘ │
|
|
36
|
-
│ │
|
|
37
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Phase 0: Current State (What Exists)
|
|
43
|
-
|
|
44
|
-
### agent-relay (✅ Ready)
|
|
45
|
-
|
|
46
|
-
**What it does:** Real-time agent-to-agent messaging via Unix sockets.
|
|
47
|
-
|
|
48
|
-
**Installation:**
|
|
49
|
-
```bash
|
|
50
|
-
npm install -g agent-relay
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
**Usage:**
|
|
54
|
-
```bash
|
|
55
|
-
# Start daemon
|
|
56
|
-
agent-relay up
|
|
57
|
-
|
|
58
|
-
# Wrap agent
|
|
59
|
-
agent-relay -n Alice claude
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**What it provides for integration:**
|
|
63
|
-
```typescript
|
|
64
|
-
import { StoredMessage, MessageQuery, StorageAdapter } from 'agent-relay';
|
|
65
|
-
|
|
66
|
-
// Query messages for a time range
|
|
67
|
-
const messages = await storage.getMessages({
|
|
68
|
-
sinceTs: startTime,
|
|
69
|
-
order: 'asc'
|
|
70
|
-
});
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### claude-mem (✅ Exists, needs integration)
|
|
74
|
-
|
|
75
|
-
**What it does:** Captures tool observations with semantic concepts.
|
|
76
|
-
|
|
77
|
-
**Installation:**
|
|
78
|
-
```bash
|
|
79
|
-
# Clone and setup
|
|
80
|
-
git clone https://github.com/thedotmack/claude-mem
|
|
81
|
-
cd claude-mem
|
|
82
|
-
bun install
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**How it works:**
|
|
86
|
-
- Hooks into Claude Code lifecycle (SessionStart, PostToolUse, SessionEnd)
|
|
87
|
-
- Stores observations in SQLite + Chroma (vector search)
|
|
88
|
-
- Provides `mem-search` skill for natural language queries
|
|
89
|
-
|
|
90
|
-
**What it provides for integration:**
|
|
91
|
-
- Tool call history with semantic tags
|
|
92
|
-
- Session continuity
|
|
93
|
-
- Concept-based search
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Phase 1: Install claude-mem
|
|
98
|
-
|
|
99
|
-
### Step 1.1: Clone and Configure
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
# From your project root
|
|
103
|
-
git clone https://github.com/thedotmack/claude-mem .claude-mem
|
|
104
|
-
|
|
105
|
-
# Install dependencies
|
|
106
|
-
cd .claude-mem
|
|
107
|
-
bun install
|
|
108
|
-
|
|
109
|
-
# Start the worker service
|
|
110
|
-
bun run start
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### Step 1.2: Configure Claude Code Hooks
|
|
114
|
-
|
|
115
|
-
Add to your `~/.claude/settings.json` (or project `.claude/settings.json`):
|
|
116
|
-
|
|
117
|
-
```json
|
|
118
|
-
{
|
|
119
|
-
"hooks": {
|
|
120
|
-
"SessionStart": [
|
|
121
|
-
{
|
|
122
|
-
"command": "node .claude-mem/hooks/session-start.js",
|
|
123
|
-
"timeout": 5000
|
|
124
|
-
}
|
|
125
|
-
],
|
|
126
|
-
"PostToolUse": [
|
|
127
|
-
{
|
|
128
|
-
"command": "node .claude-mem/hooks/post-tool-use.js",
|
|
129
|
-
"timeout": 3000
|
|
130
|
-
}
|
|
131
|
-
],
|
|
132
|
-
"SessionEnd": [
|
|
133
|
-
{
|
|
134
|
-
"command": "node .claude-mem/hooks/session-end.js",
|
|
135
|
-
"timeout": 5000
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Step 1.3: Verify It's Working
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
# Start a Claude Code session
|
|
146
|
-
claude
|
|
147
|
-
|
|
148
|
-
# Do some work...
|
|
149
|
-
|
|
150
|
-
# Check the web viewer
|
|
151
|
-
open http://localhost:37777
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
You should see observations being captured.
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## Phase 2: Create agent-trajectories
|
|
159
|
-
|
|
160
|
-
### Step 2.1: Initialize the Project
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
# Create new repo
|
|
164
|
-
mkdir agent-trajectories
|
|
165
|
-
cd agent-trajectories
|
|
166
|
-
npm init -y
|
|
167
|
-
|
|
168
|
-
# Install dependencies
|
|
169
|
-
npm install better-sqlite3 commander uuid
|
|
170
|
-
npm install -D typescript @types/node @types/better-sqlite3 vitest
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### Step 2.2: Project Structure
|
|
174
|
-
|
|
175
|
-
```
|
|
176
|
-
agent-trajectories/
|
|
177
|
-
├── src/
|
|
178
|
-
│ ├── core/
|
|
179
|
-
│ │ ├── types.ts # Trajectory, Chapter, Event types
|
|
180
|
-
│ │ ├── schema.ts # JSON schema for .trajectory format
|
|
181
|
-
│ │ └── trajectory.ts # Trajectory class
|
|
182
|
-
│ │
|
|
183
|
-
│ ├── storage/
|
|
184
|
-
│ │ ├── file-storage.ts # .trajectories/ directory
|
|
185
|
-
│ │ └── sqlite-storage.ts # SQLite for indexing
|
|
186
|
-
│ │
|
|
187
|
-
│ ├── adapters/
|
|
188
|
-
│ │ ├── adapter.ts # TaskSourceAdapter interface
|
|
189
|
-
│ │ ├── beads.ts # Beads integration
|
|
190
|
-
│ │ ├── github.ts # GitHub Issues integration
|
|
191
|
-
│ │ ├── linear.ts # Linear integration
|
|
192
|
-
│ │ └── plain.ts # Standalone trajectories
|
|
193
|
-
│ │
|
|
194
|
-
│ ├── integrations/
|
|
195
|
-
│ │ ├── relay.ts # Import from agent-relay
|
|
196
|
-
│ │ └── claude-mem.ts # Import from claude-mem
|
|
197
|
-
│ │
|
|
198
|
-
│ ├── workspace/
|
|
199
|
-
│ │ ├── decisions.ts # Decision log
|
|
200
|
-
│ │ ├── patterns.ts # Pattern library
|
|
201
|
-
│ │ └── extract.ts # Auto-extraction
|
|
202
|
-
│ │
|
|
203
|
-
│ ├── export/
|
|
204
|
-
│ │ ├── markdown.ts # Notion-style export
|
|
205
|
-
│ │ └── timeline.ts # Linear-style export
|
|
206
|
-
│ │
|
|
207
|
-
│ ├── cli/
|
|
208
|
-
│ │ └── index.ts # CLI commands
|
|
209
|
-
│ │
|
|
210
|
-
│ └── index.ts # Main exports
|
|
211
|
-
│
|
|
212
|
-
├── package.json
|
|
213
|
-
└── tsconfig.json
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### Step 2.3: Core Types
|
|
217
|
-
|
|
218
|
-
```typescript
|
|
219
|
-
// src/core/types.ts
|
|
220
|
-
|
|
221
|
-
export interface Trajectory {
|
|
222
|
-
id: string;
|
|
223
|
-
version: 1;
|
|
224
|
-
|
|
225
|
-
task: TaskReference;
|
|
226
|
-
|
|
227
|
-
startedAt: string;
|
|
228
|
-
completedAt?: string;
|
|
229
|
-
status: 'active' | 'completed' | 'abandoned';
|
|
230
|
-
|
|
231
|
-
agents: AgentParticipation[];
|
|
232
|
-
chapters: Chapter[];
|
|
233
|
-
retrospective?: Retrospective;
|
|
234
|
-
|
|
235
|
-
commits: string[];
|
|
236
|
-
filesChanged: string[];
|
|
237
|
-
|
|
238
|
-
projectId: string;
|
|
239
|
-
tags: string[];
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export interface TaskReference {
|
|
243
|
-
title: string;
|
|
244
|
-
description?: string;
|
|
245
|
-
source?: {
|
|
246
|
-
system: string; // 'beads' | 'linear' | 'github' | 'plain'
|
|
247
|
-
id: string;
|
|
248
|
-
url?: string;
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export interface Chapter {
|
|
253
|
-
id: string;
|
|
254
|
-
title: string;
|
|
255
|
-
agentName: string;
|
|
256
|
-
startedAt: string;
|
|
257
|
-
endedAt?: string;
|
|
258
|
-
events: TrajectoryEvent[];
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export interface TrajectoryEvent {
|
|
262
|
-
ts: number;
|
|
263
|
-
type: EventType;
|
|
264
|
-
content: string;
|
|
265
|
-
raw?: unknown;
|
|
266
|
-
significance?: 'low' | 'medium' | 'high' | 'critical';
|
|
267
|
-
tags?: string[];
|
|
268
|
-
source?: 'relay' | 'claude-mem' | 'manual';
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
export type EventType =
|
|
272
|
-
| 'prompt'
|
|
273
|
-
| 'thinking'
|
|
274
|
-
| 'tool_call'
|
|
275
|
-
| 'tool_result'
|
|
276
|
-
| 'message_sent'
|
|
277
|
-
| 'message_received'
|
|
278
|
-
| 'decision'
|
|
279
|
-
| 'observation' // From claude-mem
|
|
280
|
-
| 'error';
|
|
281
|
-
|
|
282
|
-
export interface Retrospective {
|
|
283
|
-
summary: string;
|
|
284
|
-
approach: string;
|
|
285
|
-
decisions: Decision[];
|
|
286
|
-
challenges: string[];
|
|
287
|
-
learnings: string[];
|
|
288
|
-
suggestions: string[];
|
|
289
|
-
confidence: number;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
export interface Decision {
|
|
293
|
-
question: string;
|
|
294
|
-
chosen: string;
|
|
295
|
-
alternatives: string[];
|
|
296
|
-
reasoning: string;
|
|
297
|
-
}
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
### Step 2.4: CLI Commands
|
|
301
|
-
|
|
302
|
-
```typescript
|
|
303
|
-
// src/cli/index.ts
|
|
304
|
-
|
|
305
|
-
import { Command } from 'commander';
|
|
306
|
-
|
|
307
|
-
const program = new Command();
|
|
308
|
-
|
|
309
|
-
program
|
|
310
|
-
.name('trajectory')
|
|
311
|
-
.description('Agent trajectory management')
|
|
312
|
-
.version('1.0.0');
|
|
313
|
-
|
|
314
|
-
// Create new trajectory
|
|
315
|
-
program
|
|
316
|
-
.command('new <title>')
|
|
317
|
-
.description('Start a new trajectory')
|
|
318
|
-
.option('--beads <id>', 'Link to Beads task')
|
|
319
|
-
.option('--linear <id>', 'Link to Linear issue')
|
|
320
|
-
.option('--github <id>', 'Link to GitHub issue')
|
|
321
|
-
.action(async (title, options) => {
|
|
322
|
-
// Implementation
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
// Show current trajectory status
|
|
326
|
-
program
|
|
327
|
-
.command('status')
|
|
328
|
-
.description('Show active trajectory')
|
|
329
|
-
.action(async () => {
|
|
330
|
-
// Implementation
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
// Add a chapter
|
|
334
|
-
program
|
|
335
|
-
.command('chapter <title>')
|
|
336
|
-
.description('Start a new chapter')
|
|
337
|
-
.action(async (title) => {
|
|
338
|
-
// Implementation
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
// Record a decision
|
|
342
|
-
program
|
|
343
|
-
.command('decision <title>')
|
|
344
|
-
.description('Record a decision')
|
|
345
|
-
.option('--chosen <choice>', 'What was chosen')
|
|
346
|
-
.option('--alternatives <alts...>', 'Alternatives considered')
|
|
347
|
-
.option('--reasoning <reason>', 'Why this choice')
|
|
348
|
-
.action(async (title, options) => {
|
|
349
|
-
// Implementation
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
// Complete trajectory
|
|
353
|
-
program
|
|
354
|
-
.command('complete')
|
|
355
|
-
.description('Complete the active trajectory')
|
|
356
|
-
.option('--retrospective', 'Prompt for retrospective')
|
|
357
|
-
.action(async (options) => {
|
|
358
|
-
// Implementation
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
// Import from sources
|
|
362
|
-
program
|
|
363
|
-
.command('import')
|
|
364
|
-
.description('Import events from external sources')
|
|
365
|
-
.option('--relay', 'Import from agent-relay')
|
|
366
|
-
.option('--claude-mem', 'Import from claude-mem')
|
|
367
|
-
.option('--since <timestamp>', 'Import since timestamp')
|
|
368
|
-
.action(async (options) => {
|
|
369
|
-
// Implementation
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
// Export trajectory
|
|
373
|
-
program
|
|
374
|
-
.command('export <id>')
|
|
375
|
-
.description('Export trajectory')
|
|
376
|
-
.option('--format <format>', 'Export format (markdown, json, timeline)')
|
|
377
|
-
.action(async (id, options) => {
|
|
378
|
-
// Implementation
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
// Search trajectories
|
|
382
|
-
program
|
|
383
|
-
.command('search <query>')
|
|
384
|
-
.description('Search trajectories')
|
|
385
|
-
.action(async (query) => {
|
|
386
|
-
// Implementation
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
program.parse();
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
---
|
|
393
|
-
|
|
394
|
-
## Phase 3: agent-relay Integration
|
|
395
|
-
|
|
396
|
-
### Step 3.1: Import Relay Messages
|
|
397
|
-
|
|
398
|
-
```typescript
|
|
399
|
-
// src/integrations/relay.ts
|
|
400
|
-
|
|
401
|
-
import { StoredMessage, MessageQuery } from 'agent-relay';
|
|
402
|
-
import { TrajectoryEvent } from '../core/types.js';
|
|
403
|
-
|
|
404
|
-
interface RelayImportOptions {
|
|
405
|
-
sinceTs: number;
|
|
406
|
-
untilTs?: number;
|
|
407
|
-
agentName?: string;
|
|
408
|
-
topic?: string;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
export async function importFromRelay(
|
|
412
|
-
storage: StorageAdapter,
|
|
413
|
-
options: RelayImportOptions
|
|
414
|
-
): Promise<TrajectoryEvent[]> {
|
|
415
|
-
const query: MessageQuery = {
|
|
416
|
-
sinceTs: options.sinceTs,
|
|
417
|
-
order: 'asc',
|
|
418
|
-
limit: 1000
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
if (options.agentName) {
|
|
422
|
-
query.from = options.agentName;
|
|
423
|
-
}
|
|
424
|
-
if (options.topic) {
|
|
425
|
-
query.topic = options.topic;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
const messages = await storage.getMessages(query);
|
|
429
|
-
|
|
430
|
-
return messages
|
|
431
|
-
.filter(m => !options.untilTs || m.ts <= options.untilTs)
|
|
432
|
-
.map(messageToEvent);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
function messageToEvent(msg: StoredMessage): TrajectoryEvent {
|
|
436
|
-
return {
|
|
437
|
-
ts: msg.ts,
|
|
438
|
-
type: msg.kind === 'thinking' ? 'thinking' :
|
|
439
|
-
msg.to === '*' ? 'message_sent' :
|
|
440
|
-
'message_received',
|
|
441
|
-
content: msg.body,
|
|
442
|
-
raw: {
|
|
443
|
-
from: msg.from,
|
|
444
|
-
to: msg.to,
|
|
445
|
-
kind: msg.kind,
|
|
446
|
-
data: msg.data
|
|
447
|
-
},
|
|
448
|
-
significance: 'medium',
|
|
449
|
-
source: 'relay'
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
### Step 3.2: Real-time Relay Subscription
|
|
455
|
-
|
|
456
|
-
```typescript
|
|
457
|
-
// src/integrations/relay-listener.ts
|
|
458
|
-
|
|
459
|
-
import { RelayClient } from 'agent-relay';
|
|
460
|
-
import { TrajectoryCapture } from '../capture/trajectory-capture.js';
|
|
461
|
-
|
|
462
|
-
export class RelayListener {
|
|
463
|
-
private client: RelayClient;
|
|
464
|
-
private capture: TrajectoryCapture;
|
|
465
|
-
|
|
466
|
-
constructor(capture: TrajectoryCapture) {
|
|
467
|
-
this.capture = capture;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
async connect(agentName: string): Promise<void> {
|
|
471
|
-
this.client = new RelayClient({ agentName });
|
|
472
|
-
|
|
473
|
-
this.client.on('message', (envelope) => {
|
|
474
|
-
this.capture.recordEvent({
|
|
475
|
-
type: envelope.from === agentName ? 'message_sent' : 'message_received',
|
|
476
|
-
content: envelope.payload.body,
|
|
477
|
-
raw: envelope,
|
|
478
|
-
source: 'relay'
|
|
479
|
-
});
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
await this.client.connect();
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
async disconnect(): Promise<void> {
|
|
486
|
-
await this.client.disconnect();
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
```
|
|
490
|
-
|
|
491
|
-
---
|
|
492
|
-
|
|
493
|
-
## Phase 4: claude-mem Integration
|
|
494
|
-
|
|
495
|
-
### Step 4.1: Query claude-mem Observations
|
|
496
|
-
|
|
497
|
-
```typescript
|
|
498
|
-
// src/integrations/claude-mem.ts
|
|
499
|
-
|
|
500
|
-
import { TrajectoryEvent } from '../core/types.js';
|
|
501
|
-
|
|
502
|
-
interface ClaudeMemObservation {
|
|
503
|
-
id: string;
|
|
504
|
-
timestamp: string;
|
|
505
|
-
type: 'decision' | 'bugfix' | 'feature' | 'refactor' | 'discovery' | 'change';
|
|
506
|
-
content: string;
|
|
507
|
-
concepts: string[];
|
|
508
|
-
files?: string[];
|
|
509
|
-
tokens?: number;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
interface ClaudeMemImportOptions {
|
|
513
|
-
sinceTs: number;
|
|
514
|
-
untilTs?: number;
|
|
515
|
-
types?: string[];
|
|
516
|
-
concepts?: string[];
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
const CLAUDE_MEM_API = 'http://localhost:37777';
|
|
520
|
-
|
|
521
|
-
export async function importFromClaudeMem(
|
|
522
|
-
options: ClaudeMemImportOptions
|
|
523
|
-
): Promise<TrajectoryEvent[]> {
|
|
524
|
-
const params = new URLSearchParams({
|
|
525
|
-
since: new Date(options.sinceTs).toISOString(),
|
|
526
|
-
});
|
|
527
|
-
|
|
528
|
-
if (options.untilTs) {
|
|
529
|
-
params.set('until', new Date(options.untilTs).toISOString());
|
|
530
|
-
}
|
|
531
|
-
if (options.types?.length) {
|
|
532
|
-
params.set('types', options.types.join(','));
|
|
533
|
-
}
|
|
534
|
-
if (options.concepts?.length) {
|
|
535
|
-
params.set('concepts', options.concepts.join(','));
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
const response = await fetch(`${CLAUDE_MEM_API}/api/observations?${params}`);
|
|
539
|
-
const observations: ClaudeMemObservation[] = await response.json();
|
|
540
|
-
|
|
541
|
-
return observations.map(observationToEvent);
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
function observationToEvent(obs: ClaudeMemObservation): TrajectoryEvent {
|
|
545
|
-
return {
|
|
546
|
-
ts: new Date(obs.timestamp).getTime(),
|
|
547
|
-
type: 'observation',
|
|
548
|
-
content: obs.content,
|
|
549
|
-
raw: obs,
|
|
550
|
-
significance: mapTypeToSignificance(obs.type),
|
|
551
|
-
tags: obs.concepts,
|
|
552
|
-
source: 'claude-mem'
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
function mapTypeToSignificance(type: string): 'low' | 'medium' | 'high' | 'critical' {
|
|
557
|
-
switch (type) {
|
|
558
|
-
case 'decision': return 'high';
|
|
559
|
-
case 'bugfix': return 'high';
|
|
560
|
-
case 'feature': return 'medium';
|
|
561
|
-
case 'discovery': return 'medium';
|
|
562
|
-
case 'refactor': return 'low';
|
|
563
|
-
case 'change': return 'low';
|
|
564
|
-
default: return 'medium';
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
// Search claude-mem for relevant observations
|
|
569
|
-
export async function searchClaudeMem(query: string): Promise<ClaudeMemObservation[]> {
|
|
570
|
-
const response = await fetch(`${CLAUDE_MEM_API}/api/search`, {
|
|
571
|
-
method: 'POST',
|
|
572
|
-
headers: { 'Content-Type': 'application/json' },
|
|
573
|
-
body: JSON.stringify({ query })
|
|
574
|
-
});
|
|
575
|
-
|
|
576
|
-
return response.json();
|
|
577
|
-
}
|
|
578
|
-
```
|
|
579
|
-
|
|
580
|
-
### Step 4.2: Enrich Trajectories with Observations
|
|
581
|
-
|
|
582
|
-
```typescript
|
|
583
|
-
// src/integrations/enrichment.ts
|
|
584
|
-
|
|
585
|
-
import { Trajectory, Chapter } from '../core/types.js';
|
|
586
|
-
import { importFromClaudeMem } from './claude-mem.js';
|
|
587
|
-
import { importFromRelay } from './relay.js';
|
|
588
|
-
|
|
589
|
-
export async function enrichTrajectory(
|
|
590
|
-
trajectory: Trajectory,
|
|
591
|
-
relayStorage?: StorageAdapter
|
|
592
|
-
): Promise<Trajectory> {
|
|
593
|
-
const startTs = new Date(trajectory.startedAt).getTime();
|
|
594
|
-
const endTs = trajectory.completedAt
|
|
595
|
-
? new Date(trajectory.completedAt).getTime()
|
|
596
|
-
: Date.now();
|
|
597
|
-
|
|
598
|
-
// Import from claude-mem
|
|
599
|
-
const claudeMemEvents = await importFromClaudeMem({
|
|
600
|
-
sinceTs: startTs,
|
|
601
|
-
untilTs: endTs,
|
|
602
|
-
types: ['decision', 'discovery', 'bugfix']
|
|
603
|
-
});
|
|
604
|
-
|
|
605
|
-
// Import from agent-relay (if available)
|
|
606
|
-
let relayEvents = [];
|
|
607
|
-
if (relayStorage) {
|
|
608
|
-
relayEvents = await importFromRelay(relayStorage, {
|
|
609
|
-
sinceTs: startTs,
|
|
610
|
-
untilTs: endTs
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
// Merge events into chapters by timestamp
|
|
615
|
-
const allEvents = [...claudeMemEvents, ...relayEvents]
|
|
616
|
-
.sort((a, b) => a.ts - b.ts);
|
|
617
|
-
|
|
618
|
-
// Distribute events to appropriate chapters
|
|
619
|
-
for (const event of allEvents) {
|
|
620
|
-
const chapter = findChapterForTimestamp(trajectory.chapters, event.ts);
|
|
621
|
-
if (chapter) {
|
|
622
|
-
chapter.events.push(event);
|
|
623
|
-
chapter.events.sort((a, b) => a.ts - b.ts);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
return trajectory;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
function findChapterForTimestamp(chapters: Chapter[], ts: number): Chapter | null {
|
|
631
|
-
for (const chapter of chapters) {
|
|
632
|
-
const start = new Date(chapter.startedAt).getTime();
|
|
633
|
-
const end = chapter.endedAt
|
|
634
|
-
? new Date(chapter.endedAt).getTime()
|
|
635
|
-
: Date.now();
|
|
636
|
-
|
|
637
|
-
if (ts >= start && ts <= end) {
|
|
638
|
-
return chapter;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
// Return last chapter if no match
|
|
643
|
-
return chapters[chapters.length - 1] || null;
|
|
644
|
-
}
|
|
645
|
-
```
|
|
646
|
-
|
|
647
|
-
---
|
|
648
|
-
|
|
649
|
-
## Phase 5: Hook Integration
|
|
650
|
-
|
|
651
|
-
### Step 5.1: Trajectory Hooks for Claude Code
|
|
652
|
-
|
|
653
|
-
```typescript
|
|
654
|
-
// src/hooks/session-start.ts
|
|
655
|
-
|
|
656
|
-
import { TrajectoryStore } from '../storage/trajectory-store.js';
|
|
657
|
-
|
|
658
|
-
async function onSessionStart(): Promise<{ context?: string }> {
|
|
659
|
-
const store = new TrajectoryStore();
|
|
660
|
-
const active = await store.getActive();
|
|
661
|
-
|
|
662
|
-
if (!active) {
|
|
663
|
-
return {};
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
const context = `
|
|
667
|
-
## Active Trajectory
|
|
668
|
-
|
|
669
|
-
**Task:** ${active.task.title}
|
|
670
|
-
**Status:** ${active.status}
|
|
671
|
-
**Chapter:** ${active.chapters[active.chapters.length - 1]?.title || 'Starting'}
|
|
672
|
-
|
|
673
|
-
### Key Decisions So Far
|
|
674
|
-
${active.chapters
|
|
675
|
-
.flatMap(c => c.events.filter(e => e.type === 'decision'))
|
|
676
|
-
.map(d => `- ${d.content}`)
|
|
677
|
-
.join('\n') || 'None yet'}
|
|
678
|
-
|
|
679
|
-
### Recent Activity
|
|
680
|
-
${active.chapters[active.chapters.length - 1]?.events
|
|
681
|
-
.slice(-5)
|
|
682
|
-
.map(e => `- [${e.type}] ${e.content.slice(0, 100)}`)
|
|
683
|
-
.join('\n') || 'None'}
|
|
684
|
-
|
|
685
|
-
---
|
|
686
|
-
To record a decision: [[TRAJECTORY:decision]]{"title": "...", "chosen": "...", "alternatives": [...], "reasoning": "..."}[[/TRAJECTORY]]
|
|
687
|
-
To start a new chapter: [[TRAJECTORY:chapter]]{"title": "..."}[[/TRAJECTORY]]
|
|
688
|
-
`.trim();
|
|
689
|
-
|
|
690
|
-
return { context };
|
|
691
|
-
}
|
|
692
|
-
```
|
|
693
|
-
|
|
694
|
-
### Step 5.2: Combined Hook Configuration
|
|
695
|
-
|
|
696
|
-
```json
|
|
697
|
-
// .claude/settings.json
|
|
698
|
-
{
|
|
699
|
-
"hooks": {
|
|
700
|
-
"SessionStart": [
|
|
701
|
-
{
|
|
702
|
-
"command": "node .claude-mem/hooks/session-start.js",
|
|
703
|
-
"timeout": 5000
|
|
704
|
-
},
|
|
705
|
-
{
|
|
706
|
-
"command": "npx trajectory hook:session-start",
|
|
707
|
-
"timeout": 3000
|
|
708
|
-
}
|
|
709
|
-
],
|
|
710
|
-
"PostToolUse": [
|
|
711
|
-
{
|
|
712
|
-
"command": "node .claude-mem/hooks/post-tool-use.js",
|
|
713
|
-
"timeout": 3000
|
|
714
|
-
}
|
|
715
|
-
],
|
|
716
|
-
"Stop": [
|
|
717
|
-
{
|
|
718
|
-
"command": "npx trajectory hook:stop",
|
|
719
|
-
"timeout": 5000
|
|
720
|
-
}
|
|
721
|
-
],
|
|
722
|
-
"SessionEnd": [
|
|
723
|
-
{
|
|
724
|
-
"command": "node .claude-mem/hooks/session-end.js",
|
|
725
|
-
"timeout": 5000
|
|
726
|
-
},
|
|
727
|
-
{
|
|
728
|
-
"command": "npx trajectory hook:session-end",
|
|
729
|
-
"timeout": 5000
|
|
730
|
-
}
|
|
731
|
-
]
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
```
|
|
735
|
-
|
|
736
|
-
### Step 5.3: Stop Hook - Prompt for Retrospective
|
|
737
|
-
|
|
738
|
-
```typescript
|
|
739
|
-
// src/hooks/stop.ts
|
|
740
|
-
|
|
741
|
-
import { TrajectoryStore } from '../storage/trajectory-store.js';
|
|
742
|
-
|
|
743
|
-
async function onStop(): Promise<{ decision: 'allow' | 'block'; reason?: string }> {
|
|
744
|
-
const store = new TrajectoryStore();
|
|
745
|
-
const active = await store.getActive();
|
|
746
|
-
|
|
747
|
-
if (!active) {
|
|
748
|
-
return { decision: 'allow' };
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
// Check if trajectory has a retrospective
|
|
752
|
-
if (!active.retrospective) {
|
|
753
|
-
return {
|
|
754
|
-
decision: 'block',
|
|
755
|
-
reason: `
|
|
756
|
-
Active trajectory "${active.task.title}" needs a retrospective before completing.
|
|
757
|
-
|
|
758
|
-
Please output a retrospective:
|
|
759
|
-
|
|
760
|
-
[[TRAJECTORY:retrospective]]
|
|
761
|
-
{
|
|
762
|
-
"summary": "What was accomplished?",
|
|
763
|
-
"approach": "How did you approach it?",
|
|
764
|
-
"decisions": [
|
|
765
|
-
{"question": "Key choice made", "chosen": "What you picked", "alternatives": ["Other options"], "reasoning": "Why"}
|
|
766
|
-
],
|
|
767
|
-
"challenges": ["What was difficult?"],
|
|
768
|
-
"learnings": ["What would you do differently?"],
|
|
769
|
-
"suggestions": ["Improvements for codebase/process?"],
|
|
770
|
-
"confidence": 0.85
|
|
771
|
-
}
|
|
772
|
-
[[/TRAJECTORY]]
|
|
773
|
-
|
|
774
|
-
Or run: trajectory complete --skip-retrospective
|
|
775
|
-
`.trim()
|
|
776
|
-
};
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
return { decision: 'allow' };
|
|
780
|
-
}
|
|
781
|
-
```
|
|
782
|
-
|
|
783
|
-
---
|
|
784
|
-
|
|
785
|
-
## Phase 6: Putting It All Together
|
|
786
|
-
|
|
787
|
-
### Complete Setup Checklist
|
|
788
|
-
|
|
789
|
-
```bash
|
|
790
|
-
# 1. Install agent-relay
|
|
791
|
-
npm install -g agent-relay
|
|
792
|
-
|
|
793
|
-
# 2. Clone and setup claude-mem
|
|
794
|
-
git clone https://github.com/thedotmack/claude-mem .claude-mem
|
|
795
|
-
cd .claude-mem && bun install && bun run start &
|
|
796
|
-
cd ..
|
|
797
|
-
|
|
798
|
-
# 3. Install agent-trajectories (once published)
|
|
799
|
-
npm install -g agent-trajectories
|
|
800
|
-
|
|
801
|
-
# 4. Configure hooks
|
|
802
|
-
cat > .claude/settings.json << 'EOF'
|
|
803
|
-
{
|
|
804
|
-
"hooks": {
|
|
805
|
-
"SessionStart": [
|
|
806
|
-
{"command": "node .claude-mem/hooks/session-start.js", "timeout": 5000},
|
|
807
|
-
{"command": "npx trajectory hook:session-start", "timeout": 3000}
|
|
808
|
-
],
|
|
809
|
-
"PostToolUse": [
|
|
810
|
-
{"command": "node .claude-mem/hooks/post-tool-use.js", "timeout": 3000}
|
|
811
|
-
],
|
|
812
|
-
"Stop": [
|
|
813
|
-
{"command": "npx trajectory hook:stop", "timeout": 5000}
|
|
814
|
-
],
|
|
815
|
-
"SessionEnd": [
|
|
816
|
-
{"command": "node .claude-mem/hooks/session-end.js", "timeout": 5000},
|
|
817
|
-
{"command": "npx trajectory hook:session-end", "timeout": 5000}
|
|
818
|
-
]
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
EOF
|
|
822
|
-
|
|
823
|
-
# 5. Start the relay daemon
|
|
824
|
-
agent-relay up
|
|
825
|
-
|
|
826
|
-
# 6. Start working!
|
|
827
|
-
agent-relay -n Alice claude
|
|
828
|
-
```
|
|
829
|
-
|
|
830
|
-
### Typical Workflow
|
|
831
|
-
|
|
832
|
-
```bash
|
|
833
|
-
# Start a task
|
|
834
|
-
trajectory new "Implement user authentication" --linear ENG-456
|
|
835
|
-
|
|
836
|
-
# Work in Claude Code...
|
|
837
|
-
# - claude-mem captures tool observations automatically
|
|
838
|
-
# - agent-relay captures messages automatically
|
|
839
|
-
# - You can add decisions manually via [[TRAJECTORY:decision]]
|
|
840
|
-
|
|
841
|
-
# Check status
|
|
842
|
-
trajectory status
|
|
843
|
-
|
|
844
|
-
# Start a new chapter when switching focus
|
|
845
|
-
trajectory chapter "Testing"
|
|
846
|
-
|
|
847
|
-
# When done, complete with retrospective
|
|
848
|
-
trajectory complete
|
|
849
|
-
|
|
850
|
-
# View the result
|
|
851
|
-
trajectory export ENG-456 --format markdown
|
|
852
|
-
```
|
|
853
|
-
|
|
854
|
-
### Data Flow Diagram
|
|
855
|
-
|
|
856
|
-
```
|
|
857
|
-
┌──────────────────────────────────────────────────────────────────┐
|
|
858
|
-
│ AGENT SESSION │
|
|
859
|
-
├──────────────────────────────────────────────────────────────────┤
|
|
860
|
-
│ │
|
|
861
|
-
│ Agent works... │
|
|
862
|
-
│ │ │
|
|
863
|
-
│ ├──────────────────┬───────────────────┐ │
|
|
864
|
-
│ ▼ ▼ ▼ │
|
|
865
|
-
│ ┌─────────┐ ┌───────────┐ ┌────────────┐ │
|
|
866
|
-
│ │ Tool │ │ ->relay: │ │[[TRAJECTORY│ │
|
|
867
|
-
│ │ Calls │ │ messages │ │ :decision]]│ │
|
|
868
|
-
│ └────┬────┘ └─────┬─────┘ └──────┬─────┘ │
|
|
869
|
-
│ │ │ │ │
|
|
870
|
-
│ ▼ ▼ ▼ │
|
|
871
|
-
│ ┌─────────┐ ┌───────────┐ ┌────────────┐ │
|
|
872
|
-
│ │claude- │ │agent-relay│ │agent- │ │
|
|
873
|
-
│ │mem │ │SQLite │ │trajectories│ │
|
|
874
|
-
│ │SQLite + │ │ │ │.trajectory/│ │
|
|
875
|
-
│ │Chroma │ │ │ │ │ │
|
|
876
|
-
│ └────┬────┘ └─────┬─────┘ └──────┬─────┘ │
|
|
877
|
-
│ │ │ │ │
|
|
878
|
-
│ └────────────┬────┴───────────────────┘ │
|
|
879
|
-
│ ▼ │
|
|
880
|
-
│ ┌─────────────────┐ │
|
|
881
|
-
│ │ trajectory │ │
|
|
882
|
-
│ │ complete │ │
|
|
883
|
-
│ │ │ │
|
|
884
|
-
│ │ Enriches with: │ │
|
|
885
|
-
│ │ - relay msgs │ │
|
|
886
|
-
│ │ - claude-mem │ │
|
|
887
|
-
│ │ observations │ │
|
|
888
|
-
│ └────────┬────────┘ │
|
|
889
|
-
│ ▼ │
|
|
890
|
-
│ ┌─────────────────┐ │
|
|
891
|
-
│ │ .trajectory.json│ │
|
|
892
|
-
│ │ .trajectory.md │ │
|
|
893
|
-
│ │ │ │
|
|
894
|
-
│ │ Complete story │ │
|
|
895
|
-
│ │ of the work │ │
|
|
896
|
-
│ └─────────────────┘ │
|
|
897
|
-
│ │
|
|
898
|
-
└──────────────────────────────────────────────────────────────────┘
|
|
899
|
-
```
|
|
900
|
-
|
|
901
|
-
---
|
|
902
|
-
|
|
903
|
-
## Summary: What Each Piece Does
|
|
904
|
-
|
|
905
|
-
| Component | Captures | Storage | Query |
|
|
906
|
-
|-----------|----------|---------|-------|
|
|
907
|
-
| **agent-relay** | Agent messages | SQLite | By time, sender, topic |
|
|
908
|
-
| **claude-mem** | Tool observations | SQLite + Chroma | Semantic search |
|
|
909
|
-
| **agent-trajectories** | Task narratives | Files + SQLite | By task, decision, pattern |
|
|
910
|
-
|
|
911
|
-
| Component | Hooks | Real-time | Export |
|
|
912
|
-
|-----------|-------|-----------|--------|
|
|
913
|
-
| **agent-relay** | Stop (inbox check) | Yes (sockets) | JSON |
|
|
914
|
-
| **claude-mem** | All lifecycle | No | JSON |
|
|
915
|
-
| **agent-trajectories** | Start, Stop, End | Optional | Markdown, JSON, Timeline |
|
|
916
|
-
|
|
917
|
-
---
|
|
918
|
-
|
|
919
|
-
## Next Steps
|
|
920
|
-
|
|
921
|
-
1. **Phase 1:** Get claude-mem working in your project
|
|
922
|
-
2. **Phase 2:** Create agent-trajectories repo with core types
|
|
923
|
-
3. **Phase 3:** Add relay integration
|
|
924
|
-
4. **Phase 4:** Add claude-mem integration
|
|
925
|
-
5. **Phase 5:** Build CLI and hooks
|
|
926
|
-
6. **Phase 6:** Test end-to-end flow
|