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
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
https://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"package": "cryptography",
|
|
3
|
+
"version": "50.0.1",
|
|
4
|
+
"source_url": "https://files.pythonhosted.org/packages/bb/ad/5d6702db60b1e40b41ef513b6967ff5848f307d50f8449baf1634f5908f1/cryptography-50.0.1.tar.gz",
|
|
5
|
+
"source_sha256": "5dd9bda1c12b4162f6ff568eeb5e0ff956c28d14406e875cfe8a63a2d414ff20",
|
|
6
|
+
"wheel": "cryptography-50.0.1-cp312-abi3-macosx_13_0_x86_64.whl",
|
|
7
|
+
"sha256": "5ab2d3209217de6b4ffddb2a30f6566ca61915fbe257af9324327c7b766f09b5",
|
|
8
|
+
"platform": "macOS-15.7.9-x86_64-i386-64bit",
|
|
9
|
+
"python": "3.12.10 (v3.12.10:0cc81280367, Apr 8 2025, 08:47:00) [Clang 13.0.0 (clang-1300.0.29.30)]",
|
|
10
|
+
"openssl": "OpenSSL 3.6.3 9 Jun 2026 (Library: OpenSSL 3.6.3 9 Jun 2026)",
|
|
11
|
+
"rust": "rustc 1.98.1 (48a229cea 2026-09-01)",
|
|
12
|
+
"linkage": "/Users/runner/work/Openwrite/Openwrite/.tmp-intel-wheel/inspect/cryptography/hazmat/bindings/_rust.abi3.so:\n\t@rpath/cryptography.hazmat.bindings._rust.abi3.so (compatibility version 0.0.0, current version 0.0.0)\n\t/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)\n\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)\n",
|
|
13
|
+
"build_commit": "51ae02c0be1517df1ce3fd95b01bf087b41897cb",
|
|
14
|
+
"run_url": "https://github.com/LiPu-jpg/Openwrite/actions/runs/34267117629"
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// dsh-dog verifier for one materialized chapter-delivery stage.
|
|
3
|
+
|
|
4
|
+
import { readFile } from 'node:fs/promises'
|
|
5
|
+
|
|
6
|
+
const inputPath = process.argv[2]
|
|
7
|
+
if (!inputPath) {
|
|
8
|
+
process.stdout.write(JSON.stringify({ verdict: 'inconclusive', evidence: { error: 'missing input path' } }))
|
|
9
|
+
process.exit(0)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const value = JSON.parse(await readFile(inputPath, 'utf8'))
|
|
14
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) throw new Error('delivery stage must be an object')
|
|
15
|
+
if (!['delivery-stage', 'chapter-delivery'].includes(value.recordType)) throw new Error('record is not a delivery artifact')
|
|
16
|
+
if (!['pass', 'fail', 'inconclusive'].includes(value.verdict)) throw new Error('delivery stage has an invalid verdict')
|
|
17
|
+
process.stdout.write(JSON.stringify({
|
|
18
|
+
verdict: value.verdict,
|
|
19
|
+
evidence: {
|
|
20
|
+
chapterId: value.chapterId,
|
|
21
|
+
stage: value.stage,
|
|
22
|
+
status: value.status ?? (value.readyForDelivery ? 'ready' : 'not_ready'),
|
|
23
|
+
readyForDelivery: value.readyForDelivery,
|
|
24
|
+
...(value.evidence !== null && typeof value.evidence === 'object' ? value.evidence : {}),
|
|
25
|
+
},
|
|
26
|
+
}))
|
|
27
|
+
} catch (error) {
|
|
28
|
+
process.stdout.write(JSON.stringify({
|
|
29
|
+
verdict: 'inconclusive',
|
|
30
|
+
evidence: { error: error instanceof Error ? error.message : String(error) },
|
|
31
|
+
}))
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// dsh-dog verifier for one imported manuscript chapter.
|
|
3
|
+
|
|
4
|
+
import { readFile } from 'node:fs/promises'
|
|
5
|
+
|
|
6
|
+
const inputPath = process.argv[2]
|
|
7
|
+
if (!inputPath) {
|
|
8
|
+
process.stdout.write(JSON.stringify({ verdict: 'inconclusive', evidence: { error: 'missing input path' } }))
|
|
9
|
+
process.exit(0)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const text = await readFile(inputPath, 'utf8')
|
|
14
|
+
if (!text.trim()) throw new Error('chapter file is empty')
|
|
15
|
+
const heading = text.match(/^#\s+(.+)$/m)?.[1]?.trim() ?? ''
|
|
16
|
+
if (!heading) throw new Error('chapter file has no markdown title')
|
|
17
|
+
process.stdout.write(JSON.stringify({ verdict: 'pass', evidence: { heading, bytes: Buffer.byteLength(text) } }))
|
|
18
|
+
} catch (error) {
|
|
19
|
+
process.stdout.write(JSON.stringify({ verdict: 'fail', evidence: { error: error instanceof Error ? error.message : String(error) } }))
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// dsh-dog verifier for a smart-import manifest.
|
|
3
|
+
|
|
4
|
+
import { readFile } from 'node:fs/promises'
|
|
5
|
+
|
|
6
|
+
const inputPath = process.argv[2]
|
|
7
|
+
if (!inputPath) {
|
|
8
|
+
process.stdout.write(JSON.stringify({ verdict: 'inconclusive', evidence: { error: 'missing input path' } }))
|
|
9
|
+
process.exit(0)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const value = JSON.parse(await readFile(inputPath, 'utf8'))
|
|
14
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) throw new Error('manifest must be an object')
|
|
15
|
+
if (value.recordType !== 'smart-import' || !['completed', 'partial', 'failed'].includes(value.status)) throw new Error('manifest has an invalid status')
|
|
16
|
+
if (!Number.isInteger(value.chapterCount) || !Array.isArray(value.chapters) || value.chapterCount !== value.chapters.length) {
|
|
17
|
+
throw new Error('chapterCount does not match chapters')
|
|
18
|
+
}
|
|
19
|
+
const invalid = value.chapters.some(item => item === null || typeof item !== 'object' || typeof item.target !== 'string' || !item.target.endsWith('.md'))
|
|
20
|
+
if (invalid) throw new Error('manifest contains an invalid chapter target')
|
|
21
|
+
process.stdout.write(JSON.stringify({
|
|
22
|
+
verdict: value.status === 'completed' ? 'pass' : 'fail',
|
|
23
|
+
evidence: {
|
|
24
|
+
importId: value.importId,
|
|
25
|
+
status: value.status,
|
|
26
|
+
error: value.error,
|
|
27
|
+
source: value.source,
|
|
28
|
+
chapterCount: value.chapterCount,
|
|
29
|
+
aiCheck: value.aiCheck,
|
|
30
|
+
construction: value.construction,
|
|
31
|
+
},
|
|
32
|
+
}))
|
|
33
|
+
} catch (error) {
|
|
34
|
+
process.stdout.write(JSON.stringify({ verdict: 'fail', evidence: { error: error instanceof Error ? error.message : String(error) } }))
|
|
35
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// dsh-dog programmatic verifier for one materialized OpenWrite dimension.
|
|
3
|
+
|
|
4
|
+
import { readFile } from 'node:fs/promises'
|
|
5
|
+
|
|
6
|
+
const inputPath = process.argv[2]
|
|
7
|
+
if (!inputPath) {
|
|
8
|
+
process.stdout.write(JSON.stringify({ verdict: 'inconclusive', evidence: { error: 'missing input path' } }))
|
|
9
|
+
process.exit(0)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const value = JSON.parse(await readFile(inputPath, 'utf8'))
|
|
14
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) {
|
|
15
|
+
throw new Error('dimension record must be an object')
|
|
16
|
+
}
|
|
17
|
+
if (!['dimension', 'review-dimension'].includes(value.recordType)) {
|
|
18
|
+
throw new Error('record is not a review dimension')
|
|
19
|
+
}
|
|
20
|
+
const verdict = value.verdict
|
|
21
|
+
if (verdict !== 'pass' && verdict !== 'fail' && verdict !== 'inconclusive') {
|
|
22
|
+
throw new Error('dimension record has an invalid verdict')
|
|
23
|
+
}
|
|
24
|
+
process.stdout.write(JSON.stringify({
|
|
25
|
+
verdict,
|
|
26
|
+
evidence: {
|
|
27
|
+
chapterId: value.chapterId,
|
|
28
|
+
dimension: value.dimension,
|
|
29
|
+
name: value.name,
|
|
30
|
+
status: value.status,
|
|
31
|
+
criterionId: value.criterionId,
|
|
32
|
+
issueCount: value.issueCount,
|
|
33
|
+
issues: Array.isArray(value.issues) ? value.issues : [],
|
|
34
|
+
},
|
|
35
|
+
}))
|
|
36
|
+
} catch (error) {
|
|
37
|
+
process.stdout.write(JSON.stringify({
|
|
38
|
+
verdict: 'inconclusive',
|
|
39
|
+
evidence: { error: error instanceof Error ? error.message : String(error) },
|
|
40
|
+
}))
|
|
41
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Programmatic verifier for hierarchical review context/domain/gate/aggregate records.
|
|
3
|
+
|
|
4
|
+
import { readFile } from 'node:fs/promises'
|
|
5
|
+
|
|
6
|
+
const inputPath = process.argv[2]
|
|
7
|
+
if (!inputPath) {
|
|
8
|
+
process.stdout.write(JSON.stringify({ verdict: 'inconclusive', evidence: { error: 'missing input path' } }))
|
|
9
|
+
process.exit(0)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const value = JSON.parse(await readFile(inputPath, 'utf8'))
|
|
14
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) {
|
|
15
|
+
throw new Error('review record must be an object')
|
|
16
|
+
}
|
|
17
|
+
if (!String(value.recordType ?? '').startsWith('review')) {
|
|
18
|
+
throw new Error('recordType is not a review artifact')
|
|
19
|
+
}
|
|
20
|
+
if (!['pass', 'fail', 'inconclusive'].includes(value.verdict)) {
|
|
21
|
+
throw new Error('review record has an invalid verdict')
|
|
22
|
+
}
|
|
23
|
+
process.stdout.write(JSON.stringify({
|
|
24
|
+
verdict: value.verdict,
|
|
25
|
+
evidence: {
|
|
26
|
+
recordType: value.recordType,
|
|
27
|
+
chapterId: value.chapterId,
|
|
28
|
+
id: value.id,
|
|
29
|
+
status: value.status ?? value.deliveryStatus ?? value.executionStatus,
|
|
30
|
+
qualityScore: value.qualityScore,
|
|
31
|
+
coverage: value.coverage,
|
|
32
|
+
gateStatus: value.gateStatus,
|
|
33
|
+
deliveryStatus: value.deliveryStatus,
|
|
34
|
+
issueCount: Array.isArray(value.issues) ? value.issues.length : value.issueCount,
|
|
35
|
+
},
|
|
36
|
+
}))
|
|
37
|
+
} catch (error) {
|
|
38
|
+
process.stdout.write(JSON.stringify({
|
|
39
|
+
verdict: 'inconclusive',
|
|
40
|
+
evidence: { error: error instanceof Error ? error.message : String(error) },
|
|
41
|
+
}))
|
|
42
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Local maintenance never reads manuscript directories or prints credentials.
|
|
3
|
+
import { cp, mkdir, readFile, readdir, rename, writeFile } from 'node:fs/promises'
|
|
4
|
+
import { spawnSync } from 'node:child_process'
|
|
5
|
+
import { join, resolve } from 'node:path'
|
|
6
|
+
import { homedir } from 'node:os'
|
|
7
|
+
import { randomUUID } from 'node:crypto'
|
|
8
|
+
import { pathToFileURL } from 'node:url'
|
|
9
|
+
|
|
10
|
+
export const legacyPackages = ['@dsh-novel/openwrite-bridge', '@dsh-novel/studio-panel', '@dsh-external/dsh-dog']
|
|
11
|
+
export const legacyBundles = legacyPackages
|
|
12
|
+
|
|
13
|
+
const PROFILE = /^[a-zA-Z0-9_-]+$/
|
|
14
|
+
const PROFILE_FILES = ['package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', 'cordis.patch.yml']
|
|
15
|
+
|
|
16
|
+
export function inspectProfile(manifest) {
|
|
17
|
+
const bundles = Array.isArray(manifest?.dsh?.profile?.bundles) ? manifest.dsh.profile.bundles : []
|
|
18
|
+
const dependencies = manifest?.dependencies && typeof manifest.dependencies === 'object'
|
|
19
|
+
? Object.keys(manifest.dependencies) : []
|
|
20
|
+
const leftoverBundles = legacyPackages.filter(name => bundles.includes(name))
|
|
21
|
+
const leftoverDeps = legacyPackages.filter(name => dependencies.includes(name))
|
|
22
|
+
return {
|
|
23
|
+
leftover: [...new Set([...leftoverBundles, ...leftoverDeps])],
|
|
24
|
+
leftoverBundles,
|
|
25
|
+
leftoverDeps,
|
|
26
|
+
installed: bundles.filter(name => name === 'dsh-openwrite').length === 1,
|
|
27
|
+
otherPlugins: bundles.filter(name => name !== 'dsh-openwrite' && !legacyPackages.includes(name)),
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function inspectPresets(home) {
|
|
32
|
+
const dir = join(home, '.agent-presets')
|
|
33
|
+
const names = await readdir(dir).catch(error => { if (error.code === 'ENOENT') return []; throw error })
|
|
34
|
+
const presets = []
|
|
35
|
+
for (const name of names) {
|
|
36
|
+
const marker = await readFile(join(dir, name, '.openwrite-managed.json'), 'utf8').then(JSON.parse).catch(() => null)
|
|
37
|
+
presets.push({ name, origin: marker ? 'package-managed' : 'author-owned', preserved: true })
|
|
38
|
+
}
|
|
39
|
+
return presets
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function defaultRunPlugin(home, _profile, args) {
|
|
43
|
+
const bin = process.env.DSH_BIN
|
|
44
|
+
const command = bin && /\.[cm]?js$/.test(bin) ? process.execPath : (bin || 'dsh')
|
|
45
|
+
const argv = bin && /\.[cm]?js$/.test(bin) ? [bin, ...args] : args
|
|
46
|
+
const result = spawnSync(command, argv, {
|
|
47
|
+
cwd: home,
|
|
48
|
+
env: { ...process.env, DSH_HOME: home },
|
|
49
|
+
encoding: 'utf8',
|
|
50
|
+
timeout: 120_000,
|
|
51
|
+
maxBuffer: 8 * 1024 ** 2,
|
|
52
|
+
windowsHide: true,
|
|
53
|
+
})
|
|
54
|
+
if (result.error?.code === 'ENOENT') {
|
|
55
|
+
throw new Error('dsh not found; install the accepted host and re-run migrate with dsh stopped')
|
|
56
|
+
}
|
|
57
|
+
if (result.status !== 0) {
|
|
58
|
+
throw new Error(`dsh ${args.join(' ')} failed: ${(result.stderr || result.stdout || result.error?.message || '').trim() || `exit ${result.status}`}`)
|
|
59
|
+
}
|
|
60
|
+
return result.stdout
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function readManifest(home, profile) {
|
|
64
|
+
if (!PROFILE.test(profile)) throw new Error('Invalid profile name')
|
|
65
|
+
const file = join(home, 'profiles', profile, 'package.json')
|
|
66
|
+
const original = await readFile(file, 'utf8')
|
|
67
|
+
return { file, original, manifest: JSON.parse(original), directory: join(home, 'profiles', profile) }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function backupProfile(home, profile, extra) {
|
|
71
|
+
const backup = join(home, 'openwrite', 'migration-backups', randomUUID())
|
|
72
|
+
await mkdir(backup, { recursive: true, mode: 0o700 })
|
|
73
|
+
const directory = join(home, 'profiles', profile)
|
|
74
|
+
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
75
|
+
if (entry.isFile() && /\.(?:json|ya?ml)$/.test(entry.name)) {
|
|
76
|
+
await cp(join(directory, entry.name), join(backup, entry.name))
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
for (const name of ['settings.yaml', '.agent-presets']) {
|
|
80
|
+
await cp(join(home, name), join(backup, name), { recursive: true, dereference: false }).catch(error => {
|
|
81
|
+
if (error.code !== 'ENOENT') throw error
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
await writeFile(join(backup, 'migration.json'), JSON.stringify({
|
|
85
|
+
profile, time: new Date().toISOString(), ...extra,
|
|
86
|
+
}, null, 2), { mode: 0o600 })
|
|
87
|
+
return backup
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export async function restoreBackup(backup, home, profile) {
|
|
91
|
+
if (!PROFILE.test(profile)) throw new Error('Invalid profile name')
|
|
92
|
+
const directory = join(home, 'profiles', profile)
|
|
93
|
+
for (const name of PROFILE_FILES) {
|
|
94
|
+
await cp(join(backup, name), join(directory, name)).catch(error => {
|
|
95
|
+
if (error.code !== 'ENOENT') throw error
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function stripRemainingBundles(file, original, leftoverBundles) {
|
|
101
|
+
if (!leftoverBundles.length) return false
|
|
102
|
+
if (await readFile(file, 'utf8') !== original) {
|
|
103
|
+
// Host remove already rewrote the manifest; re-read rather than clobber it.
|
|
104
|
+
original = await readFile(file, 'utf8')
|
|
105
|
+
}
|
|
106
|
+
const manifest = JSON.parse(original)
|
|
107
|
+
const bundles = manifest.dsh?.profile?.bundles ?? []
|
|
108
|
+
const next = bundles.filter(name => !legacyPackages.includes(name))
|
|
109
|
+
if (next.length === bundles.length) return false
|
|
110
|
+
if (!manifest.dsh) manifest.dsh = {}
|
|
111
|
+
if (!manifest.dsh.profile) manifest.dsh.profile = {}
|
|
112
|
+
manifest.dsh.profile.bundles = next
|
|
113
|
+
const staging = file + '.openwrite-' + randomUUID()
|
|
114
|
+
await writeFile(staging, JSON.stringify(manifest, null, 2) + '\n', { mode: 0o600 })
|
|
115
|
+
await rename(staging, file)
|
|
116
|
+
return true
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export async function migrate(home, profile, apply = false, options = {}) {
|
|
120
|
+
const { file, original, manifest } = await readManifest(home, profile)
|
|
121
|
+
const inspection = inspectProfile(manifest)
|
|
122
|
+
const presets = await inspectPresets(home)
|
|
123
|
+
const base = { profile, ...inspection, presets, changed: false }
|
|
124
|
+
if (!apply || !inspection.leftover.length) return base
|
|
125
|
+
const backup = await backupProfile(home, profile, {
|
|
126
|
+
leftover: inspection.leftover, leftoverBundles: inspection.leftoverBundles, leftoverDeps: inspection.leftoverDeps,
|
|
127
|
+
})
|
|
128
|
+
const runPlugin = options.runPlugin ?? defaultRunPlugin
|
|
129
|
+
try {
|
|
130
|
+
if (await readFile(file, 'utf8') !== original) throw new Error('Profile changed during backup; retry with dsh stopped')
|
|
131
|
+
for (const name of inspection.leftoverDeps) {
|
|
132
|
+
await runPlugin(home, profile, ['plugin', '--profile', profile, 'remove', '-w', name])
|
|
133
|
+
}
|
|
134
|
+
const afterRemove = await readFile(file, 'utf8')
|
|
135
|
+
const remaining = inspectProfile(JSON.parse(afterRemove))
|
|
136
|
+
await stripRemainingBundles(file, afterRemove, remaining.leftoverBundles)
|
|
137
|
+
const final = inspectProfile(JSON.parse(await readFile(file, 'utf8')))
|
|
138
|
+
if (final.leftover.length) {
|
|
139
|
+
throw new Error(`legacy packages still present after host remove: ${final.leftover.join(', ')}`)
|
|
140
|
+
}
|
|
141
|
+
return { ...base, leftover: [], leftoverBundles: [], leftoverDeps: [], changed: true, backup, otherPlugins: final.otherPlugins }
|
|
142
|
+
} catch (error) {
|
|
143
|
+
await restoreBackup(backup, home, profile)
|
|
144
|
+
error.message = `${error.message}; restored profile from ${backup}`
|
|
145
|
+
throw error
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export async function diagnose(home, profile) {
|
|
150
|
+
const { manifest } = await readManifest(home, profile)
|
|
151
|
+
const inspection = inspectProfile(manifest)
|
|
152
|
+
const presets = await inspectPresets(home)
|
|
153
|
+
const runtime = await readFile(join(home, 'openwrite', 'active.json'), 'utf8').then(JSON.parse).catch(() => null)
|
|
154
|
+
return {
|
|
155
|
+
node: process.version, platform: process.platform, arch: process.arch, profile,
|
|
156
|
+
installed: inspection.installed,
|
|
157
|
+
leftover: inspection.leftover,
|
|
158
|
+
leftoverBundles: inspection.leftoverBundles,
|
|
159
|
+
leftoverDeps: inspection.leftoverDeps,
|
|
160
|
+
legacyBundles: inspection.leftoverBundles,
|
|
161
|
+
otherPlugins: inspection.otherPlugins,
|
|
162
|
+
presets,
|
|
163
|
+
runtimePrepared: runtime !== null,
|
|
164
|
+
instructions: inspection.leftover.length
|
|
165
|
+
? 'Stop dsh, run openwrite-maintenance migrate --profile web --apply, then install the Release package. Author-owned presets and historical sessions are preserved.'
|
|
166
|
+
: 'OpenWrite → 诊断与帮助:查看实时健康状态;本命令不启动模型。',
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
|
|
171
|
+
const command = process.argv[2] ?? 'doctor'
|
|
172
|
+
const index = process.argv.indexOf('--profile')
|
|
173
|
+
const profile = index < 0 ? 'web' : process.argv[index + 1]
|
|
174
|
+
const home = resolve(process.env.DSH_HOME || join(homedir(), '.dsh'))
|
|
175
|
+
try {
|
|
176
|
+
if (!['doctor', 'migrate'].includes(command)) throw new Error('Usage: openwrite-maintenance doctor|migrate --profile web [--apply]')
|
|
177
|
+
console.log(JSON.stringify(await (command === 'migrate' ? migrate(home, profile, process.argv.includes('--apply')) : diagnose(home, profile)), null, 2))
|
|
178
|
+
} catch (error) { console.error(error.message); process.exitCode = 1 }
|
|
179
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Git installs build here only after the user authorizes this package in pnpm.
|
|
2
|
+
// Precompiled Release tarballs need no install script or sibling checkout.
|
|
3
|
+
import { access, readFile } from 'node:fs/promises'
|
|
4
|
+
import { spawnSync } from 'node:child_process'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
const root = fileURLToPath(new URL('../', import.meta.url))
|
|
7
|
+
const manifest = JSON.parse(await readFile(new URL('../release/runtime-manifest.json', import.meta.url), 'utf8'))
|
|
8
|
+
let built = false
|
|
9
|
+
await access(new URL('../release/' + manifest.wheel.file, import.meta.url))
|
|
10
|
+
for (const dir of ['packages/openwrite-bridge', 'packages/studio-panel', 'vendor/dsh-dog']) {
|
|
11
|
+
try { await access(new URL(`../${dir}/lib/index.js`, import.meta.url)); await access(new URL(`../${dir}/lib/${dir.endsWith('openwrite-bridge') ? 'preset-tools.js' : 'client.js'}`, import.meta.url)); continue } catch {}
|
|
12
|
+
built = true
|
|
13
|
+
for (const args of [['ci', '--ignore-scripts', '--no-audit', '--no-fund'], ['run', 'build']]) {
|
|
14
|
+
const result = spawnSync(process.platform === 'win32' ? 'npm.cmd' : 'npm', args, { cwd: root + dir, stdio: 'inherit', shell: process.platform === 'win32' })
|
|
15
|
+
if (result.status !== 0) throw new Error(`${dir}: ${args.join(' ')} failed`)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (built) {
|
|
19
|
+
const result = spawnSync(process.execPath, [fileURLToPath(new URL('./release-provenance.mjs', import.meta.url))], { cwd: root, stdio: 'inherit' })
|
|
20
|
+
if (result.status !== 0) throw new Error('Release provenance generation failed')
|
|
21
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, DoG contributors
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|