@dommaker/harness 1.16.0 → 2.0.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/CHANGELOG.md +16 -0
- package/dist/agents/lifecycle.d.ts.map +1 -1
- package/dist/agents/lifecycle.js +3 -6
- package/dist/agents/lifecycle.js.map +1 -1
- package/dist/cli/command-contract.d.ts +6 -9
- package/dist/cli/command-contract.d.ts.map +1 -1
- package/dist/cli/command-contract.js +6 -0
- package/dist/cli/command-contract.js.map +1 -1
- package/dist/cli/commands/acceptance.d.ts.map +1 -1
- package/dist/cli/commands/acceptance.js +8 -7
- package/dist/cli/commands/acceptance.js.map +1 -1
- package/dist/cli/commands/constraints-retire.d.ts.map +1 -1
- package/dist/cli/commands/constraints-retire.js +2 -1
- package/dist/cli/commands/constraints-retire.js.map +1 -1
- package/dist/cli/commands/contract.d.ts.map +1 -1
- package/dist/cli/commands/contract.js +20 -10
- package/dist/cli/commands/contract.js.map +1 -1
- package/dist/cli/commands/definitions.d.ts.map +1 -1
- package/dist/cli/commands/definitions.js +13 -12
- package/dist/cli/commands/definitions.js.map +1 -1
- package/dist/cli/commands/init/ci-platform.d.ts +35 -0
- package/dist/cli/commands/init/ci-platform.d.ts.map +1 -0
- package/dist/cli/commands/init/ci-platform.js +59 -0
- package/dist/cli/commands/init/ci-platform.js.map +1 -0
- package/dist/cli/commands/init/ci-wiring.d.ts +20 -0
- package/dist/cli/commands/init/ci-wiring.d.ts.map +1 -0
- package/dist/cli/commands/init/ci-wiring.js +72 -0
- package/dist/cli/commands/init/ci-wiring.js.map +1 -0
- package/dist/cli/commands/init/git-hooks.d.ts +15 -0
- package/dist/cli/commands/init/git-hooks.d.ts.map +1 -0
- package/dist/cli/commands/init/git-hooks.js +64 -0
- package/dist/cli/commands/init/git-hooks.js.map +1 -0
- package/dist/cli/commands/init/governance.d.ts +14 -0
- package/dist/cli/commands/init/governance.d.ts.map +1 -0
- package/dist/cli/commands/init/governance.js +132 -0
- package/dist/cli/commands/init/governance.js.map +1 -0
- package/dist/cli/commands/{init.d.ts → init/index.d.ts} +13 -14
- package/dist/cli/commands/init/index.d.ts.map +1 -0
- package/dist/cli/commands/init/index.js +148 -0
- package/dist/cli/commands/init/index.js.map +1 -0
- package/dist/cli/commands/init/output-style.d.ts +19 -0
- package/dist/cli/commands/init/output-style.d.ts.map +1 -0
- package/dist/cli/commands/init/output-style.js +110 -0
- package/dist/cli/commands/init/output-style.js.map +1 -0
- package/dist/cli/commands/init/presets.d.ts +26 -0
- package/dist/cli/commands/init/presets.d.ts.map +1 -0
- package/dist/cli/commands/init/presets.js +104 -0
- package/dist/cli/commands/init/presets.js.map +1 -0
- package/dist/cli/commands/init/snippets.d.ts +18 -0
- package/dist/cli/commands/init/snippets.d.ts.map +1 -0
- package/dist/cli/commands/init/snippets.js +49 -0
- package/dist/cli/commands/init/snippets.js.map +1 -0
- package/dist/cli/commands/knowledge/audit.d.ts +30 -0
- package/dist/cli/commands/knowledge/audit.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/audit.js +114 -0
- package/dist/cli/commands/knowledge/audit.js.map +1 -0
- package/dist/cli/commands/knowledge/decay.d.ts +19 -0
- package/dist/cli/commands/knowledge/decay.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/decay.js +48 -0
- package/dist/cli/commands/knowledge/decay.js.map +1 -0
- package/dist/cli/commands/knowledge/health.d.ts +36 -0
- package/dist/cli/commands/knowledge/health.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/health.js +172 -0
- package/dist/cli/commands/knowledge/health.js.map +1 -0
- package/dist/cli/commands/knowledge/import.d.ts +26 -0
- package/dist/cli/commands/knowledge/import.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/import.js +63 -0
- package/dist/cli/commands/knowledge/import.js.map +1 -0
- package/dist/cli/commands/knowledge/index.d.ts +25 -0
- package/dist/cli/commands/knowledge/index.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/index.js +84 -0
- package/dist/cli/commands/knowledge/index.js.map +1 -0
- package/dist/cli/commands/knowledge/list.d.ts +25 -0
- package/dist/cli/commands/knowledge/list.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/list.js +60 -0
- package/dist/cli/commands/knowledge/list.js.map +1 -0
- package/dist/cli/commands/knowledge/migrate.d.ts +21 -0
- package/dist/cli/commands/knowledge/migrate.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/migrate.js +48 -0
- package/dist/cli/commands/knowledge/migrate.js.map +1 -0
- package/dist/cli/commands/knowledge/search.d.ts +32 -0
- package/dist/cli/commands/knowledge/search.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/search.js +73 -0
- package/dist/cli/commands/knowledge/search.js.map +1 -0
- package/dist/cli/commands/knowledge/shared.d.ts +14 -0
- package/dist/cli/commands/knowledge/shared.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/shared.js +6 -0
- package/dist/cli/commands/knowledge/shared.js.map +1 -0
- package/dist/cli/commands/knowledge/snapshot.d.ts +18 -0
- package/dist/cli/commands/knowledge/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/snapshot.js +34 -0
- package/dist/cli/commands/knowledge/snapshot.js.map +1 -0
- package/dist/cli/commands/knowledge/stats.d.ts +26 -0
- package/dist/cli/commands/knowledge/stats.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/stats.js +132 -0
- package/dist/cli/commands/knowledge/stats.js.map +1 -0
- package/dist/cli/commands/knowledge/sync-rag.d.ts +19 -0
- package/dist/cli/commands/knowledge/sync-rag.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/sync-rag.js +77 -0
- package/dist/cli/commands/knowledge/sync-rag.js.map +1 -0
- package/dist/cli/commands/knowledge-view.d.ts +2 -1
- package/dist/cli/commands/knowledge-view.d.ts.map +1 -1
- package/dist/cli/commands/knowledge-view.js +2 -2
- package/dist/cli/commands/knowledge-view.js.map +1 -1
- package/dist/cli/commands/passes-gate.d.ts.map +1 -1
- package/dist/cli/commands/passes-gate.js +12 -2
- package/dist/cli/commands/passes-gate.js.map +1 -1
- package/dist/cli/commands/performance.js.map +1 -1
- package/dist/cli/commands/release.d.ts.map +1 -1
- package/dist/cli/commands/release.js +13 -41
- package/dist/cli/commands/release.js.map +1 -1
- package/dist/cli/commands/review.d.ts.map +1 -1
- package/dist/cli/commands/review.js +3 -2
- package/dist/cli/commands/review.js.map +1 -1
- package/dist/cli/commands/security.d.ts.map +1 -1
- package/dist/cli/commands/security.js +7 -8
- package/dist/cli/commands/security.js.map +1 -1
- package/dist/cli/commands/spec-baseline-check.d.ts.map +1 -1
- package/dist/cli/commands/spec-baseline-check.js +6 -5
- package/dist/cli/commands/spec-baseline-check.js.map +1 -1
- package/dist/cli/commands/status.js +2 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/sync-docs/agents-syncer.js +31 -55
- package/dist/cli/commands/sync-docs/agents-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.js +18 -12
- package/dist/cli/commands/sync-docs/capabilities-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/compact.d.ts +9 -0
- package/dist/cli/commands/sync-docs/compact.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/compact.js +73 -0
- package/dist/cli/commands/sync-docs/compact.js.map +1 -0
- package/dist/cli/commands/sync-docs/context-syncer.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/context-syncer.js +17 -36
- package/dist/cli/commands/sync-docs/context-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/gate.d.ts +27 -0
- package/dist/cli/commands/sync-docs/gate.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/gate.js +72 -0
- package/dist/cli/commands/sync-docs/gate.js.map +1 -0
- package/dist/cli/commands/sync-docs/index.d.ts +13 -27
- package/dist/cli/commands/sync-docs/index.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/index.js +19 -529
- package/dist/cli/commands/sync-docs/index.js.map +1 -1
- package/dist/cli/commands/sync-docs/main-flow.d.ts +37 -0
- package/dist/cli/commands/sync-docs/main-flow.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/main-flow.js +485 -0
- package/dist/cli/commands/sync-docs/main-flow.js.map +1 -0
- package/dist/cli/commands/sync-docs/project-reader.d.ts +1 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/project-reader.js +16 -25
- package/dist/cli/commands/sync-docs/project-reader.js.map +1 -1
- package/dist/cli/gate-command.d.ts +1 -1
- package/dist/cli/gate-command.d.ts.map +1 -1
- package/dist/context/index.d.ts +1 -3
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -5
- package/dist/context/index.js.map +1 -1
- package/dist/context/session-manager.d.ts +2 -2
- package/dist/context/session-manager.d.ts.map +1 -1
- package/dist/context/session-manager.js +31 -52
- package/dist/context/session-manager.js.map +1 -1
- package/dist/context/types.d.ts +2 -2
- package/dist/context/types.d.ts.map +1 -1
- package/dist/core/constraint-lifecycle.d.ts +1 -1
- package/dist/core/constraint-lifecycle.d.ts.map +1 -1
- package/dist/core/constraint-lifecycle.js +1 -1
- package/dist/core/constraint-lifecycle.js.map +1 -1
- package/dist/core/constraints/capabilities-parser.d.ts +2 -1
- package/dist/core/constraints/capabilities-parser.d.ts.map +1 -1
- package/dist/core/constraints/capabilities-parser.js +4 -6
- package/dist/core/constraints/capabilities-parser.js.map +1 -1
- package/dist/core/constraints/checkers/templated/exec.d.ts.map +1 -1
- package/dist/core/constraints/checkers/templated/exec.js +1 -0
- package/dist/core/constraints/checkers/templated/exec.js.map +1 -1
- package/dist/core/constraints/checkers/templated/file-exists.js +1 -1
- package/dist/core/constraints/checkers/templated/file-exists.js.map +1 -1
- package/dist/core/constraints/context-builder.d.ts.map +1 -1
- package/dist/core/constraints/context-builder.js +13 -34
- package/dist/core/constraints/context-builder.js.map +1 -1
- package/dist/core/constraints/definitions/guidelines.d.ts.map +1 -1
- package/dist/core/constraints/definitions/guidelines.js +18 -0
- package/dist/core/constraints/definitions/guidelines.js.map +1 -1
- package/dist/core/constraints/definitions/iron-laws.d.ts.map +1 -1
- package/dist/core/constraints/definitions/iron-laws.js +0 -16
- package/dist/core/constraints/definitions/iron-laws.js.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.d.ts.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.js +192 -223
- package/dist/core/constraints/doc-freshness/runner.js.map +1 -1
- package/dist/core/constraints/git-evidence.d.ts.map +1 -1
- package/dist/core/constraints/git-evidence.js +2 -0
- package/dist/core/constraints/git-evidence.js.map +1 -1
- package/dist/core/constraints/injection-writer.d.ts +1 -0
- package/dist/core/constraints/injection-writer.d.ts.map +1 -1
- package/dist/core/constraints/injection-writer.js +3 -6
- package/dist/core/constraints/injection-writer.js.map +1 -1
- package/dist/core/project-config-loader.d.ts +3 -1
- package/dist/core/project-config-loader.d.ts.map +1 -1
- package/dist/core/project-config-loader.js +6 -6
- package/dist/core/project-config-loader.js.map +1 -1
- package/dist/core/spec/validator.d.ts +1 -1
- package/dist/core/spec/validator.d.ts.map +1 -1
- package/dist/core/spec/validator.js +41 -36
- package/dist/core/spec/validator.js.map +1 -1
- package/dist/core/validators/check-handlers/command.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/command.js +7 -4
- package/dist/core/validators/check-handlers/command.js.map +1 -1
- package/dist/core/validators/check-handlers/http.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/http.js +6 -4
- package/dist/core/validators/check-handlers/http.js.map +1 -1
- package/dist/core/validators/check-handlers/output.d.ts +1 -1
- package/dist/core/validators/check-handlers/output.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/output.js +2 -1
- package/dist/core/validators/check-handlers/output.js.map +1 -1
- package/dist/core/validators/passes-gate.d.ts +2 -1
- package/dist/core/validators/passes-gate.d.ts.map +1 -1
- package/dist/core/validators/passes-gate.js +25 -30
- package/dist/core/validators/passes-gate.js.map +1 -1
- package/dist/gates/acceptance.d.ts +37 -18
- package/dist/gates/acceptance.d.ts.map +1 -1
- package/dist/gates/acceptance.js +129 -97
- package/dist/gates/acceptance.js.map +1 -1
- package/dist/gates/command.d.ts +1 -1
- package/dist/gates/contract.d.ts +11 -2
- package/dist/gates/contract.d.ts.map +1 -1
- package/dist/gates/contract.js +57 -62
- package/dist/gates/contract.js.map +1 -1
- package/dist/gates/performance.d.ts +1 -1
- package/dist/gates/performance.d.ts.map +1 -1
- package/dist/gates/performance.js +18 -8
- package/dist/gates/performance.js.map +1 -1
- package/dist/gates/registry.d.ts.map +1 -1
- package/dist/gates/registry.js +6 -2
- package/dist/gates/registry.js.map +1 -1
- package/dist/gates/review.d.ts.map +1 -1
- package/dist/gates/review.js +16 -2
- package/dist/gates/review.js.map +1 -1
- package/dist/gates/security.d.ts +5 -1
- package/dist/gates/security.d.ts.map +1 -1
- package/dist/gates/security.js +57 -63
- package/dist/gates/security.js.map +1 -1
- package/dist/gates/types.d.ts +11 -78
- package/dist/gates/types.d.ts.map +1 -1
- package/dist/gates/types.js +5 -1
- package/dist/gates/types.js.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/knowledge/audit-dimensions.d.ts +45 -0
- package/dist/knowledge/audit-dimensions.d.ts.map +1 -0
- package/dist/knowledge/audit-dimensions.js +144 -0
- package/dist/knowledge/audit-dimensions.js.map +1 -0
- package/dist/knowledge/audit-rules.d.ts +41 -0
- package/dist/knowledge/audit-rules.d.ts.map +1 -0
- package/dist/knowledge/audit-rules.js +269 -0
- package/dist/knowledge/audit-rules.js.map +1 -0
- package/dist/knowledge/audit-scoring.d.ts +6 -60
- package/dist/knowledge/audit-scoring.d.ts.map +1 -1
- package/dist/knowledge/audit-scoring.js +8 -391
- package/dist/knowledge/audit-scoring.js.map +1 -1
- package/dist/knowledge/audit.d.ts +6 -3
- package/dist/knowledge/audit.d.ts.map +1 -1
- package/dist/knowledge/audit.js +9 -6
- package/dist/knowledge/audit.js.map +1 -1
- package/dist/knowledge/import.d.ts.map +1 -1
- package/dist/knowledge/import.js +5 -4
- package/dist/knowledge/import.js.map +1 -1
- package/dist/knowledge/index-generator.d.ts +2 -0
- package/dist/knowledge/index-generator.d.ts.map +1 -1
- package/dist/knowledge/index-generator.js +43 -50
- package/dist/knowledge/index-generator.js.map +1 -1
- package/dist/knowledge/index.d.ts +4 -2
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +2 -1
- package/dist/knowledge/index.js.map +1 -1
- package/dist/knowledge/ingest.d.ts +21 -5
- package/dist/knowledge/ingest.d.ts.map +1 -1
- package/dist/knowledge/ingest.js +12 -9
- package/dist/knowledge/ingest.js.map +1 -1
- package/dist/knowledge/lifecycle.d.ts.map +1 -1
- package/dist/knowledge/lifecycle.js +17 -22
- package/dist/knowledge/lifecycle.js.map +1 -1
- package/dist/knowledge/query.d.ts +1 -1
- package/dist/knowledge/query.d.ts.map +1 -1
- package/dist/knowledge/query.js +7 -7
- package/dist/knowledge/query.js.map +1 -1
- package/dist/knowledge/reference-tracker.d.ts.map +1 -1
- package/dist/knowledge/reference-tracker.js +14 -17
- package/dist/knowledge/reference-tracker.js.map +1 -1
- package/dist/knowledge/store.d.ts.map +1 -1
- package/dist/knowledge/store.js +17 -36
- package/dist/knowledge/store.js.map +1 -1
- package/dist/monitoring/trace-analyzer.d.ts +2 -2
- package/dist/monitoring/trace-analyzer.d.ts.map +1 -1
- package/dist/monitoring/trace-analyzer.js +9 -7
- package/dist/monitoring/trace-analyzer.js.map +1 -1
- package/dist/monitoring/traces.d.ts.map +1 -1
- package/dist/monitoring/traces.js +6 -4
- package/dist/monitoring/traces.js.map +1 -1
- package/dist/pretool-use-hook.d.ts +1 -1
- package/dist/pretool-use-hook.d.ts.map +1 -1
- package/dist/pretool-use-hook.js +12 -19
- package/dist/pretool-use-hook.js.map +1 -1
- package/dist/release/integrity.d.ts.map +1 -1
- package/dist/release/integrity.js +8 -8
- package/dist/release/integrity.js.map +1 -1
- package/dist/sdd/index-generator.d.ts.map +1 -1
- package/dist/sdd/index-generator.js +4 -0
- package/dist/sdd/index-generator.js.map +1 -1
- package/dist/types/checkpoint.d.ts +8 -8
- package/dist/types/checkpoint.d.ts.map +1 -1
- package/dist/types/command-io.d.ts +19 -0
- package/dist/types/command-io.d.ts.map +1 -0
- package/dist/types/command-io.js +3 -0
- package/dist/types/command-io.js.map +1 -0
- package/dist/types/gate.d.ts +72 -0
- package/dist/types/gate.d.ts.map +1 -0
- package/dist/types/gate.js +13 -0
- package/dist/types/gate.js.map +1 -0
- package/dist/utils/attempt.d.ts +22 -0
- package/dist/utils/attempt.d.ts.map +1 -0
- package/dist/utils/attempt.js +40 -0
- package/dist/utils/attempt.js.map +1 -0
- package/dist/utils/detect-source-roots.d.ts.map +1 -1
- package/dist/utils/detect-source-roots.js +42 -51
- package/dist/utils/detect-source-roots.js.map +1 -1
- package/dist/utils/file-walk.d.ts +2 -1
- package/dist/utils/file-walk.d.ts.map +1 -1
- package/dist/utils/file-walk.js +3 -8
- package/dist/utils/file-walk.js.map +1 -1
- package/dist/utils/package-json.d.ts +49 -0
- package/dist/utils/package-json.d.ts.map +1 -0
- package/dist/utils/package-json.js +78 -0
- package/dist/utils/package-json.js.map +1 -0
- package/dist/utils/package-version.d.ts +5 -2
- package/dist/utils/package-version.d.ts.map +1 -1
- package/dist/utils/package-version.js +8 -11
- package/dist/utils/package-version.js.map +1 -1
- package/package.json +1 -6
- package/src/CONTEXT.md +5 -4
- package/src/__tests__/acceptance-gate.test.ts +23 -51
- package/src/__tests__/contract-gate.test.ts +1 -1
- package/src/__tests__/install-precommit-hook.test.ts +61 -0
- package/src/__tests__/iron-laws.test.ts +5 -5
- package/src/__tests__/layering.test.ts +1 -1
- package/src/__tests__/public-exports.test.ts +1 -1
- package/src/__tests__/public-type-surface.test.ts +9 -19
- package/src/__tests__/public-value-surface.test.ts +9 -17
- package/src/__tests__/skip-semantics.test.ts +5 -4
- package/src/agents/lifecycle.ts +3 -5
- package/src/cli/__tests__/command-contract.test.ts +18 -0
- package/src/cli/command-contract.ts +8 -5
- package/src/cli/commands/CONTEXT.md +10 -10
- package/src/cli/commands/__tests__/check.test.ts +1 -1
- package/src/cli/commands/__tests__/constraints-retire.test.ts +5 -3
- package/src/cli/commands/__tests__/init-governance-io.test.ts +7 -2
- package/src/cli/commands/__tests__/init.test.ts +1 -1
- package/src/cli/commands/__tests__/knowledge-audit-threshold.test.ts +14 -8
- package/src/cli/commands/__tests__/knowledge-flywheel-consistency.test.ts +2 -1
- package/src/cli/commands/__tests__/knowledge-view.test.ts +28 -18
- package/src/cli/commands/__tests__/knowledge.test.ts +6 -2
- package/src/cli/commands/__tests__/numeric-flag-assembly.test.ts +1 -1
- package/src/cli/commands/__tests__/passes-gate.test.ts +100 -24
- package/src/cli/commands/__tests__/project-path-anchoring.test.ts +3 -6
- package/src/cli/commands/__tests__/registry.test.ts +3 -2
- package/src/cli/commands/__tests__/release.test.ts +24 -2
- package/src/cli/commands/__tests__/report-false-green.test.ts +10 -6
- package/src/cli/commands/acceptance.ts +10 -9
- package/src/cli/commands/command.ts +1 -1
- package/src/cli/commands/constraints-retire.ts +3 -2
- package/src/cli/commands/contract.ts +29 -14
- package/src/cli/commands/definitions.ts +13 -12
- package/src/cli/commands/init/ci-platform.ts +66 -0
- package/src/cli/commands/init/ci-wiring.ts +48 -0
- package/src/cli/commands/init/git-hooks.ts +31 -0
- package/src/cli/commands/init/governance.ts +127 -0
- package/src/cli/commands/init/index.ts +156 -0
- package/src/cli/commands/init/output-style.ts +82 -0
- package/src/cli/commands/init/presets.ts +105 -0
- package/src/cli/commands/init/snippets.ts +57 -0
- package/src/cli/commands/knowledge/audit.ts +155 -0
- package/src/cli/commands/knowledge/decay.ts +57 -0
- package/src/cli/commands/knowledge/health.ts +176 -0
- package/src/cli/commands/knowledge/import.ts +82 -0
- package/src/cli/commands/knowledge/index.ts +60 -0
- package/src/cli/commands/knowledge/list.ts +73 -0
- package/src/cli/commands/knowledge/migrate.ts +61 -0
- package/src/cli/commands/knowledge/search.ts +93 -0
- package/src/cli/commands/knowledge/shared.ts +13 -0
- package/src/cli/commands/knowledge/snapshot.ts +38 -0
- package/src/cli/commands/knowledge/stats.ts +112 -0
- package/src/cli/commands/knowledge/sync-rag.ts +48 -0
- package/src/cli/commands/knowledge-view.ts +3 -2
- package/src/cli/commands/passes-gate.ts +14 -2
- package/src/cli/commands/performance.ts +2 -2
- package/src/cli/commands/release.ts +14 -9
- package/src/cli/commands/review.ts +5 -4
- package/src/cli/commands/security.ts +10 -11
- package/src/cli/commands/spec-baseline-check.ts +6 -7
- package/src/cli/commands/status.ts +2 -2
- package/src/cli/commands/sync-docs/agents-syncer.ts +28 -47
- package/src/cli/commands/sync-docs/capabilities-syncer.ts +18 -11
- package/src/cli/commands/sync-docs/compact.ts +35 -0
- package/src/cli/commands/sync-docs/context-syncer.ts +15 -31
- package/src/cli/commands/sync-docs/gate.ts +78 -0
- package/src/cli/commands/sync-docs/index.ts +21 -585
- package/src/cli/commands/sync-docs/main-flow.ts +549 -0
- package/src/cli/commands/sync-docs/project-reader.ts +21 -24
- package/src/cli/gate-command.ts +1 -1
- package/src/context/CONTEXT.md +4 -4
- package/src/context/__tests__/session-manager.test.ts +18 -0
- package/src/context/index.ts +1 -5
- package/src/context/session-manager.ts +34 -50
- package/src/context/types.ts +2 -2
- package/src/core/CONTEXT.md +2 -2
- package/src/core/constraint-lifecycle.ts +2 -2
- package/src/core/constraints/capabilities-parser.ts +4 -6
- package/src/core/constraints/checkers/templated/exec.ts +1 -0
- package/src/core/constraints/checkers/templated/file-exists.ts +1 -1
- package/src/core/constraints/context-builder.ts +11 -28
- package/src/core/constraints/definitions/guidelines.ts +19 -0
- package/src/core/constraints/definitions/iron-laws.ts +0 -17
- package/src/core/constraints/doc-freshness/runner.ts +220 -244
- package/src/core/constraints/git-evidence.ts +2 -0
- package/src/core/constraints/injection-writer.ts +3 -6
- package/src/core/project-config-loader.ts +6 -5
- package/src/core/spec/__tests__/validator.test.ts +65 -13
- package/src/core/spec/validator.ts +50 -40
- package/src/core/validators/__tests__/passes-gate-counts.test.ts +52 -0
- package/src/core/validators/check-handlers/command.ts +9 -6
- package/src/core/validators/check-handlers/http.ts +8 -6
- package/src/core/validators/check-handlers/output.ts +7 -6
- package/src/core/validators/passes-gate.ts +31 -32
- package/src/gates/CONTEXT.md +7 -6
- package/src/gates/__tests__/acceptance-types-single-source.test.ts +16 -14
- package/src/gates/__tests__/acceptance.test.ts +69 -94
- package/src/gates/__tests__/command-single-predicate.test.ts +1 -1
- package/src/gates/__tests__/command.test.ts +23 -12
- package/src/gates/__tests__/gate-interface.test.ts +2 -5
- package/src/gates/__tests__/performance.test.ts +3 -3
- package/src/gates/__tests__/security.test.ts +7 -19
- package/src/gates/acceptance.ts +176 -131
- package/src/gates/command.ts +1 -1
- package/src/gates/contract.ts +86 -79
- package/src/gates/performance.ts +35 -19
- package/src/gates/registry.ts +6 -3
- package/src/gates/review.ts +38 -10
- package/src/gates/security.ts +94 -81
- package/src/gates/types.ts +22 -84
- package/src/index.ts +8 -4
- package/src/knowledge/CONTEXT.md +9 -7
- package/src/knowledge/__tests__/audit-labels.test.ts +3 -3
- package/src/knowledge/__tests__/audit-scoring.test.ts +9 -7
- package/src/knowledge/__tests__/ingest.test.ts +17 -17
- package/src/knowledge/__tests__/store.test.ts +4 -6
- package/src/knowledge/audit-dimensions.ts +190 -0
- package/src/knowledge/audit-rules.ts +335 -0
- package/src/knowledge/audit-scoring.ts +7 -495
- package/src/knowledge/audit.ts +9 -11
- package/src/knowledge/import.ts +7 -6
- package/src/knowledge/index-generator.ts +48 -53
- package/src/knowledge/index.ts +4 -2
- package/src/knowledge/ingest.ts +27 -12
- package/src/knowledge/lifecycle.ts +17 -19
- package/src/knowledge/query.ts +7 -6
- package/src/knowledge/reference-tracker.ts +14 -16
- package/src/knowledge/store.ts +17 -32
- package/src/monitoring/trace-analyzer.ts +12 -9
- package/src/monitoring/traces.ts +8 -6
- package/src/pretool-use-hook.ts +26 -21
- package/src/release/CONTEXT.md +1 -1
- package/src/release/__tests__/integrity.test.ts +0 -2
- package/src/release/integrity.ts +8 -9
- package/src/sdd/index-generator.ts +4 -0
- package/src/types/checkpoint.ts +8 -8
- package/src/types/command-io.ts +14 -0
- package/src/types/gate.ts +77 -0
- package/src/utils/__tests__/attempt.test.ts +94 -0
- package/src/utils/__tests__/package-json.test.ts +58 -0
- package/src/utils/__tests__/package-version.test.ts +21 -2
- package/src/utils/attempt.ts +35 -0
- package/src/utils/detect-source-roots.ts +38 -44
- package/src/utils/file-walk.ts +3 -7
- package/src/utils/package-json.ts +61 -0
- package/src/utils/package-version.ts +8 -10
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js +0 -502
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/knowledge.d.ts +0 -169
- package/dist/cli/commands/knowledge.d.ts.map +0 -1
- package/dist/cli/commands/knowledge.js +0 -700
- package/dist/cli/commands/knowledge.js.map +0 -1
- package/dist/context/knowledge-injector.d.ts +0 -51
- package/dist/context/knowledge-injector.d.ts.map +0 -1
- package/dist/context/knowledge-injector.js +0 -128
- package/dist/context/knowledge-injector.js.map +0 -1
- package/dist/gates/index.d.ts +0 -10
- package/dist/gates/index.d.ts.map +0 -1
- package/dist/gates/index.js +0 -11
- package/dist/gates/index.js.map +0 -1
- package/src/cli/commands/init.ts +0 -590
- package/src/cli/commands/knowledge.ts +0 -820
- package/src/context/__tests__/knowledge-injector.test.ts +0 -197
- package/src/context/knowledge-injector.ts +0 -174
- package/src/gates/index.ts +0 -11
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* harness knowledge decay 子命令(Phase 3 自 knowledge.ts 拆出,纯移位)
|
|
3
|
+
*
|
|
4
|
+
* 本文件只做「取数 + 声明两投影」:json 面正本在 `data`,人读排版在 `human()` 的
|
|
5
|
+
* display model。上色、label 映射、json/人读分派、退出码、路径解析与 store 构造
|
|
6
|
+
* 统一在 knowledge-view.ts(harness#133,架构评审候选4)。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { KnowledgeLifecycle } from '../../../knowledge/lifecycle';
|
|
10
|
+
import type { MaturityChange } from '../../../knowledge/types';
|
|
11
|
+
import { processIO, type CommandIO, type CommandResult } from '../../command-contract';
|
|
12
|
+
import {
|
|
13
|
+
announce,
|
|
14
|
+
blankLine,
|
|
15
|
+
emitKnowledgeView,
|
|
16
|
+
openKnowledgeStore,
|
|
17
|
+
type DisplayModel,
|
|
18
|
+
type DisplayRow,
|
|
19
|
+
} from '../knowledge-view';
|
|
20
|
+
import type { KnowledgeOptions } from './shared';
|
|
21
|
+
|
|
22
|
+
export function knowledgeDecayView(options: KnowledgeOptions, io: CommandIO) {
|
|
23
|
+
const lifecycle = new KnowledgeLifecycle(openKnowledgeStore(options, io));
|
|
24
|
+
announce(io, options.json, '🔄 运行衰减周期...');
|
|
25
|
+
const changes = lifecycle.runDecayCycle();
|
|
26
|
+
const data = { changes };
|
|
27
|
+
|
|
28
|
+
return { data, human: (): DisplayModel => ({ sections: [{ rows: decayRows(changes) }] }) };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function decayRows(changes: MaturityChange[]): DisplayRow[] {
|
|
32
|
+
if (changes.length === 0) {
|
|
33
|
+
return [{ cells: [{ label: '✅ 没有需要衰减的知识条目', tone: 'ok' }] }];
|
|
34
|
+
}
|
|
35
|
+
const rows: DisplayRow[] = [
|
|
36
|
+
{ cells: [
|
|
37
|
+
{ label: '📉 ', tone: 'warn' },
|
|
38
|
+
{ field: 'changes.length', text: String(changes.length), tone: 'warn' },
|
|
39
|
+
{ label: ' 条知识发生衰减:', tone: 'warn' },
|
|
40
|
+
] },
|
|
41
|
+
blankLine(),
|
|
42
|
+
];
|
|
43
|
+
changes.forEach((change, i) => {
|
|
44
|
+
rows.push({ cells: [
|
|
45
|
+
{ field: `changes.${i}.entryId`, text: ` ${change.entryId}: ` },
|
|
46
|
+
{ field: `changes.${i}.from`, text: change.from, tone: 'error' },
|
|
47
|
+
{ label: ' → ' },
|
|
48
|
+
{ field: `changes.${i}.to`, text: change.to, tone: 'ok' },
|
|
49
|
+
] });
|
|
50
|
+
rows.push({ cells: [{ field: `changes.${i}.reason`, text: ` ${change.reason}`, tone: 'muted' }] });
|
|
51
|
+
});
|
|
52
|
+
return rows;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export async function knowledgeDecay(options: KnowledgeOptions, io: CommandIO = processIO): Promise<CommandResult> {
|
|
56
|
+
return emitKnowledgeView(io, options, knowledgeDecayView(options, io));
|
|
57
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* harness knowledge health 子命令(飞轮健康检查 — 零 token 检测数据流状态;
|
|
3
|
+
* Phase 3 自 knowledge.ts 拆出,纯移位)
|
|
4
|
+
*
|
|
5
|
+
* 本文件只做「取数 + 声明两投影」:json 面正本在 `data`,人读排版在 `human()` 的
|
|
6
|
+
* display model。上色、json/人读分派、退出码、路径解析与 store 构造统一在
|
|
7
|
+
* knowledge-view.ts(harness#133,架构评审候选4)。
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import * as fs from 'fs';
|
|
11
|
+
import * as path from 'path';
|
|
12
|
+
import { evaluateFlywheel } from '../../../knowledge/flywheel-metrics';
|
|
13
|
+
import { processIO, type CommandIO, type CommandResult } from '../../command-contract';
|
|
14
|
+
import {
|
|
15
|
+
blankLine,
|
|
16
|
+
emitKnowledgeView,
|
|
17
|
+
openKnowledgeStore,
|
|
18
|
+
toneForScore,
|
|
19
|
+
toneForSeverity,
|
|
20
|
+
type DisplayModel,
|
|
21
|
+
type DisplayRow,
|
|
22
|
+
type DisplaySection,
|
|
23
|
+
} from '../knowledge-view';
|
|
24
|
+
import type { KnowledgeDirOption, KnowledgeOptions } from './shared';
|
|
25
|
+
|
|
26
|
+
interface HealthIssue {
|
|
27
|
+
severity: 'error' | 'warn' | 'info';
|
|
28
|
+
entry: string;
|
|
29
|
+
detail: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** health 的 json 面正本(字段清单冻结在 __tests__/knowledge-view.test.ts) */
|
|
33
|
+
interface HealthData {
|
|
34
|
+
healthScore: number;
|
|
35
|
+
summary: {
|
|
36
|
+
total: number;
|
|
37
|
+
lowRefEntries: number;
|
|
38
|
+
staleEntries: number;
|
|
39
|
+
consumptionData: boolean;
|
|
40
|
+
refCoverage: number;
|
|
41
|
+
avgRefs: number;
|
|
42
|
+
};
|
|
43
|
+
issues: HealthIssue[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function knowledgeHealthView(options: KnowledgeOptions & KnowledgeDirOption, io: CommandIO) {
|
|
47
|
+
const store = openKnowledgeStore(options, io);
|
|
48
|
+
const baseDir = store.getBaseDir();
|
|
49
|
+
const entries = store.list({ excludeArchived: true });
|
|
50
|
+
|
|
51
|
+
const issues: HealthIssue[] = [];
|
|
52
|
+
|
|
53
|
+
// D1: 引用密度检查(低引用 = 可能孤立)
|
|
54
|
+
let lowRefEntries = 0;
|
|
55
|
+
for (const entry of entries) {
|
|
56
|
+
if (entry.referencedBy.length === 0 && entry.maturity === 'verified') {
|
|
57
|
+
lowRefEntries++;
|
|
58
|
+
issues.push({ severity: 'info', entry: entry.id, detail: `verified 条目零引用(可能孤立)` });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// D2: 新鲜度检查
|
|
63
|
+
const now = Date.now();
|
|
64
|
+
const staleThreshold = 90 * 24 * 60 * 60 * 1000; // 90 days
|
|
65
|
+
let staleEntries = 0;
|
|
66
|
+
for (const entry of entries) {
|
|
67
|
+
const created = new Date(entry.created).getTime();
|
|
68
|
+
if (now - created > staleThreshold && entry.maturity === 'draft') {
|
|
69
|
+
staleEntries++;
|
|
70
|
+
issues.push({ severity: 'warn', entry: entry.id, detail: `draft 超过 90 天未推进` });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// D3: 消费数据检查
|
|
75
|
+
const statsPath = path.join(baseDir, '.consumption-stats.json');
|
|
76
|
+
const consumptionData = fs.existsSync(statsPath);
|
|
77
|
+
if (!consumptionData) {
|
|
78
|
+
issues.push({ severity: 'info', entry: '-', detail: `消费追踪数据不存在(${statsPath})` });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// D4: 飞轮指标(计算唯一实现在 knowledge/flywheel-metrics;人口为本命令的 excludeArchived 切片)
|
|
82
|
+
const metrics = evaluateFlywheel({ entries });
|
|
83
|
+
const refCoverage = Math.round(metrics.refCoverage * 100);
|
|
84
|
+
const avgRefs = Math.round(metrics.avgRefs * 10) / 10;
|
|
85
|
+
|
|
86
|
+
const totalIssues = issues.filter(i => i.severity === 'error').length * 3
|
|
87
|
+
+ issues.filter(i => i.severity === 'warn').length * 1;
|
|
88
|
+
const healthScore = Math.max(0, 100 - totalIssues);
|
|
89
|
+
|
|
90
|
+
const data: HealthData = {
|
|
91
|
+
healthScore,
|
|
92
|
+
summary: { total: entries.length, lowRefEntries, staleEntries, consumptionData, refCoverage, avgRefs },
|
|
93
|
+
issues: issues.slice(0, 50),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return { data, human: (): DisplayModel => ({ sections: healthSections(data) }) };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function healthSections(data: HealthData): DisplaySection[] {
|
|
100
|
+
const { healthScore, summary, issues } = data;
|
|
101
|
+
const scoreTone = toneForScore(healthScore);
|
|
102
|
+
return [
|
|
103
|
+
{
|
|
104
|
+
rows: [
|
|
105
|
+
{ cells: [{ label: '🏥 飞轮健康检查', tone: 'heading' }] },
|
|
106
|
+
blankLine(),
|
|
107
|
+
{ cells: [
|
|
108
|
+
{ label: ' 健康分: ', tone: 'emph' },
|
|
109
|
+
{ field: 'healthScore', text: String(healthScore), tone: scoreTone },
|
|
110
|
+
{ label: '/100', tone: 'emph' },
|
|
111
|
+
] },
|
|
112
|
+
{ cells: [
|
|
113
|
+
{ label: ' 活跃条目: ', tone: 'emph' },
|
|
114
|
+
{ field: 'summary.total', text: String(summary.total), tone: 'emph' },
|
|
115
|
+
] },
|
|
116
|
+
blankLine(),
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
title: ' 数据流状态:',
|
|
121
|
+
rows: [
|
|
122
|
+
densityRow(' 引用密度: ', 'summary.lowRefEntries', summary.lowRefEntries, ' 个零引用 verified'),
|
|
123
|
+
densityRow(' 新鲜度: ', 'summary.staleEntries', summary.staleEntries, ' 个过期 draft'),
|
|
124
|
+
{ cells: [
|
|
125
|
+
{ label: ' 消费追踪: ' },
|
|
126
|
+
summary.consumptionData
|
|
127
|
+
? { label: '✓', tone: 'ok' }
|
|
128
|
+
: { field: 'summary.consumptionData', text: '○ 未启用', tone: 'muted' },
|
|
129
|
+
] },
|
|
130
|
+
blankLine(),
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
title: ' 飞轮指标:',
|
|
135
|
+
rows: [
|
|
136
|
+
{ cells: [{ label: ' 引用覆盖: ' }, { field: 'summary.refCoverage', text: `${summary.refCoverage}%` }] },
|
|
137
|
+
{ cells: [{ label: ' 平均引用: ' }, { field: 'summary.avgRefs', text: String(summary.avgRefs) }] },
|
|
138
|
+
blankLine(),
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
title: ' 问题 (前 20):',
|
|
143
|
+
rows: issues.length === 0
|
|
144
|
+
? [{ cells: [{ label: ' ✓ 无问题', tone: 'ok' }] }]
|
|
145
|
+
: [
|
|
146
|
+
...issues.slice(0, 20).map((issue, i) => ({
|
|
147
|
+
cells: [
|
|
148
|
+
{ field: `issues.${i}.severity`, text: ` [${issue.severity}]`, tone: toneForSeverity(issue.severity) },
|
|
149
|
+
{ field: `issues.${i}.entry`, text: ` ${issue.entry}: ` },
|
|
150
|
+
{ field: `issues.${i}.detail`, text: issue.detail },
|
|
151
|
+
],
|
|
152
|
+
})),
|
|
153
|
+
// 溢出计数取全量数组,而 json 面的 issues 已截 50 条 → 无字段可锚,登记派生量
|
|
154
|
+
...(issues.length > 20
|
|
155
|
+
? [{ cells: [{ derived: 'healthIssuesOverflow', text: ` ... 还有 ${issues.length - 20} 条`, tone: 'muted' as const }] }]
|
|
156
|
+
: []),
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function densityRow(prefix: string, field: string, count: number, suffix: string): DisplayRow {
|
|
163
|
+
if (count === 0) return { cells: [{ label: prefix }, { label: '✓', tone: 'ok' }] };
|
|
164
|
+
return {
|
|
165
|
+
cells: [
|
|
166
|
+
{ label: prefix },
|
|
167
|
+
{ label: '⚠ ', tone: 'warn' },
|
|
168
|
+
{ field, text: String(count), tone: 'warn' },
|
|
169
|
+
{ label: suffix, tone: 'warn' },
|
|
170
|
+
],
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export async function knowledgeHealth(options: KnowledgeOptions & KnowledgeDirOption, io: CommandIO = processIO): Promise<CommandResult> {
|
|
175
|
+
return emitKnowledgeView(io, options, knowledgeHealthView(options, io));
|
|
176
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* harness knowledge import 子命令(冷启动导入;Phase 3 自 knowledge.ts 拆出,纯移位)
|
|
3
|
+
*
|
|
4
|
+
* 本文件只做「取数 + 声明两投影」:json 面正本在 `data`,人读排版在 `human()` 的
|
|
5
|
+
* display model。上色、label 映射、json/人读分派、退出码、路径解析与 store 构造
|
|
6
|
+
* 统一在 knowledge-view.ts(harness#133,架构评审候选4)。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { ColdStartImporter } from '../../../knowledge/import';
|
|
10
|
+
import { processIO, type CommandIO, type CommandResult } from '../../command-contract';
|
|
11
|
+
import {
|
|
12
|
+
announce,
|
|
13
|
+
blankLine,
|
|
14
|
+
emitKnowledgeView,
|
|
15
|
+
openKnowledgeStore,
|
|
16
|
+
type DisplayModel,
|
|
17
|
+
type DisplayRow,
|
|
18
|
+
} from '../knowledge-view';
|
|
19
|
+
import type { KnowledgeOptions } from './shared';
|
|
20
|
+
|
|
21
|
+
export async function knowledgeImportView(
|
|
22
|
+
options: KnowledgeOptions & { sources?: string; reset?: boolean },
|
|
23
|
+
io: CommandIO,
|
|
24
|
+
) {
|
|
25
|
+
const projectPath = options.projectPath || process.cwd();
|
|
26
|
+
const store = openKnowledgeStore(options, io);
|
|
27
|
+
const sources = options.sources
|
|
28
|
+
? options.sources.split(',') as Array<'code' | 'git' | 'docs' | 'manual'>
|
|
29
|
+
: ['code', 'git', 'docs'] as Array<'code' | 'git' | 'docs'>;
|
|
30
|
+
|
|
31
|
+
const importer = new ColdStartImporter({ projectRoot: projectPath, store, sources });
|
|
32
|
+
|
|
33
|
+
if (options.reset) {
|
|
34
|
+
importer.resetState();
|
|
35
|
+
announce(io, options.json, '🔄 已重置导入状态', 'warn');
|
|
36
|
+
}
|
|
37
|
+
announce(io, options.json, `📥 开始导入知识 (源: ${sources.join(', ')})...`);
|
|
38
|
+
|
|
39
|
+
const results = await importer.importAll();
|
|
40
|
+
const data = {
|
|
41
|
+
totalImported: results.reduce((sum, r) => sum + r.entries.length, 0),
|
|
42
|
+
totalErrors: results.reduce((sum, r) => sum + r.errors.length, 0),
|
|
43
|
+
results,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return { data, human: (): DisplayModel => ({ sections: [{ rows: importRows(data) }] }) };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type ImportOutcome = Awaited<ReturnType<ColdStartImporter['importAll']>>;
|
|
50
|
+
|
|
51
|
+
function importRows(data: { totalImported: number; totalErrors: number; results: ImportOutcome }): DisplayRow[] {
|
|
52
|
+
const rows: DisplayRow[] = [];
|
|
53
|
+
data.results.forEach((result, i) => {
|
|
54
|
+
if (result.entries.length > 0) {
|
|
55
|
+
rows.push({ cells: [
|
|
56
|
+
{ field: `results.${i}.source.type`, text: ` ✅ ${result.source.type}: `, tone: 'ok' },
|
|
57
|
+
{ field: `results.${i}.entries.length`, text: `${result.entries.length} 条`, tone: 'ok' },
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
result.errors.forEach((err, j) => {
|
|
61
|
+
rows.push({ cells: [
|
|
62
|
+
{ field: `results.${i}.source.type`, text: ` ❌ ${result.source.type}: `, tone: 'error' },
|
|
63
|
+
{ field: `results.${i}.errors.${j}.message`, text: err.message, tone: 'error' },
|
|
64
|
+
] });
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
rows.push(blankLine(), { cells: [
|
|
68
|
+
{ label: '✅ 导入完成: ', tone: 'ok' },
|
|
69
|
+
{ field: 'totalImported', text: String(data.totalImported), tone: 'ok' },
|
|
70
|
+
{ label: ' 条,', tone: 'ok' },
|
|
71
|
+
{ field: 'totalErrors', text: String(data.totalErrors), tone: 'ok' },
|
|
72
|
+
{ label: ' 个错误', tone: 'ok' },
|
|
73
|
+
] });
|
|
74
|
+
return rows;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export async function knowledgeImport(
|
|
78
|
+
options: KnowledgeOptions & { sources?: string; reset?: boolean },
|
|
79
|
+
io: CommandIO = processIO,
|
|
80
|
+
): Promise<CommandResult> {
|
|
81
|
+
return emitKnowledgeView(io, options, await knowledgeImportView(options, io));
|
|
82
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* harness knowledge index 子命令(重建 _index.md 供 Agent grep,并同步 index.json;
|
|
3
|
+
* Phase 3 自 knowledge.ts 拆出,纯移位)
|
|
4
|
+
*
|
|
5
|
+
* 注意:本文件是 `index` 子命令的实现,不是 knowledge/ 目录的 barrel——子命令
|
|
6
|
+
* 实现由 definitions.ts 按 module+export 逐个懒加载引用,无聚合出口。
|
|
7
|
+
*
|
|
8
|
+
* 本文件只做「取数 + 声明两投影」:json 面正本在 `data`,人读排版在 `human()` 的
|
|
9
|
+
* display model。上色、json/人读分派、退出码、路径解析与 store 构造统一在
|
|
10
|
+
* knowledge-view.ts(harness#133,架构评审候选4)。
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import * as fs from 'fs';
|
|
14
|
+
import * as path from 'path';
|
|
15
|
+
import { KnowledgeIndexGenerator } from '../../../knowledge/index-generator';
|
|
16
|
+
import { processIO, type CommandIO, type CommandResult } from '../../command-contract';
|
|
17
|
+
import {
|
|
18
|
+
emitKnowledgeView,
|
|
19
|
+
openKnowledgeStore,
|
|
20
|
+
resolveKnowledgeBaseDir,
|
|
21
|
+
type DisplayModel,
|
|
22
|
+
type DisplayRow,
|
|
23
|
+
} from '../knowledge-view';
|
|
24
|
+
import type { KnowledgeDirOption, KnowledgeOptions } from './shared';
|
|
25
|
+
|
|
26
|
+
export function knowledgeIndexView(options: KnowledgeOptions & KnowledgeDirOption, io: CommandIO) {
|
|
27
|
+
const baseDir = resolveKnowledgeBaseDir(options, io);
|
|
28
|
+
const indexPath = path.join(baseDir, '_index.md');
|
|
29
|
+
const beforeSize = fs.existsSync(indexPath) ? fs.statSync(indexPath).size : 0;
|
|
30
|
+
|
|
31
|
+
const output = new KnowledgeIndexGenerator(baseDir).regenerate();
|
|
32
|
+
// Sync index.json from disk files (removes ghost entries from manual mv/rm)
|
|
33
|
+
openKnowledgeStore({ dir: baseDir }, io).rebuildIndex();
|
|
34
|
+
|
|
35
|
+
const afterSize = Buffer.byteLength(output, 'utf-8');
|
|
36
|
+
const lineCount = output.split('\n').filter(l => !l.startsWith('#')).length;
|
|
37
|
+
const data = { path: indexPath, entries: lineCount, size: afterSize, previousSize: beforeSize };
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
data,
|
|
41
|
+
human: (): DisplayModel => ({ sections: [{ rows: indexRows({ indexPath, afterSize, lineCount, beforeSize }) }] }),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function indexRows(shape: { indexPath: string; afterSize: number; lineCount: number; beforeSize: number }): DisplayRow[] {
|
|
46
|
+
const rows: DisplayRow[] = [
|
|
47
|
+
{ cells: [{ label: '📇 索引已重建', tone: 'heading' }] },
|
|
48
|
+
{ cells: [{ label: ' 路径: ', tone: 'muted' }, { field: 'path', text: shape.indexPath, tone: 'muted' }] },
|
|
49
|
+
{ cells: [{ label: ' 条目: ', tone: 'ok' }, { field: 'entries', text: String(shape.lineCount), tone: 'ok' }] },
|
|
50
|
+
{ cells: [{ label: ' 大小: ', tone: 'ok' }, { field: 'size', text: `${(shape.afterSize / 1024).toFixed(1)} KB`, tone: 'ok' }] },
|
|
51
|
+
];
|
|
52
|
+
if (shape.beforeSize > 0) {
|
|
53
|
+
rows.push({ cells: [{ label: ' 旧大小: ', tone: 'muted' }, { field: 'previousSize', text: `${(shape.beforeSize / 1024).toFixed(1)} KB`, tone: 'muted' }] });
|
|
54
|
+
}
|
|
55
|
+
return rows;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function knowledgeIndex(options: KnowledgeOptions & KnowledgeDirOption, io: CommandIO = processIO): CommandResult {
|
|
59
|
+
return emitKnowledgeView(io, options, knowledgeIndexView(options, io));
|
|
60
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* harness knowledge list 子命令(Phase 3 自 knowledge.ts 拆出,纯移位)
|
|
3
|
+
*
|
|
4
|
+
* 本文件只做「取数 + 声明两投影」:json 面正本在 `data`,人读排版在 `human()` 的
|
|
5
|
+
* display model。上色、label 映射、json/人读分派、退出码、路径解析与 store 构造
|
|
6
|
+
* 统一在 knowledge-view.ts(harness#133,架构评审候选4)。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { KnowledgeEntry, KnowledgeSubsystem, MaturityLevel, QueryFilter } from '../../../knowledge/types';
|
|
10
|
+
import { processIO, type CommandIO, type CommandResult } from '../../command-contract';
|
|
11
|
+
import {
|
|
12
|
+
blankLine,
|
|
13
|
+
emitKnowledgeView,
|
|
14
|
+
openKnowledgeStore,
|
|
15
|
+
toneForMaturity,
|
|
16
|
+
type DisplayModel,
|
|
17
|
+
type DisplayRow,
|
|
18
|
+
} from '../knowledge-view';
|
|
19
|
+
import type { KnowledgeOptions } from './shared';
|
|
20
|
+
|
|
21
|
+
function listFilter(options: KnowledgeListOptions): QueryFilter {
|
|
22
|
+
const filter: QueryFilter = { excludeArchived: false };
|
|
23
|
+
if (options.type) filter.types = options.type.split(',') as KnowledgeSubsystem[];
|
|
24
|
+
if (options.maturity) filter.maturity = options.maturity.split(',') as MaturityLevel[];
|
|
25
|
+
if (options.tag) filter.tags = options.tag.split(',');
|
|
26
|
+
return filter;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface KnowledgeListOptions extends KnowledgeOptions {
|
|
30
|
+
type?: string;
|
|
31
|
+
maturity?: string;
|
|
32
|
+
tag?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function knowledgeListView(options: KnowledgeListOptions, io: CommandIO) {
|
|
36
|
+
const entries = openKnowledgeStore(options, io).list(listFilter(options));
|
|
37
|
+
const data = { total: entries.length, entries };
|
|
38
|
+
|
|
39
|
+
return { data, human: (): DisplayModel => ({ sections: [{ rows: listRows(entries) }] }) };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function listRows(entries: KnowledgeEntry[]): DisplayRow[] {
|
|
43
|
+
if (entries.length === 0) {
|
|
44
|
+
return [{ cells: [{ label: '知识库为空', tone: 'warn' }] }];
|
|
45
|
+
}
|
|
46
|
+
const rows: DisplayRow[] = [
|
|
47
|
+
{ cells: [
|
|
48
|
+
{ label: '📚 知识库 (', tone: 'heading' },
|
|
49
|
+
{ field: 'total', text: String(entries.length), tone: 'heading' },
|
|
50
|
+
{ label: ' 条)', tone: 'heading' },
|
|
51
|
+
] },
|
|
52
|
+
blankLine(),
|
|
53
|
+
];
|
|
54
|
+
entries.forEach((entry, i) => {
|
|
55
|
+
rows.push({ cells: [
|
|
56
|
+
{ field: `entries.${i}.maturity`, text: ` [${entry.maturity}]`, tone: toneForMaturity(entry.maturity) },
|
|
57
|
+
{ field: `entries.${i}.title`, text: ` ${entry.title}`, tone: 'emph' },
|
|
58
|
+
] });
|
|
59
|
+
rows.push({ cells: [
|
|
60
|
+
{ field: `entries.${i}.id`, text: ` id: ${entry.id}`, tone: 'muted' },
|
|
61
|
+
{ field: `entries.${i}.type`, text: ` | type: ${entry.type}`, tone: 'muted' },
|
|
62
|
+
{ field: `entries.${i}.layer`, text: ` | layer: ${entry.layer}`, tone: 'muted' },
|
|
63
|
+
] });
|
|
64
|
+
if (entry.tags.length > 0) {
|
|
65
|
+
rows.push({ cells: [{ field: `entries.${i}.tags`, text: ` tags: ${entry.tags.join(', ')}`, tone: 'muted' }] });
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return rows;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function knowledgeList(options: KnowledgeListOptions, io: CommandIO = processIO): Promise<CommandResult> {
|
|
72
|
+
return emitKnowledgeView(io, options, knowledgeListView(options, io));
|
|
73
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* harness knowledge migrate 子命令(为现有条目补 AS-021 新字段;Phase 3 自 knowledge.ts 拆出,纯移位)
|
|
3
|
+
*
|
|
4
|
+
* 本文件只做「取数 + 声明两投影」:json 面正本在 `data`,人读排版在 `human()` 的
|
|
5
|
+
* display model。上色、json/人读分派、退出码、路径解析统一在 knowledge-view.ts
|
|
6
|
+
* (harness#133,架构评审候选4)。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { migrateKnowledgeEntries } from '../../../knowledge/migration';
|
|
10
|
+
import { processIO, type CommandIO, type CommandResult } from '../../command-contract';
|
|
11
|
+
import {
|
|
12
|
+
blankLine,
|
|
13
|
+
emitKnowledgeView,
|
|
14
|
+
resolveKnowledgeBaseDir,
|
|
15
|
+
type DisplayModel,
|
|
16
|
+
type DisplayRow,
|
|
17
|
+
type KnowledgeView,
|
|
18
|
+
} from '../knowledge-view';
|
|
19
|
+
import type { KnowledgeDirOption, KnowledgeOptions } from './shared';
|
|
20
|
+
|
|
21
|
+
/** migrateKnowledgeEntries 的返回面 = migrate 的 json 正本(该类型未从 knowledge/migration 导出,此处同构声明) */
|
|
22
|
+
type MigrateResult = { total: number; migrated: number; skipped: number; errors: string[] };
|
|
23
|
+
|
|
24
|
+
export function knowledgeMigrateView(options: KnowledgeOptions & KnowledgeDirOption, io: CommandIO): KnowledgeView<MigrateResult> {
|
|
25
|
+
const result = migrateKnowledgeEntries(resolveKnowledgeBaseDir(options, io));
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
data: result,
|
|
29
|
+
human: (): DisplayModel => ({ sections: [{ rows: migrateRows(result) }] }),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function migrateRows(result: MigrateResult): DisplayRow[] {
|
|
34
|
+
const rows: DisplayRow[] = [
|
|
35
|
+
{ cells: [{ label: '🔄 迁移知识条目(添加 consumptionMode/origin 字段)', tone: 'heading' }] },
|
|
36
|
+
blankLine(),
|
|
37
|
+
{ cells: [{ label: ' 总计: ', tone: 'ok' }, { field: 'total', text: String(result.total), tone: 'ok' }, { label: ' 条', tone: 'ok' }] },
|
|
38
|
+
{ cells: [{ label: ' 已迁移: ', tone: 'ok' }, { field: 'migrated', text: String(result.migrated), tone: 'ok' }, { label: ' 条', tone: 'ok' }] },
|
|
39
|
+
{ cells: [{ label: ' 已跳过: ', tone: 'muted' }, { field: 'skipped', text: String(result.skipped), tone: 'muted' }, { label: ' 条', tone: 'muted' }] },
|
|
40
|
+
];
|
|
41
|
+
if (result.errors.length > 0) {
|
|
42
|
+
rows.push(
|
|
43
|
+
blankLine(),
|
|
44
|
+
{ cells: [{ label: ' 错误: ', tone: 'error' }, { field: 'errors.length', text: String(result.errors.length), tone: 'error' }, { label: ' 条', tone: 'error' }] },
|
|
45
|
+
);
|
|
46
|
+
result.errors.slice(0, 5).forEach((err, i) => {
|
|
47
|
+
rows.push({ cells: [{ label: ' ' }, { field: `errors.${i}`, text: err, tone: 'error' }] });
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// 两种收尾语各自带一个前导空行;migrated=0 且有错误时历史上两句都不打
|
|
51
|
+
if (result.migrated === 0 && result.errors.length === 0) {
|
|
52
|
+
rows.push(blankLine(), { cells: [{ label: '✅ 所有条目已是最新,无需迁移', tone: 'ok' }] });
|
|
53
|
+
} else if (result.migrated > 0) {
|
|
54
|
+
rows.push(blankLine(), { cells: [{ label: '✅ 迁移完成', tone: 'ok' }] });
|
|
55
|
+
}
|
|
56
|
+
return rows;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function knowledgeMigrate(options: KnowledgeOptions & KnowledgeDirOption, io: CommandIO = processIO): CommandResult {
|
|
60
|
+
return emitKnowledgeView(io, options, knowledgeMigrateView(options, io));
|
|
61
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* harness knowledge search 子命令(Phase 3 自 knowledge.ts 拆出,纯移位)
|
|
3
|
+
*
|
|
4
|
+
* 本文件只做「取数 + 声明两投影」:json 面正本在 `data`,人读排版在 `human()` 的
|
|
5
|
+
* display model。上色、label 映射、json/人读分派、退出码、路径解析与 store 构造
|
|
6
|
+
* 统一在 knowledge-view.ts(harness#133,架构评审候选4)。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { KnowledgeQuery } from '../../../knowledge/query';
|
|
10
|
+
import type { KnowledgeEntry } from '../../../knowledge/types';
|
|
11
|
+
import { logError, processIO, type CommandIO, type CommandResult } from '../../command-contract';
|
|
12
|
+
import { numericFlagMessage, parseNumericFlag } from '../../../utils/numeric-flag';
|
|
13
|
+
import {
|
|
14
|
+
blankLine,
|
|
15
|
+
emitKnowledgeView,
|
|
16
|
+
openKnowledgeStore,
|
|
17
|
+
type DisplayModel,
|
|
18
|
+
type DisplayRow,
|
|
19
|
+
} from '../knowledge-view';
|
|
20
|
+
import type { KnowledgeOptions } from './shared';
|
|
21
|
+
|
|
22
|
+
export function knowledgeSearchView(
|
|
23
|
+
query: string,
|
|
24
|
+
options: KnowledgeOptions & { limit?: number },
|
|
25
|
+
io: CommandIO,
|
|
26
|
+
) {
|
|
27
|
+
const store = openKnowledgeStore(options, io);
|
|
28
|
+
const matched = new KnowledgeQuery(store).search(query, { limit: options.limit ?? 20 });
|
|
29
|
+
const data = { query, total: matched.length, entries: matched };
|
|
30
|
+
|
|
31
|
+
return { data, human: (): DisplayModel => ({ sections: [{ rows: searchRows(query, matched) }] }) };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function searchRows(query: string, matched: KnowledgeEntry[]): DisplayRow[] {
|
|
35
|
+
if (matched.length === 0) {
|
|
36
|
+
return [{ cells: [{ label: `未找到匹配 "${query}" 的知识条目`, tone: 'warn' }] }];
|
|
37
|
+
}
|
|
38
|
+
const rows: DisplayRow[] = [
|
|
39
|
+
{ cells: [
|
|
40
|
+
{ label: '🔍 搜索 "', tone: 'heading' },
|
|
41
|
+
{ field: 'query', text: query, tone: 'heading' },
|
|
42
|
+
{ label: '" (', tone: 'heading' },
|
|
43
|
+
{ field: 'total', text: String(matched.length), tone: 'heading' },
|
|
44
|
+
{ label: ' 条结果)', tone: 'heading' },
|
|
45
|
+
] },
|
|
46
|
+
blankLine(),
|
|
47
|
+
];
|
|
48
|
+
matched.forEach((entry, i) => {
|
|
49
|
+
const preview = entry.content.slice(0, 100).replace(/\n/g, ' ') + (entry.content.length > 100 ? '...' : '');
|
|
50
|
+
rows.push({ cells: [
|
|
51
|
+
{ field: `entries.${i}.title`, text: ` ${entry.title}`, tone: 'emph' },
|
|
52
|
+
{ field: `entries.${i}.maturity`, text: ` [${entry.maturity}]`, tone: 'muted' },
|
|
53
|
+
] });
|
|
54
|
+
rows.push({ cells: [{ field: `entries.${i}.content`, text: ` ${preview}`, tone: 'muted' }] });
|
|
55
|
+
});
|
|
56
|
+
return rows;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function knowledgeSearch(
|
|
60
|
+
query: string,
|
|
61
|
+
options: KnowledgeOptions & { limit?: number },
|
|
62
|
+
io: CommandIO = processIO,
|
|
63
|
+
): Promise<CommandResult> {
|
|
64
|
+
return emitKnowledgeView(io, options, knowledgeSearchView(query, options, io));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* knowledge search 子命令入口(候选7):缺参闸门 + limit 装配窄化,
|
|
69
|
+
* 自 definitions.ts 的 args 复印块移回命令模块(interface/测试面所在)。
|
|
70
|
+
* `--limit` 给到的恒是字符串(缺省 '20' 也是),脏输入 fail-loud(harness#154,
|
|
71
|
+
* 原先 parseInt 出 NaN 被下游 `|| 20` 静默兜成缺省量)。
|
|
72
|
+
*/
|
|
73
|
+
export async function knowledgeSearchCommand(
|
|
74
|
+
positionals: (string | undefined)[],
|
|
75
|
+
options: Record<string, unknown>,
|
|
76
|
+
io: CommandIO = processIO,
|
|
77
|
+
): Promise<CommandResult> {
|
|
78
|
+
const query = positionals[0];
|
|
79
|
+
if (!query) {
|
|
80
|
+
logError(io, '请提供搜索关键词');
|
|
81
|
+
return { kind: 'usage-error', reason: 'knowledge search 缺少关键词位置参数' };
|
|
82
|
+
}
|
|
83
|
+
const limit = parseNumericFlag(options.limit as string | undefined, 'int');
|
|
84
|
+
if (!limit.ok) {
|
|
85
|
+
logError(io, numericFlagMessage('--limit', limit.raw, 'int'));
|
|
86
|
+
return { kind: 'usage-error', reason: `knowledge search --limit 非法限制: "${limit.raw}"` };
|
|
87
|
+
}
|
|
88
|
+
return knowledgeSearch(String(query), {
|
|
89
|
+
projectPath: options.projectPath as string | undefined,
|
|
90
|
+
json: options.json as boolean | undefined,
|
|
91
|
+
limit: limit.value,
|
|
92
|
+
}, io);
|
|
93
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* knowledge 子命令共享的入参面(Phase 3:原 knowledge.ts 的公共类型,纯移位)
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface KnowledgeOptions {
|
|
6
|
+
/** 项目路径 */
|
|
7
|
+
projectPath?: string;
|
|
8
|
+
/** 输出 JSON 格式 */
|
|
9
|
+
json?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** 子操作共用的入参面:知识库目录覆盖(audit/snapshot/migrate/index/health 收) */
|
|
13
|
+
export type KnowledgeDirOption = { dir?: string };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* harness knowledge snapshot 子命令(KR4 存活率追踪;Phase 3 自 knowledge.ts 拆出,纯移位)
|
|
3
|
+
*
|
|
4
|
+
* 本文件只做「取数 + 声明两投影」:json 面正本在 `data`,人读排版在 `human()` 的
|
|
5
|
+
* display model。上色、json/人读分派、退出码、路径解析与 store 构造统一在
|
|
6
|
+
* knowledge-view.ts(harness#133,架构评审候选4)。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { processIO, type CommandIO, type CommandResult } from '../../command-contract';
|
|
10
|
+
import {
|
|
11
|
+
emitKnowledgeView,
|
|
12
|
+
openKnowledgeStore,
|
|
13
|
+
type DisplayModel,
|
|
14
|
+
} from '../knowledge-view';
|
|
15
|
+
import type { KnowledgeDirOption, KnowledgeOptions } from './shared';
|
|
16
|
+
|
|
17
|
+
export function knowledgeSnapshotView(options: KnowledgeOptions & KnowledgeDirOption, io: CommandIO) {
|
|
18
|
+
const snapshotPath = openKnowledgeStore(options, io).snapshot();
|
|
19
|
+
const data = { snapshotPath };
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
data,
|
|
23
|
+
human: (): DisplayModel => ({
|
|
24
|
+
sections: [{
|
|
25
|
+
rows: [{
|
|
26
|
+
cells: [
|
|
27
|
+
{ label: '✅ 快照已保存: ', tone: 'ok' },
|
|
28
|
+
{ field: 'snapshotPath', text: snapshotPath, tone: 'ok' },
|
|
29
|
+
],
|
|
30
|
+
}],
|
|
31
|
+
}],
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function knowledgeSnapshot(options: KnowledgeOptions & KnowledgeDirOption, io: CommandIO = processIO): CommandResult {
|
|
37
|
+
return emitKnowledgeView(io, options, knowledgeSnapshotView(options, io));
|
|
38
|
+
}
|