@lemoncat7/dsh-partner 2.8.1 → 2.8.3

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 (833) hide show
  1. package/docs/THIRD_PARTY_LICENSES.md +10 -0
  2. package/docs/blocked-delivery-recovery.md +7 -0
  3. package/docs/concern-attention.md +19 -0
  4. package/docs/observation-contract.md +21 -0
  5. package/docs/pendant-loading.md +30 -0
  6. package/docs/releases/2.8.2.md +7 -0
  7. package/docs/releases/2.8.3.md +20 -0
  8. package/lib/agent-runtime.d.ts +7 -0
  9. package/lib/agent-runtime.d.ts.map +1 -1
  10. package/lib/agent-runtime.js +119 -35
  11. package/lib/agent-runtime.js.map +1 -1
  12. package/lib/api/features/pendant-api.d.ts.map +1 -1
  13. package/lib/api/features/pendant-api.js +11 -2
  14. package/lib/api/features/pendant-api.js.map +1 -1
  15. package/lib/api.d.ts +1 -0
  16. package/lib/api.d.ts.map +1 -1
  17. package/lib/api.js +41 -6
  18. package/lib/api.js.map +1 -1
  19. package/lib/autonomy.d.ts.map +1 -1
  20. package/lib/autonomy.js +9 -2
  21. package/lib/autonomy.js.map +1 -1
  22. package/lib/channel-message.d.ts +2 -0
  23. package/lib/channel-message.d.ts.map +1 -1
  24. package/lib/channel-message.js.map +1 -1
  25. package/lib/channels/direct/message-format.js +127 -127
  26. package/lib/channels/direct/message-format.js.map +1 -1
  27. package/lib/channels/manager.d.ts.map +1 -1
  28. package/lib/channels/manager.js +4 -3
  29. package/lib/channels/manager.js.map +1 -1
  30. package/lib/channels/notification-delivery.d.ts.map +1 -1
  31. package/lib/channels/notification-delivery.js +10 -0
  32. package/lib/channels/notification-delivery.js.map +1 -1
  33. package/lib/channels/weixin/connect.d.ts.map +1 -1
  34. package/lib/client-api.d.ts +17 -2
  35. package/lib/client-api.d.ts.map +1 -1
  36. package/lib/client-api.js +8 -1
  37. package/lib/client-api.js.map +1 -1
  38. package/lib/client.d.ts.map +1 -1
  39. package/lib/client.js +2398 -1970
  40. package/lib/client.js.map +4 -4
  41. package/lib/client.pendant.js +4157 -0
  42. package/lib/collaboration/composition.js +1 -1
  43. package/lib/collaboration/composition.js.map +1 -1
  44. package/lib/concern-attention.d.ts +19 -0
  45. package/lib/concern-attention.d.ts.map +1 -0
  46. package/lib/concern-attention.js +36 -0
  47. package/lib/concern-attention.js.map +1 -0
  48. package/lib/concern-domain.d.ts +10 -1
  49. package/lib/concern-domain.d.ts.map +1 -1
  50. package/lib/concern-domain.js +4 -0
  51. package/lib/concern-domain.js.map +1 -1
  52. package/lib/concern-execution-notes.d.ts +18 -0
  53. package/lib/concern-execution-notes.d.ts.map +1 -0
  54. package/lib/concern-execution-notes.js +41 -0
  55. package/lib/concern-execution-notes.js.map +1 -0
  56. package/lib/concern-execution-receipt.d.ts +4 -0
  57. package/lib/concern-execution-receipt.d.ts.map +1 -0
  58. package/lib/concern-execution-receipt.js +28 -0
  59. package/lib/concern-execution-receipt.js.map +1 -0
  60. package/lib/concern-execution.d.ts +32 -0
  61. package/lib/concern-execution.d.ts.map +1 -0
  62. package/lib/concern-execution.js +112 -0
  63. package/lib/concern-execution.js.map +1 -0
  64. package/lib/concern-management-tool.d.ts.map +1 -1
  65. package/lib/concern-management-tool.js +21 -19
  66. package/lib/concern-management-tool.js.map +1 -1
  67. package/lib/concern-note-source.d.ts +7 -0
  68. package/lib/concern-note-source.d.ts.map +1 -0
  69. package/lib/concern-note-source.js +25 -0
  70. package/lib/concern-note-source.js.map +1 -0
  71. package/lib/concern-resources.d.ts +27 -0
  72. package/lib/concern-resources.d.ts.map +1 -0
  73. package/lib/concern-resources.js +36 -0
  74. package/lib/concern-resources.js.map +1 -0
  75. package/lib/concern-sources.d.ts +1 -1
  76. package/lib/concern-sources.d.ts.map +1 -1
  77. package/lib/concern-store.d.ts +10 -1
  78. package/lib/concern-store.d.ts.map +1 -1
  79. package/lib/concern-store.js +135 -36
  80. package/lib/concern-store.js.map +1 -1
  81. package/lib/concern-tool.d.ts +1 -0
  82. package/lib/concern-tool.d.ts.map +1 -1
  83. package/lib/concern-tool.js +8 -4
  84. package/lib/concern-tool.js.map +1 -1
  85. package/lib/decision/conversation.d.ts +11 -0
  86. package/lib/decision/conversation.d.ts.map +1 -0
  87. package/lib/decision/conversation.js +52 -0
  88. package/lib/decision/conversation.js.map +1 -0
  89. package/lib/decision/events.d.ts +16 -0
  90. package/lib/decision/events.d.ts.map +1 -0
  91. package/lib/decision/events.js +9 -0
  92. package/lib/decision/events.js.map +1 -0
  93. package/lib/domain.d.ts +2 -0
  94. package/lib/domain.d.ts.map +1 -1
  95. package/lib/domain.js.map +1 -1
  96. package/lib/heartbeat.d.ts +12 -10
  97. package/lib/heartbeat.d.ts.map +1 -1
  98. package/lib/heartbeat.js +55 -26
  99. package/lib/heartbeat.js.map +1 -1
  100. package/lib/index.d.ts.map +1 -1
  101. package/lib/index.js +4 -1
  102. package/lib/index.js.map +1 -1
  103. package/lib/memory-prompt-context.js +1 -0
  104. package/lib/memory-prompt-context.js.map +1 -1
  105. package/lib/memory-reflection.js +1 -1
  106. package/lib/observation-contract.d.ts +9 -0
  107. package/lib/observation-contract.d.ts.map +1 -0
  108. package/lib/observation-contract.js +19 -0
  109. package/lib/observation-contract.js.map +1 -0
  110. package/lib/observation-executor.d.ts +5 -0
  111. package/lib/observation-executor.d.ts.map +1 -1
  112. package/lib/observation-executor.js +23 -1
  113. package/lib/observation-executor.js.map +1 -1
  114. package/lib/observation-loop.d.ts +7 -0
  115. package/lib/observation-loop.d.ts.map +1 -1
  116. package/lib/observation-loop.js +65 -4
  117. package/lib/observation-loop.js.map +1 -1
  118. package/lib/observation-progress.d.ts +18 -0
  119. package/lib/observation-progress.d.ts.map +1 -0
  120. package/lib/observation-progress.js +57 -0
  121. package/lib/observation-progress.js.map +1 -0
  122. package/lib/observation-sources.d.ts +14 -0
  123. package/lib/observation-sources.d.ts.map +1 -0
  124. package/lib/observation-sources.js +12 -0
  125. package/lib/observation-sources.js.map +1 -0
  126. package/lib/pendant/badge-art.d.ts +9 -0
  127. package/lib/pendant/badge-art.d.ts.map +1 -0
  128. package/lib/pendant/badge-art.js +68 -0
  129. package/lib/pendant/badge-art.js.map +1 -0
  130. package/lib/pendant/card-image.d.ts.map +1 -1
  131. package/lib/pendant/card-image.js +11 -9
  132. package/lib/pendant/card-image.js.map +1 -1
  133. package/lib/pendant/renderer-loader.d.ts +9 -0
  134. package/lib/pendant/renderer-loader.d.ts.map +1 -0
  135. package/lib/pendant/renderer-loader.js +12 -0
  136. package/lib/pendant/renderer-loader.js.map +1 -0
  137. package/lib/pendant/renderer.d.ts +2 -6
  138. package/lib/pendant/renderer.d.ts.map +1 -1
  139. package/lib/pendant/renderer.js +1 -67
  140. package/lib/pendant/renderer.js.map +1 -1
  141. package/lib/pendant/static-card.d.ts +20 -0
  142. package/lib/pendant/static-card.d.ts.map +1 -0
  143. package/lib/pendant/static-card.js +55 -0
  144. package/lib/pendant/static-card.js.map +1 -0
  145. package/lib/pendant/widget.d.ts.map +1 -1
  146. package/lib/pendant/widget.js +9 -5
  147. package/lib/pendant/widget.js.map +1 -1
  148. package/lib/pendant-renderer.js +14 -14
  149. package/lib/requirements/service.d.ts.map +1 -1
  150. package/lib/requirements/service.js +2 -0
  151. package/lib/requirements/service.js.map +1 -1
  152. package/lib/requirements/worker.d.ts.map +1 -1
  153. package/lib/requirements/worker.js +1 -0
  154. package/lib/requirements/worker.js.map +1 -1
  155. package/lib/scheduler/continuations.d.ts.map +1 -1
  156. package/lib/scheduler/continuations.js +17 -3
  157. package/lib/scheduler/continuations.js.map +1 -1
  158. package/lib/skills/builtin.d.ts.map +1 -1
  159. package/lib/skills/builtin.js +2 -0
  160. package/lib/skills/builtin.js.map +1 -1
  161. package/lib/skills/drama-builtin.d.ts.map +1 -1
  162. package/lib/skills/drama-builtin.js +13 -1
  163. package/lib/skills/drama-builtin.js.map +1 -1
  164. package/lib/skills/story-builtins.d.ts +3 -0
  165. package/lib/skills/story-builtins.d.ts.map +1 -0
  166. package/lib/skills/story-builtins.js +72 -0
  167. package/lib/skills/story-builtins.js.map +1 -0
  168. package/lib/skills/viora-canvas-builtin.d.ts.map +1 -1
  169. package/lib/skills/viora-canvas-builtin.js +12 -1
  170. package/lib/skills/viora-canvas-builtin.js.map +1 -1
  171. package/lib/snapshot-cache.d.ts +7 -0
  172. package/lib/snapshot-cache.d.ts.map +1 -0
  173. package/lib/snapshot-cache.js +26 -0
  174. package/lib/snapshot-cache.js.map +1 -0
  175. package/lib/tasks/result.js +1 -1
  176. package/lib/tasks/result.js.map +1 -1
  177. package/lib/ui/memory/concern-board.d.ts +1 -1
  178. package/lib/ui/memory/concern-board.d.ts.map +1 -1
  179. package/lib/ui/memory/concern-board.js +14 -6
  180. package/lib/ui/memory/concern-board.js.map +1 -1
  181. package/lib/ui/memory/concern-deletion.d.ts.map +1 -1
  182. package/lib/ui/memory/concern-deletion.js +2 -1
  183. package/lib/ui/memory/concern-deletion.js.map +1 -1
  184. package/lib/ui/memory/concern-editor.d.ts.map +1 -1
  185. package/lib/ui/memory/concern-editor.js +5 -3
  186. package/lib/ui/memory/concern-editor.js.map +1 -1
  187. package/lib/ui/memory/concern-execution-fields.d.ts +7 -0
  188. package/lib/ui/memory/concern-execution-fields.d.ts.map +1 -0
  189. package/lib/ui/memory/concern-execution-fields.js +8 -0
  190. package/lib/ui/memory/concern-execution-fields.js.map +1 -0
  191. package/lib/ui/memory/concern-execution-status.d.ts +8 -0
  192. package/lib/ui/memory/concern-execution-status.d.ts.map +1 -0
  193. package/lib/ui/memory/concern-execution-status.js +31 -0
  194. package/lib/ui/memory/concern-execution-status.js.map +1 -0
  195. package/lib/ui/memory/concern-feedback.d.ts +15 -0
  196. package/lib/ui/memory/concern-feedback.d.ts.map +1 -0
  197. package/lib/ui/memory/concern-feedback.js +13 -0
  198. package/lib/ui/memory/concern-feedback.js.map +1 -0
  199. package/lib/ui/memory/concern-panel.d.ts.map +1 -1
  200. package/lib/ui/memory/concern-panel.js +11 -3
  201. package/lib/ui/memory/concern-panel.js.map +1 -1
  202. package/package.json +7 -1
  203. package/resources/skills/novel-game-creation/manifest.json +393 -0
  204. package/resources/skills/novel-game-creation/upstream/LICENSE +21 -0
  205. package/resources/skills/novel-game-creation/upstream/README.md +420 -0
  206. package/resources/skills/novel-game-creation/upstream/README_ZH.md +421 -0
  207. package/resources/skills/novel-game-creation/upstream/VERSION +1 -0
  208. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/BUILD_BRIEF.md +219 -0
  209. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/.vercelignore +3 -0
  210. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/RUN.md +138 -0
  211. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/bg/compound_new_guofeng.webp +0 -0
  212. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/fate_coda.webp +0 -0
  213. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/meng.webp +0 -0
  214. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/pan.webp +0 -0
  215. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/pinger.webp +0 -0
  216. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/xuee.webp +0 -0
  217. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/yue.webp +0 -0
  218. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_accord_five.webp +0 -0
  219. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_afterglow_five.webp +0 -0
  220. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_alliance.webp +0 -0
  221. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/public_day10.webp +0 -0
  222. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/public_day15.webp +0 -0
  223. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/public_day5.webp +0 -0
  224. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/title_new_guofeng.webp +0 -0
  225. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/pan_pinger.webp +0 -0
  226. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/pan_xuee.webp +0 -0
  227. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/yue_meng.webp +0 -0
  228. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/yue_pan.webp +0 -0
  229. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/yue_pinger.webp +0 -0
  230. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/meng/explicit.webp +0 -0
  231. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/meng/prelude.webp +0 -0
  232. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/meng.webp +0 -0
  233. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/pan.webp +0 -0
  234. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/pinger.webp +0 -0
  235. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/xuee.webp +0 -0
  236. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/yue.webp +0 -0
  237. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pan/explicit.webp +0 -0
  238. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pan/prelude.webp +0 -0
  239. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pinger/explicit.webp +0 -0
  240. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pinger/prelude.webp +0 -0
  241. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/xuee/explicit.webp +0 -0
  242. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/xuee/prelude.webp +0 -0
  243. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/yue/explicit.webp +0 -0
  244. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/yue/prelude.webp +0 -0
  245. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/meng/night.webp +0 -0
  246. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/pan/night.webp +0 -0
  247. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/pinger/night.webp +0 -0
  248. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/xuee/night.webp +0 -0
  249. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/yue/night.webp +0 -0
  250. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/household/li_jiaoer.webp +0 -0
  251. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/scene/gate_collector.webp +0 -0
  252. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/css/new-guofeng.css +1494 -0
  253. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/css/style.css +2508 -0
  254. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/index.html +18 -0
  255. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/assets.js +147 -0
  256. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/audio.js +332 -0
  257. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/data.js +7470 -0
  258. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/engine.js +13066 -0
  259. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/main.js +3051 -0
  260. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/text.js +32 -0
  261. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/package.json +11 -0
  262. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/vercel.json +23 -0
  263. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/art/generated-art.json +161 -0
  264. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/example.json +12 -0
  265. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/README.md +26 -0
  266. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/playable-model.json +99 -0
  267. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/verification.json +41 -0
  268. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/verify_playable_model.mjs +152 -0
  269. package/resources/skills/novel-game-creation/upstream/manifest.json +498 -0
  270. package/resources/skills/novel-game-creation/upstream/skills/game-art-direction/SKILL.md +47 -0
  271. package/resources/skills/novel-game-creation/upstream/skills/game-art-direction/agents/openai.yaml +4 -0
  272. package/resources/skills/novel-game-creation/upstream/skills/game-art-direction/references/art-direction-method.md +40 -0
  273. package/resources/skills/novel-game-creation/upstream/skills/game-build/SKILL.md +66 -0
  274. package/resources/skills/novel-game-creation/upstream/skills/game-build/agents/openai.yaml +4 -0
  275. package/resources/skills/novel-game-creation/upstream/skills/game-build/references/blender-asset-workflow.md +24 -0
  276. package/resources/skills/novel-game-creation/upstream/skills/game-build/references/build-brief-contract.md +72 -0
  277. package/resources/skills/novel-game-creation/upstream/skills/game-build/references/generative-media-pipeline.md +25 -0
  278. package/resources/skills/novel-game-creation/upstream/skills/game-build/references/playable-model-contract.md +46 -0
  279. package/resources/skills/novel-game-creation/upstream/skills/game-build/references/tts-production-contract.md +23 -0
  280. package/resources/skills/novel-game-creation/upstream/skills/game-concept/SKILL.md +54 -0
  281. package/resources/skills/novel-game-creation/upstream/skills/game-concept/agents/openai.yaml +4 -0
  282. package/resources/skills/novel-game-creation/upstream/skills/game-concept/references/concept-method.md +47 -0
  283. package/resources/skills/novel-game-creation/upstream/skills/game-qa/SKILL.md +39 -0
  284. package/resources/skills/novel-game-creation/upstream/skills/game-qa/agents/openai.yaml +4 -0
  285. package/resources/skills/novel-game-creation/upstream/skills/game-qa/references/qa-contract.md +66 -0
  286. package/resources/skills/novel-game-creation/upstream/skills/game-qa/references/test-design-method.md +49 -0
  287. package/resources/skills/novel-game-creation/upstream/skills/game-world-design/SKILL.md +50 -0
  288. package/resources/skills/novel-game-creation/upstream/skills/game-world-design/agents/openai.yaml +4 -0
  289. package/resources/skills/novel-game-creation/upstream/skills/game-world-design/references/narrative-design-method.md +35 -0
  290. package/resources/skills/novel-game-creation/upstream/skills/game-world-design/references/numeric-design-method.md +22 -0
  291. package/resources/skills/novel-game-creation/upstream/skills/game-world-design/references/world-design-method.md +57 -0
  292. package/resources/skills/novel-game-creation/upstream/skills/novel-game-analyze/SKILL.md +68 -0
  293. package/resources/skills/novel-game-creation/upstream/skills/novel-game-analyze/agents/openai.yaml +4 -0
  294. package/resources/skills/novel-game-creation/upstream/skills/novel-game-analyze/references/gameability-protocol.md +65 -0
  295. package/resources/skills/novel-game-creation/upstream/skills/novel-to-game/SKILL.md +54 -0
  296. package/resources/skills/novel-game-creation/upstream/skills/novel-to-game/agents/openai.yaml +4 -0
  297. package/resources/skills/novel-game-creation/upstream/skills/novel-to-game/references/intake-method.md +50 -0
  298. package/resources/skills/novel-game-creation/upstream/skills/novel-to-game/references/pipeline-contract.md +60 -0
  299. package/resources/skills/story-creation/manifest.json +1477 -0
  300. package/resources/skills/story-creation/upstream/LICENSE.upstream +21 -0
  301. package/resources/skills/story-creation/upstream/manifest.json +1861 -0
  302. package/resources/skills/story-creation/upstream/roles/chapter-extractor.md +254 -0
  303. package/resources/skills/story-creation/upstream/roles/character-designer.md +168 -0
  304. package/resources/skills/story-creation/upstream/roles/consistency-checker.md +192 -0
  305. package/resources/skills/story-creation/upstream/roles/narrative-writer.md +105 -0
  306. package/resources/skills/story-creation/upstream/roles/story-architect.md +139 -0
  307. package/resources/skills/story-creation/upstream/roles/story-explorer.md +262 -0
  308. package/resources/skills/story-creation/upstream/roles/story-researcher.md +303 -0
  309. package/resources/skills/story-creation/upstream/skills/browser-cdp/SKILL.md +175 -0
  310. package/resources/skills/story-creation/upstream/skills/story/SKILL.md +129 -0
  311. package/resources/skills/story-creation/upstream/skills/story/VERSION +1 -0
  312. package/resources/skills/story-creation/upstream/skills/story/references/author-memory-maintenance.md +75 -0
  313. package/resources/skills/story-creation/upstream/skills/story/references/author-memory.md +117 -0
  314. package/resources/skills/story-creation/upstream/skills/story/scripts/author_memory_commit.py +1635 -0
  315. package/resources/skills/story-creation/upstream/skills/story-cover/SKILL.md +336 -0
  316. package/resources/skills/story-creation/upstream/skills/story-cover/references/cover-styles.md +210 -0
  317. package/resources/skills/story-creation/upstream/skills/story-deslop/SKILL.md +274 -0
  318. package/resources/skills/story-creation/upstream/skills/story-deslop/references/agent-calls.md +5 -0
  319. package/resources/skills/story-creation/upstream/skills/story-deslop/references/anti-ai-writing.md +556 -0
  320. package/resources/skills/story-creation/upstream/skills/story-deslop/references/author-memory-maintenance.md +75 -0
  321. package/resources/skills/story-creation/upstream/skills/story-deslop/references/author-memory.md +117 -0
  322. package/resources/skills/story-creation/upstream/skills/story-deslop/references/banned-words.md +151 -0
  323. package/resources/skills/story-creation/upstream/skills/story-deslop/references/deslop-gates.md +171 -0
  324. package/resources/skills/story-creation/upstream/skills/story-deslop/references/style-resolution.md +27 -0
  325. package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/author_memory_commit.py +1635 -0
  326. package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/check-ai-patterns.js +1586 -0
  327. package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/check-degeneration.js +349 -0
  328. package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/normalize-punctuation.js +415 -0
  329. package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/style-whitelist.js +39 -0
  330. package/resources/skills/story-creation/upstream/skills/story-import/SKILL.md +127 -0
  331. package/resources/skills/story-creation/upstream/skills/story-import/references/character-state-reverse.md +82 -0
  332. package/resources/skills/story-creation/upstream/skills/story-import/references/deep-analysis.md +47 -0
  333. package/resources/skills/story-creation/upstream/skills/story-import/references/format-and-structure.md +168 -0
  334. package/resources/skills/story-creation/upstream/skills/story-import/references/import-report.md +64 -0
  335. package/resources/skills/story-creation/upstream/skills/story-import/references/import-special-cases.md +34 -0
  336. package/resources/skills/story-creation/upstream/skills/story-import/references/import-tracking.md +95 -0
  337. package/resources/skills/story-creation/upstream/skills/story-import/references/length-routing.md +134 -0
  338. package/resources/skills/story-creation/upstream/skills/story-import/references/outline-reverse-rules.md +79 -0
  339. package/resources/skills/story-creation/upstream/skills/story-import/references/outline-reverse.md +24 -0
  340. package/resources/skills/story-creation/upstream/skills/story-import/references/state-tracking.md +43 -0
  341. package/resources/skills/story-creation/upstream/skills/story-import/references/structure-mapping-long.md +448 -0
  342. package/resources/skills/story-creation/upstream/skills/story-import/references/structure-mapping-short.md +187 -0
  343. package/resources/skills/story-creation/upstream/skills/story-import/references/tracking-initialization.md +31 -0
  344. package/resources/skills/story-creation/upstream/skills/story-import/references/tracking-transaction.md +146 -0
  345. package/resources/skills/story-creation/upstream/skills/story-import/scripts/build_outline_brief.py +332 -0
  346. package/resources/skills/story-creation/upstream/skills/story-import/scripts/check-outline-contract.js +520 -0
  347. package/resources/skills/story-creation/upstream/skills/story-import/scripts/tracking_commit.py +1691 -0
  348. package/resources/skills/story-creation/upstream/skills/story-import/scripts/wordcount_core.py +405 -0
  349. package/resources/skills/story-creation/upstream/skills/story-long-analyze/SKILL.md +140 -0
  350. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/author-facing.md +252 -0
  351. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/deconstruction-notes.md +270 -0
  352. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/final-checks.md +19 -0
  353. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/index-rebuild.md +11 -0
  354. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/inspiration-library.md +105 -0
  355. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/pipeline-ops.md +154 -0
  356. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/semantic-acceptance-fixtures.md +84 -0
  357. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage1-golden-chapters.md +128 -0
  358. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage2-extraction.md +229 -0
  359. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage3-plot-rhythm.md +480 -0
  360. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage4-characters-settings.md +195 -0
  361. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage5-report.md +33 -0
  362. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/style-profile-generator.md +76 -0
  363. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/style-profile-protocol.md +133 -0
  364. package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/synthesis-inputs.md +39 -0
  365. package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/build_chapter_index.py +466 -0
  366. package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/inspect_existing_assets.py +702 -0
  367. package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/inspiration_index.py +864 -0
  368. package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/manage_analysis_run.py +1145 -0
  369. package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/render_relation_chart.py +425 -0
  370. package/resources/skills/story-creation/upstream/skills/story-long-scan/SKILL.md +193 -0
  371. package/resources/skills/story-creation/upstream/skills/story-long-scan/references/genre-trends.md +197 -0
  372. package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-ciweimao.md +19 -0
  373. package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-fanqie.md +45 -0
  374. package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-jjwxc.md +28 -0
  375. package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-qidian.md +35 -0
  376. package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-qimao.md +27 -0
  377. package/resources/skills/story-creation/upstream/skills/story-long-scan/references/publishing-guide.md +114 -0
  378. package/resources/skills/story-creation/upstream/skills/story-long-scan/references/reader-profiling.md +105 -0
  379. package/resources/skills/story-creation/upstream/skills/story-long-scan/references/topic-decision.md +82 -0
  380. package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/aggregate-rank.js +682 -0
  381. package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/cdp-utils.js +242 -0
  382. package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/ciweimao-rank-scraper.js +240 -0
  383. package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/fanqie-rank-scraper.js +658 -0
  384. package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/jjwxc-rank-scraper.js +400 -0
  385. package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/qidian-rank-scraper.js +592 -0
  386. package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/qimao-rank-scraper.js +435 -0
  387. package/resources/skills/story-creation/upstream/skills/story-long-write/SKILL.md +136 -0
  388. package/resources/skills/story-creation/upstream/skills/story-long-write/references/agent-calls.md +47 -0
  389. package/resources/skills/story-creation/upstream/skills/story-long-write/references/anti-ai-writing.md +556 -0
  390. package/resources/skills/story-creation/upstream/skills/story-long-write/references/artifact-protocols.md +183 -0
  391. package/resources/skills/story-creation/upstream/skills/story-long-write/references/author-memory-maintenance.md +75 -0
  392. package/resources/skills/story-creation/upstream/skills/story-long-write/references/author-memory.md +117 -0
  393. package/resources/skills/story-creation/upstream/skills/story-long-write/references/banned-words.md +151 -0
  394. package/resources/skills/story-creation/upstream/skills/story-long-write/references/benchmark-recall.md +16 -0
  395. package/resources/skills/story-creation/upstream/skills/story-long-write/references/character-basics.md +445 -0
  396. package/resources/skills/story-creation/upstream/skills/story-long-write/references/character-design-methods.md +428 -0
  397. package/resources/skills/story-creation/upstream/skills/story-long-write/references/character-relations.md +433 -0
  398. package/resources/skills/story-creation/upstream/skills/story-long-write/references/commercial-core-methods.md +502 -0
  399. package/resources/skills/story-creation/upstream/skills/story-long-write/references/cross-book-recall.md +88 -0
  400. package/resources/skills/story-creation/upstream/skills/story-long-write/references/deslop-gates.md +171 -0
  401. package/resources/skills/story-creation/upstream/skills/story-long-write/references/dialogue-mastery.md +288 -0
  402. package/resources/skills/story-creation/upstream/skills/story-long-write/references/emotion-on-page.md +116 -0
  403. package/resources/skills/story-creation/upstream/skills/story-long-write/references/emotional-arc-design.md +313 -0
  404. package/resources/skills/story-creation/upstream/skills/story-long-write/references/emotional-methods.md +209 -0
  405. package/resources/skills/story-creation/upstream/skills/story-long-write/references/female-audience-writing.md +188 -0
  406. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//344/270/234/346/226/271/344/273/231/344/276/240.md +51 -0
  407. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//344/274/240/347/273/237/347/216/204/345/271/273.md +51 -0
  408. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/216/206/345/217/262/345/217/244/344/273/243.md +51 -0
  409. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/216/206/345/217/262/350/204/221/346/264/236.md +51 -0
  410. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/217/214/347/224/267/344/270/273.md +53 -0
  411. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/217/244/350/250/200/350/204/221/346/264/236.md +51 -0
  412. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/217/244/351/243/216/344/270/226/346/203/205.md +51 -0
  413. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/245/263/351/242/221/346/202/254/347/226/221.md +51 -0
  414. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/245/263/351/242/221/347/247/215/347/224/260.md +51 -0
  415. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/256/253/346/226/227/345/256/205/346/226/227.md +51 -0
  416. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/271/264/344/273/243.md +53 -0
  417. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/277/253/347/251/277.md +51 -0
  418. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/202/254/347/226/221/347/201/265/345/274/202.md +51 -0
  419. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/202/254/347/226/221/350/204/221/346/264/236.md +51 -0
  420. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/210/230/347/245/236/350/265/230/345/251/277.md +51 -0
  421. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/212/227/346/210/230/350/260/215/346/210/230.md +51 -0
  422. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/230/237/345/205/211/347/222/200/347/222/250.md +51 -0
  423. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/260/221/345/233/275/350/250/200/346/203/205.md +51 -0
  424. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/270/270/346/210/217/344/275/223/350/202/262.md +51 -0
  425. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//347/216/204/345/271/273/350/204/221/346/264/236.md +53 -0
  426. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//347/216/204/345/271/273/350/250/200/346/203/205.md +51 -0
  427. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//347/216/260/350/250/200/350/204/221/346/264/236.md +51 -0
  428. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//347/247/221/345/271/273/346/234/253/344/270/226.md +51 -0
  429. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//350/201/214/345/234/272/345/251/232/346/201/213.md +51 -0
  430. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//350/245/277/346/226/271/345/245/207/345/271/273.md +51 -0
  431. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//350/261/252/351/227/250/346/200/273/350/243/201.md +53 -0
  432. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/344/277/256/347/234/237.md +51 -0
  433. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/346/227/245/345/270/270.md +53 -0
  434. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/347/247/215/347/224/260.md +51 -0
  435. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/350/204/221/346/264/236.md +53 -0
  436. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/351/253/230/346/255/246.md +53 -0
  437. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/235/222/346/230/245/347/224/234/345/256/240.md +51 -0
  438. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards.md +91 -0
  439. package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-readers.md +235 -0
  440. package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-chapter-hooks.md +225 -0
  441. package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-chapter-quality.md +177 -0
  442. package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-format.md +36 -0
  443. package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-genre-catalog.md +394 -0
  444. package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-genre-mechanics.md +415 -0
  445. package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-reversal.md +335 -0
  446. package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-suspense.md +352 -0
  447. package/resources/skills/story-creation/upstream/skills/story-long-write/references/opening-design.md +349 -0
  448. package/resources/skills/story-creation/upstream/skills/story-long-write/references/outline-conflict.md +457 -0
  449. package/resources/skills/story-creation/upstream/skills/story-long-write/references/outline-methods.md +287 -0
  450. package/resources/skills/story-creation/upstream/skills/story-long-write/references/outline-rhythm.md +389 -0
  451. package/resources/skills/story-creation/upstream/skills/story-long-write/references/outline-structure-theory.md +273 -0
  452. package/resources/skills/story-creation/upstream/skills/story-long-write/references/plot-core-methods.md +522 -0
  453. package/resources/skills/story-creation/upstream/skills/story-long-write/references/plot-emotion-system.md +354 -0
  454. package/resources/skills/story-creation/upstream/skills/story-long-write/references/plot-frameworks.md +711 -0
  455. package/resources/skills/story-creation/upstream/skills/story-long-write/references/plot-special-topics.md +622 -0
  456. package/resources/skills/story-creation/upstream/skills/story-long-write/references/project-files.md +114 -0
  457. package/resources/skills/story-creation/upstream/skills/story-long-write/references/reader-contract-and-progression.md +117 -0
  458. package/resources/skills/story-creation/upstream/skills/story-long-write/references/reference-index.md +86 -0
  459. package/resources/skills/story-creation/upstream/skills/story-long-write/references/stop-and-fix.md +9 -0
  460. package/resources/skills/story-creation/upstream/skills/story-long-write/references/style-combat-face.md +352 -0
  461. package/resources/skills/story-creation/upstream/skills/story-long-write/references/style-craft.md +327 -0
  462. package/resources/skills/story-creation/upstream/skills/story-long-write/references/style-genre-modules.md +510 -0
  463. package/resources/skills/story-creation/upstream/skills/story-long-write/references/style-resolution.md +27 -0
  464. package/resources/skills/story-creation/upstream/skills/story-long-write/references/tracking-initialization.md +31 -0
  465. package/resources/skills/story-creation/upstream/skills/story-long-write/references/tracking-transaction.md +146 -0
  466. package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-chapter.md +104 -0
  467. package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-daily.md +75 -0
  468. package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-outline.md +157 -0
  469. package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-revision.md +89 -0
  470. package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-setup.md +170 -0
  471. package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-volume.md +142 -0
  472. package/resources/skills/story-creation/upstream/skills/story-long-write/references/writer-prompt-fallback.md +24 -0
  473. package/resources/skills/story-creation/upstream/skills/story-long-write/references/writing-craft.md +442 -0
  474. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/author_memory_commit.py +1635 -0
  475. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/build_architect_brief.py +260 -0
  476. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/build_writer_prompt.py +611 -0
  477. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/check-ai-patterns.js +1586 -0
  478. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/check-degeneration.js +349 -0
  479. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/check-outline-contract.js +520 -0
  480. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/check-outline-copy.js +313 -0
  481. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/normalize-punctuation.js +415 -0
  482. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/outline_view.py +286 -0
  483. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/storyctl.py +561 -0
  484. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/style-whitelist.js +39 -0
  485. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/tracking_commit.py +1691 -0
  486. package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/wordcount_core.py +405 -0
  487. package/resources/skills/story-creation/upstream/skills/story-review/SKILL.md +231 -0
  488. package/resources/skills/story-creation/upstream/skills/story-review/references/agent-prompts.md +184 -0
  489. package/resources/skills/story-creation/upstream/skills/story-review/references/anti-ai-writing.md +556 -0
  490. package/resources/skills/story-creation/upstream/skills/story-review/references/author-memory-maintenance.md +75 -0
  491. package/resources/skills/story-creation/upstream/skills/story-review/references/author-memory.md +117 -0
  492. package/resources/skills/story-creation/upstream/skills/story-review/references/banned-words.md +151 -0
  493. package/resources/skills/story-creation/upstream/skills/story-review/references/batch-review.md +19 -0
  494. package/resources/skills/story-creation/upstream/skills/story-review/references/character-relations.md +433 -0
  495. package/resources/skills/story-creation/upstream/skills/story-review/references/dialogue-mastery.md +288 -0
  496. package/resources/skills/story-creation/upstream/skills/story-review/references/plot-core-methods.md +522 -0
  497. package/resources/skills/story-creation/upstream/skills/story-review/references/quality-rubric.md +55 -0
  498. package/resources/skills/story-creation/upstream/skills/story-review/references/review-quality.md +246 -0
  499. package/resources/skills/story-creation/upstream/skills/story-review/references/review-tracking.md +10 -0
  500. package/resources/skills/story-creation/upstream/skills/story-review/references/rubrics/fanqie.md +18 -0
  501. package/resources/skills/story-creation/upstream/skills/story-review/references/rubrics/qidian.md +19 -0
  502. package/resources/skills/story-creation/upstream/skills/story-review/references/rubrics/zhihu.md +20 -0
  503. package/resources/skills/story-creation/upstream/skills/story-review/references/solo.md +52 -0
  504. package/resources/skills/story-creation/upstream/skills/story-review/references/style-resolution.md +27 -0
  505. package/resources/skills/story-creation/upstream/skills/story-review/references/tracking-initialization.md +31 -0
  506. package/resources/skills/story-creation/upstream/skills/story-review/references/tracking-transaction.md +146 -0
  507. package/resources/skills/story-creation/upstream/skills/story-review/scripts/author_memory_commit.py +1635 -0
  508. package/resources/skills/story-creation/upstream/skills/story-review/scripts/check-ai-patterns.js +1586 -0
  509. package/resources/skills/story-creation/upstream/skills/story-review/scripts/check-degeneration.js +349 -0
  510. package/resources/skills/story-creation/upstream/skills/story-review/scripts/normalize-punctuation.js +415 -0
  511. package/resources/skills/story-creation/upstream/skills/story-review/scripts/style-whitelist.js +39 -0
  512. package/resources/skills/story-creation/upstream/skills/story-review/scripts/tracking_commit.py +1691 -0
  513. package/resources/skills/story-creation/upstream/skills/story-review/scripts/wordcount_core.py +405 -0
  514. package/resources/skills/story-creation/upstream/skills/story-setup/SKILL.md +165 -0
  515. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/agent-quality.md +72 -0
  516. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/agent-reference-profiles.md +55 -0
  517. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/anti-ai-writing.md +556 -0
  518. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/banned-words.md +151 -0
  519. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/benchmark-style-load.md +107 -0
  520. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/character-basics.md +445 -0
  521. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/character-design-methods.md +428 -0
  522. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/character-relations.md +433 -0
  523. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/deslop-gates.md +171 -0
  524. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/dialogue-mastery.md +288 -0
  525. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/emotion-on-page.md +116 -0
  526. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/emotional-arc-design.md +313 -0
  527. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/format-and-structure.md +168 -0
  528. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//344/270/234/346/226/271/344/273/231/344/276/240.md +51 -0
  529. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//344/274/240/347/273/237/347/216/204/345/271/273.md +51 -0
  530. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/216/206/345/217/262/345/217/244/344/273/243.md +51 -0
  531. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/216/206/345/217/262/350/204/221/346/264/236.md +51 -0
  532. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/217/214/347/224/267/344/270/273.md +53 -0
  533. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/217/244/350/250/200/350/204/221/346/264/236.md +51 -0
  534. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/217/244/351/243/216/344/270/226/346/203/205.md +51 -0
  535. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/245/263/351/242/221/346/202/254/347/226/221.md +51 -0
  536. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/245/263/351/242/221/347/247/215/347/224/260.md +51 -0
  537. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/256/253/346/226/227/345/256/205/346/226/227.md +51 -0
  538. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/271/264/344/273/243.md +53 -0
  539. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/277/253/347/251/277.md +51 -0
  540. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/202/254/347/226/221/347/201/265/345/274/202.md +51 -0
  541. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/202/254/347/226/221/350/204/221/346/264/236.md +51 -0
  542. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/210/230/347/245/236/350/265/230/345/251/277.md +51 -0
  543. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/212/227/346/210/230/350/260/215/346/210/230.md +51 -0
  544. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/230/237/345/205/211/347/222/200/347/222/250.md +51 -0
  545. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/260/221/345/233/275/350/250/200/346/203/205.md +51 -0
  546. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/270/270/346/210/217/344/275/223/350/202/262.md +51 -0
  547. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//347/216/204/345/271/273/350/204/221/346/264/236.md +53 -0
  548. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//347/216/204/345/271/273/350/250/200/346/203/205.md +51 -0
  549. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//347/216/260/350/250/200/350/204/221/346/264/236.md +51 -0
  550. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//347/247/221/345/271/273/346/234/253/344/270/226.md +51 -0
  551. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//350/201/214/345/234/272/345/251/232/346/201/213.md +51 -0
  552. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//350/245/277/346/226/271/345/245/207/345/271/273.md +51 -0
  553. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//350/261/252/351/227/250/346/200/273/350/243/201.md +53 -0
  554. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/344/277/256/347/234/237.md +51 -0
  555. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/346/227/245/345/270/270.md +53 -0
  556. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/347/247/215/347/224/260.md +51 -0
  557. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/350/204/221/346/264/236.md +53 -0
  558. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/351/253/230/346/255/246.md +53 -0
  559. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/235/222/346/230/245/347/224/234/345/256/240.md +51 -0
  560. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards.md +91 -0
  561. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-readers.md +235 -0
  562. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-chapter-hooks.md +225 -0
  563. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-emotional-methods.md +209 -0
  564. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-genre-catalog.md +394 -0
  565. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-genre-mechanics.md +415 -0
  566. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-quality.md +42 -0
  567. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-reversal.md +335 -0
  568. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-suspense.md +352 -0
  569. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/opening-design.md +349 -0
  570. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/outline-conflict.md +457 -0
  571. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/outline-methods.md +287 -0
  572. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/outline-rhythm.md +389 -0
  573. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/plot-core-methods.md +522 -0
  574. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-chapter-hooks.md +225 -0
  575. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-emotional-methods.md +179 -0
  576. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-genre-formulas.md +417 -0
  577. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-paragraph-hooks.md +146 -0
  578. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-quality.md +39 -0
  579. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-reversal.md +355 -0
  580. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-suspense.md +352 -0
  581. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/style-combat-face.md +352 -0
  582. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/style-genre-modules.md +510 -0
  583. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/style-resolution.md +27 -0
  584. package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/writing-craft.md +442 -0
  585. package/resources/skills/story-creation/upstream/skills/story-setup/references/diagnostics.md +38 -0
  586. package/resources/skills/story-creation/upstream/skills/story-short-analyze/SKILL.md +224 -0
  587. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-character-basics.md +453 -0
  588. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-character-design.md +438 -0
  589. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-character-relations.md +395 -0
  590. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-method.md +42 -0
  591. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-paragraph-hooks.md +146 -0
  592. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-reader-profile.md +245 -0
  593. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-report-style.md +45 -0
  594. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-genres.md +65 -0
  595. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-hooks.md +77 -0
  596. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-mechanics.md +82 -0
  597. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-patterns.md +50 -0
  598. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-suspense.md +98 -0
  599. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-writing-techniques.md +477 -0
  600. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/deconstruction-examples.md +79 -0
  601. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/optional-modules.md +97 -0
  602. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/output-contract.md +127 -0
  603. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/quality-checklist.md +80 -0
  604. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/real-market-data.md +90 -0
  605. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/source-story-quality.md +221 -0
  606. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/stage2-3-structure-emotion.md +308 -0
  607. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/stage4-6-reversal-summary.md +611 -0
  608. package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/zhihu-style.md +54 -0
  609. package/resources/skills/story-creation/upstream/skills/story-short-scan/SKILL.md +182 -0
  610. package/resources/skills/story-creation/upstream/skills/story-short-scan/references/manual-rank-input.md +36 -0
  611. package/resources/skills/story-creation/upstream/skills/story-short-scan/references/platform-dianzhong.md +24 -0
  612. package/resources/skills/story-creation/upstream/skills/story-short-scan/references/platform-heiyan.md +21 -0
  613. package/resources/skills/story-creation/upstream/skills/story-short-scan/references/real-market-data.md +90 -0
  614. package/resources/skills/story-creation/upstream/skills/story-short-scan/references/topic-match.md +38 -0
  615. package/resources/skills/story-creation/upstream/skills/story-short-scan/scripts/aggregate-rank.js +682 -0
  616. package/resources/skills/story-creation/upstream/skills/story-short-scan/scripts/cdp-utils.js +242 -0
  617. package/resources/skills/story-creation/upstream/skills/story-short-scan/scripts/dz-browse-scraper.js +232 -0
  618. package/resources/skills/story-creation/upstream/skills/story-short-scan/scripts/heiyan-booklist-scraper.js +345 -0
  619. package/resources/skills/story-creation/upstream/skills/story-short-write/SKILL.md +136 -0
  620. package/resources/skills/story-creation/upstream/skills/story-short-write/references/agent-calls.md +13 -0
  621. package/resources/skills/story-creation/upstream/skills/story-short-write/references/author-memory-maintenance.md +75 -0
  622. package/resources/skills/story-creation/upstream/skills/story-short-write/references/author-memory.md +117 -0
  623. package/resources/skills/story-creation/upstream/skills/story-short-write/references/banned-words.md +151 -0
  624. package/resources/skills/story-creation/upstream/skills/story-short-write/references/benchmark-recall.md +40 -0
  625. package/resources/skills/story-creation/upstream/skills/story-short-write/references/cross-book-recall.md +62 -0
  626. package/resources/skills/story-creation/upstream/skills/story-short-write/references/dialogue-mastery.md +288 -0
  627. package/resources/skills/story-creation/upstream/skills/story-short-write/references/emotional-methods.md +179 -0
  628. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//344/270/226/346/203/205/346/211/223/350/204/270.md +159 -0
  629. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//345/217/214/347/224/267/344/270/273.md +156 -0
  630. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//345/244/215/344/273/207/346/211/223/350/204/270.md +163 -0
  631. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//345/256/205/346/226/227/345/256/253/346/226/227.md +167 -0
  632. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//346/200/273/350/243/201/350/261/252/351/227/250.md +178 -0
  633. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//346/202/254/347/226/221.md +166 -0
  634. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//346/260/221/344/277/227/346/200/252/350/260/210.md +159 -0
  635. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//346/262/231/351/233/225/350/204/221/346/264/236.md +151 -0
  636. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//347/224/234/345/256/240.md +153 -0
  637. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//350/277/275/345/246/273/347/201/253/350/221/254/345/234/272.md +210 -0
  638. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-writing-formulas.md +417 -0
  639. package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-writing-techniques.md +490 -0
  640. package/resources/skills/story-creation/upstream/skills/story-short-write/references/hooks-chapter.md +225 -0
  641. package/resources/skills/story-creation/upstream/skills/story-short-write/references/hooks-paragraph.md +146 -0
  642. package/resources/skills/story-creation/upstream/skills/story-short-write/references/output-contract.md +127 -0
  643. package/resources/skills/story-creation/upstream/skills/story-short-write/references/reference-index.md +23 -0
  644. package/resources/skills/story-creation/upstream/skills/story-short-write/references/scene-craft.md +40 -0
  645. package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-craft.md +147 -0
  646. package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-deslop.md +133 -0
  647. package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-format.md +199 -0
  648. package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-prose-quality.md +224 -0
  649. package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-reversal.md +355 -0
  650. package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-suspense.md +352 -0
  651. package/resources/skills/story-creation/upstream/skills/story-short-write/references/style-resolution.md +27 -0
  652. package/resources/skills/story-creation/upstream/skills/story-short-write/references/submission-craft.md +35 -0
  653. package/resources/skills/story-creation/upstream/skills/story-short-write/references/villain-and-reveal.md +153 -0
  654. package/resources/skills/story-creation/upstream/skills/story-short-write/references/workflow-design.md +85 -0
  655. package/resources/skills/story-creation/upstream/skills/story-short-write/references/workflow-draft.md +116 -0
  656. package/resources/skills/story-creation/upstream/skills/story-short-write/references/workflow-revision.md +99 -0
  657. package/resources/skills/story-creation/upstream/skills/story-short-write/references/writing-workflow.md +50 -0
  658. package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/author_memory_commit.py +1635 -0
  659. package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-ai-patterns.js +1586 -0
  660. package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-degeneration.js +349 -0
  661. package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-delivery-contract.js +241 -0
  662. package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-outline-copy.js +313 -0
  663. package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-phase2-contract.js +363 -0
  664. package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/normalize-punctuation.js +415 -0
  665. package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/style-whitelist.js +39 -0
  666. package/resources/skills/video-recap-production/manifest.json +673 -0
  667. package/resources/skills/video-recap-production/upstream/CHANGELOG.md +371 -0
  668. package/resources/skills/video-recap-production/upstream/LICENSE +21 -0
  669. package/resources/skills/video-recap-production/upstream/README.en.md +468 -0
  670. package/resources/skills/video-recap-production/upstream/README.md +459 -0
  671. package/resources/skills/video-recap-production/upstream/manifest.json +839 -0
  672. package/resources/skills/video-recap-production/upstream/skills/video-assemble/SKILL.md +112 -0
  673. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/audio-modes.md +63 -0
  674. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/explicit-audio-mix.md +75 -0
  675. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/foreground-compose.md +118 -0
  676. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/LICENSE.duo-video +21 -0
  677. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/SOURCE.md +15 -0
  678. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_draft_meta_info.json +69 -0
  679. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_combination_segment.json +84 -0
  680. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_combination_video_material.json +98 -0
  681. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_draft.json +204 -0
  682. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_material_video.json +83 -0
  683. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_meta_material_value.json +23 -0
  684. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_project_info.json +133 -0
  685. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_segment.json +70 -0
  686. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_text_styles.json +30 -0
  687. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_yj_material_audio.json +41 -0
  688. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_yj_material_text.json +109 -0
  689. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/narration-adoption.md +103 -0
  690. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/packaging.md +45 -0
  691. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/pair-media.md +74 -0
  692. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/source-score.md +147 -0
  693. package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/subtitle-track.md +202 -0
  694. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/__init__.py +1 -0
  695. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/audio_mix_binding.py +279 -0
  696. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/frozen_audio.py +187 -0
  697. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/narration_binding.py +323 -0
  698. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/strict_inputs.py +109 -0
  699. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/strict_publish.py +130 -0
  700. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/artifacts.py +47 -0
  701. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/assemble.py +591 -0
  702. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/assemble_constants.py +51 -0
  703. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/assembly_contract.py +318 -0
  704. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/assembly_settings.py +138 -0
  705. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/audio_automation.py +195 -0
  706. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/audio_mix.py +465 -0
  707. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/compose_foreground.py +293 -0
  708. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/export_jianying.py +254 -0
  709. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/__init__.py +1 -0
  710. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/builders.py +718 -0
  711. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/model.py +105 -0
  712. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/optional.py +23 -0
  713. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/schema.py +53 -0
  714. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/templates.py +37 -0
  715. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/timeline_contract.py +223 -0
  716. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/tracks.py +72 -0
  717. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/writer.py +383 -0
  718. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/lib.py +218 -0
  719. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/media.py +190 -0
  720. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/narration_audio.py +413 -0
  721. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/packaging.py +122 -0
  722. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/pair_media.py +216 -0
  723. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/render_preflight.py +33 -0
  724. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/source_score.py +469 -0
  725. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/source_subtitles.py +423 -0
  726. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/__init__.py +1 -0
  727. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/core.py +330 -0
  728. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/render.py +82 -0
  729. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/track.py +324 -0
  730. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/track_binding.py +200 -0
  731. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/timeline.py +217 -0
  732. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/timeline_emit.py +167 -0
  733. package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/visual_render.py +448 -0
  734. package/resources/skills/video-recap-production/upstream/skills/video-cut/SKILL.md +108 -0
  735. package/resources/skills/video-recap-production/upstream/skills/video-cut/references/shot-review.md +50 -0
  736. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/cut.py +41 -0
  737. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/cut_cli.py +308 -0
  738. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/cut_contract.py +424 -0
  739. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/cut_render.py +304 -0
  740. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/lib.py +114 -0
  741. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/media_geometry.py +238 -0
  742. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/narration_mapping.py +71 -0
  743. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/narrative_selection.py +244 -0
  744. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/sentence_boundaries.py +585 -0
  745. package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/shot_review.py +357 -0
  746. package/resources/skills/video-recap-production/upstream/skills/video-recap/SKILL.md +260 -0
  747. package/resources/skills/video-recap-production/upstream/skills/video-recap/references/audio-routing.md +126 -0
  748. package/resources/skills/video-recap-production/upstream/skills/video-recap/references/config-playbook.md +65 -0
  749. package/resources/skills/video-recap-production/upstream/skills/video-recap/references/data-schema.md +545 -0
  750. package/resources/skills/video-recap-production/upstream/skills/video-recap/references/resource-library.md +151 -0
  751. package/resources/skills/video-recap-production/upstream/skills/video-recap/references/shift-left-qc-schema.md +23 -0
  752. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/doctor.py +556 -0
  753. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/final_qc.py +527 -0
  754. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/lib.py +220 -0
  755. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/library.py +509 -0
  756. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/materials.py +406 -0
  757. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/mimo_qc.py +33 -0
  758. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/project_binding.py +286 -0
  759. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/__init__.py +1 -0
  760. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_client.py +13 -0
  761. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_contract.py +9 -0
  762. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_evidence.py +287 -0
  763. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_observations.py +175 -0
  764. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_payload.py +206 -0
  765. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_report.py +318 -0
  766. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_runner.py +130 -0
  767. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc_contract.py +320 -0
  768. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap.py +9 -0
  769. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_cli.py +209 -0
  770. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_inspect.py +452 -0
  771. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_review.py +70 -0
  772. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_runner.py +696 -0
  773. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_runtime.py +260 -0
  774. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_source.py +278 -0
  775. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_stage_qc.py +160 -0
  776. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_timeline.py +621 -0
  777. package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/resource_lock.py +162 -0
  778. package/resources/skills/video-recap-production/upstream/skills/video-script/SKILL.md +251 -0
  779. package/resources/skills/video-recap-production/upstream/skills/video-script/references/creative-editing-playbook.md +229 -0
  780. package/resources/skills/video-recap-production/upstream/skills/video-script/references/promotional-copy.md +68 -0
  781. package/resources/skills/video-recap-production/upstream/skills/video-script/references/research-guide.md +75 -0
  782. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/agent_text.py +301 -0
  783. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/deslop_qc.py +211 -0
  784. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/evidence_bundle.py +440 -0
  785. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/lib.py +254 -0
  786. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/narration_lint.py +707 -0
  787. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/review.py +40 -0
  788. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/review_grounding.py +238 -0
  789. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/review_response.py +669 -0
  790. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/review_runner.py +186 -0
  791. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/speech_ownership.py +143 -0
  792. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/timeline_fusion.py +108 -0
  793. package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/validate.py +175 -0
  794. package/resources/skills/video-recap-production/upstream/skills/video-understanding/SKILL.md +77 -0
  795. package/resources/skills/video-recap-production/upstream/skills/video-understanding/references/data-schema.md +193 -0
  796. package/resources/skills/video-recap-production/upstream/skills/video-understanding/references/prompt-templates.md +37 -0
  797. package/resources/skills/video-recap-production/upstream/skills/video-understanding/references/research-guide.md +74 -0
  798. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/agent_text.py +301 -0
  799. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/asr.py +279 -0
  800. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/asr_timing_evidence.py +270 -0
  801. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/brief.py +9 -0
  802. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/__init__.py +1 -0
  803. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/builder.py +402 -0
  804. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/context.py +317 -0
  805. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/inputs.py +268 -0
  806. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/timeline.py +326 -0
  807. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/consolidate.py +596 -0
  808. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/deslop_qc.py +211 -0
  809. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/detect.py +504 -0
  810. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/extract.py +62 -0
  811. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/lib.py +419 -0
  812. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/narration_lint.py +707 -0
  813. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/speech_ownership.py +143 -0
  814. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/storyboard.py +445 -0
  815. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/timeline_fusion.py +108 -0
  816. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understand.py +9 -0
  817. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understanding_brief.py +190 -0
  818. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understanding_cache.py +345 -0
  819. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understanding_runner.py +387 -0
  820. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understanding_storyboard.py +167 -0
  821. package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/vlm.py +674 -0
  822. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/SKILL.md +91 -0
  823. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/references/index-tts.md +31 -0
  824. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/approved_text_policy.py +123 -0
  825. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/dub.py +623 -0
  826. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/lib.py +352 -0
  827. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/providers/__init__.py +1 -0
  828. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/providers/fish_audio.py +91 -0
  829. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/providers/index_tts.py +184 -0
  830. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/tts_audio.py +102 -0
  831. package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/voiceover.py +771 -0
  832. package/resources/skills/viora-canvas-production/manifest.json +5 -1
  833. package/resources/skills/viora-canvas-production/references/story-handoff.md +49 -0
@@ -0,0 +1,406 @@
1
+ """Filesystem material library helpers for video-recap.
2
+
3
+ The library is intentionally grep-friendly: JSON/MD/JSONL files on disk, no DB,
4
+ no embeddings, no raw-media copies. Current metadata lives in each material
5
+ folder; the root ``materials_index.jsonl`` is an append-only journal for grep and
6
+ history.
7
+
8
+ Secret handling is BEST-EFFORT defense-in-depth, NOT a guarantee. ``_redact_text``
9
+ masks common credential value shapes (``tp-``/``sk-``/``gh*_``/``AKIA``/JWT and
10
+ ``KEY=VALUE`` assignments) and ``_redact_json`` drops the value of exact
11
+ credential-named keys, but a secret in an unrecognized format can still slip
12
+ through. Keep secrets (API keys, tokens) out of the analysis artifacts in the
13
+ first place — the key is read from the environment/``.env`` and never needs to be
14
+ written into scenes/ASR/VLM/summary JSON.
15
+ """
16
+ from __future__ import annotations
17
+
18
+ import json
19
+ import os
20
+ import re
21
+ import tempfile
22
+ from datetime import datetime, timezone
23
+ from pathlib import Path
24
+
25
+ from lib import load_json
26
+
27
+ ALLOWED_ARTIFACTS = {
28
+ "scenes.json",
29
+ "asr_result.json",
30
+ "asr_clean.json",
31
+ "vlm_analysis.json",
32
+ "silence_periods.json",
33
+ "speech_boundary_anchors.json",
34
+ "speech_boundary_anchors_output.json",
35
+ "timeline_fusion.json",
36
+ "understanding_index.json",
37
+ "understanding_index.md",
38
+ "agent_narration_brief.md",
39
+ "background_research.json",
40
+ "reference_profile.json",
41
+ "reference_match_report.json",
42
+ "recap_run_manifest.json",
43
+ }
44
+ # Redaction targets credential VALUE shapes, not English/Chinese dictionary words — the
45
+ # library must stay a faithful copy of the analysis. Bare words like "secret"/"token"
46
+ # legitimately appear in transcripts/summaries and must NOT be touched.
47
+ SECRET_VALUE_RES = (
48
+ re.compile(r"\btp-[A-Za-z0-9_-]{8,}\b"), # MiMo Token Plan keys
49
+ re.compile(r"\bsk-[A-Za-z0-9_-]{16,}\b"), # OpenAI-style keys
50
+ re.compile(r"\bgh[pousr]_[A-Za-z0-9]{20,}\b"), # GitHub tokens
51
+ re.compile(r"\bAKIA[0-9A-Z]{16}\b"), # AWS access key id
52
+ re.compile(r"\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\b"), # JWT
53
+ )
54
+ # `KEY=VALUE` / `"key": "value"` assignments whose key denotes a credential -> mask the VALUE.
55
+ SECRET_ASSIGN_RE = re.compile(
56
+ r"(?i)(\b(?:mimo(?:_\w+)?_api_key|api_key|secret_key|access_token|refresh_token|"
57
+ r"authorization|password|passwd|bearer)\b\s*[:=]\s*)(\"?)([^\s\"',;]+)(\"?)"
58
+ )
59
+ # Exact JSON/dict key names whose VALUE is a credential and must be dropped (key name kept).
60
+ SECRET_KEY_NAMES = frozenset({
61
+ "api_key", "mimo_api_key", "mimo_asr_api_key", "mimo_tts_api_key", "mimo_video_api_key",
62
+ "secret_key", "access_token", "refresh_token", "authorization", "password", "passwd",
63
+ })
64
+
65
+
66
+ def utc_now_iso() -> str:
67
+ return datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z")
68
+
69
+
70
+ def file_identity(path: str | Path) -> dict:
71
+ """``{size, mtime_ns}`` of a file: the identity recap records and compares for a source
72
+ video or adopted artifact. A file rewritten in place gets a new mtime_ns."""
73
+ st = os.stat(os.fspath(path))
74
+ return {"size": st.st_size, "mtime_ns": st.st_mtime_ns}
75
+
76
+
77
+ def _slug(text: str, max_len: int = 48) -> str:
78
+ raw = Path(text).stem.lower()
79
+ raw = re.sub(r"[^a-z0-9\u4e00-\u9fff._-]+", "-", raw).strip("-._")
80
+ return (raw or "material")[:max_len].strip("-._") or "material"
81
+
82
+
83
+ def _id_stem(source_path: str | Path, max_len: int = 32) -> str:
84
+ raw = re.sub(r"[^a-z0-9]+", "-", Path(source_path).stem.lower()).strip("-")
85
+ return (raw or "source")[:max_len].strip("-") or "source"
86
+
87
+
88
+ def source_id_for(source_path: str | Path) -> str:
89
+ """``src_<stem>_<size>``: readable, stable across runs, and distinct for a different cut
90
+ of the same title (the size changes)."""
91
+ return f"src_{_id_stem(source_path)}_{os.stat(os.fspath(source_path)).st_size}"
92
+
93
+
94
+ def assign_source_ids(sources: list[dict]) -> list[dict]:
95
+ """Assign deterministic source_id values to manifest source records.
96
+
97
+ Base id is ``source_id_for(source_path)``. When two records in one project share a
98
+ base id, the first keeps it and later ones get ``_2``, ``_3``… suffixes in input order.
99
+ """
100
+ used: set[str] = set()
101
+ assigned = []
102
+ for raw in sources:
103
+ item = dict(raw)
104
+ path = str(Path(item["source_path"]).resolve())
105
+ base = source_id_for(path)
106
+ sid = base
107
+ suffix = 2
108
+ while sid in used:
109
+ sid = f"{base}_{suffix}"
110
+ suffix += 1
111
+ used.add(sid)
112
+ item["source_id"] = sid
113
+ item["source_path"] = path
114
+ assigned.append(item)
115
+ return assigned
116
+
117
+
118
+ def material_id_for(source_path: str | Path, source_identity: dict) -> str:
119
+ return f"{_slug(str(source_path))}-{source_identity['size']}"
120
+
121
+
122
+ def material_dir(library_dir: str | Path, material_id: str) -> Path:
123
+ return Path(library_dir) / "materials" / material_id
124
+
125
+
126
+ def _redact_text(text: str) -> str:
127
+ """Redact credential value shapes only; leave ordinary words (secret/token/…) intact."""
128
+ for rx in SECRET_VALUE_RES:
129
+ text = rx.sub("[redacted-token]", text)
130
+ return SECRET_ASSIGN_RE.sub(lambda m: f"{m.group(1)}{m.group(2)}[redacted-key]{m.group(4)}", text)
131
+
132
+
133
+ def _redact_json(value):
134
+ if isinstance(value, dict):
135
+ out = {}
136
+ for key, item in value.items():
137
+ # Drop only the value of an exact credential-named key; keep the key name and
138
+ # never coalesce distinct keys (so benign fields like token_economy survive).
139
+ if key.strip().lower() in SECRET_KEY_NAMES:
140
+ out[key] = "[redacted]"
141
+ else:
142
+ out[key] = _redact_json(item)
143
+ return out
144
+ if isinstance(value, list):
145
+ return [_redact_json(item) for item in value]
146
+ if isinstance(value, str):
147
+ return _redact_text(value)
148
+ return value
149
+
150
+
151
+ def copy_artifact_redacted(src: Path, dst: Path) -> None:
152
+ """Copy an allowed JSON/MD artifact without persisting obvious secret markers."""
153
+ text = src.read_text(encoding="utf-8")
154
+ if src.suffix.lower() == ".json":
155
+ dst.write_text(json.dumps(_redact_json(json.loads(text)), ensure_ascii=False, indent=2), encoding="utf-8")
156
+ else:
157
+ dst.write_text(_redact_text(text), encoding="utf-8")
158
+
159
+
160
+ def summarize_work_dir(work_dir: str | Path, *, source_name: str = "") -> dict:
161
+ """Grep-friendly tags for material.md/index: character and entity names plus artifact counts."""
162
+ work = Path(work_dir)
163
+ summary = f"Analyzed video material: {source_name or work.name}"
164
+ tags = []
165
+ index_path = work / "understanding_index.json"
166
+ if index_path.exists():
167
+ # consolidate.py writes {characters, relationships, plot_points, entities,
168
+ # research_glossary} and no prose summary. The list ITEMS are MiMo output that
169
+ # consolidate only list-checks, so their shape is still tolerated here.
170
+ index = load_json(index_path)
171
+ for key in ("characters", "entities"):
172
+ for item in index[key][:12]:
173
+ text = item.get("name", "") if isinstance(item, dict) else item
174
+ tags.append(_redact_text(str(text))[:80])
175
+ for name, label in (("scenes.json", "scenes"), ("asr_result.json", "asr")):
176
+ if (work / name).exists():
177
+ tags.append(f"{label}:{len(load_json(work / name))}")
178
+ return {
179
+ "summary": summary,
180
+ "tags": list(dict.fromkeys(tag for tag in tags if tag))[:20],
181
+ }
182
+
183
+
184
+ def allowed_artifact_paths(work_dir: str | Path) -> list[Path]:
185
+ work = Path(work_dir)
186
+ return [work / name for name in sorted(ALLOWED_ARTIFACTS) if (work / name).is_file()]
187
+
188
+
189
+ def write_material_md(path: Path, metadata: dict, summary: str, tags: list[str]) -> None:
190
+ artifact_lines = "\n".join(f"- `{a['name']}` → `{a['path']}`" for a in metadata["artifacts"])
191
+ tags_text = ", ".join(tags) if tags else "(none)"
192
+ text = f"""# Material: {metadata['source_name']}
193
+
194
+ - material_id: `{metadata['material_id']}`
195
+ - source: `{metadata['source_path']}`
196
+ - source_identity: `{json.dumps(metadata['source_video_identity'], sort_keys=True)}`
197
+ - settings: `{json.dumps(metadata['settings'], ensure_ascii=False, sort_keys=True)}`
198
+ - updated_at: `{metadata['updated_at']}`
199
+ - tags: {tags_text}
200
+
201
+ ## Summary
202
+ {summary}
203
+
204
+ ## Artifacts
205
+ {artifact_lines or '- (none)'}
206
+ """
207
+ path.write_text(text, encoding="utf-8")
208
+
209
+
210
+ def _read_material_metadata(path: Path) -> dict | None:
211
+ try:
212
+ data = load_json(path)
213
+ except (OSError, ValueError):
214
+ return None
215
+ return data if isinstance(data, dict) else None
216
+
217
+
218
+ def _material_cache_entry(path: Path) -> dict | None:
219
+ data = _read_material_metadata(path)
220
+ if not data or not all(data.get(key) for key in (
221
+ "source_path", "updated_at", "material_id",
222
+ )) or not isinstance(data.get("artifacts"), list):
223
+ return None
224
+ if not isinstance(data.get("source_video_identity"), dict) \
225
+ or not isinstance(data.get("settings"), dict):
226
+ return None
227
+ return data
228
+
229
+
230
+ def save_material(
231
+ library_dir: str | Path,
232
+ work_dir: str | Path,
233
+ source_path: str | Path,
234
+ source_identity: dict,
235
+ settings: dict,
236
+ *,
237
+ duration: float | None = None,
238
+ source_id: str | None = None,
239
+ material_id: str | None = None,
240
+ now: str | None = None,
241
+ ) -> dict:
242
+ """Persist small reusable analysis artifacts into the filesystem library."""
243
+ lib = Path(library_dir)
244
+ mid = material_id or material_id_for(source_path, source_identity)
245
+ dest = material_dir(lib, mid)
246
+ artifacts_dir = dest / "artifacts"
247
+ artifacts_dir.mkdir(parents=True, exist_ok=True)
248
+ now = now or utc_now_iso()
249
+
250
+ sources = allowed_artifact_paths(work_dir)
251
+ fresh_names = {src.name for src in sources}
252
+ # Reconcile: drop allowed artifacts left from a previous (larger) save so the on-disk
253
+ # artifacts/ dir always matches material.json — a stale orphan must not surface in greps.
254
+ for stale in artifacts_dir.iterdir():
255
+ if stale.is_file() and stale.name in ALLOWED_ARTIFACTS and stale.name not in fresh_names:
256
+ stale.unlink()
257
+ copied = []
258
+ for src in sources:
259
+ dst = artifacts_dir / src.name
260
+ copy_artifact_redacted(src, dst)
261
+ copied.append({"name": src.name, "path": f"artifacts/{src.name}", "bytes": dst.stat().st_size})
262
+
263
+ meta_path = dest / "material.json"
264
+ previous = _read_material_metadata(meta_path)
265
+ created_at = previous.get("created_at") if previous else None
266
+ if not isinstance(created_at, str) or not created_at:
267
+ created_at = now
268
+ source_path = Path(source_path).resolve()
269
+ summary_info = summarize_work_dir(work_dir, source_name=source_path.name)
270
+ metadata = {
271
+ "schema_version": 1,
272
+ "material_id": mid,
273
+ "source_id": source_id,
274
+ "source_name": source_path.name,
275
+ "source_path": str(source_path),
276
+ "source_video_identity": dict(source_identity),
277
+ "duration": duration,
278
+ "settings": dict(settings),
279
+ "artifacts": copied,
280
+ "created_at": created_at,
281
+ "updated_at": now,
282
+ }
283
+ meta_path.write_text(json.dumps(metadata, ensure_ascii=False, indent=2), encoding="utf-8")
284
+ write_material_md(dest / "material.md", metadata, summary_info["summary"], summary_info["tags"])
285
+
286
+ index_record = {
287
+ "schema_version": 1,
288
+ "event": "saved",
289
+ "material_id": mid,
290
+ "source_name": metadata["source_name"],
291
+ "source_path": metadata["source_path"],
292
+ "source_video_identity": dict(source_identity),
293
+ "summary": summary_info["summary"],
294
+ "tags": summary_info["tags"],
295
+ "material_dir": str(dest),
296
+ "updated_at": now,
297
+ }
298
+ lib.mkdir(parents=True, exist_ok=True)
299
+ with (lib / "materials_index.jsonl").open("a", encoding="utf-8") as f:
300
+ f.write(json.dumps(index_record, ensure_ascii=False, separators=(",", ":")) + "\n")
301
+ return metadata
302
+
303
+
304
+ def find_material_by_source(
305
+ library_dir: str | Path, source_path: str | Path, source_identity: dict
306
+ ) -> dict | None:
307
+ """The newest material saved for this exact source file (resolved path + identity)."""
308
+ root = Path(library_dir) / "materials"
309
+ if not root.exists():
310
+ return None
311
+ resolved = str(Path(source_path).resolve())
312
+ candidates = []
313
+ for meta_path in root.glob("*/material.json"):
314
+ data = _material_cache_entry(meta_path)
315
+ if (
316
+ data is not None
317
+ and data["source_path"] == resolved
318
+ and data["source_video_identity"] == source_identity
319
+ ):
320
+ data["material_dir"] = str(meta_path.parent)
321
+ candidates.append(data)
322
+ if not candidates:
323
+ return None
324
+ # Deterministic fallback policy for legacy/manual callers that do not know
325
+ # the expected material_id: newest wins, then material_id for stable ties.
326
+ candidates.sort(key=lambda d: (d["updated_at"], d["material_id"]), reverse=True)
327
+ return candidates[0]
328
+
329
+
330
+ def restore_material(
331
+ library_dir: str | Path,
332
+ work_dir: str | Path,
333
+ *,
334
+ source_path: str | Path,
335
+ source_identity: dict,
336
+ settings: dict,
337
+ material_id: str | None = None,
338
+ overwrite: bool = True,
339
+ prune_stale_allowed: bool = True,
340
+ ) -> dict:
341
+ """Restore allowed artifacts when source path, identity and settings all match.
342
+
343
+ Returns a status dict and never partially restores on mismatch.
344
+
345
+ By default the restored material is treated as the authoritative analysis
346
+ snapshot for ``work_dir``: allowed analysis artifacts are staged first, then
347
+ stale allowed artifacts in the destination are pruned before replacement.
348
+ This prevents reused work dirs from mixing old scenes/ASR/VLM files with a
349
+ newly restored material. Non-allowed files (for example narration.json or
350
+ clip_plan.json) are never removed here.
351
+ """
352
+ lib = Path(library_dir)
353
+ if material_id:
354
+ meta_path = material_dir(lib, material_id) / "material.json"
355
+ meta = _material_cache_entry(meta_path)
356
+ if meta is None:
357
+ return {"restored": False, "reason": "material missing or invalid"}
358
+ meta["material_dir"] = str(meta_path.parent)
359
+ else:
360
+ meta = find_material_by_source(lib, source_path, source_identity)
361
+ if meta is None:
362
+ return {"restored": False, "reason": "material not found"}
363
+ if meta["source_path"] != str(Path(source_path).resolve()) \
364
+ or meta["source_video_identity"] != source_identity:
365
+ return {"restored": False, "reason": "source identity mismatch", "material_id": meta["material_id"]}
366
+ if meta["settings"] != settings:
367
+ return {"restored": False, "reason": "settings mismatch", "material_id": meta["material_id"]}
368
+
369
+ src_dir = Path(meta["material_dir"]) / "artifacts"
370
+ if not src_dir.exists():
371
+ return {"restored": False, "reason": "material artifacts missing", "material_id": meta["material_id"]}
372
+ dest = Path(work_dir)
373
+ dest.mkdir(parents=True, exist_ok=True)
374
+ with tempfile.TemporaryDirectory(prefix=".material_restore_", dir=str(dest)) as tmp_name:
375
+ tmp = Path(tmp_name)
376
+ staged = [artifact["name"] for artifact in meta["artifacts"]] # save_material's own list
377
+ if not staged or any(not (src_dir / name).is_file() for name in staged):
378
+ return {"restored": False, "reason": "material artifacts missing", "material_id": meta["material_id"]}
379
+ for name in staged:
380
+ copy_artifact_redacted(src_dir / name, tmp / name)
381
+
382
+ pruned = []
383
+ if prune_stale_allowed:
384
+ # Never prune an artifact we are about to restore: the restore loop below honors
385
+ # `overwrite`, so pruning a staged name would (with overwrite=False) delete it and
386
+ # then skip the copy, losing the file.
387
+ for name in sorted(ALLOWED_ARTIFACTS - set(staged)):
388
+ out = dest / name
389
+ if out.exists():
390
+ out.unlink()
391
+ pruned.append(name)
392
+
393
+ restored = []
394
+ for name in staged:
395
+ out = dest / name
396
+ if out.exists() and not overwrite:
397
+ continue
398
+ (tmp / name).replace(out)
399
+ restored.append(name)
400
+ return {
401
+ "restored": bool(restored),
402
+ "material_id": meta["material_id"],
403
+ "artifacts": restored,
404
+ "pruned_artifacts": pruned,
405
+ "material": meta,
406
+ }
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env python3
2
+ """Public API and CLI entrypoint for advisory MiMo multimodal QC."""
3
+
4
+ import qc.mimo_runner as mimo_qc_runner
5
+ from qc.mimo_evidence import collect_evidence, safe_mimo_config
6
+ from qc.mimo_observations import normalize_observations
7
+ from qc.mimo_payload import build_payload
8
+ from qc.mimo_client import mimo_qc_api_call
9
+
10
+ clear_report = mimo_qc_runner.clear_report
11
+
12
+
13
+ def run(work_dir, **kwargs):
14
+ """mimo_qc_runner.run with the real MiMo transport bound at call time."""
15
+ return mimo_qc_runner.run(work_dir, api_call=mimo_qc_api_call, **kwargs)
16
+
17
+
18
+ def main(argv=None):
19
+ return mimo_qc_runner.main(argv, run_callable=run)
20
+
21
+ __all__ = [
22
+ "build_payload",
23
+ "clear_report",
24
+ "collect_evidence",
25
+ "main",
26
+ "mimo_qc_api_call",
27
+ "normalize_observations",
28
+ "run",
29
+ "safe_mimo_config",
30
+ ]
31
+
32
+ if __name__ == "__main__":
33
+ raise SystemExit(main())