workspai 0.50.0 → 0.52.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 (135) hide show
  1. package/README.md +127 -497
  2. package/contracts/artifact-remediation-plan.v1.json +87 -0
  3. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +24 -0
  4. package/contracts/create-planner-capabilities.v1.json +10 -1
  5. package/contracts/doctor-project-evidence.v1.json +46 -0
  6. package/contracts/doctor-remediation-plan.v1.json +82 -0
  7. package/contracts/doctor-workspace-evidence.v1.json +46 -0
  8. package/contracts/extension-cli-compatibility.v1.json +6 -2
  9. package/contracts/published-contract-catalog.v1.json +22 -1
  10. package/contracts/runtime-command-surface.v1.json +104 -0
  11. package/contracts/workspace-intelligence/doctor-dependency-repair-transaction.v1.json +66 -0
  12. package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +5 -0
  13. package/contracts/workspace-intelligence/verified-goal-status.v1.json +27 -0
  14. package/contracts/workspace-intelligence/verified-goal.v1.json +163 -0
  15. package/contracts/workspace-intelligence-chain.v1.json +6 -0
  16. package/dist/analyze-J7VNZMDH.js +1 -0
  17. package/dist/artifact-remediation-plan-2UKY4TKO.js +3 -0
  18. package/dist/autopilot-release-UG23AWVH.js +1 -0
  19. package/dist/chunk-27UR373Z.js +1 -0
  20. package/dist/chunk-2PY65U6X.js +5 -0
  21. package/dist/{chunk-DQ3PI7EP.js → chunk-3D3PFPP5.js} +1 -1
  22. package/dist/chunk-4D7DIGAB.js +1 -0
  23. package/dist/{chunk-IND3TUVU.js → chunk-4UVGTFOX.js} +1 -1
  24. package/dist/chunk-5XJRCP3D.js +36 -0
  25. package/dist/chunk-62K2H72S.js +1 -0
  26. package/dist/chunk-6AXRIAP2.js +86 -0
  27. package/dist/chunk-6HJJHEL6.js +2 -0
  28. package/dist/{chunk-BHYTI3RH.js → chunk-6PBSAAS5.js} +1 -1
  29. package/dist/{chunk-MVLIONQD.js → chunk-7MQZQ4UU.js} +1 -1
  30. package/dist/chunk-7RLGOEWV.js +1 -0
  31. package/dist/{chunk-CV5HKU4P.js → chunk-7T4TSV5C.js} +1 -1
  32. package/dist/chunk-B4CPDK6J.js +2 -0
  33. package/dist/{chunk-SHXJ2GDR.js → chunk-DZ4VKAXB.js} +1 -1
  34. package/dist/{chunk-5EXZBCAZ.js → chunk-F4KBYFZ5.js} +1 -1
  35. package/dist/{chunk-LZQUZGXB.js → chunk-FRJYAJH6.js} +1 -1
  36. package/dist/chunk-FUPHQOJB.js +1 -0
  37. package/dist/{chunk-VKTUWUS6.js → chunk-GHB6QMQH.js} +1 -1
  38. package/dist/chunk-GR6442P7.js +1 -0
  39. package/dist/chunk-HPWLSLMC.js +8 -0
  40. package/dist/{chunk-KXG6E5VK.js → chunk-ICLYL3N5.js} +1 -1
  41. package/dist/chunk-IO54DFWR.js +691 -0
  42. package/dist/{chunk-RTVRZFIJ.js → chunk-KHEJO3JU.js} +1 -1
  43. package/dist/{chunk-IPJ5URDF.js → chunk-LOCPNNSK.js} +1 -1
  44. package/dist/chunk-LPCL4U4L.js +1 -0
  45. package/dist/{chunk-C35UXTDM.js → chunk-M5ICGR55.js} +1 -1
  46. package/dist/{chunk-SS2VV3D5.js → chunk-MBRU3VWJ.js} +2 -2
  47. package/dist/{chunk-DDQ3XK3H.js → chunk-MZFSINY7.js} +3 -3
  48. package/dist/chunk-OTDGTAZJ.js +1 -0
  49. package/dist/chunk-P4OSLAVD.js +3 -0
  50. package/dist/chunk-PS5F4DCT.js +1 -0
  51. package/dist/{chunk-C3FLCDRN.js → chunk-PTTZPDLX.js} +1 -1
  52. package/dist/chunk-Q6CUJ3WF.js +10 -0
  53. package/dist/{chunk-MV7KF75Q.js → chunk-QURMI7ID.js} +1 -1
  54. package/dist/{chunk-RVQLMTTI.js → chunk-ULR66OJR.js} +1 -1
  55. package/dist/chunk-WJVB6SSD.js +16 -0
  56. package/dist/chunk-WJY7ZXVJ.js +2 -0
  57. package/dist/{chunk-6UTM5AJI.js → chunk-XHRHNVCZ.js} +1 -1
  58. package/dist/chunk-ZTKIBREF.js +1 -0
  59. package/dist/{chunk-BQGBU2Y3.js → chunk-ZVOEPWQM.js} +1 -1
  60. package/dist/{create-I23DC7SN.js → create-ESK3CQPK.js} +1 -1
  61. package/dist/{doctor-DOOMYLIH.js → doctor-DLEBZSF7.js} +1 -1
  62. package/dist/index.d.ts +26 -11
  63. package/dist/index.js +129 -129
  64. package/dist/{pipeline-U77HSINC.js → pipeline-NT6AYYWM.js} +1 -1
  65. package/dist/{project-intelligence-lens-BKKVPCLC.js → project-intelligence-lens-Q4SZDI2N.js} +1 -1
  66. package/dist/project-test-coverage-A677ZLW3.js +1 -0
  67. package/dist/verified-goal-MJNZROS5.js +1 -0
  68. package/dist/{workspace-ZEYUVR26.js → workspace-LSOZM2CG.js} +1 -1
  69. package/dist/{workspace-agent-sync-DKYJLUDP.js → workspace-agent-sync-RZBQXCNJ.js} +1 -1
  70. package/dist/{workspace-archive-4JNT4S7N.js → workspace-archive-ZOWQXWJ6.js} +1 -1
  71. package/dist/workspace-context-IYJKO5BN.js +1 -0
  72. package/dist/{workspace-contract-PVLGPBBV.js → workspace-contract-AZFISDLS.js} +1 -1
  73. package/dist/workspace-explain-26UGV7L4.js +1 -0
  74. package/dist/workspace-explain-contract-GIWPCCEF.js +1 -0
  75. package/dist/{workspace-feedback-RATRXFUC.js → workspace-feedback-LIHEWTNV.js} +1 -1
  76. package/dist/{workspace-foundation-D33LJLGT.js → workspace-foundation-H5UTAUXQ.js} +1 -1
  77. package/dist/{workspace-graph-stream-THNG2T7R.js → workspace-graph-stream-KUDOZE73.js} +1 -1
  78. package/dist/workspace-graph-token-efficiency-5FNH4JZ5.js +1 -0
  79. package/dist/{workspace-history-EWFPT74O.js → workspace-history-HULG5EFN.js} +1 -1
  80. package/dist/{workspace-intelligence-MCNSWWDV.js → workspace-intelligence-A4UE4DZK.js} +1 -1
  81. package/dist/{workspace-intelligence-evaluation-7CABG5Y6.js → workspace-intelligence-evaluation-AOLGHYHC.js} +1 -1
  82. package/dist/workspace-intelligence-runner-42QI5RYA.js +1 -0
  83. package/dist/{workspace-intelligence-runtime-registry-ZZ3GRAL2.js → workspace-intelligence-runtime-registry-YOQ5GFFJ.js} +1 -1
  84. package/dist/{workspace-knowledge-graph-2EYR7N56.js → workspace-knowledge-graph-LEM6X5CM.js} +1 -1
  85. package/dist/{workspace-knowledge-graph-query-VOSPPH4W.js → workspace-knowledge-graph-query-EKHIE3E2.js} +1 -1
  86. package/dist/{workspace-mcp-serve-FLAVKWYW.js → workspace-mcp-serve-N2QPR7VJ.js} +1 -1
  87. package/dist/{workspace-model-FMFYLHE4.js → workspace-model-FJXX3NET.js} +1 -1
  88. package/dist/{workspace-onboarding-MYROZDI2.js → workspace-onboarding-IKFISWWY.js} +1 -1
  89. package/dist/workspace-readme-E2M35RJH.js +77 -0
  90. package/dist/{workspace-registry-summary-6VXIAQLX.js → workspace-registry-summary-HOQ3OBNT.js} +1 -1
  91. package/dist/workspace-run-GOZTUGJS.js +1 -0
  92. package/dist/{workspace-verify-FKYI65UQ.js → workspace-verify-32AWCJQG.js} +1 -1
  93. package/dist/workspace-watch-4WVNB26E.js +1 -0
  94. package/docs/README.md +1 -0
  95. package/docs/README_CONTENT_CONTRACT.md +98 -124
  96. package/docs/ci-workflows.md +53 -15
  97. package/docs/commands-reference.md +16 -2
  98. package/docs/doctor-command.md +16 -0
  99. package/docs/workspace-intelligence-runner.md +48 -0
  100. package/docs/workspace-knowledge-graph.md +39 -0
  101. package/docs/workspace-operations.md +9 -6
  102. package/package.json +9 -4
  103. package/scripts/enterprise-package-smoke.mjs +11 -0
  104. package/templates/kits/fastapi-ddd/README.md.j2 +1 -1
  105. package/templates/kits/fastapi-standard/README.md.j2 +1 -1
  106. package/templates/kits/nestjs-standard/Dockerfile.j2 +1 -1
  107. package/templates/kits/nestjs-standard/README.md.j2 +1 -1
  108. package/templates/kits/nestjs-standard/package.json.j2 +11 -2
  109. package/dist/analyze-ZFQWTCJQ.js +0 -1
  110. package/dist/artifact-remediation-plan-ICN3KOFG.js +0 -3
  111. package/dist/autopilot-release-VKXQ7BS7.js +0 -1
  112. package/dist/chunk-2AXEGYPL.js +0 -1
  113. package/dist/chunk-2D4UOYOJ.js +0 -1
  114. package/dist/chunk-AHLMIL2T.js +0 -1
  115. package/dist/chunk-AL2A7Q4X.js +0 -86
  116. package/dist/chunk-GNQRYISX.js +0 -5
  117. package/dist/chunk-I42F552T.js +0 -2
  118. package/dist/chunk-IDQKVJUF.js +0 -2
  119. package/dist/chunk-JFUD73OZ.js +0 -933
  120. package/dist/chunk-KKAOTTYO.js +0 -8
  121. package/dist/chunk-KMLPHFLD.js +0 -2
  122. package/dist/chunk-L2YK5RV2.js +0 -1
  123. package/dist/chunk-LAJM2SBP.js +0 -15
  124. package/dist/chunk-TDTCMZK7.js +0 -10
  125. package/dist/chunk-UETZ7USY.js +0 -36
  126. package/dist/chunk-WDKNMTJQ.js +0 -1
  127. package/dist/chunk-YPKNQCLK.js +0 -2
  128. package/dist/project-test-coverage-4TEHZJFC.js +0 -1
  129. package/dist/workspace-context-IHUFMZT3.js +0 -1
  130. package/dist/workspace-explain-64HNKAHO.js +0 -1
  131. package/dist/workspace-explain-contract-H7O26QJU.js +0 -1
  132. package/dist/workspace-graph-token-efficiency-CFGFCJ5V.js +0 -1
  133. package/dist/workspace-intelligence-runner-TG2VLHNZ.js +0 -1
  134. package/dist/workspace-run-2ZI5UMJ2.js +0 -1
  135. package/dist/workspace-watch-RP5KMVP2.js +0 -1
@@ -1,2 +1,2 @@
1
- import {a as a$1}from'./chunk-AFIFZTOY.js';import {a,c,b,i}from'./chunk-AHLMIL2T.js';import j from'path';var m=Object.keys(a).flatMap(r=>{let o=r,a$1=b[o],t=c[o];return !a$1||!t?[]:[{artifactPath:a[o],schemaVersion:a$1,contractPath:t}]}),d=[{artifactPath:".workspai/workspace-link.local.json",schemaVersion:"project-workspace-link.v1",contractPath:"contracts/project-workspace-link.v1.json"},{artifactPath:".workspai/reports/project-context-agent.json",schemaVersion:"project-context-agent.v1",contractPath:"contracts/workspace-intelligence/project-context-agent.v1.json"},{artifactPath:".workspai/workspace.contract.json",schemaVersion:1,contractPath:"contracts/workspace-contract.v1.json"},{artifactPath:".workspai/cache/workspace-model.v1.json",schemaVersion:"workspace-model-cache.v1",contractPath:"contracts/workspace-model-cache.v1.json"},{artifactPath:".workspai/workspace-registry.v1.json",schemaVersion:"workspace-registry.v1",contractPath:"contracts/workspace-registry.v1.json"},{artifactPath:".workspai/compatibility-matrix.json",schemaVersion:"rapidkit.compatibility-matrix.v1",contractPath:"contracts/compatibility-matrix.v1.json"},{artifactPath:".workspai/reports/doctor-workspace-cache.json",schemaVersion:"doctor-workspace-cache-v2",contractPath:"contracts/doctor-workspace-cache.v2.json"},{artifactPath:".workspai/reports/bootstrap-compliance.latest.json",schemaVersion:"bootstrap-compliance.v1",contractPath:"contracts/bootstrap-compliance.v1.json"},{artifactPath:".workspai/reports/mirror-ops.latest.json",schemaVersion:"mirror-ops.v1",contractPath:"contracts/mirror-ops.v1.json"},{artifactPath:".workspai/reports/transparency-evidence.latest.json",schemaVersion:"transparency-evidence.v1",contractPath:"contracts/transparency-evidence.v1.json"},{artifactPath:".workspai/reports/share-bundle.json",schemaVersion:"1.1",schemaVersionField:"schema_version",contractPath:"contracts/workspace-share-bundle.v1.json"},{artifactPath:".workspai/reports/doctor-project-last-run.json",schemaVersion:"doctor-project-evidence-v1",contractPath:"contracts/doctor-project-evidence.v1.json"},{artifactPath:".workspai/reports/project-test-coverage-last-run.json",schemaVersion:"workspai.project-test-coverage.v1",contractPath:"contracts/project-test-coverage.v1.json"},{artifactPath:".workspai/reports/doctor-remediation-plan-last-run.json",schemaVersion:"doctor-remediation-plan-v2",contractPath:"contracts/doctor-remediation-plan.v2.json"},{artifactPath:".workspai/reports/artifact-remediation-plan-last-run.json",schemaVersion:"artifact-remediation-plan-v1",contractPath:"contracts/artifact-remediation-plan.v1.json"},{artifactPath:".workspai/reports/doctor-fix-result-last-run.json",schemaVersion:"rapidkit-doctor-fix-result-v1",contractPath:"contracts/workspace-intelligence/doctor-fix-result.v1.json"},{artifactPath:".workspai/reports/pipeline-last-run.json",schemaVersion:"rapidkit-pipeline-v1",contractPath:"contracts/pipeline-last-run.v1.json"},{artifactPath:".workspai/reports/autopilot-release-last-run.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json"},{artifactPath:".workspai/reports/autopilot-release.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json"},{artifactPath:".workspai/reports/workspace-run-last.json",schemaVersion:"workspace-run-v1",contractPath:"contracts/workspace-run-last.v1.json"},{artifactPath:".workspai/reports/workspai-mcp-design.json",schemaVersion:"workspai-mcp-design.v1",contractPath:"contracts/workspace-intelligence/mcp-design.v1.json"},{artifactPath:".workspai/reports/rapidkit-mcp-design.json",schemaVersion:"workspai-mcp-design.v1",contractPath:"contracts/workspace-intelligence/mcp-design.v1.json"},{artifactPath:".workspai/reports/workspace-why-last-run.json",schemaVersion:b.explain,contractPath:c.explain},{artifactPath:".workspai/reports/workspace-trace-last-run.json",schemaVersion:b.explain,contractPath:c.explain},{artifactPath:".vscode/workspai-agent-hooks.json",schemaVersion:"workspai-agent-hooks.v1",contractPath:"contracts/workspace-intelligence/agent-hooks.v1.json"},{artifactPath:".workspai/reports/infra-plan.json",schemaVersion:"rapidkit.infra-plan.v1",contractPath:"contracts/infra-plan.v1.json"}],u={".workspai/workspace-link.local.json":[["adopt"],["import"],["project","workspace","relink"],["workspace","sync"]],".workspai/reports/project-context-agent.json":[["adopt"],["import"],["workspace","sync"],["workspace","agent-sync","--write"]],".workspai/workspace.contract.json":[["workspace","sync"],["workspace","contract","sync"]],[a.intelligenceRun]:[["workspace","intelligence","run"]],[a.snapshot]:[["workspace","snapshot"]],[a.history]:[["workspace","feedback","record","--json"]],[a.evaluationLive]:[["workspace","eval","init"],["workspace","eval","record","--json"]],[a.evaluationLastRun]:[["workspace","eval","report","--json"]],".workspai/cache/workspace-model.v1.json":[["workspace","model"]],".workspai/workspace-registry.v1.json":[["workspace","sync"]],".workspai/compatibility-matrix.json":[["bootstrap"]],".workspai/reports/doctor-workspace-cache.json":[["doctor","workspace"]],".workspai/reports/bootstrap-compliance.latest.json":[["bootstrap"]],".workspai/reports/mirror-ops.latest.json":[["mirror","status"]],".workspai/reports/transparency-evidence.latest.json":[["mirror","sync"]],".workspai/reports/share-bundle.json":[["workspace","share"]],".workspai/reports/doctor-project-last-run.json":[["doctor","project"]],".workspai/reports/project-test-coverage-last-run.json":[["project","coverage"]],".workspai/reports/doctor-remediation-plan-last-run.json":[["workspace","remediation-plan"]],".workspai/reports/artifact-remediation-plan-last-run.json":[["workspace","remediation-plan"]],".workspai/reports/doctor-fix-result-last-run.json":[["doctor","workspace"]],".workspai/reports/pipeline-last-run.json":[["pipeline"]],".workspai/reports/autopilot-release-last-run.json":[["autopilot","release"]],".workspai/reports/autopilot-release.json":[["autopilot","release"]],".workspai/reports/workspace-run-last.json":[["workspace","run"]],".workspai/reports/workspai-mcp-design.json":[["workspace","agent-sync","--write"]],".workspai/reports/rapidkit-mcp-design.json":[["workspace","agent-sync","--write"]],".workspai/reports/workspace-why-last-run.json":[["workspace","why"]],".workspai/reports/workspace-trace-last-run.json":[["workspace","trace"]],".vscode/workspai-agent-hooks.json":[["workspace","agent-sync"]],".workspai/reports/infra-plan.json":[["infra","plan"]]};function v(r){let o=Object.values(i).filter(t=>t.produces.includes(r)).map(t=>[...t.command]),a=u[r]??[];return [...o,...a.map(t=>[...t])]}var k=Object.freeze(Object.fromEntries([...m,...d].map(r=>[r.artifactPath,{...r,producerCommands:v(r.artifactPath)}])));function w(r){return r.split(j.sep).join("/").replace(/^\.\//,"")}var P=[{pattern:/^\.workspai\/reports\/bootstrap-compliance-[^/]+\.json$/,canonicalPath:".workspai/reports/bootstrap-compliance.latest.json"},{pattern:/^\.workspai\/reports\/mirror-ops-[^/]+\.json$/,canonicalPath:".workspai/reports/mirror-ops.latest.json"},{pattern:/^\.workspai\/reports\/transparency-evidence-[^/]+\.json$/,canonicalPath:".workspai/reports/transparency-evidence.latest.json"},{pattern:/^\.workspai\/reports\/projects\/[^/]+\/doctor-project-last-run\.json$/,canonicalPath:".workspai/reports/doctor-project-last-run.json"},{pattern:/^\.workspai\/reports\/projects\/[^/]+\/project-test-coverage-last-run\.json$/,canonicalPath:".workspai/reports/project-test-coverage-last-run.json"}];function f(r){let o=w(r),a=k[o];if(a)return a;let t=P.find(e=>e.pattern.test(o));return t?k[t.canonicalPath]??null:null}function E(r,o,a=r){let t=w(r),e=f(r);if(!e){if(t.startsWith(".workspai/reports/")&&t.endsWith(".json"))throw new Error(`${a} is a public workspace report without a registered artifact contract`);return}let h=e.schemaVersionField??"schemaVersion",i=o&&typeof o=="object"?o[h]:void 0;if(i!==e.schemaVersion)throw new Error(`${a} schemaVersion is ${String(i)}, expected ${e.schemaVersion}`);a$1(o,e.contractPath,a);}
1
+ import {a as a$1}from'./chunk-AFIFZTOY.js';import {a,c,b,i}from'./chunk-62K2H72S.js';import j from'path';var m=Object.keys(a).flatMap(r=>{let o=r,a$1=b[o],t=c[o];return !a$1||!t?[]:[{artifactPath:a[o],schemaVersion:a$1,contractPath:t}]}),d=[{artifactPath:".workspai/workspace-link.local.json",schemaVersion:"project-workspace-link.v1",contractPath:"contracts/project-workspace-link.v1.json"},{artifactPath:".workspai/reports/project-context-agent.json",schemaVersion:"project-context-agent.v1",contractPath:"contracts/workspace-intelligence/project-context-agent.v1.json"},{artifactPath:".workspai/workspace.contract.json",schemaVersion:1,contractPath:"contracts/workspace-contract.v1.json"},{artifactPath:".workspai/cache/workspace-model.v1.json",schemaVersion:"workspace-model-cache.v1",contractPath:"contracts/workspace-model-cache.v1.json"},{artifactPath:".workspai/workspace-registry.v1.json",schemaVersion:"workspace-registry.v1",contractPath:"contracts/workspace-registry.v1.json"},{artifactPath:".workspai/compatibility-matrix.json",schemaVersion:"rapidkit.compatibility-matrix.v1",contractPath:"contracts/compatibility-matrix.v1.json"},{artifactPath:".workspai/reports/doctor-workspace-cache.json",schemaVersion:"doctor-workspace-cache-v2",contractPath:"contracts/doctor-workspace-cache.v2.json"},{artifactPath:".workspai/reports/bootstrap-compliance.latest.json",schemaVersion:"bootstrap-compliance.v1",contractPath:"contracts/bootstrap-compliance.v1.json"},{artifactPath:".workspai/reports/mirror-ops.latest.json",schemaVersion:"mirror-ops.v1",contractPath:"contracts/mirror-ops.v1.json"},{artifactPath:".workspai/reports/transparency-evidence.latest.json",schemaVersion:"transparency-evidence.v1",contractPath:"contracts/transparency-evidence.v1.json"},{artifactPath:".workspai/reports/share-bundle.json",schemaVersion:"1.1",schemaVersionField:"schema_version",contractPath:"contracts/workspace-share-bundle.v1.json"},{artifactPath:".workspai/reports/doctor-project-last-run.json",schemaVersion:"doctor-project-evidence-v1",contractPath:"contracts/doctor-project-evidence.v1.json"},{artifactPath:".workspai/reports/project-test-coverage-last-run.json",schemaVersion:"workspai.project-test-coverage.v1",contractPath:"contracts/project-test-coverage.v1.json"},{artifactPath:".workspai/reports/doctor-remediation-plan-last-run.json",schemaVersion:"doctor-remediation-plan-v2",contractPath:"contracts/doctor-remediation-plan.v2.json"},{artifactPath:".workspai/reports/artifact-remediation-plan-last-run.json",schemaVersion:"artifact-remediation-plan-v1",contractPath:"contracts/artifact-remediation-plan.v1.json"},{artifactPath:".workspai/reports/doctor-fix-result-last-run.json",schemaVersion:"rapidkit-doctor-fix-result-v1",contractPath:"contracts/workspace-intelligence/doctor-fix-result.v1.json"},{artifactPath:".workspai/reports/pipeline-last-run.json",schemaVersion:"rapidkit-pipeline-v1",contractPath:"contracts/pipeline-last-run.v1.json"},{artifactPath:".workspai/reports/autopilot-release-last-run.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json"},{artifactPath:".workspai/reports/autopilot-release.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json"},{artifactPath:".workspai/reports/workspace-run-last.json",schemaVersion:"workspace-run-v1",contractPath:"contracts/workspace-run-last.v1.json"},{artifactPath:".workspai/reports/workspai-mcp-design.json",schemaVersion:"workspai-mcp-design.v1",contractPath:"contracts/workspace-intelligence/mcp-design.v1.json"},{artifactPath:".workspai/reports/rapidkit-mcp-design.json",schemaVersion:"workspai-mcp-design.v1",contractPath:"contracts/workspace-intelligence/mcp-design.v1.json"},{artifactPath:".workspai/reports/workspace-why-last-run.json",schemaVersion:b.explain,contractPath:c.explain},{artifactPath:".workspai/reports/workspace-trace-last-run.json",schemaVersion:b.explain,contractPath:c.explain},{artifactPath:".vscode/workspai-agent-hooks.json",schemaVersion:"workspai-agent-hooks.v1",contractPath:"contracts/workspace-intelligence/agent-hooks.v1.json"},{artifactPath:".workspai/reports/infra-plan.json",schemaVersion:"rapidkit.infra-plan.v1",contractPath:"contracts/infra-plan.v1.json"}],u={".workspai/workspace-link.local.json":[["adopt"],["import"],["project","workspace","relink"],["workspace","sync"]],".workspai/reports/project-context-agent.json":[["adopt"],["import"],["workspace","sync"],["workspace","agent-sync","--write"]],".workspai/workspace.contract.json":[["workspace","sync"],["workspace","contract","sync"]],[a.intelligenceRun]:[["workspace","intelligence","run"]],[a.snapshot]:[["workspace","snapshot"]],[a.history]:[["workspace","feedback","record","--json"]],[a.evaluationLive]:[["workspace","eval","init"],["workspace","eval","record","--json"]],[a.evaluationLastRun]:[["workspace","eval","report","--json"]],[a.verifiedGoalStatus]:[["workspace","goal","plan"],["workspace","goal","verify"]],".workspai/cache/workspace-model.v1.json":[["workspace","model"]],".workspai/workspace-registry.v1.json":[["workspace","sync"]],".workspai/compatibility-matrix.json":[["bootstrap"]],".workspai/reports/doctor-workspace-cache.json":[["doctor","workspace"]],".workspai/reports/bootstrap-compliance.latest.json":[["bootstrap"]],".workspai/reports/mirror-ops.latest.json":[["mirror","status"]],".workspai/reports/transparency-evidence.latest.json":[["mirror","sync"]],".workspai/reports/share-bundle.json":[["workspace","share"]],".workspai/reports/doctor-project-last-run.json":[["doctor","project"]],".workspai/reports/project-test-coverage-last-run.json":[["project","coverage"]],".workspai/reports/doctor-remediation-plan-last-run.json":[["workspace","remediation-plan"]],".workspai/reports/artifact-remediation-plan-last-run.json":[["workspace","remediation-plan"]],".workspai/reports/doctor-fix-result-last-run.json":[["doctor","workspace"]],".workspai/reports/pipeline-last-run.json":[["pipeline"]],".workspai/reports/autopilot-release-last-run.json":[["autopilot","release"]],".workspai/reports/autopilot-release.json":[["autopilot","release"]],".workspai/reports/workspace-run-last.json":[["workspace","run"]],".workspai/reports/workspai-mcp-design.json":[["workspace","agent-sync","--write"]],".workspai/reports/rapidkit-mcp-design.json":[["workspace","agent-sync","--write"]],".workspai/reports/workspace-why-last-run.json":[["workspace","why"]],".workspai/reports/workspace-trace-last-run.json":[["workspace","trace"]],".vscode/workspai-agent-hooks.json":[["workspace","agent-sync"]],".workspai/reports/infra-plan.json":[["infra","plan"]]};function v(r){let o=Object.values(i).filter(t=>t.produces.includes(r)).map(t=>[...t.command]),a=u[r]??[];return [...o,...a.map(t=>[...t])]}var k=Object.freeze(Object.fromEntries([...m,...d].map(r=>[r.artifactPath,{...r,producerCommands:v(r.artifactPath)}])));function w(r){return r.split(j.sep).join("/").replace(/^\.\//,"")}var P=[{pattern:/^\.workspai\/reports\/bootstrap-compliance-[^/]+\.json$/,canonicalPath:".workspai/reports/bootstrap-compliance.latest.json"},{pattern:/^\.workspai\/reports\/mirror-ops-[^/]+\.json$/,canonicalPath:".workspai/reports/mirror-ops.latest.json"},{pattern:/^\.workspai\/reports\/transparency-evidence-[^/]+\.json$/,canonicalPath:".workspai/reports/transparency-evidence.latest.json"},{pattern:/^\.workspai\/reports\/projects\/[^/]+\/doctor-project-last-run\.json$/,canonicalPath:".workspai/reports/doctor-project-last-run.json"},{pattern:/^\.workspai\/reports\/projects\/[^/]+\/project-test-coverage-last-run\.json$/,canonicalPath:".workspai/reports/project-test-coverage-last-run.json"}];function f(r){let o=w(r),a=k[o];if(a)return a;let t=P.find(e=>e.pattern.test(o));return t?k[t.canonicalPath]??null:null}function E(r,o,a=r){let t=w(r),e=f(r);if(!e){if(t.startsWith(".workspai/reports/")&&t.endsWith(".json"))throw new Error(`${a} is a public workspace report without a registered artifact contract`);return}let h=e.schemaVersionField??"schemaVersion",i=o&&typeof o=="object"?o[h]:void 0;if(i!==e.schemaVersion)throw new Error(`${a} schemaVersion is ${String(i)}, expected ${e.schemaVersion}`);a$1(o,e.contractPath,a);}
2
2
  export{f as a,E as b};
@@ -0,0 +1,16 @@
1
+ import {i}from'./chunk-VRW6KXNK.js';import {b,a}from'./chunk-TQEMLBAG.js';import {u as u$1}from'./chunk-MOSXTVPU.js';import {e,h,c}from'./chunk-RJIYCDVC.js';import ee from'validate-npm-package-name';import w from'path';import {spawn}from'child_process';import d from'chalk';import g from'fs-extra';var f=class extends Error{constructor(n,r,i){super(n);this.code=r;this.details=i;this.name="RapidKitError",Error.captureStackTrace(this,this.constructor);}code;details},q=class extends f{constructor(t,n){let r=n?`Python ${t}+ required, found ${n}`:`Python ${t}+ not found`;super(r,"PYTHON_NOT_FOUND","Please install Python from https://www.python.org/downloads/");}},V=class extends f{constructor(){super("Poetry is not installed","POETRY_NOT_FOUND","Install Poetry from https://python-poetry.org/docs/#installation");}},L=class extends f{constructor(){super("pipx is not installed","PIPX_NOT_FOUND","Install pipx from https://pypa.github.io/pipx/installation/");}},M=class extends f{constructor(t){super(`Directory "${t}" already exists`,"DIRECTORY_EXISTS","Please choose a different name or remove the existing directory");}},u=class extends f{constructor(t,n){super(`Invalid project name: "${t}"`,"INVALID_PROJECT_NAME",n);}},J=class extends f{constructor(t,n){let r=`Installation failed at: ${t}`,i=`${n.message}
2
+
3
+ Troubleshooting:
4
+ - Check your internet connection
5
+ - Verify Python/Poetry installation
6
+ - Try running with --debug flag for more details`;super(r,"INSTALLATION_ERROR",i);}},W=class extends f{constructor(){super("RapidKit Python package is not yet available on PyPI","RAPIDKIT_NOT_AVAILABLE",`Available options:
7
+ 1. Install Python 3.10+ and retry the same command
8
+ 2. Use the core workflow: npx workspai create workspace <name>
9
+ 3. Offline fallback (limited): npx workspai create project fastapi.standard <name> --output .
10
+
11
+ Legacy: set RAPIDKIT_SHOW_LEGACY=1 to reveal template-mode flags in help.`);}};function _(e){let t=ee(e);if(!t.validForNewPackages){let r=t.errors||[],i=t.warnings||[],o=[...r,...i];throw new u(e,`NPM validation failed: ${o.join(", ")}`)}if(!/^[a-z][a-z0-9_-]*$/.test(e))throw new u(e,"Must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, and underscores");if(["test","tests","src","dist","build","lib","python","pip","poetry","node","npm","rapidkit","rapidkit"].includes(e.toLowerCase()))throw new u(e,`"${e}" is a reserved name. Please choose a different name.`);if(e.length<2)throw new u(e,"Name must be at least 2 characters long");if(e.length>214)throw new u(e,"Name must be less than 214 characters");return true}async function D(e,t){let n={},r={};return await te(e,n,r),await ne(e,n,r),{policy:"latest-stable",requested_channel:t,host:{node:process.versions.node,platform:process.platform,arch:process.arch},declared:U(n),resolved:U(r)}}async function te(e,t,n){let r=w.join(e,"package.json");if(!await g.pathExists(r))return;let i=await g.readJson(r);for(let l of ["dependencies","devDependencies","peerDependencies"]){let s=T(i[l]);for(let[p,v]of Object.entries(s))t[`npm:${p}`]=v;}for(let[l,s]of Object.entries(T(i.engines)))t[`engine:${l}`]=s;let o=w.join(e,"package-lock.json");if(!await g.pathExists(o))return;let a=await g.readJson(o),c=S(a.packages);for(let l of Object.keys(t).filter(s=>s.startsWith("npm:")).map(s=>s.slice(4))){let s=S(c[`node_modules/${l}`]);typeof s.version=="string"&&(n[`npm:${l}`]=s.version);}}async function ne(e,t,n){let r=w.join(e,"composer.json");if(!await g.pathExists(r))return;let i=await g.readJson(r);for(let c of ["require","require-dev"])for(let[l,s]of Object.entries(T(i[c])))t[`composer:${l}`]=s;let o=w.join(e,"composer.lock");if(!await g.pathExists(o))return;let a=await g.readJson(o);for(let c of ["packages","packages-dev"]){let l=Array.isArray(a[c])?a[c]:[];for(let s of l){let p=S(s);typeof p.name=="string"&&typeof p.version=="string"&&(n[`composer:${p.name}`]=p.version);}}}function T(e){return !e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="string"))}function S(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function U(e){return Object.fromEntries(Object.entries(e).sort(([t],[n])=>t.localeCompare(n)))}var B=[{id:"nextjs",kitId:"frontend.nextjs",aliases:["frontend.nextjs","next","nextjs","next.js"],displayName:"Next.js",framework:"nextjs",defaultPort:3e3,versionPolicy:"latest-stable",commandDisplay:e=>`npx create-next-app@latest ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","create-next-app@latest",e,"--yes",...t.skipGit?["--disable-git"]:[],...t.skipInstall?["--skip-install"]:[]]})},{id:"remix",kitId:"frontend.remix",aliases:["frontend.remix","remix","remix-run","react-router"],displayName:"React Router",framework:"remix",defaultPort:5173,versionPolicy:"latest-stable",minNodeVersion:"22.22.0",minNodeMessage:"The latest stable React Router generator requires Node.js 22.22.0 or newer. Upgrade Node.js, then retry.",commandDisplay:e=>`npx create-react-router@latest ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","create-react-router@latest",e,"--yes",...t.skipInstall?["--no-install"]:["--install"],"--no-git-init"]})},{id:"vite-react",kitId:"frontend.vite-react",aliases:["frontend.vite-react","vite-react","react","vite.react"],displayName:"React + Vite",framework:"react",defaultPort:5173,versionPolicy:"latest-stable",commandDisplay:e=>`npm create vite@latest ${e} -- --template react-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","react-ts","--no-interactive"]})},{id:"vite-vue",kitId:"frontend.vite-vue",aliases:["frontend.vite-vue","vite-vue","vue","vite.vue"],displayName:"Vue + Vite",framework:"vue",defaultPort:5173,versionPolicy:"latest-stable",commandDisplay:e=>`npm create vite@latest ${e} -- --template vue-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","vue-ts","--no-interactive"]})},{id:"vite-svelte",kitId:"frontend.vite-svelte",aliases:["frontend.vite-svelte","vite-svelte","svelte","vite.svelte"],displayName:"Svelte + Vite",framework:"svelte",defaultPort:5173,versionPolicy:"latest-stable",commandDisplay:e=>`npm create vite@latest ${e} -- --template svelte-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","svelte-ts","--no-interactive"]})},{id:"vite-solid",kitId:"frontend.vite-solid",aliases:["frontend.vite-solid","vite-solid","solid","solidjs","vite.solid"],displayName:"Solid + Vite",framework:"solid",defaultPort:5173,versionPolicy:"latest-stable",commandDisplay:e=>`npm create vite@latest ${e} -- --template solid-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","solid-ts","--no-interactive"]})},{id:"vite-vanilla",kitId:"frontend.vite-vanilla",aliases:["frontend.vite-vanilla","vite","vanilla","vite-vanilla"],displayName:"Vite",framework:"vite",defaultPort:5173,versionPolicy:"latest-stable",commandDisplay:e=>`npm create vite@latest ${e} -- --template vanilla-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","vanilla-ts","--no-interactive"]})},{id:"nuxt",kitId:"frontend.nuxt",aliases:["frontend.nuxt","nuxt","nuxtjs","nuxt.js"],displayName:"Nuxt",framework:"nuxt",defaultPort:3e3,versionPolicy:"latest-stable",commandDisplay:(e,t)=>`npx create-nuxt@latest ${e} --template minimal --packageManager npm --gitInit ${t?.skipGit?"false":"true"}${t?.skipInstall?" --no-install":""}`,commandExec:(e,t)=>({command:"npx",args:["--yes","create-nuxt@latest",e,"--template","minimal","--packageManager","npm","--gitInit",t.skipGit?"false":"true",...t.skipInstall?["--no-install"]:[]]})},{id:"angular",kitId:"frontend.angular",aliases:["frontend.angular","angular","ng"],displayName:"Angular",framework:"angular",defaultPort:4200,versionPolicy:"latest-stable",minNodeMajor:20,minNodeMessage:"The latest stable Angular CLI requires a modern Node.js runtime. Upgrade to Node.js 20.19+ (or a newer supported LTS), then retry.",commandDisplay:e=>`npx @angular/cli@latest new ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","@angular/cli@latest","new",e,"--defaults","--skip-git",...t.skipInstall?["--skip-install"]:[]]})},{id:"astro",kitId:"frontend.astro",aliases:["frontend.astro","astro"],displayName:"Astro",framework:"astro",defaultPort:4321,versionPolicy:"latest-stable",commandDisplay:e=>`npm create astro@latest ${e}`,commandExec:(e,t)=>({command:"npm",args:["create","astro@latest",e,"--","--yes",...t.skipInstall?["--no-install"]:[],...t.skipGit?["--no-git"]:[]]})},{id:"sveltekit",kitId:"frontend.sveltekit",aliases:["frontend.sveltekit","sveltekit","svelte-kit"],displayName:"SvelteKit",framework:"sveltekit",defaultPort:5173,versionPolicy:"latest-stable",commandDisplay:e=>`npx sv@latest create ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","sv@latest","create",e,"--template","minimal","--types","ts","--no-add-ons",...t.skipInstall?["--no-install"]:["--install","npm"]]})}],G=new Map;for(let e of B){G.set(e.id,e),G.set(e.kitId,e);for(let t of e.aliases)G.set(t.toLowerCase(),e);}function Me(){return [...B]}function P(e){return e?G.get(e.trim().toLowerCase())??null:null}function Je(e){return !!P(e)}function We(e){if(e[0]!=="create"||e[1]!=="frontend")return null;let t=e[2],n=e[3],r=e.slice(4),i=P(t);return i?["create","project",i.kitId,n??"",...r].filter(Boolean):["create","project",`frontend.${t??""}`,n??"",...r].filter(Boolean)}function K(e,t){return `workspai create project ${P(e)?.id??e.replace(/^frontend\./,"")} ${t}`}function z(e,t){return `npx ${K(e,t)}`}function oe(e){let t=P(e);return t?`${K(t.id,"<name>")} [--output <dir>] [--skip-install] [--dry-run]`:"workspai create project <nextjs|remix|vite-react|vite-vue|vite-svelte|vite-solid|vite-vanilla|nuxt|angular|astro|sveltekit> <name> [--output <dir>] [--skip-install] [--dry-run]"}async function Ue(e){let t=e.args;if(t[0]!=="create"||t[1]!=="project")throw new Error("Frontend create expects normalized args: create project <frontend.kit> <name>");let n=P(t[2]);if(!n)throw new Error(`Unknown frontend generator: ${t[2]??"(missing)"}`);let r=t[3];if(!r)throw new Error(`Usage: ${oe(n.id)}`);_(r);let i=pe(t,"--output")||process.cwd(),o=w.resolve(i,r),a=e.dryRun===true||t.includes("--dry-run"),c=t.includes("--skip-install"),l=t.includes("--skip-git")||t.includes("--no-git"),s=n.commandExec(r,{skipGit:l,skipInstall:c}),p=n.commandDisplay(r,{skipGit:l,skipInstall:c});if(await g.pathExists(o))throw new Error(`Directory "${o}" already exists`);if(a)return ae({definition:n,projectName:r,projectPath:o,commandPlan:s}),{definition:n,projectName:r,projectPath:o,dryRun:a,commandDisplay:p,commandExec:[s.command,...s.args]};ce(n),await g.ensureDir(w.dirname(o));try{let v=await Y(s.command,s.args,w.dirname(o)),Z=await de(o);if(v!==0)throw new Error(`Official ${n.displayName} generator failed with exit code ${v}`);if(!Z)throw new Error(`Official ${n.displayName} generator did not produce a valid package.json`);l||await me(o),await ie({definition:n,projectName:r,projectPath:o,commandDisplay:p,commandExec:[s.command,...s.args],skipGit:l,skipInstall:c});}catch(v){throw await g.remove(o),v}return console.log(d.green(`\u2705 ${n.displayName} project created at ${o}`)),console.log(d.gray(` Display command: ${z(n.id,r)}`)),console.log(d.gray(" Next: cd "+r+" && npx workspai dev")),{definition:n,projectName:r,projectPath:o,dryRun:a,commandDisplay:p,commandExec:[s.command,...s.args]}}async function ie(e){let t=new Date().toISOString(),n=await i(),r=await D(e.projectPath,"latest"),i$1={schema_version:"1.0",name:e.projectName,slug:e.projectName,kind:"frontend",project_type:"frontend",category:"frontend",runtime:"node",framework:e.definition.framework,framework_display_name:e.definition.displayName,kit_name:e.definition.kitId,kit:e.definition.kitId,engine:"npm",support_tier:"extended",module_support:false,modules:[],workspai_version:n,rapidkit_version:n,generated_by:"workspai",generated_at:t,frontend:{generator:e.definition.id,official_generator:true,version_policy:e.definition.versionPolicy,version_evidence:r,default_port:e.definition.defaultPort,command_display:e.commandDisplay,command_exec:e.commandExec,skip_install:e.skipInstall,skip_git:e.skipGit},contracts:{owns:[],apis:[],publishes:[],consumes:[],dependsOn:[],env:[]}},o={project:e.projectName,runtime:"node",framework:e.definition.framework,kind:"frontend",category:"frontend",source:"official-generator"},a={kind:"workspai.frontend_create",schema_version:"1.0",generated_at:t,project:{name:e.projectName,path:e.projectPath,kind:"frontend",category:"frontend",runtime:"node",framework:e.definition.framework,framework_display_name:e.definition.displayName,kit_name:e.definition.kitId},generator:{id:e.definition.id,version_policy:e.definition.versionPolicy,version_evidence:r,command_display:e.commandDisplay,command_exec:e.commandExec}};for(let[c,l]of [["project.json",i$1],["context.json",o],["frontend-create.json",a]]){let s=u$1(e.projectPath,c);await g.ensureDir(w.dirname(s)),await g.writeJson(s,l,{spaces:2});}}function ae(e){console.log(d.bold(`
12
+ Workspai frontend create plan: ${e.definition.displayName}`)),console.log(d.gray(`Project: ${e.projectName}`)),console.log(d.gray(`Target: ${e.projectPath}`)),console.log(d.gray(`Show: ${z(e.definition.id,e.projectName)}`)),console.log(d.gray(`Run: ${[e.commandPlan.command,...e.commandPlan.args].join(" ")}`)),console.log(d.gray(`Default: http://localhost:${e.definition.defaultPort}`));}function se(){let e=Number.parseInt(process.versions.node.split(".")[0]??"",10);return Number.isFinite(e)?e:0}function ce(e){if(!e.minNodeVersion&&!e.minNodeMajor||(e.minNodeVersion?le(process.versions.node,e.minNodeVersion)>=0:se()>=(e.minNodeMajor??0)))return;let n=e.minNodeVersion??`${e.minNodeMajor}+`;throw new Error(e.minNodeMessage??`${e.displayName} requires Node.js ${n} (current: ${process.versions.node}).`)}function le(e,t){let n=e.split(".").map(o=>Number.parseInt(o,10)||0),r=t.split(".").map(o=>Number.parseInt(o,10)||0),i=Math.max(n.length,r.length);for(let o=0;o<i;o+=1){let a=(n[o]??0)-(r[o]??0);if(a!==0)return a}return 0}async function de(e){if(!await g.pathExists(e))return false;let t=w.join(e,"package.json");if(!await g.pathExists(t))return false;try{let n=await g.readJson(t);return n!==null&&typeof n=="object"&&!Array.isArray(n)}catch{return false}}async function me(e){let t=w.join(e,".git");if(await g.pathExists(t))return;if(await b(e)){console.log(d.gray(" Git initialization skipped; target is inside an existing git worktree."));return}if(await Y("git",["init"],e)===0){console.log(d.gray(" Git repository initialized."));return}console.log(d.yellow("\u26A0\uFE0F Git initialization was skipped or failed. You can run `git init` manually inside the project."));}async function Y(e$1,t,n){let r=e(e$1);return await new Promise(i=>{let o=spawn(r.command,[...r.prefixArgs,...t],{cwd:n,stdio:"inherit",shell:false,env:e$1==="git"?a(h()):h()});o.on("close",a=>i(a??1)),o.on("error",()=>i(1));})}function pe(e,t){let n=e.indexOf(t);if(n>=0&&n+1<e.length)return e[n+1];let r=e.find(i=>i.startsWith(`${t}=`));return r?r.slice(t.length+1):void 0}var Q=[{id:"tauri",kitId:"desktop.tauri",aliases:["desktop.tauri","tauri","tauri-app"],displayName:"Tauri",category:"desktop",kind:"desktop",runtime:"node",runtimeCandidates:["node","rust"],framework:"tauri",supportTier:"extended",versionPolicy:"latest-stable",defaultPort:1420,officialSource:"create-tauri-app",supportsSkipInstall:true,requiredTools:[{command:"rustc",args:["--version"],label:"Rust toolchain",guidance:"Install the current stable Rust toolchain from https://rustup.rs/ and retry."},{command:"cargo",args:["--version"],label:"Cargo",guidance:"Install Cargo through the current stable Rust toolchain and retry."}],commandDisplay:e=>`npm create tauri-app@latest ${e} -- --manager npm --template vanilla-ts --yes`,commandExec:e=>({command:"npm",args:["create","tauri-app@latest",e,"--","--manager","npm","--template","vanilla-ts","--yes"]}),requiredArtifacts:["package.json","src-tauri/Cargo.toml","src-tauri/tauri.conf.json"]},{id:"electron",kitId:"desktop.electron",aliases:["desktop.electron","electron","electron-forge"],displayName:"Electron Forge",category:"desktop",kind:"desktop",runtime:"node",runtimeCandidates:["node"],framework:"electron",supportTier:"extended",versionPolicy:"latest-stable",officialSource:"create-electron-app",supportsSkipInstall:false,requiredTools:[{command:"git",args:["--version"],label:"Git",guidance:"Install Git and make it available on PATH, then retry."}],commandDisplay:e=>`npx create-electron-app@latest ${e} --template=vite-typescript`,commandExec:e=>({command:"npx",args:["--yes","create-electron-app@latest",e,"--template=vite-typescript"]}),requiredArtifacts:["package.json"]},{id:"vscode-extension",kitId:"extension.vscode",aliases:["extension.vscode","vscode","vscode-extension","visual-studio-code-extension"],displayName:"VS Code Extension",category:"extension",kind:"extension",runtime:"node",runtimeCandidates:["node"],framework:"vscode-extension",supportTier:"extended",versionPolicy:"latest-stable",officialSource:"generator-code",supportsSkipInstall:false,nodeSupport:{requirement:"^22.22.2 || ^24.15.0 || >=26.0.0",ranges:[{major:22,minVersion:"22.22.2"},{major:24,minVersion:"24.15.0"},{minVersion:"26.0.0"}],guidance:"Install Node.js 22.22.2+, 24.15.0+, or 26+ before running the latest stable VS Code Extension generator."},requiredTools:[{command:"git",args:["--version"],label:"Git",guidance:"Install Git to initialize source control, or create the project with --skip-git."}],commandDisplay:e=>`npx --package yo@latest --package generator-code@latest -- yo code ${e} --quick --extensionType ts --pkgManager npm --bundle esbuild`,commandExec:(e,t)=>({command:"npx",args:["--yes","--package","yo@latest","--package","generator-code@latest","--","yo","code",e,"--quick","--extensionType","ts","--extensionId",e,"--pkgManager","npm","--bundle","esbuild",`--gitInit=${t.skipGit?"false":"true"}`]}),requiredArtifacts:["package.json","src/extension.ts"]},{id:"laravel",kitId:"php.laravel",aliases:["php.laravel","laravel","php-laravel"],displayName:"Laravel",category:"backend",kind:"backend",runtime:"php",runtimeCandidates:["php","node"],framework:"laravel",supportTier:"extended",versionPolicy:"latest-stable",defaultPort:8e3,officialSource:"composer-create-project",supportsSkipInstall:false,requiredTools:[{command:"php",args:["--version"],label:"PHP",guidance:"Install a PHP version supported by the latest stable Laravel release and retry."},{command:"composer",args:["--version"],label:"Composer",guidance:"Install the latest stable Composer release and retry."}],recommendedTools:[{command:"npm",args:["--version"],label:"npm",guidance:"Install a supported Node.js LTS runtime when you want to build Laravel frontend assets."}],commandDisplay:e=>`composer create-project --no-interaction --prefer-dist --stability=stable laravel/laravel ${e}`,commandExec:e=>({command:"composer",args:["create-project","--no-interaction","--prefer-dist","--stability=stable","laravel/laravel",e]}),requiredArtifacts:["composer.json","artisan"]}],O=new Map;for(let e of Q){O.set(e.id,e),O.set(e.kitId,e);for(let t of e.aliases)O.set(t.toLowerCase(),e);}function ot(){return [...Q]}function A(e){return e?O.get(e.trim().toLowerCase())??null:null}function it(e){return A(e)!==null}function fe(e){return `workspai create project ${A(e)?.kitId??"<desktop.tauri|desktop.electron|extension.vscode|php.laravel>"} <name> [--output <dir>] [--skip-git] [--skip-install] [--dry-run]`}async function at(e){if(e[0]!=="create"||e[1]!=="project")throw new Error("Official project create expects: create project <official.kit> <project-name>");let t=A(e[2]);if(!t)throw new Error(`Unknown official project generator: ${e[2]??"(missing)"}`);let n=e[3];if(!n)throw new Error(`Usage: ${fe(t.kitId)}`);_(n);let r=he(e,"--output")||process.cwd(),i=w.resolve(r,n),o=e.includes("--dry-run"),a={skipGit:e.includes("--skip-git")||e.includes("--no-git"),skipInstall:e.includes("--skip-install")};if(a.skipInstall&&!t.supportsSkipInstall)throw new Error(`${t.displayName}'s official generator does not support --skip-install. Remove the flag so Workspai can verify the official scaffold.`);let c=t.commandExec(n,a),l=t.commandDisplay(n,a);if(await g.pathExists(i))throw new Error(`Directory "${i}" already exists`);if(o)return we(t,i,l,c),{definition:t,projectName:n,projectPath:i,dryRun:o,commandDisplay:l,commandExec:[c.command,...c.args]};ve(t),await ke(t,a),await g.ensureDir(w.dirname(i));try{let s=await ye(c,w.dirname(i));if(s!==0)throw new Error(`Official ${t.displayName} generator failed with exit code ${s}`);await ge(t,i),a.skipGit&&await g.remove(w.join(i,".git")),await ue({definition:t,projectName:n,projectPath:i,commandDisplay:l,commandExec:[c.command,...c.args],flags:a});}catch(s){throw await g.remove(i).catch(()=>{}),s}return console.log(d.green(`
13
+ \u2713 ${t.displayName} scaffold ready`)),console.log(d.gray(` Location ${i}`)),console.log(d.gray(` Generator ${t.officialSource} \xB7 ${t.versionPolicy}`)),console.log(d.green(" \u2713 Required scaffold files verified")),console.log(d.green(" \u2713 Generator and version evidence recorded in .workspai/")),t.id==="vscode-extension"&&console.log(d.yellow(" Note Dependency warnings above come from the official generated project; Workspai keeps them visible for Doctor and CI.")),console.log(d.gray(` Next cd ${n} && npx workspai doctor project`)),{definition:t,projectName:n,projectPath:i,dryRun:o,commandDisplay:l,commandExec:[c.command,...c.args]}}async function ge(e,t){let n=[];for(let r of e.requiredArtifacts)await g.pathExists(w.join(t,r))||n.push(r);if(n.length>0)throw new Error(`Official ${e.displayName} generator did not produce required artifacts: ${n.join(", ")}`)}async function ue(e){let t=new Date().toISOString(),n=i(),r=await D(e.projectPath,e.definition.id==="laravel"?"stable":"latest"),i$1={schema_version:"1.0",name:e.projectName,slug:e.projectName,kind:e.definition.kind,project_type:e.definition.category,category:e.definition.category,runtime:e.definition.runtime,runtime_candidates:e.definition.runtimeCandidates,framework:e.definition.framework,framework_display_name:e.definition.displayName,kit_name:e.definition.kitId,kit:e.definition.kitId,engine:"npm",support_tier:e.definition.supportTier,version_policy:e.definition.versionPolicy,module_support:false,modules:[],workspai_version:n,rapidkit_version:n,generated_by:"workspai",generated_at:t,generator:{id:e.definition.id,source:e.definition.officialSource,official:true,version_policy:e.definition.versionPolicy,version_evidence:r,command_display:e.commandDisplay,command_exec:e.commandExec,skip_install:e.flags.skipInstall,skip_git:e.flags.skipGit},...e.definition.defaultPort?{ports:[{name:"http",port:e.definition.defaultPort,protocol:"http"}]}:{},contracts:{owns:[],apis:[],publishes:[],consumes:[],dependsOn:[],env:[]}},o={engine:"npm",project:e.projectName,kind:e.definition.kind,category:e.definition.category,runtime:e.definition.runtime,runtimeCandidates:e.definition.runtimeCandidates,framework:e.definition.framework,source:"official-generator",versionPolicy:e.definition.versionPolicy},a={schema_version:"1.0",kind:"workspai.official_project_create",generated_at:t,project:{name:e.projectName,path:e.projectPath,kind:e.definition.kind,category:e.definition.category,runtime:e.definition.runtime,runtime_candidates:e.definition.runtimeCandidates,framework:e.definition.framework,kit_name:e.definition.kitId},generator:i$1.generator,verified_artifacts:e.definition.requiredArtifacts};for(let[c,l]of [["project.json",i$1],["context.json",o],["official-create.json",a]]){let s=u$1(e.projectPath,c);await g.ensureDir(w.dirname(s)),await g.writeJson(s,l,{spaces:2});}}async function ye(e$1,t){let n=e(e$1.command);return await new Promise(r=>{let i=h(),o=spawn(n.command,[...n.prefixArgs,...e$1.args],{cwd:t,stdio:"inherit",shell:c()&&n.command===e$1.command&&n.prefixArgs.length===0,env:e$1.command==="git"?a({...i,...e$1.env}):{...i,...e$1.env}});o.on("close",a=>r(a??1)),o.on("error",()=>r(1));})}async function ke(e,t){let n=e.id==="vscode-extension"&&t.skipGit?[]:[...e.requiredTools],r=e.id==="vscode-extension"&&t.skipGit?[]:e.recommendedTools??[],i=[],o=[];for(let a of n)await H(a)||i.push(a);for(let a of r)await H(a)||o.push(a);if(i.length>0){let a=i.map(c=>`- ${c.label}: ${c.guidance}`).join(`
14
+ `);throw new Error(`${e.displayName} cannot use its latest stable official generator because required local tools are unavailable:
15
+ ${a}`)}for(let a of o)console.warn(d.yellow(`\u26A0 ${a.label} was not found. ${a.guidance}`));}function ve(e,t=process.versions.node){let n=e.nodeSupport;if(!n)return;let r=Number.parseInt(t.split(".")[0]??"",10);if(!n.ranges.some(o=>(o.major===void 0||o.major===r)&&xe(t,o.minVersion)>=0))throw new Error(`${e.displayName} requires Node.js ${n.requirement} (current: ${t}). ${n.guidance}`)}function xe(e,t){let n=e.split(".").map(o=>Number.parseInt(o,10)||0),r=t.split(".").map(o=>Number.parseInt(o,10)||0),i=Math.max(n.length,r.length);for(let o=0;o<i;o+=1){let a=(n[o]??0)-(r[o]??0);if(a!==0)return a}return 0}async function H(e$1){let t=e(e$1.command);return await new Promise(n=>{let r=spawn(t.command,[...t.prefixArgs,...e$1.args],{stdio:"ignore",shell:c()&&t.command===e$1.command&&t.prefixArgs.length===0,env:h()}),i=false,o=setTimeout(()=>{i||(i=true,r.kill(),n(false));},5e3);r.on("close",a=>{i||(i=true,clearTimeout(o),n(a===0));}),r.on("error",()=>{i||(i=true,clearTimeout(o),n(false));});})}function we(e,t,n,r){console.log(d.bold(`
16
+ Workspai ${e.category} create plan: ${e.displayName}`)),console.log(d.gray(`Category: ${e.category}`)),console.log(d.gray(`Runtime: ${e.runtimeCandidates.join(" + ")}`)),console.log(d.gray(`Version: ${e.versionPolicy}`)),console.log(d.gray(`Target: ${t}`)),console.log(d.gray(`Official: ${n}`)),console.log(d.gray(`Execute: ${[r.command,...r.args].join(" ")}`)),console.log(d.gray("Dry run: no files or workspace state will be changed."));}function he(e,t){let n=e.indexOf(t);if(n>=0&&n+1<e.length)return e[n+1];let r=e.find(i=>i.startsWith(`${t}=`));return r?r.slice(t.length+1):void 0}export{f as a,q as b,V as c,L as d,M as e,J as f,W as g,_ as h,Me as i,P as j,Je as k,We as l,oe as m,Ue as n,ot as o,A as p,it as q,fe as r,at as s};
@@ -0,0 +1,2 @@
1
+ import {b as b$1}from'./chunk-LPCL4U4L.js';import {c}from'./chunk-P4OSLAVD.js';import {p,h,i as i$1}from'./chunk-FUPHQOJB.js';import {d}from'./chunk-B4CPDK6J.js';import {e,d as d$1}from'./chunk-MBRU3VWJ.js';import {b,a}from'./chunk-62K2H72S.js';import I from'path';import R from'fs-extra';var G=b.agentContext,V=a.agentContext;function q(e){if(typeof e!="string"||!e.trim()||e==="true")return "generic";let t=e.trim().toLowerCase();return t==="codex"||t==="claude"||t==="cursor"||t==="orca"?t:"generic"}function M(e){return `npx --yes --package workspai workspai ${e}`.trim()}function l(e){return `npx workspai ${e}`.trim()}function i(e){return {id:e.id,scope:e.scope,display:l(e.args),execute:M(e.args),description:e.description,...e.project?{project:e.project}:{},freshness:h({id:`command.${e.id}`,label:`${e.id} command`,scope:"command",value:{display:l(e.args),execute:M(e.args)},...e.project?{project:e.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:e.generatedAt,now:e.now,sourceArtifact:a.model,sourcePath:`safeCommands.${e.id}`,reason:"Safe command surfaces are derived from workspace model command capabilities."}}).freshness}}function F(e,t){return `workspace run ${t} --scope project:${e.name}`}function L(e){return (e.startsWith("project:")?e.slice(8):e).trim().toLowerCase()}function D(e){return [e.name,e.path,I.basename(e.path),e.absolutePath].filter(t=>typeof t=="string"&&t.trim().length>0).map(t=>t.trim().toLowerCase())}function K(e,t,n){let r={generatedAt:e.generatedAt,now:n},c=[i({id:"workspace.model",scope:"workspace",args:"workspace model --json",description:"Read the canonical workspace intelligence model.",...r}),i({id:"workspace.graph.entities",scope:"workspace",args:"workspace graph entities --json",description:"Query proof-backed workspace entities without loading the full graph.",...r}),i({id:"workspace.graph.evidence",scope:"workspace",args:"workspace graph evidence <entity-or-relation> --json",description:"Resolve portable evidence for a graph entity or relation.",...r}),i({id:"workspace.graph.path",scope:"workspace",args:"workspace graph path <from> <to> --json",description:"Find a shortest proof-carrying path between workspace entities.",...r}),i({id:"workspace.doctor",scope:"workspace",args:"doctor workspace --json",description:"Check workspace health before claiming verification.",...r}),i({id:"workspace.pipeline",scope:"workspace",args:"pipeline --json",description:"Run the governed sync, doctor, analyze, readiness, and autopilot loop.",...r}),i({id:"workspace.contract.verify",scope:"workspace",args:"workspace contract verify --json",description:"Verify workspace contract and dependency edges.",...r}),i({id:"workspace.verify",scope:"workspace",args:"workspace verify --json",description:"Evaluate evidence freshness and verification gates before release decisions.",...r})],a=t?[t]:e.projects;for(let s of a)s.commands.fleetStages.includes("test")&&c.push(i({id:`project.${s.name}.test`,scope:"project",project:s.name,args:F(s,"test"),description:`Run tests for ${s.name} through workspace orchestration.`,...r})),s.commands.fleetStages.includes("build")&&c.push(i({id:`project.${s.name}.build`,scope:"project",project:s.name,args:F(s,"build"),description:`Build ${s.name} through workspace orchestration.`,...r}));return c}function H(e){return e.commands.fleetStages.filter(t=>t==="test"||t==="build").map(t=>`workspace run ${t}`)}function z(e,t){if(!t?.startsWith("project:"))return;let n=L(t);if(n)return e.projects.find(r=>D(r).includes(n))}function B(e,t,n){let r=[...e.validation?.issues??[]];t?.startsWith("project:")&&!n&&r.push({severity:"error",code:"context.scope.project.missing",message:`Requested project scope was not found: ${t}`,target:t});let c=r.filter(s=>s.severity==="error").length,a=r.filter(s=>s.severity==="warning").length;return {status:c>0?"failed":a>0?"warning":"passed",errors:c,warnings:a,issues:r}}async function U(e,t){let n=[],r=[];for(let[c,a]of Object.entries(e.evidence))a&&await d$1(t,a.path)!==null?n.push(`${c}: ${a.path}`):r.push(c);return {available:n.sort(),missing:r.sort()}}function X(e){let t=e.summary.projectCount,n=e.summary.runtimes.length?`${e.summary.runtimes.join(", ")} runtime coverage`:"no runtime coverage",r=e.identity.surfaces.length?e.identity.surfaces.join(", "):"no detected surfaces";return `${e.workspace.name} is a ${e.identity.workspaceType} with ${t} project${t===1?"":"s"}, ${n}, and ${r}.`}function J(e){let t=["Do not claim a command passed unless a report or command output proves it.","Do not infer secrets or environment values from file names.","Do not change project scope without checking the selected project."];return e.contracts.exists||t.push("Workspace contract is missing; dependency and API edges may be incomplete."),e.summary.observedProjects>0&&t.push("Some projects are observed rather than first-class; command support may be partial."),t}async function pe(e){let t=e.model??await p({workspacePath:e.workspacePath,includeEvidence:e.includeEvidence===true,observableScanDepth:e.observableScanDepth,now:e.now}),n=q(e.agent),r=z(t,e.scope),c$1=B(t,e.scope,r);if(e.strict===true&&c$1.status!=="passed"){let o=c$1.issues.map(m=>`${m.severity}:${m.code}:${m.target}`).join(", ");throw new Error(`Workspace context strict validation failed: ${o}`)}let a$1=e.now??new Date,s=t.facts??[],T=new Set((r?[r]:t.projects).map(o=>o.name)),w=s.filter(o=>o.project?T.has(o.project):true),_=(r?[r]:t.projects).map(o=>{let m=w.filter(N=>N.project===o.name);return {name:o.name,path:o.path,kind:o.kind,category:o.category,runtime:o.runtime,framework:o.frameworkDisplayName,...o.generator?{generator:o.generator}:{},createCapability:o.createCapability,supportTier:o.supportTier,safeCommands:H(o),importantFiles:o.importantFiles,facts:m}}),u=await U(t,e.workspacePath),y=I.join(e.workspacePath,a.knowledgeGraph),d=await R.pathExists(y)?await R.readJson(y).catch(()=>null):null,C=false;if(d?.schemaVersion===b.knowledgeGraph)try{c(d,t),C=true;}catch{}let v=X(t),j=K(t,r,a$1),O=j.map(o=>h({id:`context.command.${o.id}`,label:`${o.id} safe command`,scope:"command",value:{display:o.display,execute:o.execute,scope:o.scope},...o.project?{project:o.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:t.generatedAt,now:a$1,sourceArtifact:a.agentContext,sourcePath:`safeCommands.${o.id}`,reason:"Context safe commands are derived from workspace model command capabilities."}})),b$2=[...w,...O],f=i$1({facts:b$2,generatedAt:a$1.toISOString(),now:a$1}),h$1=b$1();return {schemaVersion:G,generatedAt:a$1.toISOString(),agent:n,workspaceSummary:v,modelRef:a.model,knowledgeGraph:{artifact:a.knowledgeGraph,schemaVersion:b.knowledgeGraph,available:C,...typeof d?.quality?.entityCount=="number"?{entityCount:d.quality.entityCount}:{},...typeof d?.quality?.relationCount=="number"?{relationCount:d.quality.relationCount}:{},...typeof d?.quality?.proofCount=="number"?{proofCount:d.quality.proofCount}:{},queryCommands:[l("workspace graph search <query> --limit 12 --json"),l("workspace graph entities [kind] --json"),l("workspace graph evidence <entity-or-relation> --json"),l("workspace graph path <from> <to> --json")]},intelligenceChain:{schemaVersion:h$1.schemaVersion,contractPath:h$1.contractPath,currentStep:"context",canonicalReadOrder:[...h$1.consumers.agents.canonicalReadOrder]},workspace:{name:t.workspace.name,root:t.workspace.root,type:t.identity.workspaceType,...t.workspace.profile?{profile:t.workspace.profile}:{}},scope:{requested:e.scope??"workspace",...r?{activeProject:r.name}:{}},projects:_,safeCommands:j,facts:b$2,factFreshness:f,evidence:u,policies:{mode:t.policies.mode,source:t.policies.source},contracts:{exists:t.contracts.exists,path:t.contracts.workspaceContractPath},validation:c$1,agentInstructions:[`Read \`${a.agentIndex}\` first, then this context pack and linked evidence reports.`,"Use `workspace graph search <query> --limit 12 --json` for bounded, proof-backed retrieval before loading the full graph.",`Load \`${a.knowledgeGraph}\` only when a complete graph export is explicitly required.`,"Use this context as the workspace source of truth before inspecting random files.","Prefer workspace-level evidence over generic framework assumptions.","Use `display` commands when explaining steps to a human.","Use `execute` commands when launching commands from automation or tooling.","Treat `facts[].freshness.verifyBeforeUse` as a hard refresh requirement before using that fact in advice, fixes, or release decisions.","Do not carry extracted facts beyond their freshness contract; re-read or regenerate evidence when the contract says stale, unknown, live, or verify-before-use.","Keep project-scoped advice tied to the active project scope.","Regenerate stale grounding with `npx workspai workspace agent-sync --write --refresh-context`."],unsafeAssumptions:[...J(t),...f.verifyBeforeUseFacts>0?[`${f.verifyBeforeUseFacts} fact(s) require verification before use; do not treat them as durable workspace structure.`]:[]],humanSummary:[v,`Evidence available: ${u.available.length}. Missing evidence groups: ${u.missing.join(", ")||"none"}.`,r?`Active project scope: ${r.name} (${r.frameworkDisplayName}).`:"Scope: whole workspace."].join(`
2
+ `)}}async function de(e$1,t){return e(t,V,d(e$1))}export{G as a,V as b,pe as c,de as d};
@@ -1 +1 @@
1
- import {b as b$2,c,d as d$1}from'./chunk-KXG6E5VK.js';import {c as c$1}from'./chunk-VKTUWUS6.js';import {a as a$2,b as b$3}from'./chunk-PYCJWW4B.js';import {p as p$1,a as a$1,o,g,d as d$4,f}from'./chunk-C3FLCDRN.js';import {p,l,f as f$1}from'./chunk-L2YK5RV2.js';import {d}from'./chunk-EWZZUQBR.js';import {d as d$3}from'./chunk-KMLPHFLD.js';import {d as d$2,e}from'./chunk-SS2VV3D5.js';import {a as a$3}from'./chunk-AFIFZTOY.js';import {b as b$1,a,c as c$2}from'./chunk-AHLMIL2T.js';import m from'path';import v from'fs-extra';var ae="rapidkit-blocker-resolution-v1";function ce(e){let t=e.blockers.map(s=>s.trim()).filter(Boolean).slice(0,12),r=e.stderrTail?.trim().slice(-400)??"";return f$1({blockers:t,exitCode:e.exitCode??null,stderrTail:r})}function ke(e){let t=e.trim().toLowerCase();return t?t.includes("missing evidence")||t.includes(": missing")||t.includes("artifact missing")||t.includes("not found on disk")?"artifact-missing":t.includes("policy.")||t.includes("contract")?"config-fixable":t.includes("impact")||t.includes("untracked")||t.includes("grounding")?"semantic-attention":t.includes("failed")||t.includes("blocked")||t.includes(": fail")?"command-failed-repeat":"config-fixable":"unresolvable-without-human"}function ye(e){let t=ke(e.reason),r=ce({blockers:[e.reason]}),s=t==="artifact-missing"?[{actionKind:"run-once",detail:e.sourceCommand?`Run the source command once: ${e.sourceCommand}`:"Run the mapped workspace intelligence command once to generate the missing artifact.",studioActionId:"run-analyze"}]:t==="semantic-attention"?[{actionKind:"commit-files",detail:"Review workspace-level grounding files (AGENTS.md, agent-sync outputs) and commit or refresh the impact baseline."},{actionKind:"refresh-baseline",detail:"Refresh snapshot + diff + impact before re-running verify."}]:[{actionKind:"edit-file",detail:"Apply the smallest safe file or policy fix for this blocker before re-running verification.",studioActionId:"fix-lens"}];return {schemaVersion:ae,blockerId:e.blockerId,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,resolutionClass:t,blockerSignature:r,commandRetryHint:t==="artifact-missing"?"Run the source command once, then verify.":"Do not re-run the same failing command; fix the source issue first, then verify.",fixHints:s,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}}function de(e){return Array.from(new Set(e.blockingReasons.map(r=>r.trim()).filter(Boolean))).slice(0,12).map((r,s)=>ye({reason:r,blockerId:`blocker-${s+1}`,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}))}function he(e){let t=e.toLowerCase();return t.includes("stale")||t.includes("missing evidence")||t.includes("no projects")||t.includes("projects.empty")||t.includes("projects discovered")||t.includes("projects.missing")||t.includes("not yet run")||t.includes("doctor-last-run")||t.includes("doctor-project-last-run")||t.includes("doctor-remediation-plan-last-run")||t.includes("doctor-fix-result-last-run")||t.includes("pipeline-last-run")||t.includes("release-readiness")||t.includes("analyze-last-run")||t.includes("analyze reported")||t.includes("analyze verdict")||t.includes("analyze needs attention")||t.includes("toolchain.lock")||t.includes("not pinned")||t.includes("readiness:")||t.includes("env:")||t.includes("workspace-run-last")||t.includes("pre-project")||t.includes("before adding projects")||t.includes("workspace.projects.missing")||t.includes("no backend projects")||t.includes("index.json")||t.includes("workspace-intelligence-history")||t.includes("validation warning")||t.includes("workspace model validation")||t.includes("workspace.marker")||t.includes("no project roots")||t.includes("no infrastructure services")||t.includes("infra/overrides")||t.includes("infra dependencies")||t.includes("contract verify")||t.includes("contract inspect")||t.includes("publish verify evidence")}function ve(e){return e.length===0||e.every(t=>he(t))}function le(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&ve(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function Ye(e,t){let r=t&&t!=="ready"?` (${t.replace(/-/g," ")})`:"";return e===0?`Workspace scaffold ready${r} \u2014 add your first project to continue.`:`Workspace scaffold${r}: ${e} pre-project signal(s) \u2014 add your first project to continue.`}var fe=b$1.verify,J=a.verify;function be(e,t){return m.isAbsolute(t)?t:m.join(e,t)}async function ue(e){let t=await v.readJson(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Workspace impact input is not a JSON object: ${e}`);let r=t;if(r.schemaVersion!==f)throw new Error(`Unsupported workspace impact schema: ${String(r.schemaVersion)}`);a$3(t,"contracts/workspace-intelligence/workspace-impact.v1.json",`Workspace impact ${e}`);let s=r;a$3(s.diff,"contracts/workspace-intelligence/workspace-model-diff.v1.json",`Embedded workspace diff in ${e}`);let i=[];s.summary.affectedProjects!==s.affectedProjects.length&&i.push("summary.affectedProjects does not match affectedProjects.length"),s.summary.workspaceItems!==s.workspaceImpact.length&&i.push("summary.workspaceItems does not match workspaceImpact.length"),s.summary.recommendedCommands!==s.verificationPlan.length&&i.push("summary.recommendedCommands does not match verificationPlan.length"),s.summary.blastRadius.directlyAffected!==s.affectedProjects.length&&i.push("blastRadius.directlyAffected does not match affectedProjects.length"),s.summary.blastRadius.transitivelyAffected!==s.transitiveImpact.length&&i.push("blastRadius.transitivelyAffected does not match transitiveImpact.length");let o=s.transitiveImpact.reduce((u,d)=>Math.max(u,d.distance??0),0);s.summary.blastRadius.maxDistance!==o&&i.push("blastRadius.maxDistance does not match transitive impact distances");let k=l(s.diff.currentModel)?.edges.length??0;if(s.summary.blastRadius.graphEdges!==k&&i.push("blastRadius.graphEdges does not match the embedded model graph"),s.summary.changed!==s.diff.summary.changed&&i.push("summary.changed does not match embedded diff summary"),s.fromRef!==s.diff.fromRef&&i.push("fromRef does not match embedded diff fromRef"),s.workspace.name!==s.diff.currentModel.workspace.name&&i.push("workspace.name does not match the embedded model"),s.diff.toHash!==d(s.diff.currentModel)&&i.push("embedded diff current-model hash does not match toHash"),i.length>0)throw new Error(`Workspace impact semantic integrity failed: ${i.join("; ")} (${e})`);return s}function we(e){let t=new Set,r=[];for(let s of e){let i=`${s.scope}:${s.project??""}:${s.display}`;t.has(i)||(t.add(i),r.push(s));}return r}function Re(e,t){if(!e||e==="workspace")return true;let r=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return t.scope==="workspace"?true:(t.project??"").trim().toLowerCase()===r}function Ce(e,t){if(e.id==="workspace.doctor")return m.join(t,a.doctor);if(e.id==="workspace.contract.verify")return m.join(t,a.contractVerify);if(e.id==="workspace.readiness")return m.join(t,a.readiness);if(e.id==="workspace.analyze")return m.join(t,".workspai","reports","analyze-last-run.json");if(e.id==="workspace.pipeline")return m.join(t,".workspai","reports","pipeline-last-run.json");if(e.id==="workspace.doctor-fix")return m.join(t,".workspai","reports","doctor-fix-result-last-run.json");if(e.id.startsWith("project.")&&e.id.includes("."))return m.join(t,".workspai","reports","workspace-run-last.json")}function b(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function Ae(e){let t=b(e.healthScore),r=b(e.summary),s=typeof t?.errors=="number"?t.errors:0,i=typeof t?.percent=="number"?t.percent:void 0;return s>0||r?.hasSystemErrors===true?{status:"fail",message:`Doctor evidence reports ${s} error(s).`}:typeof i=="number"&&i<70?{status:"warn",message:`Doctor health score is ${i}%.`}:{status:"pass",message:"Doctor evidence is present and healthy."}}function je(e){let t=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return t==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:t==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:t==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${t}.`}}function Ee(e){let t=typeof e.status=="string"?e.status:"unknown";return t==="failed"||t==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:t==="passed"||t==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${t}.`}}function Se(e){let t=b(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Analyze evidence reports blocking findings."}:r==="needs-attention"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is ready."}}function We(e){let t=e.schemaVersion==="rapidkit-doctor-fix-result-v1"?e:e.fixResult;if(!t||typeof t!="object"||Array.isArray(t))return {status:"skipped",message:"Doctor fix result not present; run doctor workspace --fix --json to record fixes."};let r=t,s=Array.isArray(r.remainingBlockers)?r.remainingBlockers:[];if(s.length>0)return {status:"fail",message:`Doctor fix result reports ${s.length} remaining blocker(s).`};let i=Array.isArray(r.appliedFixes)?r.appliedFixes:[];return i.length===0?{status:"pass",message:"Doctor fix result recorded with no remaining blockers."}:{status:"pass",message:`Doctor fix result recorded ${i.length} applied fix(es) with no remaining blockers.`}}async function xe(e,t){let r=await d$2(e,".workspai/reports/doctor-remediation-plan-last-run.json");if(!r)return false;try{let s=b(await v.readJson(r));if(!s||(Array.isArray(s.steps)?s.steps:[]).length>0)return false;let o=typeof s.generatedAt=="string"?s.generatedAt:void 0;if(!o||!t)return true;let k=Date.parse(o),u=Date.parse(t);return !Number.isFinite(k)||!Number.isFinite(u)?true:k>=u}catch{return false}}function Pe(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function Ie(e){let t=b(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:r==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:r==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function Ve(e,t,r){let s=Pe(t),i=c$1(e,s??void 0);if(!i)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let o=i.stage;if(s&&o!==s)return {status:"missing",message:`Workspace run evidence is for stage "${o}", expected "${s}".`};let k=Array.isArray(i.projects)?i.projects:[],u=t.project?.toLowerCase();if(!u)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let d=k.find(g=>{let c=b(g);if(!c)return false;let n=typeof c.projectName=="string"?c.projectName.toLowerCase():"",a=["projectPath","relativePath","path"].map(f=>c[f]).filter(f=>typeof f=="string"&&f.trim().length>0).map(f=>f.replace(/\\/g,"/").toLowerCase());return n===u||a.some(f=>f.endsWith(`/${u}`)||f===u)});if(d){let g=C(i.generatedAt,r,`Workspace run evidence for ${t.project??t.id}`);if(g)return {status:"fail",message:g};let c=b(d),n=typeof c?.status=="string"?c.status:"unknown";return n==="failed"?{status:"fail",message:`Workspace run evidence failed for ${t.project}.`}:n==="passed"?{status:"pass",message:`Workspace run evidence passed for ${t.project}.`}:n==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${t.project}.`}:{status:"warn",message:`Workspace run evidence status is ${n} for ${t.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${t.project}.`}}function C(e,t,r){if(!t)return null;if(typeof e!="string"||e.trim().length===0)return `${r} is stale: missing generatedAt timestamp (required after impact ${t}).`;let s=Date.parse(e),i=Date.parse(t);return Number.isFinite(s)?Number.isFinite(i)&&s<i?`${r} is stale: generated at ${e}, before impact ${t}.`:null:`${r} is stale: invalid generatedAt timestamp (required after impact ${t}).`}function $e(e){if(e.id==="workspace.doctor")return c$2.doctor;if(e.id==="workspace.readiness")return c$2.readiness;if(e.id==="workspace.contract.verify")return c$2.contractVerify;if(e.id==="workspace.analyze")return c$2.analyze;if(e.id==="workspace.pipeline")return "contracts/pipeline-last-run.v1.json"}async function Fe(e,t,r,s){let i=Ce(e,t),o=i?m.relative(t,i).split(m.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!r)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};let k=i?await d$2(t,o??""):null;if(!i||!k)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:o,message:o?`Missing evidence report: ${o}`:"No evidence mapping exists for this command."};let u;try{u=await v.readJson(k);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is unreadable JSON: ${n instanceof Error?n.message:String(n)}`}}let d=b(u);if(!d)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:"Evidence report is not a JSON object."};let g=$e(e);if(g)try{a$3(d,g,`${e.label} evidence`);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is invalid: ${n instanceof Error?n.message:String(n)}`}}let c;if(e.id==="workspace.doctor"){let n=C(d.generatedAt,s,"Doctor evidence");n?c={status:"fail",message:n}:c=Ae(d);}else if(e.id==="workspace.readiness"){let n=C(d.generatedAt,s,"Release readiness evidence");n?c={status:"fail",message:n}:c=je(d);}else if(e.id==="workspace.contract.verify"){let n=C(d.generatedAt,s,"Workspace contract verify evidence");n?c={status:"fail",message:n}:c=Ee(d);}else if(e.id==="workspace.analyze"){let n=C(d.generatedAt,s,"Analyze evidence");n?c={status:"fail",message:n}:c=Se(d);}else if(e.id==="workspace.pipeline"){let n=C(d.generatedAt,s,"Pipeline evidence");n?c={status:"fail",message:n}:c=Ie(d);}else if(e.id==="workspace.doctor-fix"){let n=d.schemaVersion==="rapidkit-doctor-fix-result-v1"?d:d.fixResult,a=b(n),f=typeof a?.generatedAt=="string"?a.generatedAt:void 0,y=C(f,s,"Doctor fix result");y?c={status:"fail",message:y}:await xe(t,f)?c={status:"skipped",message:"No current doctor remediation steps are pending."}:c=We(d);}else if(e.id.startsWith("project."))c=Ve(d,e,s);else {let n=C(d.generatedAt,s,"Evidence report");n?c={status:"fail",message:n}:c={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:c.status,required:e.required,evidencePath:o,message:c.message}}function Oe(e,t={blockingReasons:[],needsAttention:false}){let r=e.filter(n=>n.status==="pass").length,s=e.filter(n=>n.status==="warn").length,i=e.filter(n=>n.status==="fail").length,o=e.filter(n=>n.status==="missing").length,k=e.filter(n=>n.status==="skipped").length,u=e.filter(n=>n.required&&(n.status==="fail"||n.status==="missing")).map(n=>`${n.id}: ${n.message}`),d=e.filter(n=>n.required&&n.status==="missing").length,g="ready",c=0;return u.length>0||t.blockingReasons.length>0?(g="blocked",c=2):(s>0||e.some(n=>!n.required&&n.status==="fail")||d>0||t.needsAttention)&&(g="needs-attention",c=1),{verdict:g,exitCode:c,stepsPassed:r,stepsWarn:s,stepsFailed:i,stepsMissing:o,stepsSkipped:k}}function Be(e,t){let r=S(e.affectedProjects.map(a=>a.project?.name).filter(a=>typeof a=="string")),s=new Set(r.map(a=>a.toLowerCase())),i=S(e.transitiveImpact.map(a=>a.project?.name).filter(a=>typeof a=="string").filter(a=>!s.has(a.toLowerCase()))),o=new Map;for(let a of t){if(a.scope!=="project"||!a.project)continue;let f=a.project.toLowerCase(),y=o.get(f)??[];y.push(a),o.set(f,y);}let k=[],u=[],d=[],g=[],c=false,n=(a,f)=>{let y=o.get(a.toLowerCase())??[];if(y.length===0){d.push(a);return}let W=y.filter(p=>p.status==="fail"),w=W.filter(p=>p.required),x=y.filter(p=>p.status==="missing"),A=x.filter(p=>p.required),P=y.some(p=>p.status==="pass"||p.status==="warn");if(w.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has failed verification evidence (${w.map(p=>p.id).join(", ")}).`);return}if(W.length>0){u.push(a),c=true;return}if(A.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has missing required verification evidence (${A.map(p=>p.id).join(", ")}).`);return}if(x.length>0){u.push(a),c=true;return}if(P){k.push(a);return}d.push(a);};for(let a of r)n(a,"directly-changed");for(let a of i)n(a,"transitive dependent");return {subgraph:{totalProjects:r.length+i.length,directlyChanged:r,transitiveDependents:i,covered:S(k),uncovered:S(u),unverifiable:S(d)},blockingReasons:g,needsAttention:c}}function S(e){return [...new Set(e)].sort((t,r)=>t.localeCompare(r))}async function _e(e){let t=m.resolve(e.workspacePath);if(e.fromImpactPath){let o=be(t,e.fromImpactPath);return {impact:await ue(o),fromImpactRef:m.relative(t,o).split(m.sep).join("/"),impactFromDisk:true}}let r=m.join(t,g);if(await v.pathExists(r))return {impact:await ue(r),fromImpactRef:g,impactFromDisk:true};let s=m.join(t,d$4);if(await v.pathExists(s))return {impact:await p$1({workspacePath:t,fromPath:d$4,scope:e.scope,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}),fromImpactRef:d$4,impactFromDisk:false};let i=await p({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now});return {impact:{schemaVersion:f,generatedAt:(e.now??new Date).toISOString(),fromRef:"baseline",diffRef:a.diff,workspace:{name:i.workspace.name,profile:i.workspace.profile,type:i.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:l(i)?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:b$1.diff,generatedAt:(e.now??new Date).toISOString(),fromRef:"baseline",toRef:a.model,fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:i}},impactFromDisk:false}}function De(e,t){if(t)return e.generatedAt}async function pt(e){let t=m.resolve(e.workspacePath),{impact:r,fromImpactRef:s,impactFromDisk:i}=await _e(e),o$1=r.diff.currentModel,k=i?await p({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}):o$1,u=[];if(i){let l=await p$1({workspacePath:t,fromPath:r.diff.fromRef,diff:r.diff,scope:e.scope,now:e.now}),_=[r.affectedProjects,r.transitiveImpact,r.verificationPlan],D=[l.affectedProjects,l.transitiveImpact,l.verificationPlan];JSON.stringify(_)!==JSON.stringify(D)&&u.push("workspace.impact: Persisted impact semantics do not match the impact re-derived from the embedded diff. Regenerate diff and impact.");}i&&d(k)!==r.diff.toHash&&u.push("workspace.impact: Impact evidence is stale because the current workspace model no longer matches the embedded model. Regenerate diff and impact.");let d$2=r.diff.git;if(i&&d$2?.available){let l=a$1(t,{ref:d$2.ref}),_=r.diff.changes.filter(h=>h.type.startsWith("git.")).map(h=>`${h.type}:${h.target.replace(/^git:/,"")}`).sort(),D=[...l.changedFiles.map(h=>`git.file.changed:${h}`),...l.untrackedFiles.map(h=>`git.untracked:${h}`),...l.deletedFiles.map(h=>`git.deleted:${h}`)].sort();(!l.available||l.commit!==d$2.commit||JSON.stringify(D)!==JSON.stringify(_))&&u.push("workspace.impact: Impact evidence is stale because Git changes no longer match the diff observation. Regenerate diff and impact.");}let g=De(r,i),c$1=we([...o(),...r.verificationPlan]).filter(l=>Re(e.scope,l)),n=[];for(let l of c$1)n.push(await Fe(l,t,o$1.contracts.exists===true,g));let a=Be(r,n),f=a$2(l(o$1)??{nodes:[],edges:[]}),y=b$2(o$1),W=await Ne(t),w=c(y,W?.freshness?.projectHashes),x={verdict:w.verdict,baseline:w.baseline,changed:w.changed,added:w.added,removed:w.removed,projectHashes:d$1(y)},A=b$3(f),P=o$1.policies?.mode??"warn",p$2=await He(o$1,t),B=Me(P,p$2),j=Oe(n,{blockingReasons:[...a.blockingReasons,...A,...B.blockingReasons,...u],needsAttention:a.needsAttention||B.needsAttention}),pe=n.filter(l=>l.status==="missing"&&l.evidencePath).map(l=>l.evidencePath),I=[...n.filter(l=>l.required&&(l.status==="fail"||l.status==="missing")).map(l=>`${l.id}: ${l.message}`),...a.blockingReasons,...A,...B.blockingReasons,...u],me=p$2.filter(l=>l.severity==="error").length,ge=o$1.summary?.projectCount??o$1.projects.length,G=le({projectCount:ge,verdict:j.verdict,exitCode:j.exitCode,blockingReasons:I,policyErrorCount:me});j.verdict=G.verdict,j.exitCode=G.exitCode;let U=I.length>0?de({blockingReasons:I,verifyCommand:"npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json",verifyArtifact:J}):[];return {schemaVersion:fe,generatedAt:(e.now??new Date).toISOString(),workspacePath:t,mode:"evidence",fromImpactRef:s,scope:e.scope,impact:{changed:r.summary.changed,risk:r.summary.risk,affectedProjects:r.summary.affectedProjects,recommendedCommands:r.summary.recommendedCommands},summary:j,steps:n,missingEvidence:pe,blockingReasons:I,...U.length>0?{resolutionHints:U}:{},verificationPlan:c$1,affectedSubgraph:a.subgraph,graphIntegrity:f,freshness:x,policyMode:P,policyViolations:p$2}}async function He(e,t){let r=[];for(let i of e.validation?.issues??[])r.push({source:"model",severity:i.severity,code:i.code,message:i.message,target:i.target});let s=await d$2(t,a.contractVerify);try{if(s&&await v.pathExists(s)){let i=await v.readJson(s);if(Array.isArray(i.violations))for(let o of i.violations)typeof o=="string"&&o.trim().length>0&&r.push({source:"contract",severity:"error",code:"contract.violation",message:o});}}catch{}return r.sort((i,o)=>i.source!==o.source?i.source.localeCompare(o.source):i.code!==o.code?i.code.localeCompare(o.code):i.message.localeCompare(o.message))}function Me(e,t){let r=t.filter(s=>s.severity==="error");return e==="enforce"&&r.length>0?{blockingReasons:r.map(s=>`policy.${s.code}: ${s.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:r.length>0}}async function Ne(e){let t=m.join(e,J);try{if(!await v.pathExists(t))return null;let r=await v.readJson(t);return r&&r.schemaVersion===fe?r:null}catch{return null}}async function mt(e$1,t){return e(t,J,d$3(e$1))}function Te(e,t){let r=t?.strict?"strict":"default",s=[];if(e.summary.verdict==="blocked")return s.push(...e.blockingReasons),s.length===0&&s.push("verify verdict is blocked."),{passed:false,mode:r,exitCode:2,reasons:s};if(r==="strict"){if(e.summary.verdict!=="ready"&&s.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let i=[...e.freshness.changed,...e.freshness.added].slice(0,5);s.push(`freshness is stale${i.length>0?`: ${i.join(", ")}`:""} (strict requires fresh).`);}if(s.length>0)return {passed:false,mode:r,exitCode:1,reasons:s}}return {passed:true,mode:r,exitCode:0,reasons:s}}function gt(e,t){return Te(e,t).exitCode}export{ae as a,Ye as b,fe as c,J as d,Be as e,pt as f,mt as g,Te as h,gt as i};
1
+ import {b as b$2,c,d as d$1}from'./chunk-ICLYL3N5.js';import {c as c$1}from'./chunk-GHB6QMQH.js';import {a as a$2,b as b$3}from'./chunk-PYCJWW4B.js';import {p as p$1,a as a$1,o,g,d as d$4,f}from'./chunk-PTTZPDLX.js';import {p,l,f as f$1}from'./chunk-FUPHQOJB.js';import {d}from'./chunk-EWZZUQBR.js';import {d as d$3}from'./chunk-B4CPDK6J.js';import {d as d$2,e}from'./chunk-MBRU3VWJ.js';import {a as a$3}from'./chunk-AFIFZTOY.js';import {b as b$1,a,c as c$2}from'./chunk-62K2H72S.js';import m from'path';import v from'fs-extra';var ae="rapidkit-blocker-resolution-v1";function ce(e){let t=e.blockers.map(s=>s.trim()).filter(Boolean).slice(0,12),r=e.stderrTail?.trim().slice(-400)??"";return f$1({blockers:t,exitCode:e.exitCode??null,stderrTail:r})}function ke(e){let t=e.trim().toLowerCase();return t?t.includes("missing evidence")||t.includes(": missing")||t.includes("artifact missing")||t.includes("not found on disk")?"artifact-missing":t.includes("policy.")||t.includes("contract")?"config-fixable":t.includes("impact")||t.includes("untracked")||t.includes("grounding")?"semantic-attention":t.includes("failed")||t.includes("blocked")||t.includes(": fail")?"command-failed-repeat":"config-fixable":"unresolvable-without-human"}function ye(e){let t=ke(e.reason),r=ce({blockers:[e.reason]}),s=t==="artifact-missing"?[{actionKind:"run-once",detail:e.sourceCommand?`Run the source command once: ${e.sourceCommand}`:"Run the mapped workspace intelligence command once to generate the missing artifact.",studioActionId:"run-analyze"}]:t==="semantic-attention"?[{actionKind:"commit-files",detail:"Review workspace-level grounding files (AGENTS.md, agent-sync outputs) and commit or refresh the impact baseline."},{actionKind:"refresh-baseline",detail:"Refresh snapshot + diff + impact before re-running verify."}]:[{actionKind:"edit-file",detail:"Apply the smallest safe file or policy fix for this blocker before re-running verification.",studioActionId:"fix-lens"}];return {schemaVersion:ae,blockerId:e.blockerId,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,resolutionClass:t,blockerSignature:r,commandRetryHint:t==="artifact-missing"?"Run the source command once, then verify.":"Do not re-run the same failing command; fix the source issue first, then verify.",fixHints:s,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}}function de(e){return Array.from(new Set(e.blockingReasons.map(r=>r.trim()).filter(Boolean))).slice(0,12).map((r,s)=>ye({reason:r,blockerId:`blocker-${s+1}`,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}))}function he(e){let t=e.toLowerCase();return t.includes("stale")||t.includes("missing evidence")||t.includes("no projects")||t.includes("projects.empty")||t.includes("projects discovered")||t.includes("projects.missing")||t.includes("not yet run")||t.includes("doctor-last-run")||t.includes("doctor-project-last-run")||t.includes("doctor-remediation-plan-last-run")||t.includes("doctor-fix-result-last-run")||t.includes("pipeline-last-run")||t.includes("release-readiness")||t.includes("analyze-last-run")||t.includes("analyze reported")||t.includes("analyze verdict")||t.includes("analyze needs attention")||t.includes("toolchain.lock")||t.includes("not pinned")||t.includes("readiness:")||t.includes("env:")||t.includes("workspace-run-last")||t.includes("pre-project")||t.includes("before adding projects")||t.includes("workspace.projects.missing")||t.includes("no backend projects")||t.includes("index.json")||t.includes("workspace-intelligence-history")||t.includes("validation warning")||t.includes("workspace model validation")||t.includes("workspace.marker")||t.includes("no project roots")||t.includes("no infrastructure services")||t.includes("infra/overrides")||t.includes("infra dependencies")||t.includes("contract verify")||t.includes("contract inspect")||t.includes("publish verify evidence")}function ve(e){return e.length===0||e.every(t=>he(t))}function le(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&ve(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function Ye(e,t){let r=t&&t!=="ready"?` (${t.replace(/-/g," ")})`:"";return e===0?`Workspace scaffold ready${r} \u2014 add your first project to continue.`:`Workspace scaffold${r}: ${e} pre-project signal(s) \u2014 add your first project to continue.`}var fe=b$1.verify,J=a.verify;function be(e,t){return m.isAbsolute(t)?t:m.join(e,t)}async function ue(e){let t=await v.readJson(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Workspace impact input is not a JSON object: ${e}`);let r=t;if(r.schemaVersion!==f)throw new Error(`Unsupported workspace impact schema: ${String(r.schemaVersion)}`);a$3(t,"contracts/workspace-intelligence/workspace-impact.v1.json",`Workspace impact ${e}`);let s=r;a$3(s.diff,"contracts/workspace-intelligence/workspace-model-diff.v1.json",`Embedded workspace diff in ${e}`);let i=[];s.summary.affectedProjects!==s.affectedProjects.length&&i.push("summary.affectedProjects does not match affectedProjects.length"),s.summary.workspaceItems!==s.workspaceImpact.length&&i.push("summary.workspaceItems does not match workspaceImpact.length"),s.summary.recommendedCommands!==s.verificationPlan.length&&i.push("summary.recommendedCommands does not match verificationPlan.length"),s.summary.blastRadius.directlyAffected!==s.affectedProjects.length&&i.push("blastRadius.directlyAffected does not match affectedProjects.length"),s.summary.blastRadius.transitivelyAffected!==s.transitiveImpact.length&&i.push("blastRadius.transitivelyAffected does not match transitiveImpact.length");let o=s.transitiveImpact.reduce((u,d)=>Math.max(u,d.distance??0),0);s.summary.blastRadius.maxDistance!==o&&i.push("blastRadius.maxDistance does not match transitive impact distances");let k=l(s.diff.currentModel)?.edges.length??0;if(s.summary.blastRadius.graphEdges!==k&&i.push("blastRadius.graphEdges does not match the embedded model graph"),s.summary.changed!==s.diff.summary.changed&&i.push("summary.changed does not match embedded diff summary"),s.fromRef!==s.diff.fromRef&&i.push("fromRef does not match embedded diff fromRef"),s.workspace.name!==s.diff.currentModel.workspace.name&&i.push("workspace.name does not match the embedded model"),s.diff.toHash!==d(s.diff.currentModel)&&i.push("embedded diff current-model hash does not match toHash"),i.length>0)throw new Error(`Workspace impact semantic integrity failed: ${i.join("; ")} (${e})`);return s}function we(e){let t=new Set,r=[];for(let s of e){let i=`${s.scope}:${s.project??""}:${s.display}`;t.has(i)||(t.add(i),r.push(s));}return r}function Re(e,t){if(!e||e==="workspace")return true;let r=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return t.scope==="workspace"?true:(t.project??"").trim().toLowerCase()===r}function Ce(e,t){if(e.id==="workspace.doctor")return m.join(t,a.doctor);if(e.id==="workspace.contract.verify")return m.join(t,a.contractVerify);if(e.id==="workspace.readiness")return m.join(t,a.readiness);if(e.id==="workspace.analyze")return m.join(t,".workspai","reports","analyze-last-run.json");if(e.id==="workspace.pipeline")return m.join(t,".workspai","reports","pipeline-last-run.json");if(e.id==="workspace.doctor-fix")return m.join(t,".workspai","reports","doctor-fix-result-last-run.json");if(e.id.startsWith("project.")&&e.id.includes("."))return m.join(t,".workspai","reports","workspace-run-last.json")}function b(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function Ae(e){let t=b(e.healthScore),r=b(e.summary),s=typeof t?.errors=="number"?t.errors:0,i=typeof t?.percent=="number"?t.percent:void 0;return s>0||r?.hasSystemErrors===true?{status:"fail",message:`Doctor evidence reports ${s} error(s).`}:typeof i=="number"&&i<70?{status:"warn",message:`Doctor health score is ${i}%.`}:{status:"pass",message:"Doctor evidence is present and healthy."}}function je(e){let t=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return t==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:t==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:t==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${t}.`}}function Ee(e){let t=typeof e.status=="string"?e.status:"unknown";return t==="failed"||t==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:t==="passed"||t==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${t}.`}}function Se(e){let t=b(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Analyze evidence reports blocking findings."}:r==="needs-attention"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is ready."}}function We(e){let t=e.schemaVersion==="rapidkit-doctor-fix-result-v1"?e:e.fixResult;if(!t||typeof t!="object"||Array.isArray(t))return {status:"skipped",message:"Doctor fix result not present; run doctor workspace --fix --json to record fixes."};let r=t,s=Array.isArray(r.remainingBlockers)?r.remainingBlockers:[];if(s.length>0)return {status:"fail",message:`Doctor fix result reports ${s.length} remaining blocker(s).`};let i=Array.isArray(r.appliedFixes)?r.appliedFixes:[];return i.length===0?{status:"pass",message:"Doctor fix result recorded with no remaining blockers."}:{status:"pass",message:`Doctor fix result recorded ${i.length} applied fix(es) with no remaining blockers.`}}async function xe(e,t){let r=await d$2(e,".workspai/reports/doctor-remediation-plan-last-run.json");if(!r)return false;try{let s=b(await v.readJson(r));if(!s||(Array.isArray(s.steps)?s.steps:[]).length>0)return false;let o=typeof s.generatedAt=="string"?s.generatedAt:void 0;if(!o||!t)return true;let k=Date.parse(o),u=Date.parse(t);return !Number.isFinite(k)||!Number.isFinite(u)?true:k>=u}catch{return false}}function Pe(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function Ie(e){let t=b(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:r==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:r==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function Ve(e,t,r){let s=Pe(t),i=c$1(e,s??void 0);if(!i)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let o=i.stage;if(s&&o!==s)return {status:"missing",message:`Workspace run evidence is for stage "${o}", expected "${s}".`};let k=Array.isArray(i.projects)?i.projects:[],u=t.project?.toLowerCase();if(!u)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let d=k.find(g=>{let c=b(g);if(!c)return false;let n=typeof c.projectName=="string"?c.projectName.toLowerCase():"",a=["projectPath","relativePath","path"].map(f=>c[f]).filter(f=>typeof f=="string"&&f.trim().length>0).map(f=>f.replace(/\\/g,"/").toLowerCase());return n===u||a.some(f=>f.endsWith(`/${u}`)||f===u)});if(d){let g=C(i.generatedAt,r,`Workspace run evidence for ${t.project??t.id}`);if(g)return {status:"fail",message:g};let c=b(d),n=typeof c?.status=="string"?c.status:"unknown";return n==="failed"?{status:"fail",message:`Workspace run evidence failed for ${t.project}.`}:n==="passed"?{status:"pass",message:`Workspace run evidence passed for ${t.project}.`}:n==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${t.project}.`}:{status:"warn",message:`Workspace run evidence status is ${n} for ${t.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${t.project}.`}}function C(e,t,r){if(!t)return null;if(typeof e!="string"||e.trim().length===0)return `${r} is stale: missing generatedAt timestamp (required after impact ${t}).`;let s=Date.parse(e),i=Date.parse(t);return Number.isFinite(s)?Number.isFinite(i)&&s<i?`${r} is stale: generated at ${e}, before impact ${t}.`:null:`${r} is stale: invalid generatedAt timestamp (required after impact ${t}).`}function $e(e){if(e.id==="workspace.doctor")return c$2.doctor;if(e.id==="workspace.readiness")return c$2.readiness;if(e.id==="workspace.contract.verify")return c$2.contractVerify;if(e.id==="workspace.analyze")return c$2.analyze;if(e.id==="workspace.pipeline")return "contracts/pipeline-last-run.v1.json"}async function Fe(e,t,r,s){let i=Ce(e,t),o=i?m.relative(t,i).split(m.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!r)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};let k=i?await d$2(t,o??""):null;if(!i||!k)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:o,message:o?`Missing evidence report: ${o}`:"No evidence mapping exists for this command."};let u;try{u=await v.readJson(k);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is unreadable JSON: ${n instanceof Error?n.message:String(n)}`}}let d=b(u);if(!d)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:"Evidence report is not a JSON object."};let g=$e(e);if(g)try{a$3(d,g,`${e.label} evidence`);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is invalid: ${n instanceof Error?n.message:String(n)}`}}let c;if(e.id==="workspace.doctor"){let n=C(d.generatedAt,s,"Doctor evidence");n?c={status:"fail",message:n}:c=Ae(d);}else if(e.id==="workspace.readiness"){let n=C(d.generatedAt,s,"Release readiness evidence");n?c={status:"fail",message:n}:c=je(d);}else if(e.id==="workspace.contract.verify"){let n=C(d.generatedAt,s,"Workspace contract verify evidence");n?c={status:"fail",message:n}:c=Ee(d);}else if(e.id==="workspace.analyze"){let n=C(d.generatedAt,s,"Analyze evidence");n?c={status:"fail",message:n}:c=Se(d);}else if(e.id==="workspace.pipeline"){let n=C(d.generatedAt,s,"Pipeline evidence");n?c={status:"fail",message:n}:c=Ie(d);}else if(e.id==="workspace.doctor-fix"){let n=d.schemaVersion==="rapidkit-doctor-fix-result-v1"?d:d.fixResult,a=b(n),f=typeof a?.generatedAt=="string"?a.generatedAt:void 0,y=C(f,s,"Doctor fix result");y?c={status:"fail",message:y}:await xe(t,f)?c={status:"skipped",message:"No current doctor remediation steps are pending."}:c=We(d);}else if(e.id.startsWith("project."))c=Ve(d,e,s);else {let n=C(d.generatedAt,s,"Evidence report");n?c={status:"fail",message:n}:c={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:c.status,required:e.required,evidencePath:o,message:c.message}}function Oe(e,t={blockingReasons:[],needsAttention:false}){let r=e.filter(n=>n.status==="pass").length,s=e.filter(n=>n.status==="warn").length,i=e.filter(n=>n.status==="fail").length,o=e.filter(n=>n.status==="missing").length,k=e.filter(n=>n.status==="skipped").length,u=e.filter(n=>n.required&&(n.status==="fail"||n.status==="missing")).map(n=>`${n.id}: ${n.message}`),d=e.filter(n=>n.required&&n.status==="missing").length,g="ready",c=0;return u.length>0||t.blockingReasons.length>0?(g="blocked",c=2):(s>0||e.some(n=>!n.required&&n.status==="fail")||d>0||t.needsAttention)&&(g="needs-attention",c=1),{verdict:g,exitCode:c,stepsPassed:r,stepsWarn:s,stepsFailed:i,stepsMissing:o,stepsSkipped:k}}function Be(e,t){let r=S(e.affectedProjects.map(a=>a.project?.name).filter(a=>typeof a=="string")),s=new Set(r.map(a=>a.toLowerCase())),i=S(e.transitiveImpact.map(a=>a.project?.name).filter(a=>typeof a=="string").filter(a=>!s.has(a.toLowerCase()))),o=new Map;for(let a of t){if(a.scope!=="project"||!a.project)continue;let f=a.project.toLowerCase(),y=o.get(f)??[];y.push(a),o.set(f,y);}let k=[],u=[],d=[],g=[],c=false,n=(a,f)=>{let y=o.get(a.toLowerCase())??[];if(y.length===0){d.push(a);return}let W=y.filter(p=>p.status==="fail"),w=W.filter(p=>p.required),x=y.filter(p=>p.status==="missing"),A=x.filter(p=>p.required),P=y.some(p=>p.status==="pass"||p.status==="warn");if(w.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has failed verification evidence (${w.map(p=>p.id).join(", ")}).`);return}if(W.length>0){u.push(a),c=true;return}if(A.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has missing required verification evidence (${A.map(p=>p.id).join(", ")}).`);return}if(x.length>0){u.push(a),c=true;return}if(P){k.push(a);return}d.push(a);};for(let a of r)n(a,"directly-changed");for(let a of i)n(a,"transitive dependent");return {subgraph:{totalProjects:r.length+i.length,directlyChanged:r,transitiveDependents:i,covered:S(k),uncovered:S(u),unverifiable:S(d)},blockingReasons:g,needsAttention:c}}function S(e){return [...new Set(e)].sort((t,r)=>t.localeCompare(r))}async function _e(e){let t=m.resolve(e.workspacePath);if(e.fromImpactPath){let o=be(t,e.fromImpactPath);return {impact:await ue(o),fromImpactRef:m.relative(t,o).split(m.sep).join("/"),impactFromDisk:true}}let r=m.join(t,g);if(await v.pathExists(r))return {impact:await ue(r),fromImpactRef:g,impactFromDisk:true};let s=m.join(t,d$4);if(await v.pathExists(s))return {impact:await p$1({workspacePath:t,fromPath:d$4,scope:e.scope,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}),fromImpactRef:d$4,impactFromDisk:false};let i=await p({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now});return {impact:{schemaVersion:f,generatedAt:(e.now??new Date).toISOString(),fromRef:"baseline",diffRef:a.diff,workspace:{name:i.workspace.name,profile:i.workspace.profile,type:i.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:l(i)?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:b$1.diff,generatedAt:(e.now??new Date).toISOString(),fromRef:"baseline",toRef:a.model,fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:i}},impactFromDisk:false}}function De(e,t){if(t)return e.generatedAt}async function pt(e){let t=m.resolve(e.workspacePath),{impact:r,fromImpactRef:s,impactFromDisk:i}=await _e(e),o$1=r.diff.currentModel,k=i?await p({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}):o$1,u=[];if(i){let l=await p$1({workspacePath:t,fromPath:r.diff.fromRef,diff:r.diff,scope:e.scope,now:e.now}),_=[r.affectedProjects,r.transitiveImpact,r.verificationPlan],D=[l.affectedProjects,l.transitiveImpact,l.verificationPlan];JSON.stringify(_)!==JSON.stringify(D)&&u.push("workspace.impact: Persisted impact semantics do not match the impact re-derived from the embedded diff. Regenerate diff and impact.");}i&&d(k)!==r.diff.toHash&&u.push("workspace.impact: Impact evidence is stale because the current workspace model no longer matches the embedded model. Regenerate diff and impact.");let d$2=r.diff.git;if(i&&d$2?.available){let l=a$1(t,{ref:d$2.ref}),_=r.diff.changes.filter(h=>h.type.startsWith("git.")).map(h=>`${h.type}:${h.target.replace(/^git:/,"")}`).sort(),D=[...l.changedFiles.map(h=>`git.file.changed:${h}`),...l.untrackedFiles.map(h=>`git.untracked:${h}`),...l.deletedFiles.map(h=>`git.deleted:${h}`)].sort();(!l.available||l.commit!==d$2.commit||JSON.stringify(D)!==JSON.stringify(_))&&u.push("workspace.impact: Impact evidence is stale because Git changes no longer match the diff observation. Regenerate diff and impact.");}let g=De(r,i),c$1=we([...o(),...r.verificationPlan]).filter(l=>Re(e.scope,l)),n=[];for(let l of c$1)n.push(await Fe(l,t,o$1.contracts.exists===true,g));let a=Be(r,n),f=a$2(l(o$1)??{nodes:[],edges:[]}),y=b$2(o$1),W=await Ne(t),w=c(y,W?.freshness?.projectHashes),x={verdict:w.verdict,baseline:w.baseline,changed:w.changed,added:w.added,removed:w.removed,projectHashes:d$1(y)},A=b$3(f),P=o$1.policies?.mode??"warn",p$2=await He(o$1,t),B=Me(P,p$2),j=Oe(n,{blockingReasons:[...a.blockingReasons,...A,...B.blockingReasons,...u],needsAttention:a.needsAttention||B.needsAttention}),pe=n.filter(l=>l.status==="missing"&&l.evidencePath).map(l=>l.evidencePath),I=[...n.filter(l=>l.required&&(l.status==="fail"||l.status==="missing")).map(l=>`${l.id}: ${l.message}`),...a.blockingReasons,...A,...B.blockingReasons,...u],me=p$2.filter(l=>l.severity==="error").length,ge=o$1.summary?.projectCount??o$1.projects.length,G=le({projectCount:ge,verdict:j.verdict,exitCode:j.exitCode,blockingReasons:I,policyErrorCount:me});j.verdict=G.verdict,j.exitCode=G.exitCode;let U=I.length>0?de({blockingReasons:I,verifyCommand:"npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json",verifyArtifact:J}):[];return {schemaVersion:fe,generatedAt:(e.now??new Date).toISOString(),workspacePath:t,mode:"evidence",fromImpactRef:s,scope:e.scope,impact:{changed:r.summary.changed,risk:r.summary.risk,affectedProjects:r.summary.affectedProjects,recommendedCommands:r.summary.recommendedCommands},summary:j,steps:n,missingEvidence:pe,blockingReasons:I,...U.length>0?{resolutionHints:U}:{},verificationPlan:c$1,affectedSubgraph:a.subgraph,graphIntegrity:f,freshness:x,policyMode:P,policyViolations:p$2}}async function He(e,t){let r=[];for(let i of e.validation?.issues??[])r.push({source:"model",severity:i.severity,code:i.code,message:i.message,target:i.target});let s=await d$2(t,a.contractVerify);try{if(s&&await v.pathExists(s)){let i=await v.readJson(s);if(Array.isArray(i.violations))for(let o of i.violations)typeof o=="string"&&o.trim().length>0&&r.push({source:"contract",severity:"error",code:"contract.violation",message:o});}}catch{}return r.sort((i,o)=>i.source!==o.source?i.source.localeCompare(o.source):i.code!==o.code?i.code.localeCompare(o.code):i.message.localeCompare(o.message))}function Me(e,t){let r=t.filter(s=>s.severity==="error");return e==="enforce"&&r.length>0?{blockingReasons:r.map(s=>`policy.${s.code}: ${s.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:r.length>0}}async function Ne(e){let t=m.join(e,J);try{if(!await v.pathExists(t))return null;let r=await v.readJson(t);return r&&r.schemaVersion===fe?r:null}catch{return null}}async function mt(e$1,t){return e(t,J,d$3(e$1))}function Te(e,t){let r=t?.strict?"strict":"default",s=[];if(e.summary.verdict==="blocked")return s.push(...e.blockingReasons),s.length===0&&s.push("verify verdict is blocked."),{passed:false,mode:r,exitCode:2,reasons:s};if(r==="strict"){if(e.summary.verdict!=="ready"&&s.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let i=[...e.freshness.changed,...e.freshness.added].slice(0,5);s.push(`freshness is stale${i.length>0?`: ${i.join(", ")}`:""} (strict requires fresh).`);}if(s.length>0)return {passed:false,mode:r,exitCode:1,reasons:s}}return {passed:true,mode:r,exitCode:0,reasons:s}}function gt(e,t){return Te(e,t).exitCode}export{ae as a,Ye as b,fe as c,J as d,Be as e,pt as f,mt as g,Te as h,gt as i};
@@ -0,0 +1 @@
1
+ import t from'path';function o(e){return `"${e.replace(/"/g,'\\"')}"`}function n(e){let r=`scripts.${e.scriptName}=${e.scriptValue}`;return `cd ${o(e.projectPath)} && npm pkg set ${o(r)}`}function s(e){return `workspai:doctor:repair ${Buffer.from(JSON.stringify(e),"utf8").toString("base64url")}`}function d(e){let r=t.join(e.projectPath,e.relativePath),i={type:"file-create",path:r,content:e.content,overwrite:false};return {id:`${e.issueId}.file-create`,issueId:e.issueId,title:e.title,status:"available",fixKind:"file-create",risk:e.risk??"safe",canAutoFix:true,canEditFiles:true,requiresApproval:true,requiresReview:e.requiresReview??false,files:[r],command:s(i),operation:i,verifyCommand:"npx workspai doctor project --json",refreshCommands:["npx workspai doctor project --json","npx workspai workspace verify --json"],reason:e.reason,limitations:e.limitations}}function g(e){let r=t.join(e.projectPath,e.relativePath),i={type:"file-append",path:r,lines:e.lines,ensureNewline:true};return {id:`${e.issueId}.file-append`,issueId:e.issueId,title:e.title,status:"available",fixKind:"file-append",risk:e.risk??"safe",canAutoFix:true,canEditFiles:true,requiresApproval:true,requiresReview:e.requiresReview??false,files:[r],command:s(i),operation:i,verifyCommand:"npx workspai doctor project --json",refreshCommands:["npx workspai doctor project --json","npx workspai workspace verify --json"],reason:e.reason,limitations:e.limitations}}function m(e){let r=t.join(e.projectPath,e.sourceRelativePath),i=t.join(e.projectPath,e.targetRelativePath),a={type:"file-copy",sourcePath:r,path:i,overwrite:false};return {id:`${e.issueId}.file-copy`,issueId:e.issueId,title:e.title,status:"available",fixKind:"file-copy",risk:e.risk??"safe",canAutoFix:true,canEditFiles:true,requiresApproval:true,requiresReview:e.requiresReview??false,files:[r,i],command:s(a),operation:a,verifyCommand:"npx workspai doctor project --json",refreshCommands:["npx workspai doctor project --json","npx workspai workspace verify --json"],reason:e.reason,limitations:e.limitations}}function u(e){return e.lint&&e.lint.trim().length>0?"npm run lint":e.build&&e.build.trim().length>0?"npm run build":null}function f(e){let r=`frontend-script-${e.scriptName}`,i=t.join(e.projectPath,"package.json"),a=["npx workspai doctor project --json","npx workspai workspace verify --json"];return e.scriptValue?{id:`${r}.package-json-script`,issueId:r,title:`Add package.json ${e.scriptName} script`,status:"available",fixKind:"package-json-script",risk:"guarded",canAutoFix:true,canEditFiles:true,requiresApproval:true,requiresReview:false,files:[i],command:n({projectPath:e.projectPath,scriptName:e.scriptName,scriptValue:e.scriptValue}),operation:{type:"package-json-script",path:i,scriptName:e.scriptName,scriptValue:e.scriptValue},verifyCommand:"npx workspai doctor project --json",refreshCommands:a,reason:`Reuse the existing ${e.scriptValue} validation path as the ${e.scriptName} gate for ${e.frameworkDisplayName}.`}:{id:`${r}.manual`,issueId:r,title:`Define ${e.scriptName} script`,status:"manual",fixKind:"manual",risk:"guarded",canAutoFix:false,canEditFiles:false,requiresApproval:true,requiresReview:true,files:[i],refreshCommands:a,reason:`No safe ${e.frameworkDisplayName} fallback script could be inferred from existing package.json scripts.`,limitations:["Add a real test/lint/build command that matches the project quality gate before release."]}}function k(e){let r=t.join(e.projectPath,"package.json");return {id:`${e.issueId}.package-json-script`,issueId:e.issueId,title:e.title,status:"available",fixKind:"package-json-script",risk:e.risk??"guarded",canAutoFix:true,canEditFiles:true,requiresApproval:true,requiresReview:e.requiresReview??false,files:[r],command:n({projectPath:e.projectPath,scriptName:e.scriptName,scriptValue:e.scriptValue}),operation:{type:"package-json-script",path:r,scriptName:e.scriptName,scriptValue:e.scriptValue},verifyCommand:"npx workspai doctor project --json",refreshCommands:["npx workspai doctor project --json","npx workspai workspace verify --json"],reason:e.reason,limitations:e.limitations}}function y(e){let r=t.join(e.projectPath,"Makefile"),i={type:"makefile-target",path:r,target:e.targetName,command:e.command,phony:true};return {id:`${e.issueId}.makefile-target`,issueId:e.issueId,title:e.title,status:"available",fixKind:"file-append",risk:e.risk??"guarded",canAutoFix:true,canEditFiles:true,requiresApproval:true,requiresReview:e.requiresReview??true,files:[r],command:s(i),operation:i,verifyCommand:"npx workspai doctor project --json",refreshCommands:["npx workspai doctor project --json","npx workspai workspace verify --json"],reason:e.reason,limitations:e.limitations}}function v(e){return {id:`${e.issueId}.command`,issueId:e.issueId,title:e.title,status:"available",fixKind:e.fixKind??"command",risk:e.risk??"guarded",canAutoFix:true,canEditFiles:false,requiresApproval:true,requiresReview:e.requiresReview??true,files:e.files.map(r=>t.join(e.projectPath,r)),command:`cd ${o(e.projectPath)} && ${e.command}`,...e.invocation?{invocation:{cwd:e.projectPath,executable:e.invocation.executable,args:[...e.invocation.args]}}:{},...e.strategy?{strategy:e.strategy.map(r=>({...r}))}:{},...e.transaction?{transaction:structuredClone(e.transaction)}:{},verifyCommand:"npx workspai doctor project --json",refreshCommands:["npx workspai doctor project --json","npx workspai workspace verify --json"],reason:e.reason,limitations:e.limitations}}export{s as a,d as b,g as c,m as d,u as e,f,k as g,y as h,v as i};
@@ -1 +1 @@
1
- import {d as d$1,c,e}from'./chunk-SS2VV3D5.js';import {b,a as a$1}from'./chunk-AHLMIL2T.js';import k from'fs-extra';var y=b.history,a=a$1.history,d=50;function A(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;return typeof e.generatedAt!="string"?null:e.kind==="agent-action"?typeof e.actionId!="string"||typeof e.summary!="string"||e.outcome!=="ok"&&e.outcome!=="failed"?null:{kind:"agent-action",generatedAt:e.generatedAt,actionId:e.actionId,scope:typeof e.scope=="string"?e.scope:"workspace",summary:e.summary,outcome:e.outcome,...typeof e.evidenceSha256=="string"?{evidenceSha256:e.evidenceSha256}:{}}:e.kind==="doctor-fix"?e.scope!=="workspace"&&e.scope!=="project"||typeof e.summary!="string"||e.outcome!=="ok"&&e.outcome!=="failed"?null:{kind:"doctor-fix",generatedAt:e.generatedAt,scope:e.scope,summary:e.summary,outcome:e.outcome,applied:typeof e.applied=="number"?e.applied:0,failed:typeof e.failed=="number"?e.failed:0,skipped:typeof e.skipped=="number"?e.skipped:0,remainingBlockers:typeof e.remainingBlockers=="number"?e.remainingBlockers:0}:typeof e.verdict!="string"||typeof e.risk!="string"||typeof e.gatePassed!="boolean"?null:{kind:"verify",generatedAt:e.generatedAt,verdict:e.verdict,risk:String(e.risk),affectedProjects:typeof e.affectedProjects=="number"?e.affectedProjects:0,freshness:e.freshness??"unknown",gatePassed:e.gatePassed,blockingReasons:typeof e.blockingReasons=="number"?e.blockingReasons:0,policyViolations:typeof e.policyViolations=="number"?e.policyViolations:0}}function S(t,e){return {kind:"verify",generatedAt:t.generatedAt,verdict:t.summary.verdict,risk:t.impact.risk,affectedProjects:t.impact.affectedProjects,freshness:t.freshness.verdict,gatePassed:e,blockingReasons:t.blockingReasons.length,policyViolations:t.policyViolations.length}}function F(t){return {kind:"agent-action",generatedAt:t.generatedAt,actionId:t.actionId,scope:t.scope,summary:t.summary,outcome:t.outcome,...t.evidenceSha256?{evidenceSha256:t.evidenceSha256}:{}}}function V(t,e){let o=t.appliedFixes.filter(i=>i.outcome==="applied").length,r=t.appliedFixes.filter(i=>i.outcome==="failed").length,n=t.appliedFixes.filter(i=>i.outcome==="skipped").length,s=t.appliedFixes.filter(i=>i.outcome==="guidance").length,c=t.remainingBlockers.length,g=r>0||c>0?"failed":"ok";return {kind:"doctor-fix",generatedAt:t.generatedAt,scope:e,summary:`${o} applied, ${r} failed, ${n} skipped, ${s} guidance, ${c} blocker(s) remaining`,outcome:g,applied:o,failed:r,skipped:n,remainingBlockers:c}}async function E(t){let e=await d$1(t,a);try{if(!e||!await k.pathExists(e))return null;let o=await k.readJson(e);return o?.schemaVersion!==y||!Array.isArray(o.entries)?null:{schemaVersion:y,retention:typeof o.retention=="number"?o.retention:d,entries:o.entries.map(r=>A(r)).filter(r=>r!=null)}}catch{return null}}function x(t,e,o=d){let r=Math.max(1,Math.floor(o)),n=[...t?.entries??[],e],s=n.slice(Math.max(0,n.length-r));return {schemaVersion:y,retention:r,entries:s}}async function v(t,e$1,o){return c(t,a,async()=>{let r=await d$1(t,a),n=await E(t);if(r&&!n)throw new Error(`Workspace history is unreadable or invalid; refusing to overwrite: ${r}`);let s=x(n,e$1,o?.retention??d);return await e(t,a,s),s})}export{y as a,a as b,d as c,A as d,S as e,F as f,V as g,E as h,x as i,v as j};
1
+ import {d as d$1,c,e}from'./chunk-MBRU3VWJ.js';import {b,a as a$1}from'./chunk-62K2H72S.js';import k from'fs-extra';var y=b.history,a=a$1.history,d=50;function A(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;return typeof e.generatedAt!="string"?null:e.kind==="agent-action"?typeof e.actionId!="string"||typeof e.summary!="string"||e.outcome!=="ok"&&e.outcome!=="failed"?null:{kind:"agent-action",generatedAt:e.generatedAt,actionId:e.actionId,scope:typeof e.scope=="string"?e.scope:"workspace",summary:e.summary,outcome:e.outcome,...typeof e.evidenceSha256=="string"?{evidenceSha256:e.evidenceSha256}:{}}:e.kind==="doctor-fix"?e.scope!=="workspace"&&e.scope!=="project"||typeof e.summary!="string"||e.outcome!=="ok"&&e.outcome!=="failed"?null:{kind:"doctor-fix",generatedAt:e.generatedAt,scope:e.scope,summary:e.summary,outcome:e.outcome,applied:typeof e.applied=="number"?e.applied:0,failed:typeof e.failed=="number"?e.failed:0,skipped:typeof e.skipped=="number"?e.skipped:0,remainingBlockers:typeof e.remainingBlockers=="number"?e.remainingBlockers:0}:typeof e.verdict!="string"||typeof e.risk!="string"||typeof e.gatePassed!="boolean"?null:{kind:"verify",generatedAt:e.generatedAt,verdict:e.verdict,risk:String(e.risk),affectedProjects:typeof e.affectedProjects=="number"?e.affectedProjects:0,freshness:e.freshness??"unknown",gatePassed:e.gatePassed,blockingReasons:typeof e.blockingReasons=="number"?e.blockingReasons:0,policyViolations:typeof e.policyViolations=="number"?e.policyViolations:0}}function S(t,e){return {kind:"verify",generatedAt:t.generatedAt,verdict:t.summary.verdict,risk:t.impact.risk,affectedProjects:t.impact.affectedProjects,freshness:t.freshness.verdict,gatePassed:e,blockingReasons:t.blockingReasons.length,policyViolations:t.policyViolations.length}}function F(t){return {kind:"agent-action",generatedAt:t.generatedAt,actionId:t.actionId,scope:t.scope,summary:t.summary,outcome:t.outcome,...t.evidenceSha256?{evidenceSha256:t.evidenceSha256}:{}}}function V(t,e){let o=t.appliedFixes.filter(i=>i.outcome==="applied").length,r=t.appliedFixes.filter(i=>i.outcome==="failed").length,n=t.appliedFixes.filter(i=>i.outcome==="skipped").length,s=t.appliedFixes.filter(i=>i.outcome==="guidance").length,c=t.remainingBlockers.length,g=r>0||c>0?"failed":"ok";return {kind:"doctor-fix",generatedAt:t.generatedAt,scope:e,summary:`${o} applied, ${r} failed, ${n} skipped, ${s} guidance, ${c} blocker(s) remaining`,outcome:g,applied:o,failed:r,skipped:n,remainingBlockers:c}}async function E(t){let e=await d$1(t,a);try{if(!e||!await k.pathExists(e))return null;let o=await k.readJson(e);return o?.schemaVersion!==y||!Array.isArray(o.entries)?null:{schemaVersion:y,retention:typeof o.retention=="number"?o.retention:d,entries:o.entries.map(r=>A(r)).filter(r=>r!=null)}}catch{return null}}function x(t,e,o=d){let r=Math.max(1,Math.floor(o)),n=[...t?.entries??[],e],s=n.slice(Math.max(0,n.length-r));return {schemaVersion:y,retention:r,entries:s}}async function v(t,e$1,o){return c(t,a,async()=>{let r=await d$1(t,a),n=await E(t);if(r&&!n)throw new Error(`Workspace history is unreadable or invalid; refusing to overwrite: ${r}`);let s=x(n,e$1,o?.retention??d);return await e(t,a,s),s})}export{y as a,a as b,d as c,A as d,S as e,F as f,V as g,E as h,x as i,v as j};
@@ -1 +1 @@
1
- export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-JFUD73OZ.js';
1
+ export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-IO54DFWR.js';
@@ -1 +1 @@
1
- export{a as DOCTOR_WORKSPACE_REPORT_PATH,m as applyEnvKeyAddFix,i as applyFileAppendFix,j as applyFileCopyFix,h as applyFileCreateFix,l as applyJsonEditFix,n as applyMakefileTargetFix,g as applyPackageScriptFix,f as assertOperationPathInsideProject,e as buildRepairOperationIdentity,p as computeDoctorFixAwareExitCode,o as computeDoctorGateExitCode,k as decodeJsonPointerSegment,d as parseInternalRepairCommand,c as parsePackageScriptFix,b as resolveDoctorPolicyProfile,q as runDoctor}from'./chunk-AL2A7Q4X.js';
1
+ export{a as DOCTOR_WORKSPACE_REPORT_PATH,m as applyEnvKeyAddFix,i as applyFileAppendFix,j as applyFileCopyFix,h as applyFileCreateFix,l as applyJsonEditFix,n as applyMakefileTargetFix,g as applyPackageScriptFix,f as assertOperationPathInsideProject,e as buildRepairOperationIdentity,p as computeDoctorFixAwareExitCode,o as computeDoctorGateExitCode,k as decodeJsonPointerSegment,d as parseInternalRepairCommand,c as parsePackageScriptFix,b as resolveDoctorPolicyProfile,q as runDoctor}from'./chunk-6AXRIAP2.js';
package/dist/index.d.ts CHANGED
@@ -56,6 +56,8 @@ declare function getPublishedContractVersions(): {
56
56
  doctorWorkspaceEvidence: "doctor-workspace-evidence-v1";
57
57
  doctorGraphDiagnosis: "doctor-graph-diagnosis.v1";
58
58
  projectTestCoverage: string;
59
+ verifiedGoal: string;
60
+ verifiedGoalStatus: "workspai.verified-goal-status.v1";
59
61
  workspaceIntelligenceArchitecture: string;
60
62
  workspaceIntelligenceChain: "workspai-workspace-intelligence-chain-v1";
61
63
  workspaceIntelligenceArtifacts: {
@@ -79,6 +81,7 @@ declare function getPublishedContractVersions(): {
79
81
  readonly intelligenceRun: "workspace-intelligence-run.v1";
80
82
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
81
83
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
84
+ readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
82
85
  };
83
86
  cliLogEvent: "cli-log-event-v1";
84
87
  freshnessMetadata: "rapidkit-freshness-metadata-v1";
@@ -106,6 +109,7 @@ declare function getPublishedContractVersions(): {
106
109
  workspaceExplain: "workspace-explain.v1";
107
110
  agentActionOutcome: "agent-action-outcome.v1";
108
111
  doctorRemediationPlan: "doctor-remediation-plan-v2";
112
+ doctorDependencyRepairTransaction: string;
109
113
  artifactRemediationPlan: "artifact-remediation-plan-v1";
110
114
  doctorFixResult: "rapidkit-doctor-fix-result-v1";
111
115
  };
@@ -113,9 +117,9 @@ declare function getPublishedContractCatalog(): {
113
117
  [k: string]: {
114
118
  artifacts?: {
115
119
  [k: string]: {
116
- path: "AGENTS.md" | ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-knowledge-graph.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json" | ".workspai/reports/workspace-intelligence-evaluation-live.json" | ".workspai/reports/workspace-intelligence-evaluation-last-run.json";
117
- schemaVersion: "workspace-model.v1" | "workspace-knowledge-graph.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | "workspace-intelligence-evaluation.v1" | null;
118
- contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json" | null;
120
+ path: "AGENTS.md" | ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-knowledge-graph.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json" | ".workspai/reports/workspace-intelligence-evaluation-live.json" | ".workspai/reports/workspace-intelligence-evaluation-last-run.json" | ".workspai/reports/verified-goal-last-run.json";
121
+ schemaVersion: "workspace-model.v1" | "workspace-knowledge-graph.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | "workspace-intelligence-evaluation.v1" | "workspai.verified-goal-status.v1" | null;
122
+ contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json" | "contracts/workspace-intelligence/verified-goal-status.v1.json" | null;
119
123
  };
120
124
  } | undefined;
121
125
  schemaVersion: string | number | {
@@ -139,6 +143,7 @@ declare function getPublishedContractCatalog(): {
139
143
  readonly intelligenceRun: "workspace-intelligence-run.v1";
140
144
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
141
145
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
146
+ readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
142
147
  };
143
148
  contractPath: string | null;
144
149
  publication: "capability-contract" | "json-schema" | "embedded-type";
@@ -221,6 +226,8 @@ declare function getVersionContract(): {
221
226
  doctorWorkspaceEvidence: "doctor-workspace-evidence-v1";
222
227
  doctorGraphDiagnosis: "doctor-graph-diagnosis.v1";
223
228
  projectTestCoverage: string;
229
+ verifiedGoal: string;
230
+ verifiedGoalStatus: "workspai.verified-goal-status.v1";
224
231
  workspaceIntelligenceArchitecture: string;
225
232
  workspaceIntelligenceChain: "workspai-workspace-intelligence-chain-v1";
226
233
  workspaceIntelligenceArtifacts: {
@@ -244,6 +251,7 @@ declare function getVersionContract(): {
244
251
  readonly intelligenceRun: "workspace-intelligence-run.v1";
245
252
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
246
253
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
254
+ readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
247
255
  };
248
256
  cliLogEvent: "cli-log-event-v1";
249
257
  freshnessMetadata: "rapidkit-freshness-metadata-v1";
@@ -271,6 +279,7 @@ declare function getVersionContract(): {
271
279
  workspaceExplain: "workspace-explain.v1";
272
280
  agentActionOutcome: "agent-action-outcome.v1";
273
281
  doctorRemediationPlan: "doctor-remediation-plan-v2";
282
+ doctorDependencyRepairTransaction: string;
274
283
  artifactRemediationPlan: "artifact-remediation-plan-v1";
275
284
  doctorFixResult: "rapidkit-doctor-fix-result-v1";
276
285
  };
@@ -278,9 +287,9 @@ declare function getVersionContract(): {
278
287
  [k: string]: {
279
288
  artifacts?: {
280
289
  [k: string]: {
281
- path: "AGENTS.md" | ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-knowledge-graph.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json" | ".workspai/reports/workspace-intelligence-evaluation-live.json" | ".workspai/reports/workspace-intelligence-evaluation-last-run.json";
282
- schemaVersion: "workspace-model.v1" | "workspace-knowledge-graph.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | "workspace-intelligence-evaluation.v1" | null;
283
- contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json" | null;
290
+ path: "AGENTS.md" | ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-knowledge-graph.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json" | ".workspai/reports/workspace-intelligence-evaluation-live.json" | ".workspai/reports/workspace-intelligence-evaluation-last-run.json" | ".workspai/reports/verified-goal-last-run.json";
291
+ schemaVersion: "workspace-model.v1" | "workspace-knowledge-graph.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | "workspace-intelligence-evaluation.v1" | "workspai.verified-goal-status.v1" | null;
292
+ contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json" | "contracts/workspace-intelligence/verified-goal-status.v1.json" | null;
284
293
  };
285
294
  } | undefined;
286
295
  schemaVersion: string | number | {
@@ -304,6 +313,7 @@ declare function getVersionContract(): {
304
313
  readonly intelligenceRun: "workspace-intelligence-run.v1";
305
314
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
306
315
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
316
+ readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
307
317
  };
308
318
  contractPath: string | null;
309
319
  publication: "capability-contract" | "json-schema" | "embedded-type";
@@ -380,6 +390,8 @@ declare function getGlobalCommandCapabilities(): {
380
390
  doctorWorkspaceEvidence: "doctor-workspace-evidence-v1";
381
391
  doctorGraphDiagnosis: "doctor-graph-diagnosis.v1";
382
392
  projectTestCoverage: string;
393
+ verifiedGoal: string;
394
+ verifiedGoalStatus: "workspai.verified-goal-status.v1";
383
395
  workspaceIntelligenceArchitecture: string;
384
396
  workspaceIntelligenceChain: "workspai-workspace-intelligence-chain-v1";
385
397
  workspaceIntelligenceArtifacts: {
@@ -403,6 +415,7 @@ declare function getGlobalCommandCapabilities(): {
403
415
  readonly intelligenceRun: "workspace-intelligence-run.v1";
404
416
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
405
417
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
418
+ readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
406
419
  };
407
420
  cliLogEvent: "cli-log-event-v1";
408
421
  freshnessMetadata: "rapidkit-freshness-metadata-v1";
@@ -430,6 +443,7 @@ declare function getGlobalCommandCapabilities(): {
430
443
  workspaceExplain: "workspace-explain.v1";
431
444
  agentActionOutcome: "agent-action-outcome.v1";
432
445
  doctorRemediationPlan: "doctor-remediation-plan-v2";
446
+ doctorDependencyRepairTransaction: string;
433
447
  artifactRemediationPlan: "artifact-remediation-plan-v1";
434
448
  doctorFixResult: "rapidkit-doctor-fix-result-v1";
435
449
  };
@@ -437,9 +451,9 @@ declare function getGlobalCommandCapabilities(): {
437
451
  [k: string]: {
438
452
  artifacts?: {
439
453
  [k: string]: {
440
- path: "AGENTS.md" | ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-knowledge-graph.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json" | ".workspai/reports/workspace-intelligence-evaluation-live.json" | ".workspai/reports/workspace-intelligence-evaluation-last-run.json";
441
- schemaVersion: "workspace-model.v1" | "workspace-knowledge-graph.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | "workspace-intelligence-evaluation.v1" | null;
442
- contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json" | null;
454
+ path: "AGENTS.md" | ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-knowledge-graph.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json" | ".workspai/reports/workspace-intelligence-evaluation-live.json" | ".workspai/reports/workspace-intelligence-evaluation-last-run.json" | ".workspai/reports/verified-goal-last-run.json";
455
+ schemaVersion: "workspace-model.v1" | "workspace-knowledge-graph.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | "workspace-intelligence-evaluation.v1" | "workspai.verified-goal-status.v1" | null;
456
+ contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json" | "contracts/workspace-intelligence/verified-goal-status.v1.json" | null;
443
457
  };
444
458
  } | undefined;
445
459
  schemaVersion: string | number | {
@@ -463,6 +477,7 @@ declare function getGlobalCommandCapabilities(): {
463
477
  readonly intelligenceRun: "workspace-intelligence-run.v1";
464
478
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
465
479
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
480
+ readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
466
481
  };
467
482
  contractPath: string | null;
468
483
  publication: "capability-contract" | "json-schema" | "embedded-type";
@@ -475,8 +490,8 @@ declare function getGlobalCommandCapabilities(): {
475
490
  };
476
491
  workspace: {
477
492
  command: string;
478
- subcommands: ("archive" | "snapshot" | "list" | "import" | "init" | "model" | "diff" | "impact" | "verify" | "explain" | "sync" | "registry" | "foundation" | "intelligence" | "graph" | "watch" | "context" | "agent-sync" | "remediation-plan" | "why" | "trace" | "feedback" | "eval" | "mcp" | "policy" | "contract" | "share" | "export" | "hydrate" | "connect" | "run")[];
479
- intelligenceSubcommands: ("snapshot" | "model" | "diff" | "impact" | "verify" | "explain" | "intelligence" | "graph" | "watch" | "context" | "agent-sync" | "remediation-plan" | "why" | "trace" | "feedback" | "eval" | "mcp" | "contract")[];
493
+ subcommands: ("archive" | "snapshot" | "list" | "import" | "init" | "model" | "diff" | "impact" | "verify" | "explain" | "sync" | "registry" | "foundation" | "intelligence" | "goal" | "graph" | "watch" | "context" | "agent-sync" | "remediation-plan" | "why" | "trace" | "feedback" | "eval" | "mcp" | "policy" | "contract" | "share" | "export" | "hydrate" | "connect" | "run")[];
494
+ intelligenceSubcommands: ("snapshot" | "model" | "diff" | "impact" | "verify" | "explain" | "intelligence" | "goal" | "graph" | "watch" | "context" | "agent-sync" | "remediation-plan" | "why" | "trace" | "feedback" | "eval" | "mcp" | "contract")[];
480
495
  };
481
496
  commandMap: any;
482
497
  runtimeInventory: RuntimeCommandInventoryPayload;