@synap-core/cli 1.8.0 → 1.11.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 (372) 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.js +3 -4
  5. package/dist/commands/agent-run.js.map +1 -1
  6. package/dist/commands/agents.js +85 -46
  7. package/dist/commands/agents.js.map +1 -1
  8. package/dist/commands/automation.js +2 -1
  9. package/dist/commands/automation.js.map +1 -1
  10. package/dist/commands/bridge-setup.d.ts +66 -0
  11. package/dist/commands/bridge-setup.js +1112 -0
  12. package/dist/commands/bridge-setup.js.map +1 -0
  13. package/dist/commands/cap-connections.d.ts +28 -0
  14. package/dist/commands/cap-connections.js +224 -0
  15. package/dist/commands/cap-connections.js.map +1 -0
  16. package/dist/commands/capability.d.ts +89 -0
  17. package/dist/commands/capability.js +1594 -0
  18. package/dist/commands/capability.js.map +1 -0
  19. package/dist/commands/centrality.d.ts +20 -0
  20. package/dist/commands/centrality.js +95 -0
  21. package/dist/commands/centrality.js.map +1 -0
  22. package/dist/commands/connect.d.ts +2 -0
  23. package/dist/commands/connect.js +16 -35
  24. package/dist/commands/connect.js.map +1 -1
  25. package/dist/commands/context.js +6 -7
  26. package/dist/commands/context.js.map +1 -1
  27. package/dist/commands/data-extra.d.ts +1 -0
  28. package/dist/commands/data-extra.js +41 -14
  29. package/dist/commands/data-extra.js.map +1 -1
  30. package/dist/commands/data.d.ts +4 -4
  31. package/dist/commands/data.js +254 -187
  32. package/dist/commands/data.js.map +1 -1
  33. package/dist/commands/diagnose.d.ts +20 -0
  34. package/dist/commands/diagnose.js +186 -0
  35. package/dist/commands/diagnose.js.map +1 -0
  36. package/dist/commands/digest.d.ts +17 -0
  37. package/dist/commands/digest.js +122 -0
  38. package/dist/commands/digest.js.map +1 -0
  39. package/dist/commands/discover.d.ts +2 -0
  40. package/dist/commands/discover.js +25 -8
  41. package/dist/commands/discover.js.map +1 -1
  42. package/dist/commands/doc.d.ts +14 -0
  43. package/dist/commands/doc.js +61 -4
  44. package/dist/commands/doc.js.map +1 -1
  45. package/dist/commands/doctor.d.ts +21 -0
  46. package/dist/commands/doctor.js +189 -0
  47. package/dist/commands/doctor.js.map +1 -0
  48. package/dist/commands/events.js +5 -2
  49. package/dist/commands/events.js.map +1 -1
  50. package/dist/commands/explain.d.ts +1 -1
  51. package/dist/commands/explain.js +18 -15
  52. package/dist/commands/explain.js.map +1 -1
  53. package/dist/commands/facet.d.ts +29 -0
  54. package/dist/commands/facet.js +113 -0
  55. package/dist/commands/facet.js.map +1 -0
  56. package/dist/commands/graph.js +7 -4
  57. package/dist/commands/graph.js.map +1 -1
  58. package/dist/commands/import.d.ts +38 -0
  59. package/dist/commands/import.js +471 -0
  60. package/dist/commands/import.js.map +1 -0
  61. package/dist/commands/init.js +35 -16
  62. package/dist/commands/init.js.map +1 -1
  63. package/dist/commands/keys.js +3 -4
  64. package/dist/commands/keys.js.map +1 -1
  65. package/dist/commands/knowledge.d.ts +8 -0
  66. package/dist/commands/knowledge.js +308 -33
  67. package/dist/commands/knowledge.js.map +1 -1
  68. package/dist/commands/launch.d.ts +50 -0
  69. package/dist/commands/launch.js +790 -0
  70. package/dist/commands/launch.js.map +1 -0
  71. package/dist/commands/lens.d.ts +45 -0
  72. package/dist/commands/lens.js +386 -0
  73. package/dist/commands/lens.js.map +1 -0
  74. package/dist/commands/market-authoring.d.ts +45 -0
  75. package/dist/commands/market-authoring.js +225 -0
  76. package/dist/commands/market-authoring.js.map +1 -0
  77. package/dist/commands/market.d.ts +224 -0
  78. package/dist/commands/market.js +1643 -0
  79. package/dist/commands/market.js.map +1 -0
  80. package/dist/commands/mcp.d.ts +64 -0
  81. package/dist/commands/mcp.js +265 -0
  82. package/dist/commands/mcp.js.map +1 -0
  83. package/dist/commands/observe.js +14 -11
  84. package/dist/commands/observe.js.map +1 -1
  85. package/dist/commands/open.d.ts +21 -4
  86. package/dist/commands/open.js +45 -4
  87. package/dist/commands/open.js.map +1 -1
  88. package/dist/commands/pod.d.ts +100 -0
  89. package/dist/commands/pod.js +359 -0
  90. package/dist/commands/pod.js.map +1 -0
  91. package/dist/commands/pods.d.ts +15 -0
  92. package/dist/commands/pods.js +233 -17
  93. package/dist/commands/pods.js.map +1 -1
  94. package/dist/commands/proposals-actions.js +43 -3
  95. package/dist/commands/proposals-actions.js.map +1 -1
  96. package/dist/commands/purge.d.ts +23 -0
  97. package/dist/commands/purge.js +148 -0
  98. package/dist/commands/purge.js.map +1 -0
  99. package/dist/commands/raycast.d.ts +15 -0
  100. package/dist/commands/raycast.js +153 -0
  101. package/dist/commands/raycast.js.map +1 -0
  102. package/dist/commands/sessions.js +47 -22
  103. package/dist/commands/sessions.js.map +1 -1
  104. package/dist/commands/skill-manage.d.ts +21 -0
  105. package/dist/commands/skill-manage.js +195 -0
  106. package/dist/commands/skill-manage.js.map +1 -0
  107. package/dist/commands/skills-commands.js +2 -1
  108. package/dist/commands/skills-commands.js.map +1 -1
  109. package/dist/commands/skills.js +7 -4
  110. package/dist/commands/skills.js.map +1 -1
  111. package/dist/commands/status.d.ts +3 -1
  112. package/dist/commands/status.js +166 -14
  113. package/dist/commands/status.js.map +1 -1
  114. package/dist/commands/statusline.d.ts +24 -0
  115. package/dist/commands/statusline.js +450 -0
  116. package/dist/commands/statusline.js.map +1 -0
  117. package/dist/commands/subscribe.js +2 -2
  118. package/dist/commands/subscribe.js.map +1 -1
  119. package/dist/commands/template.d.ts +42 -0
  120. package/dist/commands/template.js +191 -0
  121. package/dist/commands/template.js.map +1 -0
  122. package/dist/commands/tools.d.ts +30 -0
  123. package/dist/commands/tools.js +315 -0
  124. package/dist/commands/tools.js.map +1 -0
  125. package/dist/commands/upload.d.ts +30 -0
  126. package/dist/commands/upload.js +155 -0
  127. package/dist/commands/upload.js.map +1 -0
  128. package/dist/commands/versions.d.ts +27 -0
  129. package/dist/commands/versions.js +277 -0
  130. package/dist/commands/versions.js.map +1 -0
  131. package/dist/commands/view.js +3 -2
  132. package/dist/commands/view.js.map +1 -1
  133. package/dist/commands/whoami.d.ts +21 -0
  134. package/dist/commands/whoami.js +129 -0
  135. package/dist/commands/whoami.js.map +1 -0
  136. package/dist/index.js +894 -60
  137. package/dist/index.js.map +1 -1
  138. package/dist/lib/approval-poll.d.ts +42 -0
  139. package/dist/lib/approval-poll.js +52 -0
  140. package/dist/lib/approval-poll.js.map +1 -0
  141. package/dist/lib/auth.d.ts +29 -6
  142. package/dist/lib/auth.js +105 -94
  143. package/dist/lib/auth.js.map +1 -1
  144. package/dist/lib/bundle-version.d.ts +11 -0
  145. package/dist/lib/bundle-version.js +33 -0
  146. package/dist/lib/bundle-version.js.map +1 -0
  147. package/dist/lib/capture-lane.d.ts +30 -12
  148. package/dist/lib/capture-lane.js +73 -14
  149. package/dist/lib/capture-lane.js.map +1 -1
  150. package/dist/lib/capture-structure.d.ts +123 -0
  151. package/dist/lib/capture-structure.js +57 -0
  152. package/dist/lib/capture-structure.js.map +1 -0
  153. package/dist/lib/cp-packages.d.ts +177 -0
  154. package/dist/lib/cp-packages.js +389 -0
  155. package/dist/lib/cp-packages.js.map +1 -0
  156. package/dist/lib/describe-lens.d.ts +46 -0
  157. package/dist/lib/describe-lens.js +33 -0
  158. package/dist/lib/describe-lens.js.map +1 -0
  159. package/dist/lib/hub-client.d.ts +91 -1
  160. package/dist/lib/hub-client.js +565 -22
  161. package/dist/lib/hub-client.js.map +1 -1
  162. package/dist/lib/id.d.ts +23 -0
  163. package/dist/lib/id.js +35 -0
  164. package/dist/lib/id.js.map +1 -0
  165. package/dist/lib/installed.d.ts +51 -0
  166. package/dist/lib/installed.js +70 -0
  167. package/dist/lib/installed.js.map +1 -0
  168. package/dist/lib/next-steps.d.ts +61 -0
  169. package/dist/lib/next-steps.js +146 -0
  170. package/dist/lib/next-steps.js.map +1 -0
  171. package/dist/lib/pod.d.ts +144 -22
  172. package/dist/lib/pod.js +302 -64
  173. package/dist/lib/pod.js.map +1 -1
  174. package/dist/lib/project-ref.d.ts +95 -0
  175. package/dist/lib/project-ref.js +144 -0
  176. package/dist/lib/project-ref.js.map +1 -0
  177. package/dist/lib/project.d.ts +35 -0
  178. package/dist/lib/project.js +39 -0
  179. package/dist/lib/project.js.map +1 -0
  180. package/dist/lib/session-lens.d.ts +33 -0
  181. package/dist/lib/session-lens.js +76 -0
  182. package/dist/lib/session-lens.js.map +1 -0
  183. package/dist/lib/skill-import.d.ts +40 -0
  184. package/dist/lib/skill-import.js +203 -0
  185. package/dist/lib/skill-import.js.map +1 -0
  186. package/dist/lib/skills-installer.d.ts +17 -6
  187. package/dist/lib/skills-installer.js +133 -19
  188. package/dist/lib/skills-installer.js.map +1 -1
  189. package/dist/lib/suite.d.ts +28 -0
  190. package/dist/lib/suite.js +29 -0
  191. package/dist/lib/suite.js.map +1 -0
  192. package/dist/lib/superwhisper-import.d.ts +40 -0
  193. package/dist/lib/superwhisper-import.js +389 -0
  194. package/dist/lib/superwhisper-import.js.map +1 -0
  195. package/dist/lib/targets.d.ts +49 -1
  196. package/dist/lib/targets.js +420 -288
  197. package/dist/lib/targets.js.map +1 -1
  198. package/dist/lib/template-file.d.ts +74 -0
  199. package/dist/lib/template-file.js +140 -0
  200. package/dist/lib/template-file.js.map +1 -0
  201. package/dist/lib/unwrapList.d.ts +1 -0
  202. package/dist/lib/unwrapList.js +20 -0
  203. package/dist/lib/unwrapList.js.map +1 -0
  204. package/dist/utils/logger.d.ts +2 -0
  205. package/dist/utils/logger.js +10 -2
  206. package/dist/utils/logger.js.map +1 -1
  207. package/node_modules/@synap/hub-rest-client/dist/index.cjs +414 -34
  208. package/node_modules/@synap/hub-rest-client/dist/index.d.cts +762 -22
  209. package/node_modules/@synap/hub-rest-client/dist/index.d.ts +762 -22
  210. package/node_modules/@synap/hub-rest-client/dist/index.js +414 -34
  211. package/node_modules/@synap/hub-rest-client/package.json +1 -1
  212. package/node_modules/@synap/hub-rest-client/src/client.ts +525 -37
  213. package/node_modules/@synap/hub-rest-client/src/index.ts +42 -0
  214. package/node_modules/@synap/hub-rest-client/src/setup.ts +57 -1
  215. package/node_modules/@synap/hub-rest-client/src/types.ts +697 -37
  216. package/package.json +11 -5
  217. package/skills/agent-os/SKILL.md +218 -0
  218. package/skills/manifest.json +5 -0
  219. package/skills/onboard/SKILL.md +193 -0
  220. package/skills/synap/SKILL.md +1284 -58
  221. package/skills/synap/_order.txt +37 -0
  222. package/skills/synap/_skill.yaml +24 -0
  223. package/skills/synap/authentication.md +10 -0
  224. package/skills/synap/automations.md +264 -0
  225. package/skills/synap/capabilities.md +107 -0
  226. package/skills/synap/capture.md +50 -142
  227. package/skills/synap/cli-operations.md +107 -0
  228. package/skills/synap/common-mistakes.md +13 -0
  229. package/skills/synap/content-os.md +83 -0
  230. package/skills/synap/creative-loop.md +43 -0
  231. package/skills/synap/crm.md +117 -0
  232. package/skills/synap/diagnostics.md +35 -0
  233. package/skills/synap/digesting-a-channel.md +63 -0
  234. package/skills/synap/document-embeds.md +123 -0
  235. package/skills/synap/escalation-ladder.md +71 -0
  236. package/skills/synap/focus-sessions.md +47 -0
  237. package/skills/synap/governance-rules.md +64 -0
  238. package/skills/synap/governance.md +6 -6
  239. package/skills/synap/graph-gardening.md +21 -0
  240. package/skills/synap/inline-patterns.md +38 -0
  241. package/skills/synap/lenses.md +38 -0
  242. package/skills/synap/linking-principle.md +39 -0
  243. package/skills/synap/linking.md +1 -0
  244. package/skills/synap/mental-model.md +45 -0
  245. package/skills/synap/more.md +7 -0
  246. package/skills/synap/multi-entity-capture.md +12 -0
  247. package/skills/synap/next-action.md +37 -0
  248. package/skills/synap/north-star.md +17 -0
  249. package/skills/synap/operating-mode-rules.md +45 -0
  250. package/skills/synap/operating-mode.md +9 -0
  251. package/skills/synap/quick-reference.md +67 -0
  252. package/skills/synap/reading.md +43 -0
  253. package/skills/synap/recap.md +21 -0
  254. package/skills/synap/reflexes.md +46 -0
  255. package/skills/synap/response-style.md +21 -0
  256. package/skills/synap/scope.md +13 -0
  257. package/skills/synap/showing.md +17 -0
  258. package/skills/synap/user-model.md +25 -0
  259. package/skills/synap/viewframe-cells.md +290 -0
  260. package/skills/synap/work-flow.md +113 -0
  261. package/skills/synap/worked-examples.md +74 -0
  262. package/skills/synap/workspace-design.md +45 -0
  263. package/skills/synap/workspace-edges.md +49 -0
  264. package/skills/synap/writes.md +213 -0
  265. package/skills/synap-app/SKILL.md +319 -0
  266. package/skills/synap-app/_order.txt +5 -0
  267. package/skills/synap-app/_skill.yaml +20 -0
  268. package/skills/synap-app/creating-the-base-app.md +64 -0
  269. package/skills/synap-app/governance.md +42 -0
  270. package/skills/synap-app/install-commands.md +55 -0
  271. package/skills/synap-app/overview.md +50 -0
  272. package/skills/synap-app/using-the-sdk.md +73 -0
  273. package/skills/synap-market/SKILL.md +335 -0
  274. package/skills/synap-market/_order.txt +5 -0
  275. package/skills/synap-market/_skill.yaml +24 -0
  276. package/skills/synap-market/author-and-publish.md +75 -0
  277. package/skills/synap-market/discover-and-fetch.md +59 -0
  278. package/skills/synap-market/governance-and-catalog.md +56 -0
  279. package/skills/synap-market/install.md +55 -0
  280. package/skills/synap-market/overview.md +51 -0
  281. package/skills/synap-schema/SKILL.md +97 -6
  282. package/skills/synap-schema/_order.txt +13 -0
  283. package/skills/synap-schema/_skill.yaml +22 -0
  284. package/skills/synap-schema/before-you-touch.md +14 -0
  285. package/skills/synap-schema/common-mistakes.md +9 -0
  286. package/skills/synap-schema/creating-profiles.md +17 -0
  287. package/skills/synap-schema/discover-profiles.md +24 -0
  288. package/skills/synap-schema/entity-scope.md +8 -0
  289. package/skills/synap-schema/extend-vs-create.md +31 -0
  290. package/skills/synap-schema/more.md +6 -0
  291. package/skills/synap-schema/overlay-properties.md +22 -0
  292. package/skills/synap-schema/profiles.md +3 -0
  293. package/skills/synap-schema/property-defs.md +29 -0
  294. package/skills/synap-schema/read-before-write.md +50 -0
  295. package/skills/synap-schema/relations.md +18 -0
  296. package/skills/synap-schema/worked-example.md +30 -0
  297. package/skills/synap-ui/SKILL.md +26 -2
  298. package/skills/synap-ui/_order.txt +13 -0
  299. package/skills/synap-ui/_skill.yaml +23 -0
  300. package/skills/synap-ui/ai-companion.md +27 -0
  301. package/skills/synap-ui/arranging-bento.md +8 -0
  302. package/skills/synap-ui/before-you-build.md +20 -0
  303. package/skills/synap-ui/bento-layouts.md +35 -0
  304. package/skills/synap-ui/common-mistakes.md +10 -0
  305. package/skills/synap-ui/creating-views.md +26 -0
  306. package/skills/synap-ui/four-builds.md +24 -0
  307. package/skills/synap-ui/more.md +7 -0
  308. package/skills/synap-ui/proposing-vs-extending.md +11 -0
  309. package/skills/synap-ui/view-list.md +24 -0
  310. package/skills/synap-ui/views.md +3 -0
  311. package/skills/synap-ui/worked-example.md +18 -0
  312. package/skills/synap-ui/workspaces.md +47 -0
  313. package/templates/automations/bookmark-enrichment.automation.json +44 -0
  314. package/templates/automations/mail-feed.automation.json +86 -0
  315. package/templates/automations/url-bookmark-capture.automation.json +70 -0
  316. package/templates/skills/README.md +21 -0
  317. package/templates/skills/authoring-automations/SKILL.md +95 -0
  318. package/templates/skills/authoring-automations/reference/node-matrix.md +49 -0
  319. package/templates/skills/authoring-capabilities/SKILL.md +93 -0
  320. package/templates/skills/authoring-capabilities/reference/template-anatomy.md +70 -0
  321. package/templates/skills/authoring-playbooks/SKILL.md +102 -0
  322. package/templates/skills/authoring-playbooks/reference/stages-contract.md +35 -0
  323. package/templates/skills/authoring-playbooks/reference/worked-example.md +64 -0
  324. package/templates/skills/bookmark-enrichment/SKILL.md +40 -0
  325. package/templates/skills/coordinating-agents/SKILL.md +32 -0
  326. package/templates/skills/coordinating-branches/SKILL.md +27 -0
  327. package/templates/skills/mapping-the-server/SKILL.md +54 -0
  328. package/templates/skills/reading-client-progress/SKILL.md +65 -0
  329. package/templates/skills/routing-to-channels/SKILL.md +54 -0
  330. package/templates/skills/stellar-scf-grants-advisor/ASSOCIATE-CHEATSHEET.md +133 -0
  331. package/templates/skills/stellar-scf-grants-advisor/ASSOCIATE-ONBOARDING-GUIDE.md +761 -0
  332. package/templates/skills/stellar-scf-grants-advisor/CLIENT-FAQ.md +181 -0
  333. package/templates/skills/stellar-scf-grants-advisor/PARTNER-HANDOVER.md +130 -0
  334. package/templates/skills/stellar-scf-grants-advisor/SKILL.md +102 -0
  335. package/templates/skills/stellar-scf-grants-advisor/examples/README.md +43 -0
  336. package/templates/skills/stellar-scf-grants-advisor/examples/chat-summary-templates.md +158 -0
  337. package/templates/skills/stellar-scf-grants-advisor/examples/corpus-comparable-rows.md +136 -0
  338. package/templates/skills/stellar-scf-grants-advisor/examples/q10-team-rewrites.md +109 -0
  339. package/templates/skills/stellar-scf-grants-advisor/examples/q2-description-rewrites.md +88 -0
  340. package/templates/skills/stellar-scf-grants-advisor/examples/q6-integration-rewrites.md +107 -0
  341. package/templates/skills/stellar-scf-grants-advisor/examples/tranche-structures.md +176 -0
  342. package/templates/skills/stellar-scf-grants-advisor/reference/01-methodology.md +96 -0
  343. package/templates/skills/stellar-scf-grants-advisor/reference/02-scoring-framework.md +199 -0
  344. package/templates/skills/stellar-scf-grants-advisor/reference/03-rejection-patterns.md +241 -0
  345. package/templates/skills/stellar-scf-grants-advisor/reference/04-winner-patterns.md +120 -0
  346. package/templates/skills/stellar-scf-grants-advisor/reference/05-comeback-patterns.md +92 -0
  347. package/templates/skills/stellar-scf-grants-advisor/reference/06-budget-benchmarks.md +125 -0
  348. package/templates/skills/stellar-scf-grants-advisor/reference/07-integration-list.md +147 -0
  349. package/templates/skills/stellar-scf-grants-advisor/reference/08-abstract-fields.md +258 -0
  350. package/templates/skills/stellar-scf-grants-advisor/reference/09-build-fields.md +259 -0
  351. package/templates/skills/stellar-scf-grants-advisor/reference/10-corpus-winners.md +135 -0
  352. package/templates/skills/stellar-scf-grants-advisor/reference/11-corpus-rejects.md +267 -0
  353. package/templates/skills/stellar-scf-grants-advisor/reference/12-client-communication.md +131 -0
  354. package/templates/skills/stellar-scf-grants-advisor/reference/13-excel-output-spec.md +199 -0
  355. package/templates/skills/stellar-scf-grants-advisor/reference/14-worked-examples.md +160 -0
  356. package/templates/skills/stellar-scf-grants-advisor/templates/abstract-review-builder.py +253 -0
  357. package/templates/skills/stellar-scf-grants-advisor/templates/build-review-builder.py +213 -0
  358. package/dist/commands/connectors.d.ts +0 -31
  359. package/dist/commands/connectors.js +0 -276
  360. package/dist/commands/connectors.js.map +0 -1
  361. package/dist/commands/finish.d.ts +0 -25
  362. package/dist/commands/finish.js +0 -274
  363. package/dist/commands/finish.js.map +0 -1
  364. package/dist/commands/openclaw.d.ts +0 -40
  365. package/dist/commands/openclaw.js +0 -1148
  366. package/dist/commands/openclaw.js.map +0 -1
  367. package/dist/commands/security-audit.d.ts +0 -12
  368. package/dist/commands/security-audit.js +0 -100
  369. package/dist/commands/security-audit.js.map +0 -1
  370. package/dist/lib/hardening.d.ts +0 -18
  371. package/dist/lib/hardening.js +0 -214
  372. package/dist/lib/hardening.js.map +0 -1
@@ -24,6 +24,15 @@ interface HubEntity {
24
24
  dueDate?: string;
25
25
  content?: string;
26
26
  url?: string;
27
+ /** Short, server-generated summary suitable for lists and agent context. */
28
+ preview?: string | null;
29
+ /** Optional long-form summary returned by entity detail routes. */
30
+ description?: string | null;
31
+ /** Linked versioned document, when this entity has long-form content. */
32
+ documentId?: string | null;
33
+ /** System-managed fields returned by the canonical entity wire codec. */
34
+ systemData?: Record<string, unknown>;
35
+ version?: number;
27
36
  }
28
37
  interface HubDocument {
29
38
  id: string;
@@ -32,6 +41,9 @@ interface HubDocument {
32
41
  workspaceId: string | null;
33
42
  createdAt: string;
34
43
  updatedAt: string;
44
+ userId?: string;
45
+ type?: "text" | "markdown" | "code" | "html" | "pdf" | "docx";
46
+ language?: string | null;
35
47
  }
36
48
  interface HubChannel {
37
49
  id: string;
@@ -58,6 +70,8 @@ interface HubUser {
58
70
  email?: string;
59
71
  name?: string;
60
72
  scopes?: string[];
73
+ /** True only when the server authenticated this request as an agent credential. */
74
+ isAgent: boolean;
61
75
  }
62
76
  interface HubMemoryResult {
63
77
  id: string;
@@ -77,12 +91,32 @@ interface CreateEntityInput {
77
91
  profileSlug: string;
78
92
  title: string;
79
93
  workspaceId?: string;
94
+ /** Existing project to file this entity into via `belongs_to_project`. */
95
+ projectId?: string;
96
+ /** Short description rendered with the entity; long-form text belongs in content. */
97
+ description?: string;
80
98
  properties?: Record<string, unknown>;
81
99
  content?: string;
82
100
  url?: string;
83
101
  status?: string;
84
102
  priority?: "low" | "medium" | "high" | "urgent";
85
103
  dueDate?: string;
104
+ agentUserId?: string;
105
+ sessionId?: string;
106
+ reasoning?: string;
107
+ /** Origin signal for audit/provenance. It does not grant permissions. */
108
+ source?: HubWriteSource;
109
+ sourceMessageId?: string;
110
+ extractedFromMessageId?: string;
111
+ /** Role profiles to attach with this entity when the write applies inline. */
112
+ facets?: Array<{
113
+ /** `profileSlug` is accepted by REST; `slug` remains valid for legacy callers. */
114
+ profileSlug?: string;
115
+ slug?: string;
116
+ status?: string;
117
+ properties?: Record<string, unknown>;
118
+ contextEntityId?: string;
119
+ }>;
86
120
  }
87
121
  interface UpdateEntityInput {
88
122
  title?: string;
@@ -98,6 +132,45 @@ interface CreateDocumentInput {
98
132
  content?: string;
99
133
  workspaceId?: string;
100
134
  entityId?: string;
135
+ type?: HubDocument["type"];
136
+ reasoning?: string;
137
+ agentUserId?: string;
138
+ sourceMessageId?: string;
139
+ sessionId?: string;
140
+ }
141
+ /** Full-document replacement input for PATCH /documents/:id. */
142
+ interface UpdateDocumentInput {
143
+ content: string;
144
+ title?: string;
145
+ agentUserId?: string;
146
+ sourceMessageId?: string;
147
+ sessionId?: string;
148
+ }
149
+ interface HubDocumentChange {
150
+ op: "insert" | "delete" | "replace";
151
+ position?: number;
152
+ range?: [number, number];
153
+ text?: string;
154
+ }
155
+ /** Submit a governed edit proposal without replacing a document directly. */
156
+ interface CreateDocumentProposalInput {
157
+ documentId: string;
158
+ agentUserId?: string;
159
+ threadId?: string;
160
+ sourceMessageId?: string;
161
+ sessionId?: string;
162
+ proposalType?: "ai_edit" | "user_suggestion" | "review_comment";
163
+ changes: HubDocumentChange[];
164
+ proposedContent: string;
165
+ originalContent?: string;
166
+ }
167
+ /** Proposal rows vary slightly by pod version; these stable fields are shared. */
168
+ interface HubDocumentProposalResult {
169
+ id?: string;
170
+ proposalId?: string;
171
+ status?: string;
172
+ reviewUrl?: string;
173
+ [key: string]: unknown;
101
174
  }
102
175
  interface StoreMemoryInput {
103
176
  fact: string;
@@ -124,12 +197,59 @@ interface PodStatus {
124
197
  healthy: boolean;
125
198
  version?: string;
126
199
  }
200
+ /**
201
+ * A single tappable chip in a structured follow-up. Mirrors the IS `structure`
202
+ * output and the frontend capture-pipeline contract EXACTLY (do NOT narrow).
203
+ */
204
+ interface FollowUpChip {
205
+ label: string;
206
+ value: string;
207
+ action: "link_entity" | "set_property" | "add_relation" | "confirm" | "dismiss";
208
+ icon?: string;
209
+ entityId?: string;
210
+ propertyKey?: string;
211
+ }
212
+ /** Structured follow-up the IS may emit instead of a plain string question. */
213
+ interface StructuredFollowUp {
214
+ question: string;
215
+ suggestions: FollowUpChip[];
216
+ }
217
+ /** One field of an AI-authored dynamic form. `type` is a free string (field kind). */
218
+ interface DynamicFormField {
219
+ key: string;
220
+ label: string;
221
+ type: string;
222
+ constraints?: {
223
+ enum?: string[];
224
+ min?: number;
225
+ max?: number;
226
+ pattern?: string;
227
+ };
228
+ required?: boolean;
229
+ help?: string;
230
+ }
231
+ /** AI-authored guided-capture form spec (additive, null-safe). */
232
+ interface DynamicFormSpec {
233
+ title?: string;
234
+ note?: string;
235
+ fields: DynamicFormField[];
236
+ }
127
237
  interface CaptureProposal {
128
238
  tempId: string;
129
239
  profileSlug: string;
130
240
  title: string;
131
241
  description?: string;
242
+ /** Long-form body preserved through plan → commit as a linked document. */
243
+ content?: string;
132
244
  properties?: Record<string, unknown>;
245
+ /** Role profiles proposed alongside the primary kind. */
246
+ facets?: Array<{
247
+ profileSlug: string;
248
+ status?: string;
249
+ properties?: Record<string, unknown>;
250
+ /** Batch-local entity reference used by captureExecute. */
251
+ contextTempId?: string;
252
+ }>;
133
253
  confidence: number;
134
254
  action: "create" | "link" | "dismiss";
135
255
  linkedEntityId?: string;
@@ -149,10 +269,29 @@ interface CaptureRelation {
149
269
  interface CaptureStructureResponse {
150
270
  proposals: CaptureProposal[];
151
271
  relations: CaptureRelation[];
152
- followUp: string | null;
272
+ /** The intelligence service was unavailable, so the pod returned a raw-note fallback. */
273
+ degraded?: boolean;
274
+ followUp: string | StructuredFollowUp | null;
275
+ formSpec?: DynamicFormSpec | null;
276
+ targetWorkspaceId?: string | null;
277
+ targetWorkspaceConfidence?: number | null;
278
+ targetWorkspaceReason?: string | null;
279
+ targetProjectId?: string | null;
280
+ /**
281
+ * Soft meta-structure suggestions (display-only chips). Never materialize.
282
+ * Additive — absent when the model has nothing to suggest.
283
+ */
284
+ architectureSuggestions?: Array<{
285
+ kind?: "workspace_template" | "new_workspace" | "project" | "view" | "role" | "playbook";
286
+ title: string;
287
+ reason?: string;
288
+ confidence?: number;
289
+ payload?: Record<string, unknown>;
290
+ }>;
153
291
  dedupCandidates?: Record<string, Array<{
154
292
  entityId: string;
155
293
  title: string;
294
+ profileSlug: string;
156
295
  score: number;
157
296
  }>>;
158
297
  }
@@ -163,11 +302,116 @@ interface CaptureExecuteInput {
163
302
  title: string;
164
303
  description?: string;
165
304
  properties?: Record<string, unknown>;
166
- action: "create" | "link" | "dismiss";
305
+ /** Legacy structure-output field; the execute route ignores it. */
306
+ action?: "create" | "link" | "dismiss";
167
307
  linkedEntityId?: string;
168
308
  confidence?: number;
309
+ /** Long-form body materialized as a linked document by the capture pipeline. */
310
+ content?: string;
311
+ /** Reuse an existing entity instead of creating one for this batch entry. */
312
+ existingEntityId?: string;
313
+ /** Role profiles to attach after the primary kind materializes. */
314
+ facets?: Array<{
315
+ profileSlug: string;
316
+ status?: string;
317
+ properties?: Record<string, unknown>;
318
+ contextTempId?: string;
319
+ }>;
169
320
  }>;
170
321
  relations?: CaptureRelation[];
322
+ /** Cross-cutting project lens to file the created entities into. */
323
+ projectId?: string | null;
324
+ /** Explicit reviewed placement override; unlike workspaceId it is never inferred. */
325
+ targetWorkspaceId?: string | null;
326
+ /** Preserve the original binary source with the primary derived entity. */
327
+ keepRaw?: boolean;
328
+ file?: {
329
+ /** Base64 payload; server caps it at about 5MB decoded. */
330
+ content: string;
331
+ mimeType: string;
332
+ filename?: string;
333
+ };
334
+ /** Client-stable retry namespace for this capture execution. */
335
+ idempotencyKey?: string;
336
+ /**
337
+ * Workspace routing (shared across all capture doors). Forward the AI's
338
+ * structure hints + the caller's mode so the door auto-routes; the backend
339
+ * decides the final workspace (auto/ask/locked, confidence + membership gated).
340
+ */
341
+ workspaceRouting?: "auto" | "ask" | "locked";
342
+ aiWorkspaceId?: string | null;
343
+ aiWorkspaceConfidence?: number | null;
344
+ aiWorkspaceReason?: string | null;
345
+ }
346
+ /** One planned entity in the proposal-first graph capture door. */
347
+ interface CaptureGraphEntity {
348
+ /** Batch-local ID used by relations and bindings. Must be unique per request. */
349
+ ref: string;
350
+ profileSlug: string;
351
+ title?: string;
352
+ /** Short descriptive body retained on the approved entity. */
353
+ description?: string;
354
+ /** Long-form body materialized through the canonical document path on approval. */
355
+ content?: string;
356
+ properties?: Record<string, unknown>;
357
+ /** Link this graph node to an existing entity rather than creating it. */
358
+ existingEntityId?: string;
359
+ /** Role profiles to attach after the primary kind materializes. */
360
+ facets?: Array<{
361
+ profileSlug: string;
362
+ status?: string;
363
+ properties?: Record<string, unknown>;
364
+ contextRef?: string;
365
+ }>;
366
+ }
367
+ interface CaptureGraphRelation {
368
+ sourceRef: string;
369
+ targetRef: string;
370
+ type: string;
371
+ }
372
+ /** Optional post-approval external-channel binding for an entity in the graph. */
373
+ interface CaptureGraphBinding {
374
+ externalChannelId: string;
375
+ entityRef: string;
376
+ branchPurpose?: "client-comms" | "team";
377
+ title?: string;
378
+ }
379
+ /**
380
+ * Bounded original-input context retained in proposal data for review/retry.
381
+ * It is deliberately not a materialized source artifact or entity provenance.
382
+ */
383
+ interface CaptureGraphRawSource {
384
+ rawText?: string;
385
+ sourceUrl?: string;
386
+ label?: string;
387
+ mimeType?: string;
388
+ hash?: string;
389
+ idempotencyKey?: string;
390
+ }
391
+ /** Input for POST /capture/graph. The server always creates one composite proposal. */
392
+ interface SubmitCaptureGraphInput {
393
+ workspaceId?: string | null;
394
+ /** Existing project to file every newly created graph entity into on approval. */
395
+ projectId?: string | null;
396
+ /** Origin signal preserved through proposal approval and materialization. */
397
+ source?: HubWriteSource;
398
+ sourceMessageId?: string;
399
+ sessionId?: string;
400
+ rawSource?: CaptureGraphRawSource;
401
+ entities: CaptureGraphEntity[];
402
+ relations?: CaptureGraphRelation[];
403
+ bindings?: CaptureGraphBinding[];
404
+ summary?: string;
405
+ }
406
+ interface SubmitCaptureGraphResult {
407
+ /** Composite graph writes are proposal-first, so this receipt begins pending. */
408
+ writeReceipt?: HubWriteReceipt;
409
+ proposalId?: string;
410
+ entityCount: number;
411
+ relationCount: number;
412
+ bindingCount: number;
413
+ reviewUrl?: string;
414
+ summary: string;
171
415
  }
172
416
  interface CaptureExecuteResponse {
173
417
  created: Array<{
@@ -181,6 +425,33 @@ interface CaptureExecuteResponse {
181
425
  targetTempId: string;
182
426
  relationType: string;
183
427
  }>;
428
+ /** Set when AUTO routing moved the capture to the AI-resolved workspace. */
429
+ movedToWorkspace?: string;
430
+ /** Set in ASK mode — a suggested switch for the surface to confirm. */
431
+ pendingWorkspaceSwitch?: {
432
+ suggestedWorkspaceId: string;
433
+ reason: string | null;
434
+ confidence: number | null;
435
+ };
436
+ }
437
+ /** One substrate's slice of an `ask` answer (semantic / procedural / episodic). */
438
+ interface AskAnswerBlock {
439
+ substrate: string;
440
+ items: Array<Record<string, unknown>>;
441
+ status: "ok" | "error";
442
+ }
443
+ /**
444
+ * The provenance-tagged result of `ask` — glass-box: it says which substrates
445
+ * were queried (`routedTo`), what the query's cue suggested (`intent`), and the
446
+ * per-substrate answer blocks. Shape mirrors the backend `AskResult`.
447
+ */
448
+ interface AskResponse {
449
+ query: string;
450
+ routedTo: string[];
451
+ intent: string;
452
+ answers?: AskAnswerBlock[];
453
+ verdict?: string;
454
+ [key: string]: unknown;
184
455
  }
185
456
  interface HubRelation {
186
457
  id: string;
@@ -204,22 +475,30 @@ interface HubGraphResult {
204
475
  edges: HubGraphEdge[];
205
476
  }
206
477
  /**
207
- * A single link returned by getConnections() — unified view across three sources:
478
+ * A single link returned by getConnections() across the local graph:
208
479
  * - `"graph"` : an explicit row in the relations table
209
- * - `"property"` : derived from another entity's `entity_id` property pointing here
210
- * - `"thread"` : a chat thread created, updated, or referenced this entity
480
+ * - `"property"` : an inbound or outbound `entity_id` property edge
481
+ * - `"thread"` / `"context_channel"` : a channel that touched or is about this entity
482
+ * - `"focus_session"` : a session anchored to this entity
211
483
  */
212
484
  interface HubConnection {
213
485
  entityId: string;
214
486
  entity: HubEntity | null;
215
487
  label: string;
216
488
  direction: "outgoing" | "incoming" | "structural";
217
- source: "graph" | "property" | "thread";
489
+ source: "graph" | "property" | "thread" | "context_channel" | "focus_session";
490
+ relationId?: string;
218
491
  relationType?: string;
219
492
  propertySlug?: string;
220
493
  propertyLabel?: string;
221
494
  channelId?: string;
222
495
  channelRelationshipType?: string;
496
+ channelTitle?: string | null;
497
+ channelWorkspaceId?: string | null;
498
+ focusSessionId?: string;
499
+ focusSessionGoal?: string;
500
+ focusSessionStatus?: string;
501
+ focusSessionWorkspaceId?: string | null;
223
502
  createdAt?: string | null;
224
503
  }
225
504
  interface HubConnectionsResult {
@@ -229,6 +508,8 @@ interface HubConnectionsResult {
229
508
  graph: number;
230
509
  structural: number;
231
510
  threads: number;
511
+ contextChannels?: number;
512
+ focusSessions?: number;
232
513
  };
233
514
  }
234
515
  interface HubProfile {
@@ -241,6 +522,10 @@ interface HubProfile {
241
522
  icon?: string;
242
523
  color?: string;
243
524
  properties?: HubPropertyDef[];
525
+ /** Primary entity kind or attachable role/facet. Defaults to kind on old pods. */
526
+ profileKind?: "kind" | "role";
527
+ /** Kinds this role can be attached to; null means the pod did not constrain it. */
528
+ applicableKinds?: string[] | null;
244
529
  }
245
530
  interface HubPropertyDef {
246
531
  id: string;
@@ -256,6 +541,15 @@ interface HubDiscoverProperty {
256
541
  type: string;
257
542
  options?: string[];
258
543
  required?: boolean;
544
+ /** Default the validator applies when this property is omitted. */
545
+ defaultValue?: unknown;
546
+ /** Exact validation constraints used by the property validator. */
547
+ constraints?: Record<string, unknown>;
548
+ /** Target kind for an entity_id property, when configured. */
549
+ targetProfileSlug?: string;
550
+ /** Base definitions are always visible; workspace definitions require this lens. */
551
+ schemaScope?: "base" | "workspace";
552
+ workspaceId?: string | null;
259
553
  }
260
554
  interface HubDiscoverProfile {
261
555
  slug: string;
@@ -263,14 +557,91 @@ interface HubDiscoverProfile {
263
557
  scope: "pod" | "workspace";
264
558
  description?: string | null;
265
559
  icon?: string | null;
266
- properties: HubDiscoverProperty[];
267
- createCommand: string;
560
+ /** Omitted by the summary tier. */
561
+ properties?: HubDiscoverProperty[];
562
+ /** Omitted by the summary tier. */
563
+ createCommand?: string;
564
+ profileKind?: "kind" | "role";
565
+ applicableKinds?: string[] | null;
268
566
  }
269
567
  interface HubDiscoverResult {
270
568
  profiles: HubDiscoverProfile[];
271
569
  commands: Record<string, string>;
272
570
  hint: string;
273
571
  }
572
+ /** Progressive-disclosure controls for GET /discover. */
573
+ interface HubDiscoverOptions {
574
+ /**
575
+ * Omit to read the base/pod schema only. Supplying a workspace resolves only
576
+ * that workspace's overlays; callers must never substitute a default here.
577
+ */
578
+ workspaceId?: string;
579
+ /** Return the digest tier without property schemas. */
580
+ summary?: boolean;
581
+ /** Limit full discovery to these profile slugs when the pod supports it. */
582
+ profileSlugs?: string[];
583
+ }
584
+ type HubOrientScope = "workspaces" | "projects" | "profiles";
585
+ type HubOrientDetail = "light" | "full";
586
+ interface HubOrientProfile {
587
+ slug: string;
588
+ name: string;
589
+ profileKind: "kind" | "role";
590
+ applicableKinds?: string[] | null;
591
+ /** Placement for entities of this kind; distinct from profile visibility. */
592
+ entityScope?: "pod" | "workspace" | null;
593
+ }
594
+ interface HubOrientWorkspace {
595
+ id: string;
596
+ name: string;
597
+ domain: string | null;
598
+ entityCount: number;
599
+ onboarding?: Record<string, unknown>;
600
+ description?: string | null;
601
+ profiles?: HubOrientProfile[];
602
+ }
603
+ interface HubOrientProject {
604
+ id: string;
605
+ name: string;
606
+ description: string | null;
607
+ status: string | null;
608
+ workspaceId: string | null;
609
+ homeWorkspace: string | null;
610
+ }
611
+ /**
612
+ * Prompt-facing team roster for a workspace (no emails). Present when the
613
+ * pinned/sample workspace has human members. Treat as internal — not contacts.
614
+ */
615
+ interface HubOrientTeamRoster {
616
+ instructionBlock: string | null;
617
+ names: string[];
618
+ members: Array<{
619
+ displayName: string;
620
+ personId?: string | null;
621
+ }>;
622
+ }
623
+ /** Canonical session bootstrap response shared by MCP, CLI, and REST surfaces. */
624
+ interface HubOrientResult {
625
+ me: {
626
+ userId: string;
627
+ scopes: string[];
628
+ };
629
+ detail: HubOrientDetail;
630
+ projects: HubOrientProject[];
631
+ projectCount: number;
632
+ workspaces: HubOrientWorkspace[];
633
+ workspaceCount: number;
634
+ profiles: HubOrientProfile[];
635
+ note: string;
636
+ /** Internal team for the pinned/sample workspace — omitted when empty. */
637
+ teamRoster?: HubOrientTeamRoster;
638
+ }
639
+ interface HubOrientOptions {
640
+ detail?: HubOrientDetail;
641
+ scope?: HubOrientScope[];
642
+ workspaceId?: string;
643
+ projectId?: string;
644
+ }
274
645
  interface HubThread {
275
646
  id: string;
276
647
  name?: string;
@@ -315,6 +686,9 @@ interface HubView {
315
686
  profileSlug?: string;
316
687
  workspaceId?: string;
317
688
  config?: Record<string, unknown>;
689
+ metadata?: Record<string, unknown>;
690
+ profileId?: string | null;
691
+ userId?: string;
318
692
  createdAt: string;
319
693
  updatedAt: string;
320
694
  }
@@ -341,8 +715,34 @@ interface HubUserContext {
341
715
  activeThreads: HubThread[];
342
716
  workspaceSummary?: Record<string, unknown>;
343
717
  }
718
+ type HubWriteSource = "intelligence" | "agent" | "openwebui-pipeline" | "extension" | "cli" | "n8n" | "raycast";
719
+ /**
720
+ * Truthful outcome envelope shared by direct and proposal-first write doors.
721
+ * `partial` means independently-applied sub-operations failed; it never
722
+ * implies an atomic rollback.
723
+ */
724
+ interface HubWriteReceipt {
725
+ state: "pending" | "applied" | "partial";
726
+ proposalId?: string;
727
+ reviewUrl?: string;
728
+ entityId?: string;
729
+ proposedEntityId?: string;
730
+ profileSlug?: string;
731
+ effectiveWorkspaceId?: string | null;
732
+ projectId?: string;
733
+ source?: HubWriteSource;
734
+ facets?: Array<{
735
+ slug: string;
736
+ outcome: "attached" | "proposed" | "dropped" | "error" | string;
737
+ facetId?: string;
738
+ proposalId?: string;
739
+ error?: string;
740
+ }>;
741
+ warnings?: string[];
742
+ }
344
743
  interface HubGovernanceResult {
345
- status: "approved" | "proposed" | "denied";
744
+ /** `created` is an inline, materialized write; `proposed` remains pending. */
745
+ status: "approved" | "created" | "proposed" | "denied";
346
746
  id?: string;
347
747
  proposalId?: string;
348
748
  reason?: string;
@@ -358,16 +758,18 @@ interface HubGovernanceResult {
358
758
  */
359
759
  reasoning?: string;
360
760
  /**
361
- * Pod-relative path for the review UI: `/proposals/{id}`.
761
+ * Pod-relative path into the app: `/open/{id}`.
362
762
  * Present on `proposed` responses.
363
763
  */
364
764
  reviewPath?: string;
365
765
  /**
366
- * Absolute URL for the review UI (defaults to `studio.synap.live`,
367
- * overridable via `SYNAP_APP_URL` on the pod). Surface this directly to
368
- * the user so they can approve without digging through the app.
766
+ * Absolute clickable link into the app: `${PUBLIC_URL}/open/{id}`. The pod
767
+ * resolves the id's type server-side and bounces to the Electron app. Surface
768
+ * this directly to the user so they can approve without digging through the app.
369
769
  */
370
770
  reviewUrl?: string;
771
+ /** Additive receipt for write-aware clients. Legacy clients may keep using status/id. */
772
+ writeReceipt?: HubWriteReceipt;
371
773
  }
372
774
  interface CreateThreadInput {
373
775
  name?: string;
@@ -386,13 +788,220 @@ interface CreateRelationInput {
386
788
  workspaceId?: string;
387
789
  userId?: string;
388
790
  }
791
+ /** Attach an existing role-profile to a primary-kind entity. */
792
+ interface AttachFacetInput {
793
+ entityId: string;
794
+ profileSlug?: string;
795
+ profileId?: string;
796
+ workspaceId?: string | null;
797
+ contextEntityId?: string | null;
798
+ status?: string;
799
+ properties?: Record<string, unknown>;
800
+ reasoning?: string;
801
+ }
802
+ /**
803
+ * Result of `POST /entities/{entityId}/facets`.
804
+ *
805
+ * NOT a `HubGovernanceResult`: the facet door's inline-write status is
806
+ * `attached` (never `created`/`approved`), and it reports the new row as
807
+ * `facetId` rather than `id`. Source of truth for both branches:
808
+ * `entities.attachFacet` in `packages/api/src/routers/entities.ts`.
809
+ */
810
+ interface HubAttachFacetResult {
811
+ status: "attached" | "proposed";
812
+ message?: string;
813
+ /** Present on the inline `attached` branch. */
814
+ facetId?: string;
815
+ /** The materialized facet row on `attached`; `null` on `proposed`. */
816
+ facet?: Record<string, unknown> | null;
817
+ /** Present on the `proposed` branch. */
818
+ proposalId?: string;
819
+ proposalType?: string;
820
+ reviewUrl?: string;
821
+ }
389
822
  interface CreateViewInput {
390
823
  name: string;
391
824
  type: HubView["type"];
392
825
  profileSlug?: string;
393
826
  workspaceId: string;
394
827
  config?: Record<string, unknown>;
828
+ metadata?: Record<string, unknown>;
829
+ userId?: string;
830
+ agentUserId?: string;
831
+ reasoning?: string;
832
+ sourceMessageId?: string;
833
+ }
834
+ interface UpdateViewInput {
835
+ name?: string;
836
+ config?: Record<string, unknown>;
837
+ metadata?: Record<string, unknown>;
838
+ workspaceId?: string;
839
+ userId?: string;
840
+ agentUserId?: string;
841
+ reasoning?: string;
842
+ sourceMessageId?: string;
843
+ }
844
+ interface BentoWidgetInput {
845
+ /** Canonical Hub-router field naming the cell type. */
846
+ key: string;
847
+ x: number;
848
+ y: number;
849
+ w: number;
850
+ h: number;
851
+ config?: Record<string, unknown>;
852
+ props?: Record<string, unknown>;
853
+ }
854
+ interface ArrangeBentoViewInput {
855
+ workspaceId?: string;
395
856
  userId?: string;
857
+ widgets: BentoWidgetInput[];
858
+ agentUserId?: string;
859
+ reasoning?: string;
860
+ sourceMessageId?: string;
861
+ }
862
+ interface HubBentoArrangementResult {
863
+ status: string;
864
+ viewId?: string;
865
+ widgetCount?: number;
866
+ message?: string;
867
+ proposalId?: string;
868
+ reviewUrl?: string;
869
+ }
870
+ interface HubCapabilityVerb {
871
+ id?: string;
872
+ verbId?: string;
873
+ label?: string;
874
+ type?: "read" | "write";
875
+ enabled?: boolean;
876
+ granted?: boolean;
877
+ runnable?: boolean;
878
+ governance?: "auto" | "propose";
879
+ effectiveExecMode?: string;
880
+ govDefault?: string;
881
+ [key: string]: unknown;
882
+ }
883
+ /** Flat capability read-model for callers that need every granted verb. */
884
+ interface HubCapability {
885
+ id?: string;
886
+ name?: string;
887
+ key?: string;
888
+ kind?: string;
889
+ description?: string | null;
890
+ verbs?: HubCapabilityVerb[];
891
+ governance?: Record<string, unknown>;
892
+ approved?: boolean;
893
+ [key: string]: unknown;
894
+ }
895
+ interface HubCapabilityCatalogConnection {
896
+ required: boolean;
897
+ kind: "provider" | "vault" | null;
898
+ provider?: string;
899
+ /** `unavailable`: this pod's Nango doesn't declare the provider — no connect action exists. */
900
+ state: "connected" | "missing" | "expired" | "unavailable";
901
+ account?: string;
902
+ }
903
+ interface HubCapabilityCatalogCard {
904
+ id: string | null;
905
+ key: string;
906
+ name: string;
907
+ description?: string | null;
908
+ source: "installed" | "available";
909
+ status: "available" | "needs_connection" | "connected" | "draft" | "ready" | "partial" | "unavailable";
910
+ connection?: HubCapabilityCatalogConnection;
911
+ verbs: Array<{
912
+ verbId: string;
913
+ label: string;
914
+ type: "read" | "write";
915
+ enabled: boolean;
916
+ governance: "auto" | "propose";
917
+ runnable: boolean;
918
+ }>;
919
+ nextAction: {
920
+ kind: "add" | "connect" | "enable" | "run" | "none";
921
+ hint: string;
922
+ };
923
+ }
924
+ interface HubCapabilityCatalogResult {
925
+ capabilities: HubCapabilityCatalogCard[];
926
+ }
927
+ /** One action the shared capability execute door can launch immediately. */
928
+ interface HubRunnableCapabilityAction {
929
+ skillId?: string;
930
+ verbId?: string;
931
+ label: string;
932
+ description?: string | null;
933
+ tool: string | null;
934
+ connection?: {
935
+ required: true;
936
+ state: "connected";
937
+ provider: string;
938
+ };
939
+ governance: "auto";
940
+ executionMode?: string;
941
+ parameters: Record<string, unknown>;
942
+ }
943
+ interface HubRunnableCapabilityActionsResult {
944
+ actions: HubRunnableCapabilityAction[];
945
+ }
946
+ interface ExecuteCapabilityInput {
947
+ verbId?: string;
948
+ skillId?: string;
949
+ parameters?: Record<string, unknown>;
950
+ workspaceId?: string;
951
+ connectionSelector?: {
952
+ connectionId?: string;
953
+ contextObjectId?: string;
954
+ };
955
+ }
956
+ type ExecuteCapabilityResult = {
957
+ status: "run" | "dry-run";
958
+ skillId: string;
959
+ result?: unknown;
960
+ dryRun?: boolean;
961
+ } | {
962
+ proposed: true;
963
+ proposalId: string;
964
+ reviewUrl?: string;
965
+ };
966
+ interface HubAgentSkill {
967
+ id: string;
968
+ slug: string;
969
+ name: string;
970
+ description: string | null;
971
+ topics: string[];
972
+ body: string | null;
973
+ source: string | null;
974
+ author: string | null;
975
+ version: string | null;
976
+ tags: string[];
977
+ teachesTools: string[];
978
+ skillGroup: string | null;
979
+ alwaysOn: boolean;
980
+ createdAt: string;
981
+ updatedAt: string;
982
+ }
983
+ interface ListAgentSkillsOptions {
984
+ topic?: string;
985
+ query?: string;
986
+ tag?: string;
987
+ /** Restrict to the seeded system/* teaching catalog. */
988
+ system?: boolean;
989
+ /** Include visible workspace-scoped skills for this selected lens. */
990
+ workspaceId?: string;
991
+ limit?: number;
992
+ offset?: number;
993
+ }
994
+ interface HubAgentSkillsResult {
995
+ skills: HubAgentSkill[];
996
+ total: number;
997
+ }
998
+ interface GetCapabilityBriefsInput {
999
+ tools: string[];
1000
+ workspaceId?: string;
1001
+ door?: "chat" | "automation";
1002
+ }
1003
+ interface HubCapabilityBriefsResult {
1004
+ briefs: Record<string, string>;
396
1005
  }
397
1006
  interface ExecuteCommandInput {
398
1007
  slug: string;
@@ -506,20 +1115,60 @@ interface HubRestClientConfig {
506
1115
  apiKey: string;
507
1116
  /** Default workspace ID — used when not specified per call */
508
1117
  workspaceId?: string;
509
- /** Optional request timeout in ms (default: 30000) */
1118
+ /** Optional request timeout in ms (default: 30000). Fallback when read/write timeouts are unset. */
510
1119
  timeoutMs?: number;
1120
+ /** Optional read (GET) timeout in ms (default: timeoutMs ?? 30000). */
1121
+ readTimeoutMs?: number;
1122
+ /** Optional write (non-GET) timeout in ms (default: timeoutMs ?? 30000). */
1123
+ writeTimeoutMs?: number;
1124
+ /**
1125
+ * Max attempts for a request (default: 3). Retries ONLY on network failure or
1126
+ * 5xx — never on 4xx, never on a caller-provided abort. Set to 1 to disable.
1127
+ */
1128
+ maxAttempts?: number;
511
1129
  }
512
1130
  declare class HubRestClient {
513
1131
  private readonly base;
514
1132
  private readonly headers;
515
1133
  private readonly timeoutMs;
1134
+ private readonly readTimeoutMs;
1135
+ private readonly writeTimeoutMs;
1136
+ private readonly maxAttempts;
516
1137
  readonly workspaceId: string | undefined;
517
1138
  /** Cached from GET /users/me — avoids repeated identity calls. */
518
1139
  private resolvedUserId;
519
1140
  constructor(config: HubRestClientConfig);
520
1141
  /** User id for the current API key (Hub REST requires userId on several GETs). */
521
1142
  private resolveUserId;
522
- private request;
1143
+ /**
1144
+ * The ONE shared request loop. Per-method timeout (GET = read, else write, or a
1145
+ * caller override) + up to `maxAttempts` with exponential backoff. Retries ONLY
1146
+ * on a network failure or 5xx; NEVER on a 4xx or a caller abort. Returns the raw
1147
+ * `Response` for any non-5xx (ok OR 4xx) — the typed entry points below decide
1148
+ * how to interpret it. This is the single source of retry/timeout truth, shared
1149
+ * by the CLI and the IS's `ISHubClient` (which reuses the protected entry points
1150
+ * rather than re-implementing fetch).
1151
+ */
1152
+ private fetchWithRetry;
1153
+ /** Build a HubApiError from a non-ok Response (reads the JSON error body). */
1154
+ private toHubError;
1155
+ /** Parse a 2xx body, tolerating an empty/204 response (returns undefined). */
1156
+ private parseBody;
1157
+ /**
1158
+ * Typed JSON request — throws `HubApiError` on any non-2xx. Protected so the IS
1159
+ * subclass reuses it. Tolerates an empty/204 body (returns `undefined`).
1160
+ */
1161
+ protected request<T>(method: string, path: string, body?: unknown, signal?: AbortSignal): Promise<T>;
1162
+ /**
1163
+ * Like `request<T>` but returns `null` on 404/403 (the "absent/forbidden →
1164
+ * empty" contract several IS reads use) instead of throwing.
1165
+ */
1166
+ protected requestOrNull<T>(method: string, path: string, body?: unknown, signal?: AbortSignal): Promise<T | null>;
1167
+ /**
1168
+ * The raw `Response` (same retry/timeout infra), for the few callers that read
1169
+ * `.text()`, branch on status themselves, or need a per-call timeout override.
1170
+ */
1171
+ protected requestRaw(method: string, path: string, body?: unknown, signal?: AbortSignal, timeoutMsOverride?: number): Promise<Response>;
523
1172
  getMe(): Promise<HubUser>;
524
1173
  getWorkspaces(): Promise<HubWorkspace[]>;
525
1174
  provisionAgentWorkspace(input: {
@@ -585,6 +1234,12 @@ declare class HubRestClient {
585
1234
  * Goes through governance — may return "proposed".
586
1235
  */
587
1236
  createRelation(input: CreateRelationInput): Promise<HubGovernanceResult>;
1237
+ /**
1238
+ * Attach a role-profile through the canonical governed facet door. A result
1239
+ * may be `proposed`; callers must surface its review information instead of
1240
+ * claiming the role was applied.
1241
+ */
1242
+ attachFacet(input: AttachFacetInput): Promise<HubAttachFacetResult>;
588
1243
  /**
589
1244
  * Delete a relation by ID (get from getRelations()).
590
1245
  */
@@ -603,10 +1258,10 @@ declare class HubRestClient {
603
1258
  workspaceId?: string;
604
1259
  }): Promise<HubGraphResult>;
605
1260
  /**
606
- * Unified view of everything connected to an entity. Merges three sources:
1261
+ * Unified view of everything connected to an entity across the local graph:
607
1262
  * 1. Graph relations — explicit rows in the relations table (both directions)
608
- * 2. Structural links — entities whose `entity_id` properties point to this entity
609
- * 3. Thread connections — chat threads that touched this entity
1263
+ * 2. Structural links — inbound and outbound `entity_id` property edges
1264
+ * 3. Channel and focus-session connections around this entity
610
1265
  *
611
1266
  * Prefer this over `getRelations()` / `traverseGraph()` when you want the complete
612
1267
  * picture — those only see the relations table and miss property-based links that
@@ -622,12 +1277,20 @@ declare class HubRestClient {
622
1277
  workspaceId?: string;
623
1278
  limit?: number;
624
1279
  }): Promise<HubConnectionsResult>;
1280
+ /**
1281
+ * Canonical session bootstrap shared by the MCP, CLI, and external surfaces.
1282
+ * It is deliberately a lens map, not a profile/schema dump; use discover()
1283
+ * only for the selected profiles needed by the next action.
1284
+ */
1285
+ orient(options?: HubOrientOptions): Promise<HubOrientResult>;
625
1286
  /**
626
1287
  * List all entity profile types in the workspace.
627
1288
  * Always call before creating entities to discover what types are available.
628
1289
  * Returns system profiles (always present) + custom workspace profiles.
629
1290
  */
630
- listProfiles(workspaceId: string): Promise<HubProfile[]>;
1291
+ listProfiles(workspaceId: string, options?: {
1292
+ detail?: "full";
1293
+ }): Promise<HubProfile[]>;
631
1294
  /**
632
1295
  * List property definitions for a workspace, optionally filtered by profile.
633
1296
  */
@@ -641,7 +1304,7 @@ declare class HubRestClient {
641
1304
  * schemas (including custom workspace profiles) and the canonical CLI
642
1305
  * command map. Replaces static skill file profile descriptions.
643
1306
  */
644
- discover(workspaceId?: string): Promise<HubDiscoverResult>;
1307
+ discover(options?: string | HubDiscoverOptions): Promise<HubDiscoverResult>;
645
1308
  /**
646
1309
  * List threads (channels) accessible to a user.
647
1310
  */
@@ -714,6 +1377,11 @@ declare class HubRestClient {
714
1377
  listProposals(options?: {
715
1378
  status?: "pending" | "approved" | "rejected";
716
1379
  workspaceId?: string;
1380
+ /**
1381
+ * "workspace" (default) — applies the client workspaceId filter.
1382
+ * "all" — omits workspaceId so results span every workspace the user can see.
1383
+ */
1384
+ scope?: "workspace" | "all";
717
1385
  limit?: number;
718
1386
  }): Promise<HubProposal[]>;
719
1387
  /**
@@ -734,6 +1402,10 @@ declare class HubRestClient {
734
1402
  * Create a new view. Goes through governance.
735
1403
  */
736
1404
  createView(input: CreateViewInput): Promise<HubGovernanceResult>;
1405
+ /** Update a view through the existing governed Hub route. */
1406
+ updateView(viewId: string, input: UpdateViewInput): Promise<HubView | HubGovernanceResult>;
1407
+ /** Replace a bento view's widget arrangement through the existing Hub route. */
1408
+ arrangeBentoView(viewId: string, input: ArrangeBentoViewInput): Promise<HubBentoArrangementResult>;
737
1409
  /**
738
1410
  * Get a document by ID with full markdown content.
739
1411
  */
@@ -745,6 +1417,36 @@ declare class HubRestClient {
745
1417
  createDocument(input: CreateDocumentInput & {
746
1418
  workspaceId?: string;
747
1419
  }): Promise<HubGovernanceResult>;
1420
+ /** Propose a full document-content replacement through the governed Hub route. */
1421
+ updateDocument(documentId: string, input: UpdateDocumentInput): Promise<HubDocumentProposalResult>;
1422
+ /** Submit a structured, reviewable document-edit proposal. */
1423
+ createDocumentProposal(input: CreateDocumentProposalInput): Promise<HubDocumentProposalResult>;
1424
+ /** Flat capability read-model. Prefer getCapabilityCatalog() for presentation. */
1425
+ listCapabilities(options?: {
1426
+ workspaceId?: string;
1427
+ }): Promise<HubCapability[]>;
1428
+ /** Status-computed, pack-grouped capability catalog for every external surface. */
1429
+ getCapabilityCatalog(options?: {
1430
+ workspaceId?: string;
1431
+ extraKey?: string;
1432
+ }): Promise<HubCapabilityCatalogResult>;
1433
+ /** List only approved, connected actions that this client can execute now. */
1434
+ listRunnableCapabilityActions(options?: {
1435
+ workspaceId?: string;
1436
+ query?: string;
1437
+ kind?: string;
1438
+ limit?: number;
1439
+ }): Promise<HubRunnableCapabilityActionsResult>;
1440
+ /** Run one registered capability through the shared governance gate. */
1441
+ executeCapability(input: ExecuteCapabilityInput): Promise<ExecuteCapabilityResult>;
1442
+ /** List the compact system teaching catalog, or search the available skill index. */
1443
+ listAgentSkills(options?: ListAgentSkillsOptions): Promise<HubAgentSkillsResult>;
1444
+ /** Load one skill body only when it is relevant to the agent's next action. */
1445
+ getAgentSkillBySlug(slug: string, options?: {
1446
+ workspaceId?: string;
1447
+ }): Promise<HubAgentSkill>;
1448
+ /** Compose just-in-time teaching and governance briefs for selected tools. */
1449
+ getCapabilityBriefs(input: GetCapabilityBriefsInput): Promise<HubCapabilityBriefsResult>;
748
1450
  /**
749
1451
  * List available commands (automation shortcuts) in the workspace.
750
1452
  */
@@ -784,6 +1486,34 @@ declare class HubRestClient {
784
1486
  captureExecute(input: CaptureExecuteInput & {
785
1487
  workspaceId?: string;
786
1488
  }): Promise<CaptureExecuteResponse>;
1489
+ /**
1490
+ * Submit a designed entity graph as ONE reviewable composite proposal.
1491
+ *
1492
+ * This is intentionally distinct from captureExecute(): execute materializes
1493
+ * a prior structure result immediately, while this door keeps an autonomous
1494
+ * graph plan reviewable and applies entities, relations, and bindings together
1495
+ * only after approval.
1496
+ */
1497
+ submitCaptureGraph(input: SubmitCaptureGraphInput): Promise<SubmitCaptureGraphResult>;
1498
+ /**
1499
+ * `ask` — the unified recall verb. Routes a natural-language question across
1500
+ * all knowledge substrates (semantic entities, procedural runbooks, episodic
1501
+ * facts) server-side and returns ONE provenance-tagged answer. The canonical
1502
+ * recall door — prefer it over the fragmented searchEntities / recallMemory.
1503
+ * The server builds the profile catalog from the caller's workspace; the
1504
+ * client only sends the query (+ optional scope).
1505
+ */
1506
+ ask(input: {
1507
+ query: string;
1508
+ workspaceId?: string;
1509
+ limit?: number;
1510
+ /**
1511
+ * Return just the glass-box understanding + routing (no retrieval) — for a
1512
+ * caller that routes a query before fetching results (e.g. a palette
1513
+ * completing a type word). `answers` comes back empty.
1514
+ */
1515
+ parseOnly?: boolean;
1516
+ }): Promise<AskResponse>;
787
1517
  /**
788
1518
  * List automations for the current user, optionally filtered by workspace and status.
789
1519
  */
@@ -885,8 +1615,18 @@ declare class HubApiError extends Error {
885
1615
  * These functions are the canonical implementations shared between
886
1616
  * the Synap CLI and the Raycast extension. They use the native fetch API
887
1617
  * and have zero Node.js-specific dependencies.
1618
+ *
1619
+ * ⚠️ `assertValidPodUrl` below is a DUPLICATE of the guard in
1620
+ * `@synap-core/auth-bootstrap` (`src/url.ts`). It is copied, not imported,
1621
+ * because this package is deliberately zero-dependency. The two copies must
1622
+ * be kept in sync — change one, change the other.
888
1623
  */
889
1624
 
1625
+ /** Shared per-request knobs for the credential-bearing bootstrap calls. */
1626
+ interface BootstrapRequestOptions {
1627
+ /** Allow `http://` pod URLs (localhost / local-mode dev only). */
1628
+ allowHttp?: boolean;
1629
+ }
890
1630
  /**
891
1631
  * Check whether a Synap pod is healthy.
892
1632
  * Hits `GET {podUrl}/health` with a 5s timeout.
@@ -902,6 +1642,6 @@ declare function checkPodHealth(podUrl: string): Promise<PodStatus>;
902
1642
  *
903
1643
  * Endpoint: `POST {podUrl}/api/hub/setup/agent`
904
1644
  */
905
- declare function setupAgent(podUrl: string, provisioningToken: string, agentType?: string): Promise<AgentSetupResult>;
1645
+ declare function setupAgent(podUrl: string, provisioningToken: string, agentType: string, opts?: BootstrapRequestOptions): Promise<AgentSetupResult>;
906
1646
 
907
- export { type AgentSetupResult, type CaptureExecuteInput, type CaptureExecuteResponse, type CaptureProposal, type CaptureRelation, type CaptureStructureResponse, type CreateDocumentInput, type CreateEntityInput, type CreateRelationInput, type CreateThreadInput, type CreateViewInput, type ExecuteCommandInput, type HubAgentUser, HubApiError, type HubChannel, type HubCommand, type HubConnection, type HubConnectionsResult, type HubDiscoverProfile, type HubDiscoverProperty, type HubDiscoverResult, type HubDocument, type HubEntity, type HubGovernanceResult, type HubGraphEdge, type HubGraphNode, type HubGraphResult, type HubListResponse, type HubMemoryResult, type HubMessage, type HubProfile, type HubPropertyDef, type HubProposal, type HubRelation, HubRestClient, type HubRestClientConfig, type HubSearchResult, type HubSingleResponse, type HubThread, type HubThreadContext, type HubUser, type HubUserContext, type HubView, type HubWorkspace, type HubWorkspacesListResponse, type PodStatus, type SendToChannelInput, type StoreMemoryInput, type UpdateEntityInput, checkPodHealth, setupAgent };
1647
+ export { type AgentSetupResult, type ArrangeBentoViewInput, type AskAnswerBlock, type AskResponse, type BentoWidgetInput, type CaptureExecuteInput, type CaptureExecuteResponse, type CaptureGraphBinding, type CaptureGraphEntity, type CaptureGraphRawSource, type CaptureGraphRelation, type CaptureProposal, type CaptureRelation, type CaptureStructureResponse, type CreateDocumentInput, type CreateDocumentProposalInput, type CreateEntityInput, type CreateRelationInput, type CreateThreadInput, type CreateViewInput, type ExecuteCapabilityResult, type ExecuteCommandInput, type GetCapabilityBriefsInput, type HubAgentSkill, type HubAgentSkillsResult, type HubAgentUser, HubApiError, type HubAttachFacetResult, type HubBentoArrangementResult, type HubCapability, type HubCapabilityBriefsResult, type HubCapabilityCatalogCard, type HubCapabilityCatalogConnection, type HubCapabilityCatalogResult, type HubCapabilityVerb, type HubChannel, type HubCommand, type HubConnection, type HubConnectionsResult, type HubDiscoverOptions, type HubDiscoverProfile, type HubDiscoverProperty, type HubDiscoverResult, type HubDocument, type HubDocumentChange, type HubDocumentProposalResult, type HubEntity, type HubGovernanceResult, type HubGraphEdge, type HubGraphNode, type HubGraphResult, type HubListResponse, type HubMemoryResult, type HubMessage, type HubOrientDetail, type HubOrientOptions, type HubOrientProfile, type HubOrientProject, type HubOrientResult, type HubOrientScope, type HubOrientTeamRoster, type HubOrientWorkspace, type HubProfile, type HubPropertyDef, type HubProposal, type HubRelation, HubRestClient, type HubRestClientConfig, type HubRunnableCapabilityAction, type HubRunnableCapabilityActionsResult, type HubSearchResult, type HubSingleResponse, type HubThread, type HubThreadContext, type HubUser, type HubUserContext, type HubView, type HubWorkspace, type HubWorkspacesListResponse, type HubWriteReceipt, type HubWriteSource, type ListAgentSkillsOptions, type PodStatus, type SendToChannelInput, type StoreMemoryInput, type SubmitCaptureGraphInput, type SubmitCaptureGraphResult, type UpdateDocumentInput, type UpdateEntityInput, type UpdateViewInput, checkPodHealth, setupAgent };