@devtrack-solution/codesdd 1.2.2 → 1.2.3
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/.sdd/skills/curated/api-clean-flask-langgraph/SKILL.md +17 -17
- package/.sdd/skills/curated/devtrack-api/SKILL.md +160 -28
- package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +1 -1
- package/.sdd/skills/curated/devtrack-api/references/architecture-governance.md +8 -7
- package/.sdd/skills/curated/devtrack-api/references/consumer-sync-policy.md +93 -0
- package/.sdd/skills/curated/devtrack-api/references/contract-pack.yaml +317 -0
- package/.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md +95 -0
- package/.sdd/skills/curated/devtrack-api/references/foundation-layout.md +295 -0
- package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +4 -4
- package/.sdd/skills/curated/devtrack-api/references/imports-lint.md +4 -0
- package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +2 -2
- package/LICENSE +1 -1
- package/README.md +243 -51
- package/bin/codesdd.js +3 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +11 -558
- package/dist/cli/program.d.ts +14 -0
- package/dist/cli/program.js +645 -0
- package/dist/commands/change.js +5 -5
- package/dist/commands/completion.d.ts +1 -1
- package/dist/commands/completion.js +9 -2
- package/dist/commands/config.js +159 -20
- package/dist/commands/feedback.js +1 -1
- package/dist/commands/schema.d.ts +63 -0
- package/dist/commands/schema.js +12 -12
- package/dist/commands/sdd/backlog.d.ts +3 -0
- package/dist/commands/sdd/backlog.js +54 -0
- package/dist/commands/sdd/execution.js +147 -16
- package/dist/commands/sdd/plugin.d.ts +3 -0
- package/dist/commands/sdd/plugin.js +153 -0
- package/dist/commands/sdd/shared.js +2 -23
- package/dist/commands/sdd/skills.js +7 -0
- package/dist/commands/sdd.js +69 -12
- package/dist/commands/spec.js +9 -9
- package/dist/commands/validate.js +6 -6
- package/dist/commands/workflow/instructions.js +6 -6
- package/dist/commands/workflow/new-change.js +3 -3
- package/dist/commands/workflow/shared.d.ts +1 -1
- package/dist/commands/workflow/shared.js +4 -4
- package/dist/core/archive.js +15 -5
- package/dist/core/artifact-graph/instruction-loader.d.ts +1 -1
- package/dist/core/artifact-graph/instruction-loader.js +3 -3
- package/dist/core/artifact-graph/resolver.d.ts +4 -4
- package/dist/core/artifact-graph/resolver.js +6 -6
- package/dist/core/branding.js +3 -3
- package/dist/core/cli/command-matrix.js +10 -1
- package/dist/core/cli-command-quality.d.ts +27 -0
- package/dist/core/cli-command-quality.js +171 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +1 -1
- package/dist/core/command-generation/adapters/costrict.js +2 -2
- package/dist/core/command-generation/types.d.ts +1 -1
- package/dist/core/completions/command-registry.d.ts +1 -1
- package/dist/core/completions/command-registry.js +155 -12
- package/dist/core/completions/completion-provider.d.ts +14 -1
- package/dist/core/completions/completion-provider.js +29 -1
- package/dist/core/completions/generators/bash-generator.d.ts +1 -1
- package/dist/core/completions/generators/bash-generator.js +20 -12
- package/dist/core/completions/generators/fish-generator.d.ts +9 -1
- package/dist/core/completions/generators/fish-generator.js +39 -25
- package/dist/core/completions/generators/powershell-generator.d.ts +1 -1
- package/dist/core/completions/generators/powershell-generator.js +21 -11
- package/dist/core/completions/generators/zsh-generator.d.ts +3 -6
- package/dist/core/completions/generators/zsh-generator.js +21 -42
- package/dist/core/completions/installers/bash-installer.js +6 -6
- package/dist/core/completions/installers/fish-installer.js +1 -1
- package/dist/core/completions/installers/powershell-installer.js +14 -14
- package/dist/core/completions/installers/zsh-installer.d.ts +7 -1
- package/dist/core/completions/installers/zsh-installer.js +36 -8
- package/dist/core/completions/templates/bash-templates.d.ts +1 -1
- package/dist/core/completions/templates/bash-templates.js +12 -6
- package/dist/core/completions/templates/fish-templates.d.ts +2 -2
- package/dist/core/completions/templates/fish-templates.js +20 -9
- package/dist/core/completions/templates/powershell-templates.d.ts +1 -1
- package/dist/core/completions/templates/powershell-templates.js +13 -4
- package/dist/core/completions/templates/zsh-templates.d.ts +1 -1
- package/dist/core/completions/templates/zsh-templates.js +18 -9
- package/dist/core/config-schema.d.ts +3 -1
- package/dist/core/config-schema.js +26 -1
- package/dist/core/config.d.ts +3 -3
- package/dist/core/config.js +4 -4
- package/dist/core/global-config.d.ts +41 -12
- package/dist/core/global-config.js +344 -27
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/init.d.ts +6 -1
- package/dist/core/init.js +99 -77
- package/dist/core/legacy-cleanup.d.ts +17 -17
- package/dist/core/legacy-cleanup.js +96 -79
- package/dist/core/list.js +18 -4
- package/dist/core/migration.d.ts +3 -1
- package/dist/core/migration.js +7 -8
- package/dist/core/parsers/change-parser.js +1 -1
- package/dist/core/parsers/markdown-parser.js +2 -2
- package/dist/core/profile-sync-drift.d.ts +1 -1
- package/dist/core/profile-sync-drift.js +13 -13
- package/dist/core/project-config.d.ts +4 -4
- package/dist/core/project-config.js +11 -11
- package/dist/core/schemas/change.schema.d.ts +1 -1
- package/dist/core/schemas/change.schema.js +1 -1
- package/dist/core/schemas/spec.schema.d.ts +1 -1
- package/dist/core/schemas/spec.schema.js +1 -1
- package/dist/core/sdd/adr.js +23 -1
- package/dist/core/sdd/agent-binding.d.ts +346 -0
- package/dist/core/sdd/agent-binding.js +343 -0
- package/dist/core/sdd/backlog-cli.d.ts +16 -0
- package/dist/core/sdd/backlog-cli.js +146 -0
- package/dist/core/sdd/backlog-conflict-policy.d.ts +58 -0
- package/dist/core/sdd/backlog-conflict-policy.js +230 -0
- package/dist/core/sdd/backlog-projection.d.ts +8 -0
- package/dist/core/sdd/backlog-projection.js +89 -0
- package/dist/core/sdd/backlog-provider-contract.d.ts +252 -0
- package/dist/core/sdd/backlog-provider-contract.js +158 -0
- package/dist/core/sdd/bootstrap.js +2 -2
- package/dist/core/sdd/check.d.ts +42 -0
- package/dist/core/sdd/check.js +22 -22
- package/dist/core/sdd/contract.d.ts +13 -0
- package/dist/core/sdd/contract.js +36 -0
- package/dist/core/sdd/coordination/coordination-adapters.d.ts +38 -0
- package/dist/core/sdd/coordination/coordination-adapters.js +139 -1
- package/dist/core/sdd/deepagent-contracts.d.ts +276 -0
- package/dist/core/sdd/deepagent-contracts.js +173 -0
- package/dist/core/sdd/deepagents/adr-governor.d.ts +2 -0
- package/dist/core/sdd/deepagents/adr-governor.js +30 -0
- package/dist/core/sdd/deepagents/backend.d.ts +63 -0
- package/dist/core/sdd/deepagents/backend.js +174 -0
- package/dist/core/sdd/deepagents/codesdd-tools.d.ts +39 -0
- package/dist/core/sdd/deepagents/codesdd-tools.js +83 -0
- package/dist/core/sdd/deepagents/evidence-mapper.d.ts +86 -0
- package/dist/core/sdd/deepagents/evidence-mapper.js +178 -0
- package/dist/core/sdd/deepagents/model-provider.d.ts +53 -0
- package/dist/core/sdd/deepagents/model-provider.js +379 -0
- package/dist/core/sdd/deepagents/policy-enforcement.d.ts +30 -0
- package/dist/core/sdd/deepagents/policy-enforcement.js +90 -0
- package/dist/core/sdd/deepagents/policy.d.ts +75 -0
- package/dist/core/sdd/deepagents/policy.js +358 -0
- package/dist/core/sdd/deepagents/quality-witness.d.ts +3 -0
- package/dist/core/sdd/deepagents/quality-witness.js +77 -0
- package/dist/core/sdd/deepagents/reversa-subagents.d.ts +75 -0
- package/dist/core/sdd/deepagents/reversa-subagents.js +182 -0
- package/dist/core/sdd/deepagents/runtime-factory.d.ts +90 -0
- package/dist/core/sdd/deepagents/runtime-factory.js +231 -0
- package/dist/core/sdd/deepagents/runtime-loader.d.ts +16 -0
- package/dist/core/sdd/deepagents/runtime-loader.js +65 -0
- package/dist/core/sdd/default-bootstrap-files.d.ts +2 -2
- package/dist/core/sdd/default-bootstrap-files.js +36 -2
- package/dist/core/sdd/default-skills.d.ts +30 -0
- package/dist/core/sdd/default-skills.js +181 -5
- package/dist/core/sdd/devtrack-api-appliance.d.ts +84 -0
- package/dist/core/sdd/devtrack-api-appliance.js +257 -0
- package/dist/core/sdd/devtrack-api-architecture.d.ts +31 -0
- package/dist/core/sdd/devtrack-api-architecture.js +608 -0
- package/dist/core/sdd/devtrack-api-import-boundary.d.ts +19 -0
- package/dist/core/sdd/devtrack-api-import-boundary.js +32 -0
- package/dist/core/sdd/diagnose.d.ts +59 -0
- package/dist/core/sdd/diagnose.js +37 -37
- package/dist/core/sdd/docs-sync.js +33 -5
- package/dist/core/sdd/domain/post-active-validation.d.ts +7 -0
- package/dist/core/sdd/domain/post-active-validation.js +61 -0
- package/dist/core/sdd/domain/transition-engine.js +1 -0
- package/dist/core/sdd/entity-reference.d.ts +5 -0
- package/dist/core/sdd/entity-reference.js +22 -0
- package/dist/core/sdd/governance-backfill.d.ts +31 -0
- package/dist/core/sdd/governance-backfill.js +359 -0
- package/dist/core/sdd/governance-parser.d.ts +21 -0
- package/dist/core/sdd/governance-parser.js +91 -0
- package/dist/core/sdd/governance-schemas.d.ts +245 -0
- package/dist/core/sdd/governance-schemas.js +143 -0
- package/dist/core/sdd/{import-openspec.d.ts → import-legacy-spec.d.ts} +7 -7
- package/dist/core/sdd/{import-openspec.js → import-legacy-spec.js} +21 -29
- package/dist/core/sdd/init.d.ts +3 -0
- package/dist/core/sdd/init.js +6 -3
- package/dist/core/sdd/json-schema.js +100 -6
- package/dist/core/sdd/knowledge-graph.d.ts +45 -0
- package/dist/core/sdd/knowledge-graph.js +288 -0
- package/dist/core/sdd/legacy-operations.js +431 -43
- package/dist/core/sdd/lenses.d.ts +1 -0
- package/dist/core/sdd/lenses.js +29 -1
- package/dist/core/sdd/migrate-workspace.js +56 -2
- package/dist/core/sdd/migrate.d.ts +1 -1
- package/dist/core/sdd/migrate.js +36 -2
- package/dist/core/sdd/package-structure-gate.d.ts +83 -0
- package/dist/core/sdd/package-structure-gate.js +362 -0
- package/dist/core/sdd/parallel-feat-automation.d.ts +152 -0
- package/dist/core/sdd/parallel-feat-automation.js +212 -0
- package/dist/core/sdd/plugin-broker.d.ts +558 -0
- package/dist/core/sdd/plugin-broker.js +482 -0
- package/dist/core/sdd/plugin-certification.d.ts +79 -0
- package/dist/core/sdd/plugin-certification.js +453 -0
- package/dist/core/sdd/plugin-cli.d.ts +109 -0
- package/dist/core/sdd/plugin-cli.js +198 -0
- package/dist/core/sdd/plugin-evidence.d.ts +275 -0
- package/dist/core/sdd/plugin-evidence.js +307 -0
- package/dist/core/sdd/plugin-manifest.d.ts +164 -0
- package/dist/core/sdd/plugin-manifest.js +215 -0
- package/dist/core/sdd/plugin-policy-pack.d.ts +88 -0
- package/dist/core/sdd/plugin-policy-pack.js +236 -0
- package/dist/core/sdd/plugin-policy.d.ts +68 -0
- package/dist/core/sdd/plugin-policy.js +212 -0
- package/dist/core/sdd/plugin-registry.d.ts +311 -0
- package/dist/core/sdd/plugin-registry.js +138 -0
- package/dist/core/sdd/plugin-skill-binding.d.ts +151 -0
- package/dist/core/sdd/plugin-skill-binding.js +339 -0
- package/dist/core/sdd/quality-artifact-manifest-validator.d.ts +28 -0
- package/dist/core/sdd/quality-artifact-manifest-validator.js +167 -0
- package/dist/core/sdd/quality-evidence-renderer.d.ts +65 -0
- package/dist/core/sdd/quality-evidence-renderer.js +218 -0
- package/dist/core/sdd/quality-scenario-runner.d.ts +42 -0
- package/dist/core/sdd/quality-scenario-runner.js +613 -0
- package/dist/core/sdd/quality-validation.d.ts +547 -0
- package/dist/core/sdd/quality-validation.js +239 -0
- package/dist/core/sdd/resolve-project-root.d.ts +2 -2
- package/dist/core/sdd/resolve-project-root.js +11 -5
- package/dist/core/sdd/sanitize.d.ts +30 -1
- package/dist/core/sdd/sanitize.js +23 -23
- package/dist/core/sdd/services/agent-run.service.d.ts +65 -0
- package/dist/core/sdd/services/agent-run.service.js +189 -0
- package/dist/core/sdd/services/breakdown.service.js +2 -1
- package/dist/core/sdd/services/context.service.js +18 -16
- package/dist/core/sdd/services/debate.service.js +15 -2
- package/dist/core/sdd/services/feature-lint.service.d.ts +22 -0
- package/dist/core/sdd/services/feature-lint.service.js +105 -5
- package/dist/core/sdd/services/finalize.service.d.ts +80 -0
- package/dist/core/sdd/services/finalize.service.js +323 -24
- package/dist/core/sdd/services/frontend-gap.service.js +22 -7
- package/dist/core/sdd/services/governance-control-plane-runtime-adapters.d.ts +17 -0
- package/dist/core/sdd/services/governance-control-plane-runtime-adapters.js +38 -0
- package/dist/core/sdd/services/governance-control-plane.service.d.ts +66 -0
- package/dist/core/sdd/services/governance-control-plane.service.js +134 -0
- package/dist/core/sdd/services/ingest-deposito.service.js +1 -1
- package/dist/core/sdd/services/legacy-capability.service.d.ts +10 -7
- package/dist/core/sdd/services/legacy-capability.service.js +38 -21
- package/dist/core/sdd/services/mcp-runtime.service.d.ts +123 -8
- package/dist/core/sdd/services/mcp-runtime.service.js +1085 -33
- package/dist/core/sdd/services/onboard.service.js +2 -1
- package/dist/core/sdd/services/rebuild.service.js +6 -1
- package/dist/core/sdd/services/skills-sync.service.d.ts +17 -5
- package/dist/core/sdd/services/skills-sync.service.js +55 -2
- package/dist/core/sdd/services/start.service.js +6 -4
- package/dist/core/sdd/skill-bundles-curation-schema.d.ts +66 -0
- package/dist/core/sdd/skill-bundles-curation-schema.js +52 -0
- package/dist/core/sdd/skill-evidence.d.ts +19 -0
- package/dist/core/sdd/skill-evidence.js +38 -0
- package/dist/core/sdd/skill-policy-pool.d.ts +46 -0
- package/dist/core/sdd/skill-policy-pool.js +185 -0
- package/dist/core/sdd/state.d.ts +22 -0
- package/dist/core/sdd/state.js +66 -41
- package/dist/core/sdd/structural-health.d.ts +42 -42
- package/dist/core/sdd/types.d.ts +33 -7
- package/dist/core/sdd/types.js +17 -0
- package/dist/core/sdd/upgrade-to-codesdd.d.ts +45 -0
- package/dist/core/sdd/upgrade-to-codesdd.js +179 -0
- package/dist/core/sdd/workspace-schemas.d.ts +285 -14
- package/dist/core/sdd/workspace-schemas.js +148 -0
- package/dist/core/sdd/write-manifest.js +22 -4
- package/dist/core/shared/skill-generation.d.ts +1 -1
- package/dist/core/shared/skill-generation.js +15 -15
- package/dist/core/shared/tool-detection.d.ts +3 -3
- package/dist/core/shared/tool-detection.js +14 -14
- package/dist/core/specs-apply.js +6 -6
- package/dist/core/templates/index.d.ts +1 -1
- package/dist/core/templates/index.js +1 -1
- package/dist/core/templates/workflows/apply-change.js +14 -14
- package/dist/core/templates/workflows/archive-change.js +32 -32
- package/dist/core/templates/workflows/bulk-archive-change.js +25 -25
- package/dist/core/templates/workflows/continue-change.js +12 -12
- package/dist/core/templates/workflows/explore.js +29 -29
- package/dist/core/templates/workflows/feedback.js +6 -6
- package/dist/core/templates/workflows/ff-change.js +24 -24
- package/dist/core/templates/workflows/new-change.js +20 -20
- package/dist/core/templates/workflows/onboard.js +33 -33
- package/dist/core/templates/workflows/propose.js +23 -23
- package/dist/core/templates/workflows/sdd.js +8 -8
- package/dist/core/templates/workflows/sync-specs.js +19 -19
- package/dist/core/templates/workflows/verify-change.js +17 -17
- package/dist/core/update.d.ts +2 -2
- package/dist/core/update.js +16 -15
- package/dist/core/validation/constants.d.ts +1 -1
- package/dist/core/validation/constants.js +1 -1
- package/dist/core/view.js +11 -11
- package/dist/telemetry/config.d.ts +2 -1
- package/dist/telemetry/config.js +17 -8
- package/dist/telemetry/index.d.ts +10 -2
- package/dist/telemetry/index.js +40 -7
- package/dist/ui/ascii-patterns.d.ts +2 -2
- package/dist/ui/ascii-patterns.js +2 -2
- package/dist/ui/welcome-screen.js +2 -2
- package/dist/utils/change-metadata.d.ts +4 -4
- package/dist/utils/change-metadata.js +6 -6
- package/dist/utils/change-utils.d.ts +3 -3
- package/dist/utils/change-utils.js +5 -5
- package/dist/utils/file-system.js +1 -1
- package/dist/utils/interactive.js +1 -1
- package/dist/utils/item-discovery.js +4 -4
- package/dist/utils/legacy-spec-compat.d.ts +2 -0
- package/dist/utils/legacy-spec-compat.js +2 -0
- package/dist/utils/shell-detection.d.ts +1 -0
- package/dist/utils/shell-detection.js +16 -0
- package/package.json +27 -17
- package/schemas/sdd/1-spec.schema.json +1 -1
- package/schemas/sdd/2-plan.schema.json +73 -1
- package/schemas/sdd/3-tasks.schema.json +73 -1
- package/schemas/sdd/4-changelog.schema.json +1 -1
- package/schemas/sdd/5-quality.schema.json +442 -2
- package/schemas/sdd/adr.schema.json +148 -0
- package/schemas/sdd/agent-binding-adapter.schema.json +210 -0
- package/schemas/sdd/agent-binding-resolution.schema.json +338 -0
- package/schemas/sdd/backlog-projection-plan.schema.json +180 -0
- package/schemas/sdd/backlog-provider-contract.schema.json +260 -0
- package/schemas/sdd/codesdd-plugin.schema.json +474 -0
- package/schemas/sdd/debate.schema.json +244 -0
- package/schemas/sdd/deepagent-decision-evidence.schema.json +58 -0
- package/schemas/sdd/deepagent-env-contract.schema.json +143 -0
- package/schemas/sdd/deepagent-quality-evidence.schema.json +108 -0
- package/schemas/sdd/deepagent-run-evidence.schema.json +192 -0
- package/schemas/sdd/deepagent-run-plan.schema.json +197 -0
- package/schemas/sdd/deepagent-run-request.schema.json +321 -0
- package/schemas/sdd/deepagent-subagent-evidence.schema.json +110 -0
- package/schemas/sdd/deepagent-tool-call-evidence.schema.json +78 -0
- package/schemas/sdd/discarded.schema.json +127 -0
- package/schemas/sdd/epic.schema.json +147 -0
- package/schemas/sdd/insight.schema.json +136 -0
- package/schemas/sdd/parallel-feat-automation-plan.schema.json +215 -0
- package/schemas/sdd/parallel-feat-automation-request.schema.json +109 -0
- package/schemas/sdd/plugin-artifact-manifest.schema.json +150 -0
- package/schemas/sdd/plugin-compliance-index.schema.json +136 -0
- package/schemas/sdd/plugin-dry-run-plan.schema.json +260 -0
- package/schemas/sdd/plugin-evidence-manifest.schema.json +569 -0
- package/schemas/sdd/plugin-policy-evaluation.schema.json +92 -0
- package/schemas/sdd/plugin-policy-pack-evaluation.schema.json +94 -0
- package/schemas/sdd/plugin-policy-pack.schema.json +196 -0
- package/schemas/sdd/plugin-registry.schema.json +558 -0
- package/schemas/sdd/plugin-rollback-manifest.schema.json +87 -0
- package/schemas/sdd/plugin-runtime-invocation-plan.schema.json +845 -0
- package/schemas/sdd/plugin-skill-binding-resolution.schema.json +305 -0
- package/schemas/sdd/plugin-skill-binding.schema.json +88 -0
- package/schemas/sdd/plugin-validation-manifest.schema.json +123 -0
- package/schemas/sdd/quality-architecture-schema.schema.json +216 -0
- package/schemas/sdd/quality-evidence-bundle.schema.json +1228 -0
- package/schemas/sdd/quality-run.schema.json +197 -0
- package/schemas/sdd/quality-scenario.schema.json +252 -0
- package/schemas/sdd/workspace-catalog.schema.json +9841 -22
- package/schemas/spec-driven/schema.yaml +4 -4
- package/schemas/spec-driven/templates/proposal.md +1 -1
- package/dist/utils/openspec-compat.d.ts +0 -2
- package/dist/utils/openspec-compat.js +0 -2
|
@@ -10,11 +10,21 @@ import { ApproveService } from '../../core/sdd/services/approve.service.js';
|
|
|
10
10
|
import { NextService } from '../../core/sdd/services/next.service.js';
|
|
11
11
|
import { AuditService } from '../../core/sdd/services/audit.service.js';
|
|
12
12
|
import { McpRuntimeService } from '../../core/sdd/services/mcp-runtime.service.js';
|
|
13
|
+
import { DeepAgentsRunService } from '../../core/sdd/services/agent-run.service.js';
|
|
13
14
|
import { ensureMandatorySddMigration, parseCsvOption, parseFlowModeOption, resolveRoot } from './shared.js';
|
|
15
|
+
function parseJsonObjectOption(value) {
|
|
16
|
+
if (!value)
|
|
17
|
+
return {};
|
|
18
|
+
const parsed = JSON.parse(value);
|
|
19
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
20
|
+
throw new Error('--input must be a JSON object.');
|
|
21
|
+
}
|
|
22
|
+
return parsed;
|
|
23
|
+
}
|
|
14
24
|
export function registerExecutionCommands(sddCmd) {
|
|
15
25
|
sddCmd
|
|
16
26
|
.command('mcp-manifest')
|
|
17
|
-
.description('Render a provider-agnostic MCP manifest for
|
|
27
|
+
.description('Render a provider-agnostic MCP manifest for CodeSDD execution tools')
|
|
18
28
|
.option('--provider <provider>', 'Client profile: codex|claude-code|kimmy-code|kilo-code|open-code|generic')
|
|
19
29
|
.option('--json', 'JSON output')
|
|
20
30
|
.action(async (options) => {
|
|
@@ -28,22 +38,46 @@ export function registerExecutionCommands(sddCmd) {
|
|
|
28
38
|
console.log(JSON.stringify(manifest, null, 2));
|
|
29
39
|
return;
|
|
30
40
|
}
|
|
31
|
-
console.log(chalk.green(`
|
|
41
|
+
console.log(chalk.green(`CodeSDD MCP manifest for ${manifest.provider.label}`));
|
|
32
42
|
console.log(`Protocol: ${manifest.protocol}`);
|
|
33
43
|
console.log(`Transport: ${manifest.provider.transport}`);
|
|
34
44
|
console.log(`Tools: ${manifest.tools.map((tool) => tool.name).join(', ')}`);
|
|
35
45
|
});
|
|
36
46
|
sddCmd
|
|
37
47
|
.command('mcp-call <tool>')
|
|
38
|
-
.description('Invoke
|
|
48
|
+
.description('Invoke governed CodeSDD MCP tools for DeepAgents')
|
|
39
49
|
.option('--provider <provider>', 'Client profile: codex|claude-code|kimmy-code|kilo-code|open-code|generic')
|
|
40
|
-
.option('--ref <ref>', 'Reference for
|
|
41
|
-
.option('--
|
|
42
|
-
.option('--
|
|
43
|
-
.option('--
|
|
44
|
-
.option('--
|
|
45
|
-
.option('--
|
|
46
|
-
.option('--
|
|
50
|
+
.option('--ref <ref>', 'Reference for context/read/query/quality tools')
|
|
51
|
+
.option('--ref-or-text <value>', 'Reference or free text for codesdd.start intent')
|
|
52
|
+
.option('--feature-id <id>', 'Feature id for codesdd.finalize_intent or codesdd.frontend_impact')
|
|
53
|
+
.option('--status <status>', 'Status for codesdd.frontend_impact: unknown|none|required')
|
|
54
|
+
.option('--reason <text>', 'Reason for codesdd.frontend_impact when applicable')
|
|
55
|
+
.option('--routes <list>', 'CSV routes for codesdd.frontend_impact')
|
|
56
|
+
.option('--surfaces <list>', 'CSV surfaces for codesdd.frontend_impact')
|
|
57
|
+
.option('--manifest-path <path>', 'Plugin manifest path for plugin tools')
|
|
58
|
+
.option('--feature-ref <ref>', 'Feature ref for plugin plan/apply_sandbox')
|
|
59
|
+
.option('--capability <name>', 'Plugin capability for plugin plan/apply_sandbox')
|
|
60
|
+
.option('--skill-ref <ref>', 'Skill reference for plugin plan/apply_sandbox')
|
|
61
|
+
.option('--input <json>', 'JSON object input for plugin plan/apply_sandbox')
|
|
62
|
+
.option('--write-scope <list>', 'CSV write scope for plugin plan/apply_sandbox')
|
|
63
|
+
.option('--approval-grants <list>', 'CSV approvals for plugin plan/apply_sandbox')
|
|
64
|
+
.option('--planned-writes <list>', 'CSV planned writes for plugin plan/apply_sandbox')
|
|
65
|
+
.option('--requested-env <list>', 'CSV env vars for plugin plan/apply_sandbox')
|
|
66
|
+
.option('--network-domains <list>', 'CSV domains for plugin plan/apply_sandbox')
|
|
67
|
+
.option('--process-spawn-requested', 'Whether plugin plan/apply_sandbox requests process spawn')
|
|
68
|
+
.option('--strict', 'Strict mode for codesdd.check and codesdd.diagnose')
|
|
69
|
+
.option('--doc <doc>', 'Workspace doc for codesdd.read: spec|plan|tasks|changelog|quality|all')
|
|
70
|
+
.option('--query <query>', 'Search expression for codesdd.query')
|
|
71
|
+
.option('--scope <scope>', 'Search scope for codesdd.query: backlog|discovery|all')
|
|
72
|
+
.option('--rank <rank>', 'Ranking for codesdd.next: impact|criticality|fifo')
|
|
73
|
+
.option('--limit <n>', 'Limit for codesdd.next')
|
|
74
|
+
.option('--max-agents <n>', 'Max agents for codesdd.next wave simulation')
|
|
75
|
+
.option('--ids <list>', 'CSV skill IDs for codesdd.skill_prompt')
|
|
76
|
+
.option('--phase <phase>', 'Phase for codesdd.skill_prompt')
|
|
77
|
+
.option('--domains <list>', 'CSV domains for codesdd.skill_prompt')
|
|
78
|
+
.option('--bundles <list>', 'CSV bundles for codesdd.skill_prompt')
|
|
79
|
+
.option('--max <n>', 'Max suggested skills for codesdd.skill_prompt')
|
|
80
|
+
.option('--objective <text>', 'Objective text for codesdd.skill_prompt')
|
|
47
81
|
.option('--json', 'JSON output')
|
|
48
82
|
.action(async (tool, options) => {
|
|
49
83
|
const root = resolveRoot();
|
|
@@ -57,30 +91,124 @@ export function registerExecutionCommands(sddCmd) {
|
|
|
57
91
|
tool: tool,
|
|
58
92
|
args: {
|
|
59
93
|
ref: options?.ref,
|
|
94
|
+
refOrText: options?.refOrText,
|
|
95
|
+
featureId: options?.featureId,
|
|
96
|
+
status: options?.status,
|
|
97
|
+
reason: options?.reason,
|
|
98
|
+
routes: parseCsvOption(options?.routes),
|
|
99
|
+
surfaces: parseCsvOption(options?.surfaces),
|
|
100
|
+
manifestPath: options?.manifestPath,
|
|
101
|
+
featureRef: options?.featureRef,
|
|
102
|
+
capability: options?.capability,
|
|
103
|
+
skillRef: options?.skillRef,
|
|
104
|
+
inputs: parseJsonObjectOption(options?.input),
|
|
105
|
+
writeScope: parseCsvOption(options?.writeScope),
|
|
106
|
+
approvalGrants: parseCsvOption(options?.approvalGrants),
|
|
107
|
+
plannedWrites: parseCsvOption(options?.plannedWrites),
|
|
108
|
+
requestedEnv: parseCsvOption(options?.requestedEnv),
|
|
109
|
+
networkDomains: parseCsvOption(options?.networkDomains),
|
|
110
|
+
processSpawnRequested: options?.processSpawnRequested,
|
|
111
|
+
strict: options?.strict,
|
|
112
|
+
doc: options?.doc,
|
|
113
|
+
query: options?.query,
|
|
114
|
+
scope: options?.scope,
|
|
60
115
|
rank: options?.rank,
|
|
61
116
|
limit: options?.limit ? Number.parseInt(options.limit, 10) : undefined,
|
|
62
117
|
maxAgents: options?.maxAgents ? Number.parseInt(options.maxAgents, 10) : undefined,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
118
|
+
ids: parseCsvOption(options?.ids),
|
|
119
|
+
phase: options?.phase,
|
|
120
|
+
domains: parseCsvOption(options?.domains),
|
|
121
|
+
bundles: parseCsvOption(options?.bundles),
|
|
122
|
+
max: options?.max ? Number.parseInt(options.max, 10) : undefined,
|
|
123
|
+
objective: options?.objective,
|
|
67
124
|
},
|
|
68
125
|
});
|
|
69
126
|
if (options?.json) {
|
|
70
127
|
console.log(JSON.stringify(response, null, 2));
|
|
71
128
|
return;
|
|
72
129
|
}
|
|
73
|
-
console.log(chalk.green(`
|
|
130
|
+
console.log(chalk.green(`CodeSDD MCP call completed: ${response.tool}`));
|
|
74
131
|
console.log(`Provider: ${response.provider}`);
|
|
75
132
|
console.log(`Invoked at: ${response.invoked_at}`);
|
|
76
133
|
console.log(JSON.stringify(response.result, null, 2));
|
|
77
134
|
});
|
|
135
|
+
const agentCmd = sddCmd
|
|
136
|
+
.command('agent')
|
|
137
|
+
.description('Governed agent execution commands for external providers');
|
|
138
|
+
agentCmd
|
|
139
|
+
.command('run <featureId>')
|
|
140
|
+
.description('Run DeepAgents mode policy gate with fail-closed enforcement')
|
|
141
|
+
.requiredOption('--provider <provider>', 'Execution provider (FEAT-0243 accepts only deepagents)')
|
|
142
|
+
.option('--mode <mode>', 'Execution mode: read-only|plan|validate|apply-sandbox|apply-approved')
|
|
143
|
+
.option('--plugin-execution-path <path>', 'Plugin execution path: broker|direct', 'broker')
|
|
144
|
+
.option('--plugin-flow <list>', 'CSV plugin broker/evidence checkpoints for mutation modes')
|
|
145
|
+
.option('--operations <list>', 'CSV runtime operations requested by this run: read|write|execute|network|plugin-apply|finalize|dependency-change|process-spawn')
|
|
146
|
+
.option('--write-scope <list>', 'CSV project-relative write scopes allowed for the runtime')
|
|
147
|
+
.option('--planned-writes <list>', 'CSV project-relative files the runtime plans to write')
|
|
148
|
+
.option('--requested-env <list>', 'CSV environment variables requested for runtime passthrough')
|
|
149
|
+
.option('--network-domains <list>', 'CSV network domains requested by this run')
|
|
150
|
+
.option('--approval-grants <list>', 'CSV HITL approval grants: operation names or all')
|
|
151
|
+
.option('--json', 'JSON output')
|
|
152
|
+
.action(async (featureId, options) => {
|
|
153
|
+
const root = resolveRoot();
|
|
154
|
+
const __config = await loadProjectSddConfig(root);
|
|
155
|
+
const __paths = resolveSddPaths(root, __config);
|
|
156
|
+
const stores = createSddStores(__paths);
|
|
157
|
+
void stores;
|
|
158
|
+
await ensureMandatorySddMigration(root);
|
|
159
|
+
const command = new DeepAgentsRunService();
|
|
160
|
+
const result = await command.execute(featureId, {
|
|
161
|
+
provider: options.provider,
|
|
162
|
+
mode: options.mode,
|
|
163
|
+
plugin_execution_path: options.pluginExecutionPath,
|
|
164
|
+
plugin_flow: parseCsvOption(options.pluginFlow),
|
|
165
|
+
operations: parseCsvOption(options.operations),
|
|
166
|
+
write_scope: parseCsvOption(options.writeScope),
|
|
167
|
+
planned_writes: parseCsvOption(options.plannedWrites),
|
|
168
|
+
requested_env: parseCsvOption(options.requestedEnv),
|
|
169
|
+
network_domains: parseCsvOption(options.networkDomains),
|
|
170
|
+
approval_grants: parseCsvOption(options.approvalGrants),
|
|
171
|
+
}, { projectRoot: root, stores });
|
|
172
|
+
if (options.json) {
|
|
173
|
+
console.log(JSON.stringify(result, null, 2));
|
|
174
|
+
if (result.status === 'blocked') {
|
|
175
|
+
process.exitCode = 1;
|
|
176
|
+
}
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (result.status === 'allowed') {
|
|
180
|
+
console.log(chalk.green(`DeepAgents run policy: ${result.status}`));
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
console.log(chalk.red(`DeepAgents run policy: ${result.status}`));
|
|
184
|
+
}
|
|
185
|
+
console.log(`Feature: ${result.feature_id}`);
|
|
186
|
+
console.log(`Provider: ${result.provider}`);
|
|
187
|
+
console.log(`Mode: ${result.mode}`);
|
|
188
|
+
console.log(`Fail-closed: ${result.fail_closed ? 'yes' : 'no'}`);
|
|
189
|
+
console.log(`Direct .sdd/state writes: ${result.evidence.direct_state_write_allowed ? 'allowed' : 'blocked'}`);
|
|
190
|
+
console.log(`Plugin execution path: ${result.evidence.plugin_execution.requested_path}`);
|
|
191
|
+
if (result.evidence.runtime) {
|
|
192
|
+
console.log(`Runtime: ${result.evidence.runtime.adapter.runtime}`);
|
|
193
|
+
console.log(`Runtime status: ${result.evidence.runtime.adapter.status}`);
|
|
194
|
+
}
|
|
195
|
+
if (result.evidence.plugin_execution.missing_flow.length > 0) {
|
|
196
|
+
console.log(`Missing plugin flow: ${result.evidence.plugin_execution.missing_flow.join(', ')}`);
|
|
197
|
+
}
|
|
198
|
+
console.log(`Evidence run id: ${result.evidence.run_id}`);
|
|
199
|
+
if (result.reasons.length > 0) {
|
|
200
|
+
console.log(`Reasons: ${result.reasons.join(' | ')}`);
|
|
201
|
+
}
|
|
202
|
+
if (result.status === 'blocked') {
|
|
203
|
+
process.exitCode = 1;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
78
206
|
sddCmd
|
|
79
207
|
.command('start <refOrText>')
|
|
80
208
|
.description('Starts FEAT/EPIC/FGAP/TD execution or creates a direct FEAT')
|
|
81
209
|
.alias('iniciar-execucao')
|
|
82
210
|
.option('--scale <scale>', 'Escala QUICK|STANDARD|LARGE')
|
|
83
|
-
.option('--schema <schema>', 'Schema para criar change em
|
|
211
|
+
.option('--schema <schema>', 'Schema para criar change de compatibilidade em legacy-spec/changes')
|
|
84
212
|
.option('--force', 'Bypass de bloqueios e conflitos de lock')
|
|
85
213
|
.option('--force-transition', 'Bypass das restrições e violações das lentes estruturais')
|
|
86
214
|
.option('--flow-mode <flowMode>', 'Flow: direct|standard|rigorous')
|
|
@@ -262,6 +390,9 @@ export function registerExecutionCommands(sddCmd) {
|
|
|
262
390
|
.option('--compact', 'Retorna payload resumido')
|
|
263
391
|
.option('--full', 'Retorna payload completo em JSON (desativa modo compacto automatico)')
|
|
264
392
|
.action(async (target = 'system', options) => {
|
|
393
|
+
if (options?.compact && options?.full) {
|
|
394
|
+
throw new Error("Options '--compact' and '--full' are mutually exclusive. Choose one.");
|
|
395
|
+
}
|
|
265
396
|
const root = resolveRoot();
|
|
266
397
|
const __config = await loadProjectSddConfig(root);
|
|
267
398
|
const __paths = resolveSddPaths(root, __config);
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { inspectPluginManifestFromFile, planDevTrackApiScaffoldDryRunFromFile, planPluginInvocationFromFile, } from '../../core/sdd/plugin-cli.js';
|
|
3
|
+
import { parseCsvOption } from './shared.js';
|
|
4
|
+
export function registerPluginCommands(sddCmd) {
|
|
5
|
+
const pluginCmd = sddCmd.command('plugin').description('Inspect and plan enterprise plugin operations');
|
|
6
|
+
pluginCmd
|
|
7
|
+
.command('inspect <manifestPath>')
|
|
8
|
+
.description('Inspect a CodeSDD plugin manifest without executing it')
|
|
9
|
+
.option('--json', 'Return plugin manifest summary as JSON')
|
|
10
|
+
.action(async (manifestPath, options) => {
|
|
11
|
+
const result = await inspectPluginManifestFromFile(manifestPath);
|
|
12
|
+
if (options?.json) {
|
|
13
|
+
console.log(JSON.stringify(result, null, 2));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
printInspectResult(result);
|
|
17
|
+
});
|
|
18
|
+
pluginCmd
|
|
19
|
+
.command('plan <manifestPath>')
|
|
20
|
+
.description('Build a non-executing runtime invocation plan for a plugin capability')
|
|
21
|
+
.requiredOption('--feature <ref>', 'Feature reference that owns the operation, for example FEAT-0148')
|
|
22
|
+
.requiredOption('--capability <name>', 'Plugin capability to resolve, for example scaffold.project')
|
|
23
|
+
.option('--skill <ref>', 'Skill reference bound to the operation')
|
|
24
|
+
.option('--input <json>', 'JSON object passed as plugin capability input')
|
|
25
|
+
.option('--write-scope <list>', 'Comma-separated requested write scope')
|
|
26
|
+
.option('--apply', 'Plan an apply operation instead of dry-run')
|
|
27
|
+
.option('--rollback', 'Plan a rollback operation instead of dry-run')
|
|
28
|
+
.option('--approval <list>', 'Comma-separated approval grants: maintainer,security,architecture-board')
|
|
29
|
+
.option('--operation-id <id>', 'Stable operation id to use in the invocation envelope')
|
|
30
|
+
.option('--source-checksum <checksum>', 'Expected source checksum for policy evaluation')
|
|
31
|
+
.option('--planned-writes <list>', 'Comma-separated planned write paths for policy evaluation')
|
|
32
|
+
.option('--env <list>', 'Comma-separated requested environment variables')
|
|
33
|
+
.option('--network-domains <list>', 'Comma-separated requested network domains')
|
|
34
|
+
.option('--process-spawn', 'Declare that the operation requests process spawning')
|
|
35
|
+
.option('--language <language>', 'Technology language constraint')
|
|
36
|
+
.option('--framework <framework>', 'Technology framework constraint')
|
|
37
|
+
.option('--json', 'Return invocation plan as JSON')
|
|
38
|
+
.action(async (manifestPath, options) => {
|
|
39
|
+
const result = await planPluginInvocationFromFile(manifestPath, {
|
|
40
|
+
feature_ref: options.feature,
|
|
41
|
+
capability: options.capability,
|
|
42
|
+
mode: resolvePlanMode(options),
|
|
43
|
+
skill_ref: options.skill,
|
|
44
|
+
inputs: parseJsonObjectOption(options.input),
|
|
45
|
+
requested_write_scope: parseCsvOption(options.writeScope),
|
|
46
|
+
approval_grants: parseCsvOption(options.approval),
|
|
47
|
+
operation_id: options.operationId,
|
|
48
|
+
source_checksum: options.sourceChecksum,
|
|
49
|
+
planned_writes: parseCsvOption(options.plannedWrites),
|
|
50
|
+
requested_env: parseCsvOption(options.env),
|
|
51
|
+
network_domains: parseCsvOption(options.networkDomains),
|
|
52
|
+
process_spawn_requested: options.processSpawn ?? false,
|
|
53
|
+
technology: resolveTechnologyConstraint(options),
|
|
54
|
+
});
|
|
55
|
+
if (options.json) {
|
|
56
|
+
console.log(JSON.stringify(result, null, 2));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
printPlanResult(result);
|
|
60
|
+
});
|
|
61
|
+
const devtrackApiCmd = pluginCmd.command('devtrack-api').description('Plan DevTrack API appliance operations');
|
|
62
|
+
devtrackApiCmd
|
|
63
|
+
.command('scaffold-dry-run <manifestPath>')
|
|
64
|
+
.description('Build a deterministic DevTrack API scaffold dry-run plan without executing the appliance')
|
|
65
|
+
.requiredOption('--feature <ref>', 'Feature reference that owns the scaffold operation, for example FEAT-0152')
|
|
66
|
+
.requiredOption('--project <name>', 'Project display name to scaffold')
|
|
67
|
+
.option('--package <name>', 'Package name to use in the scaffold plan')
|
|
68
|
+
.option('--operation-id <id>', 'Stable operation id to use in the dry-run plan')
|
|
69
|
+
.option('--write-scope <list>', 'Comma-separated requested write scope')
|
|
70
|
+
.option('--json', 'Return scaffold dry-run plan as JSON')
|
|
71
|
+
.action(async (manifestPath, options) => {
|
|
72
|
+
const result = await planDevTrackApiScaffoldDryRunFromFile(manifestPath, {
|
|
73
|
+
feature_ref: options.feature,
|
|
74
|
+
project_name: options.project,
|
|
75
|
+
package_name: options.package,
|
|
76
|
+
operation_id: options.operationId,
|
|
77
|
+
requested_write_scope: parseCsvOption(options.writeScope),
|
|
78
|
+
});
|
|
79
|
+
if (options.json) {
|
|
80
|
+
console.log(JSON.stringify(result, null, 2));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
printDevTrackApiScaffoldDryRunResult(result);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function resolvePlanMode(options) {
|
|
87
|
+
if (options.apply && options.rollback) {
|
|
88
|
+
throw new Error('Use only one of --apply or --rollback.');
|
|
89
|
+
}
|
|
90
|
+
if (options.apply)
|
|
91
|
+
return 'apply';
|
|
92
|
+
if (options.rollback)
|
|
93
|
+
return 'rollback';
|
|
94
|
+
return 'dry-run';
|
|
95
|
+
}
|
|
96
|
+
function parseJsonObjectOption(value) {
|
|
97
|
+
if (!value)
|
|
98
|
+
return {};
|
|
99
|
+
const parsed = JSON.parse(value);
|
|
100
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
101
|
+
throw new Error('--input must be a JSON object.');
|
|
102
|
+
}
|
|
103
|
+
return parsed;
|
|
104
|
+
}
|
|
105
|
+
function resolveTechnologyConstraint(options) {
|
|
106
|
+
if (!options.language && !options.framework) {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
language: options.language,
|
|
111
|
+
framework: options.framework,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function printInspectResult(result) {
|
|
115
|
+
console.log(chalk.green(`Plugin: ${result.plugin_ref.id}@${result.plugin_ref.version}`));
|
|
116
|
+
console.log(`Manifest: ${result.manifest_path}`);
|
|
117
|
+
console.log(`Contract: ${result.contract_version}`);
|
|
118
|
+
console.log(`Technology: ${result.technology.language}${result.technology.framework ? `/${result.technology.framework}` : ''}`);
|
|
119
|
+
console.log(`Trust: ${result.governance.trust_tier}`);
|
|
120
|
+
console.log(`Capabilities: ${result.capabilities.map((capability) => capability.name).join(', ')}`);
|
|
121
|
+
}
|
|
122
|
+
function printPlanResult(result) {
|
|
123
|
+
const { plan } = result;
|
|
124
|
+
console.log(chalk.green(`Plugin plan: ${plan.status}`));
|
|
125
|
+
console.log(`Manifest: ${result.manifest_path}`);
|
|
126
|
+
console.log(`Policy: ${plan.policy?.decision ?? 'not-evaluated'}`);
|
|
127
|
+
if (plan.envelope) {
|
|
128
|
+
console.log(`Operation: ${plan.envelope.operation_id}`);
|
|
129
|
+
console.log(`Plugin: ${plan.envelope.plugin_ref.id}@${plan.envelope.plugin_ref.version}`);
|
|
130
|
+
console.log(`Capability: ${plan.envelope.capability}`);
|
|
131
|
+
console.log(`Mode: ${plan.envelope.mode}`);
|
|
132
|
+
console.log(`Write scope: ${plan.envelope.write_scope.join(', ') || 'none'}`);
|
|
133
|
+
}
|
|
134
|
+
if (plan.reasons.length > 0) {
|
|
135
|
+
console.log(`Reasons: ${plan.reasons.join(' | ')}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function printDevTrackApiScaffoldDryRunResult(result) {
|
|
139
|
+
const { plan } = result;
|
|
140
|
+
console.log(chalk.green(`DevTrack API scaffold dry-run: ${plan.status}`));
|
|
141
|
+
console.log(`Manifest: ${result.manifest_path}`);
|
|
142
|
+
console.log(`Project: ${plan.project_name}`);
|
|
143
|
+
console.log(`Package: ${plan.package_name}`);
|
|
144
|
+
if (plan.status === 'planned') {
|
|
145
|
+
console.log(`Operation: ${plan.operation_id}`);
|
|
146
|
+
console.log(`Artifacts: ${plan.artifacts.length}`);
|
|
147
|
+
console.log(`Policy: ${plan.runtime_plan.policy?.decision ?? 'not-evaluated'}`);
|
|
148
|
+
}
|
|
149
|
+
if (plan.issues.length > 0) {
|
|
150
|
+
console.log(`Issues: ${plan.issues.join(' | ')}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { promises as fs } from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
2
|
import { resolveProjectRoot } from '../../core/sdd/resolve-project-root.js';
|
|
5
3
|
import { loadProjectSddConfig, resolveSddPaths, } from '../../core/sdd/state.js';
|
|
6
|
-
import { assessSddMigration
|
|
7
|
-
import { withStateLock } from '../../core/sdd/state-lock.js';
|
|
8
|
-
import { isInteractive } from '../../utils/interactive.js';
|
|
4
|
+
import { assessSddMigration } from '../../core/sdd/migrate.js';
|
|
9
5
|
export function parseCsvOption(value) {
|
|
10
6
|
if (!value)
|
|
11
7
|
return [];
|
|
@@ -62,23 +58,6 @@ export async function ensureMandatorySddMigration(targetPath) {
|
|
|
62
58
|
return;
|
|
63
59
|
}
|
|
64
60
|
const summary = assessment.reasons.join(' | ');
|
|
65
|
-
|
|
66
|
-
const { confirm } = await import('@inquirer/prompts');
|
|
67
|
-
const approved = await confirm({
|
|
68
|
-
message: `Migracao SDD obrigatoria detectada. Deseja aplicar agora para continuar? ${summary}`,
|
|
69
|
-
default: true,
|
|
70
|
-
});
|
|
71
|
-
if (!approved) {
|
|
72
|
-
throw new Error('Operacao interrompida: aplique a migracao SDD mandatória com `openspec sdd migrate`.');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const stateDir = path.dirname(paths.stateFiles.discoveryIndex);
|
|
76
|
-
const result = await withStateLock(stateDir, async () => {
|
|
77
|
-
const command = new SddMigrateCommand();
|
|
78
|
-
return command.execute(resolved, { radToEpic: true });
|
|
79
|
-
});
|
|
80
|
-
for (const message of result.messages) {
|
|
81
|
-
console.log(chalk.yellow(`[sdd:migrate] ${message}`));
|
|
82
|
-
}
|
|
61
|
+
throw new Error(`Migracao SDD obrigatoria detectada: ${summary}. Execute \`codesdd sdd migrate --yes\` e reexecute o comando.`);
|
|
83
62
|
}
|
|
84
63
|
//# sourceMappingURL=shared.js.map
|
|
@@ -62,6 +62,13 @@ export function registerSkillsCommands(sddCmd) {
|
|
|
62
62
|
console.log(chalk.green(`Skills sincronizadas: ${result.synced}`));
|
|
63
63
|
console.log(`Skills locais (${localSkillsPath}): ${result.local_synced}`);
|
|
64
64
|
console.log(`Ferramentas atualizadas: ${result.tools.length > 0 ? result.tools.join(', ') : 'nenhuma'}`);
|
|
65
|
+
if (result.alerts.length > 0) {
|
|
66
|
+
console.log(chalk.yellow(`Alertas de user-extension (nao bloqueante): ${result.alerts.length}`));
|
|
67
|
+
for (const alert of result.alerts) {
|
|
68
|
+
const expected = alert.expected_sha256 || '<missing>';
|
|
69
|
+
console.log(`- ${alert.skill_id}: ${alert.status} (expected=${expected}, observed=${alert.observed_sha256})`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
65
72
|
});
|
|
66
73
|
skillsCmd
|
|
67
74
|
.command('suggest [path]')
|
package/dist/commands/sdd.js
CHANGED
|
@@ -5,8 +5,9 @@ import { SddInitCommand, SddInitContextCommand } from '../core/sdd/init.js';
|
|
|
5
5
|
import { SddCheckCommand } from '../core/sdd/check.js';
|
|
6
6
|
import { loadProjectSddConfig, resolveSddPaths, } from '../core/sdd/state.js';
|
|
7
7
|
import { assessSddMigration, SddMigrateCommand } from '../core/sdd/migrate.js';
|
|
8
|
+
import { formatUpgradeToCodeSddReadiness, UpgradeToCodeSddCommand, } from '../core/sdd/upgrade-to-codesdd.js';
|
|
8
9
|
import { MigrateWorkspaceCommand } from '../core/sdd/migrate-workspace.js';
|
|
9
|
-
import {
|
|
10
|
+
import { SddImportLegacySpecCommand } from '../core/sdd/import-legacy-spec.js';
|
|
10
11
|
import { isInteractive } from '../utils/interactive.js';
|
|
11
12
|
import { createSddStores } from "../core/sdd/store/sdd-stores.js";
|
|
12
13
|
import { InsightService } from "../core/sdd/services/insight.service.js";
|
|
@@ -25,8 +26,10 @@ import { SddDedupApplyService, formatSddDedupApplyReport } from "../core/sdd/ser
|
|
|
25
26
|
import { captureFingerprintsForChange, writeMeta } from '../core/sdd/fingerprint.js';
|
|
26
27
|
import { ensureMandatorySddMigration, parseCsvOption, parseFlowModeOption, parseLangOption, parseLayoutOption, resolveRoot, } from './sdd/shared.js';
|
|
27
28
|
import { registerExecutionCommands } from './sdd/execution.js';
|
|
29
|
+
import { registerPluginCommands } from './sdd/plugin.js';
|
|
28
30
|
import { registerSkillsCommands } from './sdd/skills.js';
|
|
29
|
-
import {
|
|
31
|
+
import { registerBacklogCommands } from './sdd/backlog.js';
|
|
32
|
+
import { displayLegacySpecPath, resolveLegacySpecSubpath, } from '../core/sdd/services/legacy-capability.service.js';
|
|
30
33
|
export function registerSddCommand(program) {
|
|
31
34
|
const sddCmd = program.command('sdd').description('SDD memory operations');
|
|
32
35
|
sddCmd
|
|
@@ -69,6 +72,9 @@ export function registerSddCommand(program) {
|
|
|
69
72
|
.alias('iniciar-contexto')
|
|
70
73
|
.option('--mode <mode>', 'Modo de escrita: merge|replace (padrao: merge)')
|
|
71
74
|
.option('--no-deep', 'Desativa inspecao profunda de estrutura de repositorio')
|
|
75
|
+
.option('--frontend', 'Ativa arquivos e views de frontend durante o bootstrap')
|
|
76
|
+
.option('--lang <lang>', 'Idioma SDD: pt-BR|en-US')
|
|
77
|
+
.option('--layout <layout>', 'Layout de pastas: en-US|legacy|pt-BR')
|
|
72
78
|
.option('--no-render', 'Nao gera views apos bootstrap de contexto')
|
|
73
79
|
.option('--json', 'Saida em JSON')
|
|
74
80
|
.action(async (targetPath = '.', options) => {
|
|
@@ -84,6 +90,9 @@ export function registerSddCommand(program) {
|
|
|
84
90
|
mode: options?.mode,
|
|
85
91
|
deep: options?.deep,
|
|
86
92
|
render: options?.render,
|
|
93
|
+
frontendEnabled: options?.frontend,
|
|
94
|
+
language: parseLangOption(options?.lang),
|
|
95
|
+
layout: parseLayoutOption(options?.layout),
|
|
87
96
|
});
|
|
88
97
|
if (options?.json) {
|
|
89
98
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -113,8 +122,8 @@ export function registerSddCommand(program) {
|
|
|
113
122
|
if (!options?.backfill) {
|
|
114
123
|
throw new Error('Use --backfill para executar esta operação.');
|
|
115
124
|
}
|
|
116
|
-
const changeRoot =
|
|
117
|
-
const mainSpecsDir =
|
|
125
|
+
const changeRoot = resolveLegacySpecSubpath(root, 'changes');
|
|
126
|
+
const mainSpecsDir = resolveLegacySpecSubpath(root, 'specs');
|
|
118
127
|
await fs.access(changeRoot);
|
|
119
128
|
let changeIds;
|
|
120
129
|
if (options?.ref) {
|
|
@@ -124,7 +133,7 @@ export function registerSddCommand(program) {
|
|
|
124
133
|
const requestedChangeDir = path.join(changeRoot, options.ref);
|
|
125
134
|
const stat = await fs.stat(requestedChangeDir);
|
|
126
135
|
if (!stat.isDirectory()) {
|
|
127
|
-
throw new Error(`Change '${options.ref}' nao encontrado em ${
|
|
136
|
+
throw new Error(`Change '${options.ref}' nao encontrado em ${displayLegacySpecPath('changes')}`);
|
|
128
137
|
}
|
|
129
138
|
changeIds = [options.ref];
|
|
130
139
|
}
|
|
@@ -341,6 +350,8 @@ export function registerSddCommand(program) {
|
|
|
341
350
|
console.log(`Duplicatas puladas: ${result.skipped_duplicates.length}`);
|
|
342
351
|
});
|
|
343
352
|
registerExecutionCommands(sddCmd);
|
|
353
|
+
registerPluginCommands(sddCmd);
|
|
354
|
+
registerBacklogCommands(sddCmd);
|
|
344
355
|
sddCmd
|
|
345
356
|
.command('check [path]')
|
|
346
357
|
.description('Valida arquivos de estado .sdd e opcionalmente gera views')
|
|
@@ -545,6 +556,52 @@ export function registerSddCommand(program) {
|
|
|
545
556
|
console.log(`- ${msg}`);
|
|
546
557
|
}
|
|
547
558
|
});
|
|
559
|
+
sddCmd
|
|
560
|
+
.command('upgrade-to-codesdd')
|
|
561
|
+
.description('Plans, applies, or rolls back a transactional upgrade to the CodeSDD SDD contract')
|
|
562
|
+
.option('--dry-run', 'Preview readiness and planned steps without writing files')
|
|
563
|
+
.option('--apply', 'Apply the transactional upgrade')
|
|
564
|
+
.option('--yes', 'Confirm transactional mutation')
|
|
565
|
+
.option('--rollback <transactionId>', 'Rollback a previous upgrade transaction id')
|
|
566
|
+
.option('--reason <reason>', 'Rollback reason used with --rollback')
|
|
567
|
+
.option('--json', 'JSON output')
|
|
568
|
+
.action(async (options) => {
|
|
569
|
+
const root = resolveRoot();
|
|
570
|
+
const command = new UpgradeToCodeSddCommand();
|
|
571
|
+
if (options?.rollback) {
|
|
572
|
+
if (options.apply || options.dryRun) {
|
|
573
|
+
throw new Error('Use --rollback without --apply or --dry-run.');
|
|
574
|
+
}
|
|
575
|
+
const result = await command.rollback(root, options.rollback, {
|
|
576
|
+
reason: options.reason,
|
|
577
|
+
});
|
|
578
|
+
if (options.json) {
|
|
579
|
+
console.log(JSON.stringify(result, null, 2));
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
console.log(chalk.green(`Upgrade rollback completed: ${result.transaction_id}`));
|
|
583
|
+
console.log(`Manifest: ${result.manifest_path}`);
|
|
584
|
+
console.log(`Restored: ${result.restored_paths.join(', ') || '-'}`);
|
|
585
|
+
console.log(`Skipped: ${result.skipped_paths.join(', ') || '-'}`);
|
|
586
|
+
console.log(`Reason: ${result.reason}`);
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
const result = await command.execute(root, {
|
|
590
|
+
dryRun: options?.dryRun || !options?.apply,
|
|
591
|
+
apply: options?.apply,
|
|
592
|
+
yes: options?.yes,
|
|
593
|
+
});
|
|
594
|
+
if (options?.json) {
|
|
595
|
+
console.log(JSON.stringify(result, null, 2));
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
console.log(formatUpgradeToCodeSddReadiness(result.readiness));
|
|
599
|
+
if (result.mode === 'apply') {
|
|
600
|
+
console.log(chalk.green('Transactional upgrade applied.'));
|
|
601
|
+
console.log(`Transaction: ${result.manifest?.transaction_id}`);
|
|
602
|
+
console.log(`Manifest: ${result.manifest_path}`);
|
|
603
|
+
}
|
|
604
|
+
});
|
|
548
605
|
sddCmd
|
|
549
606
|
.command('migrate-workspace')
|
|
550
607
|
.description('Migra workspaces SDD legados de Markdown para YAML validado')
|
|
@@ -586,11 +643,11 @@ export function registerSddCommand(program) {
|
|
|
586
643
|
}
|
|
587
644
|
});
|
|
588
645
|
sddCmd
|
|
589
|
-
.command('import-
|
|
590
|
-
.description('Imports legacy
|
|
591
|
-
.alias('importar-
|
|
646
|
+
.command('import-legacy-spec [path]')
|
|
647
|
+
.description('Imports legacy legacy-spec/ state into .sdd sources and source-index')
|
|
648
|
+
.alias('importar-codesdd')
|
|
592
649
|
.option('--dry-run', 'Preview import without writing files')
|
|
593
|
-
.option('--remove', 'Remove
|
|
650
|
+
.option('--remove', 'Remove legacy-spec/ after successful import verification')
|
|
594
651
|
.option('--yes', 'Confirm destructive removal when --remove is used')
|
|
595
652
|
.option('--json', 'JSON output')
|
|
596
653
|
.option('--no-render', 'Does not generate views after updating state')
|
|
@@ -600,7 +657,7 @@ export function registerSddCommand(program) {
|
|
|
600
657
|
const __paths = resolveSddPaths(root, __config);
|
|
601
658
|
const stores = createSddStores(__paths);
|
|
602
659
|
await ensureMandatorySddMigration(root);
|
|
603
|
-
const command = new
|
|
660
|
+
const command = new SddImportLegacySpecCommand();
|
|
604
661
|
const result = await command.execute(root, {
|
|
605
662
|
dryRun: options?.dryRun,
|
|
606
663
|
remove: options?.remove,
|
|
@@ -611,7 +668,7 @@ export function registerSddCommand(program) {
|
|
|
611
668
|
console.log(JSON.stringify(result, null, 2));
|
|
612
669
|
return;
|
|
613
670
|
}
|
|
614
|
-
console.log(chalk.green('
|
|
671
|
+
console.log(chalk.green('Legacy spec import completed.'));
|
|
615
672
|
console.log(`Source root: ${result.source_root}`);
|
|
616
673
|
console.log(`Target root: ${result.target_root}`);
|
|
617
674
|
console.log(`Report: ${result.report_path}`);
|
|
@@ -619,7 +676,7 @@ export function registerSddCommand(program) {
|
|
|
619
676
|
console.log(`Files seen: ${result.files_seen}`);
|
|
620
677
|
console.log(`Files copied: ${result.files_copied}`);
|
|
621
678
|
console.log(`Sources indexed: ${result.sources_indexed}`);
|
|
622
|
-
console.log(`Removed
|
|
679
|
+
console.log(`Removed legacy-spec/: ${result.removed_source_root ? 'yes' : 'no'}`);
|
|
623
680
|
const categories = Object.entries(result.categories)
|
|
624
681
|
.map(([name, count]) => `${name}=${count}`)
|
|
625
682
|
.join(', ');
|