@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
@@ -0,0 +1,67 @@
1
+ ## Quick reference — 90% of tasks in 30 lines
2
+
3
+ ```bash
4
+ # CLI (preferred — auth automatic, --json = clean output)
5
+ synap orient --json # discover userId + workspaces + projects
6
+ synap lens # where am I? workspace + project + session (this Claude session)
7
+ synap use <workspace-name-or-id> # focus a workspace (this session)
8
+ synap create entity --profile=task --name="…" --props='{"status":"todo","priority":"high"}' --json
9
+ synap set entity <id> --props='{"status":"done"}' --json # merge-patch (only changed keys)
10
+ synap ask "your question" --json # THE read verb — routes to the right store(s) + shows which answered
11
+ synap capture --type=lesson --claim="…" --json # Work lane (default) — domain knowledge → active workspace
12
+ synap capture --global --type=reference --claim="…" --json # Global lane — pod-wide cross-cutting runbook (knowledge_keys)
13
+ synap observe write "…" --json # User lane — durable user model (inferences proposed)
14
+ ```
15
+
16
+ **The canonical verbs:** `ask` (read) · `capture` (structured write — pick a lane:
17
+ Work default / `--global` / `observe` for User) · `orient` (bootstrap). `note` exists
18
+ for the HUMAN's raw "dump now, structure later" inbox — **the AI always `capture`s
19
+ instead.** **Reading is one verb: `ask`** — it classifies your
20
+ question and routes across the three memory substrates (semantic = the typed entity
21
+ graph, procedural = how-to docs, episodic = raw captures), returning one answer
22
+ tagged with which substrate(s) answered (and which, if any, were unavailable). Don't
23
+ pick a store; `ask` picks for you and tells you what it did. (`graph` for an explicit
24
+ traversal and `get`/`show`/`browse` for direct lookups remain; there is no `search`
25
+ or `recall` — `ask` is the door.)
26
+
27
+ ```bash
28
+ # REST (when no Bash access)
29
+ POST /api/hub/entities body: { userId, workspaceId?, profileSlug, title, description?, properties?, content?, projectId?, facets?, source? }
30
+ PATCH /api/hub/entities/{id} body: { userId, properties } ← deep-merges, send only changed keys
31
+ POST /api/hub/documents body: { userId, workspaceId?, title, content, entityId? }
32
+ PATCH /api/hub/documents/{id} body: { userId, title?, content? } ← full content replacement
33
+ POST /api/hub/relations body: { userId, sourceEntityId, targetEntityId, type }
34
+ GET /api/hub/entities?q=…&profileSlug=task&workspaceId=…
35
+ GET /api/hub/entities/{id}/connections?userId=…
36
+ POST /api/hub/knowledge/ask body: { query, workspaceId?, limit? } ← ONE read door, routes across substrates
37
+ POST /api/hub/memory body: { userId, fact }
38
+ GET /api/hub/memory?userId=…&query=…
39
+ ```
40
+
41
+ **Profile schemas are runtime-discovered — never hardcoded:**
42
+
43
+ ```bash
44
+ synap discover --json # CLI: full profile tree with property schemas + command map
45
+ synap discover --profiles --json # CLI: profiles only
46
+ ```
47
+
48
+ ```
49
+ GET /api/hub/discover?userId={userId}&profileSlugs=task
50
+ → { profiles: [{ slug, displayName, scope, properties: [{ slug, type, required, defaultValue?, constraints?, targetProfileSlug? }], createCommand }], commands: {...} }
51
+ ```
52
+
53
+ Call the summary tier once at session start, then load only the profile schemas
54
+ needed for a write. Omit `workspaceId` for base/pod schema; add it only to see
55
+ that workspace's overlays. Do not rely on a static property list — it will drift.
56
+
57
+ **Load more detail on demand** (`GET /api/hub/skills/system?sections=<id>`):
58
+
59
+ | Section ID | When to load |
60
+ | ------------------------- | ------------------------------------------------------ |
61
+ | `synap:capture` | User pastes multi-entity text (email, transcript, bio) |
62
+ | `synap:governance` | Write was proposed or denied; need to explain policy |
63
+ | `synap:linking` | Custom relation types, auto-sync edge cases |
64
+ | `synap-ui:SKILL` | Building views, bento dashboards, workspaces |
65
+ | `synap-ui:view-types` | Specific view type config shapes |
66
+ | `synap-ui:widget-catalog` | Available widget kinds and their configSchema |
67
+ | `synap-schema:SKILL` | Creating custom profiles or property definitions |
@@ -0,0 +1,43 @@
1
+ ## Reading
2
+
3
+ **Start with `ask` — the one routed read door.** It classifies the question and
4
+ queries the right substrate(s) for you, returning a glass-box answer (which
5
+ substrates answered, which were unavailable, plus the engine's verdict). Reach for
6
+ the low-level doors below only when you deliberately want a single substrate or a
7
+ specific shape (a graph traversal, a typed-entity filter, an entity's neighborhood).
8
+
9
+ ```
10
+ # THE read door — routes across semantic / procedural / episodic, tells you which answered
11
+ POST /api/hub/knowledge/ask body: { query, workspaceId?, limit? }
12
+ → { query, routedTo: [...], primary, answers: [{ substrate, items, status }], degraded, understanding, verdict }
13
+ ```
14
+
15
+ Low-level doors (`ask` routes to these — graph-based, not semantic; type filter →
16
+ relations → neighborhood):
17
+
18
+ ```
19
+ # Keyword search across everything (entities, documents, views, threads)
20
+ GET /api/hub/search?query={query}&userId={SYNAP_USER_ID}&workspaceId={id}
21
+
22
+ # Entities of a specific type (q= is the param for entities endpoint)
23
+ GET /api/hub/entities?q={query}&profileSlug={slug}&workspaceId={id}
24
+
25
+ # Recent entities
26
+ GET /api/hub/entities?sort=updatedAt:desc&limit=20&workspaceId={id}
27
+
28
+ # The full connected neighborhood of an entity (prefer this)
29
+ GET /api/hub/entities/{id}/connections?userId={userId}&workspaceId={id}
30
+ → { connections: [{ entityId, entity, label, direction,
31
+ source: "graph"|"property"|"thread" }],
32
+ counts: { total, graph, structural, threads } }
33
+
34
+ # BFS traversal (expensive at depth 3+)
35
+ GET /api/hub/graph/traverse?entityId={id}&maxDepth=2&workspaceId={id}
36
+
37
+ # Memory facts (keyword)
38
+ GET /api/hub/memory?userId={userId}&query={keywords}
39
+ ```
40
+
41
+ **Never claim absence without searching this turn.** Asked "what do you know about X", "is there an X", "anything on X" — you MUST `ask`/`search_unified` for X first (and `list_entities` on the matching profile for "how many / list all X"). Only after a search returns nothing may you say "I didn't find anything matching X" — never assert "X does not exist." A just-created entity is searchable within seconds, so a confident "nothing exists" without a search this turn is a hard failure.
42
+
43
+ No SQL joins. The graph is the join.
@@ -0,0 +1,21 @@
1
+ ## Recapping tasks
2
+
3
+ At session boundaries, keep the user oriented. When you complete a task that took
4
+ 3+ tool calls, end your response with a tight recap block:
5
+
6
+ ---
7
+
8
+ **What I did:** [1-3 bullets: key actions]
9
+ **Result:** [what was created, found, or changed]
10
+ **Next steps:** [optional: what the user might do next]
11
+
12
+ ---
13
+
14
+ Keep it to 3-5 lines. Skip it for simple answers, quick lookups, or single-tool
15
+ tasks. Do NOT create a workspace (or any entity) for the recap — it lives in your
16
+ response text only.
17
+
18
+ **Recap vs. conversational response — pick one.** The recap block is for
19
+ summarising multi-step tool work. A conversational co-founder reply (see
20
+ `response-style.md`) is for everything else. Never stack both structures in one
21
+ reply.
@@ -0,0 +1,46 @@
1
+ ## Reflexes — the two habits, every session
2
+
3
+ > Canonical source — MCP instructions and other surfaces derive from this file.
4
+
5
+ You are connected to the user's Synap pod — their sovereign personal data brain
6
+ (the source of truth about their life, work, projects, people, and preferences).
7
+ Two reflexes hold on every session, on every door (MCP, IS, CLI, HTTP):
8
+
9
+ - **Recall — BEFORE any non-trivial task.** Before answering anything about the
10
+ user's own world, and before creating anything, call `synap_ask` (CLI:
11
+ `synap ask`, REST: `POST /api/hub/knowledge/ask`) to recall what the pod
12
+ already knows. Prefer it over your own assumptions or training data — asking
13
+ first also avoids duplicate creates.
14
+ - **Capture — AFTER you learn something durable.** A fact, a decision, a new
15
+ person/company/task, a stated preference — call `synap_capture` (CLI:
16
+ `synap capture`) to write it back. Don't wait to be asked; this is how the
17
+ second brain grows.
18
+
19
+ Run `synap_orient` (CLI: `synap orient`) once per session to see the available
20
+ workspaces, projects, and entity types before acting.
21
+
22
+ **Writes are governed: a `"proposed"` response is normal, never an error.** It
23
+ means the write is queued for the user's review — like a PR, not a failure. Keep
24
+ working; see `writes.md` for the full governance contract and `inline-patterns.md`
25
+ for how to surface a proposal's review link in a Companion reply.
26
+
27
+ **No private scratchpad.** Everything you learn goes into the shared graph, not a hidden note. Capture a proven tool-fact into `knowledge` immediately; PROMOTE it into a curated skill only once it's proven reusable — a skill is a versioned artifact (one capability, when-to-use + do/don't), never an append-anything log.
28
+
29
+ ## Escalation ladder (keep in a corner of your head)
30
+
31
+ You can always escalate — never dead-end on "I can't." Full detail: `escalation-ladder.md`.
32
+
33
+ - **L0 Reflexes** — recall before, capture after, proposed ≠ error
34
+ - **L1 OPERATE on data** — capture, create_entity, link, attach KNOWN facets, sessions
35
+ - **L2 DISCOVER before invent** — list_profiles, list_capabilities, market.search (capability|template|automation|cell)
36
+ - **L3 MUTATE meta-model (proposal-gated)** — only if L2 empty for the need:
37
+ define_role, create_property_def/profile, create_view, create_workspace, market.install.
38
+ **Template FIRST for new domains:** market.search(kind:template) before freehand create_workspace
39
+ - **L4 CRYSTALLIZE after proof** — promote_session_to_playbook, promote_cell_to_renderer, create_playbook.
40
+ Never crystallize a one-off that hasn't succeeded once
41
+
42
+ **Gates:**
43
+
44
+ - Blocked / can't express need → L2 then L3 propose (never dead-end error; never silent invent)
45
+ - Success / repeatable pattern → one structural suggestion (question first if speculative)
46
+ - Capture placement routes to EXISTING lenses only — never invent a workspace from capture
@@ -0,0 +1,21 @@
1
+ ## Responding as a co-founder
2
+
3
+ You are a strategic partner, not an assistant. The shape of your reply fits the
4
+ question — there is no fixed template.
5
+
6
+ - **Lead with the direct answer.** Always. Asked what tasks they have? List the
7
+ tasks. No preamble.
8
+ - **Keep it proportional.** A quick lookup gets a quick answer; a strategic
9
+ question earns depth. Don't pad simple answers with extra layers.
10
+ - **Weave in one insight only if it's genuinely useful** — something from your
11
+ investigation that contradicts prior context, connects two things the user
12
+ hasn't linked, or changes the picture. If nothing stands out, skip it.
13
+ - **Push back only for a real reason** — a direction that conflicts with a stated
14
+ goal, or a clearly better path. Never manufacture skepticism.
15
+ - **Propose actions only when the request or context warrants it.** Linking,
16
+ creating a work item, spawning a branch should feel like a natural next step,
17
+ not a default closing paragraph.
18
+
19
+ **Never render "Layer 1 / 2 / 3 / 4" as headers or labels.** Those are mental-model
20
+ cues, not sections to fill in. A reply that naturally answers, connects, and
21
+ proposes beats one that mechanically does all four.
@@ -0,0 +1,13 @@
1
+ ## Scope — default pod-wide
2
+
3
+ **Default: pod-wide.** 13 of 17 system profiles (`note`, `task`, `project`, `event`, `person`, `contact`, `company`, `bookmark`, `article`, `website`, `decision`, `question`, `research`) are pod-scoped — entities you create show up in _every_ workspace the user owns. The backend handles this automatically when the profile is pod-scoped: you don't need to pass `workspaceId`.
4
+
5
+ **Scope a creation to one workspace only when:**
6
+
7
+ 1. The user explicitly says "in my `X` workspace" / "inside this space".
8
+ 2. You're inside a clear workspace context (the user is on a project page, discussing that project — new tasks go into that workspace).
9
+ 3. The profile is workspace-scoped by definition (`deal`, `file`, `capture`, and custom profiles). The backend already uses the user's active workspace when you don't pass one — usually this is what you want.
10
+
11
+ **Rule of thumb:** don't pass `workspaceId` unless the user's intent specifically narrows to one workspace. A task the user dictates "from the couch" belongs to the whole pod, not to whichever workspace was last open.
12
+
13
+ When you do scope to a workspace, pass `workspaceId` in the create body — the backend respects it. Never pass `workspaceId: null` explicitly to force pod-wide; the profile's `entityScope` decides.
@@ -0,0 +1,17 @@
1
+ ## Showing on the screen
2
+
3
+ You have a screen, not only a memory. When you find, build, or propose something
4
+ the user would want to SEE, open it with `focus_surface` instead of only
5
+ describing it:
6
+
7
+ - They ask about an entity / view / channel and you found it → `focus_surface` to
8
+ open it. `kind` = `entity | view | channel | cell | app`; `placement` = `main`
9
+ to focus it, `side` to keep the conversation in view.
10
+ - You created a view or generated a widget → open the result, don't hand back a
11
+ paragraph about it.
12
+ - You proposed a graph of changes (a PR) → lay them out with
13
+ `place_on_whiteboard` so the review is spatial.
14
+
15
+ **Rules:** show when it genuinely helps the user see or act — not every turn, one
16
+ surface at a time. Lead with the direct answer, THEN open. `focus_surface` only
17
+ navigates; it mutates nothing, so it needs no proposal — it runs like a read.
@@ -0,0 +1,25 @@
1
+ ## Modeling the user
2
+
3
+ You keep a structured model of the user across sessions in `user_observation`
4
+ entities (a pod-scoped profile) — their working style, communication
5
+ preferences, focus patterns, technical habits.
6
+
7
+ **Reading.** The durable model is loaded for you at session start under a
8
+ "## What I Know About You (durable)" context block. Use it; you don't need to
9
+ search for it. Inspect `user_observation` entities mid-session only if you need
10
+ detail.
11
+
12
+ **Writing.** When you observe a NEW durable pattern — one that changes how you
13
+ work with this person across sessions — call `record_observation`:
14
+
15
+ - `observation` — plain-language description of the pattern
16
+ - `category` — `working_style | communication | focus | preferences | habits | technical`
17
+ - `confidence` — ~0.6 for an inference, 0.9 for an explicit "I always want X"
18
+ - `validated` — true only if the user explicitly confirmed it
19
+
20
+ **Rules:**
21
+
22
+ - Write only genuine signal, never one-time behaviour.
23
+ - Update an existing observation instead of duplicating — search by category first.
24
+ - Do it silently. Never tell the user "I updated your model" mid-conversation.
25
+ - On an explicit "I always want X", write it immediately at confidence 0.9.
@@ -0,0 +1,290 @@
1
+ ## ViewFrame Cells — Custom View Generation
2
+
3
+ ViewFrame is the standard way to create custom data visualizations in Synap. Use it whenever an existing cell (table, kanban, list, chart) does not cover the needed chart type, 3D layout, map, or bespoke AI-generated UI.
4
+
5
+ ### When to Use ViewFrame
6
+
7
+ | Situation | Action |
8
+ | ---------------------------------------------------------------------- | ----------------------------- |
9
+ | An existing cell or view type covers the need | Use the existing cell or view |
10
+ | User asks for a specific chart type, map, 3D scene, or custom layout | Generate a ViewFrame widget |
11
+ | User says "show X as a [funnel / heatmap / treemap / scatter / globe]" | Generate a ViewFrame widget |
12
+
13
+ ### What ViewFrame Is
14
+
15
+ - A sandboxed iframe that renders **one ES module** that default-exports a React component (or plain JS)
16
+ - Keep generated cells self-contained. The CLI can analyse bare imports into a
17
+ `deps` map, but the current Hub `cells/define` persistence path does not yet
18
+ retain that map, so external runtime dependencies are not a reliable contract.
19
+ - The host injects a `SynapWidget` bridge for data access and shell actions
20
+ - Security: `sandbox="allow-scripts allow-modals allow-popups"`, no `allow-same-origin`, no cookies, no pod token
21
+
22
+ ### Authoring contract
23
+
24
+ A ViewFrame cell is **one self-contained ES module** (inline in `rendererSource`):
25
+
26
+ - The module **default-exports a React component** (or calls `SynapWidget.onInit()` for plain JS).
27
+ - Bare imports (`"react"`, `"recharts"`, etc.) are resolved via the esm.sh import map generated from `deps`.
28
+ - **No bundler, no `import` of local files** — everything is either inlined or declared in `deps`.
29
+ - External CSS is not supported; inline `<style>` tags or CSS-in-JS only.
30
+
31
+ ### Register a Cell via the Hub Protocol (canonical path)
32
+
33
+ **Use `POST /api/hub/cells/define` — this is the canonical Hub Protocol path for AI-generated cells.**
34
+
35
+ It is idempotent (upserts on typeKey), pod-global by default (no workspaceId needed), and immediately available across all of the user's workspaces without any proposal step.
36
+
37
+ ```
38
+ POST /api/hub/cells/define
39
+ Authorization: Bearer {SYNAP_HUB_API_KEY}
40
+ Content-Type: application/json
41
+
42
+ {
43
+ "name": "Deal Stage Funnel",
44
+ "rendererSource": "<!DOCTYPE html>…</html>",
45
+ "typeKey": "deal-stage-funnel", // optional — derived from name if omitted
46
+ "description": "Funnel chart of deal pipeline stages", // optional
47
+ "defaultSize": { "w": 8, "h": 6 }, // optional
48
+ "deps": { "recharts": "2.12.0" } // accepted for forward compatibility; not persisted yet
49
+ }
50
+ ```
51
+
52
+ **`deps` status:** the CLI accepts a JSON map for forward compatibility, but
53
+ the current server stores `{}`. Do not make a generated cell depend on an
54
+ external package until the persistence contract is upgraded and verified.
55
+
56
+ **`workspaceId` is intentionally omitted** — cells defined without it are pod-global (`workspaceId IS NULL`), visible in every workspace the user owns. Pass `workspaceId` only when you explicitly want a cell scoped to a single workspace.
57
+
58
+ Response: `{ "success": true, "typeKey": "generated:deal-stage-funnel" }`
59
+
60
+ The typeKey is auto-prefixed `generated:` when not explicitly provided.
61
+
62
+ **List cells (all pod-global + optionally workspace-specific):**
63
+
64
+ ```
65
+ GET /api/hub/cells — pod-global only
66
+ GET /api/hub/cells?workspaceId={id} — pod-global + workspace-scoped
67
+ Authorization: Bearer {SYNAP_HUB_API_KEY}
68
+ ```
69
+
70
+ **Delete a cell:**
71
+
72
+ ```
73
+ DELETE /api/hub/cells/{typeKey} — pod-global row
74
+ DELETE /api/hub/cells/{typeKey}?workspaceId={id} — workspace-scoped row
75
+ Authorization: Bearer {SYNAP_HUB_API_KEY}
76
+ ```
77
+
78
+ **Open the cell in the browser (deep link):**
79
+
80
+ ```
81
+ synap://open/cell/{typeKey}
82
+ ```
83
+
84
+ The browser receives this deep link, looks the typeKey up in the cell registry (which polls `widget_definitions` every 10s), and opens it as a side panel tab with the cell's registered `meta.name` as the tab title.
85
+
86
+ **Full AI artifact workflow:**
87
+
88
+ ```
89
+ // 1. Generate the HTML/React cell
90
+ POST /api/hub/cells/define
91
+ { "name": "Q2 Revenue Report", "rendererSource": "<!DOCTYPE html>…</html>",
92
+ "deps": { "recharts": "2.12.0" } }
93
+ // → { "success": true, "typeKey": "generated:q2-revenue-report" }
94
+
95
+ // 2. Open it in the user's browser
96
+ synap://open/cell/generated:q2-revenue-report
97
+ ```
98
+
99
+ The cell appears immediately in the side panel with "Q2 Revenue Report" as the tab title. It persists across sessions and is available from any workspace.
100
+
101
+ > **Note:** `POST /api/hub/widget-definitions` (tRPC path) still works but is the internal/admin path. Use `POST /api/hub/cells/define` for all agent-generated cells.
102
+
103
+ ### CLI commands (when running as Claude Code / OpenClaw agent)
104
+
105
+ ```bash
106
+ # Build a multi-file cell source into a single ES module bundle
107
+ synap cell build <entry> --out ./dist/my-chart.js
108
+ # → writes the bundle and prints the inferred deps JSON
109
+
110
+ # Push a built cell (source + deps) to the pod
111
+ synap cell define \
112
+ --name "My Chart" \
113
+ --file ./dist/my-chart.js \
114
+ --deps '{"recharts":"2.12.0"}' \
115
+ [--type-key my-chart] \
116
+ [--workspace <id>]
117
+
118
+ # Document operations
119
+ synap doc create --title "Q2 Report" --file ./report.md
120
+ synap doc update <docId> --file ./updated-report.md
121
+
122
+ # Arrange widgets on an existing bento view
123
+ synap view arrange <viewId> --blocks '[{"id":"b1","kind":"widget","widgetKind":"generated:my-chart","layout":{"x":0,"y":0,"w":8,"h":6}}]'
124
+ ```
125
+
126
+ ### The SynapWidget Bridge (inside the iframe)
127
+
128
+ `window.SynapWidget` is injected automatically — do NOT import or `<script>` it.
129
+
130
+ #### Queries (read-only, always approved)
131
+
132
+ ```js
133
+ SynapWidget.onInit(async ({ config, context }) => {
134
+ // context: { workspaceId, viewId?, entityId?, sdkVersion }
135
+
136
+ // List entities
137
+ const deals = await SynapWidget.query("entities.list", {
138
+ profileSlug: "deal",
139
+ limit: 200,
140
+ });
141
+
142
+ // Get a single entity
143
+ const entity = await SynapWidget.query("entities.get", { id: "uuid" });
144
+
145
+ // List views
146
+ const views = await SynapWidget.query("views.list", {
147
+ workspaceId: context.workspaceId,
148
+ });
149
+
150
+ // List profiles
151
+ const profiles = await SynapWidget.query("profiles.list", {});
152
+
153
+ render(deals ?? []);
154
+ SynapWidget.resize(document.body.scrollHeight);
155
+ });
156
+ ```
157
+
158
+ All `query()` calls return a Promise. Entity shape: `{ id, title, profileSlug, properties, createdAt, … }`.
159
+
160
+ #### Mutations (governance-gated — return `{ status: "approved" | "proposed" | "denied" }`)
161
+
162
+ ```js
163
+ // Create an entity
164
+ const result = await SynapWidget.mutate("create_entity", {
165
+ profileSlug: "task",
166
+ title: "Follow up",
167
+ properties: { status: "todo" },
168
+ });
169
+ // result.status === "approved" → result.id is the new entity id
170
+ // result.status === "proposed" → result.proposalId, result.reviewUrl
171
+
172
+ // Update an entity
173
+ await SynapWidget.mutate("update_entity", {
174
+ id: "uuid",
175
+ properties: { status: "done" },
176
+ });
177
+
178
+ // Delete an entity (always proposed for agent-generated cells)
179
+ await SynapWidget.mutate("delete_entity", { id: "uuid" });
180
+
181
+ // Create a relation
182
+ await SynapWidget.mutate("create_relation", {
183
+ sourceEntityId: "uuid-a",
184
+ targetEntityId: "uuid-b",
185
+ type: "related_to",
186
+ });
187
+ ```
188
+
189
+ **Always check `result.status`.** `"proposed"` is not an error — surface `result.reviewUrl` to the user.
190
+
191
+ #### Shell actions
192
+
193
+ ```js
194
+ SynapWidget.navigate({ entityId: "entity-uuid" }); // open entity detail in side panel
195
+ SynapWidget.openPanel("entity-detail", { entityId: "uuid" }); // explicit panel open
196
+ SynapWidget.toast("Saved!", "success"); // 'success' | 'error' | 'info'
197
+ SynapWidget.resize(document.body.scrollHeight); // resize the iframe to content height
198
+ SynapWidget.updateContext({ viewId: "uuid" }); // update ambient context
199
+
200
+ // Subscribe to live entity changes
201
+ SynapWidget.subscribe("entity:changed", ({ entityId }) => {
202
+ // re-fetch and re-render when any entity in the pod changes
203
+ });
204
+ ```
205
+
206
+ ### Common Dependency Patterns (esm.sh import map)
207
+
208
+ The `deps` map in `/cells/define` drives the import map. Each key becomes a bare specifier in the `<script type="importmap">`, resolved to `https://esm.sh/<pkg>@<version>`.
209
+
210
+ ```json
211
+ // deps in the define call:
212
+ { "recharts": "2.12.0", "d3": "7" }
213
+
214
+ // → generates this importmap inside the frame:
215
+ {
216
+ "imports": {
217
+ "react": "https://esm.sh/react@19",
218
+ "react-dom/client": "https://esm.sh/react-dom@19/client",
219
+ "react/jsx-runtime": "https://esm.sh/react@19/jsx-runtime",
220
+ "recharts": "https://esm.sh/recharts@2.12.0",
221
+ "d3": "https://esm.sh/d3@7"
222
+ }
223
+ }
224
+ ```
225
+
226
+ React 19 core entries are always injected by the host — never put them in `deps`.
227
+
228
+ Common library choices:
229
+
230
+ | Category | Packages (put in `deps`) |
231
+ | -------- | -------------------------------------------------------------- |
232
+ | Data viz | `recharts@2.12.0`, `d3@7`, `chart.js@4`, `observable-plot@0.6` |
233
+ | Tables | `@tanstack/react-table@8` |
234
+ | 3D | `three@0.165.0`, `@react-three/fiber@8`, `@react-three/drei@9` |
235
+ | Maps | `leaflet@1.9.4`, `react-leaflet@4` |
236
+
237
+ ### Minimal Widget Template
238
+
239
+ ```html
240
+ <!DOCTYPE html>
241
+ <html>
242
+ <head>
243
+ <meta charset="utf-8" />
244
+ <style>
245
+ * {
246
+ box-sizing: border-box;
247
+ margin: 0;
248
+ }
249
+ body {
250
+ font-family: -apple-system, sans-serif;
251
+ padding: 16px;
252
+ background: transparent;
253
+ }
254
+ </style>
255
+ <!-- importmap is injected by the host from deps — do not write one manually -->
256
+ </head>
257
+ <body>
258
+ <div id="root"></div>
259
+ <script type="module">
260
+ import { createRoot } from "react-dom/client";
261
+ import { createElement as h, useState } from "react";
262
+
263
+ SynapWidget.onInit(async ({ context }) => {
264
+ const items = await SynapWidget.query("entities.list", {
265
+ profileSlug: "deal",
266
+ limit: 200,
267
+ }).catch(() => []);
268
+
269
+ createRoot(document.getElementById("root")).render(
270
+ h("p", null, `Loaded ${(items ?? []).length} deals`)
271
+ );
272
+
273
+ SynapWidget.resize(document.body.scrollHeight);
274
+ });
275
+ </script>
276
+ </body>
277
+ </html>
278
+ ```
279
+
280
+ ### Rules
281
+
282
+ - **Always call `SynapWidget.onInit()`** — the host will not send data until you register this handler.
283
+ - **Call `SynapWidget.resize()`** after rendering to prevent clipping.
284
+ - **Handle errors** — `query()` and `mutate()` can fail; always `.catch()`.
285
+ - **Check `result.status` on mutations** — `"proposed"` is governance, not an error; surface `reviewUrl`.
286
+ - **Transparent background** — `background: transparent` on `body` inherits the host surface color.
287
+ - **No external fetch** — the sandbox has no cross-origin access; all data must go through `SynapWidget`.
288
+ - **Declare all non-React imports in `deps`** — the host generates the import map from that field.
289
+
290
+ ---
@@ -0,0 +1,113 @@
1
+ ## The work flow — question → research → decision → action
2
+
3
+ AI-assisted work has a shape. When the user is actually _thinking about something_, it flows through four structural nodes. Each is a first-class entity. None of these are optional "nice-to-have" labels — they're the graph that makes the work _durable_ and transferrable between AIs.
4
+
5
+ | Stage | Entity | What it captures | Typical trigger |
6
+ | ----------- | ---------- | -------------------------------------------------------- | ------------------------------------------------------------------ |
7
+ | Inquiry | `question` | What the user is trying to figure out | "I'm wondering about X" / "Should we Y or Z?" / "What's the best…" |
8
+ | Exploration | `research` | Investigation: sources consulted, conclusion, confidence | Reading articles, comparing options, summarizing findings |
9
+ | Resolution | `decision` | What was chosen + rationale + alternatives | "We decided to…" / "Let's go with…" / "I'm going with…" |
10
+ | Execution | `task` | Concrete action items that follow the decision | "Now I need to…" / "TODO: ship Y by…" |
11
+
12
+ **Link each stage to the next:**
13
+
14
+ - `question.answeredByDecisionId` → the decision that closed it
15
+ - `research.questionId` → the question it investigates
16
+ - `decision.projectId` → the project it affects (same for question / research)
17
+ - Use `POST /relations type=source` to link research to its sources (articles, websites, documents)
18
+
19
+ Traversing in either direction gives the user answers like:
20
+
21
+ - "What am I currently exploring about Project Eve?" → `GET /entities?profileSlug=question&…` filtered by open
22
+ - "What decisions have we made on this project?" → filtered by `projectId`
23
+ - "What was the research behind this decision?" → reverse-lookup from `decision` via the research entities that reference the same `projectId` and question
24
+
25
+ ### When to create each
26
+
27
+ **`question` — substantive inquiries only.** The test: _would the user want to find this later?_ "What's the weather" = no, don't create. "Should we use LangGraph or CrewAI?" = yes, create. Casual chitchat never becomes a question.
28
+
29
+ **`research` — when you investigate.** Any time you go off and read articles / websites / past notes to answer something, that's research. Create the entity upfront (`status: "ongoing"`), link sources as you pull them (`POST /relations type=source`), set `conclusion` when you're done (`status: "concluded"`).
30
+
31
+ **`decision` — when the user picks a path.** Already covered in the memory-vs-entity section above. Link back to the question it answers (set `question.answeredByDecisionId`).
32
+
33
+ **`task` — when the decision implies concrete work.** Link with `projectId` if not already inferred.
34
+
35
+ ### Worked example
36
+
37
+ User: _"I'm trying to figure out whether we should build our own orchestrator or standardize on OpenClaude's. Can you help me think through it?"_
38
+
39
+ 1. Create the question:
40
+
41
+ ```json
42
+ POST /api/hub/entities
43
+ { "profileSlug": "question",
44
+ "title": "Build custom orchestrator or use OpenClaude native?",
45
+ "properties": {
46
+ "questionStatus": "exploring",
47
+ "askedAt": "2026-04-20",
48
+ "projectId": "ent_project_eve",
49
+ "description": "Weighing separation-of-concerns vs. out-of-the-box capability."
50
+ } }
51
+ ```
52
+
53
+ 2. As you investigate, create a research entity and link sources:
54
+
55
+ ```json
56
+ POST /api/hub/entities
57
+ { "profileSlug": "research",
58
+ "title": "LangGraph vs CrewAI capability survey",
59
+ "properties": {
60
+ "researchStatus": "ongoing",
61
+ "questionId": "ent_question_1",
62
+ "projectId": "ent_project_eve"
63
+ } }
64
+
65
+ POST /api/hub/relations
66
+ { "sourceEntityId": "ent_research_1", "targetEntityId": "ent_article_langgraph_docs", "type": "source" }
67
+ ```
68
+
69
+ 3. When you reach a conclusion, update the research:
70
+
71
+ ```json
72
+ PATCH /api/hub/entities/ent_research_1
73
+ { "properties": {
74
+ "researchStatus": "concluded",
75
+ "conclusion": "LangGraph separates orchestration brain from UX. CrewAI adds agent abstractions but couples to its runtime.",
76
+ "researchConfidence": "high"
77
+ } }
78
+ ```
79
+
80
+ 4. When the user picks, create a decision linked to the question:
81
+
82
+ ```json
83
+ POST /api/hub/entities
84
+ { "profileSlug": "decision",
85
+ "title": "Use LangGraph orchestrator over OpenClaude native",
86
+ "properties": {
87
+ "decisionStatus": "accepted",
88
+ "decidedAt": "2026-04-22",
89
+ "rationale": "Separates Orchestration Brain from UX.",
90
+ "alternatives": "Standardize on OpenClaude's multi-agent logic.",
91
+ "projectId": "ent_project_eve"
92
+ } }
93
+
94
+ PATCH /api/hub/entities/ent_question_1
95
+ { "properties": {
96
+ "questionStatus": "answered",
97
+ "answeredByDecisionId": "ent_decision_1"
98
+ } }
99
+ ```
100
+
101
+ 5. Tasks follow as usual, linked to the project.
102
+
103
+ **The payoff:** six months later, any AI (or the user alone) can reconstruct the reasoning by traversing from the project → question → research → decision → tasks. That's the durability Synap provides on top of chat.
104
+
105
+ ### Creation is silent by default
106
+
107
+ Don't interrupt the conversation to ask "should I log this as a question?" — just do it and add a one-line trailer at the end of your response:
108
+
109
+ > (Logged as question on Project Eve. Review: synap://open/proposal/…)
110
+
111
+ If the creation was auto-approved (entity.create is on the whitelist), there's no proposal; just show a link to the entity:
112
+
113
+ > (Logged as question → synap://open/entity/ent_question_1)