agent-relay 2.0.9 → 2.0.11

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.
Files changed (98) hide show
  1. package/bin/relay-pty-darwin-arm64 +0 -0
  2. package/bin/relay-pty-darwin-x64 +0 -0
  3. package/bin/relay-pty-linux-x64 +0 -0
  4. package/dist/dashboard/out/404.html +1 -1
  5. package/dist/dashboard/out/app/onboarding.html +1 -1
  6. package/dist/dashboard/out/app/onboarding.txt +1 -1
  7. package/dist/dashboard/out/app.html +1 -1
  8. package/dist/dashboard/out/app.txt +1 -1
  9. package/dist/dashboard/out/cloud/link.html +1 -1
  10. package/dist/dashboard/out/cloud/link.txt +1 -1
  11. package/dist/dashboard/out/connect-repos.html +1 -1
  12. package/dist/dashboard/out/connect-repos.txt +1 -1
  13. package/dist/dashboard/out/history.html +1 -1
  14. package/dist/dashboard/out/history.txt +1 -1
  15. package/dist/dashboard/out/index.html +1 -1
  16. package/dist/dashboard/out/index.txt +1 -1
  17. package/dist/dashboard/out/login.html +1 -1
  18. package/dist/dashboard/out/login.txt +1 -1
  19. package/dist/dashboard/out/metrics.html +1 -1
  20. package/dist/dashboard/out/metrics.txt +1 -1
  21. package/dist/dashboard/out/pricing.html +1 -1
  22. package/dist/dashboard/out/pricing.txt +1 -1
  23. package/dist/dashboard/out/providers/setup/claude.html +1 -1
  24. package/dist/dashboard/out/providers/setup/claude.txt +1 -1
  25. package/dist/dashboard/out/providers/setup/codex.html +1 -1
  26. package/dist/dashboard/out/providers/setup/codex.txt +1 -1
  27. package/dist/dashboard/out/providers/setup/cursor.html +1 -1
  28. package/dist/dashboard/out/providers/setup/cursor.txt +1 -1
  29. package/dist/dashboard/out/providers.html +1 -1
  30. package/dist/dashboard/out/providers.txt +1 -1
  31. package/dist/dashboard/out/signup.html +1 -1
  32. package/dist/dashboard/out/signup.txt +1 -1
  33. package/package.json +15 -15
  34. package/packages/api-types/package.json +1 -1
  35. package/packages/bridge/dist/spawner.js +50 -7
  36. package/packages/bridge/package.json +7 -7
  37. package/packages/cloud/package.json +6 -6
  38. package/packages/config/package.json +2 -2
  39. package/packages/continuity/package.json +1 -1
  40. package/packages/daemon/dist/cloud-sync.d.ts +101 -0
  41. package/packages/daemon/dist/cloud-sync.js +209 -1
  42. package/packages/daemon/dist/orchestrator.js +8 -0
  43. package/packages/daemon/dist/server.js +25 -0
  44. package/packages/daemon/package.json +12 -12
  45. package/packages/dashboard/package.json +12 -12
  46. package/packages/dashboard/ui-dist/404.html +1 -1
  47. package/packages/dashboard/ui-dist/app/onboarding.html +1 -1
  48. package/packages/dashboard/ui-dist/app/onboarding.txt +1 -1
  49. package/packages/dashboard/ui-dist/app.html +1 -1
  50. package/packages/dashboard/ui-dist/app.txt +1 -1
  51. package/packages/dashboard/ui-dist/cloud/link.html +1 -1
  52. package/packages/dashboard/ui-dist/cloud/link.txt +1 -1
  53. package/packages/dashboard/ui-dist/connect-repos.html +1 -1
  54. package/packages/dashboard/ui-dist/connect-repos.txt +1 -1
  55. package/packages/dashboard/ui-dist/history.html +1 -1
  56. package/packages/dashboard/ui-dist/history.txt +1 -1
  57. package/packages/dashboard/ui-dist/index.html +1 -1
  58. package/packages/dashboard/ui-dist/index.txt +1 -1
  59. package/packages/dashboard/ui-dist/login.html +1 -1
  60. package/packages/dashboard/ui-dist/login.txt +1 -1
  61. package/packages/dashboard/ui-dist/metrics.html +1 -1
  62. package/packages/dashboard/ui-dist/metrics.txt +1 -1
  63. package/packages/dashboard/ui-dist/pricing.html +1 -1
  64. package/packages/dashboard/ui-dist/pricing.txt +1 -1
  65. package/packages/dashboard/ui-dist/providers/setup/claude.html +1 -1
  66. package/packages/dashboard/ui-dist/providers/setup/claude.txt +1 -1
  67. package/packages/dashboard/ui-dist/providers/setup/codex.html +1 -1
  68. package/packages/dashboard/ui-dist/providers/setup/codex.txt +1 -1
  69. package/packages/dashboard/ui-dist/providers/setup/cursor.html +1 -1
  70. package/packages/dashboard/ui-dist/providers/setup/cursor.txt +1 -1
  71. package/packages/dashboard/ui-dist/providers.html +1 -1
  72. package/packages/dashboard/ui-dist/providers.txt +1 -1
  73. package/packages/dashboard/ui-dist/signup.html +1 -1
  74. package/packages/dashboard/ui-dist/signup.txt +1 -1
  75. package/packages/dashboard-server/package.json +12 -12
  76. package/packages/hooks/package.json +4 -4
  77. package/packages/mcp/package.json +2 -2
  78. package/packages/memory/package.json +2 -2
  79. package/packages/policy/package.json +2 -2
  80. package/packages/protocol/package.json +1 -1
  81. package/packages/resiliency/package.json +1 -1
  82. package/packages/sdk/package.json +2 -2
  83. package/packages/spawner/package.json +1 -1
  84. package/packages/state/package.json +1 -1
  85. package/packages/storage/package.json +2 -2
  86. package/packages/telemetry/package.json +1 -1
  87. package/packages/trajectory/package.json +2 -2
  88. package/packages/user-directory/package.json +2 -2
  89. package/packages/utils/package.json +1 -1
  90. package/packages/wrapper/package.json +6 -6
  91. /package/dist/dashboard/out/_next/static/{yw7HtoQSzwaQ0EXhFC8Qg → N2nFek-KCN321ZAghmjge}/_buildManifest.js +0 -0
  92. /package/dist/dashboard/out/_next/static/{yw7HtoQSzwaQ0EXhFC8Qg → N2nFek-KCN321ZAghmjge}/_ssgManifest.js +0 -0
  93. /package/packages/dashboard/ui-dist/_next/static/{Ok6uUFTpNDsiK7XtHQXew → 59SiFCGkIPHj5xnvI-Hkn}/_buildManifest.js +0 -0
  94. /package/packages/dashboard/ui-dist/_next/static/{Ok6uUFTpNDsiK7XtHQXew → 59SiFCGkIPHj5xnvI-Hkn}/_ssgManifest.js +0 -0
  95. /package/packages/dashboard/ui-dist/_next/static/{vBCaf0XUzTLY1jl5BFsZX → N2nFek-KCN321ZAghmjge}/_buildManifest.js +0 -0
  96. /package/packages/dashboard/ui-dist/_next/static/{vBCaf0XUzTLY1jl5BFsZX → N2nFek-KCN321ZAghmjge}/_ssgManifest.js +0 -0
  97. /package/packages/dashboard/ui-dist/_next/static/{yw7HtoQSzwaQ0EXhFC8Qg → eWYFV8hKU_42BNS8Dj84s}/_buildManifest.js +0 -0
  98. /package/packages/dashboard/ui-dist/_next/static/{yw7HtoQSzwaQ0EXhFC8Qg → eWYFV8hKU_42BNS8Dj84s}/_ssgManifest.js +0 -0
@@ -3,4 +3,4 @@
3
3
  transition-all duration-300
4
4
  drop-shadow-[0_0_8px_rgba(0,217,255,0.3)]
5
5
 
6
- " aria-label="Agent Relay Logo" role="img"><path d="M30 80 L 50 20 L 70 80" stroke="#00d9ff" stroke-width="5" stroke-linejoin="round" stroke-linecap="round" fill="none"></path><line x1="40" y1="50" x2="60" y2="50" stroke="#00d9ff" stroke-width="5" stroke-linecap="round"></line><path d="M50 20 L 50 80" stroke="#00ffc8" stroke-width="2.5" stroke-linecap="round" opacity="0.7"></path><path d="M50 20 C 80 20 80 50 50 50 L 80 80" stroke="#00ffc8" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" fill="none" opacity="0.7"></path></svg><h1 class="mt-4 text-3xl font-bold text-white">Get Started</h1><p class="mt-2 text-text-muted text-center">Create your account and start orchestrating AI agents</p></div><div class="bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8 shadow-xl"><div><div class="mb-6 space-y-3"><div class="flex items-center gap-3 text-sm text-text-secondary"><div class="w-8 h-8 rounded-lg bg-accent-cyan/10 flex items-center justify-center flex-shrink-0"><svg class="w-4 h-4 text-accent-cyan" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></div><span>Deploy AI agents in seconds</span></div><div class="flex items-center gap-3 text-sm text-text-secondary"><div class="w-8 h-8 rounded-lg bg-[#00ffc8]/10 flex items-center justify-center flex-shrink-0"><svg class="w-4 h-4 text-[#00ffc8]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path></svg></div><span>Real-time agent collaboration</span></div><div class="flex items-center gap-3 text-sm text-text-secondary"><div class="w-8 h-8 rounded-lg bg-[#0891b2]/10 flex items-center justify-center flex-shrink-0"><svg class="w-4 h-4 text-[#0891b2]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"></path></svg></div><span>Secure credential management</span></div></div><button type="button" disabled="" class="w-full py-4 px-6 bg-[#24292e] hover:bg-[#2f363d] border border-[#444d56] rounded-xl text-white font-medium flex items-center justify-center gap-3 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"><svg class="w-5 h-5 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg><span>Loading...</span></button><p class="mt-6 text-center text-text-muted text-sm">By signing up, you agree to our<!-- --> <a href="/terms" class="text-accent-cyan hover:underline">Terms of Service</a> <!-- -->and<!-- --> <a href="/privacy" class="text-accent-cyan hover:underline">Privacy Policy</a></p></div></div><div class="mt-6 text-center"><p class="text-text-muted">Already have an account?<!-- --> <a href="/login" class="text-accent-cyan hover:underline font-medium">Sign in</a></p></div><div class="mt-4 text-center"><a href="/" class="text-text-muted hover:text-white transition-colors text-sm">Back to home</a></div></div></div><script src="/_next/static/chunks/webpack-1cdd8ed57114d5e1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/99c2552394077586.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[9107,[],\"ClientPageRoot\"]\n5:I[4665,[\"282\",\"static/chunks/282-980c2eb8fff20123.js\",\"966\",\"static/chunks/app/signup/page-1ede2205b58649ca.js\"],\"default\",1]\n6:I[4707,[],\"\"]\n7:I[6423,[],\"\"]\n9:I[1060,[],\"\"]\na:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"yw7HtoQSzwaQ0EXhFC8Qg\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"signup\"],\"initialTree\":[\"\",{\"children\":[\"signup\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"signup\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$5\"}],null],null],null]},[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"signup\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/99c2552394077586.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L8\"],\"globalErrorComponent\":\"$9\",\"missingSlots\":\"$Wa\"}]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}],[\"$\",\"link\",\"4\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?9e7a840704165ca6\",\"type\":\"image/png\",\"sizes\":\"256x256\"}]]\n3:null\n"])</script></body></html>
6
+ " aria-label="Agent Relay Logo" role="img"><path d="M30 80 L 50 20 L 70 80" stroke="#00d9ff" stroke-width="5" stroke-linejoin="round" stroke-linecap="round" fill="none"></path><line x1="40" y1="50" x2="60" y2="50" stroke="#00d9ff" stroke-width="5" stroke-linecap="round"></line><path d="M50 20 L 50 80" stroke="#00ffc8" stroke-width="2.5" stroke-linecap="round" opacity="0.7"></path><path d="M50 20 C 80 20 80 50 50 50 L 80 80" stroke="#00ffc8" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" fill="none" opacity="0.7"></path></svg><h1 class="mt-4 text-3xl font-bold text-white">Get Started</h1><p class="mt-2 text-text-muted text-center">Create your account and start orchestrating AI agents</p></div><div class="bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8 shadow-xl"><div><div class="mb-6 space-y-3"><div class="flex items-center gap-3 text-sm text-text-secondary"><div class="w-8 h-8 rounded-lg bg-accent-cyan/10 flex items-center justify-center flex-shrink-0"><svg class="w-4 h-4 text-accent-cyan" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></div><span>Deploy AI agents in seconds</span></div><div class="flex items-center gap-3 text-sm text-text-secondary"><div class="w-8 h-8 rounded-lg bg-[#00ffc8]/10 flex items-center justify-center flex-shrink-0"><svg class="w-4 h-4 text-[#00ffc8]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path></svg></div><span>Real-time agent collaboration</span></div><div class="flex items-center gap-3 text-sm text-text-secondary"><div class="w-8 h-8 rounded-lg bg-[#0891b2]/10 flex items-center justify-center flex-shrink-0"><svg class="w-4 h-4 text-[#0891b2]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"></path></svg></div><span>Secure credential management</span></div></div><button type="button" disabled="" class="w-full py-4 px-6 bg-[#24292e] hover:bg-[#2f363d] border border-[#444d56] rounded-xl text-white font-medium flex items-center justify-center gap-3 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"><svg class="w-5 h-5 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg><span>Loading...</span></button><p class="mt-6 text-center text-text-muted text-sm">By signing up, you agree to our<!-- --> <a href="/terms" class="text-accent-cyan hover:underline">Terms of Service</a> <!-- -->and<!-- --> <a href="/privacy" class="text-accent-cyan hover:underline">Privacy Policy</a></p></div></div><div class="mt-6 text-center"><p class="text-text-muted">Already have an account?<!-- --> <a href="/login" class="text-accent-cyan hover:underline font-medium">Sign in</a></p></div><div class="mt-4 text-center"><a href="/" class="text-text-muted hover:text-white transition-colors text-sm">Back to home</a></div></div></div><script src="/_next/static/chunks/webpack-1cdd8ed57114d5e1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/99c2552394077586.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[9107,[],\"ClientPageRoot\"]\n5:I[4665,[\"282\",\"static/chunks/282-980c2eb8fff20123.js\",\"966\",\"static/chunks/app/signup/page-1ede2205b58649ca.js\"],\"default\",1]\n6:I[4707,[],\"\"]\n7:I[6423,[],\"\"]\n9:I[1060,[],\"\"]\na:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"N2nFek-KCN321ZAghmjge\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"signup\"],\"initialTree\":[\"\",{\"children\":[\"signup\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"signup\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$5\"}],null],null],null]},[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"signup\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/99c2552394077586.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L8\"],\"globalErrorComponent\":\"$9\",\"missingSlots\":\"$Wa\"}]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}],[\"$\",\"link\",\"4\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?9e7a840704165ca6\",\"type\":\"image/png\",\"sizes\":\"256x256\"}]]\n3:null\n"])</script></body></html>
@@ -2,6 +2,6 @@
2
2
  3:I[4665,["282","static/chunks/282-980c2eb8fff20123.js","966","static/chunks/app/signup/page-1ede2205b58649ca.js"],"default",1]
3
3
  4:I[4707,[],""]
4
4
  5:I[6423,[],""]
5
- 0:["yw7HtoQSzwaQ0EXhFC8Qg",[[["",{"children":["signup",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["signup",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","signup","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/99c2552394077586.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]
5
+ 0:["N2nFek-KCN321ZAghmjge",[[["",{"children":["signup",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["signup",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","signup","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/99c2552394077586.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]
6
6
  6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Agent Relay Dashboard"}],["$","meta","3",{"name":"description","content":"Fleet control dashboard for Agent Relay"}],["$","link","4",{"rel":"apple-touch-icon","href":"/apple-icon.png?9e7a840704165ca6","type":"image/png","sizes":"256x256"}]]
7
7
  1:null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Real-time agent-to-agent communication system",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -107,20 +107,20 @@
107
107
  },
108
108
  "homepage": "https://github.com/AgentWorkforce/relay#readme",
109
109
  "dependencies": {
110
- "@agent-relay/bridge": "2.0.9",
111
- "@agent-relay/config": "2.0.9",
112
- "@agent-relay/continuity": "2.0.9",
113
- "@agent-relay/daemon": "2.0.9",
114
- "@agent-relay/hooks": "2.0.9",
115
- "@agent-relay/protocol": "2.0.9",
116
- "@agent-relay/resiliency": "2.0.9",
117
- "@agent-relay/sdk": "2.0.9",
118
- "@agent-relay/storage": "2.0.9",
119
- "@agent-relay/telemetry": "2.0.9",
120
- "@agent-relay/trajectory": "2.0.9",
121
- "@agent-relay/user-directory": "2.0.9",
122
- "@agent-relay/utils": "2.0.9",
123
- "@agent-relay/wrapper": "2.0.9",
110
+ "@agent-relay/bridge": "2.0.11",
111
+ "@agent-relay/config": "2.0.11",
112
+ "@agent-relay/continuity": "2.0.11",
113
+ "@agent-relay/daemon": "2.0.11",
114
+ "@agent-relay/hooks": "2.0.11",
115
+ "@agent-relay/protocol": "2.0.11",
116
+ "@agent-relay/resiliency": "2.0.11",
117
+ "@agent-relay/sdk": "2.0.11",
118
+ "@agent-relay/storage": "2.0.11",
119
+ "@agent-relay/telemetry": "2.0.11",
120
+ "@agent-relay/trajectory": "2.0.11",
121
+ "@agent-relay/user-directory": "2.0.11",
122
+ "@agent-relay/utils": "2.0.11",
123
+ "@agent-relay/wrapper": "2.0.11",
124
124
  "@nangohq/node": "^0.69.20",
125
125
  "@types/jsonwebtoken": "^9.0.10",
126
126
  "agent-trajectories": "^0.2.3",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-relay/api-types",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Shared API types and Zod schemas for Agent Relay",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -187,24 +187,67 @@ function getRelayInstructions(agentName, options = {}) {
187
187
  * 1. bin/relay-pty in package root (installed by postinstall)
188
188
  * 2. relay-pty/target/release/relay-pty (local Rust build)
189
189
  * 3. /usr/local/bin/relay-pty (global install)
190
+ * 4. In node_modules when installed as dependency
191
+ * 5. Global npm installs (nvm) - both scoped and root packages
190
192
  */
191
193
  function findRelayPtyBinary() {
192
- // Get the project root (three levels up from packages/bridge/dist/)
193
- // packages/bridge/dist/ -> packages/bridge -> packages -> project root
194
- const projectRoot = path.join(__dirname, '..', '..', '..');
194
+ // Determine the agent-relay package root
195
+ // This code runs from either:
196
+ // - packages/bridge/dist/ (development/workspace)
197
+ // - node_modules/@agent-relay/bridge/dist/ (npm install)
198
+ //
199
+ // We need to find the agent-relay package root where bin/relay-pty lives
200
+ let packageRoot;
201
+ // Check if we're inside node_modules/@agent-relay/bridge/
202
+ if (__dirname.includes('node_modules/@agent-relay/bridge')) {
203
+ // Go from node_modules/@agent-relay/bridge/dist/ to agent-relay/
204
+ // dist/ -> bridge/ -> @agent-relay/ -> node_modules/ -> agent-relay/
205
+ packageRoot = path.join(__dirname, '..', '..', '..', '..');
206
+ }
207
+ else if (__dirname.includes('node_modules/agent-relay')) {
208
+ // Direct dependency: node_modules/agent-relay/packages/bridge/dist/
209
+ // dist/ -> bridge/ -> packages/ -> agent-relay/
210
+ packageRoot = path.join(__dirname, '..', '..', '..');
211
+ }
212
+ else {
213
+ // Development: packages/bridge/dist/ -> packages/ -> project root
214
+ packageRoot = path.join(__dirname, '..', '..', '..');
215
+ }
216
+ // Find the node_modules root for global installs
217
+ // When running from node_modules/@agent-relay/dashboard/node_modules/@agent-relay/bridge/dist/
218
+ // we need to look for agent-relay at node_modules/agent-relay
219
+ let nodeModulesRoot = null;
220
+ const nodeModulesMatch = __dirname.match(/^(.+?\/node_modules)\/@agent-relay\//);
221
+ if (nodeModulesMatch) {
222
+ nodeModulesRoot = nodeModulesMatch[1];
223
+ }
195
224
  const candidates = [
196
225
  // Primary: installed by postinstall from platform-specific binary
197
- path.join(projectRoot, 'bin', 'relay-pty'),
226
+ path.join(packageRoot, 'bin', 'relay-pty'),
198
227
  // Development: local Rust build
199
- path.join(projectRoot, 'relay-pty', 'target', 'release', 'relay-pty'),
200
- path.join(projectRoot, 'relay-pty', 'target', 'debug', 'relay-pty'),
228
+ path.join(packageRoot, 'relay-pty', 'target', 'release', 'relay-pty'),
229
+ path.join(packageRoot, 'relay-pty', 'target', 'debug', 'relay-pty'),
201
230
  // Local build in cwd (for development)
202
231
  path.join(process.cwd(), 'relay-pty', 'target', 'release', 'relay-pty'),
203
232
  // Installed globally
204
233
  '/usr/local/bin/relay-pty',
205
- // In node_modules (when installed as dependency)
234
+ // In node_modules (when installed as local dependency)
206
235
  path.join(process.cwd(), 'node_modules', 'agent-relay', 'bin', 'relay-pty'),
236
+ // Global npm install (nvm) - root package
237
+ path.join(process.env.HOME || '', '.nvm', 'versions', 'node', process.version, 'lib', 'node_modules', 'agent-relay', 'bin', 'relay-pty'),
207
238
  ];
239
+ // Add candidate for root agent-relay package when running from scoped @agent-relay/* packages
240
+ if (nodeModulesRoot) {
241
+ candidates.push(path.join(nodeModulesRoot, 'agent-relay', 'bin', 'relay-pty'));
242
+ }
243
+ // Try common global npm paths
244
+ if (process.env.HOME) {
245
+ // Homebrew npm (macOS)
246
+ candidates.push(path.join('/usr/local/lib/node_modules', 'agent-relay', 'bin', 'relay-pty'));
247
+ candidates.push(path.join('/opt/homebrew/lib/node_modules', 'agent-relay', 'bin', 'relay-pty'));
248
+ // pnpm global
249
+ candidates.push(path.join(process.env.HOME, '.local', 'share', 'pnpm', 'global', 'node_modules', 'agent-relay', 'bin', 'relay-pty'));
250
+ }
208
251
  for (const candidate of candidates) {
209
252
  if (fs.existsSync(candidate)) {
210
253
  return candidate;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-relay/bridge",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Multi-project bridge client utilities for Relay",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,12 +22,12 @@
22
22
  "test:watch": "vitest"
23
23
  },
24
24
  "dependencies": {
25
- "@agent-relay/protocol": "2.0.9",
26
- "@agent-relay/config": "2.0.9",
27
- "@agent-relay/utils": "2.0.9",
28
- "@agent-relay/policy": "2.0.9",
29
- "@agent-relay/user-directory": "2.0.9",
30
- "@agent-relay/wrapper": "2.0.9"
25
+ "@agent-relay/protocol": "2.0.11",
26
+ "@agent-relay/config": "2.0.11",
27
+ "@agent-relay/utils": "2.0.11",
28
+ "@agent-relay/policy": "2.0.11",
29
+ "@agent-relay/user-directory": "2.0.11",
30
+ "@agent-relay/wrapper": "2.0.11"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^22.19.3",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-relay/cloud",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Cloud API server and services for Agent Relay",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -38,11 +38,11 @@
38
38
  "test:watch": "vitest"
39
39
  },
40
40
  "dependencies": {
41
- "@agent-relay/wrapper": "2.0.9",
42
- "@agent-relay/config": "2.0.9",
43
- "@agent-relay/resiliency": "2.0.9",
44
- "@agent-relay/storage": "2.0.9",
45
- "@agent-relay/protocol": "2.0.9"
41
+ "@agent-relay/wrapper": "2.0.11",
42
+ "@agent-relay/config": "2.0.11",
43
+ "@agent-relay/resiliency": "2.0.11",
44
+ "@agent-relay/storage": "2.0.11",
45
+ "@agent-relay/protocol": "2.0.11"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "^22.19.3",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-relay/config",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Shared configuration schemas and loaders for Agent Relay",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -83,7 +83,7 @@
83
83
  "test:watch": "vitest"
84
84
  },
85
85
  "dependencies": {
86
- "@agent-relay/protocol": "2.0.9",
86
+ "@agent-relay/protocol": "2.0.11",
87
87
  "zod": "^3.23.8",
88
88
  "zod-to-json-schema": "^3.23.1"
89
89
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-relay/continuity",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Session continuity manager for Relay (ledgers, handoffs, resume)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -25,6 +25,33 @@ export interface CloudSyncConfig {
25
25
  syncQueue?: Partial<SyncQueueConfig>;
26
26
  /** Project directory for git remote detection (defaults to cwd) */
27
27
  projectDirectory?: string;
28
+ /** Enable agent metrics sync to cloud (default: true if connected) */
29
+ metricsSyncEnabled?: boolean;
30
+ }
31
+ /**
32
+ * Agent metrics data for cloud sync
33
+ */
34
+ export interface AgentMetricsPayload {
35
+ name: string;
36
+ pid?: number;
37
+ status: string;
38
+ rssBytes?: number;
39
+ heapUsedBytes?: number;
40
+ heapTotalBytes?: number;
41
+ cpuPercent?: number;
42
+ trend?: string;
43
+ trendRatePerMinute?: number;
44
+ alertLevel?: string;
45
+ highWatermark?: number;
46
+ averageRss?: number;
47
+ uptimeMs?: number;
48
+ startedAt?: Date;
49
+ }
50
+ /**
51
+ * Provider interface for getting agent metrics
52
+ */
53
+ export interface AgentMetricsProvider {
54
+ getAll(): AgentMetricsPayload[];
28
55
  }
29
56
  export interface RemoteAgent {
30
57
  name: string;
@@ -58,6 +85,7 @@ export declare class CloudSyncService extends EventEmitter {
58
85
  private projectDirectory;
59
86
  private repoFullName;
60
87
  private syncQueue;
88
+ private metricsProvider;
61
89
  constructor(config?: Partial<CloudSyncConfig>);
62
90
  /**
63
91
  * Get or create a persistent machine ID
@@ -121,6 +149,39 @@ export declare class CloudSyncService extends EventEmitter {
121
149
  * Set the storage adapter for message sync
122
150
  */
123
151
  setStorage(storage: StorageAdapter): void;
152
+ /**
153
+ * Set the metrics provider for agent metrics sync
154
+ */
155
+ setMetricsProvider(provider: AgentMetricsProvider): void;
156
+ /**
157
+ * Push agent metrics to cloud monitoring API.
158
+ * Called during heartbeat if a metrics provider is configured.
159
+ */
160
+ pushAgentMetrics(): Promise<{
161
+ recorded: number;
162
+ } | null>;
163
+ /**
164
+ * Create a new agent session in cloud.
165
+ * Returns the session ID for tracking summaries and end markers.
166
+ */
167
+ createSession(agentName: string, workspaceId?: string): Promise<string | null>;
168
+ /**
169
+ * Add a summary to an existing session.
170
+ */
171
+ addSummary(sessionId: string, agentName: string, summary: {
172
+ currentTask?: string;
173
+ completedTasks?: string[];
174
+ decisions?: string[];
175
+ context?: string;
176
+ files?: string[];
177
+ }): Promise<string | null>;
178
+ /**
179
+ * End a session with an optional end marker.
180
+ */
181
+ endSession(sessionId: string, endMarker?: {
182
+ summary?: string;
183
+ completedTasks?: string[];
184
+ }): Promise<boolean>;
124
185
  /**
125
186
  * Queue a single message for sync to cloud.
126
187
  * Use this for real-time sync as messages are created.
@@ -147,4 +208,44 @@ export declare class CloudSyncService extends EventEmitter {
147
208
  }>;
148
209
  }
149
210
  export declare function getCloudSync(config?: Partial<CloudSyncConfig>): CloudSyncService;
211
+ /**
212
+ * Summary event from wrapper
213
+ */
214
+ export interface SummaryEvent {
215
+ agentName: string;
216
+ summary: {
217
+ currentTask?: string;
218
+ completedTasks?: string[];
219
+ decisions?: string[];
220
+ context?: string;
221
+ files?: string[];
222
+ };
223
+ }
224
+ /**
225
+ * Session end event from wrapper
226
+ */
227
+ export interface SessionEndEvent {
228
+ agentName: string;
229
+ marker: {
230
+ summary?: string;
231
+ completedTasks?: string[];
232
+ };
233
+ }
234
+ /**
235
+ * Cloud persistence handler interface (matches @agent-relay/bridge)
236
+ */
237
+ export interface CloudPersistenceHandler {
238
+ onSummary: (agentName: string, event: SummaryEvent) => Promise<void>;
239
+ onSessionEnd: (agentName: string, event: SessionEndEvent) => Promise<void>;
240
+ destroy?: () => void;
241
+ }
242
+ /**
243
+ * Create a cloud persistence handler that uses CloudSyncService.
244
+ * Tracks session IDs per agent and creates sessions lazily on first summary.
245
+ *
246
+ * @param cloudSync The CloudSyncService instance to use
247
+ * @param workspaceId Optional workspace ID for session scoping
248
+ * @returns CloudPersistenceHandler for use with AgentSpawner
249
+ */
250
+ export declare function createCloudPersistenceHandler(cloudSync: CloudSyncService, workspaceId?: string): CloudPersistenceHandler;
150
251
  //# sourceMappingURL=cloud-sync.d.ts.map
@@ -32,6 +32,8 @@ export class CloudSyncService extends EventEmitter {
32
32
  repoFullName = null;
33
33
  // Optimized sync queue
34
34
  syncQueue = null;
35
+ // Agent metrics provider (e.g., AgentMemoryMonitor)
36
+ metricsProvider = null;
35
37
  constructor(config = {}) {
36
38
  super();
37
39
  this.config = {
@@ -212,11 +214,12 @@ export class CloudSyncService extends EventEmitter {
212
214
  this.emit('command', cmd);
213
215
  }
214
216
  }
215
- // Fetch messages, sync agents, and sync local messages to cloud
217
+ // Fetch messages, sync agents, sync local messages, and push metrics to cloud
216
218
  await Promise.all([
217
219
  this.fetchMessages(),
218
220
  this.syncAgents(),
219
221
  this.syncMessagesToCloud(),
222
+ this.pushAgentMetrics(),
220
223
  ]);
221
224
  }
222
225
  catch (error) {
@@ -331,6 +334,165 @@ export class CloudSyncService extends EventEmitter {
331
334
  this.storage = storage;
332
335
  log.info('Storage adapter configured for message sync');
333
336
  }
337
+ /**
338
+ * Set the metrics provider for agent metrics sync
339
+ */
340
+ setMetricsProvider(provider) {
341
+ this.metricsProvider = provider;
342
+ log.info('Metrics provider configured for agent metrics sync');
343
+ }
344
+ /**
345
+ * Push agent metrics to cloud monitoring API.
346
+ * Called during heartbeat if a metrics provider is configured.
347
+ */
348
+ async pushAgentMetrics() {
349
+ if (!this.connected || this.config.metricsSyncEnabled === false) {
350
+ return null;
351
+ }
352
+ if (!this.metricsProvider) {
353
+ return null;
354
+ }
355
+ try {
356
+ const agents = this.metricsProvider.getAll();
357
+ if (agents.length === 0) {
358
+ return { recorded: 0 };
359
+ }
360
+ // Transform to API format
361
+ const payload = agents.map(agent => ({
362
+ name: agent.name,
363
+ pid: agent.pid,
364
+ status: agent.status,
365
+ rssBytes: agent.rssBytes,
366
+ heapUsedBytes: agent.heapUsedBytes,
367
+ heapTotalBytes: agent.heapTotalBytes,
368
+ cpuPercent: agent.cpuPercent,
369
+ trend: agent.trend,
370
+ trendRatePerMinute: agent.trendRatePerMinute,
371
+ alertLevel: agent.alertLevel,
372
+ highWatermark: agent.highWatermark,
373
+ averageRss: agent.averageRss,
374
+ uptimeMs: agent.uptimeMs,
375
+ startedAt: agent.startedAt?.toISOString(),
376
+ }));
377
+ const response = await fetch(`${this.config.cloudUrl}/api/monitoring/metrics`, {
378
+ method: 'POST',
379
+ headers: {
380
+ Authorization: `Bearer ${this.config.apiKey}`,
381
+ 'Content-Type': 'application/json',
382
+ },
383
+ body: JSON.stringify({ agents: payload }),
384
+ });
385
+ if (!response.ok) {
386
+ throw new Error(`Metrics push failed: ${response.status}`);
387
+ }
388
+ const result = await response.json();
389
+ if (result.recorded > 0) {
390
+ log.info(`Pushed ${result.recorded} agent metrics to cloud`);
391
+ }
392
+ return { recorded: result.recorded };
393
+ }
394
+ catch (error) {
395
+ log.error('Failed to push agent metrics', { error: String(error) });
396
+ return null;
397
+ }
398
+ }
399
+ // ============================================================================
400
+ // Session Persistence API (for linked daemons)
401
+ // ============================================================================
402
+ /**
403
+ * Create a new agent session in cloud.
404
+ * Returns the session ID for tracking summaries and end markers.
405
+ */
406
+ async createSession(agentName, workspaceId) {
407
+ if (!this.connected) {
408
+ return null;
409
+ }
410
+ try {
411
+ const response = await fetch(`${this.config.cloudUrl}/api/monitoring/session/create`, {
412
+ method: 'POST',
413
+ headers: {
414
+ Authorization: `Bearer ${this.config.apiKey}`,
415
+ 'Content-Type': 'application/json',
416
+ },
417
+ body: JSON.stringify({
418
+ agentName,
419
+ workspaceId,
420
+ }),
421
+ });
422
+ if (!response.ok) {
423
+ throw new Error(`Session create failed: ${response.status}`);
424
+ }
425
+ const result = await response.json();
426
+ log.info(`Created session ${result.sessionId.substring(0, 8)} for ${agentName}`);
427
+ return result.sessionId;
428
+ }
429
+ catch (error) {
430
+ log.error('Failed to create session', { agentName, error: String(error) });
431
+ return null;
432
+ }
433
+ }
434
+ /**
435
+ * Add a summary to an existing session.
436
+ */
437
+ async addSummary(sessionId, agentName, summary) {
438
+ if (!this.connected) {
439
+ return null;
440
+ }
441
+ try {
442
+ const response = await fetch(`${this.config.cloudUrl}/api/monitoring/session/summary`, {
443
+ method: 'POST',
444
+ headers: {
445
+ Authorization: `Bearer ${this.config.apiKey}`,
446
+ 'Content-Type': 'application/json',
447
+ },
448
+ body: JSON.stringify({
449
+ sessionId,
450
+ agentName,
451
+ summary,
452
+ }),
453
+ });
454
+ if (!response.ok) {
455
+ throw new Error(`Summary add failed: ${response.status}`);
456
+ }
457
+ const result = await response.json();
458
+ log.info(`Added summary for ${agentName}: ${summary.currentTask || 'no task'}`);
459
+ return result.summaryId;
460
+ }
461
+ catch (error) {
462
+ log.error('Failed to add summary', { sessionId, agentName, error: String(error) });
463
+ return null;
464
+ }
465
+ }
466
+ /**
467
+ * End a session with an optional end marker.
468
+ */
469
+ async endSession(sessionId, endMarker) {
470
+ if (!this.connected) {
471
+ return false;
472
+ }
473
+ try {
474
+ const response = await fetch(`${this.config.cloudUrl}/api/monitoring/session/end`, {
475
+ method: 'POST',
476
+ headers: {
477
+ Authorization: `Bearer ${this.config.apiKey}`,
478
+ 'Content-Type': 'application/json',
479
+ },
480
+ body: JSON.stringify({
481
+ sessionId,
482
+ endMarker,
483
+ }),
484
+ });
485
+ if (!response.ok) {
486
+ throw new Error(`Session end failed: ${response.status}`);
487
+ }
488
+ log.info(`Ended session ${sessionId.substring(0, 8)}: ${endMarker?.summary || 'no summary'}`);
489
+ return true;
490
+ }
491
+ catch (error) {
492
+ log.error('Failed to end session', { sessionId, error: String(error) });
493
+ return false;
494
+ }
495
+ }
334
496
  /**
335
497
  * Queue a single message for sync to cloud.
336
498
  * Use this for real-time sync as messages are created.
@@ -443,4 +605,50 @@ export function getCloudSync(config) {
443
605
  }
444
606
  return _cloudSync;
445
607
  }
608
+ /**
609
+ * Create a cloud persistence handler that uses CloudSyncService.
610
+ * Tracks session IDs per agent and creates sessions lazily on first summary.
611
+ *
612
+ * @param cloudSync The CloudSyncService instance to use
613
+ * @param workspaceId Optional workspace ID for session scoping
614
+ * @returns CloudPersistenceHandler for use with AgentSpawner
615
+ */
616
+ export function createCloudPersistenceHandler(cloudSync, workspaceId) {
617
+ // Track session IDs per agent name
618
+ const agentSessions = new Map();
619
+ return {
620
+ async onSummary(agentName, event) {
621
+ // Get or create session for this agent
622
+ let sessionId = agentSessions.get(agentName);
623
+ if (!sessionId) {
624
+ // Create session on first summary
625
+ const newSessionId = await cloudSync.createSession(agentName, workspaceId);
626
+ if (newSessionId) {
627
+ sessionId = newSessionId;
628
+ agentSessions.set(agentName, sessionId);
629
+ }
630
+ else {
631
+ log.warn(`Failed to create session for ${agentName}, skipping summary`);
632
+ return;
633
+ }
634
+ }
635
+ // Add summary to session
636
+ await cloudSync.addSummary(sessionId, agentName, event.summary);
637
+ },
638
+ async onSessionEnd(agentName, event) {
639
+ const sessionId = agentSessions.get(agentName);
640
+ if (sessionId) {
641
+ // End the session
642
+ await cloudSync.endSession(sessionId, event.marker);
643
+ agentSessions.delete(agentName);
644
+ }
645
+ else {
646
+ log.warn(`No session found for ${agentName} on session-end`);
647
+ }
648
+ },
649
+ destroy() {
650
+ agentSessions.clear();
651
+ },
652
+ };
653
+ }
446
654
  //# sourceMappingURL=cloud-sync.js.map