@uipath/skills 1.196.0 → 1.197.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 (592) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +5 -2
  3. package/CODEOWNERS +22 -7
  4. package/README.md +14 -1
  5. package/assets/skill-status.json +14 -1
  6. package/assets/uip-catalog-snapshot.json +13 -2
  7. package/hooks/hooks.json +12 -0
  8. package/hooks/send-telemetry.sh +445 -0
  9. package/hooks/suggest-permissions.sh +6 -0
  10. package/package.json +1 -1
  11. package/skills/uipath-admin/SKILL.md +24 -4
  12. package/skills/uipath-admin/references/audit-commands.md +25 -21
  13. package/skills/uipath-admin/references/audit-workflow-guide.md +26 -25
  14. package/skills/uipath-admin/references/diagnose/CAPABILITY.md +74 -0
  15. package/skills/uipath-admin/references/diagnose/references/failure-modes.md +228 -0
  16. package/skills/uipath-admin/references/diagnose/references/troubleshooting-guide.md +106 -0
  17. package/skills/uipath-admin/references/identity-troubleshoot-guide.md +251 -0
  18. package/skills/uipath-agents/SKILL.md +12 -8
  19. package/skills/uipath-agents/references/coded/capabilities/context-grounding.md +2 -0
  20. package/skills/uipath-agents/references/coded/capabilities/conversational-agents.md +2 -0
  21. package/skills/uipath-agents/references/coded/capabilities/guardrails/guardrails-recommend.md +12 -7
  22. package/skills/uipath-agents/references/coded/capabilities/guardrails/guardrails.md +141 -1
  23. package/skills/uipath-agents/references/coded/capabilities/human-in-the-loop.md +2 -0
  24. package/skills/uipath-agents/references/coded/capabilities/integration-service.md +19 -33
  25. package/skills/uipath-agents/references/coded/lifecycle/bindings-reference.md +54 -22
  26. package/skills/uipath-agents/references/coded/lifecycle/build.md +1 -0
  27. package/skills/uipath-agents/references/coded/lifecycle/evaluations/evaluation-sets.md +5 -1
  28. package/skills/uipath-agents/references/coded/lifecycle/setup.md +3 -1
  29. package/skills/uipath-agents/references/coded/quickstart.md +11 -10
  30. package/skills/uipath-agents/references/coded-vs-lowcode-guide.md +1 -0
  31. package/skills/uipath-agents/references/context-grounding-patterns.md +1 -1
  32. package/skills/uipath-agents/references/lowcode/agent-definition.md +97 -12
  33. package/skills/uipath-agents/references/lowcode/capabilities/built-in-tools/analyze-attachments.md +2 -2
  34. package/skills/uipath-agents/references/lowcode/capabilities/built-in-tools/batch-transform/impl-json.md +40 -14
  35. package/skills/uipath-agents/references/lowcode/capabilities/built-in-tools/built-in-tools.md +4 -3
  36. package/skills/uipath-agents/references/lowcode/capabilities/built-in-tools/deeprag/impl-json.md +38 -6
  37. package/skills/uipath-agents/references/lowcode/capabilities/context/attachments.md +1 -1
  38. package/skills/uipath-agents/references/lowcode/capabilities/context/context.md +1 -1
  39. package/skills/uipath-agents/references/lowcode/capabilities/context/datafabric.md +1 -1
  40. package/skills/uipath-agents/references/lowcode/capabilities/context/index.md +7 -3
  41. package/skills/uipath-agents/references/lowcode/capabilities/escalation/escalation.md +49 -38
  42. package/skills/uipath-agents/references/lowcode/capabilities/guardrails/guardrails-recommend.md +3 -1
  43. package/skills/uipath-agents/references/lowcode/capabilities/guardrails/guardrails.md +49 -49
  44. package/skills/uipath-agents/references/lowcode/capabilities/inline-in-flow/inline-in-flow.md +34 -14
  45. package/skills/uipath-agents/references/lowcode/capabilities/integration-service/integration-service.md +1 -1
  46. package/skills/uipath-agents/references/lowcode/capabilities/memory/memory.md +2 -0
  47. package/skills/uipath-agents/references/lowcode/capabilities/process/process.md +2 -2
  48. package/skills/uipath-agents/references/lowcode/capabilities/process/solution-files.md +1 -1
  49. package/skills/uipath-agents/references/lowcode/critical-rules/autonomous-critical-rules.md +15 -0
  50. package/skills/uipath-agents/references/lowcode/critical-rules/conversational-critical-rules.md +19 -0
  51. package/skills/uipath-agents/references/lowcode/{critical-rules.md → critical-rules/critical-rules.md} +25 -27
  52. package/skills/uipath-agents/references/lowcode/debug.md +6 -3
  53. package/skills/uipath-agents/references/lowcode/evaluations/evaluate.md +2 -0
  54. package/skills/uipath-agents/references/lowcode/lowcode.md +29 -6
  55. package/skills/uipath-agents/references/lowcode/model-selection-guide.md +4 -1
  56. package/skills/uipath-agents/references/lowcode/project-lifecycle.md +20 -8
  57. package/skills/uipath-agents/references/lowcode/prompting/agent-prompting-guide.md +17 -0
  58. package/skills/uipath-agents/references/lowcode/{agent-prompting-guide.md → prompting/autonomous-agent-prompting-guide.md} +9 -11
  59. package/skills/uipath-agents/references/lowcode/prompting/conversational-agent-prompting-guide.md +123 -0
  60. package/skills/uipath-agents/references/lowcode/solution-resources.md +1 -1
  61. package/skills/uipath-api-workflow/SKILL.md +32 -12
  62. package/skills/uipath-api-workflow/references/cli-reference.md +110 -22
  63. package/skills/uipath-api-workflow/references/connector-activity-discovery.md +43 -4
  64. package/skills/uipath-api-workflow/references/troubleshooting.md +23 -7
  65. package/skills/uipath-api-workflow/references/workflow-file-format.md +25 -7
  66. package/skills/uipath-coded-apps/SKILL.md +55 -12
  67. package/skills/uipath-coded-apps/assets/fixtures/governance-dashboard-starter-kit.tar.gz +0 -0
  68. package/skills/uipath-coded-apps/assets/scripts/dashboards/build-dashboard.mjs +1371 -0
  69. package/skills/uipath-coded-apps/assets/scripts/dashboards/capability-registry.json +845 -0
  70. package/skills/uipath-coded-apps/assets/scripts/dashboards/flows/build.mjs +338 -0
  71. package/skills/uipath-coded-apps/assets/scripts/dashboards/flows/edit.mjs +248 -0
  72. package/skills/uipath-coded-apps/assets/scripts/dashboards/flows/template.mjs +82 -0
  73. package/skills/uipath-coded-apps/assets/scripts/dashboards/flows/upgrade.mjs +73 -0
  74. package/skills/uipath-coded-apps/assets/scripts/dashboards/lifecycle.mjs +207 -0
  75. package/skills/uipath-coded-apps/assets/scripts/dashboards/setup-admin-folder.mjs +146 -0
  76. package/skills/uipath-coded-apps/assets/scripts/dashboards/tests/regime-eject.test.mjs +124 -0
  77. package/skills/uipath-coded-apps/assets/scripts/dashboards/tests/resolution.test.mjs +1635 -0
  78. package/skills/uipath-coded-apps/assets/templates/action-app/app-template.css +9 -0
  79. package/skills/uipath-coded-apps/assets/templates/action-app/document-tab-template.css +139 -0
  80. package/skills/uipath-coded-apps/assets/templates/action-app/form-template.css +442 -0
  81. package/skills/uipath-coded-apps/assets/templates/action-app/index-template.css +111 -0
  82. package/skills/uipath-coded-apps/assets/templates/action-app-template.md +357 -152
  83. package/skills/uipath-coded-apps/assets/templates/web-app-template.md +255 -78
  84. package/skills/uipath-coded-apps/references/create-action-app.md +284 -195
  85. package/skills/uipath-coded-apps/references/create-web-app.md +64 -26
  86. package/skills/uipath-coded-apps/references/dashboards/CAPABILITY.md +179 -0
  87. package/skills/uipath-coded-apps/references/dashboards/aesthetic/charting.md +138 -0
  88. package/skills/uipath-coded-apps/references/dashboards/aesthetic/layout-patterns.md +152 -0
  89. package/skills/uipath-coded-apps/references/dashboards/plugins/build/impl.md +423 -0
  90. package/skills/uipath-coded-apps/references/dashboards/plugins/deploy/impl.md +322 -0
  91. package/skills/uipath-coded-apps/references/dashboards/primitives/customization.md +66 -0
  92. package/skills/uipath-coded-apps/references/dashboards/primitives/detail-views.md +64 -0
  93. package/skills/uipath-coded-apps/references/dashboards/primitives/incremental-editor.md +92 -0
  94. package/skills/uipath-coded-apps/references/dashboards/primitives/state-file.md +64 -0
  95. package/skills/uipath-coded-apps/references/dashboards/primitives/tier-resolution.md +474 -0
  96. package/skills/uipath-coded-apps/references/debug.md +15 -21
  97. package/skills/uipath-coded-apps/references/oauth-client-setup.md +5 -5
  98. package/skills/uipath-coded-apps/references/oauth-scopes.md +64 -2
  99. package/skills/uipath-coded-apps/references/pack-publish-deploy.md +12 -5
  100. package/skills/uipath-coded-apps/references/patterns.md +10 -5
  101. package/skills/uipath-coded-apps/references/sdk/action-center.md +32 -6
  102. package/skills/uipath-coded-apps/references/sdk/agents.md +241 -0
  103. package/skills/uipath-coded-apps/references/sdk/governance-traces.md +186 -0
  104. package/skills/uipath-coded-apps/references/sdk/governance.md +72 -0
  105. package/skills/uipath-coded-apps/references/sdk/imports.md +4 -0
  106. package/skills/uipath-coded-apps/references/sdk/maestro.md +114 -0
  107. package/skills/uipath-coded-apps/references/sdk/orchestrator.md +80 -4
  108. package/skills/uipath-coded-apps/references/sdk/pagination.md +2 -0
  109. package/skills/uipath-coded-apps/references/sdk/traces.md +89 -0
  110. package/skills/uipath-coded-apps/references/widgets/validation-station.md +308 -0
  111. package/skills/uipath-coded-apps/scripts/validate-action-schema.js +241 -0
  112. package/skills/uipath-connector-builder/SKILL.md +192 -0
  113. package/skills/uipath-connector-builder/references/auth.md +171 -0
  114. package/skills/uipath-connector-builder/references/configuration.md +130 -0
  115. package/skills/uipath-connector-builder/references/debugging.md +80 -0
  116. package/skills/uipath-connector-builder/references/element-json.md +148 -0
  117. package/skills/uipath-connector-builder/references/events.md +132 -0
  118. package/skills/uipath-connector-builder/references/hooks.md +198 -0
  119. package/skills/uipath-connector-builder/references/overview.md +78 -0
  120. package/skills/uipath-connector-builder/references/standard-resources.md +111 -0
  121. package/skills/uipath-connector-builder/references/system-resources.md +85 -0
  122. package/skills/uipath-feedback/SKILL.md +43 -29
  123. package/skills/{uipath-agents/references/coded/frameworks/coded-functions.md → uipath-functions/SKILL.md} +36 -23
  124. package/skills/uipath-governance/SKILL.md +49 -8
  125. package/skills/uipath-governance/references/aops-policy/aops-policy-commands.md +10 -10
  126. package/skills/uipath-governance/references/aops-policy/aops-policy-deploy-guide.md +7 -7
  127. package/skills/uipath-governance/references/auth-context.md +101 -0
  128. package/skills/uipath-governance/references/cli-cheatsheet.md +207 -0
  129. package/skills/uipath-governance/references/compliance-pack/catalog/impl.md +79 -0
  130. package/skills/uipath-governance/references/compliance-pack/coverage/impl.md +141 -0
  131. package/skills/uipath-governance/references/compliance-pack/disable/impl.md +39 -0
  132. package/skills/uipath-governance/references/compliance-pack/full-apply/impl.md +164 -0
  133. package/skills/uipath-governance/references/compliance-pack/partial-apply/impl.md +266 -0
  134. package/skills/uipath-governance/references/compliance-pack/partial-apply/merge-overrides-guide.md +28 -0
  135. package/skills/uipath-governance/references/compliance-pack/partial-apply/planning.md +82 -0
  136. package/skills/uipath-governance/references/compliance-pack/partial-apply/synthesize-formdata-guide.md +22 -0
  137. package/skills/uipath-governance/references/compliance-pack/preview-gate.md +43 -0
  138. package/skills/uipath-governance/references/compliance-pack/query/impl.md +75 -0
  139. package/skills/uipath-governance/references/diagnose/CAPABILITY.md +71 -0
  140. package/skills/uipath-governance/references/diagnose/references/failure-modes.md +201 -0
  141. package/skills/uipath-governance/references/diagnose/references/troubleshooting-guide.md +137 -0
  142. package/skills/uipath-governance/references/disambiguation-guide.md +15 -0
  143. package/skills/uipath-governance/scripts/merge-overrides.mjs +81 -0
  144. package/skills/uipath-governance/scripts/synthesize-formdata.mjs +86 -0
  145. package/skills/uipath-human-in-the-loop/SKILL.md +30 -25
  146. package/skills/uipath-human-in-the-loop/references/hitl-node-apptask.md +38 -4
  147. package/skills/uipath-human-in-the-loop/references/hitl-node-coded-action-app.md +2 -3
  148. package/skills/uipath-human-in-the-loop/references/hitl-node-quickform.md +92 -34
  149. package/skills/uipath-ixp/SKILL.md +120 -0
  150. package/skills/uipath-ixp/references/cli-reference.md +121 -0
  151. package/skills/uipath-ixp/references/improve-prompts-guide.md +283 -0
  152. package/skills/uipath-ixp/references/label-documents-guide.md +207 -0
  153. package/skills/uipath-ixp/references/project-setup-guide.md +90 -0
  154. package/skills/uipath-maestro-bpmn/SKILL.md +167 -68
  155. package/skills/uipath-maestro-bpmn/references/cli-conventions.md +47 -0
  156. package/skills/uipath-maestro-bpmn/references/diagnose/CAPABILITY.md +6 -6
  157. package/skills/uipath-maestro-bpmn/references/operate/CAPABILITY.md +3 -3
  158. package/skills/uipath-maestro-bpmn/references/registry-workflow.md +199 -0
  159. package/skills/uipath-maestro-bpmn/references/structural-bpmn.md +500 -0
  160. package/skills/uipath-maestro-bpmn/validator/README.md +214 -0
  161. package/skills/uipath-maestro-bpmn/validator/bpmn-spec.json +2477 -0
  162. package/skills/uipath-maestro-bpmn/validator/model.mjs +419 -0
  163. package/skills/uipath-maestro-bpmn/validator/package.json +17 -0
  164. package/skills/uipath-maestro-bpmn/validator/rules.mjs +1403 -0
  165. package/skills/uipath-maestro-bpmn/validator/samples/invalid-conditional-and-variable.bpmn +25 -0
  166. package/skills/uipath-maestro-bpmn/validator/samples/valid-baseline.bpmn +52 -0
  167. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/A.2.0.bpmn +157 -0
  168. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/A.2.1.bpmn +333 -0
  169. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/B.1.0.bpmn +598 -0
  170. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/B.2.0.bpmn +1709 -0
  171. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.2.0.bpmn +564 -0
  172. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.3.0.bpmn +671 -0
  173. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.4.0.bpmn +1045 -0
  174. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.5.0.bpmn +1176 -0
  175. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.6.0.bpmn +670 -0
  176. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.7.0.bpmn +466 -0
  177. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Can_Parse_Complex_Process_With_Task_Gateway_BoundaryEvent_etc.bpmn +74 -0
  178. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/ExclusiveGatewayDefaultFlow.bpmn +32 -0
  179. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/ExternalAgentWorkflow.bpmn +62 -0
  180. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Golden_Scenario.initial.bpmn +361 -0
  181. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/InclusiveJoinRouteAwayBranch.bpmn +62 -0
  182. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_AsyncExecution_And_Create_CorrectModel.bpmn +74 -0
  183. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_IXP_ExtractionValidation_And_Create_CorrectModel.bpmn +35 -0
  184. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_IXP_Extraction_FileUpload_And_Create_CorrectModel.bpmn +33 -0
  185. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_IXP_Extraction_JobAttachment_And_Create_CorrectModel.bpmn +35 -0
  186. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_SubProcess_With_Multiple_Element_Types.bpmn +76 -0
  187. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/StartEventWithOutputs.bpmn +36 -0
  188. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/StartGatewayEnd.bpmn +44 -0
  189. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/all elements.bpmn +516 -0
  190. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/all_sequence_flow_types.bpmn +173 -0
  191. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/demo.bpmn +181 -0
  192. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/subprocess-example-001-collapsed.bpmn +126 -0
  193. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/subprocess-example-001-expanded.bpmn +122 -0
  194. package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/subprocess-example-003-collapsed_deeply-nested.bpmn +438 -0
  195. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/A.1.0.bpmn +87 -0
  196. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/A.3.0.bpmn +165 -0
  197. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ApiWorkflow.bpmn +39 -0
  198. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/BpmnNestedSubProcessTests.bpmn +102 -0
  199. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/BpmnTimerBoundaryEvents.bpmn +160 -0
  200. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/BpmnXmlWithCatchAllErrorEventSubProcess.bpmn +45 -0
  201. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/BpmnXmlWithSpecificErrorEventSubProcess.bpmn +46 -0
  202. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/CaseManagementWithConstantIdentifier.bpmn +218 -0
  203. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ErrorBoundary.bpmn +78 -0
  204. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ErrorPropagationInEventSubprocess.bpmn +340 -0
  205. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/EventBasedGatewayFirstCatcherWins.bpmn +56 -0
  206. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Example-EventBasedGateway.bpmn +117 -0
  207. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ExclusiveGatewayConditional.bpmn +45 -0
  208. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ExclusiveGatewaySharedEndEvent.bpmn +45 -0
  209. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ExclusiveWithParallelGateway.bpmn +68 -0
  210. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/FourScriptTasks.bpmn +84 -0
  211. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/HitlTaskOnly.bpmn +55 -0
  212. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/InclusiveGatewayForkJoin.bpmn +69 -0
  213. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_BPMN_Elements_And_Create_CorrectModel.bpmn +20 -0
  214. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_HttpRequest_ServiceTask_And_Create_Correct_Model.bpmn +34 -0
  215. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_MessageBoundaryEvent_And_Create_CorrectModel.bpmn +87 -0
  216. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_Script_Task_V2_And_Create_Correct_Model.bpmn +31 -0
  217. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_Sets_Containers_Properly.bpmn +129 -0
  218. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ScriptWritesVariableThenGatewayBranches.bpmn +55 -0
  219. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/boundaryevent.bpmn +30 -0
  220. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/collapsed-subprocess.bpmn +83 -0
  221. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/connectable-types.bpmn +85 -0
  222. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/extensions-orchestrator-start-job.bpmn +80 -0
  223. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/multiparticipantpool.bpmn +77 -0
  224. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/nestedsubprocess.bpmn +36 -0
  225. package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/simple.bpmn +59 -0
  226. package/skills/uipath-maestro-bpmn/validator/test/integration.test.mjs +146 -0
  227. package/skills/uipath-maestro-bpmn/validator/test/model-helpers.mjs +42 -0
  228. package/skills/uipath-maestro-bpmn/validator/test/ported-rule-tests.mjs +983 -0
  229. package/skills/uipath-maestro-bpmn/validator/test/run-tests.mjs +530 -0
  230. package/skills/uipath-maestro-bpmn/validator/uipath-moddle.v1.json +715 -0
  231. package/skills/uipath-maestro-bpmn/validator/validate-bpmn.mjs +164 -0
  232. package/skills/uipath-maestro-case/SKILL.md +5 -1
  233. package/skills/uipath-maestro-case/assets/templates/sdd-template-examples.md +10 -0
  234. package/skills/uipath-maestro-case/assets/templates/sdd-template.md +89 -17
  235. package/skills/uipath-maestro-case/references/bindings-and-expressions.md +26 -0
  236. package/skills/uipath-maestro-case/references/case-editing-operations.md +3 -0
  237. package/skills/uipath-maestro-case/references/implementation.md +11 -4
  238. package/skills/uipath-maestro-case/references/phase-0-interview.md +8 -7
  239. package/skills/uipath-maestro-case/references/phased-execution.md +2 -1
  240. package/skills/uipath-maestro-case/references/plugins/conditions/stage-exit-conditions/impl-json.md +21 -0
  241. package/skills/uipath-maestro-case/references/plugins/conditions/stage-exit-conditions/planning.md +2 -0
  242. package/skills/uipath-maestro-case/references/plugins/variables/global-vars/impl-json.md +15 -9
  243. package/skills/uipath-maestro-case/references/plugins/variables/io-binding/impl-json.md +131 -4
  244. package/skills/uipath-maestro-case/references/sdd-generation-rules.md +94 -17
  245. package/skills/uipath-maestro-flow/references/author/CAPABILITY.md +1 -1
  246. package/skills/uipath-maestro-flow/references/author/references/planning-arch.md +2 -2
  247. package/skills/uipath-maestro-flow/references/author/references/plugins/hitl/impl.md +11 -11
  248. package/skills/uipath-maestro-flow/references/author/references/plugins/hitl/planning.md +6 -6
  249. package/skills/uipath-maestro-flow/references/author/references/plugins/http/impl-connector.md +4 -1
  250. package/skills/uipath-maestro-flow/references/author/references/plugins/inline-agent/impl.md +157 -122
  251. package/skills/uipath-maestro-flow/references/author/references/plugins/inline-agent/planning.md +16 -4
  252. package/skills/uipath-maestro-flow/references/evaluate/references/commands-reference.md +8 -8
  253. package/skills/uipath-maestro-flow/references/evaluate/references/running-guide.md +3 -3
  254. package/skills/uipath-maestro-flow/references/shared/cli-commands.md +1 -1
  255. package/skills/uipath-planner/SKILL.md +19 -8
  256. package/skills/uipath-planner/assets/templates/agent-sdd-template.md +14 -0
  257. package/skills/uipath-planner/assets/templates/api-workflow-sdd-template.md +14 -0
  258. package/skills/uipath-planner/assets/templates/case-sdd-template.md +14 -0
  259. package/skills/uipath-planner/assets/templates/coded-app-sdd-template.md +14 -0
  260. package/skills/uipath-planner/assets/templates/flow-sdd-template.md +14 -0
  261. package/skills/uipath-planner/assets/templates/rpa-sdd-template.md +40 -5
  262. package/skills/uipath-planner/references/asdd-crosswalk-guide.md +55 -0
  263. package/skills/uipath-planner/references/attended-reauth-pattern-guide.md +43 -0
  264. package/skills/uipath-planner/references/multi-skill-patterns-guide.md +4 -0
  265. package/skills/uipath-planner/references/non-pdd-lane-guide.md +2 -0
  266. package/skills/uipath-planner/references/pdd-analysis-guide.md +24 -1
  267. package/skills/uipath-planner/references/pdd-driven-lane-guide.md +6 -2
  268. package/skills/uipath-planner/references/plan-and-tasks-format.md +2 -0
  269. package/skills/uipath-planner/references/platform-availability-guide.md +43 -0
  270. package/skills/uipath-planner/references/product-selection-guide.md +20 -0
  271. package/skills/uipath-planner/references/sdd-generation-guide.md +90 -21
  272. package/skills/uipath-planner/references/tenant-library-search-guide.md +5 -1
  273. package/skills/uipath-planner/scripts/docx-extract.sh +54 -0
  274. package/skills/uipath-planner/scripts/sdd-to-docx.sh +76 -0
  275. package/skills/uipath-platform/SKILL.md +54 -7
  276. package/skills/uipath-platform/references/context-grounding/index-management.md +123 -0
  277. package/skills/uipath-platform/references/data-fabric/bulk-import.md +86 -0
  278. package/skills/{uipath-data-fabric/references → uipath-platform/references/data-fabric}/choice-sets.md +33 -12
  279. package/skills/uipath-platform/references/data-fabric/data-fabric.md +352 -0
  280. package/skills/uipath-platform/references/data-fabric/entity-schema.md +444 -0
  281. package/skills/uipath-platform/references/data-fabric/file-attachments.md +122 -0
  282. package/skills/{uipath-data-fabric/references → uipath-platform/references/data-fabric}/filter-platform-contract.md +3 -3
  283. package/skills/{uipath-data-fabric/references → uipath-platform/references/data-fabric}/records-query.md +46 -10
  284. package/skills/uipath-platform/references/integration-service/http-request.md +15 -1
  285. package/skills/uipath-platform/references/integration-service/vendor-docs-registry.json +173 -0
  286. package/skills/uipath-platform/references/uip-commands.md +12 -4
  287. package/skills/uipath-review/SKILL.md +53 -12
  288. package/skills/uipath-review/references/agents/agent-common-issues.md +1 -1
  289. package/skills/uipath-review/references/agents/agent-grading-rubric.md +133 -0
  290. package/skills/uipath-review/references/agents/agent-review-checklist.md +23 -3
  291. package/skills/uipath-review/references/agents/agents-coded-rules.md +7 -0
  292. package/skills/uipath-review/references/agents/agents-lowcode-rules.md +13 -3
  293. package/skills/uipath-review/references/agents/guardrails/guardrails-review.md +198 -0
  294. package/skills/uipath-review/references/architecture-assessment-guide.md +2 -0
  295. package/skills/uipath-review/references/review-workflow-guide.md +9 -5
  296. package/skills/uipath-review/references/rule-catalog-workflow.md +3 -3
  297. package/skills/uipath-rpa/SKILL.md +18 -6
  298. package/skills/uipath-rpa/references/cli-reference.md +57 -3
  299. package/skills/uipath-rpa/references/common-activity-card.md +1 -1
  300. package/skills/uipath-rpa/references/connector-capabilities.md +2 -0
  301. package/skills/uipath-rpa/references/data-manipulation-guide.md +311 -0
  302. package/skills/uipath-rpa/references/environment-setup.md +0 -2
  303. package/skills/uipath-rpa/references/error-handling-guide.md +381 -0
  304. package/skills/uipath-rpa/references/is-connector-xaml-guide.md +127 -11
  305. package/skills/uipath-rpa/references/reframework-guide.md +2 -0
  306. package/skills/uipath-rpa/references/testing-guide.md +19 -0
  307. package/skills/uipath-rpa/references/ui-automation-guide.md +129 -18
  308. package/skills/uipath-rpa/references/uia-configure-target-workflows.md +22 -1
  309. package/skills/uipath-rpa/references/uia-elements-interaction-guide.md +93 -0
  310. package/skills/uipath-rpa/references/xaml/canvas-layout-guide.md +41 -4
  311. package/skills/uipath-rpa/references/xaml/common-pitfalls.md +12 -3
  312. package/skills/uipath-rpa/references/xaml/flowchart-guide.md +113 -0
  313. package/skills/uipath-rpa/references/xaml/xaml-basics-and-rules.md +5 -9
  314. package/skills/uipath-solution/SKILL.md +11 -8
  315. package/skills/uipath-solution/references/pack-and-deploy.md +18 -1
  316. package/skills/uipath-solution/references/solution-overview.md +3 -0
  317. package/skills/uipath-test/SKILL.md +2 -1
  318. package/skills/uipath-troubleshoot/SKILL.md +24 -26
  319. package/skills/uipath-troubleshoot/agents/depth-verifier.md +24 -25
  320. package/skills/uipath-troubleshoot/agents/hypothesis-generator.md +8 -4
  321. package/skills/uipath-troubleshoot/agents/hypothesis-tester.md +85 -38
  322. package/skills/uipath-troubleshoot/agents/presenter.md +7 -7
  323. package/skills/uipath-troubleshoot/agents/scope-checker.md +3 -6
  324. package/skills/uipath-troubleshoot/agents/shared.md +26 -21
  325. package/skills/uipath-troubleshoot/agents/triage.md +117 -49
  326. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/investigation_guide.md +43 -0
  327. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/overview.md +57 -0
  328. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/playbooks/cv-action-failed-after-find.md +100 -0
  329. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/playbooks/cv-cell-targeting-failures.md +111 -0
  330. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/playbooks/cv-element-not-found.md +125 -0
  331. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/playbooks/cv-get-text-empty-or-wrong-result.md +117 -0
  332. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/playbooks/cv-invalid-descriptor.md +102 -0
  333. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/playbooks/cv-scope-setup-failures.md +136 -0
  334. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/playbooks/cv-scroll-search-failures.md +114 -0
  335. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/playbooks/cv-server-auth-throttling-network.md +95 -0
  336. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/playbooks/cv-silent-failures-and-false-results.md +124 -0
  337. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/presentation.md +8 -0
  338. package/skills/uipath-troubleshoot/references/activity-packages/cv-activities/summary.md +15 -0
  339. package/skills/uipath-troubleshoot/references/activity-packages/database-activities/investigation_guide.md +42 -0
  340. package/skills/uipath-troubleshoot/references/activity-packages/database-activities/overview.md +41 -0
  341. package/skills/uipath-troubleshoot/references/activity-packages/database-activities/playbooks/connect-to-database-failures.md +104 -0
  342. package/skills/uipath-troubleshoot/references/activity-packages/database-activities/playbooks/execute-non-query-failures.md +97 -0
  343. package/skills/uipath-troubleshoot/references/activity-packages/database-activities/playbooks/execute-query-failures.md +134 -0
  344. package/skills/uipath-troubleshoot/references/activity-packages/database-activities/playbooks/start-transaction-failures.md +94 -0
  345. package/skills/uipath-troubleshoot/references/activity-packages/database-activities/presentation.md +10 -0
  346. package/skills/uipath-troubleshoot/references/activity-packages/database-activities/summary.md +10 -0
  347. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/investigation_guide.md +27 -9
  348. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/overview.md +51 -10
  349. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/playbooks/append-range-failures.md +146 -0
  350. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/playbooks/delete-range-failures.md +126 -0
  351. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/playbooks/excel-application-card-failures.md +139 -0
  352. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/playbooks/excel-application-scope-failures.md +118 -0
  353. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/playbooks/execute-macro-failures.md +149 -0
  354. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/playbooks/write-range-failures.md +145 -0
  355. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/presentation.md +12 -7
  356. package/skills/uipath-troubleshoot/references/activity-packages/excel-activities/summary.md +6 -0
  357. package/skills/uipath-troubleshoot/references/activity-packages/gsuite-activities/investigation_guide.md +1 -0
  358. package/skills/uipath-troubleshoot/references/activity-packages/gsuite-activities/overview.md +12 -4
  359. package/skills/uipath-troubleshoot/references/activity-packages/gsuite-activities/playbooks/connection-and-auth-failures.md +55 -0
  360. package/skills/uipath-troubleshoot/references/activity-packages/gsuite-activities/playbooks/drive-file-not-found.md +18 -10
  361. package/skills/uipath-troubleshoot/references/activity-packages/gsuite-activities/playbooks/get-newest-email-not-found.md +9 -8
  362. package/skills/uipath-troubleshoot/references/activity-packages/gsuite-activities/playbooks/invalid-or-null-input.md +68 -0
  363. package/skills/uipath-troubleshoot/references/activity-packages/gsuite-activities/playbooks/transient-and-timeout-errors.md +52 -0
  364. package/skills/uipath-troubleshoot/references/activity-packages/gsuite-activities/playbooks/upload-storage-quota-exceeded.md +1 -1
  365. package/skills/uipath-troubleshoot/references/activity-packages/gsuite-activities/summary.md +5 -2
  366. package/skills/uipath-troubleshoot/references/activity-packages/mail-activities/overview.md +28 -0
  367. package/skills/uipath-troubleshoot/references/activity-packages/mail-activities/playbooks/delete-outlook-mail-failures.md +105 -0
  368. package/skills/uipath-troubleshoot/references/activity-packages/mail-activities/playbooks/get-outlook-mail-failures.md +109 -0
  369. package/skills/uipath-troubleshoot/references/activity-packages/mail-activities/playbooks/move-outlook-mail-failures.md +97 -0
  370. package/skills/uipath-troubleshoot/references/activity-packages/mail-activities/playbooks/send-outlook-mail-failures.md +95 -0
  371. package/skills/uipath-troubleshoot/references/activity-packages/mail-activities/summary.md +8 -0
  372. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/investigation_guide.md +23 -0
  373. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/overview.md +9 -0
  374. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/application-scope-misconfigured.md +49 -0
  375. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/authentication-token-invalid.md +53 -0
  376. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/copy-item-argument-null.md +34 -0
  377. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/create-folder-invalid-path.md +36 -0
  378. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/download-file-conversion-or-destination.md +40 -0
  379. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/drive-item-not-found.md +1 -1
  380. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/email-trigger-connection-event-failure.md +45 -0
  381. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/insufficient-graph-scope.md +44 -0
  382. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/legacy-mail-null-reference.md +43 -0
  383. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/mail-folder-not-found.md +4 -3
  384. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/mail-invalid-odata-query.md +43 -0
  385. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/mail-message-not-found.md +45 -0
  386. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/request-throttled.md +45 -0
  387. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/send-mail-rejected.md +52 -0
  388. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/transient-service-error.md +48 -0
  389. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/playbooks/upload-file-quota-or-size.md +47 -0
  390. package/skills/uipath-troubleshoot/references/activity-packages/o365-activities/summary.md +15 -1
  391. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/investigation_guide.md +32 -0
  392. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/overview.md +38 -0
  393. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/playbooks/invoke-method-failures.md +57 -0
  394. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/playbooks/invoke-python-method-pipe-is-broken.md +44 -0
  395. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/playbooks/load-script-failures.md +62 -0
  396. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/playbooks/python-path-not-valid.md +39 -0
  397. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/playbooks/python-scope-architecture-version-mismatch.md +41 -0
  398. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/playbooks/working-folder-relative-path.md +34 -0
  399. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/presentation.md +9 -0
  400. package/skills/uipath-troubleshoot/references/activity-packages/python-activities/summary.md +12 -0
  401. package/skills/uipath-troubleshoot/references/activity-packages/system-activities/playbooks/get-asset-activity-bug-silent-failure.md +1 -1
  402. package/skills/uipath-troubleshoot/references/activity-packages/system-activities/playbooks/get-asset-robot-not-authenticated.md +29 -22
  403. package/skills/uipath-troubleshoot/references/activity-packages/system-activities/summary.md +1 -1
  404. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/investigation_guide.md +30 -0
  405. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/overview.md +36 -0
  406. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/deserialize-malformed-input.md +36 -0
  407. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/deserialize-null-input.md +35 -0
  408. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/deserialize-type-mismatch.md +40 -0
  409. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/http-client-null-reference.md +34 -0
  410. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/http-request-connection-failure.md +48 -0
  411. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/http-request-timeout.md +40 -0
  412. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/net-http-request-aggregate-failure.md +38 -0
  413. package/skills/uipath-troubleshoot/references/activity-packages/web-activities/summary.md +13 -0
  414. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/investigation_guide.md +55 -0
  415. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/overview.md +82 -0
  416. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/add-picture-failures.md +51 -0
  417. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/append-text-missing-container.md +31 -0
  418. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/append-text-zero-byte-file.md +32 -0
  419. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/export-pdf-com-hang.md +46 -0
  420. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/export-pdf-missing-output-dir.md +32 -0
  421. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/export-pdf-output-path-format.md +35 -0
  422. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/read-text-doc-format.md +30 -0
  423. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/read-text-missing-container.md +29 -0
  424. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/read-text-protected-view.md +32 -0
  425. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/replace-text-com-busy.md +35 -0
  426. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/replace-text-file-locked.md +33 -0
  427. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/replace-text-headers-textboxes-skipped.md +30 -0
  428. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/replace-text-length-limit.md +30 -0
  429. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/replace-text-loop-template-overwrite.md +31 -0
  430. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/replace-text-multiline-formatting.md +31 -0
  431. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/replace-text-silent-no-substitution.md +32 -0
  432. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/replace-text-version-mismatch.md +30 -0
  433. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/word-com-interop-failures.md +52 -0
  434. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/word-com-start-background-session0.md +50 -0
  435. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/word-export-pdf-com-wrong-thread.md +46 -0
  436. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/word-open-sharepoint-url-com-command-failed.md +45 -0
  437. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/word-scope-cannot-create-unknown-type.md +30 -0
  438. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/word-scope-com-not-installed.md +35 -0
  439. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/word-scope-file-corrupted.md +34 -0
  440. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/word-scope-file-path-not-found.md +36 -0
  441. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/playbooks/word-scope-hangs-background-prompt.md +34 -0
  442. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/presentation.md +11 -0
  443. package/skills/uipath-troubleshoot/references/activity-packages/word-activities/summary.md +38 -0
  444. package/skills/uipath-troubleshoot/references/products/integration-service/investigation_guide.md +9 -0
  445. package/skills/uipath-troubleshoot/references/products/integration-service/overview.md +7 -0
  446. package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/connection-invalid.md +9 -0
  447. package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/connector-aggregate-exception.md +30 -0
  448. package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/connector-general-exception.md +43 -0
  449. package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/connector-null-reference.md +36 -0
  450. package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/connector-remote-exception.md +31 -0
  451. package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/connector-runtime-exception.md +40 -0
  452. package/skills/uipath-troubleshoot/references/products/integration-service/summary.md +5 -0
  453. package/skills/uipath-troubleshoot/references/products/maestro/investigation_guide.md +2 -1
  454. package/skills/uipath-troubleshoot/references/products/orchestrator/investigation_guide.md +105 -10
  455. package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/job-faulted-logon-failure.md +1 -1
  456. package/skills/uipath-troubleshoot/references/summary.md +59 -3
  457. package/skills/uipath-troubleshoot/schemas/evidence.schema.md +48 -0
  458. package/skills/uipath-troubleshoot/schemas/hypotheses.schema.md +22 -7
  459. package/skills/uipath-troubleshoot/schemas/scope-check.schema.md +1 -1
  460. package/skills/uipath-troubleshoot/schemas/state.schema.md +81 -6
  461. package/version-manifest.json +2 -2
  462. package/skills/uipath-data-fabric/SKILL.md +0 -239
  463. package/skills/uipath-data-fabric/references/bulk-import.md +0 -73
  464. package/skills/uipath-data-fabric/references/entity-schema.md +0 -391
  465. package/skills/uipath-data-fabric/references/file-attachments.md +0 -65
  466. package/skills/uipath-maestro-bpmn/.maintenance/README.md +0 -241
  467. package/skills/uipath-maestro-bpmn/.maintenance/check-all.sh +0 -41
  468. package/skills/uipath-maestro-bpmn/.maintenance/check-anchors.sh +0 -83
  469. package/skills/uipath-maestro-bpmn/.maintenance/check-depth.sh +0 -132
  470. package/skills/uipath-maestro-bpmn/.maintenance/check-link-text.sh +0 -123
  471. package/skills/uipath-maestro-bpmn/.maintenance/check-links.sh +0 -70
  472. package/skills/uipath-maestro-bpmn/.maintenance/check-orphans.sh +0 -93
  473. package/skills/uipath-maestro-bpmn/.maintenance/check-plugin-pairs.sh +0 -39
  474. package/skills/uipath-maestro-bpmn/.maintenance/check-real-pack.sh +0 -79
  475. package/skills/uipath-maestro-bpmn/.maintenance/check-template.sh +0 -42
  476. package/skills/uipath-maestro-bpmn/.maintenance/check-uip-commands.sh +0 -266
  477. package/skills/uipath-maestro-bpmn/.maintenance/check-validation-fixtures.py +0 -1255
  478. package/skills/uipath-maestro-bpmn/.maintenance/check-validation-fixtures.sh +0 -8
  479. package/skills/uipath-maestro-bpmn/fixtures/validation/README.md +0 -94
  480. package/skills/uipath-maestro-bpmn/fixtures/validation/agent-invocation/agent-invocation.bpmn +0 -62
  481. package/skills/uipath-maestro-bpmn/fixtures/validation/agent-invocation/bindings_v2.json +0 -37
  482. package/skills/uipath-maestro-bpmn/fixtures/validation/agent-invocation/entry-points.json +0 -21
  483. package/skills/uipath-maestro-bpmn/fixtures/validation/agent-invocation/operate.json +0 -9
  484. package/skills/uipath-maestro-bpmn/fixtures/validation/agent-invocation/package-descriptor.json +0 -10
  485. package/skills/uipath-maestro-bpmn/fixtures/validation/agent-invocation/project.uiproj +0 -7
  486. package/skills/uipath-maestro-bpmn/fixtures/validation/contract-variants/bindings_v2.json +0 -68
  487. package/skills/uipath-maestro-bpmn/fixtures/validation/contract-variants/contract-variants.bpmn +0 -270
  488. package/skills/uipath-maestro-bpmn/fixtures/validation/contract-variants/entry-points.json +0 -25
  489. package/skills/uipath-maestro-bpmn/fixtures/validation/contract-variants/operate.json +0 -9
  490. package/skills/uipath-maestro-bpmn/fixtures/validation/contract-variants/package-descriptor.json +0 -10
  491. package/skills/uipath-maestro-bpmn/fixtures/validation/contract-variants/project.uiproj +0 -7
  492. package/skills/uipath-maestro-bpmn/fixtures/validation/gateway-boundary-error/bindings_v2.json +0 -19
  493. package/skills/uipath-maestro-bpmn/fixtures/validation/gateway-boundary-error/entry-points.json +0 -25
  494. package/skills/uipath-maestro-bpmn/fixtures/validation/gateway-boundary-error/gateway-boundary-error.bpmn +0 -91
  495. package/skills/uipath-maestro-bpmn/fixtures/validation/gateway-boundary-error/operate.json +0 -9
  496. package/skills/uipath-maestro-bpmn/fixtures/validation/gateway-boundary-error/package-descriptor.json +0 -10
  497. package/skills/uipath-maestro-bpmn/fixtures/validation/gateway-boundary-error/project.uiproj +0 -7
  498. package/skills/uipath-maestro-bpmn/fixtures/validation/imported-brownfield-preservation/bindings_v2.json +0 -4
  499. package/skills/uipath-maestro-bpmn/fixtures/validation/imported-brownfield-preservation/entry-points.json +0 -25
  500. package/skills/uipath-maestro-bpmn/fixtures/validation/imported-brownfield-preservation/imported-brownfield-preservation.bpmn +0 -63
  501. package/skills/uipath-maestro-bpmn/fixtures/validation/imported-brownfield-preservation/operate.json +0 -9
  502. package/skills/uipath-maestro-bpmn/fixtures/validation/imported-brownfield-preservation/package-descriptor.json +0 -10
  503. package/skills/uipath-maestro-bpmn/fixtures/validation/imported-brownfield-preservation/project.uiproj +0 -7
  504. package/skills/uipath-maestro-bpmn/fixtures/validation/integration-service-enriched/bindings_v2.json +0 -52
  505. package/skills/uipath-maestro-bpmn/fixtures/validation/integration-service-enriched/entry-points.json +0 -21
  506. package/skills/uipath-maestro-bpmn/fixtures/validation/integration-service-enriched/integration-service-enriched.bpmn +0 -65
  507. package/skills/uipath-maestro-bpmn/fixtures/validation/integration-service-enriched/operate.json +0 -9
  508. package/skills/uipath-maestro-bpmn/fixtures/validation/integration-service-enriched/package-descriptor.json +0 -10
  509. package/skills/uipath-maestro-bpmn/fixtures/validation/integration-service-enriched/project.uiproj +0 -7
  510. package/skills/uipath-maestro-bpmn/fixtures/validation/linear-process/bindings_v2.json +0 -4
  511. package/skills/uipath-maestro-bpmn/fixtures/validation/linear-process/entry-points.json +0 -25
  512. package/skills/uipath-maestro-bpmn/fixtures/validation/linear-process/linear-process.bpmn +0 -55
  513. package/skills/uipath-maestro-bpmn/fixtures/validation/linear-process/operate.json +0 -9
  514. package/skills/uipath-maestro-bpmn/fixtures/validation/linear-process/package-descriptor.json +0 -10
  515. package/skills/uipath-maestro-bpmn/fixtures/validation/linear-process/project.uiproj +0 -7
  516. package/skills/uipath-maestro-bpmn/fixtures/validation/registry-coverage-matrix/bindings_v2.json +0 -20
  517. package/skills/uipath-maestro-bpmn/fixtures/validation/registry-coverage-matrix/entry-points.json +0 -17
  518. package/skills/uipath-maestro-bpmn/fixtures/validation/registry-coverage-matrix/operate.json +0 -9
  519. package/skills/uipath-maestro-bpmn/fixtures/validation/registry-coverage-matrix/package-descriptor.json +0 -10
  520. package/skills/uipath-maestro-bpmn/fixtures/validation/registry-coverage-matrix/project.uiproj +0 -7
  521. package/skills/uipath-maestro-bpmn/fixtures/validation/registry-coverage-matrix/registry-coverage-matrix.bpmn +0 -207
  522. package/skills/uipath-maestro-bpmn/fixtures/validation/subprocess-multi-instance/bindings_v2.json +0 -4
  523. package/skills/uipath-maestro-bpmn/fixtures/validation/subprocess-multi-instance/entry-points.json +0 -33
  524. package/skills/uipath-maestro-bpmn/fixtures/validation/subprocess-multi-instance/operate.json +0 -9
  525. package/skills/uipath-maestro-bpmn/fixtures/validation/subprocess-multi-instance/package-descriptor.json +0 -10
  526. package/skills/uipath-maestro-bpmn/fixtures/validation/subprocess-multi-instance/project.uiproj +0 -7
  527. package/skills/uipath-maestro-bpmn/fixtures/validation/subprocess-multi-instance/subprocess-multi-instance.bpmn +0 -94
  528. package/skills/uipath-maestro-bpmn/fixtures/validation/wrapper-family-contract/bindings_v2.json +0 -124
  529. package/skills/uipath-maestro-bpmn/fixtures/validation/wrapper-family-contract/entry-points.json +0 -25
  530. package/skills/uipath-maestro-bpmn/fixtures/validation/wrapper-family-contract/operate.json +0 -9
  531. package/skills/uipath-maestro-bpmn/fixtures/validation/wrapper-family-contract/package-descriptor.json +0 -10
  532. package/skills/uipath-maestro-bpmn/fixtures/validation/wrapper-family-contract/project.uiproj +0 -7
  533. package/skills/uipath-maestro-bpmn/fixtures/validation/wrapper-family-contract/wrapper-family-contract.bpmn +0 -151
  534. package/skills/uipath-maestro-bpmn/references/author/CAPABILITY.md +0 -141
  535. package/skills/uipath-maestro-bpmn/references/author/references/brownfield.md +0 -48
  536. package/skills/uipath-maestro-bpmn/references/author/references/editing-operations.md +0 -75
  537. package/skills/uipath-maestro-bpmn/references/author/references/greenfield.md +0 -41
  538. package/skills/uipath-maestro-bpmn/references/author/references/planning-arch.md +0 -82
  539. package/skills/uipath-maestro-bpmn/references/author/references/planning-impl.md +0 -104
  540. package/skills/uipath-maestro-bpmn/references/author/references/plugins/agents/impl.md +0 -34
  541. package/skills/uipath-maestro-bpmn/references/author/references/plugins/agents/planning.md +0 -38
  542. package/skills/uipath-maestro-bpmn/references/author/references/plugins/api-workflows/impl.md +0 -37
  543. package/skills/uipath-maestro-bpmn/references/author/references/plugins/api-workflows/planning.md +0 -28
  544. package/skills/uipath-maestro-bpmn/references/author/references/plugins/business-rules/impl.md +0 -36
  545. package/skills/uipath-maestro-bpmn/references/author/references/plugins/business-rules/planning.md +0 -29
  546. package/skills/uipath-maestro-bpmn/references/author/references/plugins/call-activity-subprocess/impl.md +0 -67
  547. package/skills/uipath-maestro-bpmn/references/author/references/plugins/call-activity-subprocess/planning.md +0 -29
  548. package/skills/uipath-maestro-bpmn/references/author/references/plugins/connectors/impl.md +0 -29
  549. package/skills/uipath-maestro-bpmn/references/author/references/plugins/connectors/planning.md +0 -33
  550. package/skills/uipath-maestro-bpmn/references/author/references/plugins/gateways/impl.md +0 -32
  551. package/skills/uipath-maestro-bpmn/references/author/references/plugins/gateways/planning.md +0 -34
  552. package/skills/uipath-maestro-bpmn/references/author/references/plugins/hitl/impl.md +0 -42
  553. package/skills/uipath-maestro-bpmn/references/author/references/plugins/hitl/planning.md +0 -30
  554. package/skills/uipath-maestro-bpmn/references/author/references/plugins/integration-service/impl.md +0 -134
  555. package/skills/uipath-maestro-bpmn/references/author/references/plugins/integration-service/planning.md +0 -67
  556. package/skills/uipath-maestro-bpmn/references/author/references/plugins/multi-instance/impl.md +0 -50
  557. package/skills/uipath-maestro-bpmn/references/author/references/plugins/multi-instance/planning.md +0 -29
  558. package/skills/uipath-maestro-bpmn/references/author/references/plugins/queues/impl.md +0 -29
  559. package/skills/uipath-maestro-bpmn/references/author/references/plugins/queues/planning.md +0 -29
  560. package/skills/uipath-maestro-bpmn/references/author/references/plugins/rpa-jobs/impl.md +0 -35
  561. package/skills/uipath-maestro-bpmn/references/author/references/plugins/rpa-jobs/planning.md +0 -29
  562. package/skills/uipath-maestro-bpmn/references/author/references/plugins/script/impl.md +0 -118
  563. package/skills/uipath-maestro-bpmn/references/author/references/plugins/script/planning.md +0 -30
  564. package/skills/uipath-maestro-bpmn/references/author/references/plugins/sequence-flows/impl.md +0 -30
  565. package/skills/uipath-maestro-bpmn/references/author/references/plugins/sequence-flows/planning.md +0 -30
  566. package/skills/uipath-maestro-bpmn/references/author/references/plugins/service-tasks/impl.md +0 -33
  567. package/skills/uipath-maestro-bpmn/references/author/references/plugins/service-tasks/planning.md +0 -31
  568. package/skills/uipath-maestro-bpmn/references/author/references/plugins/signals/impl.md +0 -33
  569. package/skills/uipath-maestro-bpmn/references/author/references/plugins/signals/planning.md +0 -46
  570. package/skills/uipath-maestro-bpmn/references/author/references/plugins/start-end-events/impl.md +0 -59
  571. package/skills/uipath-maestro-bpmn/references/author/references/plugins/start-end-events/planning.md +0 -37
  572. package/skills/uipath-maestro-bpmn/references/author/references/plugins/waits-triggers/impl.md +0 -40
  573. package/skills/uipath-maestro-bpmn/references/author/references/plugins/waits-triggers/planning.md +0 -34
  574. package/skills/uipath-maestro-bpmn/references/author/references/supported-elements.md +0 -123
  575. package/skills/uipath-maestro-bpmn/references/author/references/task-recipes/README.md +0 -29
  576. package/skills/uipath-maestro-bpmn/references/author/references/task-recipes/agent-job.md +0 -36
  577. package/skills/uipath-maestro-bpmn/references/author/references/task-recipes/api-workflow.md +0 -29
  578. package/skills/uipath-maestro-bpmn/references/author/references/task-recipes/business-rule.md +0 -18
  579. package/skills/uipath-maestro-bpmn/references/author/references/task-recipes/call-activity.md +0 -56
  580. package/skills/uipath-maestro-bpmn/references/author/references/task-recipes/hitl.md +0 -17
  581. package/skills/uipath-maestro-bpmn/references/author/references/task-recipes/http-request.md +0 -119
  582. package/skills/uipath-maestro-bpmn/references/author/references/task-recipes/queue.md +0 -21
  583. package/skills/uipath-maestro-bpmn/references/author/references/task-recipes/rpa-job.md +0 -23
  584. package/skills/uipath-maestro-bpmn/references/author/references/validation.md +0 -118
  585. package/skills/uipath-maestro-bpmn/references/shared/bpmn-xml-contract.md +0 -197
  586. package/skills/uipath-maestro-bpmn/references/shared/cli-conventions.md +0 -46
  587. package/skills/uipath-maestro-bpmn/references/shared/error-handling.md +0 -82
  588. package/skills/uipath-maestro-bpmn/references/shared/variables-bindings-expressions.md +0 -150
  589. package/skills/uipath-maestro-bpmn/references/shared/wrapper-shells.md +0 -554
  590. /package/skills/uipath-maestro-bpmn/references/{shared/expression-authoring.md → expression-authoring.md} +0 -0
  591. /package/skills/uipath-maestro-bpmn/references/{shared/public-safety.md → public-safety.md} +0 -0
  592. /package/{agents → skills/uipath-rpa/agents}/uipath-project-discovery-agent.md +0 -0
@@ -0,0 +1,338 @@
1
+ // Use-case flow: fresh BUILD — the main intent.json pipeline. Scaffolds, writes
2
+ // config + state, pre-warms deps, copies + type-checks metric modules, generates
3
+ // every widget/view, injects routes, runs the full-app tsc backstop, and finalizes
4
+ // state.json. Extracted from build-dashboard.mjs.
5
+
6
+ import { execSync } from 'child_process'
7
+ import { join, resolve, dirname, basename } from 'path'
8
+ import { existsSync, readFileSync, mkdirSync, copyFileSync, unlinkSync } from 'fs'
9
+ import {
10
+ scaffoldDrift, readScaffoldVersion, buildVersions, checkSdkVersion,
11
+ runPrewarm, waitForPrewarm, killPreviousDevServer,
12
+ } from '../lifecycle.mjs'
13
+ import {
14
+ log, fail, emit, writeAtomic, setWidgetsDir, assertScaffoldExtracted,
15
+ resolveMetric, buildWidgetFile, buildViewSpec, generateViewFile, generateKeyedDetailViewFile,
16
+ generateDashboardFiles, injectAppRoutes, runMetricsTypecheck,
17
+ widgetGetsDetailView, widgetLayoutGroup, autoSubtitle, metricModuleSpecifier, compileColumns,
18
+ toPascalCase, hashContent,
19
+ DASHBOARD_PORT, DASHBOARD_SCOPES, MIN_SDK_VERSION, STATE_SCHEMA_VERSION,
20
+ } from '../build-dashboard.mjs'
21
+
22
+ /**
23
+ * Main intent.json build pipeline.
24
+ * @param {DashboardIntent} intent
25
+ * @param {string} intentPath - Absolute path to intent.json on disk (for re-reads)
26
+ * @returns {Promise<void>}
27
+ */
28
+ export async function runDashboardBuild(intent, intentPath) {
29
+ const {
30
+ dashboardName, timeRange, metrics,
31
+ projectDir, orgName, tenantName, cloudUrl, apiUrl, clientId = '', dashboardDescription = '',
32
+ routingName, template = false,
33
+ } = intent
34
+
35
+ if (!projectDir) fail('intent.projectDir is required')
36
+ if (!routingName) fail('intent.routingName is required')
37
+
38
+ const P = resolve(projectDir)
39
+ // Path-safety guard: the pre-warm already created the project folder (the
40
+ // relative <routingName>). A projectDir that does not exist means the caller
41
+ // reconstructed an absolute working-directory path (dash/underscore mangling)
42
+ // — refuse instead of letting a sibling project be silently created where no
43
+ // user or grader will ever find it.
44
+ if (!existsSync(P)) {
45
+ fail(
46
+ `projectDir does not exist: ${P}\n` +
47
+ 'Never reconstruct the project\'s absolute path — cd into the pre-warmed <routingName> ' +
48
+ 'folder and run the build there with intent.json "projectDir": "." ' +
49
+ '(see plugins/build/impl.md § Phase 4, and primitives/incremental-editor.md § Path safety).'
50
+ )
51
+ }
52
+ const BUILD_SENTINEL = join(P, '.build-in-progress')
53
+
54
+ if (existsSync(BUILD_SENTINEL)) {
55
+ emit('PARTIAL_BUILD_DETECTED', { projectDir: P })
56
+ }
57
+ writeAtomic(BUILD_SENTINEL, String(Date.now()))
58
+
59
+ try {
60
+ // Step 1 — Scaffold (the agent extracts the starter-kit archive into the project
61
+ // before building; the skill ships no zip code). Verify it's present, then
62
+ // point widget generation at the kit's _gen/widgets templates.
63
+ assertScaffoldExtracted(P)
64
+ setWidgetsDir(join(P, '_gen', 'widgets'))
65
+ emit('SCAFFOLD_READY')
66
+
67
+ // Step 2 — Config (uipath.json)
68
+ // All SPA config lives in uipath.json. The `uipathCodedApps()` Vite plugin reads
69
+ // it and injects <meta name="uipath:*"> tags into index.html (dev serve AND
70
+ // production build); the SDK (new UiPath()) reads its config from those tags. No
71
+ // VITE_* / .env files. A TEMPLATE build writes a TENANT-NEUTRAL uipath.json
72
+ // (scope + redirectUri only — no org/tenant/baseUrl/clientId), so the shared
73
+ // bundle bakes no tenant identity and the Apps host injects it at runtime. A
74
+ // normal dashboard writes the full tenant config (baked into its own deploy).
75
+ const uipathJsonPath = join(P, 'uipath.json')
76
+ const baseConfig = existsSync(uipathJsonPath)
77
+ ? JSON.parse(readFileSync(uipathJsonPath, 'utf8'))
78
+ : {}
79
+ const uipathConfig = template
80
+ ? { name: dashboardName, scope: DASHBOARD_SCOPES, redirectUri: `http://localhost:${DASHBOARD_PORT}` }
81
+ : {
82
+ name: dashboardName,
83
+ scope: DASHBOARD_SCOPES,
84
+ clientId,
85
+ orgName,
86
+ tenantName,
87
+ baseUrl: apiUrl,
88
+ redirectUri: `http://localhost:${DASHBOARD_PORT}`,
89
+ }
90
+ writeAtomic(uipathJsonPath, JSON.stringify({ ...baseConfig, ...uipathConfig }, null, 2) + '\n')
91
+ emit('ENV_WRITTEN')
92
+
93
+ // Warn if clientId is missing — local-dev / standalone OAuth will fail without it
94
+ // (a hosted/embedded deploy gets its client-id from the host instead).
95
+ if (!template && !clientId) {
96
+ emit('AUTH_MISSING', { var: 'clientId', message: 'No external OAuth app client ID in uipath.json. Local preview / standalone OAuth will fail. Run Phase 4.5 to provision one.' })
97
+ log('⚠ Warning: clientId is empty — local dashboard auth will not work. See Phase 4.5 in build plugin docs.')
98
+ }
99
+
100
+ // Write partial state.json early so deploy can find app metadata even if build fails
101
+ const stateDir = join(P, '.dashboard')
102
+ mkdirSync(stateDir, { recursive: true })
103
+ const statePath = join(stateDir, 'state.json')
104
+ const existingState = existsSync(statePath) ? JSON.parse(readFileSync(statePath, 'utf8')) : {}
105
+ const buildDrift = existsSync(statePath) ? scaffoldDrift(existingState, readScaffoldVersion(P)) : null
106
+ if (buildDrift) emit('UPGRADE_AVAILABLE', buildDrift)
107
+ // Regime: a template builds straight to the ejected regime (full-source,
108
+ // agent-edited, no compiler regen); a fresh dashboard is compiler-managed.
109
+ // Once ejected, always ejected (one-way — never silently re-adopt the script).
110
+ const regime = template ? 'ejected' : (existingState.regime ?? 'compiler-managed')
111
+ if (template) {
112
+ emit('TEMPLATE_BUILD', {
113
+ regime,
114
+ note: 'Template build → ejected regime + tenant-neutral bundle (no org/tenant/baseUrl/clientId baked). The scaffold useAuth resolves host-injected <meta name="uipath:*"> config at runtime (new UiPath()), so the artifact is portable across tenants. Pack source with: node build-dashboard.mjs --pack-template <projectDir>',
115
+ })
116
+ }
117
+ const partialState = {
118
+ schemaVersion: STATE_SCHEMA_VERSION,
119
+ versions: buildVersions(null, readScaffoldVersion(P)),
120
+ regime,
121
+ app: { name: dashboardName, routingName, semver: existingState.app?.semver ?? '1.0.0', description: dashboardDescription },
122
+ env: cloudUrl.includes('alpha') ? 'alpha' : cloudUrl.includes('staging') ? 'staging' : 'prod',
123
+ org: orgName, tenant: tenantName, cloudUrl,
124
+ timeRange,
125
+ widgets: existingState.widgets ?? {},
126
+ deployment: existingState.deployment ?? { systemName: null, folderKey: null, appUrl: null, lastDeployedAt: null },
127
+ buildStatus: 'in-progress',
128
+ }
129
+ writeAtomic(statePath, JSON.stringify(partialState, null, 2))
130
+
131
+ // Step 3 — Pre-warm guarantee
132
+ const LOCK_SIGNAL = join(P, 'node_modules', '.package-lock.json')
133
+ const PREWARM_LOCK_PATH = join(P, '.prewarm.lock')
134
+ if (!existsSync(LOCK_SIGNAL)) {
135
+ if (existsSync(PREWARM_LOCK_PATH)) {
136
+ log('⏳ Waiting for pre-warm…')
137
+ waitForPrewarm(P)
138
+ } else {
139
+ log('⚙ Installing dependencies…')
140
+ await runPrewarm(P)
141
+ }
142
+ } else {
143
+ emit('PREWARM_DONE')
144
+ }
145
+
146
+ // Step 3.5 — SDK version floor (agent-memory/governance subpaths need ≥ MIN_SDK_VERSION)
147
+ const sdkCheck = checkSdkVersion(P)
148
+ if (!sdkCheck.ok) {
149
+ fail(
150
+ `Installed @uipath/uipath-typescript ${sdkCheck.version ?? '(not found)'} is below the required ${MIN_SDK_VERSION} ` +
151
+ `(agent/governance metrics need the agent-memory and governance subpaths). ` +
152
+ `Fix: delete ${join(P, 'package-lock.json')} and ${join(P, 'node_modules')}, then re-run the pre-warm.`
153
+ )
154
+ }
155
+
156
+ // Step 3.6 — Copy agent-authored metric modules into the project and
157
+ // type-check them in isolation (Stage A) before generating any widget.
158
+ // A failure here maps directly to a metrics/<name>.ts file — fast, no React.
159
+ const intentDir = dirname(intentPath)
160
+ const metricsDestDir = join(P, 'src', 'metrics')
161
+ mkdirSync(metricsDestDir, { recursive: true })
162
+ for (const metric of metrics) {
163
+ const rel = metric.module ?? `metrics/${metric.name}.ts`
164
+ const fromPath = join(intentDir, rel)
165
+ if (!existsSync(fromPath)) {
166
+ fail(`Metric module not found: ${fromPath} — write the data function as metrics/${metric.name}.ts exporting "fetchData"`)
167
+ }
168
+ copyFileSync(fromPath, join(metricsDestDir, basename(rel)))
169
+ }
170
+ const stageA = runMetricsTypecheck(P)
171
+ if (!stageA.ok) {
172
+ emit('METRICS_RETRY', { files: stageA.files, errors: stageA.errors, intentPath })
173
+ log(`⚠ Metric modules have TypeScript errors. Fix the named files in ${metricsDestDir} and re-run.`)
174
+ process.exit(2)
175
+ }
176
+ emit('METRICS_PASS')
177
+
178
+ // Step 3.6 — Enforce record-grain detail. Every widget that exposes a
179
+ // drill-down (a chart not opted out via registry `noDetail`, or a kpi-card
180
+ // with `detail: true`) MUST export `fetchDetail` — the record-grain query
181
+ // behind the aggregate. Without it the detail view would re-table the chart's
182
+ // own buckets and add no information. This is the chart analogue of the
183
+ // existing T3-table-without-columns hard-fail.
184
+ const missingDetail = []
185
+ for (const metric of metrics) {
186
+ const isT3 = metric.tier === 'T3'
187
+ const { entry } = isT3 ? { entry: null } : resolveMetric(metric)
188
+ const displayAs = metric.displayAs ?? entry?.template ?? 'data-table'
189
+ if (!widgetGetsDetailView(displayAs, metric, entry)) continue
190
+ const rel = metric.module ?? `metrics/${metric.name}.ts`
191
+ const moduleSrc = readFileSync(join(metricsDestDir, basename(rel)), 'utf8')
192
+ if (!/export\s+const\s+fetchDetail\b/.test(moduleSrc)) {
193
+ missingDetail.push({ metric: metric.name, module: rel, recipe: entry?.detailRecipe })
194
+ }
195
+ }
196
+ if (missingDetail.length > 0) {
197
+ emit('CHART_DETAIL_MISSING', { metrics: missingDetail, intentPath })
198
+ log(
199
+ `⚠ These widgets expose a drill-down but their modules don't export "fetchDetail" ` +
200
+ `(the record-grain query behind the chart). Add it to each module (see the metric's ` +
201
+ `detailRecipe), or — for a chart that genuinely has no record data — set "noDetail": true ` +
202
+ `(on the registry entry for a catalog metric, or on the metric in intent.json for a T3 custom chart):\n` +
203
+ missingDetail.map(m => ` • ${m.metric} (${m.module})${m.recipe ? `\n ${m.recipe}` : ''}`).join('\n'),
204
+ )
205
+ process.exit(2)
206
+ }
207
+
208
+ // Step 4 — Resolve + generate widgets
209
+ const widgetHashes = {}
210
+ const widgetMeta = [] // { componentName, template }
211
+ const widgetSpecs = {} // componentName → view spec (see buildViewSpec); chart widgets only
212
+ const keyedSpecs = {} // componentName → keyed detail spec; table widgets with rowLink
213
+ let widgetIndex = 0
214
+ const total = metrics.length
215
+
216
+ // All widgets generated together — T1, T2, T3 in one pass (no per-widget tsc)
217
+ // Metric-level errors were already caught by Stage A above; Step 6 is the integration backstop.
218
+ for (const metric of metrics) {
219
+ const isT3 = metric.tier === 'T3'
220
+ const { entry } = isT3 ? { entry: null } : resolveMetric(metric)
221
+
222
+ let widgetContent
223
+ try {
224
+ widgetContent = buildWidgetFile(metric, entry, timeRange)
225
+ } catch (e) {
226
+ if (isT3) emit('T3_FAILED', { widget: metric.name, reason: e.message })
227
+ fail(`Widget "${metric.name}" could not be generated: ${e.message}`)
228
+ }
229
+
230
+ const displayAs = metric.displayAs ?? entry?.template ?? 'data-table'
231
+ const componentName = metric.componentName ?? toPascalCase(metric.name)
232
+ const widgetPath = join(P, 'src', 'dashboard', 'widgets', `${componentName}.tsx`)
233
+ writeAtomic(widgetPath, widgetContent)
234
+
235
+ // intentMetric is persisted so incremental CHANGE/REBUILD can regenerate
236
+ // the widget without the original intent.json (title, display hints).
237
+ widgetHashes[componentName] = { hash: hashContent(widgetContent), tier: metric.tier, metric: metric.name, template: displayAs, module: metric.module ?? `metrics/${metric.name}.ts`, intentMetric: metric }
238
+ widgetMeta.push({ componentName, template: displayAs })
239
+
240
+ // Detail views: charts (unless registry `noDetail`) and kpi-cards with
241
+ // `detail: true` get a generated record-grain view + route — any tier. The
242
+ // view runs `fetchDetail`; columns come from detailColumns (intent or
243
+ // registry defaults), else auto-detected at runtime.
244
+ if (widgetGetsDetailView(displayAs, metric, entry)) {
245
+ widgetSpecs[componentName] = buildViewSpec(componentName, metric, entry, timeRange)
246
+ }
247
+
248
+ // Row-click drill-down: a table widget with `rowLink` gets a keyed detail
249
+ // view at /<widget>/:key that calls the module's fetchDetailByKey.
250
+ // rowLink + detailView fall back to the registry entry's defaults (same as
251
+ // title/columns), so a cataloged metric ships its drill-down + rich charts
252
+ // without the intent restating them.
253
+ const keyedRowLink = metric.rowLink ?? entry?.defaults?.rowLink
254
+ if (keyedRowLink?.key && widgetLayoutGroup(displayAs) === 'table') {
255
+ keyedSpecs[componentName] = {
256
+ componentName,
257
+ title: metric.title ?? entry?.defaults?.title ?? componentName,
258
+ subtitle: autoSubtitle(metric, entry?.defaults ?? {}, timeRange),
259
+ moduleSpecifier: metricModuleSpecifier(metric),
260
+ detailColumns: metric.detailColumns ? compileColumns(metric.detailColumns) : null,
261
+ detailView: metric.detailView ?? entry?.defaults?.detailView ?? null,
262
+ routeBase: `/${componentName.toLowerCase()}`,
263
+ }
264
+ }
265
+
266
+ widgetIndex++
267
+ emit('WIDGET_READY', { name: componentName, index: widgetIndex, total })
268
+ }
269
+
270
+ // Step 5 — Generate Dashboard.tsx + index.ts
271
+ generateDashboardFiles(P, widgetMeta, dashboardName, dashboardDescription)
272
+
273
+ // Step 5a — Generate view files (widgetSpecs is chart-only; every chart links to its view)
274
+ const generatedViewNames = []
275
+ for (const [componentName, spec] of Object.entries(widgetSpecs)) {
276
+ const viewContent = generateViewFile(spec)
277
+ writeAtomic(join(P, 'src', 'dashboard', 'views', `${componentName}View.tsx`), viewContent)
278
+ generatedViewNames.push(componentName)
279
+ }
280
+
281
+ // Step 5a.2 — Generate keyed detail views for tables with rowLink
282
+ const keyedViewWidgets = []
283
+ for (const [componentName, spec] of Object.entries(keyedSpecs)) {
284
+ const viewContent = generateKeyedDetailViewFile(spec)
285
+ writeAtomic(join(P, 'src', 'dashboard', 'views', `${componentName}DetailView.tsx`), viewContent)
286
+ keyedViewWidgets.push({ componentName, routeBase: spec.routeBase })
287
+ }
288
+
289
+ // Step 5b — Only inject routes for widgets that actually have view files
290
+ injectAppRoutes(P, generatedViewNames, keyedViewWidgets)
291
+
292
+ // Step 6 — Full-app tsc backstop. Metric-level errors were already caught by
293
+ // Stage A; a failure here is an integration/template error, not a metric bug.
294
+ try {
295
+ execSync('npx tsc --noEmit', { cwd: P, stdio: 'pipe' })
296
+ emit('TSC_PASS')
297
+ } catch (e) {
298
+ const tscOut = e.stdout?.toString() ?? ''
299
+ const err = tscOut || e.stderr?.toString() || String(e)
300
+ emit('TSC_FAIL', { errors: err.slice(0, 1000) })
301
+ fail(`TypeScript errors:\n${err}`)
302
+ }
303
+
304
+ // Step 7 — Write final state.json (upgrade partial → complete)
305
+ const newState = {
306
+ schemaVersion: STATE_SCHEMA_VERSION,
307
+ versions: buildVersions(sdkCheck.version, readScaffoldVersion(P)),
308
+ regime,
309
+ app: { name: dashboardName, routingName, semver: existingState.app?.semver ?? '1.0.0', description: dashboardDescription },
310
+ env: cloudUrl.includes('alpha') ? 'alpha' : cloudUrl.includes('staging') ? 'staging' : 'prod',
311
+ org: orgName, tenant: tenantName, cloudUrl,
312
+ timeRange,
313
+ widgets: widgetHashes,
314
+ deployment: existingState.deployment ?? { systemName: null, folderKey: null, appUrl: null, lastDeployedAt: null },
315
+ buildStatus: 'complete',
316
+ }
317
+ writeAtomic(statePath, JSON.stringify(newState, null, 2))
318
+
319
+ // Step 8 — Clean up any server a PREVIOUS script version spawned (legacy
320
+ // pid file). The script itself no longer starts the dev server: a detached
321
+ // child here outlives the session and leaks. The calling agent starts
322
+ // `npm run dev` as a tracked background job instead (see build impl.md).
323
+ const serverPidFile = join(P, '.dashboard', 'server.pid')
324
+ await killPreviousDevServer(serverPidFile)
325
+ try { unlinkSync(serverPidFile) } catch { /* ignore */ }
326
+
327
+ emit('BUILD_RESULT', {
328
+ success: true, projectDir: P, port: DASHBOARD_PORT,
329
+ previewUrl: `http://localhost:${DASHBOARD_PORT}`,
330
+ widgets: Object.keys(widgetHashes),
331
+ dashboardName,
332
+ serverStart: `npm run dev -- --port ${DASHBOARD_PORT}`,
333
+ })
334
+
335
+ } finally {
336
+ try { unlinkSync(BUILD_SENTINEL) } catch { /* ignore */ }
337
+ }
338
+ }
@@ -0,0 +1,248 @@
1
+ // Use-case flow: incremental EDIT — apply ADD / REMOVE / CHANGE / REBUILD / EJECT /
2
+ // UPGRADE ops to an existing project in one validated pass. Delegates project-wide
3
+ // UPGRADE to ./upgrade.mjs. Extracted from build-dashboard.mjs.
4
+
5
+ import { execSync } from 'child_process'
6
+ import { join, resolve, dirname, basename } from 'path'
7
+ import { existsSync, readFileSync, mkdirSync, copyFileSync, unlinkSync } from 'fs'
8
+ import { scaffoldDrift, readScaffoldVersion, buildVersions, checkSdkVersion } from '../lifecycle.mjs'
9
+ import { runUpgrade } from './upgrade.mjs'
10
+ import {
11
+ log, fail, emit, writeAtomic, setWidgetsDir, assertScaffoldExtracted,
12
+ classifyEditIntent, resolveChangeMetric, resolveMetric, buildWidgetFile, buildViewSpec,
13
+ generateViewFile, generateDashboardFiles, injectAppRoutes, collectKeyedViews,
14
+ writeKeyedViewIfRowLink, rebuildAllWidgets, runMetricsTypecheck,
15
+ widgetGetsDetailView, toPascalCase, hashContent, STATE_SCHEMA_VERSION,
16
+ } from '../build-dashboard.mjs'
17
+
18
+ /**
19
+ * Copy a metric's module file from the edit's sibling `metrics/` dir into the
20
+ * project's `src/metrics/`. Returns true if a file was copied, false if the edit
21
+ * supplied none (CHANGE may legitimately supply none — the existing module stays).
22
+ * @param {string} intentDir - directory containing the edit-intent.json
23
+ * @param {string} projectPath
24
+ * @param {{ name: string, module?: string }} metric
25
+ * @returns {boolean}
26
+ */
27
+ function copyMetricModule(intentDir, projectPath, metric) {
28
+ const rel = metric.module ?? `metrics/${metric.name}.ts`
29
+ const fromPath = join(intentDir, rel)
30
+ if (!existsSync(fromPath)) return false
31
+ const destDir = join(projectPath, 'src', 'metrics')
32
+ mkdirSync(destDir, { recursive: true })
33
+ copyFileSync(fromPath, join(destDir, basename(rel)))
34
+ return true
35
+ }
36
+
37
+ /**
38
+ * Apply one or more incremental edits (ADD / REMOVE / CHANGE / REBUILD) to an
39
+ * existing project in a single pass: every op is validated up front (nothing is
40
+ * written if any op would fail), then all ops apply, then Dashboard.tsx/index.ts
41
+ * regenerate ONCE and tsc runs ONCE.
42
+ * @param {{ projectDir: string, op?: string, ops?: Array<object> }} editIntent
43
+ * @param {string} intentPath
44
+ * @returns {Promise<void>}
45
+ */
46
+ export async function runIncrementalEdit(editIntent, intentPath) {
47
+ const { projectDir } = editIntent
48
+ if (!projectDir) fail('edit-intent.projectDir is required')
49
+ const P = resolve(projectDir)
50
+ const intentDir = dirname(intentPath)
51
+ const statePath = join(P, '.dashboard', 'state.json')
52
+ if (!existsSync(statePath)) fail('No .dashboard/state.json found. Run a fresh build first.')
53
+ const state = JSON.parse(readFileSync(statePath, 'utf8'))
54
+ const { ops } = classifyEditIntent(editIntent)
55
+
56
+ // Eject — flip to the ejected regime (one-way). No scaffold needed: this only
57
+ // rewrites state.json. From here the dashboard is a full-source project edited
58
+ // free-form by the agent + `npm run build`; the edit-script no longer runs on it.
59
+ // Idempotent — re-ejecting an ejected project is a no-op write.
60
+ if (ops.length === 1 && ops[0].op === 'EJECT') {
61
+ state.regime = 'ejected'
62
+ state.schemaVersion = STATE_SCHEMA_VERSION
63
+ writeAtomic(statePath, JSON.stringify(state, null, 2))
64
+ emit('EJECTED', {
65
+ projectDir: P,
66
+ note: 'Dashboard ejected → full-source, agent-edited regime. Compiler regen / UPGRADE no longer apply. Edit files under src/ directly, then run `npm run build`.',
67
+ })
68
+ return
69
+ }
70
+
71
+ // Regime gate — the structured edit-script is for compiler-managed dashboards
72
+ // only. An ejected project (or a template) is edited free-form on its source;
73
+ // running the script would regenerate Dashboard.tsx/widgets and clobber hand
74
+ // work. Refuse loud (before touching the scaffold) and route to source editing.
75
+ if (state.regime === 'ejected') {
76
+ emit('EJECTED_PROJECT', { projectDir: P })
77
+ fail(
78
+ 'This dashboard is ejected (full-source, agent-edited). The structured edit-script ' +
79
+ 'is disabled for ejected projects — edit the source under src/ directly per the ' +
80
+ 'request, then run `npm run build`. See references/dashboards/primitives/customization.md (Ejected regime).'
81
+ )
82
+ }
83
+
84
+ // The starter kit must still be extracted in the project (the widget generator
85
+ // templates live in <proj>/_gen/widgets). Verify + point the generator at them —
86
+ // without this, ADD/CHANGE/REBUILD crash at widgetsDir().
87
+ assertScaffoldExtracted(P)
88
+ setWidgetsDir(join(P, '_gen', 'widgets'))
89
+ const editDrift = scaffoldDrift(state, readScaffoldVersion(P))
90
+ if (editDrift) emit('UPGRADE_AVAILABLE', editDrift)
91
+ if (state.buildStatus === 'in-progress') {
92
+ log('⚠ Warning: Previous build did not complete — widgets may be missing. Consider running a full build first.')
93
+ }
94
+ const timeRange = state.timeRange ?? '30d'
95
+
96
+ // Project-wide upgrade — runs instead of the per-widget batch loop.
97
+ if (ops.length === 1 && ops[0].op === 'UPGRADE') {
98
+ await runUpgrade(P, state, intentPath)
99
+ return
100
+ }
101
+
102
+ // ── Pre-validate the whole batch — fail BEFORE any write ────────────────────
103
+ const violations = []
104
+ for (const [i, o] of ops.entries()) {
105
+ if (o.op === 'REMOVE' || o.op === 'CHANGE') {
106
+ if (!o.target) { violations.push(`ops[${i}] ${o.op}: missing target`); continue }
107
+ const widgetPath = join(P, 'src', 'dashboard', 'widgets', `${o.target}.tsx`)
108
+ const currentContent = existsSync(widgetPath) ? readFileSync(widgetPath, 'utf8') : null
109
+ const stored = state.widgets?.[o.target]
110
+ if (currentContent && stored && hashContent(currentContent) !== stored.hash) {
111
+ emit('HAND_EDIT_DETECTED', { widget: o.target })
112
+ violations.push(`ops[${i}] ${o.op} "${o.target}": hand-edited — overwriting would lose changes`)
113
+ }
114
+ if (o.op === 'CHANGE') {
115
+ const metricRef = resolveChangeMetric(stored, o.target, o.delta)
116
+ const rel = metricRef.module ?? `metrics/${metricRef.name}.ts`
117
+ const provided = existsSync(join(intentDir, rel))
118
+ const existing = existsSync(join(P, 'src', 'metrics', basename(rel)))
119
+ if (!provided && !existing) {
120
+ violations.push(`ops[${i}] CHANGE "${o.target}": no metric module found — provide metrics/${metricRef.name}.ts in the edit, or re-run a fresh build`)
121
+ }
122
+ }
123
+ }
124
+ if (o.op === 'ADD') {
125
+ if (!o.metric?.name) { violations.push(`ops[${i}] ADD: missing metric`); continue }
126
+ let addEntry = null
127
+ try { addEntry = resolveMetric(o.metric).entry } catch (e) { violations.push(`ops[${i}] ADD "${o.metric.name}": ${e.message}`) }
128
+ const rel = o.metric.module ?? `metrics/${o.metric.name}.ts`
129
+ const addFrom = join(intentDir, rel)
130
+ if (!existsSync(addFrom)) {
131
+ violations.push(`ops[${i}] ADD "${o.metric.name}": metric module not found — write ${rel} exporting "fetchData"`)
132
+ } else if (
133
+ widgetGetsDetailView(o.metric.displayAs ?? addEntry?.template ?? 'data-table', o.metric, addEntry) &&
134
+ !/export\s+const\s+fetchDetail\b/.test(readFileSync(addFrom, 'utf8'))
135
+ ) {
136
+ violations.push(
137
+ `ops[${i}] ADD "${o.metric.name}": drill-down widget needs a record-grain "fetchDetail" export in ${rel}` +
138
+ `${addEntry?.detailRecipe ? ` — ${addEntry.detailRecipe}` : ''} (or set "noDetail": true on the metric/registry entry for a chart with no record data)`,
139
+ )
140
+ }
141
+ }
142
+ }
143
+ if (violations.length > 0) {
144
+ fail(`Batch rejected — nothing was changed:\n${violations.map(v => ' • ' + v).join('\n')}`)
145
+ }
146
+
147
+ // ── Apply every op ───────────────────────────────────────────────────────────
148
+ const applied = []
149
+ for (const { op, target, metric, delta } of ops) {
150
+
151
+ if (op === 'ADD') {
152
+ const { tier, entry } = resolveMetric(metric)
153
+ const componentName = metric.componentName ?? toPascalCase(metric.name)
154
+ copyMetricModule(intentDir, P, metric)
155
+ const widgetContent = buildWidgetFile(metric, entry, timeRange)
156
+ const addTemplate = metric.displayAs ?? entry?.template ?? 'data-table'
157
+ const widgetPath = join(P, 'src', 'dashboard', 'widgets', `${componentName}.tsx`)
158
+ writeAtomic(widgetPath, widgetContent)
159
+ state.widgets = state.widgets ?? {}
160
+ state.widgets[componentName] = { hash: hashContent(widgetContent), tier, metric: metric.name, template: addTemplate, module: metric.module ?? `metrics/${metric.name}.ts`, intentMetric: metric }
161
+ // Charts (unless noDetail) and kpi-cards with detail:true get a record-grain
162
+ // detail view so the drill-down route resolves.
163
+ if (widgetGetsDetailView(addTemplate, metric, entry)) {
164
+ const viewContent = generateViewFile(buildViewSpec(componentName, metric, entry, timeRange))
165
+ writeAtomic(join(P, 'src', 'dashboard', 'views', `${componentName}View.tsx`), viewContent)
166
+ }
167
+ // Table with rowLink → generate its keyed row-click detail view
168
+ writeKeyedViewIfRowLink(P, componentName, metric, entry, timeRange)
169
+
170
+ } else if (op === 'REMOVE') {
171
+ const stored = state.widgets?.[target]
172
+ const widgetPath = join(P, 'src', 'dashboard', 'widgets', `${target}.tsx`)
173
+ if (existsSync(widgetPath)) unlinkSync(widgetPath)
174
+ const viewPath = join(P, 'src', 'dashboard', 'views', `${target}View.tsx`)
175
+ if (existsSync(viewPath)) unlinkSync(viewPath)
176
+ const moduleRel = stored?.module ?? `metrics/${stored?.metric ?? target.toLowerCase()}.ts`
177
+ const modulePath = join(P, 'src', 'metrics', basename(moduleRel))
178
+ if (existsSync(modulePath)) unlinkSync(modulePath)
179
+ if (state.widgets) delete state.widgets[target]
180
+
181
+ } else if (op === 'CHANGE') {
182
+ const widgetPath = join(P, 'src', 'dashboard', 'widgets', `${target}.tsx`)
183
+ const stored = state.widgets?.[target]
184
+ const metricRef = resolveChangeMetric(stored, target, delta)
185
+ copyMetricModule(intentDir, P, metricRef)
186
+ const tier = metricRef.tier ?? stored?.tier ?? 'T1'
187
+ const { entry } = resolveMetric(metricRef)
188
+ const widgetContent = buildWidgetFile(metricRef, entry, delta?.timeRange ?? timeRange)
189
+ writeAtomic(widgetPath, widgetContent)
190
+ const changeTemplate = metricRef.displayAs ?? entry?.template ?? stored?.template ?? 'data-table'
191
+ if (state.widgets) state.widgets[target] = { hash: hashContent(widgetContent), tier, metric: metricRef.name, template: changeTemplate, module: metricRef.module ?? `metrics/${metricRef.name}.ts`, intentMetric: metricRef }
192
+ // Keep the detail view in sync: regenerate when the widget drills down
193
+ // (chart unless noDetail, or kpi-card with detail:true), drop it otherwise.
194
+ const changeViewPath = join(P, 'src', 'dashboard', 'views', `${target}View.tsx`)
195
+ if (widgetGetsDetailView(changeTemplate, metricRef, entry)) {
196
+ const viewContent = generateViewFile(buildViewSpec(target, metricRef, entry, delta?.timeRange ?? timeRange))
197
+ writeAtomic(changeViewPath, viewContent)
198
+ } else if (existsSync(changeViewPath)) {
199
+ unlinkSync(changeViewPath)
200
+ }
201
+ // Sync the keyed row-click detail view (adds it if rowLink was set, removes a stale one)
202
+ writeKeyedViewIfRowLink(P, target, metricRef, entry, delta?.timeRange ?? timeRange)
203
+
204
+ } else if (op === 'REBUILD') {
205
+ // Regenerate every widget (and chart detail view) from the persisted intentMetric.
206
+ // Useful after scaffold/template updates. Legacy entries without intentMetric are skipped.
207
+ rebuildAllWidgets(P, state, timeRange)
208
+ }
209
+
210
+ applied.push({ op, widget: target ?? (metric ? (metric.componentName ?? toPascalCase(metric.name)) : undefined) })
211
+ } // end apply loop
212
+
213
+ // Regenerate Dashboard.tsx + index.ts — ONCE for the whole batch
214
+ const widgetMeta = Object.entries(state.widgets ?? {}).map(([name, info]) => ({
215
+ componentName: name,
216
+ template: info.template ?? 'ranked-table',
217
+ }))
218
+ generateDashboardFiles(P, widgetMeta, state.app?.name ?? 'Dashboard', state.app?.description ?? '')
219
+
220
+ // Re-inject App.tsx routes — chart views + keyed row-click detail views on disk
221
+ const viewNames = Object.keys(state.widgets ?? {}).filter(name =>
222
+ existsSync(join(P, 'src', 'dashboard', 'views', `${name}View.tsx`))
223
+ )
224
+ injectAppRoutes(P, viewNames, collectKeyedViews(P, state))
225
+
226
+ // Stage A — re-type-check metric modules in isolation after the batch.
227
+ const stageA = runMetricsTypecheck(P)
228
+ if (!stageA.ok) {
229
+ emit('METRICS_RETRY', { files: stageA.files, errors: stageA.errors, intentPath })
230
+ log(`⚠ Metric modules have TypeScript errors. Fix the named files in ${join(P, 'src', 'metrics')} and re-run.`)
231
+ process.exit(2)
232
+ }
233
+
234
+ // tsc validate
235
+ try {
236
+ execSync('npx tsc --noEmit', { cwd: P, stdio: 'pipe' })
237
+ emit('TSC_PASS')
238
+ } catch (e) {
239
+ const err = e.stdout?.toString() || ''
240
+ emit('TSC_FAIL', { errors: err.slice(0, 500) })
241
+ fail(`TypeScript errors after edit:\n${err}`)
242
+ }
243
+
244
+ state.schemaVersion = STATE_SCHEMA_VERSION
245
+ state.versions = buildVersions(checkSdkVersion(P).version, readScaffoldVersion(P))
246
+ writeAtomic(statePath, JSON.stringify(state, null, 2))
247
+ emit('INCREMENTAL_READY', { count: applied.length, ops: applied })
248
+ }
@@ -0,0 +1,82 @@
1
+ // Use-case flow: TEMPLATE packaging — stage the modify-face source + manifest into
2
+ // dist/_source so one pack artifact carries both the deploy face and the ejected,
3
+ // tenant-neutral source. Extracted from build-dashboard.mjs.
4
+
5
+ import { join, resolve, basename } from 'path'
6
+ import { existsSync, readFileSync, writeFileSync, copyFileSync, mkdirSync, rmSync, cpSync, readdirSync } from 'fs'
7
+ import { readScaffoldVersion } from '../lifecycle.mjs'
8
+ import { fail, emit, MIN_SDK_VERSION, DASHBOARD_SCOPES } from '../build-dashboard.mjs'
9
+
10
+ /**
11
+ * Stage the full modify-face source + a template.json manifest into dist/_source/
12
+ * so ONE `uip codedapp pack dist` artifact carries both the deploy face (dist/)
13
+ * and the agent-modifiable source (the ejected "recipe"). Tenant-neutral: never
14
+ * stages .env*, .dashboard/ (tenant + deployment identity), node_modules, or dist,
15
+ * and blanks uipath.json clientId. Run AFTER `npm run build` (needs dist/), before pack.
16
+ * @param {string} projectDir
17
+ */
18
+ export function packTemplate(projectDir) {
19
+ const P = resolve(projectDir)
20
+ const distDir = join(P, 'dist')
21
+ if (!existsSync(distDir)) fail('dist/ not found — run `npm run build` before --pack-template.')
22
+ const statePath = join(P, '.dashboard', 'state.json')
23
+ const state = existsSync(statePath) ? JSON.parse(readFileSync(statePath, 'utf8')) : {}
24
+
25
+ const srcOut = join(distDir, '_source')
26
+ try { rmSync(srcOut, { recursive: true, force: true }) } catch { /* fresh */ }
27
+ mkdirSync(srcOut, { recursive: true })
28
+
29
+ // The modify-face project. Tenant identity (.env*, .dashboard/) and rebuildable
30
+ // artifacts (node_modules, dist, _gen) are deliberately excluded.
31
+ const INCLUDE = [
32
+ 'intent.json', 'package.json', 'package-lock.json', 'index.html',
33
+ 'vite.config.ts', 'tsconfig.json', 'tsconfig.node.json', 'tsconfig.metrics.json',
34
+ 'tailwind.config.ts', 'postcss.config.js', 'src',
35
+ ]
36
+ const stripDirs = new Set(['node_modules', 'dist'])
37
+ for (const rel of INCLUDE) {
38
+ const from = join(P, rel)
39
+ if (!existsSync(from)) continue
40
+ cpSync(from, join(srcOut, rel), {
41
+ recursive: true,
42
+ filter: (s) => {
43
+ const b = basename(s)
44
+ return !stripDirs.has(b) && !b.startsWith('.env')
45
+ },
46
+ })
47
+ }
48
+
49
+ // uipath.json — staged tenant-neutral. dist/_source/* is web-served, so blank
50
+ // ALL tenant identity (clientId, orgName, tenantName, baseUrl); keep only scope
51
+ // (+ name/redirectUri). A proper template build already wrote a scope-only
52
+ // uipath.json; this also covers packing a non-template build as a template.
53
+ const TENANT_KEYS = ['clientId', 'orgName', 'tenantName', 'baseUrl']
54
+ const uj = join(P, 'uipath.json')
55
+ if (existsSync(uj)) {
56
+ try {
57
+ const obj = JSON.parse(readFileSync(uj, 'utf8'))
58
+ for (const k of TENANT_KEYS) if (k in obj) obj[k] = ''
59
+ writeFileSync(join(srcOut, 'uipath.json'), JSON.stringify(obj, null, 2))
60
+ } catch { copyFileSync(uj, join(srcOut, 'uipath.json')) }
61
+ }
62
+
63
+ const manifest = {
64
+ templateVersion: '1.0.0',
65
+ scaffoldVersion: readScaffoldVersion(P),
66
+ sdkFloor: MIN_SDK_VERSION,
67
+ requiredScopes: DASHBOARD_SCOPES,
68
+ routingName: state.app?.routingName ?? null,
69
+ dashboardName: state.app?.name ?? null,
70
+ regime: 'ejected',
71
+ ejected: true,
72
+ generatedBy: 'build-dashboard.mjs --pack-template',
73
+ }
74
+ writeFileSync(join(srcOut, 'template.json'), JSON.stringify(manifest, null, 2))
75
+
76
+ emit('TEMPLATE_PACKED', {
77
+ sourceDir: srcOut,
78
+ files: readdirSync(srcOut),
79
+ packCommand: `uip codedapp pack dist -n "${state.app?.name ?? '<APP_NAME>'}" --version "${state.app?.semver ?? '1.0.0'}" --output json`,
80
+ caveat: "dist/_source/* is web-served by the platform — ship embedded source ONLY for shareable, tenant-neutral templates, never a customer's private dashboard.",
81
+ })
82
+ }