ai-delivery-workflow 0.2.2 → 0.4.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/README.md +45 -14
- package/bin/ai-delivery.mjs +181 -6
- package/bin/benchmark-autonomy.mjs +217 -0
- package/bin/release-check.mjs +382 -0
- package/docs/CLI-PARAMETER-REFERENCE.zh-CN.md +346 -0
- package/docs/CODEGRAPH-INTEGRATION.zh-CN.md +89 -0
- package/docs/DUAL-REPOSITORY-WORKSPACE.zh-CN.md +2 -2
- package/docs/EVOLUTION-MAINTENANCE.zh-CN.md +7 -7
- package/docs/EVOLUTION-USER-GUIDE.zh-CN.md +2 -2
- package/docs/FILE-REFERENCE.zh-CN.md +120 -39
- package/docs/MAINTENANCE-VERIFICATION.zh-CN.md +51 -0
- package/docs/MOCK-SYSTEM.zh-CN.md +141 -0
- package/docs/NPM-RELEASE-MANAGEMENT.zh-CN.md +106 -0
- package/docs/PROJECT-MANUAL.zh-CN.md +154 -95
- package/docs/PROTOTYPE-MIGRATION.zh-CN.md +164 -0
- package/docs/STATE-CLI-MAINTENANCE.zh-CN.md +35 -17
- package/docs/STATE-CLI-USER-GUIDE.zh-CN.md +115 -39
- package/docs/VIEWER-MAINTENANCE.zh-CN.md +101 -324
- package/docs/VIEWER-USER-GUIDE.zh-CN.md +68 -190
- package/docs/adr/0001-prototype-first-ui-governance.md +3 -0
- package/docs/adr/0002-microcks-as-default-mock-system.md +3 -0
- package/docs/adr/0003-workflow-manager-governed-control-surface.md +46 -0
- package/docs/adr/0004-operational-carbon-visual-standard.md +9 -0
- package/docs/adr/0005-prototype-management-as-routed-pages.md +7 -0
- package/docs/agents/domain.md +12 -0
- package/docs/agents/issue-tracker.md +27 -0
- package/docs/agents/triage-labels.md +11 -0
- package/docs/agents/workflow-manager-acceptance-matrix.md +93 -0
- package/docs/agents/workflow-manager-agent-interface.md +145 -0
- package/docs/agents/workflow-manager-current-state.md +205 -0
- package/lib/artifact-files.mjs +47 -0
- package/lib/codegraph.mjs +405 -0
- package/lib/delivery-state.mjs +3079 -198
- package/lib/frontend-guard.mjs +288 -0
- package/lib/fs-utils.mjs +53 -0
- package/lib/history-anchor.mjs +98 -0
- package/lib/mock-scenario-pack.mjs +687 -0
- package/lib/mock-system.mjs +897 -0
- package/lib/npm-package-result.mjs +11 -0
- package/lib/png-evidence.mjs +149 -0
- package/lib/project-bootstrap.mjs +96 -55
- package/lib/project-installer.mjs +1484 -164
- package/lib/project-migration.mjs +1193 -0
- package/lib/prototype-migration.mjs +713 -0
- package/lib/prototype-page-review.mjs +384 -0
- package/lib/prototype-review-target.mjs +334 -0
- package/lib/prototype-revision.mjs +812 -0
- package/lib/stable-value.mjs +15 -0
- package/lib/toml-hooks.mjs +69 -0
- package/lib/ui-acceptance.mjs +565 -0
- package/lib/visual-standard.mjs +232 -0
- package/lib/workflow-manager-contracts.mjs +367 -0
- package/lib/workflow-manager-facts.mjs +778 -0
- package/lib/workflow-manager-governance.mjs +514 -0
- package/lib/workflow-manager-mock.mjs +183 -0
- package/lib/workflow-manager-prototypes.mjs +1847 -0
- package/lib/workflow-manager-public/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/lib/workflow-manager-public/assets/index-Chlg6r8f.css +1 -0
- package/lib/workflow-manager-public/assets/index-E-hGB5ZD.js +13 -0
- package/lib/workflow-manager-public/fonts/OFL-1.1.txt +90 -0
- package/lib/workflow-manager-public/index.html +14 -0
- package/lib/workflow-manager-systems.mjs +519 -0
- package/lib/workflow-manager-transaction.mjs +397 -0
- package/lib/workflow-manager.mjs +745 -0
- package/package.json +8 -2
- package/skills/ai-delivery-assemble-release/agents/openai.yaml +3 -3
- package/skills/ai-delivery-assemble-release/assets/release-material-index.csv +1 -1
- package/skills/ai-delivery-assemble-release/assets/version-inclusion.csv +1 -1
- package/skills/ai-delivery-bootstrap/SKILL.md +4 -4
- package/skills/ai-delivery-bootstrap/agents/openai.yaml +3 -3
- package/skills/ai-delivery-bootstrap/references/bootstrap-contract.md +4 -2
- package/skills/ai-delivery-checkpoint-task/SKILL.md +17 -3
- package/skills/ai-delivery-checkpoint-task/agents/openai.yaml +3 -3
- package/skills/ai-delivery-checkpoint-task/assets/runtime-template/task.json +7 -1
- package/skills/ai-delivery-checkpoint-task/references/checkpoint-contract.md +22 -8
- package/skills/ai-delivery-checkpoint-task/scripts/hook-event.mjs +91 -0
- package/skills/ai-delivery-checkpoint-task/scripts/task-state.mjs +1086 -51
- package/skills/ai-delivery-close-version/SKILL.md +9 -8
- package/skills/ai-delivery-close-version/agents/openai.yaml +3 -3
- package/skills/ai-delivery-close-version/assets/version-lineage.yaml +1 -1
- package/skills/ai-delivery-close-version/references/version-closeout-contract.md +2 -2
- package/skills/ai-delivery-define-product/SKILL.md +8 -4
- package/skills/ai-delivery-define-product/agents/openai.yaml +4 -4
- package/skills/ai-delivery-define-product/references/product-contract.md +2 -2
- package/skills/ai-delivery-deploy-production/agents/openai.yaml +3 -3
- package/skills/ai-delivery-design-architecture/SKILL.md +9 -5
- package/skills/ai-delivery-design-architecture/assets/architecture-template/prototype-architecture-validation.yaml +16 -16
- package/skills/ai-delivery-design-architecture/references/architecture-contract.md +1 -1
- package/skills/ai-delivery-design-experience/SKILL.md +36 -30
- package/skills/ai-delivery-design-experience/agents/openai.yaml +4 -4
- package/skills/ai-delivery-design-experience/assets/experience-template/LEGACY-COMPATIBILITY.md +16 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/design-reference-selection.yaml +32 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/experience-baseline.yaml +2 -2
- package/skills/ai-delivery-design-experience/assets/experience-template/formal-ui-confirmation.yaml +16 -3
- package/skills/ai-delivery-design-experience/assets/experience-template/frontend-change-scope.yaml +30 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/interaction-contract.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/mock-admin-export.yaml +8 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/mock-scenario-mappings.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/mock-scenario-pack-request.yaml +24 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/product-prototype-reconciliation.yaml +2 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-adjustment-log.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-component-bindings.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-component-candidates.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-components.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-confirmation.yaml +18 -18
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-data-contracts.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-impact-assessment.yaml +5 -5
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-implementation-bindings.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-manifest.yaml +2 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-pages.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-product-coverage.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-comments.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-decision.yaml +13 -12
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-scenes.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-sessions.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-unit-pages.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-units.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-revision.yaml +88 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-routes.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-set.yaml +2 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-source-inspection-snapshots.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-terminals.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-tool-candidates.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-tool-selection.yaml +2 -3
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-traceability.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-trigger-conditions.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype.yaml +6 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/ui-framework-selection.yaml +17 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/ui-handoff.yaml +6 -5
- package/skills/ai-delivery-design-experience/assets/experience-template/ui-mapping.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-direction.yaml +4 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-reference-manifest.yaml +23 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-reference.html +163 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-system-confirmation.yaml +11 -0
- package/skills/ai-delivery-design-experience/references/experience-contract.md +26 -27
- package/skills/ai-delivery-design-experience/references/prototype-management-contract.md +42 -21
- package/skills/ai-delivery-design-tests/SKILL.md +13 -7
- package/skills/ai-delivery-design-tests/assets/test-design-template/prototype-test-scope.csv +1 -1
- package/skills/ai-delivery-design-tests/assets/test-design-template/prototype-test-validation.yaml +17 -16
- package/skills/ai-delivery-design-tests/references/test-design-contract.md +7 -5
- package/skills/ai-delivery-develop-iteration/SKILL.md +18 -11
- package/skills/ai-delivery-develop-iteration/agents/openai.yaml +3 -3
- package/skills/ai-delivery-develop-iteration/assets/development-template/candidate-manifest.yaml +36 -0
- package/skills/ai-delivery-develop-iteration/assets/development-template/task-prototype-traceability.csv +1 -1
- package/skills/ai-delivery-develop-iteration/references/development-contract.md +5 -3
- package/skills/ai-delivery-evolve-workflow/agents/openai.yaml +3 -3
- package/skills/ai-delivery-execute-test/SKILL.md +6 -2
- package/skills/ai-delivery-execute-test/agents/openai.yaml +4 -4
- package/skills/ai-delivery-execute-work-package/SKILL.md +10 -3
- package/skills/ai-delivery-execute-work-package/agents/openai.yaml +4 -4
- package/skills/ai-delivery-execute-work-package/references/work-package-contract.md +1 -1
- package/skills/ai-delivery-manage-git/agents/openai.yaml +3 -3
- package/skills/ai-delivery-manage-standards/agents/openai.yaml +4 -4
- package/skills/ai-delivery-orchestrate/SKILL.md +47 -29
- package/skills/ai-delivery-orchestrate/agents/openai.yaml +3 -3
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/control/migrations/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/control/repairs/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/delivery/project.yaml +1 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/delivery/workflow-state.yaml +2 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/frontend-guard/frontend-guard.mjs +50 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/hooks/hook-event.mjs +91 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/manager/manager.mjs +64 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/manager/start.cmd +4 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/manager/start.ps1 +2 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/{viewer → manager}/start.sh +1 -1
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/mock/mock.mjs +50 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/ui-acceptance/ui-acceptance.mjs +37 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/AGENTS.md +32 -6
- package/skills/ai-delivery-orchestrate/assets/project-template/gitignore.template +1 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/CONTRIBUTING.md +25 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/LICENSE +21 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/README.md +250 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/UPSTREAM.yaml +19 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/airbnb/DESIGN.md +545 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/airbnb/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/airtable/DESIGN.md +554 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/airtable/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/apple/DESIGN.md +562 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/apple/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/binance/DESIGN.md +634 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/binance/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bmw/DESIGN.md +544 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bmw/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bmw-m/DESIGN.md +503 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bmw-m/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bugatti/DESIGN.md +454 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bugatti/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cal/DESIGN.md +542 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cal/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/claude/DESIGN.md +589 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/claude/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/clay/DESIGN.md +541 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/clay/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/clickhouse/DESIGN.md +544 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/clickhouse/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cohere/DESIGN.md +451 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cohere/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/coinbase/DESIGN.md +570 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/coinbase/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/composio/DESIGN.md +506 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/composio/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cursor/DESIGN.md +537 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cursor/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/dell-1996/DESIGN.md +632 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/dell-1996/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/elevenlabs/DESIGN.md +504 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/elevenlabs/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/expo/DESIGN.md +526 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/expo/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ferrari/DESIGN.md +531 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ferrari/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/figma/DESIGN.md +578 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/figma/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/framer/DESIGN.md +544 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/framer/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/hashicorp/DESIGN.md +575 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/hashicorp/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/hp/DESIGN.md +670 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/hp/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ibm/DESIGN.md +550 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ibm/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/intercom/DESIGN.md +546 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/intercom/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/kraken/DESIGN.md +125 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/kraken/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/lamborghini/DESIGN.md +288 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/lamborghini/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/linear.app/DESIGN.md +548 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/linear.app/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/lovable/DESIGN.md +298 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/lovable/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mastercard/DESIGN.md +365 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mastercard/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/meta/DESIGN.md +683 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/meta/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/minimax/DESIGN.md +746 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/minimax/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mintlify/DESIGN.md +852 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mintlify/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/miro/DESIGN.md +825 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/miro/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mistral.ai/DESIGN.md +773 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mistral.ai/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mongodb/DESIGN.md +767 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mongodb/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nike/DESIGN.md +575 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nike/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nintendo-2001/DESIGN.md +649 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nintendo-2001/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/notion/DESIGN.md +821 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/notion/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nvidia/DESIGN.md +640 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nvidia/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ollama/DESIGN.md +539 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ollama/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/opencode.ai/DESIGN.md +521 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/opencode.ai/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/pinterest/DESIGN.md +597 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/pinterest/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/playstation/DESIGN.md +661 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/playstation/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/posthog/DESIGN.md +690 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/posthog/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/raycast/DESIGN.md +669 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/raycast/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/renault/DESIGN.md +589 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/renault/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/replicate/DESIGN.md +616 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/replicate/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/resend/DESIGN.md +585 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/resend/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/revolut/DESIGN.md +636 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/revolut/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/runwayml/DESIGN.md +244 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/runwayml/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/sanity/DESIGN.md +357 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/sanity/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/sentry/DESIGN.md +551 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/sentry/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/shopify/DESIGN.md +516 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/shopify/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/slack/DESIGN.md +482 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/spacex/DESIGN.md +363 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/spacex/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/spotify/DESIGN.md +246 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/spotify/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/starbucks/DESIGN.md +580 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/starbucks/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/stripe/DESIGN.md +487 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/stripe/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/supabase/DESIGN.md +462 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/supabase/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/superhuman/DESIGN.md +448 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/superhuman/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/tesla/DESIGN.md +286 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/tesla/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/theverge/DESIGN.md +339 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/theverge/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/together.ai/DESIGN.md +633 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/together.ai/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/uber/DESIGN.md +636 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/uber/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/vercel/DESIGN.md +736 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/vercel/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/vodafone/DESIGN.md +538 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/vodafone/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/voltagent/DESIGN.md +521 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/voltagent/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/warp/DESIGN.md +526 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/warp/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/webflow/DESIGN.md +588 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/webflow/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/wired/DESIGN.md +497 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/wired/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/wise/DESIGN.md +544 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/wise/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/x.ai/DESIGN.md +465 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/x.ai/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/zapier/DESIGN.md +537 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/zapier/README.md +5 -0
- package/skills/ai-delivery-orchestrate/references/formal-state-contract.md +65 -20
- package/skills/ai-delivery-orchestrate/references/workflow-model.md +7 -5
- package/skills/ai-delivery-orchestrate-release/SKILL.md +2 -2
- package/skills/ai-delivery-orchestrate-release/agents/openai.yaml +4 -4
- package/skills/ai-delivery-orchestrate-release/references/release-workflow-contract.md +1 -1
- package/skills/ai-delivery-plan-iteration/SKILL.md +11 -4
- package/skills/ai-delivery-plan-iteration/agents/openai.yaml +4 -4
- package/skills/ai-delivery-plan-iteration/assets/planning-template/scope-manifest.yaml +17 -0
- package/skills/ai-delivery-plan-iteration/assets/planning-template/slice-prototype-traceability.csv +1 -1
- package/skills/ai-delivery-plan-iteration/references/planning-contract.md +8 -2
- package/skills/ai-delivery-prepare-platform/SKILL.md +5 -1
- package/skills/ai-delivery-prepare-platform/agents/openai.yaml +4 -4
- package/skills/ai-delivery-prepare-release/agents/openai.yaml +4 -4
- package/skills/ai-delivery-review-change/SKILL.md +14 -4
- package/skills/ai-delivery-review-change/agents/openai.yaml +4 -4
- package/skills/ai-delivery-review-change/references/review-contract.md +6 -0
- package/skills/ai-delivery-triage-failure/SKILL.md +5 -1
- package/skills/ai-delivery-triage-failure/agents/openai.yaml +4 -4
- package/skills/ai-delivery-validate-artifacts/SKILL.md +6 -3
- package/skills/ai-delivery-validate-artifacts/agents/openai.yaml +4 -4
- package/skills/ai-delivery-validate-artifacts/references/artifact-contract.md +13 -13
- package/skills/ai-delivery-verify-candidate/SKILL.md +13 -6
- package/skills/ai-delivery-verify-candidate/agents/openai.yaml +3 -3
- package/skills/ai-delivery-verify-candidate/assets/verification-template/ui-acceptance-request.yaml +19 -0
- package/skills/ai-delivery-verify-candidate/assets/verification-template/ui-acceptance-results.yaml +53 -0
- package/skills/ai-delivery-verify-candidate/references/candidate-verification-contract.md +10 -2
- package/skills/ai-delivery-verify-production/agents/openai.yaml +3 -3
- package/skills/ai-delivery-design-experience/assets/experience-template/low-fidelity-confirmation.yaml +0 -32
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/public/app.js +0 -546
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/public/index.html +0 -199
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/public/styles.css +0 -529
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/server.mjs +0 -780
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/start.cmd +0 -4
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/start.ps1 +0 -2
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
import { assertPathInside, atomicWrite } from "./fs-utils.mjs";
|
|
5
|
+
import { readWorkspaceConfiguration } from "./workspace.mjs";
|
|
6
|
+
|
|
7
|
+
const DOCTOR_TIMEOUT_MS = 5000;
|
|
8
|
+
|
|
9
|
+
function windowsCommandInvocation(command, args) {
|
|
10
|
+
if (process.platform !== "win32") return { command, args };
|
|
11
|
+
const extension = path.extname(command).toLowerCase();
|
|
12
|
+
const explicit = path.isAbsolute(command) || command.includes("\\") || command.includes("/");
|
|
13
|
+
const candidates = explicit
|
|
14
|
+
? [command]
|
|
15
|
+
: (process.env.PATH || "")
|
|
16
|
+
.split(path.delimiter)
|
|
17
|
+
.filter(Boolean)
|
|
18
|
+
.flatMap((directory) => [
|
|
19
|
+
path.join(directory.replace(/^"|"$/g, ""), `${command}.exe`),
|
|
20
|
+
path.join(directory.replace(/^"|"$/g, ""), `${command}.ps1`),
|
|
21
|
+
]);
|
|
22
|
+
const resolved = extension ? command : candidates.find((candidate) => fs.existsSync(candidate));
|
|
23
|
+
if (resolved?.toLowerCase().endsWith(".ps1")) {
|
|
24
|
+
return {
|
|
25
|
+
command: "powershell.exe",
|
|
26
|
+
args: ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", resolved, ...args],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return { command: resolved || command, args };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function defaultRunner(args, options = {}) {
|
|
33
|
+
const command = options.command || "codegraph";
|
|
34
|
+
const invocation = windowsCommandInvocation(command, args);
|
|
35
|
+
return spawnSync(invocation.command, invocation.args, {
|
|
36
|
+
cwd: options.cwd,
|
|
37
|
+
encoding: "utf8",
|
|
38
|
+
windowsHide: true,
|
|
39
|
+
timeout: options.timeout,
|
|
40
|
+
env: {
|
|
41
|
+
...process.env,
|
|
42
|
+
...options.env,
|
|
43
|
+
CODEGRAPH_TELEMETRY: "0",
|
|
44
|
+
NO_COLOR: "1",
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function normalizedPath(value) {
|
|
50
|
+
const resolved = path.resolve(value).replaceAll("\\", "/");
|
|
51
|
+
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function failureDetail(result) {
|
|
55
|
+
return String(result?.stderr || result?.stdout || result?.error?.message || "no valid output")
|
|
56
|
+
.replace(/\s+/g, " ")
|
|
57
|
+
.trim()
|
|
58
|
+
.slice(0, 500);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function statusResult(workspace, runner, command, env, timeout) {
|
|
62
|
+
const result = runner(["status", workspace.codeRoot, "--json"], {
|
|
63
|
+
cwd: workspace.codeRoot,
|
|
64
|
+
command,
|
|
65
|
+
env,
|
|
66
|
+
timeout,
|
|
67
|
+
});
|
|
68
|
+
let status = null;
|
|
69
|
+
if (result?.status === 0) {
|
|
70
|
+
try {
|
|
71
|
+
status = JSON.parse(result.stdout);
|
|
72
|
+
} catch {
|
|
73
|
+
status = null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { result, status };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function versionResult(workspace, runner, command, env, timeout) {
|
|
80
|
+
return runner(["--version"], {
|
|
81
|
+
cwd: workspace.codeRoot,
|
|
82
|
+
command,
|
|
83
|
+
env,
|
|
84
|
+
timeout,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function requireCommand(result, description) {
|
|
89
|
+
if (result?.error?.code === "ENOENT") {
|
|
90
|
+
throw new Error("CodeGraph CLI is unavailable; install it explicitly before running CodeGraph commands");
|
|
91
|
+
}
|
|
92
|
+
if (result?.status !== 0) {
|
|
93
|
+
throw new Error(`${description} failed: ${failureDetail(result)}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function indexDescriptor(codeRoot, indexPath) {
|
|
98
|
+
if (typeof indexPath !== "string" || !path.isAbsolute(indexPath)) {
|
|
99
|
+
throw new Error("CodeGraph index path must be a safe direct subdirectory of the code repository");
|
|
100
|
+
}
|
|
101
|
+
const absolutePath = path.resolve(indexPath);
|
|
102
|
+
const relativePath = path.relative(codeRoot, absolutePath);
|
|
103
|
+
if (!relativePath
|
|
104
|
+
|| relativePath === ".."
|
|
105
|
+
|| relativePath.startsWith(`..${path.sep}`)
|
|
106
|
+
|| path.isAbsolute(relativePath)
|
|
107
|
+
|| relativePath.includes(path.sep)
|
|
108
|
+
|| !/^\.codegraph(?:-[A-Za-z0-9][A-Za-z0-9._-]*)?$/.test(relativePath)) {
|
|
109
|
+
throw new Error("CodeGraph index path must be a dedicated .codegraph or .codegraph-* directory in the code repository");
|
|
110
|
+
}
|
|
111
|
+
assertPathInside(codeRoot, absolutePath);
|
|
112
|
+
return {
|
|
113
|
+
absolutePath,
|
|
114
|
+
relativePath,
|
|
115
|
+
excludeEntry: `/${relativePath}/`,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function configuredIndexDescriptor(codeRoot, env) {
|
|
120
|
+
const configured = typeof env.CODEGRAPH_DIR === "string" ? env.CODEGRAPH_DIR.trim() : "";
|
|
121
|
+
const directoryName = configured || ".codegraph";
|
|
122
|
+
return indexDescriptor(codeRoot, path.join(codeRoot, directoryName));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function indexInitialized(codeRoot, index) {
|
|
126
|
+
if (!fs.existsSync(index.absolutePath)) return false;
|
|
127
|
+
assertPathInside(codeRoot, index.absolutePath);
|
|
128
|
+
if (!fs.statSync(index.absolutePath).isDirectory()) return false;
|
|
129
|
+
const database = path.join(index.absolutePath, "codegraph.db");
|
|
130
|
+
if (!fs.existsSync(database)) return false;
|
|
131
|
+
assertPathInside(codeRoot, database);
|
|
132
|
+
return fs.statSync(database).isFile();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function gitCommand(codeRoot, args) {
|
|
136
|
+
return spawnSync("git", args, {
|
|
137
|
+
cwd: codeRoot,
|
|
138
|
+
encoding: "utf8",
|
|
139
|
+
windowsHide: true,
|
|
140
|
+
timeout: DOCTOR_TIMEOUT_MS,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function requireGitCommand(result, description) {
|
|
145
|
+
if (result?.error?.code === "ENOENT") {
|
|
146
|
+
throw new Error(`${description} failed: Git CLI is unavailable`);
|
|
147
|
+
}
|
|
148
|
+
if (result?.status !== 0) {
|
|
149
|
+
throw new Error(`${description} failed: ${failureDetail(result)}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function trackedIndexPaths(codeRoot, index) {
|
|
154
|
+
const tracked = gitCommand(codeRoot, [
|
|
155
|
+
"ls-files",
|
|
156
|
+
"--",
|
|
157
|
+
index.relativePath,
|
|
158
|
+
`${index.relativePath}/**`,
|
|
159
|
+
]);
|
|
160
|
+
requireGitCommand(tracked, "Checking the CodeGraph index Git boundary");
|
|
161
|
+
return tracked.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function localGitExcludeFile(codeRoot) {
|
|
165
|
+
const gitDirectory = gitCommand(codeRoot, ["rev-parse", "--git-dir"]);
|
|
166
|
+
requireGitCommand(gitDirectory, "Resolving the code repository Git directory");
|
|
167
|
+
const absoluteGitDirectory = path.resolve(codeRoot, gitDirectory.stdout.trim());
|
|
168
|
+
const relativeGitDirectory = path.relative(codeRoot, absoluteGitDirectory);
|
|
169
|
+
if (!relativeGitDirectory
|
|
170
|
+
|| relativeGitDirectory === ".."
|
|
171
|
+
|| relativeGitDirectory.startsWith(`..${path.sep}`)
|
|
172
|
+
|| path.isAbsolute(relativeGitDirectory)) {
|
|
173
|
+
throw new Error("CodeGraph setup requires the configured code repository to own its local Git directory");
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
assertPathInside(codeRoot, absoluteGitDirectory);
|
|
177
|
+
} catch {
|
|
178
|
+
throw new Error("CodeGraph setup requires the configured code repository to own its local Git directory");
|
|
179
|
+
}
|
|
180
|
+
return path.join(absoluteGitDirectory, "info", "exclude");
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function requireIndexIgnored(codeRoot, index) {
|
|
184
|
+
const ignored = gitCommand(codeRoot, [
|
|
185
|
+
"check-ignore",
|
|
186
|
+
"--quiet",
|
|
187
|
+
"--no-index",
|
|
188
|
+
"--",
|
|
189
|
+
`${index.relativePath}/`,
|
|
190
|
+
]);
|
|
191
|
+
if (ignored?.status === 1) {
|
|
192
|
+
throw new Error(`CodeGraph index ${index.excludeEntry} is not ignored by the code repository`);
|
|
193
|
+
}
|
|
194
|
+
requireGitCommand(ignored, "Checking whether the CodeGraph index is ignored");
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function inspectIndexBoundary(codeRoot, index, options = {}) {
|
|
198
|
+
try {
|
|
199
|
+
localGitExcludeFile(codeRoot);
|
|
200
|
+
const tracked = trackedIndexPaths(codeRoot, index);
|
|
201
|
+
if (tracked.length) {
|
|
202
|
+
return `CodeGraph index contains tracked paths under ${index.excludeEntry}: ${tracked.slice(0, 5).join(", ")}`;
|
|
203
|
+
}
|
|
204
|
+
if (options.requireIgnored) {
|
|
205
|
+
requireIndexIgnored(codeRoot, index);
|
|
206
|
+
}
|
|
207
|
+
return null;
|
|
208
|
+
} catch (error) {
|
|
209
|
+
return error.message;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function ensureLocalIndexExclude(codeRoot, index) {
|
|
214
|
+
const excludeFile = localGitExcludeFile(codeRoot);
|
|
215
|
+
const existed = fs.existsSync(excludeFile);
|
|
216
|
+
const existing = existed ? fs.readFileSync(excludeFile, "utf8") : "";
|
|
217
|
+
const entry = index.excludeEntry;
|
|
218
|
+
if (existing.split(/\r?\n/).some((line) => line.trim() === entry)) {
|
|
219
|
+
return { changed: false, excludeFile, existed, existing };
|
|
220
|
+
}
|
|
221
|
+
const separator = existing && !existing.endsWith("\n") ? "\n" : "";
|
|
222
|
+
atomicWrite(excludeFile, `${existing}${separator}${entry}\n`);
|
|
223
|
+
return { changed: true, excludeFile, existed, existing };
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function restoreLocalIndexExclude(change) {
|
|
227
|
+
if (!change.changed) return;
|
|
228
|
+
if (change.existed) {
|
|
229
|
+
atomicWrite(change.excludeFile, change.existing);
|
|
230
|
+
} else {
|
|
231
|
+
fs.unlinkSync(change.excludeFile);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export function inspectCodeGraph(workspaceRoot, options = {}) {
|
|
236
|
+
const workspace = readWorkspaceConfiguration(workspaceRoot);
|
|
237
|
+
const runner = options.runner || defaultRunner;
|
|
238
|
+
const env = { ...process.env, ...options.env };
|
|
239
|
+
const base = { required: false, scope: "codegraph" };
|
|
240
|
+
let index = null;
|
|
241
|
+
let initialized = false;
|
|
242
|
+
try {
|
|
243
|
+
index = configuredIndexDescriptor(workspace.codeRoot, env);
|
|
244
|
+
initialized = indexInitialized(workspace.codeRoot, index);
|
|
245
|
+
} catch (error) {
|
|
246
|
+
return {
|
|
247
|
+
...base,
|
|
248
|
+
ok: false,
|
|
249
|
+
message: error.message,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const boundaryIssue = inspectIndexBoundary(workspace.codeRoot, index, {
|
|
253
|
+
requireIgnored: initialized,
|
|
254
|
+
});
|
|
255
|
+
if (boundaryIssue) {
|
|
256
|
+
return {
|
|
257
|
+
...base,
|
|
258
|
+
ok: false,
|
|
259
|
+
message: boundaryIssue,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
let version = null;
|
|
263
|
+
try {
|
|
264
|
+
version = versionResult(
|
|
265
|
+
workspace,
|
|
266
|
+
runner,
|
|
267
|
+
options.command,
|
|
268
|
+
env,
|
|
269
|
+
options.timeout ?? DOCTOR_TIMEOUT_MS,
|
|
270
|
+
);
|
|
271
|
+
} catch (error) {
|
|
272
|
+
return {
|
|
273
|
+
...base,
|
|
274
|
+
ok: false,
|
|
275
|
+
message: `CodeGraph version check failed for the code repository: ${error.message}`,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
if (version?.error?.code === "ENOENT") {
|
|
279
|
+
return {
|
|
280
|
+
...base,
|
|
281
|
+
ok: false,
|
|
282
|
+
message: "CodeGraph CLI is unavailable; code intelligence will fall back to Semble and direct source search",
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
if (version?.status !== 0) {
|
|
286
|
+
return {
|
|
287
|
+
...base,
|
|
288
|
+
ok: false,
|
|
289
|
+
message: `CodeGraph version check failed for the code repository: ${failureDetail(version)}`,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
const versionText = version.stdout.trim() || "unknown";
|
|
293
|
+
if (!initialized) {
|
|
294
|
+
return {
|
|
295
|
+
...base,
|
|
296
|
+
ok: false,
|
|
297
|
+
message: `CodeGraph ${versionText} index is not initialized for the code repository; run ai-delivery codegraph setup for this workspace`,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
...base,
|
|
302
|
+
ok: true,
|
|
303
|
+
message: `CodeGraph ${versionText} index files are present and isolated in the configured code repository`,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export function runCodeGraphAction(workspaceRoot, action, options = {}) {
|
|
308
|
+
if (!new Set(["setup", "sync"]).has(action)) throw new Error(`Unknown CodeGraph action: ${action}`);
|
|
309
|
+
const workspace = readWorkspaceConfiguration(workspaceRoot);
|
|
310
|
+
const runner = options.runner || defaultRunner;
|
|
311
|
+
const env = { ...process.env, ...options.env };
|
|
312
|
+
const index = configuredIndexDescriptor(workspace.codeRoot, env);
|
|
313
|
+
const initializedBefore = indexInitialized(workspace.codeRoot, index);
|
|
314
|
+
const boundaryIssue = inspectIndexBoundary(workspace.codeRoot, index);
|
|
315
|
+
if (boundaryIssue) throw new Error(boundaryIssue);
|
|
316
|
+
const version = versionResult(workspace, runner, options.command, env);
|
|
317
|
+
requireCommand(version, "CodeGraph version check");
|
|
318
|
+
const versionText = version.stdout.trim() || null;
|
|
319
|
+
if (action === "sync" && !initializedBefore) {
|
|
320
|
+
throw new Error("CodeGraph index is not initialized; run ai-delivery codegraph setup first");
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const codeRepository = {
|
|
324
|
+
repo_id: workspace.configuration.code_repository.repo_id,
|
|
325
|
+
path: workspace.configuration.code_repository.path,
|
|
326
|
+
absolute_path: workspace.codeRoot,
|
|
327
|
+
};
|
|
328
|
+
if (options.dryRun) {
|
|
329
|
+
const plannedActions = [];
|
|
330
|
+
if (action === "setup") plannedActions.push("disable CodeGraph telemetry");
|
|
331
|
+
plannedActions.push(`exclude ${index.excludeEntry} in the code repository local Git config`);
|
|
332
|
+
if (action === "setup" && !initializedBefore) {
|
|
333
|
+
plannedActions.push("initialize the CodeGraph index");
|
|
334
|
+
} else if (action === "sync") {
|
|
335
|
+
plannedActions.push("synchronize the CodeGraph index");
|
|
336
|
+
}
|
|
337
|
+
return {
|
|
338
|
+
provider: "codegraph",
|
|
339
|
+
action,
|
|
340
|
+
dry_run: true,
|
|
341
|
+
initialized: initializedBefore,
|
|
342
|
+
would_initialize: action === "setup" && !initializedBefore,
|
|
343
|
+
telemetry: action === "setup" ? "would-disable" : "disabled-for-command",
|
|
344
|
+
version: versionText,
|
|
345
|
+
index_path: index.absolutePath,
|
|
346
|
+
planned_actions: plannedActions,
|
|
347
|
+
code_repository: codeRepository,
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const excludeChange = ensureLocalIndexExclude(workspace.codeRoot, index);
|
|
352
|
+
try {
|
|
353
|
+
requireIndexIgnored(workspace.codeRoot, index);
|
|
354
|
+
} catch (error) {
|
|
355
|
+
restoreLocalIndexExclude(excludeChange);
|
|
356
|
+
throw error;
|
|
357
|
+
}
|
|
358
|
+
if (action === "setup") {
|
|
359
|
+
const telemetry = runner(["telemetry", "off"], {
|
|
360
|
+
cwd: workspace.codeRoot,
|
|
361
|
+
command: options.command,
|
|
362
|
+
env,
|
|
363
|
+
});
|
|
364
|
+
requireCommand(telemetry, "Disabling CodeGraph telemetry");
|
|
365
|
+
}
|
|
366
|
+
if (action === "setup" && !initializedBefore) {
|
|
367
|
+
const initialized = runner(["init", workspace.codeRoot], {
|
|
368
|
+
cwd: workspace.codeRoot,
|
|
369
|
+
command: options.command,
|
|
370
|
+
env,
|
|
371
|
+
});
|
|
372
|
+
requireCommand(initialized, "CodeGraph initialization");
|
|
373
|
+
} else if (action === "sync") {
|
|
374
|
+
const synchronized = runner(["sync", workspace.codeRoot], {
|
|
375
|
+
cwd: workspace.codeRoot,
|
|
376
|
+
command: options.command,
|
|
377
|
+
env,
|
|
378
|
+
});
|
|
379
|
+
requireCommand(synchronized, "CodeGraph synchronization");
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const after = statusResult(workspace, runner, options.command, env);
|
|
383
|
+
requireCommand(after.result, "CodeGraph status verification");
|
|
384
|
+
if (!after.status?.initialized
|
|
385
|
+
|| normalizedPath(after.status.projectPath) !== normalizedPath(workspace.codeRoot)) {
|
|
386
|
+
throw new Error(`CodeGraph ${action} did not produce a valid index for the configured code repository`);
|
|
387
|
+
}
|
|
388
|
+
const finalIndex = indexDescriptor(workspace.codeRoot, after.status.indexPath);
|
|
389
|
+
if (normalizedPath(finalIndex.absolutePath) !== normalizedPath(index.absolutePath)) {
|
|
390
|
+
throw new Error(`CodeGraph ${action} changed the configured index path unexpectedly`);
|
|
391
|
+
}
|
|
392
|
+
const finalBoundaryIssue = inspectIndexBoundary(workspace.codeRoot, finalIndex, {
|
|
393
|
+
requireIgnored: true,
|
|
394
|
+
});
|
|
395
|
+
if (finalBoundaryIssue) throw new Error(finalBoundaryIssue);
|
|
396
|
+
return {
|
|
397
|
+
provider: "codegraph",
|
|
398
|
+
action,
|
|
399
|
+
initialized: true,
|
|
400
|
+
telemetry: action === "setup" ? "off" : "disabled-for-command",
|
|
401
|
+
version: after.status.version || versionText,
|
|
402
|
+
index_path: finalIndex.absolutePath,
|
|
403
|
+
code_repository: codeRepository,
|
|
404
|
+
};
|
|
405
|
+
}
|