@synap-core/cli 1.11.0 → 1.12.2

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 (452) hide show
  1. package/README.md +23 -198
  2. package/dist/build-info.json +6 -0
  3. package/dist/commands/agent-run.js +3 -2
  4. package/dist/commands/agent-run.js.map +1 -1
  5. package/dist/commands/agents.d.ts +33 -17
  6. package/dist/commands/agents.js +203 -237
  7. package/dist/commands/agents.js.map +1 -1
  8. package/dist/commands/app.d.ts +143 -0
  9. package/dist/commands/app.js +523 -0
  10. package/dist/commands/app.js.map +1 -0
  11. package/dist/commands/automate.d.ts +21 -0
  12. package/dist/commands/automate.js +42 -0
  13. package/dist/commands/automate.js.map +1 -0
  14. package/dist/commands/automation-schema.test.d.ts +16 -0
  15. package/dist/commands/automation-schema.test.js +77 -0
  16. package/dist/commands/automation-schema.test.js.map +1 -0
  17. package/dist/commands/automation.d.ts +12 -0
  18. package/dist/commands/automation.js +80 -35
  19. package/dist/commands/automation.js.map +1 -1
  20. package/dist/commands/bridge-setup.d.ts +14 -1
  21. package/dist/commands/bridge-setup.js +392 -128
  22. package/dist/commands/bridge-setup.js.map +1 -1
  23. package/dist/commands/cap-connections.d.ts +4 -4
  24. package/dist/commands/cap-connections.js +14 -14
  25. package/dist/commands/cap-connections.js.map +1 -1
  26. package/dist/commands/capability.d.ts +2 -0
  27. package/dist/commands/capability.js +218 -168
  28. package/dist/commands/capability.js.map +1 -1
  29. package/dist/commands/catalog.d.ts +275 -0
  30. package/dist/commands/catalog.js +481 -0
  31. package/dist/commands/catalog.js.map +1 -0
  32. package/dist/commands/cell.d.ts +155 -8
  33. package/dist/commands/cell.js +416 -40
  34. package/dist/commands/cell.js.map +1 -1
  35. package/dist/commands/centrality.js +1 -13
  36. package/dist/commands/centrality.js.map +1 -1
  37. package/dist/commands/connect.d.ts +38 -13
  38. package/dist/commands/connect.js +68 -167
  39. package/dist/commands/connect.js.map +1 -1
  40. package/dist/commands/connections.d.ts +3 -2
  41. package/dist/commands/connections.js +95 -25
  42. package/dist/commands/connections.js.map +1 -1
  43. package/dist/commands/context.js +7 -1
  44. package/dist/commands/context.js.map +1 -1
  45. package/dist/commands/data-extra.d.ts +34 -0
  46. package/dist/commands/data-extra.js +193 -23
  47. package/dist/commands/data-extra.js.map +1 -1
  48. package/dist/commands/data.d.ts +120 -2
  49. package/dist/commands/data.js +293 -20
  50. package/dist/commands/data.js.map +1 -1
  51. package/dist/commands/diagnose.d.ts +66 -4
  52. package/dist/commands/diagnose.js +285 -28
  53. package/dist/commands/diagnose.js.map +1 -1
  54. package/dist/commands/doc.d.ts +11 -4
  55. package/dist/commands/doc.js +39 -14
  56. package/dist/commands/doc.js.map +1 -1
  57. package/dist/commands/doctor.d.ts +112 -3
  58. package/dist/commands/doctor.js +657 -32
  59. package/dist/commands/doctor.js.map +1 -1
  60. package/dist/commands/explain.js +5 -5
  61. package/dist/commands/explain.js.map +1 -1
  62. package/dist/commands/import.d.ts +368 -13
  63. package/dist/commands/import.js +1064 -54
  64. package/dist/commands/import.js.map +1 -1
  65. package/dist/commands/init.d.ts +20 -9
  66. package/dist/commands/init.js +433 -973
  67. package/dist/commands/init.js.map +1 -1
  68. package/dist/commands/keys.d.ts +1 -0
  69. package/dist/commands/keys.js +15 -2
  70. package/dist/commands/keys.js.map +1 -1
  71. package/dist/commands/knowledge.d.ts +22 -6
  72. package/dist/commands/knowledge.js +117 -55
  73. package/dist/commands/knowledge.js.map +1 -1
  74. package/dist/commands/lens.d.ts +37 -1
  75. package/dist/commands/lens.js +192 -71
  76. package/dist/commands/lens.js.map +1 -1
  77. package/dist/commands/market-authoring.d.ts +29 -2
  78. package/dist/commands/market-authoring.js +348 -7
  79. package/dist/commands/market-authoring.js.map +1 -1
  80. package/dist/commands/market-official.d.ts +58 -0
  81. package/dist/commands/market-official.js +84 -0
  82. package/dist/commands/market-official.js.map +1 -0
  83. package/dist/commands/market.d.ts +400 -16
  84. package/dist/commands/market.js +1802 -146
  85. package/dist/commands/market.js.map +1 -1
  86. package/dist/commands/mcp.d.ts +60 -25
  87. package/dist/commands/mcp.js +251 -64
  88. package/dist/commands/mcp.js.map +1 -1
  89. package/dist/commands/open.d.ts +39 -9
  90. package/dist/commands/open.js +80 -25
  91. package/dist/commands/open.js.map +1 -1
  92. package/dist/commands/playbook.d.ts +42 -0
  93. package/dist/commands/playbook.js +162 -0
  94. package/dist/commands/playbook.js.map +1 -0
  95. package/dist/commands/pod.js +1 -1
  96. package/dist/commands/pod.js.map +1 -1
  97. package/dist/commands/pods.d.ts +5 -0
  98. package/dist/commands/pods.js +97 -116
  99. package/dist/commands/pods.js.map +1 -1
  100. package/dist/commands/proposals-actions.d.ts +62 -0
  101. package/dist/commands/proposals-actions.js +143 -8
  102. package/dist/commands/proposals-actions.js.map +1 -1
  103. package/dist/commands/proposals-await.d.ts +68 -0
  104. package/dist/commands/proposals-await.js +248 -0
  105. package/dist/commands/proposals-await.js.map +1 -0
  106. package/dist/commands/proton-setup.d.ts +73 -0
  107. package/dist/commands/proton-setup.js +577 -0
  108. package/dist/commands/proton-setup.js.map +1 -0
  109. package/dist/commands/providers.d.ts +23 -0
  110. package/dist/commands/providers.js +126 -1
  111. package/dist/commands/providers.js.map +1 -1
  112. package/dist/commands/raycast.js +6 -2
  113. package/dist/commands/raycast.js.map +1 -1
  114. package/dist/commands/rule.d.ts +150 -0
  115. package/dist/commands/rule.js +447 -0
  116. package/dist/commands/rule.js.map +1 -0
  117. package/dist/commands/session-wait.d.ts +111 -0
  118. package/dist/commands/session-wait.js +209 -0
  119. package/dist/commands/session-wait.js.map +1 -0
  120. package/dist/commands/sessions.d.ts +52 -0
  121. package/dist/commands/sessions.js +478 -58
  122. package/dist/commands/sessions.js.map +1 -1
  123. package/dist/commands/skill-manage.d.ts +21 -0
  124. package/dist/commands/skill-manage.js +136 -19
  125. package/dist/commands/skill-manage.js.map +1 -1
  126. package/dist/commands/skills.js +16 -0
  127. package/dist/commands/skills.js.map +1 -1
  128. package/dist/commands/status.d.ts +1 -4
  129. package/dist/commands/status.js +5 -34
  130. package/dist/commands/status.js.map +1 -1
  131. package/dist/commands/statusline.backoff.test.d.ts +13 -0
  132. package/dist/commands/statusline.backoff.test.js +100 -0
  133. package/dist/commands/statusline.backoff.test.js.map +1 -0
  134. package/dist/commands/statusline.js +16 -9
  135. package/dist/commands/statusline.js.map +1 -1
  136. package/dist/commands/sync-status.d.ts +12 -0
  137. package/dist/commands/sync-status.js +125 -0
  138. package/dist/commands/sync-status.js.map +1 -0
  139. package/dist/commands/templates-retire.d.ts +34 -0
  140. package/dist/commands/templates-retire.js +192 -0
  141. package/dist/commands/templates-retire.js.map +1 -0
  142. package/dist/commands/tools.js +6 -21
  143. package/dist/commands/tools.js.map +1 -1
  144. package/dist/commands/tracks.d.ts +51 -0
  145. package/dist/commands/tracks.js +291 -0
  146. package/dist/commands/tracks.js.map +1 -0
  147. package/dist/commands/update.d.ts +3 -11
  148. package/dist/commands/update.js +5 -134
  149. package/dist/commands/update.js.map +1 -1
  150. package/dist/commands/upload.d.ts +41 -3
  151. package/dist/commands/upload.js +120 -18
  152. package/dist/commands/upload.js.map +1 -1
  153. package/dist/commands/vendor.d.ts +28 -0
  154. package/dist/commands/vendor.js +110 -0
  155. package/dist/commands/vendor.js.map +1 -0
  156. package/dist/commands/versions.js +6 -0
  157. package/dist/commands/versions.js.map +1 -1
  158. package/dist/commands/view.js +10 -5
  159. package/dist/commands/view.js.map +1 -1
  160. package/dist/commands/whoami.d.ts +23 -3
  161. package/dist/commands/whoami.js +169 -23
  162. package/dist/commands/whoami.js.map +1 -1
  163. package/dist/commands/worker.d.ts +122 -0
  164. package/dist/commands/worker.js +435 -0
  165. package/dist/commands/worker.js.map +1 -0
  166. package/dist/commands/worker.test.d.ts +1 -0
  167. package/dist/commands/worker.test.js +116 -0
  168. package/dist/commands/worker.test.js.map +1 -0
  169. package/dist/commands/workspace-ops.d.ts +35 -0
  170. package/dist/commands/workspace-ops.js +153 -0
  171. package/dist/commands/workspace-ops.js.map +1 -0
  172. package/dist/index.d.ts +6 -6
  173. package/dist/index.js +900 -180
  174. package/dist/index.js.map +1 -1
  175. package/dist/lib/agent-connections.d.ts +31 -0
  176. package/dist/lib/agent-connections.js +33 -0
  177. package/dist/lib/agent-connections.js.map +1 -0
  178. package/dist/lib/agent-detect.d.ts +27 -0
  179. package/dist/lib/agent-detect.js +71 -0
  180. package/dist/lib/agent-detect.js.map +1 -0
  181. package/dist/lib/agent-door.d.ts +138 -0
  182. package/dist/lib/agent-door.js +426 -0
  183. package/dist/lib/agent-door.js.map +1 -0
  184. package/dist/lib/agents-config.d.ts +2 -0
  185. package/dist/lib/agents-config.js +4 -9
  186. package/dist/lib/agents-config.js.map +1 -1
  187. package/dist/lib/approval-poll.d.ts +31 -2
  188. package/dist/lib/approval-poll.js +20 -7
  189. package/dist/lib/approval-poll.js.map +1 -1
  190. package/dist/lib/atomic-file.d.ts +48 -0
  191. package/dist/lib/atomic-file.js +129 -0
  192. package/dist/lib/atomic-file.js.map +1 -0
  193. package/dist/lib/auth.d.ts +14 -9
  194. package/dist/lib/auth.js +44 -61
  195. package/dist/lib/auth.js.map +1 -1
  196. package/dist/lib/batch-approval.d.ts +85 -0
  197. package/dist/lib/batch-approval.js +170 -0
  198. package/dist/lib/batch-approval.js.map +1 -0
  199. package/dist/lib/capture-lane.d.ts +6 -5
  200. package/dist/lib/capture-lane.js +6 -5
  201. package/dist/lib/capture-lane.js.map +1 -1
  202. package/dist/lib/capture-structure.d.ts +230 -11
  203. package/dist/lib/capture-structure.js +251 -13
  204. package/dist/lib/capture-structure.js.map +1 -1
  205. package/dist/lib/catalog-templates.d.ts +59 -0
  206. package/dist/lib/catalog-templates.js +126 -0
  207. package/dist/lib/catalog-templates.js.map +1 -0
  208. package/dist/lib/cli-build.d.ts +19 -0
  209. package/dist/lib/cli-build.js +37 -0
  210. package/dist/lib/cli-build.js.map +1 -0
  211. package/dist/lib/conversation-headers.d.ts +18 -0
  212. package/dist/lib/conversation-headers.js +32 -0
  213. package/dist/lib/conversation-headers.js.map +1 -0
  214. package/dist/lib/cp-packages.d.ts +167 -11
  215. package/dist/lib/cp-packages.js +253 -21
  216. package/dist/lib/cp-packages.js.map +1 -1
  217. package/dist/lib/credential-class.d.ts +117 -0
  218. package/dist/lib/credential-class.js +116 -0
  219. package/dist/lib/credential-class.js.map +1 -0
  220. package/dist/lib/describe-lens.d.ts +35 -0
  221. package/dist/lib/describe-lens.js +40 -0
  222. package/dist/lib/describe-lens.js.map +1 -1
  223. package/dist/lib/device-connect.d.ts +125 -0
  224. package/dist/lib/device-connect.js +256 -0
  225. package/dist/lib/device-connect.js.map +1 -0
  226. package/dist/lib/directory-lens.d.ts +99 -0
  227. package/dist/lib/directory-lens.js +187 -0
  228. package/dist/lib/directory-lens.js.map +1 -0
  229. package/dist/lib/exporter-coverage.d.ts +71 -0
  230. package/dist/lib/exporter-coverage.js +97 -0
  231. package/dist/lib/exporter-coverage.js.map +1 -0
  232. package/dist/lib/hub-client.d.ts +29 -8
  233. package/dist/lib/hub-client.js +328 -55
  234. package/dist/lib/hub-client.js.map +1 -1
  235. package/dist/lib/init-connect.d.ts +41 -0
  236. package/dist/lib/init-connect.js +75 -0
  237. package/dist/lib/init-connect.js.map +1 -0
  238. package/dist/lib/init-exit.d.ts +24 -0
  239. package/dist/lib/init-exit.js +41 -0
  240. package/dist/lib/init-exit.js.map +1 -0
  241. package/dist/lib/init-flow.d.ts +25 -0
  242. package/dist/lib/init-flow.js +40 -0
  243. package/dist/lib/init-flow.js.map +1 -0
  244. package/dist/lib/init-handoff.d.ts +16 -0
  245. package/dist/lib/init-handoff.js +19 -0
  246. package/dist/lib/init-handoff.js.map +1 -0
  247. package/dist/lib/init-output.d.ts +18 -0
  248. package/dist/lib/init-output.js +43 -0
  249. package/dist/lib/init-output.js.map +1 -0
  250. package/dist/lib/init-pod.d.ts +45 -0
  251. package/dist/lib/init-pod.js +36 -0
  252. package/dist/lib/init-pod.js.map +1 -0
  253. package/dist/lib/installed.d.ts +210 -11
  254. package/dist/lib/installed.js +234 -36
  255. package/dist/lib/installed.js.map +1 -1
  256. package/dist/lib/key-approval.d.ts +57 -0
  257. package/dist/lib/key-approval.js +117 -0
  258. package/dist/lib/key-approval.js.map +1 -0
  259. package/dist/lib/key-diagnosis.d.ts +56 -0
  260. package/dist/lib/key-diagnosis.js +227 -0
  261. package/dist/lib/key-diagnosis.js.map +1 -0
  262. package/dist/lib/key-doctor.d.ts +136 -0
  263. package/dist/lib/key-doctor.js +286 -0
  264. package/dist/lib/key-doctor.js.map +1 -0
  265. package/dist/lib/key-locations.d.ts +120 -0
  266. package/dist/lib/key-locations.js +326 -0
  267. package/dist/lib/key-locations.js.map +1 -0
  268. package/dist/lib/key-source.d.ts +66 -0
  269. package/dist/lib/key-source.js +106 -0
  270. package/dist/lib/key-source.js.map +1 -0
  271. package/dist/lib/key-state.d.ts +70 -0
  272. package/dist/lib/key-state.js +115 -0
  273. package/dist/lib/key-state.js.map +1 -0
  274. package/dist/lib/kind-package.d.ts +181 -0
  275. package/dist/lib/kind-package.js +679 -0
  276. package/dist/lib/kind-package.js.map +1 -0
  277. package/dist/lib/knowledge-title.d.ts +24 -0
  278. package/dist/lib/knowledge-title.js +46 -0
  279. package/dist/lib/knowledge-title.js.map +1 -0
  280. package/dist/lib/knowledge-title.test.d.ts +1 -0
  281. package/dist/lib/knowledge-title.test.js +34 -0
  282. package/dist/lib/knowledge-title.test.js.map +1 -0
  283. package/dist/lib/machine-instance.d.ts +64 -0
  284. package/dist/lib/machine-instance.js +142 -0
  285. package/dist/lib/machine-instance.js.map +1 -0
  286. package/dist/lib/mcp-bridge.d.ts +42 -0
  287. package/dist/lib/mcp-bridge.js +147 -0
  288. package/dist/lib/mcp-bridge.js.map +1 -0
  289. package/dist/lib/mcp-bridge.test.d.ts +1 -0
  290. package/dist/lib/mcp-bridge.test.js +90 -0
  291. package/dist/lib/mcp-bridge.test.js.map +1 -0
  292. package/dist/lib/mcp-call.d.ts +30 -0
  293. package/dist/lib/mcp-call.js +107 -0
  294. package/dist/lib/mcp-call.js.map +1 -0
  295. package/dist/lib/mcp-snippets.d.ts +53 -0
  296. package/dist/lib/mcp-snippets.js +82 -0
  297. package/dist/lib/mcp-snippets.js.map +1 -0
  298. package/dist/lib/next-steps.d.ts +8 -0
  299. package/dist/lib/next-steps.js +31 -1
  300. package/dist/lib/next-steps.js.map +1 -1
  301. package/dist/lib/package-wire.d.ts +179 -0
  302. package/dist/lib/package-wire.js +68 -0
  303. package/dist/lib/package-wire.js.map +1 -0
  304. package/dist/lib/pair-link.d.ts +38 -0
  305. package/dist/lib/pair-link.js +68 -0
  306. package/dist/lib/pair-link.js.map +1 -0
  307. package/dist/lib/pod-wide.d.ts +40 -0
  308. package/dist/lib/pod-wide.js +46 -0
  309. package/dist/lib/pod-wide.js.map +1 -0
  310. package/dist/lib/pod.d.ts +66 -112
  311. package/dist/lib/pod.js +134 -412
  312. package/dist/lib/pod.js.map +1 -1
  313. package/dist/lib/project-ref.d.ts +9 -3
  314. package/dist/lib/project-ref.js +10 -4
  315. package/dist/lib/project-ref.js.map +1 -1
  316. package/dist/lib/review-credential.d.ts +119 -0
  317. package/dist/lib/review-credential.js +147 -0
  318. package/dist/lib/review-credential.js.map +1 -0
  319. package/dist/lib/safe-open.d.ts +49 -0
  320. package/dist/lib/safe-open.js +119 -0
  321. package/dist/lib/safe-open.js.map +1 -0
  322. package/dist/lib/session-lens.d.ts +40 -1
  323. package/dist/lib/session-lens.js +54 -4
  324. package/dist/lib/session-lens.js.map +1 -1
  325. package/dist/lib/superwhisper-import.d.ts +8 -0
  326. package/dist/lib/superwhisper-import.js +14 -7
  327. package/dist/lib/superwhisper-import.js.map +1 -1
  328. package/dist/lib/superwhisper-title.test.d.ts +1 -0
  329. package/dist/lib/superwhisper-title.test.js +18 -0
  330. package/dist/lib/superwhisper-title.test.js.map +1 -0
  331. package/dist/lib/targets.d.ts +134 -10
  332. package/dist/lib/targets.js +962 -258
  333. package/dist/lib/targets.js.map +1 -1
  334. package/dist/lib/template-file.d.ts +4 -0
  335. package/dist/lib/template-file.js.map +1 -1
  336. package/dist/lib/template-lifecycle.d.ts +217 -0
  337. package/dist/lib/template-lifecycle.js +433 -0
  338. package/dist/lib/template-lifecycle.js.map +1 -0
  339. package/dist/lib/template-steps.d.ts +88 -0
  340. package/dist/lib/template-steps.js +118 -0
  341. package/dist/lib/template-steps.js.map +1 -0
  342. package/dist/lib/time-ago.d.ts +2 -0
  343. package/dist/lib/time-ago.js +15 -0
  344. package/dist/lib/time-ago.js.map +1 -0
  345. package/dist/utils/logger.js +5 -2
  346. package/dist/utils/logger.js.map +1 -1
  347. package/package.json +23 -17
  348. package/skills/README.md +12 -10
  349. package/skills/agent-os/SKILL.md +214 -99
  350. package/skills/manifest.json +1 -1
  351. package/skills/onboard/SKILL.md +55 -26
  352. package/skills/synap/README.md +5 -8
  353. package/skills/synap/SKILL.md +1086 -283
  354. package/skills/synap/_order.txt +7 -0
  355. package/skills/synap/_skill.yaml +1 -1
  356. package/skills/synap/automations.md +15 -0
  357. package/skills/synap/capture.md +5 -0
  358. package/skills/synap/cli-operations.md +24 -18
  359. package/skills/synap/concepts.md +28 -0
  360. package/skills/synap/content-os.md +10 -1
  361. package/skills/synap/creative-loop.md +15 -10
  362. package/skills/synap/crm.md +21 -52
  363. package/skills/synap/document-embeds.md +141 -47
  364. package/skills/synap/escalation-ladder.md +20 -10
  365. package/skills/synap/focus-sessions.md +47 -21
  366. package/skills/synap/from-intent.md +142 -0
  367. package/skills/synap/governance-rules.md +4 -4
  368. package/skills/synap/governance.md +10 -7
  369. package/skills/synap/hand-off.md +33 -0
  370. package/skills/synap/inline-patterns.md +15 -7
  371. package/skills/synap/lenses.md +33 -15
  372. package/skills/synap/linking.md +41 -40
  373. package/skills/synap/mcp-remote-servers.md +64 -0
  374. package/skills/synap/mental-model.md +17 -15
  375. package/skills/synap/operating-mode-rules.md +1 -1
  376. package/skills/synap/processes.md +118 -0
  377. package/skills/synap/quick-reference.md +5 -1
  378. package/skills/synap/reading.md +3 -1
  379. package/skills/synap/reflexes.md +12 -42
  380. package/skills/synap/viewframe-cells.md +38 -5
  381. package/skills/synap/work-flow.md +1 -1
  382. package/skills/synap/work-model.md +96 -0
  383. package/skills/synap/worked-examples.md +4 -5
  384. package/skills/synap/workspace-design.md +14 -10
  385. package/skills/synap/writes.md +97 -24
  386. package/skills/synap/writing-titles.md +63 -0
  387. package/skills/synap-app/SKILL.md +2 -2
  388. package/skills/synap-app/_skill.yaml +1 -1
  389. package/skills/synap-app/install-commands.md +1 -1
  390. package/skills/synap-design/SKILL.md +474 -0
  391. package/skills/synap-design/_order.txt +4 -0
  392. package/skills/synap-design/_skill.yaml +21 -0
  393. package/skills/synap-design/loop.md +134 -0
  394. package/skills/synap-design/overview.md +44 -0
  395. package/skills/synap-design/principles.md +130 -0
  396. package/skills/synap-design/system.md +133 -0
  397. package/skills/synap-market/SKILL.md +306 -16
  398. package/skills/synap-market/_skill.yaml +1 -1
  399. package/skills/synap-market/author-and-publish.md +145 -8
  400. package/skills/synap-market/governance-and-catalog.md +7 -0
  401. package/skills/synap-market/install.md +79 -1
  402. package/skills/synap-market/overview.md +74 -6
  403. package/skills/synap-schema/SKILL.md +172 -10
  404. package/skills/synap-schema/_order.txt +2 -0
  405. package/skills/synap-schema/_skill.yaml +4 -2
  406. package/skills/synap-schema/common-mistakes.md +4 -2
  407. package/skills/synap-schema/discover-profiles.md +1 -1
  408. package/skills/synap-schema/entity-scope.md +15 -3
  409. package/skills/synap-schema/extend-first.md +29 -0
  410. package/skills/synap-schema/extend-vs-create.md +1 -1
  411. package/skills/synap-schema/intent-vocabulary-ssot.md +111 -0
  412. package/skills/synap-schema/property-types.md +1 -1
  413. package/skills/synap-schema/relations.md +1 -1
  414. package/skills/synap-ui/SKILL.md +19 -12
  415. package/skills/synap-ui/_skill.yaml +1 -1
  416. package/skills/synap-ui/ai-companion.md +1 -1
  417. package/skills/synap-ui/arranging-bento.md +2 -0
  418. package/skills/synap-ui/bento-layouts.md +10 -10
  419. package/skills/synap-ui/bento-recipes.md +313 -543
  420. package/skills/synap-ui/four-builds.md +5 -0
  421. package/skills/synap-ui/view-types.md +2 -2
  422. package/skills/synap-ui/widget-catalog.md +22 -278
  423. package/templates/automations/bookmark-enrichment.automation.json +290 -13
  424. package/templates/automations/url-bookmark-capture.automation.json +73 -11
  425. package/templates/skills/authoring-playbooks/SKILL.md +6 -3
  426. package/templates/skills/authoring-playbooks/reference/stages-contract.md +15 -0
  427. package/templates/skills/authoring-playbooks/reference/worked-example.md +3 -0
  428. package/dist/commands/infra.d.ts +0 -21
  429. package/dist/commands/infra.js +0 -262
  430. package/dist/commands/infra.js.map +0 -1
  431. package/dist/commands/template.d.ts +0 -42
  432. package/dist/commands/template.js +0 -191
  433. package/dist/commands/template.js.map +0 -1
  434. package/dist/lib/browser-auth.d.ts +0 -35
  435. package/dist/lib/browser-auth.js +0 -170
  436. package/dist/lib/browser-auth.js.map +0 -1
  437. package/dist/lib/openclaw.d.ts +0 -32
  438. package/dist/lib/openclaw.js +0 -164
  439. package/dist/lib/openclaw.js.map +0 -1
  440. package/dist/lib/seed.d.ts +0 -13
  441. package/dist/lib/seed.js +0 -135
  442. package/dist/lib/seed.js.map +0 -1
  443. package/node_modules/@synap/hub-rest-client/dist/index.cjs +0 -1261
  444. package/node_modules/@synap/hub-rest-client/dist/index.d.cts +0 -1647
  445. package/node_modules/@synap/hub-rest-client/dist/index.d.ts +0 -1647
  446. package/node_modules/@synap/hub-rest-client/dist/index.js +0 -1231
  447. package/node_modules/@synap/hub-rest-client/package.json +0 -45
  448. package/node_modules/@synap/hub-rest-client/src/client.ts +0 -1631
  449. package/node_modules/@synap/hub-rest-client/src/errors.ts +0 -30
  450. package/node_modules/@synap/hub-rest-client/src/index.ts +0 -153
  451. package/node_modules/@synap/hub-rest-client/src/setup.ts +0 -133
  452. package/node_modules/@synap/hub-rest-client/src/types.ts +0 -1299
@@ -1,6 +1,9 @@
1
1
  operating-mode.md
2
2
  reflexes.md
3
+ concepts.md
4
+ work-model.md
3
5
  escalation-ladder.md
6
+ from-intent.md
4
7
  mental-model.md
5
8
  quick-reference.md
6
9
  lenses.md
@@ -12,6 +15,7 @@ linking-principle.md
12
15
  governance-rules.md
13
16
  capabilities.md
14
17
  writes.md
18
+ writing-titles.md
15
19
  document-embeds.md
16
20
  creative-loop.md
17
21
  graph-gardening.md
@@ -35,3 +39,6 @@ recap.md
35
39
  showing.md
36
40
  user-model.md
37
41
  north-star.md
42
+ processes.md
43
+ mcp-remote-servers.md
44
+ hand-off.md
@@ -12,7 +12,7 @@ description: >
12
12
  when the user asks about their own data. Do NOT use this skill for extending
13
13
  the schema (use synap-schema) or building dashboards and views (use synap-ui).
14
14
  metadata:
15
- openclaw:
15
+ synap:
16
16
  requires:
17
17
  env: [SYNAP_HUB_API_KEY, SYNAP_POD_URL]
18
18
  optional_env:
@@ -39,6 +39,21 @@ Filters narrow the event to specific conditions:
39
39
  }
40
40
  ```
41
41
 
42
+ ### Status changes: the transitioned event
43
+
44
+ A status move (a kind's own lifecycle, or a role's) emits ONE event, `entity.transition.completed` (the verb "transitioned"), whatever moved it: a person, a board drag, an agent through `update_entity` + `expectedStatus`, a sync. Filter it on `lifecycleProfile` (the kind or ROLE whose lifecycle moved; `profileSlug` stays the entity's kind even for a role) and `to` / `from` / `property`:
45
+
46
+ ```json
47
+ {
48
+ "eventPattern": "entity.transition.completed",
49
+ "filters": { "lifecycleProfile": "lead", "to": "qualified" }
50
+ }
51
+ ```
52
+
53
+ Prefer it to `entity.update.completed` for any status. For a ROLE it is the only one: a role's status lives on its facet, so an update rule never sees it.
54
+
55
+ **A worker usually beats a hand-written rule.** "When a post enters Review, run the review" is an activator on the playbook (`on: enters_status`), and "once 5 leads wait in qualified" is `on: count` + `min`; both compile to a governed rule like the one above, fire once per thing per transition, and are throttled by `maxPendingApprovals`. Write the rule by hand only for work no method owns. Workers: `processes`.
56
+
42
57
  ### Cron Expressions
43
58
 
44
59
  Standard 5-field cron (minute hour day month weekday):
@@ -8,6 +8,11 @@ entities[] → you already know the kind + fields
8
8
  entities[] + relations[] → a graph; refs link things that don't exist yet, reviewed as ONE proposal
9
9
  ```
10
10
 
11
+ **Titles and kinds:** each entity's title is linted — the receipt's `titleLint`
12
+ (per `ref`) names what to rewrite, and `validate: true` shows it before you
13
+ write. Status reports, decisions, open bugs and ideas are not `knowledge`; see
14
+ `writing-titles.md` for the routing rule.
15
+
11
16
  There is no wrong door to pick, because there is one door. `text` alone is the old "capture"; `entities[]` is the old "rich create"; `entities[] + relations[]` is the composite graph. All three go through `synap_capture`.
12
17
 
13
18
  ## One call → one receipt (no plan-and-commit)
@@ -40,10 +40,11 @@ synap list entities --profile=task --workspace=<id> --json
40
40
  synap get entity <id> --json
41
41
  ```
42
42
 
43
- **Capturing a decision (the AI structures — it never `note`s):**
43
+ **Recording a decision as its own graph entity:**
44
44
 
45
45
  ```bash
46
- synap capture --type decision --claim "Use Typesense for entity search" --json
46
+ synap create entity --profile=decision --name="Use Typesense for entity search" \
47
+ --props='{"summary":"Use Typesense for entity search","decisionStatus":"accepted"}' --json
47
48
  # Retrieve later with the one read verb: synap ask "Typesense decision"
48
49
  ```
49
50
 
@@ -52,27 +53,32 @@ synap capture --type decision --claim "Use Typesense for entity search" --json
52
53
  **Structured knowledge (durable, typed, searchable — preferred for engineering learnings):**
53
54
 
54
55
  ```bash
55
- # Work lane (default): a domain gotcha/lesson/decision → knowledge entity in the ACTIVE workspace
56
- synap capture --type gotcha --claim "Hono static routes must come before /:id" \
57
- --why "First-match routing; dynamic routes eat static ones" \
58
- --tags "repo:synap-backend,layer:routing" --json
59
-
60
- synap capture --type lesson --claim "code-read ≠ runtime-true for library APIs" \
61
- --evidence "tldraw 2.4.6 binding API changed silently from props.start.boundShapeId"
62
-
63
- # A quick decision-note is a typed knowledge entry (ek_type=decision):
64
- synap capture --type decision --claim "Use Typesense for entity search" \
65
- --why "pgvector deferred to V1; Typesense ships now" --json
66
-
67
- # Global lane: a runbook/best-practice that holds across ALL projects → pod-wide knowledge_keys
68
- synap capture --global --type reference --claim "Always fix the canonical path, never a workaround" \
56
+ # Work lane: one explicit Knowledge form. Keep the Markdown body on the
57
+ # linked document; these properties remain compact/queryable metadata.
58
+ synap create entity --profile=knowledge --name="Hono static route ordering" \
59
+ --workspace=<id> \
60
+ --props='{"knowledgeForm":"caution","ek_claim":"Static routes must come before /:id","ek_tags":["repo:synap-backend","layer:routing"]}' \
61
+ --content=$'## Why\\n\\nStatic routes must come before `/:id`.' --json
62
+
63
+ synap create entity --profile=knowledge --name="Verify library APIs at runtime" \
64
+ --workspace=<id> \
65
+ --props='{"knowledgeForm":"fact","ek_claim":"Code-read is not runtime-true for library APIs"}' \
66
+ --content=$'Validate the installed version before depending on an API.' --json
67
+
68
+ # A Decision is its own lifecycle entity; link it to the supporting Knowledge.
69
+ synap create entity --profile=decision --name="Use Typesense for entity search" \
70
+ --props='{"summary":"pgvector deferred to V1; Typesense ships now","decisionStatus":"accepted"}' --json
71
+
72
+ # A Reference is source material, not a Knowledge form. Create/use a source
73
+ # entity or document and link it as evidence; global runbooks remain knowledge_keys.
74
+ synap capture --global "Always fix the canonical path, never a workaround" \
69
75
  --key "principle:root-cause" --json
70
76
 
71
77
  # Retrieve any of it later with the one read verb (it spans every lane):
72
- synap ask "hono routing gotcha" --json
78
+ synap ask "hono routing caution" --json
73
79
  ```
74
80
 
75
- `synap capture --type` writes a typed **`knowledge`** entity in the **active workspace** (the Work lane); `ek_type` (gotcha|lesson|decision|reference) discriminates the kind — **one store, type tags, not a residual dump**. It's workspace-scoped, so the active workspace supplies the domain — a Builder gotcha ≠ a marketing one (there is no `engineering_knowledge`). Add **`--global`** to write a pod-wide cross-cutting runbook to `knowledge_keys` instead. A formal **decision RECORD** (rationale, alternatives, superseded-by lifecycle) is a different artifact — use smart `synap capture "<free text>"` or `synap create entity --profile=decision`. Retrieve everything with `synap ask`.
81
+ `knowledge` has exactly one canonical `knowledgeForm`: `fact`, `caution` or `convention` (a legacy `insight` is read as `fact`). It is workspace-scoped, so the active workspace supplies the domain. `ek_claim` (the "Claim") is required — the full sentence; the title is its short handle, never the claim cut off. Readable long form belongs in the entity's linked Markdown document. Status reports, decisions, open problems (`issue`) and ideas are not knowledge — see `writing-titles.md`. A formal **Decision** has its own rationale/lifecycle entity, and a **Reference** is source material linked as evidence — neither is a Knowledge form. The legacy `synap capture --type gotcha|lesson|decision|reference` command is still accepted for compatibility, but new automation must use the canonical entity properties above. Retrieve everything with `synap ask`.
76
82
  Use `capture` for anything worth remembering across sessions and projects.
77
83
 
78
84
  **Open (the one display door):**
@@ -0,0 +1,28 @@
1
+ ## Concepts — one word per idea
2
+
3
+ The ONE glossary; other skills point here. Word = what the user sees; internal = tools and tables.
4
+
5
+ | Word | Internal | Answers | Test · e.g. · not |
6
+ | ------------- | ----------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
+ | **Space** | workspace | which domain: kinds + tools? | owns kinds, never done · CRM · not a project or method; findable, not emphasised |
8
+ | **Project** | project | what am I committed to, with whom? | ends with the commitment; spans spaces · a launch · not a task, method, or the owner's company |
9
+ | **Track** | project_tracks | what lasting intent am I pursuing? | inside ONE project, lasts, never completes; direction, instructions, goal; turns workers on; work in it = sessions · grow the newsletter · no stages |
10
+ | **Step** | stage | where does this work stand? | = the subject's status: move the thing, the step follows · legacy: steps of a track started from a method |
11
+ | **Work** | focus_session | what am I doing this sitting? | one goal · no noun: "Start work" |
12
+ | **Template** | playbook | how do I reuse it? | kind DERIVED, never declared: scope session = work template (a method a session or worker follows), project = track template (legacy); also space and rule templates |
13
+ | **Pack** | suite | which templates come together? | a bundle; depends on space templates, never creates a space |
14
+ | **Rule** | automation | what runs by itself, when? | standing · "every Monday…" · not Approvals |
15
+ | **Approvals** | governance rules | which AI writes wait for me? | decides review vs auto, does no work |
16
+ | **Tools** | capability, skill, tool | what can it act with? | one word; the detail shows the kind |
17
+ | **To review** | proposal | what awaits my approval? | `proposed` is success |
18
+ | **Role** | role profile + facet | which hat does it wear? | one role per name, pod-wide; spaces add properties by overlay; its entities show in all · client · never a twin |
19
+ | **Thing** | entity | what is being worked on? | one kind, maybe roles · a post, a lead · never a twin for a hat |
20
+ | **Status** | lifecycle | where does it stand? | ONE list per kind or role, declared on its profile; category open·active·paused·done·lost · moved only through the door (`expectedStatus`) |
21
+ | **Pipeline** | pipeline view | what is in each status? | computed from a lifecycle, never created · not an object |
22
+ | **Worker** | playbook activator | what starts work by itself? | a method + trigger (enters status · schedule · count · manual) + size (per thing · per batch); a track or project turns it on |
23
+
24
+ Doors: `start_track`, `start_session`, `create_rule`, `attach_facet`, `update_entity` + `expectedStatus` (a status). How they fit (sizes, workers, tenses): `work-model`.
25
+
26
+ A lasting goal on a project: `list_tracks` → none? `start_track` (`name`, `direction`, a `kpi` only if the person names one; no method needed); work in it = `start_session` + `trackId`, as many sessions as it takes. Detail: `from-intent`.
27
+
28
+ Existing work can be filed into a track with `update_session` `trackId` (proposed; the session keeps its space). Track stages are legacy: only a track started from a track template has them (`start_stage_session`; never `advance_track` without the user).
@@ -5,7 +5,7 @@ Some workspaces run an editorial engine: `pillar`, `post`, `platform`, `newslett
5
5
  **The editorial core:**
6
6
 
7
7
  - **`pillar`** — a recurring theme the audience knows the operator for. Two to four, not twelve. `pillar-status` (Active, Developing, Paused, Retired), `pillar-goal`, `pillar-formats`, `posting-frequency`.
8
- - **`post`** — the atomic unit. `post-status` moves Idea → Briefed → In Draft → Review → Scheduled → Published → Archived. Plus `post-format`, `post-platform`, `publish-date`, `post-hook`, `post-cta`; measured by `engagement-score` and `post-reach`.
8
+ - **`post`** — the atomic unit. `post-status` is the post's ONE lifecycle: Idea → Briefed → Scripted → In Draft → Review → Scheduled → Published, or Archived (see below). Plus `post-format`, `post-platform`, `publish-date`, `post-hook`, `post-cta`; measured by `engagement-score` and `post-reach`.
9
9
  - **`platform`** — a publishing account (social, newsletter publication, podcast). Carries its own cadence and audience metrics.
10
10
  - **`newsletter`** — one issue of the owned channel. `newsletter-status`, `newsletter-pillar`.
11
11
  - **`campaign`** and **`sponsor`** — reused from marketing / foundation, not owned here.
@@ -20,6 +20,15 @@ A post joins these through `post-stage`, `post-series`, `post-offer`; a repurpos
20
20
 
21
21
  **Two axes, both optional, composable:** CURRICULUM (`series` — ordered, "which chapter is this?") and AUDIENCE STAGE (`journey-stage` — an unordered tag, "where is the reader?"). A post carries at most one of each. With neither, Content OS still works exactly as a post tracker — that is a valid end state, not an incomplete one.
22
22
 
23
+ ## The post lifecycle and who moves it
24
+
25
+ The lifecycle is declared on the `post` kind (work model: `load_skill system/synap/work-model`). Categories: Idea = open; Briefed, Scripted, In Draft, Review, Scheduled = active; Published = done; Archived = lost and **human-only**.
26
+
27
+ - **Nothing publishes itself.** Your move to Published is a proposal the person approves on the preview. Never set Archived.
28
+ - **Every move goes through the door:** `update_entity` with `post-status` = the new option AND `expectedStatus` = the status you read. A `conflict` means someone moved it; re-read. Never invent an option.
29
+ - **Workers, as the model maps them:** **Draft** (per post, when it enters Briefed) · **Review prep** (per post, when it enters Review; ends by proposing the publish date) · **Ideas** (per batch, weekly; creates posts at Idea). Today the catalog ships them as Produce Content (enters Briefed, a person approves the script and the draft), Repurpose (enters Published) and Plan Next Content (weekly, off until the operator turns it on).
30
+ - **Results go on each post**, not only in a summary. "What to make next" = read the pipeline (the Posts board): gaps per pillar, posts waiting per status.
31
+
23
32
  ## The degradation rule — check before you assume
24
33
 
25
34
  Read the world before you reason about it: `list_profiles` tells you the vocabulary actually provisioned, and the `## Pod Domains` block in your context tells you which domains exist.
@@ -6,12 +6,12 @@ The loop has three moves that compound. Each takes a one-off act and, if it's wo
6
6
 
7
7
  | Do-once (author) | → Crystallize (curate) | Tool |
8
8
  | --------------------------------------- | ----------------------------------- | ----------------------------- |
9
- | Work a multi-step goal in a **session** | → a **playbook** (the process) | `promote_session_to_playbook` |
9
+ | Work a multi-step goal in a **session** | → a **work template** (the process) | `promote_session_to_playbook` |
10
10
  | Show a result in a **cell** | → a **renderer** for an entity type | `promote_cell_to_renderer` |
11
11
 
12
12
  ### 1. Open a session for real work
13
13
 
14
- When the task is a unit of work with a deliverable — research, a build, an investigation, a sprint — and there's no active session, **`start_session`** with a clear `goal` and `expectedOutputs`. The session is the spine that accrues results (see the focus-sessions skill). Don't open one for a one-shot lookup or a casual reply.
14
+ When the task is a unit of work with a deliverable — research, a build, an investigation, a sprint — and there's no active session, **`start_session`** with a clear `goal` and `expectedOutputs`. The start door hands back the pod's matching playbooks (`playbooks.candidates`) — read them before working ad-hoc, and start again with `templateId` when one fits. The session is the spine that accrues results (see the focus-sessions skill). Don't open one for a one-shot lookup or a casual reply.
15
15
 
16
16
  ### 2. Create a cell to REPORT — don't dump data into chat
17
17
 
@@ -22,22 +22,27 @@ When you have something to _show_ the user — a list of leads, a summary, a com
22
22
 
23
23
  ### 3. Promote a good cell to a renderer — recurring presentation
24
24
 
25
- When a cell is a _good, recurring way to present a whole entity type or step_ — e.g. every `bookmark`'s detail view, every `lead`'s list row — promote it with `promote_cell_to_renderer`:
25
+ Every kind already has a built-in card — the readable-first default nobody has to ask for (a brand-new user kind even gets one AUTOMATICALLY, built from its schema). Don't reach for this move by default; reach for it when the user explicitly asks for a different look and a cell has already proven it once.
26
26
 
27
- - Pick the `profileSlug` (the entity type), the `slot` (`list` | `detail` | `dashboard`), and the `cellKey` from `create_cell`.
28
- - This is **governed**: for you it returns `{ status: "proposed", proposalId }`. That is the point — you author the renderer, the user reviews and curates it before it becomes every entity's view. Surface the proposal plainly ("I've proposed this as the detail view for bookmarks — review it when you like"), don't treat it as a failure.
29
- - Use `scope: "pod"` only when the presentation should apply in every workspace; default to workspace scope.
27
+ When a cell is a _good, recurring way to present a whole entity type or step_ — e.g. every `bookmark`'s small card, every `lead`'s list row — promote it with `promote_cell_to_renderer`:
30
28
 
31
- ### 4. Promote a finished session to a playbook — recurring process
29
+ - Pick the `profileSlug` (the entity type), the `slot` (`list` | `card` | `detail` | `dashboard` — `card` is the small embeddable block; most "change how X looks" requests mean this one, not `detail`), and the `cellKey` from `create_cell`.
30
+ - This is **governed**: for you it returns `{ status: "proposed", proposalId }`. That is the point — you author the renderer, the user reviews and curates it before it becomes every entity's view. Surface the proposal plainly ("I've proposed this as the card for bookmarks — review it when you like"), don't treat it as a failure.
31
+ - Use `scope: "pod"` only when the presentation should apply in every workspace; default to workspace scope. Bind PER KIND — never as a blanket replacement for every kind's card.
32
+ - Once it lands, tell the user where to find or revert it: **"⋯ → Customize display"** on that kind's page.
32
33
 
33
- When the session is done **and the work was a repeatable process** (not a one-off), promote it with `promote_session_to_playbook({ sessionId })`. This captures the goal, tasks, expected outputs, and steps as a reusable session template — so next time the process starts pre-built instead of from scratch.
34
+ ### 4. Promote a finished session to a template — recurring process
35
+
36
+ When the session is done **and the work was a repeatable process** (not a one-off), promote it with `promote_session_to_playbook({ sessionId })`. This captures the goal, tasks, expected outputs, and phases as a reusable **work template** (one sitting) — so next time the process starts pre-built instead of from scratch. Words: `concepts`.
34
37
 
35
38
  - Do this at the _end_, once the promised outputs are produced and verified.
36
- - Judge repeatability honestly: a bespoke, never-again investigation is not a playbook. A "weekly competitor scan" or "new-client onboarding" is.
39
+ - Judge repeatability honestly: a bespoke, never-again investigation is not a template. "New-client onboarding" is a work template.
40
+ - If it should **run on its own** ("a weekly competitor scan"), that is a **Rule** that starts the work each cycle (`create_rule`), not a template alone.
41
+ - If the work is a **lasting goal** worked over weeks, start a **track** for it on the project (`start_track`) and run this work template in it (`trackId`) — a track needs no template of its own.
37
42
  - Governed like the others — `promoted` (applied) or `proposed` (awaiting review) are both normal.
38
43
 
39
44
  ### The symmetry
40
45
 
41
- Sessions and cells are the two things you _do_; playbooks and renderers are the two things you _keep_. The instinct to build: **first do it once concretely, watch it work, then offer to crystallize it** — and let the user decide what becomes standing config. Never crystallize speculatively before the one-off has proven itself.
46
+ Sessions and cells are the two things you _do_; templates and renderers are the two things you _keep_. The instinct to build: **first do it once concretely, watch it work, then offer to crystallize it** — and let the user decide what becomes standing config. Never crystallize speculatively before the one-off has proven itself.
42
47
 
43
48
  This is escalation ladder **L4**: crystallize only after proof. Blocked/missing structure climbs L2→L3 first (`escalation-ladder.md`); L4 is the success path, not a substitute for discovery.
@@ -1,24 +1,23 @@
1
- ## CRM Workspaces — 4-Entity Model
1
+ ## CRM Workspaces — identity, roles, deals
2
2
 
3
- Some workspaces use a CRM data structure with four entities: `person` and `company` (identity records), `deal` (pipeline record), and `client` (post-win relationship marker). Understand this pattern when proposing lead captures, deal updates, or campaign membership.
3
+ A CRM workspace holds `person` and `company` (identity records), the `lead` and `client` ROLES those identities wear (facets, not entities), and `deal` (the sale). Understand this pattern when proposing lead captures, deal updates, or campaign membership.
4
4
 
5
- **The model:**
5
+ **The model (one lifecycle per kind or role):**
6
6
 
7
7
  - **`person` + `company`** — Identity only, no sales state. Persist across deals.
8
- - **`deal`** — Pipeline record with `dealStage` property (lead, contacted, qualifying, proposal, negotiating, won, lost, inactive). Represents what people often call a "lead" (when stage=lead). Linked to person/company via `linked_to_deal` relation.
9
- - **`client`** — Post-win relationship marker. Created automatically when deal transitions to stage=won. Status: active, paused, or churned. Linked via `is_client` (party → client) and `produced_by_deal` (deal → client).
10
- - **`journey`** — Documents anchored to a deal (not a person). Linked via `has_journey`.
8
+ - **`lead` role** — qualification only. Attach it with `attach_facet` to the person/company; its status is `leadStage`: new, researching, outreach, engaged, qualified, nurturing, converted, disqualified.
9
+ - **`deal`** — the sale, and nothing before it. Its one lifecycle is `commercialStage`: draft, proposed, negotiating, won, lost. Linked to person/company via `linked_to_deal`. Open a deal only when a person chose to pursue the lead.
10
+ - **`client` role** — attached to the party when a deal is won. Status `clientStatus`: prospect, active, paused, former, churned. An ended relationship is `clientStatus: churned` — never a separate `churned` role.
11
11
 
12
12
  **AI behavior — lead capture:**
13
13
 
14
- When the user describes a lead (inbound person, prospect, or company lead), propose the full bundle:
14
+ When the user describes a lead (inbound person, prospect, or company lead):
15
15
 
16
- 1. Create `person` entity (if not exists) with email, role, company name
17
- 2. Create `company` entity (if not exists)
18
- 3. Create `deal` entity with `dealStage: "lead"` and `estimatedValue` (if known)
19
- 4. Create `linked_to_deal` relation connecting person/company to deal
16
+ 1. Resolve the person/company first (email, domain, url); create only if none matches
17
+ 2. `attach_facet` the `lead` role with `leadStage: "new"`
18
+ 3. Do NOT open a deal yet — a deal starts when the person decides to pursue
20
19
 
21
- Never create a person with a sales-state flag. The deal is the lead container.
20
+ A booked call (Cal.com) is lead evidence, not a deal. The booking already resolves the person (and company), attaches `lead` at `leadStage: "engaged"` — moving an earlier lead forward, never a qualified, nurturing, converted or disqualified one back — and links the call as an `event` `attended_by` the person. Do not open a deal for a booking.
22
21
 
23
22
  ```json
24
23
  POST /api/hub/entities
@@ -27,50 +26,19 @@ POST /api/hub/entities
27
26
  "title": "Alice Johnson",
28
27
  "properties": { "email": "alice@acme.com", "role": "VP Engineering" }
29
28
  }
30
-
31
- POST /api/hub/entities
32
- { "userId": "{userId}", "workspaceId": "{wsId}",
33
- "profileSlug": "deal",
34
- "title": "Acme prospect",
35
- "properties": { "dealStage": "lead", "estimatedValue": 50000 }
36
- }
37
-
38
- POST /api/hub/relations
39
- { "userId": "{userId}",
40
- "sourceEntityId": "ent_person_alice",
41
- "targetEntityId": "ent_deal_acme",
42
- "type": "linked_to_deal"
43
- }
29
+ // then attach_facet { entityId: "ent_person_alice", facetSlug: "lead", properties: { "leadStage": "new" } }
44
30
  ```
45
31
 
46
- **AI behavior — moving deals to won:**
32
+ **AI behavior — pursue, then win:**
47
33
 
48
- When a deal transitions to `dealStage: "won"`, also propose client creation if not yet linked:
34
+ When the person chooses to pursue: create the `deal` at `commercialStage: "draft"`, link the party with `linked_to_deal`, and set the lead's `leadStage: "converted"`. When a person confirms the deal is won: set `commercialStage: "won"` and `attach_facet` the `client` role on the party with `clientStatus: "active"`. Moving a deal to won or lost is a person's call — propose it, never decide it.
35
+
36
+ Every status move goes through the one door (work model: `load_skill system/synap/work-model`): send the new value AND `expectedStatus` = the status you read (`update_entity` for the deal's `commercialStage`; `update_facet` for a role's status where your tools list it). A `conflict` means someone moved it: re-read. `converted` and `won` are done, `lost` and `disqualified` are lost: an agent's move into them proposes, and `disqualified` is a person's call only.
49
37
 
50
38
  ```json
51
39
  PATCH /api/hub/entities/ent_deal_acme
52
- { "properties": { "dealStage": "won" } }
53
-
54
- POST /api/hub/entities
55
- { "userId": "{userId}", "workspaceId": "{wsId}",
56
- "profileSlug": "client",
57
- "title": "Acme (active)",
58
- "properties": { "clientStatus": "active" }
59
- }
60
-
61
- POST /api/hub/relations
62
- { "userId": "{userId}",
63
- "sourceEntityId": "ent_person_alice",
64
- "targetEntityId": "ent_client_acme",
65
- "type": "is_client"
66
- }
67
-
68
- POST /api/hub/relations
69
- { "userId": "{userId}",
70
- "sourceEntityId": "ent_deal_acme",
71
- "targetEntityId": "ent_client_acme",
72
- "type": "produced_by_deal"
73
- }
40
+ { "properties": { "commercialStage": "won" } }
41
+ // then attach_facet { entityId: "ent_company_acme", facetSlug: "client", properties: { "clientStatus": "active" } }
74
42
  ```
75
43
 
76
44
  **AI behavior — campaign membership:**
@@ -96,8 +64,9 @@ POST /api/hub/relations
96
64
 
97
65
  **Property names:**
98
66
 
99
- - `dealStage` (not `crmStatus` or `status`) — values: lead, contacted, qualifying, proposal, negotiating, won, lost, inactive
100
- - `clientStatus` (post-win only) — values: active, paused, churned
67
+ - `commercialStage` on `deal` (never `dealStage`, `stage`, `crmStatus` or `status` — retired) — draft, proposed, negotiating, won, lost
68
+ - `leadStage` on the `lead` facet — new, researching, outreach, engaged, qualified, nurturing, converted, disqualified
69
+ - `clientStatus` on the `client` facet — prospect, active, paused, former, churned
101
70
  - Identities (person, company) carry no sales state
102
71
 
103
72
  **Why separate identity from state:**