agent-relay 1.3.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -158
- 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 +9 -0
- package/dist/bridge/spawner.d.ts +4 -4
- package/dist/bridge/spawner.js +58 -92
- package/dist/cli/index.d.ts +8 -6
- package/dist/cli/index.js +282 -47
- package/dist/cloud/api/daemons.js +13 -32
- package/dist/cloud/api/onboarding.js +2 -4
- package/dist/cloud/api/providers.js +6 -0
- package/dist/cloud/config.d.ts +1 -0
- package/dist/cloud/config.js +2 -0
- package/dist/cloud/db/bulk-ingest.d.ts +2 -1
- package/dist/cloud/db/drizzle.d.ts +21 -26
- package/dist/cloud/db/drizzle.js +87 -100
- package/dist/cloud/db/index.d.ts +6 -5
- package/dist/cloud/db/index.js +9 -8
- package/dist/cloud/db/schema.d.ts +1049 -1076
- package/dist/cloud/db/schema.js +59 -71
- package/dist/cloud/server.js +854 -18
- package/dist/cloud/services/persistence.d.ts +15 -15
- package/dist/cloud/services/persistence.js +14 -14
- package/dist/daemon/agent-manager.d.ts +6 -5
- package/dist/daemon/agent-manager.js +12 -8
- package/dist/daemon/channel-membership-store.d.ts +48 -0
- package/dist/daemon/channel-membership-store.js +149 -0
- package/dist/daemon/cloud-sync.d.ts +2 -0
- package/dist/daemon/cloud-sync.js +4 -0
- package/dist/daemon/connection.js +17 -9
- package/dist/daemon/router.d.ts +37 -0
- package/dist/daemon/router.js +318 -79
- package/dist/daemon/server.d.ts +15 -0
- package/dist/daemon/server.js +141 -3
- package/dist/dashboard/out/404.html +1 -0
- package/dist/dashboard/out/_next/static/IxxVRv94L1w3ReRGAiI-k/_buildManifest.js +1 -0
- package/dist/dashboard/out/_next/static/IxxVRv94L1w3ReRGAiI-k/_ssgManifest.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/116-eacf84a131b80db9.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/117-c8afed19e821a35d.js +2 -0
- package/dist/dashboard/out/_next/static/chunks/282-980c2eb8fff20123.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/532-bace199897eeab37.js +9 -0
- package/dist/dashboard/out/_next/static/chunks/64-87ab9cd6bcf2f737.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/648-acb2ff9f77cbfbd3.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/766-aa7c8c9900ff5f53.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/83-4f08122d4e7e79a6.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/847-f1f467060f32afff.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/891-a024fbe4b619cf6f.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/_not-found/page-60501fddbafba9dc.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/onboarding/page-f746f29e01fffc43.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/page-ffad986adfcc8b31.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/cloud/link/page-cfeb437f08a12ed9.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-03ac6f35a6654ea6.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/history/page-240f91e8b06ba8ac.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/layout-c0d118c0f92d969c.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/login/page-6ec54eee75877971.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-82938ab8fcf44694.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/page-671037943b2f2e43.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-0efa024c28ba4597.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-57cbd738c6a73859.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/providers/setup/[provider]/page-5ab0854472b402b0.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/signup/page-18a4665665f6be11.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +18 -0
- package/dist/dashboard/out/_next/static/chunks/fd9d1056-609918ca7b6280bb.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/framework-f66176bb897dc684.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/main-5a40a5ae29646e1b.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/main-app-6e8e8d3ef4e0192a.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/pages/_app-72b849fbd24ac258.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/pages/_error-7ba65e1336b92748.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +1 -0
- package/dist/dashboard/out/_next/static/css/4034f236dd1a3178.css +1 -0
- package/dist/dashboard/out/_next/static/css/8f9ed310f454e5a5.css +1 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-128.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-256.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-32.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-512.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-64.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo.svg +45 -0
- package/dist/dashboard/out/alt-logos/logo.svg +38 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-128.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-256.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-32.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-512.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-64.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo.svg +38 -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 -0
- package/dist/dashboard/out/app.txt +7 -0
- package/dist/dashboard/out/apple-icon.png +0 -0
- package/dist/dashboard/out/cloud/link.html +1 -0
- package/dist/dashboard/out/cloud/link.txt +7 -0
- 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 -0
- package/dist/dashboard/out/history.txt +7 -0
- package/dist/dashboard/out/index.html +1 -0
- package/dist/dashboard/out/index.txt +7 -0
- package/dist/dashboard/out/login.html +5 -0
- package/dist/dashboard/out/login.txt +7 -0
- package/dist/dashboard/out/metrics.html +1 -0
- package/dist/dashboard/out/metrics.txt +7 -0
- package/dist/dashboard/out/pricing.html +13 -0
- package/dist/dashboard/out/pricing.txt +7 -0
- package/dist/dashboard/out/providers/setup/claude.html +1 -0
- package/dist/dashboard/out/providers/setup/claude.txt +8 -0
- package/dist/dashboard/out/providers/setup/codex.html +1 -0
- package/dist/dashboard/out/providers/setup/codex.txt +8 -0
- 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/metrics.d.ts +105 -0
- package/dist/dashboard-server/metrics.js +193 -0
- package/dist/dashboard-server/needs-attention.d.ts +24 -0
- package/dist/dashboard-server/needs-attention.js +78 -0
- package/dist/dashboard-server/server.d.ts +15 -0
- package/dist/dashboard-server/server.js +4753 -0
- package/dist/dashboard-server/start.d.ts +6 -0
- package/dist/dashboard-server/start.js +13 -0
- package/dist/dashboard-server/user-bridge.d.ts +132 -0
- package/dist/dashboard-server/user-bridge.js +317 -0
- package/dist/protocol/channels.d.ts +14 -8
- package/dist/protocol/channels.js +1 -1
- package/dist/protocol/index.d.ts +1 -0
- package/dist/protocol/index.js +1 -0
- package/dist/protocol/relay-pty-schemas.d.ts +209 -0
- package/dist/protocol/relay-pty-schemas.js +60 -0
- package/dist/wrapper/auth-detection.js +8 -1
- package/dist/wrapper/base-wrapper.d.ts +11 -1
- package/dist/wrapper/base-wrapper.js +67 -6
- package/dist/wrapper/client.d.ts +49 -1
- package/dist/wrapper/client.js +167 -0
- package/dist/wrapper/parser.d.ts +0 -4
- package/dist/wrapper/parser.js +38 -10
- package/dist/wrapper/pty-wrapper.d.ts +12 -1
- package/dist/wrapper/pty-wrapper.js +104 -5
- package/dist/wrapper/relay-pty-orchestrator.d.ts +270 -0
- package/dist/wrapper/relay-pty-orchestrator.js +970 -0
- package/dist/wrapper/shared.d.ts +1 -1
- package/dist/wrapper/shared.js +14 -4
- package/dist/wrapper/tmux-wrapper.d.ts +13 -1
- package/dist/wrapper/tmux-wrapper.js +143 -29
- package/package.json +9 -4
- package/scripts/postinstall.js +101 -11
- package/.trajectories/active/traj_3yx9dy148mge.json +0 -42
- package/.trajectories/agent-relay-322-324.md +0 -17
- package/.trajectories/completed/2026-01/traj_03zupyv1s7b9.json +0 -49
- package/.trajectories/completed/2026-01/traj_03zupyv1s7b9.md +0 -31
- package/.trajectories/completed/2026-01/traj_0zacdjl1g4ht.json +0 -125
- package/.trajectories/completed/2026-01/traj_0zacdjl1g4ht.md +0 -62
- package/.trajectories/completed/2026-01/traj_1dviorhnkcb5.json +0 -65
- package/.trajectories/completed/2026-01/traj_1dviorhnkcb5.md +0 -37
- package/.trajectories/completed/2026-01/traj_1g7yx6qtg4ai.json +0 -49
- package/.trajectories/completed/2026-01/traj_1g7yx6qtg4ai.md +0 -31
- package/.trajectories/completed/2026-01/traj_1k5if5snst2e.json +0 -65
- package/.trajectories/completed/2026-01/traj_1k5if5snst2e.md +0 -37
- package/.trajectories/completed/2026-01/traj_1rp3rges5811.json +0 -49
- package/.trajectories/completed/2026-01/traj_1rp3rges5811.md +0 -31
- package/.trajectories/completed/2026-01/traj_22bhyulruouw.json +0 -113
- package/.trajectories/completed/2026-01/traj_22bhyulruouw.md +0 -57
- package/.trajectories/completed/2026-01/traj_2dao7ddgnta0.json +0 -53
- package/.trajectories/completed/2026-01/traj_2dao7ddgnta0.md +0 -32
- package/.trajectories/completed/2026-01/traj_33iuy72sezbk.json +0 -49
- package/.trajectories/completed/2026-01/traj_33iuy72sezbk.md +0 -31
- package/.trajectories/completed/2026-01/traj_3t0440mjeunc.json +0 -26
- package/.trajectories/completed/2026-01/traj_3t0440mjeunc.md +0 -6
- package/.trajectories/completed/2026-01/traj_45x9494d9xnr.json +0 -47
- package/.trajectories/completed/2026-01/traj_45x9494d9xnr.md +0 -32
- package/.trajectories/completed/2026-01/traj_4aa0bb77s4nh.json +0 -53
- package/.trajectories/completed/2026-01/traj_4aa0bb77s4nh.md +0 -32
- package/.trajectories/completed/2026-01/traj_4qwd4zmhfwp4.json +0 -49
- package/.trajectories/completed/2026-01/traj_4qwd4zmhfwp4.md +0 -31
- package/.trajectories/completed/2026-01/traj_5ammh5qtvklq.json +0 -77
- package/.trajectories/completed/2026-01/traj_5ammh5qtvklq.md +0 -42
- package/.trajectories/completed/2026-01/traj_5lhmzq8rxpqv.json +0 -59
- package/.trajectories/completed/2026-01/traj_5lhmzq8rxpqv.md +0 -33
- package/.trajectories/completed/2026-01/traj_5vr4e9erb1fs.json +0 -53
- package/.trajectories/completed/2026-01/traj_5vr4e9erb1fs.md +0 -32
- package/.trajectories/completed/2026-01/traj_6fgiwdoklvym.json +0 -48
- package/.trajectories/completed/2026-01/traj_6fgiwdoklvym.md +0 -24
- package/.trajectories/completed/2026-01/traj_6mieijqyvaag.json +0 -77
- package/.trajectories/completed/2026-01/traj_6mieijqyvaag.md +0 -42
- package/.trajectories/completed/2026-01/traj_6unwwmgyj5sq.json +0 -109
- package/.trajectories/completed/2026-01/traj_78ffm31jn3uk.json +0 -77
- package/.trajectories/completed/2026-01/traj_78ffm31jn3uk.md +0 -42
- package/.trajectories/completed/2026-01/traj_7ludwvz45veh.json +0 -209
- package/.trajectories/completed/2026-01/traj_7ludwvz45veh.md +0 -97
- package/.trajectories/completed/2026-01/traj_94gnp3k30goq.json +0 -66
- package/.trajectories/completed/2026-01/traj_94gnp3k30goq.md +0 -36
- package/.trajectories/completed/2026-01/traj_9921cuhel0pj.json +0 -48
- package/.trajectories/completed/2026-01/traj_9921cuhel0pj.md +0 -24
- package/.trajectories/completed/2026-01/traj_a0tqx8biw9c4.json +0 -49
- package/.trajectories/completed/2026-01/traj_a0tqx8biw9c4.md +0 -31
- package/.trajectories/completed/2026-01/traj_ajs7zqfux4wc.json +0 -49
- package/.trajectories/completed/2026-01/traj_ajs7zqfux4wc.md +0 -23
- package/.trajectories/completed/2026-01/traj_avqeghu6pz5a.json +0 -40
- package/.trajectories/completed/2026-01/traj_avqeghu6pz5a.md +0 -22
- package/.trajectories/completed/2026-01/traj_ax8uungxz2qh.json +0 -66
- package/.trajectories/completed/2026-01/traj_ax8uungxz2qh.md +0 -36
- package/.trajectories/completed/2026-01/traj_c9izbh2snpzf.json +0 -49
- package/.trajectories/completed/2026-01/traj_c9izbh2snpzf.md +0 -31
- package/.trajectories/completed/2026-01/traj_cpn70dw066nt.json +0 -65
- package/.trajectories/completed/2026-01/traj_cpn70dw066nt.md +0 -37
- package/.trajectories/completed/2026-01/traj_cvtqhlwcq9s0.json +0 -53
- package/.trajectories/completed/2026-01/traj_cvtqhlwcq9s0.md +0 -32
- package/.trajectories/completed/2026-01/traj_cxofprm2m2en.json +0 -49
- package/.trajectories/completed/2026-01/traj_cxofprm2m2en.md +0 -31
- package/.trajectories/completed/2026-01/traj_d2hhz3k0vrhn.json +0 -26
- package/.trajectories/completed/2026-01/traj_d2hhz3k0vrhn.md +0 -6
- package/.trajectories/completed/2026-01/traj_dcsp9s8y01ra.json +0 -121
- package/.trajectories/completed/2026-01/traj_dcsp9s8y01ra.md +0 -29
- package/.trajectories/completed/2026-01/traj_dfuvww9pege5.json +0 -59
- package/.trajectories/completed/2026-01/traj_dfuvww9pege5.md +0 -37
- package/.trajectories/completed/2026-01/traj_erglv2f8t9eh.json +0 -36
- package/.trajectories/completed/2026-01/traj_erglv2f8t9eh.md +0 -21
- package/.trajectories/completed/2026-01/traj_fhx9irlckht6.json +0 -53
- package/.trajectories/completed/2026-01/traj_fhx9irlckht6.md +0 -32
- package/.trajectories/completed/2026-01/traj_fqduidx3xbtp.json +0 -101
- package/.trajectories/completed/2026-01/traj_fqduidx3xbtp.md +0 -52
- package/.trajectories/completed/2026-01/traj_g0fisy9h51mf.json +0 -77
- package/.trajectories/completed/2026-01/traj_g0fisy9h51mf.md +0 -42
- package/.trajectories/completed/2026-01/traj_gjdre5voouod.json +0 -53
- package/.trajectories/completed/2026-01/traj_gjdre5voouod.md +0 -32
- package/.trajectories/completed/2026-01/traj_gtlyqtta3x8l.json +0 -25
- package/.trajectories/completed/2026-01/traj_gtlyqtta3x8l.md +0 -15
- package/.trajectories/completed/2026-01/traj_h4xijiuip3w4.json +0 -101
- package/.trajectories/completed/2026-01/traj_h4xijiuip3w4.md +0 -44
- package/.trajectories/completed/2026-01/traj_he75f24d1xfm.json +0 -101
- package/.trajectories/completed/2026-01/traj_he75f24d1xfm.md +0 -52
- package/.trajectories/completed/2026-01/traj_hf81ey93uz6t.json +0 -49
- package/.trajectories/completed/2026-01/traj_hf81ey93uz6t.md +0 -31
- package/.trajectories/completed/2026-01/traj_hfmki2jr9d4r.json +0 -65
- package/.trajectories/completed/2026-01/traj_hfmki2jr9d4r.md +0 -37
- package/.trajectories/completed/2026-01/traj_hhxte7w4gjjx.json +0 -22
- package/.trajectories/completed/2026-01/traj_hhxte7w4gjjx.md +0 -5
- package/.trajectories/completed/2026-01/traj_hpungyhoj6v5.json +0 -53
- package/.trajectories/completed/2026-01/traj_hpungyhoj6v5.md +0 -32
- package/.trajectories/completed/2026-01/traj_lgtodco7dp1n.json +0 -61
- package/.trajectories/completed/2026-01/traj_lgtodco7dp1n.md +0 -36
- package/.trajectories/completed/2026-01/traj_lq450ly148uw.json +0 -49
- package/.trajectories/completed/2026-01/traj_lq450ly148uw.md +0 -31
- package/.trajectories/completed/2026-01/traj_m2xkjv0w2sq7.json +0 -25
- package/.trajectories/completed/2026-01/traj_m2xkjv0w2sq7.md +0 -15
- package/.trajectories/completed/2026-01/traj_multi_server_arch.md +0 -101
- package/.trajectories/completed/2026-01/traj_noq5zbvnrdvz.json +0 -53
- package/.trajectories/completed/2026-01/traj_noq5zbvnrdvz.md +0 -32
- package/.trajectories/completed/2026-01/traj_ntbs6ppopf46.json +0 -53
- package/.trajectories/completed/2026-01/traj_ntbs6ppopf46.md +0 -32
- package/.trajectories/completed/2026-01/traj_oszg9flv74pk.json +0 -73
- package/.trajectories/completed/2026-01/traj_oszg9flv74pk.md +0 -41
- package/.trajectories/completed/2026-01/traj_ozd98si6a7ns.json +0 -48
- package/.trajectories/completed/2026-01/traj_ozd98si6a7ns.md +0 -24
- package/.trajectories/completed/2026-01/traj_prdza7a5cxp5.json +0 -53
- package/.trajectories/completed/2026-01/traj_prdza7a5cxp5.md +0 -32
- package/.trajectories/completed/2026-01/traj_psd9ob0j2ru3.json +0 -27
- package/.trajectories/completed/2026-01/traj_psd9ob0j2ru3.md +0 -14
- package/.trajectories/completed/2026-01/traj_pulomd3y8cvj.json +0 -77
- package/.trajectories/completed/2026-01/traj_pulomd3y8cvj.md +0 -42
- package/.trajectories/completed/2026-01/traj_qb3twvvywfwi.json +0 -77
- package/.trajectories/completed/2026-01/traj_qb3twvvywfwi.md +0 -42
- package/.trajectories/completed/2026-01/traj_qft54mi7nfor.json +0 -53
- package/.trajectories/completed/2026-01/traj_qft54mi7nfor.md +0 -32
- package/.trajectories/completed/2026-01/traj_qx9uhf8whhxo.json +0 -83
- package/.trajectories/completed/2026-01/traj_qx9uhf8whhxo.md +0 -47
- package/.trajectories/completed/2026-01/traj_rd9toccj18a0.json +0 -59
- package/.trajectories/completed/2026-01/traj_rd9toccj18a0.md +0 -37
- package/.trajectories/completed/2026-01/traj_rsavt0jipi3c.json +0 -109
- package/.trajectories/completed/2026-01/traj_rsavt0jipi3c.md +0 -56
- package/.trajectories/completed/2026-01/traj_rt4fiw3ecp50.json +0 -48
- package/.trajectories/completed/2026-01/traj_rt4fiw3ecp50.md +0 -16
- package/.trajectories/completed/2026-01/traj_st8j35b0hrlc.json +0 -59
- package/.trajectories/completed/2026-01/traj_st8j35b0hrlc.md +0 -37
- package/.trajectories/completed/2026-01/traj_t1yy8m7hbuxp.json +0 -53
- package/.trajectories/completed/2026-01/traj_t1yy8m7hbuxp.md +0 -32
- package/.trajectories/completed/2026-01/traj_tmux_orchestrator_analysis.json +0 -84
- package/.trajectories/completed/2026-01/traj_tmux_orchestrator_analysis.md +0 -109
- package/.trajectories/completed/2026-01/traj_u9n9eqasw16k.json +0 -53
- package/.trajectories/completed/2026-01/traj_u9n9eqasw16k.md +0 -32
- package/.trajectories/completed/2026-01/traj_ub8csuv3lcv4.json +0 -53
- package/.trajectories/completed/2026-01/traj_ub8csuv3lcv4.md +0 -32
- package/.trajectories/completed/2026-01/traj_uc29tlso8i9s.json +0 -186
- package/.trajectories/completed/2026-01/traj_uc29tlso8i9s.md +0 -86
- package/.trajectories/completed/2026-01/traj_ui9b4tqxoa7j.json +0 -77
- package/.trajectories/completed/2026-01/traj_ui9b4tqxoa7j.md +0 -42
- package/.trajectories/completed/2026-01/traj_v87hypnongqx.json +0 -71
- package/.trajectories/completed/2026-01/traj_v87hypnongqx.md +0 -42
- package/.trajectories/completed/2026-01/traj_v9dkdoxylyid.json +0 -89
- package/.trajectories/completed/2026-01/traj_v9dkdoxylyid.md +0 -47
- package/.trajectories/completed/2026-01/traj_wkp2fgzdyinb.json +0 -53
- package/.trajectories/completed/2026-01/traj_wkp2fgzdyinb.md +0 -32
- package/.trajectories/completed/2026-01/traj_x14t8w8rn7xg.json +0 -20
- package/.trajectories/completed/2026-01/traj_x14t8w8rn7xg.md +0 -6
- package/.trajectories/completed/2026-01/traj_x721m1j9rzup.json +0 -113
- package/.trajectories/completed/2026-01/traj_x721m1j9rzup.md +0 -57
- package/.trajectories/completed/2026-01/traj_xjqvmep5ed3h.json +0 -61
- package/.trajectories/completed/2026-01/traj_xjqvmep5ed3h.md +0 -36
- package/.trajectories/completed/2026-01/traj_xnwbznkvv8ua.json +0 -175
- package/.trajectories/completed/2026-01/traj_xnwbznkvv8ua.md +0 -82
- package/.trajectories/completed/2026-01/traj_xy9vifpqet80.json +0 -65
- package/.trajectories/completed/2026-01/traj_xy9vifpqet80.md +0 -37
- package/.trajectories/completed/2026-01/traj_y7aiwijyfmmv.json +0 -49
- package/.trajectories/completed/2026-01/traj_y7aiwijyfmmv.md +0 -31
- package/.trajectories/completed/2026-01/traj_y7n6hfbf7dmg.json +0 -49
- package/.trajectories/completed/2026-01/traj_y7n6hfbf7dmg.md +0 -31
- package/.trajectories/completed/2026-01/traj_ysjc8zaeqtd3.json +0 -47
- package/.trajectories/completed/2026-01/traj_ysjc8zaeqtd3.md +0 -32
- package/.trajectories/completed/2026-01/traj_yvdadtvdgnz3.json +0 -59
- package/.trajectories/completed/2026-01/traj_yvdadtvdgnz3.md +0 -37
- package/.trajectories/completed/2026-01/traj_yvfkwnkdiso2.json +0 -49
- package/.trajectories/completed/2026-01/traj_yvfkwnkdiso2.md +0 -31
- package/.trajectories/completed/2026-01/traj_z0vcw1wrzide.json +0 -53
- package/.trajectories/completed/2026-01/traj_z0vcw1wrzide.md +0 -32
- package/.trajectories/consolidate-settings-panel.md +0 -24
- package/.trajectories/gh-cli-user-token.md +0 -26
- package/.trajectories/index.json +0 -607
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Standalone dashboard starter for local development
|
|
4
|
+
*/
|
|
5
|
+
import { startDashboard } from './server.js';
|
|
6
|
+
import { getProjectPaths } from '../utils/project-namespace.js';
|
|
7
|
+
const port = parseInt(process.env.DASHBOARD_PORT || '3888', 10);
|
|
8
|
+
const paths = getProjectPaths();
|
|
9
|
+
console.log(`Starting dashboard for project: ${paths.projectRoot}`);
|
|
10
|
+
console.log(`Data dir: ${paths.dataDir}`);
|
|
11
|
+
console.log(`Database: ${paths.dbPath}`);
|
|
12
|
+
startDashboard(port, paths.dataDir, paths.teamDir, paths.dbPath).catch(console.error);
|
|
13
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Bridge - Bridges dashboard WebSocket users to the relay daemon.
|
|
3
|
+
*
|
|
4
|
+
* This module allows human users connected via WebSocket to:
|
|
5
|
+
* - Register as "user" entities in the relay daemon
|
|
6
|
+
* - Join/leave channels
|
|
7
|
+
* - Send/receive messages through the relay daemon
|
|
8
|
+
* - Communicate with agents and other users
|
|
9
|
+
*/
|
|
10
|
+
import type { WebSocket } from 'ws';
|
|
11
|
+
/**
|
|
12
|
+
* Relay client interface (subset of RelayClient for dependency injection)
|
|
13
|
+
*/
|
|
14
|
+
export interface IRelayClient {
|
|
15
|
+
connect(): Promise<void>;
|
|
16
|
+
disconnect(): void;
|
|
17
|
+
state: string;
|
|
18
|
+
sendMessage(to: string, body: string, kind?: string, data?: unknown, thread?: string): boolean;
|
|
19
|
+
joinChannel(channel: string, displayName?: string): boolean;
|
|
20
|
+
leaveChannel(channel: string, reason?: string): boolean;
|
|
21
|
+
sendChannelMessage(channel: string, body: string, options?: {
|
|
22
|
+
thread?: string;
|
|
23
|
+
mentions?: string[];
|
|
24
|
+
attachments?: unknown[];
|
|
25
|
+
data?: Record<string, unknown>;
|
|
26
|
+
}): boolean;
|
|
27
|
+
adminJoinChannel?(channel: string, member: string): boolean;
|
|
28
|
+
adminRemoveMember?(channel: string, member: string): boolean;
|
|
29
|
+
onMessage?: (from: string, payload: any, messageId: string, meta?: any, originalTo?: string) => void;
|
|
30
|
+
onChannelMessage?: (from: string, channel: string, body: string, envelope: any) => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Factory function type for creating relay clients
|
|
34
|
+
*/
|
|
35
|
+
export type RelayClientFactory = (options: {
|
|
36
|
+
socketPath: string;
|
|
37
|
+
agentName: string;
|
|
38
|
+
entityType: 'user';
|
|
39
|
+
displayName?: string;
|
|
40
|
+
avatarUrl?: string;
|
|
41
|
+
}) => Promise<IRelayClient>;
|
|
42
|
+
/**
|
|
43
|
+
* Options for creating a UserBridge
|
|
44
|
+
*/
|
|
45
|
+
export interface UserBridgeOptions {
|
|
46
|
+
socketPath: string;
|
|
47
|
+
createRelayClient: RelayClientFactory;
|
|
48
|
+
loadPersistedChannels?: (username: string) => Promise<string[]>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Message options for sending
|
|
52
|
+
*/
|
|
53
|
+
export interface SendMessageOptions {
|
|
54
|
+
thread?: string;
|
|
55
|
+
data?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* UserBridge manages the connection between dashboard WebSocket users
|
|
59
|
+
* and the relay daemon.
|
|
60
|
+
*/
|
|
61
|
+
export declare class UserBridge {
|
|
62
|
+
private readonly socketPath;
|
|
63
|
+
private readonly createRelayClient;
|
|
64
|
+
private readonly loadPersistedChannels?;
|
|
65
|
+
private readonly users;
|
|
66
|
+
constructor(options: UserBridgeOptions);
|
|
67
|
+
/**
|
|
68
|
+
* Register a user with the relay daemon.
|
|
69
|
+
* Creates a relay client connection for the user.
|
|
70
|
+
*/
|
|
71
|
+
registerUser(username: string, webSocket: WebSocket, options?: {
|
|
72
|
+
avatarUrl?: string;
|
|
73
|
+
displayName?: string;
|
|
74
|
+
}): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Unregister a user and disconnect their relay client.
|
|
77
|
+
*/
|
|
78
|
+
unregisterUser(username: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Check if a user is registered.
|
|
81
|
+
*/
|
|
82
|
+
isUserRegistered(username: string): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Get list of all registered users.
|
|
85
|
+
*/
|
|
86
|
+
getRegisteredUsers(): string[];
|
|
87
|
+
/**
|
|
88
|
+
* Join a channel.
|
|
89
|
+
*/
|
|
90
|
+
joinChannel(username: string, channel: string): Promise<boolean>;
|
|
91
|
+
/**
|
|
92
|
+
* Leave a channel.
|
|
93
|
+
*/
|
|
94
|
+
leaveChannel(username: string, channel: string): Promise<boolean>;
|
|
95
|
+
/**
|
|
96
|
+
* Get channels a user has joined.
|
|
97
|
+
*/
|
|
98
|
+
getUserChannels(username: string): string[];
|
|
99
|
+
/**
|
|
100
|
+
* Send a message to a channel.
|
|
101
|
+
*/
|
|
102
|
+
sendChannelMessage(username: string, channel: string, body: string, options?: SendMessageOptions): Promise<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* Send a direct message to another user or agent.
|
|
105
|
+
*/
|
|
106
|
+
sendDirectMessage(fromUsername: string, toName: string, body: string, options?: SendMessageOptions): Promise<boolean>;
|
|
107
|
+
/**
|
|
108
|
+
* Handle incoming direct message from relay daemon.
|
|
109
|
+
*/
|
|
110
|
+
private handleIncomingDirectMessage;
|
|
111
|
+
/**
|
|
112
|
+
* Handle incoming channel message from relay daemon.
|
|
113
|
+
*/
|
|
114
|
+
private handleIncomingChannelMessage;
|
|
115
|
+
/**
|
|
116
|
+
* Admin: Add a member to a channel (does not require member to be connected).
|
|
117
|
+
* Used to sync channel memberships from database.
|
|
118
|
+
* Uses the first available user session or creates a temporary one.
|
|
119
|
+
*/
|
|
120
|
+
adminJoinChannel(channel: string, member: string): Promise<boolean>;
|
|
121
|
+
/**
|
|
122
|
+
* Admin: Remove a member from a channel (does not require member to be connected).
|
|
123
|
+
* Used to remove channel members from dashboard.
|
|
124
|
+
* Uses the first available user session or creates a temporary one.
|
|
125
|
+
*/
|
|
126
|
+
adminRemoveMember(channel: string, member: string): Promise<boolean>;
|
|
127
|
+
/**
|
|
128
|
+
* Dispose of all user sessions.
|
|
129
|
+
*/
|
|
130
|
+
dispose(): void;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=user-bridge.d.ts.map
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Bridge - Bridges dashboard WebSocket users to the relay daemon.
|
|
3
|
+
*
|
|
4
|
+
* This module allows human users connected via WebSocket to:
|
|
5
|
+
* - Register as "user" entities in the relay daemon
|
|
6
|
+
* - Join/leave channels
|
|
7
|
+
* - Send/receive messages through the relay daemon
|
|
8
|
+
* - Communicate with agents and other users
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* UserBridge manages the connection between dashboard WebSocket users
|
|
12
|
+
* and the relay daemon.
|
|
13
|
+
*/
|
|
14
|
+
export class UserBridge {
|
|
15
|
+
socketPath;
|
|
16
|
+
createRelayClient;
|
|
17
|
+
loadPersistedChannels;
|
|
18
|
+
users = new Map();
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.socketPath = options.socketPath;
|
|
21
|
+
this.createRelayClient = options.createRelayClient;
|
|
22
|
+
this.loadPersistedChannels = options.loadPersistedChannels;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Register a user with the relay daemon.
|
|
26
|
+
* Creates a relay client connection for the user.
|
|
27
|
+
*/
|
|
28
|
+
async registerUser(username, webSocket, options) {
|
|
29
|
+
// If user already registered, unregister first
|
|
30
|
+
if (this.users.has(username)) {
|
|
31
|
+
this.unregisterUser(username);
|
|
32
|
+
}
|
|
33
|
+
// Create relay client for this user
|
|
34
|
+
const relayClient = await this.createRelayClient({
|
|
35
|
+
socketPath: this.socketPath,
|
|
36
|
+
agentName: username,
|
|
37
|
+
entityType: 'user',
|
|
38
|
+
displayName: options?.displayName,
|
|
39
|
+
avatarUrl: options?.avatarUrl,
|
|
40
|
+
});
|
|
41
|
+
// Connect to daemon
|
|
42
|
+
await relayClient.connect();
|
|
43
|
+
// Set up message handler to forward direct messages to WebSocket
|
|
44
|
+
relayClient.onMessage = (from, payload, _messageId, _meta, _originalTo) => {
|
|
45
|
+
const body = typeof payload === 'object' && payload !== null && 'body' in payload
|
|
46
|
+
? payload.body
|
|
47
|
+
: String(payload);
|
|
48
|
+
this.handleIncomingDirectMessage(username, from, body, payload);
|
|
49
|
+
};
|
|
50
|
+
// Set up channel message handler to forward channel messages to WebSocket
|
|
51
|
+
relayClient.onChannelMessage = (from, channel, body, envelope) => {
|
|
52
|
+
console.log(`[user-bridge] onChannelMessage callback triggered: ${from} -> ${channel} for ${username}`);
|
|
53
|
+
this.handleIncomingChannelMessage(username, from, channel, body, envelope);
|
|
54
|
+
};
|
|
55
|
+
// Create session
|
|
56
|
+
const session = {
|
|
57
|
+
username,
|
|
58
|
+
relayClient,
|
|
59
|
+
webSocket,
|
|
60
|
+
channels: new Set(),
|
|
61
|
+
avatarUrl: options?.avatarUrl,
|
|
62
|
+
};
|
|
63
|
+
this.users.set(username, session);
|
|
64
|
+
// Auto-join user to #general channel
|
|
65
|
+
// Note: The daemon auto-joins on connect, but we need to track locally too
|
|
66
|
+
session.channels.add('#general');
|
|
67
|
+
if (this.loadPersistedChannels) {
|
|
68
|
+
try {
|
|
69
|
+
const persistedChannels = await this.loadPersistedChannels(username);
|
|
70
|
+
for (const channel of persistedChannels) {
|
|
71
|
+
if (channel === '#general')
|
|
72
|
+
continue;
|
|
73
|
+
if (session.channels.has(channel))
|
|
74
|
+
continue;
|
|
75
|
+
session.relayClient.joinChannel(channel, username);
|
|
76
|
+
session.channels.add(channel);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
console.error(`[user-bridge] Failed to restore persisted channels for ${username}:`, err);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Set up WebSocket close handler
|
|
84
|
+
webSocket.on('close', () => {
|
|
85
|
+
this.unregisterUser(username);
|
|
86
|
+
});
|
|
87
|
+
console.log(`[user-bridge] User ${username} registered with relay daemon`);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Unregister a user and disconnect their relay client.
|
|
91
|
+
*/
|
|
92
|
+
unregisterUser(username) {
|
|
93
|
+
const session = this.users.get(username);
|
|
94
|
+
if (!session)
|
|
95
|
+
return;
|
|
96
|
+
session.relayClient.disconnect();
|
|
97
|
+
this.users.delete(username);
|
|
98
|
+
console.log(`[user-bridge] User ${username} unregistered from relay daemon`);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if a user is registered.
|
|
102
|
+
*/
|
|
103
|
+
isUserRegistered(username) {
|
|
104
|
+
return this.users.has(username);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get list of all registered users.
|
|
108
|
+
*/
|
|
109
|
+
getRegisteredUsers() {
|
|
110
|
+
return Array.from(this.users.keys());
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Join a channel.
|
|
114
|
+
*/
|
|
115
|
+
async joinChannel(username, channel) {
|
|
116
|
+
const session = this.users.get(username);
|
|
117
|
+
if (!session) {
|
|
118
|
+
console.warn(`[user-bridge] Cannot join channel - user ${username} not registered`);
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
// Send CHANNEL_JOIN via relay client
|
|
122
|
+
const success = session.relayClient.joinChannel(channel, username);
|
|
123
|
+
if (success) {
|
|
124
|
+
// Track membership
|
|
125
|
+
session.channels.add(channel);
|
|
126
|
+
}
|
|
127
|
+
return success;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Leave a channel.
|
|
131
|
+
*/
|
|
132
|
+
async leaveChannel(username, channel) {
|
|
133
|
+
const session = this.users.get(username);
|
|
134
|
+
if (!session) {
|
|
135
|
+
console.warn(`[user-bridge] Cannot leave channel - user ${username} not registered`);
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
// Send CHANNEL_LEAVE via relay client
|
|
139
|
+
const success = session.relayClient.leaveChannel(channel);
|
|
140
|
+
if (success) {
|
|
141
|
+
// Update membership
|
|
142
|
+
session.channels.delete(channel);
|
|
143
|
+
console.log(`[user-bridge] User ${username} left channel ${channel}`);
|
|
144
|
+
}
|
|
145
|
+
return success;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Get channels a user has joined.
|
|
149
|
+
*/
|
|
150
|
+
getUserChannels(username) {
|
|
151
|
+
const session = this.users.get(username);
|
|
152
|
+
return session ? Array.from(session.channels) : [];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Send a message to a channel.
|
|
156
|
+
*/
|
|
157
|
+
async sendChannelMessage(username, channel, body, options) {
|
|
158
|
+
console.log(`[user-bridge] sendChannelMessage called: username=${username}, channel=${channel}`);
|
|
159
|
+
const session = this.users.get(username);
|
|
160
|
+
if (!session) {
|
|
161
|
+
console.warn(`[user-bridge] Cannot send - user ${username} not registered`);
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
console.log(`[user-bridge] Session found, relayClient state: ${session.relayClient.state}`);
|
|
165
|
+
console.log(`[user-bridge] User channels: ${Array.from(session.channels).join(', ')}`);
|
|
166
|
+
// Use CHANNEL_MESSAGE protocol
|
|
167
|
+
const success = session.relayClient.sendChannelMessage(channel, body, {
|
|
168
|
+
thread: options?.thread,
|
|
169
|
+
data: options?.data,
|
|
170
|
+
});
|
|
171
|
+
console.log(`[user-bridge] sendChannelMessage result: ${success}`);
|
|
172
|
+
return success;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Send a direct message to another user or agent.
|
|
176
|
+
*/
|
|
177
|
+
async sendDirectMessage(fromUsername, toName, body, options) {
|
|
178
|
+
const session = this.users.get(fromUsername);
|
|
179
|
+
if (!session) {
|
|
180
|
+
console.warn(`[user-bridge] Cannot send DM - user ${fromUsername} not registered`);
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
return session.relayClient.sendMessage(toName, body, 'message', options?.data, options?.thread);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Handle incoming direct message from relay daemon.
|
|
187
|
+
*/
|
|
188
|
+
handleIncomingDirectMessage(username, from, body, payload) {
|
|
189
|
+
const session = this.users.get(username);
|
|
190
|
+
if (!session)
|
|
191
|
+
return;
|
|
192
|
+
const ws = session.webSocket;
|
|
193
|
+
if (ws.readyState !== 1)
|
|
194
|
+
return; // Not OPEN
|
|
195
|
+
// Direct message (DELIVER)
|
|
196
|
+
const payloadObj = payload;
|
|
197
|
+
ws.send(JSON.stringify({
|
|
198
|
+
type: 'direct_message',
|
|
199
|
+
from,
|
|
200
|
+
body: payloadObj?.body || body,
|
|
201
|
+
timestamp: new Date().toISOString(),
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Handle incoming channel message from relay daemon.
|
|
206
|
+
*/
|
|
207
|
+
handleIncomingChannelMessage(username, from, channel, body, envelope) {
|
|
208
|
+
const session = this.users.get(username);
|
|
209
|
+
if (!session)
|
|
210
|
+
return;
|
|
211
|
+
const ws = session.webSocket;
|
|
212
|
+
if (ws.readyState !== 1)
|
|
213
|
+
return; // Not OPEN
|
|
214
|
+
console.log(`[user-bridge] Forwarding channel message to ${username}: ${from} -> ${channel}`);
|
|
215
|
+
// Channel message
|
|
216
|
+
const env = envelope;
|
|
217
|
+
ws.send(JSON.stringify({
|
|
218
|
+
type: 'channel_message',
|
|
219
|
+
channel,
|
|
220
|
+
from,
|
|
221
|
+
body,
|
|
222
|
+
thread: env?.payload?.thread,
|
|
223
|
+
mentions: env?.payload?.mentions,
|
|
224
|
+
timestamp: new Date().toISOString(),
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Admin: Add a member to a channel (does not require member to be connected).
|
|
229
|
+
* Used to sync channel memberships from database.
|
|
230
|
+
* Uses the first available user session or creates a temporary one.
|
|
231
|
+
*/
|
|
232
|
+
async adminJoinChannel(channel, member) {
|
|
233
|
+
// Try to use an existing session
|
|
234
|
+
const sessions = Array.from(this.users.values());
|
|
235
|
+
if (sessions.length > 0) {
|
|
236
|
+
const session = sessions[0];
|
|
237
|
+
if (session.relayClient.adminJoinChannel) {
|
|
238
|
+
console.log(`[user-bridge] Admin join: ${member} -> ${channel} (via ${session.username})`);
|
|
239
|
+
return session.relayClient.adminJoinChannel(channel, member);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// No sessions available - create a temporary system client
|
|
243
|
+
try {
|
|
244
|
+
console.log(`[user-bridge] Admin join: ${member} -> ${channel} (creating temp client)`);
|
|
245
|
+
const tempClient = await this.createRelayClient({
|
|
246
|
+
socketPath: this.socketPath,
|
|
247
|
+
agentName: '__system__',
|
|
248
|
+
entityType: 'user',
|
|
249
|
+
});
|
|
250
|
+
await tempClient.connect();
|
|
251
|
+
// Give daemon time to complete handshake
|
|
252
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
253
|
+
if (tempClient.adminJoinChannel) {
|
|
254
|
+
const result = tempClient.adminJoinChannel(channel, member);
|
|
255
|
+
// Disconnect after a short delay to allow message to be sent
|
|
256
|
+
setTimeout(() => tempClient.disconnect(), 200);
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
tempClient.disconnect();
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
console.error('[user-bridge] Failed to create temp client for admin join:', err);
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Admin: Remove a member from a channel (does not require member to be connected).
|
|
269
|
+
* Used to remove channel members from dashboard.
|
|
270
|
+
* Uses the first available user session or creates a temporary one.
|
|
271
|
+
*/
|
|
272
|
+
async adminRemoveMember(channel, member) {
|
|
273
|
+
// Try to use an existing session
|
|
274
|
+
const sessions = Array.from(this.users.values());
|
|
275
|
+
if (sessions.length > 0) {
|
|
276
|
+
const session = sessions[0];
|
|
277
|
+
if (session.relayClient.adminRemoveMember) {
|
|
278
|
+
console.log(`[user-bridge] Admin remove: ${member} <- ${channel} (via ${session.username})`);
|
|
279
|
+
return session.relayClient.adminRemoveMember(channel, member);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
// No sessions available - create a temporary system client
|
|
283
|
+
try {
|
|
284
|
+
console.log(`[user-bridge] Admin remove: ${member} <- ${channel} (creating temp client)`);
|
|
285
|
+
const tempClient = await this.createRelayClient({
|
|
286
|
+
socketPath: this.socketPath,
|
|
287
|
+
agentName: '__system__',
|
|
288
|
+
entityType: 'user',
|
|
289
|
+
});
|
|
290
|
+
await tempClient.connect();
|
|
291
|
+
// Give daemon time to complete handshake
|
|
292
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
293
|
+
if (tempClient.adminRemoveMember) {
|
|
294
|
+
const result = tempClient.adminRemoveMember(channel, member);
|
|
295
|
+
// Disconnect after a short delay to allow message to be sent
|
|
296
|
+
setTimeout(() => tempClient.disconnect(), 200);
|
|
297
|
+
return result;
|
|
298
|
+
}
|
|
299
|
+
tempClient.disconnect();
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
catch (err) {
|
|
303
|
+
console.error('[user-bridge] Failed to create temp client for admin remove:', err);
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Dispose of all user sessions.
|
|
309
|
+
*/
|
|
310
|
+
dispose() {
|
|
311
|
+
for (const [username] of this.users) {
|
|
312
|
+
this.unregisterUser(username);
|
|
313
|
+
}
|
|
314
|
+
console.log('[user-bridge] Disposed all user sessions');
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=user-bridge.js.map
|
|
@@ -6,14 +6,8 @@
|
|
|
6
6
|
* - Channels for group communication
|
|
7
7
|
* - Direct messaging between any combination of users and agents
|
|
8
8
|
*/
|
|
9
|
-
import { PROTOCOL_VERSION, type Envelope } from './types.js';
|
|
9
|
+
import { PROTOCOL_VERSION, type Envelope, type EntityType } from './types.js';
|
|
10
10
|
export { PROTOCOL_VERSION };
|
|
11
|
-
/**
|
|
12
|
-
* Entity types in the relay system.
|
|
13
|
-
* - 'agent': AI agent (Claude, GPT, etc.)
|
|
14
|
-
* - 'user': Human user (via dashboard)
|
|
15
|
-
*/
|
|
16
|
-
export type EntityType = 'agent' | 'user';
|
|
17
11
|
/**
|
|
18
12
|
* Extended message types for channels.
|
|
19
13
|
*/
|
|
@@ -34,7 +28,7 @@ export interface MessageAttachment {
|
|
|
34
28
|
id: string;
|
|
35
29
|
filename: string;
|
|
36
30
|
mimeType: string;
|
|
37
|
-
size
|
|
31
|
+
size?: number;
|
|
38
32
|
url?: string;
|
|
39
33
|
data?: string;
|
|
40
34
|
}
|
|
@@ -49,6 +43,12 @@ export interface ChannelJoinPayload {
|
|
|
49
43
|
displayName?: string;
|
|
50
44
|
/** Optional avatar URL */
|
|
51
45
|
avatarUrl?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Optional member name to add to channel.
|
|
48
|
+
* If provided, adds this member instead of the sender.
|
|
49
|
+
* Used for admin operations (e.g., adding agents via dashboard).
|
|
50
|
+
*/
|
|
51
|
+
member?: string;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Payload for CHANNEL_LEAVE message.
|
|
@@ -59,6 +59,12 @@ export interface ChannelLeavePayload {
|
|
|
59
59
|
channel: string;
|
|
60
60
|
/** Optional reason for leaving */
|
|
61
61
|
reason?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Optional member name to remove from channel.
|
|
64
|
+
* If provided, removes this member instead of the sender.
|
|
65
|
+
* Used for admin operations (e.g., removing members via dashboard).
|
|
66
|
+
*/
|
|
67
|
+
member?: string;
|
|
62
68
|
}
|
|
63
69
|
/**
|
|
64
70
|
* Payload for CHANNEL_MESSAGE.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { generateId } from '../utils/id-generator.js';
|
|
10
10
|
import { PROTOCOL_VERSION } from './types.js';
|
|
11
|
-
// Re-export
|
|
11
|
+
// Re-export for convenience
|
|
12
12
|
export { PROTOCOL_VERSION };
|
|
13
13
|
/**
|
|
14
14
|
* Check if an entity type represents a user.
|
package/dist/protocol/index.d.ts
CHANGED
package/dist/protocol/index.js
CHANGED