@decibelsystems/tools 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/LICENSE +21 -0
- package/README.md +342 -0
- package/dist/agentic/compiler.d.ts +21 -0
- package/dist/agentic/compiler.d.ts.map +1 -0
- package/dist/agentic/compiler.js +267 -0
- package/dist/agentic/compiler.js.map +1 -0
- package/dist/agentic/golden.d.ts +25 -0
- package/dist/agentic/golden.d.ts.map +1 -0
- package/dist/agentic/golden.js +255 -0
- package/dist/agentic/golden.js.map +1 -0
- package/dist/agentic/index.d.ts +17 -0
- package/dist/agentic/index.d.ts.map +1 -0
- package/dist/agentic/index.js +153 -0
- package/dist/agentic/index.js.map +1 -0
- package/dist/agentic/linter.d.ts +20 -0
- package/dist/agentic/linter.d.ts.map +1 -0
- package/dist/agentic/linter.js +340 -0
- package/dist/agentic/linter.js.map +1 -0
- package/dist/agentic/renderer.d.ts +17 -0
- package/dist/agentic/renderer.d.ts.map +1 -0
- package/dist/agentic/renderer.js +277 -0
- package/dist/agentic/renderer.js.map +1 -0
- package/dist/agentic/types.d.ts +199 -0
- package/dist/agentic/types.d.ts.map +1 -0
- package/dist/agentic/types.js +8 -0
- package/dist/agentic/types.js.map +1 -0
- package/dist/architectAdrs.d.ts +32 -0
- package/dist/architectAdrs.d.ts.map +1 -0
- package/dist/architectAdrs.js +162 -0
- package/dist/architectAdrs.js.map +1 -0
- package/dist/client/facade-client.d.ts +41 -0
- package/dist/client/facade-client.d.ts.map +1 -0
- package/dist/client/facade-client.js +243 -0
- package/dist/client/facade-client.js.map +1 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +18 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/transports.d.ts +78 -0
- package/dist/client/transports.d.ts.map +1 -0
- package/dist/client/transports.js +258 -0
- package/dist/client/transports.js.map +1 -0
- package/dist/client/types.d.ts +49 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +8 -0
- package/dist/client/types.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +19 -0
- package/dist/config.js.map +1 -0
- package/dist/daemon.d.ts +77 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +374 -0
- package/dist/daemon.js.map +1 -0
- package/dist/daemonConfig.d.ts +43 -0
- package/dist/daemonConfig.d.ts.map +1 -0
- package/dist/daemonConfig.js +113 -0
- package/dist/daemonConfig.js.map +1 -0
- package/dist/dataRoot.d.ts +5 -0
- package/dist/dataRoot.d.ts.map +1 -0
- package/dist/dataRoot.js +23 -0
- package/dist/dataRoot.js.map +1 -0
- package/dist/decibelPaths.d.ts +42 -0
- package/dist/decibelPaths.d.ts.map +1 -0
- package/dist/decibelPaths.js +150 -0
- package/dist/decibelPaths.js.map +1 -0
- package/dist/facades/definitions.d.ts +6 -0
- package/dist/facades/definitions.d.ts.map +1 -0
- package/dist/facades/definitions.js +450 -0
- package/dist/facades/definitions.js.map +1 -0
- package/dist/facades/index.d.ts +27 -0
- package/dist/facades/index.d.ts.map +1 -0
- package/dist/facades/index.js +124 -0
- package/dist/facades/index.js.map +1 -0
- package/dist/facades/types.d.ts +38 -0
- package/dist/facades/types.d.ts.map +1 -0
- package/dist/facades/types.js +8 -0
- package/dist/facades/types.js.map +1 -0
- package/dist/httpServer.d.ts +66 -0
- package/dist/httpServer.d.ts.map +1 -0
- package/dist/httpServer.js +1723 -0
- package/dist/httpServer.js.map +1 -0
- package/dist/kernel.d.ts +87 -0
- package/dist/kernel.d.ts.map +1 -0
- package/dist/kernel.js +256 -0
- package/dist/kernel.js.map +1 -0
- package/dist/lib/agent-services/assumptions.d.ts +16 -0
- package/dist/lib/agent-services/assumptions.d.ts.map +1 -0
- package/dist/lib/agent-services/assumptions.js +284 -0
- package/dist/lib/agent-services/assumptions.js.map +1 -0
- package/dist/lib/agent-services/context-pack.d.ts +6 -0
- package/dist/lib/agent-services/context-pack.d.ts.map +1 -0
- package/dist/lib/agent-services/context-pack.js +354 -0
- package/dist/lib/agent-services/context-pack.js.map +1 -0
- package/dist/lib/agent-services/drift-guard.d.ts +14 -0
- package/dist/lib/agent-services/drift-guard.d.ts.map +1 -0
- package/dist/lib/agent-services/drift-guard.js +355 -0
- package/dist/lib/agent-services/drift-guard.js.map +1 -0
- package/dist/lib/agent-services/index.d.ts +5 -0
- package/dist/lib/agent-services/index.d.ts.map +1 -0
- package/dist/lib/agent-services/index.js +10 -0
- package/dist/lib/agent-services/index.js.map +1 -0
- package/dist/lib/benchmark.d.ts +110 -0
- package/dist/lib/benchmark.d.ts.map +1 -0
- package/dist/lib/benchmark.js +338 -0
- package/dist/lib/benchmark.js.map +1 -0
- package/dist/lib/supabase.d.ts +123 -0
- package/dist/lib/supabase.d.ts.map +1 -0
- package/dist/lib/supabase.js +91 -0
- package/dist/lib/supabase.js.map +1 -0
- package/dist/license.d.ts +30 -0
- package/dist/license.d.ts.map +1 -0
- package/dist/license.js +131 -0
- package/dist/license.js.map +1 -0
- package/dist/projectPaths.d.ts +27 -0
- package/dist/projectPaths.d.ts.map +1 -0
- package/dist/projectPaths.js +86 -0
- package/dist/projectPaths.js.map +1 -0
- package/dist/projectRegistry.d.ts +97 -0
- package/dist/projectRegistry.d.ts.map +1 -0
- package/dist/projectRegistry.js +374 -0
- package/dist/projectRegistry.js.map +1 -0
- package/dist/sentinelIssues.d.ts +65 -0
- package/dist/sentinelIssues.d.ts.map +1 -0
- package/dist/sentinelIssues.js +297 -0
- package/dist/sentinelIssues.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +195 -0
- package/dist/server.js.map +1 -0
- package/dist/test.d.ts +7 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +77 -0
- package/dist/test.js.map +1 -0
- package/dist/tools/agentic/index.d.ts +7 -0
- package/dist/tools/agentic/index.d.ts.map +1 -0
- package/dist/tools/agentic/index.js +203 -0
- package/dist/tools/agentic/index.js.map +1 -0
- package/dist/tools/architect/index.d.ts +11 -0
- package/dist/tools/architect/index.d.ts.map +1 -0
- package/dist/tools/architect/index.js +506 -0
- package/dist/tools/architect/index.js.map +1 -0
- package/dist/tools/architect.d.ts +19 -0
- package/dist/tools/architect.d.ts.map +1 -0
- package/dist/tools/architect.js +88 -0
- package/dist/tools/architect.js.map +1 -0
- package/dist/tools/auditor/index.d.ts +10 -0
- package/dist/tools/auditor/index.d.ts.map +1 -0
- package/dist/tools/auditor/index.js +310 -0
- package/dist/tools/auditor/index.js.map +1 -0
- package/dist/tools/auditor.d.ts +149 -0
- package/dist/tools/auditor.d.ts.map +1 -0
- package/dist/tools/auditor.js +775 -0
- package/dist/tools/auditor.js.map +1 -0
- package/dist/tools/bench/index.d.ts +3 -0
- package/dist/tools/bench/index.d.ts.map +1 -0
- package/dist/tools/bench/index.js +220 -0
- package/dist/tools/bench/index.js.map +1 -0
- package/dist/tools/bench.d.ts +89 -0
- package/dist/tools/bench.d.ts.map +1 -0
- package/dist/tools/bench.js +826 -0
- package/dist/tools/bench.js.map +1 -0
- package/dist/tools/context/index.d.ts +11 -0
- package/dist/tools/context/index.d.ts.map +1 -0
- package/dist/tools/context/index.js +482 -0
- package/dist/tools/context/index.js.map +1 -0
- package/dist/tools/context.d.ts +146 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +481 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/coordinator/coordinator.d.ts +168 -0
- package/dist/tools/coordinator/coordinator.d.ts.map +1 -0
- package/dist/tools/coordinator/coordinator.js +535 -0
- package/dist/tools/coordinator/coordinator.js.map +1 -0
- package/dist/tools/coordinator/index.d.ts +12 -0
- package/dist/tools/coordinator/index.d.ts.map +1 -0
- package/dist/tools/coordinator/index.js +381 -0
- package/dist/tools/coordinator/index.js.map +1 -0
- package/dist/tools/corpus/index.d.ts +5 -0
- package/dist/tools/corpus/index.d.ts.map +1 -0
- package/dist/tools/corpus/index.js +105 -0
- package/dist/tools/corpus/index.js.map +1 -0
- package/dist/tools/corpus.d.ts +33 -0
- package/dist/tools/corpus.d.ts.map +1 -0
- package/dist/tools/corpus.js +180 -0
- package/dist/tools/corpus.js.map +1 -0
- package/dist/tools/crit.d.ts +63 -0
- package/dist/tools/crit.d.ts.map +1 -0
- package/dist/tools/crit.js +159 -0
- package/dist/tools/crit.js.map +1 -0
- package/dist/tools/data-inspector.d.ts +189 -0
- package/dist/tools/data-inspector.d.ts.map +1 -0
- package/dist/tools/data-inspector.js +669 -0
- package/dist/tools/data-inspector.js.map +1 -0
- package/dist/tools/deck.d.ts +11 -0
- package/dist/tools/deck.d.ts.map +1 -0
- package/dist/tools/deck.js +188 -0
- package/dist/tools/deck.js.map +1 -0
- package/dist/tools/designer/index.d.ts +11 -0
- package/dist/tools/designer/index.d.ts.map +1 -0
- package/dist/tools/designer/index.js +442 -0
- package/dist/tools/designer/index.js.map +1 -0
- package/dist/tools/designer/lateral-tools.d.ts +6 -0
- package/dist/tools/designer/lateral-tools.d.ts.map +1 -0
- package/dist/tools/designer/lateral-tools.js +190 -0
- package/dist/tools/designer/lateral-tools.js.map +1 -0
- package/dist/tools/designer.d.ts +122 -0
- package/dist/tools/designer.d.ts.map +1 -0
- package/dist/tools/designer.js +495 -0
- package/dist/tools/designer.js.map +1 -0
- package/dist/tools/dojo/index.d.ts +13 -0
- package/dist/tools/dojo/index.d.ts.map +1 -0
- package/dist/tools/dojo/index.js +613 -0
- package/dist/tools/dojo/index.js.map +1 -0
- package/dist/tools/dojo.d.ts +254 -0
- package/dist/tools/dojo.d.ts.map +1 -0
- package/dist/tools/dojo.js +933 -0
- package/dist/tools/dojo.js.map +1 -0
- package/dist/tools/dojoBench.d.ts +49 -0
- package/dist/tools/dojoBench.d.ts.map +1 -0
- package/dist/tools/dojoBench.js +205 -0
- package/dist/tools/dojoBench.js.map +1 -0
- package/dist/tools/dojoGraduated.d.ts +50 -0
- package/dist/tools/dojoGraduated.d.ts.map +1 -0
- package/dist/tools/dojoGraduated.js +174 -0
- package/dist/tools/dojoGraduated.js.map +1 -0
- package/dist/tools/dojoPolicy.d.ts +65 -0
- package/dist/tools/dojoPolicy.d.ts.map +1 -0
- package/dist/tools/dojoPolicy.js +263 -0
- package/dist/tools/dojoPolicy.js.map +1 -0
- package/dist/tools/feedback/index.d.ts +5 -0
- package/dist/tools/feedback/index.d.ts.map +1 -0
- package/dist/tools/feedback/index.js +153 -0
- package/dist/tools/feedback/index.js.map +1 -0
- package/dist/tools/feedback.d.ts +61 -0
- package/dist/tools/feedback.d.ts.map +1 -0
- package/dist/tools/feedback.js +209 -0
- package/dist/tools/feedback.js.map +1 -0
- package/dist/tools/forecast/index.d.ts +8 -0
- package/dist/tools/forecast/index.d.ts.map +1 -0
- package/dist/tools/forecast/index.js +283 -0
- package/dist/tools/forecast/index.js.map +1 -0
- package/dist/tools/forecast.d.ts +147 -0
- package/dist/tools/forecast.d.ts.map +1 -0
- package/dist/tools/forecast.js +417 -0
- package/dist/tools/forecast.js.map +1 -0
- package/dist/tools/friction/index.d.ts +7 -0
- package/dist/tools/friction/index.d.ts.map +1 -0
- package/dist/tools/friction/index.js +265 -0
- package/dist/tools/friction/index.js.map +1 -0
- package/dist/tools/friction.d.ts +82 -0
- package/dist/tools/friction.d.ts.map +1 -0
- package/dist/tools/friction.js +331 -0
- package/dist/tools/friction.js.map +1 -0
- package/dist/tools/git/index.d.ts +9 -0
- package/dist/tools/git/index.d.ts.map +1 -0
- package/dist/tools/git/index.js +237 -0
- package/dist/tools/git/index.js.map +1 -0
- package/dist/tools/git-sentinel/index.d.ts +7 -0
- package/dist/tools/git-sentinel/index.d.ts.map +1 -0
- package/dist/tools/git-sentinel/index.js +178 -0
- package/dist/tools/git-sentinel/index.js.map +1 -0
- package/dist/tools/git-sentinel.d.ts +78 -0
- package/dist/tools/git-sentinel.d.ts.map +1 -0
- package/dist/tools/git-sentinel.js +391 -0
- package/dist/tools/git-sentinel.js.map +1 -0
- package/dist/tools/git.d.ts +134 -0
- package/dist/tools/git.d.ts.map +1 -0
- package/dist/tools/git.js +374 -0
- package/dist/tools/git.js.map +1 -0
- package/dist/tools/guardian/index.d.ts +8 -0
- package/dist/tools/guardian/index.d.ts.map +1 -0
- package/dist/tools/guardian/index.js +171 -0
- package/dist/tools/guardian/index.js.map +1 -0
- package/dist/tools/guardian.d.ts +62 -0
- package/dist/tools/guardian.d.ts.map +1 -0
- package/dist/tools/guardian.js +332 -0
- package/dist/tools/guardian.js.map +1 -0
- package/dist/tools/hygiene/codebase-scanner.d.ts +38 -0
- package/dist/tools/hygiene/codebase-scanner.d.ts.map +1 -0
- package/dist/tools/hygiene/codebase-scanner.js +411 -0
- package/dist/tools/hygiene/codebase-scanner.js.map +1 -0
- package/dist/tools/hygiene/config-scanner.d.ts +33 -0
- package/dist/tools/hygiene/config-scanner.d.ts.map +1 -0
- package/dist/tools/hygiene/config-scanner.js +482 -0
- package/dist/tools/hygiene/config-scanner.js.map +1 -0
- package/dist/tools/hygiene/coverage-scanner.d.ts +41 -0
- package/dist/tools/hygiene/coverage-scanner.d.ts.map +1 -0
- package/dist/tools/hygiene/coverage-scanner.js +331 -0
- package/dist/tools/hygiene/coverage-scanner.js.map +1 -0
- package/dist/tools/hygiene/index.d.ts +7 -0
- package/dist/tools/hygiene/index.d.ts.map +1 -0
- package/dist/tools/hygiene/index.js +291 -0
- package/dist/tools/hygiene/index.js.map +1 -0
- package/dist/tools/hygiene/oracle-hygiene.d.ts +68 -0
- package/dist/tools/hygiene/oracle-hygiene.d.ts.map +1 -0
- package/dist/tools/hygiene/oracle-hygiene.js +324 -0
- package/dist/tools/hygiene/oracle-hygiene.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +130 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/lateral.d.ts +114 -0
- package/dist/tools/lateral.d.ts.map +1 -0
- package/dist/tools/lateral.js +536 -0
- package/dist/tools/lateral.js.map +1 -0
- package/dist/tools/learnings/index.d.ts +5 -0
- package/dist/tools/learnings/index.d.ts.map +1 -0
- package/dist/tools/learnings/index.js +138 -0
- package/dist/tools/learnings/index.js.map +1 -0
- package/dist/tools/learnings.d.ts +41 -0
- package/dist/tools/learnings.d.ts.map +1 -0
- package/dist/tools/learnings.js +149 -0
- package/dist/tools/learnings.js.map +1 -0
- package/dist/tools/oracle/index.d.ts +6 -0
- package/dist/tools/oracle/index.d.ts.map +1 -0
- package/dist/tools/oracle/index.js +217 -0
- package/dist/tools/oracle/index.js.map +1 -0
- package/dist/tools/oracle.d.ts +90 -0
- package/dist/tools/oracle.d.ts.map +1 -0
- package/dist/tools/oracle.js +529 -0
- package/dist/tools/oracle.js.map +1 -0
- package/dist/tools/policy.d.ts +119 -0
- package/dist/tools/policy.d.ts.map +1 -0
- package/dist/tools/policy.js +406 -0
- package/dist/tools/policy.js.map +1 -0
- package/dist/tools/provenance/index.d.ts +4 -0
- package/dist/tools/provenance/index.d.ts.map +1 -0
- package/dist/tools/provenance/index.js +63 -0
- package/dist/tools/provenance/index.js.map +1 -0
- package/dist/tools/provenance.d.ts +75 -0
- package/dist/tools/provenance.d.ts.map +1 -0
- package/dist/tools/provenance.js +224 -0
- package/dist/tools/provenance.js.map +1 -0
- package/dist/tools/rateLimiter.d.ts +45 -0
- package/dist/tools/rateLimiter.d.ts.map +1 -0
- package/dist/tools/rateLimiter.js +91 -0
- package/dist/tools/rateLimiter.js.map +1 -0
- package/dist/tools/registry/index.d.ts +10 -0
- package/dist/tools/registry/index.d.ts.map +1 -0
- package/dist/tools/registry/index.js +506 -0
- package/dist/tools/registry/index.js.map +1 -0
- package/dist/tools/registry.d.ts +3 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +189 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/roadmap/index.d.ts +11 -0
- package/dist/tools/roadmap/index.d.ts.map +1 -0
- package/dist/tools/roadmap/index.js +364 -0
- package/dist/tools/roadmap/index.js.map +1 -0
- package/dist/tools/roadmap.d.ts +103 -0
- package/dist/tools/roadmap.d.ts.map +1 -0
- package/dist/tools/roadmap.js +407 -0
- package/dist/tools/roadmap.js.map +1 -0
- package/dist/tools/senken.d.ts +11 -0
- package/dist/tools/senken.d.ts.map +1 -0
- package/dist/tools/senken.js +482 -0
- package/dist/tools/senken.js.map +1 -0
- package/dist/tools/sentinel/index.d.ts +21 -0
- package/dist/tools/sentinel/index.d.ts.map +1 -0
- package/dist/tools/sentinel/index.js +1067 -0
- package/dist/tools/sentinel/index.js.map +1 -0
- package/dist/tools/sentinel-scan-data.d.ts +90 -0
- package/dist/tools/sentinel-scan-data.d.ts.map +1 -0
- package/dist/tools/sentinel-scan-data.js +122 -0
- package/dist/tools/sentinel-scan-data.js.map +1 -0
- package/dist/tools/sentinel.d.ts +156 -0
- package/dist/tools/sentinel.d.ts.map +1 -0
- package/dist/tools/sentinel.js +603 -0
- package/dist/tools/sentinel.js.map +1 -0
- package/dist/tools/shared/index.d.ts +5 -0
- package/dist/tools/shared/index.d.ts.map +1 -0
- package/dist/tools/shared/index.js +8 -0
- package/dist/tools/shared/index.js.map +1 -0
- package/dist/tools/shared/project.d.ts +17 -0
- package/dist/tools/shared/project.d.ts.map +1 -0
- package/dist/tools/shared/project.js +36 -0
- package/dist/tools/shared/project.js.map +1 -0
- package/dist/tools/shared/response.d.ts +15 -0
- package/dist/tools/shared/response.d.ts.map +1 -0
- package/dist/tools/shared/response.js +77 -0
- package/dist/tools/shared/response.js.map +1 -0
- package/dist/tools/shared/runTracker.d.ts +87 -0
- package/dist/tools/shared/runTracker.d.ts.map +1 -0
- package/dist/tools/shared/runTracker.js +225 -0
- package/dist/tools/shared/runTracker.js.map +1 -0
- package/dist/tools/shared/validation.d.ts +10 -0
- package/dist/tools/shared/validation.d.ts.map +1 -0
- package/dist/tools/shared/validation.js +26 -0
- package/dist/tools/shared/validation.js.map +1 -0
- package/dist/tools/studio/cloud-spine.d.ts +27 -0
- package/dist/tools/studio/cloud-spine.d.ts.map +1 -0
- package/dist/tools/studio/cloud-spine.js +845 -0
- package/dist/tools/studio/cloud-spine.js.map +1 -0
- package/dist/tools/studio/index.d.ts +154 -0
- package/dist/tools/studio/index.d.ts.map +1 -0
- package/dist/tools/studio/index.js +541 -0
- package/dist/tools/studio/index.js.map +1 -0
- package/dist/tools/testSpec.d.ts +122 -0
- package/dist/tools/testSpec.d.ts.map +1 -0
- package/dist/tools/testSpec.js +525 -0
- package/dist/tools/testSpec.js.map +1 -0
- package/dist/tools/toolsIndex.d.ts +5 -0
- package/dist/tools/toolsIndex.d.ts.map +1 -0
- package/dist/tools/toolsIndex.js +37 -0
- package/dist/tools/toolsIndex.js.map +1 -0
- package/dist/tools/types.d.ts +47 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +7 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/vector/index.d.ts +13 -0
- package/dist/tools/vector/index.d.ts.map +1 -0
- package/dist/tools/vector/index.js +592 -0
- package/dist/tools/vector/index.js.map +1 -0
- package/dist/tools/vector.d.ts +189 -0
- package/dist/tools/vector.d.ts.map +1 -0
- package/dist/tools/vector.js +570 -0
- package/dist/tools/vector.js.map +1 -0
- package/dist/tools/velocity/index.d.ts +9 -0
- package/dist/tools/velocity/index.d.ts.map +1 -0
- package/dist/tools/velocity/index.js +306 -0
- package/dist/tools/velocity/index.js.map +1 -0
- package/dist/tools/velocity.d.ts +143 -0
- package/dist/tools/velocity.d.ts.map +1 -0
- package/dist/tools/velocity.js +628 -0
- package/dist/tools/velocity.js.map +1 -0
- package/dist/tools/voice/index.d.ts +8 -0
- package/dist/tools/voice/index.d.ts.map +1 -0
- package/dist/tools/voice/index.js +203 -0
- package/dist/tools/voice/index.js.map +1 -0
- package/dist/tools/voice.d.ts +291 -0
- package/dist/tools/voice.d.ts.map +1 -0
- package/dist/tools/voice.js +734 -0
- package/dist/tools/voice.js.map +1 -0
- package/dist/tools/workflow/index.d.ts +8 -0
- package/dist/tools/workflow/index.d.ts.map +1 -0
- package/dist/tools/workflow/index.js +199 -0
- package/dist/tools/workflow/index.js.map +1 -0
- package/dist/tools/workflow.d.ts +123 -0
- package/dist/tools/workflow.d.ts.map +1 -0
- package/dist/tools/workflow.js +647 -0
- package/dist/tools/workflow.js.map +1 -0
- package/dist/transports/bridge.d.ts +22 -0
- package/dist/transports/bridge.d.ts.map +1 -0
- package/dist/transports/bridge.js +177 -0
- package/dist/transports/bridge.js.map +1 -0
- package/dist/transports/http.d.ts +9 -0
- package/dist/transports/http.d.ts.map +1 -0
- package/dist/transports/http.js +35 -0
- package/dist/transports/http.js.map +1 -0
- package/dist/transports/index.d.ts +6 -0
- package/dist/transports/index.d.ts.map +1 -0
- package/dist/transports/index.js +8 -0
- package/dist/transports/index.js.map +1 -0
- package/dist/transports/mcp.d.ts +9 -0
- package/dist/transports/mcp.d.ts.map +1 -0
- package/dist/transports/mcp.js +51 -0
- package/dist/transports/mcp.js.map +1 -0
- package/dist/transports/stdio.d.ts +9 -0
- package/dist/transports/stdio.d.ts.map +1 -0
- package/dist/transports/stdio.js +26 -0
- package/dist/transports/stdio.js.map +1 -0
- package/dist/transports/types.d.ts +27 -0
- package/dist/transports/types.d.ts.map +1 -0
- package/dist/transports/types.js +8 -0
- package/dist/transports/types.js.map +1 -0
- package/dist/types/agent-services.d.ts +193 -0
- package/dist/types/agent-services.d.ts.map +1 -0
- package/dist/types/agent-services.js +8 -0
- package/dist/types/agent-services.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +72 -0
- package/templates/AGENT.md +87 -0
- package/templates/com.decibel.daemon.plist +47 -0
- package/templates/sentinel/ISSUE_TEMPLATE.md +20 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Git-Sentinel Domain Tool Definitions
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Tools for linking git commits to Sentinel artifacts (issues, epics).
|
|
5
|
+
// Bidirectional: link commits to artifacts, query linked commits,
|
|
6
|
+
// and reverse-lookup which artifacts reference a commit.
|
|
7
|
+
// ============================================================================
|
|
8
|
+
import { toolSuccess, toolError } from '../shared/index.js';
|
|
9
|
+
import { sentinelLinkCommit, sentinelGetLinkedCommits, gitFindLinkedIssues, autoLinkCommit, isLinkError, } from '../git-sentinel.js';
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Constants
|
|
12
|
+
// ============================================================================
|
|
13
|
+
const RELATIONSHIP_TYPES = [
|
|
14
|
+
'fixes',
|
|
15
|
+
'closes',
|
|
16
|
+
'related',
|
|
17
|
+
'reverts',
|
|
18
|
+
'breaks',
|
|
19
|
+
'implements',
|
|
20
|
+
];
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// sentinel_link_commit
|
|
23
|
+
// ============================================================================
|
|
24
|
+
export const sentinelLinkCommitTool = {
|
|
25
|
+
definition: {
|
|
26
|
+
name: 'sentinel_link_commit',
|
|
27
|
+
description: 'Link a git commit to a Sentinel artifact (issue or epic). Creates a bidirectional reference stored in the artifact YAML. Use after committing a fix, implementing a feature, or reverting a change.',
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: {
|
|
31
|
+
projectId: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
description: 'Project identifier. Uses current project if not specified.',
|
|
34
|
+
},
|
|
35
|
+
artifactId: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'Sentinel artifact ID to link to (e.g., "ISS-0042", "EPIC-0015")',
|
|
38
|
+
},
|
|
39
|
+
commitSha: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'Full or short git commit SHA to link',
|
|
42
|
+
},
|
|
43
|
+
relationship: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
enum: [...RELATIONSHIP_TYPES],
|
|
46
|
+
description: 'How the commit relates to the artifact (default: "related")',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
required: ['artifactId', 'commitSha'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
handler: async (args) => {
|
|
53
|
+
try {
|
|
54
|
+
const result = await sentinelLinkCommit(args);
|
|
55
|
+
if (isLinkError(result)) {
|
|
56
|
+
return toolError(result.error, result.details);
|
|
57
|
+
}
|
|
58
|
+
return toolSuccess(result);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
// ============================================================================
|
|
66
|
+
// sentinel_get_linked_commits
|
|
67
|
+
// ============================================================================
|
|
68
|
+
export const sentinelListLinkedCommitsTool = {
|
|
69
|
+
definition: {
|
|
70
|
+
name: 'sentinel_list_linked_commits',
|
|
71
|
+
description: 'List all git commits linked to a Sentinel artifact (issue or epic). Shows commit SHAs, messages, relationships, and when they were linked.',
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
projectId: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: 'Project identifier. Uses current project if not specified.',
|
|
78
|
+
},
|
|
79
|
+
artifactId: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
description: 'Sentinel artifact ID to query (e.g., "ISS-0042", "EPIC-0015")',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
required: ['artifactId'],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
handler: async (args) => {
|
|
88
|
+
try {
|
|
89
|
+
const result = await sentinelGetLinkedCommits(args);
|
|
90
|
+
if (isLinkError(result)) {
|
|
91
|
+
return toolError(result.error, result.details);
|
|
92
|
+
}
|
|
93
|
+
return toolSuccess(result);
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
// ============================================================================
|
|
101
|
+
// git_find_linked_issues
|
|
102
|
+
// ============================================================================
|
|
103
|
+
export const gitFindLinkedIssuesTool = {
|
|
104
|
+
definition: {
|
|
105
|
+
name: 'git_find_linked_issues',
|
|
106
|
+
description: 'Reverse lookup: find all Sentinel artifacts (issues, epics) that reference a specific git commit. Useful for understanding the impact and context of a commit.',
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: 'object',
|
|
109
|
+
properties: {
|
|
110
|
+
projectId: {
|
|
111
|
+
type: 'string',
|
|
112
|
+
description: 'Project identifier. Uses current project if not specified.',
|
|
113
|
+
},
|
|
114
|
+
commitSha: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
description: 'Full or short git commit SHA to search for',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
required: ['commitSha'],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
handler: async (args) => {
|
|
123
|
+
try {
|
|
124
|
+
const result = await gitFindLinkedIssues(args);
|
|
125
|
+
if (isLinkError(result)) {
|
|
126
|
+
return toolError(result.error, result.details);
|
|
127
|
+
}
|
|
128
|
+
return toolSuccess(result);
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
// ============================================================================
|
|
136
|
+
// sentinel_auto_link
|
|
137
|
+
// ============================================================================
|
|
138
|
+
export const sentinelAutoLinkTool = {
|
|
139
|
+
definition: {
|
|
140
|
+
name: 'sentinel_auto_link',
|
|
141
|
+
description: 'Auto-link a commit to issues/epics referenced in its message. Parses patterns like "fixes ISS-0042", "closes EPIC-0001", or standalone "ISS-0042" references. Call after commits to automatically create links.',
|
|
142
|
+
inputSchema: {
|
|
143
|
+
type: 'object',
|
|
144
|
+
properties: {
|
|
145
|
+
projectId: {
|
|
146
|
+
type: 'string',
|
|
147
|
+
description: 'Project identifier. Uses current project if not specified.',
|
|
148
|
+
},
|
|
149
|
+
commitSha: {
|
|
150
|
+
type: 'string',
|
|
151
|
+
description: 'Commit SHA to process (default: HEAD). Parses commit message for issue/epic references.',
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
handler: async (args) => {
|
|
157
|
+
try {
|
|
158
|
+
const result = await autoLinkCommit(args);
|
|
159
|
+
if (isLinkError(result)) {
|
|
160
|
+
return toolError(result.error, result.details);
|
|
161
|
+
}
|
|
162
|
+
return toolSuccess(result);
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
// ============================================================================
|
|
170
|
+
// Export All Tools
|
|
171
|
+
// ============================================================================
|
|
172
|
+
export const gitSentinelTools = [
|
|
173
|
+
sentinelLinkCommitTool,
|
|
174
|
+
sentinelListLinkedCommitsTool,
|
|
175
|
+
gitFindLinkedIssuesTool,
|
|
176
|
+
sentinelAutoLinkTool,
|
|
177
|
+
];
|
|
178
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/git-sentinel/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,uCAAuC;AACvC,+EAA+E;AAC/E,uEAAuE;AACvE,kEAAkE;AAClE,yDAAyD;AACzD,+EAA+E;AAG/E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,WAAW,GAKZ,MAAM,oBAAoB,CAAC;AAE5B,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,kBAAkB,GAAG;IACzB,OAAO;IACP,QAAQ;IACR,SAA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C,CAAC;YACjD,CAAC;YACD,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,SAAS,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;CACF,CAAC;AAEF,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,sBAAsB;IACtB,6BAA6B;IAC7B,uBAAuB;IACvB,oBAAoB;CACrB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface LinkedCommit {
|
|
2
|
+
sha: string;
|
|
3
|
+
shortSha: string;
|
|
4
|
+
message: string;
|
|
5
|
+
relationship: 'fixes' | 'closes' | 'related' | 'reverts' | 'breaks' | 'implements';
|
|
6
|
+
linked_at: string;
|
|
7
|
+
linked_by?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SentinelLinkCommitInput {
|
|
10
|
+
projectId?: string;
|
|
11
|
+
artifactId: string;
|
|
12
|
+
commitSha: string;
|
|
13
|
+
relationship?: LinkedCommit['relationship'];
|
|
14
|
+
}
|
|
15
|
+
export interface SentinelLinkCommitOutput {
|
|
16
|
+
artifactId: string;
|
|
17
|
+
artifactPath: string;
|
|
18
|
+
commit: LinkedCommit;
|
|
19
|
+
totalLinkedCommits: number;
|
|
20
|
+
}
|
|
21
|
+
export interface SentinelGetCommitsInput {
|
|
22
|
+
projectId?: string;
|
|
23
|
+
artifactId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SentinelGetCommitsOutput {
|
|
26
|
+
artifactId: string;
|
|
27
|
+
commits: LinkedCommit[];
|
|
28
|
+
}
|
|
29
|
+
export interface GitFindIssueInput {
|
|
30
|
+
projectId?: string;
|
|
31
|
+
commitSha: string;
|
|
32
|
+
}
|
|
33
|
+
export interface GitFindIssueOutput {
|
|
34
|
+
commitSha: string;
|
|
35
|
+
linkedArtifacts: Array<{
|
|
36
|
+
id: string;
|
|
37
|
+
type: 'issue' | 'epic';
|
|
38
|
+
title: string;
|
|
39
|
+
relationship: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
export interface LinkError {
|
|
43
|
+
error: string;
|
|
44
|
+
details?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ParsedReference {
|
|
47
|
+
artifactId: string;
|
|
48
|
+
relationship: LinkedCommit['relationship'];
|
|
49
|
+
}
|
|
50
|
+
export interface AutoLinkInput {
|
|
51
|
+
projectId?: string;
|
|
52
|
+
commitSha?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface AutoLinkOutput {
|
|
55
|
+
commitSha: string;
|
|
56
|
+
commitMessage: string;
|
|
57
|
+
referencesFound: ParsedReference[];
|
|
58
|
+
linked: Array<{
|
|
59
|
+
artifactId: string;
|
|
60
|
+
relationship: string;
|
|
61
|
+
status: 'linked' | 'already_linked' | 'not_found';
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
export declare function sentinelLinkCommit(input: SentinelLinkCommitInput): Promise<SentinelLinkCommitOutput | LinkError>;
|
|
65
|
+
export declare function sentinelGetLinkedCommits(input: SentinelGetCommitsInput): Promise<SentinelGetCommitsOutput | LinkError>;
|
|
66
|
+
export declare function gitFindLinkedIssues(input: GitFindIssueInput): Promise<GitFindIssueOutput | LinkError>;
|
|
67
|
+
/**
|
|
68
|
+
* Parse commit message for issue/epic references.
|
|
69
|
+
* Supports patterns:
|
|
70
|
+
* - ISS-0042, EPIC-0001 (standalone references -> 'related')
|
|
71
|
+
* - fixes ISS-0042, closes EPIC-0001 (action + reference)
|
|
72
|
+
* - fix: ISS-0042, close: EPIC-0001 (conventional commit style)
|
|
73
|
+
* - implements EPIC-0001, reverts ISS-0042
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseCommitMessage(message: string): ParsedReference[];
|
|
76
|
+
export declare function autoLinkCommit(input: AutoLinkInput): Promise<AutoLinkOutput | LinkError>;
|
|
77
|
+
export declare function isLinkError(result: unknown): result is LinkError;
|
|
78
|
+
//# sourceMappingURL=git-sentinel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-sentinel.d.ts","sourceRoot":"","sources":["../../src/tools/git-sentinel.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC;IACnF,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;I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ACnB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA2FrC;AAMD,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,SAAS,CAEhE"}
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Git-Sentinel Integration Tools
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Tools for linking git history to Decibel artifacts.
|
|
5
|
+
// These are METADATA operations - they update .decibel files, not git.
|
|
6
|
+
// ============================================================================
|
|
7
|
+
import fs from 'fs/promises';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import YAML from 'yaml';
|
|
10
|
+
import { resolveProjectPaths } from '../projectRegistry.js';
|
|
11
|
+
import { gitLogRecent, isGitErrorResult } from './git.js';
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Helpers
|
|
14
|
+
// ============================================================================
|
|
15
|
+
function makeError(message, details) {
|
|
16
|
+
return { error: message, details };
|
|
17
|
+
}
|
|
18
|
+
async function findArtifactFile(resolved, artifactId) {
|
|
19
|
+
const id = artifactId.toUpperCase();
|
|
20
|
+
// Check issues
|
|
21
|
+
const issuesDir = resolved.subPath('sentinel', 'issues');
|
|
22
|
+
try {
|
|
23
|
+
const issueFiles = await fs.readdir(issuesDir);
|
|
24
|
+
const issueFile = issueFiles.find(f => f.toUpperCase().startsWith(id));
|
|
25
|
+
if (issueFile) {
|
|
26
|
+
return { path: path.join(issuesDir, issueFile), type: 'issue' };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch { /* dir doesn't exist */ }
|
|
30
|
+
// Check epics
|
|
31
|
+
const epicsDir = resolved.subPath('sentinel', 'epics');
|
|
32
|
+
try {
|
|
33
|
+
const epicFiles = await fs.readdir(epicsDir);
|
|
34
|
+
const epicFile = epicFiles.find(f => f.toUpperCase().startsWith(id));
|
|
35
|
+
if (epicFile) {
|
|
36
|
+
return { path: path.join(epicsDir, epicFile), type: 'epic' };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch { /* dir doesn't exist */ }
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
async function getCommitInfo(projectId, sha) {
|
|
43
|
+
const logResult = await gitLogRecent({ projectId, count: 100 });
|
|
44
|
+
if (isGitErrorResult(logResult)) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const commit = logResult.commits.find(c => c.sha.startsWith(sha) || c.shortSha === sha);
|
|
48
|
+
return commit || null;
|
|
49
|
+
}
|
|
50
|
+
// ============================================================================
|
|
51
|
+
// sentinel_link_commit
|
|
52
|
+
// ============================================================================
|
|
53
|
+
export async function sentinelLinkCommit(input) {
|
|
54
|
+
let resolved;
|
|
55
|
+
try {
|
|
56
|
+
resolved = resolveProjectPaths(input.projectId);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return makeError('Failed to resolve project path');
|
|
60
|
+
}
|
|
61
|
+
// Find the artifact file
|
|
62
|
+
const artifact = await findArtifactFile(resolved, input.artifactId);
|
|
63
|
+
if (!artifact) {
|
|
64
|
+
return makeError(`Artifact not found: ${input.artifactId}`, 'Check that the issue or epic ID is correct');
|
|
65
|
+
}
|
|
66
|
+
// Get commit info
|
|
67
|
+
const commitInfo = await getCommitInfo(input.projectId, input.commitSha);
|
|
68
|
+
if (!commitInfo) {
|
|
69
|
+
return makeError(`Commit not found: ${input.commitSha}`, 'Verify the commit SHA exists in this repository');
|
|
70
|
+
}
|
|
71
|
+
// Read current artifact
|
|
72
|
+
const content = await fs.readFile(artifact.path, 'utf-8');
|
|
73
|
+
// Parse YAML (handle frontmatter format)
|
|
74
|
+
let data;
|
|
75
|
+
let prefix = '';
|
|
76
|
+
let suffix = '';
|
|
77
|
+
if (content.startsWith('---')) {
|
|
78
|
+
const parts = content.split('---');
|
|
79
|
+
if (parts.length >= 3) {
|
|
80
|
+
prefix = '---\n';
|
|
81
|
+
data = YAML.parse(parts[1]) || {};
|
|
82
|
+
suffix = '\n---' + parts.slice(2).join('---');
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
data = YAML.parse(content) || {};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
data = YAML.parse(content) || {};
|
|
90
|
+
}
|
|
91
|
+
// Create linked commit entry
|
|
92
|
+
const linkedCommit = {
|
|
93
|
+
sha: commitInfo.sha,
|
|
94
|
+
shortSha: commitInfo.shortSha,
|
|
95
|
+
message: commitInfo.message,
|
|
96
|
+
relationship: input.relationship || 'related',
|
|
97
|
+
linked_at: new Date().toISOString(),
|
|
98
|
+
linked_by: 'ai:claude',
|
|
99
|
+
};
|
|
100
|
+
// Add to linked_commits array
|
|
101
|
+
const existingCommits = data.linked_commits || [];
|
|
102
|
+
// Check for duplicate
|
|
103
|
+
if (existingCommits.some(c => c.sha === linkedCommit.sha)) {
|
|
104
|
+
return makeError('Commit already linked', `${input.commitSha} is already linked to ${input.artifactId}`);
|
|
105
|
+
}
|
|
106
|
+
existingCommits.push(linkedCommit);
|
|
107
|
+
data.linked_commits = existingCommits;
|
|
108
|
+
data.updated_at = new Date().toISOString();
|
|
109
|
+
// Write back
|
|
110
|
+
const newContent = prefix + YAML.stringify(data) + suffix;
|
|
111
|
+
await fs.writeFile(artifact.path, newContent, 'utf-8');
|
|
112
|
+
return {
|
|
113
|
+
artifactId: input.artifactId,
|
|
114
|
+
artifactPath: artifact.path,
|
|
115
|
+
commit: linkedCommit,
|
|
116
|
+
totalLinkedCommits: existingCommits.length,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// ============================================================================
|
|
120
|
+
// sentinel_get_linked_commits
|
|
121
|
+
// ============================================================================
|
|
122
|
+
export async function sentinelGetLinkedCommits(input) {
|
|
123
|
+
let resolved;
|
|
124
|
+
try {
|
|
125
|
+
resolved = resolveProjectPaths(input.projectId);
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
return makeError('Failed to resolve project path');
|
|
129
|
+
}
|
|
130
|
+
const artifact = await findArtifactFile(resolved, input.artifactId);
|
|
131
|
+
if (!artifact) {
|
|
132
|
+
return makeError(`Artifact not found: ${input.artifactId}`);
|
|
133
|
+
}
|
|
134
|
+
const content = await fs.readFile(artifact.path, 'utf-8');
|
|
135
|
+
// Parse YAML
|
|
136
|
+
let data;
|
|
137
|
+
if (content.startsWith('---')) {
|
|
138
|
+
const parts = content.split('---');
|
|
139
|
+
data = parts.length >= 3 ? YAML.parse(parts[1]) || {} : YAML.parse(content) || {};
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
data = YAML.parse(content) || {};
|
|
143
|
+
}
|
|
144
|
+
const commits = data.linked_commits || [];
|
|
145
|
+
return {
|
|
146
|
+
artifactId: input.artifactId,
|
|
147
|
+
commits,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
// ============================================================================
|
|
151
|
+
// git_find_linked_issues
|
|
152
|
+
// ============================================================================
|
|
153
|
+
export async function gitFindLinkedIssues(input) {
|
|
154
|
+
let resolved;
|
|
155
|
+
try {
|
|
156
|
+
resolved = resolveProjectPaths(input.projectId);
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return makeError('Failed to resolve project path');
|
|
160
|
+
}
|
|
161
|
+
const linkedArtifacts = [];
|
|
162
|
+
// Scan issues
|
|
163
|
+
const issuesDir = resolved.subPath('sentinel', 'issues');
|
|
164
|
+
try {
|
|
165
|
+
const issueFiles = await fs.readdir(issuesDir);
|
|
166
|
+
for (const file of issueFiles) {
|
|
167
|
+
if (!file.endsWith('.yml') && !file.endsWith('.yaml') && !file.endsWith('.md'))
|
|
168
|
+
continue;
|
|
169
|
+
const content = await fs.readFile(path.join(issuesDir, file), 'utf-8');
|
|
170
|
+
// Quick check before parsing
|
|
171
|
+
if (!content.includes(input.commitSha))
|
|
172
|
+
continue;
|
|
173
|
+
// Parse and check linked_commits
|
|
174
|
+
let data;
|
|
175
|
+
if (content.startsWith('---')) {
|
|
176
|
+
const parts = content.split('---');
|
|
177
|
+
data = parts.length >= 3 ? YAML.parse(parts[1]) || {} : {};
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
data = YAML.parse(content) || {};
|
|
181
|
+
}
|
|
182
|
+
const commits = data.linked_commits || [];
|
|
183
|
+
const match = commits.find(c => c.sha.startsWith(input.commitSha) || c.shortSha === input.commitSha);
|
|
184
|
+
if (match) {
|
|
185
|
+
linkedArtifacts.push({
|
|
186
|
+
id: data.id,
|
|
187
|
+
type: 'issue',
|
|
188
|
+
title: data.title,
|
|
189
|
+
relationship: match.relationship,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch { /* dir doesn't exist */ }
|
|
195
|
+
// Scan epics
|
|
196
|
+
const epicsDir = resolved.subPath('sentinel', 'epics');
|
|
197
|
+
try {
|
|
198
|
+
const epicFiles = await fs.readdir(epicsDir);
|
|
199
|
+
for (const file of epicFiles) {
|
|
200
|
+
if (!file.endsWith('.yml') && !file.endsWith('.yaml') && !file.endsWith('.md'))
|
|
201
|
+
continue;
|
|
202
|
+
const content = await fs.readFile(path.join(epicsDir, file), 'utf-8');
|
|
203
|
+
if (!content.includes(input.commitSha))
|
|
204
|
+
continue;
|
|
205
|
+
let data;
|
|
206
|
+
if (content.startsWith('---')) {
|
|
207
|
+
const parts = content.split('---');
|
|
208
|
+
data = parts.length >= 3 ? YAML.parse(parts[1]) || {} : {};
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
data = YAML.parse(content) || {};
|
|
212
|
+
}
|
|
213
|
+
const commits = data.linked_commits || [];
|
|
214
|
+
const match = commits.find(c => c.sha.startsWith(input.commitSha) || c.shortSha === input.commitSha);
|
|
215
|
+
if (match) {
|
|
216
|
+
linkedArtifacts.push({
|
|
217
|
+
id: data.id,
|
|
218
|
+
type: 'epic',
|
|
219
|
+
title: data.title,
|
|
220
|
+
relationship: match.relationship,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch { /* dir doesn't exist */ }
|
|
226
|
+
return {
|
|
227
|
+
commitSha: input.commitSha,
|
|
228
|
+
linkedArtifacts,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
// ============================================================================
|
|
232
|
+
// parseCommitMessage - Extract issue/epic references from commit message
|
|
233
|
+
// ============================================================================
|
|
234
|
+
/**
|
|
235
|
+
* Parse commit message for issue/epic references.
|
|
236
|
+
* Supports patterns:
|
|
237
|
+
* - ISS-0042, EPIC-0001 (standalone references -> 'related')
|
|
238
|
+
* - fixes ISS-0042, closes EPIC-0001 (action + reference)
|
|
239
|
+
* - fix: ISS-0042, close: EPIC-0001 (conventional commit style)
|
|
240
|
+
* - implements EPIC-0001, reverts ISS-0042
|
|
241
|
+
*/
|
|
242
|
+
export function parseCommitMessage(message) {
|
|
243
|
+
const refs = [];
|
|
244
|
+
const seen = new Set();
|
|
245
|
+
// Pattern: action + artifact (fixes ISS-0042, closes EPIC-0001, etc.)
|
|
246
|
+
const actionPatterns = [
|
|
247
|
+
{ pattern: /(?:fix(?:es|ed)?|fixing)[:\s]+((iss|epic|issue)-?\d+)/gi, relationship: 'fixes' },
|
|
248
|
+
{ pattern: /(?:close[sd]?|closing)[:\s]+((iss|epic|issue)-?\d+)/gi, relationship: 'closes' },
|
|
249
|
+
{ pattern: /(?:implement[sd]?|implementing)[:\s]+((iss|epic|issue)-?\d+)/gi, relationship: 'implements' },
|
|
250
|
+
{ pattern: /(?:revert[sd]?|reverting)[:\s]+((iss|epic|issue)-?\d+)/gi, relationship: 'reverts' },
|
|
251
|
+
{ pattern: /(?:break[sd]?|breaking)[:\s]+((iss|epic|issue)-?\d+)/gi, relationship: 'breaks' },
|
|
252
|
+
];
|
|
253
|
+
for (const { pattern, relationship } of actionPatterns) {
|
|
254
|
+
let match;
|
|
255
|
+
while ((match = pattern.exec(message)) !== null) {
|
|
256
|
+
const artifactId = normalizeArtifactId(match[1]);
|
|
257
|
+
if (!seen.has(artifactId)) {
|
|
258
|
+
seen.add(artifactId);
|
|
259
|
+
refs.push({ artifactId, relationship });
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Pattern: standalone artifact references (ISS-0042, EPIC-0001)
|
|
264
|
+
// Only add as 'related' if not already captured with a specific relationship
|
|
265
|
+
const standalonePattern = /\b(iss(?:ue)?-?\d+|epic-?\d+)\b/gi;
|
|
266
|
+
let match;
|
|
267
|
+
while ((match = standalonePattern.exec(message)) !== null) {
|
|
268
|
+
const artifactId = normalizeArtifactId(match[1]);
|
|
269
|
+
if (!seen.has(artifactId)) {
|
|
270
|
+
seen.add(artifactId);
|
|
271
|
+
refs.push({ artifactId, relationship: 'related' });
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return refs;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Normalize artifact ID to standard format (ISS-0042, EPIC-0001)
|
|
278
|
+
*/
|
|
279
|
+
function normalizeArtifactId(raw) {
|
|
280
|
+
const upper = raw.toUpperCase();
|
|
281
|
+
// Handle ISSUE -> ISS
|
|
282
|
+
if (upper.startsWith('ISSUE')) {
|
|
283
|
+
const num = upper.replace(/[^0-9]/g, '');
|
|
284
|
+
return `ISS-${num.padStart(4, '0')}`;
|
|
285
|
+
}
|
|
286
|
+
// Handle ISS0042 -> ISS-0042
|
|
287
|
+
if (upper.startsWith('ISS') && !upper.includes('-')) {
|
|
288
|
+
const num = upper.replace(/[^0-9]/g, '');
|
|
289
|
+
return `ISS-${num.padStart(4, '0')}`;
|
|
290
|
+
}
|
|
291
|
+
// Handle EPIC0001 -> EPIC-0001
|
|
292
|
+
if (upper.startsWith('EPIC') && !upper.includes('-')) {
|
|
293
|
+
const num = upper.replace(/[^0-9]/g, '');
|
|
294
|
+
return `EPIC-${num.padStart(4, '0')}`;
|
|
295
|
+
}
|
|
296
|
+
// Already normalized
|
|
297
|
+
return upper;
|
|
298
|
+
}
|
|
299
|
+
// ============================================================================
|
|
300
|
+
// autoLinkCommit - Auto-link commit to referenced issues/epics
|
|
301
|
+
// ============================================================================
|
|
302
|
+
export async function autoLinkCommit(input) {
|
|
303
|
+
let resolved;
|
|
304
|
+
try {
|
|
305
|
+
resolved = resolveProjectPaths(input.projectId);
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
return makeError('Failed to resolve project path');
|
|
309
|
+
}
|
|
310
|
+
// Get commit info (HEAD if not specified)
|
|
311
|
+
const logResult = await gitLogRecent({ projectId: input.projectId, count: 1 });
|
|
312
|
+
if (isGitErrorResult(logResult) || logResult.commits.length === 0) {
|
|
313
|
+
return makeError('Failed to get commit info');
|
|
314
|
+
}
|
|
315
|
+
// If SHA specified, find it; otherwise use HEAD (first commit)
|
|
316
|
+
let commit = logResult.commits[0];
|
|
317
|
+
if (input.commitSha) {
|
|
318
|
+
const fullLog = await gitLogRecent({ projectId: input.projectId, count: 100 });
|
|
319
|
+
if (!isGitErrorResult(fullLog)) {
|
|
320
|
+
const found = fullLog.commits.find(c => c.sha.startsWith(input.commitSha) || c.shortSha === input.commitSha);
|
|
321
|
+
if (found)
|
|
322
|
+
commit = found;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
// Parse commit message for references
|
|
326
|
+
const refs = parseCommitMessage(commit.message);
|
|
327
|
+
if (refs.length === 0) {
|
|
328
|
+
return {
|
|
329
|
+
commitSha: commit.sha,
|
|
330
|
+
commitMessage: commit.message,
|
|
331
|
+
referencesFound: [],
|
|
332
|
+
linked: [],
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
// Try to link each reference
|
|
336
|
+
const linked = [];
|
|
337
|
+
for (const ref of refs) {
|
|
338
|
+
const artifact = await findArtifactFile(resolved, ref.artifactId);
|
|
339
|
+
if (!artifact) {
|
|
340
|
+
linked.push({
|
|
341
|
+
artifactId: ref.artifactId,
|
|
342
|
+
relationship: ref.relationship,
|
|
343
|
+
status: 'not_found',
|
|
344
|
+
});
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
// Try to link
|
|
348
|
+
const linkResult = await sentinelLinkCommit({
|
|
349
|
+
projectId: input.projectId,
|
|
350
|
+
artifactId: ref.artifactId,
|
|
351
|
+
commitSha: commit.sha,
|
|
352
|
+
relationship: ref.relationship,
|
|
353
|
+
});
|
|
354
|
+
if (isLinkError(linkResult)) {
|
|
355
|
+
if (linkResult.error === 'Commit already linked') {
|
|
356
|
+
linked.push({
|
|
357
|
+
artifactId: ref.artifactId,
|
|
358
|
+
relationship: ref.relationship,
|
|
359
|
+
status: 'already_linked',
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
linked.push({
|
|
364
|
+
artifactId: ref.artifactId,
|
|
365
|
+
relationship: ref.relationship,
|
|
366
|
+
status: 'not_found',
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
linked.push({
|
|
372
|
+
artifactId: ref.artifactId,
|
|
373
|
+
relationship: ref.relationship,
|
|
374
|
+
status: 'linked',
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
commitSha: commit.sha,
|
|
380
|
+
commitMessage: commit.message,
|
|
381
|
+
referencesFound: refs,
|
|
382
|
+
linked,
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
// ============================================================================
|
|
386
|
+
// Exports
|
|
387
|
+
// ============================================================================
|
|
388
|
+
export function isLinkError(result) {
|
|
389
|
+
return typeof result === 'object' && result !== null && 'error' in result;
|
|
390
|
+
}
|
|
391
|
+
//# sourceMappingURL=git-sentinel.js.map
|