@synap-core/cli 1.7.0 → 1.10.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.
Files changed (371) hide show
  1. package/dist/commands/agent-chat.d.ts +47 -0
  2. package/dist/commands/agent-chat.js +250 -0
  3. package/dist/commands/agent-chat.js.map +1 -0
  4. package/dist/commands/agent-run.d.ts +47 -0
  5. package/dist/commands/agent-run.js +301 -0
  6. package/dist/commands/agent-run.js.map +1 -0
  7. package/dist/commands/agents.js +85 -46
  8. package/dist/commands/agents.js.map +1 -1
  9. package/dist/commands/artifact.d.ts +26 -0
  10. package/dist/commands/artifact.js +76 -0
  11. package/dist/commands/artifact.js.map +1 -0
  12. package/dist/commands/automation.d.ts +47 -0
  13. package/dist/commands/automation.js +601 -0
  14. package/dist/commands/automation.js.map +1 -0
  15. package/dist/commands/bridge-setup.d.ts +66 -0
  16. package/dist/commands/bridge-setup.js +1112 -0
  17. package/dist/commands/bridge-setup.js.map +1 -0
  18. package/dist/commands/cap-connections.d.ts +28 -0
  19. package/dist/commands/cap-connections.js +224 -0
  20. package/dist/commands/cap-connections.js.map +1 -0
  21. package/dist/commands/capability.d.ts +89 -0
  22. package/dist/commands/capability.js +1523 -0
  23. package/dist/commands/capability.js.map +1 -0
  24. package/dist/commands/cell.d.ts +55 -0
  25. package/dist/commands/cell.js +277 -0
  26. package/dist/commands/cell.js.map +1 -0
  27. package/dist/commands/centrality.d.ts +20 -0
  28. package/dist/commands/centrality.js +94 -0
  29. package/dist/commands/centrality.js.map +1 -0
  30. package/dist/commands/connect.d.ts +2 -0
  31. package/dist/commands/connect.js +25 -10
  32. package/dist/commands/connect.js.map +1 -1
  33. package/dist/commands/connections.js +0 -16
  34. package/dist/commands/connections.js.map +1 -1
  35. package/dist/commands/context.d.ts +22 -0
  36. package/dist/commands/context.js +149 -0
  37. package/dist/commands/context.js.map +1 -0
  38. package/dist/commands/data-extra.d.ts +14 -0
  39. package/dist/commands/data-extra.js +185 -0
  40. package/dist/commands/data-extra.js.map +1 -0
  41. package/dist/commands/data.d.ts +14 -10
  42. package/dist/commands/data.js +353 -192
  43. package/dist/commands/data.js.map +1 -1
  44. package/dist/commands/diagnose.d.ts +20 -0
  45. package/dist/commands/diagnose.js +143 -0
  46. package/dist/commands/diagnose.js.map +1 -0
  47. package/dist/commands/digest.d.ts +17 -0
  48. package/dist/commands/digest.js +121 -0
  49. package/dist/commands/digest.js.map +1 -0
  50. package/dist/commands/discover.d.ts +2 -0
  51. package/dist/commands/discover.js +25 -8
  52. package/dist/commands/discover.js.map +1 -1
  53. package/dist/commands/doc.d.ts +39 -0
  54. package/dist/commands/doc.js +130 -0
  55. package/dist/commands/doc.js.map +1 -0
  56. package/dist/commands/events.d.ts +26 -0
  57. package/dist/commands/events.js +69 -0
  58. package/dist/commands/events.js.map +1 -0
  59. package/dist/commands/explain.d.ts +21 -0
  60. package/dist/commands/explain.js +251 -0
  61. package/dist/commands/explain.js.map +1 -0
  62. package/dist/commands/facet.d.ts +29 -0
  63. package/dist/commands/facet.js +113 -0
  64. package/dist/commands/facet.js.map +1 -0
  65. package/dist/commands/graph.d.ts +18 -0
  66. package/dist/commands/graph.js +74 -0
  67. package/dist/commands/graph.js.map +1 -0
  68. package/dist/commands/home.d.ts +12 -0
  69. package/dist/commands/home.js +54 -0
  70. package/dist/commands/home.js.map +1 -0
  71. package/dist/commands/import.d.ts +38 -0
  72. package/dist/commands/import.js +440 -0
  73. package/dist/commands/import.js.map +1 -0
  74. package/dist/commands/init.d.ts +0 -2
  75. package/dist/commands/init.js +97 -118
  76. package/dist/commands/init.js.map +1 -1
  77. package/dist/commands/keys.d.ts +9 -0
  78. package/dist/commands/keys.js +78 -0
  79. package/dist/commands/keys.js.map +1 -0
  80. package/dist/commands/knowledge.d.ts +34 -18
  81. package/dist/commands/knowledge.js +355 -57
  82. package/dist/commands/knowledge.js.map +1 -1
  83. package/dist/commands/launch.d.ts +50 -0
  84. package/dist/commands/launch.js +790 -0
  85. package/dist/commands/launch.js.map +1 -0
  86. package/dist/commands/lens.d.ts +45 -0
  87. package/dist/commands/lens.js +386 -0
  88. package/dist/commands/lens.js.map +1 -0
  89. package/dist/commands/market.d.ts +209 -0
  90. package/dist/commands/market.js +1368 -0
  91. package/dist/commands/market.js.map +1 -0
  92. package/dist/commands/mcp.d.ts +42 -0
  93. package/dist/commands/mcp.js +184 -0
  94. package/dist/commands/mcp.js.map +1 -0
  95. package/dist/commands/observe.d.ts +9 -0
  96. package/dist/commands/observe.js +93 -0
  97. package/dist/commands/observe.js.map +1 -0
  98. package/dist/commands/open.d.ts +32 -0
  99. package/dist/commands/open.js +85 -0
  100. package/dist/commands/open.js.map +1 -0
  101. package/dist/commands/pod.d.ts +100 -0
  102. package/dist/commands/pod.js +359 -0
  103. package/dist/commands/pod.js.map +1 -0
  104. package/dist/commands/pods.d.ts +6 -0
  105. package/dist/commands/pods.js +160 -50
  106. package/dist/commands/pods.js.map +1 -1
  107. package/dist/commands/proposals-actions.d.ts +7 -0
  108. package/dist/commands/proposals-actions.js +77 -0
  109. package/dist/commands/proposals-actions.js.map +1 -0
  110. package/dist/commands/providers.d.ts +38 -0
  111. package/dist/commands/providers.js +170 -0
  112. package/dist/commands/providers.js.map +1 -0
  113. package/dist/commands/purge.d.ts +23 -0
  114. package/dist/commands/purge.js +148 -0
  115. package/dist/commands/purge.js.map +1 -0
  116. package/dist/commands/raycast.d.ts +15 -0
  117. package/dist/commands/raycast.js +153 -0
  118. package/dist/commands/raycast.js.map +1 -0
  119. package/dist/commands/sessions.d.ts +31 -0
  120. package/dist/commands/sessions.js +248 -0
  121. package/dist/commands/sessions.js.map +1 -0
  122. package/dist/commands/skill-manage.d.ts +21 -0
  123. package/dist/commands/skill-manage.js +195 -0
  124. package/dist/commands/skill-manage.js.map +1 -0
  125. package/dist/commands/skills-commands.d.ts +26 -0
  126. package/dist/commands/skills-commands.js +187 -0
  127. package/dist/commands/skills-commands.js.map +1 -0
  128. package/dist/commands/skills.d.ts +26 -0
  129. package/dist/commands/skills.js +196 -0
  130. package/dist/commands/skills.js.map +1 -0
  131. package/dist/commands/status.d.ts +3 -1
  132. package/dist/commands/status.js +231 -41
  133. package/dist/commands/status.js.map +1 -1
  134. package/dist/commands/statusline.d.ts +24 -0
  135. package/dist/commands/statusline.js +450 -0
  136. package/dist/commands/statusline.js.map +1 -0
  137. package/dist/commands/subscribe.d.ts +19 -0
  138. package/dist/commands/subscribe.js +91 -0
  139. package/dist/commands/subscribe.js.map +1 -0
  140. package/dist/commands/tools.d.ts +30 -0
  141. package/dist/commands/tools.js +315 -0
  142. package/dist/commands/tools.js.map +1 -0
  143. package/dist/commands/versions.d.ts +27 -0
  144. package/dist/commands/versions.js +277 -0
  145. package/dist/commands/versions.js.map +1 -0
  146. package/dist/commands/view.d.ts +57 -0
  147. package/dist/commands/view.js +195 -0
  148. package/dist/commands/view.js.map +1 -0
  149. package/dist/commands/whoami.d.ts +21 -0
  150. package/dist/commands/whoami.js +129 -0
  151. package/dist/commands/whoami.js.map +1 -0
  152. package/dist/index.d.ts +3 -4
  153. package/dist/index.js +1524 -202
  154. package/dist/index.js.map +1 -1
  155. package/dist/lib/agent-templates.d.ts +25 -0
  156. package/dist/lib/agent-templates.js +148 -0
  157. package/dist/lib/agent-templates.js.map +1 -0
  158. package/dist/lib/agents-config.d.ts +4 -1
  159. package/dist/lib/agents-config.js +19 -2
  160. package/dist/lib/agents-config.js.map +1 -1
  161. package/dist/lib/approval-poll.d.ts +42 -0
  162. package/dist/lib/approval-poll.js +52 -0
  163. package/dist/lib/approval-poll.js.map +1 -0
  164. package/dist/lib/auth.d.ts +29 -6
  165. package/dist/lib/auth.js +105 -94
  166. package/dist/lib/auth.js.map +1 -1
  167. package/dist/lib/bundle-version.d.ts +11 -0
  168. package/dist/lib/bundle-version.js +33 -0
  169. package/dist/lib/bundle-version.js.map +1 -0
  170. package/dist/lib/capture-lane.d.ts +67 -0
  171. package/dist/lib/capture-lane.js +136 -0
  172. package/dist/lib/capture-lane.js.map +1 -0
  173. package/dist/lib/cp-packages.d.ts +121 -0
  174. package/dist/lib/cp-packages.js +218 -0
  175. package/dist/lib/cp-packages.js.map +1 -0
  176. package/dist/lib/describe-lens.d.ts +46 -0
  177. package/dist/lib/describe-lens.js +33 -0
  178. package/dist/lib/describe-lens.js.map +1 -0
  179. package/dist/lib/hub-client.d.ts +84 -1
  180. package/dist/lib/hub-client.js +502 -22
  181. package/dist/lib/hub-client.js.map +1 -1
  182. package/dist/lib/installed.d.ts +51 -0
  183. package/dist/lib/installed.js +70 -0
  184. package/dist/lib/installed.js.map +1 -0
  185. package/dist/lib/next-steps.d.ts +61 -0
  186. package/dist/lib/next-steps.js +146 -0
  187. package/dist/lib/next-steps.js.map +1 -0
  188. package/dist/lib/pod.d.ts +104 -19
  189. package/dist/lib/pod.js +245 -57
  190. package/dist/lib/pod.js.map +1 -1
  191. package/dist/lib/project-ref.d.ts +95 -0
  192. package/dist/lib/project-ref.js +144 -0
  193. package/dist/lib/project-ref.js.map +1 -0
  194. package/dist/lib/project.d.ts +35 -0
  195. package/dist/lib/project.js +39 -0
  196. package/dist/lib/project.js.map +1 -0
  197. package/dist/lib/session-lens.d.ts +33 -0
  198. package/dist/lib/session-lens.js +76 -0
  199. package/dist/lib/session-lens.js.map +1 -0
  200. package/dist/lib/skill-import.d.ts +40 -0
  201. package/dist/lib/skill-import.js +203 -0
  202. package/dist/lib/skill-import.js.map +1 -0
  203. package/dist/lib/skills-installer.d.ts +16 -5
  204. package/dist/lib/skills-installer.js +132 -18
  205. package/dist/lib/skills-installer.js.map +1 -1
  206. package/dist/lib/suite.d.ts +28 -0
  207. package/dist/lib/suite.js +29 -0
  208. package/dist/lib/suite.js.map +1 -0
  209. package/dist/lib/superwhisper-import.d.ts +40 -0
  210. package/dist/lib/superwhisper-import.js +389 -0
  211. package/dist/lib/superwhisper-import.js.map +1 -0
  212. package/dist/lib/targets.d.ts +66 -2
  213. package/dist/lib/targets.js +914 -132
  214. package/dist/lib/targets.js.map +1 -1
  215. package/dist/lib/unwrapList.d.ts +1 -0
  216. package/dist/lib/unwrapList.js +20 -0
  217. package/dist/lib/unwrapList.js.map +1 -0
  218. package/dist/utils/logger.d.ts +2 -0
  219. package/dist/utils/logger.js +10 -2
  220. package/dist/utils/logger.js.map +1 -1
  221. package/package.json +10 -4
  222. package/skills/agent-os/SKILL.md +212 -0
  223. package/skills/manifest.json +5 -0
  224. package/skills/onboard/SKILL.md +186 -0
  225. package/skills/synap/SKILL.md +1524 -104
  226. package/skills/synap/_order.txt +37 -0
  227. package/skills/synap/_skill.yaml +24 -0
  228. package/skills/synap/authentication.md +10 -0
  229. package/skills/synap/automations.md +264 -0
  230. package/skills/synap/capabilities.md +107 -0
  231. package/skills/synap/capture.md +10 -0
  232. package/skills/synap/cli-operations.md +107 -0
  233. package/skills/synap/common-mistakes.md +12 -0
  234. package/skills/synap/creative-loop.md +43 -0
  235. package/skills/synap/crm.md +117 -0
  236. package/skills/synap/diagnostics.md +35 -0
  237. package/skills/synap/digesting-a-channel.md +38 -0
  238. package/skills/synap/document-embeds.md +123 -0
  239. package/skills/synap/escalation-ladder.md +71 -0
  240. package/skills/synap/focus-sessions.md +47 -0
  241. package/skills/synap/governance-rules.md +64 -0
  242. package/skills/synap/governance.md +6 -6
  243. package/skills/synap/graph-gardening.md +21 -0
  244. package/skills/synap/inline-patterns.md +38 -0
  245. package/skills/synap/lenses.md +38 -0
  246. package/skills/synap/linking-principle.md +39 -0
  247. package/skills/synap/linking.md +1 -0
  248. package/skills/synap/mental-model.md +45 -0
  249. package/skills/synap/more.md +7 -0
  250. package/skills/synap/multi-entity-capture.md +10 -0
  251. package/skills/synap/next-action.md +37 -0
  252. package/skills/synap/north-star.md +17 -0
  253. package/skills/synap/operating-mode-rules.md +45 -0
  254. package/skills/synap/operating-mode.md +9 -0
  255. package/skills/synap/quick-reference.md +67 -0
  256. package/skills/synap/reading.md +43 -0
  257. package/skills/synap/recap.md +21 -0
  258. package/skills/synap/reflexes.md +46 -0
  259. package/skills/synap/response-style.md +21 -0
  260. package/skills/synap/scope.md +13 -0
  261. package/skills/synap/showing.md +17 -0
  262. package/skills/synap/user-model.md +25 -0
  263. package/skills/synap/viewframe-cells.md +290 -0
  264. package/skills/synap/work-flow.md +113 -0
  265. package/skills/synap/worked-examples.md +53 -0
  266. package/skills/synap/workspace-design.md +45 -0
  267. package/skills/synap/workspace-edges.md +49 -0
  268. package/skills/synap/writes.md +156 -0
  269. package/skills/synap-schema/SKILL.md +97 -6
  270. package/skills/synap-schema/_order.txt +13 -0
  271. package/skills/synap-schema/_skill.yaml +22 -0
  272. package/skills/synap-schema/before-you-touch.md +14 -0
  273. package/skills/synap-schema/common-mistakes.md +9 -0
  274. package/skills/synap-schema/creating-profiles.md +17 -0
  275. package/skills/synap-schema/discover-profiles.md +24 -0
  276. package/skills/synap-schema/entity-scope.md +8 -0
  277. package/skills/synap-schema/extend-vs-create.md +31 -0
  278. package/skills/synap-schema/more.md +6 -0
  279. package/skills/synap-schema/overlay-properties.md +22 -0
  280. package/skills/synap-schema/profiles.md +3 -0
  281. package/skills/synap-schema/property-defs.md +29 -0
  282. package/skills/synap-schema/read-before-write.md +50 -0
  283. package/skills/synap-schema/relations.md +18 -0
  284. package/skills/synap-schema/worked-example.md +30 -0
  285. package/skills/synap-ui/SKILL.md +38 -11
  286. package/skills/synap-ui/_order.txt +13 -0
  287. package/skills/synap-ui/_skill.yaml +23 -0
  288. package/skills/synap-ui/ai-companion.md +27 -0
  289. package/skills/synap-ui/arranging-bento.md +8 -0
  290. package/skills/synap-ui/before-you-build.md +20 -0
  291. package/skills/synap-ui/bento-layouts.md +35 -0
  292. package/skills/synap-ui/common-mistakes.md +10 -0
  293. package/skills/synap-ui/creating-views.md +26 -0
  294. package/skills/synap-ui/four-builds.md +24 -0
  295. package/skills/synap-ui/more.md +7 -0
  296. package/skills/synap-ui/proposing-vs-extending.md +11 -0
  297. package/skills/synap-ui/view-list.md +24 -0
  298. package/skills/synap-ui/views.md +3 -0
  299. package/skills/synap-ui/worked-example.md +18 -0
  300. package/skills/synap-ui/workspaces.md +47 -0
  301. package/templates/automations/bookmark-enrichment.automation.json +44 -0
  302. package/templates/automations/mail-feed.automation.json +86 -0
  303. package/templates/automations/url-bookmark-capture.automation.json +70 -0
  304. package/templates/skills/README.md +21 -0
  305. package/templates/skills/authoring-automations/SKILL.md +95 -0
  306. package/templates/skills/authoring-automations/reference/node-matrix.md +49 -0
  307. package/templates/skills/authoring-capabilities/SKILL.md +93 -0
  308. package/templates/skills/authoring-capabilities/reference/template-anatomy.md +70 -0
  309. package/templates/skills/authoring-playbooks/SKILL.md +102 -0
  310. package/templates/skills/authoring-playbooks/reference/stages-contract.md +35 -0
  311. package/templates/skills/authoring-playbooks/reference/worked-example.md +64 -0
  312. package/templates/skills/bookmark-enrichment/SKILL.md +40 -0
  313. package/templates/skills/coordinating-agents/SKILL.md +32 -0
  314. package/templates/skills/coordinating-branches/SKILL.md +27 -0
  315. package/templates/skills/mapping-the-server/SKILL.md +54 -0
  316. package/templates/skills/reading-client-progress/SKILL.md +65 -0
  317. package/templates/skills/routing-to-channels/SKILL.md +54 -0
  318. package/templates/skills/stellar-scf-grants-advisor/ASSOCIATE-CHEATSHEET.md +133 -0
  319. package/templates/skills/stellar-scf-grants-advisor/ASSOCIATE-ONBOARDING-GUIDE.md +761 -0
  320. package/templates/skills/stellar-scf-grants-advisor/CLIENT-FAQ.md +181 -0
  321. package/templates/skills/stellar-scf-grants-advisor/PARTNER-HANDOVER.md +130 -0
  322. package/templates/skills/stellar-scf-grants-advisor/SKILL.md +102 -0
  323. package/templates/skills/stellar-scf-grants-advisor/examples/README.md +43 -0
  324. package/templates/skills/stellar-scf-grants-advisor/examples/chat-summary-templates.md +158 -0
  325. package/templates/skills/stellar-scf-grants-advisor/examples/corpus-comparable-rows.md +136 -0
  326. package/templates/skills/stellar-scf-grants-advisor/examples/q10-team-rewrites.md +109 -0
  327. package/templates/skills/stellar-scf-grants-advisor/examples/q2-description-rewrites.md +88 -0
  328. package/templates/skills/stellar-scf-grants-advisor/examples/q6-integration-rewrites.md +107 -0
  329. package/templates/skills/stellar-scf-grants-advisor/examples/tranche-structures.md +176 -0
  330. package/templates/skills/stellar-scf-grants-advisor/reference/01-methodology.md +96 -0
  331. package/templates/skills/stellar-scf-grants-advisor/reference/02-scoring-framework.md +199 -0
  332. package/templates/skills/stellar-scf-grants-advisor/reference/03-rejection-patterns.md +241 -0
  333. package/templates/skills/stellar-scf-grants-advisor/reference/04-winner-patterns.md +120 -0
  334. package/templates/skills/stellar-scf-grants-advisor/reference/05-comeback-patterns.md +92 -0
  335. package/templates/skills/stellar-scf-grants-advisor/reference/06-budget-benchmarks.md +125 -0
  336. package/templates/skills/stellar-scf-grants-advisor/reference/07-integration-list.md +147 -0
  337. package/templates/skills/stellar-scf-grants-advisor/reference/08-abstract-fields.md +258 -0
  338. package/templates/skills/stellar-scf-grants-advisor/reference/09-build-fields.md +259 -0
  339. package/templates/skills/stellar-scf-grants-advisor/reference/10-corpus-winners.md +135 -0
  340. package/templates/skills/stellar-scf-grants-advisor/reference/11-corpus-rejects.md +267 -0
  341. package/templates/skills/stellar-scf-grants-advisor/reference/12-client-communication.md +131 -0
  342. package/templates/skills/stellar-scf-grants-advisor/reference/13-excel-output-spec.md +199 -0
  343. package/templates/skills/stellar-scf-grants-advisor/reference/14-worked-examples.md +160 -0
  344. package/templates/skills/stellar-scf-grants-advisor/templates/abstract-review-builder.py +253 -0
  345. package/templates/skills/stellar-scf-grants-advisor/templates/build-review-builder.py +213 -0
  346. package/dist/commands/finish.d.ts +0 -25
  347. package/dist/commands/finish.js +0 -274
  348. package/dist/commands/finish.js.map +0 -1
  349. package/dist/commands/openclaw.d.ts +0 -40
  350. package/dist/commands/openclaw.js +0 -1148
  351. package/dist/commands/openclaw.js.map +0 -1
  352. package/dist/commands/security-audit.d.ts +0 -12
  353. package/dist/commands/security-audit.js +0 -100
  354. package/dist/commands/security-audit.js.map +0 -1
  355. package/dist/lib/hardening.d.ts +0 -18
  356. package/dist/lib/hardening.js +0 -214
  357. package/dist/lib/hardening.js.map +0 -1
  358. package/dist/lib/templates.d.ts +0 -11
  359. package/dist/lib/templates.js +0 -13
  360. package/dist/lib/templates.js.map +0 -1
  361. package/dist/templates/agent-os.json +0 -3090
  362. package/node_modules/@synap/hub-rest-client/dist/index.cjs +0 -881
  363. package/node_modules/@synap/hub-rest-client/dist/index.d.cts +0 -907
  364. package/node_modules/@synap/hub-rest-client/dist/index.d.ts +0 -907
  365. package/node_modules/@synap/hub-rest-client/dist/index.js +0 -851
  366. package/node_modules/@synap/hub-rest-client/package.json +0 -45
  367. package/node_modules/@synap/hub-rest-client/src/client.ts +0 -1143
  368. package/node_modules/@synap/hub-rest-client/src/errors.ts +0 -30
  369. package/node_modules/@synap/hub-rest-client/src/index.ts +0 -111
  370. package/node_modules/@synap/hub-rest-client/src/setup.ts +0 -77
  371. package/node_modules/@synap/hub-rest-client/src/types.ts +0 -639
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Installed-awareness — which packages are already on the active pod.
3
+ * ===================================================================
4
+ *
5
+ * The pod stamps `workspace.settings.packageSlug` on every workspace it
6
+ * provisions from a package (Hub `GET /workspaces` surfaces it — see
7
+ * `workspaces.ts:508`). Cross-referencing the discovery catalog against that set
8
+ * lets `launch --list` / the picker / `market` mark what is already installed
9
+ * instead of re-offering it.
10
+ *
11
+ * NON-FATAL by design: if the pod is unreachable, unconfigured, or on an older
12
+ * build, this degrades to an empty set (no markers) rather than failing the
13
+ * discovery command — you can always browse the catalog offline.
14
+ */
15
+ /** An installed workspace's package identity — slug plus (when the pod stamped one) its content version. */
16
+ export interface InstalledTemplateInfo {
17
+ slug: string;
18
+ /**
19
+ * `settings.packageVersion`, when the pod stamped one — `GET /api/hub/workspaces`
20
+ * (`hub-protocol/rest/workspaces.ts`) projects it off `workspace.settings`.
21
+ * Undefined for workspaces the pod never version-stamped: installs that
22
+ * predate versioning, OR any install whose template only resolved from the
23
+ * frozen bundle (no CP cache hit — `resolveWorkspaceTemplate` returns no
24
+ * `version` for a bundle fallback). `market update` treats undefined as
25
+ * "can't check" rather than "outdated" — see `market.ts`'s `computeUpdates`.
26
+ */
27
+ version?: string;
28
+ workspaceId: string;
29
+ workspaceName: string;
30
+ }
31
+ /**
32
+ * Every installed workspace's `{slug, version, workspaceId, workspaceName}` —
33
+ * the raw material for "what's installed" (`fetchInstalledSlugs`) and "what's
34
+ * out of date" (`market update`'s `computeUpdates`). One Hub call, derived
35
+ * views. Unions TWO install shapes, mirroring the browser's
36
+ * `useInstalledPackageSlugs` (see that hook's doc for the full rationale):
37
+ *
38
+ * 1. `workspace.packageSlug` — a workspace-creating install (template).
39
+ * 2. `workspace.settings.installedPacks[]` — additive packs (profile/view/
40
+ * bento) that create no workspace of their own, so never set `packageSlug`.
41
+ *
42
+ * A workspace carrying BOTH contributes one row per shape — they're different
43
+ * package identities layered onto the same workspace.
44
+ */
45
+ export declare function fetchInstalledTemplates(): Promise<InstalledTemplateInfo[]>;
46
+ /**
47
+ * The set of `packageSlug`s installed on the active pod. Empty on ANY failure
48
+ * (no pod configured, unreachable, older build without the field) — the caller
49
+ * simply shows no "installed" markers.
50
+ */
51
+ export declare function fetchInstalledSlugs(): Promise<Set<string>>;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Installed-awareness — which packages are already on the active pod.
3
+ * ===================================================================
4
+ *
5
+ * The pod stamps `workspace.settings.packageSlug` on every workspace it
6
+ * provisions from a package (Hub `GET /workspaces` surfaces it — see
7
+ * `workspaces.ts:508`). Cross-referencing the discovery catalog against that set
8
+ * lets `launch --list` / the picker / `market` mark what is already installed
9
+ * instead of re-offering it.
10
+ *
11
+ * NON-FATAL by design: if the pod is unreachable, unconfigured, or on an older
12
+ * build, this degrades to an empty set (no markers) rather than failing the
13
+ * discovery command — you can always browse the catalog offline.
14
+ */
15
+ import { resolveHubConfig, hubGet } from "./hub-client.js";
16
+ /**
17
+ * Every installed workspace's `{slug, version, workspaceId, workspaceName}` —
18
+ * the raw material for "what's installed" (`fetchInstalledSlugs`) and "what's
19
+ * out of date" (`market update`'s `computeUpdates`). One Hub call, derived
20
+ * views. Unions TWO install shapes, mirroring the browser's
21
+ * `useInstalledPackageSlugs` (see that hook's doc for the full rationale):
22
+ *
23
+ * 1. `workspace.packageSlug` — a workspace-creating install (template).
24
+ * 2. `workspace.settings.installedPacks[]` — additive packs (profile/view/
25
+ * bento) that create no workspace of their own, so never set `packageSlug`.
26
+ *
27
+ * A workspace carrying BOTH contributes one row per shape — they're different
28
+ * package identities layered onto the same workspace.
29
+ */
30
+ export async function fetchInstalledTemplates() {
31
+ const out = [];
32
+ try {
33
+ const cfg = await resolveHubConfig();
34
+ const res = (await hubGet("/workspaces", {}, cfg));
35
+ for (const ws of res.workspaces ?? []) {
36
+ if (ws.packageSlug) {
37
+ out.push({
38
+ slug: ws.packageSlug,
39
+ version: ws.packageVersion ?? undefined,
40
+ workspaceId: ws.id,
41
+ workspaceName: ws.name,
42
+ });
43
+ }
44
+ for (const pack of ws.installedPacks ?? []) {
45
+ if (pack?.slug) {
46
+ out.push({
47
+ slug: pack.slug,
48
+ version: pack.version,
49
+ workspaceId: ws.id,
50
+ workspaceName: ws.name,
51
+ });
52
+ }
53
+ }
54
+ }
55
+ }
56
+ catch {
57
+ // Non-fatal: degrade to empty. Discovery never depends on the pod.
58
+ }
59
+ return out;
60
+ }
61
+ /**
62
+ * The set of `packageSlug`s installed on the active pod. Empty on ANY failure
63
+ * (no pod configured, unreachable, older build without the field) — the caller
64
+ * simply shows no "installed" markers.
65
+ */
66
+ export async function fetchInstalledSlugs() {
67
+ const templates = await fetchInstalledTemplates();
68
+ return new Set(templates.map((t) => t.slug));
69
+ }
70
+ //# sourceMappingURL=installed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installed.js","sourceRoot":"","sources":["../../src/lib/installed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,gBA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AAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The guided path — one graph of "what to run next", shared by the journey
3
+ * commands so the CLI reads as a coherent flow instead of a pile of one-off
4
+ * `log.dim("Run synap …")` hints.
5
+ *
6
+ * Two consumers, one source of truth:
7
+ * - HUMANS get a consistent, dim `Next:` block via `renderNextSteps()`.
8
+ * - AGENTS get the SAME `NextStep[]` in every journey command's `--json`
9
+ * output (a `nextSteps` field), so a script/agent can parse the graph and
10
+ * chain the next call without scraping prose.
11
+ *
12
+ * `command` is a full, runnable `synap …` invocation (paste-able / executable);
13
+ * `why` is a crisp one-liner. Placeholders like `<id>` / `<slug>` stay literal
14
+ * where the concrete value isn't known yet.
15
+ */
16
+ export interface NextStep {
17
+ /** A full runnable command, e.g. `synap market --list`. */
18
+ command: string;
19
+ /** Why you'd run it next — one crisp line. */
20
+ why: string;
21
+ }
22
+ /**
23
+ * Print a consistent, dim `Next:` block (aligned `command — why`). No-op on an
24
+ * empty list. Goes to stdout via the `log.*` helpers, alongside ordinary output
25
+ * detail (a next-step block is guidance, not an error).
26
+ */
27
+ export declare function renderNextSteps(steps: NextStep[]): void;
28
+ /**
29
+ * The canonical flow graph. Each edge is a small function returning 1–3
30
+ * `NextStep`s for "you just did X → here's the sensible next move(s)."
31
+ */
32
+ export declare const FLOW: {
33
+ /** After switching the active pod. */
34
+ afterPodUse(podName: string): NextStep[];
35
+ /** After logging in to the Synap account (control plane). */
36
+ afterLogin(email?: string): NextStep[];
37
+ /** After pinning a project as the active lens. */
38
+ afterProjectUse(name: string): NextStep[];
39
+ /** After creating a new project. */
40
+ afterProjectNew(name: string, id: string): NextStep[];
41
+ /** After listing projects (or after orient). */
42
+ afterProjectList(): NextStep[];
43
+ /** After browsing the marketplace. */
44
+ afterMarketList(): NextStep[];
45
+ /** After a market install. `proposed` = governance queued it for approval. */
46
+ afterMarketInstall(args: {
47
+ slug: string;
48
+ proposed: boolean;
49
+ projectName?: string;
50
+ }): NextStep[];
51
+ /** After `synap launch` stands up a company/OS (pod-wide, or under a project). */
52
+ afterLaunch(projectName?: string): NextStep[];
53
+ /** After orienting on the pod. */
54
+ afterOrient(): NextStep[];
55
+ /** After `synap market update` found drift but didn't apply (no --yes / no slug). */
56
+ afterMarketUpdateCheck(slugsWithUpdates: string[]): NextStep[];
57
+ /** After `synap market installed` inventoried the pod (found drift or not). */
58
+ afterMarketInstalledCheck(slugsWithUpdates: string[]): NextStep[];
59
+ /** After `synap market update` applied one or more updates. */
60
+ afterMarketUpdateApply(): NextStep[];
61
+ };
@@ -0,0 +1,146 @@
1
+ /**
2
+ * The guided path — one graph of "what to run next", shared by the journey
3
+ * commands so the CLI reads as a coherent flow instead of a pile of one-off
4
+ * `log.dim("Run synap …")` hints.
5
+ *
6
+ * Two consumers, one source of truth:
7
+ * - HUMANS get a consistent, dim `Next:` block via `renderNextSteps()`.
8
+ * - AGENTS get the SAME `NextStep[]` in every journey command's `--json`
9
+ * output (a `nextSteps` field), so a script/agent can parse the graph and
10
+ * chain the next call without scraping prose.
11
+ *
12
+ * `command` is a full, runnable `synap …` invocation (paste-able / executable);
13
+ * `why` is a crisp one-liner. Placeholders like `<id>` / `<slug>` stay literal
14
+ * where the concrete value isn't known yet.
15
+ */
16
+ import chalk from "chalk";
17
+ import { log } from "../utils/logger.js";
18
+ /**
19
+ * Print a consistent, dim `Next:` block (aligned `command — why`). No-op on an
20
+ * empty list. Goes to stdout via the `log.*` helpers, alongside ordinary output
21
+ * detail (a next-step block is guidance, not an error).
22
+ */
23
+ export function renderNextSteps(steps) {
24
+ if (steps.length === 0)
25
+ return;
26
+ const width = Math.max(...steps.map((s) => s.command.length));
27
+ log.blank();
28
+ console.log(chalk.dim(" Next:"));
29
+ for (const s of steps) {
30
+ console.log(chalk.dim(` ${s.command.padEnd(width)} — ${s.why}`));
31
+ }
32
+ }
33
+ /**
34
+ * The canonical flow graph. Each edge is a small function returning 1–3
35
+ * `NextStep`s for "you just did X → here's the sensible next move(s)."
36
+ */
37
+ export const FLOW = {
38
+ /** After switching the active pod. */
39
+ afterPodUse(podName) {
40
+ return [
41
+ { command: "synap project use <id>", why: `focus a project on ${podName} to scope your work` },
42
+ { command: "synap market --list", why: "see what you can install" },
43
+ { command: "synap orient", why: "map this pod's projects + workspaces" },
44
+ ];
45
+ },
46
+ /** After logging in to the Synap account (control plane). */
47
+ afterLogin(email) {
48
+ return [
49
+ {
50
+ command: "synap market --list",
51
+ why: email ? `your private packages (${email}) are now visible` : "your private packages are now visible",
52
+ },
53
+ { command: "synap market install <slug>", why: "install an OS / template pod-wide" },
54
+ ];
55
+ },
56
+ /** After pinning a project as the active lens. */
57
+ afterProjectUse(name) {
58
+ return [
59
+ { command: "synap market install <slug>", why: `add a package to ${name}` },
60
+ { command: "synap market --list", why: "browse installable packages" },
61
+ { command: "synap orient", why: "see what's already in this pod" },
62
+ ];
63
+ },
64
+ /** After creating a new project. */
65
+ afterProjectNew(name, id) {
66
+ return [
67
+ { command: "synap launch", why: `stand up an OS (project + core workspaces) in ${name}` },
68
+ { command: `synap market install <slug> --project ${id}`, why: `add a single package to ${name}` },
69
+ ];
70
+ },
71
+ /** After listing projects (or after orient). */
72
+ afterProjectList() {
73
+ return [
74
+ { command: "synap project use <id>", why: "focus a project (cross-cutting lens)" },
75
+ { command: "synap project new <name>", why: "create a new company / initiative" },
76
+ ];
77
+ },
78
+ /** After browsing the marketplace. */
79
+ afterMarketList() {
80
+ return [
81
+ { command: "synap market install <slug>", why: "install it pod-wide" },
82
+ { command: "synap market install <slug> --project <id>", why: "optionally also tag its seeded entities to a project" },
83
+ ];
84
+ },
85
+ /** After a market install. `proposed` = governance queued it for approval. */
86
+ afterMarketInstall(args) {
87
+ if (args.proposed) {
88
+ return [{ command: "synap proposals list", why: `approve the queued install of ${args.slug}` }];
89
+ }
90
+ return [
91
+ { command: "synap orient", why: `see ${args.slug} in ${args.projectName ?? "your pod"}` },
92
+ { command: "synap open", why: "open it in the browser" },
93
+ ];
94
+ },
95
+ /** After `synap launch` stands up a company/OS (pod-wide, or under a project). */
96
+ afterLaunch(projectName) {
97
+ return [
98
+ {
99
+ command: "synap orient",
100
+ why: projectName
101
+ ? `see the new workspaces under ${projectName}`
102
+ : "see the new workspaces",
103
+ },
104
+ { command: "synap market --list", why: "add more packages" },
105
+ ];
106
+ },
107
+ /** After orienting on the pod. */
108
+ afterOrient() {
109
+ return [
110
+ { command: "synap project use <id>", why: "focus a project (cross-cutting lens)" },
111
+ { command: "synap market --list", why: "browse installable packages" },
112
+ ];
113
+ },
114
+ /** After `synap market update` found drift but didn't apply (no --yes / no slug). */
115
+ afterMarketUpdateCheck(slugsWithUpdates) {
116
+ if (slugsWithUpdates.length === 0)
117
+ return [];
118
+ const steps = slugsWithUpdates
119
+ .slice(0, 3)
120
+ .map((slug) => ({ command: `synap market update ${slug}`, why: "apply this template's update" }));
121
+ if (slugsWithUpdates.length > 1) {
122
+ steps.push({ command: "synap market update --yes", why: "apply every available update, no prompt" });
123
+ }
124
+ return steps;
125
+ },
126
+ /** After `synap market installed` inventoried the pod (found drift or not). */
127
+ afterMarketInstalledCheck(slugsWithUpdates) {
128
+ if (slugsWithUpdates.length === 0)
129
+ return [];
130
+ const steps = slugsWithUpdates
131
+ .slice(0, 3)
132
+ .map((slug) => ({ command: `synap market update ${slug}`, why: "preview this package's update" }));
133
+ if (slugsWithUpdates.length > 1) {
134
+ steps.push({ command: "synap market update --yes", why: "apply every available update, no prompt" });
135
+ }
136
+ return steps;
137
+ },
138
+ /** After `synap market update` applied one or more updates. */
139
+ afterMarketUpdateApply() {
140
+ return [
141
+ { command: "synap orient", why: "see what changed in the pod" },
142
+ { command: "synap market update", why: "re-check for further drift" },
143
+ ];
144
+ },
145
+ };
146
+ //# sourceMappingURL=next-steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-steps.js","sourceRoot":"","sources":["../../src/lib/next-steps.ts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AC,gBAA0B;QAClD,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAe,gBAAgB;aACvC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;aACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,uBAAuB,IAAI,EAAE,EAAE,GAAG,EAAE,+BAA+B,EAAE,CAAC,CAAC,CAAC;QACrG,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,GAAG,EAAE,yCAAyC,EAAE,CAAC,CAAC;QACvG,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,+DAA+D;IAC/D,sBAAsB;QACpB,OAAO;YACL,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,6BAA6B,EAAE;YAC/D,EAAE,OAAO,EAAE,qBAAqB,EAAE,GAAG,EAAE,4BAA4B,EAAE;SACtE,CAAC;IACJ,CAAC;CACF,CAAC"}
package/dist/lib/pod.d.ts CHANGED
@@ -10,10 +10,39 @@ export interface LocalPodConfig {
10
10
  label?: string;
11
11
  savedAt: string;
12
12
  }
13
- export type SurfaceName = "raycast" | "claude-code" | "claude-desktop" | "cursor" | "openclaw";
13
+ /** SSOT for every connect/surface agent identity. The type is derived from this
14
+ * array so the two can't drift. */
15
+ export declare const SURFACE_NAMES: readonly ["raycast", "claude-code", "claude-desktop", "cursor", "codex", "opencode", "aider", "windsurf", "goose", "zed", "vscode", "discord"];
16
+ export type SurfaceName = (typeof SURFACE_NAMES)[number];
17
+ /**
18
+ * agentTypes already owned by OTHER doors — `POST /setup/agent` treats agentType
19
+ * as a POD-WIDE SINGLETON, so `agents create` deriving a slug that collides with
20
+ * one of these would silently hijack that door's agent + key. Superset of the
21
+ * surfaces above plus the non-surface provisioning types (generic/openwebui MCP
22
+ * mappings; openclaw/cli/memory). Single source of truth for the collision guard.
23
+ */
24
+ export declare const RESERVED_AGENT_TYPES: ReadonlySet<string>;
14
25
  export interface SurfaceAgentKey {
15
26
  hubApiKey: string;
16
27
  agentUserId: string;
28
+ /**
29
+ * Pod the key was provisioned against. Consumers (e.g. the Raycast extension)
30
+ * must only use the key when this matches the pod they're talking to —
31
+ * a surface pointed at another pod falls back to that pod's own profile key.
32
+ */
33
+ podUrl?: string;
34
+ }
35
+ /** Agent workspace routing — persisted by `synap connect` wizard. */
36
+ export interface AgentWorkspaceRouting {
37
+ /** Private workspace for agent-only captures (gotchas, lessons, patterns). Auto-approved. */
38
+ memoryWorkspaceId?: string;
39
+ /** Shared workspaces the agent writes team-visible data to. */
40
+ productWorkspaceIds?: string[];
41
+ }
42
+ /** The active project pinned together with the pod profile it lives on. */
43
+ export interface ActiveProjectBinding {
44
+ projectId: string;
45
+ podName: string;
17
46
  }
18
47
  export interface MultiPodConfig {
19
48
  activePod: string;
@@ -22,9 +51,26 @@ export interface MultiPodConfig {
22
51
  pods: Record<string, LocalPodConfig>;
23
52
  /** Active workspace override — set by `synap use <workspaceId>`. Takes priority over the pod's default workspaceId. */
24
53
  activeWorkspaceId?: string;
54
+ /** Active project override — set by `synap project use <projectId>`. Peer of activeWorkspaceId; independent (composable). */
55
+ activeProjectId?: string;
56
+ /** Pod-aware binding of the active project — set by cross-pod `synap project use <ref>` so later drift (active pod changed under the pin) can warn. */
57
+ activeProject?: ActiveProjectBinding;
25
58
  /** Per-surface dedicated agent keys (provisioned with named agentType). Separate from pod profile keys. */
26
59
  agentKeys?: Partial<Record<SurfaceName, SurfaceAgentKey>>;
60
+ /** Workspace routing set by `synap connect` wizard — drives capture/recall defaults. */
61
+ agentWorkspaceRouting?: AgentWorkspaceRouting;
27
62
  }
63
+ /**
64
+ * The ONE "pod profile not found" message.
65
+ *
66
+ * Names the profile that missed, the pods that DO exist, and the command that
67
+ * adds one. Every site that fails to resolve a profile name renders through
68
+ * this — a bare `not found` leaves the user with no next move, and the known-pods
69
+ * list is usually the whole answer (a typo).
70
+ */
71
+ export declare function podNotFoundMessage(name: string): string;
72
+ /** Throwing form of {@link podNotFoundMessage}. */
73
+ export declare function podNotFoundError(name: string): Error;
28
74
  /** Get the pod config for a specific surface, falling back to the global activePod. */
29
75
  export declare function getSurfacePod(surface: SurfaceName): LocalPodConfig | null;
30
76
  /** Get the name of the pod assigned to a surface (or the global active pod name). */
@@ -39,14 +85,43 @@ export declare function listPodProfiles(): Array<{
39
85
  config: LocalPodConfig;
40
86
  active: boolean;
41
87
  }>;
88
+ export declare function getPodOverride(): LocalPodConfig | null;
89
+ /** Resolve a saved pod profile by name and set it as this invocation's override. */
90
+ export declare function setPodOverrideByName(name: string): LocalPodConfig;
91
+ /**
92
+ * Consume a position-independent `--pod <name>` (or `--pod=<name>`) from argv and
93
+ * register it as the per-invocation override. Mutates `argv` in place so commander
94
+ * never sees the flag (it isn't registered per-command). No-op when the argv
95
+ * targets a command that owns `--pod` itself (agents, bridge-setup). Throws with a
96
+ * helpful message when the named profile is unknown.
97
+ */
98
+ export declare function bootstrapPodOverride(argv: string[]): void;
42
99
  export declare function addPodProfile(name: string, podConfig: LocalPodConfig): void;
43
100
  export declare function setActivePod(name: string): LocalPodConfig;
44
101
  /** Get the active workspace ID: explicit override first, then the pod default. */
45
102
  export declare function getActiveWorkspaceId(): string | undefined;
46
103
  /** Persist a workspace as the active context for all subsequent commands. */
47
104
  export declare function setActiveWorkspaceId(workspaceId: string): void;
105
+ /** Get the active project ID: durable override set by `synap project use`. */
106
+ export declare function getActiveProjectId(): string | undefined;
107
+ /** Persist a project as the active context for all subsequent commands. */
108
+ export declare function setActiveProjectId(projectId: string): void;
109
+ /**
110
+ * Pin project AND the pod it lives on together — the cross-pod `project use`
111
+ * door. Stores the binding so later drift (active pod switched away from the
112
+ * pinned project's pod) can warn.
113
+ */
114
+ export declare function setActiveProjectBinding(binding: ActiveProjectBinding): void;
115
+ /** The pod-aware active-project binding, when set by cross-pod `project use`. */
116
+ export declare function getActiveProjectBinding(): ActiveProjectBinding | undefined;
117
+ /** Remove the active project override — subsequent commands see all projects. */
118
+ export declare function clearActiveProjectId(): void;
48
119
  /** Store a dedicated agent key for a specific surface (e.g. "raycast", "claude-code"). */
49
120
  export declare function setSurfaceAgentKey(surface: SurfaceName, key: SurfaceAgentKey): void;
121
+ /** Read back the stored agent key for a surface. Returns null if not provisioned. */
122
+ export declare function getSurfaceAgentKey(surface: SurfaceName): SurfaceAgentKey | null;
123
+ export declare function setAgentWorkspaceRouting(routing: AgentWorkspaceRouting): void;
124
+ export declare function getAgentWorkspaceRouting(): AgentWorkspaceRouting | undefined;
50
125
  /** Remove the active workspace override — subsequent commands see all workspaces. */
51
126
  export declare function clearActiveWorkspaceId(): void;
52
127
  export declare function removePodProfile(name: string): void;
@@ -63,15 +138,6 @@ export interface PodStatus {
63
138
  * Check if a Synap pod is healthy.
64
139
  */
65
140
  export declare function checkPodHealth(podUrl: string): Promise<PodStatus>;
66
- /**
67
- * Create an agent user and API key on the pod.
68
- * Uses the PROVISIONING_TOKEN for auth.
69
- */
70
- export declare function setupAgent(podUrl: string, provisioningToken: string, agentType?: string): Promise<{
71
- hubApiKey: string;
72
- agentUserId: string;
73
- workspaceId: string;
74
- }>;
75
141
  /**
76
142
  * Install Docker and start a self-hosted Synap pod.
77
143
  */
@@ -80,17 +146,31 @@ export declare function startSelfHostedPod(): void;
80
146
  * Install the synap skill into OpenClaw.
81
147
  */
82
148
  /**
83
- * Provision the CP-authenticated user on their pod.
84
- * Calls the CP to get a handshake JWT, then calls /api/handshake on the pod.
85
- * This ensures the user exists in the pod's users table before setup/agent runs.
86
- * Safe to call multiple times — idempotent (Kratos upserts by email).
149
+ * Open a Pod session for the CP-authenticated user.
150
+ * Calls the issuer for a short-lived generic assertion, then exchanges that
151
+ * assertion directly with the Pod. The issuer never receives a Pod session.
152
+ *
153
+ * Returns the Kratos session token the Pod mints after its own membership check.
154
+ * That token authenticates subsequent pod tRPC calls (e.g.
155
+ * `apiKeys.connectIntegration`) as the pod user, via the X-Session-Token header.
156
+ * `sessionToken` is null only if the pod handshake returned no token (e.g. 409).
87
157
  */
88
- export declare function provisionUserOnPod(podUrl: string, cpToken: string): Promise<void>;
158
+ export declare function provisionUserOnPod(podUrl: string, cpToken: string): Promise<{
159
+ sessionToken: string | null;
160
+ }>;
89
161
  /**
90
- * Generate an API key via the Control Plane (for authenticated users).
91
- * The CP relays the request to the pod using its own authority.
162
+ * Issue a scoped Hub Protocol API key on the pod for an authenticated user.
163
+ *
164
+ * Canonical path: the pod's `apiKeys.connectIntegration` tRPC procedure — the
165
+ * same one the pod-admin `/connect` page and the browser's LocalCliRow use.
166
+ * Auth is the Kratos session token minted by {@link provisionUserOnPod},
167
+ * forwarded as the `X-Session-Token` header. (Replaces the removed CP relay
168
+ * `POST /pods/setup-agent`, which now returns 410.)
169
+ *
170
+ * Backend tRPC uses the superjson transformer, so the input rides in a
171
+ * `{ json: ... }` envelope and the output is unwrapped from `result.data.json`.
92
172
  */
93
- export declare function setupAgentViaCp(podUrl: string, cpToken: string, agentType?: string): Promise<{
173
+ export declare function setupAgentViaPod(podUrl: string, sessionToken: string, integration?: "cli" | "openclaw" | "raycast" | "custom"): Promise<{
94
174
  hubApiKey: string;
95
175
  agentUserId: string;
96
176
  workspaceId: string;
@@ -98,6 +178,11 @@ export declare function setupAgentViaCp(podUrl: string, cpToken: string, agentTy
98
178
  /**
99
179
  * Enable OpenClaw as a free addon on a SELF-HOSTED pod.
100
180
  * Uses the PROVISIONING_TOKEN directly against the pod.
181
+ *
182
+ * Routes through the shared `provisionAgentKey()` wrapper (dynamic import to
183
+ * avoid a circular pod.ts <-> targets.ts static import). `workspaceId` is no
184
+ * longer part of the response — agents are pod-wide singletons now; scope is
185
+ * granted separately via `enrollAgentIfNeeded()`, not returned from setup.
101
186
  */
102
187
  export declare function enableOpenClawAddon(podUrl: string, provisioningToken: string): Promise<{
103
188
  hubApiKey: string;
@@ -143,7 +228,7 @@ export declare function findSynapDeployDir(): string | null;
143
228
  *
144
229
  * Returns the deploy dir used.
145
230
  */
146
- export declare function startOpenClawOnServer(hubApiKey: string, agentUserId: string, workspaceId: string, podUrl: string): string;
231
+ export declare function startOpenClawOnServer(hubApiKey: string, agentUserId: string, workspaceId: string, podUrl: string, projectId?: string): string;
147
232
  /**
148
233
  * Install the synap skill into OpenClaw.
149
234
  * Automatically chooses the right execution path: