ws-spec-kit 0.1.0-beta.0
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 +79 -0
- package/dist/adapters/cli/output.d.ts +15 -0
- package/dist/adapters/cli/output.js +21 -0
- package/dist/adapters/cli/output.js.map +1 -0
- package/dist/adapters/cli/workflow.d.ts +25 -0
- package/dist/adapters/cli/workflow.js +131 -0
- package/dist/adapters/cli/workflow.js.map +1 -0
- package/dist/adapters/connectors/git-native.d.ts +23 -0
- package/dist/adapters/connectors/git-native.js +521 -0
- package/dist/adapters/connectors/git-native.js.map +1 -0
- package/dist/adapters/connectors/github-cli.d.ts +23 -0
- package/dist/adapters/connectors/github-cli.js +213 -0
- package/dist/adapters/connectors/github-cli.js.map +1 -0
- package/dist/adapters/connectors/gitlab-cli.d.ts +23 -0
- package/dist/adapters/connectors/gitlab-cli.js +199 -0
- package/dist/adapters/connectors/gitlab-cli.js.map +1 -0
- package/dist/adapters/connectors/lark-cli.d.ts +24 -0
- package/dist/adapters/connectors/lark-cli.js +296 -0
- package/dist/adapters/connectors/lark-cli.js.map +1 -0
- package/dist/adapters/process/redaction.d.ts +2 -0
- package/dist/adapters/process/redaction.js +51 -0
- package/dist/adapters/process/redaction.js.map +1 -0
- package/dist/adapters/process/spawn-json.d.ts +37 -0
- package/dist/adapters/process/spawn-json.js +312 -0
- package/dist/adapters/process/spawn-json.js.map +1 -0
- package/dist/adapters/skills/claude.d.ts +1 -0
- package/dist/adapters/skills/claude.js +3 -0
- package/dist/adapters/skills/claude.js.map +1 -0
- package/dist/adapters/skills/codex.d.ts +1 -0
- package/dist/adapters/skills/codex.js +3 -0
- package/dist/adapters/skills/codex.js.map +1 -0
- package/dist/adapters/skills/cursor.d.ts +1 -0
- package/dist/adapters/skills/cursor.js +3 -0
- package/dist/adapters/skills/cursor.js.map +1 -0
- package/dist/adapters/skills/generic.d.ts +1 -0
- package/dist/adapters/skills/generic.js +2 -0
- package/dist/adapters/skills/generic.js.map +1 -0
- package/dist/adapters/skills/install.d.ts +28 -0
- package/dist/adapters/skills/install.js +571 -0
- package/dist/adapters/skills/install.js.map +1 -0
- package/dist/application/acquire.d.ts +60 -0
- package/dist/application/acquire.js +964 -0
- package/dist/application/acquire.js.map +1 -0
- package/dist/application/application.d.ts +21 -0
- package/dist/application/application.js +31 -0
- package/dist/application/application.js.map +1 -0
- package/dist/application/artifact-reader.d.ts +1 -0
- package/dist/application/artifact-reader.js +150 -0
- package/dist/application/artifact-reader.js.map +1 -0
- package/dist/application/artifact-writer.d.ts +1 -0
- package/dist/application/artifact-writer.js +268 -0
- package/dist/application/artifact-writer.js.map +1 -0
- package/dist/application/artifact.d.ts +28 -0
- package/dist/application/artifact.js +523 -0
- package/dist/application/artifact.js.map +1 -0
- package/dist/application/decide.d.ts +12 -0
- package/dist/application/decide.js +168 -0
- package/dist/application/decide.js.map +1 -0
- package/dist/application/doctor-connectors.d.ts +34 -0
- package/dist/application/doctor-connectors.js +99 -0
- package/dist/application/doctor-connectors.js.map +1 -0
- package/dist/application/external-action.d.ts +164 -0
- package/dist/application/external-action.js +670 -0
- package/dist/application/external-action.js.map +1 -0
- package/dist/application/initial-stages.d.ts +3 -0
- package/dist/application/initial-stages.js +7 -0
- package/dist/application/initial-stages.js.map +1 -0
- package/dist/application/inspect.d.ts +2 -0
- package/dist/application/inspect.js +31 -0
- package/dist/application/inspect.js.map +1 -0
- package/dist/application/profile.d.ts +32 -0
- package/dist/application/profile.js +70 -0
- package/dist/application/profile.js.map +1 -0
- package/dist/application/snapshot.d.ts +75 -0
- package/dist/application/snapshot.js +338 -0
- package/dist/application/snapshot.js.map +1 -0
- package/dist/application/start.d.ts +43 -0
- package/dist/application/start.js +360 -0
- package/dist/application/start.js.map +1 -0
- package/dist/application/state.d.ts +17 -0
- package/dist/application/state.js +94 -0
- package/dist/application/state.js.map +1 -0
- package/dist/application/submit.d.ts +18 -0
- package/dist/application/submit.js +1090 -0
- package/dist/application/submit.js.map +1 -0
- package/dist/cli/commands/core.d.ts +2 -0
- package/dist/cli/commands/core.js +205 -0
- package/dist/cli/commands/core.js.map +1 -0
- package/dist/cli/commands/public-contract.d.ts +12 -0
- package/dist/cli/commands/public-contract.js +47 -0
- package/dist/cli/commands/public-contract.js.map +1 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +23 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/domain/artifacts.d.ts +52 -0
- package/dist/domain/artifacts.js +241 -0
- package/dist/domain/artifacts.js.map +1 -0
- package/dist/domain/digests.d.ts +11 -0
- package/dist/domain/digests.js +106 -0
- package/dist/domain/digests.js.map +1 -0
- package/dist/domain/external-receipt.d.ts +48 -0
- package/dist/domain/external-receipt.js +138 -0
- package/dist/domain/external-receipt.js.map +1 -0
- package/dist/domain/ids.d.ts +7 -0
- package/dist/domain/ids.js +5 -0
- package/dist/domain/ids.js.map +1 -0
- package/dist/domain/repository-path.d.ts +3 -0
- package/dist/domain/repository-path.js +87 -0
- package/dist/domain/repository-path.js.map +1 -0
- package/dist/domain/states.d.ts +38 -0
- package/dist/domain/states.js +69 -0
- package/dist/domain/states.js.map +1 -0
- package/dist/domain/work-package-identity.d.ts +2 -0
- package/dist/domain/work-package-identity.js +10 -0
- package/dist/domain/work-package-identity.js.map +1 -0
- package/dist/domain/workflow.d.ts +58 -0
- package/dist/domain/workflow.js +2 -0
- package/dist/domain/workflow.js.map +1 -0
- package/dist/engine/actor-roles.d.ts +15 -0
- package/dist/engine/actor-roles.js +53 -0
- package/dist/engine/actor-roles.js.map +1 -0
- package/dist/engine/approvals.d.ts +44 -0
- package/dist/engine/approvals.js +239 -0
- package/dist/engine/approvals.js.map +1 -0
- package/dist/engine/archive.d.ts +24 -0
- package/dist/engine/archive.js +442 -0
- package/dist/engine/archive.js.map +1 -0
- package/dist/engine/compiler.d.ts +25 -0
- package/dist/engine/compiler.js +828 -0
- package/dist/engine/compiler.js.map +1 -0
- package/dist/engine/control/condition.d.ts +10 -0
- package/dist/engine/control/condition.js +49 -0
- package/dist/engine/control/condition.js.map +1 -0
- package/dist/engine/control/loop.d.ts +23 -0
- package/dist/engine/control/loop.js +96 -0
- package/dist/engine/control/loop.js.map +1 -0
- package/dist/engine/control/retry.d.ts +15 -0
- package/dist/engine/control/retry.js +54 -0
- package/dist/engine/control/retry.js.map +1 -0
- package/dist/engine/docs-integrity.d.ts +13 -0
- package/dist/engine/docs-integrity.js +34 -0
- package/dist/engine/docs-integrity.js.map +1 -0
- package/dist/engine/expressions/ast.d.ts +18 -0
- package/dist/engine/expressions/ast.js +9 -0
- package/dist/engine/expressions/ast.js.map +1 -0
- package/dist/engine/expressions/evaluate.d.ts +7 -0
- package/dist/engine/expressions/evaluate.js +47 -0
- package/dist/engine/expressions/evaluate.js.map +1 -0
- package/dist/engine/expressions/parser.d.ts +2 -0
- package/dist/engine/expressions/parser.js +173 -0
- package/dist/engine/expressions/parser.js.map +1 -0
- package/dist/engine/external-effects/authorization.d.ts +146 -0
- package/dist/engine/external-effects/authorization.js +222 -0
- package/dist/engine/external-effects/authorization.js.map +1 -0
- package/dist/engine/external-effects/idempotency.d.ts +14 -0
- package/dist/engine/external-effects/idempotency.js +26 -0
- package/dist/engine/external-effects/idempotency.js.map +1 -0
- package/dist/engine/external-effects/reconciliation.d.ts +11 -0
- package/dist/engine/external-effects/reconciliation.js +18 -0
- package/dist/engine/external-effects/reconciliation.js.map +1 -0
- package/dist/engine/results.d.ts +14 -0
- package/dist/engine/results.js +88 -0
- package/dist/engine/results.js.map +1 -0
- package/dist/engine/scheduler.d.ts +60 -0
- package/dist/engine/scheduler.js +225 -0
- package/dist/engine/scheduler.js.map +1 -0
- package/dist/engine/tdd/green-gate.d.ts +6 -0
- package/dist/engine/tdd/green-gate.js +72 -0
- package/dist/engine/tdd/green-gate.js.map +1 -0
- package/dist/engine/tdd/red-gate.d.ts +30 -0
- package/dist/engine/tdd/red-gate.js +531 -0
- package/dist/engine/tdd/red-gate.js.map +1 -0
- package/dist/engine/tdd/types.d.ts +89 -0
- package/dist/engine/tdd/types.js +38 -0
- package/dist/engine/tdd/types.js.map +1 -0
- package/dist/engine/verification.d.ts +56 -0
- package/dist/engine/verification.js +196 -0
- package/dist/engine/verification.js.map +1 -0
- package/dist/policy/profile.d.ts +24 -0
- package/dist/policy/profile.js +23 -0
- package/dist/policy/profile.js.map +1 -0
- package/dist/policy/risk.d.ts +33 -0
- package/dist/policy/risk.js +138 -0
- package/dist/policy/risk.js.map +1 -0
- package/dist/protocol/application.d.ts +196 -0
- package/dist/protocol/application.js +2 -0
- package/dist/protocol/application.js.map +1 -0
- package/dist/protocol/public-contract.d.ts +81 -0
- package/dist/protocol/public-contract.js +231 -0
- package/dist/protocol/public-contract.js.map +1 -0
- package/dist/protocol/work-package.d.ts +55 -0
- package/dist/protocol/work-package.js +2 -0
- package/dist/protocol/work-package.js.map +1 -0
- package/dist/registry/connectors/external-executor.d.ts +4 -0
- package/dist/registry/connectors/external-executor.js +249 -0
- package/dist/registry/connectors/external-executor.js.map +1 -0
- package/dist/registry/connectors/feishu-document.d.ts +21 -0
- package/dist/registry/connectors/feishu-document.js +197 -0
- package/dist/registry/connectors/feishu-document.js.map +1 -0
- package/dist/registry/connectors/git-commit.d.ts +32 -0
- package/dist/registry/connectors/git-commit.js +122 -0
- package/dist/registry/connectors/git-commit.js.map +1 -0
- package/dist/registry/connectors/issue.d.ts +68 -0
- package/dist/registry/connectors/issue.js +301 -0
- package/dist/registry/connectors/issue.js.map +1 -0
- package/dist/registry/connectors/knowledge-publish.d.ts +30 -0
- package/dist/registry/connectors/knowledge-publish.js +157 -0
- package/dist/registry/connectors/knowledge-publish.js.map +1 -0
- package/dist/registry/connectors/local-requirement.d.ts +19 -0
- package/dist/registry/connectors/local-requirement.js +177 -0
- package/dist/registry/connectors/local-requirement.js.map +1 -0
- package/dist/registry/connectors/manifest.d.ts +6 -0
- package/dist/registry/connectors/manifest.js +164 -0
- package/dist/registry/connectors/manifest.js.map +1 -0
- package/dist/registry/connectors/registry.d.ts +11 -0
- package/dist/registry/connectors/registry.js +34 -0
- package/dist/registry/connectors/registry.js.map +1 -0
- package/dist/registry/connectors/requirement-source.d.ts +46 -0
- package/dist/registry/connectors/requirement-source.js +513 -0
- package/dist/registry/connectors/requirement-source.js.map +1 -0
- package/dist/registry/connectors/runtime.d.ts +38 -0
- package/dist/registry/connectors/runtime.js +127 -0
- package/dist/registry/connectors/runtime.js.map +1 -0
- package/dist/registry/connectors/secret-detector.d.ts +19 -0
- package/dist/registry/connectors/secret-detector.js +85 -0
- package/dist/registry/connectors/secret-detector.js.map +1 -0
- package/dist/registry/connectors/semver.d.ts +8 -0
- package/dist/registry/connectors/semver.js +57 -0
- package/dist/registry/connectors/semver.js.map +1 -0
- package/dist/registry/connectors/types.d.ts +45 -0
- package/dist/registry/connectors/types.js +2 -0
- package/dist/registry/connectors/types.js.map +1 -0
- package/dist/registry/executors/registry.d.ts +15 -0
- package/dist/registry/executors/registry.js +68 -0
- package/dist/registry/executors/registry.js.map +1 -0
- package/dist/registry/executors/types.d.ts +19 -0
- package/dist/registry/executors/types.js +2 -0
- package/dist/registry/executors/types.js.map +1 -0
- package/dist/registry/skills/lock.d.ts +3 -0
- package/dist/registry/skills/lock.js +278 -0
- package/dist/registry/skills/lock.js.map +1 -0
- package/dist/registry/skills/resolver.d.ts +16 -0
- package/dist/registry/skills/resolver.js +353 -0
- package/dist/registry/skills/resolver.js.map +1 -0
- package/dist/registry/skills/types.d.ts +75 -0
- package/dist/registry/skills/types.js +9 -0
- package/dist/registry/skills/types.js.map +1 -0
- package/dist/resources/catalog.d.ts +20 -0
- package/dist/resources/catalog.js +111 -0
- package/dist/resources/catalog.js.map +1 -0
- package/dist/schemas/definitions.d.ts +5 -0
- package/dist/schemas/definitions.js +958 -0
- package/dist/schemas/definitions.js.map +1 -0
- package/dist/schemas/generate.d.ts +1 -0
- package/dist/schemas/generate.js +26 -0
- package/dist/schemas/generate.js.map +1 -0
- package/dist/schemas/index.d.ts +11 -0
- package/dist/schemas/index.js +54 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/storage/control-plane.d.ts +136 -0
- package/dist/storage/control-plane.js +688 -0
- package/dist/storage/control-plane.js.map +1 -0
- package/dist/storage/events.d.ts +36 -0
- package/dist/storage/events.js +185 -0
- package/dist/storage/events.js.map +1 -0
- package/dist/storage/external-action-payload.d.ts +33 -0
- package/dist/storage/external-action-payload.js +190 -0
- package/dist/storage/external-action-payload.js.map +1 -0
- package/dist/storage/files.d.ts +13 -0
- package/dist/storage/files.js +45 -0
- package/dist/storage/files.js.map +1 -0
- package/dist/storage/git.d.ts +4 -0
- package/dist/storage/git.js +21 -0
- package/dist/storage/git.js.map +1 -0
- package/dist/storage/project-config.d.ts +11 -0
- package/dist/storage/project-config.js +60 -0
- package/dist/storage/project-config.js.map +1 -0
- package/dist/storage/repository.d.ts +14 -0
- package/dist/storage/repository.js +151 -0
- package/dist/storage/repository.js.map +1 -0
- package/dist/storage/work-items.d.ts +77 -0
- package/dist/storage/work-items.js +373 -0
- package/dist/storage/work-items.js.map +1 -0
- package/dist/storage/workflow-trust.d.ts +38 -0
- package/dist/storage/workflow-trust.js +310 -0
- package/dist/storage/workflow-trust.js.map +1 -0
- package/dist/workflow-package/loader.d.ts +12 -0
- package/dist/workflow-package/loader.js +249 -0
- package/dist/workflow-package/loader.js.map +1 -0
- package/dist/workflow-package/lock.d.ts +6 -0
- package/dist/workflow-package/lock.js +12 -0
- package/dist/workflow-package/lock.js.map +1 -0
- package/dist/workflow-package/path-boundary.d.ts +5 -0
- package/dist/workflow-package/path-boundary.js +38 -0
- package/dist/workflow-package/path-boundary.js.map +1 -0
- package/dist/workflow-package/trust.d.ts +27 -0
- package/dist/workflow-package/trust.js +61 -0
- package/dist/workflow-package/trust.js.map +1 -0
- package/dist/workflow-package/types.d.ts +176 -0
- package/dist/workflow-package/types.js +9 -0
- package/dist/workflow-package/types.js.map +1 -0
- package/dist/workflow-package/workflow-v1.d.ts +3 -0
- package/dist/workflow-package/workflow-v1.js +274 -0
- package/dist/workflow-package/workflow-v1.js.map +1 -0
- package/package.json +40 -0
- package/resources/catalog.yaml +37 -0
- package/resources/connectors/github-cli.yaml +24 -0
- package/resources/connectors/gitlab-cli.yaml +24 -0
- package/resources/connectors/lark-cli.yaml +28 -0
- package/resources/skills/bug-fixing/SKILL.md +16 -0
- package/resources/skills/code-review/SKILL.md +16 -0
- package/resources/skills/documentation-editing/SKILL.md +16 -0
- package/resources/skills/documentation-exploration/SKILL.md +16 -0
- package/resources/skills/documentation-review/SKILL.md +16 -0
- package/resources/skills/requirement-exploration/SKILL.md +16 -0
- package/resources/skills/solution-design/SKILL.md +16 -0
- package/resources/skills/task-planning/SKILL.md +16 -0
- package/resources/skills/tdd-implementation/SKILL.md +16 -0
- package/resources/workflows/documentation-delivery/manifest.yaml +8 -0
- package/resources/workflows/documentation-delivery/profiles/governed.yaml +23 -0
- package/resources/workflows/documentation-delivery/profiles/quick.yaml +23 -0
- package/resources/workflows/documentation-delivery/profiles/standard.yaml +21 -0
- package/resources/workflows/documentation-delivery/workflow.yaml +109 -0
- package/resources/workflows/feature-delivery/manifest.yaml +8 -0
- package/resources/workflows/feature-delivery/profiles/governed.yaml +27 -0
- package/resources/workflows/feature-delivery/profiles/quick.yaml +25 -0
- package/resources/workflows/feature-delivery/profiles/standard.yaml +26 -0
- package/resources/workflows/feature-delivery/workflow.yaml +150 -0
- package/schemas/builtin-agent-action-v1.schema.json +509 -0
- package/schemas/builtin-application-acquire-input-v1.schema.json +25 -0
- package/schemas/builtin-application-artifact-create-input-v1.schema.json +49 -0
- package/schemas/builtin-application-decision-input-v1.schema.json +284 -0
- package/schemas/builtin-application-inspect-input-v1.schema.json +20 -0
- package/schemas/builtin-application-project-config-snapshot-v1.schema.json +289 -0
- package/schemas/builtin-application-project-config-v1.schema.json +293 -0
- package/schemas/builtin-application-start-input-v1.schema.json +92 -0
- package/schemas/builtin-application-submit-input-v1.schema.json +145 -0
- package/schemas/builtin-artifact-v1.schema.json +48 -0
- package/schemas/builtin-evidence-v1.schema.json +65 -0
- package/schemas/builtin-external-action-grant-v1.schema.json +298 -0
- package/schemas/builtin-external-action-request-v1.schema.json +288 -0
- package/schemas/builtin-external-binding-v1.schema.json +59 -0
- package/schemas/builtin-external-receipt-v1.schema.json +109 -0
- package/schemas/builtin-external-write-receipt-v1.schema.json +253 -0
- package/schemas/builtin-source-artifact-v1.schema.json +293 -0
- package/schemas/builtin-submit-result-v1.schema.json +111 -0
- package/schemas/builtin-tdd-cycle-evidence-v1.schema.json +119 -0
- package/schemas/builtin-tdd-node-test-report-v1.schema.json +103 -0
- package/schemas/builtin-tdd-trusted-evidence-v1.schema.json +184 -0
- package/schemas/builtin-work-item-v1.schema.json +201 -0
- package/schemas/builtin-work-package-v1.schema.json +254 -0
- package/schemas/builtin-workflow-selection-v1.schema.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# WSSpecKit
|
|
2
|
+
|
|
3
|
+
**WSSpecKit**,包名 `ws-spec-kit`,是一个由 Agent Skill 驱动、可配置的软件交付工作流引擎。它把需求来源、工作流、Skill、配置和执行状态绑定到 Work Item,使 Agent 按已声明的步骤交付软件或文档。
|
|
4
|
+
|
|
5
|
+
当前版本为 `0.1.0-beta.0`,仍处于 beta 阶段。
|
|
6
|
+
|
|
7
|
+
## 中文概述
|
|
8
|
+
|
|
9
|
+
WSSpecKit 提供可执行文件 `wspec`。CLI 的成功、帮助与错误结果都以 JSON 写入标准输出,便于 Agent 或其他程序读取。
|
|
10
|
+
|
|
11
|
+
项目内置两种 Workflow Package:
|
|
12
|
+
|
|
13
|
+
- `builtin://workflows/feature-delivery`,用于功能交付。
|
|
14
|
+
- `builtin://workflows/documentation-delivery`,用于纯文档交付,并限制改动范围为声明的文档路径。
|
|
15
|
+
|
|
16
|
+
工作流定义、Profile、所需 Skill 和结果会在 Work Item 中快照。非内置工作流在首次使用或内容变化后需要明确的信任决定。外部连接器已有契约与本地自动化验证;真实 Provider 平台的验收状态以 [验收报告](docs/acceptance/release-report.md) 为准。
|
|
17
|
+
|
|
18
|
+
## 本地开发快速开始
|
|
19
|
+
|
|
20
|
+
在仓库根目录运行:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install
|
|
24
|
+
npm run build
|
|
25
|
+
node dist/cli/main.js --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
在一个 Git 仓库中初始化 WSSpecKit 配置:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
node dist/cli/main.js init
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
这会初始化当前仓库的 `.wsspec` 配置。命令输出为 JSON,请根据返回的 `ok`、`result` 或 `error` 字段处理结果。
|
|
35
|
+
|
|
36
|
+
## 命令族
|
|
37
|
+
|
|
38
|
+
使用 `node dist/cli/main.js --help` 查看当前公开用法。主要命令族如下:
|
|
39
|
+
|
|
40
|
+
| 命令 | 用途 |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `init` | 初始化当前 Git 仓库的 WSSpecKit 配置。 |
|
|
43
|
+
| `start` | 从需求来源创建 Work Item。 |
|
|
44
|
+
| `acquire` | 获取指定 Work Item 的下一步 AgentAction。 |
|
|
45
|
+
| `artifact create` | 在活动 Attempt 范围内创建不可变 Artifact 引用。 |
|
|
46
|
+
| `submit` | 提交一次 Attempt 的结果、Artifact 与 Evidence 引用。 |
|
|
47
|
+
| `decide` | 提交步骤审批、工作流信任或外部动作相关决定。 |
|
|
48
|
+
| `inspect` | 读取 Work Item 的快照状态。 |
|
|
49
|
+
| `workflow` | 列出、查看、导出、校验或选择工作流。 |
|
|
50
|
+
| `agent install` | 安装 Agent Driver Skill。 |
|
|
51
|
+
| `doctor connectors` | 对已声明的连接器执行无外部写入的诊断。 |
|
|
52
|
+
|
|
53
|
+
## 参考文档
|
|
54
|
+
|
|
55
|
+
- [Application Protocol](docs/reference/application-protocol.md):公开 CLI 与 Application 生命周期契约。
|
|
56
|
+
- [Workflow Language v1](docs/reference/workflow-language.md):工作流 Package、步骤、Gate 和 Profile。
|
|
57
|
+
- [Skill 解析与锁定](docs/reference/skill-resolution.md):Skill URI、来源与快照规则。
|
|
58
|
+
- [Connector 契约](docs/reference/connector-contracts.md):连接器、审批、回读和诊断边界。
|
|
59
|
+
|
|
60
|
+
## 开发检查
|
|
61
|
+
|
|
62
|
+
仓库提供以下检查脚本:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npm run build
|
|
66
|
+
npm run lint
|
|
67
|
+
npm run typecheck
|
|
68
|
+
npm test
|
|
69
|
+
npm run test:contract
|
|
70
|
+
npm run test:e2e
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## English introduction
|
|
74
|
+
|
|
75
|
+
WSSpecKit, with the package name `ws-spec-kit`, is an Agent Skill-driven, configurable software delivery workflow engine. Its `wspec` CLI returns JSON on standard output and supports local Work Item workflows for feature delivery and documentation delivery. See the reference documents above for the public protocol and current implementation boundaries.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
Licensed under [Apache-2.0](LICENSE).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type PublicCliErrorRoute } from "../../protocol/public-contract.js";
|
|
2
|
+
export interface CliProblem {
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
retryable?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class CliAdapterError extends Error {
|
|
8
|
+
readonly code: `WSSPEC_${string}`;
|
|
9
|
+
constructor(code: `WSSPEC_${string}`, message: string);
|
|
10
|
+
}
|
|
11
|
+
export declare function json(value: unknown): string;
|
|
12
|
+
export declare function errorOutput(error: unknown, route?: PublicCliErrorRoute): {
|
|
13
|
+
ok: false;
|
|
14
|
+
error: CliProblem;
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { applicationFixedPublicErrors, applicationInternalError, isApplicationPublicErrorCode, } from "../../protocol/public-contract.js";
|
|
2
|
+
export class CliAdapterError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
constructor(code, message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.code = code;
|
|
7
|
+
this.name = "CliAdapterError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export function json(value) {
|
|
11
|
+
return `${JSON.stringify(value)}\n`;
|
|
12
|
+
}
|
|
13
|
+
export function errorOutput(error, route) {
|
|
14
|
+
const code = error instanceof Error && "code" in error ? String(error.code) : applicationInternalError.code;
|
|
15
|
+
if (error instanceof Error && code !== applicationInternalError.code && isApplicationPublicErrorCode(code, route)) {
|
|
16
|
+
const fixed = applicationFixedPublicErrors[code];
|
|
17
|
+
return { ok: false, error: fixed === undefined ? { code, message: error.message } : { ...fixed } };
|
|
18
|
+
}
|
|
19
|
+
return { ok: false, error: { ...applicationInternalError } };
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/adapters/cli/output.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,GAE7B,MAAM,mCAAmC,CAAC;AAQ3C,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACnB;IAArB,YAAqB,IAAwB,EAAE,OAAe;QAC5D,KAAK,CAAC,OAAO,CAAC,CAAC;QADI,SAAI,GAAJ,IAAI,CAAoB;QAE3C,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,MAAM,UAAU,IAAI,CAAC,KAAc;IACjC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAc,EAAE,KAA2B;IACrE,MAAM,IAAI,GAAG,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,MAAM,CAAE,KAAmC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC;IAC3I,IAAI,KAAK,YAAY,KAAK,IAAI,IAAI,KAAK,wBAAwB,CAAC,IAAI,IAAI,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QAClH,MAAM,KAAK,GAAG,4BAA4B,CAAC,IAAiD,CAAC,CAAC;QAC9F,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,CAAC;IACrG,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,GAAG,wBAAwB,EAAE,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SkillProvider } from "../../registry/skills/types.js";
|
|
2
|
+
export interface WorkflowCommandInput {
|
|
3
|
+
root: string;
|
|
4
|
+
argv: string[];
|
|
5
|
+
home?: string;
|
|
6
|
+
provider?: SkillProvider;
|
|
7
|
+
interactive?: boolean;
|
|
8
|
+
actor?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkflowListResult {
|
|
11
|
+
workflows: Array<{
|
|
12
|
+
ref: string;
|
|
13
|
+
id: string;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
export interface WorkflowPackageResult {
|
|
17
|
+
workflow: {
|
|
18
|
+
ref: string;
|
|
19
|
+
id: string;
|
|
20
|
+
digest: string;
|
|
21
|
+
profiles: string[];
|
|
22
|
+
capabilities: string[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function runWorkflowCommand(input: WorkflowCommandInput): Promise<unknown>;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { access, mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { parse, stringify } from "yaml";
|
|
4
|
+
import { compileWorkflow } from "../../engine/compiler.js";
|
|
5
|
+
import { resolveProjectWorkflowContext } from "../../application/start.js";
|
|
6
|
+
import { loadBuiltinCatalog } from "../../resources/catalog.js";
|
|
7
|
+
import { validate } from "../../schemas/index.js";
|
|
8
|
+
import { writeFileAtomic } from "../../storage/files.js";
|
|
9
|
+
import { isRepositoryInitialized, loadRepository } from "../../storage/repository.js";
|
|
10
|
+
import { loadWorkflowPackage } from "../../workflow-package/loader.js";
|
|
11
|
+
import { evaluateWorkflowTrust } from "../../workflow-package/trust.js";
|
|
12
|
+
import { CliAdapterError } from "./output.js";
|
|
13
|
+
function fail(message) { throw new CliAdapterError("WSSPEC_ARGUMENT_INVALID", message); }
|
|
14
|
+
function provider(value) {
|
|
15
|
+
if (value === undefined)
|
|
16
|
+
return "generic";
|
|
17
|
+
if (["codex", "claude", "cursor", "generic"].includes(value))
|
|
18
|
+
return value;
|
|
19
|
+
return fail("Provider 必须是 codex、claude、cursor 或 generic。");
|
|
20
|
+
}
|
|
21
|
+
function parseArgs(argv, positions, options) {
|
|
22
|
+
const positional = [];
|
|
23
|
+
const found = {};
|
|
24
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
25
|
+
const value = argv[index];
|
|
26
|
+
if (!value.startsWith("--")) {
|
|
27
|
+
positional.push(value);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (!options.includes(value) || found[value] !== undefined)
|
|
31
|
+
fail(`不支持或重复参数 ${value}。`);
|
|
32
|
+
const next = argv[index + 1];
|
|
33
|
+
if (next === undefined || next.startsWith("--"))
|
|
34
|
+
fail(`缺少参数 ${value} 的值。`);
|
|
35
|
+
found[value] = next;
|
|
36
|
+
index += 1;
|
|
37
|
+
}
|
|
38
|
+
if (positional.length !== positions)
|
|
39
|
+
fail("命令包含多余或缺少的位置参数。");
|
|
40
|
+
return { positional, options: found };
|
|
41
|
+
}
|
|
42
|
+
async function exists(filename) { try {
|
|
43
|
+
await access(filename);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (error.code === "ENOENT")
|
|
48
|
+
return false;
|
|
49
|
+
throw error;
|
|
50
|
+
} }
|
|
51
|
+
async function validatePackage(root, ref, home, selectedProvider, allowMissingConfig = false) {
|
|
52
|
+
const pkg = await loadWorkflowPackage({ root, ref });
|
|
53
|
+
const { configuration, skills } = await resolveProjectWorkflowContext({ root, pkg, provider: selectedProvider, home, allowMissingConfig });
|
|
54
|
+
for (const id of ["quick", "standard", "governed"]) {
|
|
55
|
+
compileWorkflow(pkg, {
|
|
56
|
+
id,
|
|
57
|
+
skills,
|
|
58
|
+
...(configuration.documentationAllowedPaths === undefined ? {} : { documentationAllowedPaths: configuration.documentationAllowedPaths }),
|
|
59
|
+
}, configuration.gatePolicy);
|
|
60
|
+
}
|
|
61
|
+
return pkg;
|
|
62
|
+
}
|
|
63
|
+
function packageView(pkg) { return { workflow: { ref: pkg.ref, id: pkg.workflow.workflow.id, digest: pkg.contentDigest, profiles: [...pkg.profiles.keys()].sort(), capabilities: [...new Set([...pkg.manifest.capabilities, ...pkg.manifest.externalSideEffects])].sort() } }; }
|
|
64
|
+
async function ejectBuiltin(root, ref, target) {
|
|
65
|
+
if (!ref.startsWith("builtin://"))
|
|
66
|
+
throw new CliAdapterError("WSSPEC_WORKFLOW_EJECT_SOURCE_INVALID", "只能 eject 内置 Workflow Package。");
|
|
67
|
+
const pkg = await loadWorkflowPackage({ root, ref });
|
|
68
|
+
const output = path.resolve(target);
|
|
69
|
+
if (await exists(output))
|
|
70
|
+
throw new CliAdapterError("WSSPEC_WORKFLOW_EJECT_TARGET_EXISTS", "Workflow Package 目标已存在,拒绝覆盖。");
|
|
71
|
+
const parent = path.dirname(output);
|
|
72
|
+
await mkdir(parent, { recursive: true });
|
|
73
|
+
const staging = path.join(parent, `.${path.basename(output)}.wsspec-${crypto.randomUUID()}`);
|
|
74
|
+
await mkdir(staging);
|
|
75
|
+
try {
|
|
76
|
+
for (const file of pkg.files) {
|
|
77
|
+
const destination = path.join(staging, file.path);
|
|
78
|
+
await mkdir(path.dirname(destination), { recursive: true });
|
|
79
|
+
await writeFile(destination, await readFile(path.join(pkg.root, file.path), "utf8"), "utf8");
|
|
80
|
+
}
|
|
81
|
+
await rename(staging, output);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (await exists(staging))
|
|
85
|
+
await rm(staging, { recursive: true, force: true });
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
return { target: output };
|
|
89
|
+
}
|
|
90
|
+
async function useWorkflow(input, ref, requestedProfile) {
|
|
91
|
+
const identity = await loadRepository(input.root);
|
|
92
|
+
const current = validate("builtin.workflow-selection.v1", parse(await readFile(path.join(identity.repositoryRoot, ".wsspec", "workflow.yaml"), "utf8")));
|
|
93
|
+
const profile = requestedProfile ?? (typeof current.profile === "string" ? current.profile : "auto");
|
|
94
|
+
if (!["auto", "quick", "standard", "governed"].includes(profile))
|
|
95
|
+
fail("Profile 必须是 auto、quick、standard 或 governed。");
|
|
96
|
+
const pkg = await validatePackage(identity.repositoryRoot, ref, input.home ?? process.env.HOME ?? "", input.provider ?? "generic");
|
|
97
|
+
const trust = await evaluateWorkflowTrust({ root: identity.repositoryRoot, pkg, ...(input.interactive === true ? { interactive: true, actor: input.actor ?? "cli", channel: "interactive" } : { interactive: false }) });
|
|
98
|
+
if (trust.status !== "trusted")
|
|
99
|
+
return trust.status === "approval_required" ? { status: "blocked", trust: trust.summary } : { status: "blocked", problems: [{ code: "WSSPEC_WORKFLOW_TRUST_REJECTED", message: "Workflow Package 已被拒绝。", retryable: false }] };
|
|
100
|
+
await writeFileAtomic(path.join(identity.repositoryRoot, ".wsspec", "workflow.yaml"), stringify({ version: 1, activeWorkflow: { ref, version: 1 }, profile }, { lineWidth: 0 }));
|
|
101
|
+
return { status: "selected", workflowRef: ref, profile };
|
|
102
|
+
}
|
|
103
|
+
export async function runWorkflowCommand(input) {
|
|
104
|
+
const [command, ...args] = input.argv;
|
|
105
|
+
if (command === "list") {
|
|
106
|
+
parseArgs(args, 0, []);
|
|
107
|
+
const catalog = await loadBuiltinCatalog();
|
|
108
|
+
return { workflows: catalog.workflows.map(({ workflow }) => ({ ref: `builtin://workflows/${workflow.id}`, id: workflow.id })).sort((left, right) => left.ref.localeCompare(right.ref)) };
|
|
109
|
+
}
|
|
110
|
+
if (command === "show") {
|
|
111
|
+
const parsed = parseArgs(args, 1, []);
|
|
112
|
+
return packageView(await loadWorkflowPackage({ root: input.root, ref: parsed.positional[0] }));
|
|
113
|
+
}
|
|
114
|
+
if (command === "validate") {
|
|
115
|
+
const parsed = parseArgs(args, 1, ["--provider"]);
|
|
116
|
+
const ref = parsed.positional[0];
|
|
117
|
+
const initialized = await isRepositoryInitialized(input.root);
|
|
118
|
+
const pkg = await validatePackage(input.root, ref, input.home ?? process.env.HOME ?? "", provider(parsed.options["--provider"] ?? input.provider), !initialized && ref.startsWith("builtin://"));
|
|
119
|
+
return { valid: true, workflow: packageView(pkg).workflow };
|
|
120
|
+
}
|
|
121
|
+
if (command === "eject") {
|
|
122
|
+
const parsed = parseArgs(args, 2, []);
|
|
123
|
+
return ejectBuiltin(input.root, parsed.positional[0], parsed.positional[1]);
|
|
124
|
+
}
|
|
125
|
+
if (command === "use") {
|
|
126
|
+
const parsed = parseArgs(args, 1, ["--profile", "--provider"]);
|
|
127
|
+
return useWorkflow({ ...input, provider: provider(parsed.options["--provider"] ?? input.provider) }, parsed.positional[0], parsed.options["--profile"]);
|
|
128
|
+
}
|
|
129
|
+
throw new CliAdapterError("WSSPEC_COMMAND_UNKNOWN", `未知 Workflow 命令:${command ?? ""}`);
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../src/adapters/cli/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAM9C,SAAS,IAAI,CAAC,OAAe,IAAW,MAAM,IAAI,eAAe,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AACxG,SAAS,QAAQ,CAAC,KAAyB;IACzC,IAAI,KAAK,KAAK,SAAS;QAA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itCommitApproval, type GitCommitReceipt } from "../../registry/connectors/git-commit.js";
|
|
2
|
+
export interface GitCommitInput {
|
|
3
|
+
executable: string;
|
|
4
|
+
approval: GitCommitApproval;
|
|
5
|
+
environment?: Readonly<Partial<Record<"HOME" | "XDG_CONFIG_HOME", string | undefined>>>;
|
|
6
|
+
markDispatched?(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export type GitCommitReconciliation = {
|
|
9
|
+
outcome: "unknown";
|
|
10
|
+
} | {
|
|
11
|
+
outcome: "failed";
|
|
12
|
+
} | {
|
|
13
|
+
outcome: "verified";
|
|
14
|
+
repositoryCommonDir: string;
|
|
15
|
+
diffDigest: `sha256:${string}`;
|
|
16
|
+
commitOid: string;
|
|
17
|
+
parentOid: string;
|
|
18
|
+
treeOid: string;
|
|
19
|
+
files: string[];
|
|
20
|
+
messageDigest: `sha256:${string}`;
|
|
21
|
+
};
|
|
22
|
+
export declare function reconcileGitCommit(input: Omit<GitCommitInput, "markDispatched">): Promise<GitCommitReconciliation>;
|
|
23
|
+
export declare function commitGitChanges(input: GitCommitInput): Promise<GitCommitReceipt>;
|