@givolt/i3-composer-agent 3.1.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +1 -1
- package/.claude/commands/i3-build.md +1 -0
- package/.claude/commands/i3-code-simplify.md +1 -0
- package/.claude/commands/i3-constraints.md +1 -0
- package/.claude/commands/i3-plan.md +1 -0
- package/.claude/commands/i3-review.md +1 -0
- package/.claude/commands/i3-ship.md +1 -0
- package/.claude/commands/i3-sop.md +3 -3
- package/.claude/commands/i3-spec.md +1 -0
- package/.claude/commands/i3-test.md +1 -0
- package/.claude/commands/i3-webperf.md +1 -0
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +2 -2
- package/.gemini/commands/i3-sop.toml +3 -3
- package/README.md +44 -43
- package/bin/i3-composer-agent.cjs +4 -59
- package/bin/install.cjs +6 -14
- package/bin/native-layout.cjs +11 -2
- package/bin/native-migration.cjs +68 -28
- package/bin/retired-custom-fingerprints.json +1597 -0
- package/bin/wizard.cjs +2 -13
- package/commands/i3-sop.toml +3 -3
- package/docs/antigravity-setup.md +3 -1
- package/docs/codebuddy-setup.md +19 -76
- package/docs/codex-setup.md +10 -4
- package/docs/comparison.md +1 -1
- package/docs/copilot-cli-setup.md +4 -4
- package/docs/cursor-setup.md +1 -1
- package/docs/gemini-cli-setup.md +1 -1
- package/docs/other-hosts.md +2 -2
- package/docs/windsurf-setup.md +2 -2
- package/docs/workbuddy-setup.md +9 -16
- package/evals/README.md +10 -0
- package/evals/cases/i3-code-simplification.json +8 -0
- package/evals/cases/i3-documentation-and-adrs.json +4 -0
- package/evals/cases/i3-enterprise-sop.json +70 -32
- package/evals/cases/i3-frontend-ui-engineering.json +1 -1
- package/evals/cases/i3-security-and-hardening.json +4 -0
- package/evals/cases/i3-ui-demo.json +2 -2
- package/evals/cases/i3-using-agent-skills.json +5 -5
- package/evals/plugin/simplify-fires-on-pasted-function/graders/behavior-kept-and-explained.md +7 -0
- package/evals/plugin/simplify-fires-on-pasted-function/graders/skill-fired.md +5 -0
- package/evals/plugin/simplify-fires-on-pasted-function/prompt.md +30 -0
- package/evals/plugin/simplify-stays-quiet-on-make-it-fast/graders/not-fired.md +8 -0
- package/evals/plugin/simplify-stays-quiet-on-make-it-fast/prompt.md +20 -0
- package/evals/zh-CN/cases/i3-code-simplification.json +8 -0
- package/evals/zh-CN/cases/i3-documentation-and-adrs.json +4 -0
- package/evals/zh-CN/cases/i3-enterprise-sop.json +77 -31
- package/evals/zh-CN/cases/i3-frontend-ui-engineering.json +2 -2
- package/evals/zh-CN/cases/i3-security-and-hardening.json +4 -0
- package/evals/zh-CN/cases/i3-ui-demo.json +2 -2
- package/evals/zh-CN/cases/i3-using-agent-skills.json +6 -6
- package/hooks/SDD-CACHE.md +1 -1
- package/package.json +13 -102
- package/plugin.json +15 -2
- package/references/accessibility-checklist.md +4 -4
- package/references/performance-checklist.md +5 -4
- package/references/testing-patterns.md +2 -1
- package/scripts/floor-guard-reference-test.js +32 -0
- package/scripts/lib/execution-status.js +44 -0
- package/scripts/run-evals-test.js +157 -7
- package/scripts/run-evals.js +59 -12
- package/scripts/ui-demo-test.js +2 -2
- package/scripts/validate-artifact-paths-test.js +14 -0
- package/scripts/validate-artifact-paths.js +4 -2
- package/skills/i3-api-and-interface-design/SKILL.md +3 -1
- package/skills/i3-ci-cd-and-automation/SKILL.md +7 -4
- package/skills/i3-code-simplification/SKILL.md +3 -3
- package/skills/i3-constraint-driven-development/SKILL.md +4 -4
- package/skills/i3-constraint-driven-development/references/floor-guard.md +2 -2
- package/skills/i3-context-engineering/SKILL.md +1 -1
- package/skills/i3-debugging-and-error-recovery/SKILL.md +1 -1
- package/skills/i3-deprecation-and-migration/SKILL.md +6 -1
- package/skills/i3-documentation-and-adrs/SKILL.md +3 -2
- package/skills/i3-enterprise-sop/SKILL.md +121 -94
- package/skills/i3-enterprise-sop/references/engineering-skeleton/directory-standard.md +31 -17
- package/skills/i3-enterprise-sop/references/handoff.py +235 -135
- package/skills/i3-enterprise-sop/references/read_text.py +60 -0
- package/skills/i3-enterprise-sop/references/technical-baseline/baselines/enterprise-application-technical-baseline-v0-0-4.md +47 -47
- package/skills/i3-enterprise-sop/references/technical-baseline/readme.md +9 -118
- package/skills/i3-enterprise-sop/references/technical-baseline/templates/technical-baseline.md +8 -8
- package/skills/i3-enterprise-sop/references/{ad/templates → templates}/ad.md +57 -50
- package/skills/i3-enterprise-sop/references/{brd/templates → templates}/brd.md +23 -12
- package/skills/i3-enterprise-sop/references/{prd/templates → templates}/prd.md +84 -51
- package/skills/i3-enterprise-sop/references/{testcase/templates → templates}/testcase.md +49 -39
- package/skills/i3-frontend-ui-engineering/SKILL.md +6 -10
- package/skills/i3-idea-refine/SKILL.md +4 -2
- package/skills/i3-incremental-implementation/SKILL.md +0 -4
- package/skills/i3-performance-optimization/SKILL.md +2 -2
- package/skills/i3-security-and-hardening/references/hardening-patterns.md +5 -0
- package/skills/i3-source-driven-development/SKILL.md +3 -2
- package/skills/i3-spec-driven-development/SKILL.md +1 -1
- package/skills/i3-ui-demo/SKILL.md +3 -1
- package/skills/i3-ui-demo/references/dependencies.md +1 -1
- package/skills/i3-ui-demo/references/resources.md +1 -1
- package/skills/i3-ui-demo/scripts/dependencies.cjs +0 -3
- package/skills/i3-using-agent-skills/SKILL.md +2 -2
- package/.claude/commands/i3-prototype.md +0 -23
- package/.gemini/commands/i3-prototype.toml +0 -23
- package/commands/i3-prototype.toml +0 -23
- package/docs/upstream-repository/AGENTS.md +0 -92
- package/docs/upstream-repository/CLAUDE.md +0 -60
- package/docs/upstream-repository/CONTRIBUTING.md +0 -137
- package/docs/upstream-repository/README.md +0 -8
- package/docs/upstream-repository/gitattributes.txt +0 -1
- package/docs/upstream-repository/gitignore.txt +0 -10
- package/docs/upstream-repository/manifest.json +0 -71
- package/docs/upstream-repository/opencode-skills.link +0 -1
- package/docs/upstream-repository/skill-gap.yml +0 -80
- package/docs/upstream-repository/skills-contributing.md +0 -15
- package/docs/upstream-repository/test-plugin-install.yml +0 -167
- package/evals/cases/i3-ui-prototype.json +0 -158
- package/evals/fixtures/i3-ui-prototype/admin-list/assets/reference.css +0 -3
- package/evals/fixtures/i3-ui-prototype/admin-list/assets/reference.js +0 -8
- package/evals/fixtures/i3-ui-prototype/admin-list/capability-definition.json +0 -67
- package/evals/fixtures/i3-ui-prototype/admin-list/index.html +0 -89
- package/evals/fixtures/i3-ui-prototype/admin-list/readme.md +0 -52
- package/evals/fixtures/i3-ui-prototype/admin-list/template.json +0 -8
- package/evals/fixtures/i3-ui-prototype/business-brief.md +0 -7
- package/evals/zh-CN/cases/i3-ui-prototype.json +0 -165
- package/hooks/PROTOTYPE.md +0 -31
- package/hooks/codebuddy-upstream.cjs +0 -93
- package/hooks/i3-prototype.cjs +0 -7
- package/hooks/manage.cjs +0 -169
- package/scripts/design-provider-discovery-test.js +0 -190
- package/scripts/design-provider-test.js +0 -75
- package/scripts/enterprise-template-test.js +0 -205
- package/scripts/lib/prototype-fixture.cjs +0 -17
- package/scripts/prototype-cache-test.js +0 -55
- package/scripts/prototype-generation-entry-test.js +0 -6
- package/scripts/prototype-generation-evidence-test.js +0 -10
- package/scripts/prototype-generation-native-test.js +0 -78
- package/scripts/prototype-generation-test.js +0 -99
- package/scripts/prototype-inventory-test.js +0 -43
- package/scripts/prototype-locations-test.js +0 -79
- package/scripts/prototype-project-test.js +0 -183
- package/scripts/template-adapter-test.js +0 -155
- package/scripts/ui-prototype-binding-recovery-test.js +0 -84
- package/scripts/ui-prototype-buddy-lifecycle-test.js +0 -102
- package/scripts/ui-prototype-codebuddy-hook-test.js +0 -112
- package/scripts/ui-prototype-content-test.js +0 -123
- package/scripts/ui-prototype-dependencies-test.js +0 -226
- package/scripts/ui-prototype-devtools-test.js +0 -53
- package/scripts/ui-prototype-execution-evidence-test.js +0 -62
- package/scripts/ui-prototype-execution-gates-test.js +0 -91
- package/scripts/ui-prototype-execution-policy-test.js +0 -53
- package/scripts/ui-prototype-execution-runtime-test.js +0 -27
- package/scripts/ui-prototype-ide-source-test.js +0 -73
- package/scripts/ui-prototype-native-test.js +0 -526
- package/scripts/ui-prototype-recovery-test.js +0 -81
- package/scripts/ui-prototype-registration-test.js +0 -53
- package/scripts/ui-prototype-template-test.js +0 -261
- package/scripts/ui-prototype-test.js +0 -124
- package/scripts/ui-prototype-transcript-auto-test.js +0 -67
- package/skills/i3-enterprise-sop/references/ad/assets-manifest.json +0 -86
- package/skills/i3-enterprise-sop/references/ad/prompts/01-generate.md +0 -58
- package/skills/i3-enterprise-sop/references/ad/prompts/02-review.md +0 -54
- package/skills/i3-enterprise-sop/references/ad/prompts/03-revise.md +0 -54
- package/skills/i3-enterprise-sop/references/ad/prompts/04-recheck.md +0 -54
- package/skills/i3-enterprise-sop/references/ad/readme.md +0 -70
- package/skills/i3-enterprise-sop/references/assets-manifest.json +0 -230
- package/skills/i3-enterprise-sop/references/brd/assets-manifest.json +0 -83
- package/skills/i3-enterprise-sop/references/brd/prompts/01-generate.md +0 -51
- package/skills/i3-enterprise-sop/references/brd/prompts/02-review.md +0 -47
- package/skills/i3-enterprise-sop/references/brd/prompts/03-revise.md +0 -47
- package/skills/i3-enterprise-sop/references/brd/prompts/04-recheck.md +0 -47
- package/skills/i3-enterprise-sop/references/brd/readme.md +0 -50
- package/skills/i3-enterprise-sop/references/codebuddy-project-guide.md +0 -34
- package/skills/i3-enterprise-sop/references/controlled-handoff.md +0 -41
- package/skills/i3-enterprise-sop/references/controlled_handoff.py +0 -379
- package/skills/i3-enterprise-sop/references/engineering-skeleton/adoption.md +0 -200
- package/skills/i3-enterprise-sop/references/engineering-skeleton/catalog.json +0 -17
- package/skills/i3-enterprise-sop/references/engineering-skeleton/readme.md +0 -52
- package/skills/i3-enterprise-sop/references/handoff-contract.md +0 -196
- package/skills/i3-enterprise-sop/references/lifecycle-contract.md +0 -91
- package/skills/i3-enterprise-sop/references/plan-handoff.md +0 -73
- package/skills/i3-enterprise-sop/references/prd/assets-manifest.json +0 -109
- package/skills/i3-enterprise-sop/references/prd/prompts/01-generate.md +0 -64
- package/skills/i3-enterprise-sop/references/prd/prompts/02-review.md +0 -49
- package/skills/i3-enterprise-sop/references/prd/prompts/03-revise.md +0 -48
- package/skills/i3-enterprise-sop/references/prd/prompts/04-recheck.md +0 -47
- package/skills/i3-enterprise-sop/references/prd/readme.md +0 -137
- package/skills/i3-enterprise-sop/references/prd/template-contracts.md +0 -39
- package/skills/i3-enterprise-sop/references/prd/templates/ad.md +0 -17
- package/skills/i3-enterprise-sop/references/readme.md +0 -167
- package/skills/i3-enterprise-sop/references/recovery-contract.md +0 -65
- package/skills/i3-enterprise-sop/references/review-handoff.md +0 -105
- package/skills/i3-enterprise-sop/references/selection-handoff.md +0 -55
- package/skills/i3-enterprise-sop/references/selection_handoff.py +0 -225
- package/skills/i3-enterprise-sop/references/stages.json +0 -271
- package/skills/i3-enterprise-sop/references/technical-baseline/assets-manifest.json +0 -84
- package/skills/i3-enterprise-sop/references/template-contracts.md +0 -142
- package/skills/i3-enterprise-sop/references/testcase/assets-manifest.json +0 -91
- package/skills/i3-enterprise-sop/references/testcase/prompts/01-generate.md +0 -53
- package/skills/i3-enterprise-sop/references/testcase/prompts/02-review.md +0 -51
- package/skills/i3-enterprise-sop/references/testcase/prompts/03-revise.md +0 -49
- package/skills/i3-enterprise-sop/references/testcase/prompts/04-recheck.md +0 -51
- package/skills/i3-enterprise-sop/references/testcase/readme.md +0 -61
- package/skills/i3-enterprise-sop/references/verification/check_execution.py +0 -185
- package/skills/i3-enterprise-sop/references/verification/check_native_execution.py +0 -282
- package/skills/i3-enterprise-sop/references/verification/check_reads.py +0 -348
- package/skills/i3-enterprise-sop/references/verification/readme.md +0 -149
- package/skills/i3-enterprise-sop/references/verification/review-output.schema.json +0 -155
- package/skills/i3-enterprise-sop/references/verification/review_handoff.py +0 -329
- package/skills/i3-ui-prototype/SKILL.md +0 -256
- package/skills/i3-ui-prototype/assets/capabilities/generation.json +0 -833
- package/skills/i3-ui-prototype/assets/capabilities/management.json +0 -294
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/acceptance.json +0 -51
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/component-map.json +0 -13
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/generation-component-map.json +0 -300
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/index.html +0 -11
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/package-lock.json +0 -2298
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/package.json +0 -22
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/public/prototype-config.json +0 -6
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/src/App.vue +0 -136
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/src/components/DeviceEditor.vue +0 -111
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/src/config.ts +0 -19
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/src/content.ts +0 -28
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/src/domain/devices.ts +0 -50
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/src/domain/theme.ts +0 -25
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/src/main.ts +0 -18
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/src/style.css +0 -50
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/src/useDevices.ts +0 -66
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/tests/devices.test.ts +0 -44
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/tests/theme.test.ts +0 -26
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/tsconfig.json +0 -15
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/legacy-starter/vite.config.ts +0 -4
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/profile.json +0 -174
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/readme.md +0 -61
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/index.html +0 -11
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/package-lock.json +0 -2298
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/package.json +0 -22
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/public/prototype-config.json +0 -21
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/src/App.vue +0 -62
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/src/PrototypeShell.vue +0 -59
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/src/config.ts +0 -23
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/src/domain/presentation.ts +0 -29
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/src/domain/theme.ts +0 -25
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/src/main.ts +0 -18
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/src/style.css +0 -26
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/tests/presentation.test.ts +0 -23
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/tests/theme.test.ts +0 -26
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/tsconfig.json +0 -15
- package/skills/i3-ui-prototype/assets/frameworks/vue-antdv-next/starter/vite.config.ts +0 -4
- package/skills/i3-ui-prototype/assets/hosts/codebuddy/profile.json +0 -17
- package/skills/i3-ui-prototype/assets/optional-skills/host-targets.json +0 -739
- package/skills/i3-ui-prototype/assets/optional-skills/sources.json +0 -27
- package/skills/i3-ui-prototype/assets/templates/catalog.js +0 -149
- package/skills/i3-ui-prototype/assets/templates/catalog.json +0 -149
- package/skills/i3-ui-prototype/assets/templates/classic-admin/manifest.json +0 -9
- package/skills/i3-ui-prototype/assets/templates/classic-admin/preset.json +0 -6
- package/skills/i3-ui-prototype/assets/templates/common/app/app.mjs +0 -89
- package/skills/i3-ui-prototype/assets/templates/common/app/config.json +0 -1
- package/skills/i3-ui-prototype/assets/templates/common/app/domain.mjs +0 -20
- package/skills/i3-ui-prototype/assets/templates/common/app/index.html +0 -17
- package/skills/i3-ui-prototype/assets/templates/common/app/serve.cjs +0 -16
- package/skills/i3-ui-prototype/assets/templates/common/app/styles.css +0 -670
- package/skills/i3-ui-prototype/assets/templates/common/app/tokens.css +0 -19
- package/skills/i3-ui-prototype/assets/templates/common/design-system/master.md +0 -20
- package/skills/i3-ui-prototype/assets/templates/common/gallery.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/common/mocks/applications.json +0 -5
- package/skills/i3-ui-prototype/assets/templates/common/requirements-map.json +0 -8
- package/skills/i3-ui-prototype/assets/templates/common/serve-gallery.cjs +0 -16
- package/skills/i3-ui-prototype/assets/templates/credits.md +0 -17
- package/skills/i3-ui-prototype/assets/templates/data-operations/manifest.json +0 -9
- package/skills/i3-ui-prototype/assets/templates/data-operations/preset.json +0 -6
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/capability-definition.json +0 -294
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/component-inventory.json +0 -707
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/design-system.md +0 -32
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/generation.json +0 -49
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/index.html +0 -534
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/manifest.json +0 -9
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/offline-build.json +0 -265
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/offline.js +0 -8888
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/origin.json +0 -344
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/preset.json +0 -928
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/app.js +0 -22
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/assets/empty.svg +0 -1
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/assets/reference-styles.json +0 -1
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/assets/result-403.svg +0 -1
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/assets/result-404.svg +0 -1
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/assets-manifest.json +0 -334
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/baseline.json +0 -173
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/conversion.md +0 -30
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/credits.md +0 -17
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/design-tokens.json +0 -881
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/index.html +0 -28
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/licenses/@qin-ui-antdv-next-pro.txt +0 -9
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/licenses/ant-design-icons.txt +0 -22
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/licenses/antdv-next.txt +0 -21
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/package.json +0 -12
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/browser-routes.json +0 -298
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/coverage.json +0 -180
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/integrity.json +0 -13
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/keyboard.json +0 -11
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/responsive.json +0 -125
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/review.md +0 -51
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/rules.log +0 -150
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/screenshots/flow-editor-html.png +0 -0
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/screenshots/flow-editor-original.png +0 -0
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/screenshots/intent-create-html.png +0 -0
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/screenshots/intent-create-original.png +0 -0
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/screenshots/models-html.png +0 -0
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/screenshots/models-original.png +0 -0
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/screenshots/workbench-html.png +0 -0
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/screenshots/workbench-original.png +0 -0
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/selection.json +0 -9
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/qa/visual-comparison.json +0 -342
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/readme.md +0 -73
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/reference.md +0 -59
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/routes.json +0 -178
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/controls.js +0 -99
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/dialogs.js +0 -54
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/dom.js +0 -264
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/forms.js +0 -47
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/icons.js +0 -41
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/layout.js +0 -47
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/router.js +0 -63
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/state.js +0 -90
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/table.js +0 -41
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/runtime/widgets.js +0 -8
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/AgentDetail.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/AgentDetail.js +0 -36
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/AgentEditor.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/AgentEditor.js +0 -51
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/AgentsPage.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/AgentsPage.js +0 -48
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/CheckResults.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/CheckResults.js +0 -6
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/ResourcePicker.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/ResourcePicker.js +0 -13
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/data.js +0 -24
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/domain.js +0 -32
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/registry.js +0 -25
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/agents/store.js +0 -85
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentClose.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentClose.js +0 -17
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentCreate.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentCreate.js +0 -66
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentDecisions.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentDecisions.js +0 -38
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentDetail.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentDetail.js +0 -66
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentDocument.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentDocument.js +0 -5
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentHeader.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentHeader.js +0 -12
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentHistory.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentHistory.js +0 -11
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentList.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentList.js +0 -116
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentReplan.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentReplan.js +0 -32
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentRevision.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentRevision.js +0 -49
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentSummary.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentSummary.js +0 -10
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentWorkspace.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/IntentWorkspace.js +0 -77
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/data.js +0 -60
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/domain.js +0 -105
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/intents/store.js +0 -212
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/AuditPanel.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/AuditPanel.js +0 -18
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelDetail.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelDetail.js +0 -23
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelEditor.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelEditor.js +0 -78
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelGrant.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelGrant.js +0 -55
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelReferences.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelReferences.js +0 -26
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelRelease.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelRelease.js +0 -38
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelStatus.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelStatus.js +0 -7
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelTable.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelTable.js +0 -72
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelTester.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelTester.js +0 -46
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelsPage.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/ModelsPage.js +0 -52
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/RowActions.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/RowActions.js +0 -19
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/UsagePanel.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/UsagePanel.js +0 -30
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/data.js +0 -48
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/domain.js +0 -39
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/models/store.js +0 -129
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/IncidentDetail.html +0 -4
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/IncidentDetail.js +0 -21
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/IntentSource.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/IntentSource.js +0 -8
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/OperationActionDialog.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/OperationActionDialog.js +0 -37
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/OperationEntry.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/OperationEntry.js +0 -10
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/OperationsPage.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/OperationsPage.js +0 -37
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/RepairTrack.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/RepairTrack.js +0 -49
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/RunDetail.html +0 -4
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/RunDetail.js +0 -22
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/SourceSummary.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/SourceSummary.js +0 -9
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/commands.js +0 -82
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/examples.js +0 -47
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/model.js +0 -61
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/repair.js +0 -68
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/store.js +0 -55
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/types.js +0 -1
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/operations/workbench.js +0 -18
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/ManagementTable.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/ManagementTable.js +0 -28
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcCreateEntry.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcCreateEntry.js +0 -18
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcDetail.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcDetail.js +0 -31
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcEditor.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcEditor.js +0 -27
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcLifecycle.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcLifecycle.js +0 -16
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcPage.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcPage.js +0 -43
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcPicker.html +0 -4
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcPicker.js +0 -34
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcProgress.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcProgress.js +0 -30
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcWizard.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcWizard.js +0 -67
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcWorkspace.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcWorkspace.js +0 -41
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcsPage.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/PbcsPage.js +0 -31
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/ServiceEditor.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/ServiceEditor.js +0 -26
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/ServiceList.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/ServiceList.js +0 -70
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/data.js +0 -8
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/domain.js +0 -62
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/management.js +0 -36
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/managementStore.js +0 -49
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/pbc/store.js +0 -132
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/AdminList.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/AdminList.js +0 -38
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/EffectiveGrants.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/EffectiveGrants.js +0 -11
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/GrantEditor.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/GrantEditor.js +0 -45
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/MemberEditor.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/MemberEditor.js +0 -54
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/MembersPage.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/MembersPage.js +0 -27
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/RecordsPage.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/RecordsPage.js +0 -12
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/RoleEditor.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/RoleEditor.js +0 -45
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/RolesPage.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/RolesPage.js +0 -38
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/domain.js +0 -61
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/state.js +0 -51
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/permissions/store.js +0 -116
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleaseActionDialog.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleaseActionDialog.js +0 -45
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleaseDetail.html +0 -4
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleaseDetail.js +0 -30
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleaseEditor.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleaseEditor.js +0 -67
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleaseExecution.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleaseExecution.js +0 -5
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleasesPage.html +0 -4
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/ReleasesPage.js +0 -60
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/commands.js +0 -157
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/model.js +0 -136
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/releases/store.js +0 -76
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/ReviewDetail.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/ReviewDetail.js +0 -26
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/ReviewEvidence.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/ReviewEvidence.js +0 -14
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/ReviewProcess.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/ReviewProcess.js +0 -113
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/ReviewsPage.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/ReviewsPage.js +0 -62
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/commands.js +0 -97
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/model.js +0 -147
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/reviews/store.js +0 -13
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/ColumnSettings.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/ColumnSettings.js +0 -9
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/ListBatchBar.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/ListBatchBar.js +0 -8
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/ListDeleteDialog.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/ListDeleteDialog.js +0 -37
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/ListMore.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/ListMore.js +0 -8
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/RecordMetadata.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/RecordMetadata.js +0 -17
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/columns.js +0 -32
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/deliveryGuide.js +0 -49
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/deliveryView.js +0 -12
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/listBatch.js +0 -15
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/listSelection.js +0 -37
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/policy.js +0 -68
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shared/session.js +0 -44
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/ConfirmationDialog.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/ConfirmationDialog.js +0 -25
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/ConsoleShell.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/ConsoleShell.js +0 -53
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/PrototypeGuide.html +0 -10
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/PrototypeGuide.js +0 -30
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/ScopePage.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/ScopePage.js +0 -10
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/SessionDialog.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/SessionDialog.js +0 -9
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/confirmation.js +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/shell/navigation.js +0 -19
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecDocument.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecDocument.js +0 -8
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecEdit.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecEdit.js +0 -32
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecHeader.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecHeader.js +0 -15
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecHistory.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecHistory.js +0 -11
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecReview.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecReview.js +0 -57
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecWorkspace.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/SpecWorkspace.js +0 -37
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/data.js +0 -20
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/domain.js +0 -55
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/specs/store.js +0 -151
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/ArtifactDetail.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/ArtifactDetail.js +0 -18
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/TaskCreate.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/TaskCreate.js +0 -40
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/TaskDetail.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/TaskDetail.js +0 -51
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/TaskLaunch.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/TaskLaunch.js +0 -9
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/TasksPage.html +0 -5
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/TasksPage.js +0 -48
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/domain.js +0 -204
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/exampleSource.js +0 -22
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/registry.js +0 -135
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/tasks/store.js +0 -137
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workbench/WorkbenchPage.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workbench/WorkbenchPage.js +0 -36
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workbench/model.js +0 -56
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workbench/store.js +0 -15
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/FlowCanvas.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/FlowCanvas.js +0 -27
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/FlowDetail.html +0 -4
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/FlowDetail.js +0 -31
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/FlowEditor.html +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/FlowEditor.js +0 -68
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/WorkflowsPage.html +0 -5
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/WorkflowsPage.js +0 -55
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/data.js +0 -16
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/domain.js +0 -83
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/registry.js +0 -18
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/src/workflows/store.js +0 -61
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/admin.css +0 -60
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/agents.css +0 -46
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/antdv.css +0 -295
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/app.css +0 -102
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/delivery.css +0 -4
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/intents.css +0 -37
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/native.css +0 -22
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/operations.css +0 -2
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/pbc.css +0 -3
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/permissions.css +0 -22
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/pro.css +0 -1
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/releases.css +0 -4
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/reset.css +0 -246
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/reviews.css +0 -8
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/tasks.css +0 -6
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/tokens.css +0 -15
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/workbench.css +0 -61
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/styles/workflows.css +0 -1
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/admin-rules.test.js +0 -96
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/agents.test.js +0 -14
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/intent-state.test.js +0 -37
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/list-batch.test.js +0 -44
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/operation-fixtures.js +0 -19
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/operation-repair.test.js +0 -14
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/operations.test.js +0 -25
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/pbc-management.test.js +0 -17
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/pbc-state.test.js +0 -24
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/permission-config.test.js +0 -23
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/permissions.test.js +0 -24
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/releases.test.js +0 -50
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/reviews.test.js +0 -36
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/runtime-forms-router.test.js +0 -28
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/runtime-state.test.js +0 -42
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/runtime-stores.test.js +0 -16
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/spec-state.test.js +0 -11
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/tasks.test.js +0 -27
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/workbench.test.js +0 -34
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tests/workflows.test.js +0 -16
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tools/convert.mjs +0 -168
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tools/serve.mjs +0 -7
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tools/styles.mjs +0 -11
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/reference/tools/verify.mjs +0 -24
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/serve.cjs +0 -16
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/template-inventory.json +0 -28791
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/template.json +0 -9
- package/skills/i3-ui-prototype/assets/templates/enterprise-admin/usability.css +0 -44
- package/skills/i3-ui-prototype/assets/templates/gallery/index.html +0 -40
- package/skills/i3-ui-prototype/assets/templates/generation-options.js +0 -42
- package/skills/i3-ui-prototype/assets/templates/index.html +0 -3
- package/skills/i3-ui-prototype/assets/templates/modern-workspace/manifest.json +0 -9
- package/skills/i3-ui-prototype/assets/templates/modern-workspace/preset.json +0 -6
- package/skills/i3-ui-prototype/assets/templates/presentation.html +0 -17
- package/skills/i3-ui-prototype/assets/templates/serve-gallery.cjs +0 -23
- package/skills/i3-ui-prototype/references/artifact-contract.md +0 -66
- package/skills/i3-ui-prototype/references/content-template.md +0 -81
- package/skills/i3-ui-prototype/references/enterprise-admin.md +0 -44
- package/skills/i3-ui-prototype/references/entry-contract.md +0 -71
- package/skills/i3-ui-prototype/references/execution-evidence.md +0 -51
- package/skills/i3-ui-prototype/references/expert-adapter.md +0 -76
- package/skills/i3-ui-prototype/references/framework-contract.md +0 -76
- package/skills/i3-ui-prototype/references/generation-contract.md +0 -122
- package/skills/i3-ui-prototype/references/interaction-acceptance.md +0 -169
- package/skills/i3-ui-prototype/references/legacy-native.md +0 -58
- package/skills/i3-ui-prototype/references/optional-skills.md +0 -63
- package/skills/i3-ui-prototype/references/project-layout.md +0 -92
- package/skills/i3-ui-prototype/references/template-adapters.md +0 -63
- package/skills/i3-ui-prototype/references/workflow-contract.md +0 -77
- package/skills/i3-ui-prototype/scripts/adapters/easel-html.cjs +0 -30
- package/skills/i3-ui-prototype/scripts/adapters/legacy-html.cjs +0 -28
- package/skills/i3-ui-prototype/scripts/browser-workspace.cjs +0 -72
- package/skills/i3-ui-prototype/scripts/buddy-host.cjs +0 -40
- package/skills/i3-ui-prototype/scripts/check-design-provider.cjs +0 -9
- package/skills/i3-ui-prototype/scripts/check-prototype.cjs +0 -14
- package/skills/i3-ui-prototype/scripts/codebuddy-context.cjs +0 -92
- package/skills/i3-ui-prototype/scripts/codebuddy-hook.cjs +0 -298
- package/skills/i3-ui-prototype/scripts/codebuddy-ide-source.cjs +0 -69
- package/skills/i3-ui-prototype/scripts/codebuddy-registration.cjs +0 -125
- package/skills/i3-ui-prototype/scripts/content-template.cjs +0 -98
- package/skills/i3-ui-prototype/scripts/design-provider-discovery.cjs +0 -128
- package/skills/i3-ui-prototype/scripts/enterprise-template.cjs +0 -104
- package/skills/i3-ui-prototype/scripts/execution-assertions.cjs +0 -43
- package/skills/i3-ui-prototype/scripts/execution-diagnostics.cjs +0 -91
- package/skills/i3-ui-prototype/scripts/execution-evidence.cjs +0 -177
- package/skills/i3-ui-prototype/scripts/execution-gates.cjs +0 -216
- package/skills/i3-ui-prototype/scripts/execution-policy.cjs +0 -62
- package/skills/i3-ui-prototype/scripts/execution-recovery.cjs +0 -58
- package/skills/i3-ui-prototype/scripts/execution-runtime.cjs +0 -69
- package/skills/i3-ui-prototype/scripts/generation-assets.cjs +0 -18
- package/skills/i3-ui-prototype/scripts/generation-contract.cjs +0 -214
- package/skills/i3-ui-prototype/scripts/generation-evidence.cjs +0 -50
- package/skills/i3-ui-prototype/scripts/generation-replan.cjs +0 -34
- package/skills/i3-ui-prototype/scripts/hosts/codebuddy.cjs +0 -21
- package/skills/i3-ui-prototype/scripts/init-prototype.cjs +0 -8
- package/skills/i3-ui-prototype/scripts/manage-baseline.cjs +0 -11
- package/skills/i3-ui-prototype/scripts/native-browser.cjs +0 -785
- package/skills/i3-ui-prototype/scripts/native-build.cjs +0 -91
- package/skills/i3-ui-prototype/scripts/native-command.cjs +0 -35
- package/skills/i3-ui-prototype/scripts/native-delivery.cjs +0 -104
- package/skills/i3-ui-prototype/scripts/native-devtools.cjs +0 -92
- package/skills/i3-ui-prototype/scripts/native-files.cjs +0 -44
- package/skills/i3-ui-prototype/scripts/native-pilot-lib.cjs +0 -290
- package/skills/i3-ui-prototype/scripts/native-pilot.cjs +0 -59
- package/skills/i3-ui-prototype/scripts/native-tool-name.cjs +0 -5
- package/skills/i3-ui-prototype/scripts/native-tool-result.cjs +0 -14
- package/skills/i3-ui-prototype/scripts/optional-skill-install.cjs +0 -203
- package/skills/i3-ui-prototype/scripts/project-registry.cjs +0 -126
- package/skills/i3-ui-prototype/scripts/prototype-dependencies.cjs +0 -103
- package/skills/i3-ui-prototype/scripts/prototype-hooks.cjs +0 -94
- package/skills/i3-ui-prototype/scripts/prototype-lib.cjs +0 -277
- package/skills/i3-ui-prototype/scripts/prototype-locations.cjs +0 -69
- package/skills/i3-ui-prototype/scripts/ptc-callbacks.cjs +0 -131
- package/skills/i3-ui-prototype/scripts/sync-template.cjs +0 -19
- package/skills/i3-ui-prototype/scripts/template-adapters.cjs +0 -89
- package/skills/i3-ui-prototype/scripts/template-contract.cjs +0 -407
- package/skills/i3-ui-prototype/scripts/template-inventory.cjs +0 -78
- package/skills/i3-ui-prototype/scripts/validate-result.cjs +0 -117
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const fs=require('node:fs'),path=require('node:path'),crypto=require('node:crypto'),assert=require('node:assert/strict');
|
|
3
|
-
const F=require('./native-files.cjs'),C=require('./codebuddy-context.cjs'),E=require('./execution-evidence.cjs'),P=require('./execution-policy.cjs'),G=require('./execution-gates.cjs');
|
|
4
|
-
const X=require('./execution-runtime.cjs');
|
|
5
|
-
const H=require('./buddy-host.cjs');
|
|
6
|
-
const Recovery=require('./execution-recovery.cjs');
|
|
7
|
-
const {tokens,nativeCommand,stageFor,completedBegin}=require('./native-command.cjs');
|
|
8
|
-
const {toolName}=require('./native-tool-name.cjs');
|
|
9
|
-
function eventCall(payload,source) {
|
|
10
|
-
const callId=payload.tool_use_id||payload.call_id;
|
|
11
|
-
const canonical=value=>Array.isArray(value)?value.map(canonical):value&&typeof value==='object'?Object.fromEntries(Object.keys(value).sort().map(k=>[k,canonical(value[k])])):value;
|
|
12
|
-
const partial=(before,after)=>typeof before==='string'?typeof after==='string'&&after.startsWith(before):Array.isArray(before)?Array.isArray(after)&&before.length<=after.length&&before.every((value,i)=>partial(value,after[i])):before&&typeof before==='object'?after&&typeof after==='object'&&Object.keys(before).every(key=>Object.hasOwn(after,key)&&partial(before[key],after[key])):before===after;
|
|
13
|
-
const matches=source.calls.filter(call=>{
|
|
14
|
-
if(call.name!==toolName(payload.tool_name)||call.requestLine<source.prompts.at(-1).line||callId&&call.toolCallId!==callId)return false;
|
|
15
|
-
if(source.format==='codebuddy-ide-index-v1'&&payload.generation_id&&call.nativeRequestId!==payload.generation_id)return false;
|
|
16
|
-
if(JSON.stringify(canonical(call.input))===JSON.stringify(canonical(payload.tool_input||{})))return true;
|
|
17
|
-
// IDE 4.12 streams incomplete args to disk before PreToolUse. Correlate its
|
|
18
|
-
// actual callback with one pending native call in the exact generation. The
|
|
19
|
-
// pending call remains unsuccessful until a native result is persisted.
|
|
20
|
-
return source.format==='codebuddy-ide-index-v1'&&H.isIDE(payload)&&typeof payload.generation_id==='string'&&call.nativeRequestId===payload.generation_id&&!call.resultLine&&partial(call.input,payload.tool_input||{});
|
|
21
|
-
});
|
|
22
|
-
// IDE can omit the call ID and invoke Post before persisting the result.
|
|
23
|
-
// A failed earlier attempt can have identical args; only the still-pending
|
|
24
|
-
// request in this exact generation can be the current callback.
|
|
25
|
-
const pending=matches.filter(call=>!call.resultLine);
|
|
26
|
-
const current=payload.hook_event_name==='PreToolUse'||source.format==='codebuddy-ide-index-v1'&&pending.length?pending:matches;
|
|
27
|
-
assert.equal(current.length,1,'Native Hook event does not uniquely match the current transcript request');return current[0];
|
|
28
|
-
}
|
|
29
|
-
function eventSource(payload,record,project,{readSource=C.source,pause=milliseconds=>Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,milliseconds)}={}) {
|
|
30
|
-
const toolEvent=['PreToolUse','PostToolUse'].includes(payload.hook_event_name);
|
|
31
|
-
// IDE can persist the current call only AFTER returning from both Hooks. Its
|
|
32
|
-
// current native prompt/generation still binds the callback. Never synthesize
|
|
33
|
-
// a successful call; A checks the persisted request/result at a later stage.
|
|
34
|
-
const attempts=toolEvent?8:1;
|
|
35
|
-
for(let attempt=1;attempt<=attempts;attempt++) {
|
|
36
|
-
try {
|
|
37
|
-
let source=readSource(payload,record,project);
|
|
38
|
-
if(toolEvent&&record.product==='cli'&&(payload.agent_type==='ptc'||source.calls.some(c=>c.name==='REPL'&&!c.resultLine))){
|
|
39
|
-
source=require('./ptc-callbacks.cjs').observe({payload,record,project,source});
|
|
40
|
-
}
|
|
41
|
-
let nativeRequestStatus='not-tool-event';
|
|
42
|
-
if(toolEvent) {
|
|
43
|
-
if(source.format==='codebuddy-ide-index-v1'&&record.product==='ide'&&H.isIDE(payload)) {
|
|
44
|
-
const latest=source.prompts.at(-1);
|
|
45
|
-
assert.ok(typeof payload.generation_id==='string'&&latest?.nativeRequestId===payload.generation_id,'IDE callback differs from the current native task generation');
|
|
46
|
-
const pending=source.calls.filter(call=>!call.resultLine&&call.requestLine>latest.line&&call.nativeRequestId===payload.generation_id&&call.name===toolName(payload.tool_name));
|
|
47
|
-
if(pending.length) {eventCall(payload,source);nativeRequestStatus='pending-native-request';}
|
|
48
|
-
else nativeRequestStatus='deferred-until-native-persistence';
|
|
49
|
-
}else {eventCall(payload,source);nativeRequestStatus='matched-native-request';}
|
|
50
|
-
}
|
|
51
|
-
return {...source,nativeReadAttempts:attempt,nativeRequestStatus};
|
|
52
|
-
}catch(error){if(attempt===attempts)throw error;pause(100);}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function decision({event,source,binding,tool,input,directory,cwd,deliveryCurrent,stopHookActive=false,policy,restricted}) {
|
|
56
|
-
if(restricted??C.restriction(source.prompts).blocked)return {continue:true,reason:'user-read-only-or-stopped'};
|
|
57
|
-
if(event==='PreToolUse'&&G.uiWrite({name:tool,input:input||{},cwd},directory)) {
|
|
58
|
-
const missing=Recovery.missing({source,binding,policy});
|
|
59
|
-
if(missing.length)return {deny:true,missing,reason:'原型 UI 写入已被阻止。'+Recovery.instruction(missing,{directory,automatic:binding?.association==='automatic'})};
|
|
60
|
-
}
|
|
61
|
-
const final=source.latestAssistant||'',claim=/(?:已完成|已经完成|全部通过|可以交付|\b(?:completed|ready for review|all checks passed)\b)/i.test(final)&&!/(?:未完成|尚未|待验证|阻塞|等待|进度|blocked|awaiting|not complete|in progress)/i.test(final);
|
|
62
|
-
const blocked=/(?:\bblocked\b|无法继续|当前阻塞|等待用户|等待授权)/i.test(final);
|
|
63
|
-
if(event==='Stop'&&binding&&!deliveryCurrent&&!blocked&&(policy?.id===P.AUTO_ID||!stopHookActive)&&claim){
|
|
64
|
-
const missing=Recovery.missing({source,binding,policy,stage:'delivery'});if(!missing.length)missing.push('execution-evidence');
|
|
65
|
-
return {feedback:true,missing,reason:'当前原型没有有效交付回执。'+Recovery.instruction(missing,{directory,automatic:binding?.association==='automatic'})};
|
|
66
|
-
}
|
|
67
|
-
return {continue:true};
|
|
68
|
-
}
|
|
69
|
-
function prototypeForWrite(project,tool,input,cwd=project) {
|
|
70
|
-
if(!['Write','Edit','MultiEdit','write_to_file','replace_in_file'].includes(tool))return null;
|
|
71
|
-
const file=input?.file_path||input?.filePath||input?.path||input?.TargetFile;if(typeof file!=='string')return null;
|
|
72
|
-
let current=path.dirname(path.resolve(cwd,file));const prototypes=path.join(project,'prototypes');
|
|
73
|
-
while(current.startsWith(prototypes+path.sep)){if(fs.existsSync(path.join(current,'prototype.json')))return fs.realpathSync(current);current=path.dirname(current);}return null;
|
|
74
|
-
}
|
|
75
|
-
function safeProject(payload,options={},env=process.env,real=file=>fs.realpathSync(file),callbackCwd=process.cwd(),workspace=E.ideWorkspace) {
|
|
76
|
-
const ideRoot=options.product==='ide'&&H.isIDE(payload)&&payload.cwd==='/';
|
|
77
|
-
const hostProject=options.host==='workbuddy'?env.WORKBUDDY_PROJECT_DIR:env.CODEBUDDY_PROJECT_DIR;
|
|
78
|
-
const root=options.scope==='project'?path.dirname(options.base):options.nativeProject|| (ideRoot?workspace(payload.transcript_path,payload.session_id):hostProject||env.CLAUDE_PROJECT_DIR||payload.cwd||(payload.hook_event_name==='SessionStart'?callbackCwd:null));assert.ok(root&&path.isAbsolute(root),'Native project directory required');
|
|
79
|
-
const project=real(root);
|
|
80
|
-
// IDE 4.12.2 reports '/' for absolute-path tools. Use the project registration
|
|
81
|
-
// or session-bound native workspace above; reject all other outside cwd.
|
|
82
|
-
if(payload.cwd&&!ideRoot){const relative=path.relative(project,real(payload.cwd));assert.ok(relative!=='..'&&!relative.startsWith('..'+path.sep)&&!path.isAbsolute(relative),'Hook cwd is outside project');}return project;
|
|
83
|
-
}
|
|
84
|
-
function saveIndex(directory,index) {
|
|
85
|
-
for(const entry of Object.values(index.bindings))F.write(path.dirname(directory),`runs/${entry.runId}/binding.json`,entry);
|
|
86
|
-
F.write(directory,'session.json',index);
|
|
87
|
-
}
|
|
88
|
-
function toolCwd(payload,record,project) {
|
|
89
|
-
return record.product==='ide'&&H.isIDE(payload)&&payload.cwd==='/'?project:payload.cwd||project;
|
|
90
|
-
}
|
|
91
|
-
function settleNativeRetries(index,source,{project,sessionId}) {
|
|
92
|
-
let changed=false;
|
|
93
|
-
for(const entry of Object.values(index.bindings)) {
|
|
94
|
-
const repair=entry.recovery,expected=repair?.expectedRetry;
|
|
95
|
-
if(!expected||!['required','ready-to-retry'].includes(repair.status)||entry.contextLine!==source.contextLine)continue;
|
|
96
|
-
const matches=source.calls.filter(call=>{
|
|
97
|
-
if(!call.success||!call.resultLine||call.sessionId!==sessionId||call.requestLine<=entry.entryLine||source.stableThroughLine!==undefined&&call.resultLine>source.stableThroughLine)return false;
|
|
98
|
-
if(expected.kind==='ui-write') {
|
|
99
|
-
const input=call.input||{},file=input.file_path||input.filePath||input.path||input.TargetFile;
|
|
100
|
-
return typeof file==='string'&&path.resolve(call.cwd||project,file)===expected.file&&G.uiWrite({...call,cwd:call.cwd||project},entry.directory);
|
|
101
|
-
}
|
|
102
|
-
const parsed=nativeCommand(call.name,call.input,call.cwd||project);
|
|
103
|
-
return expected.kind==='stage'&&parsed?.root===entry.directory&&parsed.operation===expected.operation;
|
|
104
|
-
});
|
|
105
|
-
for(const call of matches) {
|
|
106
|
-
const stage=expected.kind==='stage'?expected.stage:null;
|
|
107
|
-
if(stage&&X.check(entry.directory,stage,require('./native-pilot-lib.cjs')).status!=='passed')continue;
|
|
108
|
-
const retry={...expected,toolCallId:call.toolCallId,resultDigest:call.resultDigest,requestLine:call.requestLine,resultLine:call.resultLine};
|
|
109
|
-
const answer=Recovery.record(index,{source,sessionId,directory:entry.directory,event:'PostToolUse',eventKey:E.sha(JSON.stringify(['persisted-native-result',call.toolCallId,call.resultDigest])),stage,policy:X.policy(entry.directory),resolved:stage?['execution-evidence']:[],retrySucceeded:true,retry},{continue:true});
|
|
110
|
-
if(answer.recovery&&JSON.stringify(answer.recovery)!==JSON.stringify(entry.recovery)){entry.recovery=answer.recovery;changed=true;}
|
|
111
|
-
if(entry.recovery?.status==='recovered')break;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return changed;
|
|
115
|
-
}
|
|
116
|
-
function dispatch(payload,options) {
|
|
117
|
-
payload={...payload,tool_name:toolName(payload.tool_name)};
|
|
118
|
-
assert.equal(payload.hook_event_name,options.event,'Hook event mismatch');
|
|
119
|
-
if(options.event==='SessionStart')return {continue:true};
|
|
120
|
-
if(options.event==='UserPromptSubmit')return {continue:true};
|
|
121
|
-
let identity,installed;
|
|
122
|
-
try{installed=options.product==='auto'?C.registration(options.base):null;identity=H.identify(payload,installed||{schemaVersion:1,product:options.product},options);}catch(error){
|
|
123
|
-
const project=options.scope==='project'?path.dirname(options.base):payload.cwd;
|
|
124
|
-
if(options.event==='PreToolUse'&&project&&path.isAbsolute(project)){
|
|
125
|
-
const native=nativeCommand(payload.tool_name,payload.tool_input,payload.cwd||project),target=native?.root||prototypeForWrite(project,payload.tool_name,payload.tool_input,payload.cwd==='/'?project:payload.cwd||project);
|
|
126
|
-
if(target&&fs.existsSync(path.join(target,'prototype.json'))&&X.policy(target))return {deny:true,reason:'原型原生宿主身份尚未核验,禁止受管写入或阶段推进:'+error.message};
|
|
127
|
-
}
|
|
128
|
-
throw error;
|
|
129
|
-
}
|
|
130
|
-
options={...options,...identity};
|
|
131
|
-
const project=safeProject(payload,options,options.env),record=C.select({project,product:identity.product,host:identity.host,home:options.home,env:options.env});
|
|
132
|
-
if(!record||record.base!==options.base)return {continue:true};
|
|
133
|
-
const cwd=toolCwd(payload,record,project);
|
|
134
|
-
let source;
|
|
135
|
-
try {
|
|
136
|
-
source=eventSource(payload,record,project);
|
|
137
|
-
}catch(error){
|
|
138
|
-
// The outer diagnostic handler must persist and bound this failure as well;
|
|
139
|
-
// returning an uncounted denial here used to create an endless repair loop.
|
|
140
|
-
throw error;
|
|
141
|
-
}
|
|
142
|
-
const latest=source.prompts.at(-1);
|
|
143
|
-
if(options.restricted??C.restriction(source.prompts).blocked) {
|
|
144
|
-
const native=nativeCommand(payload.tool_name,payload.tool_input,cwd),root=native?.root||prototypeForWrite(project,payload.tool_name,payload.tool_input,cwd);
|
|
145
|
-
if(options.event==='PreToolUse'&&(native&&['create','execution-begin','build','revise','replan','record-run','record-devtools-review','finalize'].includes(native.operation)||root&&X.policy(root)&&G.uiWrite({name:payload.tool_name,input:payload.tool_input,cwd},root)))return {deny:true,reason:'The latest user request is read-only or stopped; no prototype mutation is authorized.'};
|
|
146
|
-
return {continue:true};
|
|
147
|
-
}
|
|
148
|
-
const stateDirectory=C.sessionDirectory(record,project,payload.session_id),file=path.join(stateDirectory,'session.json');
|
|
149
|
-
let index=JSON.parse(C.read(file)||'{"schemaVersion":1,"bindings":{}}');assert.equal(index.schemaVersion,1,'Unsupported audit session state');
|
|
150
|
-
if(Object.values(index.bindings).some(entry=>['required','ready-to-retry'].includes(entry.recovery?.status))) {
|
|
151
|
-
const lock=path.join(stateDirectory,'.audit.lock');fs.mkdirSync(stateDirectory,{recursive:true});
|
|
152
|
-
try{fs.mkdirSync(lock);}catch{throw new Error('Concurrent audit callback; retry the original operation');}
|
|
153
|
-
try{index=JSON.parse(C.read(file));if(settleNativeRetries(index,source,{project,sessionId:payload.session_id}))saveIndex(stateDirectory,index);}
|
|
154
|
-
finally{fs.rmdirSync(lock);}
|
|
155
|
-
}
|
|
156
|
-
const command=nativeCommand(payload.tool_name,payload.tool_input,cwd);
|
|
157
|
-
if(options.event==='PreToolUse'&&command?.operation==='create'&&(installed?.schemaVersion===2||E.loaded(source.calls,'prototype').some(c=>c.requestLine>source.contextLine)||/^\s*\/i3-prototype\b/.test(latest.text))){
|
|
158
|
-
const at=command.argv.indexOf('--execution-policy'),expected=installed?.schemaVersion===2?P.AUTO_ID:P.ID;
|
|
159
|
-
const hostAt=command.argv.indexOf('--host');
|
|
160
|
-
if(at<0||command.argv[at+1]!==expected||installed?.schemaVersion===2&&(hostAt<0||command.argv[hostAt+1]!==identity.host))return {deny:true,reason:`New ${identity.host} prototypes require --host ${identity.host} --execution-policy ${expected} and fixed --execution-assertions. Existing artifacts keep their original contracts.`};
|
|
161
|
-
}
|
|
162
|
-
const directory=command?.root||prototypeForWrite(project,payload.tool_name,payload.tool_input,cwd);
|
|
163
|
-
let existing=directory?index.bindings[directory]:null;
|
|
164
|
-
const stage=options.event==='Stop'?'delivery':stageFor[command?.operation];
|
|
165
|
-
let callbackCall=null;if(['PreToolUse','PostToolUse'].includes(options.event))try{callbackCall=eventCall(payload,source);}catch{/* Deferred IDE requests cannot attest results. */}
|
|
166
|
-
const callId=payload.tool_use_id||payload.call_id||callbackCall?.toolCallId;
|
|
167
|
-
const eventKey=E.sha(JSON.stringify([options.event,payload.generation_id||latest.nativeRequestId||null,callId||null,payload.tool_name||null,payload.tool_input||null,callId?null:source.digest]));
|
|
168
|
-
const recoveryContext=target=>{
|
|
169
|
-
const stagePassed=stage&&options.event!=='Stop'&&X.check(target,stage,require('./native-pilot-lib.cjs')).status==='passed';
|
|
170
|
-
const retryCall=options.event==='PostToolUse'&&callbackCall?.success&&(stagePassed||G.uiWrite({...callbackCall,cwd:callbackCall.cwd||cwd},target))?callbackCall:null;
|
|
171
|
-
const input=payload.tool_input||{},uiFile=input.file_path||input.filePath||input.path||input.TargetFile;
|
|
172
|
-
const expectedRetry=stage?{kind:'stage',stage,operation:options.event==='Stop'?'finalize':command.operation}:G.uiWrite({name:payload.tool_name,input,cwd},target)?{kind:'ui-write',file:path.resolve(cwd,uiFile)}:null;
|
|
173
|
-
return {source,sessionId:payload.session_id,directory:target,event:options.event,eventKey,stage,expectedRetry,policy:X.policy(target),resolved:[...(completedBegin(source,existing)?['execution-begin']:[]),...(stagePassed?['execution-evidence']:[])],retrySucceeded:!!retryCall,
|
|
174
|
-
...(retryCall?{retry:{toolCallId:retryCall.toolCallId,resultDigest:retryCall.resultDigest,requestLine:retryCall.requestLine,resultLine:retryCall.resultLine,...(stagePassed?{kind:'stage',stage,operation:command.operation}:{kind:'ui-write',file:path.resolve(cwd,uiFile)})}}:{})};
|
|
175
|
-
};
|
|
176
|
-
const respond=answer=>{
|
|
177
|
-
const lock=path.join(stateDirectory,'.audit.lock');fs.mkdirSync(stateDirectory,{recursive:true});
|
|
178
|
-
try{fs.mkdirSync(lock);}catch{throw new Error('Concurrent audit callback; retry without bypassing the gate');}
|
|
179
|
-
try{const fresh=JSON.parse(C.read(file)||'{"schemaVersion":1,"bindings":{}}');const result=Recovery.record(fresh,recoveryContext(directory),answer);if(fresh.bindings[directory]&&result.recovery)fresh.bindings[directory].recovery=result.recovery;saveIndex(stateDirectory,fresh);return result;}
|
|
180
|
-
finally{fs.rmdirSync(lock);}
|
|
181
|
-
};
|
|
182
|
-
const automatic=options.event==='PreToolUse'&&directory&&fs.existsSync(path.join(directory,'prototype.json'))&&X.policy(directory)&&
|
|
183
|
-
(command||G.uiWrite({name:payload.tool_name,input:payload.tool_input||{},cwd},directory))&&command?.operation!=='execution-begin'&&
|
|
184
|
-
(!existing||existing.contextLine!==source.contextLine||existing.registrationDigest!==record.registrationDigest||existing.settingsDigest!==record.settingsDigest||existing.inputDigest!==require('./native-pilot-lib.cjs').manifest(directory).inputDigest);
|
|
185
|
-
if(options.event==='PreToolUse'&&command?.operation==='execution-begin'||automatic) {
|
|
186
|
-
assert.ok(directory&&directory.startsWith(path.join(project,'prototypes')+path.sep),'Prototype must be in this project');
|
|
187
|
-
const fixed=X.policy(directory);assert.ok(fixed,'Existing prototype retains its original contract; do not rewrite it implicitly');
|
|
188
|
-
assert.equal(fixed.host,identity.host,'This prototype has a fixed contract for another host; inspect it or explicitly migrate and revalidate, do not inherit its invocation proof');
|
|
189
|
-
const loaded=E.loaded(source.calls,'prototype').some(c=>c.requestLine>source.contextLine);
|
|
190
|
-
assert.ok(automatic||loaded||/^\s*\/i3-prototype\b/.test(latest.text),'Native prototype Skill or actual shortcut entry required');
|
|
191
|
-
const meta=F.json(path.join(directory,'prototype.json')),lib=require('./native-pilot-lib.cjs'),current=lib.manifest(directory);
|
|
192
|
-
const reuse=existing&&existing.inputDigest===current.inputDigest&&existing.contextLine===source.contextLine&&existing.registrationDigest===record.registrationDigest&&existing.settingsDigest===record.settingsDigest;
|
|
193
|
-
const runId=reuse?existing.runId:crypto.randomUUID();
|
|
194
|
-
index.bindings[directory]={schemaVersion:1,...(automatic?{association:'automatic'}:{}),runId,sessionId:payload.session_id,project,projectKey:C.projectKey(project),directory,instanceId:meta.instanceId,policyDigest:fixed.digest,inputDigest:current.inputDigest,entryLine:reuse?existing.entryLine:latest.line,promptDigest:reuse?existing.promptDigest:latest.digest,contextLine:source.contextLine,
|
|
195
|
-
operation:meta.revision==='r001'?'create':'revise',host:identity.host,identitySource:identity.identitySource,product:record.product,productVersion:identity.productVersion,scope:record.scope,registrationDigest:record.registrationDigest,settingsDigest:record.settingsDigest,source:{path:source.path,bytes:source.bytes,digest:source.digest},lastHook:{event:options.event,at:new Date().toISOString(),nativeReadAttempts:source.nativeReadAttempts,nativeRequestStatus:source.nativeRequestStatus}};
|
|
196
|
-
const lock=path.join(stateDirectory,'.audit.lock');fs.mkdirSync(stateDirectory,{recursive:true});
|
|
197
|
-
try{fs.mkdirSync(lock);}catch{throw new Error('Concurrent audit callback; retry the original operation');}
|
|
198
|
-
try {
|
|
199
|
-
const fresh=JSON.parse(C.read(file)||'{"schemaVersion":1,"bindings":{}}');fresh.bindings[directory]=index.bindings[directory];
|
|
200
|
-
saveIndex(stateDirectory,fresh);
|
|
201
|
-
F.write(directory,'qa/execution-context.json',{schemaVersion:1,runId,sessionId:payload.session_id,project,base:record.base,host:identity.host,product:record.product});
|
|
202
|
-
}finally{fs.rmdirSync(lock);}
|
|
203
|
-
existing=index.bindings[directory];
|
|
204
|
-
if(!automatic)return {continue:true};
|
|
205
|
-
}
|
|
206
|
-
if(directory&&fs.existsSync(path.join(directory,'prototype.json'))&&X.policy(directory)) {
|
|
207
|
-
const fixed=X.policy(directory),answer=decision({event:options.event,source,binding:existing,tool:payload.tool_name,input:payload.tool_input,directory,cwd,policy:fixed,restricted:options.restricted});
|
|
208
|
-
if(answer.deny)return respond(answer);
|
|
209
|
-
if(options.event==='PostToolUse'&&command&&(command.operation==='execution-begin'||stage)){
|
|
210
|
-
// IDE may not have persisted a callback's result yet. Only observed native
|
|
211
|
-
// failures produce recovery feedback; outer tool success is insufficient.
|
|
212
|
-
if(callbackCall?.resultLine&&!callbackCall.success){
|
|
213
|
-
const missing=command.operation==='execution-begin'?['execution-begin']:['execution-evidence'];
|
|
214
|
-
return respond({feedback:true,missing,reason:`原型 ${command.operation} 实际返回失败,阶段尚未通过。`+Recovery.instruction(missing,{directory,automatic:existing?.association==='automatic'})});
|
|
215
|
-
}
|
|
216
|
-
if(command.operation==='execution-begin')return respond({continue:true});
|
|
217
|
-
}
|
|
218
|
-
if(options.event==='PreToolUse'&&command&&['build','record-run','record-devtools-review','finalize'].includes(command.operation)){
|
|
219
|
-
if(existing?.association!=='automatic'&&!completedBegin(source,existing))return respond({deny:true,missing:['execution-begin'],reason:Recovery.instruction(['execution-begin'],{directory})});
|
|
220
|
-
const checked=X.check(directory,stage,require('./native-pilot-lib.cjs'));
|
|
221
|
-
if(checked.status==='failed'){
|
|
222
|
-
const missing=Recovery.missing({source,binding:existing,policy:fixed,stage});if(!missing.length)missing.push('execution-evidence');
|
|
223
|
-
return respond({deny:true,missing,reason:Recovery.instruction(missing,{directory,automatic:existing?.association==='automatic'})+' '+checked.errors.join('; ')});
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
if(G.uiWrite({name:payload.tool_name,input:payload.tool_input||{},cwd},directory)||stage&&['PreToolUse','PostToolUse'].includes(options.event)){
|
|
227
|
-
const recovery=respond({continue:true});if(recovery.deny||recovery.feedback||recovery.context)return recovery;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
if(!Object.keys(index.bindings).length)return {continue:true};
|
|
231
|
-
const lock=path.join(stateDirectory,'.audit.lock');fs.mkdirSync(stateDirectory,{recursive:true});
|
|
232
|
-
try{fs.mkdirSync(lock);}catch(error){if(error.code==='EEXIST')throw new Error('Concurrent audit callback; no success evidence recorded. Retry the stage.');throw error;}
|
|
233
|
-
try {
|
|
234
|
-
const fresh=JSON.parse(C.read(file));let changed=false;
|
|
235
|
-
for(const entry of Object.values(fresh.bindings)) {
|
|
236
|
-
if(entry.contextLine!==source.contextLine)continue;
|
|
237
|
-
if(entry.lastEventKey===eventKey)continue;
|
|
238
|
-
entry.source={path:source.path,bytes:source.bytes,digest:source.digest};entry.lastEventKey=eventKey;entry.lastHook={event:options.event,at:new Date().toISOString(),nativeReadAttempts:source.nativeReadAttempts,nativeRequestStatus:source.nativeRequestStatus};changed=true;
|
|
239
|
-
if(options.event==='Stop') {
|
|
240
|
-
// Completion of an unrelated task must not trigger delivery of every
|
|
241
|
-
// prototype previously visited in the session. Inspect actual operations
|
|
242
|
-
// in this response, without another task lifecycle or activation flag.
|
|
243
|
-
const workedOn=source.calls.some(call=>{
|
|
244
|
-
if(call.requestLine<=latest.line)return false;
|
|
245
|
-
if(G.uiWrite({...call,cwd:call.cwd||project},entry.directory))return true;
|
|
246
|
-
const native=nativeCommand(call.name,call.input,call.cwd||project);
|
|
247
|
-
return native?.root===entry.directory&&Object.hasOwn(stageFor,native.operation);
|
|
248
|
-
});
|
|
249
|
-
if(!workedOn)continue;
|
|
250
|
-
const lib=require('./native-pilot-lib.cjs'),state=lib.state(entry.directory);
|
|
251
|
-
const complete=state.execution.status==='passed'&&state.delivery?.status==='current'&&state.delivery.result.runId===entry.runId;
|
|
252
|
-
const fixed=X.policy(entry.directory),feedback=decision({event:'Stop',source,binding:entry,directory:entry.directory,deliveryCurrent:complete,policy:fixed,restricted:options.restricted,stopHookActive:payload.stop_hook_active||entry.stopFeedbackPrompt===latest.digest});
|
|
253
|
-
if(feedback.feedback){const result=Recovery.record(fresh,{...recoveryContext(entry.directory),policy:fixed},feedback);entry.recovery=result.recovery;if(fixed.id!==P.AUTO_ID)entry.stopFeedbackPrompt=latest.digest;saveIndex(stateDirectory,fresh);return result;}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if(changed)saveIndex(stateDirectory,fresh);
|
|
257
|
-
}finally{fs.rmdirSync(lock);}
|
|
258
|
-
return {continue:true};
|
|
259
|
-
}
|
|
260
|
-
function handle(payload,options){
|
|
261
|
-
const D=require('./execution-diagnostics.cjs');
|
|
262
|
-
payload={...payload,tool_name:toolName(payload.tool_name)};
|
|
263
|
-
let diagnostic;
|
|
264
|
-
try{
|
|
265
|
-
if(options.event==='UserPromptSubmit')D.remember(payload,options);
|
|
266
|
-
diagnostic=D.context(payload,options);
|
|
267
|
-
}catch{/* The authoritative dispatcher still checks registration and identity. */}
|
|
268
|
-
const toolEvent=['PreToolUse','PostToolUse'].includes(options.event);
|
|
269
|
-
const cwd=diagnostic&&toolCwd(payload,diagnostic.record,diagnostic.project);
|
|
270
|
-
const command=diagnostic&&nativeCommand(payload.tool_name,payload.tool_input,cwd);
|
|
271
|
-
const root=diagnostic&&(command?.root||prototypeForWrite(diagnostic.project,payload.tool_name,payload.tool_input,cwd));
|
|
272
|
-
const mutation=command&&['create','execution-begin','build','revise','replan','record-run','record-devtools-review','finalize'].includes(command.operation)||root&&G.uiWrite({name:payload.tool_name,input:payload.tool_input||{},cwd},root);
|
|
273
|
-
if(diagnostic&&toolEvent&&['Write','Edit','MultiEdit'].includes(payload.tool_name)&&!mutation)return {continue:true};
|
|
274
|
-
if(diagnostic?.task.restriction.blocked&&toolEvent&&mutation)return options.event==='PreToolUse'?{deny:true,reason:'The user explicitly requested read-only work or stopped implementation; no prototype mutation is authorized.'}:{continue:true};
|
|
275
|
-
try{
|
|
276
|
-
const answer=dispatch(payload,diagnostic?{...options,nativeProject:diagnostic.project,restricted:diagnostic.task.restriction.blocked}:options);
|
|
277
|
-
if(toolEvent&&!answer.deny&&!answer.feedback){if(mutation)D.recover(diagnostic);D.observed(diagnostic,payload);}
|
|
278
|
-
return answer;
|
|
279
|
-
}catch(error){
|
|
280
|
-
if(diagnostic)return mutation?D.failure(diagnostic,payload,error):{continue:true};
|
|
281
|
-
if(options.event==='PreToolUse') {
|
|
282
|
-
// A damaged/absent task source must not turn a protected write into exit 1
|
|
283
|
-
// (which CodeBuddy treats as non-blocking). This is a failure-only fallback,
|
|
284
|
-
// not a successful task association or invocation receipt.
|
|
285
|
-
const cwd=payload.cwd==='/'&&options.scope==='project'?path.dirname(options.base):payload.cwd;
|
|
286
|
-
if(cwd&&path.isAbsolute(cwd)) {
|
|
287
|
-
const parsed=nativeCommand(payload.tool_name,payload.tool_input,cwd),input=payload.tool_input||{},file=input.file_path||input.filePath||input.path||input.TargetFile;
|
|
288
|
-
let target=typeof file==='string'?path.dirname(path.resolve(cwd,file)):parsed?.root;
|
|
289
|
-
while(target&&target!==path.dirname(target)) {
|
|
290
|
-
if(fs.existsSync(path.join(target,'prototype.json'))&&X.policy(target)&&(parsed||G.uiWrite({name:payload.tool_name,input,cwd},target)))return {deny:true,reason:'原型 Hook 运行异常,当前操作未放行:'+error.message+'。请停止自动重试并交由维护入口处理;原型会话不排查 Hook。'};
|
|
291
|
-
target=path.dirname(target);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
throw error;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
module.exports={tokens,nativeCommand,eventCall,eventSource,decision,safeProject,toolCwd,handle};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
// Observed CodeBuddy IDE history format: Hook-provided index.json and only the
|
|
3
|
-
// UUID message files explicitly referenced by that index. No directory scan.
|
|
4
|
-
const fs=require('node:fs'),path=require('node:path'),assert=require('node:assert/strict');
|
|
5
|
-
const ID=/^[a-f0-9]{32}$/;
|
|
6
|
-
const {toolName}=require('./native-tool-name.cjs');
|
|
7
|
-
function read(file) {
|
|
8
|
-
assert.equal(path.basename(file),'index.json','Expected native IDE index');
|
|
9
|
-
const directory=path.dirname(file),sessionId=path.basename(directory);
|
|
10
|
-
assert.match(sessionId,ID,'Invalid IDE session directory');
|
|
11
|
-
let total=0;
|
|
12
|
-
const load=target=>{
|
|
13
|
-
const stat=fs.lstatSync(target);assert.ok(stat.isFile()&&!stat.isSymbolicLink(),'Invalid IDE history file');
|
|
14
|
-
total+=stat.size;assert.ok(total<=64*1024*1024,'IDE history exceeds size limit');
|
|
15
|
-
return JSON.parse(fs.readFileSync(target,'utf8'));
|
|
16
|
-
};
|
|
17
|
-
const index=load(file);assert.ok(Array.isArray(index.messages)&&Array.isArray(index.requests),'Unsupported IDE index');
|
|
18
|
-
assert.ok(index.messages.length<=10000&&index.requests.length<=10000,'IDE history index exceeds limit');
|
|
19
|
-
const folder=path.join(directory,'messages');assert.ok(fs.lstatSync(folder).isDirectory()&&!fs.lstatSync(folder).isSymbolicLink(),'Invalid IDE message directory');
|
|
20
|
-
const requestIds=new Map(),seen=new Set(),events=[];let latestAssistant='',workspace;
|
|
21
|
-
for(const request of index.requests){
|
|
22
|
-
assert.match(request.id,ID,'Invalid IDE request ID');assert.ok(Array.isArray(request.messages),'Invalid IDE request messages');
|
|
23
|
-
for(const id of request.messages){assert.match(id,ID,'Invalid IDE message reference');assert.ok(!requestIds.has(id),'Duplicate IDE message request');requestIds.set(id,request.id);}
|
|
24
|
-
}
|
|
25
|
-
for(const item of index.messages){
|
|
26
|
-
assert.match(item.id,ID,'Invalid IDE message ID');assert.ok(!seen.has(item.id),'Duplicate IDE message ID');seen.add(item.id);
|
|
27
|
-
const row=load(path.join(folder,item.id+'.json'));
|
|
28
|
-
assert.equal(row.id,item.id,'IDE message identity differs');assert.equal(row.role,item.role,'IDE message role differs');
|
|
29
|
-
const message=JSON.parse(row.message),extra=JSON.parse(row.extra||'{}');
|
|
30
|
-
assert.equal(message.role,row.role,'IDE serialized message role differs');
|
|
31
|
-
assert.ok(requestIds.has(item.id),'Unbound IDE message');
|
|
32
|
-
// The index is the primary request membership. During execution the SDK can
|
|
33
|
-
// write message content before its duplicate extra.requestId metadata.
|
|
34
|
-
const requestId=requestIds.get(item.id);
|
|
35
|
-
if(extra.requestId!==undefined)assert.equal(extra.requestId,requestId,'IDE request identity differs');
|
|
36
|
-
assert.ok(Array.isArray(message.content),'Invalid IDE message content');
|
|
37
|
-
const base={sessionId,nativeMessageId:item.id,nativeRequestId:requestId};
|
|
38
|
-
if(row.role==='user'&&!extra.isHelperMessage){
|
|
39
|
-
const hostText=message.content[0]?.type==='text'?message.content[0].text:'';
|
|
40
|
-
const context=typeof hostText==='string'?hostText.match(/^<user_info>\s*([\s\S]*?)<\/user_info>/):null;
|
|
41
|
-
const nativeFolder=context?.[1].match(/^Workspace Folder:\s*(\/[^\r\n]+)$/m)?.[1]?.trim();
|
|
42
|
-
if(nativeFolder){
|
|
43
|
-
assert.ok(path.isAbsolute(nativeFolder)&&!/[\x00\r\n]/.test(nativeFolder),'Invalid native IDE workspace');
|
|
44
|
-
if(workspace)assert.equal(workspace,nativeFolder,'Native IDE workspace changed within one session');
|
|
45
|
-
workspace=nativeFolder;
|
|
46
|
-
}
|
|
47
|
-
assert.ok(Array.isArray(extra.sourceContentBlocks),'Original IDE user task is missing');
|
|
48
|
-
const text=extra.sourceContentBlocks.filter(b=>b.type==='text'&&typeof b.text==='string').map(b=>b.text).join('\n');
|
|
49
|
-
if(text.trim())events.push({...base,type:'user',message:{content:[{type:'text',text}]}});
|
|
50
|
-
}else if(row.role==='assistant'){
|
|
51
|
-
const text=message.content.filter(b=>b.type==='text').map(b=>b.text||'').join('\n');
|
|
52
|
-
if(text)latestAssistant=text;
|
|
53
|
-
for(const block of message.content.filter(b=>b.type==='tool-call')){
|
|
54
|
-
assert.ok(block.args&&typeof block.args==='object'&&!Array.isArray(block.args),'Invalid IDE tool arguments');
|
|
55
|
-
events.push({...base,type:'assistant',message:{content:[{type:'tool_use',id:block.toolCallId,name:toolName(block.toolName),input:block.args}]}});
|
|
56
|
-
}
|
|
57
|
-
}else if(row.role==='tool'){
|
|
58
|
-
for(const block of message.content.filter(b=>b.type==='tool-result')){
|
|
59
|
-
const result=block.result,success=!block.isError&&result?.success===true&&result.status==='success';
|
|
60
|
-
events.push({...base,type:'user',message:{content:[{type:'tool_result',tool_use_id:block.toolCallId,
|
|
61
|
-
tool_name:toolName(block.toolName),content:result,is_error:!success}]}});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// Only stable prompt/call/result facts form the prefix cursor. Streaming text,
|
|
66
|
-
// reasoning, request state and mutable toolStatus do not invalidate old facts.
|
|
67
|
-
return {text:events.map(row=>JSON.stringify(row)).join('\n')+'\n',latestAssistant,workspace,format:'codebuddy-ide-index-v1'};
|
|
68
|
-
}
|
|
69
|
-
module.exports={read};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
// Pure configuration planning. This module does not install or activate a host.
|
|
3
|
-
const assert = require('node:assert/strict');
|
|
4
|
-
const path = require('node:path');
|
|
5
|
-
const fs = require('node:fs');
|
|
6
|
-
const crypto = require('node:crypto');
|
|
7
|
-
const { digest } = require('./execution-policy.cjs');
|
|
8
|
-
const OWNER = 'i3-prototype-codebuddy-v1';
|
|
9
|
-
const EVENTS = ['SessionStart', 'UserPromptSubmit', 'PreToolUse', 'PostToolUse', 'Stop'];
|
|
10
|
-
function quote(value) {
|
|
11
|
-
assert.ok(typeof value === 'string' && !/[\x00\r\n]/.test(value), 'Unsafe Hook argument');
|
|
12
|
-
return "'" + value.replaceAll("'", "'\\''") + "'";
|
|
13
|
-
}
|
|
14
|
-
function config(text) {
|
|
15
|
-
if (text === null) return {};
|
|
16
|
-
let value; try { value = JSON.parse(text); } catch { throw new Error('Settings must be valid JSON; preserve the original file'); }
|
|
17
|
-
assert.ok(value && !Array.isArray(value) && typeof value === 'object', 'Settings must be a JSON object');
|
|
18
|
-
assert.ok(!value.hooks || (typeof value.hooks === 'object' && !Array.isArray(value.hooks)), 'Invalid hooks configuration');
|
|
19
|
-
for (const groups of Object.values(value.hooks || {})) {
|
|
20
|
-
assert.ok(Array.isArray(groups), 'Hook groups must be arrays');
|
|
21
|
-
for (const group of groups) assert.ok(group && Array.isArray(group.hooks), 'Invalid Hook group');
|
|
22
|
-
}
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
function ownedMarker(group) { return group.hooks.some(hook => typeof hook.command === 'string' && hook.command.includes(OWNER)); }
|
|
26
|
-
function plan(options) {
|
|
27
|
-
const { action = 'keep', scope, product = 'auto', base, project, nodePath, scriptPath, scriptDigest, currentText = null, record = null,
|
|
28
|
-
transcriptRoots = record?.transcriptRoots || [], transcriptMode = record?.transcriptMode || (transcriptRoots.length ? 'manual' : 'auto'), productVersion = record?.productVersion || 'unreported' } = options;
|
|
29
|
-
assert.ok(['keep', 'enable', 'disable'].includes(action), 'Invalid Hook action');
|
|
30
|
-
assert.ok(['project', 'global'].includes(scope), 'Invalid installation scope');
|
|
31
|
-
assert.ok(['auto', 'ide', 'cli'].includes(product), 'Use automatic product detection, or a legacy ide/cli profile');
|
|
32
|
-
const hosts=[...new Set(options.hosts || [...(record?.hosts || (record ? ['codebuddy'] : [])),...(options.agents?.filter(host=>['codebuddy','workbuddy'].includes(host)) || [options.host || 'codebuddy'])])].sort();
|
|
33
|
-
assert.ok((hosts.length||action==='disable')&&hosts.every(host=>['codebuddy','workbuddy'].includes(host)), 'Unsupported prototype Hook host');
|
|
34
|
-
for (const item of [base, project, nodePath, scriptPath]) assert.ok(typeof item === 'string' && path.isAbsolute(item) && !/[\x00\r\n]/.test(item), 'Absolute safe registration paths required');
|
|
35
|
-
if (process.platform === 'win32' && action !== 'disable') throw new Error('CodeBuddy A+B Windows Hook quoting is not yet verified');
|
|
36
|
-
const before = config(currentText), after = structuredClone(before), activeRecord = record && record.owner === OWNER ? record : null;
|
|
37
|
-
if (record) {
|
|
38
|
-
assert.ok(activeRecord && [1,2].includes(activeRecord.schemaVersion), 'Unknown registration ownership');
|
|
39
|
-
assert.equal(activeRecord.scope, scope, 'Registration scope changed');
|
|
40
|
-
if(product!=='auto')assert.equal(activeRecord.product, product, 'Disable the previous product profile before changing it');
|
|
41
|
-
assert.equal(activeRecord.base, base, 'Registration base changed');
|
|
42
|
-
}
|
|
43
|
-
const found = {};
|
|
44
|
-
for (const [event, groups] of Object.entries(after.hooks || {})) {
|
|
45
|
-
for (const group of groups.filter(ownedMarker)) {
|
|
46
|
-
assert.ok(activeRecord?.groups[event], 'Hook ownership is missing; do not adopt an unknown command');
|
|
47
|
-
assert.deepEqual(group, activeRecord.groups[event], 'Owned Hook was modified; preserve the user changes');
|
|
48
|
-
assert.ok(!found[event], 'Duplicate owned Hook registration'); found[event] = group;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (activeRecord) for (const event of Object.keys(activeRecord.groups)) assert.ok(found[event], 'Owned Hook registration changed or is missing');
|
|
52
|
-
const unchanged = action === 'keep' && !activeRecord;
|
|
53
|
-
let recordAfter = null;
|
|
54
|
-
if (!unchanged) {
|
|
55
|
-
after.hooks ||= {};
|
|
56
|
-
for (const event of Object.keys(found)) after.hooks[event] = after.hooks[event].filter(group => group !== found[event]);
|
|
57
|
-
if (action !== 'disable') {
|
|
58
|
-
assert.match(scriptDigest || '', /^[a-f0-9]{64}$/, 'Hook script digest required');
|
|
59
|
-
const groups = {};
|
|
60
|
-
for (const event of EVENTS) {
|
|
61
|
-
const argv = [nodePath, scriptPath, '--registration', OWNER, '--base', base, '--scope', scope, '--product', product, '--event', event];
|
|
62
|
-
const group = { ...(event.endsWith('ToolUse') ? { matcher: '' } : {}), hooks: [{ type: 'command', command: argv.map(quote).join(' '), timeout: 10 }] };
|
|
63
|
-
groups[event] = group; (after.hooks[event] ||= []).push(group);
|
|
64
|
-
}
|
|
65
|
-
assert.ok(Array.isArray(transcriptRoots)&&transcriptRoots.every(root=>typeof root==='string'&&path.isAbsolute(root)&&!/[\x00\r\n]/.test(root)),'Absolute native transcript roots required');
|
|
66
|
-
assert.ok(['auto','manual'].includes(transcriptMode),'Invalid native transcript mode');
|
|
67
|
-
assert.ok(transcriptMode==='manual'?transcriptRoots.length>0:transcriptRoots.length===0,'Manual transcript mode requires roots; auto uses only the native callback file');
|
|
68
|
-
recordAfter = { schemaVersion: product==='auto'?2:1, owner: OWNER, scope, product, ...(product==='auto'?{hosts}:{}), base, scriptPath, scriptDigest, nodePath, groups, transcriptMode, transcriptRoots, productVersion };
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
const afterText = unchanged ? currentText : JSON.stringify(after, null, 2) + '\n';
|
|
72
|
-
return { action, scope, product, base, project, settingsPath: path.join(base, 'settings.json'),
|
|
73
|
-
recordPath: path.join(base, 'state/i3-prototype/installation.json'), beforeDigest: digest(currentText), beforeRecordDigest: digest(record), afterText, recordAfter,
|
|
74
|
-
summary: { status: unchanged || action === 'disable' ? 'not-enabled' : product === 'cli' ? 'pending-host-review' : 'registered',
|
|
75
|
-
...(recordAfter?{transcript:{mode:transcriptMode,status:'awaiting-native-event',invocationVerified:false}}:{}),
|
|
76
|
-
scope, product, settingsPath: path.join(base, 'settings.json'), events: recordAfter ? EVENTS : [], changed: afterText !== currentText || digest(recordAfter)!==digest(record),
|
|
77
|
-
next: product === 'cli' && recordAfter ? 'Review the external settings change in CodeBuddy /hooks; then start a new session.' : 'Actual Hook invocation must be checked in the host; registration is not activation.' } };
|
|
78
|
-
}
|
|
79
|
-
function safePath(file) {
|
|
80
|
-
let current = path.parse(path.resolve(file)).root;
|
|
81
|
-
for (const part of path.resolve(file).slice(current.length).split(path.sep)) {
|
|
82
|
-
current = path.join(current, part);
|
|
83
|
-
if (fs.existsSync(current)) assert.ok(!fs.lstatSync(current).isSymbolicLink(), 'Hook settings symlink refused');
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
const fileIO = {
|
|
87
|
-
lock(file) {safePath(file);fs.mkdirSync(path.dirname(file),{recursive:true});const lock=file+'.i3-prototype.lock';try{fs.mkdirSync(lock);}catch{throw new Error('Hook configuration is being updated; retry without overwriting the other change');}return ()=>fs.rmdirSync(lock);},
|
|
88
|
-
read(file) {
|
|
89
|
-
safePath(file); if (!fs.existsSync(file)) return null;
|
|
90
|
-
assert.ok(fs.statSync(file).isFile() && fs.statSync(file).size <= 4 * 1024 * 1024, 'Invalid or oversized Hook configuration');
|
|
91
|
-
return fs.readFileSync(file, 'utf8');
|
|
92
|
-
},
|
|
93
|
-
write(file, text, expected) {
|
|
94
|
-
assert.equal(digest(this.read(file)), expected, 'Hook configuration changed concurrently');
|
|
95
|
-
if (text === null) { if (fs.existsSync(file)) fs.unlinkSync(file); return; }
|
|
96
|
-
fs.mkdirSync(path.dirname(file), { recursive: true }); safePath(file);
|
|
97
|
-
const staging = file + '.' + crypto.randomUUID() + '.new';
|
|
98
|
-
try {
|
|
99
|
-
fs.writeFileSync(staging, text, { flag: 'wx', mode: fs.existsSync(file) ? fs.statSync(file).mode & 0o777 : 0o600 });
|
|
100
|
-
assert.equal(digest(this.read(file)), expected, 'Hook configuration changed before publication');
|
|
101
|
-
fs.renameSync(staging, file);
|
|
102
|
-
} finally { if (fs.existsSync(staging)) fs.unlinkSync(staging); }
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
function apply(change, io = fileIO) {
|
|
106
|
-
const unlock=io.lock?io.lock(change.settingsPath):()=>{};
|
|
107
|
-
try {return applyLocked(change,io);}finally{unlock();}
|
|
108
|
-
}
|
|
109
|
-
function applyLocked(change, io) {
|
|
110
|
-
const before = io.read(change.settingsPath), recordBefore = io.read(change.recordPath);
|
|
111
|
-
assert.equal(digest(before), change.beforeDigest, 'Hook configuration changed after preview');
|
|
112
|
-
assert.equal(digest(recordBefore === null ? null : JSON.parse(recordBefore)), change.beforeRecordDigest, 'Hook ownership changed after preview');
|
|
113
|
-
const recordAfter = change.recordAfter ? JSON.stringify(change.recordAfter, null, 2) + '\n' : null;
|
|
114
|
-
if (change.afterText === before && recordAfter === recordBefore) return change.summary;
|
|
115
|
-
let settingsWritten = false;
|
|
116
|
-
try {
|
|
117
|
-
if (change.afterText !== before) { io.write(change.settingsPath, change.afterText, digest(before)); settingsWritten = true; }
|
|
118
|
-
if (recordAfter !== recordBefore) io.write(change.recordPath, recordAfter, digest(recordBefore));
|
|
119
|
-
} catch (error) {
|
|
120
|
-
if (settingsWritten && io.read(change.settingsPath) === change.afterText) io.write(change.settingsPath, before, digest(change.afterText));
|
|
121
|
-
throw error;
|
|
122
|
-
}
|
|
123
|
-
return change.summary;
|
|
124
|
-
}
|
|
125
|
-
module.exports = { OWNER, EVENTS, quote, config, plan, apply, fileIO };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const fs = require('node:fs');
|
|
3
|
-
const path = require('node:path');
|
|
4
|
-
const assert = require('node:assert/strict');
|
|
5
|
-
const read = file => JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
6
|
-
|
|
7
|
-
function extract(directory, manifest, files) {
|
|
8
|
-
assert.equal(manifest.entry, 'index.html', 'Content templates use the offline index.html convention');
|
|
9
|
-
const html = fs.readFileSync(path.join(directory, manifest.entry), 'utf8');
|
|
10
|
-
assert.ok(!/<script\b[^>]*type=["']module/i.test(html), 'Offline entry cannot use modules');
|
|
11
|
-
const routesMatch = html.match(/id="prototype-offline-routes">([\s\S]*?)<\/script>/);
|
|
12
|
-
assert.ok(routesMatch, 'Editable route inventory is required');
|
|
13
|
-
const routes = JSON.parse(routesMatch[1]);
|
|
14
|
-
const fragments = new Map([...html.matchAll(/^<template data-source="([^"]+)">\n([\s\S]*?)^<\/template>/gm)].map(match => [match[1], match[2]]));
|
|
15
|
-
assert.ok(fragments.size, 'Editable HTML fragments are required');
|
|
16
|
-
const resources = [];
|
|
17
|
-
for (const match of html.matchAll(/<(script|link)\b[^>]*\b(src|href)="([^"]+)"/gi)) {
|
|
18
|
-
if (match[3].startsWith('data:')) continue;
|
|
19
|
-
assert.ok(!/^(?:[a-z]+:|\/)/i.test(match[3]) && !match[3].split('/').includes('..'), 'Offline resources must remain inside the template');
|
|
20
|
-
const resource = match[3].split(/[?#]/)[0];
|
|
21
|
-
assert.ok(files.some(file => file.path === resource), `Offline resource missing: ${resource}`);
|
|
22
|
-
resources.push({ file: manifest.entry, path: resource });
|
|
23
|
-
if (match[1].toLowerCase() === 'script') {
|
|
24
|
-
const script = fs.readFileSync(path.join(directory, resource), 'utf8');
|
|
25
|
-
assert.ok(!/\bfetch\s*\(|\bXMLHttpRequest\b|\bimport\s*(?:\(|["'{*])|\bfrom\s*["']/.test(script), 'Offline runtime cannot load modules or remote HTML');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const pages = [...new Set(routes.map(route => route.component).filter(Boolean))].map(component => {
|
|
29
|
-
const fragment = 'reference/' + component.replace(/^\.\//, '').replace(/\.js$/, '.html');
|
|
30
|
-
assert.ok(fragments.has(fragment), `Missing page HTML: ${fragment}`);
|
|
31
|
-
const title = fragments.get(fragment).match(/<h1[^>]*>([^<{]+)<\/h1>/)?.[1]?.trim();
|
|
32
|
-
return { id: path.posix.basename(component, '.js').replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase(),
|
|
33
|
-
title: title || path.posix.basename(component, '.js'), file: 'index.html', fragment,
|
|
34
|
-
routes: routes.filter(route => route.component === component).map(route => route.path) };
|
|
35
|
-
});
|
|
36
|
-
assert.equal(new Set(pages.map(page => page.id)).size, pages.length, 'Duplicate content page identity');
|
|
37
|
-
return { kind: 'content-reference', pages, regions: [], bindings: [], fields: [], actions: [], resources,
|
|
38
|
-
htmlFragments: [...fragments.keys()], routes, requiredBindings: [], requiredScenarios: [] };
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function scopeInputs(snapshot, scope, contract) {
|
|
42
|
-
assert.ok(Array.isArray(scope?.pages) && scope.pages.length, 'Provide sourced PRD scope.pages; the reference is not the business requirement');
|
|
43
|
-
assert.ok(scope.requirements?.length, 'Provide sourced business requirements');
|
|
44
|
-
const known = new Set(snapshot.index.pages.map(page => page.id));
|
|
45
|
-
const seen = new Set(['app-shell']), regions = [{ pageId: 'app-shell', id: 'appearance', mode: 'application-shell' }], bindings = [];
|
|
46
|
-
const defaults = {
|
|
47
|
-
theme: { defaultTheme: 'light', presets: ['light', 'dark', 'fresh', 'tech'] },
|
|
48
|
-
filter: { resetPage: true, clearSelection: true }, selection: { strategy: 'current-page-clear-on-change' },
|
|
49
|
-
pagination: { mode: 'adjustable', defaultPageSize: 10, pageSizeOptions: [10, 20, 50], minimumTestPages: 3 },
|
|
50
|
-
bulk: { target: 'selected-only' }, edit: { presentation: 'drawer', preserveOnFailure: true },
|
|
51
|
-
};
|
|
52
|
-
for (const page of scope.pages) {
|
|
53
|
-
assert.match(page.id || '', /^[a-z][a-z0-9-]{0,63}$/);
|
|
54
|
-
assert.ok(!seen.has(page.id), `Duplicate business page: ${page.id}`); seen.add(page.id);
|
|
55
|
-
assert.ok(page.title?.trim() && known.has(page.referencePage), `Missing explicit template reference page: ${page.id}`);
|
|
56
|
-
assert.ok(page.regions?.length, `Declare the actual region modes: ${page.id}`);
|
|
57
|
-
for (const region of page.regions) {
|
|
58
|
-
assert.match(region.id || '', /^[a-z][a-z0-9-]{0,63}$/);
|
|
59
|
-
assert.ok(['management-list', 'edit-form', 'content'].includes(region.mode) || (scope.schemaVersion === 3 && require('./generation-contract.cjs').resource(snapshot, 'generation.json').patterns.includes(region.pattern || region.mode)), `Unknown business region mode: ${region.mode}`);
|
|
60
|
-
regions.push({ pageId: page.id, id: region.id, mode: scope.schemaVersion === 3 ? 'content' : region.mode });
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
for (const region of regions) for (const capability of snapshot.definition.capabilities) {
|
|
64
|
-
if (capability.requirement !== 'required' || !capability.appliesTo.includes(region.mode)) continue;
|
|
65
|
-
const configured = scope.pages.find(page => page.id === region.pageId)?.regions.find(item => item.id === region.id)?.parameters?.[capability.id];
|
|
66
|
-
const parameters = configured || (capability.id === 'feedback'
|
|
67
|
-
? { states: region.mode === 'edit-form' ? ['loading', 'error', 'success'] : ['loading', 'empty', 'error', 'success'] }
|
|
68
|
-
: defaults[capability.id]);
|
|
69
|
-
bindings.push({ id: `${region.pageId}/${region.id}/${capability.id}`, pageId: region.pageId, regionId: region.id, capabilityId: capability.id, parameters });
|
|
70
|
-
}
|
|
71
|
-
const requirementIds = new Set();
|
|
72
|
-
for (const requirement of scope.requirements) {
|
|
73
|
-
assert.ok(typeof requirement.id==='string'&&requirement.id.trim()&&!requirementIds.has(requirement.id), `Missing or duplicate requirement identity: ${requirement.id}`);
|
|
74
|
-
requirementIds.add(requirement.id);
|
|
75
|
-
assert.ok(requirement.pages?.length && requirement.pages.every(page => seen.has(page) && page !== 'app-shell'), `Map each business requirement to its pages: ${requirement.id}`);
|
|
76
|
-
}
|
|
77
|
-
for (const page of scope.pages) assert.ok(scope.requirements.some(requirement => requirement.pages?.includes(page.id)), `Business page lacks a requirement: ${page.id}`);
|
|
78
|
-
const fixed = { schemaVersion: 1, definition: snapshot.definition, regions, bindings, decisions: scope.decisions || [] };
|
|
79
|
-
assert.ok(!fixed.decisions.some(decision=>decision.bindingId==='app-shell/appearance/theme'&&decision.status==='not-applicable'), 'The default four-theme contract must retain its acceptance');
|
|
80
|
-
const result = contract.checkCapabilities({ ...fixed, scope });
|
|
81
|
-
assert.equal(result.status, 'passed', result.errors.join('; '));
|
|
82
|
-
return { fixed, result };
|
|
83
|
-
}
|
|
84
|
-
function checkInputs(inputsRoot, contract) {
|
|
85
|
-
const snapshot = read(path.join(inputsRoot, 'template-snapshot.json')), scope = read(path.join(inputsRoot, 'scope.json'));
|
|
86
|
-
const expected = scopeInputs(snapshot, scope, contract), fixed = read(path.join(inputsRoot, 'capabilities.json'));
|
|
87
|
-
assert.deepEqual(fixed, expected.fixed, 'Business capability bindings differ from the fixed sourced page/region contract');
|
|
88
|
-
return expected.result;
|
|
89
|
-
}
|
|
90
|
-
function pageContent(snapshot, pageId) {
|
|
91
|
-
assert.equal(snapshot.kind, 'content-reference');
|
|
92
|
-
const page = snapshot.index.pages.find(entry=>entry.id===pageId);
|
|
93
|
-
assert.ok(page, `Unknown reference page: ${pageId}`);
|
|
94
|
-
const html = Buffer.from(snapshot.files.find(file=>file.path==='index.html').content, 'base64').toString('utf8');
|
|
95
|
-
const fragments = new Map([...html.matchAll(/^<template data-source="([^"]+)">\n([\s\S]*?)^<\/template>/gm)].map(match=>[match[1],match[2]]));
|
|
96
|
-
return { ...page, html: fragments.get(page.fragment), templateDigest: snapshot.digest, readOnly: true };
|
|
97
|
-
}
|
|
98
|
-
module.exports = { extract, scopeInputs, checkInputs, pageContent };
|