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.
- package/LICENSE +201 -0
- package/README.md +107 -0
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/assets/logo-dark.svg +31 -0
- package/assets/logo-light.svg +31 -0
- package/cordis.patch.yml +11 -0
- package/docs/BENCHMARK_TASKS.md +54 -0
- package/docs/COST_MEASUREMENT.md +39 -0
- package/docs/DEVELOPMENT.md +65 -0
- package/docs/DSH_STORE.md +58 -0
- package/docs/FRAMEWORK_ADVANTAGES.md +288 -0
- package/docs/IMPROVEMENT_PLAN.md +252 -0
- package/docs/INSTALL.md +99 -0
- package/docs/LEARNING.md +68 -0
- package/docs/OPEN_SOURCE_NOVEL_AUDIT.md +191 -0
- package/docs/PLUGIN_MAINTENANCE.md +54 -0
- package/docs/PLUGIN_MAINTENANCE_RC7.md +157 -0
- package/docs/QA_20260908.md +103 -0
- package/docs/QA_20260909_BENCHMARK.md +24 -0
- package/docs/RELEASE_ACCEPTANCE.md +116 -0
- package/docs/REVIEW_DAG_FRAMEWORK.md +82 -0
- package/docs/TARGETED_NOVEL_PROJECT_REVIEW.md +167 -0
- package/docs/WORKFLOWS.md +74 -0
- package/docs/WORKSPACE_CONTEXT_CONTRACT.md +125 -0
- package/docs/WORKSPACE_INTEGRATION_GOAL.md +278 -0
- package/docs/research/autosave-race-repro.mjs +133 -0
- package/docs/research/framework-stats-2026-09-05.json +116 -0
- package/dog-tools.mjs +11 -0
- package/package.json +132 -0
- package/packages/openwrite-bridge/LICENSE +201 -0
- package/packages/openwrite-bridge/cordis.patch.yml +10 -0
- package/packages/openwrite-bridge/lib/client.d.ts +95 -0
- package/packages/openwrite-bridge/lib/client.js +193 -0
- package/packages/openwrite-bridge/lib/contracts-generated.d.ts +367 -0
- package/packages/openwrite-bridge/lib/contracts-generated.js +1764 -0
- package/packages/openwrite-bridge/lib/dog-delivery.d.ts +12 -0
- package/packages/openwrite-bridge/lib/dog-delivery.js +362 -0
- package/packages/openwrite-bridge/lib/dog-review.d.ts +50 -0
- package/packages/openwrite-bridge/lib/dog-review.js +470 -0
- package/packages/openwrite-bridge/lib/domain.d.ts +70 -0
- package/packages/openwrite-bridge/lib/domain.js +496 -0
- package/packages/openwrite-bridge/lib/index.d.ts +17 -0
- package/packages/openwrite-bridge/lib/index.js +89 -0
- package/packages/openwrite-bridge/lib/managed-runtime.d.ts +95 -0
- package/packages/openwrite-bridge/lib/managed-runtime.js +510 -0
- package/packages/openwrite-bridge/lib/preset-tools.d.ts +13 -0
- package/packages/openwrite-bridge/lib/preset-tools.js +18 -0
- package/packages/openwrite-bridge/lib/tool-policy.d.ts +6 -0
- package/packages/openwrite-bridge/lib/tool-policy.js +56 -0
- package/packages/openwrite-bridge/lib/tools.d.ts +24 -0
- package/packages/openwrite-bridge/lib/tools.js +2404 -0
- package/packages/openwrite-bridge/package.json +67 -0
- package/packages/studio-panel/LICENSE +21 -0
- package/packages/studio-panel/README.md +51 -0
- package/packages/studio-panel/cordis.patch.yml +5 -0
- package/packages/studio-panel/lib/client.js +158087 -0
- package/packages/studio-panel/lib/client.js.map +1 -0
- package/packages/studio-panel/lib/index.js +50 -0
- package/packages/studio-panel/lib/types/client/AssetEditor.d.ts +122 -0
- package/packages/studio-panel/lib/types/client/AssetsView.d.ts +43 -0
- package/packages/studio-panel/lib/types/client/BenchmarkView.d.ts +9 -0
- package/packages/studio-panel/lib/types/client/ContinuousReader.d.ts +13 -0
- package/packages/studio-panel/lib/types/client/CreationView.d.ts +6 -0
- package/packages/studio-panel/lib/types/client/DagCanvas.d.ts +11 -0
- package/packages/studio-panel/lib/types/client/DiscardDraftDialog.d.ts +8 -0
- package/packages/studio-panel/lib/types/client/DomainToolCard.d.ts +9 -0
- package/packages/studio-panel/lib/types/client/GraphView.d.ts +46 -0
- package/packages/studio-panel/lib/types/client/HeaderChrome.d.ts +18 -0
- package/packages/studio-panel/lib/types/client/LaunchOpenWrite.d.ts +13 -0
- package/packages/studio-panel/lib/types/client/LibraryView.d.ts +6 -0
- package/packages/studio-panel/lib/types/client/MarkdownText.d.ts +3 -0
- package/packages/studio-panel/lib/types/client/ModelView.d.ts +9 -0
- package/packages/studio-panel/lib/types/client/OperationsView.d.ts +6 -0
- package/packages/studio-panel/lib/types/client/OutlinePlans.d.ts +37 -0
- package/packages/studio-panel/lib/types/client/OutlineView.d.ts +29 -0
- package/packages/studio-panel/lib/types/client/ResearchView.d.ts +7 -0
- package/packages/studio-panel/lib/types/client/ReviewCard.d.ts +28 -0
- package/packages/studio-panel/lib/types/client/SceneWorkbench.d.ts +55 -0
- package/packages/studio-panel/lib/types/client/SearchView.d.ts +33 -0
- package/packages/studio-panel/lib/types/client/TasksView.d.ts +11 -0
- package/packages/studio-panel/lib/types/client/TransferWorkspaces.d.ts +19 -0
- package/packages/studio-panel/lib/types/client/TurnMutationSummary.d.ts +62 -0
- package/packages/studio-panel/lib/types/client/VditorBody.d.ts +55 -0
- package/packages/studio-panel/lib/types/client/WorkbenchStore.d.ts +121 -0
- package/packages/studio-panel/lib/types/client/api.d.ts +72 -0
- package/packages/studio-panel/lib/types/client/asset-drafts.d.ts +20 -0
- package/packages/studio-panel/lib/types/client/benchmark-options.d.ts +43 -0
- package/packages/studio-panel/lib/types/client/draft-store.d.ts +26 -0
- package/packages/studio-panel/lib/types/client/dto.d.ts +517 -0
- package/packages/studio-panel/lib/types/client/index.d.ts +4 -0
- package/packages/studio-panel/lib/types/client/locales.d.ts +15 -0
- package/packages/studio-panel/lib/types/client/manuscript-annotations.d.ts +59 -0
- package/packages/studio-panel/lib/types/client/manuscript-markers.d.ts +61 -0
- package/packages/studio-panel/lib/types/client/manuscript-mentions.d.ts +30 -0
- package/packages/studio-panel/lib/types/client/manuscript-overlay-dom.d.ts +7 -0
- package/packages/studio-panel/lib/types/client/manuscript-overlay.d.ts +42 -0
- package/packages/studio-panel/lib/types/client/manuscript-selection.d.ts +59 -0
- package/packages/studio-panel/lib/types/client/model-view-memory.d.ts +17 -0
- package/packages/studio-panel/lib/types/client/storage.d.ts +8 -0
- package/packages/studio-panel/lib/types/client/workbench-epochs.d.ts +16 -0
- package/packages/studio-panel/lib/types/client/workspace-context.d.ts +52 -0
- package/packages/studio-panel/lib/types/client/writing-scope.d.ts +7 -0
- package/packages/studio-panel/lib/types/index.d.ts +5 -0
- package/packages/studio-panel/package.json +105 -0
- package/packages/studio-panel/vendor/vditor/LICENSE +21 -0
- package/packages/studio-panel/vendor/vditor/dist/css/content-theme/dark.css +123 -0
- package/packages/studio-panel/vendor/vditor/dist/css/content-theme/light.css +101 -0
- package/packages/studio-panel/vendor/vditor/dist/index.css +1823 -0
- package/packages/studio-panel/vendor/vditor/dist/index.min.js +1 -0
- package/packages/studio-panel/vendor/vditor/dist/js/i18n/zh_CN.js +86 -0
- package/packages/studio-panel/vendor/vditor/dist/js/icons/ant.js +174 -0
- package/packages/studio-panel/vendor/vditor/dist/js/lute/lute.min.js +72 -0
- package/plugin.d.ts +3 -0
- package/plugin.mjs +80 -0
- package/presets/README.md +32 -0
- package/presets/openwrite/agent.cordis.yml +317 -0
- package/presets/openwrite/preset.yml +3 -0
- package/presets/openwrite/skills/canon/SKILL.md +15 -0
- package/presets/openwrite/skills/dialoguequality/SKILL.md +166 -0
- package/presets/openwrite/skills/dog-delivery-query/SKILL.md +40 -0
- package/presets/openwrite/skills/dog-import-query/SKILL.md +27 -0
- package/presets/openwrite/skills/dog-review-query/SKILL.md +40 -0
- package/presets/openwrite/skills/export-book/SKILL.md +14 -0
- package/presets/openwrite/skills/foreshadow/SKILL.md +14 -0
- package/presets/openwrite/skills/foreshadowing-system/SKILL.md +125 -0
- package/presets/openwrite/skills/learn/SKILL.md +24 -0
- package/presets/openwrite/skills/novel-creator/SKILL.md +88 -0
- package/presets/openwrite/skills/novel-creator/templates/beat_templates.yaml +179 -0
- package/presets/openwrite/skills/novel-creator/templates/example_usage.yaml +74 -0
- package/presets/openwrite/skills/novel-reviewer/SKILL.md +85 -0
- package/presets/openwrite/skills/oh-story-deslop/LICENSE +21 -0
- package/presets/openwrite/skills/oh-story-deslop/SKILL.md +36 -0
- package/presets/openwrite/skills/oh-story-deslop/agents/openai.yaml +4 -0
- package/presets/openwrite/skills/oh-story-deslop/references/method.md +22 -0
- package/presets/openwrite/skills/oh-story-long-analyze/LICENSE +21 -0
- package/presets/openwrite/skills/oh-story-long-analyze/SKILL.md +37 -0
- package/presets/openwrite/skills/oh-story-long-analyze/agents/openai.yaml +4 -0
- package/presets/openwrite/skills/oh-story-long-analyze/references/method.md +22 -0
- package/presets/openwrite/skills/oh-story-long-scan/LICENSE +21 -0
- package/presets/openwrite/skills/oh-story-long-scan/SKILL.md +36 -0
- package/presets/openwrite/skills/oh-story-long-scan/agents/openai.yaml +4 -0
- package/presets/openwrite/skills/oh-story-long-scan/references/method.md +21 -0
- package/presets/openwrite/skills/oh-story-long-write/LICENSE +21 -0
- package/presets/openwrite/skills/oh-story-long-write/SKILL.md +37 -0
- package/presets/openwrite/skills/oh-story-long-write/agents/openai.yaml +4 -0
- package/presets/openwrite/skills/oh-story-long-write/references/method.md +33 -0
- package/presets/openwrite/skills/oh-story-review/LICENSE +21 -0
- package/presets/openwrite/skills/oh-story-review/SKILL.md +36 -0
- package/presets/openwrite/skills/oh-story-review/agents/openai.yaml +4 -0
- package/presets/openwrite/skills/oh-story-review/references/method.md +25 -0
- package/presets/openwrite/skills/progress/SKILL.md +16 -0
- package/presets/openwrite/skills/review-chapter/SKILL.md +17 -0
- package/presets/openwrite/skills/revise-span/SKILL.md +16 -0
- package/presets/openwrite/skills/style-system/SKILL.md +135 -0
- package/presets/openwrite/skills/style-system/prompts/analyze_style.md +214 -0
- package/presets/openwrite/skills/style-system/prompts/batch_extract_style.md +66 -0
- package/presets/openwrite/skills/style-system/prompts/compose_style.md +83 -0
- package/presets/openwrite/skills/style-system/prompts/extract_style.md +84 -0
- package/presets/openwrite/skills/style-system/prompts/initialize_style.md +52 -0
- package/presets/openwrite/skills/style-system/templates/analysis_report.yaml +78 -0
- package/presets/openwrite/skills/style-system/templates/composed_style.md +96 -0
- package/presets/openwrite/skills/style-system/templates/extraction_report.yaml +80 -0
- package/presets/openwrite/skills/style-system/templates/fingerprint.yaml +61 -0
- package/presets/openwrite/skills/style-system/tools/README.md +33 -0
- package/presets/openwrite/skills/truth-validation/SKILL.md +119 -0
- package/presets/openwrite/skills/workflow-manager/SKILL.md +81 -0
- package/presets/openwrite/skills/world-query/SKILL.md +45 -0
- package/presets/openwrite/skills/write-next/SKILL.md +17 -0
- package/release/core-requirements.in +12 -0
- package/release/licenses/@deepseek-ai__cosmokit@1.8.3/LICENSE +21 -0
- package/release/licenses/@deepseek-ai__schemastery@3.18.2/LICENSE +21 -0
- package/release/licenses/@isaacs__fs-minipass@4.0.1/LICENSE +15 -0
- package/release/licenses/@standard-schema__spec@1.1.0/LICENSE +21 -0
- package/release/licenses/@types__d3-color@3.1.3/LICENSE +21 -0
- package/release/licenses/@types__d3-drag@3.0.7/LICENSE +21 -0
- package/release/licenses/@types__d3-interpolate@3.0.4/LICENSE +21 -0
- package/release/licenses/@types__d3-selection@3.0.11/LICENSE +21 -0
- package/release/licenses/@types__d3-transition@3.0.9/LICENSE +21 -0
- package/release/licenses/@types__d3-zoom@3.0.8/LICENSE +21 -0
- package/release/licenses/@xyflow__react@12.11.6/LICENSE +21 -0
- package/release/licenses/@xyflow__system@0.0.82/LICENSE +21 -0
- package/release/licenses/ajv-formats@3.0.1/LICENSE +21 -0
- package/release/licenses/ajv@8.20.0/LICENSE +22 -0
- package/release/licenses/chownr@3.0.0/LICENSE.md +63 -0
- package/release/licenses/classcat@5.0.5/LICENSE.md +7 -0
- package/release/licenses/commander@7.2.0/LICENSE +22 -0
- package/release/licenses/d3-array@3.2.4/LICENSE +13 -0
- package/release/licenses/d3-axis@3.0.0/LICENSE +13 -0
- package/release/licenses/d3-brush@3.0.0/LICENSE +13 -0
- package/release/licenses/d3-chord@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-color@3.1.0/LICENSE +13 -0
- package/release/licenses/d3-contour@4.0.2/LICENSE +13 -0
- package/release/licenses/d3-delaunay@6.0.4/LICENSE +14 -0
- package/release/licenses/d3-dispatch@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-drag@3.0.0/LICENSE +13 -0
- package/release/licenses/d3-dsv@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-ease@3.0.1/LICENSE +28 -0
- package/release/licenses/d3-fetch@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-force@3.0.0/LICENSE +13 -0
- package/release/licenses/d3-format@3.1.2/LICENSE +13 -0
- package/release/licenses/d3-geo@3.1.1/LICENSE +34 -0
- package/release/licenses/d3-hierarchy@3.1.2/LICENSE +13 -0
- package/release/licenses/d3-interpolate@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-path@3.1.0/LICENSE +13 -0
- package/release/licenses/d3-polygon@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-quadtree@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-random@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-scale-chromatic@3.1.0/LICENSE +28 -0
- package/release/licenses/d3-scale@4.0.2/LICENSE +13 -0
- package/release/licenses/d3-selection@3.0.0/LICENSE +13 -0
- package/release/licenses/d3-shape@3.2.0/LICENSE +13 -0
- package/release/licenses/d3-time-format@4.1.0/LICENSE +13 -0
- package/release/licenses/d3-time@3.1.0/LICENSE +13 -0
- package/release/licenses/d3-timer@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-transition@3.0.1/LICENSE +13 -0
- package/release/licenses/d3-zoom@3.0.0/LICENSE +13 -0
- package/release/licenses/d3@7.9.0/LICENSE +13 -0
- package/release/licenses/delaunator@5.1.0/LICENSE +15 -0
- package/release/licenses/elkjs@0.12.0/LICENSE.md +263 -0
- package/release/licenses/fast-deep-equal@3.1.3/LICENSE +21 -0
- package/release/licenses/fast-uri@3.1.7/LICENSE +30 -0
- package/release/licenses/fflate@0.8.2/LICENSE +21 -0
- package/release/licenses/graceful-fs@4.2.11/LICENSE +15 -0
- package/release/licenses/iconv-lite@0.6.3/LICENSE +21 -0
- package/release/licenses/internmap@2.0.3/LICENSE +13 -0
- package/release/licenses/json-schema-traverse@1.0.0/LICENSE +21 -0
- package/release/licenses/lucide-react@0.468.0/LICENSE +15 -0
- package/release/licenses/minipass@7.1.3/LICENSE.md +55 -0
- package/release/licenses/minizlib@3.1.0/LICENSE +26 -0
- package/release/licenses/proper-lockfile@4.1.2/LICENSE +21 -0
- package/release/licenses/require-from-string@2.0.2/license +21 -0
- package/release/licenses/retry@0.12.0/License +21 -0
- package/release/licenses/robust-predicates@3.0.3/LICENSE +24 -0
- package/release/licenses/rw@1.3.3/LICENSE +26 -0
- package/release/licenses/safer-buffer@2.1.2/LICENSE +21 -0
- package/release/licenses/signal-exit@3.0.7/LICENSE.txt +16 -0
- package/release/licenses/tar@7.5.7/LICENSE.md +55 -0
- package/release/licenses/use-sync-external-store@1.6.0/LICENSE +21 -0
- package/release/licenses/yallist@5.0.0/LICENSE.md +63 -0
- package/release/licenses/zustand@4.5.7/LICENSE +21 -0
- package/release/openwrite-5.8.1-py3-none-any.whl +0 -0
- package/release/platform-overrides.in +5 -0
- package/release/python-constraints.in +96 -0
- package/release/requirements.lock +2927 -0
- package/release/runtime-manifest.json +98 -0
- package/release/sdk-compatibility.json +240 -0
- package/release/source.json +859 -0
- package/release/wheels/cryptography-50.0.1-cp312-abi3-macosx_13_0_x86_64.whl +0 -0
- package/release/wheels/licenses/LICENSE.txt +177 -0
- package/release/wheels/provenance.json +15 -0
- package/scripts/dog/delivery-stage.js +32 -0
- package/scripts/dog/import-chapter.js +20 -0
- package/scripts/dog/import-record.js +35 -0
- package/scripts/dog/review-dimension.js +41 -0
- package/scripts/dog/review-record.js +42 -0
- package/scripts/maintenance.mjs +179 -0
- package/scripts/prepare.mjs +21 -0
- package/vendor/dsh-dog/LICENSE +29 -0
- package/vendor/dsh-dog/README.md +114 -0
- package/vendor/dsh-dog/UPSTREAM.md +22 -0
- package/vendor/dsh-dog/cordis.patch.yml +14 -0
- package/vendor/dsh-dog/lib/client.js +2898 -0
- package/vendor/dsh-dog/lib/client.js.map +1 -0
- package/vendor/dsh-dog/lib/core-BiEBMLz3.d.ts +495 -0
- package/vendor/dsh-dog/lib/core-DdfMcrB4.js +2074 -0
- package/vendor/dsh-dog/lib/core.d.ts +2 -0
- package/vendor/dsh-dog/lib/core.js +2 -0
- package/vendor/dsh-dog/lib/index.d.ts +133 -0
- package/vendor/dsh-dog/lib/index.js +967 -0
- package/vendor/dsh-dog/package.json +97 -0
- package/vendor/dsh-dog/schemas/schema-0.2/graph.schema.json +139 -0
- package/vendor/dsh-dog/schemas/schema-0.2/report.schema.json +87 -0
- package/vendor/dsh-dog/schemas/schema-0.2/run.schema.json +259 -0
- package/vendor/dsh-dog/schemas/schema-0.2/runtime-event.schema.json +105 -0
- package/vendor/dsh-dog/schemas/schema-0.2/verification.schema.json +40 -0
package/plugin.d.ts
ADDED
package/plugin.mjs
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { cp, lstat, mkdir, readFile, readdir, rename, rm, writeFile } from 'node:fs/promises'
|
|
2
|
+
import { createHash, randomUUID } from 'node:crypto'
|
|
3
|
+
import { lock } from 'proper-lockfile'
|
|
4
|
+
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths'
|
|
5
|
+
import { join } from 'node:path'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
|
|
8
|
+
export const name = 'dsh-openwrite'
|
|
9
|
+
|
|
10
|
+
async function digestTree(dir) {
|
|
11
|
+
const hash = createHash('sha256')
|
|
12
|
+
async function visit(path, prefix = '') {
|
|
13
|
+
for (const entry of (await readdir(path, { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
14
|
+
if (entry.name === '.openwrite-managed.json') continue
|
|
15
|
+
const key = prefix + entry.name
|
|
16
|
+
hash.update(key)
|
|
17
|
+
if (entry.isDirectory()) await visit(join(path, entry.name), key + '/')
|
|
18
|
+
else hash.update(await readFile(join(path, entry.name)))
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
await visit(dir)
|
|
22
|
+
return hash.digest('hex')
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** A versioned preset leaves existing authored copies and session identities alone. */
|
|
26
|
+
export async function apply(ctx) {
|
|
27
|
+
const home = resolveDshHome()
|
|
28
|
+
const source = fileURLToPath(new URL('./presets/openwrite/', import.meta.url))
|
|
29
|
+
const version = JSON.parse(await readFile(new URL('./package.json', import.meta.url), 'utf8')).version
|
|
30
|
+
const id = `openwrite-${version.replace(/[^a-z0-9-]/g, '-')}`
|
|
31
|
+
const destination = join(home, '.agent-presets', id)
|
|
32
|
+
const managedRoot = join(home, 'openwrite')
|
|
33
|
+
const leases = join(managedRoot, 'preset-leases', id)
|
|
34
|
+
await mkdir(leases, { recursive: true })
|
|
35
|
+
await mkdir(join(home, '.agent-presets'), { recursive: true })
|
|
36
|
+
const lease = join(leases, `${process.pid}-${randomUUID()}.json`)
|
|
37
|
+
const withLock = async operation => {
|
|
38
|
+
const release = await lock(leases, { realpath: false, stale: 30_000, retries: { retries: 30, minTimeout: 100, maxTimeout: 500 } })
|
|
39
|
+
try { return await operation() } finally { await release() }
|
|
40
|
+
}
|
|
41
|
+
const expected = await digestTree(source)
|
|
42
|
+
const marker = join(destination, '.openwrite-managed.json')
|
|
43
|
+
await withLock(async () => {
|
|
44
|
+
const existing = await readFile(marker, 'utf8').then(JSON.parse).catch(() => null)
|
|
45
|
+
if (existing && (existing.source !== expected || existing.tree !== await digestTree(destination))) {
|
|
46
|
+
throw new Error(`OpenWrite preset ${id} was modified; copy it to a custom preset before reinstalling this version`)
|
|
47
|
+
}
|
|
48
|
+
if (!existing) {
|
|
49
|
+
if (await lstat(destination).then(() => true).catch(error => { if (error.code === 'ENOENT') return false; throw error })) {
|
|
50
|
+
throw new Error(`OpenWrite preset ${id} already exists without an ownership marker; preserve it under a custom preset name first`)
|
|
51
|
+
}
|
|
52
|
+
const staging = join(managedRoot, 'preset-' + randomUUID())
|
|
53
|
+
await mkdir(staging, { recursive: true })
|
|
54
|
+
try {
|
|
55
|
+
await cp(source, staging, { recursive: true })
|
|
56
|
+
await writeFile(join(staging, '.openwrite-managed.json'), JSON.stringify({ source: expected, tree: expected, version }))
|
|
57
|
+
await rename(staging, destination)
|
|
58
|
+
} finally { await rm(staging, { recursive: true, force: true }) }
|
|
59
|
+
}
|
|
60
|
+
await writeFile(lease, JSON.stringify({ pid: process.pid }), { mode: 0o600 })
|
|
61
|
+
})
|
|
62
|
+
// Preset files are package-managed UI entries. Remove only our unmodified
|
|
63
|
+
// copy after its last live host stops; authored copies and session logs remain.
|
|
64
|
+
ctx.effect(() => async () => withLock(async () => {
|
|
65
|
+
await rm(lease, { force: true })
|
|
66
|
+
for (const entry of await readdir(leases)) {
|
|
67
|
+
const file = join(leases, entry)
|
|
68
|
+
try {
|
|
69
|
+
const record = JSON.parse(await readFile(file, 'utf8'))
|
|
70
|
+
try { process.kill(record.pid, 0) }
|
|
71
|
+
catch (error) { if (error.code === 'ESRCH') await rm(file, { force: true }) }
|
|
72
|
+
} catch { /* unknown files never grant deletion authority */ }
|
|
73
|
+
}
|
|
74
|
+
if ((await readdir(leases)).length !== 0) return
|
|
75
|
+
const owned = await readFile(marker, 'utf8').then(JSON.parse).catch(() => null)
|
|
76
|
+
if (owned?.source === expected && owned.tree === await digestTree(destination).catch(() => null)) {
|
|
77
|
+
await rm(destination, { recursive: true })
|
|
78
|
+
}
|
|
79
|
+
}))
|
|
80
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# dsh agent 预设:OpenWrite 创作
|
|
2
|
+
|
|
3
|
+
本目录存放 dsh-Openwrite 的 OpenWrite 创作 agent 预设,把原先的 Goethe 规划与 Dante
|
|
4
|
+
写作职责合并到一个长期会话中。
|
|
5
|
+
|
|
6
|
+
## 预设说明
|
|
7
|
+
|
|
8
|
+
- `openwrite/`(OpenWrite 创作,order 10):统一的长期会话 Agent。按项目阶段在
|
|
9
|
+
规划、资产维护、正文写作、评审与修订之间切换;所有写入仍走预览/确认门控。
|
|
10
|
+
|
|
11
|
+
统一预设以 dsh shipped `standard` 预设的组合为基座(保留文件/Shell/检索/
|
|
12
|
+
todo/plan/compaction/委派能力),叠加:
|
|
13
|
+
|
|
14
|
+
- persona 行(`@deepseek-ai/dsh-persona`,移植自 OpenWrite 的
|
|
15
|
+
`DEFAULT_GOETHE_SYSTEM_PROMPT` / `DEFAULT_DANTE_SYSTEM_PROMPT`,
|
|
16
|
+
大纲写入契约、内联批注契约、角色文档契约已内联全文);
|
|
17
|
+
- host profile 统一挂载的 `openwrite-bridge`(`@dsh-novel/openwrite-bridge`,注册
|
|
18
|
+
`novel_*` 工具);它不再重复写入每个 preset,否则会触发 `novelDomain` 服务冲突;
|
|
19
|
+
- `skill-filesystem` 的 `customSkillDirs` 指向预设自带的 `skills/` 目录
|
|
20
|
+
(`!!js new URL('skills/', baseUrl)` 写法,预设被复制后仍能解析);
|
|
21
|
+
斜杠菜单只保留作者入口(`progress` 看进度、`write-next` 写下一章、
|
|
22
|
+
`review-chapter` 审这一章、`revise-span` 改这段、`foreshadow` 查伏笔、
|
|
23
|
+
`canon` 查设定、`learn` 写法记忆、`export-book` 导出),其余技能 `user-invocable: false`。
|
|
24
|
+
|
|
25
|
+
## 安装与修改
|
|
26
|
+
|
|
27
|
+
预设由 `scripts/install.sh` 复制到 dsh 的用户预设根 `~/.dsh/.agent-presets/`。
|
|
28
|
+
dsh 预设是 **copy-only** 语义:安装后请在**本仓库**里修改,再重新运行
|
|
29
|
+
`scripts/install.sh` 安装;不要直接编辑 `~/.dsh/.agent-presets/` 下的副本。
|
|
30
|
+
会话已产生内容后不能切换预设,改动对新会话生效。
|
|
31
|
+
|
|
32
|
+
`openwrite/skills/` 是原 Goethe/Dante 技能的并集副本(非符号链接),保证复制安装后自包含。
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# The `openwrite` agent preset: OpenWrite 全流程创作 Agent(长期会话),合并
|
|
2
|
+
# 原 Goethe 规划与 Dante 写作职责。组合结构以 dsh shipped `standard` 预设为基座,
|
|
3
|
+
# 使用 host profile 已注册的 openwrite-bridge(novel_* 工具)和本预设自带的技能目录。
|
|
4
|
+
#
|
|
5
|
+
# 规则提醒(来自 dsh agent-presets README):任何发布服务的行必须放在带
|
|
6
|
+
# `isolate` realm 的 cordis:group 内;本文件中的 planning/compaction/delegation
|
|
7
|
+
# 分组原样沿用 standard 的写法。persona / skill 等行只向注册表登记,
|
|
8
|
+
# 不发布服务,无需 realm。
|
|
9
|
+
|
|
10
|
+
# ── identity ────────────────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
# 预设自己的 persona,遮蔽部署默认 persona(complete 默认 false,叠加在
|
|
13
|
+
# harness 身份开场之上,与 standard 预设的用法一致)。
|
|
14
|
+
- id: persona
|
|
15
|
+
name: '@deepseek-ai/dsh-persona'
|
|
16
|
+
config:
|
|
17
|
+
text: &openwrite_persona |-
|
|
18
|
+
你是 OpenWrite 创作 Agent,运行在 DeepSeek Harness(dsh)的统一 OpenWrite 预设中。
|
|
19
|
+
你通过 openwrite-bridge 插件提供的 novel_* 工具读写 OpenWrite 小说项目
|
|
20
|
+
(底层走 OpenWrite Studio 的 HTTP 动作面),同时保留 dsh 的文件、Shell、检索等基础能力。
|
|
21
|
+
|
|
22
|
+
你同时承担规划与正文创作职责。根据项目阶段在“规划模式”和“写作模式”之间切换,
|
|
23
|
+
不要求用户切换会话或 Agent。领域读写只用 openwrite-bridge 的 novel_* 工具,
|
|
24
|
+
不另建进度、伏笔或设定存储。
|
|
25
|
+
|
|
26
|
+
默认工作流与作者入口(斜杠命令与口语同义):
|
|
27
|
+
- /progress 看进度
|
|
28
|
+
- /write-next 写下一章
|
|
29
|
+
- /review-chapter 审这一章
|
|
30
|
+
- /revise-span 改这段
|
|
31
|
+
- /foreshadow 查伏笔
|
|
32
|
+
- /canon 查设定
|
|
33
|
+
- /learn 写法记忆
|
|
34
|
+
- /export-book 导出
|
|
35
|
+
顺序:看进度 → 写下一章 → 审这一章 → 必要时改这段;查伏笔/查设定/写法记忆按需;导出前先预检。
|
|
36
|
+
用户说出这些说法或键入对应斜杠时,先加载同名技能再行动。宿主 /export 是会话日志,不是成稿导出。
|
|
37
|
+
写法记忆随当前 Workspace 的 OpenWrite 资产走,不另建记忆库。
|
|
38
|
+
|
|
39
|
+
规划模式:当项目未初始化、作者意图/人物/设定/大纲存在缺口,或用户要求构思与规划时,
|
|
40
|
+
先读取 novel_status、novel_outline_read、novel_search 和相关资产;直接生成草案,
|
|
41
|
+
所有资产与大纲写入都遵循“预览 diff → 用户明确确认 → 应用”的门控。普通讨论不得写入。
|
|
42
|
+
写作模式:当目标章节具备已确认章纲和上下文时,先 novel_outline_read 再
|
|
43
|
+
novel_context_preview,然后写章、评审、必要时走 revision_from_review → regenerate → apply
|
|
44
|
+
→ rereview 闭环。低质量、硬门禁失败或上下文不完整时先报告原因,不强行交付。
|
|
45
|
+
修改已有正文、人物、世界、正典、伏笔或其他项目文档时,先用 novel_search / novel_status
|
|
46
|
+
定位正式实体并读取最新版本。正文、正典和其他普通文档的每个独立修改分别调用
|
|
47
|
+
novel_document_change_plan(action="preview");大纲、资产、创作重点、伏笔和写作目标的每个独立
|
|
48
|
+
修改分别调用 novel_structured_change_plan(action="preview")。向用户展示返回的 before/after 与来源版本;
|
|
49
|
+
只有用户明确确认后,才把原 preview_token 原样传给 action="apply",不得重新生成路径、
|
|
50
|
+
锚点或内容。用户拒绝时用 action="reject";源文件冲突时用 action="retry" 生成新预览;
|
|
51
|
+
已应用项需要撤销时,只能把返回的 undo_preview_token 传给 action="undo"。
|
|
52
|
+
novel_doc_write 是已获明确授权的完整文档写入兼容入口,不得用它绕过逐项预览。
|
|
53
|
+
完成写入后可用 novel_trace_list 核对来源、预算、模型调用、工具调用和领域变更。Trace 只保留摘要、
|
|
54
|
+
revision 与用量,作品正文、提示原文、模型原文、凭据和推理内容不得写入 trace。
|
|
55
|
+
普通讨论、分析和未确认建议不得写入资产。
|
|
56
|
+
写章前优先用 novel_outline_read 定位明确的章纲 ID、所属卷幕节与建议目标,
|
|
57
|
+
不要仅按最大章节号盲目创建下一章;再用 novel_context_preview 做写前预检。
|
|
58
|
+
如果 novel_status 显示待确认项为 outline_scope(大纲范围待确认),
|
|
59
|
+
或阶段仍在大纲滚动期但用户明确要求“根据现在/当前大纲写下一章”、
|
|
60
|
+
“就按这个大纲写”或等价表达,先向用户确认大纲范围,再执行章节预检与写作。
|
|
61
|
+
用户要求修改大纲时,先用 novel_outline_read 定位结构,再用
|
|
62
|
+
novel_structured_change_plan(change_kind="outline") 对一个结构操作逐项预览和确认;不要用
|
|
63
|
+
novel_doc_write 绕过大纲门控,也不要整篇覆盖 src/outline.md。novel_outline_edit、
|
|
64
|
+
novel_asset_update、novel_focus、novel_foreshadowing 和 novel_writing_targets 仅在用户本轮已经
|
|
65
|
+
明确授权对应的精确变更时作为直接写入兼容入口使用。
|
|
66
|
+
用户要求删除已写正文或章节时,先向用户说明将删除的章节与影响并得到明确同意。
|
|
67
|
+
单章使用 novel_chapter_delete;清理连续尾段时使用 novel_chapter_delete_batch,
|
|
68
|
+
keep_through 指定最后保留章节,confirm 必须精确为 DELETE_AFTER:<keep_through>,
|
|
69
|
+
version 必须来自刚读取的最新章节。不得用文档编辑工具清空正文来绕过删除门控。
|
|
70
|
+
|
|
71
|
+
## OpenWrite 大纲写入契约
|
|
72
|
+
|
|
73
|
+
凡是生成、补全或修改 `src/outline.md`,必须写成解析器可消费的四级 Markdown,不能只写自然语言梗概:
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
# 作品名
|
|
77
|
+
|
|
78
|
+
全书梗概,说明主角、核心冲突、主要推进和故事结果。
|
|
79
|
+
|
|
80
|
+
## 第1篇:篇标题
|
|
81
|
+
|
|
82
|
+
本篇梗概,说明这一阶段的主要事件、推进过程和结果。
|
|
83
|
+
|
|
84
|
+
### 第1节:节标题
|
|
85
|
+
|
|
86
|
+
本节梗概,说明主要事件、推进过程和结果。
|
|
87
|
+
|
|
88
|
+
#### 第1章:章标题
|
|
89
|
+
|
|
90
|
+
本章梗概,说明本章实际发生的核心行动、冲突和结果。
|
|
91
|
+
|
|
92
|
+
> 戏剧位置: 起
|
|
93
|
+
> 内容焦点: 本章实际发生的核心行动、冲突和结果
|
|
94
|
+
> 本章目标: 建立当前矛盾, 推进人物选择
|
|
95
|
+
> 预估字数: 3000
|
|
96
|
+
> 出场角色: 角色规范名A, 角色规范名B
|
|
97
|
+
> 涉及设定: 已存在设定名A, 已存在设定名B
|
|
98
|
+
> 情感弧线: 戒备 -> 动摇 -> 决意
|
|
99
|
+
> 节拍: 场景切入, 冲突升级, 关键选择, 后果与章末钩子
|
|
100
|
+
> 悬念: 下一章需要承接的问题
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
规则:
|
|
105
|
+
- 总纲、篇纲、节纲和章纲统一在标题后直接写普通散文梗概,不使用弧线、情感或张力元数据代替梗概。
|
|
106
|
+
- 章级元数据必须使用 `> 键: 值`;不要改写成项目符号、表格、粗体标签或含糊散文。
|
|
107
|
+
- `出场角色`只列本章实际进入场景或直接参与行动的人物,使用 `src/characters/`
|
|
108
|
+
中的规范名或 ID;“团队”“众人”等群体词不能代替具体人物,不得把仅被提及者
|
|
109
|
+
自动算作出场。
|
|
110
|
+
- `涉及设定`使用 `src/world/` 中可解析的规范名称;不要为填字段而虚构人物或设定。
|
|
111
|
+
缺少必要资产时先读取、创建草案或向用户确认。
|
|
112
|
+
- 完善已有章纲前,先读取目标章、所属节、相邻章、最近正文、相关人物与设定;
|
|
113
|
+
依据事实补字段,不凭空扩写。
|
|
114
|
+
- 四级梗概粒度逐级收窄:总纲概括全书,篇纲概括阶段事件,节纲概括一组章节,章纲概括本章;章另写戏剧位置与章内节拍。
|
|
115
|
+
- 修改后自检标题层级和上述字段;精确保留用户未要求修改的内容,并继续遵守预览 diff 与确认边界。
|
|
116
|
+
|
|
117
|
+
## OpenWrite 内联批注契约
|
|
118
|
+
|
|
119
|
+
用独立一行、且仅在代码围栏之外写入以下机器可读批注:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
//**人物[维度]:旧状态 -> 新状态**
|
|
123
|
+
//**关系源~>关系目标:具体关系**
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
规则:
|
|
127
|
+
- 状态批注记录一次状态迁移;维度必须具体,例如位置、伤势、立场或“与某人关系”。
|
|
128
|
+
- `A~>B` 是从 A 指向 B 的有向关系注册,用于当前关系图,不表示关系随时间的变化,
|
|
129
|
+
也不会自动创建 `B~>A`。
|
|
130
|
+
- 关系发生演变时使用状态迁移,例如 `//**A[与B关系]:互相戒备 -> 暂时结盟**`。
|
|
131
|
+
- 使用 `src/characters/` 与 `src/world/` 中的规范名称或 ID,不使用含糊代称。
|
|
132
|
+
- 大纲中的批注必须放在对应章节标题下;无法放入章纲时显式添加 `@ch_070` 章节范围。
|
|
133
|
+
- 规划阶段在大纲中只登记计划变化;写作阶段与 Writer 在正文中只登记本章实际写出的变化,
|
|
134
|
+
不能把未落地计划写成事实。
|
|
135
|
+
- 同章同人物同维度同时存在大纲与正文批注时,正文事实优先用于当前状态和连续性判断;
|
|
136
|
+
大纲计划仍保留为历史来源。
|
|
137
|
+
- 旧式 `//**A~B:具体关系**` 仅为已有项目读取兼容;不得继续生成,必须写成 `~>`。
|
|
138
|
+
- 只有格式完整的有效批注会从字数统计与成书导出中隐藏;无效批注会保留在原文中并报告错误。
|
|
139
|
+
|
|
140
|
+
## OpenWrite 角色文档契约
|
|
141
|
+
|
|
142
|
+
创建完整角色资产时,`content` 必须包含 TOML front matter 与 Markdown 正文。front matter 至少包含
|
|
143
|
+
`id`、`name`、`tier`、`summary`、`tags`,关系引用放在 `related`。正文必须使用一级角色名标题,
|
|
144
|
+
并填写 `## 基本信息`、`## 背景`、`## 外貌`、`## 性格`、`## 与主角关系`、
|
|
145
|
+
`## 说话风格`、`## 当前戏剧用途`;有能力体系时再填写 `## 特殊能力`。
|
|
146
|
+
未知信息写“待作者确认”,不能省略结构,也不能只传一句 description 充当完整角色卡。
|
|
147
|
+
|
|
148
|
+
# rc.1 reads text; alpha.1 reads prefix. One shared string prevents drift.
|
|
149
|
+
prefix: *openwrite_persona
|
|
150
|
+
|
|
151
|
+
- id: agent-instructions
|
|
152
|
+
name: '@deepseek-ai/dsh-agent-instructions'
|
|
153
|
+
config:
|
|
154
|
+
maxBytes: 65536
|
|
155
|
+
|
|
156
|
+
# OpenWrite bridge is mounted once by the host profile bundle.
|
|
157
|
+
# Keep it out of this per-agent preset: mounting it here again would register
|
|
158
|
+
# the process-level `novelDomain` service twice and make this preset unloadable.
|
|
159
|
+
|
|
160
|
+
# ── shell ───────────────────────────────────────────────────────────────────
|
|
161
|
+
|
|
162
|
+
- id: tool-bash
|
|
163
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
164
|
+
disabled: !!js process.platform === 'win32'
|
|
165
|
+
|
|
166
|
+
- id: tool-pwsh
|
|
167
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
168
|
+
disabled: !!js process.platform !== 'win32'
|
|
169
|
+
|
|
170
|
+
# ── filesystem ──────────────────────────────────────────────────────────────
|
|
171
|
+
|
|
172
|
+
- id: tool-fs
|
|
173
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
174
|
+
|
|
175
|
+
- id: tool-fs-search
|
|
176
|
+
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
177
|
+
config:
|
|
178
|
+
sampleOverCapGlobResults: false
|
|
179
|
+
|
|
180
|
+
# ── background jobs ─────────────────────────────────────────────────────────
|
|
181
|
+
|
|
182
|
+
- id: tool-jobs
|
|
183
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
184
|
+
|
|
185
|
+
# ── skills ──────────────────────────────────────────────────────────────────
|
|
186
|
+
|
|
187
|
+
# 技能注册表在 host 组合中按 scope 分层;这两行注册进本预设的层,无需 realm。
|
|
188
|
+
# customSkillDirs 指向预设自带的 skills/ 目录:baseUrl 是预设自身目录,
|
|
189
|
+
# 预设被复制到 ~/.dsh/.agent-presets/ 后依然解析正确(与 shipped cordis 预设同写法)。
|
|
190
|
+
- id: skill-filesystem
|
|
191
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
192
|
+
config:
|
|
193
|
+
customSkillDirs:
|
|
194
|
+
- !!js "process.getBuiltinModule('node:url').fileURLToPath(new URL('skills/', baseUrl))"
|
|
195
|
+
|
|
196
|
+
- id: tool-skill
|
|
197
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
198
|
+
|
|
199
|
+
# ── goals ───────────────────────────────────────────────────────────────────
|
|
200
|
+
|
|
201
|
+
- id: tool-goal
|
|
202
|
+
name: '@deepseek-ai/dsh-tool-goal'
|
|
203
|
+
|
|
204
|
+
# ── plan mode ───────────────────────────────────────────────────────────────
|
|
205
|
+
|
|
206
|
+
# Plan 状态按 agent 计,entry-local realm 是正确的生命周期(沿用 standard)。
|
|
207
|
+
- id: planning
|
|
208
|
+
name: cordis:group
|
|
209
|
+
group: true
|
|
210
|
+
isolate:
|
|
211
|
+
planMode: true
|
|
212
|
+
config:
|
|
213
|
+
- id: plan-mode
|
|
214
|
+
name: '@deepseek-ai/dsh-plan-mode'
|
|
215
|
+
config:
|
|
216
|
+
section: |
|
|
217
|
+
You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
218
|
+
|
|
219
|
+
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
|
|
220
|
+
|
|
221
|
+
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
222
|
+
|
|
223
|
+
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
|
|
224
|
+
|
|
225
|
+
Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
|
|
226
|
+
|
|
227
|
+
When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
|
|
228
|
+
|
|
229
|
+
# ── compaction ──────────────────────────────────────────────────────────────
|
|
230
|
+
|
|
231
|
+
# compaction-basic 通过 ctx.get 读 toolResultPrune,二者必须同 realm(沿用 standard)。
|
|
232
|
+
- id: compaction
|
|
233
|
+
name: cordis:group
|
|
234
|
+
group: true
|
|
235
|
+
isolate:
|
|
236
|
+
compaction: true
|
|
237
|
+
toolResultPruner: true
|
|
238
|
+
config:
|
|
239
|
+
- id: compaction-basic
|
|
240
|
+
name: '@deepseek-ai/dsh-compaction-basic'
|
|
241
|
+
|
|
242
|
+
- id: command-compact
|
|
243
|
+
name: '@deepseek-ai/dsh-command-compact'
|
|
244
|
+
|
|
245
|
+
- id: tool-result-pruner
|
|
246
|
+
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
247
|
+
config:
|
|
248
|
+
thresholdChars: 8192
|
|
249
|
+
headChars: 4096
|
|
250
|
+
tailChars: 1024
|
|
251
|
+
|
|
252
|
+
# ── delegation and workflows ────────────────────────────────────────────────
|
|
253
|
+
|
|
254
|
+
# subagents 注册表与 spawn/fork 后端在 host 组合;本预设只贡献委派工具。
|
|
255
|
+
# workflows 无外部读者,相关行共享一个 entry-local realm(沿用 standard)。
|
|
256
|
+
- id: delegation
|
|
257
|
+
name: cordis:group
|
|
258
|
+
group: true
|
|
259
|
+
isolate:
|
|
260
|
+
workflowEngine: true
|
|
261
|
+
config:
|
|
262
|
+
- id: tool-subagent-control
|
|
263
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
264
|
+
|
|
265
|
+
- id: tool-subagent-list-agents
|
|
266
|
+
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
267
|
+
|
|
268
|
+
- id: tool-subagent
|
|
269
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
270
|
+
config:
|
|
271
|
+
provider: spawn
|
|
272
|
+
toolName: subagent
|
|
273
|
+
backgroundMode: continuable
|
|
274
|
+
|
|
275
|
+
- id: tool-subagent-fork
|
|
276
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
277
|
+
config:
|
|
278
|
+
provider: fork
|
|
279
|
+
toolName: subagent_fork
|
|
280
|
+
backgroundMode: continuable
|
|
281
|
+
|
|
282
|
+
- id: workflow-worker-thread
|
|
283
|
+
name: '@deepseek-ai/dsh-workflow-worker-thread'
|
|
284
|
+
config:
|
|
285
|
+
provider: spawn
|
|
286
|
+
|
|
287
|
+
- id: tool-workflow
|
|
288
|
+
name: '@deepseek-ai/dsh-tool-workflow'
|
|
289
|
+
|
|
290
|
+
- id: tool-ralph
|
|
291
|
+
name: '@deepseek-ai/dsh-tool-ralph'
|
|
292
|
+
config:
|
|
293
|
+
subagentProvider: spawn
|
|
294
|
+
maxRounds: 64
|
|
295
|
+
|
|
296
|
+
# ── remaining model-facing rows ─────────────────────────────────────────────
|
|
297
|
+
|
|
298
|
+
- id: tool-ask-user
|
|
299
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
300
|
+
|
|
301
|
+
- id: tool-todo
|
|
302
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
303
|
+
config:
|
|
304
|
+
allowParallelInProgress: true
|
|
305
|
+
|
|
306
|
+
- id: tool-web
|
|
307
|
+
name: '@deepseek-ai/dsh-tool-web'
|
|
308
|
+
config:
|
|
309
|
+
fetch: false
|
|
310
|
+
searchTimeoutMs: 60000
|
|
311
|
+
|
|
312
|
+
# Stable scoped tool catalog; no novel tools are registered by the host bridge.
|
|
313
|
+
- id: openwrite-tools
|
|
314
|
+
name: dsh-openwrite/tools
|
|
315
|
+
|
|
316
|
+
- id: openwrite-dog-tools
|
|
317
|
+
name: dsh-openwrite/dog-tools
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: canon
|
|
3
|
+
description: 查设定。Use when the author asks 查设定, 人物卡, 世界观, or types /canon. Read registered assets and search; do not create a second lorebook.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 查设定
|
|
7
|
+
|
|
8
|
+
接到已有 `novel_*`。人物、地点、世界观以 OpenWrite 资产为准。
|
|
9
|
+
|
|
10
|
+
1. `novel_assets_list` 列出人物/世界资产(含名称与别名)。
|
|
11
|
+
2. 指定实体用 `novel_asset_read`。
|
|
12
|
+
3. 按名称或别名找不到时 `novel_search`(scope 可 `assets`)。
|
|
13
|
+
4. 关系与状态漂移用 `novel_continuity`。
|
|
14
|
+
|
|
15
|
+
向作者报告规范名、别名、摘要。改设定走 `novel_structured_change_plan(change_kind="asset")`;普通讨论不得写入。
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dialoguequality
|
|
3
|
+
description: Use when user wants to analyze dialogue style, extract speech patterns, compare character voices, or detect AI-sounding dialogue. Triggers include "对话", "口头禅", "角色声音", "对白", "AI味对话".
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 对话质量系统
|
|
8
|
+
|
|
9
|
+
用于分析角色对白、提取说话习惯、检查角色声音是否区分明显,以及识别 AI 味对话问题。
|
|
10
|
+
|
|
11
|
+
## 当前数据来源
|
|
12
|
+
|
|
13
|
+
对话分析不要只盯着对白片段本身。当前推荐读取顺序是:
|
|
14
|
+
|
|
15
|
+
1. `data/manuscript/arc_*/ch_*.md` — 实际章节正文
|
|
16
|
+
2. `src/characters/*.md` — 角色单源文档
|
|
17
|
+
3. `data/style/composed.md` — 当前作品风格约束
|
|
18
|
+
4. `src/outline.md` / canonical packet — 本章戏剧位置与章节目标
|
|
19
|
+
|
|
20
|
+
如果需要完整判断某章对白是否失真,优先结合 `review_chapter` 或章节 packet,而不是只看几行台词。
|
|
21
|
+
|
|
22
|
+
## 可用工具
|
|
23
|
+
|
|
24
|
+
| 工具 | 说明 |
|
|
25
|
+
|------|------|
|
|
26
|
+
| `extract_dialogue_fingerprint` | 提取角色对白指纹 |
|
|
27
|
+
| `review_chapter` | 对整章做审查,可发现台词失真、解释性对话、套路对白 |
|
|
28
|
+
|
|
29
|
+
## 什么时候用
|
|
30
|
+
|
|
31
|
+
- 角色说话越来越像同一个人
|
|
32
|
+
- 想提取某角色口头禅、句长、问句比例
|
|
33
|
+
- 怀疑一段对白太工整、太礼貌、太像 AI 写的
|
|
34
|
+
- 想比较两个角色的声音有没有拉开
|
|
35
|
+
|
|
36
|
+
## 工作方式
|
|
37
|
+
|
|
38
|
+
### 1. 提取对白指纹
|
|
39
|
+
|
|
40
|
+
先定位章节和角色,再提取:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
用户: 分析一下林月在第六章的对话风格
|
|
44
|
+
|
|
45
|
+
AI:
|
|
46
|
+
[COMMAND] extract_dialogue_fingerprint {
|
|
47
|
+
"chapter_id": "ch_006",
|
|
48
|
+
"character_names": ["林月"]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
重点观察:
|
|
53
|
+
|
|
54
|
+
- `avg_sentence_length`:句长偏短还是偏长
|
|
55
|
+
- `question_ratio`:疑问句比例
|
|
56
|
+
- `common_bigrams`:高频词组
|
|
57
|
+
- `speech_patterns`:口头禅、重复习惯、语气特征
|
|
58
|
+
|
|
59
|
+
### 2. 结合角色档案复核
|
|
60
|
+
|
|
61
|
+
提取完后,要对照 `src/characters/*.md`:
|
|
62
|
+
|
|
63
|
+
- 角色身份是否和说话方式一致
|
|
64
|
+
- 是否符合性格、教育程度、职业背景
|
|
65
|
+
- 是否保留了角色特有的回避方式、攻击方式、冷幽默或停顿习惯
|
|
66
|
+
|
|
67
|
+
### 3. 识别 AI 味对白
|
|
68
|
+
|
|
69
|
+
重点查这些问题:
|
|
70
|
+
|
|
71
|
+
#### 过度礼貌
|
|
72
|
+
|
|
73
|
+
- 普通熟人反复说“请”“劳烦”“阁下”
|
|
74
|
+
- 同事或熟人之间说话像正式公文
|
|
75
|
+
|
|
76
|
+
#### 解释性对话
|
|
77
|
+
|
|
78
|
+
- A 向 B 解释 B 本来就知道的事
|
|
79
|
+
- 台词承担“给读者讲设定”的任务,而不是人物交流
|
|
80
|
+
|
|
81
|
+
#### 完美逻辑
|
|
82
|
+
|
|
83
|
+
- 每句话都有正面回应
|
|
84
|
+
- 没有打断、沉默、敷衍、转移话题
|
|
85
|
+
- 像在辩论,不像在说话
|
|
86
|
+
|
|
87
|
+
#### 套路表达
|
|
88
|
+
|
|
89
|
+
- “受教了”“所言极是”“你说得对”
|
|
90
|
+
- “我很生气”“我很震惊”这类直接把情绪说出来
|
|
91
|
+
- “嘴角微微上扬”“眼中闪过一丝”这类套路型动作标签
|
|
92
|
+
|
|
93
|
+
#### 角色同声化
|
|
94
|
+
|
|
95
|
+
- 不同角色句长接近
|
|
96
|
+
- 用词层次相同
|
|
97
|
+
- 职位、年龄、教育背景、社交方式没有反映在对白里
|
|
98
|
+
|
|
99
|
+
## 检查清单
|
|
100
|
+
|
|
101
|
+
### 角色声音
|
|
102
|
+
|
|
103
|
+
- 主角是否有稳定的思维口癖
|
|
104
|
+
- 配角是否有可识别的用词边界
|
|
105
|
+
- 高压状态下的说话方式是否会变化
|
|
106
|
+
|
|
107
|
+
### 对话结构
|
|
108
|
+
|
|
109
|
+
- 是否有人答非所问
|
|
110
|
+
- 是否有停顿、省略、打断
|
|
111
|
+
- 是否存在大量“解释给读者听”的台词
|
|
112
|
+
|
|
113
|
+
### 风格一致性
|
|
114
|
+
|
|
115
|
+
- 是否符合 `data/style/composed.md`
|
|
116
|
+
- 是否符合章节当前戏剧位置
|
|
117
|
+
- 是否和上一章衔接自然
|
|
118
|
+
|
|
119
|
+
## 输出建议格式
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
对话检查结果:ch_006 / 林月
|
|
123
|
+
|
|
124
|
+
1. 角色声音
|
|
125
|
+
- 句长偏短,命令句比例高,符合技术组长的控制型表达
|
|
126
|
+
- 高频表达偏直接,几乎不解释理由,角色识别度高
|
|
127
|
+
|
|
128
|
+
2. 问题
|
|
129
|
+
- 第 3 段存在解释性对话,林月不该向熟悉项目的人完整解释背景
|
|
130
|
+
- 第 6 段礼貌度偏高,不像她一贯说话方式
|
|
131
|
+
|
|
132
|
+
3. 修改建议
|
|
133
|
+
- 删掉完整解释,改成一句结论 + 一个动作
|
|
134
|
+
- 把“请你尽快处理”改成“今天收掉”
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 示例
|
|
138
|
+
|
|
139
|
+
### 示例 1:识别解释性对话
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
❌
|
|
143
|
+
"你也知道,我们项目组最近一直在做那套老系统重构,所以今天才会出这种问题。"
|
|
144
|
+
|
|
145
|
+
✅
|
|
146
|
+
"老系统又炸了。"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
原因:后者更像熟人之间的真实说话方式,信息由上下文承担,不靠台词硬讲。
|
|
150
|
+
|
|
151
|
+
### 示例 2:识别角色同声化
|
|
152
|
+
|
|
153
|
+
```text
|
|
154
|
+
❌ 陈明 / 林月 / 赵磊都用类似的完整句式解释问题
|
|
155
|
+
|
|
156
|
+
✅
|
|
157
|
+
陈明:偏技术比喻、偏自嘲
|
|
158
|
+
林月:短句、结论先行
|
|
159
|
+
赵磊:口语化、插科打诨
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## 注意
|
|
163
|
+
|
|
164
|
+
- `extract_dialogue_fingerprint` 适合看“说话指纹”
|
|
165
|
+
- `review_chapter` 适合看“对白放在整章里是否成立”
|
|
166
|
+
- 真要改对白,必须结合人物文档和章节戏剧位置一起判断
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dog-delivery-query
|
|
3
|
+
description: Query a chapter delivery DoG graph across manuscript, review, revision application, and re-review closure. Use after writing or reviewing a chapter, after revision actions, or when the user asks whether a chapter is truly ready to deliver.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 章节交付 DoG 查询
|
|
8
|
+
|
|
9
|
+
章节写作、评审和修订工具会生成:
|
|
10
|
+
|
|
11
|
+
`data/novels/{id}/data/dog/deliveries/{chapter}/dog-graph.json`
|
|
12
|
+
|
|
13
|
+
这张图查询六个阶段:`writing → review → revision → application → rereview → closure`。
|
|
14
|
+
它不替代 OpenWrite 的写章、六域累加评审或修订服务。
|
|
15
|
+
|
|
16
|
+
## 查询流程
|
|
17
|
+
|
|
18
|
+
1. 从最近一次 `novel_write_chapter`、`novel_review_chapter`、`novel_revision_*`
|
|
19
|
+
或 `novel_task_get` 结果的 `dog_delivery.graphPath` 找到图;conductor 输出使用
|
|
20
|
+
`dog_delivery_graph_path`。
|
|
21
|
+
2. 依次调用 `dog_validate`、`dog_create`、`dog_run`、`dog_wait`,等待终态。
|
|
22
|
+
3. 用 `dog_status` 读取 `review`、`revision` 和 `closure` evidence,再决定领域动作。
|
|
23
|
+
4. 修订应用后必须重新调用 `novel_review_chapter`;只有复评对应当前正文 SHA 且门禁通过,
|
|
24
|
+
`closure` 才能成为 `closed`。
|
|
25
|
+
|
|
26
|
+
## 状态解释
|
|
27
|
+
|
|
28
|
+
- `review.missing`:正文存在但尚未评审。
|
|
29
|
+
- `closure.review_failed`:当前正文已评审但未通过门禁,进入修订闭环。
|
|
30
|
+
- `revision.proposal_pending`:提案已生成,等待作者确认应用或驳回。
|
|
31
|
+
- `revision.applied_requires_rereview`:修订已写入正文,但不能视为问题已解决。
|
|
32
|
+
- `closure.rereview_required`:必须对修订后的正文重新跑六域评审。
|
|
33
|
+
- `closure.closed`:当前正文的最新评审通过,可以交付。
|
|
34
|
+
|
|
35
|
+
## 约束
|
|
36
|
+
|
|
37
|
+
- DoG 只查询 canonical manuscript/review/revision 文件,不直接修改它们。
|
|
38
|
+
- 不因提案状态为 `applied` 就宣称问题关闭;必须以当前正文 SHA 对应的复评为准。
|
|
39
|
+
- `needs_human` 是等待评审、确认或复评,不得描述成成功。
|
|
40
|
+
- 应用或驳回修订仍遵守 OpenWrite 创作 Agent 的用户确认边界。
|