@dommaker/harness 0.16.6 → 0.16.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +54 -14
- package/bin/harness.js +56 -96
- package/dist/architecture/constraint-engine.d.ts.map +1 -1
- package/dist/architecture/constraint-engine.js +0 -4
- package/dist/architecture/constraint-engine.js.map +1 -1
- package/dist/architecture/cross-project-checker.d.ts.map +1 -1
- package/dist/architecture/cross-project-checker.js +5 -25
- package/dist/architecture/cross-project-checker.js.map +1 -1
- package/dist/cli/commands/analyze-sessions.d.ts +2 -0
- package/dist/cli/commands/analyze-sessions.d.ts.map +1 -1
- package/dist/cli/commands/analyze-sessions.js +25 -181
- package/dist/cli/commands/analyze-sessions.js.map +1 -1
- package/dist/cli/commands/check.d.ts +1 -0
- package/dist/cli/commands/check.d.ts.map +1 -1
- package/dist/cli/commands/check.js +24 -216
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/doc-freshness-check.d.ts.map +1 -1
- package/dist/cli/commands/doc-freshness-check.js +14 -28
- package/dist/cli/commands/doc-freshness-check.js.map +1 -1
- package/dist/cli/commands/flow.d.ts.map +1 -1
- package/dist/cli/commands/flow.js +2 -1
- package/dist/cli/commands/flow.js.map +1 -1
- package/dist/cli/commands/init.js +2 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/posteval-plan.d.ts.map +1 -1
- package/dist/cli/commands/posteval-plan.js +0 -1
- package/dist/cli/commands/posteval-plan.js.map +1 -1
- package/dist/cli/commands/release.js +1 -1
- package/dist/cli/commands/release.js.map +1 -1
- package/dist/cli/commands/report.d.ts.map +1 -1
- package/dist/cli/commands/report.js +2 -0
- package/dist/cli/commands/report.js.map +1 -1
- package/dist/cli/commands/spec-baseline-check.d.ts.map +1 -1
- package/dist/cli/commands/spec-baseline-check.js +12 -23
- package/dist/cli/commands/spec-baseline-check.js.map +1 -1
- package/dist/cli/commands/sync-docs/agents-syncer.d.ts +19 -0
- package/dist/cli/commands/sync-docs/agents-syncer.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/agents-syncer.js +288 -0
- package/dist/cli/commands/sync-docs/agents-syncer.js.map +1 -0
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts +37 -0
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/capabilities-syncer.js +235 -0
- package/dist/cli/commands/sync-docs/capabilities-syncer.js.map +1 -0
- package/dist/cli/commands/sync-docs/context-syncer.d.ts +17 -0
- package/dist/cli/commands/sync-docs/context-syncer.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/context-syncer.js +143 -0
- package/dist/cli/commands/sync-docs/context-syncer.js.map +1 -0
- package/dist/cli/commands/{sync-docs.d.ts → sync-docs/index.d.ts} +9 -2
- package/dist/cli/commands/sync-docs/index.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/index.js +338 -0
- package/dist/cli/commands/sync-docs/index.js.map +1 -0
- package/dist/cli/commands/sync-docs/preserve-block.d.ts +24 -0
- package/dist/cli/commands/sync-docs/preserve-block.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/preserve-block.js +55 -0
- package/dist/cli/commands/sync-docs/preserve-block.js.map +1 -0
- package/dist/cli/commands/sync-docs/project-reader.d.ts +41 -0
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/project-reader.js +183 -0
- package/dist/cli/commands/sync-docs/project-reader.js.map +1 -0
- package/dist/cli/commands/update-user-model.d.ts +2 -0
- package/dist/cli/commands/update-user-model.d.ts.map +1 -1
- package/dist/cli/commands/update-user-model.js +19 -90
- package/dist/cli/commands/update-user-model.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +3 -0
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +6 -39
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/session-mining/corrections.d.ts +17 -0
- package/dist/cli/session-mining/corrections.d.ts.map +1 -0
- package/dist/cli/session-mining/corrections.js +58 -0
- package/dist/cli/session-mining/corrections.js.map +1 -0
- package/dist/cli/session-mining/index.d.ts +13 -0
- package/dist/cli/session-mining/index.d.ts.map +1 -0
- package/dist/{core/spec → cli/session-mining}/index.js +9 -3
- package/dist/cli/session-mining/index.js.map +1 -0
- package/dist/cli/session-mining/text.d.ts +31 -0
- package/dist/cli/session-mining/text.d.ts.map +1 -0
- package/dist/cli/session-mining/text.js +126 -0
- package/dist/cli/session-mining/text.js.map +1 -0
- package/dist/cli/session-mining/transcript.d.ts +28 -0
- package/dist/cli/session-mining/transcript.d.ts.map +1 -0
- package/dist/cli/session-mining/transcript.js +123 -0
- package/dist/cli/session-mining/transcript.js.map +1 -0
- package/dist/constraints/lifecycle-runner.d.ts +1 -1
- package/dist/constraints/lifecycle-runner.d.ts.map +1 -1
- package/dist/context/compaction.d.ts.map +1 -1
- package/dist/context/compaction.js +2 -3
- package/dist/context/compaction.js.map +1 -1
- package/dist/context/knowledge-injector.d.ts.map +1 -1
- package/dist/context/tool-output-budget.d.ts +1 -1
- package/dist/context/tool-output-budget.d.ts.map +1 -1
- package/dist/context/tool-output-budget.js +1 -1
- package/dist/context/tool-output-budget.js.map +1 -1
- package/dist/core/constraints/capabilities-parser.d.ts +24 -0
- package/dist/core/constraints/capabilities-parser.d.ts.map +1 -0
- package/dist/core/constraints/capabilities-parser.js +95 -0
- package/dist/core/constraints/capabilities-parser.js.map +1 -0
- package/dist/core/constraints/checker.d.ts +37 -100
- package/dist/core/constraints/checker.d.ts.map +1 -1
- package/dist/core/constraints/checker.js +150 -737
- package/dist/core/constraints/checker.js.map +1 -1
- package/dist/core/constraints/checkers/always-pass.d.ts +17 -0
- package/dist/core/constraints/checkers/always-pass.d.ts.map +1 -0
- package/dist/core/constraints/checkers/always-pass.js +23 -0
- package/dist/core/constraints/checkers/always-pass.js.map +1 -0
- package/dist/core/constraints/checkers/capability-sync.d.ts +10 -0
- package/dist/core/constraints/checkers/capability-sync.d.ts.map +1 -0
- package/dist/core/constraints/checkers/capability-sync.js +60 -0
- package/dist/core/constraints/checkers/capability-sync.js.map +1 -0
- package/dist/core/constraints/checkers/context-doc-sync.d.ts +6 -0
- package/dist/core/constraints/checkers/context-doc-sync.d.ts.map +1 -0
- package/dist/core/constraints/checkers/context-doc-sync.js +35 -0
- package/dist/core/constraints/checkers/context-doc-sync.js.map +1 -0
- package/dist/core/constraints/checkers/docs-freshness.d.ts +10 -0
- package/dist/core/constraints/checkers/docs-freshness.d.ts.map +1 -0
- package/dist/core/constraints/checkers/docs-freshness.js +111 -0
- package/dist/core/constraints/checkers/docs-freshness.js.map +1 -0
- package/dist/core/constraints/checkers/guideline-flags.d.ts +9 -0
- package/dist/core/constraints/checkers/guideline-flags.d.ts.map +1 -0
- package/dist/core/constraints/checkers/guideline-flags.js +13 -0
- package/dist/core/constraints/checkers/guideline-flags.js.map +1 -0
- package/dist/core/constraints/checkers/index.d.ts +17 -0
- package/dist/core/constraints/checkers/index.d.ts.map +1 -0
- package/dist/core/constraints/checkers/index.js +82 -0
- package/dist/core/constraints/checkers/index.js.map +1 -0
- package/dist/core/constraints/checkers/iron-flags.d.ts +14 -0
- package/dist/core/constraints/checkers/iron-flags.d.ts.map +1 -0
- package/dist/core/constraints/checkers/iron-flags.js +24 -0
- package/dist/core/constraints/checkers/iron-flags.js.map +1 -0
- package/dist/core/constraints/checkers/no-any-type.d.ts +6 -0
- package/dist/core/constraints/checkers/no-any-type.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-any-type.js +42 -0
- package/dist/core/constraints/checkers/no-any-type.js.map +1 -0
- package/dist/core/constraints/checkers/no-bypass-checkpoint.d.ts +6 -0
- package/dist/core/constraints/checkers/no-bypass-checkpoint.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-bypass-checkpoint.js +40 -0
- package/dist/core/constraints/checkers/no-bypass-checkpoint.js.map +1 -0
- package/dist/core/constraints/checkers/no-excuse-patterns.d.ts +6 -0
- package/dist/core/constraints/checkers/no-excuse-patterns.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-excuse-patterns.js +25 -0
- package/dist/core/constraints/checkers/no-excuse-patterns.js.map +1 -0
- package/dist/core/constraints/checkers/no-fuzzy-completion-claim.d.ts +6 -0
- package/dist/core/constraints/checkers/no-fuzzy-completion-claim.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-fuzzy-completion-claim.js +34 -0
- package/dist/core/constraints/checkers/no-fuzzy-completion-claim.js.map +1 -0
- package/dist/core/constraints/checkers/no-performative-agreement.d.ts +8 -0
- package/dist/core/constraints/checkers/no-performative-agreement.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-performative-agreement.js +23 -0
- package/dist/core/constraints/checkers/no-performative-agreement.js.map +1 -0
- package/dist/core/constraints/checkers/no-simplification-without-approval.d.ts +6 -0
- package/dist/core/constraints/checkers/no-simplification-without-approval.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-simplification-without-approval.js +30 -0
- package/dist/core/constraints/checkers/no-simplification-without-approval.js.map +1 -0
- package/dist/core/constraints/checkers/no-test-simplification.d.ts +6 -0
- package/dist/core/constraints/checkers/no-test-simplification.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-test-simplification.js +29 -0
- package/dist/core/constraints/checkers/no-test-simplification.js.map +1 -0
- package/dist/core/constraints/checkers/test-coverage.d.ts +6 -0
- package/dist/core/constraints/checkers/test-coverage.d.ts.map +1 -0
- package/dist/core/constraints/checkers/test-coverage.js +33 -0
- package/dist/core/constraints/checkers/test-coverage.js.map +1 -0
- package/dist/core/constraints/checkers/types.d.ts +43 -0
- package/dist/core/constraints/checkers/types.d.ts.map +1 -0
- package/dist/core/constraints/checkers/types.js +23 -0
- package/dist/core/constraints/checkers/types.js.map +1 -0
- package/dist/core/constraints/checkers/yagni.d.ts +8 -0
- package/dist/core/constraints/checkers/yagni.d.ts.map +1 -0
- package/dist/core/constraints/checkers/yagni.js +96 -0
- package/dist/core/constraints/checkers/yagni.js.map +1 -0
- package/dist/core/constraints/context-builder.d.ts +67 -0
- package/dist/core/constraints/context-builder.d.ts.map +1 -0
- package/dist/core/constraints/context-builder.js +294 -0
- package/dist/core/constraints/context-builder.js.map +1 -0
- package/dist/core/constraints/definitions/guidelines.d.ts +7 -0
- package/dist/core/constraints/definitions/guidelines.d.ts.map +1 -0
- package/dist/core/constraints/definitions/guidelines.js +641 -0
- package/dist/core/constraints/definitions/guidelines.js.map +1 -0
- package/dist/core/constraints/definitions/iron-laws.d.ts +7 -0
- package/dist/core/constraints/definitions/iron-laws.d.ts.map +1 -0
- package/dist/core/constraints/definitions/iron-laws.js +322 -0
- package/dist/core/constraints/definitions/iron-laws.js.map +1 -0
- package/dist/core/constraints/definitions/tips.d.ts +7 -0
- package/dist/core/constraints/definitions/tips.d.ts.map +1 -0
- package/dist/core/constraints/definitions/tips.js +62 -0
- package/dist/core/constraints/definitions/tips.js.map +1 -0
- package/dist/core/constraints/definitions.d.ts +8 -21
- package/dist/core/constraints/definitions.d.ts.map +1 -1
- package/dist/core/constraints/definitions.js +15 -1048
- package/dist/core/constraints/definitions.js.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.d.ts.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.js +0 -1
- package/dist/core/constraints/doc-freshness/runner.js.map +1 -1
- package/dist/core/constraints/index.d.ts +4 -5
- package/dist/core/constraints/index.d.ts.map +1 -1
- package/dist/core/constraints/index.js +1 -16
- package/dist/core/constraints/index.js.map +1 -1
- package/dist/core/constraints/interceptor.d.ts.map +1 -1
- package/dist/core/constraints/interceptor.js.map +1 -1
- package/dist/core/index.js +0 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/project-config-loader.d.ts +6 -4
- package/dist/core/project-config-loader.d.ts.map +1 -1
- package/dist/core/project-config-loader.js +46 -13
- package/dist/core/project-config-loader.js.map +1 -1
- package/dist/core/validators/check-handlers/command.d.ts +7 -0
- package/dist/core/validators/check-handlers/command.d.ts.map +1 -0
- package/dist/core/validators/check-handlers/command.js +58 -0
- package/dist/core/validators/check-handlers/command.js.map +1 -0
- package/dist/core/validators/check-handlers/file.d.ts +10 -0
- package/dist/core/validators/check-handlers/file.d.ts.map +1 -0
- package/dist/core/validators/check-handlers/file.js +128 -0
- package/dist/core/validators/check-handlers/file.js.map +1 -0
- package/dist/core/validators/check-handlers/http.d.ts +7 -0
- package/dist/core/validators/check-handlers/http.d.ts.map +1 -0
- package/dist/core/validators/check-handlers/http.js +88 -0
- package/dist/core/validators/check-handlers/http.js.map +1 -0
- package/dist/core/validators/check-handlers/output.d.ts +15 -0
- package/dist/core/validators/check-handlers/output.d.ts.map +1 -0
- package/dist/core/validators/check-handlers/output.js +152 -0
- package/dist/core/validators/check-handlers/output.js.map +1 -0
- package/dist/core/validators/checkpoint.d.ts +4 -72
- package/dist/core/validators/checkpoint.d.ts.map +1 -1
- package/dist/core/validators/checkpoint.js +21 -400
- package/dist/core/validators/checkpoint.js.map +1 -1
- package/dist/core/validators/cso.js +1 -1
- package/dist/core/validators/cso.js.map +1 -1
- package/dist/core/validators/passes-gate.js +2 -2
- package/dist/core/validators/passes-gate.js.map +1 -1
- package/dist/dashboard/stats.d.ts.map +1 -1
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/evolution/auto-evolve.d.ts +1 -2
- package/dist/evolution/auto-evolve.d.ts.map +1 -1
- package/dist/evolution/auto-evolve.js +2 -1
- package/dist/evolution/auto-evolve.js.map +1 -1
- package/dist/failure/types.d.ts +5 -85
- package/dist/failure/types.d.ts.map +1 -1
- package/dist/failure/types.js +19 -115
- package/dist/failure/types.js.map +1 -1
- package/dist/gates/contract.d.ts.map +1 -1
- package/dist/gates/contract.js.map +1 -1
- package/dist/gates/index.d.ts.map +1 -1
- package/dist/gates/index.js.map +1 -1
- package/dist/gates/performance.js +1 -1
- package/dist/gates/performance.js.map +1 -1
- package/dist/gates/security.d.ts.map +1 -1
- package/dist/gates/security.js +1 -1
- package/dist/gates/security.js.map +1 -1
- package/dist/hooks/bootstrap.d.ts.map +1 -1
- package/dist/hooks/bootstrap.js +6 -48
- package/dist/hooks/bootstrap.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/knowledge/audit.d.ts.map +1 -1
- package/dist/knowledge/doctor.d.ts.map +1 -1
- package/dist/knowledge/doctor.js.map +1 -1
- package/dist/knowledge/import.d.ts.map +1 -1
- package/dist/knowledge/import.js +1 -1
- package/dist/knowledge/import.js.map +1 -1
- package/dist/knowledge/index-generator.d.ts.map +1 -1
- package/dist/knowledge/index-generator.js +0 -1
- package/dist/knowledge/index-generator.js.map +1 -1
- package/dist/knowledge/ingest.d.ts.map +1 -1
- package/dist/knowledge/ingest.js +1 -1
- package/dist/knowledge/ingest.js.map +1 -1
- package/dist/knowledge/lint.d.ts +1 -1
- package/dist/knowledge/lint.d.ts.map +1 -1
- package/dist/knowledge/lint.js +2 -2
- package/dist/knowledge/lint.js.map +1 -1
- package/dist/knowledge/primitives/code-structure.d.ts.map +1 -1
- package/dist/knowledge/primitives/code-structure.js +29 -12
- package/dist/knowledge/primitives/code-structure.js.map +1 -1
- package/dist/knowledge/query.d.ts.map +1 -1
- package/dist/knowledge/query.js.map +1 -1
- package/dist/knowledge/store.d.ts.map +1 -1
- package/dist/llm/adapter.d.ts +3 -3
- package/dist/llm/adapter.d.ts.map +1 -1
- package/dist/llm/adapter.js +3 -3
- package/dist/llm/adapter.js.map +1 -1
- package/dist/monitoring/analyzer-base.d.ts +50 -0
- package/dist/monitoring/analyzer-base.d.ts.map +1 -0
- package/dist/monitoring/analyzer-base.js +146 -0
- package/dist/monitoring/analyzer-base.js.map +1 -0
- package/dist/monitoring/constraint-doctor.d.ts +3 -46
- package/dist/monitoring/constraint-doctor.d.ts.map +1 -1
- package/dist/monitoring/constraint-doctor.js +11 -113
- package/dist/monitoring/constraint-doctor.js.map +1 -1
- package/dist/monitoring/constraint-evolver.d.ts +9 -63
- package/dist/monitoring/constraint-evolver.d.ts.map +1 -1
- package/dist/monitoring/constraint-evolver.js +8 -10
- package/dist/monitoring/constraint-evolver.js.map +1 -1
- package/dist/monitoring/diagnosis-rules.d.ts +18 -0
- package/dist/monitoring/diagnosis-rules.d.ts.map +1 -0
- package/dist/monitoring/diagnosis-rules.js +119 -0
- package/dist/monitoring/diagnosis-rules.js.map +1 -0
- package/dist/monitoring/knowledge-doctor.d.ts.map +1 -1
- package/dist/monitoring/knowledge-doctor.js.map +1 -1
- package/dist/monitoring/performance-analyzer.d.ts +0 -12
- package/dist/monitoring/performance-analyzer.d.ts.map +1 -1
- package/dist/monitoring/performance-analyzer.js +13 -93
- package/dist/monitoring/performance-analyzer.js.map +1 -1
- package/dist/monitoring/performance-collector.d.ts +0 -8
- package/dist/monitoring/performance-collector.d.ts.map +1 -1
- package/dist/monitoring/performance-collector.js +0 -21
- package/dist/monitoring/performance-collector.js.map +1 -1
- package/dist/monitoring/trace-analyzer.d.ts +0 -8
- package/dist/monitoring/trace-analyzer.d.ts.map +1 -1
- package/dist/monitoring/trace-analyzer.js +9 -91
- package/dist/monitoring/trace-analyzer.js.map +1 -1
- package/dist/presets/index.d.ts +1 -1
- package/dist/presets/index.d.ts.map +1 -1
- package/dist/presets/index.js +1 -4
- package/dist/presets/index.js.map +1 -1
- package/dist/presets/standard.d.ts +0 -9
- package/dist/presets/standard.d.ts.map +1 -1
- package/dist/presets/standard.js +1 -16
- package/dist/presets/standard.js.map +1 -1
- package/dist/safety/output-guardrail.d.ts +0 -1
- package/dist/safety/output-guardrail.d.ts.map +1 -1
- package/dist/safety/output-guardrail.js +0 -3
- package/dist/safety/output-guardrail.js.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/types/constraint.d.ts +5 -59
- package/dist/types/constraint.d.ts.map +1 -1
- package/dist/types/constraint.js +1 -39
- package/dist/types/constraint.js.map +1 -1
- package/dist/types/failure.d.ts +89 -0
- package/dist/types/failure.d.ts.map +1 -0
- package/dist/types/failure.js +121 -0
- package/dist/types/failure.js.map +1 -0
- package/dist/types/index.d.ts +2 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +7 -6
- package/dist/types/index.js.map +1 -1
- package/dist/types/monitoring-types.d.ts +114 -0
- package/dist/types/monitoring-types.d.ts.map +1 -0
- package/dist/types/monitoring-types.js +10 -0
- package/dist/types/monitoring-types.js.map +1 -0
- package/dist/utils/detect-source-roots.js.map +1 -1
- package/dist/utils/file-walk.d.ts +33 -0
- package/dist/utils/file-walk.d.ts.map +1 -0
- package/dist/utils/file-walk.js +89 -0
- package/dist/utils/file-walk.js.map +1 -0
- package/dist/verification/rules-based.d.ts.map +1 -1
- package/dist/verification/rules-based.js.map +1 -1
- package/package.json +3 -7
- package/src/__tests__/checker-extra.test.ts +0 -30
- package/src/__tests__/checker.test.ts +0 -33
- package/src/__tests__/checkpoint.test.ts +46 -46
- package/src/__tests__/constraint-evolver.test.ts +22 -21
- package/src/__tests__/doctor-evolver.test.ts +3 -3
- package/src/__tests__/iron-laws.test.ts +0 -27
- package/src/__tests__/presets.test.ts +1 -40
- package/src/architecture/constraint-engine.ts +0 -5
- package/src/architecture/cross-project-checker.ts +6 -24
- package/src/cli/commands/__tests__/check.test.ts +3 -1
- package/src/cli/commands/__tests__/sync-docs.test.ts +77 -0
- package/src/cli/commands/__tests__/validate.test.ts +5 -0
- package/src/cli/commands/analyze-sessions.ts +31 -185
- package/src/cli/commands/check.ts +26 -225
- package/src/cli/commands/doc-freshness-check.ts +14 -25
- package/src/cli/commands/flow.ts +5 -3
- package/src/cli/commands/init.ts +3 -3
- package/src/cli/commands/posteval-plan.ts +0 -1
- package/src/cli/commands/release.ts +1 -1
- package/src/cli/commands/report.ts +2 -0
- package/src/cli/commands/spec-baseline-check.ts +12 -19
- package/src/cli/commands/sync-docs/agents-syncer.ts +280 -0
- package/src/cli/commands/sync-docs/capabilities-syncer.ts +229 -0
- package/src/cli/commands/sync-docs/context-syncer.ts +108 -0
- package/src/cli/commands/sync-docs/index.ts +355 -0
- package/src/cli/commands/sync-docs/preserve-block.ts +59 -0
- package/src/cli/commands/sync-docs/project-reader.ts +163 -0
- package/src/cli/commands/update-user-model.ts +23 -87
- package/src/cli/commands/validate.ts +6 -40
- package/src/cli/session-mining/corrections.ts +56 -0
- package/src/cli/session-mining/index.ts +13 -0
- package/src/cli/session-mining/text.ts +117 -0
- package/src/cli/session-mining/transcript.ts +107 -0
- package/src/constraints/__tests__/lifecycle-runner.test.ts +1 -1
- package/src/constraints/lifecycle-runner.ts +1 -1
- package/src/context/compaction.ts +2 -3
- package/src/context/knowledge-injector.ts +1 -1
- package/src/context/tool-output-budget.ts +1 -1
- package/src/core/constraints/capabilities-parser.ts +70 -0
- package/src/core/constraints/checker.ts +170 -779
- package/src/core/constraints/checkers/always-pass.ts +22 -0
- package/src/core/constraints/checkers/capability-sync.ts +71 -0
- package/src/core/constraints/checkers/context-doc-sync.ts +36 -0
- package/src/core/constraints/checkers/docs-freshness.ts +116 -0
- package/src/core/constraints/checkers/guideline-flags.ts +30 -0
- package/src/core/constraints/checkers/index.ts +114 -0
- package/src/core/constraints/checkers/iron-flags.ts +62 -0
- package/src/core/constraints/checkers/no-any-type.ts +42 -0
- package/src/core/constraints/checkers/no-bypass-checkpoint.ts +40 -0
- package/src/core/constraints/checkers/no-excuse-patterns.ts +24 -0
- package/src/core/constraints/checkers/no-fuzzy-completion-claim.ts +33 -0
- package/src/core/constraints/checkers/no-performative-agreement.ts +22 -0
- package/src/core/constraints/checkers/no-simplification-without-approval.ts +29 -0
- package/src/core/constraints/checkers/no-test-simplification.ts +28 -0
- package/src/core/constraints/checkers/test-coverage.ts +35 -0
- package/src/core/constraints/checkers/types.ts +54 -0
- package/src/core/constraints/checkers/yagni.ts +65 -0
- package/src/core/constraints/context-builder.ts +262 -0
- package/src/core/constraints/definitions/guidelines.ts +668 -0
- package/src/core/constraints/definitions/iron-laws.ts +333 -0
- package/src/core/constraints/definitions/tips.ts +63 -0
- package/src/core/constraints/definitions.ts +9 -1086
- package/src/core/constraints/doc-freshness/runner.ts +2 -3
- package/src/core/constraints/index.ts +1 -27
- package/src/core/constraints/interceptor.ts +0 -2
- package/src/core/index.ts +1 -1
- package/src/core/project-config-loader.ts +49 -13
- package/src/core/validators/check-handlers/command.ts +58 -0
- package/src/core/validators/check-handlers/file.ts +104 -0
- package/src/core/validators/check-handlers/http.ts +88 -0
- package/src/core/validators/check-handlers/output.ts +165 -0
- package/src/core/validators/checkpoint.ts +32 -407
- package/src/core/validators/cso.ts +1 -1
- package/src/core/validators/passes-gate.ts +2 -2
- package/src/dashboard/stats.ts +1 -1
- package/src/dashboard/types.ts +1 -1
- package/src/evolution/__tests__/auto-evolve.test.ts +1 -2
- package/src/evolution/auto-evolve.ts +3 -3
- package/src/failure/types.ts +5 -161
- package/src/gates/contract.ts +0 -1
- package/src/gates/index.ts +0 -2
- package/src/gates/performance.ts +1 -1
- package/src/gates/security.ts +1 -3
- package/src/hooks/bootstrap.ts +6 -16
- package/src/index.ts +4 -1
- package/src/knowledge/__tests__/lifecycle.test.ts +4 -1
- package/src/knowledge/audit.ts +1 -1
- package/src/knowledge/doctor.ts +0 -1
- package/src/knowledge/import.ts +2 -2
- package/src/knowledge/index-generator.ts +0 -1
- package/src/knowledge/ingest.ts +1 -2
- package/src/knowledge/lint.ts +2 -2
- package/src/knowledge/primitives/__tests__/code-structure-degrade.test.ts +24 -0
- package/src/knowledge/primitives/code-structure.ts +36 -12
- package/src/knowledge/query.ts +0 -3
- package/src/knowledge/store.ts +1 -1
- package/src/llm/adapter.ts +3 -3
- package/src/monitoring/analyzer-base.ts +112 -0
- package/src/monitoring/constraint-doctor.ts +14 -175
- package/src/monitoring/constraint-evolver.ts +20 -92
- package/src/monitoring/diagnosis-rules.ts +132 -0
- package/src/monitoring/knowledge-doctor.ts +0 -1
- package/src/monitoring/performance-analyzer.ts +22 -72
- package/src/monitoring/performance-collector.ts +0 -22
- package/src/monitoring/trace-analyzer.ts +17 -73
- package/src/presets/__tests__/standard.test.ts +2 -17
- package/src/presets/index.ts +1 -3
- package/src/presets/standard.ts +1 -26
- package/src/safety/output-guardrail.ts +0 -4
- package/src/tools/registry.ts +1 -1
- package/src/types/__tests__/types.test.ts +1 -33
- package/src/types/constraint.ts +6 -75
- package/src/types/failure.ts +165 -0
- package/src/types/index.ts +7 -5
- package/src/types/monitoring-types.ts +150 -0
- package/src/utils/detect-source-roots.ts +1 -1
- package/src/utils/file-walk.ts +78 -0
- package/src/verification/rules-based.ts +0 -1
- package/bin/harness-knowledge-capture.js +0 -99
- package/bin/harness-knowledge-check.js +0 -164
- package/bin/harness-knowledge-track.js +0 -118
- package/dist/cli/commands/sync-docs.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs.js +0 -1074
- package/dist/cli/commands/sync-docs.js.map +0 -1
- package/dist/constraints/index.d.ts +0 -4
- package/dist/constraints/index.d.ts.map +0 -1
- package/dist/constraints/index.js +0 -20
- package/dist/constraints/index.js.map +0 -1
- package/dist/core/constraints/doc-freshness/auto-fix.d.ts +0 -23
- package/dist/core/constraints/doc-freshness/auto-fix.d.ts.map +0 -1
- package/dist/core/constraints/doc-freshness/auto-fix.js +0 -59
- package/dist/core/constraints/doc-freshness/auto-fix.js.map +0 -1
- package/dist/core/constraints/prompt-injection.d.ts +0 -16
- package/dist/core/constraints/prompt-injection.d.ts.map +0 -1
- package/dist/core/constraints/prompt-injection.js +0 -69
- package/dist/core/constraints/prompt-injection.js.map +0 -1
- package/dist/core/spec/index.d.ts +0 -7
- package/dist/core/spec/index.d.ts.map +0 -1
- package/dist/core/spec/index.js.map +0 -1
- package/dist/governance/executor.d.ts +0 -45
- package/dist/governance/executor.d.ts.map +0 -1
- package/dist/governance/executor.js +0 -243
- package/dist/governance/executor.js.map +0 -1
- package/dist/governance/index.d.ts +0 -9
- package/dist/governance/index.d.ts.map +0 -1
- package/dist/governance/index.js +0 -13
- package/dist/governance/index.js.map +0 -1
- package/dist/governance/types.d.ts +0 -46
- package/dist/governance/types.d.ts.map +0 -1
- package/dist/governance/types.js +0 -9
- package/dist/governance/types.js.map +0 -1
- package/dist/tools/definitions/definitions/core/code/fingerprint.sh +0 -273
- package/dist/tools/definitions/definitions/core/code/fingerprint.yml +0 -72
- package/dist/tools/definitions/definitions/core/code/parse.yml +0 -68
- package/dist/tools/definitions/definitions/core/code/register-language.sh +0 -475
- package/dist/tools/definitions/definitions/core/code/register-language.yml +0 -74
- package/dist/tools/definitions/definitions/core/docker/build.yml +0 -73
- package/dist/tools/definitions/definitions/core/docker/run.yml +0 -81
- package/dist/tools/definitions/definitions/core/file/copy.yml +0 -88
- package/dist/tools/definitions/definitions/core/file/read.yml +0 -69
- package/dist/tools/definitions/definitions/core/file/write.yml +0 -75
- package/dist/tools/definitions/definitions/core/git/branch.yml +0 -61
- package/dist/tools/definitions/definitions/core/git/cleanup-worktree.yml +0 -50
- package/dist/tools/definitions/definitions/core/git/clone.yml +0 -69
- package/dist/tools/definitions/definitions/core/git/commit.yml +0 -65
- package/dist/tools/definitions/definitions/core/git/push.yml +0 -79
- package/dist/tools/definitions/definitions/core/git/worktree.yml +0 -96
- package/dist/tools/definitions/definitions/core/notification/notify.sh +0 -152
- package/dist/tools/definitions/definitions/core/notification/notify.yml +0 -60
- package/dist/tools/definitions/definitions/core/npm/build.yml +0 -75
- package/dist/tools/definitions/definitions/core/npm/install.yml +0 -58
- package/dist/tools/definitions/definitions/core/npm/test.yml +0 -75
- package/dist/tools/definitions/definitions/core/validation/check-reuse.yml +0 -170
- package/dist/tools/definitions/definitions/core/validation/validate-handlers.yml +0 -118
- package/dist/tools/definitions/definitions/core/validation/validate-readme-stats.yml +0 -155
- package/dist/tools/definitions/definitions/core/validation/validate-yaml-syntax.yml +0 -134
- package/dist/tools/definitions/definitions/ext/browser/browser-automate.sh +0 -255
- package/dist/tools/definitions/definitions/ext/browser/browser-automate.yml +0 -166
- package/dist/tools/definitions/definitions/ext/browser/browser-close.sh +0 -104
- package/dist/tools/definitions/definitions/ext/browser/browser-close.yml +0 -55
- package/dist/tools/definitions/definitions/ext/browser/browser-mcp-debug.sh +0 -682
- package/dist/tools/definitions/definitions/ext/browser/browser-mcp-debug.yml +0 -167
- package/dist/tools/definitions/definitions/ext/browser/browser-start.sh +0 -101
- package/dist/tools/definitions/definitions/ext/browser/browser-start.yml +0 -62
- package/dist/tools/definitions/definitions/registry.json +0 -795
- package/dist/tools/definitions/definitions/std/README.md +0 -350
- package/dist/tools/definitions/definitions/std/analysis/analyze-codebase.yml +0 -72
- package/dist/tools/definitions/definitions/std/analysis/analyze-diff.yml +0 -182
- package/dist/tools/definitions/definitions/std/analysis/analyze-git-diff.yml +0 -70
- package/dist/tools/definitions/definitions/std/analysis/analyze-impact.yml +0 -78
- package/dist/tools/definitions/definitions/std/analysis/analyze-requirements.yml +0 -105
- package/dist/tools/definitions/definitions/std/analysis/brainstorm-options.yml +0 -106
- package/dist/tools/definitions/definitions/std/analysis/build-graph.yml +0 -154
- package/dist/tools/definitions/definitions/std/analysis/clarify-requirements.yml +0 -90
- package/dist/tools/definitions/definitions/std/analysis/detect-context.yml +0 -109
- package/dist/tools/definitions/definitions/std/analysis/detect-layers.yml +0 -125
- package/dist/tools/definitions/definitions/std/analysis/generate-tour.yml +0 -102
- package/dist/tools/definitions/definitions/std/analysis/search-enhance.yml +0 -105
- package/dist/tools/definitions/definitions/std/backlog/add.yml +0 -51
- package/dist/tools/definitions/definitions/std/backlog/decide.yml +0 -39
- package/dist/tools/definitions/definitions/std/backlog/github-sync.yml +0 -161
- package/dist/tools/definitions/definitions/std/backlog/list.yml +0 -53
- package/dist/tools/definitions/definitions/std/backlog/load.yml +0 -46
- package/dist/tools/definitions/definitions/std/backlog/resolve.yml +0 -37
- package/dist/tools/definitions/definitions/std/backlog/update.yml +0 -42
- package/dist/tools/definitions/definitions/std/bugfix/diagnose.yml +0 -68
- package/dist/tools/definitions/definitions/std/bugfix/fix.yml +0 -66
- package/dist/tools/definitions/definitions/std/bugfix/verify.yml +0 -69
- package/dist/tools/definitions/definitions/std/constraint/check-decomposition.yml +0 -103
- package/dist/tools/definitions/definitions/std/constraint/check-feature-list.yml +0 -77
- package/dist/tools/definitions/definitions/std/constraint/check-progress.yml +0 -97
- package/dist/tools/definitions/definitions/std/constraint/generate-report.yml +0 -147
- package/dist/tools/definitions/definitions/std/deploy/commit-push.yml +0 -33
- package/dist/tools/definitions/definitions/std/deploy/deploy-backend.yml +0 -37
- package/dist/tools/definitions/definitions/std/deploy/deploy-frontend.yml +0 -37
- package/dist/tools/definitions/definitions/std/deploy/rollback.yml +0 -148
- package/dist/tools/definitions/definitions/std/design/analyze-architecture-impact.yml +0 -113
- package/dist/tools/definitions/definitions/std/design/design-api.yml +0 -55
- package/dist/tools/definitions/definitions/std/design/design-architecture.yml +0 -97
- package/dist/tools/definitions/definitions/std/design/design-db.yml +0 -81
- package/dist/tools/definitions/definitions/std/design/generate-spec.yml +0 -182
- package/dist/tools/definitions/definitions/std/development/develop-api.yml +0 -85
- package/dist/tools/definitions/definitions/std/development/develop-backend.yml +0 -88
- package/dist/tools/definitions/definitions/std/development/develop-frontend.yml +0 -87
- package/dist/tools/definitions/definitions/std/development/develop-shared-types.yml +0 -74
- package/dist/tools/definitions/definitions/std/development/develop-task.yml +0 -122
- package/dist/tools/definitions/definitions/std/development/develop-tests.yml +0 -76
- package/dist/tools/definitions/definitions/std/development/execute-batch.yml +0 -152
- package/dist/tools/definitions/definitions/std/development/fix-issues.yml +0 -100
- package/dist/tools/definitions/definitions/std/development/implement-task.yml +0 -124
- package/dist/tools/definitions/definitions/std/development/review-fix-cycle.yml +0 -232
- package/dist/tools/definitions/definitions/std/evolution/implement.yml +0 -125
- package/dist/tools/definitions/definitions/std/evolution/prioritize.yml +0 -112
- package/dist/tools/definitions/definitions/std/evolution/report-gap.yml +0 -166
- package/dist/tools/definitions/definitions/std/file/read.yml +0 -21
- package/dist/tools/definitions/definitions/std/governance/aggregate-opinions.sh +0 -201
- package/dist/tools/definitions/definitions/std/governance/aggregate-opinions.yml +0 -79
- package/dist/tools/definitions/definitions/std/governance/audit-task.yml +0 -178
- package/dist/tools/definitions/definitions/std/governance/cast-vote.yml +0 -129
- package/dist/tools/definitions/definitions/std/governance/collect-issues.yml +0 -16
- package/dist/tools/definitions/definitions/std/governance/create-signed-document.yml +0 -23
- package/dist/tools/definitions/definitions/std/governance/create-voting-session.yml +0 -101
- package/dist/tools/definitions/definitions/std/governance/define-stance.sh +0 -243
- package/dist/tools/definitions/definitions/std/governance/define-stance.yml +0 -82
- package/dist/tools/definitions/definitions/std/governance/generate-review-report.yml +0 -23
- package/dist/tools/definitions/definitions/std/governance/impeach.yml +0 -179
- package/dist/tools/definitions/definitions/std/governance/multi-stance-review.yml +0 -154
- package/dist/tools/definitions/definitions/std/governance/prepare-artifact.yml +0 -20
- package/dist/tools/definitions/definitions/std/governance/review-spec-approval.yml +0 -262
- package/dist/tools/definitions/definitions/std/governance/rollback.yml +0 -186
- package/dist/tools/definitions/definitions/std/governance/stance-review.yml +0 -149
- package/dist/tools/definitions/definitions/std/governance/track-effect.yml +0 -199
- package/dist/tools/definitions/definitions/std/governance/vote-tally.yml +0 -144
- package/dist/tools/definitions/definitions/std/patch/execute.yml +0 -51
- package/dist/tools/definitions/definitions/std/planning/generate-tasks.yml +0 -36
- package/dist/tools/definitions/definitions/std/planning/load-tasks.yml +0 -44
- package/dist/tools/definitions/definitions/std/planning/split-batch.yml +0 -481
- package/dist/tools/definitions/definitions/std/planning/split-tasks.yml +0 -359
- package/dist/tools/definitions/definitions/std/planning/update-tasks.yml +0 -51
- package/dist/tools/definitions/definitions/std/planning/validate-tasks.yml +0 -46
- package/dist/tools/definitions/definitions/std/project/decide-next-workflow.yml +0 -38
- package/dist/tools/definitions/definitions/std/project/load-state.yml +0 -31
- package/dist/tools/definitions/definitions/std/project/save-state.yml +0 -32
- package/dist/tools/definitions/definitions/std/quality/check-quality.yml +0 -241
- package/dist/tools/definitions/definitions/std/quality/debug-systematic.yml +0 -163
- package/dist/tools/definitions/definitions/std/quality/handle-feedback.yml +0 -108
- package/dist/tools/definitions/definitions/std/quality/review-code.yml +0 -128
- package/dist/tools/definitions/definitions/std/quality/review-spec.yml +0 -140
- package/dist/tools/definitions/definitions/std/quality/review-task.yml +0 -190
- package/dist/tools/definitions/definitions/std/quality/run-tests.yml +0 -80
- package/dist/tools/definitions/definitions/std/quick/analyze.yml +0 -56
- package/dist/tools/definitions/definitions/std/quick/implement.yml +0 -67
- package/dist/tools/definitions/definitions/std/quick/verify.yml +0 -71
- package/dist/tools/definitions/definitions/std/verification/verify_completion.yml +0 -113
- package/dist/tools/definitions/definitions/std/verification/wait-condition.yml +0 -107
- package/dist/types/iron-law.d.ts +0 -25
- package/dist/types/iron-law.d.ts.map +0 -1
- package/dist/types/iron-law.js +0 -16
- package/dist/types/iron-law.js.map +0 -1
- package/src/cli/commands/sync-docs.ts +0 -1175
- package/src/constraints/index.ts +0 -3
- package/src/core/constraints/__tests__/prompt-injection.test.ts +0 -89
- package/src/core/constraints/doc-freshness/auto-fix.ts +0 -69
- package/src/core/constraints/prompt-injection.ts +0 -73
- package/src/core/spec/index.ts +0 -7
- package/src/governance/CONTEXT.md +0 -22
- package/src/governance/__tests__/executor.test.ts +0 -249
- package/src/governance/executor.ts +0 -229
- package/src/governance/index.ts +0 -13
- package/src/governance/types.ts +0 -53
- package/src/tools/core/package.json +0 -7
- package/src/tools/core/pnpm-lock.yaml +0 -232
- package/src/types/iron-law.ts +0 -50
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# notify.sh - 发送通知
|
|
3
|
-
# ============================================================================
|
|
4
|
-
# 功能:发送通知到指定渠道
|
|
5
|
-
# 渠道:discord, queue (降级方案)
|
|
6
|
-
# 用途:工作流完成通知、审核结果通知、状态更新
|
|
7
|
-
# ============================================================================
|
|
8
|
-
|
|
9
|
-
set -e
|
|
10
|
-
|
|
11
|
-
# 参数
|
|
12
|
-
CHANNEL="${1:-discord}"
|
|
13
|
-
MESSAGE="${2:-}"
|
|
14
|
-
TITLE="${3:-}"
|
|
15
|
-
|
|
16
|
-
# 通知队列目录
|
|
17
|
-
NOTIFICATION_DIR="${NOTIFICATION_DIR:-/tmp/agent-notifications}"
|
|
18
|
-
|
|
19
|
-
# 颜色输出
|
|
20
|
-
RED='\033[0;31m'
|
|
21
|
-
GREEN='\033[0;32m'
|
|
22
|
-
YELLOW='\033[1;33m'
|
|
23
|
-
BLUE='\033[0;34m'
|
|
24
|
-
NC='\033[0m'
|
|
25
|
-
|
|
26
|
-
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
|
|
27
|
-
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
28
|
-
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
29
|
-
|
|
30
|
-
# 显示帮助
|
|
31
|
-
show_help() {
|
|
32
|
-
cat << EOF
|
|
33
|
-
发送通知
|
|
34
|
-
|
|
35
|
-
用法:
|
|
36
|
-
$0 <channel> <message> [title]
|
|
37
|
-
|
|
38
|
-
参数:
|
|
39
|
-
channel 通知渠道 (discord/queue)
|
|
40
|
-
message 通知内容
|
|
41
|
-
title 通知标题(可选)
|
|
42
|
-
|
|
43
|
-
渠道说明:
|
|
44
|
-
discord 尝试发送到 Discord(需要 sessions_send)
|
|
45
|
-
queue 写入通知队列文件(降级方案)
|
|
46
|
-
|
|
47
|
-
环境变量:
|
|
48
|
-
NOTIFICATION_DIR 通知队列目录(默认 /tmp/agent-notifications)
|
|
49
|
-
|
|
50
|
-
输出:
|
|
51
|
-
JSON 格式的发送结果
|
|
52
|
-
|
|
53
|
-
示例:
|
|
54
|
-
$0 discord "测试完成" "通知标题"
|
|
55
|
-
$0 queue "审核完成" "审核结果"
|
|
56
|
-
EOF
|
|
57
|
-
exit 0
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
# 检查参数
|
|
61
|
-
if [[ "$1" == "-h" || "$1" == "--help" || -z "$MESSAGE" ]]; then
|
|
62
|
-
show_help
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
# 生成消息 ID
|
|
66
|
-
MESSAGE_ID="notify-$(date +%s)-$$"
|
|
67
|
-
|
|
68
|
-
# 构建通知内容
|
|
69
|
-
if [[ -n "$TITLE" ]]; then
|
|
70
|
-
FULL_MESSAGE="**$TITLE**\n$MESSAGE"
|
|
71
|
-
else
|
|
72
|
-
FULL_MESSAGE="$MESSAGE"
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
|
-
# 根据渠道发送
|
|
76
|
-
case "$CHANNEL" in
|
|
77
|
-
discord)
|
|
78
|
-
# 方案 1: 尝试使用 sessions_send(如果有 OpenClaw 环境)
|
|
79
|
-
# 方案 2: 降级到队列
|
|
80
|
-
|
|
81
|
-
# 检查是否有 sessions_send 工具
|
|
82
|
-
# 这里我们写入队列,由 OpenClaw 的 heartbeat 检查并发送
|
|
83
|
-
mkdir -p "$NOTIFICATION_DIR"
|
|
84
|
-
|
|
85
|
-
NOTIFICATION_FILE="$NOTIFICATION_DIR/${MESSAGE_ID}.json"
|
|
86
|
-
|
|
87
|
-
cat > "$NOTIFICATION_FILE" << EOF
|
|
88
|
-
{
|
|
89
|
-
"id": "$MESSAGE_ID",
|
|
90
|
-
"channel": "discord",
|
|
91
|
-
"title": "$TITLE",
|
|
92
|
-
"content": $(echo "$MESSAGE" | jq -Rs .),
|
|
93
|
-
"timestamp": "$(date -Iseconds)",
|
|
94
|
-
"status": "pending"
|
|
95
|
-
}
|
|
96
|
-
EOF
|
|
97
|
-
|
|
98
|
-
log_info "通知已写入队列: $NOTIFICATION_FILE"
|
|
99
|
-
|
|
100
|
-
cat << EOF
|
|
101
|
-
{
|
|
102
|
-
"success": true,
|
|
103
|
-
"message_id": "$MESSAGE_ID",
|
|
104
|
-
"channel": "discord",
|
|
105
|
-
"status": "queued",
|
|
106
|
-
"file": "$NOTIFICATION_FILE"
|
|
107
|
-
}
|
|
108
|
-
EOF
|
|
109
|
-
;;
|
|
110
|
-
|
|
111
|
-
queue)
|
|
112
|
-
# 直接写入队列
|
|
113
|
-
mkdir -p "$NOTIFICATION_DIR"
|
|
114
|
-
|
|
115
|
-
NOTIFICATION_FILE="$NOTIFICATION_DIR/${MESSAGE_ID}.json"
|
|
116
|
-
|
|
117
|
-
cat > "$NOTIFICATION_FILE" << EOF
|
|
118
|
-
{
|
|
119
|
-
"id": "$MESSAGE_ID",
|
|
120
|
-
"channel": "$CHANNEL",
|
|
121
|
-
"title": "$TITLE",
|
|
122
|
-
"content": $(echo "$MESSAGE" | jq -Rs .),
|
|
123
|
-
"timestamp": "$(date -Iseconds)",
|
|
124
|
-
"status": "pending"
|
|
125
|
-
}
|
|
126
|
-
EOF
|
|
127
|
-
|
|
128
|
-
log_info "通知已写入队列: $NOTIFICATION_FILE"
|
|
129
|
-
|
|
130
|
-
cat << EOF
|
|
131
|
-
{
|
|
132
|
-
"success": true,
|
|
133
|
-
"message_id": "$MESSAGE_ID",
|
|
134
|
-
"channel": "$CHANNEL",
|
|
135
|
-
"status": "queued",
|
|
136
|
-
"file": "$NOTIFICATION_FILE"
|
|
137
|
-
}
|
|
138
|
-
EOF
|
|
139
|
-
;;
|
|
140
|
-
|
|
141
|
-
*)
|
|
142
|
-
log_error "不支持的通知渠道: $CHANNEL"
|
|
143
|
-
cat << EOF
|
|
144
|
-
{
|
|
145
|
-
"success": false,
|
|
146
|
-
"error": "Unsupported channel: $CHANNEL",
|
|
147
|
-
"supported_channels": ["discord", "queue"]
|
|
148
|
-
}
|
|
149
|
-
EOF
|
|
150
|
-
exit 1
|
|
151
|
-
;;
|
|
152
|
-
esac
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# notify.yml - 发送通知
|
|
2
|
-
# ============================================================================
|
|
3
|
-
# 工具类型: 通知
|
|
4
|
-
# 用途: 发送通知到指定渠道
|
|
5
|
-
# ============================================================================
|
|
6
|
-
|
|
7
|
-
name: notification/notify
|
|
8
|
-
description: |
|
|
9
|
-
发送通知到指定渠道
|
|
10
|
-
|
|
11
|
-
支持渠道:
|
|
12
|
-
- discord
|
|
13
|
-
- slack
|
|
14
|
-
- email(待实现)
|
|
15
|
-
|
|
16
|
-
input:
|
|
17
|
-
- name: channel
|
|
18
|
-
type: string
|
|
19
|
-
required: true
|
|
20
|
-
enum: [discord, slack, email]
|
|
21
|
-
description: 通知渠道
|
|
22
|
-
|
|
23
|
-
- name: message
|
|
24
|
-
type: string
|
|
25
|
-
required: true
|
|
26
|
-
description: 通知内容
|
|
27
|
-
|
|
28
|
-
- name: title
|
|
29
|
-
type: string
|
|
30
|
-
required: false
|
|
31
|
-
description: 通知标题(可选)
|
|
32
|
-
|
|
33
|
-
output:
|
|
34
|
-
- name: success
|
|
35
|
-
type: boolean
|
|
36
|
-
description: 是否发送成功
|
|
37
|
-
|
|
38
|
-
- name: message_id
|
|
39
|
-
type: string
|
|
40
|
-
description: 消息 ID
|
|
41
|
-
|
|
42
|
-
# 实现说明
|
|
43
|
-
implementation:
|
|
44
|
-
type: script
|
|
45
|
-
script: ./notify.sh
|
|
46
|
-
note: |
|
|
47
|
-
使用通知队列发送消息
|
|
48
|
-
|
|
49
|
-
1. 写入通知到队列文件
|
|
50
|
-
2. 由 OpenClaw heartbeat 检查并发送
|
|
51
|
-
3. 支持 discord 和 queue 渠道
|
|
52
|
-
|
|
53
|
-
# 元数据
|
|
54
|
-
metadata:
|
|
55
|
-
author: Agent Studio
|
|
56
|
-
version: 1.0.0
|
|
57
|
-
tags:
|
|
58
|
-
- notification
|
|
59
|
-
- discord
|
|
60
|
-
- communication
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# build.yml - NPM 构建
|
|
2
|
-
# ============================================================================
|
|
3
|
-
# 能力类型: npm 操作(工具型)
|
|
4
|
-
# 执行方式: 纯脚本,不调用 Agent
|
|
5
|
-
# ============================================================================
|
|
6
|
-
|
|
7
|
-
name: npm-build
|
|
8
|
-
description: 构建 npm/pnpm 项目
|
|
9
|
-
|
|
10
|
-
input:
|
|
11
|
-
repo_path:
|
|
12
|
-
type: path
|
|
13
|
-
required: true
|
|
14
|
-
description: 项目路径
|
|
15
|
-
|
|
16
|
-
build_cmd:
|
|
17
|
-
type: string
|
|
18
|
-
required: false
|
|
19
|
-
description: 构建命令(可选,自动检测)
|
|
20
|
-
default: ""
|
|
21
|
-
|
|
22
|
-
output:
|
|
23
|
-
build_result:
|
|
24
|
-
type: string
|
|
25
|
-
description: 构建结果
|
|
26
|
-
|
|
27
|
-
script: |
|
|
28
|
-
#!/bin/bash
|
|
29
|
-
set -euo pipefail
|
|
30
|
-
|
|
31
|
-
REPO_PATH="{{repo_path}}"
|
|
32
|
-
BUILD_CMD="{{build_cmd}}"
|
|
33
|
-
|
|
34
|
-
cd "$REPO_PATH"
|
|
35
|
-
|
|
36
|
-
echo "🔨 构建项目..."
|
|
37
|
-
echo " 路径: $REPO_PATH"
|
|
38
|
-
|
|
39
|
-
# 自动检测包管理器
|
|
40
|
-
if [ -f "pnpm-lock.yaml" ]; then
|
|
41
|
-
PKG_MGR="pnpm"
|
|
42
|
-
elif [ -f "yarn.lock" ]; then
|
|
43
|
-
PKG_MGR="yarn"
|
|
44
|
-
else
|
|
45
|
-
PKG_MGR="npm"
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
echo " 包管理器: $PKG_MGR"
|
|
49
|
-
|
|
50
|
-
# 确定构建命令
|
|
51
|
-
if [ -z "$BUILD_CMD" ]; then
|
|
52
|
-
# 检查 package.json 中的构建脚本
|
|
53
|
-
if [ -f "package.json" ] && grep -q '"build"' package.json; then
|
|
54
|
-
BUILD_CMD="$PKG_MGR run build"
|
|
55
|
-
else
|
|
56
|
-
echo "⚠️ 未找到构建脚本,跳过构建"
|
|
57
|
-
echo "BUILD_RESULT=skipped"
|
|
58
|
-
exit 0
|
|
59
|
-
fi
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
echo " 命令: $BUILD_CMD"
|
|
63
|
-
echo ""
|
|
64
|
-
|
|
65
|
-
# 执行构建
|
|
66
|
-
if $BUILD_CMD 2>&1; then
|
|
67
|
-
echo ""
|
|
68
|
-
echo "✅ 构建成功"
|
|
69
|
-
echo "BUILD_RESULT=success"
|
|
70
|
-
else
|
|
71
|
-
echo ""
|
|
72
|
-
echo "❌ 构建失败"
|
|
73
|
-
echo "BUILD_RESULT=failed"
|
|
74
|
-
exit 1
|
|
75
|
-
fi
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# install.yml - NPM 安装依赖
|
|
2
|
-
# ============================================================================
|
|
3
|
-
# 能力类型: npm 操作(工具型)
|
|
4
|
-
# 执行方式: 纯脚本,不调用 Agent
|
|
5
|
-
# ============================================================================
|
|
6
|
-
|
|
7
|
-
name: npm-install
|
|
8
|
-
description: 安装 npm/pnpm 依赖
|
|
9
|
-
|
|
10
|
-
input:
|
|
11
|
-
repo_path:
|
|
12
|
-
type: path
|
|
13
|
-
required: true
|
|
14
|
-
description: 项目路径
|
|
15
|
-
|
|
16
|
-
output:
|
|
17
|
-
install_result:
|
|
18
|
-
type: string
|
|
19
|
-
description: 安装结果
|
|
20
|
-
|
|
21
|
-
script: |
|
|
22
|
-
#!/bin/bash
|
|
23
|
-
set -euo pipefail
|
|
24
|
-
|
|
25
|
-
REPO_PATH="{{repo_path}}"
|
|
26
|
-
|
|
27
|
-
cd "$REPO_PATH"
|
|
28
|
-
|
|
29
|
-
echo "📦 安装依赖..."
|
|
30
|
-
echo " 路径: $REPO_PATH"
|
|
31
|
-
|
|
32
|
-
# 自动检测包管理器
|
|
33
|
-
if [ -f "pnpm-lock.yaml" ]; then
|
|
34
|
-
PKG_MGR="pnpm"
|
|
35
|
-
INSTALL_CMD="pnpm install"
|
|
36
|
-
elif [ -f "yarn.lock" ]; then
|
|
37
|
-
PKG_MGR="yarn"
|
|
38
|
-
INSTALL_CMD="yarn install"
|
|
39
|
-
else
|
|
40
|
-
PKG_MGR="npm"
|
|
41
|
-
INSTALL_CMD="npm install"
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
echo " 包管理器: $PKG_MGR"
|
|
45
|
-
echo " 命令: $INSTALL_CMD"
|
|
46
|
-
echo ""
|
|
47
|
-
|
|
48
|
-
# 执行安装
|
|
49
|
-
if $INSTALL_CMD 2>&1; then
|
|
50
|
-
echo ""
|
|
51
|
-
echo "✅ 依赖安装成功"
|
|
52
|
-
echo "INSTALL_RESULT=success"
|
|
53
|
-
else
|
|
54
|
-
echo ""
|
|
55
|
-
echo "❌ 依赖安装失败"
|
|
56
|
-
echo "INSTALL_RESULT=failed"
|
|
57
|
-
exit 1
|
|
58
|
-
fi
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# test.yml - NPM 测试
|
|
2
|
-
# ============================================================================
|
|
3
|
-
# 能力类型: npm 操作(工具型)
|
|
4
|
-
# 执行方式: 纯脚本,不调用 Agent
|
|
5
|
-
# ============================================================================
|
|
6
|
-
|
|
7
|
-
name: npm-test
|
|
8
|
-
description: 运行 npm/pnpm 测试
|
|
9
|
-
|
|
10
|
-
input:
|
|
11
|
-
repo_path:
|
|
12
|
-
type: path
|
|
13
|
-
required: true
|
|
14
|
-
description: 项目路径
|
|
15
|
-
|
|
16
|
-
test_cmd:
|
|
17
|
-
type: string
|
|
18
|
-
required: false
|
|
19
|
-
description: 测试命令(可选,自动检测)
|
|
20
|
-
default: ""
|
|
21
|
-
|
|
22
|
-
output:
|
|
23
|
-
test_result:
|
|
24
|
-
type: string
|
|
25
|
-
description: 测试结果
|
|
26
|
-
|
|
27
|
-
script: |
|
|
28
|
-
#!/bin/bash
|
|
29
|
-
set -euo pipefail
|
|
30
|
-
|
|
31
|
-
REPO_PATH="{{repo_path}}"
|
|
32
|
-
TEST_CMD="{{test_cmd}}"
|
|
33
|
-
|
|
34
|
-
cd "$REPO_PATH"
|
|
35
|
-
|
|
36
|
-
echo "🧪 运行测试..."
|
|
37
|
-
echo " 路径: $REPO_PATH"
|
|
38
|
-
|
|
39
|
-
# 自动检测包管理器
|
|
40
|
-
if [ -f "pnpm-lock.yaml" ]; then
|
|
41
|
-
PKG_MGR="pnpm"
|
|
42
|
-
elif [ -f "yarn.lock" ]; then
|
|
43
|
-
PKG_MGR="yarn"
|
|
44
|
-
else
|
|
45
|
-
PKG_MGR="npm"
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
echo " 包管理器: $PKG_MGR"
|
|
49
|
-
|
|
50
|
-
# 确定测试命令
|
|
51
|
-
if [ -z "$TEST_CMD" ]; then
|
|
52
|
-
# 检查 package.json 中的测试脚本
|
|
53
|
-
if [ -f "package.json" ] && grep -q '"test"' package.json; then
|
|
54
|
-
TEST_CMD="$PKG_MGR test"
|
|
55
|
-
else
|
|
56
|
-
echo "⚠️ 未找到测试脚本,跳过测试"
|
|
57
|
-
echo "TEST_RESULT=skipped"
|
|
58
|
-
exit 0
|
|
59
|
-
fi
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
echo " 命令: $TEST_CMD"
|
|
63
|
-
echo ""
|
|
64
|
-
|
|
65
|
-
# 执行测试
|
|
66
|
-
if $TEST_CMD 2>&1; then
|
|
67
|
-
echo ""
|
|
68
|
-
echo "✅ 测试通过"
|
|
69
|
-
echo "TEST_RESULT=passed"
|
|
70
|
-
else
|
|
71
|
-
echo ""
|
|
72
|
-
echo "❌ 测试失败"
|
|
73
|
-
echo "TEST_RESULT=failed"
|
|
74
|
-
exit 1
|
|
75
|
-
fi
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
# check-reuse.yml - 复用检查工具
|
|
2
|
-
# ============================================================================
|
|
3
|
-
# 能力类型: validation(工具型)
|
|
4
|
-
# 执行方式: 纯脚本,检查现有能力
|
|
5
|
-
# 用途: 在创建新 step/tool/workflow 前检查可复用的现有能力
|
|
6
|
-
# 铁律: NO NEW CAPABILITIES WITHOUT REUSE CHECK FIRST
|
|
7
|
-
# ============================================================================
|
|
8
|
-
|
|
9
|
-
name: check-reuse
|
|
10
|
-
description: 在创建新能力前检查是否有可复用的现有能力
|
|
11
|
-
category: validation
|
|
12
|
-
version: 1.0.0
|
|
13
|
-
|
|
14
|
-
# 铁律
|
|
15
|
-
iron_law:
|
|
16
|
-
rule: "NO NEW CAPABILITIES WITHOUT REUSE CHECK FIRST"
|
|
17
|
-
message: "在创建新能力之前,必须先检查是否有可复用的现有能力"
|
|
18
|
-
|
|
19
|
-
# 输入
|
|
20
|
-
input:
|
|
21
|
-
capability_type:
|
|
22
|
-
type: string
|
|
23
|
-
required: true
|
|
24
|
-
enum: [step, tool, workflow]
|
|
25
|
-
description: 要创建的能力类型
|
|
26
|
-
|
|
27
|
-
keywords:
|
|
28
|
-
type: array
|
|
29
|
-
required: true
|
|
30
|
-
description: 关键词列表(用于搜索现有能力)
|
|
31
|
-
|
|
32
|
-
description:
|
|
33
|
-
type: string
|
|
34
|
-
required: false
|
|
35
|
-
description: 功能描述(用于相似度匹配)
|
|
36
|
-
|
|
37
|
-
workflows_path:
|
|
38
|
-
type: path
|
|
39
|
-
required: false
|
|
40
|
-
default: "~/projects/agent-workflows"
|
|
41
|
-
description: agent-workflows 路径
|
|
42
|
-
|
|
43
|
-
# 输出
|
|
44
|
-
output:
|
|
45
|
-
has_reusable:
|
|
46
|
-
type: boolean
|
|
47
|
-
description: 是否有可复用的能力
|
|
48
|
-
|
|
49
|
-
existing_capabilities:
|
|
50
|
-
type: array
|
|
51
|
-
description: 找到的现有能力列表
|
|
52
|
-
|
|
53
|
-
reuse_recommendation:
|
|
54
|
-
type: string
|
|
55
|
-
description: 复用建议
|
|
56
|
-
|
|
57
|
-
should_create:
|
|
58
|
-
type: boolean
|
|
59
|
-
description: 是否建议创建新文件
|
|
60
|
-
|
|
61
|
-
# 执行脚本
|
|
62
|
-
script: |
|
|
63
|
-
#!/bin/bash
|
|
64
|
-
set -euo pipefail
|
|
65
|
-
|
|
66
|
-
CAPABILITY_TYPE="{{capability_type}}"
|
|
67
|
-
KEYWORDS="{{keywords}}"
|
|
68
|
-
DESCRIPTION="{{description}}"
|
|
69
|
-
WORKFLOWS_PATH="{{workflows_path}}"
|
|
70
|
-
|
|
71
|
-
echo "🔍 复用检查: 创建新 $CAPABILITY_TYPE"
|
|
72
|
-
echo "关键词: $KEYWORDS"
|
|
73
|
-
echo ""
|
|
74
|
-
|
|
75
|
-
# 展开路径
|
|
76
|
-
WORKFLOWS_PATH="${WORKFLOWS_PATH/#\~/$HOME}"
|
|
77
|
-
|
|
78
|
-
# 根据能力类型选择搜索目录
|
|
79
|
-
case "$CAPABILITY_TYPE" in
|
|
80
|
-
step)
|
|
81
|
-
SEARCH_DIR="$WORKFLOWS_PATH/steps"
|
|
82
|
-
;;
|
|
83
|
-
tool)
|
|
84
|
-
SEARCH_DIR="$WORKFLOWS_PATH/tools"
|
|
85
|
-
;;
|
|
86
|
-
workflow)
|
|
87
|
-
SEARCH_DIR="$WORKFLOWS_PATH/workflows"
|
|
88
|
-
;;
|
|
89
|
-
*)
|
|
90
|
-
echo "❌ 未知的能力类型: $CAPABILITY_TYPE"
|
|
91
|
-
exit 1
|
|
92
|
-
;;
|
|
93
|
-
esac
|
|
94
|
-
|
|
95
|
-
if [ ! -d "$SEARCH_DIR" ]; then
|
|
96
|
-
echo "❌ 搜索目录不存在: $SEARCH_DIR"
|
|
97
|
-
exit 1
|
|
98
|
-
fi
|
|
99
|
-
|
|
100
|
-
# 搜索现有能力
|
|
101
|
-
FOUND=()
|
|
102
|
-
|
|
103
|
-
# 将关键词转换为数组
|
|
104
|
-
IFS=',' read -ra KEYWORD_ARRAY <<< "$KEYWORDS"
|
|
105
|
-
|
|
106
|
-
for keyword in "${KEYWORD_ARRAY[@]}"; do
|
|
107
|
-
keyword=$(echo "$keyword" | xargs) # trim
|
|
108
|
-
|
|
109
|
-
# 搜索文件名和内容
|
|
110
|
-
for f in $(find "$SEARCH_DIR" -name "*.yml" -o -name "*.yaml" 2>/dev/null | grep -v README); do
|
|
111
|
-
# 检查文件名
|
|
112
|
-
if echo "$f" | grep -qi "$keyword"; then
|
|
113
|
-
FOUND+=("$f (文件名匹配)")
|
|
114
|
-
# 检查文件内容
|
|
115
|
-
elif grep -qi "$keyword" "$f" 2>/dev/null; then
|
|
116
|
-
FOUND+=("$f (内容匹配)")
|
|
117
|
-
fi
|
|
118
|
-
done
|
|
119
|
-
done
|
|
120
|
-
|
|
121
|
-
# 去重
|
|
122
|
-
FOUND_UNIQUE=($(printf "%s\n" "${FOUND[@]}" | sort -u | tr '\n' ' '))
|
|
123
|
-
|
|
124
|
-
# 输出结果
|
|
125
|
-
echo "================================"
|
|
126
|
-
echo "📊 搜索结果"
|
|
127
|
-
echo "================================"
|
|
128
|
-
echo ""
|
|
129
|
-
|
|
130
|
-
if [ ${#FOUND_UNIQUE[@]} -gt 0 ]; then
|
|
131
|
-
echo "✅ 找到 ${#FOUND_UNIQUE[@]} 个相关能力:"
|
|
132
|
-
echo ""
|
|
133
|
-
for item in "${FOUND_UNIQUE[@]}"; do
|
|
134
|
-
echo " - $item"
|
|
135
|
-
done
|
|
136
|
-
echo ""
|
|
137
|
-
echo "================================"
|
|
138
|
-
echo "📋 复用建议"
|
|
139
|
-
echo "================================"
|
|
140
|
-
echo ""
|
|
141
|
-
|
|
142
|
-
# 根据匹配数量给出建议
|
|
143
|
-
if [ ${#FOUND_UNIQUE[@]} -ge 3 ]; then
|
|
144
|
-
echo "⚠️ 找到多个相关能力,建议先评估是否可以复用或扩展"
|
|
145
|
-
echo "REUSE_RECOMMENDATION=evaluate"
|
|
146
|
-
echo "SHOULD_CREATE=false"
|
|
147
|
-
else
|
|
148
|
-
echo "💡 找到相关能力,建议检查是否满足需求"
|
|
149
|
-
echo "REUSE_RECOMMENDATION=check"
|
|
150
|
-
echo "SHOULD_CREATE=maybe"
|
|
151
|
-
fi
|
|
152
|
-
|
|
153
|
-
echo ""
|
|
154
|
-
echo "has_reusable=true"
|
|
155
|
-
else
|
|
156
|
-
echo "❌ 未找到相关能力"
|
|
157
|
-
echo ""
|
|
158
|
-
echo "================================"
|
|
159
|
-
echo "📋 复用建议"
|
|
160
|
-
echo "================================"
|
|
161
|
-
echo ""
|
|
162
|
-
echo "✅ 可以创建新 $CAPABILITY_TYPE"
|
|
163
|
-
echo ""
|
|
164
|
-
echo "has_reusable=false"
|
|
165
|
-
echo "REUSE_RECOMMENDATION=create"
|
|
166
|
-
echo "SHOULD_CREATE=true"
|
|
167
|
-
fi
|
|
168
|
-
|
|
169
|
-
echo ""
|
|
170
|
-
echo "existing_capabilities=${FOUND_UNIQUE[*]}"
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
# validate-handlers.yml - Handler 注册完整性检查
|
|
2
|
-
# ============================================================================
|
|
3
|
-
# 能力类型: validation(工具型)
|
|
4
|
-
# 执行方式: 纯脚本,检查 handler 注册
|
|
5
|
-
# 用途: 验证所有 step 的 handler 都已在 builtin-handlers.ts 中注册
|
|
6
|
-
# ============================================================================
|
|
7
|
-
|
|
8
|
-
name: validate-handlers
|
|
9
|
-
description: 检查 step 的 handler 是否都在 builtin-handlers.ts 中注册
|
|
10
|
-
category: validation
|
|
11
|
-
version: 1.0.0
|
|
12
|
-
|
|
13
|
-
# 铁律
|
|
14
|
-
iron_law:
|
|
15
|
-
rule: "NO ORPHAN HANDLERS"
|
|
16
|
-
message: "所有 step 定义的 handler 必须在 builtin-handlers.ts 中注册"
|
|
17
|
-
|
|
18
|
-
# 输入
|
|
19
|
-
input:
|
|
20
|
-
steps_dir:
|
|
21
|
-
type: path
|
|
22
|
-
required: false
|
|
23
|
-
default: "steps"
|
|
24
|
-
description: steps 目录路径
|
|
25
|
-
|
|
26
|
-
registry_file:
|
|
27
|
-
type: path
|
|
28
|
-
required: false
|
|
29
|
-
default: "../agent-runtime/src/core/builtin-handlers.ts"
|
|
30
|
-
description: builtin-handlers.ts 文件路径
|
|
31
|
-
|
|
32
|
-
# 输出
|
|
33
|
-
output:
|
|
34
|
-
total_handlers:
|
|
35
|
-
type: number
|
|
36
|
-
description: 发现的 handler 总数
|
|
37
|
-
|
|
38
|
-
registered:
|
|
39
|
-
type: number
|
|
40
|
-
description: 已注册的 handler 数量
|
|
41
|
-
|
|
42
|
-
missing:
|
|
43
|
-
type: array
|
|
44
|
-
description: 未注册的 handler 列表
|
|
45
|
-
|
|
46
|
-
passed:
|
|
47
|
-
type: boolean
|
|
48
|
-
description: 是否全部通过
|
|
49
|
-
|
|
50
|
-
# 执行脚本
|
|
51
|
-
script: |
|
|
52
|
-
#!/bin/bash
|
|
53
|
-
set -euo pipefail
|
|
54
|
-
|
|
55
|
-
STEPS_DIR="{{steps_dir}}"
|
|
56
|
-
REGISTRY_FILE="{{registry_file}}"
|
|
57
|
-
|
|
58
|
-
echo "🔍 检查 Handler 注册完整性"
|
|
59
|
-
echo " Steps 目录: $STEPS_DIR"
|
|
60
|
-
echo " 注册文件: $REGISTRY_FILE"
|
|
61
|
-
echo ""
|
|
62
|
-
|
|
63
|
-
# 检查目录和文件是否存在
|
|
64
|
-
if [ ! -d "$STEPS_DIR" ]; then
|
|
65
|
-
echo "❌ Steps 目录不存在: $STEPS_DIR"
|
|
66
|
-
exit 1
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
if [ ! -f "$REGISTRY_FILE" ]; then
|
|
70
|
-
echo "❌ 注册文件不存在: $REGISTRY_FILE"
|
|
71
|
-
exit 1
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
MISSING=()
|
|
75
|
-
TOTAL=0
|
|
76
|
-
REGISTERED=0
|
|
77
|
-
|
|
78
|
-
# 遍历所有 step 文件
|
|
79
|
-
for f in $(find "$STEPS_DIR" -name "*.yml" -o -name "*.yaml" 2>/dev/null | sort); do
|
|
80
|
-
# 提取 handler 字段
|
|
81
|
-
handler=$(grep -E "^\s*handler:" "$f" 2>/dev/null | head -1 | sed 's/.*handler:\s*//' | tr -d '"' | tr -d "'")
|
|
82
|
-
|
|
83
|
-
if [ -n "$handler" ]; then
|
|
84
|
-
TOTAL=$((TOTAL + 1))
|
|
85
|
-
|
|
86
|
-
# 检查是否在注册文件中
|
|
87
|
-
if grep -q "'$handler'" "$REGISTRY_FILE" 2>/dev/null; then
|
|
88
|
-
REGISTERED=$((REGISTERED + 1))
|
|
89
|
-
echo " ✅ $handler"
|
|
90
|
-
else
|
|
91
|
-
MISSING+=("$handler")
|
|
92
|
-
echo " ❌ $handler (from $(basename $(dirname $f))/$(basename $f))"
|
|
93
|
-
fi
|
|
94
|
-
fi
|
|
95
|
-
done
|
|
96
|
-
|
|
97
|
-
echo ""
|
|
98
|
-
echo "================================"
|
|
99
|
-
echo "📊 统计:"
|
|
100
|
-
echo " 总计: $TOTAL 个 handler"
|
|
101
|
-
echo " 已注册: $REGISTERED 个"
|
|
102
|
-
echo " 未注册: ${#MISSING[@]} 个"
|
|
103
|
-
echo "================================"
|
|
104
|
-
|
|
105
|
-
if [ ${#MISSING[@]} -gt 0 ]; then
|
|
106
|
-
echo ""
|
|
107
|
-
echo "❌ 发现未注册的 handler:"
|
|
108
|
-
for h in "${MISSING[@]}"; do
|
|
109
|
-
echo " - $h"
|
|
110
|
-
done
|
|
111
|
-
echo ""
|
|
112
|
-
echo "请在 builtin-handlers.ts 中注册这些 handler"
|
|
113
|
-
exit 1
|
|
114
|
-
fi
|
|
115
|
-
|
|
116
|
-
echo ""
|
|
117
|
-
echo "✅ 所有 handler 都已正确注册"
|
|
118
|
-
exit 0
|