@prismer/runtime 2.0.7 → 2.2.55

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 (291) hide show
  1. package/CHANGELOG.md +3631 -0
  2. package/README.md +34 -12
  3. package/apc/skills/FIELD-DICTIONARY.md +111 -0
  4. package/apc/skills/bug-reproduce/SKILL.md +150 -0
  5. package/apc/skills/bug-reproduce/skill.json +96 -0
  6. package/apc/skills/code-review/SKILL.md +198 -0
  7. package/apc/skills/code-review/skill.json +124 -0
  8. package/apc/skills/design-review/SKILL.md +122 -0
  9. package/apc/skills/design-review/skill.json +88 -0
  10. package/apc/skills/doc-sync/SKILL.md +168 -0
  11. package/apc/skills/doc-sync/skill.json +81 -0
  12. package/apc/skills/env-doctor/SKILL.md +194 -0
  13. package/apc/skills/env-doctor/skill.json +209 -0
  14. package/apc/skills/git-ops/SKILL.md +189 -0
  15. package/apc/skills/git-ops/skill.json +94 -0
  16. package/apc/skills/impact-trace/SKILL.md +168 -0
  17. package/apc/skills/impact-trace/skill.json +104 -0
  18. package/apc/skills/observability/SKILL.md +195 -0
  19. package/apc/skills/observability/skill.json +116 -0
  20. package/apc/skills/release-db-config-sync/SKILL.md +186 -0
  21. package/apc/skills/release-db-config-sync/skill.json +109 -0
  22. package/apc/skills/release-ota-promote/SKILL.md +195 -0
  23. package/apc/skills/release-ota-promote/skill.json +176 -0
  24. package/apc/skills/release-preflight/SKILL.md +174 -0
  25. package/apc/skills/release-preflight/skill.json +175 -0
  26. package/apc/skills/release-rollback/SKILL.md +214 -0
  27. package/apc/skills/release-rollback/skill.json +230 -0
  28. package/apc/skills/release-tag/SKILL.md +194 -0
  29. package/apc/skills/release-tag/skill.json +94 -0
  30. package/apc/skills/releasing-prod/SKILL.md +49 -0
  31. package/apc/skills/releasing-test/SKILL.md +135 -0
  32. package/apc/skills/sdk-release/SKILL.md +200 -0
  33. package/apc/skills/spec-intake/SKILL.md +169 -0
  34. package/apc/skills/spec-intake/skill.json +93 -0
  35. package/apc/skills/test-result-feedback/SKILL.md +239 -0
  36. package/apc/skills/test-result-feedback/skill.json +193 -0
  37. package/apc/skills/test-runner/SKILL.md +169 -0
  38. package/apc/skills/test-runner/skill.json +103 -0
  39. package/apc/skills/ui-align/SKILL.md +209 -0
  40. package/apc/skills/ui-align/skill.json +114 -0
  41. package/apc/skills/ui-canvas/SKILL.md +148 -0
  42. package/apc/skills/ui-canvas/skill.json +127 -0
  43. package/built-in-skills/agent-coordination/SKILL.md +257 -0
  44. package/built-in-skills/agent-meta/SKILL.md +53 -0
  45. package/built-in-skills/assets/SKILL.md +133 -0
  46. package/built-in-skills/browser-use/SKILL.md +93 -0
  47. package/built-in-skills/canvas-design/LICENSE.txt +202 -0
  48. package/built-in-skills/canvas-design/SKILL.md +157 -0
  49. package/built-in-skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
  50. package/built-in-skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
  51. package/built-in-skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
  52. package/built-in-skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
  53. package/built-in-skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
  54. package/built-in-skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
  55. package/built-in-skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
  56. package/built-in-skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  57. package/built-in-skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  58. package/built-in-skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  59. package/built-in-skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
  60. package/built-in-skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
  61. package/built-in-skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
  62. package/built-in-skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
  63. package/built-in-skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
  64. package/built-in-skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
  65. package/built-in-skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
  66. package/built-in-skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
  67. package/built-in-skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
  68. package/built-in-skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
  69. package/built-in-skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
  70. package/built-in-skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
  71. package/built-in-skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
  72. package/built-in-skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
  73. package/built-in-skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
  74. package/built-in-skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
  75. package/built-in-skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
  76. package/built-in-skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
  77. package/built-in-skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
  78. package/built-in-skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
  79. package/built-in-skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  80. package/built-in-skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  81. package/built-in-skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  82. package/built-in-skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  83. package/built-in-skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  84. package/built-in-skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  85. package/built-in-skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  86. package/built-in-skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
  87. package/built-in-skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
  88. package/built-in-skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  89. package/built-in-skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  90. package/built-in-skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  91. package/built-in-skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
  92. package/built-in-skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
  93. package/built-in-skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
  94. package/built-in-skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
  95. package/built-in-skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
  96. package/built-in-skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  97. package/built-in-skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  98. package/built-in-skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  99. package/built-in-skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
  100. package/built-in-skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  101. package/built-in-skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
  102. package/built-in-skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
  103. package/built-in-skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
  104. package/built-in-skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  105. package/built-in-skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  106. package/built-in-skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  107. package/built-in-skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
  108. package/built-in-skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  109. package/built-in-skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
  110. package/built-in-skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
  111. package/built-in-skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
  112. package/built-in-skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
  113. package/built-in-skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
  114. package/built-in-skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
  115. package/built-in-skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
  116. package/built-in-skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
  117. package/built-in-skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
  118. package/built-in-skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
  119. package/built-in-skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
  120. package/built-in-skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  121. package/built-in-skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
  122. package/built-in-skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  123. package/built-in-skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
  124. package/built-in-skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
  125. package/built-in-skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
  126. package/built-in-skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
  127. package/built-in-skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
  128. package/built-in-skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
  129. package/built-in-skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  130. package/built-in-skills/claim-agent-ownership/SKILL.md +255 -0
  131. package/built-in-skills/claude-api/LICENSE.txt +202 -0
  132. package/built-in-skills/claude-api/SKILL.md +325 -0
  133. package/built-in-skills/claude-api/csharp/claude-api.md +402 -0
  134. package/built-in-skills/claude-api/curl/examples.md +216 -0
  135. package/built-in-skills/claude-api/curl/managed-agents.md +336 -0
  136. package/built-in-skills/claude-api/go/claude-api.md +421 -0
  137. package/built-in-skills/claude-api/go/managed-agents/README.md +561 -0
  138. package/built-in-skills/claude-api/java/claude-api.md +432 -0
  139. package/built-in-skills/claude-api/java/managed-agents/README.md +442 -0
  140. package/built-in-skills/claude-api/php/claude-api.md +375 -0
  141. package/built-in-skills/claude-api/php/managed-agents/README.md +435 -0
  142. package/built-in-skills/claude-api/python/claude-api/README.md +420 -0
  143. package/built-in-skills/claude-api/python/claude-api/batches.md +185 -0
  144. package/built-in-skills/claude-api/python/claude-api/files-api.md +165 -0
  145. package/built-in-skills/claude-api/python/claude-api/streaming.md +162 -0
  146. package/built-in-skills/claude-api/python/claude-api/tool-use.md +590 -0
  147. package/built-in-skills/claude-api/python/managed-agents/README.md +332 -0
  148. package/built-in-skills/claude-api/ruby/claude-api.md +113 -0
  149. package/built-in-skills/claude-api/ruby/managed-agents/README.md +389 -0
  150. package/built-in-skills/claude-api/shared/agent-design.md +101 -0
  151. package/built-in-skills/claude-api/shared/error-codes.md +213 -0
  152. package/built-in-skills/claude-api/shared/live-sources.md +135 -0
  153. package/built-in-skills/claude-api/shared/managed-agents-api-reference.md +378 -0
  154. package/built-in-skills/claude-api/shared/managed-agents-client-patterns.md +209 -0
  155. package/built-in-skills/claude-api/shared/managed-agents-core.md +238 -0
  156. package/built-in-skills/claude-api/shared/managed-agents-environments.md +215 -0
  157. package/built-in-skills/claude-api/shared/managed-agents-events.md +195 -0
  158. package/built-in-skills/claude-api/shared/managed-agents-memory.md +197 -0
  159. package/built-in-skills/claude-api/shared/managed-agents-multiagent.md +99 -0
  160. package/built-in-skills/claude-api/shared/managed-agents-onboarding.md +114 -0
  161. package/built-in-skills/claude-api/shared/managed-agents-outcomes.md +106 -0
  162. package/built-in-skills/claude-api/shared/managed-agents-overview.md +68 -0
  163. package/built-in-skills/claude-api/shared/managed-agents-self-hosted-sandboxes.md +173 -0
  164. package/built-in-skills/claude-api/shared/managed-agents-tools.md +321 -0
  165. package/built-in-skills/claude-api/shared/managed-agents-webhooks.md +110 -0
  166. package/built-in-skills/claude-api/shared/model-migration.md +779 -0
  167. package/built-in-skills/claude-api/shared/models.md +121 -0
  168. package/built-in-skills/claude-api/shared/prompt-caching.md +171 -0
  169. package/built-in-skills/claude-api/shared/tool-use-concepts.md +327 -0
  170. package/built-in-skills/claude-api/typescript/claude-api/README.md +333 -0
  171. package/built-in-skills/claude-api/typescript/claude-api/batches.md +106 -0
  172. package/built-in-skills/claude-api/typescript/claude-api/files-api.md +98 -0
  173. package/built-in-skills/claude-api/typescript/claude-api/streaming.md +178 -0
  174. package/built-in-skills/claude-api/typescript/claude-api/tool-use.md +527 -0
  175. package/built-in-skills/claude-api/typescript/managed-agents/README.md +359 -0
  176. package/built-in-skills/codebase-design/DEEPENING.md +37 -0
  177. package/built-in-skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  178. package/built-in-skills/codebase-design/LICENSE +21 -0
  179. package/built-in-skills/codebase-design/SKILL.md +116 -0
  180. package/built-in-skills/conversation-compaction/SKILL.md +114 -0
  181. package/built-in-skills/council-creator/SKILL.md +426 -0
  182. package/built-in-skills/diagnosing-bugs/LICENSE +21 -0
  183. package/built-in-skills/diagnosing-bugs/SKILL.md +136 -0
  184. package/built-in-skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  185. package/built-in-skills/doc-coauthoring/SKILL.md +376 -0
  186. package/built-in-skills/document-generation/SKILL.md +105 -0
  187. package/built-in-skills/domain-modeling/ADR-FORMAT.md +47 -0
  188. package/built-in-skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  189. package/built-in-skills/domain-modeling/LICENSE +21 -0
  190. package/built-in-skills/domain-modeling/SKILL.md +76 -0
  191. package/built-in-skills/frontend-design/LICENSE.txt +177 -0
  192. package/built-in-skills/frontend-design/SKILL.md +43 -0
  193. package/built-in-skills/human-approval/SKILL.md +129 -0
  194. package/built-in-skills/image-generate/SKILL.md +128 -0
  195. package/built-in-skills/image-generate/scripts/generate-and-deliver.mjs +289 -0
  196. package/built-in-skills/ingest/SKILL.md +73 -0
  197. package/built-in-skills/internal-comms/LICENSE.txt +202 -0
  198. package/built-in-skills/internal-comms/SKILL.md +33 -0
  199. package/built-in-skills/internal-comms/examples/3p-updates.md +47 -0
  200. package/built-in-skills/internal-comms/examples/company-newsletter.md +65 -0
  201. package/built-in-skills/internal-comms/examples/faq-answers.md +30 -0
  202. package/built-in-skills/internal-comms/examples/general-comms.md +16 -0
  203. package/built-in-skills/liteparse/SKILL.md +176 -0
  204. package/built-in-skills/mcp-builder/LICENSE.txt +202 -0
  205. package/built-in-skills/mcp-builder/SKILL.md +237 -0
  206. package/built-in-skills/mcp-builder/reference/evaluation.md +602 -0
  207. package/built-in-skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  208. package/built-in-skills/mcp-builder/reference/node_mcp_server.md +970 -0
  209. package/built-in-skills/mcp-builder/reference/python_mcp_server.md +719 -0
  210. package/built-in-skills/mcp-builder/scripts/connections.py +151 -0
  211. package/built-in-skills/mcp-builder/scripts/evaluation.py +373 -0
  212. package/built-in-skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  213. package/built-in-skills/mcp-builder/scripts/requirements.txt +2 -0
  214. package/built-in-skills/memory/SKILL.md +471 -0
  215. package/built-in-skills/memory-dream/SKILL.md +339 -0
  216. package/built-in-skills/office-artifacts/SKILL.md +211 -0
  217. package/built-in-skills/okr/SKILL.md +154 -0
  218. package/built-in-skills/persona/SKILL.md +81 -0
  219. package/built-in-skills/persona-generator/SKILL.md +296 -0
  220. package/built-in-skills/pkf-svg/SKILL.md +253 -0
  221. package/built-in-skills/pkf-writing/SKILL.md +236 -0
  222. package/built-in-skills/prismer-im-collab/SKILL.md +168 -0
  223. package/built-in-skills/proactivity/SKILL.md +84 -0
  224. package/built-in-skills/remotion/SKILL.md +431 -0
  225. package/built-in-skills/role-builder/SKILL.md +203 -0
  226. package/built-in-skills/role-builder/scripts/author-role.mjs +334 -0
  227. package/built-in-skills/role-builder/scripts/ingest-role.mjs +223 -0
  228. package/built-in-skills/role-builder/scripts/instantiate-and-run.mjs +290 -0
  229. package/built-in-skills/role-builder/scripts/operation-harness.mjs +267 -0
  230. package/built-in-skills/skill-authoring/SKILL.md +134 -0
  231. package/built-in-skills/skill-authoring/skill.json +74 -0
  232. package/built-in-skills/skill-builder/SKILL.md +171 -0
  233. package/built-in-skills/skill-builder/scripts/ingest.mjs +265 -0
  234. package/built-in-skills/skill-creator/LICENSE.txt +202 -0
  235. package/built-in-skills/skill-creator/SKILL.md +227 -0
  236. package/built-in-skills/skill-creator/agents/analyzer.md +274 -0
  237. package/built-in-skills/skill-creator/agents/comparator.md +202 -0
  238. package/built-in-skills/skill-creator/agents/grader.md +223 -0
  239. package/built-in-skills/skill-creator/assets/eval_review.html +146 -0
  240. package/built-in-skills/skill-creator/eval-viewer/generate_review.py +471 -0
  241. package/built-in-skills/skill-creator/eval-viewer/viewer.html +1325 -0
  242. package/built-in-skills/skill-creator/references/external-library-import.md +110 -0
  243. package/built-in-skills/skill-creator/references/schemas.md +430 -0
  244. package/built-in-skills/skill-creator/scripts/__init__.py +0 -0
  245. package/built-in-skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  246. package/built-in-skills/skill-creator/scripts/generate_report.py +326 -0
  247. package/built-in-skills/skill-creator/scripts/import-library.mjs +475 -0
  248. package/built-in-skills/skill-creator/scripts/improve_description.py +247 -0
  249. package/built-in-skills/skill-creator/scripts/package_skill.py +136 -0
  250. package/built-in-skills/skill-creator/scripts/quick_validate.py +103 -0
  251. package/built-in-skills/skill-creator/scripts/run_eval.py +310 -0
  252. package/built-in-skills/skill-creator/scripts/run_loop.py +328 -0
  253. package/built-in-skills/skill-creator/scripts/utils.py +47 -0
  254. package/built-in-skills/slack-gif-creator/LICENSE.txt +202 -0
  255. package/built-in-skills/slack-gif-creator/SKILL.md +291 -0
  256. package/built-in-skills/slack-gif-creator/core/easing.py +234 -0
  257. package/built-in-skills/slack-gif-creator/core/frame_composer.py +176 -0
  258. package/built-in-skills/slack-gif-creator/core/gif_builder.py +269 -0
  259. package/built-in-skills/slack-gif-creator/core/validators.py +136 -0
  260. package/built-in-skills/slack-gif-creator/requirements.txt +4 -0
  261. package/built-in-skills/tasks/SKILL.md +413 -0
  262. package/built-in-skills/tdd/LICENSE +21 -0
  263. package/built-in-skills/tdd/SKILL.md +110 -0
  264. package/built-in-skills/tdd/mocking.md +59 -0
  265. package/built-in-skills/tdd/refactoring.md +10 -0
  266. package/built-in-skills/tdd/tests.md +61 -0
  267. package/built-in-skills/team/SKILL.md +77 -0
  268. package/built-in-skills/web-artifacts-builder/LICENSE.txt +202 -0
  269. package/built-in-skills/web-artifacts-builder/SKILL.md +105 -0
  270. package/built-in-skills/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
  271. package/built-in-skills/web-artifacts-builder/scripts/init-artifact.sh +334 -0
  272. package/built-in-skills/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
  273. package/built-in-skills/webapp-testing/LICENSE.txt +202 -0
  274. package/built-in-skills/webapp-testing/SKILL.md +97 -0
  275. package/built-in-skills/webapp-testing/examples/console_logging.py +35 -0
  276. package/built-in-skills/webapp-testing/examples/element_discovery.py +40 -0
  277. package/built-in-skills/webapp-testing/examples/static_html_automation.py +33 -0
  278. package/built-in-skills/webapp-testing/scripts/with_server.py +106 -0
  279. package/built-in-skills/wechat-pay/SKILL.md +59 -0
  280. package/dist/cli.cjs +72577 -16101
  281. package/dist/cli.js +72752 -16232
  282. package/dist/index.cjs +72632 -16024
  283. package/dist/index.d.cts +4956 -640
  284. package/dist/index.d.ts +4956 -640
  285. package/dist/index.js +72564 -15963
  286. package/package.json +39 -6
  287. package/plugins/memory/prismer/__init__.py +1211 -0
  288. package/plugins/memory/prismer/plugin.yaml +8 -0
  289. package/plugins/memory/prismer/tool-schemas.generated.json +249 -0
  290. package/plugins/tools/prismer-recall/__init__.py +282 -0
  291. package/plugins/tools/prismer-recall/plugin.yaml +15 -0
@@ -0,0 +1,339 @@
1
+ ---
2
+ name: memory-dream
3
+ scope: common
4
+ role_scope: orchestrator-only
5
+ description: |
6
+ Actively curate the workspace memory wiki as the appointed orchestrator: READ the
7
+ Dream candidates (`memory_curate(op="candidates")` → orphan leaves, near-duplicate
8
+ clusters, stale pages, remote-conflict pages, oversized hubs), BROWSE the current
9
+ structure (`memory_browse`), CLUSTER scattered leaves by topic with your OWN LLM,
10
+ CONVERGE the flat star into an INDEX→hub→leaf hierarchy with
11
+ `memory_curate(op="promote_to_hub", childPaths=[…])` + `rebuild_index`, MAINTAIN
12
+ hub `#overview` prose and the INDEX's authored semantic sections (hub `#toc` stays
13
+ machine-generated; INDEX Contents is graph-derived), SPLIT oversized hubs, then
14
+ VERIFY via candidates again and
15
+ REPORT the changes. The periodic tidy that merges duplicates and prunes stale —
16
+ the enacting counterpart to write-time placement. Cloud-triggered and
17
+ orchestrator-enacted: the Cloud scheduler evaluates authoritative wiki health and
18
+ dispatches one internal task; the appointed workspace orchestrator runs this skill.
19
+ A user may also request curation directly. Orchestrator-only — write verbs reject
20
+ any non-orchestrator actor (403).
21
+ applies_to: [hermes, claude-code, codex]
22
+ version: 4
23
+ ---
24
+
25
+ # Memory Dream — orchestrator-driven consolidation
26
+
27
+ > **Memory pages are PKF (`.pkf`).** When you fold or merge page bodies, the body syntax
28
+ > (sections, typed links, frontmatter) comes from the **`pkf-writing`** skill — load it
29
+ > when you author body content, and validate the result before persisting. This skill
30
+ > only governs the graph: what to merge, where to attach, and how to keep INDEX/hub
31
+ > ownership straight.
32
+
33
+ > **Candidate boundary.** Dream sees authoritative **Memory Pages**, not “all PKF.” A
34
+ > message-inline PKF or Library `.pkf` Asset remains outside this loop. Runtime
35
+ > automatically classifies durable claims from validated inline PKF; Asset handling
36
+ > still uses the `memory` skill. Explicitly materialize authoritative inline bytes only
37
+ > when the user requests exact preservation. Only a resulting Memory Page participates
38
+ > in candidates, revisions, merges and hub TOCs.
39
+
40
+ You are (when appointed) the **workspace memory orchestrator**. Your job is the "Dream
41
+ phase": periodically reorganize the memory wiki so it stays coherent as it grows — merge
42
+ duplicate hubs, attach satellite pages under the right hub, supersede stale/contradicted
43
+ pages, keep the top-level INDEX lean, maintain every hub's `#overview` plus the INDEX's
44
+ authored semantic sections, and split hubs that have grown oversized.
45
+
46
+ There is one automatic trigger authority: the **Cloud SchedulerService** sweeps every
47
+ six hours, applies the 24-hour cadence gate plus authoritative wiki-health signals
48
+ (orphan ratio, oversized INDEX, frontier duplicate cluster, or page-growth burst),
49
+ deduplicates in-flight work, and dispatches one hidden `memory-dream` task to the bound
50
+ workspace orchestrator. The Cloud performs no Memory LLM reasoning. The appointed
51
+ orchestrator executes this skill in its own Runtime and is the sole automatic write
52
+ actor. A user can also ask that orchestrator to curate immediately; ordinary per-page
53
+ queries do not trigger Dream. The retired daemon `FF_MEMORY_DREAM_ENABLED` scheduler is
54
+ not an active trigger path.
55
+
56
+ > **Authority gate.** The curation write verbs only work for the **appointed workspace
57
+ > orchestrator** (the workspace owner, or the agent set as `orchestratorAgentId`).
58
+ > If you are not the orchestrator, every write verb returns `403 orchestrator_only` —
59
+ > that is expected, not a bug. Do not retry; write-time placement discipline (the
60
+ > **memory** skill's browse-first flow) is what every agent does, and it is enough.
61
+
62
+ **Owner vs orchestrator vs deputy (product209/16 MA-2):**
63
+
64
+ - The **owner** (human) and the **appointed orchestrator**
65
+ (`orchestratorAgentId`) are the only Dream write actors. The owner speaking
66
+ through an agent does NOT grant it Dream rights — the agent itself must hold
67
+ the orchestrator binding. Dream never back-derives authority from "the owner
68
+ is talking to me".
69
+ - A **deputy** does NOT inherit Dream from its bound member — not even when
70
+ the bound member is the owner. A deputy runs Dream write verbs only if the
71
+ deputy agent itself is the appointed `orchestratorAgentId`.
72
+ - `candidates` is the READ half and works for any agent in scope; the write
73
+ verbs (`promote_to_hub` / `supersede` / `rebuild_index` and the section-level
74
+ `section_merge` / `section_supersede` / `rewire`) are the gated half.
75
+ - `403 orchestrator_only` and `202 approval deferred` are final per-request
76
+ verdicts — do not retry, and do not route around them through another agent.
77
+
78
+ ## The verbs
79
+
80
+ ```
81
+ memory_curate(op="candidates") # READ what needs work (any agent)
82
+ memory_curate(op="candidates", kind="orphans") # one surface; limit caps per kind
83
+ memory_browse(query="<topic>") # READ the structure: {index, hubs[+snippet], nearest}
84
+ memory_curate(op="promote_to_hub", pageId="<id>",
85
+ childPaths=["<path>", …]) # leaf → hub AND attach children (orchestrator only)
86
+ memory_curate(op="supersede", pageId="<id>",
87
+ reason="merged into <path>") # archive + mark stale (orchestrator only)
88
+ memory_curate(op="rebuild_index") # regenerate hub TOCs; INDEX Contents stays graph-derived (orchestrator only)
89
+ memory_curate(op="section_merge", pageId="<winnerPageId>",
90
+ targetSection="<winnerSlug>", sourcePageId="<loserPageId>",
91
+ sourceSection="<loserSlug>",
92
+ mergedContent="<merged body>") # fold ONE near-duplicate section (memory211 W5)
93
+ memory_curate(op="section_supersede", pageId="<pageId>",
94
+ section="<slug>") # retire ONE section in place (memory211 W5)
95
+ memory_curate(op="rewire", linkId="<linkId>",
96
+ toPageId="<id>") # re-point a broken/wrong link (memory211 W5)
97
+ ```
98
+
99
+ - `candidates` is the READ half: `{candidates:{orphans,duplicates,stale,conflicts,oversized}}`
100
+ — unplaced leaves (no outgoing `child-of`/`parent` edge to a live hub; an INDEX
101
+ `index-anchor` only guarantees reachability and therefore still counts as flat), near-duplicate clusters
102
+ (`duplicate_cluster:<peerIds>`), stale pages, remote-conflict pages, and oversized
103
+ hub/INDEX advisories (`kind="oversized"` — size is recorded, never machine-enforced;
104
+ splitting is YOUR call). It does NOT cluster or decide; that is YOUR LLM's job.
105
+ - **`promote_to_hub` takes `childPaths[]`** — pass the member pages' paths (exactly as
106
+ candidates/browse returned them) and the cloud attaches them under the new hub as
107
+ `child-of` children **in the same call**. Do not promote a hollow hub and re-anchor
108
+ members one by one afterwards.
109
+ - `rebuild_index` is the ONLY **hub** `#toc` writer. It emits a complete strict PKF
110
+ `<section>` with stable `data-sid`, one navigation entry per graph child and the
111
+ child's frontmatter `description`. Structural `child-of` remains child→hub in the
112
+ graph; downward TOC links are navigation, never inverted placement edges. Hub
113
+ `<h2 id="overview">` prose is agent territory and survives rebuild.
114
+ - Top INDEX is different: its Contents is derived live from the graph and there is no
115
+ stored machine `#toc` to rebuild or edit. Its authored semantic sections are the
116
+ orchestrator's editorial territory.
117
+ - **Section verbs (memory211 W5)** — the granularity drift happens at SECTION level, so
118
+ curation does too. `section_merge` rewrites the winner's section with `mergedContent`,
119
+ splices the loser section out of its page, and the CLOUD writes the
120
+ `supersedes` + `derived-from` provenance edges for you — a merge with no edge trail is
121
+ an unfinished merge. `section_supersede` retires one section (optionally pointing at the
122
+ surviving one). `rewire` fixes a single broken/wrong link without a page rewrite.
123
+ - There is no `run_dream` cloud-LLM op — `candidates` (read) + the write ops are
124
+ the whole surface (memory203/13 §0.5: all memory LLM runs in your runtime, never the
125
+ cloud's).
126
+
127
+ Enactment is the native `memory_curate` TOOL (the same tool surface every agent already
128
+ holds, alongside `memory_search` / `memory_load` / `memory_browse` / `memory_write`). Do
129
+ NOT look for a separate "memory-dream tool" or shell — `memory_curate` IS the enactment
130
+ surface. (A `prismer memory curate …` CLI exists for shell contexts; the TOOL is primary.)
131
+ If a curate response is `degraded:true`, no authoritative Cloud mutation occurred;
132
+ report the degraded state and never describe the requested convergence as completed.
133
+
134
+ ## The convergence loop (keep it tight)
135
+
136
+ Run the loop end-to-end in a handful of calls — `memory_browse` gives you the whole
137
+ structure in ONE call, so you never need long exploratory search/load spelunking:
138
+
139
+ **STEP 1 — READ the candidates.**
140
+
141
+ ```
142
+ memory_curate(op="candidates")
143
+ # → { ok:true, candidates: {
144
+ # orphans: { items:[ {pageId, path, reason:"orphan"}, … ], total },
145
+ # duplicates: { items:[ {pageId, path, reason:"duplicate_cluster:<peerIds>"}, … ], total },
146
+ # stale: { items:[ {pageId, path, reason}, … ], total },
147
+ # conflicts: { items:[ {pageId, path, reason:"remote-conflict",
148
+ # metadata:{…, latestTwoVersionSummaries}}, … ], total },
149
+ # oversized: { items:[ {pageId, path, reason:"oversized:toc_entries,body_chars",
150
+ # metadata:{bodyChars, tocEntries, softThresholds, advisory:true}}, … ], total } } }
151
+ ```
152
+
153
+ **STEP 1b — REVIEW the conflicts.** `memory_curate(op="candidates", kind="conflicts")`
154
+ lists pages whose current head landed via a remote-conflict LWW merge (two devices
155
+ diverged); each item carries the latest two version summaries (changeSummary /
156
+ authoredBy / createdAt) so you can judge which side won. For each one, confirm the
157
+ head is correct — `memory_load` it and check the LWW winner didn't clobber the better
158
+ content; if it did, `memory_write` the corrected body. Conflict is a STATE, not a
159
+ brand: a curation touch or clean rewrite of the page clears it (an identical-content
160
+ rewrite is a no-op and does NOT), so a reviewed page drops off this list on the next
161
+ `candidates` read.
162
+
163
+ **STEP 1c — REVIEW the oversized hubs.** `memory_curate(op="candidates",
164
+ kind="oversized")` lists hubs whose body chars or stored TOC entry count exceeds the
165
+ advisory soft thresholds, plus INDEX advisories based on its authored body size (its
166
+ Contents is graph-derived). These are **split suggestions, never enforcement** — a
167
+ lean hub (overview + TOC) keeps every multi-hop recall fast. For a hub with too many
168
+ children, split by sub-topic: pick the natural anchor leaf of each sub-cluster,
169
+ `promote_to_hub` it WITH its `childPaths`, and the moved children drop out of the
170
+ parent's TOC on the next rebuild. A hub that is oversized because its overview prose
171
+ grew into an essay: move the essay's durable content into a leaf under the hub and
172
+ shrink the overview back to a summary. Use your judgment — an advisory you deliberately
173
+ leave alone (and say so in the report) is a valid outcome.
174
+
175
+ **STEP 2 — BROWSE the structure.**
176
+
177
+ ```
178
+ memory_browse(query="<dominant candidate topic>")
179
+ # → { index, hubs:[{path,title,pageType,snippet}], nearest:[…] }
180
+ ```
181
+
182
+ One call shows you which hubs already exist and what each is about — decide whether a
183
+ candidate cluster belongs under an EXISTING hub (attach, don't mint a duplicate hub) or
184
+ needs a new one. Spot-check individual members with `memory_load` only where the title
185
+ is ambiguous; do not load every page.
186
+
187
+ **STEP 3 — DECIDE clusters (your LLM — this is the point).** Group the orphan leaves by
188
+ topic. A cluster is a set of leaves that genuinely share one topic and deserve a single
189
+ hub above them. For duplicate clusters, decide:
190
+
191
+ - Same topic, one is a clear superset → **merge** (fold content, supersede the loser).
192
+ - Adjacent but distinct → **link, don't merge** (write with `relation="related"` or a
193
+ typed `<a rel="related">` with a canonical href) — merging distinct facts loses recall
194
+ precision.
195
+ - Ambiguous / high-stakes → **do not enact**; leave it for human review. When unsure,
196
+ prefer leaving two pages over deleting one.
197
+
198
+ **STEP 4 — ENACT per cluster: promote WITH children.**
199
+
200
+ ```
201
+ memory_curate(op="promote_to_hub",
202
+ pageId="<id of the cluster's natural anchor page>",
203
+ childPaths=["project/helios-billing.pkf",
204
+ "project/helios-db-choice.pkf",
205
+ "project/helios-deploy.pkf", …])
206
+ ```
207
+
208
+ One call: the anchor becomes a hub AND every member is attached under it as a child.
209
+ For a cluster that belongs under an EXISTING hub (found in STEP 2), don't promote —
210
+ attach the members to that hub (`memory_write` the member with
211
+ `parentHubPath="<existing hub path>"`; use `op="append-section"` rather than a
212
+ full-page rewrite when touching someone else's page). For merge losers and garbage:
213
+ `memory_curate(op="supersede", pageId="…", reason="…")`.
214
+
215
+ **STEP 5 — REBUILD hub navigation once per batch.**
216
+
217
+ ```
218
+ memory_curate(op="rebuild_index")
219
+ ```
220
+
221
+ Each touched hub's strict PKF `#toc` regenerates with child descriptions. The top INDEX
222
+ Contents changes automatically because it is a live graph projection—no INDEX body
223
+ revision is minted. Leaves that now have a hub parent drop out of the flat top level.
224
+
225
+ **STEP 6 — MAINTAIN authored prose (your editorial duty).** After the structure settles,
226
+ read the INDEX and touched hubs. Refresh each hub's `<h2 id="overview">` and any stale
227
+ authored INDEX semantic section. Reuse the loaded section's existing `data-sid`; for a
228
+ new section, run `pkf_mint_sids`, then `pkf_validate` on the complete resulting page
229
+ before persisting. Section-operation content is a complete `<section>…</section>`:
230
+
231
+ ```
232
+ memory_write(
233
+ path="project/helios.pkf",
234
+ op="rewrite-section",
235
+ section="overview",
236
+ content="<section><h2 id=\"overview\" data-sid=\"<reuse-or-minted-sec-id>\">Overview</h2><p>Helios is the Q3 billing replatform —
237
+ auth, billing and deploy decisions live here; the postmortems under it record why
238
+ rate limits were re-tuned twice. Start at <a href=\"<canonical href from browse>\"
239
+ rel=\"references\">the API spec</a>.</p></section>")
240
+ ```
241
+
242
+ A hub you just promoted has no overview yet — `op="append-section", section="overview"`
243
+ seeds it. Never touch the `#toc` section while you are in there.
244
+
245
+ **STEP 7 — VERIFY and REPORT.** Call `memory_curate(op="candidates")` again — the
246
+ orphans you clustered should be gone. Then **report the structural changes in your
247
+ reply**: which hubs you created/promoted, how many children each absorbed, what you
248
+ superseded and why, which overviews you wrote/refreshed, which oversized advisories you
249
+ split or deliberately left, and the before→after orphan count. A convergence run that
250
+ ends without a structural report is unverifiable.
251
+
252
+ ### Worked example — 8 scattered `project/helios-*` leaves → one hub
253
+
254
+ `candidates` returns 8 orphan leaves hanging off INDEX directly (`project/helios-auth.pkf`,
255
+ `project/helios-billing.pkf`, `project/helios-db-choice.pkf`, `project/helios-deploy.pkf`,
256
+ `project/helios-api-spec.pkf`, `project/helios-rate-limits.pkf`, `project/helios-oncall.pkf`,
257
+ `project/helios-postmortem-0420.pkf`).
258
+
259
+ ```
260
+ # 1-2. read candidates + browse — no existing helios hub, all 8 are one topic
261
+ memory_curate(op="candidates", kind="orphans")
262
+ memory_browse(query="helios project")
263
+
264
+ # 3. decide: ONE cluster; helios-auth is the natural anchor
265
+
266
+ # 4. promote the anchor WITH the other 7 attached in the same call
267
+ memory_curate(op="promote_to_hub", pageId="<id-of-helios-auth>",
268
+ childPaths=["project/helios-billing.pkf", "project/helios-db-choice.pkf",
269
+ "project/helios-deploy.pkf", "project/helios-api-spec.pkf",
270
+ "project/helios-rate-limits.pkf", "project/helios-oncall.pkf",
271
+ "project/helios-postmortem-0420.pkf"])
272
+
273
+ # the 0420 postmortem is superseded by a newer incident page → archive it
274
+ memory_curate(op="supersede", pageId="<id-of-helios-postmortem-0420>",
275
+ reason="merged into project/helios-auth#incidents")
276
+
277
+ # 5. rebuild once — hub #toc regenerates; INDEX Contents follows the graph live
278
+ memory_curate(op="rebuild_index")
279
+
280
+ # 6. seed the new hub's overview (the machine never writes this prose)
281
+ memory_write(path="project/helios-auth.pkf", op="append-section", section="overview",
282
+ content="<section><h2 id=\"overview\" data-sid=\"<minted-sec-id>\">Overview</h2><p>Helios project knowledge —
283
+ auth is the anchor; billing/db/deploy/api-spec/rate-limits/oncall hang
284
+ under it. The 0420 postmortem is archived into #incidents.</p></section>")
285
+
286
+ # 7. verify: orphans 8 → 0 for this topic; REPORT the delta in your reply
287
+ memory_curate(op="candidates", kind="orphans")
288
+ ```
289
+
290
+ Result: the derived INDEX Contents shows one described hub entry instead of 8 bare leaves; the facts
291
+ are reachable `INDEX → hub → leaf`, and the hub opens with prose that says what lives
292
+ there. The flat star collapsed into a readable tree — in ~7 tool calls.
293
+
294
+ ## Folding content on a merge
295
+
296
+ When one page absorbs a true duplicate: copy any durable fact the survivor lacks into
297
+ the survivor's matching section (`memory_write` with `op="append-section"` /
298
+ `op="rewrite-section"` — never a whole-page rewrite of a page another agent authored;
299
+ the section body follows `pkf-writing`), then `supersede` the loser with a reason naming
300
+ the survivor's path. The loser is archived, not hard-deleted — it stays for audit and
301
+ redirect.
302
+
303
+ ## Stop conditions
304
+
305
+ - Enact only **clear** merges; one ambiguous call left un-enacted is better than one
306
+ wrong merge that destroys recall.
307
+ - Batch a handful of clusters, `rebuild_index` ONCE, verify, report, stop. Do not loop
308
+ the whole graph every tick — Dream is incremental.
309
+ - Never hand-write a hub `#toc`; `rebuild_index` is its only writer. Never store an
310
+ INDEX TOC copy—the reader derives Contents. Hub overviews and authored INDEX semantic
311
+ sections are your editorial territory.
312
+
313
+ ## Anti-patterns
314
+
315
+ - ❌ Promoting a hollow hub (no `childPaths`) and then re-anchoring members one at a
316
+ time — pass the children in the promote call.
317
+ - ❌ Hand-writing `child-of` links inside a HUB pointing down at leaves — `child-of`
318
+ edges point FROM the child TO the hub; the structural params get this right for you.
319
+ - ❌ Hand-editing a hub `#toc`, or creating a stored INDEX `#toc`; declare edges +
320
+ `rebuild_index`. Leaving hubs with no overview prose is its own anti-pattern.
321
+ - ❌ Treating message-inline/Asset PKF as a Dream candidate before it becomes an
322
+ authoritative Memory Page.
323
+ - ❌ Whole-page-rewriting another agent's page to fold in one fact — append a section
324
+ (`op="append-section"`).
325
+ - ❌ Treating an `oversized` advisory as an order — it is a split *suggestion*; splitting
326
+ a coherent hub just to satisfy a threshold destroys navigability. Judge, then report.
327
+ - ❌ Merging two pages because they share a topic word — they may carry distinct facts.
328
+ Read them first; merge only clear duplicates.
329
+ - ❌ Hard-deleting. You `supersede` (reversible archive), never destroy.
330
+ - ❌ Running the whole graph every tick. Dream is incremental: a handful of clear
331
+ merges, one rebuild_index, verify, stop.
332
+ - ❌ Enacting an ambiguous/high-stakes merge. Leave it for human review; Dream cannot
333
+ reconstruct a wrongly-merged page.
334
+ - ❌ Retrying a `403 orchestrator_only` — you are not the appointed orchestrator; that
335
+ is correct, not an error.
336
+ - ❌ A deputy assuming Dream rights because its bound member is the owner — the
337
+ deputy agent itself must be the appointed `orchestratorAgentId`.
338
+ - ❌ Ending a convergence run without reporting the structural delta (hubs created,
339
+ children attached, pages superseded, orphan count before→after).
@@ -0,0 +1,211 @@
1
+ ---
2
+ name: office-artifacts
3
+ scope: persistence
4
+ description: Generate real DOCX, PPTX, XLSX, PDF, CSV files using python-docx / python-pptx / openpyxl / reportlab by writing them into the dispatch artifacts dir, then explicitly deliver each one with `cloud deliver <abs-path>`. Use whenever the user asks for documents, slides, spreadsheets, reports, or PDFs.
5
+ ---
6
+
7
+ # Office Artifacts
8
+
9
+ Produce real binary office files (not markdown-as-PDF) by writing each
10
+ one into the **artifacts dir** (`$PRISMER_ARTIFACTS_DIR` /
11
+ `<artifacts_dir>` from `<execution_context>`). Prose-only completions are
12
+ not valid.
13
+
14
+ ## Delivery contract — explicit, two steps (release202/09 P2)
15
+
16
+ Delivery is **explicit**. Writing a file into the artifacts dir does NOT
17
+ deliver it — there is no auto-scan. You must run **`cloud deliver`** for
18
+ every file you want the user to receive.
19
+
20
+ 1. **Write** each deliverable (PDF / DOCX / PPTX / XLSX / CSV / image /
21
+ archive) into the artifacts dir. Drafts / intermediate scratch →
22
+ `$PRISMER_SCRATCH_DIR` (never delivered).
23
+ 2. **Deliver** it with the absolute path:
24
+
25
+ ```bash
26
+ cloud deliver "<artifacts_dir>/report.pdf"
27
+ ```
28
+
29
+ This attaches the file to **your current reply** (动作 A — it rides the
30
+ same message as your text summary). Run it once per file. The command
31
+ prints the `assetId` on success.
32
+
33
+ - **`$PRISMER_ARTIFACTS_DIR`** is injected as an env var by spawn-style
34
+ adapters (claude-code / codex / openclaw). **Hermes does not inject the
35
+ env var** — read the absolute `artifacts/` path from the dispatch
36
+ prompt's `[Artifacts directive]` block and write there. Either way, pass
37
+ the **absolute path** to `cloud deliver`.
38
+ - **Hermes also has NO per-dispatch env ids** (`PRISMER_RUN_ID` /
39
+ `PRISMER_TASK_ID` / `PRISMER_CONVERSATION_ID` are all unset), so plain
40
+ `cloud deliver <path>` cannot find the dispatch and exits with an error.
41
+ On hermes you MUST copy `<run_id>` (or `<task_id>`) and `<conversation_id>`
42
+ from `<execution_context>` and pass them as flags:
43
+
44
+ ```bash
45
+ # Hermes — ids come from <execution_context>, not env:
46
+ cloud deliver "<artifacts_dir>/report.pdf" --run-id "<run_id>" --conversation-id "<conversation_id>"
47
+ ```
48
+
49
+ Spawn-adapter agents (claude-code / codex) do **not** need these flags —
50
+ their env is already set; plain `cloud deliver "<abs-path>"` works there.
51
+ - **Sending a file as its OWN message** (动作 B — separate from your reply,
52
+ e.g. to drop it into the session standalone): use
53
+ `cloud file send "$PRISMER_CONVERSATION_ID" "<abs-path>"`. On hermes the
54
+ conversation id comes from `<execution_context><conversation_id>` (pass it
55
+ as the positional), and you must also add `--run-id "<run_id>"` so the
56
+ proxy activates. Prefer `cloud deliver` (动作 A) for the normal "here is
57
+ the document you asked for" case.
58
+ - **Attaching a file to a message you ALREADY sent** (动作 A2 — "I already
59
+ replied, now I produced a file I want on THAT message"): `cloud send` /
60
+ `cloud file send` return a `messageId`; run
61
+ `cloud attach <messageId> "<abs-path>"` to append the file to that
62
+ existing message (it does NOT start a new one). On hermes also pass
63
+ `--run-id "<run_id>"` and `--conversation-id "<conversation_id>"` (both
64
+ copied from `<execution_context>`). Use this only when the reply already
65
+ exists; for "this reply carries the file" use `cloud deliver` (动作 A).
66
+ - **Do NOT run `cloud task complete`** to deliver a chat reply — the
67
+ platform closes the turn from your final reply (dispatch-reply path).
68
+ - **`cloud task attach` / `cloud task complete` are OPTIONAL** and ONLY
69
+ for when you are genuinely working a **kanban TASK** you were assigned
70
+ (e.g. moving a board card to `review` / `done`). For a normal @-mention
71
+ chat reply, never touch them — `cloud deliver` is all you need.
72
+ - **Rejections are visible**: if `cloud deliver` prints a non-zero exit /
73
+ error (bad MIME, renamed extension, file not found), the file was NOT
74
+ delivered — fix it and re-run. Do not claim a file you failed to deliver.
75
+
76
+ ## HARD RULE — never claim a file you didn't actually write
77
+
78
+ Lie-guard (`src/im/ws/handler.ts`) **as of release201/30 §8 is
79
+ warn-only telemetry**, not a destructive interceptor — the audit
80
+ banner ("Team Manager 声明已生成文件但未真正落盘") that used to render in
81
+ red is removed. The detector still logs a `[warn] claim/asset
82
+ disagreement (warn-only, see release201/30 §8)` for ops dashboards
83
+ when text claims a file but `assetIds` is empty. That signal helps
84
+ investigate broken adapter wiring; it does NOT change the visible
85
+ chat. Original 2026-05-22 audit: 25 of 27 office tasks shipped a
86
+ claim with zero attached files.
87
+
88
+ Forbidden unless every product was actually written to
89
+ `$PRISMER_ARTIFACTS_DIR`: "已生成 / 已落盘 / 已附件", "Created
90
+ report.pdf", "Attached the file", "Generated slides.pptx".
91
+
92
+ Before claiming a file, **all** must hold:
93
+
94
+ 1. Generator import (`import docx` / `pptx` / `openpyxl` / `reportlab`)
95
+ succeeds.
96
+ 2. Script ran with exit 0 (no traceback).
97
+ 3. `ls -lah <artifacts_dir>` (the absolute path from `<execution_context>`)
98
+ shows the file, non-zero size.
99
+
100
+ If (1)-(3) fail, your reply must start with `无法生成文件
101
+ (reason)` / `Cannot produce file (reason)`.
102
+
103
+ ## Runtime baseline (release 201)
104
+
105
+ Sandbox image bakes `python-docx`, `python-pptx`, `openpyxl`,
106
+ `reportlab`, `pandas`, `pillow`, `numpy`, `imageio`, apt `file` — all of
107
+ them inside the image venv interpreter **`/home/user/.venv/bin/python3`**
108
+ (NOT the system `/usr/bin/python3`, which has NONE of these libraries).
109
+ Always run generator scripts with that interpreter, e.g.
110
+
111
+ ```bash
112
+ /home/user/.venv/bin/python3 generate_report.py
113
+ ```
114
+
115
+ If an `import docx` (or `pptx` / `openpyxl` / `reportlab`) probe fails, DO
116
+ NOT conclude the dependency is missing until you have retried under
117
+ `/home/user/.venv/bin/python3` — a failure under the system python only
118
+ means you probed the wrong interpreter. Only when the import ALSO fails
119
+ under the venv interpreter, fail the task with `module 'X' missing —
120
+ rebuild sandbox image`. Do not `pip install` on the fly.
121
+
122
+ ## Resolving the output directory
123
+
124
+ Your artifacts dir is delivered as an ABSOLUTE path in your prompt's
125
+ `<execution_context>` block:
126
+
127
+ ```xml
128
+ <execution_context …>
129
+ <artifacts_dir>/home/user/.prismer/workspaces/<ws>/…/tasks/<id>/artifacts</artifacts_dir>
130
+
131
+ </execution_context>
132
+ ```
133
+
134
+ It is also re-stated in the `[Artifacts directive]` block. **Use that exact
135
+ absolute path.** The `$PRISMER_ARTIFACTS_DIR` env var is set ONLY by
136
+ spawn-style adapters (claude-code / codex / openclaw); **Hermes does NOT set
137
+ it** (`os.environ.get("PRISMER_ARTIFACTS_DIR")` returns `None`). Never write to
138
+ a relative path, the CWD, or a literal placeholder — copy the `<artifacts_dir>`
139
+ value verbatim:
140
+
141
+ ```python
142
+ import os
143
+ from pathlib import Path
144
+ # Paste the absolute path from <execution_context><artifacts_dir> here:
145
+ ARTIFACTS_DIR = "/home/user/.prismer/workspaces/.../tasks/.../artifacts" # ← from <artifacts_dir>
146
+ out = Path(os.environ.get("PRISMER_ARTIFACTS_DIR") or ARTIFACTS_DIR)
147
+ out.mkdir(parents=True, exist_ok=True)
148
+ ```
149
+
150
+ ## Generator recipes
151
+
152
+ ```python
153
+ # DOCX
154
+ from docx import Document
155
+ d = Document(); d.add_heading("Report", 0)
156
+ d.add_paragraph("Executive summary…"); d.save(out / "report.docx")
157
+
158
+ # PPTX
159
+ from pptx import Presentation
160
+ p = Presentation(); s = p.slides.add_slide(p.slide_layouts[0])
161
+ s.shapes.title.text = "Deck"; s.placeholders[1].text = "Key message"
162
+ p.save(out / "deck.pptx")
163
+
164
+ # XLSX
165
+ from openpyxl import Workbook
166
+ wb = Workbook(); ws = wb.active; ws.title = "Model"
167
+ ws.append(["Metric", "Value"]); ws.append(["Revenue", 100000])
168
+ ws.freeze_panes = "A2"; wb.save(out / "model.xlsx")
169
+
170
+ # PDF — reportlab (never rename markdown/html to .pdf)
171
+ from reportlab.pdfgen import canvas
172
+ from reportlab.lib.pagesizes import letter
173
+ c = canvas.Canvas(str(out / "report.pdf"), pagesize=letter)
174
+ c.drawString(72, 720, "Report"); c.save()
175
+ ```
176
+
177
+ ## Validation + delivery
178
+
179
+ 1. File non-empty, magic bytes match (DOCX/PPTX/XLSX → `PK`; PDF →
180
+ `%PDF`; CSV → UTF-8 with headers).
181
+ 2. Confirm every product landed in the artifacts dir:
182
+
183
+ ```bash
184
+ ls -lah <artifacts_dir> # the absolute path from <execution_context><artifacts_dir>
185
+ ```
186
+
187
+ 3. **Deliver each file explicitly** (this is the step that actually
188
+ delivers — there is no auto-scan):
189
+
190
+ ```bash
191
+ cloud deliver "<artifacts_dir>/report.pdf"
192
+ cloud deliver "<artifacts_dir>/deck.pptx"
193
+
194
+ # On hermes (no env ids) append --run-id / --conversation-id from <execution_context>:
195
+ cloud deliver "<artifacts_dir>/report.pdf" --run-id "<run_id>" --conversation-id "<conversation_id>"
196
+ ```
197
+
198
+ Each call attaches the file to your reply (动作 A). Confirm exit 0 and
199
+ the printed `assetId`. Then write your final reply describing what you
200
+ produced. Do NOT run `cloud task attach` / `cloud task complete` for
201
+ chat delivery.
202
+
203
+ > Working a real kanban TASK (board card), not a chat reply? Only then may
204
+ > you optionally `cloud task complete "$PRISMER_TASK_ID" --result "..."` to
205
+ > move the card — and only when `$PRISMER_TASK_ID` is a real task id, not a
206
+ > chat run.
207
+
208
+ ## Failure mode
209
+
210
+ Missing library + cannot install → fail with `module 'X' missing` and
211
+ list the package. No renamed extensions, no prose-only substitute.