yugoo-design 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/bin/npm-desktop-preparation.mjs +5 -0
- package/package.json +20 -2
- package/payload/desktop-preparation/materials.json +180 -2
- package/payload/desktop-preparation/qwenwork-package.mjs +4 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/index.md +143 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/material.json +1 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
- package/payload/desktop-preparation/qwenwork-template/skills/design-bundle-creator/SKILL.md +19 -0
- package/payload/desktop-preparation/qwenwork-template/skills/design-kit-creator/SKILL.md +19 -0
- package/payload/desktop-preparation/qwenwork-template/skills/design-skill-creator/SKILL.md +19 -0
- package/payload/desktop-preparation/src/browser-access.mjs +6 -9
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/index.md +143 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/material.json +1 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
- package/payload/desktop-preparation/studio-authoring-template/skills/design-bundle-creator/SKILL.md +19 -0
- package/payload/desktop-preparation/studio-authoring-template/skills/design-kit-creator/SKILL.md +19 -0
- package/payload/desktop-preparation/studio-authoring-template/skills/design-skill-creator/SKILL.md +19 -0
- package/payload/overlays/claude-code/.claude-plugin/plugin.json +1 -1
- package/payload/overlays/claude-code/authoring/studio-creators/index.md +143 -0
- package/payload/overlays/claude-code/authoring/studio-creators/material.json +1 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
- package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
- package/payload/overlays/claude-code/skills/design-bundle-creator/SKILL.md +19 -0
- package/payload/overlays/claude-code/skills/design-kit-creator/SKILL.md +19 -0
- package/payload/overlays/claude-code/skills/design-skill-creator/SKILL.md +19 -0
- package/payload/overlays/codex/.codex-plugin/plugin.json +1 -1
- package/payload/overlays/codex/authoring/studio-creators/index.md +143 -0
- package/payload/overlays/codex/authoring/studio-creators/material.json +1 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
- package/payload/overlays/codex/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
- package/payload/overlays/codex/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
- package/payload/overlays/codex/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
- package/payload/overlays/codex/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
- package/payload/overlays/codex/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
- package/payload/overlays/codex/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
- package/payload/overlays/codex/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
- package/payload/overlays/codex/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
- package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
- package/payload/overlays/codex/skills/design-bundle-creator/SKILL.md +19 -0
- package/payload/overlays/codex/skills/design-kit-creator/SKILL.md +19 -0
- package/payload/overlays/codex/skills/design-panel/SKILL.md +5 -0
- package/payload/overlays/codex/skills/design-skill-creator/SKILL.md +19 -0
- package/payload/overlays/codex/skills/yugoo/SKILL.md +34 -1
- package/payload/overlays/qoder/.qoder-plugin/plugin.json +1 -1
- package/payload/overlays/qoder/authoring/studio-creators/index.md +143 -0
- package/payload/overlays/qoder/authoring/studio-creators/material.json +1 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
- package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
- package/payload/overlays/qoder/skills/design-bundle-creator/SKILL.md +19 -0
- package/payload/overlays/qoder/skills/design-kit-creator/SKILL.md +19 -0
- package/payload/overlays/qoder/skills/design-skill-creator/SKILL.md +19 -0
- package/payload/shared/authoring/panel-components.json +1345 -1041
- package/payload/shared/authoring/studio-creators/index.md +143 -0
- package/payload/shared/authoring/studio-creators/material.json +1 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
- package/payload/shared/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
- package/payload/shared/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
- package/payload/shared/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
- package/payload/shared/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
- package/payload/shared/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
- package/payload/shared/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
- package/payload/shared/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
- package/payload/shared/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
- package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
- package/payload/shared/bundles/ai_agent_capabilities/locales/en-US.json +1 -1
- package/payload/shared/bundles/ai_agent_capabilities/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/business_data/locales/en-US.json +1 -1
- package/payload/shared/bundles/business_data/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/business_rules/locales/en-US.json +1 -1
- package/payload/shared/bundles/business_rules/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/design_style/locales/en-US.json +1 -1
- package/payload/shared/bundles/design_style/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/flow_design/locales/en-US.json +1 -1
- package/payload/shared/bundles/flow_design/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/function_modules/locales/en-US.json +1 -2
- package/payload/shared/bundles/function_modules/locales/zh-CN.json +1 -2
- package/payload/shared/bundles/function_modules/panel.yaml +1 -1
- package/payload/shared/bundles/integration_design/locales/en-US.json +1 -1
- package/payload/shared/bundles/integration_design/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/notification_design/locales/en-US.json +1 -1
- package/payload/shared/bundles/notification_design/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/page_design/locales/en-US.json +1 -1
- package/payload/shared/bundles/page_design/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/quality_acceptance/locales/en-US.json +1 -1
- package/payload/shared/bundles/quality_acceptance/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/research/SKILL.md +38 -4
- package/payload/shared/bundles/research/locales/en-US.json +1 -1
- package/payload/shared/bundles/research/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/research/reference/artifact-contract.md +31 -0
- package/payload/shared/bundles/research/reference/preview.json +1 -1
- package/payload/shared/bundles/research/skill.yaml +1 -1
- package/payload/shared/bundles/research/validation.yaml +3 -0
- package/payload/shared/bundles/role_access/locales/en-US.json +1 -1
- package/payload/shared/bundles/role_access/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/smart_questions/locales/en-US.json +1 -1
- package/payload/shared/bundles/smart_questions/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/web_app_prd_assembly/locales/en-US.json +1 -1
- package/payload/shared/bundles/web_app_prd_assembly/locales/zh-CN.json +1 -1
- package/payload/shared/bundles/whiteboard/locales/en-US.json +1 -1
- package/payload/shared/bundles/whiteboard/locales/zh-CN.json +1 -1
- package/payload/shared/kits/web_app/kit.yaml +1 -1
- package/payload/shared/kits/web_app/mindset.md +1 -1
- package/payload/shared/knowledge/runtime-manifest.json +3 -2
- package/payload/shared/knowledge/runtime.mjs +19 -26
- package/payload/shared/scripts/{codex-connection-DuV2wtkn.mjs → codex-connection-1RvU1XCj.mjs} +115 -68
- package/payload/shared/scripts/codex-desktop-bridge.mjs +2 -2
- package/payload/shared/scripts/{connection-file-Dk1TJHgf.mjs → connection-file-CNwrHbAG.mjs} +3 -1
- package/payload/shared/scripts/{content-archive-4UdioMU9.mjs → content-archive-CnwVcuWA.mjs} +66 -22
- package/payload/shared/scripts/{core-entry-B6zaTh1o.mjs → core-entry-DESmwP78.mjs} +1121 -993
- package/payload/shared/scripts/design.mjs +136 -227
- package/payload/shared/scripts/git-runtime-check.mjs +1 -1
- package/payload/shared/scripts/knowledge-snapshot-query.mjs +1 -1
- package/payload/shared/scripts/{load-DE29wyw0.mjs → load-C-RwS23Y.mjs} +1 -1
- package/payload/shared/scripts/panel-preview-BeVRYFk1.mjs +78 -0
- package/payload/shared/scripts/{server-BoVIQm2J.mjs → server-BBHB9EQr.mjs} +423 -1462
- package/payload/shared/scripts/studio-CS5TyoYn.mjs +868 -0
- package/payload/shared/scripts/{studio-instance-composition-ClAJ72-M.mjs → studio-instance-composition-BJzYMyvV.mjs} +165 -62
- package/payload/shared/scripts/studio-instances-D-Y1WNya.mjs +1212 -0
- package/payload/shared/scripts/studio-panel-drafts-Dq171F6x.mjs +393 -0
- package/payload/shared/scripts/{windows-private-storage-DRAXaqae.mjs → windows-native-platform-DLm-tedp.mjs} +7 -150
- package/payload/shared/scripts/windows-private-storage-Q0cTolE3.mjs +149 -0
- package/payload/shared/scripts/workbuddy-panel-service.mjs +2 -2
- package/payload/shared/web/{abnfDiagram-VCTEODGH-BElHS-zE.js → abnfDiagram-VCTEODGH-B9IX6J0A.js} +3 -3
- package/payload/shared/web/{architectureDiagram-5GKGNRK7-BECL41Da.js → architectureDiagram-5GKGNRK7-BisnJYZ9.js} +5 -5
- package/payload/shared/web/{blockDiagram-I7D4REHJ-BHdPKhvo.js → blockDiagram-I7D4REHJ-B2P0WSPo.js} +9 -9
- package/payload/shared/web/{c4Diagram-7LVT6UL2-CWIbzZY_.js → c4Diagram-7LVT6UL2-D48X7taa.js} +7 -7
- package/payload/shared/web/{channel-CIc-uLOz.js → channel-BbOrJIbZ.js} +1 -1
- package/payload/shared/web/{chunk-4HAMMTFA-b3a3G6vp.js → chunk-4HAMMTFA--gjf22vn.js} +5 -5
- package/payload/shared/web/{chunk-75Z2AOVW-CRrsMd7V.js → chunk-75Z2AOVW-B2_IycTx.js} +1 -1
- package/payload/shared/web/{chunk-DU6HZSFF-DQGKOvUD.js → chunk-DU6HZSFF-U8npu9I8.js} +1 -1
- package/payload/shared/web/{chunk-F27PBJKO-CKTDAMhD.js → chunk-F27PBJKO-CTwYnE5c.js} +1 -1
- package/payload/shared/web/{chunk-GMAD6QVW-CR6pf1Wk.js → chunk-GMAD6QVW-CKC1iaEH.js} +3 -3
- package/payload/shared/web/{chunk-GVQU2GXP-Cuq0uwWc.js → chunk-GVQU2GXP-dsHcuLJt.js} +2 -2
- package/payload/shared/web/{chunk-IMKFNOWR-BIkawNBO.js → chunk-IMKFNOWR-DB9Jxepw.js} +5 -5
- package/payload/shared/web/{chunk-L3NEJ4N5-CuRR4sgK.js → chunk-L3NEJ4N5-CdduiJry.js} +5 -5
- package/payload/shared/web/{chunk-OSK3NFVY-o5AaXVbW.js → chunk-OSK3NFVY-BOueY91y.js} +6 -6
- package/payload/shared/web/{chunk-P2QGCYS3-CQGN9yCW.js → chunk-P2QGCYS3-yDDaRgcO.js} +1 -1
- package/payload/shared/web/{chunk-POPQ4Y6H-CoV8F_6L.js → chunk-POPQ4Y6H-CljBbmoJ.js} +1 -1
- package/payload/shared/web/{chunk-PWAF6VOD-DLPv7U5s.js → chunk-PWAF6VOD-CIvbnSr5.js} +1 -1
- package/payload/shared/web/{chunk-SHT3W25Y-DAA9rzEQ.js → chunk-SHT3W25Y-BtoLtpjX.js} +7 -7
- package/payload/shared/web/{chunk-SVP7TREG-CsNwZR-J.js → chunk-SVP7TREG-BZs6p27H.js} +2 -2
- package/payload/shared/web/{chunk-TICWLB2K-BkUUbwgD.js → chunk-TICWLB2K-CKuC0THI.js} +5 -5
- package/payload/shared/web/{classDiagram-ZZMXUADV-HbaRZ3Nl.js → classDiagram-ZZMXUADV-CSdRlepW.js} +13 -13
- package/payload/shared/web/{classDiagram-v2-VYDZK3BY-Bkk8o06s.js → classDiagram-v2-VYDZK3BY-B2q6X41N.js} +13 -13
- package/payload/shared/web/client.js +39072 -5906
- package/payload/shared/web/{cynefinDiagram-5FMLGOSQ-CP-tjXE5.js → cynefinDiagram-5FMLGOSQ-4N8NcsmJ.js} +3 -3
- package/payload/shared/web/{dagre-GXQ25YYZ-GUxh673_.js → dagre-GXQ25YYZ-CcOoDuJv.js} +10 -10
- package/payload/shared/web/{diagram-S7CK7UJ4-BFDH1Gbu.js → diagram-S7CK7UJ4-eOfyUI5w.js} +4 -4
- package/payload/shared/web/{diagram-UQ7AKVKN-PHM6uSDT.js → diagram-UQ7AKVKN-6SdElfMd.js} +3 -3
- package/payload/shared/web/{diagram-VSXAHHWV-C6m_LjuJ.js → diagram-VSXAHHWV-DmzS3Yhs.js} +2 -2
- package/payload/shared/web/{diagram-VX7I27RA-G0Og_1eB.js → diagram-VX7I27RA-CJ0mjzif.js} +5 -5
- package/payload/shared/web/{diagram-Z3DM3KII-DxLU0CyU.js → diagram-Z3DM3KII-b86RsB6X.js} +3 -3
- package/payload/shared/web/{dist-CpfF1Jph.js → dist-USJ_fvfj.js} +49 -49
- package/payload/shared/web/{ebnfDiagram-PWID7BFC-Dh7NgFDw.js → ebnfDiagram-PWID7BFC-BBo2ROEO.js} +3 -3
- package/payload/shared/web/{erDiagram-RLTQ6QDP-De1Ves_r.js → erDiagram-RLTQ6QDP-B7ovyDrh.js} +12 -12
- package/payload/shared/web/{excalidraw-surface-q56LZexh.js → excalidraw-surface-BAJM_4P2.js} +1 -1
- package/payload/shared/web/flowDiagram-HODETNUW-BmAFlSDM.js +16 -0
- package/payload/shared/web/{ganttDiagram-EL5Y4UJY-9UcawiqG.js → ganttDiagram-EL5Y4UJY-BF9LYJFN.js} +2 -2
- package/payload/shared/web/{gitGraphDiagram-WWUBYQGX-BYFpRlq8.js → gitGraphDiagram-WWUBYQGX-BLzvYjNu.js} +2 -2
- package/payload/shared/web/{infoDiagram-27XIBGKW-B_sYOrDT.js → infoDiagram-27XIBGKW-Cg4jV_tA.js} +2 -2
- package/payload/shared/web/{ishikawaDiagram-5VMMS53U-Dbq0pjSI.js → ishikawaDiagram-5VMMS53U-BqfEZdpO.js} +3 -3
- package/payload/shared/web/{journeyDiagram-3NMN7TZE-CzWCm5-W.js → journeyDiagram-3NMN7TZE-_QW0fOqV.js} +2 -2
- package/payload/shared/web/{kanban-definition-UXKFOSKX-BPt2iOge.js → kanban-definition-UXKFOSKX-C1qxSJso.js} +9 -9
- package/payload/shared/web/{mindmap-definition-YA3MSWOX--s-o7l9c.js → mindmap-definition-YA3MSWOX-CxX8l7QH.js} +11 -11
- package/payload/shared/web/{pegDiagram-XKGWAZYB-BtVScKlh.js → pegDiagram-XKGWAZYB-CTCTE951.js} +3 -3
- package/payload/shared/web/{pieDiagram-E7YTZNPT-BVRgxFzd.js → pieDiagram-E7YTZNPT-BVaT5mnK.js} +3 -3
- package/payload/shared/web/{quadrantDiagram-AXDQQJYC-CoI_hWsn.js → quadrantDiagram-AXDQQJYC-DC6iypTQ.js} +1 -1
- package/payload/shared/web/{railroadDiagram-O6MQD6OU-CQvkXn2E.js → railroadDiagram-O6MQD6OU-CKk1xSyC.js} +3 -3
- package/payload/shared/web/{requirementDiagram-BXWQKSXE-BeMX6Y3_.js → requirementDiagram-BXWQKSXE-D3r71qoR.js} +11 -11
- package/payload/shared/web/{sankeyDiagram-P5KCCOFB-DAW2tMQQ.js → sankeyDiagram-P5KCCOFB-BtB3K5ob.js} +1 -1
- package/payload/shared/web/{sequenceDiagram-WJ2MYXX4-CIyt6uFH.js → sequenceDiagram-WJ2MYXX4-BsJtFrjU.js} +4 -4
- package/payload/shared/web/{stateDiagram-D77RDMKH-Cl5YhtvO.js → stateDiagram-D77RDMKH-srvF-8IQ.js} +13 -13
- package/payload/shared/web/{stateDiagram-v2-MP3YSRHH-BsQEmOAZ.js → stateDiagram-v2-MP3YSRHH-CQCPpAb7.js} +13 -13
- package/payload/shared/web/{swimlanes-42K2YHIH-DRkfAovZ.js → swimlanes-42K2YHIH-cwCdwOb4.js} +10 -10
- package/payload/shared/web/{swimlanesDiagram-VR7AAH4N-CDtUk-LJ.js → swimlanesDiagram-VR7AAH4N-6PGsW_lL.js} +13 -13
- package/payload/shared/web/{timeline-definition-24CTP7MA-Bc0GefZe.js → timeline-definition-24CTP7MA-DbKwK9M6.js} +3 -3
- package/payload/shared/web/{vennDiagram-4TSXK5OY-CU3O6wRh.js → vennDiagram-4TSXK5OY-BnJ0tHAd.js} +3 -3
- package/payload/shared/web/{wardleyDiagram-VM6X3IG4-USaMhD8m.js → wardleyDiagram-VM6X3IG4-Bm9W5WIA.js} +3 -3
- package/payload/shared/web/{xychartDiagram-S5SC5T6Z-C8IhDKnq.js → xychartDiagram-S5SC5T6Z-DInWMmWi.js} +5 -5
- package/release-hosts.json +1 -1
- package/release-manifest.json +664 -133
- package/payload/shared/scripts/panel-preview-CPGv8nTe.mjs +0 -105
- package/payload/shared/scripts/studio-content-archive-CNUz472H.mjs +0 -334
- package/payload/shared/scripts/studio-instances-DKW4R37b.mjs +0 -592
- package/payload/shared/scripts/studio-panel-drafts-Cu48ih5u.mjs +0 -787
- package/payload/shared/scripts/windows-private-storage-_g0Kdp0U.mjs +0 -2
- package/payload/shared/web/flowDiagram-HODETNUW-DY-blVtj.js +0 -16
- package/payload/shared/web/katex-DhTJdtYJ.js +0 -26444
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import { $ as
|
|
1
|
+
import { i as notificationErrorResponse, n as requireThreadId, o as unknownDeliveryError, t as createCodexConnection } from "./codex-connection-1RvU1XCj.mjs";
|
|
2
|
+
import { $ as storedKnowledgeGraph, A as validateSkillDesign, At as writeConfinedText, B as writeDesignClarityAuthority, Bt as designProjectRecordsRoot, C as DesignAdvisoryJournal, D as OFFICIAL_REFLECTION_PROFILE, Dt as removeConfinedFile, E as OFFICIAL_GROUNDING_PROFILE, Et as readConfinedText, F as pendingMustEditAuthorityForSave, Ft as DesignProjectManager, H as designClarityInputMatches, I as DesignExecutionHandoffJournal, It as nodeDesignProjectSpawn, J as saveDesignKnowledgeRecords, L as DesignJournalStorage, M as applyPanelEdit, Mt as parseSchemaYaml, N as buildPanelSaveNote, Nt as validatorFromSchemaYaml, O as officialAdvisoryProfile, Ot as resolveConfinedFilePath, P as parsePanelArtifacts, Q as refreshDesignKnowledge, R as readCommittedDesignClarityAuthority, S as queryKnowledgeSnapshot, T as OFFICIAL_ALIGNMENT_PROFILE, Tt as readConfinedBytes, U as parseDesignClarityInput, V as designClarityDigest, W as parseDesignClarityReported, X as readDesignKnowledgePublication, Y as advanceDesignKnowledgePublication, Z as readPublishedDesignKnowledge, _ as DESIGN_EXECUTOR_EVIDENCE_GUIDANCE, _t as resolveDesignKitPackage, a as autoPanelGenerationPrompt, at as ensureProjectKit, b as knowledgeQueryFilters, bt as resolveSemanticCapability, c as resolveAutoPanel, ct as projectBundleOverrides, d as knowledgeReviewSchema, dt as createDirectoryBundleResolver, et as readSourceDesignKnowledge, f as publishKnowledgeReview, ft as loadDesignBundle, g as DESIGN_CORE_CLARITY_RUBRIC_PROMPT, h as DESIGN_CLARITY_OUTPUT_SCHEMA, i as writeDesignReviewPolicy, j as DESIGN_PANEL_SAVE_ASSESSMENT_GUIDANCE, k as deriveCurrentDesignExecutionGate, kt as writeConfinedBytes, l as retainResolvedAutoPanel, lt as projectKitContentHash, m as readAdvisoryDesignKnowledge, mt as parseFrontmatter, n as DesignReviewPublicationQueue, nt as DesignKnowledgeRevision, o as publishAutoPanelComponents, ot as DesignContentStore, p as splitKnowledgeReviewResult, pt as loadDesignKit, q as restoreDesignKnowledgeRecords, r as readDesignReviewPolicy, rt as commitDesignProjectRecords, s as assertResolvedAutoPanelSave, st as composeProjectKit, t as DesignContinuousReviewClock, tt as readCompleteDesignKnowledge, u as knowledgeReviewGuidance, ut as sameProjectContentPin, v as DESIGN_WORKER_EVIDENCE_GUIDANCE, vt as designOntologyCoverage, w as renderAdvisoryReviewMemory, wt as requireDesignFileRelativePath, x as knowledgeReadResult, y as KNOWLEDGE_AGENTIC_GUIDANCE, yt as reviewSupportOf, z as readDesignClarityAuthority, zt as GitVersioning } from "./core-entry-DESmwP78.mjs";
|
|
3
3
|
import { i as readDesignGit } from "./design-git-read-BUV0s4TT.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as loadStudioKit } from "./load-
|
|
7
|
-
import {
|
|
8
|
-
import { TextDecoder as TextDecoder$1, isDeepStrictEqual } from "node:util";
|
|
4
|
+
import { l as withWindowsInspection, o as windowsProcess, r as windowsCommandArgs, t as createWindowsProcessInspector } from "./windows-native-platform-DLm-tedp.mjs";
|
|
5
|
+
import { r as normalizeStudioInstanceChanges, t as createStudioDraftPorts } from "./studio-panel-drafts-Dq171F6x.mjs";
|
|
6
|
+
import { t as loadStudioKit } from "./load-C-RwS23Y.mjs";
|
|
7
|
+
import { TextDecoder, isDeepStrictEqual } from "node:util";
|
|
9
8
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep, win32 } from "node:path";
|
|
10
9
|
import { fileURLToPath } from "node:url";
|
|
11
10
|
import { link, lstat, mkdir, mkdtemp, open, readFile, readdir, readlink, realpath, rename, rm, rmdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -19,7 +18,7 @@ import { createServer } from "node:http";
|
|
|
19
18
|
import { StringDecoder } from "node:string_decoder";
|
|
20
19
|
//#region packages/companion/src/workbuddy-background.mjs
|
|
21
20
|
/** WorkBuddy 5.8.3 public Agent/TaskOutput native receipts. No Host settings or launches. */
|
|
22
|
-
const object$
|
|
21
|
+
const object$2 = (value) => value && typeof value === "object" && !Array.isArray(value);
|
|
23
22
|
const text = (value) => typeof value === "string" && value.length > 0 && value.length <= 512;
|
|
24
23
|
function args(event) {
|
|
25
24
|
try {
|
|
@@ -47,7 +46,7 @@ function receiptError(code, message, issues = [], observedMode = "unknown") {
|
|
|
47
46
|
observedMode
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
|
-
function diagnostic
|
|
49
|
+
function diagnostic(call, event, issues = []) {
|
|
51
50
|
const native = event?.providerData?.toolResult?.subAgent;
|
|
52
51
|
return {
|
|
53
52
|
...text(call?.callId) ? { callId: call.callId } : {},
|
|
@@ -115,7 +114,7 @@ function workBuddyBackgroundReadiness(events, parentSessionId, { since } = {}) {
|
|
|
115
114
|
if (!Number.isFinite(receiptAt) || receiptAt < since) continue;
|
|
116
115
|
const native = event.providerData?.toolResult?.subAgent;
|
|
117
116
|
const runId = native?.sessionId;
|
|
118
|
-
if (!object$
|
|
117
|
+
if (!object$2(native?.descriptor)) {
|
|
119
118
|
const synchronous = event.status === "completed" && text(runId) && text(native?.lastId) && native.descriptor === void 0;
|
|
120
119
|
if (synchronous) proof = void 0;
|
|
121
120
|
observation = {
|
|
@@ -123,7 +122,7 @@ function workBuddyBackgroundReadiness(events, parentSessionId, { since } = {}) {
|
|
|
123
122
|
canAttemptReadiness: false,
|
|
124
123
|
reasonCode: synchronous ? "native-synchronous-result" : "native-background-transport-missing",
|
|
125
124
|
observedMode: synchronous ? "synchronous" : "unknown",
|
|
126
|
-
diagnostics: diagnostic
|
|
125
|
+
diagnostics: diagnostic(call, event, [issue("subAgent.descriptor", "version-1 background descriptor", native?.descriptor, true)]),
|
|
127
126
|
reason: synchronous ? "The current WorkBuddy background request returned a synchronous child result without a background descriptor. Background GRA remains unavailable; do not repeat READY probes. Verify the normal Host Agent Teams/background capability and invocation mode." : "The current WorkBuddy background request has no complete native transport observation. Background execution is unverified, not a confirmed synchronous fallback. Inspect that existing request; do not launch another readiness probe."
|
|
128
127
|
};
|
|
129
128
|
continue;
|
|
@@ -142,7 +141,7 @@ function workBuddyBackgroundReadiness(events, parentSessionId, { since } = {}) {
|
|
|
142
141
|
canAttemptReadiness: false,
|
|
143
142
|
reasonCode: "native-background-stale",
|
|
144
143
|
observedMode: "background",
|
|
145
|
-
diagnostics: diagnostic
|
|
144
|
+
diagnostics: diagnostic(call, event, [issue("descriptor.createdAt", "at or after current connection opening", native.descriptor.createdAt)]),
|
|
146
145
|
reason: "The observed WorkBuddy descriptor predates this exact connection. It is not current readiness proof. Inspect the existing native request instead of repeating READY probes."
|
|
147
146
|
};
|
|
148
147
|
} catch (error) {
|
|
@@ -152,7 +151,7 @@ function workBuddyBackgroundReadiness(events, parentSessionId, { since } = {}) {
|
|
|
152
151
|
canAttemptReadiness: false,
|
|
153
152
|
reasonCode: error.code ?? "native-background-descriptor-invalid",
|
|
154
153
|
observedMode: error.observedMode ?? "unknown",
|
|
155
|
-
diagnostics: diagnostic
|
|
154
|
+
diagnostics: diagnostic(call, event, error.issues ?? []),
|
|
156
155
|
reason: error.code === "native-attached-result" ? "The existing native request returned an attached Agent result, not background execution. Background GRA remains unavailable. This receipt does not identify a Host setting; inspect the existing result without another probe." : "The current WorkBuddy background descriptor does not match its native parent call. Background execution remains unverified; inspect the reported fields in the existing request instead of repeating READY probes."
|
|
157
156
|
};
|
|
158
157
|
}
|
|
@@ -189,7 +188,7 @@ function workBuddyBackgroundReceipt(events, runId, parentSessionId, { notBefore,
|
|
|
189
188
|
const native = event.providerData?.toolResult;
|
|
190
189
|
if (event.name === "Agent" && native?.subAgent?.sessionId === runId) {
|
|
191
190
|
const descriptor = native.subAgent.descriptor;
|
|
192
|
-
if (!object$
|
|
191
|
+
if (!object$2(descriptor)) continue;
|
|
193
192
|
const issues = [];
|
|
194
193
|
const check = (field, valid, expected, value, content = false) => {
|
|
195
194
|
if (!valid) issues.push(issue(field, expected, value, content));
|
|
@@ -232,7 +231,7 @@ function workBuddyBackgroundReceipt(events, runId, parentSessionId, { notBefore,
|
|
|
232
231
|
status = "unknown";
|
|
233
232
|
continue;
|
|
234
233
|
}
|
|
235
|
-
if (!object$
|
|
234
|
+
if (!object$2(value) || value.taskId !== runId) throw new Error("WorkBuddy TaskOutput receipt belongs to another background task.");
|
|
236
235
|
status = {
|
|
237
236
|
pending: "running",
|
|
238
237
|
running: "running",
|
|
@@ -1103,7 +1102,7 @@ const verifyQwenWorkChild = verifyQoderChild;
|
|
|
1103
1102
|
//#region packages/companion/src/qwenwork-background.mjs
|
|
1104
1103
|
/** Version-pinned QwenWork native receipts. Read-only; never launches or configures a Host. */
|
|
1105
1104
|
const blocks$1 = (event) => Array.isArray(event.message?.content) ? event.message.content : [];
|
|
1106
|
-
const object = (value) => value && typeof value === "object" && !Array.isArray(value);
|
|
1105
|
+
const object$1 = (value) => value && typeof value === "object" && !Array.isArray(value);
|
|
1107
1106
|
const millis$1 = (value) => typeof value === "number" ? value : Date.parse(value);
|
|
1108
1107
|
const unavailable = "No current bound-session QwenWork asynchronous Agent receipt and matching native task descriptor.";
|
|
1109
1108
|
const statuses = /* @__PURE__ */ new Set([
|
|
@@ -1199,7 +1198,7 @@ async function readSession(options) {
|
|
|
1199
1198
|
if (block.type !== "tool_result" || !calls.has(block.tool_use_id)) continue;
|
|
1200
1199
|
const call = calls.get(block.tool_use_id);
|
|
1201
1200
|
const native = block.toolUseResult ?? (blocks$1(event).filter((x) => x.type === "tool_result").length === 1 ? event.toolUseResult : void 0);
|
|
1202
|
-
const async = block.is_error !== true && call.block.input?.run_in_background === true && object(native) && native.isAsync === true && native.status === "async_launched" && typeof native.agentId === "string" && typeof native.outputFile === "string" && native.outputFile.length > 0 && typeof native.description === "string" && typeof native.prompt === "string";
|
|
1201
|
+
const async = block.is_error !== true && call.block.input?.run_in_background === true && object$1(native) && native.isAsync === true && native.status === "async_launched" && typeof native.agentId === "string" && typeof native.outputFile === "string" && native.outputFile.length > 0 && typeof native.description === "string" && typeof native.prompt === "string";
|
|
1203
1202
|
launches.push({
|
|
1204
1203
|
callId: block.tool_use_id,
|
|
1205
1204
|
call,
|
|
@@ -1222,7 +1221,7 @@ async function descriptorFor(options, session, launch, taskPath, transcriptPath)
|
|
|
1222
1221
|
requireNativeId("qwenwork", launch.native.agentId);
|
|
1223
1222
|
if (await realpath(dirname(taskPath)) !== await realpath(session.folder)) throw Error("QwenWork task is outside this exact native session.");
|
|
1224
1223
|
const task = JSON.parse(await readRegular$1(taskPath, 2097152));
|
|
1225
|
-
if (!object(task) || typeof task.taskId !== "string" || !/^[a-zA-Z0-9][\w-]{0,127}$/.test(task.taskId) || basename(taskPath) !== `task-${task.taskId}.json` || task.sessionId !== sessionId || task.agentId !== launch.native.agentId || task.parentToolUseId !== launch.callId || task.completionBehavior !== "notify" || !Number.isSafeInteger(task.executionId) || task.executionId < 1 || !Number.isFinite(task.createdAt) || !Number.isFinite(task.updatedAt) || task.createdAt < readinessSince || task.updatedAt < task.createdAt || !statuses.has(task.status)) throw Error("QwenWork asynchronous task descriptor does not match its actual parent Agent call.");
|
|
1224
|
+
if (!object$1(task) || typeof task.taskId !== "string" || !/^[a-zA-Z0-9][\w-]{0,127}$/.test(task.taskId) || basename(taskPath) !== `task-${task.taskId}.json` || task.sessionId !== sessionId || task.agentId !== launch.native.agentId || task.parentToolUseId !== launch.callId || task.completionBehavior !== "notify" || !Number.isSafeInteger(task.executionId) || task.executionId < 1 || !Number.isFinite(task.createdAt) || !Number.isFinite(task.updatedAt) || task.createdAt < readinessSince || task.updatedAt < task.createdAt || !statuses.has(task.status)) throw Error("QwenWork asynchronous task descriptor does not match its actual parent Agent call.");
|
|
1226
1225
|
const expected = join(session.folder, `agent-${task.agentId}.jsonl`);
|
|
1227
1226
|
if (!isAbsolute(task.transcriptPath ?? "") || await realpath(task.transcriptPath) !== await realpath(expected) || transcriptPath && await realpath(transcriptPath) !== await realpath(expected) || !isAbsolute(task.outputPath ?? "") || await realpath(task.outputPath) !== await realpath(launch.native.outputFile)) throw Error("QwenWork asynchronous task paths do not match the native receipt.");
|
|
1228
1227
|
const log = await verifyQwenWorkChild({
|
|
@@ -2610,182 +2609,6 @@ var DesignFilesStore = class {
|
|
|
2610
2609
|
}
|
|
2611
2610
|
};
|
|
2612
2611
|
//#endregion
|
|
2613
|
-
//#region packages/core/src/project-content-guard.ts
|
|
2614
|
-
var ProjectContentPanelGuard = class {
|
|
2615
|
-
projectId;
|
|
2616
|
-
lifetimeMs;
|
|
2617
|
-
now;
|
|
2618
|
-
pages = /* @__PURE__ */ new Map();
|
|
2619
|
-
closedSequences = /* @__PURE__ */ new Map();
|
|
2620
|
-
constructor(projectId, lifetimeMs = 3e4, now = Date.now) {
|
|
2621
|
-
this.projectId = projectId;
|
|
2622
|
-
this.lifetimeMs = lifetimeMs;
|
|
2623
|
-
this.now = now;
|
|
2624
|
-
}
|
|
2625
|
-
observe(input) {
|
|
2626
|
-
if (input.projectId !== this.projectId || !/^[a-f0-9-]{36}$/u.test(input.pageId) || !Number.isSafeInteger(input.sequence) || input.sequence < 1 || typeof input.dirty !== "boolean" || typeof input.saving !== "boolean" || input.lifecycle && ![
|
|
2627
|
-
"opened",
|
|
2628
|
-
"observed",
|
|
2629
|
-
"closed"
|
|
2630
|
-
].includes(input.lifecycle)) throw new Error("content upgrade: invalid bound Panel observation");
|
|
2631
|
-
const prior = this.pages.get(input.pageId);
|
|
2632
|
-
if (input.sequence <= (prior?.sequence ?? this.closedSequences.get(input.pageId) ?? 0)) throw new Error("content upgrade: stale Panel observation");
|
|
2633
|
-
if (input.lifecycle === "closed") {
|
|
2634
|
-
if (!prior?.observed || prior.dirty || prior.saving || input.dirty || input.saving) throw new Error("content upgrade: closing a page cannot discard an unknown or unsaved draft");
|
|
2635
|
-
this.pages.delete(input.pageId);
|
|
2636
|
-
this.rememberClosed(input.pageId, input.sequence);
|
|
2637
|
-
return;
|
|
2638
|
-
}
|
|
2639
|
-
if (!prior && this.pages.size >= 64) throw new Error("content upgrade: too many Panel pages");
|
|
2640
|
-
this.pages.set(input.pageId, input.lifecycle === "opened" ? {
|
|
2641
|
-
sequence: input.sequence,
|
|
2642
|
-
dirty: prior?.dirty ?? false,
|
|
2643
|
-
saving: prior?.saving ?? false,
|
|
2644
|
-
observed: false,
|
|
2645
|
-
observedAt: this.now()
|
|
2646
|
-
} : {
|
|
2647
|
-
...input,
|
|
2648
|
-
observed: true,
|
|
2649
|
-
observedAt: this.now()
|
|
2650
|
-
});
|
|
2651
|
-
}
|
|
2652
|
-
rememberClosed(pageId, sequence) {
|
|
2653
|
-
this.closedSequences.delete(pageId);
|
|
2654
|
-
this.closedSequences.set(pageId, sequence);
|
|
2655
|
-
while (this.closedSequences.size > 256) this.closedSequences.delete(this.closedSequences.keys().next().value);
|
|
2656
|
-
}
|
|
2657
|
-
disconnected() {
|
|
2658
|
-
return [...this.pages].filter(([, page]) => this.now() - page.observedAt >= this.lifetimeMs).map(([pageId, page]) => ({
|
|
2659
|
-
pageId,
|
|
2660
|
-
sequence: page.sequence
|
|
2661
|
-
}));
|
|
2662
|
-
}
|
|
2663
|
-
/** Call only after actual user confirmation, using the exact displayed snapshot. */
|
|
2664
|
-
discardDisconnected(snapshot) {
|
|
2665
|
-
for (const item of snapshot) {
|
|
2666
|
-
const current = this.pages.get(item.pageId);
|
|
2667
|
-
if (!current || current.sequence !== item.sequence || this.now() - current.observedAt < this.lifetimeMs) throw new Error("content upgrade: disconnected page changed; no draft was discarded");
|
|
2668
|
-
}
|
|
2669
|
-
for (const item of snapshot) {
|
|
2670
|
-
this.pages.delete(item.pageId);
|
|
2671
|
-
this.rememberClosed(item.pageId, item.sequence);
|
|
2672
|
-
}
|
|
2673
|
-
}
|
|
2674
|
-
assertQuiescent() {
|
|
2675
|
-
for (const page of this.pages.values()) {
|
|
2676
|
-
if (this.now() - page.observedAt >= this.lifetimeMs) throw new Error("content upgrade: a Panel page disconnected; reconnect it or explicitly discard its abandoned draft");
|
|
2677
|
-
if (!page.observed) throw new Error("content upgrade: Panel draft observation is missing; reconnect its page");
|
|
2678
|
-
if (page.dirty || page.saving) throw new Error("content upgrade: preserve or settle every Panel draft before upgrading");
|
|
2679
|
-
}
|
|
2680
|
-
}
|
|
2681
|
-
};
|
|
2682
|
-
//#endregion
|
|
2683
|
-
//#region packages/core/src/project-content-journal.ts
|
|
2684
|
-
/** Append to the existing journal exactly once, including crash replay after append. */
|
|
2685
|
-
async function recordProjectContentAdoption(storage, conversation, receipt, pin) {
|
|
2686
|
-
if (receipt.contentHash !== pin.contentHash) throw new Error("content upgrade: journal receipt differs from the committed pin");
|
|
2687
|
-
await storage.atomicMutate(conversation, (current) => {
|
|
2688
|
-
const prior = current.records.find((record) => record.type === "design/kit-selected" && record.data.adoption?.operationId === receipt.operationId);
|
|
2689
|
-
if (prior?.type === "design/kit-selected") {
|
|
2690
|
-
if (JSON.stringify(prior.data.adoption) !== JSON.stringify(receipt)) throw new Error("content upgrade: conflicting journal replay");
|
|
2691
|
-
return;
|
|
2692
|
-
}
|
|
2693
|
-
return {
|
|
2694
|
-
type: "design/kit-selected",
|
|
2695
|
-
data: {
|
|
2696
|
-
kit: pin.name,
|
|
2697
|
-
version: pin.version,
|
|
2698
|
-
operation: "upgrade",
|
|
2699
|
-
adoption: receipt
|
|
2700
|
-
}
|
|
2701
|
-
};
|
|
2702
|
-
});
|
|
2703
|
-
}
|
|
2704
|
-
//#endregion
|
|
2705
|
-
//#region packages/core/src/panel-save.ts
|
|
2706
|
-
/** Decode bounded Panel attachment transport; store enforces path ownership. */
|
|
2707
|
-
function parsePanelArtifacts(skill, value) {
|
|
2708
|
-
if (value === void 0) return void 0;
|
|
2709
|
-
if (!Array.isArray(value) || value.length > 64) throw new Error("design panel: artifacts must be a list of at most 64 files");
|
|
2710
|
-
const artifacts = {};
|
|
2711
|
-
let totalBytes = 0;
|
|
2712
|
-
for (const raw of value) {
|
|
2713
|
-
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) throw new Error("design panel: each artifact must be an object");
|
|
2714
|
-
const entry = raw;
|
|
2715
|
-
const path = entry.path;
|
|
2716
|
-
const content = entry.content;
|
|
2717
|
-
if (typeof path !== "string" || typeof content !== "string") throw new Error("design panel: each artifact requires string path and content");
|
|
2718
|
-
const encoding = entry.encoding;
|
|
2719
|
-
if (encoding !== void 0 && encoding !== "base64") throw new Error("design panel: artifact encoding must be base64 when present");
|
|
2720
|
-
if (Object.keys(entry).some((key) => key !== "path" && key !== "content" && key !== "encoding")) throw new Error("design panel: artifact entries accept only path, content and encoding");
|
|
2721
|
-
if (Object.hasOwn(artifacts, path)) throw new Error(`design panel: duplicate artifact path ${JSON.stringify(path)}`);
|
|
2722
|
-
let prepared = content;
|
|
2723
|
-
let bytes = Buffer.byteLength(content, "utf8");
|
|
2724
|
-
if (encoding === "base64") {
|
|
2725
|
-
if (content === "" || !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u.test(content)) throw new Error(`design panel: artifact ${JSON.stringify(path)} is not canonical base64`);
|
|
2726
|
-
const decoded = Buffer.from(content, "base64");
|
|
2727
|
-
if (decoded.toString("base64") !== content) throw new Error(`design panel: artifact ${JSON.stringify(path)} is not canonical base64`);
|
|
2728
|
-
prepared = Uint8Array.from(decoded);
|
|
2729
|
-
bytes = decoded.byteLength;
|
|
2730
|
-
}
|
|
2731
|
-
if (bytes > 16777216) throw new Error(`design panel: artifact ${JSON.stringify(path)} exceeds 16 MiB`);
|
|
2732
|
-
totalBytes += bytes;
|
|
2733
|
-
if (totalBytes > 67108864) throw new Error("design panel: artifacts exceed 64 MiB in total");
|
|
2734
|
-
artifacts[path] = prepared;
|
|
2735
|
-
}
|
|
2736
|
-
return Object.freeze(artifacts);
|
|
2737
|
-
}
|
|
2738
|
-
/**
|
|
2739
|
-
* Build the model-facing note that carries the authoritative git diff.
|
|
2740
|
-
* @param skill - the skill whose panel was saved.
|
|
2741
|
-
* @param diff - the unified diff of the save commit.
|
|
2742
|
-
* @returns the `<panel_save_context>` note text.
|
|
2743
|
-
*/
|
|
2744
|
-
function buildPanelSaveNote(skill, diff, clarityInput) {
|
|
2745
|
-
return [
|
|
2746
|
-
"<panel_save_context>",
|
|
2747
|
-
`The backend has already persisted the "${skill}" panel edits. The raw Git diff below is the authoritative change record. Do not call a write tool to apply it again.`,
|
|
2748
|
-
"<git_diff>",
|
|
2749
|
-
diff,
|
|
2750
|
-
"</git_diff>",
|
|
2751
|
-
`This is a change diff, not the complete "${skill}" state. Reuse it and the evidence already available; read the saved JSON or a referenced artifact only when needed context is absent or the diff is insufficient.`,
|
|
2752
|
-
...clarityInput === void 0 ? [] : [
|
|
2753
|
-
`Assess this saved checkpoint in the ordinary main conversation when useful. To persist an assessment, call report_design_clarity with input=${JSON.stringify(clarityInput)} and evidence-based U/S/T for the latest saved Design state and agreed user scope. No second evaluator is required for this save to count as completed.`,
|
|
2754
|
-
"The current assembly supplies design_clarity_input for project, saved commit and Kit content. Use current user intent to decide whether the saved reasoning needs reassessment; conversational scope is not an identity ticket.",
|
|
2755
|
-
"Several saved edits may be assessed together. Reuse a score only when its evidence and reasoning remain applicable; corrections and same-turn reassessment are allowed. Reporting failure does not undo the save or block authorized work, and old scores are not fresh evidence."
|
|
2756
|
-
],
|
|
2757
|
-
"</panel_save_context>"
|
|
2758
|
-
].join("\n");
|
|
2759
|
-
}
|
|
2760
|
-
/**
|
|
2761
|
-
* Apply one panel edit: validate, persist, version, and build the agent note.
|
|
2762
|
-
* @param store - the session's Design Files store.
|
|
2763
|
-
* @param edit - the panel save (owning skill + post-edit state).
|
|
2764
|
-
* @param settleEvent - awaited plugin Journal settlement after commit.
|
|
2765
|
-
* @param validate - write-time schema validator (fail loud).
|
|
2766
|
-
* @param artifacts - deterministic files prepared by the runtime driver.
|
|
2767
|
-
* @param ownedArtifacts - complete artifact set retained by this Bundle.
|
|
2768
|
-
* @param signal - cancellation before transaction acceptance.
|
|
2769
|
-
* @returns the commit, diff, and the note to inject into the next turn.
|
|
2770
|
-
*/
|
|
2771
|
-
async function applyPanelEdit(store, edit, settleEvent, validate, artifacts, ownedArtifacts, signal, audit) {
|
|
2772
|
-
const { commit, diff } = await store.write(edit.skill, edit.state, {
|
|
2773
|
-
origin: "panel",
|
|
2774
|
-
...validate === void 0 ? {} : { validate },
|
|
2775
|
-
...artifacts === void 0 ? {} : { artifacts },
|
|
2776
|
-
...ownedArtifacts === void 0 ? {} : { ownedArtifacts },
|
|
2777
|
-
...signal === void 0 ? {} : { signal },
|
|
2778
|
-
...audit === void 0 ? {} : { audit },
|
|
2779
|
-
settleEvent
|
|
2780
|
-
});
|
|
2781
|
-
return {
|
|
2782
|
-
skill: edit.skill,
|
|
2783
|
-
commit,
|
|
2784
|
-
diff,
|
|
2785
|
-
note: buildPanelSaveNote(edit.skill, diff)
|
|
2786
|
-
};
|
|
2787
|
-
}
|
|
2788
|
-
//#endregion
|
|
2789
2612
|
//#region packages/core/src/panel-worktree.ts
|
|
2790
2613
|
/** Shared live-file projection; no Host session, transport or Agent dependency. */
|
|
2791
2614
|
const WORKTREE_REVISION_PREFIX = "worktree:";
|
|
@@ -3309,6 +3132,7 @@ async function createNativeRuns({ project, stateRoot, threadId, nativeCwd = proj
|
|
|
3309
3132
|
if (!skill) throw new Error("Unknown Bundle in the pinned Kit.");
|
|
3310
3133
|
return skill;
|
|
3311
3134
|
};
|
|
3135
|
+
const definitionRevision = () => project.definitionRevision ?? projectKitContentHash(project.kit);
|
|
3312
3136
|
const observer = (binding) => {
|
|
3313
3137
|
if (!observers.has(binding.runId)) observers.set(binding.runId, createObserver({
|
|
3314
3138
|
path: binding.transcriptPath,
|
|
@@ -3412,7 +3236,8 @@ async function createNativeRuns({ project, stateRoot, threadId, nativeCwd = proj
|
|
|
3412
3236
|
mode: "main",
|
|
3413
3237
|
kit: project.kit.name,
|
|
3414
3238
|
kitVersion: project.kit.version,
|
|
3415
|
-
bundleVersion: skillFor(skill).version
|
|
3239
|
+
bundleVersion: skillFor(skill).version,
|
|
3240
|
+
definitionRevision: definitionRevision()
|
|
3416
3241
|
};
|
|
3417
3242
|
await persistMain([...mainInvocations, invocation]);
|
|
3418
3243
|
return { ...invocation };
|
|
@@ -3511,7 +3336,8 @@ async function createNativeRuns({ project, stateRoot, threadId, nativeCwd = proj
|
|
|
3511
3336
|
skill: invocation.skill,
|
|
3512
3337
|
invocationId,
|
|
3513
3338
|
scope,
|
|
3514
|
-
outcome
|
|
3339
|
+
outcome,
|
|
3340
|
+
definitionRevision: invocation.definitionRevision
|
|
3515
3341
|
});
|
|
3516
3342
|
} catch (error) {
|
|
3517
3343
|
return committedRecovery(error);
|
|
@@ -3568,6 +3394,7 @@ async function createNativeRuns({ project, stateRoot, threadId, nativeCwd = proj
|
|
|
3568
3394
|
taskPath,
|
|
3569
3395
|
projectRoot: nativeCwd
|
|
3570
3396
|
});
|
|
3397
|
+
const existing = bindings.find((item) => item.runId === runId);
|
|
3571
3398
|
const next = {
|
|
3572
3399
|
runId,
|
|
3573
3400
|
parentRunId,
|
|
@@ -3580,9 +3407,9 @@ async function createNativeRuns({ project, stateRoot, threadId, nativeCwd = proj
|
|
|
3580
3407
|
...artifactFile ? { artifactFile } : {},
|
|
3581
3408
|
invocationId: main?.invocationId ?? parent?.invocationId ?? nativeInvocationId(host, threadId, runId),
|
|
3582
3409
|
attemptId: runId,
|
|
3583
|
-
projectId: project.project.metadata.id
|
|
3410
|
+
projectId: project.project.metadata.id,
|
|
3411
|
+
definitionRevision: existing?.definitionRevision ?? main?.definitionRevision ?? parent?.definitionRevision ?? definitionRevision()
|
|
3584
3412
|
};
|
|
3585
|
-
const existing = bindings.find((item) => item.runId === runId);
|
|
3586
3413
|
if (existing) {
|
|
3587
3414
|
for (const [key, value] of Object.entries(next)) if (existing[key] !== value) throw new Error("Native run cannot be rebound to another target.");
|
|
3588
3415
|
return {
|
|
@@ -3655,7 +3482,8 @@ async function createNativeRuns({ project, stateRoot, threadId, nativeCwd = proj
|
|
|
3655
3482
|
skill: binding.skill,
|
|
3656
3483
|
invocationId: binding.invocationId,
|
|
3657
3484
|
scope,
|
|
3658
|
-
outcome
|
|
3485
|
+
outcome,
|
|
3486
|
+
definitionRevision: binding.definitionRevision
|
|
3659
3487
|
}) : void 0;
|
|
3660
3488
|
} catch (error) {
|
|
3661
3489
|
return committedRecovery(error);
|
|
@@ -4318,9 +4146,7 @@ function createCompanionMainContext({ project, reviews, knowledge }) {
|
|
|
4318
4146
|
async function matches(input, captured) {
|
|
4319
4147
|
return !!input && input.projectId === projectId && input.kitContentHash === captured.input.kitContentHash && typeof input.assessedCheckpoint === "string" && /^[a-f0-9]{40}(?:[a-f0-9]{24})?$/.test(input.assessedCheckpoint) && await project.store.sameDesignEvidenceAt(input.assessedCheckpoint, captured.input.assessedCheckpoint);
|
|
4320
4148
|
}
|
|
4321
|
-
async function
|
|
4322
|
-
await guardRecords();
|
|
4323
|
-
const authority = await readDesignClarityAuthority(root, projectId);
|
|
4149
|
+
async function assessmentState(captured, authority) {
|
|
4324
4150
|
const current = !!authority && designClarityInputMatches(authority.report, {
|
|
4325
4151
|
kit: captured.kit.name,
|
|
4326
4152
|
version: captured.kit.version,
|
|
@@ -4335,7 +4161,8 @@ function createCompanionMainContext({ project, reviews, knowledge }) {
|
|
|
4335
4161
|
}
|
|
4336
4162
|
async function context({ includeKnowledge = true } = {}) {
|
|
4337
4163
|
const captured = await capture();
|
|
4338
|
-
|
|
4164
|
+
await guardRecords();
|
|
4165
|
+
const clarity = await assessmentState(captured, await readCommittedDesignClarityAuthority(projectRoot, projectId));
|
|
4339
4166
|
const status = includeKnowledge && knowledge ? await knowledge.status().catch(() => ({ state: "unavailable" })) : void 0;
|
|
4340
4167
|
return {
|
|
4341
4168
|
project: projectId,
|
|
@@ -4357,8 +4184,12 @@ function createCompanionMainContext({ project, reviews, knowledge }) {
|
|
|
4357
4184
|
input: async () => (await capture()).input,
|
|
4358
4185
|
context,
|
|
4359
4186
|
async notification(saved) {
|
|
4360
|
-
|
|
4361
|
-
|
|
4187
|
+
return [
|
|
4188
|
+
saved?.commit && !await project.store.sameDesignEvidenceAt(saved.commit, await project.store.head()) ? "Newer Design evidence exists." : "The saved files are durable.",
|
|
4189
|
+
"Read design_main_context for the current saved evidence, assessment and report input.",
|
|
4190
|
+
DESIGN_PANEL_SAVE_ASSESSMENT_GUIDANCE,
|
|
4191
|
+
"Assessment, KAG and GRA do not block independently authorized Design work."
|
|
4192
|
+
].join(" ");
|
|
4362
4193
|
},
|
|
4363
4194
|
async report({ input, ...value }) {
|
|
4364
4195
|
const assessment = parseDesignClarityInput(value);
|
|
@@ -4372,7 +4203,8 @@ function createCompanionMainContext({ project, reviews, knowledge }) {
|
|
|
4372
4203
|
const captured = await capture();
|
|
4373
4204
|
if (!await matches(input, captured)) throw new Error("Clarity input is no longer current. Read design_main_context and assess the current project, Kit and Design evidence.");
|
|
4374
4205
|
const digest = designClarityDigest(assessment, captured.kit.name, captured.kit.version);
|
|
4375
|
-
|
|
4206
|
+
await guardRecords();
|
|
4207
|
+
const prior = await assessmentState(captured, await readDesignClarityAuthority(root, projectId));
|
|
4376
4208
|
const replayed = !prior.needsReassessment && prior.assessment.digest === digest;
|
|
4377
4209
|
const report = replayed ? prior.assessment : parseDesignClarityReported({
|
|
4378
4210
|
...assessment,
|
|
@@ -4773,7 +4605,7 @@ function createNativeHookTransport({ host, label, noticeFile, inspectProcess, na
|
|
|
4773
4605
|
const resumeRetentionMs = 864e5;
|
|
4774
4606
|
const marker = `design-system-${prefix}-hook:`;
|
|
4775
4607
|
const defaultRoot = () => join(homedir(), ".local/state/design-system", `${prefix}-hooks`);
|
|
4776
|
-
const windowsStorage = process.platform === "win32" ? import("./windows-private-storage-
|
|
4608
|
+
const windowsStorage = process.platform === "win32" ? import("./windows-private-storage-Q0cTolE3.mjs") : void 0;
|
|
4777
4609
|
async function assertPrivate(path, stat) {
|
|
4778
4610
|
if (windowsStorage) {
|
|
4779
4611
|
const checked = await (await windowsStorage).assertWindowsPrivate(path);
|
|
@@ -5165,7 +4997,7 @@ async function createDesktopInputConnection({ sessionId, nativeCwd, request, ver
|
|
|
5165
4997
|
}
|
|
5166
4998
|
async function createQwenWorkDesktopInput(options) {
|
|
5167
4999
|
if (process.platform !== "win32" || !process.env.APPDATA) throw Error("Native Windows QwenWork desktop input required.");
|
|
5168
|
-
const { assertWindowsPrivate } = await import("./windows-private-storage-
|
|
5000
|
+
const { assertWindowsPrivate } = await import("./windows-private-storage-Q0cTolE3.mjs");
|
|
5169
5001
|
const root = join(process.env.APPDATA, "QwenWorkCN");
|
|
5170
5002
|
const endpointFile = join(root, "cli-control/endpoint.json");
|
|
5171
5003
|
await assertWindowsPrivate(endpointFile);
|
|
@@ -5233,6 +5065,226 @@ async function createQwenWorkDesktopInput(options) {
|
|
|
5233
5065
|
}
|
|
5234
5066
|
}
|
|
5235
5067
|
//#endregion
|
|
5068
|
+
//#region packages/companion/src/studio-conversation.mjs
|
|
5069
|
+
/** Studio target metadata only. Source, candidate and save authority stay in S2. */
|
|
5070
|
+
const object = (value, keys) => value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).every((key) => keys.includes(key));
|
|
5071
|
+
const identity = (value) => typeof value === "string" && /^[\w.-]{1,128}$/.test(value);
|
|
5072
|
+
const samePin = (a, b) => a?.name === b?.name && a?.version === b?.version;
|
|
5073
|
+
const changed = () => Object.assign(Error("Studio connection or working copy changed. Reopen its current binding; your unsent message is preserved."), { code: "STUDIO_BINDING_CHANGED" });
|
|
5074
|
+
function studioConversationTarget(value) {
|
|
5075
|
+
if (!object(value, [
|
|
5076
|
+
"bindingId",
|
|
5077
|
+
"threadId",
|
|
5078
|
+
"id",
|
|
5079
|
+
"expectedRevision",
|
|
5080
|
+
"bundle"
|
|
5081
|
+
]) || !identity(value.bindingId) || !identity(value.threadId) || !identity(value.id) || !Number.isSafeInteger(value.expectedRevision) || value.expectedRevision < 0) throw Error("Invalid Studio conversation target.");
|
|
5082
|
+
if (value.bundle !== void 0 && (!object(value.bundle, ["name", "version"]) || !/^[a-z][a-z0-9_]*$/.test(value.bundle.name) || typeof value.bundle.version !== "string" || !/^\d+\.\d+$/.test(value.bundle.version))) throw Error("Invalid Studio preview Bundle pin.");
|
|
5083
|
+
return Object.freeze({
|
|
5084
|
+
bindingId: value.bindingId,
|
|
5085
|
+
threadId: value.threadId,
|
|
5086
|
+
id: value.id,
|
|
5087
|
+
expectedRevision: value.expectedRevision,
|
|
5088
|
+
...value.bundle === void 0 ? {} : { bundle: Object.freeze({
|
|
5089
|
+
name: value.bundle.name,
|
|
5090
|
+
version: value.bundle.version
|
|
5091
|
+
}) }
|
|
5092
|
+
});
|
|
5093
|
+
}
|
|
5094
|
+
/** Editing hints only; source scope and candidate identity remain the exact target. */
|
|
5095
|
+
function studioEditingContext(value) {
|
|
5096
|
+
if (value === void 0) return void 0;
|
|
5097
|
+
if (!object(value, ["intent", "currentFile"]) || !["create", "edit"].includes(value.intent) || value.currentFile !== void 0 && (typeof value.currentFile !== "string" || !value.currentFile || value.currentFile.length > 1024)) throw Error("Invalid Studio editing context.");
|
|
5098
|
+
return Object.freeze({
|
|
5099
|
+
intent: value.intent,
|
|
5100
|
+
...value.currentFile === void 0 ? {} : { currentFile: value.currentFile }
|
|
5101
|
+
});
|
|
5102
|
+
}
|
|
5103
|
+
/** Read the exact copy in the existing service; never resolve a latest object. */
|
|
5104
|
+
async function readStudioConversationTarget({ target, binding, readInstance, context }) {
|
|
5105
|
+
const selected = studioConversationTarget(target);
|
|
5106
|
+
const editing = studioEditingContext(context);
|
|
5107
|
+
if (selected.bindingId !== binding.bindingId || selected.threadId !== binding.threadId) throw changed();
|
|
5108
|
+
const record = await readInstance({ id: selected.id });
|
|
5109
|
+
if (record?.id !== selected.id || record.revision !== selected.expectedRevision || record.deletedAt || !["kit", "bundle"].includes(record.kind)) throw changed();
|
|
5110
|
+
if (selected.bundle && !(record.kind === "bundle" ? samePin(selected.bundle, record.bundle ?? record.source?.bundle) : record.mounts?.some((mount) => samePin(selected.bundle, mount.bundle)))) throw changed();
|
|
5111
|
+
if (editing?.currentFile && !record.files?.some((file) => file.path === editing.currentFile)) throw changed();
|
|
5112
|
+
return {
|
|
5113
|
+
...selected,
|
|
5114
|
+
kind: record.kind,
|
|
5115
|
+
title: record.title,
|
|
5116
|
+
...editing ? { context: editing } : {}
|
|
5117
|
+
};
|
|
5118
|
+
}
|
|
5119
|
+
//#endregion
|
|
5120
|
+
//#region packages/companion/src/studio-conversation-requests.mjs
|
|
5121
|
+
/** Bounded, service-lifetime correlation of conversation requests with exact S2 receipts. */
|
|
5122
|
+
function createStudioConversationRequests({ binding, readInstance, prepareChanges }) {
|
|
5123
|
+
const entries = /* @__PURE__ */ new Map();
|
|
5124
|
+
const maximumBytes = 25165824, maximumRequests = 16;
|
|
5125
|
+
let closed = false;
|
|
5126
|
+
const requireOpen = () => {
|
|
5127
|
+
if (closed) throw Error("Studio conversation service is closed.");
|
|
5128
|
+
};
|
|
5129
|
+
const identity = (value) => typeof value === "string" && /^[\w.-]{1,128}$/.test(value);
|
|
5130
|
+
const requireEntry = async (requestId, target) => {
|
|
5131
|
+
requireOpen();
|
|
5132
|
+
const selected = studioConversationTarget(target), entry = entries.get(requestId);
|
|
5133
|
+
if (!entry) throw Error("Unknown Studio authoring request. Select the working copy and send a new request explicitly.");
|
|
5134
|
+
if (JSON.stringify(selected) !== JSON.stringify(entry.studio)) throw Error("Studio request target changed. Reopen the current working copy; do not reuse this request.");
|
|
5135
|
+
await readStudioConversationTarget({
|
|
5136
|
+
target: selected,
|
|
5137
|
+
binding,
|
|
5138
|
+
readInstance
|
|
5139
|
+
});
|
|
5140
|
+
return entry;
|
|
5141
|
+
};
|
|
5142
|
+
const service = {
|
|
5143
|
+
async register({ requestId, studio, context }) {
|
|
5144
|
+
requireOpen();
|
|
5145
|
+
if (!identity(requestId)) throw Error("An exact Studio request ID is required.");
|
|
5146
|
+
const target = studioConversationTarget(studio);
|
|
5147
|
+
const record = await readStudioConversationTarget({
|
|
5148
|
+
target,
|
|
5149
|
+
binding,
|
|
5150
|
+
readInstance,
|
|
5151
|
+
context
|
|
5152
|
+
});
|
|
5153
|
+
requireOpen();
|
|
5154
|
+
if (entries.has(requestId)) throw Error("Studio request already submitted. Check the original conversation; do not resend.");
|
|
5155
|
+
if (entries.size >= maximumRequests) throw Error("Studio request correlation limit reached. No pending or reviewed request was evicted; finish this service lifecycle before opening more requests.");
|
|
5156
|
+
entries.set(requestId, {
|
|
5157
|
+
studio: target,
|
|
5158
|
+
kind: record.kind,
|
|
5159
|
+
prepared: null,
|
|
5160
|
+
bytes: 0
|
|
5161
|
+
});
|
|
5162
|
+
return record;
|
|
5163
|
+
},
|
|
5164
|
+
async prepare({ authoringRequestId, ...input }) {
|
|
5165
|
+
if (!identity(authoringRequestId)) throw Error("An exact authoringRequestId is required.");
|
|
5166
|
+
requireOpen();
|
|
5167
|
+
const stored = entries.get(authoringRequestId);
|
|
5168
|
+
if (!stored) throw Error("Unknown Studio authoring request; no candidate was associated.");
|
|
5169
|
+
const request = normalizeStudioInstanceChanges(input);
|
|
5170
|
+
if (request.id !== stored.studio.id || request.expectedRevision !== stored.studio.expectedRevision) throw Error("Candidate does not match the exact Studio request target or base revision.");
|
|
5171
|
+
if (stored.studio.bundle && (stored.kind === "kit" || request.bundle !== void 0) && (request.bundle?.name !== stored.studio.bundle.name || request.bundle?.version !== stored.studio.bundle.version)) throw Error("Candidate preview Bundle does not match the exact Studio request pin.");
|
|
5172
|
+
const entry = await requireEntry(authoringRequestId, stored.studio);
|
|
5173
|
+
if (entry.prepared) {
|
|
5174
|
+
if (JSON.stringify(entry.prepared.request) !== JSON.stringify(request)) throw Error("This Studio request already has a different candidate source request. Send a new explicit request for another proposal.");
|
|
5175
|
+
return structuredClone(entry.prepared.candidate);
|
|
5176
|
+
}
|
|
5177
|
+
const requestKey = createHash("sha256").update(JSON.stringify(request)).digest("hex");
|
|
5178
|
+
if (entry.pending && entry.pending.requestKey !== requestKey) throw Error("This Studio request already has a different candidate source request. Send a new explicit request for another proposal.");
|
|
5179
|
+
if (!entry.pending) entry.pending = {
|
|
5180
|
+
requestKey,
|
|
5181
|
+
promise: (async () => {
|
|
5182
|
+
const candidate = await prepareChanges(request);
|
|
5183
|
+
await requireEntry(authoringRequestId, entry.studio);
|
|
5184
|
+
if (candidate?.id !== request.id || candidate.baseRevision !== request.expectedRevision || candidate.revision !== request.expectedRevision + 1 || !/^[a-f0-9]{64}$/.test(candidate.digest) || candidate.preview && candidate.preview.revision !== candidate.revision) throw Error("S2 returned a mismatched candidate receipt.");
|
|
5185
|
+
const prepared = structuredClone({
|
|
5186
|
+
request,
|
|
5187
|
+
candidate
|
|
5188
|
+
}), bytes = Buffer.byteLength(JSON.stringify(prepared));
|
|
5189
|
+
if (bytes + [...entries.values()].reduce((n, item) => n + (item === entry ? 0 : item.bytes), 0) > maximumBytes) throw Error("Studio candidate correlation exceeds its 24 MiB memory budget.");
|
|
5190
|
+
entry.prepared = prepared;
|
|
5191
|
+
entry.bytes = bytes;
|
|
5192
|
+
return candidate;
|
|
5193
|
+
})()
|
|
5194
|
+
};
|
|
5195
|
+
try {
|
|
5196
|
+
return structuredClone(await entry.pending.promise);
|
|
5197
|
+
} finally {
|
|
5198
|
+
entry.pending = void 0;
|
|
5199
|
+
}
|
|
5200
|
+
},
|
|
5201
|
+
/** An authoring purpose, not proof of caller identity. Original RPC auth owns access. */
|
|
5202
|
+
async prepareForConversation(input) {
|
|
5203
|
+
requireOpen();
|
|
5204
|
+
if (!input || Object.keys(input).some((key) => ![
|
|
5205
|
+
"id",
|
|
5206
|
+
"expectedRevision",
|
|
5207
|
+
"changes",
|
|
5208
|
+
"bundle",
|
|
5209
|
+
"sampleSource"
|
|
5210
|
+
].includes(key))) throw Error("Invalid Studio authoring preparation request.");
|
|
5211
|
+
const request = normalizeStudioInstanceChanges(input);
|
|
5212
|
+
const record = await readInstance({ id: request.id });
|
|
5213
|
+
const bundle = request.bundle ?? (record?.kind === "bundle" ? record.bundle ?? record.source?.bundle : void 0);
|
|
5214
|
+
const studio = studioConversationTarget({
|
|
5215
|
+
...binding,
|
|
5216
|
+
id: request.id,
|
|
5217
|
+
expectedRevision: request.expectedRevision,
|
|
5218
|
+
...bundle ? { bundle } : {}
|
|
5219
|
+
});
|
|
5220
|
+
await readStudioConversationTarget({
|
|
5221
|
+
target: studio,
|
|
5222
|
+
binding,
|
|
5223
|
+
readInstance
|
|
5224
|
+
});
|
|
5225
|
+
requireOpen();
|
|
5226
|
+
const key = createHash("sha256").update(JSON.stringify({
|
|
5227
|
+
studio,
|
|
5228
|
+
request
|
|
5229
|
+
})).digest("hex");
|
|
5230
|
+
let pair = [...entries].find(([, entry]) => entry.conversationRequestKey === key);
|
|
5231
|
+
if (!pair) {
|
|
5232
|
+
if (entries.size >= maximumRequests) throw Error("Studio request correlation limit reached. No pending or reviewed request was evicted; finish this service lifecycle before opening more requests.");
|
|
5233
|
+
const requestId = `host-${randomUUID()}`;
|
|
5234
|
+
const entry = {
|
|
5235
|
+
studio,
|
|
5236
|
+
kind: record.kind,
|
|
5237
|
+
prepared: null,
|
|
5238
|
+
bytes: 0,
|
|
5239
|
+
conversationRequestKey: key
|
|
5240
|
+
};
|
|
5241
|
+
entries.set(requestId, entry);
|
|
5242
|
+
pair = [requestId, entry];
|
|
5243
|
+
}
|
|
5244
|
+
const [requestId, entry] = pair;
|
|
5245
|
+
return {
|
|
5246
|
+
...await service.prepare({
|
|
5247
|
+
...request,
|
|
5248
|
+
authoringRequestId: requestId
|
|
5249
|
+
}),
|
|
5250
|
+
authoring: {
|
|
5251
|
+
requestId,
|
|
5252
|
+
studio: structuredClone(entry.studio)
|
|
5253
|
+
}
|
|
5254
|
+
};
|
|
5255
|
+
},
|
|
5256
|
+
async list({ studio }) {
|
|
5257
|
+
requireOpen();
|
|
5258
|
+
const selected = studioConversationTarget(studio);
|
|
5259
|
+
await readStudioConversationTarget({
|
|
5260
|
+
target: selected,
|
|
5261
|
+
binding,
|
|
5262
|
+
readInstance
|
|
5263
|
+
});
|
|
5264
|
+
requireOpen();
|
|
5265
|
+
return { candidates: [...entries].filter(([, entry]) => entry.prepared && JSON.stringify(entry.studio) === JSON.stringify(selected)).map(([requestId, entry]) => ({
|
|
5266
|
+
requestId,
|
|
5267
|
+
studio: structuredClone(entry.studio),
|
|
5268
|
+
digest: entry.prepared.candidate.digest,
|
|
5269
|
+
changedFiles: entry.prepared.candidate.diff.map((file) => file.path)
|
|
5270
|
+
})) };
|
|
5271
|
+
},
|
|
5272
|
+
async read({ requestId, studio }) {
|
|
5273
|
+
const entry = await requireEntry(requestId, studio);
|
|
5274
|
+
return structuredClone({
|
|
5275
|
+
requestId,
|
|
5276
|
+
studio: entry.studio,
|
|
5277
|
+
prepared: entry.prepared
|
|
5278
|
+
});
|
|
5279
|
+
},
|
|
5280
|
+
close() {
|
|
5281
|
+
closed = true;
|
|
5282
|
+
entries.clear();
|
|
5283
|
+
}
|
|
5284
|
+
};
|
|
5285
|
+
return service;
|
|
5286
|
+
}
|
|
5287
|
+
//#endregion
|
|
5236
5288
|
//#region packages/companion/src/static-asset-request.mjs
|
|
5237
5289
|
const MIME_TYPES = Object.freeze({
|
|
5238
5290
|
".html": "text/html",
|
|
@@ -5292,7 +5344,6 @@ const browserMethods = /* @__PURE__ */ new Set([
|
|
|
5292
5344
|
"readSettings",
|
|
5293
5345
|
"readReviewPolicy",
|
|
5294
5346
|
"savePanel",
|
|
5295
|
-
"observePanelDraft",
|
|
5296
5347
|
"retainAutoPanel",
|
|
5297
5348
|
"sendPrompt",
|
|
5298
5349
|
"decideAdvisory",
|
|
@@ -5310,38 +5361,27 @@ const browserMethods = /* @__PURE__ */ new Set([
|
|
|
5310
5361
|
"studioInstanceList",
|
|
5311
5362
|
"studioInstanceRead",
|
|
5312
5363
|
"studioInstanceCopy",
|
|
5364
|
+
"studioInstanceEditCurrent",
|
|
5365
|
+
"studioInstanceCreate",
|
|
5313
5366
|
"studioInstanceRename",
|
|
5367
|
+
"studioInstanceImportSources",
|
|
5314
5368
|
"studioInstanceRemove",
|
|
5315
5369
|
"studioInstanceFile",
|
|
5316
5370
|
"studioInstanceSave",
|
|
5317
5371
|
"studioInstancePreview",
|
|
5318
5372
|
"studioInstanceMounts",
|
|
5373
|
+
"studioInstancePrepareChanges",
|
|
5374
|
+
"studioInstanceSaveChanges",
|
|
5375
|
+
"studioAuthoringCandidateList",
|
|
5376
|
+
"studioAuthoringCandidateRead",
|
|
5319
5377
|
"studioTrialAvailability",
|
|
5320
5378
|
"studioTrialStart",
|
|
5321
5379
|
"studioTrialList",
|
|
5322
5380
|
"studioTrialRead",
|
|
5323
5381
|
"studioTrialStop",
|
|
5324
5382
|
"studioTrialRemove",
|
|
5325
|
-
"studioDraftList",
|
|
5326
|
-
"studioDraftRead",
|
|
5327
|
-
"studioDraftPreview",
|
|
5328
|
-
"studioDraftCreate",
|
|
5329
|
-
"studioDraftSave",
|
|
5330
|
-
"studioDraftConfirm",
|
|
5331
|
-
"studioDraftFork",
|
|
5332
|
-
"studioKitDraftList",
|
|
5333
|
-
"studioKitDraftRead",
|
|
5334
|
-
"studioKitDraftValidate",
|
|
5335
|
-
"studioKitDraftPreview",
|
|
5336
|
-
"studioKitDraftCreate",
|
|
5337
|
-
"studioKitDraftSave",
|
|
5338
|
-
"studioKitDraftConfirm",
|
|
5339
|
-
"studioKitDraftFork",
|
|
5340
5383
|
"studioContentExport",
|
|
5341
|
-
"
|
|
5342
|
-
"studioContentImportRead",
|
|
5343
|
-
"studioContentImportList",
|
|
5344
|
-
"studioContentImportAdopt"
|
|
5384
|
+
"studioContentReadArchive"
|
|
5345
5385
|
]);
|
|
5346
5386
|
function browserRequestAllowed(headers, origin) {
|
|
5347
5387
|
return headers.origin === origin && headers["x-design-browser"] === "1" && (headers["sec-fetch-site"] === void 0 || headers["sec-fetch-site"] === "same-origin") && /^application\/json(?:\s*;|\s*$)/i.test(headers["content-type"] ?? "");
|
|
@@ -5478,7 +5518,7 @@ function loadPackagedCssAssets(packageRoot, prefix) {
|
|
|
5478
5518
|
const root = realpathSync(packageRoot);
|
|
5479
5519
|
const folder = `css-assets/${prefix.split("/")[2]}`;
|
|
5480
5520
|
const manifestBytes = ownedRead(root, `${folder}/manifest.json`, 262144);
|
|
5481
|
-
const manifest = JSON.parse(new TextDecoder
|
|
5521
|
+
const manifest = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(manifestBytes));
|
|
5482
5522
|
if (manifest?.schema !== "design-system-css-assets-v1" || manifest.prefix !== prefix || !Array.isArray(manifest.assets) || manifest.assets.length > 512) throw Error("Invalid packaged CSS asset manifest");
|
|
5483
5523
|
const seen = /* @__PURE__ */ new Set(), assets = [];
|
|
5484
5524
|
let total = 0;
|
|
@@ -5509,51 +5549,6 @@ function loadPackagedCssAssets(packageRoot, prefix) {
|
|
|
5509
5549
|
};
|
|
5510
5550
|
}
|
|
5511
5551
|
//#endregion
|
|
5512
|
-
//#region packages/companion/src/content-import-legacy.mjs
|
|
5513
|
-
/** Reuse Core's legacy migration before comparing immutable imported content. */
|
|
5514
|
-
/** Caller owns stagingRoot and removes it on both success and failure. */
|
|
5515
|
-
async function normalizeLegacyKitImport(staged, { stagingRoot, sourceId }) {
|
|
5516
|
-
const legacy = staged.find((unit) => unit.kind === "kit" && !unit.files.some((file) => file.path === "kit.yaml"));
|
|
5517
|
-
if (!legacy) return staged;
|
|
5518
|
-
if (staged.length !== 1) throw new Error("Legacy Kit import must contain one complete Kit unit.");
|
|
5519
|
-
const migrationRoot = await mkdtemp(join(stagingRoot, "legacy-normalization-"));
|
|
5520
|
-
const kit = await new DesignContentStore(migrationRoot).retainKitClosure(legacy.rootDir, { sourceId });
|
|
5521
|
-
if (kit.name !== legacy.pin.name || String(kit.version) !== legacy.pin.version) throw new Error("Legacy Kit identity changed during normalization.");
|
|
5522
|
-
let count = 0, total = 0;
|
|
5523
|
-
const capture = async (kind, pin, rootDir) => {
|
|
5524
|
-
const files = [];
|
|
5525
|
-
const walk = async (directory) => {
|
|
5526
|
-
for (const entry of (await readdir(directory, { withFileTypes: true })).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
5527
|
-
const path = join(directory, entry.name);
|
|
5528
|
-
if (entry.isDirectory()) await walk(path);
|
|
5529
|
-
else if (entry.isFile()) {
|
|
5530
|
-
const bytes = await readFile(path);
|
|
5531
|
-
if (++count > 4096 || (total += bytes.length) > 16777216) throw new Error("Normalized content exceeds bounded archive limits.");
|
|
5532
|
-
files.push({
|
|
5533
|
-
path: relative(rootDir, path).split(sep).join("/"),
|
|
5534
|
-
base64: bytes.toString("base64"),
|
|
5535
|
-
bytes: bytes.length,
|
|
5536
|
-
sha256: createHash("sha256").update(bytes).digest("hex")
|
|
5537
|
-
});
|
|
5538
|
-
} else throw new Error("Normalized imported content must contain only regular files.");
|
|
5539
|
-
}
|
|
5540
|
-
};
|
|
5541
|
-
await walk(rootDir);
|
|
5542
|
-
return {
|
|
5543
|
-
kind,
|
|
5544
|
-
pin,
|
|
5545
|
-
rootDir,
|
|
5546
|
-
files
|
|
5547
|
-
};
|
|
5548
|
-
};
|
|
5549
|
-
const normalized = [await capture("kit", legacy.pin, kit.sourceRoot)];
|
|
5550
|
-
for (const skill of kit.skills) normalized.push(await capture("bundle", {
|
|
5551
|
-
name: skill.catalogName ?? skill.name,
|
|
5552
|
-
version: String(skill.version)
|
|
5553
|
-
}, skill.resourceRoot));
|
|
5554
|
-
return normalized;
|
|
5555
|
-
}
|
|
5556
|
-
//#endregion
|
|
5557
5552
|
//#region packages/companion/src/content-library.mjs
|
|
5558
5553
|
/** Companion adapter over the shared Core content authority, not a second store. */
|
|
5559
5554
|
const SOURCE_ID = "companion:explicit-kit";
|
|
@@ -5574,16 +5569,16 @@ function assertCompanionKitContributions(target, installed) {
|
|
|
5574
5569
|
});
|
|
5575
5570
|
const key = (contribution) => JSON.stringify(contribution);
|
|
5576
5571
|
const available = new Set(contributions(installed).map(key));
|
|
5577
|
-
for (const contribution of contributions(target)) if (!available.has(key(contribution))) throw new Error(`Install and verify the required Host ${contribution.kind} contribution ${contribution.id} for Bundle authority ${contribution.authority} before selecting
|
|
5572
|
+
for (const contribution of contributions(target)) if (!available.has(key(contribution))) throw new Error(`Install and verify the required Host ${contribution.kind} contribution ${contribution.id} for Bundle authority ${contribution.authority} before selecting this Kit.`);
|
|
5578
5573
|
}
|
|
5579
5574
|
/** Sources are host-selected; authored manifests cannot grant installation trust. */
|
|
5580
5575
|
function createCompanionContentLibrary({ fs, kitRoot, stateRoot, trustedContentSources }) {
|
|
5581
5576
|
const store = new DesignContentStore(stateRoot);
|
|
5582
5577
|
let installed;
|
|
5578
|
+
let studio;
|
|
5583
5579
|
const loadInstalled = async () => {
|
|
5584
5580
|
const location = await resolveDesignKitPackage(fs, kitRoot) ?? kitRoot;
|
|
5585
5581
|
const ownedRoot = typeof location === "string" ? location : location.rootDir;
|
|
5586
|
-
if (await fs.readText(typeof location === "string" ? join(ownedRoot, "kit.yaml") : location.manifestPath ?? join(ownedRoot, "kit.yaml")) === void 0) return loadDesignKit(fs, location, { sourceId: SOURCE_ID });
|
|
5587
5582
|
const bundleRoot = typeof location !== "string" && location.bundlesDir ? location.bundlesDir : join(dirname(dirname(ownedRoot)), "bundles");
|
|
5588
5583
|
const resolveBundle = trustedContentSources ? async (pin) => {
|
|
5589
5584
|
const source = trustedContentSources.bundles.find((entry) => entry.name === pin.name && entry.version === pin.version);
|
|
@@ -5592,25 +5587,11 @@ function createCompanionContentLibrary({ fs, kitRoot, stateRoot, trustedContentS
|
|
|
5592
5587
|
rootDir: bundleRoot,
|
|
5593
5588
|
sourceId: SOURCE_ID
|
|
5594
5589
|
}]);
|
|
5595
|
-
return
|
|
5590
|
+
return loadDesignKit(fs, location, {
|
|
5596
5591
|
sourceId: trustedContentSources?.sourceId ?? SOURCE_ID,
|
|
5597
5592
|
resolveBundle
|
|
5598
5593
|
});
|
|
5599
5594
|
};
|
|
5600
|
-
const sameFiles = async (root, files) => {
|
|
5601
|
-
const actual = /* @__PURE__ */ new Map();
|
|
5602
|
-
const walk = async (dir) => {
|
|
5603
|
-
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
5604
|
-
const path = join(dir, entry.name);
|
|
5605
|
-
if (entry.isSymbolicLink()) throw new Error("Retained content contains a symlink.");
|
|
5606
|
-
if (entry.isDirectory()) await walk(path);
|
|
5607
|
-
else if (entry.isFile()) actual.set(relative(root, path).split(sep).join("/"), await readFile(path));
|
|
5608
|
-
else throw new Error("Retained content contains a non-regular resource.");
|
|
5609
|
-
}
|
|
5610
|
-
};
|
|
5611
|
-
await walk(root);
|
|
5612
|
-
return actual.size === files.length && files.every((file) => actual.get(file.path)?.equals(Buffer.from(file.base64, "base64")));
|
|
5613
|
-
};
|
|
5614
5595
|
return {
|
|
5615
5596
|
store,
|
|
5616
5597
|
loadInstalled: () => installed ??= loadInstalled().catch((error) => {
|
|
@@ -5622,9 +5603,19 @@ function createCompanionContentLibrary({ fs, kitRoot, stateRoot, trustedContentS
|
|
|
5622
5603
|
installed = Promise.resolve(value);
|
|
5623
5604
|
return value;
|
|
5624
5605
|
},
|
|
5606
|
+
/** The shared Studio store owns current library edits; projects take a copy. */
|
|
5607
|
+
async studio() {
|
|
5608
|
+
return studio ??= import("./studio-CS5TyoYn.mjs").then(({ createCompanionStudio }) => createCompanionStudio(() => this.loadInstalled(), kitRoot, stateRoot, this)).catch((error) => {
|
|
5609
|
+
studio = void 0;
|
|
5610
|
+
throw error;
|
|
5611
|
+
});
|
|
5612
|
+
},
|
|
5613
|
+
async loadCurrentKit(pin) {
|
|
5614
|
+
return (await this.studio()).loadCurrentKit(pin);
|
|
5615
|
+
},
|
|
5625
5616
|
/** Discovery labels only: no Bundle loading, validation or immutable retention. */
|
|
5626
5617
|
async availableMindsetNames() {
|
|
5627
|
-
const names = (await
|
|
5618
|
+
const names = (await (await this.studio()).listInstances({ kind: "kit" })).flatMap((record) => record.kit ? [record.kit.name] : []);
|
|
5628
5619
|
const location = await resolveDesignKitPackage(fs, kitRoot) ?? kitRoot;
|
|
5629
5620
|
const sourceRoot = typeof location === "string" ? location : location.rootDir;
|
|
5630
5621
|
const path = typeof location === "string" ? join(location, "mindset.md") : location.mindsetPath;
|
|
@@ -5643,88 +5634,21 @@ function createCompanionContentLibrary({ fs, kitRoot, stateRoot, trustedContentS
|
|
|
5643
5634
|
}
|
|
5644
5635
|
return [...new Set(names)].sort();
|
|
5645
5636
|
},
|
|
5646
|
-
/**
|
|
5637
|
+
/** Current library identities; old retained definitions only seed old projects. */
|
|
5647
5638
|
async availableKits() {
|
|
5648
|
-
const
|
|
5649
|
-
|
|
5639
|
+
const base = await this.loadInstalled();
|
|
5640
|
+
const entries = /* @__PURE__ */ new Map([[base.name, base]]);
|
|
5641
|
+
for (const record of await (await this.studio()).listInstances({ kind: "kit" })) if (record.kit) entries.set(record.kit.name, {
|
|
5642
|
+
...record.kit,
|
|
5643
|
+
description: record.description
|
|
5644
|
+
});
|
|
5645
|
+
return [...entries.values()];
|
|
5650
5646
|
},
|
|
5651
|
-
/** New selection only;
|
|
5647
|
+
/** New selection only; existing projects read their own current source tree. */
|
|
5652
5648
|
async latestInstalled(name) {
|
|
5653
5649
|
const selectedName = name ?? (await this.loadInstalled()).name;
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
/** Prepared inert bytes only: staging is private and never runs dependency scripts. */
|
|
5657
|
-
async adoptPrepared(prepared) {
|
|
5658
|
-
if (!prepared.validation?.valid || !prepared.contents?.length) throw new Error("Only a validated content archive can be adopted.");
|
|
5659
|
-
await mkdir(stateRoot, { recursive: true });
|
|
5660
|
-
const staging = await mkdtemp(join(stateRoot, "content-import-"));
|
|
5661
|
-
const sourceId = `import:${createHash("sha256").update(JSON.stringify(prepared.archive)).digest("hex")}`;
|
|
5662
|
-
let staged = [];
|
|
5663
|
-
let total = 0, count = 0;
|
|
5664
|
-
try {
|
|
5665
|
-
for (const [index, unit] of prepared.contents.entries()) {
|
|
5666
|
-
const rootDir = join(staging, String(index));
|
|
5667
|
-
await mkdir(rootDir);
|
|
5668
|
-
for (const file of unit.files) {
|
|
5669
|
-
if (typeof file.path !== "string" || /[\\:\u0000]/.test(file.path) || file.path.split("/").some((part) => !part || [
|
|
5670
|
-
".",
|
|
5671
|
-
"..",
|
|
5672
|
-
".git",
|
|
5673
|
-
"node_modules"
|
|
5674
|
-
].includes(part))) throw new Error("Unsafe imported resource path.");
|
|
5675
|
-
const target = resolve(rootDir, file.path), rel = relative(rootDir, target);
|
|
5676
|
-
if (isAbsolute(rel) || rel.startsWith(`..${sep}`) || rel === "..") throw new Error("Imported resource escapes its content root.");
|
|
5677
|
-
const bytes = Buffer.from(file.base64, "base64");
|
|
5678
|
-
if (++count > 4096 || (total += bytes.length) > 16777216) throw new Error("Imported content exceeds bounded archive limits.");
|
|
5679
|
-
await mkdir(dirname(target), { recursive: true });
|
|
5680
|
-
await writeFile(target, bytes, {
|
|
5681
|
-
flag: "wx",
|
|
5682
|
-
mode: 384
|
|
5683
|
-
});
|
|
5684
|
-
}
|
|
5685
|
-
staged.push({
|
|
5686
|
-
...unit,
|
|
5687
|
-
rootDir
|
|
5688
|
-
});
|
|
5689
|
-
}
|
|
5690
|
-
staged = await normalizeLegacyKitImport(staged, {
|
|
5691
|
-
stagingRoot: staging,
|
|
5692
|
-
sourceId
|
|
5693
|
-
});
|
|
5694
|
-
const bundles = /* @__PURE__ */ new Map();
|
|
5695
|
-
for (const unit of staged.filter((unit) => unit.kind === "bundle")) {
|
|
5696
|
-
const existing = await store.resolveBundle(unit.pin);
|
|
5697
|
-
if (existing && !await sameFiles(existing.resourceRoot, unit.files)) throw new Error("Imported Bundle conflicts with an existing exact version.");
|
|
5698
|
-
const content = existing ?? await loadDesignBundle(fs, {
|
|
5699
|
-
rootDir: unit.rootDir,
|
|
5700
|
-
sourceId
|
|
5701
|
-
}, unit.pin);
|
|
5702
|
-
bundles.set(`${unit.pin.name}@${unit.pin.version}`, content);
|
|
5703
|
-
}
|
|
5704
|
-
const kit = staged.find((unit) => unit.kind === "kit");
|
|
5705
|
-
if (kit) {
|
|
5706
|
-
const existing = await store.loadRetainedKit(kit.pin);
|
|
5707
|
-
if (existing && !await sameFiles(existing.sourceRoot, kit.files)) throw new Error("Imported Kit conflicts with an existing exact version.");
|
|
5708
|
-
if (!existing) await store.retainKitClosure(kit.rootDir, {
|
|
5709
|
-
sourceId,
|
|
5710
|
-
resolveBundle: (pin) => bundles.get(`${pin.name}@${pin.version}`)
|
|
5711
|
-
});
|
|
5712
|
-
} else for (const unit of staged) {
|
|
5713
|
-
const existing = await store.resolveBundle(unit.pin);
|
|
5714
|
-
if (existing) {
|
|
5715
|
-
if (!await sameFiles(existing.resourceRoot, unit.files)) throw new Error("Imported Bundle conflicts with an existing exact version.");
|
|
5716
|
-
} else await store.retainBundle(unit.rootDir, { sourceId }, unit.pin);
|
|
5717
|
-
}
|
|
5718
|
-
return {
|
|
5719
|
-
contents: staged.map(({ kind, pin }) => ({
|
|
5720
|
-
kind,
|
|
5721
|
-
pin
|
|
5722
|
-
})),
|
|
5723
|
-
executionGranted: false
|
|
5724
|
-
};
|
|
5725
|
-
} finally {
|
|
5726
|
-
if ((await lstat(staging)).isDirectory()) await rm(staging, { recursive: true });
|
|
5727
|
-
}
|
|
5650
|
+
const pin = (await this.availableKits()).find((kit) => kit.name === selectedName);
|
|
5651
|
+
return pin ? this.loadCurrentKit(pin) : void 0;
|
|
5728
5652
|
},
|
|
5729
5653
|
async resolveProject(pin) {
|
|
5730
5654
|
if (pin) {
|
|
@@ -6166,18 +6090,6 @@ const companionFs = {
|
|
|
6166
6090
|
};
|
|
6167
6091
|
const gitSpawn = nodeDesignProjectSpawn;
|
|
6168
6092
|
async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connection, getConnectionPath, statusEntryPath, trustedContentSources, workbuddyProducer = false, getMainAssessmentContext, nativeCwd, transcriptPath }) {
|
|
6169
|
-
const adoptionGit = new GitVersioning(gitSpawn, projectRoot);
|
|
6170
|
-
const recordAdoption = async (receipt, journalOwner) => {
|
|
6171
|
-
const metadata = parseDesignProjectJson(await adoptionGit.readTextAt(receipt.checkpoint, "project.json"));
|
|
6172
|
-
if (metadata.id !== receipt.projectId || !metadata.kit) throw new Error("Content adoption receipt/project mismatch.");
|
|
6173
|
-
await recordProjectContentAdoption(new DesignJournalStorage(join(stateRoot, metadata.id)), journalOwner ?? `${connection.host ?? "codex"}:${connection.threadId}`, receipt, metadata.kit);
|
|
6174
|
-
};
|
|
6175
|
-
await new ProjectContentTransaction({
|
|
6176
|
-
root: projectRoot,
|
|
6177
|
-
spawn: gitSpawn,
|
|
6178
|
-
mutate: (operation) => operation(),
|
|
6179
|
-
record: recordAdoption
|
|
6180
|
-
}).recover();
|
|
6181
6093
|
let project = await new DesignProjectManager().open(projectRoot);
|
|
6182
6094
|
const fs = companionFs;
|
|
6183
6095
|
const contentLibrary = createCompanionContentLibrary({
|
|
@@ -6186,9 +6098,13 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6186
6098
|
stateRoot,
|
|
6187
6099
|
trustedContentSources
|
|
6188
6100
|
});
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6101
|
+
const readDefinition = async (metadata) => metadata.kit ? ensureProjectKit(projectRoot, { loadSource: () => contentLibrary.resolveExactProject(metadata.kit) }) : contentLibrary.loadInstalled().then((kit) => ({
|
|
6102
|
+
kit,
|
|
6103
|
+
revision: projectKitContentHash(kit)
|
|
6104
|
+
}));
|
|
6105
|
+
const initialDefinition = await readDefinition(project.metadata);
|
|
6106
|
+
let kit = initialDefinition.kit;
|
|
6107
|
+
let kitRevision = initialDefinition.revision;
|
|
6192
6108
|
let kitReload = {
|
|
6193
6109
|
status: "ready",
|
|
6194
6110
|
revision: kitRevision
|
|
@@ -6196,7 +6112,7 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6196
6112
|
const accessFor = (pin) => !pin ? {
|
|
6197
6113
|
mode: "unconfigured",
|
|
6198
6114
|
writable: false
|
|
6199
|
-
} : pin.name === kit.name
|
|
6115
|
+
} : pin.name === kit.name ? {
|
|
6200
6116
|
mode: "writable",
|
|
6201
6117
|
writable: true,
|
|
6202
6118
|
kit: { ...pin }
|
|
@@ -6208,15 +6124,16 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6208
6124
|
let access = accessFor(project.metadata.kit);
|
|
6209
6125
|
const assertWritable = () => {
|
|
6210
6126
|
if (access.writable) return kit;
|
|
6211
|
-
throw new Error(access.mode === "unconfigured" ? "No Kit is active. Select a mindset in the native Design command before starting Bundle work; this Panel can remain open." : `The
|
|
6127
|
+
throw new Error(access.mode === "unconfigured" ? "No Kit is active. Select a mindset in the native Design command before starting Bundle work; this Panel can remain open." : `The project's Kit ${access.kit.name} is unavailable. Check its project-local definition files before editing.`);
|
|
6212
6128
|
};
|
|
6213
6129
|
const refreshAccess = async (displayOnly = false) => {
|
|
6214
6130
|
const manager = new DesignProjectManager();
|
|
6215
6131
|
const current = displayOnly ? await manager.readMetadata(projectRoot) : await manager.open(projectRoot);
|
|
6216
6132
|
if (current.metadata.id !== project.metadata.id) throw new Error("Project identity changed. Reopen the Companion explicitly.");
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6133
|
+
const resolved = await readDefinition(current.metadata);
|
|
6134
|
+
if (resolved.revision !== kitRevision || !sameProjectContentPin(current.metadata.kit, project.metadata.kit)) {
|
|
6135
|
+
kit = resolved.kit;
|
|
6136
|
+
kitRevision = resolved.revision;
|
|
6220
6137
|
projection = void 0;
|
|
6221
6138
|
continuationCache = void 0;
|
|
6222
6139
|
publishedSnapshot = void 0;
|
|
@@ -6262,7 +6179,7 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6262
6179
|
const requireSkill = (name) => {
|
|
6263
6180
|
assertWritable();
|
|
6264
6181
|
const skill = kit.skills.find((item) => item.name === name);
|
|
6265
|
-
if (!skill) throw new Error("Unknown Bundle in the
|
|
6182
|
+
if (!skill) throw new Error("Unknown Bundle in the project Kit.");
|
|
6266
6183
|
return skill;
|
|
6267
6184
|
};
|
|
6268
6185
|
const requireArtifact = (path) => {
|
|
@@ -6318,6 +6235,9 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6318
6235
|
refreshAccess,
|
|
6319
6236
|
requireWritable,
|
|
6320
6237
|
contentLibrary,
|
|
6238
|
+
get definitionRevision() {
|
|
6239
|
+
return kitRevision;
|
|
6240
|
+
},
|
|
6321
6241
|
mutateKnowledge: mutate,
|
|
6322
6242
|
mutateAssessment: mutate,
|
|
6323
6243
|
async readGit(params, signal) {
|
|
@@ -6333,57 +6253,15 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6333
6253
|
signal?.throwIfAborted();
|
|
6334
6254
|
return result;
|
|
6335
6255
|
},
|
|
6336
|
-
createContentMigration({ assertQuiescent, verifyNativeProducer }) {
|
|
6337
|
-
return new ProjectContentMigration({
|
|
6338
|
-
root: project.root,
|
|
6339
|
-
stateRoot: join(stateRoot, project.metadata.id),
|
|
6340
|
-
spawn: gitSpawn,
|
|
6341
|
-
mutate,
|
|
6342
|
-
journalOwner: journalId,
|
|
6343
|
-
resolveKit: (pin) => contentLibrary.resolveExactProject(pin),
|
|
6344
|
-
assertQuiescent,
|
|
6345
|
-
verifyNativeProducer,
|
|
6346
|
-
record: recordAdoption,
|
|
6347
|
-
assertCompatible(target) {
|
|
6348
|
-
assertCompanionKitContributions(target, kit);
|
|
6349
|
-
},
|
|
6350
|
-
async validate(target, files) {
|
|
6351
|
-
for (const path of files.keys()) {
|
|
6352
|
-
const canonical = /^design_files\/([^/]+)\/\1\.json$/u.exec(path);
|
|
6353
|
-
if (canonical && !target.skills.some((skill) => skill.name === canonical[1])) throw new Error(`Upgrade cannot orphan saved canonical source ${path}.`);
|
|
6354
|
-
}
|
|
6355
|
-
for (const skill of target.skills) {
|
|
6356
|
-
const bytes = files.get(`design_files/${skill.name}/${skill.name}.json`);
|
|
6357
|
-
if (!bytes) continue;
|
|
6358
|
-
const state = JSON.parse(Buffer.from(bytes).toString("utf8"));
|
|
6359
|
-
const issues = await validateSkillDesign(skill, state, {
|
|
6360
|
-
scopes: ["state"],
|
|
6361
|
-
artifactText: async (path) => {
|
|
6362
|
-
const bytes = files.get(`design_files/${path}`);
|
|
6363
|
-
return bytes === void 0 ? void 0 : Buffer.from(bytes).toString("utf8");
|
|
6364
|
-
}
|
|
6365
|
-
});
|
|
6366
|
-
if (issues.length) throw new Error(JSON.stringify(issues));
|
|
6367
|
-
}
|
|
6368
|
-
}
|
|
6369
|
-
});
|
|
6370
|
-
},
|
|
6371
6256
|
prepareAutoPanel: (request) => autoTickets.prepare(request),
|
|
6372
6257
|
submitAutoPanel: (request) => autoTickets.submit(request),
|
|
6373
6258
|
async reloadKit() {
|
|
6374
6259
|
return mutate(async () => {
|
|
6375
6260
|
try {
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
if (candidate.name !== kit.name || candidate.version !== kit.version) throw new Error("Kit identity/version changed. Reopen explicitly; content reload cannot upgrade the pinned Kit.");
|
|
6379
|
-
const revision = definitionRevision(candidate);
|
|
6380
|
-
const changed = revision !== kitRevision;
|
|
6381
|
-
if (changed) {
|
|
6382
|
-
kit = candidate;
|
|
6383
|
-
kitRevision = revision;
|
|
6384
|
-
}
|
|
6261
|
+
const previous = kitRevision;
|
|
6262
|
+
await refreshAccess();
|
|
6385
6263
|
kitReload = {
|
|
6386
|
-
status:
|
|
6264
|
+
status: previous !== kitRevision ? "updated" : "unchanged",
|
|
6387
6265
|
revision: kitRevision
|
|
6388
6266
|
};
|
|
6389
6267
|
} catch (error) {
|
|
@@ -6409,7 +6287,7 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6409
6287
|
skill: name,
|
|
6410
6288
|
projectRoot: project.root,
|
|
6411
6289
|
designFiles: project.designFilesRoot,
|
|
6412
|
-
kitRoot,
|
|
6290
|
+
kitRoot: kit.sourceRoot,
|
|
6413
6291
|
stateRoot,
|
|
6414
6292
|
cliEntry: statusEntryPath
|
|
6415
6293
|
});
|
|
@@ -6422,14 +6300,15 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6422
6300
|
},
|
|
6423
6301
|
designFiles: project.designFilesRoot,
|
|
6424
6302
|
resources: skill.resourceRoot ?? join(kitRoot, "skills", name),
|
|
6425
|
-
mindset: join(kit.sourceRoot ?? kitRoot, "mindset.md"),
|
|
6303
|
+
mindset: kit.sourceLocation?.mindsetPath ?? join(kit.sourceRoot ?? kitRoot, "mindset.md"),
|
|
6426
6304
|
executionContract,
|
|
6427
|
-
|
|
6305
|
+
definitionRevision: kitRevision,
|
|
6306
|
+
method: `${executionContract.instructions}\n\n# Current project Bundle method (unaltered)\n\n${skill.content}`,
|
|
6428
6307
|
host: `${connection.host ?? "codex"}-native`,
|
|
6429
6308
|
execution
|
|
6430
6309
|
};
|
|
6431
6310
|
},
|
|
6432
|
-
async settleBundle({ skill: name, invocationId, scope = "completion", outcome }) {
|
|
6311
|
+
async settleBundle({ skill: name, invocationId, scope = "completion", outcome, definitionRevision }) {
|
|
6433
6312
|
return mutate(async () => {
|
|
6434
6313
|
await requireWritable();
|
|
6435
6314
|
const skill = requireSkill(name);
|
|
@@ -6442,6 +6321,10 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6442
6321
|
eventId: invocationId,
|
|
6443
6322
|
outcome
|
|
6444
6323
|
});
|
|
6324
|
+
const checkDefinition = () => {
|
|
6325
|
+
if (definitionRevision !== void 0 && definitionRevision !== kitRevision) throw new Error("The project Bundle definitions changed during this invocation. Re-read the current method and repair the existing files before starting another invocation.");
|
|
6326
|
+
};
|
|
6327
|
+
checkDefinition();
|
|
6445
6328
|
if (!["state", "completion"].includes(scope)) throw new Error("Invalid validation scope.");
|
|
6446
6329
|
const state = await store.read(name);
|
|
6447
6330
|
if (!state) throw new Error("Canonical Design JSON is missing.");
|
|
@@ -6460,6 +6343,8 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6460
6343
|
handoff: scope === "state" ? skill.execution.handoff : "none",
|
|
6461
6344
|
outcome: scope === "state" ? "pause" : "complete"
|
|
6462
6345
|
};
|
|
6346
|
+
await refreshAccess();
|
|
6347
|
+
checkDefinition();
|
|
6463
6348
|
return store.write(name, state, {
|
|
6464
6349
|
origin: "agent",
|
|
6465
6350
|
artifacts,
|
|
@@ -6825,7 +6710,7 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6825
6710
|
byteLength: bytes?.length ?? 0
|
|
6826
6711
|
};
|
|
6827
6712
|
},
|
|
6828
|
-
async sendPrompt({ text, requestId, saved }) {
|
|
6713
|
+
async sendPrompt({ text, requestId, saved, studio, verifyStudio }) {
|
|
6829
6714
|
await refreshAccess();
|
|
6830
6715
|
if (typeof text !== "string" || !text.trim()) throw new Error("Message is required.");
|
|
6831
6716
|
if (/^\/(?:yugoo|design)(?:\s|$)/u.test(text)) throw new Error("Project management commands are not connected in this first companion slice. Use the bound project.");
|
|
@@ -6833,7 +6718,7 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6833
6718
|
const attempt = await savedContinuation.begin({
|
|
6834
6719
|
text,
|
|
6835
6720
|
requestId,
|
|
6836
|
-
saved,
|
|
6721
|
+
saved: studio ? [] : saved,
|
|
6837
6722
|
kitHash
|
|
6838
6723
|
});
|
|
6839
6724
|
if (attempt.prior) return attempt.prior;
|
|
@@ -6848,8 +6733,28 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6848
6733
|
const assessment = getMainAssessmentContext && attempt.entries.length ? await getMainAssessmentContext(attempt.entries) : void 0;
|
|
6849
6734
|
await refreshAccess();
|
|
6850
6735
|
if (notificationKitHash() !== kitHash) throw Error("Project Kit changed before notification. Reopen the current project.");
|
|
6736
|
+
if (studio) {
|
|
6737
|
+
if (typeof verifyStudio !== "function") throw Error("Studio context must be verified by the bound service.");
|
|
6738
|
+
await verifyStudio();
|
|
6739
|
+
}
|
|
6851
6740
|
dispatched = true;
|
|
6852
|
-
|
|
6741
|
+
const studioPrompt = studio ? [
|
|
6742
|
+
"Studio Kit/Bundle customization in this exact main conversation. This request concerns reusable authoring source, not the running Design Project or its Design Files.",
|
|
6743
|
+
`Working-copy target: ${JSON.stringify({
|
|
6744
|
+
id: studio.id,
|
|
6745
|
+
expectedRevision: studio.expectedRevision,
|
|
6746
|
+
kind: studio.kind,
|
|
6747
|
+
title: studio.title,
|
|
6748
|
+
...studio.bundle ? { bundle: studio.bundle } : {}
|
|
6749
|
+
})}. Read this exact copy with design_studio_customize before proposing changes; a changed revision or preview pin requires reopening, never guessing another target. For a Kit, include the exact selected preview Bundle pin only when this request has one. Kit-owned source authoring may omit it; never select a first or latest mount to fill an absent pin.`,
|
|
6750
|
+
...studio.context ? [`Current editing intent: ${JSON.stringify(studio.context)}. This is editor focus, not additional file/save authority. Read the current saved file through the exact working-copy tools; preserve human edits and ask for clarification if their intended scope is unclear.`] : [],
|
|
6751
|
+
"Read the installed design-bundle-creator skill for Bundle changes or design-kit-creator for Kit changes; use design-skill-creator when revising professional methods and output contracts. These are authoring methods; the working copy's SKILL.md describes execution of that Bundle and is not a substitute. Read relevant saved methods/contracts through the exact working-copy file list instead of guessing paths. For Panel/component changes, use design-component and design_list_panel_components to discover the actual installed vocabulary, then its exact name with reference=contract/docs/examples for parameters and guidance. If a required tool or authoring method is unavailable, report that limit rather than inventing APIs or component parameters.",
|
|
6752
|
+
`Use design_studio_customize with action prepareChanges and top-level authoringRequestId ${JSON.stringify(attempt.requestId)} so the same S2 candidate can be reviewed in Studio. Preparation does not save. Save only when the user explicitly authorizes it, using the same request and digest through saveChanges. Do not publish, install, edit the running Design Files, launch a Bundle/GRA, or create another model/session.`,
|
|
6753
|
+
...connectionPath ? [`Exact Companion connection file: ${JSON.stringify(connectionPath)}. Pass only this path to the tool; never read or expose its contents or choose a latest connection.`] : [],
|
|
6754
|
+
"If the customization tool is unavailable in this host, report that limitation. Message acceptance is not proof that authoring or saving completed.",
|
|
6755
|
+
text
|
|
6756
|
+
] : void 0;
|
|
6757
|
+
result = await connection.send(studioPrompt ? studioPrompt.join("\n\n") : [
|
|
6853
6758
|
`Design Project: ${project.metadata.name}\nDesign Files: ${project.designFilesRoot}\nKit: ${project.metadata.kit ? `${project.metadata.kit.name}@${project.metadata.kit.version}` : "not selected"}\nAccess: ${access.mode}`,
|
|
6854
6759
|
...!access.writable ? ["Select an available Kit for an unconfigured project, or restore the exact pinned Kit for recovery. Do not start Bundle generation or reviews until workspace access is writable."] : [],
|
|
6855
6760
|
connection.host === "workbuddy" && workbuddyProducer ? "WorkBuddy supports serial foreground native Producers through its yugoo Skill bootstrap/register/resume sequence. Follow the exact declared Bundle execution mode. Workers remain unsupported; GRA follows the shared execution choice, not Bundle placement. Do not launch replacement models." : connection.host === "workbuddy" ? "WorkBuddy adapter currently supports explicitly main-mode Bundles only. Native Producer/Worker execution is unavailable; do not launch replacements or change Bundle execution mode. Use the exact connection for main Bundle prepare/begin/finish and saved-state readback. GRA follows the separate shared execution choice." : connection.host === "qwenwork" ? "Follow the QwenWork native-execution reference for the declared foreground Bundle path and GRA. Read this exact connection's design_status.hostCapabilities and reviewPolicy; only current ready capability and an authorized dispatch reference permit a background launch." : "Use the Design Panel plugin native-execution reference for Bundle work: native Producer/Worker subagents, not DSH-only tool names. GRA is never a prerequisite for foreground design work.",
|
|
@@ -6857,7 +6762,7 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6857
6762
|
...notes.map(([, note]) => note),
|
|
6858
6763
|
...assessment ? [assessment] : [],
|
|
6859
6764
|
...connectionPath ? [`Exact Companion connection file: ${JSON.stringify(connectionPath)}. Pass the path only; do not read, print, or copy its token or file contents. Never search for a latest/global connection.`, ...statusEntryPath ? [`If design_status is not available in this host, use the existing installed CLI: node ${JSON.stringify(statusEntryPath)} call --connection ${JSON.stringify(connectionPath)} --request /absolute/temporary-status-request.json. The temporary request must contain {"method":"readWorkspace","params":{}}; inspect reviews and reviewPolicy once. Do not install tools or scan unrelated connections.`] : []] : [],
|
|
6860
|
-
...notes.length ? ["After this Panel save, read design_status once.
|
|
6765
|
+
...notes.length ? [...assessment ? [] : [DESIGN_PANEL_SAVE_ASSESSMENT_GUIDANCE], "After this Panel save, read design_status once. Complete planned edits before preparing a manual review batch. A due review is not an instruction to start another review or repeatedly ask for consent. Follow the native-execution reference and the user's execution choice; do not wait for background GRA, busy-poll, or automatically retry failed reviews."] : [],
|
|
6861
6766
|
"Read the current Design Files when this notification has no save diff (for example after restarting the companion). File bytes are authoritative; do not reapply already saved edits.",
|
|
6862
6767
|
text
|
|
6863
6768
|
].join("\n\n"), {
|
|
@@ -6885,7 +6790,7 @@ async function openCompanionProject({ projectRoot, kitRoot, stateRoot, connectio
|
|
|
6885
6790
|
await refreshAccess();
|
|
6886
6791
|
return {
|
|
6887
6792
|
mindset: access.writable ? kit.name : void 0,
|
|
6888
|
-
mindsetMethod: access.writable ? join(kit.sourceRoot ?? kitRoot, "mindset.md") : void 0,
|
|
6793
|
+
mindsetMethod: access.writable ? kit.sourceLocation?.mindsetPath ?? join(kit.sourceRoot ?? kitRoot, "mindset.md") : void 0,
|
|
6889
6794
|
skills: (access.writable ? kit.skills : []).map((skill) => ({
|
|
6890
6795
|
id: skill.name,
|
|
6891
6796
|
description: skill.description,
|
|
@@ -7661,7 +7566,7 @@ function createCompanionReviews({ project, stateRoot, threadId, host = "codex",
|
|
|
7661
7566
|
}));
|
|
7662
7567
|
};
|
|
7663
7568
|
const readClarity = async (workspace) => {
|
|
7664
|
-
const authority = await
|
|
7569
|
+
const authority = await readCommittedDesignClarityAuthority(project.project.root, projectId);
|
|
7665
7570
|
if (!authority) return {
|
|
7666
7571
|
assessment: null,
|
|
7667
7572
|
needsReassessment: true
|
|
@@ -8227,912 +8132,6 @@ async function createCompanionSettings(stateRoot) {
|
|
|
8227
8132
|
};
|
|
8228
8133
|
}
|
|
8229
8134
|
//#endregion
|
|
8230
|
-
//#region packages/studio/src/composition.ts
|
|
8231
|
-
function pinKey(name, version) {
|
|
8232
|
-
return `${name}\u0000${version}`;
|
|
8233
|
-
}
|
|
8234
|
-
function comparePins(left, right) {
|
|
8235
|
-
if (left.name !== right.name) return left.name < right.name ? -1 : 1;
|
|
8236
|
-
if (left.version === right.version) return 0;
|
|
8237
|
-
return left.version < right.version ? -1 : 1;
|
|
8238
|
-
}
|
|
8239
|
-
/**
|
|
8240
|
-
* Derive the flat searchable Bundle catalog and reverse dependencies.
|
|
8241
|
-
* @param snapshot - authoritative Core-compiled installed catalog snapshot.
|
|
8242
|
-
* @returns a frozen derived catalog; identical Bundle pins are coalesced.
|
|
8243
|
-
*/
|
|
8244
|
-
function buildStudioCompositionCatalog(snapshot) {
|
|
8245
|
-
const entries = /* @__PURE__ */ new Map();
|
|
8246
|
-
const kits = [];
|
|
8247
|
-
for (const bundle of snapshot.bundles ?? []) {
|
|
8248
|
-
const key = pinKey(bundle.name, bundle.version);
|
|
8249
|
-
if (entries.has(key)) throw new Error(`studio.duplicate_bundle: ${bundle.name}@${bundle.version}`);
|
|
8250
|
-
entries.set(key, {
|
|
8251
|
-
bundle,
|
|
8252
|
-
usedBy: []
|
|
8253
|
-
});
|
|
8254
|
-
}
|
|
8255
|
-
for (const kit of snapshot.kits) {
|
|
8256
|
-
const kitPin = Object.freeze({
|
|
8257
|
-
name: kit.name,
|
|
8258
|
-
version: kit.version
|
|
8259
|
-
});
|
|
8260
|
-
kits.push(kitPin);
|
|
8261
|
-
for (const bundle of kit.bundles) {
|
|
8262
|
-
const key = pinKey(bundle.name, bundle.version);
|
|
8263
|
-
const current = entries.get(key);
|
|
8264
|
-
if (current === void 0 && snapshot.bundles !== void 0) throw new Error(`studio.missing_bundle: ${kit.name}@${kit.version} references ${bundle.name}@${bundle.version}`);
|
|
8265
|
-
if (current === void 0) entries.set(key, {
|
|
8266
|
-
bundle,
|
|
8267
|
-
usedBy: [kitPin]
|
|
8268
|
-
});
|
|
8269
|
-
else current.usedBy.push(kitPin);
|
|
8270
|
-
}
|
|
8271
|
-
}
|
|
8272
|
-
const bundles = [...entries.values()].map(({ bundle, usedBy }) => Object.freeze({
|
|
8273
|
-
name: bundle.name,
|
|
8274
|
-
version: bundle.version,
|
|
8275
|
-
definition: bundle.definition,
|
|
8276
|
-
usedBy: Object.freeze([...usedBy].sort(comparePins))
|
|
8277
|
-
})).sort(comparePins);
|
|
8278
|
-
return Object.freeze({
|
|
8279
|
-
bundles: Object.freeze(bundles),
|
|
8280
|
-
kits: Object.freeze(kits.sort(comparePins))
|
|
8281
|
-
});
|
|
8282
|
-
}
|
|
8283
|
-
/**
|
|
8284
|
-
* Search Bundle name and description in deterministic catalog order.
|
|
8285
|
-
* @param catalog - derived flat catalog.
|
|
8286
|
-
* @param query - case-insensitive trimmed text; empty returns the full catalog.
|
|
8287
|
-
* @returns matching immutable catalog entries.
|
|
8288
|
-
*/
|
|
8289
|
-
function searchStudioBundles(catalog, query) {
|
|
8290
|
-
const normalized = query.trim().toLowerCase();
|
|
8291
|
-
if (normalized === "") return catalog.bundles;
|
|
8292
|
-
return Object.freeze(catalog.bundles.filter((entry) => entry.name.toLowerCase().includes(normalized) || entry.definition.description.toLowerCase().includes(normalized) || Object.values(entry.definition.title ?? {}).some((text) => text.toLowerCase().includes(normalized)) || Object.values(entry.definition.pickerDescription ?? {}).some((text) => text.toLowerCase().includes(normalized))));
|
|
8293
|
-
}
|
|
8294
|
-
//#endregion
|
|
8295
|
-
//#region packages/studio/src/management.ts
|
|
8296
|
-
function utf8ByteLength$1(text) {
|
|
8297
|
-
return new TextEncoder().encode(text).length;
|
|
8298
|
-
}
|
|
8299
|
-
/**
|
|
8300
|
-
* JSON-facing read-only Kit catalog and workspace inspection over the
|
|
8301
|
-
* authoritative Core-compiled catalog. The Studio never mutates installed
|
|
8302
|
-
* content: source files and the Design Core loader remain the only authorities.
|
|
8303
|
-
*/
|
|
8304
|
-
var StudioManagementService = class {
|
|
8305
|
-
#catalog;
|
|
8306
|
-
/** @param catalog - current authoritative installed Kit snapshot provider. */
|
|
8307
|
-
constructor(catalog) {
|
|
8308
|
-
this.#catalog = catalog;
|
|
8309
|
-
}
|
|
8310
|
-
/**
|
|
8311
|
-
* Build a detached, frozen, JSON-only browser view.
|
|
8312
|
-
* @param query - optional Bundle name/description search.
|
|
8313
|
-
* @returns current published Kit pins and the searched Bundle catalog.
|
|
8314
|
-
*/
|
|
8315
|
-
async workspace(query = "") {
|
|
8316
|
-
const snapshot = await this.#catalog.snapshot();
|
|
8317
|
-
const composition = buildStudioCompositionCatalog(snapshot);
|
|
8318
|
-
const normalizedQuery = query.trim();
|
|
8319
|
-
const kits = Object.freeze(composition.kits.map((kit) => {
|
|
8320
|
-
const definition = snapshot.kits.find((entry) => entry.name === kit.name && entry.version === kit.version).definition;
|
|
8321
|
-
return Object.freeze({
|
|
8322
|
-
name: kit.name,
|
|
8323
|
-
version: kit.version,
|
|
8324
|
-
...definition.description === void 0 ? {} : { description: definition.description },
|
|
8325
|
-
...definition.pickerDescription ? { displayDescription: Object.freeze({ ...definition.pickerDescription }) } : {}
|
|
8326
|
-
});
|
|
8327
|
-
}));
|
|
8328
|
-
const bundles = Object.freeze(searchStudioBundles(composition, normalizedQuery).map((bundle) => Object.freeze({
|
|
8329
|
-
name: bundle.name,
|
|
8330
|
-
version: bundle.version,
|
|
8331
|
-
description: bundle.definition.description,
|
|
8332
|
-
...bundle.definition.title ? { title: Object.freeze({ ...bundle.definition.title }) } : {},
|
|
8333
|
-
...bundle.definition.pickerDescription ? { displayDescription: Object.freeze({ ...bundle.definition.pickerDescription }) } : {},
|
|
8334
|
-
usedBy: Object.freeze(bundle.usedBy.map((kit) => Object.freeze({
|
|
8335
|
-
name: kit.name,
|
|
8336
|
-
version: kit.version
|
|
8337
|
-
})))
|
|
8338
|
-
})));
|
|
8339
|
-
return Object.freeze({
|
|
8340
|
-
query: normalizedQuery,
|
|
8341
|
-
kits,
|
|
8342
|
-
bundles
|
|
8343
|
-
});
|
|
8344
|
-
}
|
|
8345
|
-
/**
|
|
8346
|
-
* Read the Kit workspace view model for one exact installed Kit version.
|
|
8347
|
-
*
|
|
8348
|
-
* The view is JSON-only: the complete raw mindset.md source is exposed for
|
|
8349
|
-
* reading, mounts carry exact version pins plus their reverse Kit
|
|
8350
|
-
* references, and resources project only the paths the Core loader compiled
|
|
8351
|
-
* into the version. No Core-compiled definition object crosses into the view.
|
|
8352
|
-
* @param name - the Kit id.
|
|
8353
|
-
* @param version - exact installed Kit version.
|
|
8354
|
-
* @returns the frozen workspace view, or resolution diagnostics.
|
|
8355
|
-
*/
|
|
8356
|
-
async readKitWorkspace(name, version) {
|
|
8357
|
-
const snapshot = await this.#catalog.snapshot();
|
|
8358
|
-
const entry = snapshot.kits.find((kit) => kit.name === name && kit.version === version);
|
|
8359
|
-
if (entry === void 0) {
|
|
8360
|
-
const installed = snapshot.kits.filter((kit) => kit.name === name).map((kit) => kit.version);
|
|
8361
|
-
if (installed.length === 0) return Object.freeze({ diagnostics: Object.freeze([Object.freeze({
|
|
8362
|
-
code: "workspace.kit_missing",
|
|
8363
|
-
message: `Kit ${JSON.stringify(name)} is not installed`,
|
|
8364
|
-
subject: name
|
|
8365
|
-
})]) });
|
|
8366
|
-
return Object.freeze({ diagnostics: Object.freeze([Object.freeze({
|
|
8367
|
-
code: "workspace.version_missing",
|
|
8368
|
-
message: `Kit ${JSON.stringify(name)} version ${JSON.stringify(version)} is not installed; the installed versions are ${installed.map((candidate) => JSON.stringify(candidate)).join(", ")}`,
|
|
8369
|
-
subject: version
|
|
8370
|
-
})]) });
|
|
8371
|
-
}
|
|
8372
|
-
const definition = entry.definition;
|
|
8373
|
-
const mounts = Object.freeze(entry.bundles.map((bundle) => Object.freeze({
|
|
8374
|
-
name: bundle.name,
|
|
8375
|
-
version: bundle.version,
|
|
8376
|
-
description: bundle.definition.description,
|
|
8377
|
-
...bundle.definition.title ? { title: Object.freeze({ ...bundle.definition.title }) } : {},
|
|
8378
|
-
...bundle.definition.pickerDescription ? { displayDescription: Object.freeze({ ...bundle.definition.pickerDescription }) } : {},
|
|
8379
|
-
mountedBy: Object.freeze(snapshot.kits.filter((kit) => kit.bundles.some((candidate) => candidate.name === bundle.name && candidate.version === bundle.version)).map((kit) => Object.freeze({
|
|
8380
|
-
name: kit.name,
|
|
8381
|
-
version: kit.version
|
|
8382
|
-
})))
|
|
8383
|
-
})));
|
|
8384
|
-
const resources = Object.freeze(Object.entries(definition.resources).map(([path, content]) => Object.freeze({
|
|
8385
|
-
path,
|
|
8386
|
-
bytes: utf8ByteLength$1(content)
|
|
8387
|
-
})).sort((left, right) => left.path < right.path ? -1 : left.path > right.path ? 1 : 0));
|
|
8388
|
-
return Object.freeze({
|
|
8389
|
-
workspace: Object.freeze({
|
|
8390
|
-
name: entry.name,
|
|
8391
|
-
version: entry.version,
|
|
8392
|
-
description: definition.description ?? "",
|
|
8393
|
-
...definition.pickerDescription ? { displayDescription: Object.freeze({ ...definition.pickerDescription }) } : {},
|
|
8394
|
-
mindsetSource: definition.mindsetSource,
|
|
8395
|
-
mounts,
|
|
8396
|
-
resources,
|
|
8397
|
-
relationVocabulary: Object.freeze({
|
|
8398
|
-
schemaVersion: 1,
|
|
8399
|
-
pin: definition.relationVocabulary?.revision ?? "legacy-unavailable",
|
|
8400
|
-
relations: Object.freeze((definition.relationVocabulary?.relations ?? []).map((relation) => Object.freeze({
|
|
8401
|
-
type: relation.type,
|
|
8402
|
-
meaning: relation.meaning,
|
|
8403
|
-
direction: relation.direction,
|
|
8404
|
-
label: Object.freeze({ ...relation.label }),
|
|
8405
|
-
description: Object.freeze({ ...relation.description }),
|
|
8406
|
-
...relation.domain ? { domain: Object.freeze([...relation.domain]) } : {},
|
|
8407
|
-
...relation.range ? { range: Object.freeze([...relation.range]) } : {},
|
|
8408
|
-
...relation.inverse ? { inverse: relation.inverse } : {},
|
|
8409
|
-
...relation.cardinality ? { cardinality: Object.freeze({ ...relation.cardinality }) } : {},
|
|
8410
|
-
...relation.reasoning ? { reasoning: Object.freeze({ ...relation.reasoning }) } : {},
|
|
8411
|
-
...relation.evidence ? { evidence: Object.freeze({ ...relation.evidence }) } : {}
|
|
8412
|
-
})))
|
|
8413
|
-
})
|
|
8414
|
-
}),
|
|
8415
|
-
diagnostics: Object.freeze([])
|
|
8416
|
-
});
|
|
8417
|
-
}
|
|
8418
|
-
};
|
|
8419
|
-
//#endregion
|
|
8420
|
-
//#region packages/studio/src/types.ts
|
|
8421
|
-
/**
|
|
8422
|
-
* Thrown by a Bundle source port when a file exists but is not decodable
|
|
8423
|
-
* UTF-8 text. The Studio surfaces binary content as an explicit diagnostic
|
|
8424
|
-
* instead of lossy-decoding it into a text viewer.
|
|
8425
|
-
*/
|
|
8426
|
-
var StudioBinaryContentError = class extends Error {
|
|
8427
|
-
/** The path whose content is not UTF-8 text. */
|
|
8428
|
-
path;
|
|
8429
|
-
/** @param path - absolute path of the non-text file. */
|
|
8430
|
-
constructor(path) {
|
|
8431
|
-
super(`design studio: ${JSON.stringify(path)} is not UTF-8 text`);
|
|
8432
|
-
this.name = "StudioBinaryContentError";
|
|
8433
|
-
this.path = path;
|
|
8434
|
-
}
|
|
8435
|
-
};
|
|
8436
|
-
//#endregion
|
|
8437
|
-
//#region packages/studio/src/bundle-source.ts
|
|
8438
|
-
/**
|
|
8439
|
-
* Read-only inspection of real Bundle source files.
|
|
8440
|
-
*
|
|
8441
|
-
* The Bundle content authority is the Kit source directory on disk. The read
|
|
8442
|
-
* model exposes the physical file tree, byte-exact text content, and the
|
|
8443
|
-
* loader-compiled manifest/schema/validation summaries with Panel
|
|
8444
|
-
* classification. Identity is reconciled against the host's Core-compiled
|
|
8445
|
-
* catalog by exact Kit and Bundle name+version; an ambiguous physical source
|
|
8446
|
-
* or a catalog/source disagreement fails loud instead of guessing. The Studio
|
|
8447
|
-
* never writes: traversal, `.git`, directories, and binary content are
|
|
8448
|
-
* rejected, and no mutation port exists.
|
|
8449
|
-
*/
|
|
8450
|
-
function diagnostic(code, message, subject) {
|
|
8451
|
-
return Object.freeze([Object.freeze(subject === void 0 ? {
|
|
8452
|
-
code,
|
|
8453
|
-
message
|
|
8454
|
-
} : {
|
|
8455
|
-
code,
|
|
8456
|
-
message,
|
|
8457
|
-
subject
|
|
8458
|
-
})]);
|
|
8459
|
-
}
|
|
8460
|
-
function jsonProject(value) {
|
|
8461
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
|
|
8462
|
-
return Object.freeze(JSON.parse(JSON.stringify(value)));
|
|
8463
|
-
}
|
|
8464
|
-
function utf8ByteLength(content) {
|
|
8465
|
-
return new TextEncoder().encode(content).length;
|
|
8466
|
-
}
|
|
8467
|
-
/**
|
|
8468
|
-
* Split one relative file path into safe segments. Rejects absolute paths,
|
|
8469
|
-
* empty/`.`/`..`/`.git` segments, backslashes, and control characters.
|
|
8470
|
-
* @param path - candidate slash-separated relative path.
|
|
8471
|
-
* @returns the segments, or undefined when the shape is unsafe.
|
|
8472
|
-
*/
|
|
8473
|
-
function safeSegments(path) {
|
|
8474
|
-
if (path === "" || path.startsWith("/") || path.endsWith("/") || path.includes("\\") || /[\u0000-\u001f\u007f]/u.test(path)) return;
|
|
8475
|
-
const parts = path.split("/");
|
|
8476
|
-
if (parts.some((part) => part === "" || part === "." || part === ".." || part === ".git")) return void 0;
|
|
8477
|
-
return parts;
|
|
8478
|
-
}
|
|
8479
|
-
function panelOf(manifest) {
|
|
8480
|
-
const presentation = manifest?.presentation;
|
|
8481
|
-
if (typeof presentation !== "object" || presentation === null || Array.isArray(presentation)) return void 0;
|
|
8482
|
-
const { mode, renderer } = presentation;
|
|
8483
|
-
if (mode === "native") return Object.freeze(typeof renderer === "string" ? {
|
|
8484
|
-
kind: "native",
|
|
8485
|
-
renderer
|
|
8486
|
-
} : { kind: "native" });
|
|
8487
|
-
if (mode === "declarative") return Object.freeze({ kind: "declarative" });
|
|
8488
|
-
}
|
|
8489
|
-
function validationOf(skill) {
|
|
8490
|
-
const document = skill.metadata?.validationDocument;
|
|
8491
|
-
if (document === void 0 || !Array.isArray(document.rules)) return void 0;
|
|
8492
|
-
const drivers = /* @__PURE__ */ new Set();
|
|
8493
|
-
for (const rule of document.rules) if (typeof rule.check?.driver === "string") drivers.add(rule.check.driver);
|
|
8494
|
-
return Object.freeze({
|
|
8495
|
-
rules: document.rules.length,
|
|
8496
|
-
drivers: Object.freeze([...drivers].sort())
|
|
8497
|
-
});
|
|
8498
|
-
}
|
|
8499
|
-
/**
|
|
8500
|
-
* Read-only Bundle inspection over real Kit source files, reconciled against
|
|
8501
|
-
* the host's Core-compiled catalog. The injected port owns the physical
|
|
8502
|
-
* filesystem; this service owns resolution, path safety, identity
|
|
8503
|
-
* reconciliation, and the JSON-only read models.
|
|
8504
|
-
*/
|
|
8505
|
-
var StudioBundleSourceService = class {
|
|
8506
|
-
#catalog;
|
|
8507
|
-
#source;
|
|
8508
|
-
/**
|
|
8509
|
-
* @param catalog - current authoritative installed Kit snapshot provider.
|
|
8510
|
-
* @param source - host-supplied read-only physical source operations.
|
|
8511
|
-
*/
|
|
8512
|
-
constructor(catalog, source) {
|
|
8513
|
-
this.#catalog = catalog;
|
|
8514
|
-
this.#source = source;
|
|
8515
|
-
}
|
|
8516
|
-
/**
|
|
8517
|
-
* Read one Bundle's workspace: physical file tree, loader-compiled
|
|
8518
|
-
* manifest/schema/validation summaries, and Panel classification.
|
|
8519
|
-
* @param name - the Bundle id.
|
|
8520
|
-
* @returns the workspace, or resolution/reconciliation diagnostics.
|
|
8521
|
-
*/
|
|
8522
|
-
async readBundleWorkspace(name, version) {
|
|
8523
|
-
const resolved = await this.#resolve(name, version);
|
|
8524
|
-
if ("diagnostics" in resolved) return resolved;
|
|
8525
|
-
const { kitRoot, bundleRoot } = resolved;
|
|
8526
|
-
let skill;
|
|
8527
|
-
let kitName;
|
|
8528
|
-
let kitVersion;
|
|
8529
|
-
try {
|
|
8530
|
-
if (resolved.skill) skill = resolved.skill;
|
|
8531
|
-
else {
|
|
8532
|
-
const kit = await loadStudioKit(this.#source, kitRoot);
|
|
8533
|
-
const found = kit.skills.find((candidate) => candidate.name === name);
|
|
8534
|
-
if (found === void 0) return Object.freeze({ diagnostics: diagnostic("bundle.not_in_catalog", `Bundle ${JSON.stringify(name)} is not referenced by the Mindset <design_skills> catalog`, name) });
|
|
8535
|
-
skill = found;
|
|
8536
|
-
kitName = kit.name;
|
|
8537
|
-
kitVersion = String(kit.version);
|
|
8538
|
-
}
|
|
8539
|
-
} catch (error) {
|
|
8540
|
-
return Object.freeze({ diagnostics: diagnostic("kit.load", error instanceof Error ? error.message : String(error), name) });
|
|
8541
|
-
}
|
|
8542
|
-
const bundleVersion = String(skill.version);
|
|
8543
|
-
const catalogKit = (await this.#catalog.snapshot()).kits.find((kit) => kit.name === kitName && kit.version === kitVersion);
|
|
8544
|
-
if (!resolved.skill && catalogKit === void 0) return Object.freeze({ diagnostics: diagnostic("studio.source_catalog_mismatch", `source Kit ${JSON.stringify(kitName)}@${JSON.stringify(kitVersion)} is not present in the compiled catalog`, name) });
|
|
8545
|
-
if (!resolved.skill && !catalogKit?.bundles.some((bundle) => bundle.name === name && bundle.version === bundleVersion)) return Object.freeze({ diagnostics: diagnostic("studio.source_catalog_mismatch", `source Bundle ${JSON.stringify(name)}@${JSON.stringify(bundleVersion)} disagrees with the compiled catalog`, name) });
|
|
8546
|
-
const files = [];
|
|
8547
|
-
for (const path of await this.#source.listFiles(bundleRoot)) {
|
|
8548
|
-
let content;
|
|
8549
|
-
try {
|
|
8550
|
-
content = await this.#source.readText(join(bundleRoot, path));
|
|
8551
|
-
} catch (error) {
|
|
8552
|
-
if (error instanceof StudioBinaryContentError) continue;
|
|
8553
|
-
throw error;
|
|
8554
|
-
}
|
|
8555
|
-
if (content === void 0) continue;
|
|
8556
|
-
files.push(Object.freeze({
|
|
8557
|
-
path,
|
|
8558
|
-
bytes: utf8ByteLength(content)
|
|
8559
|
-
}));
|
|
8560
|
-
}
|
|
8561
|
-
const manifest = jsonProject(skill.metadata?.skillManifest);
|
|
8562
|
-
const schema = jsonProject(skill.metadata?.schemaDocument);
|
|
8563
|
-
const validation = validationOf(skill);
|
|
8564
|
-
const panel = panelOf(manifest);
|
|
8565
|
-
return Object.freeze({
|
|
8566
|
-
workspace: Object.freeze({
|
|
8567
|
-
name,
|
|
8568
|
-
version: bundleVersion,
|
|
8569
|
-
...kitName === void 0 ? {} : { kit: kitName },
|
|
8570
|
-
description: skill.description,
|
|
8571
|
-
...skill.pickerDescription ? { displayDescription: Object.freeze({ ...skill.pickerDescription }) } : {},
|
|
8572
|
-
files: Object.freeze(files),
|
|
8573
|
-
...manifest === void 0 ? {} : { manifest },
|
|
8574
|
-
...schema === void 0 ? {} : { schema },
|
|
8575
|
-
...validation === void 0 ? {} : { validation },
|
|
8576
|
-
...panel === void 0 ? {} : { panel }
|
|
8577
|
-
}),
|
|
8578
|
-
diagnostics: Object.freeze([])
|
|
8579
|
-
});
|
|
8580
|
-
}
|
|
8581
|
-
/**
|
|
8582
|
-
* Read one complete Bundle file byte-exactly as UTF-8 text.
|
|
8583
|
-
* @param input - Bundle id and Bundle-relative path.
|
|
8584
|
-
* @returns the file content, or resolution diagnostics.
|
|
8585
|
-
*/
|
|
8586
|
-
async readBundleFile(input) {
|
|
8587
|
-
const located = await this.#locate(input.name, input.path, input.version);
|
|
8588
|
-
if ("diagnostics" in located) return located;
|
|
8589
|
-
let content;
|
|
8590
|
-
try {
|
|
8591
|
-
content = await this.#source.readText(located.absolute);
|
|
8592
|
-
} catch (error) {
|
|
8593
|
-
if (error instanceof StudioBinaryContentError) return Object.freeze({ diagnostics: diagnostic("bundle_file.binary", `Bundle ${JSON.stringify(input.name)} file ${JSON.stringify(input.path)} is not UTF-8 text`, input.path) });
|
|
8594
|
-
throw error;
|
|
8595
|
-
}
|
|
8596
|
-
if (content === void 0) return Object.freeze({ diagnostics: diagnostic("bundle_file.missing", `Bundle ${JSON.stringify(input.name)} has no file ${JSON.stringify(input.path)}`, input.path) });
|
|
8597
|
-
return Object.freeze({
|
|
8598
|
-
file: Object.freeze({
|
|
8599
|
-
path: input.path,
|
|
8600
|
-
content
|
|
8601
|
-
}),
|
|
8602
|
-
diagnostics: Object.freeze([])
|
|
8603
|
-
});
|
|
8604
|
-
}
|
|
8605
|
-
/** Resolve one Bundle id to exactly one physical root; same-name multi-root fails loud. */
|
|
8606
|
-
async #resolve(name, version) {
|
|
8607
|
-
if (this.#source.resolveBundleRoot) {
|
|
8608
|
-
const candidates = ((await this.#catalog.snapshot()).bundles ?? []).filter((bundle) => bundle.name === name && (version === void 0 || bundle.version === version));
|
|
8609
|
-
if (candidates.length !== 1) return { diagnostics: diagnostic(candidates.length ? "studio.ambiguous_version" : "bundle.missing", `Select one registered exact version of Bundle ${JSON.stringify(name)}`, name) };
|
|
8610
|
-
const selected = candidates[0];
|
|
8611
|
-
const root = await this.#source.resolveBundleRoot({
|
|
8612
|
-
name,
|
|
8613
|
-
version: selected.version
|
|
8614
|
-
});
|
|
8615
|
-
if (!root) return { diagnostics: diagnostic("bundle.missing", `Missing retained source for ${name}@${selected.version}`, name) };
|
|
8616
|
-
if ((selected.definition.catalogName ?? selected.definition.name) !== name || String(selected.definition.version) !== selected.version) return { diagnostics: diagnostic("studio.source_catalog_mismatch", "Independent Bundle definition disagrees with its exact pin", name) };
|
|
8617
|
-
return {
|
|
8618
|
-
bundleRoot: root,
|
|
8619
|
-
skill: selected.definition
|
|
8620
|
-
};
|
|
8621
|
-
}
|
|
8622
|
-
const matches = [];
|
|
8623
|
-
for (const kitRoot of await this.#source.listKitRoots()) {
|
|
8624
|
-
const root = resolve(kitRoot);
|
|
8625
|
-
const bundleRoot = join(root, "skills", name);
|
|
8626
|
-
if (await this.#source.isDirectory(bundleRoot)) matches.push({
|
|
8627
|
-
kitRoot: root,
|
|
8628
|
-
bundleRoot
|
|
8629
|
-
});
|
|
8630
|
-
}
|
|
8631
|
-
if (matches.length === 0) return { diagnostics: diagnostic("bundle.missing", `no source Bundle named ${JSON.stringify(name)}`, name) };
|
|
8632
|
-
if (matches.length > 1) return { diagnostics: diagnostic("studio.duplicate_source", `Bundle ${JSON.stringify(name)} exists in ${matches.length} configured Kit sources: ${matches.map((match) => JSON.stringify(match.bundleRoot)).join(", ")}`, name) };
|
|
8633
|
-
const match = matches[0];
|
|
8634
|
-
if (version !== void 0) try {
|
|
8635
|
-
const kit = await loadStudioKit(this.#source, match.kitRoot);
|
|
8636
|
-
const skill = kit.skills.find((candidate) => candidate.name === name);
|
|
8637
|
-
if (skill === void 0 || String(skill.version) !== version) return { diagnostics: diagnostic("bundle.version_missing", `Source does not provide Bundle ${JSON.stringify(name)}@${JSON.stringify(version)}`, version) };
|
|
8638
|
-
if (!(await this.#catalog.snapshot()).kits.find((candidate) => candidate.name === kit.name && candidate.version === String(kit.version))?.bundles.some((bundle) => bundle.name === name && bundle.version === version)) return { diagnostics: diagnostic("studio.source_catalog_mismatch", "Legacy source does not match the registered exact Bundle version", name) };
|
|
8639
|
-
} catch (error) {
|
|
8640
|
-
return { diagnostics: diagnostic("kit.load", error instanceof Error ? error.message : String(error), name) };
|
|
8641
|
-
}
|
|
8642
|
-
return match;
|
|
8643
|
-
}
|
|
8644
|
-
/** Resolve and path-check one Bundle file target against the physical file tree. */
|
|
8645
|
-
async #locate(name, path, version) {
|
|
8646
|
-
const resolved = await this.#resolve(name, version);
|
|
8647
|
-
if ("diagnostics" in resolved) return resolved;
|
|
8648
|
-
if (safeSegments(path) === void 0) return { diagnostics: diagnostic("bundle_file.path_forbidden", `path must stay inside the Bundle directory: ${JSON.stringify(path)}`, path) };
|
|
8649
|
-
if (!(await this.#source.listFiles(resolved.bundleRoot)).includes(path)) return { diagnostics: diagnostic("bundle_file.missing", `Bundle ${JSON.stringify(name)} has no regular file ${JSON.stringify(path)}`, path) };
|
|
8650
|
-
return { absolute: join(resolved.bundleRoot, path) };
|
|
8651
|
-
}
|
|
8652
|
-
};
|
|
8653
|
-
//#endregion
|
|
8654
|
-
//#region packages/studio/src/snapshot.ts
|
|
8655
|
-
/**
|
|
8656
|
-
* Project one Core-compiled Kit into its version-addressed snapshot form.
|
|
8657
|
-
* @param kit - compiled Kit from the host catalog authority.
|
|
8658
|
-
* @returns the frozen snapshot entry retaining the definition by reference.
|
|
8659
|
-
*/
|
|
8660
|
-
function snapshotKit(kit) {
|
|
8661
|
-
return Object.freeze({
|
|
8662
|
-
name: kit.name,
|
|
8663
|
-
version: String(kit.version),
|
|
8664
|
-
definition: kit,
|
|
8665
|
-
bundles: Object.freeze(kit.skills.map((skill) => Object.freeze({
|
|
8666
|
-
name: skill.catalogName ?? skill.name,
|
|
8667
|
-
version: String(skill.version),
|
|
8668
|
-
definition: skill
|
|
8669
|
-
})))
|
|
8670
|
-
});
|
|
8671
|
-
}
|
|
8672
|
-
//#endregion
|
|
8673
|
-
//#region packages/companion/src/studio.mjs
|
|
8674
|
-
/** Thin read-only port for the existing Studio domain; no second catalog. */
|
|
8675
|
-
async function createCompanionStudio(kit, kitRoot, stateRoot, contentLibrary) {
|
|
8676
|
-
const currentKit = () => typeof kit === "function" ? kit() : kit;
|
|
8677
|
-
const root = await realpath(currentKit().sourceRoot ?? kitRoot);
|
|
8678
|
-
let kitSnapshot, bundleSnapshot, catalogKit = currentKit();
|
|
8679
|
-
const invalidateCatalog = () => {
|
|
8680
|
-
kitSnapshot = void 0;
|
|
8681
|
-
bundleSnapshot = void 0;
|
|
8682
|
-
};
|
|
8683
|
-
const checkCatalogKit = () => {
|
|
8684
|
-
const selected = currentKit();
|
|
8685
|
-
if (selected !== catalogKit) {
|
|
8686
|
-
invalidateCatalog();
|
|
8687
|
-
catalogKit = selected;
|
|
8688
|
-
}
|
|
8689
|
-
};
|
|
8690
|
-
const installedKits = () => {
|
|
8691
|
-
checkCatalogKit();
|
|
8692
|
-
return kitSnapshot ??= (async () => {
|
|
8693
|
-
const selected = currentKit(), entries = /* @__PURE__ */ new Map([[`${selected.name}@${selected.version}`, selected]]);
|
|
8694
|
-
if (contentLibrary) for (const pin of await contentLibrary.store.listKits()) {
|
|
8695
|
-
const retained = await contentLibrary.store.loadRetainedKit(pin);
|
|
8696
|
-
if (retained) entries.set(`${pin.name}@${pin.version}`, retained);
|
|
8697
|
-
}
|
|
8698
|
-
return [...entries.values()];
|
|
8699
|
-
})().catch((error) => {
|
|
8700
|
-
kitSnapshot = void 0;
|
|
8701
|
-
throw error;
|
|
8702
|
-
});
|
|
8703
|
-
};
|
|
8704
|
-
const selectedKit = async (pin) => {
|
|
8705
|
-
const selected = (await installedKits()).find((item) => item.name === pin.name && String(item.version) === pin.version);
|
|
8706
|
-
if (!selected) throw new Error("Select the exact registered Kit version.");
|
|
8707
|
-
return selected;
|
|
8708
|
-
};
|
|
8709
|
-
const installedBundles = () => {
|
|
8710
|
-
checkCatalogKit();
|
|
8711
|
-
return bundleSnapshot ??= readInstalledBundles().catch((error) => {
|
|
8712
|
-
bundleSnapshot = void 0;
|
|
8713
|
-
throw error;
|
|
8714
|
-
});
|
|
8715
|
-
};
|
|
8716
|
-
const readInstalledBundles = async () => {
|
|
8717
|
-
const entries = new Map(currentKit().skills.map((skill) => [`${skill.catalogName ?? skill.name}@${skill.version}`, skill]));
|
|
8718
|
-
if (contentLibrary) for (const pin of await contentLibrary.store.listBundles()) {
|
|
8719
|
-
const retained = await contentLibrary.store.resolveBundle(pin);
|
|
8720
|
-
if (retained) entries.set(`${pin.name}@${pin.version}`, retained.skill);
|
|
8721
|
-
}
|
|
8722
|
-
return [...entries.values()];
|
|
8723
|
-
};
|
|
8724
|
-
const catalog = { snapshot: async () => {
|
|
8725
|
-
if (!contentLibrary) invalidateCatalog();
|
|
8726
|
-
return {
|
|
8727
|
-
kits: (await installedKits()).map(snapshotKit),
|
|
8728
|
-
bundles: (await installedBundles()).map((skill) => ({
|
|
8729
|
-
name: skill.catalogName ?? skill.name,
|
|
8730
|
-
version: String(skill.version),
|
|
8731
|
-
definition: skill
|
|
8732
|
-
}))
|
|
8733
|
-
};
|
|
8734
|
-
} };
|
|
8735
|
-
const safe = async (path) => {
|
|
8736
|
-
const owner = [
|
|
8737
|
-
root,
|
|
8738
|
-
...(await installedKits()).map((kit) => kit.sourceRoot).filter(Boolean),
|
|
8739
|
-
...(await installedBundles()).map((skill) => skill.resourceRoot).filter(Boolean)
|
|
8740
|
-
].find((base) => {
|
|
8741
|
-
const rel = relative(base, resolve(path));
|
|
8742
|
-
return !isAbsolute(rel) && rel !== ".." && !rel.startsWith(`..${sep}`);
|
|
8743
|
-
});
|
|
8744
|
-
if (!owner) throw new Error("Studio path outside registered content.");
|
|
8745
|
-
const rel = relative(owner, resolve(path));
|
|
8746
|
-
if (rel.split(sep).some((part) => [".git", "node_modules"].includes(part))) throw new Error("Studio path outside registered content.");
|
|
8747
|
-
let current = owner;
|
|
8748
|
-
for (const part of rel.split(sep).filter(Boolean)) {
|
|
8749
|
-
current = join(current, part);
|
|
8750
|
-
if ((await lstat(current)).isSymbolicLink()) throw new Error("Studio does not follow source symlinks.");
|
|
8751
|
-
}
|
|
8752
|
-
return current;
|
|
8753
|
-
};
|
|
8754
|
-
const source = {
|
|
8755
|
-
listKitRoots: async () => [root],
|
|
8756
|
-
resolveBundleRoot: async (pin) => (await installedBundles()).find((skill) => (skill.catalogName ?? skill.name) === pin.name && String(skill.version) === pin.version)?.resourceRoot,
|
|
8757
|
-
readText: async (path) => {
|
|
8758
|
-
try {
|
|
8759
|
-
const file = await safe(path);
|
|
8760
|
-
if (!(await lstat(file)).isFile()) throw new Error("Studio expects a regular file.");
|
|
8761
|
-
const bytes = await readFile(file);
|
|
8762
|
-
try {
|
|
8763
|
-
const text = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
8764
|
-
if (text.includes("\0")) throw new Error("binary");
|
|
8765
|
-
return text;
|
|
8766
|
-
} catch {
|
|
8767
|
-
throw new StudioBinaryContentError(path);
|
|
8768
|
-
}
|
|
8769
|
-
} catch (error) {
|
|
8770
|
-
if (error.code === "ENOENT") return void 0;
|
|
8771
|
-
throw error;
|
|
8772
|
-
}
|
|
8773
|
-
},
|
|
8774
|
-
listDir: async (path) => {
|
|
8775
|
-
try {
|
|
8776
|
-
return (await readdir(await safe(path))).filter((name) => ![".git", "node_modules"].includes(name));
|
|
8777
|
-
} catch (error) {
|
|
8778
|
-
if (error.code === "ENOENT") return [];
|
|
8779
|
-
throw error;
|
|
8780
|
-
}
|
|
8781
|
-
},
|
|
8782
|
-
isDirectory: async (path) => {
|
|
8783
|
-
try {
|
|
8784
|
-
return (await lstat(await safe(path))).isDirectory();
|
|
8785
|
-
} catch (error) {
|
|
8786
|
-
if (error.code === "ENOENT") return false;
|
|
8787
|
-
throw error;
|
|
8788
|
-
}
|
|
8789
|
-
},
|
|
8790
|
-
listFiles: async (path) => {
|
|
8791
|
-
const base = await safe(path), files = [];
|
|
8792
|
-
const visit = async (dir) => {
|
|
8793
|
-
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
8794
|
-
if ([".git", "node_modules"].includes(entry.name) || entry.isSymbolicLink()) continue;
|
|
8795
|
-
const next = join(dir, entry.name);
|
|
8796
|
-
if (entry.isDirectory()) await visit(next);
|
|
8797
|
-
else if (entry.isFile()) files.push(relative(base, next).split(sep).join("/"));
|
|
8798
|
-
}
|
|
8799
|
-
};
|
|
8800
|
-
await visit(base);
|
|
8801
|
-
return files.sort();
|
|
8802
|
-
}
|
|
8803
|
-
};
|
|
8804
|
-
const management = new StudioManagementService(catalog);
|
|
8805
|
-
const bundles = new StudioBundleSourceService(catalog, source);
|
|
8806
|
-
const previewInstalledPanel = async (input) => {
|
|
8807
|
-
const diagnostic = (code, message) => ({ diagnostics: [{
|
|
8808
|
-
code,
|
|
8809
|
-
message
|
|
8810
|
-
}] });
|
|
8811
|
-
if (!input || !Number.isSafeInteger(input.revision) || input.revision < 0 || input.kit !== void 0 && (typeof input.kit?.name !== "string" || typeof input.kit?.version !== "string") || typeof input.bundle?.name !== "string" || typeof input.bundle?.version !== "string" || !/^[a-z][a-z0-9_]*$/.test(input.bundle.name) || input.sampleSource !== void 0 && typeof input.sampleSource !== "string") return diagnostic("preview.request", "Select exact Kit and Bundle pins and a non-negative preview revision.");
|
|
8812
|
-
const kitPin = { ...input.kit }, bundlePin = { ...input.bundle }, revision = input.revision;
|
|
8813
|
-
const requestedSample = input.sampleSource;
|
|
8814
|
-
if (requestedSample !== void 0 && Buffer.byteLength(requestedSample) > 262144) return diagnostic("preview.size", "Sample JSON is limited to 256 KiB.");
|
|
8815
|
-
try {
|
|
8816
|
-
if (input.kit === void 0) {
|
|
8817
|
-
const selected = (await installedBundles()).find((skill) => (skill.catalogName ?? skill.name) === bundlePin.name && String(skill.version) === bundlePin.version);
|
|
8818
|
-
if (!selected) throw new Error("Select the exact registered Bundle version.");
|
|
8819
|
-
const retained = contentLibrary ? await contentLibrary.store.resolveBundle(bundlePin) : void 0;
|
|
8820
|
-
const base = retained?.resourceRoot ?? selected.resourceRoot;
|
|
8821
|
-
if (!base) throw new Error("Independent Bundle source is unavailable.");
|
|
8822
|
-
const { createStudioInstanceAdapters } = await import("./studio-instance-composition-ClAJ72-M.mjs");
|
|
8823
|
-
const { composition } = createStudioInstanceAdapters({
|
|
8824
|
-
listBundles: async () => [bundlePin],
|
|
8825
|
-
captureKit: async () => {
|
|
8826
|
-
throw new Error("Standalone preview has no Kit.");
|
|
8827
|
-
},
|
|
8828
|
-
captureBundle: async () => {
|
|
8829
|
-
throw new Error("Standalone preview uses only its captured source.");
|
|
8830
|
-
}
|
|
8831
|
-
});
|
|
8832
|
-
return composition.preview({
|
|
8833
|
-
kind: "bundle",
|
|
8834
|
-
bundle: bundlePin,
|
|
8835
|
-
runtimeName: selected.name,
|
|
8836
|
-
bundleFiles: await captureRegisteredTree(base),
|
|
8837
|
-
sourceId: retained?.sourceId ?? "companion:explicit-kit",
|
|
8838
|
-
revision,
|
|
8839
|
-
...requestedSample === void 0 ? {} : { sampleSource: requestedSample }
|
|
8840
|
-
});
|
|
8841
|
-
}
|
|
8842
|
-
const selected = await selectedKit(kitPin);
|
|
8843
|
-
const root = selected.sourceRoot ?? kitRoot;
|
|
8844
|
-
const locations = [];
|
|
8845
|
-
for (const skill of selected.skills) {
|
|
8846
|
-
const pin = {
|
|
8847
|
-
name: skill.catalogName ?? skill.name,
|
|
8848
|
-
version: String(skill.version)
|
|
8849
|
-
};
|
|
8850
|
-
const retained = contentLibrary ? await contentLibrary.store.resolveBundle(pin) : void 0;
|
|
8851
|
-
locations.push({
|
|
8852
|
-
...pin,
|
|
8853
|
-
rootDir: retained?.resourceRoot ?? skill.resourceRoot ?? join(root, "skills", skill.name),
|
|
8854
|
-
sourceId: retained?.sourceId ?? "companion:explicit-kit"
|
|
8855
|
-
});
|
|
8856
|
-
}
|
|
8857
|
-
const loadOptions = {
|
|
8858
|
-
sourceId: "companion:explicit-kit",
|
|
8859
|
-
bundles: locations
|
|
8860
|
-
};
|
|
8861
|
-
const capturedRoots = [.../* @__PURE__ */ new Set([root, ...locations.map((location) => location.rootDir)])];
|
|
8862
|
-
const files = [];
|
|
8863
|
-
for (const base of capturedRoots) for (const path of await source.listFiles(base)) files.push({
|
|
8864
|
-
base,
|
|
8865
|
-
path
|
|
8866
|
-
});
|
|
8867
|
-
if (files.length > 4096) throw new Error("Installed preview source exceeds 4096 files.");
|
|
8868
|
-
const texts = /* @__PURE__ */ new Map(), binary = /* @__PURE__ */ new Set(), directories = new Set(capturedRoots);
|
|
8869
|
-
let bytes = 0;
|
|
8870
|
-
for (const { base, path } of files) {
|
|
8871
|
-
const absolute = join(base, path), info = await lstat(await safe(absolute));
|
|
8872
|
-
bytes += info.size;
|
|
8873
|
-
if (bytes > 16777216) throw new Error("Installed preview source exceeds 16 MiB.");
|
|
8874
|
-
try {
|
|
8875
|
-
const text = await source.readText(absolute);
|
|
8876
|
-
if (text !== void 0) texts.set(absolute, text);
|
|
8877
|
-
if (text !== void 0 && Buffer.byteLength(text) > info.size) {
|
|
8878
|
-
bytes += Buffer.byteLength(text) - info.size;
|
|
8879
|
-
if (bytes > 16777216) throw new Error("Installed preview source exceeds 16 MiB.");
|
|
8880
|
-
}
|
|
8881
|
-
} catch (error) {
|
|
8882
|
-
if (error instanceof StudioBinaryContentError) binary.add(absolute);
|
|
8883
|
-
else throw error;
|
|
8884
|
-
}
|
|
8885
|
-
const parts = path.split("/");
|
|
8886
|
-
for (let count = 1; count < parts.length; count++) directories.add(join(base, ...parts.slice(0, count)));
|
|
8887
|
-
}
|
|
8888
|
-
const paths = /* @__PURE__ */ new Set([
|
|
8889
|
-
...texts.keys(),
|
|
8890
|
-
...binary,
|
|
8891
|
-
...directories
|
|
8892
|
-
]);
|
|
8893
|
-
const installed = await loadStudioKit({
|
|
8894
|
-
readText: async (path) => {
|
|
8895
|
-
const key = resolve(path);
|
|
8896
|
-
if (binary.has(key)) throw new StudioBinaryContentError(key);
|
|
8897
|
-
return texts.get(key);
|
|
8898
|
-
},
|
|
8899
|
-
isDirectory: async (path) => directories.has(resolve(path)),
|
|
8900
|
-
listDir: async (path) => {
|
|
8901
|
-
const base = resolve(path);
|
|
8902
|
-
return [...new Set([...paths].filter((key) => key !== base && relative(base, key).split(sep).length === 1 && !relative(base, key).startsWith("..")).map((key) => relative(base, key)))].sort();
|
|
8903
|
-
}
|
|
8904
|
-
}, root, loadOptions);
|
|
8905
|
-
if (installed.name !== kitPin.name || String(installed.version) !== kitPin.version) return diagnostic("preview.kit_pin", "Source does not match the selected Kit version.");
|
|
8906
|
-
const bundle = installed.skills.find((entry) => (entry.catalogName ?? entry.name) === bundlePin.name && String(entry.version) === bundlePin.version);
|
|
8907
|
-
if (!bundle) return diagnostic("preview.bundle_pin", "Source does not match the selected Bundle version.");
|
|
8908
|
-
if (typeof bundle.metadata?.panelYaml !== "string") return diagnostic("preview.not_declarative", "This Bundle has no declarative Panel preview.");
|
|
8909
|
-
const bundleRoot = bundle.resourceRoot ?? join(root, "skills", bundle.name);
|
|
8910
|
-
const panelSource = texts.get(join(bundleRoot, "panel.yaml"));
|
|
8911
|
-
if (panelSource === void 0) return diagnostic("preview.definition", "Panel source is missing.");
|
|
8912
|
-
if (Buffer.byteLength(panelSource) > 1048576) return diagnostic("preview.size", "Panel source is limited to 1 MiB and sample JSON to 256 KiB.");
|
|
8913
|
-
const initial = bundle.metadata.panelManifest?.initial_values;
|
|
8914
|
-
const example = texts.get(join(bundleRoot, "reference", "preview.json"));
|
|
8915
|
-
if (requestedSample === void 0 && example === void 0 && initial === void 0) return diagnostic("preview.sample_missing", "No preview sample is provided. Add reference/preview.json to this Bundle or supply isolated sample JSON.");
|
|
8916
|
-
const sampleSource = requestedSample ?? example ?? JSON.stringify(initial);
|
|
8917
|
-
return finalizeStudioPanelPreview({
|
|
8918
|
-
compiled: bundle,
|
|
8919
|
-
kit: kitPin,
|
|
8920
|
-
bundle: bundlePin,
|
|
8921
|
-
revision,
|
|
8922
|
-
sampleSource
|
|
8923
|
-
});
|
|
8924
|
-
} catch (error) {
|
|
8925
|
-
return diagnostic("preview.definition", error instanceof Error ? error.message : String(error));
|
|
8926
|
-
}
|
|
8927
|
-
};
|
|
8928
|
-
const hasBundle = async (name) => (await installedBundles()).some((skill) => (skill.catalogName ?? skill.name) === name);
|
|
8929
|
-
const unknownBundle = (name) => ({ diagnostics: [{
|
|
8930
|
-
code: "bundle.missing",
|
|
8931
|
-
message: "Select an installed Bundle by its exact name.",
|
|
8932
|
-
subject: String(name)
|
|
8933
|
-
}] });
|
|
8934
|
-
let draftService;
|
|
8935
|
-
const drafts = () => {
|
|
8936
|
-
if (!stateRoot) throw new Error("Studio authoring storage is not configured.");
|
|
8937
|
-
return draftService ??= createStudioPanelDrafts({
|
|
8938
|
-
stateRoot,
|
|
8939
|
-
kitRoot: root,
|
|
8940
|
-
readInstalledKit: currentKit,
|
|
8941
|
-
readInstalledBundle: (pin) => contentLibrary?.store.resolveBundle(pin)
|
|
8942
|
-
});
|
|
8943
|
-
};
|
|
8944
|
-
let kitDraftService;
|
|
8945
|
-
let kitDraftPorts;
|
|
8946
|
-
const kitPorts = () => {
|
|
8947
|
-
if (!stateRoot) throw new Error("Studio authoring storage is not configured.");
|
|
8948
|
-
return kitDraftPorts ??= createStudioDraftPorts({
|
|
8949
|
-
stateRoot,
|
|
8950
|
-
kitRoot: root,
|
|
8951
|
-
readInstalledKit: currentKit,
|
|
8952
|
-
readInstalledBundle: (pin) => contentLibrary?.store.resolveBundle(pin)
|
|
8953
|
-
}, "kit");
|
|
8954
|
-
};
|
|
8955
|
-
const kitDrafts = () => {
|
|
8956
|
-
return kitDraftService ??= kitPorts().then(({ repository, sources }) => new StudioKitDraftService(repository, sources));
|
|
8957
|
-
};
|
|
8958
|
-
let contentArchiveService;
|
|
8959
|
-
let instanceService;
|
|
8960
|
-
const captureRegisteredTree = async (base) => {
|
|
8961
|
-
const paths = await source.listFiles(base);
|
|
8962
|
-
if (paths.length > 4096) throw new Error("Content snapshot exceeds 4096 files.");
|
|
8963
|
-
const entries = [];
|
|
8964
|
-
let total = 0;
|
|
8965
|
-
for (const path of paths) {
|
|
8966
|
-
const file = await safe(join(base, path)), info = await lstat(file);
|
|
8967
|
-
if (!info.isFile() || total + info.size > 16777216) throw new Error("Content snapshot exceeds 16 MiB or contains an invalid file.");
|
|
8968
|
-
const bytes = await readFile(file);
|
|
8969
|
-
total += bytes.length;
|
|
8970
|
-
if (total > 16777216) throw new Error("Content snapshot exceeds 16 MiB.");
|
|
8971
|
-
entries.push({
|
|
8972
|
-
path,
|
|
8973
|
-
base64: bytes.toString("base64")
|
|
8974
|
-
});
|
|
8975
|
-
}
|
|
8976
|
-
return entries;
|
|
8977
|
-
};
|
|
8978
|
-
const instances = () => {
|
|
8979
|
-
if (!stateRoot) throw new Error("Studio authoring storage is not configured.");
|
|
8980
|
-
return instanceService ??= Promise.all([import("./studio-instances-DKW4R37b.mjs"), import("./studio-instance-composition-ClAJ72-M.mjs")]).then(async ([{ createStudioInstances }, { createStudioInstanceAdapters }]) => {
|
|
8981
|
-
return createStudioInstances({
|
|
8982
|
-
stateRoot,
|
|
8983
|
-
...createStudioInstanceAdapters({
|
|
8984
|
-
listBundles: async () => (await installedBundles()).map((skill) => ({
|
|
8985
|
-
name: skill.catalogName ?? skill.name,
|
|
8986
|
-
version: String(skill.version)
|
|
8987
|
-
})),
|
|
8988
|
-
captureKit: async (pin) => {
|
|
8989
|
-
const selected = await selectedKit(pin);
|
|
8990
|
-
return {
|
|
8991
|
-
files: await captureRegisteredTree(selected.sourceRoot ?? root),
|
|
8992
|
-
title: selected.title
|
|
8993
|
-
};
|
|
8994
|
-
},
|
|
8995
|
-
captureBundle: async (pin) => {
|
|
8996
|
-
const selected = (await installedBundles()).find((skill) => (skill.catalogName ?? skill.name) === pin.name && String(skill.version) === pin.version);
|
|
8997
|
-
if (!selected) throw new Error("Select the exact registered Bundle.");
|
|
8998
|
-
const retained = contentLibrary ? await contentLibrary.store.resolveBundle(pin) : void 0;
|
|
8999
|
-
const base = retained?.resourceRoot ?? selected.resourceRoot ?? join(root, "skills", selected.name);
|
|
9000
|
-
return {
|
|
9001
|
-
files: await captureRegisteredTree(base),
|
|
9002
|
-
sourceId: retained?.sourceId ?? "companion:explicit-kit"
|
|
9003
|
-
};
|
|
9004
|
-
}
|
|
9005
|
-
})
|
|
9006
|
-
});
|
|
9007
|
-
}).catch((error) => {
|
|
9008
|
-
instanceService = void 0;
|
|
9009
|
-
throw error;
|
|
9010
|
-
});
|
|
9011
|
-
};
|
|
9012
|
-
const contentArchives = () => {
|
|
9013
|
-
if (!stateRoot) throw new Error("Studio import storage is not configured.");
|
|
9014
|
-
return contentArchiveService ??= import("./studio-content-archive-CNUz472H.mjs").then(async ({ createStudioContentArchives }) => {
|
|
9015
|
-
const statePath = resolve(stateRoot);
|
|
9016
|
-
if (!(await lstat(statePath)).isDirectory()) throw new Error("Studio archive state must be an existing canonical directory.");
|
|
9017
|
-
const state = await realpath(statePath);
|
|
9018
|
-
const privateRoot = join(state, "studio-content-state");
|
|
9019
|
-
const inside = (base, target) => {
|
|
9020
|
-
const rel = relative(base, target);
|
|
9021
|
-
return !isAbsolute(rel) && rel !== ".." && !rel.startsWith(`..${sep}`);
|
|
9022
|
-
};
|
|
9023
|
-
if (inside(root, privateRoot) || inside(privateRoot, root)) throw new Error("Studio archive state and installed Kit must not be nested.");
|
|
9024
|
-
if (process.platform === "win32") await ensureWindowsPrivateDirectory(privateRoot);
|
|
9025
|
-
else await mkdir(privateRoot, { mode: 448 }).catch((error) => {
|
|
9026
|
-
if (error.code !== "EEXIST") throw error;
|
|
9027
|
-
});
|
|
9028
|
-
const bundles = [];
|
|
9029
|
-
for (const skill of await installedBundles()) {
|
|
9030
|
-
const pin = {
|
|
9031
|
-
name: skill.catalogName ?? skill.name,
|
|
9032
|
-
version: String(skill.version)
|
|
9033
|
-
};
|
|
9034
|
-
const retained = contentLibrary ? await contentLibrary.store.resolveBundle(pin) : void 0;
|
|
9035
|
-
bundles.push({
|
|
9036
|
-
...pin,
|
|
9037
|
-
rootDir: retained?.resourceRoot ?? skill.resourceRoot ?? join(root, "skills", skill.name),
|
|
9038
|
-
sourceId: retained?.sourceId ?? "companion:explicit-kit"
|
|
9039
|
-
});
|
|
9040
|
-
}
|
|
9041
|
-
return createStudioContentArchives({
|
|
9042
|
-
stateRoot: privateRoot,
|
|
9043
|
-
kitRoot: root,
|
|
9044
|
-
readInstalledKit: currentKit,
|
|
9045
|
-
sourceId: "companion:explicit-kit",
|
|
9046
|
-
bundles
|
|
9047
|
-
});
|
|
9048
|
-
});
|
|
9049
|
-
};
|
|
9050
|
-
return {
|
|
9051
|
-
listInstances: async (input) => (await instances()).list(input),
|
|
9052
|
-
readInstance: async (input) => (await instances()).read(input),
|
|
9053
|
-
copyInstance: async (input) => (await instances()).copy(input),
|
|
9054
|
-
renameInstance: async (input) => (await instances()).rename(input),
|
|
9055
|
-
removeInstance: async (input) => (await instances()).remove(input),
|
|
9056
|
-
updateInstanceMounts: async (input) => (await instances()).updateMounts(input),
|
|
9057
|
-
readInstanceFile: async (input) => (await instances()).readFile(input),
|
|
9058
|
-
saveInstanceFile: async (input) => (await instances()).saveFile(input),
|
|
9059
|
-
previewInstance: async (input) => (await instances()).preview(input),
|
|
9060
|
-
workspace: ({ query = "" }) => {
|
|
9061
|
-
invalidateCatalog();
|
|
9062
|
-
return management.workspace(query);
|
|
9063
|
-
},
|
|
9064
|
-
readKitFiles: async ({ name, version }) => {
|
|
9065
|
-
const current = await selectedKit({
|
|
9066
|
-
name,
|
|
9067
|
-
version
|
|
9068
|
-
});
|
|
9069
|
-
return source.listFiles(current.sourceRoot ?? root);
|
|
9070
|
-
},
|
|
9071
|
-
readKitFile: async ({ name, version, path }) => {
|
|
9072
|
-
const current = await selectedKit({
|
|
9073
|
-
name,
|
|
9074
|
-
version
|
|
9075
|
-
});
|
|
9076
|
-
if (typeof path !== "string" || !path || /[\\\\:\u0000]/.test(path) || path.split("/").some((part) => !part || part === "." || part === "..")) throw new Error("Invalid Kit file path.");
|
|
9077
|
-
const target = await safe(join(current.sourceRoot ?? root, path));
|
|
9078
|
-
if ((await lstat(target)).size > 1048576) throw new Error("This file is too large for the text viewer.");
|
|
9079
|
-
const content = await source.readText(target);
|
|
9080
|
-
if (content === void 0) throw new Error("Kit file not found.");
|
|
9081
|
-
return { content };
|
|
9082
|
-
},
|
|
9083
|
-
readKitWorkspace: ({ name, version }) => management.readKitWorkspace(name, version),
|
|
9084
|
-
readBundleWorkspace: async ({ name, version }) => await hasBundle(name) ? bundles.readBundleWorkspace(name, version) : unknownBundle(name),
|
|
9085
|
-
readBundleFile: async (input) => await hasBundle(input.name) ? bundles.readBundleFile(input) : unknownBundle(input.name),
|
|
9086
|
-
previewInstalledPanel,
|
|
9087
|
-
createPanelDraft: async (input) => (await drafts()).create(input),
|
|
9088
|
-
listPanelDrafts: async () => (await drafts()).list(),
|
|
9089
|
-
readPanelDraft: async ({ id }) => (await drafts()).read(id),
|
|
9090
|
-
savePanelDraft: async (input) => (await drafts()).save(input),
|
|
9091
|
-
previewPanelDraft: async (input) => (await drafts()).preview(input),
|
|
9092
|
-
confirmPanelDraft: async (input) => (await drafts()).confirm(input),
|
|
9093
|
-
forkPanelDraft: async ({ id }) => (await drafts()).fork(id),
|
|
9094
|
-
createKitDraft: async (input) => (await kitDrafts()).create(input),
|
|
9095
|
-
listKitDrafts: async () => (await kitDrafts()).list(),
|
|
9096
|
-
readKitDraft: async ({ id }) => (await kitDrafts()).read(id),
|
|
9097
|
-
saveKitDraft: async (input) => (await kitDrafts()).save(input),
|
|
9098
|
-
validateKitDraft: async (input) => (await kitDrafts()).validate(input),
|
|
9099
|
-
previewKitDraft: async (input) => (await kitDrafts()).preview(input),
|
|
9100
|
-
confirmKitDraft: async (input) => (await kitDrafts()).confirm(input),
|
|
9101
|
-
forkKitDraft: async ({ id }) => (await kitDrafts()).fork(id),
|
|
9102
|
-
exportContentArchive: async (input) => (await contentArchives()).exportArchive(input),
|
|
9103
|
-
prepareContentImport: async (input) => (await contentArchives()).prepareImport(input),
|
|
9104
|
-
readContentImport: async ({ id }) => (await contentArchives()).readImport(id),
|
|
9105
|
-
listContentImports: async () => (await contentArchives()).listImports(),
|
|
9106
|
-
adoptContentImport: async ({ id }) => {
|
|
9107
|
-
const record = await (await contentArchives()).readImport(id);
|
|
9108
|
-
const prepared = await (await contentArchives()).revalidateImport(id);
|
|
9109
|
-
if (!prepared.validation.valid) throw new Error(`Imported definition is invalid: ${prepared.validation.diagnostics.map((item) => item.message).join("; ")}`);
|
|
9110
|
-
if (!contentLibrary) throw new Error("Independent content installation is not configured.");
|
|
9111
|
-
const adopted = await contentLibrary.adoptPrepared(prepared);
|
|
9112
|
-
invalidateCatalog();
|
|
9113
|
-
contentArchiveService = void 0;
|
|
9114
|
-
let draft;
|
|
9115
|
-
if (record.archive.kind === "kit") {
|
|
9116
|
-
const retained = await contentLibrary.store.loadRetainedKit(prepared.archive.pin);
|
|
9117
|
-
const ports = await createStudioDraftPorts({
|
|
9118
|
-
stateRoot,
|
|
9119
|
-
kitRoot: retained.sourceRoot,
|
|
9120
|
-
readInstalledKit: () => retained,
|
|
9121
|
-
readInstalledBundle: (pin) => contentLibrary.store.resolveBundle(pin)
|
|
9122
|
-
}, "kit");
|
|
9123
|
-
draft = await new StudioKitDraftService(ports.repository, ports.sources).create({ kit: prepared.archive.pin });
|
|
9124
|
-
}
|
|
9125
|
-
return {
|
|
9126
|
-
importId: id,
|
|
9127
|
-
...adopted,
|
|
9128
|
-
...draft ? { draft } : {},
|
|
9129
|
-
executionGranted: false,
|
|
9130
|
-
requiresTrustReview: prepared.requiresTrustReview
|
|
9131
|
-
};
|
|
9132
|
-
}
|
|
9133
|
-
};
|
|
9134
|
-
}
|
|
9135
|
-
//#endregion
|
|
9136
8135
|
//#region packages/companion/src/studio-trials.mjs
|
|
9137
8136
|
/** Isolated Studio trials over existing project, snapshot and native transport ports. */
|
|
9138
8137
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
@@ -9477,7 +8476,7 @@ async function createStudioTrials({ stateRoot, kitRoot, readInstalledKit, readIn
|
|
|
9477
8476
|
...current,
|
|
9478
8477
|
status: current.dispatchAttempted ? "unknown" : "failed",
|
|
9479
8478
|
terminalVerified: !current.dispatchAttempted,
|
|
9480
|
-
message: current.dispatchAttempted ? "Native delivery is unverified; no automatic retry." :
|
|
8479
|
+
message: current.dispatchAttempted ? "Native delivery is unverified; no automatic retry." : `Trial preparation failed before native dispatch: ${String(error.message ?? error).slice(0, 2048)}`
|
|
9481
8480
|
}));
|
|
9482
8481
|
if (!record.dispatchAttempted) try {
|
|
9483
8482
|
await host?.close();
|
|
@@ -11397,7 +10396,16 @@ async function startCompanion(options) {
|
|
|
11397
10396
|
});
|
|
11398
10397
|
const resolveRun = (input) => backgroundAdapter?.resolveRun ? backgroundAdapter.resolveRun(input) : resolveExecutionRun(input);
|
|
11399
10398
|
const settings = await createCompanionSettings(options.stateRoot);
|
|
11400
|
-
const studio =
|
|
10399
|
+
const studio = () => project.contentLibrary.studio();
|
|
10400
|
+
const studioConversationBinding = {
|
|
10401
|
+
bindingId: randomBytes(16).toString("hex"),
|
|
10402
|
+
threadId: connection.threadId
|
|
10403
|
+
};
|
|
10404
|
+
const studioConversationRequests = options.studioTrial ? void 0 : createStudioConversationRequests({
|
|
10405
|
+
binding: studioConversationBinding,
|
|
10406
|
+
readInstance: async (input) => (await studio()).readInstance(input),
|
|
10407
|
+
prepareChanges: async (input) => (await studio()).prepareInstanceChanges(input)
|
|
10408
|
+
});
|
|
11401
10409
|
let trials;
|
|
11402
10410
|
const getTrials = () => {
|
|
11403
10411
|
if (codexDesktop) throw new Error("Codex desktop Studio trial execution is not verified yet.");
|
|
@@ -11405,7 +10413,7 @@ async function startCompanion(options) {
|
|
|
11405
10413
|
return trials ??= createStudioTrials({
|
|
11406
10414
|
stateRoot: options.stateRoot,
|
|
11407
10415
|
kitRoot: options.kitRoot,
|
|
11408
|
-
readInstalledKit: () => project.
|
|
10416
|
+
readInstalledKit: () => project.contentLibrary.loadInstalled(),
|
|
11409
10417
|
readInstalledBundle: (pin) => project.contentLibrary.store.resolveBundle(pin),
|
|
11410
10418
|
connection,
|
|
11411
10419
|
startCompanion,
|
|
@@ -11505,37 +10513,6 @@ async function startCompanion(options) {
|
|
|
11505
10513
|
skill: run.skill,
|
|
11506
10514
|
artifactFile: null
|
|
11507
10515
|
}))];
|
|
11508
|
-
const panelDrafts = new ProjectContentPanelGuard(project.project.metadata.id);
|
|
11509
|
-
const upgradeAdapter = options.contentUpgradeAdapter;
|
|
11510
|
-
const requireUpgradeAdapter = () => {
|
|
11511
|
-
if (typeof upgradeAdapter?.assertProjectQuiescent !== "function" || typeof upgradeAdapter?.verifyNativeConfinement !== "function") throw new Error("This native host has no verified project-wide draft/run guard and confined migration Producer adapter. Content upgrade is unavailable; current project pins and files are unchanged.");
|
|
11512
|
-
return upgradeAdapter;
|
|
11513
|
-
};
|
|
11514
|
-
const contentMigration = project.createContentMigration({
|
|
11515
|
-
async assertQuiescent() {
|
|
11516
|
-
const adapter = requireUpgradeAdapter();
|
|
11517
|
-
panelDrafts.assertQuiescent();
|
|
11518
|
-
const native = await nativeRuns.read();
|
|
11519
|
-
if (native.activeMainBundles.length || native.executionAttempts.some((run) => ["queued", "working"].includes(run.phase))) throw new Error("Settle the running native Producer/Worker/main Bundle before upgrading.");
|
|
11520
|
-
if ((await reviews.readReviewStatus({
|
|
11521
|
-
workspace: await project.readWorkspace(),
|
|
11522
|
-
activeWork: observedWork(native)
|
|
11523
|
-
})).some((review) => ["running", "unknown"].includes(review.status) || review.nativeStatus === "unknown")) throw new Error("Settle the native background review before upgrading.");
|
|
11524
|
-
await adapter.assertProjectQuiescent(project.project.metadata.id);
|
|
11525
|
-
},
|
|
11526
|
-
async verifyNativeProducer(proof, candidateRoot) {
|
|
11527
|
-
const adapter = requireUpgradeAdapter();
|
|
11528
|
-
const binding = await resolveRun(proof);
|
|
11529
|
-
if (binding.parentRunId !== connection.threadId) throw new Error("Content migration must belong to this exact main conversation.");
|
|
11530
|
-
const log = await verifyChild({
|
|
11531
|
-
...binding,
|
|
11532
|
-
projectRoot: nativeCwd
|
|
11533
|
-
});
|
|
11534
|
-
if (log.recordedStatus !== "completed") throw new Error("Wait for the real native migration Producer to finish before adopting.");
|
|
11535
|
-
if (!log.rows.filter((row) => row.role === "user").map((row) => row.text).join("\n").includes(candidateRoot)) throw new Error("Native migration receipt does not identify the exact isolated candidate.");
|
|
11536
|
-
await adapter.verifyNativeConfinement(binding, candidateRoot);
|
|
11537
|
-
}
|
|
11538
|
-
});
|
|
11539
10516
|
const reviewStatus = async (workspace, native) => {
|
|
11540
10517
|
workspace ??= await project.readWorkspace();
|
|
11541
10518
|
if (!workspace.access?.writable) return [];
|
|
@@ -11686,11 +10663,6 @@ async function startCompanion(options) {
|
|
|
11686
10663
|
} : fullPresentation;
|
|
11687
10664
|
return send(response, 200, Object.hasOwn(params, "knownRevision") ? workspacePollResult(presentation, params.knownRevision) : presentation);
|
|
11688
10665
|
}
|
|
11689
|
-
if (method === "recoverContentUpgrade") {
|
|
11690
|
-
const receipt = await contentMigration.recover();
|
|
11691
|
-
await project.refreshAccess();
|
|
11692
|
-
return send(response, 200, { recovered: receipt ?? null });
|
|
11693
|
-
}
|
|
11694
10666
|
const ownsAccessCheck = [
|
|
11695
10667
|
"savePanel",
|
|
11696
10668
|
"sendPrompt",
|
|
@@ -11760,6 +10732,7 @@ async function startCompanion(options) {
|
|
|
11760
10732
|
host,
|
|
11761
10733
|
threadId: connection.threadId,
|
|
11762
10734
|
projectName: project.project.metadata.name,
|
|
10735
|
+
...studioConversationRequests ? { studioConversation: studioConversationBinding } : {},
|
|
11763
10736
|
...trialEmbedOrigin === void 0 ? {} : { trialPanel: {
|
|
11764
10737
|
trialId: options.trialInput.id,
|
|
11765
10738
|
parentOrigin: trialEmbedOrigin,
|
|
@@ -11767,55 +10740,6 @@ async function startCompanion(options) {
|
|
|
11767
10740
|
} }
|
|
11768
10741
|
});
|
|
11769
10742
|
if (method === "reloadKit") return send(response, 200, await project.reloadKit());
|
|
11770
|
-
if (method === "observePanelDraft") {
|
|
11771
|
-
panelDrafts.observe(params);
|
|
11772
|
-
return send(response, 200, { observed: true });
|
|
11773
|
-
}
|
|
11774
|
-
if (method === "prepareContentUpgrade") {
|
|
11775
|
-
await project.requireWritable();
|
|
11776
|
-
return send(response, 200, await contentMigration.prepare(params.target));
|
|
11777
|
-
}
|
|
11778
|
-
if ([
|
|
11779
|
-
"readContentUpgradeDefinition",
|
|
11780
|
-
"listContentUpgradeFiles",
|
|
11781
|
-
"readContentUpgradeFile",
|
|
11782
|
-
"writeContentUpgradeFile",
|
|
11783
|
-
"validateContentUpgrade"
|
|
11784
|
-
].includes(method)) {
|
|
11785
|
-
requireUpgradeAdapter();
|
|
11786
|
-
const candidate = await contentMigration.candidate(params.id);
|
|
11787
|
-
if (method === "readContentUpgradeDefinition") return send(response, 200, await candidate.readDefinition(params.side, params.offset, params.resource));
|
|
11788
|
-
if (method === "listContentUpgradeFiles") return send(response, 200, { files: await candidate.list() });
|
|
11789
|
-
if (method === "readContentUpgradeFile") return send(response, 200, await candidate.read(params.path, params.offset));
|
|
11790
|
-
if (method === "writeContentUpgradeFile") {
|
|
11791
|
-
if (typeof params.content !== "string") throw new Error("Candidate content must be UTF-8 text.");
|
|
11792
|
-
await candidate.write(params.path, params.content);
|
|
11793
|
-
return send(response, 200, { candidateUpdated: true });
|
|
11794
|
-
}
|
|
11795
|
-
candidate.assertDefinitionsRead();
|
|
11796
|
-
try {
|
|
11797
|
-
await contentMigration.validateCandidate(params.id, params.evidence);
|
|
11798
|
-
return send(response, 200, {
|
|
11799
|
-
accepted: true,
|
|
11800
|
-
published: false
|
|
11801
|
-
});
|
|
11802
|
-
} catch (error) {
|
|
11803
|
-
return send(response, 200, {
|
|
11804
|
-
accepted: false,
|
|
11805
|
-
diagnostics: [String(error.message ?? error)],
|
|
11806
|
-
next: "Repair this candidate in the same attached native Agent. Do not change saved facts to satisfy a validator."
|
|
11807
|
-
});
|
|
11808
|
-
}
|
|
11809
|
-
}
|
|
11810
|
-
if (method === "finishContentUpgrade") {
|
|
11811
|
-
(await contentMigration.candidate(params.id)).assertDefinitionsRead();
|
|
11812
|
-
const receipt = await contentMigration.finish(params.id, params.native, params.evidence);
|
|
11813
|
-
await project.refreshAccess();
|
|
11814
|
-
return send(response, 200, await withReviewStatus({
|
|
11815
|
-
...receipt,
|
|
11816
|
-
commit: receipt.checkpoint
|
|
11817
|
-
}));
|
|
11818
|
-
}
|
|
11819
10743
|
if (method === "readGraph") try {
|
|
11820
10744
|
const result = await knowledgeReads.read(project.project.metadata.id, () => knowledge.readGraph(), () => knowledge.recoveryStatus());
|
|
11821
10745
|
return send(response, 200, result.value ?? { content: JSON.stringify({
|
|
@@ -11953,8 +10877,12 @@ async function startCompanion(options) {
|
|
|
11953
10877
|
"unavailable",
|
|
11954
10878
|
"unknown"
|
|
11955
10879
|
].includes(result?.status) ? result.status : "unknown" });
|
|
11956
|
-
} catch {
|
|
11957
|
-
|
|
10880
|
+
} catch (error) {
|
|
10881
|
+
const receipt = notificationErrorResponse(error);
|
|
10882
|
+
return send(response, 200, {
|
|
10883
|
+
status: "unavailable",
|
|
10884
|
+
...receipt?.delivery === "not-submitted" ? receipt : {}
|
|
10885
|
+
});
|
|
11958
10886
|
}
|
|
11959
10887
|
}
|
|
11960
10888
|
const trialMethods = {
|
|
@@ -11977,37 +10905,69 @@ async function startCompanion(options) {
|
|
|
11977
10905
|
studioInstanceList: "listInstances",
|
|
11978
10906
|
studioInstanceRead: "readInstance",
|
|
11979
10907
|
studioInstanceCopy: "copyInstance",
|
|
10908
|
+
studioInstanceCreate: "createInstance",
|
|
10909
|
+
studioInstanceImportSources: "importInstanceSources",
|
|
10910
|
+
studioInstanceEditCurrent: "editCurrentInstance",
|
|
11980
10911
|
studioInstanceRename: "renameInstance",
|
|
11981
10912
|
studioInstanceRemove: "removeInstance",
|
|
11982
10913
|
studioInstanceFile: "readInstanceFile",
|
|
11983
10914
|
studioInstanceSave: "saveInstanceFile",
|
|
11984
10915
|
studioInstancePreview: "previewInstance",
|
|
10916
|
+
studioInstancePrepareChanges: "prepareInstanceChanges",
|
|
10917
|
+
studioInstanceSaveChanges: "saveInstanceChanges",
|
|
11985
10918
|
studioInstanceMounts: "updateInstanceMounts",
|
|
11986
10919
|
studioKitFiles: "readKitFiles",
|
|
11987
10920
|
studioKitFile: "readKitFile",
|
|
11988
10921
|
studioInstalledPreview: "previewInstalledPanel",
|
|
11989
|
-
studioDraftCreate: "createPanelDraft",
|
|
11990
|
-
studioDraftList: "listPanelDrafts",
|
|
11991
|
-
studioDraftRead: "readPanelDraft",
|
|
11992
|
-
studioDraftSave: "savePanelDraft",
|
|
11993
|
-
studioDraftPreview: "previewPanelDraft",
|
|
11994
|
-
studioDraftConfirm: "confirmPanelDraft",
|
|
11995
|
-
studioDraftFork: "forkPanelDraft",
|
|
11996
|
-
studioKitDraftCreate: "createKitDraft",
|
|
11997
|
-
studioKitDraftList: "listKitDrafts",
|
|
11998
|
-
studioKitDraftRead: "readKitDraft",
|
|
11999
|
-
studioKitDraftSave: "saveKitDraft",
|
|
12000
|
-
studioKitDraftValidate: "validateKitDraft",
|
|
12001
|
-
studioKitDraftPreview: "previewKitDraft",
|
|
12002
|
-
studioKitDraftConfirm: "confirmKitDraft",
|
|
12003
|
-
studioKitDraftFork: "forkKitDraft",
|
|
12004
10922
|
studioContentExport: "exportContentArchive",
|
|
12005
|
-
|
|
12006
|
-
studioContentImportRead: "readContentImport",
|
|
12007
|
-
studioContentImportList: "listContentImports",
|
|
12008
|
-
studioContentImportAdopt: "adoptContentImport"
|
|
10923
|
+
studioContentReadArchive: "readArchive"
|
|
12009
10924
|
};
|
|
12010
|
-
if (
|
|
10925
|
+
if (method === "studioAuthoringPrepareChanges") {
|
|
10926
|
+
if (!studioConversationRequests) throw Error("Studio authoring is unavailable in a trial service.");
|
|
10927
|
+
const candidate = await studioConversationRequests.prepareForConversation(params);
|
|
10928
|
+
const url = new URL(browserAccess === "local" ? `${origin}${browserBase}` : `${origin}/`);
|
|
10929
|
+
url.searchParams.set("view", "studio");
|
|
10930
|
+
url.searchParams.set("presentation", "conversation");
|
|
10931
|
+
url.searchParams.set("studioTarget", JSON.stringify(candidate.authoring.studio));
|
|
10932
|
+
url.searchParams.set("studioRequest", candidate.authoring.requestId);
|
|
10933
|
+
return send(response, 200, {
|
|
10934
|
+
...candidate,
|
|
10935
|
+
authoring: {
|
|
10936
|
+
...candidate.authoring,
|
|
10937
|
+
url: url.href
|
|
10938
|
+
}
|
|
10939
|
+
});
|
|
10940
|
+
}
|
|
10941
|
+
if (method === "studioAuthoringCandidateList" || method === "studioAuthoringCandidateRead") {
|
|
10942
|
+
if (!studioConversationRequests) throw Error("Studio authoring is unavailable in a trial service.");
|
|
10943
|
+
return send(response, 200, await studioConversationRequests[method === "studioAuthoringCandidateList" ? "list" : "read"](params));
|
|
10944
|
+
}
|
|
10945
|
+
if (Object.hasOwn(studioMethods, method)) {
|
|
10946
|
+
if (Object.hasOwn(params, "authoringRequestId")) {
|
|
10947
|
+
if (method !== "studioInstancePrepareChanges" || !studioConversationRequests) throw Error("Only prepareChanges can associate a Studio authoring request.");
|
|
10948
|
+
return send(response, 200, await studioConversationRequests.prepare(params));
|
|
10949
|
+
}
|
|
10950
|
+
return send(response, 200, await (await studio())[studioMethods[method]](params));
|
|
10951
|
+
}
|
|
10952
|
+
if (method === "sendPrompt" && Object.hasOwn(params, "studio")) {
|
|
10953
|
+
if (!studioConversationRequests || Object.keys(params).some((key) => ![
|
|
10954
|
+
"text",
|
|
10955
|
+
"requestId",
|
|
10956
|
+
"studio",
|
|
10957
|
+
"context"
|
|
10958
|
+
].includes(key)) || typeof params.text !== "string" || !params.text.trim() || Buffer.byteLength(params.text) > 32768) throw Error("Invalid Studio conversation request.");
|
|
10959
|
+
const target = await studioConversationRequests.register(params);
|
|
10960
|
+
return send(response, 200, await project.sendPrompt({
|
|
10961
|
+
text: params.text,
|
|
10962
|
+
requestId: params.requestId,
|
|
10963
|
+
saved: [],
|
|
10964
|
+
studio: target,
|
|
10965
|
+
verifyStudio: () => studioConversationRequests.read({
|
|
10966
|
+
requestId: params.requestId,
|
|
10967
|
+
studio: params.studio
|
|
10968
|
+
})
|
|
10969
|
+
}));
|
|
10970
|
+
}
|
|
12011
10971
|
if (method === "updateSettings") return send(response, 200, await settings.write(params));
|
|
12012
10972
|
if (method === "readReview") return send(response, 200, reviewRequest);
|
|
12013
10973
|
if (method === "prepareReview" || method === "prepareReviews") {
|
|
@@ -12222,6 +11182,7 @@ async function startCompanion(options) {
|
|
|
12222
11182
|
return lastAuthenticatedActivityAt;
|
|
12223
11183
|
},
|
|
12224
11184
|
async close() {
|
|
11185
|
+
studioConversationRequests?.close();
|
|
12225
11186
|
let trialCloseError;
|
|
12226
11187
|
try {
|
|
12227
11188
|
if (trials) await (await trials).close();
|