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.
Files changed (667) hide show
  1. package/README.md +4 -4
  2. package/bin/npm-desktop-preparation.mjs +5 -0
  3. package/package.json +20 -2
  4. package/payload/desktop-preparation/materials.json +180 -2
  5. package/payload/desktop-preparation/qwenwork-package.mjs +4 -0
  6. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/index.md +143 -0
  7. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/material.json +1 -0
  8. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
  9. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
  10. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
  11. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
  12. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
  13. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
  14. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
  15. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
  16. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
  17. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
  18. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
  19. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
  20. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
  21. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
  22. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
  23. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
  24. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
  25. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
  26. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
  27. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
  28. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
  29. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
  30. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
  31. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
  32. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
  33. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
  34. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
  35. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
  36. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
  37. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
  38. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
  39. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
  40. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
  41. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
  42. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
  43. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
  44. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
  45. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
  46. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
  47. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
  48. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
  49. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
  50. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
  51. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
  52. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
  53. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
  54. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
  55. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
  56. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
  57. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
  58. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
  59. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
  60. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
  61. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
  62. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
  63. 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
  64. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
  65. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
  66. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
  67. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
  68. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
  69. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
  70. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
  71. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
  72. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
  73. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
  74. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
  75. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
  76. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
  77. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
  78. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
  79. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
  80. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
  81. 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
  82. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
  83. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
  84. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
  85. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
  86. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
  87. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
  88. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
  89. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
  90. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
  91. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
  92. package/payload/desktop-preparation/qwenwork-template/skills/design-bundle-creator/SKILL.md +19 -0
  93. package/payload/desktop-preparation/qwenwork-template/skills/design-kit-creator/SKILL.md +19 -0
  94. package/payload/desktop-preparation/qwenwork-template/skills/design-skill-creator/SKILL.md +19 -0
  95. package/payload/desktop-preparation/src/browser-access.mjs +6 -9
  96. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/index.md +143 -0
  97. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/material.json +1 -0
  98. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
  99. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
  100. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
  101. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
  102. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
  103. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
  104. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
  105. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
  106. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
  107. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
  108. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
  109. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
  110. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
  111. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
  112. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
  113. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
  114. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
  115. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
  116. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
  117. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
  118. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
  119. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
  120. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
  121. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
  122. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
  123. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
  124. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
  125. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
  126. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
  127. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
  128. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
  129. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
  130. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
  131. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
  132. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
  133. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
  134. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
  135. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
  136. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
  137. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
  138. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
  139. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
  140. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
  141. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
  142. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
  143. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
  144. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
  145. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
  146. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
  147. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
  148. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
  149. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
  150. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
  151. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
  152. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
  153. 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
  154. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
  155. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
  156. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
  157. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
  158. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
  159. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
  160. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
  161. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
  162. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
  163. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
  164. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
  165. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
  166. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
  167. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
  168. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
  169. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
  170. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
  171. 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
  172. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
  173. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
  174. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
  175. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
  176. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
  177. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
  178. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
  179. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
  180. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
  181. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
  182. package/payload/desktop-preparation/studio-authoring-template/skills/design-bundle-creator/SKILL.md +19 -0
  183. package/payload/desktop-preparation/studio-authoring-template/skills/design-kit-creator/SKILL.md +19 -0
  184. package/payload/desktop-preparation/studio-authoring-template/skills/design-skill-creator/SKILL.md +19 -0
  185. package/payload/overlays/claude-code/.claude-plugin/plugin.json +1 -1
  186. package/payload/overlays/claude-code/authoring/studio-creators/index.md +143 -0
  187. package/payload/overlays/claude-code/authoring/studio-creators/material.json +1 -0
  188. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
  189. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
  190. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
  191. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
  192. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
  193. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
  194. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
  195. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
  196. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
  197. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
  198. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
  199. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
  200. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
  201. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
  202. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
  203. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
  204. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
  205. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
  206. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
  207. package/payload/overlays/claude-code/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
  208. package/payload/overlays/claude-code/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
  209. package/payload/overlays/claude-code/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
  210. package/payload/overlays/claude-code/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
  211. package/payload/overlays/claude-code/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
  212. package/payload/overlays/claude-code/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
  213. package/payload/overlays/claude-code/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
  214. package/payload/overlays/claude-code/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
  215. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
  216. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
  217. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
  218. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
  219. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
  220. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
  221. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
  222. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
  223. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
  224. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
  225. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
  226. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
  227. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
  228. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
  229. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
  230. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
  231. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
  232. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
  233. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
  234. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
  235. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
  236. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
  237. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
  238. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
  239. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
  240. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
  241. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
  242. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
  243. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
  244. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
  245. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
  246. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
  247. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
  248. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
  249. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
  250. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
  251. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
  252. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
  253. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
  254. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
  255. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
  256. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
  257. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
  258. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
  259. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
  260. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
  261. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
  262. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
  263. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
  264. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
  265. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
  266. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
  267. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
  268. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
  269. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
  270. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
  271. package/payload/overlays/claude-code/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
  272. package/payload/overlays/claude-code/skills/design-bundle-creator/SKILL.md +19 -0
  273. package/payload/overlays/claude-code/skills/design-kit-creator/SKILL.md +19 -0
  274. package/payload/overlays/claude-code/skills/design-skill-creator/SKILL.md +19 -0
  275. package/payload/overlays/codex/.codex-plugin/plugin.json +1 -1
  276. package/payload/overlays/codex/authoring/studio-creators/index.md +143 -0
  277. package/payload/overlays/codex/authoring/studio-creators/material.json +1 -0
  278. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
  279. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
  280. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
  281. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
  282. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
  283. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
  284. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
  285. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
  286. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
  287. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
  288. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
  289. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
  290. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
  291. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
  292. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
  293. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
  294. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
  295. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
  296. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
  297. package/payload/overlays/codex/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
  298. package/payload/overlays/codex/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
  299. package/payload/overlays/codex/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
  300. package/payload/overlays/codex/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
  301. package/payload/overlays/codex/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
  302. package/payload/overlays/codex/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
  303. package/payload/overlays/codex/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
  304. package/payload/overlays/codex/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
  305. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
  306. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
  307. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
  308. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
  309. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
  310. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
  311. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
  312. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
  313. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
  314. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
  315. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
  316. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
  317. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
  318. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
  319. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
  320. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
  321. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
  322. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
  323. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
  324. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
  325. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
  326. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
  327. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
  328. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
  329. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
  330. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
  331. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
  332. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
  333. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
  334. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
  335. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
  336. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
  337. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
  338. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
  339. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
  340. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
  341. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
  342. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
  343. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
  344. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
  345. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
  346. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
  347. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
  348. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
  349. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
  350. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
  351. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
  352. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
  353. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
  354. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
  355. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
  356. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
  357. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
  358. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
  359. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
  360. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
  361. package/payload/overlays/codex/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
  362. package/payload/overlays/codex/skills/design-bundle-creator/SKILL.md +19 -0
  363. package/payload/overlays/codex/skills/design-kit-creator/SKILL.md +19 -0
  364. package/payload/overlays/codex/skills/design-panel/SKILL.md +5 -0
  365. package/payload/overlays/codex/skills/design-skill-creator/SKILL.md +19 -0
  366. package/payload/overlays/codex/skills/yugoo/SKILL.md +34 -1
  367. package/payload/overlays/qoder/.qoder-plugin/plugin.json +1 -1
  368. package/payload/overlays/qoder/authoring/studio-creators/index.md +143 -0
  369. package/payload/overlays/qoder/authoring/studio-creators/material.json +1 -0
  370. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
  371. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
  372. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
  373. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
  374. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
  375. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
  376. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
  377. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
  378. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
  379. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
  380. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
  381. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
  382. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
  383. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
  384. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
  385. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
  386. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
  387. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
  388. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
  389. package/payload/overlays/qoder/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
  390. package/payload/overlays/qoder/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
  391. package/payload/overlays/qoder/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
  392. package/payload/overlays/qoder/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
  393. package/payload/overlays/qoder/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
  394. package/payload/overlays/qoder/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
  395. package/payload/overlays/qoder/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
  396. package/payload/overlays/qoder/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
  397. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
  398. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
  399. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
  400. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
  401. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
  402. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
  403. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
  404. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
  405. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
  406. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
  407. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
  408. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
  409. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
  410. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
  411. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
  412. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
  413. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
  414. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
  415. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
  416. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
  417. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
  418. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
  419. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
  420. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
  421. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
  422. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
  423. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
  424. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
  425. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
  426. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
  427. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
  428. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
  429. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
  430. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
  431. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
  432. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
  433. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
  434. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
  435. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
  436. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
  437. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
  438. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
  439. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
  440. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
  441. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
  442. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
  443. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
  444. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
  445. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
  446. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
  447. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
  448. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
  449. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
  450. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
  451. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
  452. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
  453. package/payload/overlays/qoder/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
  454. package/payload/overlays/qoder/skills/design-bundle-creator/SKILL.md +19 -0
  455. package/payload/overlays/qoder/skills/design-kit-creator/SKILL.md +19 -0
  456. package/payload/overlays/qoder/skills/design-skill-creator/SKILL.md +19 -0
  457. package/payload/shared/authoring/panel-components.json +1345 -1041
  458. package/payload/shared/authoring/studio-creators/index.md +143 -0
  459. package/payload/shared/authoring/studio-creators/material.json +1 -0
  460. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/SKILL.md +53 -0
  461. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/agents/openai.yaml +4 -0
  462. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/assets/skill.template.yaml +40 -0
  463. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/bundle-checklist.md +55 -0
  464. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/canvas-authoring.md +74 -0
  465. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/cooperation-authoring.md +52 -0
  466. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/panel-authoring.md +367 -0
  467. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/references/validation-authoring.md +154 -0
  468. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +267 -0
  469. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/list-panel-components.mjs +25 -0
  470. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-kit-creator/SKILL.md +28 -0
  471. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-kit-creator/agents/openai.yaml +4 -0
  472. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/kit-checklist.md +40 -0
  473. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-kit-creator/references/mindset-authoring.md +55 -0
  474. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/SKILL.md +38 -0
  475. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/agents/openai.yaml +4 -0
  476. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/assets/method-template.md +38 -0
  477. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/references/standards.md +94 -0
  478. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-skill-creator/scripts/render-state-contract.mjs +33 -0
  479. package/payload/shared/authoring/studio-creators/source/docs/a2ui-component-catalog-contract.md +69 -0
  480. package/payload/shared/authoring/studio-creators/source/docs/bundle-contract.md +632 -0
  481. package/payload/shared/authoring/studio-creators/source/docs/dsl-spec.md +1411 -0
  482. package/payload/shared/authoring/studio-creators/source/docs/panel-uiux-standard.md +891 -0
  483. package/payload/shared/authoring/studio-creators/source/docs/system-design-baseline.md +898 -0
  484. package/payload/shared/authoring/studio-creators/source/docs/wiki/extending.md +343 -0
  485. package/payload/shared/authoring/studio-creators/source/docs/wiki/terminology.md +57 -0
  486. package/payload/shared/authoring/studio-creators/source/examples/community-workshop-delivery/mindset.md +23 -0
  487. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/SKILL.md +92 -0
  488. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/panel.yaml +145 -0
  489. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/artifact-contract.md +151 -0
  490. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/canvas-guide.md +40 -0
  491. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/example.json +24 -0
  492. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/reference/preview.json +24 -0
  493. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/schema.yaml +67 -0
  494. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/business_data/validation.yaml +92 -0
  495. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/SKILL.md +217 -0
  496. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/THIRD_PARTY_NOTICES.md +58 -0
  497. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/reference/artifact-contract.md +195 -0
  498. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/schema.yaml +177 -0
  499. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/design_style/validation.yaml +48 -0
  500. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/SKILL.md +428 -0
  501. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/artifact-contract.md +44 -0
  502. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/bpmn_authoring.md +200 -0
  503. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/reference/canvas-guide.md +39 -0
  504. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/schema.yaml +61 -0
  505. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/flow_design/validation.yaml +64 -0
  506. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/SKILL.md +142 -0
  507. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/artifact-contract.md +204 -0
  508. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/canvas-guide.md +52 -0
  509. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/reference/preview.json +32 -0
  510. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/schema.yaml +93 -0
  511. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/function_modules/validation.yaml +21 -0
  512. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/SKILL.md +545 -0
  513. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/artifact-contract.md +164 -0
  514. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/canvas-guide.md +45 -0
  515. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/reference/task-to-page-method.md +82 -0
  516. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/schema.yaml +118 -0
  517. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/page_design/validation.yaml +104 -0
  518. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/research/SKILL.md +513 -0
  519. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/research/reference/artifact-contract.md +77 -0
  520. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/research/schema.yaml +61 -0
  521. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/research/validation.yaml +74 -0
  522. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/SKILL.md +196 -0
  523. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/artifact-contract.md +186 -0
  524. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/canvas-guide.md +38 -0
  525. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/reference/example.json +90 -0
  526. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/schema.yaml +59 -0
  527. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/role_access/validation.yaml +147 -0
  528. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/SKILL.md +202 -0
  529. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/reference/artifact-contract.md +245 -0
  530. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/schema.yaml +93 -0
  531. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/smart_questions/validation.yaml +17 -0
  532. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/SKILL.md +306 -0
  533. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/reference/artifact-contract.md +140 -0
  534. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/schema.yaml +38 -0
  535. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/web_app_prd_assembly/validation.yaml +24 -0
  536. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/SKILL.md +54 -0
  537. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/artifact-contract.md +56 -0
  538. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/canvas-guide.md +39 -0
  539. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/drawing-method.md +78 -0
  540. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/reference/geometry.md +79 -0
  541. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/schema.yaml +18 -0
  542. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/bundles/whiteboard/validation.yaml +18 -0
  543. package/payload/shared/authoring/studio-creators/source/packages/skills-web-app/kits/web_app/mindset.md +345 -0
  544. package/payload/shared/bundles/ai_agent_capabilities/locales/en-US.json +1 -1
  545. package/payload/shared/bundles/ai_agent_capabilities/locales/zh-CN.json +1 -1
  546. package/payload/shared/bundles/business_data/locales/en-US.json +1 -1
  547. package/payload/shared/bundles/business_data/locales/zh-CN.json +1 -1
  548. package/payload/shared/bundles/business_rules/locales/en-US.json +1 -1
  549. package/payload/shared/bundles/business_rules/locales/zh-CN.json +1 -1
  550. package/payload/shared/bundles/design_style/locales/en-US.json +1 -1
  551. package/payload/shared/bundles/design_style/locales/zh-CN.json +1 -1
  552. package/payload/shared/bundles/flow_design/locales/en-US.json +1 -1
  553. package/payload/shared/bundles/flow_design/locales/zh-CN.json +1 -1
  554. package/payload/shared/bundles/function_modules/locales/en-US.json +1 -2
  555. package/payload/shared/bundles/function_modules/locales/zh-CN.json +1 -2
  556. package/payload/shared/bundles/function_modules/panel.yaml +1 -1
  557. package/payload/shared/bundles/integration_design/locales/en-US.json +1 -1
  558. package/payload/shared/bundles/integration_design/locales/zh-CN.json +1 -1
  559. package/payload/shared/bundles/notification_design/locales/en-US.json +1 -1
  560. package/payload/shared/bundles/notification_design/locales/zh-CN.json +1 -1
  561. package/payload/shared/bundles/page_design/locales/en-US.json +1 -1
  562. package/payload/shared/bundles/page_design/locales/zh-CN.json +1 -1
  563. package/payload/shared/bundles/quality_acceptance/locales/en-US.json +1 -1
  564. package/payload/shared/bundles/quality_acceptance/locales/zh-CN.json +1 -1
  565. package/payload/shared/bundles/research/SKILL.md +38 -4
  566. package/payload/shared/bundles/research/locales/en-US.json +1 -1
  567. package/payload/shared/bundles/research/locales/zh-CN.json +1 -1
  568. package/payload/shared/bundles/research/reference/artifact-contract.md +31 -0
  569. package/payload/shared/bundles/research/reference/preview.json +1 -1
  570. package/payload/shared/bundles/research/skill.yaml +1 -1
  571. package/payload/shared/bundles/research/validation.yaml +3 -0
  572. package/payload/shared/bundles/role_access/locales/en-US.json +1 -1
  573. package/payload/shared/bundles/role_access/locales/zh-CN.json +1 -1
  574. package/payload/shared/bundles/smart_questions/locales/en-US.json +1 -1
  575. package/payload/shared/bundles/smart_questions/locales/zh-CN.json +1 -1
  576. package/payload/shared/bundles/web_app_prd_assembly/locales/en-US.json +1 -1
  577. package/payload/shared/bundles/web_app_prd_assembly/locales/zh-CN.json +1 -1
  578. package/payload/shared/bundles/whiteboard/locales/en-US.json +1 -1
  579. package/payload/shared/bundles/whiteboard/locales/zh-CN.json +1 -1
  580. package/payload/shared/kits/web_app/kit.yaml +1 -1
  581. package/payload/shared/kits/web_app/mindset.md +1 -1
  582. package/payload/shared/knowledge/runtime-manifest.json +3 -2
  583. package/payload/shared/knowledge/runtime.mjs +19 -26
  584. package/payload/shared/scripts/{codex-connection-DuV2wtkn.mjs → codex-connection-1RvU1XCj.mjs} +115 -68
  585. package/payload/shared/scripts/codex-desktop-bridge.mjs +2 -2
  586. package/payload/shared/scripts/{connection-file-Dk1TJHgf.mjs → connection-file-CNwrHbAG.mjs} +3 -1
  587. package/payload/shared/scripts/{content-archive-4UdioMU9.mjs → content-archive-CnwVcuWA.mjs} +66 -22
  588. package/payload/shared/scripts/{core-entry-B6zaTh1o.mjs → core-entry-DESmwP78.mjs} +1121 -993
  589. package/payload/shared/scripts/design.mjs +136 -227
  590. package/payload/shared/scripts/git-runtime-check.mjs +1 -1
  591. package/payload/shared/scripts/knowledge-snapshot-query.mjs +1 -1
  592. package/payload/shared/scripts/{load-DE29wyw0.mjs → load-C-RwS23Y.mjs} +1 -1
  593. package/payload/shared/scripts/panel-preview-BeVRYFk1.mjs +78 -0
  594. package/payload/shared/scripts/{server-BoVIQm2J.mjs → server-BBHB9EQr.mjs} +423 -1462
  595. package/payload/shared/scripts/studio-CS5TyoYn.mjs +868 -0
  596. package/payload/shared/scripts/{studio-instance-composition-ClAJ72-M.mjs → studio-instance-composition-BJzYMyvV.mjs} +165 -62
  597. package/payload/shared/scripts/studio-instances-D-Y1WNya.mjs +1212 -0
  598. package/payload/shared/scripts/studio-panel-drafts-Dq171F6x.mjs +393 -0
  599. package/payload/shared/scripts/{windows-private-storage-DRAXaqae.mjs → windows-native-platform-DLm-tedp.mjs} +7 -150
  600. package/payload/shared/scripts/windows-private-storage-Q0cTolE3.mjs +149 -0
  601. package/payload/shared/scripts/workbuddy-panel-service.mjs +2 -2
  602. package/payload/shared/web/{abnfDiagram-VCTEODGH-BElHS-zE.js → abnfDiagram-VCTEODGH-B9IX6J0A.js} +3 -3
  603. package/payload/shared/web/{architectureDiagram-5GKGNRK7-BECL41Da.js → architectureDiagram-5GKGNRK7-BisnJYZ9.js} +5 -5
  604. package/payload/shared/web/{blockDiagram-I7D4REHJ-BHdPKhvo.js → blockDiagram-I7D4REHJ-B2P0WSPo.js} +9 -9
  605. package/payload/shared/web/{c4Diagram-7LVT6UL2-CWIbzZY_.js → c4Diagram-7LVT6UL2-D48X7taa.js} +7 -7
  606. package/payload/shared/web/{channel-CIc-uLOz.js → channel-BbOrJIbZ.js} +1 -1
  607. package/payload/shared/web/{chunk-4HAMMTFA-b3a3G6vp.js → chunk-4HAMMTFA--gjf22vn.js} +5 -5
  608. package/payload/shared/web/{chunk-75Z2AOVW-CRrsMd7V.js → chunk-75Z2AOVW-B2_IycTx.js} +1 -1
  609. package/payload/shared/web/{chunk-DU6HZSFF-DQGKOvUD.js → chunk-DU6HZSFF-U8npu9I8.js} +1 -1
  610. package/payload/shared/web/{chunk-F27PBJKO-CKTDAMhD.js → chunk-F27PBJKO-CTwYnE5c.js} +1 -1
  611. package/payload/shared/web/{chunk-GMAD6QVW-CR6pf1Wk.js → chunk-GMAD6QVW-CKC1iaEH.js} +3 -3
  612. package/payload/shared/web/{chunk-GVQU2GXP-Cuq0uwWc.js → chunk-GVQU2GXP-dsHcuLJt.js} +2 -2
  613. package/payload/shared/web/{chunk-IMKFNOWR-BIkawNBO.js → chunk-IMKFNOWR-DB9Jxepw.js} +5 -5
  614. package/payload/shared/web/{chunk-L3NEJ4N5-CuRR4sgK.js → chunk-L3NEJ4N5-CdduiJry.js} +5 -5
  615. package/payload/shared/web/{chunk-OSK3NFVY-o5AaXVbW.js → chunk-OSK3NFVY-BOueY91y.js} +6 -6
  616. package/payload/shared/web/{chunk-P2QGCYS3-CQGN9yCW.js → chunk-P2QGCYS3-yDDaRgcO.js} +1 -1
  617. package/payload/shared/web/{chunk-POPQ4Y6H-CoV8F_6L.js → chunk-POPQ4Y6H-CljBbmoJ.js} +1 -1
  618. package/payload/shared/web/{chunk-PWAF6VOD-DLPv7U5s.js → chunk-PWAF6VOD-CIvbnSr5.js} +1 -1
  619. package/payload/shared/web/{chunk-SHT3W25Y-DAA9rzEQ.js → chunk-SHT3W25Y-BtoLtpjX.js} +7 -7
  620. package/payload/shared/web/{chunk-SVP7TREG-CsNwZR-J.js → chunk-SVP7TREG-BZs6p27H.js} +2 -2
  621. package/payload/shared/web/{chunk-TICWLB2K-BkUUbwgD.js → chunk-TICWLB2K-CKuC0THI.js} +5 -5
  622. package/payload/shared/web/{classDiagram-ZZMXUADV-HbaRZ3Nl.js → classDiagram-ZZMXUADV-CSdRlepW.js} +13 -13
  623. package/payload/shared/web/{classDiagram-v2-VYDZK3BY-Bkk8o06s.js → classDiagram-v2-VYDZK3BY-B2q6X41N.js} +13 -13
  624. package/payload/shared/web/client.js +39072 -5906
  625. package/payload/shared/web/{cynefinDiagram-5FMLGOSQ-CP-tjXE5.js → cynefinDiagram-5FMLGOSQ-4N8NcsmJ.js} +3 -3
  626. package/payload/shared/web/{dagre-GXQ25YYZ-GUxh673_.js → dagre-GXQ25YYZ-CcOoDuJv.js} +10 -10
  627. package/payload/shared/web/{diagram-S7CK7UJ4-BFDH1Gbu.js → diagram-S7CK7UJ4-eOfyUI5w.js} +4 -4
  628. package/payload/shared/web/{diagram-UQ7AKVKN-PHM6uSDT.js → diagram-UQ7AKVKN-6SdElfMd.js} +3 -3
  629. package/payload/shared/web/{diagram-VSXAHHWV-C6m_LjuJ.js → diagram-VSXAHHWV-DmzS3Yhs.js} +2 -2
  630. package/payload/shared/web/{diagram-VX7I27RA-G0Og_1eB.js → diagram-VX7I27RA-CJ0mjzif.js} +5 -5
  631. package/payload/shared/web/{diagram-Z3DM3KII-DxLU0CyU.js → diagram-Z3DM3KII-b86RsB6X.js} +3 -3
  632. package/payload/shared/web/{dist-CpfF1Jph.js → dist-USJ_fvfj.js} +49 -49
  633. package/payload/shared/web/{ebnfDiagram-PWID7BFC-Dh7NgFDw.js → ebnfDiagram-PWID7BFC-BBo2ROEO.js} +3 -3
  634. package/payload/shared/web/{erDiagram-RLTQ6QDP-De1Ves_r.js → erDiagram-RLTQ6QDP-B7ovyDrh.js} +12 -12
  635. package/payload/shared/web/{excalidraw-surface-q56LZexh.js → excalidraw-surface-BAJM_4P2.js} +1 -1
  636. package/payload/shared/web/flowDiagram-HODETNUW-BmAFlSDM.js +16 -0
  637. package/payload/shared/web/{ganttDiagram-EL5Y4UJY-9UcawiqG.js → ganttDiagram-EL5Y4UJY-BF9LYJFN.js} +2 -2
  638. package/payload/shared/web/{gitGraphDiagram-WWUBYQGX-BYFpRlq8.js → gitGraphDiagram-WWUBYQGX-BLzvYjNu.js} +2 -2
  639. package/payload/shared/web/{infoDiagram-27XIBGKW-B_sYOrDT.js → infoDiagram-27XIBGKW-Cg4jV_tA.js} +2 -2
  640. package/payload/shared/web/{ishikawaDiagram-5VMMS53U-Dbq0pjSI.js → ishikawaDiagram-5VMMS53U-BqfEZdpO.js} +3 -3
  641. package/payload/shared/web/{journeyDiagram-3NMN7TZE-CzWCm5-W.js → journeyDiagram-3NMN7TZE-_QW0fOqV.js} +2 -2
  642. package/payload/shared/web/{kanban-definition-UXKFOSKX-BPt2iOge.js → kanban-definition-UXKFOSKX-C1qxSJso.js} +9 -9
  643. package/payload/shared/web/{mindmap-definition-YA3MSWOX--s-o7l9c.js → mindmap-definition-YA3MSWOX-CxX8l7QH.js} +11 -11
  644. package/payload/shared/web/{pegDiagram-XKGWAZYB-BtVScKlh.js → pegDiagram-XKGWAZYB-CTCTE951.js} +3 -3
  645. package/payload/shared/web/{pieDiagram-E7YTZNPT-BVRgxFzd.js → pieDiagram-E7YTZNPT-BVaT5mnK.js} +3 -3
  646. package/payload/shared/web/{quadrantDiagram-AXDQQJYC-CoI_hWsn.js → quadrantDiagram-AXDQQJYC-DC6iypTQ.js} +1 -1
  647. package/payload/shared/web/{railroadDiagram-O6MQD6OU-CQvkXn2E.js → railroadDiagram-O6MQD6OU-CKk1xSyC.js} +3 -3
  648. package/payload/shared/web/{requirementDiagram-BXWQKSXE-BeMX6Y3_.js → requirementDiagram-BXWQKSXE-D3r71qoR.js} +11 -11
  649. package/payload/shared/web/{sankeyDiagram-P5KCCOFB-DAW2tMQQ.js → sankeyDiagram-P5KCCOFB-BtB3K5ob.js} +1 -1
  650. package/payload/shared/web/{sequenceDiagram-WJ2MYXX4-CIyt6uFH.js → sequenceDiagram-WJ2MYXX4-BsJtFrjU.js} +4 -4
  651. package/payload/shared/web/{stateDiagram-D77RDMKH-Cl5YhtvO.js → stateDiagram-D77RDMKH-srvF-8IQ.js} +13 -13
  652. package/payload/shared/web/{stateDiagram-v2-MP3YSRHH-BsQEmOAZ.js → stateDiagram-v2-MP3YSRHH-CQCPpAb7.js} +13 -13
  653. package/payload/shared/web/{swimlanes-42K2YHIH-DRkfAovZ.js → swimlanes-42K2YHIH-cwCdwOb4.js} +10 -10
  654. package/payload/shared/web/{swimlanesDiagram-VR7AAH4N-CDtUk-LJ.js → swimlanesDiagram-VR7AAH4N-6PGsW_lL.js} +13 -13
  655. package/payload/shared/web/{timeline-definition-24CTP7MA-Bc0GefZe.js → timeline-definition-24CTP7MA-DbKwK9M6.js} +3 -3
  656. package/payload/shared/web/{vennDiagram-4TSXK5OY-CU3O6wRh.js → vennDiagram-4TSXK5OY-BnJ0tHAd.js} +3 -3
  657. package/payload/shared/web/{wardleyDiagram-VM6X3IG4-USaMhD8m.js → wardleyDiagram-VM6X3IG4-Bm9W5WIA.js} +3 -3
  658. package/payload/shared/web/{xychartDiagram-S5SC5T6Z-C8IhDKnq.js → xychartDiagram-S5SC5T6Z-DInWMmWi.js} +5 -5
  659. package/release-hosts.json +1 -1
  660. package/release-manifest.json +664 -133
  661. package/payload/shared/scripts/panel-preview-CPGv8nTe.mjs +0 -105
  662. package/payload/shared/scripts/studio-content-archive-CNUz472H.mjs +0 -334
  663. package/payload/shared/scripts/studio-instances-DKW4R37b.mjs +0 -592
  664. package/payload/shared/scripts/studio-panel-drafts-Cu48ih5u.mjs +0 -787
  665. package/payload/shared/scripts/windows-private-storage-_g0Kdp0U.mjs +0 -2
  666. package/payload/shared/web/flowDiagram-HODETNUW-DY-blVtj.js +0 -16
  667. package/payload/shared/web/katex-DhTJdtYJ.js +0 -26444
@@ -1563,186 +1563,6 @@ function DesignResumeActionId(value) {
1563
1563
  if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,255}$/.test(value)) throw new Error(`invalid resume action id ${JSON.stringify(value)}`);
1564
1564
  return value;
1565
1565
  }
1566
- //#endregion
1567
- //#region packages/core/src/project-content-transaction.ts
1568
- /** Recoverable same-project content adoption. Git is the publication authority. */
1569
- const marker$1 = (root) => join(root, ".git", "design-system-content-adoption");
1570
- const pendingPath = (root) => join(marker$1(root), "pending.json");
1571
- /** Every ordinary project read fails closed while crash/journal reconciliation is pending. */
1572
- async function assertProjectContentSettled(root) {
1573
- try {
1574
- await lstat(marker$1(root));
1575
- } catch (error) {
1576
- if (error.code === "ENOENT") return;
1577
- throw error;
1578
- }
1579
- throw new Error("project content: adoption reconciliation is pending; recover this exact project before reading or writing");
1580
- }
1581
- function target(root, path) {
1582
- if (path !== "project.json" && !path.startsWith("design_files/")) throw new Error("project content: adoption path is outside project content");
1583
- if (/[\\:\u0000-\u001f]/u.test(path) || path.split("/").some((part) => !part || part === "." || part === "..")) throw new Error("project content: unsafe adoption path");
1584
- const result = resolve(root, path), rel = relative(root, result);
1585
- if (isAbsolute(rel) || rel.startsWith("..")) throw new Error("project content: adoption path escapes project");
1586
- return result;
1587
- }
1588
- async function readOptional(path) {
1589
- try {
1590
- const info = await lstat(path);
1591
- if (!info.isFile() || info.isSymbolicLink()) throw new Error("project content: expected a regular file");
1592
- return await readFile(path);
1593
- } catch (error) {
1594
- if (error.code === "ENOENT") return void 0;
1595
- throw error;
1596
- }
1597
- }
1598
- async function noSymlinkParents(root, path) {
1599
- for (let current = dirname(path); current !== root; current = dirname(current)) try {
1600
- if (!(await lstat(current)).isDirectory()) throw new Error("project content: unsafe parent directory");
1601
- } catch (error) {
1602
- if (error.code !== "ENOENT") throw error;
1603
- }
1604
- }
1605
- async function durableWrite(path, bytes) {
1606
- const temp = `${path}.${randomUUID()}.tmp`;
1607
- const file = await open(temp, "wx", 384);
1608
- try {
1609
- await file.writeFile(bytes);
1610
- await file.sync();
1611
- } finally {
1612
- await file.close();
1613
- }
1614
- try {
1615
- await rename(temp, path);
1616
- } finally {
1617
- await rm(temp, { force: true });
1618
- }
1619
- }
1620
- const encoded = (bytes) => bytes === void 0 ? null : Buffer.from(bytes).toString("base64");
1621
- const decoded = (bytes) => bytes === null ? void 0 : Buffer.from(bytes, "base64");
1622
- const same = (left, right) => left === void 0 ? right === void 0 : right !== void 0 && Buffer.from(left).equals(Buffer.from(right));
1623
- /** No registry change, new project identity, serial pin update or second model authority. */
1624
- var ProjectContentTransaction = class {
1625
- options;
1626
- git;
1627
- constructor(options) {
1628
- this.options = options;
1629
- if (!isAbsolute(options.root)) throw new Error("project content: root must be absolute");
1630
- this.git = new GitVersioning(options.spawn, options.root);
1631
- }
1632
- async adopt(input) {
1633
- return this.options.mutate(async () => {
1634
- await assertProjectContentSettled(this.options.root);
1635
- if (!input.files.has("project.json") || input.files.size > 4096 || !/^[a-f0-9]{64}$/u.test(input.contentHash)) throw new Error("project content: invalid bounded candidate adoption");
1636
- if (await this.git.head() !== input.sourceCheckpoint) throw new Error("project content: stale migration checkpoint");
1637
- const files = new Map([...input.files].map(([path, bytes]) => [path, bytes === void 0 ? void 0 : Buffer.from(bytes)]));
1638
- const sourceText = await this.git.readTextAt(input.sourceCheckpoint, "project.json");
1639
- const targetBytes = files.get("project.json");
1640
- if (!sourceText || !targetBytes) throw new Error("project content: source and target metadata are required");
1641
- const source = parseDesignProjectJson(sourceText), metadata = parseDesignProjectJson(targetBytes.toString("utf8"));
1642
- if (source.id !== input.projectId || metadata.id !== source.id || metadata.createdAt !== source.createdAt || metadata.name !== source.name || metadata.knowledge.provider !== source.knowledge.provider || metadata.kit?.contentHash !== input.contentHash) throw new Error("project content: candidate must preserve project identity and own the target fingerprint");
1643
- let total = 0;
1644
- const entries = [];
1645
- for (const [path, after] of files) {
1646
- const livePath = target(this.options.root, path);
1647
- await noSymlinkParents(this.options.root, livePath);
1648
- const before = await this.git.readBytesAt(input.sourceCheckpoint, path, void 0, 67108864);
1649
- if (!same(before, await readOptional(livePath))) throw new Error(`project content: uncommitted edit at ${path}; preserve it before migration`);
1650
- total += (before?.byteLength ?? 0) + (after?.byteLength ?? 0);
1651
- if (total > 134217728) throw new Error("project content: migration receipt exceeds byte limit");
1652
- entries.push({
1653
- path,
1654
- before: encoded(before),
1655
- after: encoded(after)
1656
- });
1657
- }
1658
- await input.validate(files);
1659
- if (await this.git.head() !== input.sourceCheckpoint) throw new Error("project content: stale migration checkpoint");
1660
- for (const entry of entries) if (!same(decoded(entry.before), await readOptional(target(this.options.root, entry.path)))) throw new Error(`project content: edit arrived during validation at ${entry.path}`);
1661
- const pending = {
1662
- formatVersion: 1,
1663
- operationId: randomUUID(),
1664
- projectId: input.projectId,
1665
- sourceCheckpoint: input.sourceCheckpoint,
1666
- contentHash: input.contentHash,
1667
- entries,
1668
- ...this.options.journalOwner === void 0 ? {} : { journalOwner: this.options.journalOwner }
1669
- };
1670
- const staging = `${marker$1(this.options.root)}-${pending.operationId}.tmp`;
1671
- await mkdir(staging);
1672
- try {
1673
- await durableWrite(join(staging, "pending.json"), Buffer.from(JSON.stringify(pending)));
1674
- await rename(staging, marker$1(this.options.root));
1675
- } finally {
1676
- await rm(staging, {
1677
- recursive: true,
1678
- force: true
1679
- });
1680
- }
1681
- await this.options.boundary?.("prepared");
1682
- await this.git.commitExact(`design: content upgrade ${pending.operationId}`, files, input.sourceCheckpoint);
1683
- await this.options.boundary?.("committed");
1684
- return this.reconcile(pending);
1685
- });
1686
- }
1687
- async recover() {
1688
- return this.options.mutate(async () => {
1689
- const bytes = await readOptional(pendingPath(this.options.root));
1690
- if (!bytes) {
1691
- await assertProjectContentSettled(this.options.root);
1692
- return;
1693
- }
1694
- if (bytes.length > 188743680) throw new Error("project content: oversized recovery receipt");
1695
- const pending = JSON.parse(bytes.toString("utf8"));
1696
- const base64 = (value) => value === null || typeof value === "string" && Buffer.from(value, "base64").toString("base64") === value;
1697
- if (pending.formatVersion !== 1 || !Array.isArray(pending.entries) || !pending.entries.length || pending.entries.length > 4096 || !/^[a-f0-9]{64}$/u.test(pending.contentHash) || !/^[a-f0-9-]{36}$/u.test(pending.operationId) || !/^[a-f0-9-]{36}$/u.test(pending.projectId) || !/^[a-f0-9]{40,64}$/u.test(pending.sourceCheckpoint) || pending.journalOwner !== void 0 && (typeof pending.journalOwner !== "string" || !pending.journalOwner || pending.journalOwner.length > 256 || /[\u0000-\u001f]/u.test(pending.journalOwner)) || !pending.entries.some((entry) => entry.path === "project.json") || new Set(pending.entries.map((entry) => entry.path)).size !== pending.entries.length || pending.entries.some((entry) => typeof entry.path !== "string" || !base64(entry.before) || !base64(entry.after))) throw new Error("project content: invalid recovery receipt");
1698
- const metadataEntry = pending.entries.find((entry) => entry.path === "project.json");
1699
- const beforeMetadata = decoded(metadataEntry.before), afterMetadata = decoded(metadataEntry.after);
1700
- if (!beforeMetadata || !afterMetadata || !same(beforeMetadata, await this.git.readBytesAt(pending.sourceCheckpoint, "project.json"))) throw new Error("project content: recovery source metadata does not match its checkpoint");
1701
- const before = parseDesignProjectJson(beforeMetadata.toString("utf8")), after = parseDesignProjectJson(afterMetadata.toString("utf8"));
1702
- if (before.id !== pending.projectId || after.id !== pending.projectId || before.name !== after.name || before.createdAt !== after.createdAt || before.knowledge.provider !== after.knowledge.provider || after.kit?.contentHash !== pending.contentHash) throw new Error("project content: invalid recovery identity/fingerprint");
1703
- const head = await this.git.head();
1704
- if (!((await this.git.history(1))[0]?.subject === `design: content upgrade ${pending.operationId}`)) {
1705
- for (const entry of pending.entries) if (!same(decoded(entry.before), await readOptional(target(this.options.root, entry.path))) || !same(decoded(entry.before), head ? await this.git.readBytesAt(head, entry.path) : void 0)) throw new Error("project content: external edit conflicts with recovery; preserve it before retry");
1706
- await rm(marker$1(this.options.root), { recursive: true });
1707
- return;
1708
- }
1709
- return this.reconcile(pending);
1710
- });
1711
- }
1712
- async reconcile(pending) {
1713
- const checkpoint = await this.git.head();
1714
- if (!checkpoint || checkpoint === pending.sourceCheckpoint) throw new Error("project content: adoption did not publish a checkpoint");
1715
- const history = await this.git.history(2);
1716
- if (history[0]?.commit !== checkpoint || history[1]?.commit !== pending.sourceCheckpoint || history[0]?.subject !== `design: content upgrade ${pending.operationId}`) throw new Error("project content: HEAD changed after adoption; reconcile the exact checkpoint before continuing");
1717
- for (const entry of pending.entries) {
1718
- const path = target(this.options.root, entry.path);
1719
- await noSymlinkParents(this.options.root, path);
1720
- const live = await readOptional(path), after = decoded(entry.after);
1721
- if (!same(after, await this.git.readBytesAt(checkpoint, entry.path))) throw new Error("project content: receipt does not match committed candidate");
1722
- if (!same(live, decoded(entry.before)) && !same(live, after)) throw new Error(`project content: external edit conflicts at ${entry.path}`);
1723
- }
1724
- for (const entry of pending.entries) {
1725
- const path = target(this.options.root, entry.path), bytes = decoded(entry.after);
1726
- if (bytes === void 0) await rm(path, { force: true });
1727
- else {
1728
- await mkdir(dirname(path), { recursive: true });
1729
- await durableWrite(path, bytes);
1730
- }
1731
- }
1732
- await this.options.boundary?.("files-synced");
1733
- const receipt = {
1734
- operationId: pending.operationId,
1735
- projectId: pending.projectId,
1736
- sourceCheckpoint: pending.sourceCheckpoint,
1737
- checkpoint,
1738
- contentHash: pending.contentHash
1739
- };
1740
- await this.options.record(receipt, pending.journalOwner);
1741
- await this.options.boundary?.("journal-recorded");
1742
- await rm(marker$1(this.options.root), { recursive: true });
1743
- return receipt;
1744
- }
1745
- };
1746
1566
  const PROJECT_KIND = "dsh-design-project";
1747
1567
  const PROJECT_FILE = "project.json";
1748
1568
  const PROJECT_README_FILE = "README.md";
@@ -2076,7 +1896,6 @@ var DesignProjectManager = class {
2076
1896
  /** Display-only identity read. Does not authorize publication or execution. */
2077
1897
  async readMetadata(projectRoot) {
2078
1898
  const root = requireRoot(projectRoot);
2079
- await assertProjectContentSettled(root);
2080
1899
  await this.fs.requireDirectory(root);
2081
1900
  await this.fs.requireDirectory(join(root, DESIGN_FILES_DIRECTORY));
2082
1901
  await this.fs.readText(join(root, ".gitignore"));
@@ -2125,6 +1944,88 @@ var DesignProjectManager = class {
2125
1944
  }
2126
1945
  };
2127
1946
  //#endregion
1947
+ //#region packages/core/src/data-table.ts
1948
+ const DATA_TABLE_TYPES = [
1949
+ "text",
1950
+ "number",
1951
+ "boolean",
1952
+ "date",
1953
+ "select"
1954
+ ];
1955
+ const DATA_TABLE_LIMITS = {
1956
+ columns: 64,
1957
+ rows: 500,
1958
+ cell: 1e4
1959
+ };
1960
+ const object$2 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
1961
+ const dataTableId = (v) => typeof v === "string" && /^[A-Za-z][\w-]{0,63}$/.test(v) && ![
1962
+ "__proto__",
1963
+ "constructor",
1964
+ "prototype"
1965
+ ].includes(v);
1966
+ function dataTableCellIssue(column, value) {
1967
+ if (value === void 0 || value === "") return;
1968
+ if (typeof value !== "string" || value.length > DATA_TABLE_LIMITS.cell) return "invalid_value";
1969
+ if (column.type === "number" && (!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(value) || !Number.isFinite(Number(value)))) return "number";
1970
+ if (column.type === "boolean" && !["true", "false"].includes(value)) return "boolean";
1971
+ if (column.type === "date" && (!/^\d{4}-\d{2}-\d{2}$/.test(value) || !Number.isFinite(Date.parse(value)) || new Date(value).toISOString().slice(0, 10) !== value)) return "date";
1972
+ if (column.type === "select" && !column.options?.includes(value)) return "select";
1973
+ }
1974
+ /** Structural errors prohibit editing; cell errors stay visible and repairable. */
1975
+ function dataTableIssues(value, cells = true) {
1976
+ if (value === void 0) return [];
1977
+ if (!object$2(value) || !Array.isArray(value.columns) || !object$2(value.rows)) return ["Expected columns and rows"];
1978
+ const errors = [], ids = /* @__PURE__ */ new Set();
1979
+ if (Object.keys(value).some((k) => !["columns", "rows"].includes(k))) errors.push("Unknown table property");
1980
+ if (value.columns.length > DATA_TABLE_LIMITS.columns || Object.keys(value.rows).length > DATA_TABLE_LIMITS.rows) errors.push("Sample table exceeds row/column limit");
1981
+ for (const column of value.columns) {
1982
+ if (!object$2(column) || !dataTableId(column.id) || ids.has(column.id)) {
1983
+ errors.push("Invalid or duplicate field ID");
1984
+ continue;
1985
+ }
1986
+ ids.add(column.id);
1987
+ if (typeof column.name !== "string" || !column.name.trim() || column.name.length > 120) errors.push(`${column.id}: invalid name`);
1988
+ if (!DATA_TABLE_TYPES.includes(column.type)) errors.push(`${column.id}: invalid type`);
1989
+ if (column.role !== void 0 && ![
1990
+ "dimension",
1991
+ "value",
1992
+ "attribute"
1993
+ ].includes(String(column.role))) errors.push(`${column.id}: invalid role`);
1994
+ for (const key of ["unit", "description"]) if (column[key] !== void 0 && typeof column[key] !== "string") errors.push(`${column.id}: invalid ${key}`);
1995
+ if (column.options !== void 0 && (!Array.isArray(column.options) || column.options.length > 100 || column.options.some((v) => typeof v !== "string" || !v.trim() || v.length > 120) || new Set(column.options).size !== column.options.length)) errors.push(`${column.id}: invalid choices`);
1996
+ if (column.type === "select" && (!Array.isArray(column.options) || column.options.length === 0)) errors.push(`${column.id}: choices required`);
1997
+ }
1998
+ for (const [id, row] of Object.entries(value.rows)) {
1999
+ if (!dataTableId(id) || !object$2(row)) {
2000
+ errors.push("Invalid row");
2001
+ continue;
2002
+ }
2003
+ for (const [key, cell] of Object.entries(row)) if (!ids.has(key) || typeof cell !== "string") errors.push(`${id}.${key}: unknown field or non-text cell`);
2004
+ else if (cells) {
2005
+ const issue = dataTableCellIssue(value.columns.find((c) => object$2(c) && c.id === key), cell);
2006
+ if (issue) errors.push(`${id}.${key}: ${issue}`);
2007
+ }
2008
+ }
2009
+ return errors;
2010
+ }
2011
+ /** Ensure the declared editor cannot escape its Bundle's schema authority. */
2012
+ function dataTableSchemaMatches(spec) {
2013
+ const columns = spec.properties?.columns, rows = spec.properties?.rows, column = columns?.items;
2014
+ return spec.type === "object" && spec.additional_properties === false && spec.required?.includes("columns") === true && spec.required?.includes("rows") === true && Object.keys(spec.properties ?? {}).every((key) => ["columns", "rows"].includes(key)) && columns?.type === "array" && column?.type === "object" && [
2015
+ "id",
2016
+ "name",
2017
+ "type"
2018
+ ].every((key) => column.required?.includes(key)) && column.required?.every((key) => [
2019
+ "id",
2020
+ "name",
2021
+ "type"
2022
+ ].includes(key)) === true && ["id", "name"].every((key) => column.properties?.[key]?.type === "string") && column.properties?.type?.type === "enum" && DATA_TABLE_TYPES.every((type) => column.properties.type.values?.includes(type)) && column.properties.type.values?.length === DATA_TABLE_TYPES.length && column.properties?.role?.type === "enum" && [
2023
+ "dimension",
2024
+ "value",
2025
+ "attribute"
2026
+ ].every((role) => column.properties.role.values?.includes(role)) && ["unit", "description"].every((key) => column.properties?.[key]?.type === "string") && column.properties?.options?.type === "array" && column.properties.options.items?.type === "string" && rows?.type === "map" && rows.value?.type === "map" && rows.value.value?.type === "string";
2027
+ }
2028
+ //#endregion
2128
2029
  //#region node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
2129
2030
  var require_identity = /* @__PURE__ */ __commonJSMin(((exports) => {
2130
2031
  const ALIAS = Symbol.for("yaml.alias");
@@ -8947,7 +8848,7 @@ function validatorFromSchemaYaml(text) {
8947
8848
  };
8948
8849
  }
8949
8850
  //#endregion
8950
- //#region packages/core/src/runtime-drivers.ts
8851
+ //#region packages/core/src/design-driver-id.ts
8951
8852
  const DRIVER_ID = /^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*(?:\/v[1-9][0-9]*)$/;
8952
8853
  /**
8953
8854
  * Whether a string is a well-formed versioned dotted identifier ending in `/vN`.
@@ -9216,6 +9117,7 @@ function stringPair(value, left, right) {
9216
9117
  return typeof value === "object" && value !== null && !Array.isArray(value) && nonEmptyText(value[left]) && nonEmptyText(value[right]);
9217
9118
  }
9218
9119
  const LEAF_OPERATORS = [
9120
+ "data_table",
9219
9121
  "non_empty_map",
9220
9122
  "non_empty_list",
9221
9123
  "non_empty_string",
@@ -9254,6 +9156,7 @@ function assertStatePath(value, ruleId, operand) {
9254
9156
  }
9255
9157
  function assertRootLeafPaths(check, ruleId) {
9256
9158
  for (const operator of [
9159
+ "data_table",
9257
9160
  "non_empty_map",
9258
9161
  "non_empty_list",
9259
9162
  "non_empty_string",
@@ -9561,6 +9464,7 @@ function statePath(subject, path) {
9561
9464
  }
9562
9465
  /** Evaluate one leaf check against one subject; returns true on failure. */
9563
9466
  function leafFails(check, subject, readField, state = subject) {
9467
+ if ("data_table" in check) return dataTableIssues(readField(subject, String(check.data_table))).length > 0;
9564
9468
  if ("exclusive_fields" in check) {
9565
9469
  const spec = check.exclusive_fields;
9566
9470
  const values = spec.fields.map((field) => readField(subject, field));
@@ -9924,30 +9828,18 @@ const PANEL_COMPONENT_CATALOG = {
9924
9828
  description: "Switch between uniquely identified, titled children with keyboard-accessible tabs; inactive content stays mounted to preserve drafts.",
9925
9829
  autoOrder: 2
9926
9830
  },
9927
- split: {
9928
- description: "Compose sidebar and main slots.",
9929
- autoOrder: 3
9930
- },
9931
9831
  stack: {
9932
9832
  description: "Arrange child components vertically.",
9933
9833
  autoOrder: 1
9934
9834
  },
9935
9835
  panel_workspace: {
9936
- description: "Full-height workspace with a resizable navigation sidebar.",
9836
+ description: "Layout shell with sidebar/main slots. Plain main content scrolls within the shell; use record_workspace with record_inspector for record selection and editing.",
9937
9837
  ownsWorkspace: true
9938
9838
  },
9939
9839
  text_block: {
9940
9840
  description: "Show escaped plain-text guidance; never executable markup.",
9941
9841
  autoOrder: 4
9942
9842
  },
9943
- record_nav: {
9944
- description: "Navigate a declared record collection.",
9945
- sourceBound: true
9946
- },
9947
- record_tree: {
9948
- description: "Show record hierarchy using declared parent bindings.",
9949
- sourceBound: true
9950
- },
9951
9843
  record_form: {
9952
9844
  description: "Edit records using declared fields and schema constraints. Static sections may opt into form.header detail/card, form.reorder:false and finite form.body field/row/group/tabs composition. Record-local tabs reuse mounted shared tabs; titled collapsible groups preserve their values. Unconsumed visible fields remain rendered. Fields can opt into choice_layout, radio_custom user-triggered custom_focus, select allow_clear:false and token_list token_add_mode:menu for presets plus a cancellable custom-entry card. Omitted configuration preserves legacy behavior; generated-origin forms reject these static extensions.",
9953
9845
  sourceBound: true,
@@ -10037,12 +9929,17 @@ const PANEL_COMPONENT_CATALOG = {
10037
9929
  ownsWorkspace: true
10038
9930
  },
10039
9931
  record_inspector: { description: "Edit the selected record inside its owning record workspace. Optional authored sources compose same-record root and nested section views, preserving their canonical field bindings." },
9932
+ math_document: {
9933
+ description: "Read mathematical statements beside their plain-language explanations, notation and source pointers. Authored math bindings use declared text/rows fields in a record workspace; optional LaTeX editing uses the existing field/save authority. Rendering is not mathematical verification.",
9934
+ sourceBound: true
9935
+ },
10040
9936
  record_preview: { description: "Preview the selected record title, body and optional action without executing it. Static form.body groups may embed the same component via sidecar; bindings are declared same-section text fields and the preview follows that exact form record, stacking below fields in narrow containers. Generated-origin forms reject this static extension." },
10041
9937
  record_related_editor: { description: "Edit child records referencing the selected parent; additions bind that parent explicitly. Optional authored record_table groups the same declared editors into complete table columns without converting canonical records. Optional inherit_from_graph presents ancestors' associated records as read-only source-linked groups, never copies or resolves domain policy conflicts." },
10042
9938
  relation_graph: { description: "Interact with record nodes and binary edges or ordered role-bearing participants; multi-party relation centers project the original relation record." },
10043
9939
  reference_graph: { description: "Read-only relation canvas derived from declared in-workspace record references; details edit the original records, never a graph copy. Nodes may use label_scope: record for a root text label declared on the same canonical collection. Links use target or finite targets matching the field options_from_section/options_from_sections; missing or ambiguous identities stay diagnostic without guessed edges." },
9940
+ data_table: { description: "Authored editable sample-data grid with saved column definitions, field types and row identities. Bound to a declared data_table field inside a record workspace; edits use existing save ports. Supports text, number, boolean, date and select cells, field properties and two-index matrix viewing. No file upload or expressions; not enabled for generated panels." },
10044
9941
  record_matrix: { description: "Pivot a declared rows field inside the selected record." },
10045
- record_artifact: { description: "Preview an existing artifact of the selected record." },
9942
+ record_artifact: { description: "Preview an existing artifact of the selected record, or inline related artifacts through an explicit record_select reference_field. Missing related records create no empty view; unreadable referenced files remain visible." },
10046
9943
  structured_data: {
10047
9944
  description: "Read structured saved data without changing it.",
10048
9945
  autoOrder: 10
@@ -10322,6 +10219,86 @@ function validateIncidentDeletion(sections, fields) {
10322
10219
  return errors;
10323
10220
  }
10324
10221
  //#endregion
10222
+ //#region packages/core/src/panel-authoring-reference.ts
10223
+ /** Exact catalog identity, not another vocabulary or a browser crypto dependency. */
10224
+ function panelAuthoringCatalogIdentity() {
10225
+ return JSON.stringify({
10226
+ catalog: PANEL_COMPONENT_CATALOG,
10227
+ generated: GENERATED_COMPONENT_KINDS
10228
+ });
10229
+ }
10230
+ const object$1 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
10231
+ /** Query trusted packaged source references; never reads host paths or executes declarations. */
10232
+ function queryPanelAuthoringReference(material, name, reference, type) {
10233
+ if (!Object.hasOwn(PANEL_COMPONENT_CATALOG, name)) throw Error("Unknown panel component");
10234
+ if (![
10235
+ "contract",
10236
+ "docs",
10237
+ "examples"
10238
+ ].includes(reference) || type !== void 0 && reference !== "contract") throw Error("Invalid authoring reference query");
10239
+ if (!object$1(material) || material.format !== "panel-authoring-reference/v1" || material.catalogIdentity !== panelAuthoringCatalogIdentity() || !object$1(material.components) || !object$1(material.contracts) || Object.keys(material.components).length !== COMPONENT_KINDS.length || !COMPONENT_KINDS.every((kind) => Object.hasOwn(material.components, kind))) throw Error("Authoring reference is missing or incompatible with the installed catalog");
10240
+ const entry = material.components[name];
10241
+ if (!object$1(entry) || entry.component !== name) throw Error("Missing component authoring reference");
10242
+ const follow = (value) => {
10243
+ if (!object$1(value) || typeof value.name !== "string" || !Object.hasOwn(material.contracts, value.name)) throw Error("Missing referenced local contract");
10244
+ return {
10245
+ ...value,
10246
+ read: {
10247
+ name,
10248
+ reference: "contract",
10249
+ type: value.name
10250
+ }
10251
+ };
10252
+ };
10253
+ if (reference === "docs") {
10254
+ if (!object$1(entry.documentation) || !Array.isArray(entry.documentation.sections) || !entry.documentation.sections.length) throw Error("Missing component documentation");
10255
+ return {
10256
+ component: name,
10257
+ documentation: {
10258
+ ...entry.documentation,
10259
+ read: {
10260
+ name,
10261
+ reference: "docs"
10262
+ }
10263
+ },
10264
+ limits: entry.limits,
10265
+ protocolStatus: entry.protocolStatus
10266
+ };
10267
+ }
10268
+ if (reference === "examples") {
10269
+ if (!Array.isArray(entry.examples)) throw Error("Missing component examples");
10270
+ return {
10271
+ component: name,
10272
+ examples: entry.examples,
10273
+ coverage: entry.examples.length ? "existing-structure-validated-usages" : "no-existing-usage",
10274
+ limits: entry.limits
10275
+ };
10276
+ }
10277
+ if (type !== void 0) {
10278
+ if (!Object.hasOwn(material.contracts, type)) throw Error("Unknown local contract type or property");
10279
+ const declaration = material.contracts[type];
10280
+ if (!object$1(declaration) || declaration.name !== type || typeof declaration.declaration !== "string" || !declaration.declaration.trim()) throw Error("Missing local contract declaration");
10281
+ if (!Array.isArray(declaration.references)) throw Error("Missing local contract references");
10282
+ return {
10283
+ component: name,
10284
+ contract: {
10285
+ ...declaration,
10286
+ references: declaration.references.map(follow)
10287
+ },
10288
+ limits: entry.limits,
10289
+ protocolStatus: entry.protocolStatus
10290
+ };
10291
+ }
10292
+ if (!Array.isArray(entry.contracts) || !object$1(material.hostCallbackContract)) throw Error("Missing component contract references");
10293
+ return {
10294
+ ...entry,
10295
+ contracts: entry.contracts.map(follow),
10296
+ examples: void 0,
10297
+ documentation: void 0,
10298
+ hostCallbackContract: material.hostCallbackContract
10299
+ };
10300
+ }
10301
+ //#endregion
10325
10302
  //#region packages/core/src/panel-dsl.ts
10326
10303
  /**
10327
10304
  * Design-panel DSL: the declarative contract a Design Bundle uses to describe
@@ -10377,6 +10354,7 @@ const CONTROL_KINDS = [
10377
10354
  "key_value",
10378
10355
  "toggle",
10379
10356
  "artifact_ref",
10357
+ "data_table",
10380
10358
  "rows",
10381
10359
  "source_list",
10382
10360
  "token_list",
@@ -10510,6 +10488,14 @@ function validatePanelManifest(manifest) {
10510
10488
  if (field.required !== void 0) errors.push(`field ${field.key}: use required or required_in, not both`);
10511
10489
  }
10512
10490
  if (!CONTROL_KINDS.includes(field.control)) errors.push(`field "${field.key}" has unknown control "${String(field.control)}"`);
10491
+ if (field.control === "data_table" && [
10492
+ "columns",
10493
+ "options",
10494
+ "item_fields",
10495
+ "max_rows",
10496
+ "options_from_panel",
10497
+ "options_from_section"
10498
+ ].some((key) => field[key] !== void 0)) errors.push(`field ${field.key}: data_table uses saved column definitions, not static editor options`);
10513
10499
  const choiceControl = [
10514
10500
  "select",
10515
10501
  "radio",
@@ -11257,6 +11243,98 @@ function validatePanelManifest(manifest) {
11257
11243
  return field?.control !== "record_select" || field.readonly || targets.length !== family.length || family.some((value) => !targets.includes(value));
11258
11244
  })) errors.push(`${path}: navigation_hierarchy needs editable parent references over the workspace sources`);
11259
11245
  }
11246
+ if (component.math !== void 0 && component.component !== "math_document") errors.push(`${path}: math belongs to math_document`);
11247
+ if (component.component === "math_document") {
11248
+ const config = component.math;
11249
+ if (!workspace?.includes(component.source ?? "") || !config || typeof config !== "object" || Array.isArray(config)) errors.push(`${path}: math_document requires a workspace source and math bindings`);
11250
+ else {
11251
+ if (Object.keys(config).some((key) => ![
11252
+ "heading",
11253
+ "introduction",
11254
+ "notes",
11255
+ "complete",
11256
+ "symbols",
11257
+ "statements",
11258
+ "output",
11259
+ "checks",
11260
+ "provenance"
11261
+ ].includes(key))) errors.push(`${path}: unknown math binding`);
11262
+ const used = /* @__PURE__ */ new Set();
11263
+ const bind = (key, controls) => {
11264
+ const field = typeof key === "string" && isSafeDottedPath(key) && !key.includes(".") ? fieldOf(component.source, key) : void 0;
11265
+ if (!field || field.hidden || !controls.includes(field.control) || used.has(String(key))) errors.push(`${path}: math needs distinct declared visible ${controls.join("/")} fields (${String(key)})`);
11266
+ used.add(String(key));
11267
+ return field;
11268
+ };
11269
+ bind(config.heading, ["text"]);
11270
+ for (const key of [
11271
+ "introduction",
11272
+ "notes",
11273
+ "complete"
11274
+ ]) if (config[key] !== void 0) bind(config[key], ["text", "textarea"]);
11275
+ for (const key of ["symbols", "statements"]) {
11276
+ const rows = config[key];
11277
+ if (rows === void 0 && key === "symbols") continue;
11278
+ if (!rows || typeof rows !== "object" || Array.isArray(rows)) {
11279
+ errors.push(`${path}: math ${key} needs row bindings`);
11280
+ continue;
11281
+ }
11282
+ if (Object.keys(rows).some((key) => ![
11283
+ "field",
11284
+ "formula",
11285
+ "meaning",
11286
+ "title",
11287
+ "source",
11288
+ "details"
11289
+ ].includes(key))) errors.push(`${path}: unknown math row binding`);
11290
+ const field = bind(rows.field, ["rows"]);
11291
+ if (!field?.columns?.length || field.columns.some((column) => !["text", "textarea"].includes(column.control))) errors.push(`${path}: math entries require text/textarea columns`);
11292
+ if (rows.details !== void 0 && (!isStringList(rows.details) || rows.details.length > 6)) errors.push(`${path}: math details must be a list of up to six columns`);
11293
+ const columns = [
11294
+ rows.formula,
11295
+ rows.meaning,
11296
+ rows.title,
11297
+ rows.source,
11298
+ ...Array.isArray(rows.details) ? rows.details : []
11299
+ ].filter((value) => value !== void 0);
11300
+ if (typeof rows.formula !== "string" || typeof rows.meaning !== "string" || new Set(columns).size !== columns.length || columns.some((key) => !field?.columns?.some((column) => column.key === key && ["text", "textarea"].includes(column.control)))) errors.push(`${path}: math row bindings need distinct declared text columns`);
11301
+ }
11302
+ const readonlyBind = (key, controls) => {
11303
+ const field = bind(key, controls);
11304
+ if (field && field.readonly !== true) errors.push(`${path}: math output, checks and provenance fields must be readonly`);
11305
+ };
11306
+ for (const [key, allowed] of [["output", ["file", "format"]], ["checks", [
11307
+ "status",
11308
+ "summary",
11309
+ "evidence"
11310
+ ]]]) {
11311
+ const group = config[key];
11312
+ if (group === void 0) continue;
11313
+ if (!group || typeof group !== "object" || Array.isArray(group) || Object.keys(group).some((name) => !allowed.includes(name))) {
11314
+ errors.push(`${path}: invalid math ${key} bindings`);
11315
+ continue;
11316
+ }
11317
+ if (key === "output") {
11318
+ const output = config.output;
11319
+ readonlyBind(output.file, ["artifact_ref"]);
11320
+ if (output.format !== void 0) readonlyBind(output.format, ["text"]);
11321
+ } else {
11322
+ const checks = config.checks;
11323
+ readonlyBind(checks.status, ["select"]);
11324
+ readonlyBind(checks.summary, ["text", "textarea"]);
11325
+ if (checks.evidence !== void 0) readonlyBind(checks.evidence, ["text", "textarea"]);
11326
+ }
11327
+ }
11328
+ if (config.provenance !== void 0) {
11329
+ if (!isStringList(config.provenance)) errors.push(`${path}: math provenance must list declared readonly fields`);
11330
+ else for (const key of config.provenance) readonlyBind(key, [
11331
+ "text",
11332
+ "textarea",
11333
+ "artifact_ref"
11334
+ ]);
11335
+ }
11336
+ }
11337
+ }
11260
11338
  if (component.component === "record_related_editor") {
11261
11339
  const reference = fieldOf(component.source, component.bindings?.reference);
11262
11340
  const referenceTargets = reference?.options_from_sections ?? (reference?.options_from_section ? [reference.options_from_section] : []);
@@ -11465,14 +11543,22 @@ function validatePanelManifest(manifest) {
11465
11543
  "relation_graph",
11466
11544
  "reference_graph",
11467
11545
  "record_matrix",
11546
+ "data_table",
11468
11547
  "record_artifact"
11469
11548
  ].includes(component.component) && !scope) errors.push(`${path}: ${component.component} requires record_workspace`);
11470
11549
  if (component.component === "record_artifact") {
11471
11550
  if (!scope?.includes(component.source ?? "")) errors.push(`${path}: artifact source must belong to workspace`);
11472
11551
  if (!ownsField(component.source, component.artifact?.field) || !fields.some((field) => isEditorField(field) && field.key === component.artifact?.field && field.control === "artifact_ref")) errors.push(`${path}: artifact must bind a declared artifact_ref field`);
11552
+ const reference = component.artifact?.reference_field;
11553
+ if (reference !== void 0) {
11554
+ const field = fields.find((field) => isEditorField(field) && field.key === reference && field.applies_to?.includes(component.source ?? "") === true);
11555
+ if (!field || field.hidden || field.visible_when || field.control !== "record_select" || !scope?.includes(field.options_from_section ?? "") || field.options_from_section === component.source) errors.push(`${path}: artifact reference_field must bind a record_select to another workspace section`);
11556
+ }
11557
+ const explanation = component.artifact?.explanation_field;
11558
+ if (explanation !== void 0 && !fields.some((field) => isEditorField(field) && field.key === explanation && field.applies_to?.includes(component.source ?? "") && !field.hidden && !field.visible_when && ["text", "textarea"].includes(field.control))) errors.push(`${path}: artifact explanation_field must bind declared visible text`);
11473
11559
  }
11474
- if (component.references !== void 0 && component.component !== "reference_graph") errors.push(`${path}: references belongs to reference_graph`);
11475
- if (component.component === "reference_graph") {
11560
+ if (component.references !== void 0 && !["reference_graph", "relation_graph"].includes(component.component)) errors.push(`${path}: references belongs to a reference or participant relation graph`);
11561
+ if (component.component === "reference_graph" || component.component === "relation_graph" && component.references !== void 0) {
11476
11562
  const bindings = component.references;
11477
11563
  if (!bindings || !Array.isArray(bindings.nodes) || !bindings.nodes.length || !Array.isArray(bindings.links)) errors.push(`${path}: reference_graph needs nodes and links`);
11478
11564
  else {
@@ -11544,7 +11630,11 @@ function validatePanelManifest(manifest) {
11544
11630
  }
11545
11631
  }
11546
11632
  }
11547
- if (component.graph !== void 0 || component.children?.length) errors.push(`${path}: reference_graph cannot own editable graph bindings or children`);
11633
+ if (component.component === "reference_graph" && (component.graph !== void 0 || component.children?.length)) errors.push(`${path}: reference_graph cannot own editable graph bindings or children`);
11634
+ if (component.component === "relation_graph") {
11635
+ const primary = Array.isArray(bindings?.nodes) ? bindings.nodes.find((node) => node?.source === component.graph?.nodes) : void 0;
11636
+ if (!component.graph?.participants || !primary || primary.label_field !== component.graph.label_field || Array.isArray(bindings?.nodes) && bindings.nodes.some((node) => node?.source === component.graph?.edges) || bindings?.layout !== void 0 || component.children?.length) errors.push(`${path}: relation references need participants, the same primary node label, no relation-section nodes, layout or children`);
11637
+ }
11548
11638
  }
11549
11639
  if (component.component === "relation_graph") {
11550
11640
  const graph = component.graph;
@@ -11675,6 +11765,11 @@ function validatePanelManifest(manifest) {
11675
11765
  }
11676
11766
  }
11677
11767
  }
11768
+ if (component.table !== void 0 && component.component !== "data_table") errors.push(`${path}: table binding requires data_table`);
11769
+ if (component.component === "data_table") {
11770
+ const binding = component.table;
11771
+ if (!scope?.includes(component.source ?? "") || !binding || typeof binding !== "object" || Object.keys(binding).some((key) => key !== "field") || !ownsField(component.source, binding.field) || !fields.some((field) => isEditorField(field) && field.key === binding.field && field.control === "data_table" && field.applies_to?.includes(component.source ?? ""))) errors.push(`${path}: data_table requires a declared data_table field in its workspace source`);
11772
+ }
11678
11773
  if (component.component === "record_matrix") {
11679
11774
  const matrix = component.matrix;
11680
11775
  if (!scope?.includes(component.source ?? "")) errors.push(`${path}: matrix source must belong to workspace`);
@@ -12654,6 +12749,7 @@ function collectionRecordSpec(spec) {
12654
12749
  function controlAcceptsSchema(control, spec) {
12655
12750
  if (control === "record_map" || control === "source_reference_map") return spec.type === "map" && spec.value?.type === "object";
12656
12751
  if (control === "radio_custom") return spec.type === "string";
12752
+ if (control === "data_table") return dataTableSchemaMatches(spec);
12657
12753
  if (control === "rows") return spec.type === "array";
12658
12754
  if (control === "list" || control === "multi_select" || control === "record_multi_select" || control === "source_list" || control === "token_list") return spec.type === "array" && (spec.items?.type === "string" || spec.items?.type === "enum" && spec.items.values?.every((value) => typeof value === "string") === true);
12659
12755
  if (control === "number") return spec.type === "number";
@@ -13042,9 +13138,9 @@ async function loadDesignBundle(fs, location, expectedPin) {
13042
13138
  if (frontmatter.meta.description !== void 0 && typeof frontmatter.meta.description !== "string") throw new Error(`design kit: ${base}/SKILL.md description must be a string`);
13043
13139
  const manifest = parseSkillManifest(slots["skill.yaml"], `${base}/skill.yaml`);
13044
13140
  if (manifest.name !== entry) throw new Error(`design kit: ${base}/skill.yaml name must equal directory ${JSON.stringify(entry)}`);
13045
- if (manifest.version === void 0) throw new Error(`design kit: ${base}/skill.yaml must declare a top-level version`);
13046
- if (typeof manifest.version !== "string") throw new Error(`design kit: ${base}/skill.yaml version must be a string`);
13047
- const bundleVersion = DesignBundleVersion(manifest.version);
13141
+ if (manifest.version === void 0 && !location.current) throw new Error(`design kit: ${base}/skill.yaml must declare a top-level version`);
13142
+ if (manifest.version !== void 0 && typeof manifest.version !== "string") throw new Error(`design kit: ${base}/skill.yaml version must be a string`);
13143
+ const bundleVersion = DesignBundleVersion(manifest.version ?? "1.0");
13048
13144
  assertSkillRuntime(manifest, `${base}/skill.yaml`);
13049
13145
  const title = parseBilingualManifestField(manifest, "title", `${base}/skill.yaml`);
13050
13146
  const label = parseBilingualManifestField(manifest, "label", `${base}/skill.yaml`);
@@ -13123,6 +13219,8 @@ async function loadDesignBundle(fs, location, expectedPin) {
13123
13219
  const bundleResources = await collectResourceInputs(fs, base, "", void 0, realBundleRootConfinement);
13124
13220
  const skill = {
13125
13221
  resourceRoot: base,
13222
+ sourceId: location.sourceId,
13223
+ sourceFs: fs,
13126
13224
  ...manifest.identity === void 0 ? {} : { catalogName },
13127
13225
  name: typeof frontmatter.meta.name === "string" ? frontmatter.meta.name : entry,
13128
13226
  authority,
@@ -13135,7 +13233,7 @@ async function loadDesignBundle(fs, location, expectedPin) {
13135
13233
  execution: manifest.execution,
13136
13234
  metadata
13137
13235
  };
13138
- if (expectedPin && ((skill.catalogName ?? skill.name) !== expectedPin.name || String(skill.version) !== expectedPin.version)) throw new Error("design bundle: exact pin does not match content");
13236
+ if (expectedPin && ((skill.catalogName ?? skill.name) !== expectedPin.name || expectedPin.version !== void 0 && String(skill.version) !== expectedPin.version)) throw new Error("design bundle: exact pin does not match content");
13139
13237
  return Object.freeze({
13140
13238
  skill: Object.freeze(skill),
13141
13239
  resourceRoot: base,
@@ -13153,9 +13251,9 @@ async function loadDesignKit(fs, location, options) {
13153
13251
  const { meta, body } = parseFrontmatter(mindsetText, paths.mindsetPath);
13154
13252
  const name = meta.name;
13155
13253
  if (typeof name !== "string" || name.trim() === "") throw new Error(`design kit: mindset file missing "name" frontmatter: ${paths.mindsetPath}`);
13156
- if (meta.version === void 0) throw new Error(`design kit: mindset file missing "version" frontmatter: ${paths.mindsetPath}`);
13157
- if (typeof meta.version !== "string") throw new Error(`design kit: mindset file "version" frontmatter must be a string: ${paths.mindsetPath}`);
13158
- const version = DesignKitVersion(meta.version);
13254
+ if (meta.version === void 0 && !options.current) throw new Error(`design kit: mindset file missing "version" frontmatter: ${paths.mindsetPath}`);
13255
+ if (meta.version !== void 0 && typeof meta.version !== "string") throw new Error(`design kit: mindset file "version" frontmatter must be a string: ${paths.mindsetPath}`);
13256
+ const version = DesignKitVersion(meta.version ?? "1.0");
13159
13257
  const relationsPath = paths.relationsPath ?? resolve(paths.rootDir, "relations.yaml");
13160
13258
  let relationsSource;
13161
13259
  if (fs.realPath !== void 0 && realKitRoot !== void 0) try {
@@ -13196,7 +13294,7 @@ async function loadDesignKit(fs, location, options) {
13196
13294
  }]));
13197
13295
  if (!resolver) throw new Error("design kit: independent mounts require a Bundle resolver");
13198
13296
  bundle = await resolver(entry);
13199
- if (!bundle || (bundle.skill.catalogName ?? bundle.skill.name) !== entry.name || String(bundle.skill.version) !== entry.version) throw new Error(`design kit: unavailable exact Bundle ${entry.name}@${entry.version}`);
13297
+ if (!bundle || (bundle.skill.catalogName ?? bundle.skill.name) !== entry.name || !options.current && String(bundle.skill.version) !== entry.version) throw new Error(`design kit: unavailable exact Bundle ${entry.name}@${entry.version}`);
13200
13298
  if (bundle.skill.name !== entry.bindingKey) throw new Error("design kit: bindingKey must preserve the Bundle runtime name and data paths");
13201
13299
  } else {
13202
13300
  const base = resolve(paths.skillsDir, entry.name);
@@ -13229,6 +13327,9 @@ async function loadDesignKit(fs, location, options) {
13229
13327
  });
13230
13328
  return {
13231
13329
  sourceRoot: paths.rootDir,
13330
+ sourceLocation: paths,
13331
+ sourceId: options.sourceId,
13332
+ sourceFs: fs,
13232
13333
  name,
13233
13334
  version,
13234
13335
  ...typeof meta.description === "string" ? { description: meta.description } : {},
@@ -13252,8 +13353,8 @@ function canonical$7(value) {
13252
13353
  }
13253
13354
  /** Paths are installation details; all authored methods, manifests and captured resources participate. */
13254
13355
  function projectKitContentHash(kit) {
13255
- const { sourceRoot: _root, ...definition } = kit;
13256
- const skills = kit.skills.map(({ resourceRoot: _resourceRoot, ...skill }) => skill);
13356
+ const { sourceRoot: _root, sourceLocation: _location, sourceFs: _fs, sourceId: _sourceId, ...definition } = kit;
13357
+ const skills = kit.skills.map(({ resourceRoot: _resourceRoot, sourceFs: _fs, sourceId: _sourceId, ...skill }) => skill);
13257
13358
  return createHash("sha256").update(JSON.stringify(canonical$7({
13258
13359
  ...definition,
13259
13360
  skills
@@ -13283,362 +13384,628 @@ function composeProjectKit(pin, base, replacements) {
13283
13384
  if (pin.contentHash !== void 0 && pin.contentHash !== projectKitContentHash(kit)) throw new Error("project content: pinned definitions changed; restore the exact closure or explicitly migrate");
13284
13385
  return kit;
13285
13386
  }
13286
- /** Numeric exact-version ordering, never lexicographic and never a version range. */
13287
- function compareContentVersions(left, right) {
13288
- DesignBundleVersion(left);
13289
- DesignBundleVersion(right);
13290
- const a = left.split(".").map(BigInt), b = right.split(".").map(BigInt);
13291
- return a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0;
13292
- }
13293
- /** New projects choose one already validated complete Kit composition. */
13294
- function latestInstalledKit(kits, name) {
13295
- return kits.filter((kit) => kit.name === name).reduce((latest, kit) => latest === void 0 || compareContentVersions(kit.version, latest.version) > 0 ? kit : latest, void 0);
13296
- }
13297
13387
  //#endregion
13298
- //#region packages/core/src/project-content-definition.ts
13299
- const slots = {
13300
- "skill.yaml": "skillYaml",
13301
- "schema.yaml": "schemaYaml",
13302
- "validation.yaml": "validationYaml",
13303
- "panel.yaml": "panelYaml",
13304
- "renderer.md": "rendererMd"
13305
- };
13306
- function resources(kit) {
13307
- const result = /* @__PURE__ */ new Map([["mindset.md", kit.mindsetSource ?? kit.mindset]]);
13308
- for (const skill of kit.skills) {
13309
- const prefix = `${skill.name}/`;
13310
- result.set(`${prefix}SKILL.md`, skill.content);
13311
- for (const [file, field] of Object.entries(slots)) {
13312
- const text = skill.metadata?.[field];
13313
- if (typeof text === "string") result.set(`${prefix}${file}`, text);
13388
+ //#region packages/core/src/content-store.ts
13389
+ /** File-backed immutable content. The caller supplies trusted installation provenance. */
13390
+ const contentNodeFs = {
13391
+ readText: async (path) => {
13392
+ try {
13393
+ return await readFile(path, "utf8");
13394
+ } catch (error) {
13395
+ if (error.code === "ENOENT") return void 0;
13396
+ throw error;
13314
13397
  }
13315
- }
13316
- for (const [path, text] of Object.entries(kit.resources ?? {})) if (!result.has(path)) result.set(path, text);
13398
+ },
13399
+ listDir: (path) => readdir(path),
13400
+ isDirectory: async (path) => (await lstat(path)).isDirectory(),
13401
+ realPath: async (path) => (await import("node:fs/promises")).realpath(path)
13402
+ };
13403
+ const emptyIndex = () => ({
13404
+ formatVersion: 1,
13405
+ kits: [],
13406
+ bundles: []
13407
+ });
13408
+ const encode = (name) => {
13409
+ if (!name || name.includes("\0")) throw new Error("content: invalid identity");
13410
+ return Buffer.from(name, "utf8").toString("hex");
13411
+ };
13412
+ const key$1 = (pin) => `${pin.name}\0${pin.version}`;
13413
+ function confinedRelativePath(root, path) {
13414
+ const result = relative(root, resolve(root, path));
13415
+ if (!result || result === ".." || result.startsWith("../") || isAbsolute(result)) throw new Error("content: Kit entry path escapes retained root");
13317
13416
  return result;
13318
13417
  }
13319
- function migrationDefinitionReadPlan(source, target) {
13320
- const inputs = {
13321
- source: resources(source),
13322
- target: resources(target)
13323
- };
13324
- const names = new Set([...source.skills, ...target.skills].map((skill) => skill.name));
13325
- const changed = /* @__PURE__ */ new Set();
13326
- for (const name of names) {
13327
- const a = source.skills.find((skill) => skill.name === name), b = target.skills.find((skill) => skill.name === name);
13328
- const paths = new Set([...inputs.source.keys(), ...inputs.target.keys()].filter((path) => path.startsWith(`${name}/`)));
13329
- if (!a || !b || a.version !== b.version || [...paths].some((path) => inputs.source.get(path) !== inputs.target.get(path))) changed.add(name);
13330
- }
13331
- const relevant = new Set(changed);
13332
- for (const skill of [...source.skills, ...target.skills]) {
13333
- const declarations = [
13334
- skill.metadata?.schemaYaml,
13335
- skill.metadata?.panelYaml,
13336
- skill.metadata?.validationYaml
13337
- ].filter((value) => typeof value === "string").join("\n");
13338
- for (const name of names) if (name !== skill.name && declarations.includes(`${name}/`) && (changed.has(skill.name) || changed.has(name))) {
13339
- relevant.add(skill.name);
13340
- relevant.add(name);
13341
- }
13342
- }
13343
- const required = {};
13344
- for (const side of ["source", "target"]) {
13345
- const kit = side === "source" ? source : target;
13346
- const selected = {};
13347
- for (const [path, text] of inputs[side]) {
13348
- const owner = kit.skills.find((skill) => path.startsWith(`${skill.name}/`));
13349
- if (!owner && /\.(md|ya?ml|json)$/u.test(path) || owner && relevant.has(owner.name) && (changed.has(owner.name) && /\.md$/u.test(path) || [
13350
- "skill.yaml",
13351
- "schema.yaml",
13352
- "validation.yaml",
13353
- "panel.yaml"
13354
- ].includes(path.slice(owner.name.length + 1)))) selected[path] = text;
13355
- }
13356
- required[side] = JSON.stringify({
13357
- kit: {
13358
- name: kit.name,
13359
- version: kit.version
13360
- },
13361
- changed: [...changed],
13362
- relevant: [...relevant],
13363
- relationVocabulary: kit.relationVocabulary,
13364
- files: selected,
13365
- availableResources: ["complete", ...inputs[side].keys()]
13366
- }, null, 2);
13367
- }
13418
+ function retainedKitLocation(rootDir, paths) {
13419
+ if (!paths) return rootDir;
13420
+ if (Object.values(paths).some((path) => isAbsolute(path))) throw new Error("content: retained Kit paths must be relative");
13368
13421
  return {
13369
- required,
13370
- resources: inputs
13422
+ rootDir,
13423
+ skillsDir: join(rootDir, "skills"),
13424
+ mindsetPath: resolve(rootDir, confinedRelativePath(rootDir, paths.mindset)),
13425
+ manifestPath: resolve(rootDir, confinedRelativePath(rootDir, paths.manifest)),
13426
+ ...paths.relations === void 0 ? {} : { relationsPath: resolve(rootDir, confinedRelativePath(rootDir, paths.relations)) }
13371
13427
  };
13372
13428
  }
13373
- //#endregion
13374
- //#region packages/core/src/project-content-candidate.ts
13375
- /** Model-facing candidate capability, shared by native Host adapters; never a live project path. */
13376
- var ProjectContentCandidate = class {
13429
+ /** Copy bytes, rejecting symlinks and special files. Also hash empty directories. */
13430
+ async function copyTree(source, target, digest = createHash("sha256"), relativePath = "", budget = {
13431
+ bytes: 0,
13432
+ nodes: 0
13433
+ }) {
13434
+ if (++budget.nodes > 2e4 || relativePath.split("/").length > 32) throw new Error("content: resource tree exceeds limits");
13435
+ const info = await lstat(source);
13436
+ if (info.isSymbolicLink()) throw new Error(`content: symlink resource is not retained: ${source}`);
13437
+ if (info.isDirectory()) {
13438
+ digest.update(`directory\0${relativePath}\0`);
13439
+ await mkdir(target, { recursive: true });
13440
+ for (const entry of (await readdir(source)).sort()) await copyTree(join(source, entry), join(target, entry), digest, relativePath ? `${relativePath}/${entry}` : entry, budget);
13441
+ } else if (info.isFile()) {
13442
+ budget.bytes += info.size;
13443
+ if (budget.bytes > 134217728) throw new Error("content: resource bytes exceed limits");
13444
+ const bytes = await readFile(source);
13445
+ digest.update(`file\0${relativePath}\0${bytes.length}\0`).update(bytes);
13446
+ await writeFile(target, bytes, {
13447
+ flag: "wx",
13448
+ mode: info.mode & 511
13449
+ });
13450
+ } else throw new Error(`content: unsupported resource ${source}`);
13451
+ }
13452
+ /** Exact version catalog; editable sources and their discovery are not this authority. */
13453
+ var DesignContentStore = class {
13377
13454
  root;
13378
- definitionsPath;
13379
- covered = {
13380
- source: /* @__PURE__ */ new Set(),
13381
- target: /* @__PURE__ */ new Set()
13382
- };
13383
- totals = {};
13384
- constructor(root, definitionsPath) {
13385
- this.root = root;
13386
- this.definitionsPath = definitionsPath;
13387
- if (!isAbsolute(root) || !isAbsolute(definitionsPath)) throw new Error("migration: absolute Host-bound candidate roots required");
13455
+ constructor(stateRoot) {
13456
+ if (!isAbsolute(stateRoot)) throw new Error("content: stateRoot must be absolute");
13457
+ this.root = join(stateRoot, "content");
13388
13458
  }
13389
- async path(path) {
13390
- if (!path || path.length > 4096 || /[\\:\u0000-\u001f]/u.test(path) || path.split("/").some((part) => !part || part === "." || part === "..") || path.split("/").length > 32) throw new Error("migration: use a bounded candidate Design-Files-relative path");
13391
- const root = join(this.root, "design_files"), full = join(root, path);
13392
- for (let current = dirname(full);; current = dirname(current)) {
13393
- try {
13394
- const info = await lstat(current);
13395
- if (!info.isDirectory() || info.isSymbolicLink()) throw new Error("migration: unsafe candidate parent");
13396
- } catch (error) {
13397
- if (error.code !== "ENOENT") throw error;
13459
+ async index() {
13460
+ const text = await contentNodeFs.readText(join(this.root, "index.json"));
13461
+ if (text === void 0) return emptyIndex();
13462
+ const data = JSON.parse(text);
13463
+ if (data.formatVersion !== 1 || !Array.isArray(data.kits) || !Array.isArray(data.bundles)) throw new Error("content: invalid retained index");
13464
+ for (const entry of [...data.kits, ...data.bundles]) {
13465
+ if (typeof entry.name !== "string" || typeof entry.version !== "string" || typeof entry.sourceId !== "string" || !/^[a-f0-9]{64}$/.test(entry.hash)) throw new Error("content: invalid retained entry");
13466
+ encode(entry.name);
13467
+ if (entry.kitPaths !== void 0) {
13468
+ if (typeof entry.kitPaths.mindset !== "string" || typeof entry.kitPaths.manifest !== "string" || entry.kitPaths.relations !== void 0 && typeof entry.kitPaths.relations !== "string") throw new Error("content: invalid retained Kit paths");
13469
+ retainedKitLocation(this.directory("kits", entry), entry.kitPaths);
13398
13470
  }
13399
- if (current === root) break;
13400
- }
13401
- try {
13402
- const info = await lstat(full);
13403
- if (!info.isFile() || info.isSymbolicLink()) throw new Error("migration: expected a regular candidate file");
13404
- } catch (error) {
13405
- if (error.code !== "ENOENT") throw error;
13406
- }
13407
- return full;
13408
- }
13409
- async readDefinition(side, offset, resource = "required") {
13410
- if (side !== "source" && side !== "target" || !Number.isSafeInteger(offset) || offset < 0 || offset % 12e3) throw new Error("migration: invalid definition page");
13411
- const definitions = JSON.parse(await readFile(this.definitionsPath, "utf8"));
13412
- const plan = Array.isArray(definitions.source.skills) && Array.isArray(definitions.target.skills) ? migrationDefinitionReadPlan(definitions.source, definitions.target) : void 0;
13413
- const text = resource === "complete" || !plan ? JSON.stringify(definitions[side], null, 2) : resource === "required" ? plan.required[side] : plan.resources[side].get(resource);
13414
- if (!text || offset >= text.length) throw new Error("migration: definition offset exceeds bounds");
13415
- const end = Math.min(offset + 12e3, text.length);
13416
- if (resource === "required") {
13417
- this.covered[side].add(offset / 12e3);
13418
- this.totals[side] = text.length;
13419
13471
  }
13420
- return {
13421
- text: text.slice(offset, end),
13422
- total: text.length,
13423
- nextOffset: end === text.length ? null : end
13424
- };
13472
+ return data;
13425
13473
  }
13426
- assertDefinitionsRead() {
13427
- for (const side of ["source", "target"]) if (!this.totals[side] || this.covered[side].size !== Math.ceil(this.totals[side] / 12e3)) throw new Error("migration: read both complete required methods and contracts before submitting evidence");
13428
- }
13429
- async list() {
13430
- const result = [];
13431
- let nodes = 0;
13432
- const walk = async (directory, prefix) => {
13433
- const info = await lstat(directory);
13434
- if (!info.isDirectory() || info.isSymbolicLink()) throw new Error("migration: unsafe candidate directory");
13435
- for (const entry of await readdir(directory, { withFileTypes: true })) {
13436
- if (++nodes > 4096 || prefix.split("/").length > 32 || entry.isSymbolicLink()) throw new Error("migration: bounded regular candidate files required");
13437
- const path = `${prefix}${entry.name}`;
13438
- if (entry.isDirectory()) await walk(join(directory, entry.name), `${path}/`);
13439
- else if (entry.isFile()) result.push(path);
13440
- else throw new Error("migration: non-regular candidate file");
13441
- }
13442
- };
13443
- await walk(join(this.root, "design_files"), "");
13444
- return result;
13474
+ directory(kind, pin) {
13475
+ const version = kind === "kits" ? DesignKitVersion(pin.version) : DesignBundleVersion(pin.version);
13476
+ return join(this.root, kind, encode(pin.name), String(version));
13445
13477
  }
13446
- async read(path, offset) {
13447
- if (!Number.isSafeInteger(offset) || offset < 0) throw new Error("migration: invalid candidate offset");
13448
- const file = await this.path(path);
13449
- if ((await lstat(file)).size > 8388608) throw new Error("migration: candidate file byte limit");
13450
- const text = await readFile(file, "utf8");
13451
- if (offset > text.length) throw new Error("migration: candidate offset exceeds bounds");
13452
- const end = Math.min(offset + 12e3, text.length);
13453
- return {
13454
- text: text.slice(offset, end),
13455
- total: text.length,
13456
- nextOffset: end === text.length ? null : end
13457
- };
13478
+ async listBundles() {
13479
+ return (await this.index()).bundles.map(({ name, version }) => Object.freeze({
13480
+ name,
13481
+ version
13482
+ }));
13458
13483
  }
13459
- async write(path, content) {
13460
- if (Buffer.byteLength(content) > 8388608) throw new Error("migration: candidate file byte limit");
13461
- const file = await this.path(path);
13462
- await mkdir(dirname(file), { recursive: true });
13463
- await writeFile(file, content);
13484
+ async listKits() {
13485
+ return (await this.index()).kits.map(({ name, version }) => Object.freeze({
13486
+ name,
13487
+ version
13488
+ }));
13464
13489
  }
13465
- };
13466
- //#endregion
13467
- //#region packages/core/src/project-content-migration.ts
13468
- /** Native-Agent semantic migration in an isolated candidate, followed by same-ID adoption. */
13469
- async function candidateFiles(root) {
13470
- const result = /* @__PURE__ */ new Map();
13471
- let bytes = 0, nodes = 0;
13472
- const walk = async (directory, prefix) => {
13473
- for (const item of await readdir(directory, { withFileTypes: true })) {
13474
- if (++nodes > 4096 || prefix.split("/").length > 32 || /[\\:\u0000-\u001f]/u.test(item.name)) throw new Error("migration: candidate exceeds confinement limits");
13475
- const path = join(directory, item.name), key = `${prefix}/${item.name}`;
13476
- const info = await lstat(path);
13477
- if (info.isSymbolicLink()) throw new Error("migration: candidate cannot contain symlinks");
13478
- if (info.isDirectory()) await walk(path, key);
13479
- else if (info.isFile()) {
13480
- bytes += info.size;
13481
- if (bytes > 67108864) throw new Error("migration: candidate exceeds byte limit");
13482
- result.set(key, await readFile(path));
13483
- } else throw new Error("migration: candidate contains non-regular resources");
13484
- }
13485
- };
13486
- await walk(join(root, "design_files"), "design_files");
13487
- result.set("project.json", await readFile(join(root, "project.json")));
13488
- return result;
13489
- }
13490
- var ProjectContentMigration = class {
13491
- ports;
13492
- git;
13493
- manager;
13494
- candidates = /* @__PURE__ */ new Map();
13495
- constructor(ports) {
13496
- this.ports = ports;
13497
- if (!isAbsolute(ports.root) || !isAbsolute(ports.stateRoot)) throw new Error("migration: exact absolute project and state roots are required");
13498
- const location = relative(ports.root, ports.stateRoot);
13499
- if (!location || location !== ".." && !location.startsWith("../") && !location.startsWith("..\\") && !isAbsolute(location)) throw new Error("migration: candidate storage must be outside the live project");
13500
- this.git = new GitVersioning(ports.spawn, ports.root);
13501
- this.manager = new DesignProjectManager({ spawn: ports.spawn });
13502
- }
13503
- directory(id) {
13504
- if (!/^[a-f0-9-]{36}$/u.test(id)) throw new Error("migration: invalid exact candidate id");
13505
- return join(this.ports.stateRoot, "content-migrations", id);
13506
- }
13507
- canonicalSources(plan, evidence) {
13508
- if (evidence.status !== "equivalent" || !evidence.summary?.trim() || evidence.unresolvedFacts.length) throw new Error(`migration: unresolved semantic decisions require user input: ${evidence.unresolvedFacts.join("; ")}`);
13509
- const sources = plan.sourceFiles.filter((path) => /^design_files\/([^/]+)\/\1\.json$/u.test(path));
13510
- if (sources.some((path) => !evidence.sources.some((source) => source.file === path && source.explanation.trim()))) throw new Error("migration: native evidence must account for every saved canonical source");
13511
- return sources;
13512
- }
13513
- /** Bound tools consume an exact prepared operation; model arguments never choose its root. */
13514
- async candidate(id) {
13515
- const directory = this.directory(id);
13516
- const plan = JSON.parse(await readFile(join(directory, "plan.json"), "utf8"));
13517
- if (plan.formatVersion !== 1 || plan.id !== id) throw new Error("migration: invalid candidate plan");
13518
- const current = await this.manager.open(this.ports.root);
13519
- if (current.metadata.id !== plan.projectId || !sameProjectContentPin(current.metadata.kit, plan.sourcePin) || await this.git.head() !== plan.sourceCheckpoint) throw new Error("migration: candidate is not bound to the current exact project checkpoint");
13520
- const cached = this.candidates.get(id);
13521
- if (cached) return cached;
13522
- const candidate = new ProjectContentCandidate(join(directory, "candidate"), join(directory, "definitions.json"));
13523
- this.candidates.set(id, candidate);
13524
- return candidate;
13525
- }
13526
- async prepare(targetPin) {
13527
- return this.ports.mutate(async () => {
13528
- await this.ports.assertQuiescent();
13529
- const project = await this.manager.open(this.ports.root);
13530
- if (!project.metadata.kit) throw new Error("migration: activate a Kit before selecting a version");
13531
- if (targetPin.name !== project.metadata.kit.name) throw new Error("migration: version selection preserves the active Kit catalog identity");
13532
- const status = await this.manager.status(project);
13533
- if (status.dirty) throw new Error("migration: preserve or settle uncommitted project edits before upgrading");
13534
- const source = await this.ports.resolveKit(project.metadata.kit), target = await this.ports.resolveKit(targetPin);
13535
- if (!source || !target) throw new Error("migration: restore the full exact source and target definitions before upgrading");
13536
- if (target.name !== targetPin.name || target.version !== targetPin.version) throw new Error("migration: exact target resolution required");
13537
- await this.ports.assertCompatible(target);
13538
- const id = randomUUID(), directory = this.directory(id), candidateRoot = join(directory, "candidate");
13539
- await mkdir(join(candidateRoot, "design_files"), { recursive: true });
13540
- const paths = (await this.git.listPathsAt(status.head)).filter((path) => path.startsWith("design_files/"));
13541
- if (paths.length > 4096) throw new Error("migration: project exceeds file limit");
13542
- let total = 0;
13543
- for (const path of paths) {
13544
- if (/[\\:\u0000-\u001f]/u.test(path) || path.split("/").some((part) => !part || part === "." || part === "..")) throw new Error("migration: unsafe source path");
13545
- const bytes = await this.git.readBytesAt(status.head, path, void 0, 67108864);
13546
- if (!bytes || (total += bytes.byteLength) > 67108864) throw new Error("migration: project exceeds byte limit");
13547
- await mkdir(dirname(join(candidateRoot, path)), { recursive: true });
13548
- await writeFile(join(candidateRoot, path), bytes, { flag: "wx" });
13549
- }
13550
- const effectivePin = {
13551
- ...targetPin,
13552
- contentHash: projectKitContentHash(target)
13553
- };
13554
- const plan = {
13555
- formatVersion: 1,
13556
- id,
13557
- projectId: project.metadata.id,
13558
- sourceCheckpoint: status.head,
13559
- sourcePin: project.metadata.kit,
13560
- targetPin: effectivePin,
13561
- sourceHash: projectKitContentHash(source),
13562
- sourceFiles: paths
13563
- };
13564
- await writeFile(join(candidateRoot, "project.json"), `${JSON.stringify({
13565
- ...project.metadata,
13566
- kit: effectivePin
13567
- }, null, 2)}\n`, { flag: "wx" });
13568
- const definitions = join(directory, "definitions.json");
13569
- await writeFile(definitions, JSON.stringify({
13570
- source,
13571
- target
13572
- }, null, 2), {
13573
- flag: "wx",
13574
- mode: 256
13575
- });
13576
- await writeFile(join(directory, "plan.json"), JSON.stringify(plan), {
13577
- flag: "wx",
13578
- mode: 256
13490
+ /** Publish an independent version even when no Kit mounts it. */
13491
+ async retainBundle(rootDir, options, expectedPin) {
13492
+ const bundle = await loadDesignBundle(contentNodeFs, {
13493
+ rootDir,
13494
+ sourceId: options.sourceId
13495
+ }, expectedPin);
13496
+ const pin = {
13497
+ name: bundle.skill.catalogName ?? bundle.skill.name,
13498
+ version: String(bundle.skill.version)
13499
+ };
13500
+ await mkdir(this.root, { recursive: true });
13501
+ const lock = join(this.root, ".retain.lock");
13502
+ await writeFile(lock, String(process.pid), { flag: "wx" });
13503
+ const staging = join(this.root, `.staging-${randomUUID()}`);
13504
+ try {
13505
+ await mkdir(staging);
13506
+ const directory = join(staging, "bundle");
13507
+ await mkdir(directory);
13508
+ const digest = createHash("sha256");
13509
+ await copyTree(rootDir, join(directory, "files"), digest);
13510
+ await loadDesignBundle(contentNodeFs, {
13511
+ rootDir: join(directory, "files"),
13512
+ sourceId: options.sourceId
13513
+ }, pin);
13514
+ const current = await this.index();
13515
+ await this.publish([{
13516
+ kind: "bundles",
13517
+ entry: {
13518
+ ...pin,
13519
+ sourceId: options.sourceId,
13520
+ hash: digest.digest("hex")
13521
+ },
13522
+ directory
13523
+ }], staging, {
13524
+ formatVersion: 1,
13525
+ kits: [...current.kits],
13526
+ bundles: [...current.bundles]
13579
13527
  });
13580
- return {
13581
- id,
13582
- projectId: plan.projectId,
13583
- sourceCheckpoint: plan.sourceCheckpoint,
13584
- candidateRoot,
13585
- definitions,
13586
- method: "Use an isolated native Host Producer. Read every page of both required reading sets: complete changed domain methods and output contracts, related cross-Bundle contracts and shared constraints. Every original resource and complete source/target definition remains available on demand; read additional evidence when needed for semantic fidelity. Modify only the exact candidate directory. Preserve saved user facts, stable IDs, references and existing assets. Translate semantics; schema validity alone does not establish equivalence. Account for every existing canonical source in the evidence receipt. If new facts or domain decisions are needed, return needs-user-input with exact unresolved facts; never invent values to pass validation. Return the actual native execution proof and semantic evidence. Only the owning Core transaction may adopt this candidate into the original project; do not edit or repin that project yourself."
13587
- };
13528
+ } finally {
13529
+ await rm(staging, {
13530
+ recursive: true,
13531
+ force: true
13532
+ });
13533
+ await rm(lock, { force: true });
13534
+ }
13535
+ return await this.resolveBundle(pin);
13536
+ }
13537
+ async resolveBundle(pin) {
13538
+ const entry = (await this.index()).bundles.find((e) => key$1(e) === key$1(pin));
13539
+ if (!entry) return void 0;
13540
+ const rootDir = join(this.directory("bundles", pin), "files");
13541
+ if (await hashTree(rootDir) !== entry.hash) throw new Error("content: retained Bundle hash mismatch");
13542
+ return loadDesignBundle(contentNodeFs, {
13543
+ rootDir,
13544
+ sourceId: entry.sourceId
13545
+ }, pin);
13546
+ }
13547
+ async loadRetainedKit(pin) {
13548
+ const entry = (await this.index()).kits.find((e) => key$1(e) === key$1(pin));
13549
+ if (!entry) return void 0;
13550
+ const rootDir = join(this.directory("kits", pin), "files");
13551
+ if (await hashTree(rootDir) !== entry.hash) throw new Error("content: retained Kit hash mismatch");
13552
+ const kit = await loadDesignKit(contentNodeFs, retainedKitLocation(rootDir, entry.kitPaths), {
13553
+ sourceId: entry.sourceId,
13554
+ resolveBundle: (bundle) => this.resolveBundle(bundle)
13588
13555
  });
13556
+ if (kit.name !== pin.name || String(kit.version) !== pin.version) throw new Error("content: retained Kit pin mismatch");
13557
+ return kit;
13589
13558
  }
13590
- async finish(id, proof, evidence) {
13591
- const directory = this.directory(id), candidateRoot = join(directory, "candidate");
13592
- const plan = JSON.parse(await readFile(join(directory, "plan.json"), "utf8"));
13593
- if (plan.formatVersion !== 1 || plan.id !== id) throw new Error("migration: invalid candidate plan");
13594
- await this.ports.verifyNativeProducer(proof, candidateRoot);
13595
- const canonicalSources = this.canonicalSources(plan, evidence);
13596
- const files = await candidateFiles(candidateRoot);
13597
- for (const path of plan.sourceFiles.filter((path) => !canonicalSources.includes(path))) {
13598
- const original = await this.git.readBytesAt(plan.sourceCheckpoint, path);
13599
- if (!files.get(path) || !Buffer.from(files.get(path)).equals(Buffer.from(original))) throw new Error(`migration: preserve existing asset/source ${path}`);
13600
- }
13601
- if (canonicalSources.some((path) => !files.has(path))) throw new Error("migration: canonical sources cannot disappear during upgrade");
13602
- return new ProjectContentTransaction(this.ports).adopt({
13603
- projectId: plan.projectId,
13604
- sourceCheckpoint: plan.sourceCheckpoint,
13605
- contentHash: plan.targetPin.contentHash,
13606
- files,
13607
- validate: async (captured) => {
13608
- await this.ports.assertQuiescent();
13609
- if (!sameProjectContentPin((await this.manager.open(this.ports.root)).metadata.kit, plan.sourcePin)) throw new Error("migration: project content selection changed");
13610
- const source = await this.ports.resolveKit(plan.sourcePin), target = await this.ports.resolveKit(plan.targetPin);
13611
- if (!source || !target || projectKitContentHash(source) !== plan.sourceHash || projectKitContentHash(target) !== plan.targetPin.contentHash) throw new Error("migration: source or target definitions changed");
13612
- if (!sameProjectContentPin(parseDesignProjectJson(Buffer.from(captured.get("project.json")).toString("utf8")).kit, plan.targetPin)) throw new Error("migration: candidate changed the authorized exact target");
13613
- await this.ports.assertCompatible(target);
13614
- await this.ports.validate(target, captured);
13615
- await this.ports.assertQuiescent();
13559
+ /** Reuse a verified closure from another configured store without exposing or
13560
+ * inferring its internal layout. The source index owns provenance and paths. */
13561
+ async retainKitFrom(source, pin) {
13562
+ const entry = (await source.index()).kits.find((value) => key$1(value) === key$1(pin));
13563
+ const kit = await source.loadRetainedKit(pin);
13564
+ if (!entry || !kit) throw new Error("content: unavailable exact retained Kit source");
13565
+ const root = join(source.directory("kits", pin), "files");
13566
+ return this.retainKitClosure(retainedKitLocation(root, entry.kitPaths), {
13567
+ sourceId: entry.sourceId,
13568
+ resolveBundle: (bundle) => source.resolveBundle(bundle)
13569
+ });
13570
+ }
13571
+ /** All project reads and writes resolve the same exact closure. */
13572
+ async resolveProjectKit(pin) {
13573
+ const base = await this.loadRetainedKit(pin);
13574
+ if (!base) return void 0;
13575
+ return composeProjectKit(pin, base, await Promise.all(projectBundleOverrides(pin, base).map(async (target) => {
13576
+ const bundle = await this.resolveBundle(target);
13577
+ if (!bundle) throw new Error(`project content: unavailable exact Bundle ${target.name}@${target.version}`);
13578
+ return bundle;
13579
+ })));
13580
+ }
13581
+ /** Retain a complete validated closure; publish index only after every byte is ready. */
13582
+ async retainKitClosure(location, options) {
13583
+ if (typeof location === "string") location = await resolveDesignKitPackage(contentNodeFs, location) ?? location;
13584
+ const bundles = /* @__PURE__ */ new Map();
13585
+ const kit = await loadDesignKit(contentNodeFs, location, {
13586
+ ...options,
13587
+ ...options.resolveBundle === void 0 ? {} : { resolveBundle: async (pin) => {
13588
+ const bundle = await options.resolveBundle(pin);
13589
+ if (bundle) bundles.set(key$1(pin), bundle);
13590
+ return bundle;
13591
+ } }
13592
+ });
13593
+ for (const skill of kit.skills) if (!bundles.has(key$1({
13594
+ name: skill.catalogName ?? skill.name,
13595
+ version: String(skill.version)
13596
+ }))) {
13597
+ const bundle = await loadDesignBundle(contentNodeFs, {
13598
+ rootDir: skill.resourceRoot,
13599
+ sourceId: options.sourceId
13600
+ }, {
13601
+ name: skill.catalogName ?? skill.name,
13602
+ version: String(skill.version)
13603
+ });
13604
+ bundles.set(key$1({
13605
+ name: skill.catalogName ?? skill.name,
13606
+ version: String(skill.version)
13607
+ }), bundle);
13608
+ }
13609
+ await mkdir(this.root, { recursive: true });
13610
+ const lock = join(this.root, ".retain.lock");
13611
+ await writeFile(lock, String(process.pid), { flag: "wx" });
13612
+ const staging = join(this.root, `.staging-${randomUUID()}`);
13613
+ try {
13614
+ await mkdir(staging);
13615
+ const current = await this.index();
13616
+ const next = {
13617
+ formatVersion: 1,
13618
+ kits: [...current.kits],
13619
+ bundles: [...current.bundles]
13620
+ };
13621
+ const staged = [];
13622
+ for (const bundle of bundles.values()) {
13623
+ const pin = {
13624
+ name: bundle.skill.catalogName ?? bundle.skill.name,
13625
+ version: String(bundle.skill.version)
13626
+ };
13627
+ const sourceId = await this.bundleSourceId(bundle, options, pin);
13628
+ const directory = join(staging, `bundle-${staged.length}`);
13629
+ await mkdir(directory);
13630
+ const digest = createHash("sha256");
13631
+ await copyTree(bundle.resourceRoot, join(directory, "files"), digest);
13632
+ if ((await loadDesignBundle(contentNodeFs, {
13633
+ rootDir: join(directory, "files"),
13634
+ sourceId
13635
+ }, pin)).skill.authority !== bundle.skill.authority) throw new Error("content: Bundle authority changed during retention");
13636
+ const entry = {
13637
+ ...pin,
13638
+ sourceId,
13639
+ hash: digest.digest("hex")
13640
+ };
13641
+ staged.push({
13642
+ kind: "bundles",
13643
+ entry,
13644
+ directory
13645
+ });
13646
+ }
13647
+ const directory = join(staging, "kit");
13648
+ await mkdir(join(directory, "files"), { recursive: true });
13649
+ const root = typeof location === "string" ? location : location.rootDir;
13650
+ const originalManifest = await contentNodeFs.readText(typeof location === "string" ? join(root, "kit.yaml") : location.manifestPath ?? join(root, "kit.yaml"));
13651
+ let kitPaths;
13652
+ if (originalManifest !== void 0) {
13653
+ kitPaths = {
13654
+ mindset: confinedRelativePath(root, typeof location === "string" ? join(root, "mindset.md") : location.mindsetPath),
13655
+ manifest: confinedRelativePath(root, typeof location === "string" ? join(root, "kit.yaml") : location.manifestPath ?? join(root, "kit.yaml")),
13656
+ ...typeof location === "string" || location.relationsPath === void 0 ? {} : { relations: confinedRelativePath(root, location.relationsPath) }
13657
+ };
13658
+ if (kitPaths.mindset === "mindset.md" && kitPaths.manifest === "kit.yaml" && (kitPaths.relations === void 0 || kitPaths.relations === "relations.yaml")) kitPaths = void 0;
13659
+ await copyTree(root, join(directory, "files"), createHash("sha256"));
13660
+ } else {
13661
+ const engineering = /* @__PURE__ */ new Set([
13662
+ "skills",
13663
+ "node_modules",
13664
+ "lib",
13665
+ "dist",
13666
+ "src",
13667
+ "test",
13668
+ "tests",
13669
+ "scripts",
13670
+ ".git",
13671
+ ".cache",
13672
+ "package.json",
13673
+ "pnpm-lock.yaml",
13674
+ "package-lock.json",
13675
+ "yarn.lock",
13676
+ "tsconfig.json",
13677
+ "tsdown.config.ts"
13678
+ ]);
13679
+ for (const name of (await readdir(root)).sort()) {
13680
+ if (engineering.has(name) || name === "mindset.md" || name === "kit.yaml" || name === "relations.yaml" || /^(smoke-|test-|preview-|compare-).*\.(mjs|html)$/.test(name)) continue;
13681
+ await copyTree(join(root, name), join(directory, "files", name), createHash("sha256"), name);
13682
+ }
13683
+ await writeFile(join(directory, "files", "mindset.md"), kit.mindsetSource);
13684
+ const relations = await contentNodeFs.readText(typeof location === "string" ? join(root, "relations.yaml") : location.relationsPath ?? join(root, "relations.yaml"));
13685
+ if (relations !== void 0) await writeFile(join(directory, "files", "relations.yaml"), relations);
13686
+ await writeFile(join(directory, "files", "kit.yaml"), (0, import_dist.stringify)({
13687
+ version: 1,
13688
+ mounts: kit.skills.map((s) => ({
13689
+ bindingKey: s.name,
13690
+ name: s.catalogName ?? s.name,
13691
+ version: String(s.version)
13692
+ }))
13693
+ }));
13616
13694
  }
13695
+ const stagedByPin = new Map(staged.map((s) => [key$1(s.entry), s]));
13696
+ const verified = await loadDesignKit(contentNodeFs, retainedKitLocation(join(directory, "files"), kitPaths), {
13697
+ sourceId: options.sourceId,
13698
+ resolveBundle: async (pin) => {
13699
+ const value = stagedByPin.get(key$1(pin));
13700
+ return value ? loadDesignBundle(contentNodeFs, {
13701
+ rootDir: join(value.directory, "files"),
13702
+ sourceId: value.entry.sourceId
13703
+ }, pin) : void 0;
13704
+ }
13705
+ });
13706
+ if (verified.name !== kit.name || verified.version !== kit.version) throw new Error("content: source changed while retaining Kit");
13707
+ const kitHash = await hashTree(join(directory, "files"));
13708
+ staged.push({
13709
+ kind: "kits",
13710
+ entry: {
13711
+ name: kit.name,
13712
+ version: String(kit.version),
13713
+ hash: kitHash,
13714
+ sourceId: options.sourceId,
13715
+ ...kitPaths === void 0 ? {} : { kitPaths }
13716
+ },
13717
+ directory
13718
+ });
13719
+ await this.publish(staged, staging, next);
13720
+ } finally {
13721
+ await rm(staging, {
13722
+ recursive: true,
13723
+ force: true
13724
+ });
13725
+ await rm(lock, { force: true });
13726
+ }
13727
+ return await this.loadRetainedKit({
13728
+ name: kit.name,
13729
+ version: String(kit.version)
13617
13730
  });
13618
13731
  }
13619
- /** Same target validation inside the still-attached native generator's repair loop. */
13620
- async validateCandidate(id, evidence) {
13621
- const directory = this.directory(id);
13622
- const plan = JSON.parse(await readFile(join(directory, "plan.json"), "utf8"));
13623
- if (plan.formatVersion !== 1 || plan.id !== id) throw new Error("migration: invalid candidate plan");
13624
- this.canonicalSources(plan, evidence);
13625
- await this.ports.assertQuiescent();
13626
- const source = await this.ports.resolveKit(plan.sourcePin), target = await this.ports.resolveKit(plan.targetPin);
13627
- if (!source || !target || projectKitContentHash(source) !== plan.sourceHash || projectKitContentHash(target) !== plan.targetPin.contentHash) throw new Error("migration: source or target definitions changed");
13628
- await this.ports.assertCompatible(target);
13629
- const files = await candidateFiles(join(directory, "candidate"));
13630
- if (!sameProjectContentPin(parseDesignProjectJson(Buffer.from(files.get("project.json")).toString("utf8")).kit, plan.targetPin)) throw new Error("migration: candidate changed the authorized exact target");
13631
- for (const path of plan.sourceFiles) {
13632
- if (!files.has(path)) throw new Error("migration: canonical sources cannot disappear during upgrade");
13633
- if (!/^design_files\/([^/]+)\/\1\.json$/u.test(path) && !Buffer.from(files.get(path)).equals(Buffer.from(await this.git.readBytesAt(plan.sourceCheckpoint, path)))) throw new Error(`migration: preserve existing asset/source ${path}`);
13634
- }
13635
- await this.ports.validate(target, files);
13636
- await this.ports.assertQuiescent();
13637
- }
13638
- async recover() {
13639
- return new ProjectContentTransaction(this.ports).recover();
13732
+ async publish(staged, staging, next) {
13733
+ for (const value of staged) {
13734
+ const existing = next[value.kind].find((e) => key$1(e) === key$1(value.entry));
13735
+ if (existing && (existing.hash !== value.entry.hash || existing.sourceId !== value.entry.sourceId || JSON.stringify(existing.kitPaths) !== JSON.stringify(value.entry.kitPaths))) throw new Error(`content: immutable ${value.kind} pin conflict ${value.entry.name}@${value.entry.version}`);
13736
+ }
13737
+ for (const value of staged) {
13738
+ if (next[value.kind].some((e) => key$1(e) === key$1(value.entry))) continue;
13739
+ const target = this.directory(value.kind, value.entry);
13740
+ await mkdir(resolve(target, ".."), { recursive: true });
13741
+ await writeFile(join(value.directory, "metadata.json"), JSON.stringify(value.entry));
13742
+ try {
13743
+ await rename(value.directory, target);
13744
+ } catch (error) {
13745
+ if (!["EEXIST", "ENOTEMPTY"].includes(error.code ?? "")) throw error;
13746
+ const previous = JSON.parse(await readFile(join(target, "metadata.json"), "utf8"));
13747
+ if (previous.hash !== value.entry.hash || previous.sourceId !== value.entry.sourceId || JSON.stringify(previous.kitPaths) !== JSON.stringify(value.entry.kitPaths)) throw new Error("content: unindexed immutable version conflict");
13748
+ }
13749
+ next[value.kind].push(value.entry);
13750
+ }
13751
+ const indexPath = join(staging, "index.json");
13752
+ await writeFile(indexPath, JSON.stringify(next));
13753
+ await rename(indexPath, join(this.root, "index.json"));
13754
+ }
13755
+ async bundleSourceId(bundle, options, pin) {
13756
+ const sourceId = bundle.sourceId ?? options.sourceId;
13757
+ if ((await loadDesignBundle(contentNodeFs, {
13758
+ rootDir: bundle.resourceRoot,
13759
+ sourceId
13760
+ }, pin)).skill.authority !== bundle.skill.authority) throw new Error("content: resolver must supply original trusted sourceId");
13761
+ return sourceId;
13762
+ }
13763
+ };
13764
+ async function hashTree(root) {
13765
+ const digest = createHash("sha256");
13766
+ async function walk(path, rel) {
13767
+ const info = await lstat(path);
13768
+ if (info.isSymbolicLink()) throw new Error("content: symlink in retained content");
13769
+ if (info.isDirectory()) {
13770
+ digest.update(`directory\0${rel}\0`);
13771
+ for (const name of (await readdir(path)).sort()) await walk(join(path, name), rel ? `${rel}/${name}` : name);
13772
+ } else if (info.isFile()) {
13773
+ const bytes = await readFile(path);
13774
+ digest.update(`file\0${rel}\0${bytes.length}\0`).update(bytes);
13775
+ } else throw new Error("content: unsupported retained resource");
13640
13776
  }
13777
+ await walk(root, "");
13778
+ return digest.digest("hex");
13779
+ }
13780
+ //#endregion
13781
+ //#region packages/core/src/project-kit-source.ts
13782
+ /** One editable, byte-complete Kit source per project. No local release catalog. */
13783
+ const DESIGN_PROJECT_KIT_DIRECTORY = "design_kit";
13784
+ const identity = (name) => {
13785
+ if (!/^[a-z][a-z0-9_]*$/u.test(name)) throw new Error("project Kit: invalid Bundle identity");
13786
+ return name;
13641
13787
  };
13788
+ function rootOf(projectRoot) {
13789
+ if (!isAbsolute(projectRoot)) throw new Error("project Kit: absolute project root required");
13790
+ return join(projectRoot, DESIGN_PROJECT_KIT_DIRECTORY);
13791
+ }
13792
+ function localPath(root, path) {
13793
+ const rel = relative(root, resolve(root, path));
13794
+ if (!rel || isAbsolute(rel) || rel === ".." || rel.startsWith("../")) throw new Error("project Kit: source path escapes its root");
13795
+ return rel;
13796
+ }
13797
+ async function exists(path) {
13798
+ try {
13799
+ await lstat(path);
13800
+ return true;
13801
+ } catch (error) {
13802
+ if (error.code === "ENOENT") return false;
13803
+ throw error;
13804
+ }
13805
+ }
13806
+ /** Virtual S2 trees and real retained trees preserve the same complete bytes. */
13807
+ async function copySource(fs, source, target, checks) {
13808
+ if (!fs.readBytes) {
13809
+ const before = await revisionOf(source);
13810
+ checks.push(async () => {
13811
+ if (before !== await revisionOf(source)) throw new Error("project Kit: source changed while copying; retry from current source");
13812
+ });
13813
+ return copyTree(source, target);
13814
+ }
13815
+ const budget = {
13816
+ bytes: 0,
13817
+ nodes: 0
13818
+ };
13819
+ const walk = async (path, to, depth) => {
13820
+ if (++budget.nodes > 2e4 || depth > 32) throw new Error("project Kit: source tree exceeds limits");
13821
+ if (await fs.isDirectory?.(path)) {
13822
+ await mkdir(to, { recursive: true });
13823
+ for (const name of (await fs.listDir(path)).sort()) {
13824
+ if (!name || name === "." || name === ".." || /[\\/\u0000]/u.test(name)) throw new Error("project Kit: invalid resource path");
13825
+ await walk(join(path, name), join(to, name), depth + 1);
13826
+ }
13827
+ } else {
13828
+ const bytes = await fs.readBytes(path);
13829
+ if (!bytes) throw new Error(`project Kit: missing source resource ${path}`);
13830
+ budget.bytes += bytes.byteLength;
13831
+ if (budget.bytes > 134217728) throw new Error("project Kit: source bytes exceed limits");
13832
+ await writeFile(to, bytes, { flag: "wx" });
13833
+ }
13834
+ };
13835
+ await walk(source, target, 0);
13836
+ }
13837
+ /** Hash the current bytes, including binary assets and empty directories. Not a release pin. */
13838
+ async function revisionOf(root) {
13839
+ const hash = createHash("sha256"), budget = {
13840
+ bytes: 0,
13841
+ nodes: 0
13842
+ };
13843
+ const walk = async (path, rel) => {
13844
+ const stat = await lstat(path);
13845
+ if (stat.isSymbolicLink()) throw new Error(`project Kit: symlink source is unsupported: ${rel}`);
13846
+ if (++budget.nodes > 2e4 || rel.split("/").length > 32) throw new Error("project Kit: source tree exceeds limits");
13847
+ if (stat.isDirectory()) {
13848
+ hash.update(`directory\0${rel}\0`);
13849
+ for (const name of (await readdir(path)).sort()) await walk(join(path, name), rel ? `${rel}/${name}` : name);
13850
+ } else if (stat.isFile()) {
13851
+ budget.bytes += stat.size;
13852
+ if (budget.bytes > 134217728) throw new Error("project Kit: source bytes exceed limits");
13853
+ const bytes = await readFile(path);
13854
+ hash.update(`file\0${rel}\0${bytes.length}\0`).update(bytes);
13855
+ } else throw new Error(`project Kit: unsupported source resource ${rel}`);
13856
+ };
13857
+ await walk(root, "");
13858
+ return hash.digest("hex");
13859
+ }
13860
+ /** Existing but invalid source is diagnosed; a library fallback never hides edits. */
13861
+ async function loadProjectKit(projectRoot) {
13862
+ const root = rootOf(projectRoot), revision = await revisionOf(root);
13863
+ const layout = JSON.parse(await readFile(join(root, "source.json"), "utf8"));
13864
+ if (layout.format !== 1 || !Array.isArray(layout.bundles) || typeof layout.kit?.sourceId !== "string") throw new Error("project Kit: invalid source layout");
13865
+ const kitRoot = join(root, "kit");
13866
+ const kit = await loadDesignKit(contentNodeFs, {
13867
+ rootDir: kitRoot,
13868
+ skillsDir: join(kitRoot, "skills"),
13869
+ mindsetPath: resolve(kitRoot, localPath(kitRoot, layout.kit.mindset)),
13870
+ manifestPath: resolve(kitRoot, localPath(kitRoot, layout.kit.manifest)),
13871
+ ...layout.kit.relations ? { relationsPath: resolve(kitRoot, localPath(kitRoot, layout.kit.relations)) } : {}
13872
+ }, {
13873
+ sourceId: layout.kit.sourceId,
13874
+ current: true,
13875
+ resolveBundle: async (pin) => {
13876
+ const source = layout.bundles.find((item) => item.name === pin.name);
13877
+ if (!source) throw new Error(`project Kit: missing mounted Bundle ${pin.name}`);
13878
+ return loadDesignBundle(contentNodeFs, {
13879
+ rootDir: join(root, "bundles", identity(source.name)),
13880
+ sourceId: source.sourceId,
13881
+ current: true
13882
+ }, { name: source.name });
13883
+ }
13884
+ });
13885
+ if (revision !== await revisionOf(root)) throw new Error("project Kit: source changed while loading; retry using the current files");
13886
+ return {
13887
+ kit,
13888
+ revision
13889
+ };
13890
+ }
13891
+ /** Initialize once from the actual selected/retained closure; later reads use project files. */
13892
+ async function ensureProjectKit(projectRoot, options) {
13893
+ const root = rootOf(projectRoot);
13894
+ if (await exists(root)) return loadProjectKit(projectRoot);
13895
+ if (!(await lstat(projectRoot)).isDirectory()) throw new Error("project Kit: project directory unavailable");
13896
+ const kit = await options.loadSource();
13897
+ if (!kit.sourceRoot || !kit.sourceId) throw new Error("project Kit: original complete Kit source is unavailable");
13898
+ const sourceFs = kit.sourceFs ?? contentNodeFs;
13899
+ const location = kit.sourceLocation ?? {
13900
+ rootDir: kit.sourceRoot,
13901
+ mindsetPath: join(kit.sourceRoot, "mindset.md"),
13902
+ skillsDir: join(kit.sourceRoot, "skills")
13903
+ };
13904
+ const staging = `${root}.tmp-${randomUUID()}`;
13905
+ const kitRoot = join(staging, "kit");
13906
+ const checks = [];
13907
+ const layout = {
13908
+ format: 1,
13909
+ kit: {
13910
+ sourceId: kit.sourceId,
13911
+ mindset: localPath(location.rootDir, location.mindsetPath),
13912
+ manifest: localPath(location.rootDir, location.manifestPath ?? join(location.rootDir, "kit.yaml")),
13913
+ ...location.relationsPath ? { relations: localPath(location.rootDir, location.relationsPath) } : {}
13914
+ },
13915
+ bundles: []
13916
+ };
13917
+ try {
13918
+ await mkdir(staging);
13919
+ if (await sourceFs.readText(location.manifestPath ?? join(location.rootDir, "kit.yaml")) !== void 0) await copySource(sourceFs, location.rootDir, kitRoot, checks);
13920
+ else {
13921
+ await mkdir(kitRoot);
13922
+ const engineering = /* @__PURE__ */ new Set([
13923
+ "skills",
13924
+ "node_modules",
13925
+ "lib",
13926
+ "dist",
13927
+ "src",
13928
+ "test",
13929
+ "tests",
13930
+ "scripts",
13931
+ ".git",
13932
+ ".cache",
13933
+ "package.json",
13934
+ "pnpm-lock.yaml",
13935
+ "package-lock.json",
13936
+ "yarn.lock",
13937
+ "tsconfig.json",
13938
+ "tsdown.config.ts"
13939
+ ]);
13940
+ for (const name of await sourceFs.listDir(location.rootDir)) {
13941
+ if (engineering.has(name) || [
13942
+ "mindset.md",
13943
+ "kit.yaml",
13944
+ "relations.yaml"
13945
+ ].includes(name) || /^(smoke-|test-|preview-|compare-).*\.(mjs|html)$/u.test(name)) continue;
13946
+ await copySource(sourceFs, join(location.rootDir, name), join(kitRoot, name), checks);
13947
+ }
13948
+ layout.kit.mindset = "mindset.md";
13949
+ layout.kit.manifest = "kit.yaml";
13950
+ await writeFile(join(kitRoot, "mindset.md"), kit.mindsetSource);
13951
+ const relations = await sourceFs.readText(location.relationsPath ?? join(location.rootDir, "relations.yaml"));
13952
+ if (relations !== void 0) {
13953
+ layout.kit.relations = "relations.yaml";
13954
+ await writeFile(join(kitRoot, "relations.yaml"), relations);
13955
+ }
13956
+ await writeFile(join(kitRoot, "kit.yaml"), (0, import_dist.stringify)({
13957
+ version: 1,
13958
+ mounts: kit.skills.map((skill) => ({
13959
+ bindingKey: skill.name,
13960
+ name: skill.catalogName ?? skill.name,
13961
+ version: String(skill.version)
13962
+ }))
13963
+ }));
13964
+ }
13965
+ await mkdir(join(staging, "bundles"));
13966
+ for (const skill of kit.skills) {
13967
+ const name = identity(skill.catalogName ?? skill.name);
13968
+ if (!skill.resourceRoot || !skill.sourceId) throw new Error(`project Kit: original complete Bundle source unavailable: ${name}`);
13969
+ await copySource(skill.sourceFs ?? contentNodeFs, skill.resourceRoot, join(staging, "bundles", name), checks);
13970
+ layout.bundles.push({
13971
+ name,
13972
+ sourceId: skill.sourceId
13973
+ });
13974
+ }
13975
+ await writeFile(join(staging, "source.json"), JSON.stringify(layout, null, 2) + "\n");
13976
+ const verified = await loadDesignKit(contentNodeFs, {
13977
+ rootDir: kitRoot,
13978
+ skillsDir: join(kitRoot, "skills"),
13979
+ mindsetPath: join(kitRoot, layout.kit.mindset),
13980
+ manifestPath: join(kitRoot, layout.kit.manifest),
13981
+ ...layout.kit.relations ? { relationsPath: join(kitRoot, layout.kit.relations) } : {}
13982
+ }, {
13983
+ sourceId: layout.kit.sourceId,
13984
+ current: true,
13985
+ resolveBundle: (pin) => {
13986
+ const source = layout.bundles.find((item) => item.name === pin.name);
13987
+ return source ? loadDesignBundle(contentNodeFs, {
13988
+ rootDir: join(staging, "bundles", source.name),
13989
+ sourceId: source.sourceId,
13990
+ current: true
13991
+ }, { name: source.name }) : Promise.resolve(void 0);
13992
+ }
13993
+ });
13994
+ for (const check of checks) await check();
13995
+ if (projectKitContentHash(verified) !== projectKitContentHash(kit)) throw new Error("project Kit: source changed while copying; retry from the current source");
13996
+ try {
13997
+ await rename(staging, root);
13998
+ } catch (error) {
13999
+ if (!["EEXIST", "ENOTEMPTY"].includes(error.code ?? "")) throw error;
14000
+ }
14001
+ } finally {
14002
+ await rm(staging, {
14003
+ recursive: true,
14004
+ force: true
14005
+ });
14006
+ }
14007
+ return loadProjectKit(projectRoot);
14008
+ }
13642
14009
  //#endregion
13643
14010
  //#region packages/core/src/design-project-paths.ts
13644
14011
  /** User-owned projects belong in Documents; runtime state has separate owners. */
@@ -14312,27 +14679,58 @@ var DesignProjectRegistry = class {
14312
14679
  //#endregion
14313
14680
  //#region packages/core/src/design-project-records.ts
14314
14681
  /** Safe explicit-path Git publication for the project's single durable records. */
14682
+ const MAX_PUBLICATION_ATTEMPTS = 3;
14683
+ const sameBytes = (left, right) => left === void 0 ? right === void 0 : right !== void 0 && Buffer.from(left).equals(right);
14684
+ /** Only the existing publication-CAS failures are retryable. */
14685
+ function stalePublication(error) {
14686
+ if (!(error instanceof Error)) return false;
14687
+ return error.message === "design git native: stale-publication" || error.message === "design git: publication revision is stale" || error.message.startsWith("design git: publication revision is stale: expected ");
14688
+ }
14315
14689
  /** Caller owns the existing project mutation lane. This adds no lock or identity ticket. */
14316
14690
  async function commitDesignProjectRecords(input) {
14317
14691
  designProjectRecordsRoot(input.projectRoot);
14318
14692
  if (!input.paths.length || !input.message.trim()) throw new Error("design records: explicit files and a commit message are required");
14319
14693
  const git = new GitVersioning(input.spawn ?? nodeDesignProjectSpawn, input.projectRoot);
14320
- const head = await git.head(input.signal);
14694
+ let head = await git.head(input.signal);
14321
14695
  if (!head) throw new Error("design records: an initialized Design Project is required");
14322
- if (input.expectedHead !== void 0 && input.expectedHead !== head && await git.designEvidenceRevisionAt(input.expectedHead, input.signal) !== await git.designEvidenceRevisionAt(head, input.signal)) throw new Error("design records: Design evidence changed before record publication");
14696
+ const evidence = await git.designEvidenceRevisionAt(head, input.signal);
14697
+ if (input.expectedHead !== void 0 && input.expectedHead !== head && await git.designEvidenceRevisionAt(input.expectedHead, input.signal) !== evidence) throw new Error("design records: Design evidence changed before record publication");
14323
14698
  const bytes = /* @__PURE__ */ new Map();
14324
- for (const path of input.paths) {
14699
+ const baseline = /* @__PURE__ */ new Map();
14700
+ const read = async (path) => {
14701
+ const file = await resolveConfinedFilePath(input.projectRoot, path);
14702
+ try {
14703
+ return await readFile(file);
14704
+ } catch (error) {
14705
+ if (error.code !== "ENOENT") throw error;
14706
+ return;
14707
+ }
14708
+ };
14709
+ for (const path of new Set(input.paths)) {
14325
14710
  input.signal?.throwIfAborted();
14326
14711
  if (!path.startsWith(`design_records/`)) throw new Error("design records: path is outside the project record directory");
14327
- const file = await resolveConfinedFilePath(input.projectRoot, path);
14712
+ bytes.set(path, await read(path));
14713
+ baseline.set(path, await git.readBytesAt(input.expectedHead ?? head, path, input.signal));
14714
+ }
14715
+ for (let attempt = 0; attempt < MAX_PUBLICATION_ATTEMPTS; attempt++) {
14716
+ input.signal?.throwIfAborted();
14717
+ if (attempt > 0) {
14718
+ head = await git.head(input.signal);
14719
+ if (!head || await git.designEvidenceRevisionAt(head, input.signal) !== evidence) throw new Error("design records: Design evidence changed during record publication");
14720
+ }
14721
+ for (const [path, frozen] of bytes) {
14722
+ if (!sameBytes(await read(path), frozen)) throw new Error("design records: target bytes changed during record publication");
14723
+ const current = await git.readBytesAt(head, path, input.signal);
14724
+ if (!sameBytes(current, baseline.get(path)) && !sameBytes(current, frozen)) throw new Error("design records: committed target changed during record publication");
14725
+ }
14328
14726
  try {
14329
- bytes.set(path, await readFile(file));
14727
+ return await git.commitExact(input.message, bytes, head, input.signal);
14330
14728
  } catch (error) {
14331
- if (error.code !== "ENOENT") throw error;
14332
- bytes.set(path, void 0);
14729
+ input.signal?.throwIfAborted();
14730
+ if (!stalePublication(error) || attempt === 2) throw error;
14333
14731
  }
14334
14732
  }
14335
- return git.commitExact(input.message, bytes, head, input.signal);
14733
+ throw new Error("design records: publication attempts exhausted");
14336
14734
  }
14337
14735
  //#endregion
14338
14736
  //#region packages/core/src/design-knowledge.ts
@@ -16783,7 +17181,8 @@ function serializeDesignClarityAuthority(authority) {
16783
17181
  }, null, 2)}\n`;
16784
17182
  }
16785
17183
  /**
16786
- * Read and strictly parse one project's clarity authority.
17184
+ * Read and strictly parse the local file for an explicit report/retry operation.
17185
+ * Display and context reads use readCommittedDesignClarityAuthority instead.
16787
17186
  * @param projectStateRoot - trusted records root inside one project.
16788
17187
  * @param projectId - the project the document must be bound to.
16789
17188
  * @returns the validated authority, or undefined when no assessment exists.
@@ -16797,16 +17196,34 @@ async function readDesignClarityAuthority(projectStateRoot, projectId) {
16797
17196
  if (error.code === "ENOENT") return void 0;
16798
17197
  throw error;
16799
17198
  }
17199
+ return decodeDesignClarityAuthority(bytes, projectId);
17200
+ }
17201
+ /** Decode the same strict document from a local retry file or committed blob. */
17202
+ function decodeDesignClarityAuthority(bytes, projectId) {
16800
17203
  if (bytes.byteLength > MAX_AUTHORITY_BYTES) throw new Error(`design clarity authority: file exceeds ${MAX_AUTHORITY_BYTES} bytes`);
16801
17204
  let decoded;
16802
17205
  try {
16803
- decoded = JSON.parse(bytes.toString("utf8"));
17206
+ decoded = JSON.parse(Buffer.from(bytes).toString("utf8"));
16804
17207
  } catch (error) {
16805
17208
  throw new Error("design clarity authority: invalid JSON", { cause: error });
16806
17209
  }
16807
17210
  return parseDesignClarityAuthority(decoded, projectId);
16808
17211
  }
16809
17212
  /**
17213
+ * Read the last Git-published assessment from the same project authority file.
17214
+ * A local replacement whose publication failed is retained for explicit retry,
17215
+ * but cannot replace the last successful score in display or Agent context.
17216
+ * This read never commits, repairs, migrates, or folds journal audit facts.
17217
+ */
17218
+ async function readCommittedDesignClarityAuthority(projectRoot, projectId, options) {
17219
+ options?.signal?.throwIfAborted();
17220
+ await resolveConfinedFilePath(designProjectRecordsRoot(projectRoot), DESIGN_CLARITY_AUTHORITY_FILE);
17221
+ const git = new GitVersioning(options?.spawn ?? nodeDesignProjectSpawn, projectRoot);
17222
+ const head = await git.head(options?.signal);
17223
+ const bytes = head === void 0 ? void 0 : await git.readBytesAt(head, `${DESIGN_PROJECT_RECORDS_DIRECTORY}/${DESIGN_CLARITY_AUTHORITY_FILE}`, options?.signal, MAX_AUTHORITY_BYTES);
17224
+ return bytes === void 0 ? void 0 : decodeDesignClarityAuthority(bytes, projectId);
17225
+ }
17226
+ /**
16810
17227
  * Atomically replace one project's clarity authority document.
16811
17228
  * @param projectStateRoot - trusted records root inside one project.
16812
17229
  * @param authority - validated authority document to persist.
@@ -18135,6 +18552,99 @@ async function pendingMustEditAuthorityForSave(records, kitName, kitVersion, ski
18135
18552
  return pendingMustEditAuthority(records, kitName, kitVersion, skillName, head, (commit) => commit === release);
18136
18553
  }
18137
18554
  //#endregion
18555
+ //#region packages/core/src/panel-save.ts
18556
+ /** Shared main-conversation contract for the user's Save and assess action. */
18557
+ const DESIGN_PANEL_SAVE_ASSESSMENT_GUIDANCE = [
18558
+ "The user chose Save and assess next step. After a meaningful Panel save, you must assess the latest saved Design evidence against the agreed user scope and call report_design_clarity in this same main-conversation continuation before asking the next question, recommending another Bundle or ending your reply.",
18559
+ "Use the current server-supplied project, saved checkpoint and Kit input. If those inputs have changed, read the current Design context before reporting; do not assess a superseded checkpoint as current. Explain known evidence and gaps without inventing facts or a zero score.",
18560
+ "Several saves delivered together need one assessment of their latest relevant state. An unchanged or replayed save does not require another score; reuse an existing assessment only when its saved Design evidence, Kit content and reasoning still apply to the current agreed scope.",
18561
+ "A later user stop, cancellation or instruction not to assess takes priority. If the reporting capability is unavailable or reporting fails, state that limitation and preserve the saved result; a missing score does not block independently authorized Design work.",
18562
+ "No second evaluator is required. Do not start another model or Bundle, reopen a settled invocation, or rewrite saved Design Files just to assess them. Existing user-input handoffs and main-Agent permissions remain in force."
18563
+ ].join(" ");
18564
+ /** Decode bounded Panel attachment transport; store enforces path ownership. */
18565
+ function parsePanelArtifacts(skill, value) {
18566
+ if (value === void 0) return void 0;
18567
+ if (!Array.isArray(value) || value.length > 64) throw new Error("design panel: artifacts must be a list of at most 64 files");
18568
+ const artifacts = {};
18569
+ let totalBytes = 0;
18570
+ for (const raw of value) {
18571
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) throw new Error("design panel: each artifact must be an object");
18572
+ const entry = raw;
18573
+ const path = entry.path;
18574
+ const content = entry.content;
18575
+ if (typeof path !== "string" || typeof content !== "string") throw new Error("design panel: each artifact requires string path and content");
18576
+ const encoding = entry.encoding;
18577
+ if (encoding !== void 0 && encoding !== "base64") throw new Error("design panel: artifact encoding must be base64 when present");
18578
+ 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");
18579
+ if (Object.hasOwn(artifacts, path)) throw new Error(`design panel: duplicate artifact path ${JSON.stringify(path)}`);
18580
+ let prepared = content;
18581
+ let bytes = Buffer.byteLength(content, "utf8");
18582
+ if (encoding === "base64") {
18583
+ 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`);
18584
+ const decoded = Buffer.from(content, "base64");
18585
+ if (decoded.toString("base64") !== content) throw new Error(`design panel: artifact ${JSON.stringify(path)} is not canonical base64`);
18586
+ prepared = Uint8Array.from(decoded);
18587
+ bytes = decoded.byteLength;
18588
+ }
18589
+ if (bytes > 16777216) throw new Error(`design panel: artifact ${JSON.stringify(path)} exceeds 16 MiB`);
18590
+ totalBytes += bytes;
18591
+ if (totalBytes > 67108864) throw new Error("design panel: artifacts exceed 64 MiB in total");
18592
+ artifacts[path] = prepared;
18593
+ }
18594
+ return Object.freeze(artifacts);
18595
+ }
18596
+ /**
18597
+ * Build the model-facing note that carries the authoritative git diff.
18598
+ * @param skill - the skill whose panel was saved.
18599
+ * @param diff - the unified diff of the save commit.
18600
+ * @returns the `<panel_save_context>` note text.
18601
+ */
18602
+ function buildPanelSaveNote(skill, diff, clarityInput) {
18603
+ return [
18604
+ "<panel_save_context>",
18605
+ `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.`,
18606
+ "<git_diff>",
18607
+ diff,
18608
+ "</git_diff>",
18609
+ `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.`,
18610
+ ...clarityInput === void 0 ? [] : [
18611
+ DESIGN_PANEL_SAVE_ASSESSMENT_GUIDANCE,
18612
+ `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. The Design save is already completed independently of this report.`,
18613
+ "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.",
18614
+ "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."
18615
+ ],
18616
+ "</panel_save_context>"
18617
+ ].join("\n");
18618
+ }
18619
+ /**
18620
+ * Apply one panel edit: validate, persist, version, and build the agent note.
18621
+ * @param store - the session's Design Files store.
18622
+ * @param edit - the panel save (owning skill + post-edit state).
18623
+ * @param settleEvent - awaited plugin Journal settlement after commit.
18624
+ * @param validate - write-time schema validator (fail loud).
18625
+ * @param artifacts - deterministic files prepared by the runtime driver.
18626
+ * @param ownedArtifacts - complete artifact set retained by this Bundle.
18627
+ * @param signal - cancellation before transaction acceptance.
18628
+ * @returns the commit, diff, and the note to inject into the next turn.
18629
+ */
18630
+ async function applyPanelEdit(store, edit, settleEvent, validate, artifacts, ownedArtifacts, signal, audit) {
18631
+ const { commit, diff } = await store.write(edit.skill, edit.state, {
18632
+ origin: "panel",
18633
+ ...validate === void 0 ? {} : { validate },
18634
+ ...artifacts === void 0 ? {} : { artifacts },
18635
+ ...ownedArtifacts === void 0 ? {} : { ownedArtifacts },
18636
+ ...signal === void 0 ? {} : { signal },
18637
+ ...audit === void 0 ? {} : { audit },
18638
+ settleEvent
18639
+ });
18640
+ return {
18641
+ skill: edit.skill,
18642
+ commit,
18643
+ diff,
18644
+ note: buildPanelSaveNote(edit.skill, diff)
18645
+ };
18646
+ }
18647
+ //#endregion
18138
18648
  //#region packages/core/src/validate-design.ts
18139
18649
  /**
18140
18650
  * Renderability checkpoint (the second validation layer). Given a design skill
@@ -18162,453 +18672,72 @@ async function validateSkillDesign(skill, state, options = {}) {
18162
18672
  const result = validatorFromSchemaYaml(schemaYaml)(state);
18163
18673
  if (!result.ok) issues.push({
18164
18674
  code: "schema_violation",
18165
- message: result.error,
18166
- repair_hint: "Bring the design state into conformance with the skill schema before persisting."
18167
- });
18168
- } else issues.push({
18169
- code: "schema_missing",
18170
- message: `skill "${skill.name}" has no schema.yaml`,
18171
- repair_hint: "Add a schema.yaml data contract for the skill."
18172
- });
18173
- }
18174
- const validationYaml = skill.metadata?.validationYaml;
18175
- if (typeof validationYaml === "string") {
18176
- const doc = parseValidationYaml(validationYaml);
18177
- const stateEnv = {
18178
- skill: skill.name,
18179
- state: stateRecord,
18180
- ...options.artifactText === void 0 ? {} : { artifactText: options.artifactText }
18181
- };
18182
- if (scopes.has("state")) issues.push(...await evaluateValidationRules(doc, stateEnv, "state", options.resolveValidationDriver));
18183
- if (scopes.has("candidate")) {
18184
- if (options.candidate === void 0) throw new Error("validateSkillDesign: candidate scope requires options.candidate");
18185
- const candidate = options.candidate;
18186
- const candidateState = {
18187
- content: candidate.content,
18188
- ...candidate.metadata === void 0 ? {} : { metadata: candidate.metadata }
18189
- };
18190
- issues.push(...await evaluateValidationRules(doc, {
18191
- skill: skill.name,
18192
- state: candidateState,
18193
- candidate
18194
- }, "candidate", options.resolveValidationDriver));
18195
- }
18196
- if (scopes.has("completion")) issues.push(...await evaluateValidationRules(doc, stateEnv, "completion", options.resolveValidationDriver));
18197
- }
18198
- if (!validatesCandidateState) return issues;
18199
- const manifest = skill.metadata?.skillManifest;
18200
- if ((typeof manifest === "object" && manifest !== null && !Array.isArray(manifest) && typeof manifest.presentation === "object" && manifest.presentation !== null && !Array.isArray(manifest.presentation) ? manifest.presentation : void 0)?.mode === "declarative") {
18201
- const panelYaml = skill.metadata?.panelYaml;
18202
- if (typeof panelYaml !== "string") {
18203
- issues.push({
18204
- code: "panel_missing",
18205
- message: `skill "${skill.name}" has no panel.yaml`,
18206
- repair_hint: "Add a panel.yaml so the declarative design can be visualized and edited."
18207
- });
18208
- return issues;
18209
- }
18210
- try {
18211
- const panel = (0, import_dist.parse)(panelYaml);
18212
- if (panel.version !== 1) issues.push({
18213
- code: "panel_version",
18214
- message: `panel manifest version ${String(panel.version)} is unsupported`,
18215
- repair_hint: "Set version: 1 in panel.yaml."
18216
- });
18217
- if (panel.ui === void 0) issues.push({
18218
- code: "panel_no_ui",
18219
- message: "panel manifest has no ui tree",
18220
- repair_hint: "Define the ui component tree in panel.yaml."
18221
- });
18222
- } catch (error) {
18223
- issues.push({
18224
- code: "panel_unparseable",
18225
- message: error instanceof Error ? error.message : String(error),
18226
- repair_hint: "Fix the panel.yaml syntax."
18227
- });
18228
- }
18229
- }
18230
- return issues;
18231
- }
18232
- //#endregion
18233
- //#region packages/core/src/content-store.ts
18234
- /** File-backed immutable content. The caller supplies trusted installation provenance. */
18235
- const contentNodeFs = {
18236
- readText: async (path) => {
18237
- try {
18238
- return await readFile(path, "utf8");
18239
- } catch (error) {
18240
- if (error.code === "ENOENT") return void 0;
18241
- throw error;
18242
- }
18243
- },
18244
- listDir: (path) => readdir(path),
18245
- isDirectory: async (path) => (await lstat(path)).isDirectory(),
18246
- realPath: async (path) => (await import("node:fs/promises")).realpath(path)
18247
- };
18248
- const emptyIndex = () => ({
18249
- formatVersion: 1,
18250
- kits: [],
18251
- bundles: []
18252
- });
18253
- const encode = (name) => {
18254
- if (!name || name.includes("\0")) throw new Error("content: invalid identity");
18255
- return Buffer.from(name, "utf8").toString("hex");
18256
- };
18257
- const key$1 = (pin) => `${pin.name}\0${pin.version}`;
18258
- function confinedRelativePath(root, path) {
18259
- const result = relative(root, resolve(root, path));
18260
- if (!result || result === ".." || result.startsWith("../") || isAbsolute(result)) throw new Error("content: Kit entry path escapes retained root");
18261
- return result;
18262
- }
18263
- function retainedKitLocation(rootDir, paths) {
18264
- if (!paths) return rootDir;
18265
- if (Object.values(paths).some((path) => isAbsolute(path))) throw new Error("content: retained Kit paths must be relative");
18266
- return {
18267
- rootDir,
18268
- skillsDir: join(rootDir, "skills"),
18269
- mindsetPath: resolve(rootDir, confinedRelativePath(rootDir, paths.mindset)),
18270
- manifestPath: resolve(rootDir, confinedRelativePath(rootDir, paths.manifest)),
18271
- ...paths.relations === void 0 ? {} : { relationsPath: resolve(rootDir, confinedRelativePath(rootDir, paths.relations)) }
18272
- };
18273
- }
18274
- /** Copy bytes, rejecting symlinks and special files. Also hash empty directories. */
18275
- async function copyTree(source, target, digest, relativePath = "", budget = {
18276
- bytes: 0,
18277
- nodes: 0
18278
- }) {
18279
- if (++budget.nodes > 2e4 || relativePath.split("/").length > 32) throw new Error("content: resource tree exceeds limits");
18280
- const info = await lstat(source);
18281
- if (info.isSymbolicLink()) throw new Error(`content: symlink resource is not retained: ${source}`);
18282
- if (info.isDirectory()) {
18283
- digest.update(`directory\0${relativePath}\0`);
18284
- await mkdir(target, { recursive: true });
18285
- for (const entry of (await readdir(source)).sort()) await copyTree(join(source, entry), join(target, entry), digest, relativePath ? `${relativePath}/${entry}` : entry, budget);
18286
- } else if (info.isFile()) {
18287
- budget.bytes += info.size;
18288
- if (budget.bytes > 134217728) throw new Error("content: resource bytes exceed limits");
18289
- const bytes = await readFile(source);
18290
- digest.update(`file\0${relativePath}\0${bytes.length}\0`).update(bytes);
18291
- await writeFile(target, bytes, {
18292
- flag: "wx",
18293
- mode: info.mode & 511
18294
- });
18295
- } else throw new Error(`content: unsupported resource ${source}`);
18296
- }
18297
- /** Exact version catalog; editable sources and their discovery are not this authority. */
18298
- var DesignContentStore = class {
18299
- root;
18300
- constructor(stateRoot) {
18301
- if (!isAbsolute(stateRoot)) throw new Error("content: stateRoot must be absolute");
18302
- this.root = join(stateRoot, "content");
18303
- }
18304
- async index() {
18305
- const text = await contentNodeFs.readText(join(this.root, "index.json"));
18306
- if (text === void 0) return emptyIndex();
18307
- const data = JSON.parse(text);
18308
- if (data.formatVersion !== 1 || !Array.isArray(data.kits) || !Array.isArray(data.bundles)) throw new Error("content: invalid retained index");
18309
- for (const entry of [...data.kits, ...data.bundles]) {
18310
- if (typeof entry.name !== "string" || typeof entry.version !== "string" || typeof entry.sourceId !== "string" || !/^[a-f0-9]{64}$/.test(entry.hash)) throw new Error("content: invalid retained entry");
18311
- encode(entry.name);
18312
- if (entry.kitPaths !== void 0) {
18313
- if (typeof entry.kitPaths.mindset !== "string" || typeof entry.kitPaths.manifest !== "string" || entry.kitPaths.relations !== void 0 && typeof entry.kitPaths.relations !== "string") throw new Error("content: invalid retained Kit paths");
18314
- retainedKitLocation(this.directory("kits", entry), entry.kitPaths);
18315
- }
18316
- }
18317
- return data;
18318
- }
18319
- directory(kind, pin) {
18320
- const version = kind === "kits" ? DesignKitVersion(pin.version) : DesignBundleVersion(pin.version);
18321
- return join(this.root, kind, encode(pin.name), String(version));
18322
- }
18323
- async listBundles() {
18324
- return (await this.index()).bundles.map(({ name, version }) => Object.freeze({
18325
- name,
18326
- version
18327
- }));
18328
- }
18329
- async listKits() {
18330
- return (await this.index()).kits.map(({ name, version }) => Object.freeze({
18331
- name,
18332
- version
18333
- }));
18334
- }
18335
- /** Publish an independent version even when no Kit mounts it. */
18336
- async retainBundle(rootDir, options, expectedPin) {
18337
- const bundle = await loadDesignBundle(contentNodeFs, {
18338
- rootDir,
18339
- sourceId: options.sourceId
18340
- }, expectedPin);
18341
- const pin = {
18342
- name: bundle.skill.catalogName ?? bundle.skill.name,
18343
- version: String(bundle.skill.version)
18344
- };
18345
- await mkdir(this.root, { recursive: true });
18346
- const lock = join(this.root, ".retain.lock");
18347
- await writeFile(lock, String(process.pid), { flag: "wx" });
18348
- const staging = join(this.root, `.staging-${randomUUID()}`);
18349
- try {
18350
- await mkdir(staging);
18351
- const directory = join(staging, "bundle");
18352
- await mkdir(directory);
18353
- const digest = createHash("sha256");
18354
- await copyTree(rootDir, join(directory, "files"), digest);
18355
- await loadDesignBundle(contentNodeFs, {
18356
- rootDir: join(directory, "files"),
18357
- sourceId: options.sourceId
18358
- }, pin);
18359
- const current = await this.index();
18360
- await this.publish([{
18361
- kind: "bundles",
18362
- entry: {
18363
- ...pin,
18364
- sourceId: options.sourceId,
18365
- hash: digest.digest("hex")
18366
- },
18367
- directory
18368
- }], staging, {
18369
- formatVersion: 1,
18370
- kits: [...current.kits],
18371
- bundles: [...current.bundles]
18372
- });
18373
- } finally {
18374
- await rm(staging, {
18375
- recursive: true,
18376
- force: true
18377
- });
18378
- await rm(lock, { force: true });
18379
- }
18380
- return await this.resolveBundle(pin);
18381
- }
18382
- async resolveBundle(pin) {
18383
- const entry = (await this.index()).bundles.find((e) => key$1(e) === key$1(pin));
18384
- if (!entry) return void 0;
18385
- const rootDir = join(this.directory("bundles", pin), "files");
18386
- if (await hashTree(rootDir) !== entry.hash) throw new Error("content: retained Bundle hash mismatch");
18387
- return loadDesignBundle(contentNodeFs, {
18388
- rootDir,
18389
- sourceId: entry.sourceId
18390
- }, pin);
18391
- }
18392
- async loadRetainedKit(pin) {
18393
- const entry = (await this.index()).kits.find((e) => key$1(e) === key$1(pin));
18394
- if (!entry) return void 0;
18395
- const rootDir = join(this.directory("kits", pin), "files");
18396
- if (await hashTree(rootDir) !== entry.hash) throw new Error("content: retained Kit hash mismatch");
18397
- const kit = await loadDesignKit(contentNodeFs, retainedKitLocation(rootDir, entry.kitPaths), {
18398
- sourceId: entry.sourceId,
18399
- resolveBundle: (bundle) => this.resolveBundle(bundle)
18675
+ message: result.error,
18676
+ repair_hint: "Bring the design state into conformance with the skill schema before persisting."
18677
+ });
18678
+ } else issues.push({
18679
+ code: "schema_missing",
18680
+ message: `skill "${skill.name}" has no schema.yaml`,
18681
+ repair_hint: "Add a schema.yaml data contract for the skill."
18400
18682
  });
18401
- if (kit.name !== pin.name || String(kit.version) !== pin.version) throw new Error("content: retained Kit pin mismatch");
18402
- return kit;
18403
18683
  }
18404
- /** All project reads and writes resolve the same exact closure. */
18405
- async resolveProjectKit(pin) {
18406
- const base = await this.loadRetainedKit(pin);
18407
- if (!base) return void 0;
18408
- return composeProjectKit(pin, base, await Promise.all(projectBundleOverrides(pin, base).map(async (target) => {
18409
- const bundle = await this.resolveBundle(target);
18410
- if (!bundle) throw new Error(`project content: unavailable exact Bundle ${target.name}@${target.version}`);
18411
- return bundle;
18412
- })));
18684
+ const validationYaml = skill.metadata?.validationYaml;
18685
+ if (typeof validationYaml === "string") {
18686
+ const doc = parseValidationYaml(validationYaml);
18687
+ const stateEnv = {
18688
+ skill: skill.name,
18689
+ state: stateRecord,
18690
+ ...options.artifactText === void 0 ? {} : { artifactText: options.artifactText }
18691
+ };
18692
+ if (scopes.has("state")) issues.push(...await evaluateValidationRules(doc, stateEnv, "state", options.resolveValidationDriver));
18693
+ if (scopes.has("candidate")) {
18694
+ if (options.candidate === void 0) throw new Error("validateSkillDesign: candidate scope requires options.candidate");
18695
+ const candidate = options.candidate;
18696
+ const candidateState = {
18697
+ content: candidate.content,
18698
+ ...candidate.metadata === void 0 ? {} : { metadata: candidate.metadata }
18699
+ };
18700
+ issues.push(...await evaluateValidationRules(doc, {
18701
+ skill: skill.name,
18702
+ state: candidateState,
18703
+ candidate
18704
+ }, "candidate", options.resolveValidationDriver));
18705
+ }
18706
+ if (scopes.has("completion")) issues.push(...await evaluateValidationRules(doc, stateEnv, "completion", options.resolveValidationDriver));
18413
18707
  }
18414
- /** Retain a complete validated closure; publish index only after every byte is ready. */
18415
- async retainKitClosure(location, options) {
18416
- if (typeof location === "string") location = await resolveDesignKitPackage(contentNodeFs, location) ?? location;
18417
- const bundles = /* @__PURE__ */ new Map();
18418
- const kit = await loadDesignKit(contentNodeFs, location, {
18419
- ...options,
18420
- ...options.resolveBundle === void 0 ? {} : { resolveBundle: async (pin) => {
18421
- const bundle = await options.resolveBundle(pin);
18422
- if (bundle) bundles.set(key$1(pin), bundle);
18423
- return bundle;
18424
- } }
18425
- });
18426
- for (const skill of kit.skills) if (!bundles.has(key$1({
18427
- name: skill.catalogName ?? skill.name,
18428
- version: String(skill.version)
18429
- }))) {
18430
- const bundle = await loadDesignBundle(contentNodeFs, {
18431
- rootDir: skill.resourceRoot,
18432
- sourceId: options.sourceId
18433
- }, {
18434
- name: skill.catalogName ?? skill.name,
18435
- version: String(skill.version)
18708
+ if (!validatesCandidateState) return issues;
18709
+ const manifest = skill.metadata?.skillManifest;
18710
+ if ((typeof manifest === "object" && manifest !== null && !Array.isArray(manifest) && typeof manifest.presentation === "object" && manifest.presentation !== null && !Array.isArray(manifest.presentation) ? manifest.presentation : void 0)?.mode === "declarative") {
18711
+ const panelYaml = skill.metadata?.panelYaml;
18712
+ if (typeof panelYaml !== "string") {
18713
+ issues.push({
18714
+ code: "panel_missing",
18715
+ message: `skill "${skill.name}" has no panel.yaml`,
18716
+ repair_hint: "Add a panel.yaml so the declarative design can be visualized and edited."
18436
18717
  });
18437
- bundles.set(key$1({
18438
- name: skill.catalogName ?? skill.name,
18439
- version: String(skill.version)
18440
- }), bundle);
18718
+ return issues;
18441
18719
  }
18442
- await mkdir(this.root, { recursive: true });
18443
- const lock = join(this.root, ".retain.lock");
18444
- await writeFile(lock, String(process.pid), { flag: "wx" });
18445
- const staging = join(this.root, `.staging-${randomUUID()}`);
18446
18720
  try {
18447
- await mkdir(staging);
18448
- const current = await this.index();
18449
- const next = {
18450
- formatVersion: 1,
18451
- kits: [...current.kits],
18452
- bundles: [...current.bundles]
18453
- };
18454
- const staged = [];
18455
- for (const bundle of bundles.values()) {
18456
- const pin = {
18457
- name: bundle.skill.catalogName ?? bundle.skill.name,
18458
- version: String(bundle.skill.version)
18459
- };
18460
- const sourceId = await this.bundleSourceId(bundle, options, pin);
18461
- const directory = join(staging, `bundle-${staged.length}`);
18462
- await mkdir(directory);
18463
- const digest = createHash("sha256");
18464
- await copyTree(bundle.resourceRoot, join(directory, "files"), digest);
18465
- if ((await loadDesignBundle(contentNodeFs, {
18466
- rootDir: join(directory, "files"),
18467
- sourceId
18468
- }, pin)).skill.authority !== bundle.skill.authority) throw new Error("content: Bundle authority changed during retention");
18469
- const entry = {
18470
- ...pin,
18471
- sourceId,
18472
- hash: digest.digest("hex")
18473
- };
18474
- staged.push({
18475
- kind: "bundles",
18476
- entry,
18477
- directory
18478
- });
18479
- }
18480
- const directory = join(staging, "kit");
18481
- await mkdir(join(directory, "files"), { recursive: true });
18482
- const root = typeof location === "string" ? location : location.rootDir;
18483
- const originalManifest = await contentNodeFs.readText(typeof location === "string" ? join(root, "kit.yaml") : location.manifestPath ?? join(root, "kit.yaml"));
18484
- let kitPaths;
18485
- if (originalManifest !== void 0) {
18486
- kitPaths = {
18487
- mindset: confinedRelativePath(root, typeof location === "string" ? join(root, "mindset.md") : location.mindsetPath),
18488
- manifest: confinedRelativePath(root, typeof location === "string" ? join(root, "kit.yaml") : location.manifestPath ?? join(root, "kit.yaml")),
18489
- ...typeof location === "string" || location.relationsPath === void 0 ? {} : { relations: confinedRelativePath(root, location.relationsPath) }
18490
- };
18491
- if (kitPaths.mindset === "mindset.md" && kitPaths.manifest === "kit.yaml" && (kitPaths.relations === void 0 || kitPaths.relations === "relations.yaml")) kitPaths = void 0;
18492
- await copyTree(root, join(directory, "files"), createHash("sha256"));
18493
- } else {
18494
- const engineering = /* @__PURE__ */ new Set([
18495
- "skills",
18496
- "node_modules",
18497
- "lib",
18498
- "dist",
18499
- "src",
18500
- "test",
18501
- "tests",
18502
- "scripts",
18503
- ".git",
18504
- ".cache",
18505
- "package.json",
18506
- "pnpm-lock.yaml",
18507
- "package-lock.json",
18508
- "yarn.lock",
18509
- "tsconfig.json",
18510
- "tsdown.config.ts"
18511
- ]);
18512
- for (const name of (await readdir(root)).sort()) {
18513
- if (engineering.has(name) || name === "mindset.md" || name === "kit.yaml" || name === "relations.yaml" || /^(smoke-|test-|preview-|compare-).*\.(mjs|html)$/.test(name)) continue;
18514
- await copyTree(join(root, name), join(directory, "files", name), createHash("sha256"), name);
18515
- }
18516
- await writeFile(join(directory, "files", "mindset.md"), kit.mindsetSource);
18517
- const relations = await contentNodeFs.readText(typeof location === "string" ? join(root, "relations.yaml") : location.relationsPath ?? join(root, "relations.yaml"));
18518
- if (relations !== void 0) await writeFile(join(directory, "files", "relations.yaml"), relations);
18519
- await writeFile(join(directory, "files", "kit.yaml"), (0, import_dist.stringify)({
18520
- version: 1,
18521
- mounts: kit.skills.map((s) => ({
18522
- bindingKey: s.name,
18523
- name: s.catalogName ?? s.name,
18524
- version: String(s.version)
18525
- }))
18526
- }));
18527
- }
18528
- const stagedByPin = new Map(staged.map((s) => [key$1(s.entry), s]));
18529
- const verified = await loadDesignKit(contentNodeFs, retainedKitLocation(join(directory, "files"), kitPaths), {
18530
- sourceId: options.sourceId,
18531
- resolveBundle: async (pin) => {
18532
- const value = stagedByPin.get(key$1(pin));
18533
- return value ? loadDesignBundle(contentNodeFs, {
18534
- rootDir: join(value.directory, "files"),
18535
- sourceId: value.entry.sourceId
18536
- }, pin) : void 0;
18537
- }
18721
+ const panel = (0, import_dist.parse)(panelYaml);
18722
+ if (panel.version !== 1) issues.push({
18723
+ code: "panel_version",
18724
+ message: `panel manifest version ${String(panel.version)} is unsupported`,
18725
+ repair_hint: "Set version: 1 in panel.yaml."
18538
18726
  });
18539
- if (verified.name !== kit.name || verified.version !== kit.version) throw new Error("content: source changed while retaining Kit");
18540
- const kitHash = await hashTree(join(directory, "files"));
18541
- staged.push({
18542
- kind: "kits",
18543
- entry: {
18544
- name: kit.name,
18545
- version: String(kit.version),
18546
- hash: kitHash,
18547
- sourceId: options.sourceId,
18548
- ...kitPaths === void 0 ? {} : { kitPaths }
18549
- },
18550
- directory
18727
+ if (panel.ui === void 0) issues.push({
18728
+ code: "panel_no_ui",
18729
+ message: "panel manifest has no ui tree",
18730
+ repair_hint: "Define the ui component tree in panel.yaml."
18551
18731
  });
18552
- await this.publish(staged, staging, next);
18553
- } finally {
18554
- await rm(staging, {
18555
- recursive: true,
18556
- force: true
18732
+ } catch (error) {
18733
+ issues.push({
18734
+ code: "panel_unparseable",
18735
+ message: error instanceof Error ? error.message : String(error),
18736
+ repair_hint: "Fix the panel.yaml syntax."
18557
18737
  });
18558
- await rm(lock, { force: true });
18559
- }
18560
- return await this.loadRetainedKit({
18561
- name: kit.name,
18562
- version: String(kit.version)
18563
- });
18564
- }
18565
- async publish(staged, staging, next) {
18566
- for (const value of staged) {
18567
- const existing = next[value.kind].find((e) => key$1(e) === key$1(value.entry));
18568
- if (existing && (existing.hash !== value.entry.hash || existing.sourceId !== value.entry.sourceId || JSON.stringify(existing.kitPaths) !== JSON.stringify(value.entry.kitPaths))) throw new Error(`content: immutable ${value.kind} pin conflict ${value.entry.name}@${value.entry.version}`);
18569
- }
18570
- for (const value of staged) {
18571
- if (next[value.kind].some((e) => key$1(e) === key$1(value.entry))) continue;
18572
- const target = this.directory(value.kind, value.entry);
18573
- await mkdir(resolve(target, ".."), { recursive: true });
18574
- await writeFile(join(value.directory, "metadata.json"), JSON.stringify(value.entry));
18575
- try {
18576
- await rename(value.directory, target);
18577
- } catch (error) {
18578
- if (!["EEXIST", "ENOTEMPTY"].includes(error.code ?? "")) throw error;
18579
- const previous = JSON.parse(await readFile(join(target, "metadata.json"), "utf8"));
18580
- if (previous.hash !== value.entry.hash || previous.sourceId !== value.entry.sourceId || JSON.stringify(previous.kitPaths) !== JSON.stringify(value.entry.kitPaths)) throw new Error("content: unindexed immutable version conflict");
18581
- }
18582
- next[value.kind].push(value.entry);
18583
18738
  }
18584
- const indexPath = join(staging, "index.json");
18585
- await writeFile(indexPath, JSON.stringify(next));
18586
- await rename(indexPath, join(this.root, "index.json"));
18587
- }
18588
- async bundleSourceId(bundle, options, pin) {
18589
- const sourceId = bundle.sourceId ?? options.sourceId;
18590
- if ((await loadDesignBundle(contentNodeFs, {
18591
- rootDir: bundle.resourceRoot,
18592
- sourceId
18593
- }, pin)).skill.authority !== bundle.skill.authority) throw new Error("content: resolver must supply original trusted sourceId");
18594
- return sourceId;
18595
- }
18596
- };
18597
- async function hashTree(root) {
18598
- const digest = createHash("sha256");
18599
- async function walk(path, rel) {
18600
- const info = await lstat(path);
18601
- if (info.isSymbolicLink()) throw new Error("content: symlink in retained content");
18602
- if (info.isDirectory()) {
18603
- digest.update(`directory\0${rel}\0`);
18604
- for (const name of (await readdir(path)).sort()) await walk(join(path, name), rel ? `${rel}/${name}` : name);
18605
- } else if (info.isFile()) {
18606
- const bytes = await readFile(path);
18607
- digest.update(`file\0${rel}\0${bytes.length}\0`).update(bytes);
18608
- } else throw new Error("content: unsupported retained resource");
18609
18739
  }
18610
- await walk(root, "");
18611
- return digest.digest("hex");
18740
+ return issues;
18612
18741
  }
18613
18742
  //#endregion
18614
18743
  //#region packages/core/src/design-execution-derivation.ts
@@ -19590,6 +19719,7 @@ On DSH the main Agent can begin with a bounded text/sourceFiles query and pass t
19590
19719
  When Companion context supplies coverage.basis, forward it as the query basis with the unchanged project/checkpoint/revision pins. A source-projection view includes only verified file-derived records, explicit references and literal fields; semantic candidates and other non-file interpretations are outside it, even if a later semantic publication becomes available. Its status can remain failed for semantic maintenance while these basic reads are available; preserve sourceCheckpoint and do not call the semantic layer current. Unprojected, incomplete or stale sources remain unavailable rather than supplying invented pins. Legacy historical-snapshot coverage does not assert semantic completeness or current source projection policy.
19591
19720
  Use the shared Design KAG to answer a current design question, not to inspect or connect every node.
19592
19721
  Start from the current task, changed sourceFiles or exact record IDs. Pin project, checkpoint and graph revision; page with unchanged filters.
19722
+ The text filter is a case-insensitive literal substring over serialized projected entities and relations. Spaces are literal; it does not tokenize a question or perform query-vector search. Prefer a short verbatim keyword grounded in the source. sourceFiles filters exact provenance.evidence[].source values; copy the recorded Design-Files-relative path without adding a host root or design_files/ prefix. Combined filters must all match. Zero matches only means no records matched those filters in that snapshot; it does not prove a missing source fact, an incomplete index or an embedding failure. evidence.sourceReadRequired=true always requests verification in the original source, including when matches exist; it is not a failure or lag flag. Use the available Knowledge status and coverage to assess freshness and embedding readiness separately, and verify the pinned source evidence. Different current and published commits alone do not prove stale Design evidence when source equivalence has been established.
19593
19723
  Use ontologyTypes to select schema-derived kinds, recordKinds to separate records/content/artifacts, and identityQualities to distinguish stable anchors from structural or anonymous instances. These are generated projection facts, not manually assigned domain roles. Use incidentTo and direction for one-hop neighborhoods; relationTypes can narrow purpose. Expand only as needed, deduplicate and stop when the question is supported or the bounded search cannot resolve it.
19594
19724
  Relation reading separates meaning, origin, semantic direction and lifecycle. relationMeanings/relationOrigins filter before pagination; relationTypes still matches exact stored types. direction incoming/outgoing is STORAGE from/to, even for symmetric similar/contradicts; use both to recall both sides. Unknown types keep their raw name and unknown semantic direction: do not infer meaning from producer, labels or visual proximity.
19595
19725
  A heavily cited shared style is not necessarily a central business capability; choose relation meaning for the question instead of ranking every edge together. Do not infer mandatory node layers from schema names or visual positions.
@@ -19610,7 +19740,7 @@ Integrate receipts without echoing artifact bytes. Read relevant artifact conten
19610
19740
  const DESIGN_WORKER_EVIDENCE_GUIDANCE = `Use the assignment's shared decisions and relevant evidence before requesting more context. Do not automatically reread the complete project, shared specifications or sibling artifacts already sufficiently represented in the brief.
19611
19741
  For a material gap, read the smallest relevant source record or excerpt with available read-only tools; widen only when necessary. Check current source evidence if the brief conflicts with it or a relevant revision changed. Report that conflict to the executor rather than silently changing shared decisions. Exact assets and file-backed validators still read their authoritative files.
19612
19742
  Keep ownership to the assigned artifact. Return its receipt or path, meaningful validation evidence, and any unresolved dependency or inconsistency; do not return the artifact body or claim cross-artifact acceptance. Your executor owns integration.`;
19613
- `${KNOWLEDGE_AGENTIC_GUIDANCE}${DESIGN_EXECUTOR_EVIDENCE_GUIDANCE}${RECONSTRUCTION_METHOD}`;
19743
+ `${KNOWLEDGE_AGENTIC_GUIDANCE}${DESIGN_EXECUTOR_EVIDENCE_GUIDANCE}${RECONSTRUCTION_METHOD}${DESIGN_PANEL_SAVE_ASSESSMENT_GUIDANCE}`;
19614
19744
  /** Evidence standard for the structured U/S/T clarity report. */
19615
19745
  const DESIGN_CORE_CLARITY_RUBRIC_PROMPT = `<design_clarity_rubric>
19616
19746
  Ignore files under _experiences/: derived demonstrations and sample content are not product evidence. Assess only the original owning design facts.
@@ -20159,8 +20289,6 @@ function genericPanelNode(components, context) {
20159
20289
  if (!GENERIC_COMPONENTS.has(node.component) || seen.has(node.id)) throw new Error("auto panel: untrusted or duplicate generated component");
20160
20290
  if (node.component === "stack" || node.component === "tabs") {
20161
20291
  if (node.slots !== void 0) throw new Error("auto panel: generated layout has unrendered slots");
20162
- } else if (node.component === "split") {
20163
- if (node.children !== void 0 || Object.keys(node.slots ?? {}).some((key) => key !== "sidebar" && key !== "main")) throw new Error("auto panel: generated split has unrendered branches");
20164
20292
  } else if (node.children !== void 0 || node.slots !== void 0) throw new Error("auto panel: generated leaf has unrendered branches");
20165
20293
  if (node.card_groups !== void 0) throw new Error("auto panel: authored card groups are not supported");
20166
20294
  if (node.sidebar_icon !== void 0) throw new Error("auto panel: authored sidebar icons are not supported");
@@ -20215,7 +20343,7 @@ function genericPanelNode(components, context) {
20215
20343
  if (Object.entries(declared).filter(([key, spec]) => spec.knowledge?.role !== "metadata" && !shown.has(key)).length > 0 && !hasStructuredSource(manifest.ui, (section.records_path ?? section.id).split(".")[0])) throw new Error("auto panel: record fields omitted without readable overview");
20216
20344
  }
20217
20345
  for (const child of node.children ?? []) visit(child);
20218
- for (const child of Object.values(node.slots ?? {})) if (child !== void 0) visit(child);
20346
+ for (const child of Object.values(node.slots ?? {})) if (child != null) visit(child);
20219
20347
  };
20220
20348
  visit(manifest.ui);
20221
20349
  for (const [key, spec] of Object.entries(context.schema.properties ?? {})) {
@@ -21028,4 +21156,4 @@ var DesignContinuousReviewClock = class {
21028
21156
  }
21029
21157
  };
21030
21158
  //#endregion
21031
- export { DesignKnowledgeRevision as $, DesignContentStore as A, validatorFromSchemaYaml as At, parseDesignClarityReported as B, DesignAdvisoryJournal as C, readConfinedText as Ct, OFFICIAL_REFLECTION_PROFILE as D, writeConfinedText as Dt, OFFICIAL_GROUNDING_PROFILE as E, writeConfinedBytes as Et, readDesignClarityAuthority as F, ProjectContentTransaction as Ft, advanceDesignKnowledgePublication as G, runDesignProjectCommand as H, writeDesignClarityAuthority as I, DesignBundleVersion as It, refreshDesignKnowledge as J, readDesignKnowledgePublication as K, designClarityDigest as L, DesignKitVersion as Lt, pendingMustEditAuthorityForSave as M, DesignProjectManager as Mt, DesignExecutionHandoffJournal as N, nodeDesignProjectSpawn as Nt, officialAdvisoryProfile as O, compileSchema as Ot, DesignJournalStorage as P, parseDesignProjectJson as Pt, pointerKey as Q, designClarityInputMatches as R, GitVersioning as Rt, queryKnowledgeSnapshot as S, readConfinedBytes as St, OFFICIAL_ALIGNMENT_PROFILE as T, resolveConfinedFilePath as Tt, restoreDesignKnowledgeRecords as U, parseDesignCommand as V, saveDesignKnowledgeRecords as W, readSourceDesignKnowledge as X, storedKnowledgeGraph as Y, readCompleteDesignKnowledge as Z, DESIGN_EXECUTOR_EVIDENCE_GUIDANCE as _, resolveSemanticCapability as _t, autoPanelGenerationPrompt as a, projectBundleOverrides as at, knowledgeQueryFilters as b, PANEL_COMPONENT_CATALOG as bt, resolveAutoPanel as c, createDirectoryBundleResolver as ct, knowledgeReviewSchema as d, parseFrontmatter as dt, commitDesignProjectRecords as et, publishKnowledgeReview as f, parseKitMounts as ft, DESIGN_CORE_CLARITY_RUBRIC_PROMPT as g, reviewSupportOf as gt, DESIGN_CLARITY_OUTPUT_SCHEMA as h, designOntologyCoverage as ht, writeDesignReviewPolicy as i, latestInstalledKit as it, validateSkillDesign as j, require_dist as jt, deriveCurrentDesignExecutionGate as k, parseSchemaYaml as kt, retainResolvedAutoPanel as l, loadDesignBundle as lt, readAdvisoryDesignKnowledge as m, resolveDesignKitPackage as mt, DesignReviewPublicationQueue as n, ProjectContentMigration as nt, publishAutoPanelComponents as o, projectKitContentHash as ot, splitKnowledgeReviewResult as p, parseMindsetSkillNames as pt, readPublishedDesignKnowledge as q, readDesignReviewPolicy as r, composeProjectKit as rt, assertResolvedAutoPanelSave as s, sameProjectContentPin as st, DesignContinuousReviewClock as t, DesignProjectRegistry as tt, knowledgeReviewGuidance as u, loadDesignKit as ut, DESIGN_WORKER_EVIDENCE_GUIDANCE as v, COMPONENT_KINDS as vt, renderAdvisoryReviewMemory as w, removeConfinedFile as wt, knowledgeReadResult as x, requireDesignFileRelativePath as xt, KNOWLEDGE_AGENTIC_GUIDANCE as y, GENERATED_COMPONENT_KINDS as yt, parseDesignClarityInput as z, designProjectRecordsRoot as zt };
21159
+ export { storedKnowledgeGraph as $, validateSkillDesign as A, writeConfinedText as At, writeDesignClarityAuthority as B, designProjectRecordsRoot as Bt, DesignAdvisoryJournal as C, PANEL_COMPONENT_CATALOG as Ct, OFFICIAL_REFLECTION_PROFILE as D, removeConfinedFile as Dt, OFFICIAL_GROUNDING_PROFILE as E, readConfinedText as Et, pendingMustEditAuthorityForSave as F, DesignProjectManager as Ft, parseDesignCommand as G, designClarityInputMatches as H, DesignExecutionHandoffJournal as I, nodeDesignProjectSpawn as It, saveDesignKnowledgeRecords as J, runDesignProjectCommand as K, DesignJournalStorage as L, DesignBundleVersion as Lt, applyPanelEdit as M, parseSchemaYaml as Mt, buildPanelSaveNote as N, validatorFromSchemaYaml as Nt, officialAdvisoryProfile as O, resolveConfinedFilePath as Ot, parsePanelArtifacts as P, require_dist as Pt, refreshDesignKnowledge as Q, readCommittedDesignClarityAuthority as R, DesignKitVersion as Rt, queryKnowledgeSnapshot as S, GENERATED_COMPONENT_KINDS as St, OFFICIAL_ALIGNMENT_PROFILE as T, readConfinedBytes as Tt, parseDesignClarityInput as U, designClarityDigest as V, parseDesignClarityReported as W, readDesignKnowledgePublication as X, advanceDesignKnowledgePublication as Y, readPublishedDesignKnowledge as Z, DESIGN_EXECUTOR_EVIDENCE_GUIDANCE as _, resolveDesignKitPackage as _t, autoPanelGenerationPrompt as a, ensureProjectKit as at, knowledgeQueryFilters as b, resolveSemanticCapability as bt, resolveAutoPanel as c, projectBundleOverrides as ct, knowledgeReviewSchema as d, createDirectoryBundleResolver as dt, readSourceDesignKnowledge as et, publishKnowledgeReview as f, loadDesignBundle as ft, DESIGN_CORE_CLARITY_RUBRIC_PROMPT as g, parseMindsetSkillNames as gt, DESIGN_CLARITY_OUTPUT_SCHEMA as h, parseKitMounts as ht, writeDesignReviewPolicy as i, DesignProjectRegistry as it, DESIGN_PANEL_SAVE_ASSESSMENT_GUIDANCE as j, compileSchema as jt, deriveCurrentDesignExecutionGate as k, writeConfinedBytes as kt, retainResolvedAutoPanel as l, projectKitContentHash as lt, readAdvisoryDesignKnowledge as m, parseFrontmatter as mt, DesignReviewPublicationQueue as n, DesignKnowledgeRevision as nt, publishAutoPanelComponents as o, DesignContentStore as ot, splitKnowledgeReviewResult as p, loadDesignKit as pt, restoreDesignKnowledgeRecords as q, readDesignReviewPolicy as r, commitDesignProjectRecords as rt, assertResolvedAutoPanelSave as s, composeProjectKit as st, DesignContinuousReviewClock as t, readCompleteDesignKnowledge as tt, knowledgeReviewGuidance as u, sameProjectContentPin as ut, DESIGN_WORKER_EVIDENCE_GUIDANCE as v, designOntologyCoverage as vt, renderAdvisoryReviewMemory as w, requireDesignFileRelativePath as wt, knowledgeReadResult as x, queryPanelAuthoringReference as xt, KNOWLEDGE_AGENTIC_GUIDANCE as y, reviewSupportOf as yt, readDesignClarityAuthority as z, GitVersioning as zt };