dsh-openwrite 0.2.8

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 (275) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +107 -0
  3. package/THIRD_PARTY_NOTICES.md +33 -0
  4. package/assets/logo-dark.svg +31 -0
  5. package/assets/logo-light.svg +31 -0
  6. package/cordis.patch.yml +11 -0
  7. package/docs/BENCHMARK_TASKS.md +54 -0
  8. package/docs/COST_MEASUREMENT.md +39 -0
  9. package/docs/DEVELOPMENT.md +65 -0
  10. package/docs/DSH_STORE.md +58 -0
  11. package/docs/FRAMEWORK_ADVANTAGES.md +288 -0
  12. package/docs/IMPROVEMENT_PLAN.md +252 -0
  13. package/docs/INSTALL.md +99 -0
  14. package/docs/LEARNING.md +68 -0
  15. package/docs/OPEN_SOURCE_NOVEL_AUDIT.md +191 -0
  16. package/docs/PLUGIN_MAINTENANCE.md +54 -0
  17. package/docs/PLUGIN_MAINTENANCE_RC7.md +157 -0
  18. package/docs/QA_20260908.md +103 -0
  19. package/docs/QA_20260909_BENCHMARK.md +24 -0
  20. package/docs/RELEASE_ACCEPTANCE.md +116 -0
  21. package/docs/REVIEW_DAG_FRAMEWORK.md +82 -0
  22. package/docs/TARGETED_NOVEL_PROJECT_REVIEW.md +167 -0
  23. package/docs/WORKFLOWS.md +74 -0
  24. package/docs/WORKSPACE_CONTEXT_CONTRACT.md +125 -0
  25. package/docs/WORKSPACE_INTEGRATION_GOAL.md +278 -0
  26. package/docs/research/autosave-race-repro.mjs +133 -0
  27. package/docs/research/framework-stats-2026-09-05.json +116 -0
  28. package/dog-tools.mjs +11 -0
  29. package/package.json +132 -0
  30. package/packages/openwrite-bridge/LICENSE +201 -0
  31. package/packages/openwrite-bridge/cordis.patch.yml +10 -0
  32. package/packages/openwrite-bridge/lib/client.d.ts +95 -0
  33. package/packages/openwrite-bridge/lib/client.js +193 -0
  34. package/packages/openwrite-bridge/lib/contracts-generated.d.ts +367 -0
  35. package/packages/openwrite-bridge/lib/contracts-generated.js +1764 -0
  36. package/packages/openwrite-bridge/lib/dog-delivery.d.ts +12 -0
  37. package/packages/openwrite-bridge/lib/dog-delivery.js +362 -0
  38. package/packages/openwrite-bridge/lib/dog-review.d.ts +50 -0
  39. package/packages/openwrite-bridge/lib/dog-review.js +470 -0
  40. package/packages/openwrite-bridge/lib/domain.d.ts +70 -0
  41. package/packages/openwrite-bridge/lib/domain.js +496 -0
  42. package/packages/openwrite-bridge/lib/index.d.ts +17 -0
  43. package/packages/openwrite-bridge/lib/index.js +89 -0
  44. package/packages/openwrite-bridge/lib/managed-runtime.d.ts +95 -0
  45. package/packages/openwrite-bridge/lib/managed-runtime.js +510 -0
  46. package/packages/openwrite-bridge/lib/preset-tools.d.ts +13 -0
  47. package/packages/openwrite-bridge/lib/preset-tools.js +18 -0
  48. package/packages/openwrite-bridge/lib/tool-policy.d.ts +6 -0
  49. package/packages/openwrite-bridge/lib/tool-policy.js +56 -0
  50. package/packages/openwrite-bridge/lib/tools.d.ts +24 -0
  51. package/packages/openwrite-bridge/lib/tools.js +2404 -0
  52. package/packages/openwrite-bridge/package.json +67 -0
  53. package/packages/studio-panel/LICENSE +21 -0
  54. package/packages/studio-panel/README.md +51 -0
  55. package/packages/studio-panel/cordis.patch.yml +5 -0
  56. package/packages/studio-panel/lib/client.js +158087 -0
  57. package/packages/studio-panel/lib/client.js.map +1 -0
  58. package/packages/studio-panel/lib/index.js +50 -0
  59. package/packages/studio-panel/lib/types/client/AssetEditor.d.ts +122 -0
  60. package/packages/studio-panel/lib/types/client/AssetsView.d.ts +43 -0
  61. package/packages/studio-panel/lib/types/client/BenchmarkView.d.ts +9 -0
  62. package/packages/studio-panel/lib/types/client/ContinuousReader.d.ts +13 -0
  63. package/packages/studio-panel/lib/types/client/CreationView.d.ts +6 -0
  64. package/packages/studio-panel/lib/types/client/DagCanvas.d.ts +11 -0
  65. package/packages/studio-panel/lib/types/client/DiscardDraftDialog.d.ts +8 -0
  66. package/packages/studio-panel/lib/types/client/DomainToolCard.d.ts +9 -0
  67. package/packages/studio-panel/lib/types/client/GraphView.d.ts +46 -0
  68. package/packages/studio-panel/lib/types/client/HeaderChrome.d.ts +18 -0
  69. package/packages/studio-panel/lib/types/client/LaunchOpenWrite.d.ts +13 -0
  70. package/packages/studio-panel/lib/types/client/LibraryView.d.ts +6 -0
  71. package/packages/studio-panel/lib/types/client/MarkdownText.d.ts +3 -0
  72. package/packages/studio-panel/lib/types/client/ModelView.d.ts +9 -0
  73. package/packages/studio-panel/lib/types/client/OperationsView.d.ts +6 -0
  74. package/packages/studio-panel/lib/types/client/OutlinePlans.d.ts +37 -0
  75. package/packages/studio-panel/lib/types/client/OutlineView.d.ts +29 -0
  76. package/packages/studio-panel/lib/types/client/ResearchView.d.ts +7 -0
  77. package/packages/studio-panel/lib/types/client/ReviewCard.d.ts +28 -0
  78. package/packages/studio-panel/lib/types/client/SceneWorkbench.d.ts +55 -0
  79. package/packages/studio-panel/lib/types/client/SearchView.d.ts +33 -0
  80. package/packages/studio-panel/lib/types/client/TasksView.d.ts +11 -0
  81. package/packages/studio-panel/lib/types/client/TransferWorkspaces.d.ts +19 -0
  82. package/packages/studio-panel/lib/types/client/TurnMutationSummary.d.ts +62 -0
  83. package/packages/studio-panel/lib/types/client/VditorBody.d.ts +55 -0
  84. package/packages/studio-panel/lib/types/client/WorkbenchStore.d.ts +121 -0
  85. package/packages/studio-panel/lib/types/client/api.d.ts +72 -0
  86. package/packages/studio-panel/lib/types/client/asset-drafts.d.ts +20 -0
  87. package/packages/studio-panel/lib/types/client/benchmark-options.d.ts +43 -0
  88. package/packages/studio-panel/lib/types/client/draft-store.d.ts +26 -0
  89. package/packages/studio-panel/lib/types/client/dto.d.ts +517 -0
  90. package/packages/studio-panel/lib/types/client/index.d.ts +4 -0
  91. package/packages/studio-panel/lib/types/client/locales.d.ts +15 -0
  92. package/packages/studio-panel/lib/types/client/manuscript-annotations.d.ts +59 -0
  93. package/packages/studio-panel/lib/types/client/manuscript-markers.d.ts +61 -0
  94. package/packages/studio-panel/lib/types/client/manuscript-mentions.d.ts +30 -0
  95. package/packages/studio-panel/lib/types/client/manuscript-overlay-dom.d.ts +7 -0
  96. package/packages/studio-panel/lib/types/client/manuscript-overlay.d.ts +42 -0
  97. package/packages/studio-panel/lib/types/client/manuscript-selection.d.ts +59 -0
  98. package/packages/studio-panel/lib/types/client/model-view-memory.d.ts +17 -0
  99. package/packages/studio-panel/lib/types/client/storage.d.ts +8 -0
  100. package/packages/studio-panel/lib/types/client/workbench-epochs.d.ts +16 -0
  101. package/packages/studio-panel/lib/types/client/workspace-context.d.ts +52 -0
  102. package/packages/studio-panel/lib/types/client/writing-scope.d.ts +7 -0
  103. package/packages/studio-panel/lib/types/index.d.ts +5 -0
  104. package/packages/studio-panel/package.json +105 -0
  105. package/packages/studio-panel/vendor/vditor/LICENSE +21 -0
  106. package/packages/studio-panel/vendor/vditor/dist/css/content-theme/dark.css +123 -0
  107. package/packages/studio-panel/vendor/vditor/dist/css/content-theme/light.css +101 -0
  108. package/packages/studio-panel/vendor/vditor/dist/index.css +1823 -0
  109. package/packages/studio-panel/vendor/vditor/dist/index.min.js +1 -0
  110. package/packages/studio-panel/vendor/vditor/dist/js/i18n/zh_CN.js +86 -0
  111. package/packages/studio-panel/vendor/vditor/dist/js/icons/ant.js +174 -0
  112. package/packages/studio-panel/vendor/vditor/dist/js/lute/lute.min.js +72 -0
  113. package/plugin.d.ts +3 -0
  114. package/plugin.mjs +80 -0
  115. package/presets/README.md +32 -0
  116. package/presets/openwrite/agent.cordis.yml +317 -0
  117. package/presets/openwrite/preset.yml +3 -0
  118. package/presets/openwrite/skills/canon/SKILL.md +15 -0
  119. package/presets/openwrite/skills/dialoguequality/SKILL.md +166 -0
  120. package/presets/openwrite/skills/dog-delivery-query/SKILL.md +40 -0
  121. package/presets/openwrite/skills/dog-import-query/SKILL.md +27 -0
  122. package/presets/openwrite/skills/dog-review-query/SKILL.md +40 -0
  123. package/presets/openwrite/skills/export-book/SKILL.md +14 -0
  124. package/presets/openwrite/skills/foreshadow/SKILL.md +14 -0
  125. package/presets/openwrite/skills/foreshadowing-system/SKILL.md +125 -0
  126. package/presets/openwrite/skills/learn/SKILL.md +24 -0
  127. package/presets/openwrite/skills/novel-creator/SKILL.md +88 -0
  128. package/presets/openwrite/skills/novel-creator/templates/beat_templates.yaml +179 -0
  129. package/presets/openwrite/skills/novel-creator/templates/example_usage.yaml +74 -0
  130. package/presets/openwrite/skills/novel-reviewer/SKILL.md +85 -0
  131. package/presets/openwrite/skills/oh-story-deslop/LICENSE +21 -0
  132. package/presets/openwrite/skills/oh-story-deslop/SKILL.md +36 -0
  133. package/presets/openwrite/skills/oh-story-deslop/agents/openai.yaml +4 -0
  134. package/presets/openwrite/skills/oh-story-deslop/references/method.md +22 -0
  135. package/presets/openwrite/skills/oh-story-long-analyze/LICENSE +21 -0
  136. package/presets/openwrite/skills/oh-story-long-analyze/SKILL.md +37 -0
  137. package/presets/openwrite/skills/oh-story-long-analyze/agents/openai.yaml +4 -0
  138. package/presets/openwrite/skills/oh-story-long-analyze/references/method.md +22 -0
  139. package/presets/openwrite/skills/oh-story-long-scan/LICENSE +21 -0
  140. package/presets/openwrite/skills/oh-story-long-scan/SKILL.md +36 -0
  141. package/presets/openwrite/skills/oh-story-long-scan/agents/openai.yaml +4 -0
  142. package/presets/openwrite/skills/oh-story-long-scan/references/method.md +21 -0
  143. package/presets/openwrite/skills/oh-story-long-write/LICENSE +21 -0
  144. package/presets/openwrite/skills/oh-story-long-write/SKILL.md +37 -0
  145. package/presets/openwrite/skills/oh-story-long-write/agents/openai.yaml +4 -0
  146. package/presets/openwrite/skills/oh-story-long-write/references/method.md +33 -0
  147. package/presets/openwrite/skills/oh-story-review/LICENSE +21 -0
  148. package/presets/openwrite/skills/oh-story-review/SKILL.md +36 -0
  149. package/presets/openwrite/skills/oh-story-review/agents/openai.yaml +4 -0
  150. package/presets/openwrite/skills/oh-story-review/references/method.md +25 -0
  151. package/presets/openwrite/skills/progress/SKILL.md +16 -0
  152. package/presets/openwrite/skills/review-chapter/SKILL.md +17 -0
  153. package/presets/openwrite/skills/revise-span/SKILL.md +16 -0
  154. package/presets/openwrite/skills/style-system/SKILL.md +135 -0
  155. package/presets/openwrite/skills/style-system/prompts/analyze_style.md +214 -0
  156. package/presets/openwrite/skills/style-system/prompts/batch_extract_style.md +66 -0
  157. package/presets/openwrite/skills/style-system/prompts/compose_style.md +83 -0
  158. package/presets/openwrite/skills/style-system/prompts/extract_style.md +84 -0
  159. package/presets/openwrite/skills/style-system/prompts/initialize_style.md +52 -0
  160. package/presets/openwrite/skills/style-system/templates/analysis_report.yaml +78 -0
  161. package/presets/openwrite/skills/style-system/templates/composed_style.md +96 -0
  162. package/presets/openwrite/skills/style-system/templates/extraction_report.yaml +80 -0
  163. package/presets/openwrite/skills/style-system/templates/fingerprint.yaml +61 -0
  164. package/presets/openwrite/skills/style-system/tools/README.md +33 -0
  165. package/presets/openwrite/skills/truth-validation/SKILL.md +119 -0
  166. package/presets/openwrite/skills/workflow-manager/SKILL.md +81 -0
  167. package/presets/openwrite/skills/world-query/SKILL.md +45 -0
  168. package/presets/openwrite/skills/write-next/SKILL.md +17 -0
  169. package/release/core-requirements.in +12 -0
  170. package/release/licenses/@deepseek-ai__cosmokit@1.8.3/LICENSE +21 -0
  171. package/release/licenses/@deepseek-ai__schemastery@3.18.2/LICENSE +21 -0
  172. package/release/licenses/@isaacs__fs-minipass@4.0.1/LICENSE +15 -0
  173. package/release/licenses/@standard-schema__spec@1.1.0/LICENSE +21 -0
  174. package/release/licenses/@types__d3-color@3.1.3/LICENSE +21 -0
  175. package/release/licenses/@types__d3-drag@3.0.7/LICENSE +21 -0
  176. package/release/licenses/@types__d3-interpolate@3.0.4/LICENSE +21 -0
  177. package/release/licenses/@types__d3-selection@3.0.11/LICENSE +21 -0
  178. package/release/licenses/@types__d3-transition@3.0.9/LICENSE +21 -0
  179. package/release/licenses/@types__d3-zoom@3.0.8/LICENSE +21 -0
  180. package/release/licenses/@xyflow__react@12.11.6/LICENSE +21 -0
  181. package/release/licenses/@xyflow__system@0.0.82/LICENSE +21 -0
  182. package/release/licenses/ajv-formats@3.0.1/LICENSE +21 -0
  183. package/release/licenses/ajv@8.20.0/LICENSE +22 -0
  184. package/release/licenses/chownr@3.0.0/LICENSE.md +63 -0
  185. package/release/licenses/classcat@5.0.5/LICENSE.md +7 -0
  186. package/release/licenses/commander@7.2.0/LICENSE +22 -0
  187. package/release/licenses/d3-array@3.2.4/LICENSE +13 -0
  188. package/release/licenses/d3-axis@3.0.0/LICENSE +13 -0
  189. package/release/licenses/d3-brush@3.0.0/LICENSE +13 -0
  190. package/release/licenses/d3-chord@3.0.1/LICENSE +13 -0
  191. package/release/licenses/d3-color@3.1.0/LICENSE +13 -0
  192. package/release/licenses/d3-contour@4.0.2/LICENSE +13 -0
  193. package/release/licenses/d3-delaunay@6.0.4/LICENSE +14 -0
  194. package/release/licenses/d3-dispatch@3.0.1/LICENSE +13 -0
  195. package/release/licenses/d3-drag@3.0.0/LICENSE +13 -0
  196. package/release/licenses/d3-dsv@3.0.1/LICENSE +13 -0
  197. package/release/licenses/d3-ease@3.0.1/LICENSE +28 -0
  198. package/release/licenses/d3-fetch@3.0.1/LICENSE +13 -0
  199. package/release/licenses/d3-force@3.0.0/LICENSE +13 -0
  200. package/release/licenses/d3-format@3.1.2/LICENSE +13 -0
  201. package/release/licenses/d3-geo@3.1.1/LICENSE +34 -0
  202. package/release/licenses/d3-hierarchy@3.1.2/LICENSE +13 -0
  203. package/release/licenses/d3-interpolate@3.0.1/LICENSE +13 -0
  204. package/release/licenses/d3-path@3.1.0/LICENSE +13 -0
  205. package/release/licenses/d3-polygon@3.0.1/LICENSE +13 -0
  206. package/release/licenses/d3-quadtree@3.0.1/LICENSE +13 -0
  207. package/release/licenses/d3-random@3.0.1/LICENSE +13 -0
  208. package/release/licenses/d3-scale-chromatic@3.1.0/LICENSE +28 -0
  209. package/release/licenses/d3-scale@4.0.2/LICENSE +13 -0
  210. package/release/licenses/d3-selection@3.0.0/LICENSE +13 -0
  211. package/release/licenses/d3-shape@3.2.0/LICENSE +13 -0
  212. package/release/licenses/d3-time-format@4.1.0/LICENSE +13 -0
  213. package/release/licenses/d3-time@3.1.0/LICENSE +13 -0
  214. package/release/licenses/d3-timer@3.0.1/LICENSE +13 -0
  215. package/release/licenses/d3-transition@3.0.1/LICENSE +13 -0
  216. package/release/licenses/d3-zoom@3.0.0/LICENSE +13 -0
  217. package/release/licenses/d3@7.9.0/LICENSE +13 -0
  218. package/release/licenses/delaunator@5.1.0/LICENSE +15 -0
  219. package/release/licenses/elkjs@0.12.0/LICENSE.md +263 -0
  220. package/release/licenses/fast-deep-equal@3.1.3/LICENSE +21 -0
  221. package/release/licenses/fast-uri@3.1.7/LICENSE +30 -0
  222. package/release/licenses/fflate@0.8.2/LICENSE +21 -0
  223. package/release/licenses/graceful-fs@4.2.11/LICENSE +15 -0
  224. package/release/licenses/iconv-lite@0.6.3/LICENSE +21 -0
  225. package/release/licenses/internmap@2.0.3/LICENSE +13 -0
  226. package/release/licenses/json-schema-traverse@1.0.0/LICENSE +21 -0
  227. package/release/licenses/lucide-react@0.468.0/LICENSE +15 -0
  228. package/release/licenses/minipass@7.1.3/LICENSE.md +55 -0
  229. package/release/licenses/minizlib@3.1.0/LICENSE +26 -0
  230. package/release/licenses/proper-lockfile@4.1.2/LICENSE +21 -0
  231. package/release/licenses/require-from-string@2.0.2/license +21 -0
  232. package/release/licenses/retry@0.12.0/License +21 -0
  233. package/release/licenses/robust-predicates@3.0.3/LICENSE +24 -0
  234. package/release/licenses/rw@1.3.3/LICENSE +26 -0
  235. package/release/licenses/safer-buffer@2.1.2/LICENSE +21 -0
  236. package/release/licenses/signal-exit@3.0.7/LICENSE.txt +16 -0
  237. package/release/licenses/tar@7.5.7/LICENSE.md +55 -0
  238. package/release/licenses/use-sync-external-store@1.6.0/LICENSE +21 -0
  239. package/release/licenses/yallist@5.0.0/LICENSE.md +63 -0
  240. package/release/licenses/zustand@4.5.7/LICENSE +21 -0
  241. package/release/openwrite-5.8.1-py3-none-any.whl +0 -0
  242. package/release/platform-overrides.in +5 -0
  243. package/release/python-constraints.in +96 -0
  244. package/release/requirements.lock +2927 -0
  245. package/release/runtime-manifest.json +98 -0
  246. package/release/sdk-compatibility.json +240 -0
  247. package/release/source.json +859 -0
  248. package/release/wheels/cryptography-50.0.1-cp312-abi3-macosx_13_0_x86_64.whl +0 -0
  249. package/release/wheels/licenses/LICENSE.txt +177 -0
  250. package/release/wheels/provenance.json +15 -0
  251. package/scripts/dog/delivery-stage.js +32 -0
  252. package/scripts/dog/import-chapter.js +20 -0
  253. package/scripts/dog/import-record.js +35 -0
  254. package/scripts/dog/review-dimension.js +41 -0
  255. package/scripts/dog/review-record.js +42 -0
  256. package/scripts/maintenance.mjs +179 -0
  257. package/scripts/prepare.mjs +21 -0
  258. package/vendor/dsh-dog/LICENSE +29 -0
  259. package/vendor/dsh-dog/README.md +114 -0
  260. package/vendor/dsh-dog/UPSTREAM.md +22 -0
  261. package/vendor/dsh-dog/cordis.patch.yml +14 -0
  262. package/vendor/dsh-dog/lib/client.js +2898 -0
  263. package/vendor/dsh-dog/lib/client.js.map +1 -0
  264. package/vendor/dsh-dog/lib/core-BiEBMLz3.d.ts +495 -0
  265. package/vendor/dsh-dog/lib/core-DdfMcrB4.js +2074 -0
  266. package/vendor/dsh-dog/lib/core.d.ts +2 -0
  267. package/vendor/dsh-dog/lib/core.js +2 -0
  268. package/vendor/dsh-dog/lib/index.d.ts +133 -0
  269. package/vendor/dsh-dog/lib/index.js +967 -0
  270. package/vendor/dsh-dog/package.json +97 -0
  271. package/vendor/dsh-dog/schemas/schema-0.2/graph.schema.json +139 -0
  272. package/vendor/dsh-dog/schemas/schema-0.2/report.schema.json +87 -0
  273. package/vendor/dsh-dog/schemas/schema-0.2/run.schema.json +259 -0
  274. package/vendor/dsh-dog/schemas/schema-0.2/runtime-event.schema.json +105 -0
  275. package/vendor/dsh-dog/schemas/schema-0.2/verification.schema.json +40 -0
@@ -0,0 +1,62 @@
1
+ import type { ConversationNodeDefinition } from '@deepseek-ai/dsh-client-ui-conversation/client';
2
+ import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
3
+ import type { StudioApiInjected } from './api.ts';
4
+ export interface NovelMutationItem {
5
+ callId: string;
6
+ tool: string;
7
+ label: string;
8
+ path: string;
9
+ status: 'succeeded' | 'partial' | 'failed' | 'refresh_failed' | 'proposed' | 'rejected';
10
+ errorCode: string;
11
+ historyVersionId: string;
12
+ revision: string;
13
+ sourceRevision: string;
14
+ resultRevision: string;
15
+ changes: readonly NovelEntityChange[];
16
+ previewToken: string;
17
+ undoPreviewToken: string;
18
+ traceId?: string;
19
+ tracePath?: string;
20
+ modelCallCount?: number;
21
+ traceRetentionDays?: number;
22
+ }
23
+ export interface NovelMutationValue {
24
+ kind: 'missing' | 'text' | 'boolean' | 'number' | 'null' | 'list' | 'object';
25
+ value: unknown;
26
+ preview: string;
27
+ truncated: boolean;
28
+ units: number;
29
+ sha256: string;
30
+ }
31
+ export interface NovelEntityChange {
32
+ changeId: string;
33
+ entityKind: string;
34
+ entityId: string;
35
+ path: string;
36
+ field: string;
37
+ before: NovelMutationValue;
38
+ after: NovelMutationValue;
39
+ sourceRevision: string;
40
+ resultRevision: string;
41
+ executionStatus: string;
42
+ }
43
+ export interface NovelMutationSummary {
44
+ items: readonly NovelMutationItem[];
45
+ }
46
+ interface MutationState {
47
+ turn: number;
48
+ calls: Readonly<Record<string, NovelMutationItem>>;
49
+ items: readonly NovelMutationItem[];
50
+ }
51
+ declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
52
+ interface ConversationTurnDataMap {
53
+ 'dsh-novel-mutations': NovelMutationSummary;
54
+ }
55
+ }
56
+ /** State-only durable event definition feeding the native Turn-tail summary. */
57
+ export declare const novelMutationDefinition: ConversationNodeDefinition<MutationState>;
58
+ type TurnSummaryProps = PropsRuntime<'conversation.chat.turnTail'> & PropsLocale<'studio-panel'> & Pick<StudioApiInjected, 'postStudioApi'> & {
59
+ matched: NovelMutationSummary;
60
+ };
61
+ export declare function TurnMutationSummaryView({ matched, openFile, postStudioApi, t }: TurnSummaryProps): import("react").JSX.Element;
62
+ export {};
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Vditor live (IR) body editor. The engine is vendored with this plugin and
3
+ * served by the dsh host at a same-origin route; Studio remains a headless
4
+ * domain backend and never supplies browser assets.
5
+ *
6
+ * Mirrors Studio's options: mode 'ir', lang zh_CN, cache off, dark theme
7
+ * mapped from the dsh shell's `body[data-ds-dark-theme]` (ui-theme's
8
+ * boot-theme contract) — classic when light, dark when dark, with a
9
+ * MutationObserver following live theme switches. Toolbar is Studio's
10
+ * compact subset plus headings/code/table (card-body scope).
11
+ */
12
+ import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
13
+ import { type ManuscriptSelection } from './manuscript-selection.ts';
14
+ import type { ManuscriptAnnotation } from './manuscript-annotations.ts';
15
+ /** The slice of the bundled Vditor API this editor uses. */
16
+ interface VditorInstance {
17
+ getValue: () => string;
18
+ getSelection?: () => string;
19
+ insertValue?: (value: string, render?: boolean) => void;
20
+ setTheme: (theme: string, contentTheme?: string, codeTheme?: string, contentThemePath?: string) => void;
21
+ destroy: () => void;
22
+ }
23
+ type VditorCtor = new (host: HTMLElement, options: Record<string, unknown>) => VditorInstance;
24
+ type TFunc = PropsLocale<'studio-panel'>['t'];
25
+ /**
26
+ * Attach Vditor's packaged CSS and resolve the constructor bundled into this
27
+ * plugin. Auxiliary language/theme assets continue to use the same-origin
28
+ * vendor route.
29
+ */
30
+ export declare function loadVditor(): Promise<VditorCtor>;
31
+ export type ManuscriptEditorApi = {
32
+ insertAtCaret: (markdown: string) => void;
33
+ revealQuote: (quote: string, start: number) => boolean;
34
+ };
35
+ interface VditorBodyProps {
36
+ /** Initial markdown (the editor is the source of truth afterwards). */
37
+ initial: string;
38
+ onChange: (value: string) => void;
39
+ onSelectionChange?: (selection: ManuscriptSelection | null) => void;
40
+ onReady?: () => void;
41
+ onFailed: () => void;
42
+ disabled: boolean;
43
+ /** The consumer can synchronously retain callbacks delivered during cleanup. */
44
+ flushOnLeave?: boolean;
45
+ annotations?: readonly ManuscriptAnnotation[];
46
+ onInsertMarker?: () => void;
47
+ onEditorApi?: (api: ManuscriptEditorApi | null) => void;
48
+ }
49
+ /** One Vditor IR instance bound to the shell theme; destroyed on unmount. */
50
+ export declare function VditorBody({ initial, onChange, onSelectionChange, onReady, onFailed, disabled, flushOnLeave, annotations, onInsertMarker, onEditorApi, }: VditorBodyProps): import("react").JSX.Element;
51
+ /** Loading line shown while the Vditor script is in flight. */
52
+ export declare function VditorLoading({ t }: {
53
+ t: TFunc;
54
+ }): import("react").JSX.Element;
55
+ export {};
@@ -0,0 +1,121 @@
1
+ export type ConnectionState = 'connecting' | 'online' | 'offline';
2
+ export type EditorStatus = 'idle' | 'loading' | 'saved' | 'dirty' | 'saving' | 'conflict' | 'offline';
3
+ export type ResourceKey = 'workspace' | 'manuscript' | 'outline' | 'assets' | 'tasks' | 'benchmark' | 'models' | 'dag' | 'graph' | 'research' | 'revisions';
4
+ /**
5
+ * The panel's Workspace identity (docs/WORKSPACE_CONTEXT_CONTRACT.md §9):
6
+ * `root` is the dsh Workspace's canonical absolute path — the only identity
7
+ * that matters for invalidate filtering; `workspaceId` is the UI/wire
8
+ * reference carried on every proxied request.
9
+ */
10
+ export interface WorkbenchContext {
11
+ workspaceId: string;
12
+ root: string;
13
+ sessionId?: string | undefined;
14
+ }
15
+ export interface ReviewSummary {
16
+ score: number | null;
17
+ passed: boolean | null;
18
+ issues: number;
19
+ issueDetails: readonly unknown[];
20
+ stale: boolean;
21
+ reviewedAt: string;
22
+ sourceRevision: string;
23
+ currentSourceRevision: string;
24
+ }
25
+ export interface ChapterSummary {
26
+ id: string;
27
+ /** Stable server identity when supplied. An empty value means path is the only available identity. */
28
+ documentId: string;
29
+ /** Stable position in canonical reading order. Repeated documents receive distinct occurrences. */
30
+ occurrenceId: string;
31
+ volumeId: string;
32
+ status: string;
33
+ path: string;
34
+ title: string;
35
+ subtitle: string;
36
+ revision: string;
37
+ readingIndex: number | null;
38
+ writingUnits: number | null;
39
+ updatedAt: string;
40
+ review: ReviewSummary;
41
+ }
42
+ export interface WritingProgress {
43
+ bookUnits: number;
44
+ bookTarget: number;
45
+ chapterTarget: number;
46
+ }
47
+ export interface WorkbenchSnapshot {
48
+ connection: ConnectionState;
49
+ /** Bound Workspace context; null = no Workspace bound, panel issues no proxied requests. */
50
+ context: WorkbenchContext | null;
51
+ /** Local generation counter, bumped on every context switch. */
52
+ contextEpoch: number;
53
+ /** Contract error code blocking this context (e.g. WORKSPACE_NOT_INITIALIZED), null when healthy. */
54
+ workspaceError: string | null;
55
+ projectTitle: string;
56
+ currentChapterId: string;
57
+ activeChapterPath: string;
58
+ chapters: readonly ChapterSummary[];
59
+ writingProgress: WritingProgress;
60
+ workspace: unknown;
61
+ tasks: unknown;
62
+ activeTasks: number;
63
+ editorStatus: EditorStatus;
64
+ editorMessage: string;
65
+ epochs: Readonly<Record<ResourceKey, number>>;
66
+ lastUpdatedAt: number;
67
+ }
68
+ type Listener = () => void;
69
+ declare class NovelWorkbenchStore {
70
+ private snapshot;
71
+ private readonly listeners;
72
+ private pollTimer;
73
+ private eventSource;
74
+ private refreshPromise;
75
+ private refreshController;
76
+ private taskSignature;
77
+ /** Raw tasks payload of the last committed refresh (terminal-diff baseline). */
78
+ private tasksPayload;
79
+ private revision;
80
+ private revisionInitialized;
81
+ /** Last seen upstream context_epoch (background-transition hint channel). */
82
+ private contextEpoch;
83
+ private contextEpochInitialized;
84
+ private pollTicks;
85
+ /** Context generation: every setContext bump invalidates in-flight work. */
86
+ private generation;
87
+ readonly subscribe: (listener: Listener) => (() => void);
88
+ readonly getSnapshot: () => WorkbenchSnapshot;
89
+ /**
90
+ * The context barrier (contract §9). A changed context: bumps the
91
+ * generation (late responses from the old generation are dropped on
92
+ * commit), resets every per-context slice back to INITIAL, aborts the
93
+ * in-flight refresh, closes the old SSE stream and poll timer, zeroes the
94
+ * revision/task baselines, rebinds the API layer's context headers, then
95
+ * reconnects and refreshes under the new Workspace. An identical context
96
+ * is a no-op; null stops everything and clears the panel.
97
+ */
98
+ setContext(next: WorkbenchContext | null): void;
99
+ setActiveChapter(path: string): void;
100
+ setEditorStatus(status: EditorStatus, message?: string): void;
101
+ invalidate(resource: ResourceKey): void;
102
+ refresh(): Promise<void>;
103
+ /**
104
+ * Two-layer sync. Layer one is the always-on 5s invalidation poll: it is
105
+ * the only channel that observes background task transitions, because the
106
+ * bridge merges the upstream context_epoch into invalidation.json and task
107
+ * transitions bump it without any bridge-local write. Layer two is SSE,
108
+ * the instant channel for proxied writes and agent mutations; its state
109
+ * never gates the poll loop.
110
+ */
111
+ private start;
112
+ private startPolling;
113
+ private consumeMutation;
114
+ private stop;
115
+ private pollInvalidation;
116
+ private refreshNow;
117
+ private patch;
118
+ }
119
+ export declare const workbenchStore: NovelWorkbenchStore;
120
+ export declare function useWorkbench(): WorkbenchSnapshot;
121
+ export {};
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Same-origin read path to the local OpenWrite Studio API through the host
3
+ * half's proxy route (registered by @dsh-novel/openwrite-bridge, see
4
+ * packages/openwrite-bridge domain.ts). Studio itself sends no CORS headers,
5
+ * so the browser can only reach it via this proxy.
6
+ *
7
+ * Workspace context (docs/WORKSPACE_CONTEXT_CONTRACT.md §2.2): the browser
8
+ * only ever sends the dsh workspace id (plus an optional session id for
9
+ * audit) — never a path. Every proxied request carries the context headers;
10
+ * with no context bound the panel must not issue proxied requests at all, so
11
+ * all three request helpers fail closed with WORKSPACE_CONTEXT_MISSING.
12
+ */
13
+ /** Host-half proxy prefix (kept in sync with openwrite-bridge domain.ts). */
14
+ export declare const API_PROXY_BASE = "/studio-panel/api";
15
+ /** Browser-side Workspace identity stamped onto every proxied request. */
16
+ export interface StudioContext {
17
+ workspaceId: string;
18
+ sessionId?: string | undefined;
19
+ }
20
+ /**
21
+ * Bind (or clear, with null) the Workspace context for all proxied requests.
22
+ * Owned by the WorkbenchStore context barrier — components never call this
23
+ * directly; they go through `workbenchStore.setContext`.
24
+ */
25
+ export declare function setStudioContext(next: StudioContext | null): void;
26
+ /** The currently bound Workspace context, or null when unbound. */
27
+ export declare function getStudioContext(): StudioContext | null;
28
+ /**
29
+ * Context headers for the contract's browser wire format. Throws a
30
+ * StudioApiError (code WORKSPACE_CONTEXT_MISSING) when no context is bound —
31
+ * fail closed, never fall back to a context-less request.
32
+ */
33
+ export declare function studioContextHeaders(): Record<string, string>;
34
+ /**
35
+ * Injected share of the data views (大纲 / 资产): JSON fetches against the
36
+ * Studio API. `postStudioApi` only reaches the host proxy's write allowlist
37
+ * (asset domain; see openwrite-bridge domain.ts WRITABLE_PATHS).
38
+ */
39
+ export interface StudioApiInjected {
40
+ fetchStudioApi: (path: string) => Promise<unknown>;
41
+ postStudioApi: (path: string, body: unknown) => Promise<unknown>;
42
+ putStudioApi: (path: string, body: unknown, context?: StudioContext) => Promise<unknown>;
43
+ }
44
+ /** A Studio API failure that keeps the HTTP status (409 = optimistic-lock conflict) and contract error code. */
45
+ export declare class StudioApiError extends Error {
46
+ readonly status: number;
47
+ readonly code: string | undefined;
48
+ readonly details: Readonly<Record<string, unknown>>;
49
+ constructor(message: string, status: number, code?: string, details?: Record<string, unknown>);
50
+ }
51
+ /**
52
+ * GET one Studio API path through the proxy and parse the JSON body. Throws
53
+ * a StudioApiError carrying the upstream status and message on any non-2xx
54
+ * answer (including the proxy's own 502 when Studio is down).
55
+ * @param path - Studio API path beginning with `/`, query string allowed
56
+ * (e.g. `/assets?kind=character`).
57
+ * @param signal - optional caller abort (context switches cancel in-flight reads).
58
+ * @returns the parsed JSON payload.
59
+ */
60
+ export declare function fetchStudioApi(path: string, signal?: AbortSignal): Promise<unknown>;
61
+ /**
62
+ * POST a JSON body to one allowlisted Studio API path through the proxy and
63
+ * parse the JSON response. Throws StudioApiError with the upstream status and
64
+ * message on any non-2xx answer (409 = revision conflict, surfaced by the
65
+ * asset editor as "reload and retry").
66
+ * @param path - allowlisted Studio API path (e.g. `/assets/update`).
67
+ * @param body - JSON-serializable request body, forwarded verbatim.
68
+ * @returns the parsed JSON payload.
69
+ */
70
+ export declare function postStudioApi(path: string, body: unknown): Promise<unknown>;
71
+ /** PUT a JSON body to one allowlisted Studio API path. */
72
+ export declare function putStudioApi(path: string, body: unknown, context?: StudioContext): Promise<unknown>;
@@ -0,0 +1,20 @@
1
+ import type { AssetEditorDraft, AssetEditorSource } from './AssetEditor.tsx';
2
+ export interface AssetDraftContext {
3
+ workspaceId: string;
4
+ root: string;
5
+ }
6
+ export interface AssetDraftIdentity extends AssetDraftContext {
7
+ kind: string;
8
+ id: string;
9
+ }
10
+ export interface AssetDraftRecord extends AssetDraftIdentity {
11
+ baseRevision: string;
12
+ source: AssetEditorSource;
13
+ draft: AssetEditorDraft;
14
+ }
15
+ export declare function readAssetDraft(identity: AssetDraftIdentity): AssetDraftRecord | null;
16
+ export declare function latestAssetDraft(context: AssetDraftContext): AssetDraftRecord | null;
17
+ export declare function writeAssetDraft(record: AssetDraftRecord): boolean;
18
+ export declare function removeAssetDraft(identity: AssetDraftIdentity): void;
19
+ /** A slow save from an unmounted editor must not erase a newer local draft. */
20
+ export declare function removeAssetDraftIfUnchanged(identity: AssetDraftIdentity, saved: AssetEditorDraft): void;
@@ -0,0 +1,43 @@
1
+ export type BenchmarkTaskType = 'chapter' | 'outline';
2
+ export type BenchmarkExecutionMode = 'framework' | 'creative';
3
+ export interface BenchmarkPipeline {
4
+ id: string;
5
+ executionMode: string;
6
+ nodes: {
7
+ id: string;
8
+ label: string;
9
+ dependsOn: string[];
10
+ }[];
11
+ reviewDomains: {
12
+ id: string;
13
+ label: string;
14
+ }[];
15
+ }
16
+ export interface BenchmarkOptions {
17
+ chapters: {
18
+ id: string;
19
+ title: string;
20
+ status: string;
21
+ hasManuscript: boolean;
22
+ available: boolean;
23
+ reason: string;
24
+ }[];
25
+ nextChapterId: string;
26
+ defaultOutlineStart: number;
27
+ outlineStartMin: number;
28
+ outlineStartMax: number;
29
+ outlineCountMax: number;
30
+ tasks: {
31
+ taskType: BenchmarkTaskType;
32
+ executionModes: string[];
33
+ pipelines: BenchmarkPipeline[];
34
+ readiness: {
35
+ ok: boolean;
36
+ code: string;
37
+ message: string;
38
+ };
39
+ }[];
40
+ }
41
+ export declare function parseBenchmarkPipeline(value: unknown): BenchmarkPipeline | null;
42
+ export declare function parseBenchmarkOptions(value: unknown): BenchmarkOptions;
43
+ export declare function positiveInteger(value: string): number | null;
@@ -0,0 +1,26 @@
1
+ /** IndexedDB-backed recovery drafts for manuscript documents. */
2
+ export declare const MANUSCRIPT_DRAFT_FORMAT_VERSION: 1;
3
+ export interface ManuscriptDraftIdentity {
4
+ workspaceId: string;
5
+ novelId: string;
6
+ path: string;
7
+ }
8
+ export interface ManuscriptDraftRecord extends ManuscriptDraftIdentity {
9
+ key: string;
10
+ formatVersion: typeof MANUSCRIPT_DRAFT_FORMAT_VERSION;
11
+ baseRevision: string;
12
+ content: string;
13
+ updatedAt: number;
14
+ }
15
+ export interface ManuscriptDraftStore {
16
+ load: (identity: ManuscriptDraftIdentity) => Promise<ManuscriptDraftRecord | null>;
17
+ save: (record: ManuscriptDraftRecord) => Promise<void>;
18
+ remove: (identity: ManuscriptDraftIdentity) => Promise<void>;
19
+ removeIfContent: (identity: ManuscriptDraftIdentity, content: string) => Promise<boolean>;
20
+ }
21
+ export declare class ManuscriptDraftStorageError extends Error {
22
+ constructor(message: string, options?: ErrorOptions);
23
+ }
24
+ export declare function manuscriptDraftKey(identity: ManuscriptDraftIdentity): string;
25
+ export declare function manuscriptNovelId(workspacePayload: unknown, path: string): string;
26
+ export declare const manuscriptDraftStore: ManuscriptDraftStore;