workspai 0.52.2 → 0.53.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 (132) hide show
  1. package/README.md +2 -0
  2. package/contracts/artifact-remediation-plan.v1.json +1 -0
  3. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +36 -0
  4. package/contracts/extension-cli-compatibility.v1.json +24 -2
  5. package/contracts/pipeline-last-run.v1.json +6 -1
  6. package/contracts/published-contract-catalog.v1.json +113 -2
  7. package/contracts/runtime-command-surface.v1.json +216 -5
  8. package/contracts/studio-card-repair-capabilities.v1.json +378 -0
  9. package/contracts/workspace-intelligence/workspace-repair-proposal.v1.json +78 -0
  10. package/contracts/workspace-intelligence/workspace-repair-transaction.v1.json +249 -0
  11. package/contracts/workspace-intelligence-chain.v1.json +6 -0
  12. package/contracts/workspace-repair-capabilities.v1.json +316 -0
  13. package/dist/analyze-AAZEJ4FC.js +1 -0
  14. package/dist/artifact-remediation-plan-CJSPCMWA.js +1 -0
  15. package/dist/autopilot-release-LZWNQQLY.js +1 -0
  16. package/dist/chunk-27AXFTKW.js +1 -0
  17. package/dist/{chunk-OTDGTAZJ.js → chunk-2FJW6GSW.js} +1 -1
  18. package/dist/chunk-3DONU3DU.js +1 -0
  19. package/dist/chunk-44VJHNZB.js +1 -0
  20. package/dist/chunk-5XDPQ3CB.js +1 -0
  21. package/dist/chunk-7AR5PDLD.js +1 -0
  22. package/dist/chunk-7KKP7RNB.js +3 -0
  23. package/dist/chunk-AMB42V2F.js +1 -0
  24. package/dist/chunk-BYVTHIC3.js +2 -0
  25. package/dist/chunk-E5YYVFM2.js +1 -0
  26. package/dist/{chunk-6PBSAAS5.js → chunk-EBKYSDCX.js} +1 -1
  27. package/dist/chunk-FQLB4BIC.js +7 -0
  28. package/dist/{chunk-ICLYL3N5.js → chunk-FZCYTRBQ.js} +1 -1
  29. package/dist/{chunk-ZVOEPWQM.js → chunk-GDU7VP6G.js} +1 -1
  30. package/dist/chunk-H7P7SSUW.js +75 -0
  31. package/dist/chunk-HOVJUP7K.js +8 -0
  32. package/dist/{chunk-MZFSINY7.js → chunk-HRN5J6PW.js} +12 -12
  33. package/dist/chunk-HY3RMPW5.js +10 -0
  34. package/dist/chunk-KFKZOPZC.js +1 -0
  35. package/dist/{chunk-HPWLSLMC.js → chunk-KVUYAYTY.js} +1 -1
  36. package/dist/chunk-MQ73VS4E.js +2 -0
  37. package/dist/{chunk-2OIBHUVH.js → chunk-MRFN5ZQP.js} +1 -1
  38. package/dist/{chunk-4UVGTFOX.js → chunk-NYHVCFBT.js} +1 -1
  39. package/dist/{chunk-IO54DFWR.js → chunk-OLX6LX77.js} +1 -1
  40. package/dist/chunk-OUBBBC7T.js +36 -0
  41. package/dist/{chunk-WJY7ZXVJ.js → chunk-P7K5RHJC.js} +1 -1
  42. package/dist/chunk-QZ7PNMVP.js +1 -0
  43. package/dist/chunk-RA24WQLF.js +1 -0
  44. package/dist/chunk-RMXXK64P.js +4 -0
  45. package/dist/{chunk-PTTZPDLX.js → chunk-S7Z4DP3P.js} +1 -1
  46. package/dist/chunk-SJLUE6AY.js +1 -0
  47. package/dist/chunk-SUV7Y2FH.js +3 -0
  48. package/dist/chunk-T6JI7GYZ.js +88 -0
  49. package/dist/chunk-USMLRNZ7.js +5 -0
  50. package/dist/chunk-WD2XDMGB.js +1 -0
  51. package/dist/chunk-WIO6L24E.js +2 -0
  52. package/dist/{chunk-QURMI7ID.js → chunk-WZA5ISAQ.js} +1 -1
  53. package/dist/chunk-XVRJVKOX.js +1 -0
  54. package/dist/{create-ESK3CQPK.js → create-R6A7EHQZ.js} +1 -1
  55. package/dist/{doctor-MYRJ5BFF.js → doctor-KNIYGDM7.js} +1 -1
  56. package/dist/index.d.ts +92 -23
  57. package/dist/index.js +246 -244
  58. package/dist/pipeline-PVCLAQDI.js +5 -0
  59. package/dist/{project-intelligence-lens-Q4SZDI2N.js → project-intelligence-lens-ZOAWXYC5.js} +1 -1
  60. package/dist/project-test-coverage-44ZPCOPV.js +1 -0
  61. package/dist/{verified-goal-23HZPMRK.js → verified-goal-MCSNMA3P.js} +1 -1
  62. package/dist/{workspace-LSOZM2CG.js → workspace-B53XH35L.js} +1 -1
  63. package/dist/{workspace-agent-sync-RZBQXCNJ.js → workspace-agent-sync-446AXPHJ.js} +1 -1
  64. package/dist/{workspace-archive-ZOWQXWJ6.js → workspace-archive-VHUPOBAV.js} +1 -1
  65. package/dist/{workspace-context-IYJKO5BN.js → workspace-context-XSECHC7O.js} +1 -1
  66. package/dist/{workspace-contract-AZFISDLS.js → workspace-contract-AYFTZIKM.js} +1 -1
  67. package/dist/workspace-explain-SZI2WAAD.js +1 -0
  68. package/dist/workspace-explain-contract-N2XQHAPM.js +1 -0
  69. package/dist/{workspace-feedback-LIHEWTNV.js → workspace-feedback-WXE7NVMV.js} +1 -1
  70. package/dist/{workspace-foundation-H5UTAUXQ.js → workspace-foundation-FFNCK5ZD.js} +1 -1
  71. package/dist/{workspace-graph-stream-KUDOZE73.js → workspace-graph-stream-AJPS45FD.js} +1 -1
  72. package/dist/{workspace-history-HULG5EFN.js → workspace-history-YY7YRDOH.js} +1 -1
  73. package/dist/{workspace-intelligence-A4UE4DZK.js → workspace-intelligence-FWRB47EJ.js} +1 -1
  74. package/dist/{workspace-intelligence-evaluation-AOLGHYHC.js → workspace-intelligence-evaluation-UP2K3L35.js} +1 -1
  75. package/dist/{workspace-intelligence-runner-VYGSASDP.js → workspace-intelligence-runner-JNCQLUH7.js} +1 -1
  76. package/dist/workspace-intelligence-runtime-registry-MRSF7RTT.js +1 -0
  77. package/dist/{workspace-knowledge-graph-LEM6X5CM.js → workspace-knowledge-graph-BMMM2FUE.js} +1 -1
  78. package/dist/{workspace-mcp-serve-N2QPR7VJ.js → workspace-mcp-serve-COA4FMCA.js} +1 -1
  79. package/dist/{workspace-model-FJXX3NET.js → workspace-model-MNJOGBPP.js} +1 -1
  80. package/dist/{workspace-onboarding-IKFISWWY.js → workspace-onboarding-2B7CYZ5H.js} +1 -1
  81. package/dist/{workspace-readme-E2M35RJH.js → workspace-readme-4S6PJ74A.js} +1 -1
  82. package/dist/{workspace-registry-summary-HOQ3OBNT.js → workspace-registry-summary-GPJEL7K7.js} +1 -1
  83. package/dist/workspace-repair-engine-SRWECKZO.js +3 -0
  84. package/dist/workspace-run-3U77TMKX.js +1 -0
  85. package/dist/{workspace-verify-32AWCJQG.js → workspace-verify-C6HWHRLJ.js} +1 -1
  86. package/dist/{workspace-watch-4WVNB26E.js → workspace-watch-DLPHLF5R.js} +1 -1
  87. package/docs/README.md +2 -0
  88. package/docs/commands-reference.md +10 -8
  89. package/docs/contracts/ARTIFACT_CATALOG.md +27 -22
  90. package/docs/contracts/README.md +3 -0
  91. package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +20 -11
  92. package/docs/doctor-command.md +10 -4
  93. package/docs/workspace-intelligence-runner.md +2 -1
  94. package/docs/workspace-knowledge-graph.md +6 -1
  95. package/docs/workspace-operations.md +3 -1
  96. package/docs/workspace-repair-engine.md +113 -0
  97. package/docs/workspace-run.md +17 -14
  98. package/package.json +3 -2
  99. package/scripts/enterprise-package-smoke.mjs +9 -6
  100. package/dist/analyze-J7VNZMDH.js +0 -1
  101. package/dist/artifact-remediation-plan-2UKY4TKO.js +0 -3
  102. package/dist/autopilot-release-34H5BSI2.js +0 -1
  103. package/dist/chunk-23JDMHSD.js +0 -86
  104. package/dist/chunk-2E6WGUN6.js +0 -1
  105. package/dist/chunk-3D3PFPP5.js +0 -1
  106. package/dist/chunk-4D7DIGAB.js +0 -1
  107. package/dist/chunk-5XJRCP3D.js +0 -36
  108. package/dist/chunk-62K2H72S.js +0 -1
  109. package/dist/chunk-7MQZQ4UU.js +0 -1
  110. package/dist/chunk-AL237TSJ.js +0 -7
  111. package/dist/chunk-AYHNNPPH.js +0 -8
  112. package/dist/chunk-B4CPDK6J.js +0 -2
  113. package/dist/chunk-CZC5P2MF.js +0 -1
  114. package/dist/chunk-DZ4VKAXB.js +0 -75
  115. package/dist/chunk-FUPHQOJB.js +0 -1
  116. package/dist/chunk-GHB6QMQH.js +0 -1
  117. package/dist/chunk-JIUWK4ML.js +0 -1
  118. package/dist/chunk-KHEJO3JU.js +0 -4
  119. package/dist/chunk-LOCPNNSK.js +0 -1
  120. package/dist/chunk-LPCL4U4L.js +0 -1
  121. package/dist/chunk-MBRU3VWJ.js +0 -2
  122. package/dist/chunk-P4OSLAVD.js +0 -3
  123. package/dist/chunk-Q6CUJ3WF.js +0 -10
  124. package/dist/chunk-SQTV2OYU.js +0 -4
  125. package/dist/chunk-ULR66OJR.js +0 -2
  126. package/dist/chunk-XHRHNVCZ.js +0 -1
  127. package/dist/pipeline-FOZ46ELQ.js +0 -5
  128. package/dist/project-test-coverage-A677ZLW3.js +0 -1
  129. package/dist/workspace-explain-26UGV7L4.js +0 -1
  130. package/dist/workspace-explain-contract-GIWPCCEF.js +0 -1
  131. package/dist/workspace-intelligence-runtime-registry-YOQ5GFFJ.js +0 -1
  132. package/dist/workspace-run-GUW4EOYB.js +0 -1
@@ -0,0 +1,5 @@
1
+ import {d,b,e}from'./chunk-WD2XDMGB.js';import {d as d$2}from'./chunk-S5KTATOU.js';import {a}from'./chunk-27UR373Z.js';import {p as p$1,w as w$1,t as t$1}from'./chunk-6HJJHEL6.js';import {h,j,f,e as e$2}from'./chunk-2PY65U6X.js';import {d as d$1}from'./chunk-WIO6L24E.js';import {e as e$1}from'./chunk-44VJHNZB.js';import {a as a$1}from'./chunk-TQEMLBAG.js';import {t,p,s}from'./chunk-MOSXTVPU.js';import {e as e$3,g}from'./chunk-RJIYCDVC.js';import K from'fs';import w from'path';import E from'chalk';import {execa}from'execa';function Ce(e){return K.existsSync(w.join(e,"bun.lock"))||K.existsSync(w.join(e,"bunfig.toml"))?"bun":K.existsSync(w.join(e,"pnpm-lock.yaml"))?"pnpm":K.existsSync(w.join(e,"yarn.lock"))?"yarn":(K.existsSync(w.join(e,"package-lock.json")),"npm")}function Pe(e,r,t=Ce(e)){return t==="npm"?`npm run ${r}`:`${t} run ${r}`}function Ae(e,r=Ce(e)){return `${r} install`}var Ve={"python-fastapi":{runtime:"python",framework:"FastAPI",markers:["pyproject.toml","fastapi"],commands:{init:"python -m pip install -e .",test:"pytest",build:"python -m build",start:"uvicorn main:app --reload"},errorPatterns:{setup:["ModuleNotFoundError","No module named","pip: command not found"],"test-failure":["FAILED","ERROR","test session started"],dependency:["ImportError","missing.*dependency"],runtime:["TypeError","AttributeError","ValueError"],timeout:["timeout","Timeout","timed out"],unknown:[]},healthCheck:{stage:"start",type:"http",value:"http://localhost:8000/docs"},validation:{command:"python -m pip list | grep fastapi",error:"FastAPI not installed"}},"python-django":{runtime:"python",framework:"Django",markers:["manage.py","django"],commands:{init:"python manage.py migrate",test:"python manage.py test",build:"python manage.py collectstatic --noinput",start:"python manage.py runserver 0.0.0.0:8000"},errorPatterns:{setup:["ModuleNotFoundError","ProgrammingError.*migrate"],"test-failure":["FAILED","ERROR","Ran.*test"],dependency:["ImportError","missing.*dependency"],runtime:["DatabaseError","ImproperlyConfigured"],timeout:["timeout","Timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:8e3},dependencies:["init"]},"node-nestjs":{runtime:"node",framework:"NestJS",markers:["package.json","@nestjs/core"],commands:{init:"npm install",test:"npm run test",build:"npm run build",start:"npm run start"},errorPatterns:{setup:["npm ERR!","ENOENT","not found"],"test-failure":["Tests.*failed","FAIL","fail.*test"],dependency:["Cannot find module","ERR_MODULE_NOT_FOUND"],runtime:["TypeError","Error: ","ReferenceError"],timeout:["timeout","TIMEOUT"],unknown:[]},healthCheck:{stage:"start",type:"port",value:3e3}},"node-express":{runtime:"node",framework:"Express",markers:["package.json","express"],commands:{init:"npm install",test:"npm run test",build:"npm run build",start:"npm start"},errorPatterns:{setup:["npm ERR!","ENOENT"],"test-failure":["failed","FAIL"],dependency:["Cannot find module"],runtime:["Error","TypeError"],timeout:["timeout"],unknown:[]}},"go-fiber":{runtime:"go",framework:"Fiber",markers:["go.mod","fiber"],commands:{init:"go mod download && go mod tidy",test:"go test ./...",build:"go build -o app .",start:"./app"},errorPatterns:{setup:["go: .*not found","cannot find","go mod tidy"],"test-failure":["FAIL","--- FAIL"],dependency:["missing.*module"],runtime:["panic","fatal","Error"],timeout:["timeout","context deadline"],unknown:[]},dependencies:["init"]},"go-gin":{runtime:"go",framework:"Gin",markers:["go.mod","gin-gonic"],commands:{init:"go mod download && go mod tidy",test:"go test ./...",build:"go build -o app .",start:"./app"},errorPatterns:{setup:["go: .*not found"],"test-failure":["FAIL"],dependency:["missing.*module"],runtime:["panic"],timeout:["timeout"],unknown:[]}},"java-springboot":{runtime:"java",framework:"Spring Boot",markers:["pom.xml","build.gradle","spring-boot"],commands:{init:"mvn dependency:go-offline",test:"mvn test",build:"mvn package -DskipTests",start:"mvn spring-boot:run"},errorPatterns:{setup:["\\[ERROR\\]","BUILD FAILURE","missing dependencies"],"test-failure":["\\[ERROR\\] Tests run:","BUILD FAILURE"],dependency:["missing.*dependency"],runtime:["Exception","Error","NullPointerException"],timeout:["timeout","Timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:8080}},"php-laravel":{runtime:"php",framework:"Laravel",markers:["composer.json","artisan","app/Models"],commands:{init:"composer install && php artisan migrate:fresh --seed",test:"php artisan test",build:"php artisan config:cache && php artisan route:cache && php artisan view:cache",start:"php artisan serve --host=0.0.0.0 --port=8000"},errorPatterns:{setup:["Composer.*lock","Fatal error","Class.*not found"],"test-failure":["FAILED","Tests.*failed"],dependency:["Class.*not found","require.*failed"],runtime:["Fatal error","Exception","Error"],timeout:["timeout","Timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:8e3},dependencies:["init"]},"php-symfony":{runtime:"php",framework:"Symfony",markers:["composer.json","symfony.lock","bin/console"],commands:{init:"composer install && php bin/console doctrine:database:create",test:"php bin/phpunit",build:"php bin/console cache:clear --env=prod",start:"symfony serve --no-tls"},errorPatterns:{setup:["Composer.*error","Fatal error"],"test-failure":["FAILED","failure"],dependency:["Class.*not found"],runtime:["Fatal error","Exception"],timeout:["timeout"],unknown:[]},dependencies:["init"]},"rust-actix":{runtime:"rust",framework:"Actix-web",markers:["Cargo.toml","actix"],commands:{init:"cargo fetch",test:"cargo test",build:"cargo build --release",start:"cargo run --release"},errorPatterns:{setup:["error: .*could not find","failed.*download"],"test-failure":["test result:","FAILED"],dependency:["can.t find.*crate"],runtime:["error\\[E","thread.*panicked"],timeout:["timeout"],unknown:[]},validation:{command:"cargo --version",error:"Rust/Cargo not installed"}},"rust-axum":{runtime:"rust",framework:"Axum",markers:["Cargo.toml","axum"],commands:{init:"cargo fetch",test:"cargo test",build:"cargo build --release",start:"cargo run --release"},errorPatterns:{setup:["error: .*could not find"],"test-failure":["test result:","FAILED"],dependency:["can.t find.*crate"],runtime:["error\\[E"],timeout:["timeout"],unknown:[]}},"rust-rocket":{runtime:"rust",framework:"Rocket",markers:["Cargo.toml","rocket"],commands:{init:"cargo fetch",test:"cargo test",build:"cargo build --release",start:"cargo run --release"},errorPatterns:{setup:["error: .*could not find"],"test-failure":["FAILED"],dependency:["can.t find"],runtime:["error\\[E"],timeout:["timeout"],unknown:[]}},"dotnet-aspnetcore":{runtime:"dotnet",framework:"ASP.NET Core",markers:[".csproj",".sln","Program.cs"],commands:{init:"dotnet restore",test:"dotnet test",build:"dotnet build -c Release",start:"dotnet run"},errorPatterns:{setup:["error CS","CSPROJ.*not found","NuGet.*restore"],"test-failure":["Failed:.*test","FAILED"],dependency:["error NU1101"],runtime:["error CS","Exception"],timeout:["timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:5e3}},"elixir-phoenix":{runtime:"elixir",framework:"Phoenix",markers:["mix.exs","phoenix"],commands:{init:"mix setup",test:"mix test",build:"mix compile --all-warnings",start:"mix phx.server"},errorPatterns:{setup:["\\*\\* \\(.*Error\\)","Mix.InstallError"],"test-failure":["\\d+\\sfailed","FAILED"],dependency:["dependencies are not available"],runtime:["\\*\\* \\(","RuntimeError"],timeout:["timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:4e3},dependencies:["init"]},"ruby-rails":{runtime:"ruby",framework:"Rails",markers:["Gemfile","config/application.rb","bin/rails"],commands:{init:"bundle install && rails db:prepare",test:"rails test",build:"rails assets:precompile",start:"rails server --binding=0.0.0.0 --port=3000"},errorPatterns:{setup:["Bundler::.*Error","Gem::.*Error"],"test-failure":["failures,","error,","FAILED"],dependency:["Could not find.*gem"],runtime:["Error","Exception","NoMethodError"],timeout:["timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:3e3},dependencies:["init"]},"ruby-sinatra":{runtime:"ruby",framework:"Sinatra",markers:["Gemfile","app.rb","sinatra"],commands:{init:"bundle install",test:"rspec",build:`echo "Sinatra apps don't require build"`,start:"ruby app.rb"},errorPatterns:{setup:["Bundler.*Error","Gem.*Error"],"test-failure":["failure","FAILED"],dependency:["Could not find.*gem"],runtime:["Error","NoMethodError"],timeout:["timeout"],unknown:[]}}},Je={init:{python:["pip install -e .","poetry install","pip install -r requirements.txt"],node:["npm install","pnpm install","yarn install"],go:["go mod download && go mod tidy","go get ./..."],java:["mvn dependency:go-offline","gradle dependencies"],php:["composer install"],rust:["cargo fetch"],dotnet:["dotnet restore"],elixir:["mix deps.get"],ruby:["bundle install"],"jvm-generic":["mvn dependency:go-offline","gradle dependencies"],unknown:[]},test:{python:["pytest","python -m unittest","python -m pytest"],node:["npm test","npm run test"],go:["go test ./...","make test"],java:["mvn test","gradle test"],php:["php artisan test","phpunit","pest"],rust:["cargo test"],dotnet:["dotnet test"],elixir:["mix test"],ruby:["rspec","ruby -m minitest"],"jvm-generic":["mvn test","gradle test"],unknown:[]},build:{python:["python -m build","python setup.py build"],node:["npm run build"],go:["go build -o app .","go build ./..."],java:["mvn package -DskipTests","gradle build -x test"],php:['echo "PHP build: typically no build step"'],rust:["cargo build --release"],dotnet:["dotnet build -c Release"],elixir:["mix compile"],ruby:["gem build *.gemspec"],"jvm-generic":["mvn package -DskipTests","gradle build"],unknown:[]},start:{python:["python app.py","python main.py","uvicorn main:app --reload"],node:["npm start","node index.js","node src/index.js"],go:["./app","go run main.go","go run ./..."],java:["mvn spring-boot:run","gradle bootRun","java -jar target/*.jar"],php:["php -S 0.0.0.0:8000","php artisan serve"],rust:["cargo run --release","./target/release/app"],dotnet:["dotnet run"],elixir:["mix phx.server","iex -S mix"],ruby:["rails server","ruby app.rb","bundle exec puma"],"jvm-generic":["java -jar *.jar","gradle run"],unknown:[]}};function Y(e,r){if(r){let t=r.trim().toLowerCase().replace(/[_.\s]+/g,"-"),n=e$2(r),s=`${e}-${n==="gofiber"?"fiber":n==="gogin"?"gin":n==="dotnet"?"aspnetcore":n!=="unknown"?n:t==="fiber"?"fiber":t==="aspnetcore"||t==="asp-net-core"?"aspnetcore":t}`;return Ve[s]}}function Oe(e,r,t){if(r){let n=Y(e,r);if(n&&n.commands[t])return n.commands[t]}if(["init","test","build","start"].includes(t)){let n=Je[t]?.[e]??[];return n.length>0?n[0]:void 0}}var qe={test:"test",build:"build",start:"start"};function ie(e){if(e.stage==="init")return e.runtime==="node"?Ae(e.projectPath):Oe(e.runtime,e.framework,e.stage);if(e.runtime==="node"){let r=qe[e.stage];if(r){let t=t$1(e.projectPath,r,{framework:e.framework});if(t)return Pe(e.projectPath,t.scriptName)}}return Oe(e.runtime,e.framework,e.stage)}function Ye(e){let r=h(e).map(t=>t==="python"?"python":t==="node"||t==="bun"?"node":t==="go"?"go":t==="java"?"java":t==="php"?"php":t==="rust"?"rust":t==="dotnet"?"dotnet":t==="elixir"?"elixir":t==="ruby"?"ruby":t==="clojure"||t==="scala"||t==="kotlin"?"jvm-generic":null).filter(t=>t!==null).filter((t,n,o)=>o.indexOf(t)===n);return {primary:r.length>0?r[0]:"unknown",secondary:r.slice(1)}}function We(e){return Ye(e).primary}function ue(e,r){if(!e)return "unknown";r||(r={setup:["ModuleNotFoundError","No module named","npm ERR!","error:","not found"],"test-failure":["FAILED","FAIL","failed"],dependency:["cannot find module","import.*error"],runtime:["Exception","Error:","panic","TypeError"],timeout:["timeout","Timeout","deadline exceeded"],unknown:[]});for(let[t,n]of Object.entries(r))for(let o of n)if(new RegExp(o,"i").test(e))return t;return "unknown"}async function Q(e){let r=e.split(/[&|;]\s*/)[0].trim().split(/\s+/)[0];if(["echo","cd","pwd","test","true","false","exit"].includes(r))return {valid:true};try{let n=process.platform==="win32"?"where":"which";if((await execa(n,[r],{reject:false})).exitCode===0)return {valid:true}}catch{}return {valid:false,reason:`Command '${r}' not found or not executable`}}function Me(e,r,t){if(!r)return e;let n=typeof r=="object"&&!Array.isArray(r)&&("dev"in r||"staging"in r||"prod"in r||"default"in r)&&!Object.keys(r).some(o=>["init","test","build","start"].includes(o))?r:{};return t&&typeof n[t]=="string"?n[t]:typeof n.default=="string"?n.default:e}async function De(e,r){if(!e)return {healthy:true};switch(e.type){case "port":{let t=e.value;try{let n=await import('net');return new Promise(o=>{let s=new n.Socket,u=5e3;s.setTimeout(u),s.on("connect",()=>{s.destroy(),o({healthy:true,reason:`Port ${t} is listening`});}),s.on("timeout",()=>{s.destroy(),o({healthy:false,reason:`Port ${t} timeout after ${u}ms`});}),s.on("error",c=>{s.destroy(),o({healthy:false,reason:`Port ${t} error: ${String(c)}`});}),s.connect(t,"localhost");})}catch(n){return {healthy:false,reason:`Port check error: ${n instanceof Error?n.message:String(n)}`}}}case "http":{let t=e.value,n;try{let o=new AbortController;n=setTimeout(()=>o.abort(),5e3);let s=await fetch(t,{method:"GET",signal:o.signal});return {healthy:s.status===200,reason:`HTTP ${s.status}`,metadata:{status:s.status}}}catch(o){return {healthy:false,reason:`HTTP check error: ${o instanceof Error?o.message:String(o)}`}}finally{n&&clearTimeout(n);}}case "log":{let t=e.value;if(!r)return {healthy:true};try{let n=[w.join(r,".workspai","last-run.log"),w.join(r,".rapidkit","last-run.log")].find(o=>K.existsSync(o));if(n){let o=K.readFileSync(n,"utf-8"),s=new RegExp(t,"i");return {healthy:s.test(o),reason:s.test(o)?"Log pattern found":"Log pattern not found"}}return {healthy:true,reason:"No log file to check"}}catch(n){return {healthy:false,reason:`Log check error: ${n instanceof Error?n.message:String(n)}`}}}case "command":{let t=e.value;try{let n=await execa(t,[],{cwd:r,reject:false,shell:true});return {healthy:n.exitCode===0,reason:n.exitCode===0?"Health check passed":"Health check failed",metadata:{exitCode:n.exitCode}}}catch(n){return {healthy:false,reason:`Command check error: ${n instanceof Error?n.message:String(n)}`}}}default:return {healthy:true}}}var Ie={init:"init",test:"test",build:"build",start:"start"};function Qe(e){return e in Ie?Ie[e]:null}function Xe(e,r){let n=p$1(e)?.contextJson?.commands;if(!n||typeof n!="object"||Array.isArray(n))return;let o=n[r];if(typeof o=="string"&&o.trim().length>0)return o.trim();if(o&&typeof o=="object"&&!Array.isArray(o)){let s=o,u=s.default??s.dev;if(typeof u=="string"&&u.trim().length>0)return u.trim()}}function $e(e,r,t=w$1(e)){let n=Qe(r);if(!n)return Xe(e,r)?{supported:true}:{supported:false,reason:`Workspace stage "${r}" is not part of the Workspai fleet contract.`};if(!t.projectRoot)return {supported:false,reason:"No Workspai project metadata was detected for this target."};let o=t.commandMap[n];if(!o||o.status!=="supported"){let s=t.runtimeSupportTier==="observed"||t.frameworkSupportTier==="observed";return {supported:false,reason:o?.reason??`Command "${n}" is not supported for this project runtime/framework.`,shouldFail:!s}}return {supported:true}}var Ze=new Set(["init","test","build","start"]),et=new Set([".git","node_modules",".workspai",".rapidkit",".venv","dist","build","coverage","htmlcov"]);async function L(e){try{return await K.promises.access(e,K.constants.F_OK),true}catch{return false}}async function tt(e){for(let r of e)if(await L(r))return true;return false}async function rt(e,r,t){if(r==="python"){let o=[w.join(e,".workspai","cli.py"),w.join(e,".rapidkit","cli.py")];for(let s of o)if(await L(s))return {valid:true};return {valid:false,reason:"Project-local .workspai/cli.py is missing. Run `workspai init` in this project first."}}let n=t.trim().split(/\s+/)[0];if(n&&["npm","npx","pnpm","yarn"].includes(n)){let o=e$3(n);if((await execa(o.command,[...o.prefixArgs,"--version"],{reject:false,env:g()})).exitCode===0)return {valid:true}}return Q(t)}async function le(e){let r=await K.promises.readFile(e,"utf-8");return JSON.parse(r)}function T(e){return e.replace(/\\/g,"/")}function nt(e){let r=e?.trim();return r?r.startsWith("project:")?r.slice(8).trim()||null:r:null}async function ot(e){return a(e,{skipDirs:et,includeHiddenDirs:false,descendIntoMatchedProjects:false,isProjectDir:async(r,t$1)=>await tt([...t(r,"context.json"),...t(r,"project.json")])?true:w.resolve(r)===w.resolve(t$1)?false:h(r).length>0})}async function st(e){for(let r of [w.join(".workspai","project.json"),w.join(".workspai","context.json"),w.join(".rapidkit","project.json"),w.join(".rapidkit","context.json")]){let t=w.join(e,r);if(await L(t))try{let n=await le(t),o=n.name??n.projectName??n.slug;if(typeof o=="string"&&o.trim())return o.trim()}catch{}}return null}async function at(e,r,t){let n=nt(t);if(!n)return {projects:r,normalizedScope:null};let o=T(n).toLowerCase(),s=[];for(let u of r){let c=T(w.relative(e,u)),p=w.basename(u),m=await st(u);[c,p,m].filter(a=>typeof a=="string"&&a.length>0).map(a=>T(a).toLowerCase()).includes(o)&&s.push(u);}if(s.length===0)throw new Error(`Workspace run scope did not match any project: ${t}`);return {projects:s,normalizedScope:n}}async function it(e,r,t){let n=await execa("git",["diff","--name-only",`${t}...HEAD`],{cwd:e,reject:false,env:a$1()});if(n.exitCode!==0)return new Set(r);let o=n.stdout.split(/\r?\n/).map(u=>u.trim()).filter(u=>u.length>0).map(u=>T(u));if(o.length===0)return new Set;let s=new Set;for(let u of r){let c=T(w.relative(e,u));if(!c||c===".")continue;let p=`${c}/`;o.some(m=>m===c||m.startsWith(p))&&s.add(u);}return s}async function ut(e,r,t){let n=await d$1(e,e$1.workspaceContract)??p(e,"workspace.contract.json");if(await L(n))try{let d=await ct(e,r,t,n);if(d.graphStatus!=="missing")return d}catch{return {expanded:t,graphStatus:"invalid",expansionDepth:0}}let o=await d$1(e,".workspai/workspace-dependency-graph.json")??p(e,"workspace-dependency-graph.json");if(!await L(o))return {expanded:t,graphStatus:"missing",expansionDepth:0};let s;try{s=await le(o);}catch{return {expanded:t,graphStatus:"invalid",expansionDepth:0}}let u=new Set(r.map(d=>w.resolve(d))),c=new Map;if(!s||typeof s!="object"||Array.isArray(s))return {expanded:t,graphStatus:"invalid",expansionDepth:0};let p$1=Array.isArray(s.projects)?s.projects:[];for(let d of p$1){if(!d||typeof d!="object"||Array.isArray(d))continue;let a=d,l=typeof a.path=="string"?a.path:"",y=w.resolve(e,l);if(!u.has(y))continue;let h=Array.isArray(a.dependsOn)?a.dependsOn.filter(R=>typeof R=="string"):[];for(let R of h){let g=w.resolve(e,R);u.has(g)&&(c.has(g)||c.set(g,new Set),c.get(g)?.add(y));}}let m=d$2(c,t);return {expanded:m.reached,graphStatus:"loaded",expansionDepth:m.added}}async function ct(e,r,t,n){let o=await le(n);if(!o||typeof o!="object"||Array.isArray(o))return {expanded:t,graphStatus:"invalid",expansionDepth:0};let s=o,u=Array.isArray(s.projects)?s.projects:null;if(!u)return {expanded:t,graphStatus:"invalid",expansionDepth:0};let c=new Map,p=new Map;for(let y of r){let h=T(w.relative(e,y));p.set(h,w.resolve(y));}let m=new Map,d=new Map,a=new Map;for(let y of u){if(!y||typeof y!="object"||Array.isArray(y))continue;let h=y,R=typeof h.slug=="string"?h.slug:"",g=typeof h.relativePath=="string"?T(h.relativePath):R,x=p.get(g);!R||!x||c.set(R,x);}for(let y of u){if(!y||typeof y!="object"||Array.isArray(y))continue;let h=y,R=typeof h.slug=="string"?h.slug:"",g=c.get(R);if(!g)continue;let x=h.contracts&&typeof h.contracts=="object"&&!Array.isArray(h.contracts)?h.contracts:{},S=Array.isArray(x.dependsOn)?x.dependsOn.filter(v=>typeof v=="string"):[],W=Array.isArray(x.publishes)?x.publishes.filter(v=>typeof v=="string"):[],I=Array.isArray(x.consumes)?x.consumes.filter(v=>typeof v=="string"):[];for(let v of S){let j=c.get(v);j&&(a.has(j)||a.set(j,new Set),a.get(j)?.add(g));}for(let v of W)m.has(v)||m.set(v,new Set),m.get(v)?.add(g);for(let v of I)d.has(v)||d.set(v,new Set),d.get(v)?.add(g);}for(let[y,h]of m.entries()){let R=d.get(y);if(R)for(let g of h){a.has(g)||a.set(g,new Set);for(let x of R)x!==g&&a.get(g)?.add(x);}}let l=d$2(a,t);return {expanded:l.reached,graphStatus:"loaded",expansionDepth:l.added}}async function dt(e,r){if(typeof r=="boolean")return r;let t=s(e,"policies.yml").find(s=>K.existsSync(s))??p(e,"policies.yml");if(!await L(t))return true;let n="";try{n=await K.promises.readFile(t,"utf-8");}catch{return true}let o=n.match(/^[\t ]*rules\.enforce_workspace_run_gates:\s*(true|false)\s*(?:#.*)?$/m);return o?o[1]==="true":true}function lt(e){let r=process.env.RAPIDKIT_WORKSPACE_RUN_STAGE_TIMEOUT_MS;if(r){let t=Number.parseInt(r,10);if(Number.isFinite(t)&&t>0)return t}return e==="init"?12e4:9e4}function _e(e,r){let t=Number.parseInt(process.env[e]??"",10);return Number.isFinite(t)&&t>0?t:r}function ce(e){return new Promise(r=>setTimeout(r,e))}async function pt(e){let r=process.argv[1];if(e.useRapidkitWrapper&&!r)return {exitCode:1,stdout:"",stderr:"Workspai entrypoint is unavailable for startup verification.",healthStatus:{healthy:false,reason:"Workspai entrypoint is unavailable."}};let t=e.useRapidkitWrapper&&r?execa(process.execPath,[r,"start"],{cwd:e.projectPath,reject:false,timeout:e.timeoutMs,env:{...process.env,RAPIDKIT_WORKSPACE_RUN_CHILD:"1"}}):execa(e.finalCommand,[],{cwd:e.projectPath,reject:false,shell:true,timeout:e.timeoutMs}),n=Promise.resolve(t).then(d=>({kind:"exit",result:d}),d=>({kind:"error",error:d})),o=_e("WORKSPAI_WORKSPACE_RUN_STARTUP_GRACE_MS",2e3),s=await Promise.race([n,ce(o).then(()=>({kind:"alive"}))]);if(s.kind==="error"){let d=typeof s.error=="object"&&s.error!==null&&"timedOut"in s.error&&!!s.error.timedOut;return {exitCode:d?124:1,stdout:"",stderr:s.error instanceof Error?s.error.message:String(s.error),timedOut:d,healthStatus:{healthy:false,reason:"The start command failed before readiness."}}}if(s.kind==="exit"){let d=Number(s.result.exitCode??0);return {exitCode:d,stdout:String(s.result.stdout??""),stderr:String(s.result.stderr??""),healthStatus:{healthy:d===0,reason:d===0?"The start command completed successfully.":`The start command exited with code ${d} before readiness.`}}}let u=Y(e.runtime,e.framework)?.healthCheck,c=u?{healthy:false,reason:"The configured health check has not passed yet."}:{healthy:true,reason:`The service remained alive for ${o}ms (bounded startup smoke).`};if(u){let d=_e("WORKSPAI_WORKSPACE_RUN_STARTUP_HEALTH_TIMEOUT_MS",15e3),a=Date.now()+d;for(;Date.now()<a;){let l=await De(u,e.projectPath);if(c={healthy:l.healthy,reason:l.reason},l.healthy)break;if((await Promise.race([n,ce(350).then(()=>({kind:"alive"}))])).kind!=="alive"){c={healthy:false,reason:"The service exited before its configured health check passed."};break}}}try{t.kill?.("SIGTERM",{forceKillAfterDelay:1e3});}catch{try{t.kill?.();}catch{}}let p=await Promise.race([n,ce(2e3).then(()=>({kind:"alive"}))]),m=p.kind==="exit"?p.result:void 0;return {exitCode:c.healthy?0:1,stdout:String(m?.stdout??""),stderr:String(m?.stderr??""),healthStatus:c}}async function de(e,r,t){let n=process.argv[1];if(!n)return {exitCode:1,stdout:"",stderr:"RapidKit entrypoint is unavailable for nested workspace-run execution."};try{let o=await execa(process.execPath,[n,...e],{cwd:r,reject:false,timeout:t,env:{...process.env,RAPIDKIT_WORKSPACE_RUN_CHILD:"1"}});return {exitCode:Number(o.exitCode??1),stdout:o.stdout,stderr:o.stderr}}catch(o){return {exitCode:typeof o=="object"&&o!==null&&"timedOut"in o&&!!o.timedOut?124:1,stdout:typeof o=="object"&&o!==null&&"stdout"in o?String(o.stdout??""):"",stderr:typeof o=="object"&&o!==null&&"stderr"in o?String(o.stderr??""):o instanceof Error?o.message:String(o)}}}function mt(e){return e==="node"||e==="go"||e==="java"||e==="python"||e==="dotnet"||e==="rust"||e==="php"}function ft(){return process.env.VITEST==="true"||process.env.VITEST==="1"||process.env.NODE_ENV==="test"}function gt(e,r=8){if(e.length<=r)return e.join(`
2
+ `);let t=3;return [...e.slice(0,t),...e.slice(-(r-t))].join(`
3
+ `)}function yt(e){let r=/(?:\bnot found\b|\bno such\b|\bmissing\b|\bfailed\b|\berror\b|\bexception\b|\bcannot\b|\bdenied\b|\btimeout\b|\btimed out\b|\benoent\b|\beacces\b|\beperm\b)/i;return [...e].reverse().find(t=>r.test(t))??e.at(-1)}async function ht(e){let r=process.cwd();try{process.chdir(e);let{handleInitCommand:t}=await import('./index.js');return {exitCode:await t(["init"]),stdout:"",stderr:""}}finally{process.chdir(r);}}async function kt(e){let r=a=>{let l=f(a);return l==="node"||l==="bun"?"node":l==="python"?"python":l==="go"?"go":l==="java"?"java":l==="php"?"php":l==="ruby"?"ruby":l==="rust"?"rust":l==="dotnet"?"dotnet":l==="elixir"?"elixir":l==="clojure"||l==="scala"||l==="kotlin"?"jvm-generic":We(e)},t=a=>{if(!a)return;let l=e$2(a);if(new Set(["fastapi","django","flask","nestjs","express","fastify","koa","gofiber","gogin","echo","springboot","laravel","symfony","rails","sinatra","dotnet","actix","axum","rocket","phoenix"]).has(l))return l},n=p$1(e),o=n?.detection??j(e,n?.projectJson??null),s=n?.contextJson,u=r(o.runtime),c=t(o.key),p={},m=new Set(["init","test","build","start"]);if(s?.commands&&typeof s.commands=="object")for(let[a,l]of Object.entries(s.commands))typeof l=="string"&&m.has(a)&&(p[a]=l);let d;if(s?.commandEnvironments&&typeof s.commandEnvironments=="object"){let a=s.commandEnvironments;d={dev:typeof a.dev=="string"?a.dev:void 0,staging:typeof a.staging=="string"?a.staging:void 0,prod:typeof a.prod=="string"?a.prod:void 0,default:typeof a.default=="string"?a.default:void 0};}return {runtime:u,framework:c,commandOverrides:Object.keys(p).length>0?p:void 0,environmentCommandVariants:d,environment:typeof s?.environment=="string"?s.environment:void 0}}async function bt(e,r,t,n,o,s,u){let c=!o?.[r]&&mt(t),p;if(o&&o[r]?p=o[r]:c?p=`rapidkit ${r}`:p=ie({projectPath:e,runtime:t,framework:n,stage:r}),!p)return {exitCode:127,command:`<stage not supported for ${t}>`,message:`No stage command found for runtime '${t}' and framework '${n||"unknown"}'`,errorCategory:"runtime"};let m=Me(p,s,u);if(!m)return {exitCode:127,command:p,message:"Failed to resolve stage command",errorCategory:"runtime"};let d=ie({projectPath:e,runtime:t,framework:n,stage:r});if(c){if(d){let k=c?await rt(e,t,d):await Q(d);if(!k.valid)return {exitCode:127,command:m,message:k.reason||"Command not available",errorCategory:"setup"}}}else {let k=await Q(m);if(!k.valid)return {exitCode:127,command:m,message:k.reason||"Command not available",errorCategory:"setup"}}let a=0,l="",y="",h,R,g=lt(r),x=Date.now();try{let k=r==="start"?await pt({projectPath:e,finalCommand:m,useRapidkitWrapper:c,runtime:t,framework:n,timeoutMs:g}):c?r==="init"&&ft()?await ht(e):await de([r],e,g):await execa(m,[],{cwd:e,reject:false,shell:true,timeout:g});if(a=Number(k.exitCode??0),l=k.stdout,y=k.stderr,R=r==="start"?k.healthStatus:void 0,a!==0){let M=`${l}
4
+ ${y}`,G=Date.now()-x;h=a===124||ue(M)==="timeout"||a===143&&G>=Math.floor(g*.8)?"timeout":ue(M);}}catch(k){let M=typeof k=="object"&&k!==null&&"timedOut"in k&&!!k.timedOut;return {exitCode:M?124:1,command:m,message:M?`Stage timed out after ${g}ms`:k instanceof Error?k.message:"Command execution failed",errorCategory:M?"timeout":"runtime"}}let S=`${l}
5
+ ${y}`.split(/\r?\n/).map(k=>k.trim()).filter(Boolean),W=gt(S),I=yt(S),v=Date.now()-x,j=a===124||h==="timeout"||a===143&&v>=Math.floor(g*.8),P=a===0?void 0:j?"timeout":h,O=a===0||!P?void 0:{category:P,exitCode:a,command:m,timedOut:j,timeoutMs:g,...W?{outputExcerpt:W}:{}};return {exitCode:a,command:m,errorCategory:P,healthStatus:R,failureDiagnostic:O,message:j?`Stage timed out after ${g}ms`:a!==0?I?`Stage failed with exit code ${a}: ${I}`:`Stage failed with exit code ${a}`:void 0}}function Le(e){try{return JSON.parse(e)}catch{return null}}function wt(e){switch(e){case "dotnet":return "Install .NET 8+ SDK, then rerun `npx workspai setup dotnet` or `npx workspai init`.";case "go":return "Install Go 1.21+, then rerun `npx workspai setup go` or `npx workspai init`.";case "java":case "jvm-generic":return "Install Java 21+ and Maven/Gradle, then rerun `npx workspai setup java` or `npx workspai init`.";case "node":return "Install Node.js LTS and npm/pnpm/yarn, then rerun `npx workspai setup node` or `npx workspai init`.";case "python":return "Install Python 3.10+ and pip/Poetry, then rerun `npx workspai setup python` or `npx workspai init`.";default:return null}}async function xt(e){let r=[],t=await de(["doctor","workspace","--json"],e);if(t.exitCode!==0)r.push({gate:"doctor-workspace",status:"fail",summary:"doctor workspace command failed"});else {let s=Le(t.stdout)?.healthScore,u=Number(s?.errors??0);Number.isFinite(u)&&u>0?r.push({gate:"doctor-workspace",status:"fail",summary:`doctor workspace reports ${u} error(s)`}):r.push({gate:"doctor-workspace",status:"pass",summary:"doctor workspace passed"});}let n=await de(["readiness","--json"],e);if(n.exitCode!==0)r.push({gate:"readiness",status:"fail",summary:"readiness command failed"});else {let o=Le(n.stdout),s=String(o?.overallStatus??"").toLowerCase();s==="fail"?r.push({gate:"readiness",status:"fail",summary:"readiness overall status is fail"}):s==="warn"?r.push({gate:"readiness",status:"warn",summary:"readiness overall status is warn"}):r.push({gate:"readiness",status:"pass",summary:"readiness overall status is pass"});}return r}var vt=new Set(["dev","stop"]);function Rt(e){let r=e.trim();return !r||vt.has(r.toLowerCase())?false:Ze.has(r)?true:/^[a-z][a-z0-9_-]*$/i.test(r)}function Ge(e,r,t){let n=T(w.relative(t,r));return (Array.isArray(e.projects)?e.projects:[]).some(s=>{if(!s||typeof s!="object")return false;let u=s,c=[u.relativePath,u.path].filter(p=>typeof p=="string"&&p.length>0).map(p=>T(p));return u.status==="passed"&&(c.includes(n)||c.some(p=>p.endsWith(`/${n}`)))})}function St(e,r){return Y(e,r)?.dependencies??[]}function jt(e,r){let t=Math.max(1,Math.min(4,r)),n=Number(e??t);return Number.isFinite(n)?Math.max(1,Math.min(16,Math.trunc(n))):t}async function ar(e$1){if(!Rt(e$1.stage))throw new Error(`Unsupported workspace run stage: ${e$1.stage}`);let r=Date.now(),t=w.resolve(e$1.workspacePath),n=await d(t),o=await ot(t),{projects:s,normalizedScope:u}=await at(t,o,e$1.scope),c=e$1.affected===true,p=e$1.blastRadius===true,m=e$1.since?.trim()||"HEAD~1",d$1=c?await it(t,s,m):new Set(s),a,l="not-applicable",y=0,h="all";if(c&&p){let f=await ut(t,o,d$1);a=f.expanded,l=f.graphStatus,y=f.expansionDepth,h="affected+blast-radius";}else c?(a=d$1,h="affected"):(a=d$1,h="all");let R=e$1.stage==="init"?false:await dt(t,e$1.enforceGates),g=R?await xt(t):[{gate:"doctor-workspace",status:"skipped",summary:"workspace run gates disabled"},{gate:"readiness",status:"skipped",summary:"workspace run gates disabled"}],x=g.find(f=>f.status==="fail"),S=s.filter(f=>a.has(f)),W=e$1.continueOnError===true||e$1.stage==="init",I=e$1.parallel===true,v=jt(e$1.maxWorkers,S.length),j=S.length,P=0;e$1.json||console.log(E.gray(`Workspace run (${e$1.stage}) started: ${j} target(s), ${I?`parallel x${v}`:"sequential"}`));let O=new Map;for(let f of o){let b=T(w.relative(t,f)),i=s.includes(f),A=i&&a.has(f);O.set(f,{path:f,relativePath:b,projectName:w.basename(b)||w.basename(f),selected:A,affected:A,status:"skipped",exitCode:null,durationMs:0,reason:A?void 0:i?"not affected":"outside scope",framework:void 0,runtimeDetected:void 0,executionCommand:void 0});}if(x)for(let f of S){let b=O.get(f);b&&(b.status="skipped",b.reason=`blocked by ${x.gate}`);}else {let f=async b=>{let i=O.get(b);if(!i)return;let A=T(w.relative(t,b));e$1.json||console.log(E.gray(`\u23F3 [${P}/${j}] ${e$1.stage} ${A}`)),i.selected=true,i.affected=true;let F=Date.now(),{runtime:C,framework:N,commandOverrides:Ue,environmentCommandVariants:He,environment:ze}=await kt(b);i.runtimeDetected=C,i.framework=N;let Z=$e(b,e$1.stage);if(!Z.supported){i.status=Z.shouldFail===false?"skipped":"failed",i.reason=Z.reason??`stage "${e$1.stage}" unsupported for project`,i.durationMs=Date.now()-F,i.exitCode=i.status==="failed"?127:null,i.status==="failed"&&(i.errorCategory="setup",i.errorMessage=i.reason),P+=1;return}if(e$1.reusePassed&&n){let D=n.stages[e$1.stage]??n.stages[e$1.stage];if(D&&Ge(D,b,t)){i.status="passed",i.reason="reused passed result from workspace-run-last.json",i.durationMs=Date.now()-F,i.exitCode=0,P+=1,e$1.json||console.log(E.gray(`\u21BA reused passed cache for ${A}`));return}}let fe=St(C,N).filter(D=>D!==e$1.stage);if(fe.length>0&&n){let D=fe.find(ee=>{let B=n.stages[ee];return !B||!Ge(B,b,t)});if(D){i.status="skipped",i.reason=`dependency stage "${D}" not satisfied in workspace-run-last.json`,i.durationMs=Date.now()-F,i.exitCode=null,P+=1;return}}let $=await bt(b,e$1.stage,C,N,Ue,He,ze);if(i.executionCommand=$.command,i.errorCategory=$.errorCategory,i.healthStatus=$.healthStatus,i.failureDiagnostic=$.failureDiagnostic,i.durationMs=Date.now()-F,i.exitCode=$.exitCode,$.exitCode===0?(i.status="passed",i.reason=void 0):(i.status="failed",i.reason=$.message||"stage command failed",i.errorMessage=$.message),P+=1,!e$1.json){let D=j>0?Math.round(P/j*100):100,ee=i.status==="passed"?E.green("\u2705"):E.red("\u274C");if(console.log(E.gray(`${ee} [${P}/${j}] (${D}%) ${A} ${i.durationMs}ms`)),i.status==="failed"){i.reason&&console.log(E.red(` Reason: ${i.reason}`)),i.executionCommand&&console.log(E.gray(` Command: ${i.executionCommand}`));let B=wt(i.runtimeDetected);B&&i.errorCategory==="setup"&&console.log(E.gray(` Hint: ${B}`));}}};if(I&&S.length>1){let b=0,i=false,A=new Array(v).fill(null).map(async()=>{for(;b<S.length;){if(i&&!W)return;let F=b;b+=1;let C=S[F];await f(C),O.get(C)?.status==="failed"&&(i=true);}});if(await Promise.all(A),!W&&i){let F=false;for(let C of S){let N=O.get(C);if(N){if(N.status==="failed"){F=true;continue}F&&N.status==="skipped"&&(N.reason=N.reason||"stopped after failure");}}}}else for(let b of S){await f(b);let i=O.get(b);if(!W&&i?.status==="failed"){let A=S.slice(S.indexOf(b)+1);for(let F of A){let C=O.get(F);C&&(C.status="skipped",C.reason="stopped after failure");}break}}}let k=[];for(let f of o){let b=O.get(f);b&&k.push(b);}let M=k.filter(f=>f.status==="passed").length,G=k.filter(f=>f.status==="failed").length,X=k.filter(f=>f.status==="skipped").length,pe=e$1.strict===true,Be=G>0||pe&&g.some(f=>f.status==="fail"||f.status==="warn")?1:0,me={schemaVersion:"1.0",workspacePath:t,stage:e$1.stage,generatedAt:new Date().toISOString(),durationMs:Date.now()-r,options:{affected:c,blastRadius:p,since:c?m:null,parallel:I,maxWorkers:v,continueOnError:W,strict:pe,enforceGates:R,scope:u,reusePassed:e$1.reusePassed===true},selection:{mode:h,since:c?m:null,scope:u,graphStatus:l,expansionDepth:y},gates:{enforced:R,results:g,blocked:!!x,blockingGate:x?.gate},summary:{projectCount:o.length,selectedCount:S.length,passed:M,failed:G,skipped:X,exitCode:Be},projects:k,enterpriseControls:{jsonReady:true,evidencePath:b}},Ke=w.join(t,b);return await e(t,me),e$1.json||(x&&(console.log(E.red(`\u274C Workspace run blocked by ${x.gate}`)),console.log(E.gray(` ${x.summary}`))),console.log(E.cyan(`Workspace run (${e$1.stage}) => passed: ${M}, failed: ${G}, skipped: ${X}`)),console.log(E.gray(`Report: ${Ke}`))),me}export{ar as a};
@@ -0,0 +1 @@
1
+ import {c,e as e$1}from'./chunk-WIO6L24E.js';import {e,d as d$1}from'./chunk-44VJHNZB.js';import {s}from'./chunk-MOSXTVPU.js';import u from'fs';import A from'path';var a=d$1.workspaceRunLast.schemaVersion,W="workspace-run-last.json",o=e.workspaceRunLast;var P=new Set(["init","test","build","start"]);function _(e){return P.has(e)}async function d(e){try{return await u.promises.access(e,u.constants.F_OK),true}catch{return false}}async function w(e){try{let r=await u.promises.readFile(e,"utf-8");return JSON.parse(r)}catch{return null}}function m(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function h(e){let r=e.stage;return typeof r!="string"||r.trim().length===0||!Array.isArray(e.projects)?false:_(r)||/^[a-z][a-z0-9_-]*$/i.test(r)}function T(e){let r=m(e);return !r||r.schemaVersion===a?false:h(r)}function C(e){let r=m(e);return r?r.schemaVersion===a&&r.stages!=null:false}function p(e){if(C(e))return e;if(T(e)){let r=e.stage;return {schemaVersion:a,generatedAt:e.generatedAt,workspacePath:e.workspacePath,latestStage:r,stages:{[r]:e},enterpriseControls:e.enterpriseControls??{jsonReady:true,evidencePath:o}}}return null}function U(e,r){let n=p(e);if(!n)return null;let t=r??n.latestStage;return n.stages[t]??null}async function V(e){let r=(await Promise.all(s(A.resolve(e),"reports",W).map(async t=>await d(t)?t:null))).find(t=>typeof t=="string");if(!r)return null;let n=await w(r);return p(n)}async function j(e,r){let n=A.resolve(e);return c(n,o,async()=>{let t=(await Promise.all(s(n,"reports",W).map(async s=>await d(s)?s:null))).find(s=>typeof s=="string"),R=t?await w(t):null,i=p(R);if(t&&!i)throw new Error(`Workspace run evidence is unreadable or invalid; refusing to overwrite: ${t}`);let l=i?{...i.stages}:{};l[r.stage]=r;let g={schemaVersion:a,generatedAt:r.generatedAt,workspacePath:r.workspacePath,latestStage:r.stage,stages:l,enterpriseControls:{jsonReady:true,evidencePath:o}};return await e$1(n,o,g),g})}export{W as a,o as b,U as c,V as d,j as e};
@@ -0,0 +1,2 @@
1
+ import {b as b$1}from'./chunk-BYVTHIC3.js';import {v,w}from'./chunk-MOSXTVPU.js';import l from'path';import {randomUUID}from'crypto';import {open}from'fs/promises';import c from'fs-extra';function k(t,e){let n=l.resolve(t),r=e.trim();if(!r||l.isAbsolute(r))throw new Error(`Workspace artifact path must be non-empty and relative: ${e}`);let a=l.resolve(n,r),o=l.relative(n,a);if(o===".."||o.startsWith(`..${l.sep}`)||l.isAbsolute(o))throw new Error(`Workspace artifact path escapes workspace root: ${e}`);return a}function u(t,e){return k(t,v(e))}function N(t,e){return k(t,w(e))}async function S(t,e){let n=l.resolve(t);await c.ensureDir(n);let r=l.dirname(e);await c.ensureDir(r);let[a,o]=await Promise.all([c.realpath(n),c.realpath(r)]),i=l.relative(a,o);if(i===".."||i.startsWith(`..${l.sep}`)||l.isAbsolute(i))throw new Error(`Workspace artifact parent resolves outside workspace root: ${r}`)}async function _(t,e){let n=l.resolve(t),[r,a]=await Promise.all([c.realpath(n),c.realpath(e)]),o=l.relative(r,a);if(o===".."||o.startsWith(`..${l.sep}`)||l.isAbsolute(o))throw new Error(`Workspace artifact resolves outside workspace root: ${e}`)}function F(t){let e=t?.code;return process.platform==="win32"&&(e==="EPERM"||e==="EINVAL"||e==="ENOSYS")}function b(t,e=process.platform){if(e!=="win32")return false;let n=t?.code;return n==="EPERM"||n==="EACCES"||n==="EBUSY"}async function p(t){let e=process.platform==="win32"?6:1,n;for(let r=0;r<e;r+=1)try{await c.remove(t);return}catch(a){if(n=a,!b(a)||r===e-1)throw a;await new Promise(o=>setTimeout(o,10*2**r));}throw n}var m=new Map;async function J(t,e){let n=m.get(t)??Promise.resolve(),r,a=new Promise(i=>{r=i;}),o=n.catch(()=>{}).then(()=>a);m.set(t,o),await n.catch(()=>{});try{return await e()}finally{r(),m.get(t)===o&&m.delete(t);}}async function I(t){try{await t.sync();}catch(e){if(!F(e))throw e}}async function h(t,e,n){await S(t,e);let r=l.dirname(e),a=`${l.basename(e)}.`,o=Date.now();for(let s of await c.readdir(r)){if(!s.startsWith(a)||!s.endsWith(".tmp"))continue;let w=l.join(r,s),f=await c.stat(w).catch(()=>null);f&&o-f.mtimeMs>3e4&&await c.remove(w).catch(()=>{});}let i=`${e}.${process.pid}.${randomUUID()}.tmp`;try{await n(i);let s=await open(i,"r");try{await I(s);}finally{await s.close();}let w=Number(process.env.WORKSPAI_TEST_ATOMIC_WRITE_DELAY_MS??0);Number.isFinite(w)&&w>0&&await new Promise(f=>setTimeout(f,Math.min(w,3e4)));try{await c.rename(i,e);}catch(f){let d=f.code;if(d!=="EEXIST"&&d!=="EPERM")throw f;await c.move(i,e,{overwrite:true});}}finally{await c.remove(i).catch(()=>{});}}async function D(t,e,n,r={}){let a=u(t,e);await S(t,a);let o=`${a}.lock`;return J(o,()=>L(o,e,n,r))}async function L(t,e,n,r){let a=r.timeoutMs??1e4,o=r.staleAfterMs??3e4,i=Date.now(),s;for(;!s;)try{s=await open(t,"wx"),await s.writeFile(`${JSON.stringify({pid:process.pid,createdAt:new Date().toISOString()})}
2
+ `),await I(s);}catch(w){if(!(w.code==="EEXIST"||b(w)))throw s&&(await s.close().catch(()=>{}),s=void 0,await p(t).catch(()=>{})),w;s&&(await s.close().catch(()=>{}),s=void 0,await p(t).catch(()=>{}));let[P,M]=await Promise.all([c.stat(t).catch(()=>null),c.readJson(t).catch(()=>null)]),g=Number(M?.pid),E=Number.isInteger(g)&&g>0,A=false;if(E)try{process.kill(g,0),A=true;}catch(y){A=y.code==="EPERM";}let R=!E&&!!(P&&Date.now()-P.mtimeMs>o);if(E&&!A||R){await p(t).catch(()=>{});continue}if(Date.now()-i>=a)throw new Error(`Timed out waiting for workspace artifact lock: ${e}`);await new Promise(y=>setTimeout(y,20));}try{return await n()}finally{await s.close().catch(()=>{}),await p(t);}}async function K(t,e){let n=[u(t,e),N(t,e)];for(let r of n)if(await c.pathExists(r))return await _(t,r),r;return null}async function X(t,e,n){b$1(e,n);let r=u(t,e);return await h(t,r,a=>c.writeJson(a,n,{spaces:2})),r}async function V(t,e,n){if(n.length===0)return [];let r=n.map(o=>({...o,path:u(t,o.relativePath)})),a=r.find((o,i)=>r.findIndex(s=>s.path===o.path)!==i);if(a)throw new Error(`Duplicate workspace artifact transaction target: ${a.relativePath}`);for(let o of r)b$1(o.relativePath,o.payload);return D(t,e,async()=>{let o=await Promise.all(r.map(async i=>({path:i.path,exists:await c.pathExists(i.path),contents:await c.readFile(i.path).catch(()=>null)})));try{for(let i=0;i<r.length;i+=1){let s=r[i];await h(t,s.path,f=>c.writeJson(f,s.payload,{spaces:2}));let w=Number(process.env.WORKSPAI_TEST_FAIL_ARTIFACT_SET_AFTER??0);if(Number.isInteger(w)&&w===i+1)throw new Error(`Injected artifact-set failure after ${w} write(s).`)}return r.map(i=>i.path)}catch(i){let w=(await Promise.allSettled(o.map(async f=>{if(!f.exists||f.contents===null){await c.remove(f.path);return}await h(t,f.path,d=>c.writeFile(d,f.contents));}))).filter(f=>f.status==="rejected");throw w.length>0?new AggregateError([i,...w.map(f=>f.reason)],"Workspace artifact transaction failed and rollback was incomplete."):i}})}async function q(t,e,n){let r=u(t,e);return await h(t,r,a=>c.writeFile(a,n,"utf-8")),r}export{u as a,N as b,D as c,K as d,X as e,V as f,q as g};
@@ -1,4 +1,4 @@
1
- import {a as a$1}from'./chunk-JEI6BTZI.js';import {a}from'./chunk-6PBSAAS5.js';import {c,e,d}from'./chunk-3D3PFPP5.js';import {d as d$1,b}from'./chunk-XHRHNVCZ.js';import {g}from'./chunk-PTTZPDLX.js';import {p as p$1,l}from'./chunk-FUPHQOJB.js';import {p as p$2,d as d$2}from'./chunk-B4CPDK6J.js';import {e as e$1}from'./chunk-MBRU3VWJ.js';import {b as b$1}from'./chunk-ULR66OJR.js';import {a as a$2}from'./chunk-AFIFZTOY.js';import j from'path';import P from'fs-extra';function J(e$1){switch(e$1){case "why":return d;case "trace":return e;default:return c}}async function E(e,o,n){try{if(!await P.pathExists(e))return null;let r=await P.readJson(e);return o?b$1(o,r,e):n&&a$2(r,n,e),r}catch(r){if((o||n)&&await P.pathExists(e))throw r;return null}}function G(e,o){if(!e)return null;let n=o.trim().toLowerCase();return e.projects.find(r=>r.slug.toLowerCase()===n||r.relativePath.toLowerCase()===n)??null}function X(e,o,n){let r=n.trim().toLowerCase(),t=(l(e)?.nodes.map(a=>a.id)??e.projects.map(a=>a.name)).find(a=>a.toLowerCase()===r);if(t)return t;let d=e.projects.find(a=>[a.name,a.path,j.basename(a.path)].filter(u=>u.trim().length>0).some(u=>u.toLowerCase()===r));if(d)return d.name;let c=G(o,n);if(c){let a=e.projects.find(u=>u.path===c.relativePath||u.path.endsWith(`/${c.relativePath}`));if(a)return a.name}return n}function Y(e,o){if(!e)return [];let n=o.trim().toLowerCase(),r=new Set;for(let l of e.projects){l.contracts.dependsOn?.some(t=>t.toLowerCase()===n)&&r.add(l.slug);for(let t of l.contracts.consumes??[])for(let d of e.projects)d.contracts.publishes?.includes(t)&&d.slug===n&&r.add(l.slug);}return [...r].sort()}function q(e,o){if(!e)return [];let n=o.trim().toLowerCase();return e.steps.filter(r=>r.scope==="project"&&r.project?.toLowerCase()===n&&r.command?.display).map(r=>r.command.display).slice(0,8)}function p(e,o,n){return {id:e,title:o,body:n.trim()}}async function fe(e){let o=j.resolve(e.workspacePath),n=(e.now??new Date).toISOString(),r=e.model??await p$1({workspacePath:o,includeEvidence:true}),l$1=e.contract;if(l$1===void 0)try{l$1=(await p$2({workspacePath:o})).contract;}catch{l$1=null;}let t=e.verify;t===void 0&&(t=await E(j.join(o,d$1),d$1));let d=e.impact;if(d===void 0&&(d=await E(j.join(o,g),g)),e.target.kind==="release-blocked"){let s=t?.blockingReasons??[],i=(r.summary?.projectCount??r.projects.length)===0,g=[p("verdict",i?"Workspace scaffold posture":"Release verdict",t?i?`Scaffold posture: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Freshness: **${t.freshness.verdict}**. No registered projects yet \u2014 release gates apply after the first project is added.`:`Verdict: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Risk: **${t.impact.risk}**. Freshness: **${t.freshness.verdict}**.`:"No workspace verify report found. Run `npx workspai workspace verify --json --write` first."),p("blockers",i?"Pre-project signals":"Blocking reasons",s.length?s.map(h=>`- ${h}`).join(`
1
+ import {a as a$1}from'./chunk-JEI6BTZI.js';import {a}from'./chunk-EBKYSDCX.js';import {c,e,d}from'./chunk-AMB42V2F.js';import {d as d$1,b}from'./chunk-XVRJVKOX.js';import {g}from'./chunk-S7Z4DP3P.js';import {p as p$1,l}from'./chunk-7AR5PDLD.js';import {p as p$2,d as d$2}from'./chunk-MQ73VS4E.js';import {e as e$1}from'./chunk-WIO6L24E.js';import {b as b$1}from'./chunk-BYVTHIC3.js';import {a as a$2}from'./chunk-AFIFZTOY.js';import j from'path';import P from'fs-extra';function J(e$1){switch(e$1){case "why":return d;case "trace":return e;default:return c}}async function E(e,o,n){try{if(!await P.pathExists(e))return null;let r=await P.readJson(e);return o?b$1(o,r,e):n&&a$2(r,n,e),r}catch(r){if((o||n)&&await P.pathExists(e))throw r;return null}}function G(e,o){if(!e)return null;let n=o.trim().toLowerCase();return e.projects.find(r=>r.slug.toLowerCase()===n||r.relativePath.toLowerCase()===n)??null}function X(e,o,n){let r=n.trim().toLowerCase(),t=(l(e)?.nodes.map(a=>a.id)??e.projects.map(a=>a.name)).find(a=>a.toLowerCase()===r);if(t)return t;let d=e.projects.find(a=>[a.name,a.path,j.basename(a.path)].filter(u=>u.trim().length>0).some(u=>u.toLowerCase()===r));if(d)return d.name;let c=G(o,n);if(c){let a=e.projects.find(u=>u.path===c.relativePath||u.path.endsWith(`/${c.relativePath}`));if(a)return a.name}return n}function Y(e,o){if(!e)return [];let n=o.trim().toLowerCase(),r=new Set;for(let l of e.projects){l.contracts.dependsOn?.some(t=>t.toLowerCase()===n)&&r.add(l.slug);for(let t of l.contracts.consumes??[])for(let d of e.projects)d.contracts.publishes?.includes(t)&&d.slug===n&&r.add(l.slug);}return [...r].sort()}function q(e,o){if(!e)return [];let n=o.trim().toLowerCase();return e.steps.filter(r=>r.scope==="project"&&r.project?.toLowerCase()===n&&r.command?.display).map(r=>r.command.display).slice(0,8)}function p(e,o,n){return {id:e,title:o,body:n.trim()}}async function fe(e){let o=j.resolve(e.workspacePath),n=(e.now??new Date).toISOString(),r=e.model??await p$1({workspacePath:o,includeEvidence:true}),l$1=e.contract;if(l$1===void 0)try{l$1=(await p$2({workspacePath:o})).contract;}catch{l$1=null;}let t=e.verify;t===void 0&&(t=await E(j.join(o,d$1),d$1));let d=e.impact;if(d===void 0&&(d=await E(j.join(o,g),g)),e.target.kind==="release-blocked"){let s=t?.blockingReasons??[],i=(r.summary?.projectCount??r.projects.length)===0,g=[p("verdict",i?"Workspace scaffold posture":"Release verdict",t?i?`Scaffold posture: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Freshness: **${t.freshness.verdict}**. No registered projects yet \u2014 release gates apply after the first project is added.`:`Verdict: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Risk: **${t.impact.risk}**. Freshness: **${t.freshness.verdict}**.`:"No workspace verify report found. Run `npx workspai workspace verify --json --write` first."),p("blockers",i?"Pre-project signals":"Blocking reasons",s.length?s.map(h=>`- ${h}`).join(`
2
2
  `):i?"No pre-project signals in the latest verify report.":"No blocking reasons in the latest verify report.")];return t?.resolutionHints?.length&&g.push(p("resolution","Resolution hints",t.resolutionHints.map(h=>`- **${h.blockerId}** (${h.resolutionClass}): ${h.commandRetryHint??h.fixHints[0]?.detail??"See fix hints"}`).join(`
3
3
  `))),{schemaVersion:a,generatedAt:n,workspacePath:o,target:e.target,summary:t?i?b(s.length,t.summary.verdict):`${s.length>0||t.summary.verdict==="blocked"?"Release blocked":"Release posture"}: ${t.summary.verdict} with ${s.length} blocking reason(s).`:"Release posture unknown \u2014 verify report missing.",sections:g,releaseRisk:t?.impact.risk,blockingReasons:s,resolutionHints:t?.resolutionHints}}if(e.target.kind==="blocker"){let s=e.target,m=t?.resolutionHints?.find(g=>g.blockerId===s.blockerId),i=t?.blockingReasons.find(g=>g.includes(s.blockerId))??t?.blockingReasons[0];return {schemaVersion:a,generatedAt:n,workspacePath:o,target:s,summary:m?`Blocker ${s.blockerId}: ${m.resolutionClass}`:`Blocker ${s.blockerId} (no structured hint)`,sections:[p("reason","Blocking signal",i??"No matching blocking reason in verify."),p("hint","Resolution class",m?`${m.resolutionClass}
4
4
 
@@ -0,0 +1 @@
1
+ import {b as b$2,c,d as d$1}from'./chunk-FZCYTRBQ.js';import {c as c$1}from'./chunk-WD2XDMGB.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-S7Z4DP3P.js';import {p,l,f as f$1}from'./chunk-7AR5PDLD.js';import {d}from'./chunk-EWZZUQBR.js';import {d as d$3}from'./chunk-MQ73VS4E.js';import {d as d$2,e}from'./chunk-WIO6L24E.js';import {a as a$3}from'./chunk-AFIFZTOY.js';import {b as b$1,a,e as e$1,c as c$2,d as d$5}from'./chunk-44VJHNZB.js';import m from'path';import v from'fs-extra';var de="rapidkit-blocker-resolution-v1";function le(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 he(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 ve(e){let t=he(e.reason),r=le({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:de,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 ue(e){return Array.from(new Set(e.blockingReasons.map(r=>r.trim()).filter(Boolean))).slice(0,12).map((r,s)=>ve({reason:r,blockerId:`blocker-${s+1}`,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}))}function be(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 we(e){return e.length===0||e.every(t=>be(t))}function fe(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&we(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function Qe(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 me=b$1.verify,G=a.verify;function Re(e,t){return m.isAbsolute(t)?t:m.join(e,t)}async function pe(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 Ce(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 Ae(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 Ee(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 Se(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 We(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 je(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 xe(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 Pe(e){let t=e.schemaVersion===d$5.doctorFixResult.schemaVersion?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 Ie(e,t){let r=await d$2(e,e$1.doctorRemediationPlan);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 Ve(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function Fe(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 $e(e,t,r){let s=Ve(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 Oe(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 _e(e,t,r,s){let i=Ee(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=Oe(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=Se(d);}else if(e.id==="workspace.readiness"){let n=C(d.generatedAt,s,"Release readiness evidence");n?c={status:"fail",message:n}:c=We(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=je(d);}else if(e.id==="workspace.analyze"){let n=C(d.generatedAt,s,"Analyze evidence");n?c={status:"fail",message:n}:c=xe(d);}else if(e.id==="workspace.pipeline"){let n=C(d.generatedAt,s,"Pipeline evidence");n?c={status:"fail",message:n}:c=Fe(d);}else if(e.id==="workspace.doctor-fix"){let n=d.schemaVersion===d$5.doctorFixResult.schemaVersion?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 Ie(t,f)?c={status:"skipped",message:"No current doctor remediation steps are pending."}:c=Pe(d);}else if(e.id.startsWith("project."))c=$e(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 Be(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 Ne(e,t){let r=W(e.affectedProjects.map(a=>a.project?.name).filter(a=>typeof a=="string")),s=new Set(r.map(a=>a.toLowerCase())),i=W(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 j=y.filter(p=>p.status==="fail"),w=j.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(j.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:W(k),uncovered:W(u),unverifiable:W(d)},blockingReasons:g,needsAttention:c}}function W(e){return [...new Set(e)].sort((t,r)=>t.localeCompare(r))}async function De(e){let t=m.resolve(e.workspacePath);if(e.fromImpactPath){let o=Re(t,e.fromImpactPath);return {impact:await pe(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 pe(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 He(e,t){if(t)return e.generatedAt}async function gt(e){let t=m.resolve(e.workspacePath),{impact:r,fromImpactRef:s,impactFromDisk:i}=await De(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}),B=[r.affectedProjects,r.transitiveImpact,r.verificationPlan],N=[l.affectedProjects,l.transitiveImpact,l.verificationPlan];JSON.stringify(B)!==JSON.stringify(N)&&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}),B=r.diff.changes.filter(h=>h.type.startsWith("git.")).map(h=>`${h.type}:${h.target.replace(/^git:/,"")}`).sort(),N=[...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(N)!==JSON.stringify(B))&&u.push("workspace.impact: Impact evidence is stale because Git changes no longer match the diff observation. Regenerate diff and impact.");}let g=He(r,i),c$1=Ce([...o(),...r.verificationPlan]).filter(l=>Ae(e.scope,l)),n=[];for(let l of c$1)n.push(await _e(l,t,o$1.contracts.exists===true,g));let a=Ne(r,n),f=a$2(l(o$1)??{nodes:[],edges:[]}),y=b$2(o$1),j=await Le(t),w=c(y,j?.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 Me(o$1,t),_=Te(P,p$2),E=Be(n,{blockingReasons:[...a.blockingReasons,...A,..._.blockingReasons,...u],needsAttention:a.needsAttention||_.needsAttention}),ge=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,..._.blockingReasons,...u],ke=p$2.filter(l=>l.severity==="error").length,ye=o$1.summary?.projectCount??o$1.projects.length,U=fe({projectCount:ye,verdict:E.verdict,exitCode:E.exitCode,blockingReasons:I,policyErrorCount:ke});E.verdict=U.verdict,E.exitCode=U.exitCode;let Y=I.length>0?ue({blockingReasons:I,verifyCommand:"npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json",verifyArtifact:G}):[];return {schemaVersion:me,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:E,steps:n,missingEvidence:ge,blockingReasons:I,...Y.length>0?{resolutionHints:Y}:{},verificationPlan:c$1,affectedSubgraph:a.subgraph,graphIntegrity:f,freshness:x,policyMode:P,policyViolations:p$2}}async function Me(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 Te(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 Le(e){let t=m.join(e,G);try{if(!await v.pathExists(t))return null;let r=await v.readJson(t);return r&&r.schemaVersion===me?r:null}catch{return null}}async function kt(e$1,t){return e(t,G,d$3(e$1))}function qe(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 yt(e,t){return qe(e,t).exitCode}export{de as a,Qe as b,me as c,G as d,Ne as e,gt as f,kt as g,qe as h,yt as i};
@@ -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-IO54DFWR.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-OLX6LX77.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-23JDMHSD.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-T6JI7GYZ.js';
package/dist/index.d.ts CHANGED
@@ -49,13 +49,13 @@ declare function getPublishedContractVersions(): {
49
49
  ingestionPlan: "workspai.ingestion-plan.v1";
50
50
  ingestionResult: "workspai.ingestion-result.v1";
51
51
  projectEntryCapability: string;
52
- projectWorkspaceLink: string;
52
+ projectWorkspaceLink: "project-workspace-link.v1";
53
53
  projectWorkspaceResolution: "project-workspace-resolution.v1";
54
- projectContextAgent: string;
55
- doctorProjectEvidence: string;
54
+ projectContextAgent: "project-context-agent.v1";
55
+ doctorProjectEvidence: "doctor-project-evidence-v1";
56
56
  doctorWorkspaceEvidence: "doctor-workspace-evidence-v1";
57
57
  doctorGraphDiagnosis: "doctor-graph-diagnosis.v1";
58
- projectTestCoverage: string;
58
+ projectTestCoverage: "workspai.project-test-coverage.v1";
59
59
  verifiedGoal: string;
60
60
  verifiedGoalStatus: "workspai.verified-goal-status.v1";
61
61
  workspaceIntelligenceArchitecture: string;
@@ -82,6 +82,7 @@ declare function getPublishedContractVersions(): {
82
82
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
83
83
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
84
84
  readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
85
+ readonly repairTransaction: "workspai.workspace-repair-transaction.v1";
85
86
  };
86
87
  cliLogEvent: "cli-log-event-v1";
87
88
  freshnessMetadata: "rapidkit-freshness-metadata-v1";
@@ -111,15 +112,36 @@ declare function getPublishedContractVersions(): {
111
112
  doctorRemediationPlan: "doctor-remediation-plan-v2";
112
113
  doctorDependencyRepairTransaction: string;
113
114
  artifactRemediationPlan: "artifact-remediation-plan-v1";
115
+ studioCardRepairCapabilities: "workspai.studio-card-repair-capabilities.v1";
116
+ workspaceRepairProposal: "workspai.workspace-repair-proposal.v1";
117
+ workspaceRepairCapabilities: "workspai.workspace-repair-capabilities.v1";
118
+ workspaceRepairTransaction: "workspai.workspace-repair-transaction.v1";
114
119
  doctorFixResult: "rapidkit-doctor-fix-result-v1";
120
+ backendImportStackParitySnapshot: string;
121
+ bootstrapCompliance: "bootstrap-compliance.v1";
122
+ commandCapabilities: string;
123
+ createPlannerCapabilities: string;
124
+ doctorRemediationPlanLegacy: "doctor-remediation-plan-v2";
125
+ extensionCliCompatibility: string;
126
+ infraStack: string;
127
+ mirrorOps: "mirror-ops.v1";
128
+ moduleLayout: string;
129
+ moduleSupport: string;
130
+ pipelineLastRun: "rapidkit-pipeline-v1";
131
+ transparencyEvidence: "transparency-evidence.v1";
132
+ version: string;
133
+ studioBlockerHandoff: string;
134
+ workspaceRegistry: "workspace-registry.v1";
135
+ workspaceRunLast: "workspace-run-v1";
136
+ workspaceShareBundle: "1.1";
115
137
  };
116
138
  declare function getPublishedContractCatalog(): {
117
139
  [k: string]: {
118
140
  artifacts?: {
119
141
  [k: string]: {
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;
142
+ path: ".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" | "AGENTS.md" | ".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" | ".workspai/reports/workspace-repair-last-run.json";
143
+ 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" | "workspai.workspace-repair-transaction.v1" | null;
144
+ 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" | "contracts/workspace-intelligence/workspace-repair-transaction.v1.json" | null;
123
145
  };
124
146
  } | undefined;
125
147
  schemaVersion: string | number | {
@@ -144,6 +166,7 @@ declare function getPublishedContractCatalog(): {
144
166
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
145
167
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
146
168
  readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
169
+ readonly repairTransaction: "workspai.workspace-repair-transaction.v1";
147
170
  };
148
171
  contractPath: string | null;
149
172
  publication: "capability-contract" | "json-schema" | "embedded-type";
@@ -219,13 +242,13 @@ declare function getVersionContract(): {
219
242
  ingestionPlan: "workspai.ingestion-plan.v1";
220
243
  ingestionResult: "workspai.ingestion-result.v1";
221
244
  projectEntryCapability: string;
222
- projectWorkspaceLink: string;
245
+ projectWorkspaceLink: "project-workspace-link.v1";
223
246
  projectWorkspaceResolution: "project-workspace-resolution.v1";
224
- projectContextAgent: string;
225
- doctorProjectEvidence: string;
247
+ projectContextAgent: "project-context-agent.v1";
248
+ doctorProjectEvidence: "doctor-project-evidence-v1";
226
249
  doctorWorkspaceEvidence: "doctor-workspace-evidence-v1";
227
250
  doctorGraphDiagnosis: "doctor-graph-diagnosis.v1";
228
- projectTestCoverage: string;
251
+ projectTestCoverage: "workspai.project-test-coverage.v1";
229
252
  verifiedGoal: string;
230
253
  verifiedGoalStatus: "workspai.verified-goal-status.v1";
231
254
  workspaceIntelligenceArchitecture: string;
@@ -252,6 +275,7 @@ declare function getVersionContract(): {
252
275
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
253
276
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
254
277
  readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
278
+ readonly repairTransaction: "workspai.workspace-repair-transaction.v1";
255
279
  };
256
280
  cliLogEvent: "cli-log-event-v1";
257
281
  freshnessMetadata: "rapidkit-freshness-metadata-v1";
@@ -281,15 +305,36 @@ declare function getVersionContract(): {
281
305
  doctorRemediationPlan: "doctor-remediation-plan-v2";
282
306
  doctorDependencyRepairTransaction: string;
283
307
  artifactRemediationPlan: "artifact-remediation-plan-v1";
308
+ studioCardRepairCapabilities: "workspai.studio-card-repair-capabilities.v1";
309
+ workspaceRepairProposal: "workspai.workspace-repair-proposal.v1";
310
+ workspaceRepairCapabilities: "workspai.workspace-repair-capabilities.v1";
311
+ workspaceRepairTransaction: "workspai.workspace-repair-transaction.v1";
284
312
  doctorFixResult: "rapidkit-doctor-fix-result-v1";
313
+ backendImportStackParitySnapshot: string;
314
+ bootstrapCompliance: "bootstrap-compliance.v1";
315
+ commandCapabilities: string;
316
+ createPlannerCapabilities: string;
317
+ doctorRemediationPlanLegacy: "doctor-remediation-plan-v2";
318
+ extensionCliCompatibility: string;
319
+ infraStack: string;
320
+ mirrorOps: "mirror-ops.v1";
321
+ moduleLayout: string;
322
+ moduleSupport: string;
323
+ pipelineLastRun: "rapidkit-pipeline-v1";
324
+ transparencyEvidence: "transparency-evidence.v1";
325
+ version: string;
326
+ studioBlockerHandoff: string;
327
+ workspaceRegistry: "workspace-registry.v1";
328
+ workspaceRunLast: "workspace-run-v1";
329
+ workspaceShareBundle: "1.1";
285
330
  };
286
331
  contractCatalog: {
287
332
  [k: string]: {
288
333
  artifacts?: {
289
334
  [k: string]: {
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;
335
+ path: ".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" | "AGENTS.md" | ".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" | ".workspai/reports/workspace-repair-last-run.json";
336
+ 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" | "workspai.workspace-repair-transaction.v1" | null;
337
+ 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" | "contracts/workspace-intelligence/workspace-repair-transaction.v1.json" | null;
293
338
  };
294
339
  } | undefined;
295
340
  schemaVersion: string | number | {
@@ -314,6 +359,7 @@ declare function getVersionContract(): {
314
359
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
315
360
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
316
361
  readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
362
+ readonly repairTransaction: "workspai.workspace-repair-transaction.v1";
317
363
  };
318
364
  contractPath: string | null;
319
365
  publication: "capability-contract" | "json-schema" | "embedded-type";
@@ -383,13 +429,13 @@ declare function getGlobalCommandCapabilities(): {
383
429
  ingestionPlan: "workspai.ingestion-plan.v1";
384
430
  ingestionResult: "workspai.ingestion-result.v1";
385
431
  projectEntryCapability: string;
386
- projectWorkspaceLink: string;
432
+ projectWorkspaceLink: "project-workspace-link.v1";
387
433
  projectWorkspaceResolution: "project-workspace-resolution.v1";
388
- projectContextAgent: string;
389
- doctorProjectEvidence: string;
434
+ projectContextAgent: "project-context-agent.v1";
435
+ doctorProjectEvidence: "doctor-project-evidence-v1";
390
436
  doctorWorkspaceEvidence: "doctor-workspace-evidence-v1";
391
437
  doctorGraphDiagnosis: "doctor-graph-diagnosis.v1";
392
- projectTestCoverage: string;
438
+ projectTestCoverage: "workspai.project-test-coverage.v1";
393
439
  verifiedGoal: string;
394
440
  verifiedGoalStatus: "workspai.verified-goal-status.v1";
395
441
  workspaceIntelligenceArchitecture: string;
@@ -416,6 +462,7 @@ declare function getGlobalCommandCapabilities(): {
416
462
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
417
463
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
418
464
  readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
465
+ readonly repairTransaction: "workspai.workspace-repair-transaction.v1";
419
466
  };
420
467
  cliLogEvent: "cli-log-event-v1";
421
468
  freshnessMetadata: "rapidkit-freshness-metadata-v1";
@@ -445,15 +492,36 @@ declare function getGlobalCommandCapabilities(): {
445
492
  doctorRemediationPlan: "doctor-remediation-plan-v2";
446
493
  doctorDependencyRepairTransaction: string;
447
494
  artifactRemediationPlan: "artifact-remediation-plan-v1";
495
+ studioCardRepairCapabilities: "workspai.studio-card-repair-capabilities.v1";
496
+ workspaceRepairProposal: "workspai.workspace-repair-proposal.v1";
497
+ workspaceRepairCapabilities: "workspai.workspace-repair-capabilities.v1";
498
+ workspaceRepairTransaction: "workspai.workspace-repair-transaction.v1";
448
499
  doctorFixResult: "rapidkit-doctor-fix-result-v1";
500
+ backendImportStackParitySnapshot: string;
501
+ bootstrapCompliance: "bootstrap-compliance.v1";
502
+ commandCapabilities: string;
503
+ createPlannerCapabilities: string;
504
+ doctorRemediationPlanLegacy: "doctor-remediation-plan-v2";
505
+ extensionCliCompatibility: string;
506
+ infraStack: string;
507
+ mirrorOps: "mirror-ops.v1";
508
+ moduleLayout: string;
509
+ moduleSupport: string;
510
+ pipelineLastRun: "rapidkit-pipeline-v1";
511
+ transparencyEvidence: "transparency-evidence.v1";
512
+ version: string;
513
+ studioBlockerHandoff: string;
514
+ workspaceRegistry: "workspace-registry.v1";
515
+ workspaceRunLast: "workspace-run-v1";
516
+ workspaceShareBundle: "1.1";
449
517
  };
450
518
  contractCatalog: {
451
519
  [k: string]: {
452
520
  artifacts?: {
453
521
  [k: string]: {
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;
522
+ path: ".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" | "AGENTS.md" | ".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" | ".workspai/reports/workspace-repair-last-run.json";
523
+ 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" | "workspai.workspace-repair-transaction.v1" | null;
524
+ 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" | "contracts/workspace-intelligence/workspace-repair-transaction.v1.json" | null;
457
525
  };
458
526
  } | undefined;
459
527
  schemaVersion: string | number | {
@@ -478,6 +546,7 @@ declare function getGlobalCommandCapabilities(): {
478
546
  readonly evaluationLive: "workspace-intelligence-evaluation.v1";
479
547
  readonly evaluationLastRun: "workspace-intelligence-evaluation.v1";
480
548
  readonly verifiedGoalStatus: "workspai.verified-goal-status.v1";
549
+ readonly repairTransaction: "workspai.workspace-repair-transaction.v1";
481
550
  };
482
551
  contractPath: string | null;
483
552
  publication: "capability-contract" | "json-schema" | "embedded-type";
@@ -490,8 +559,8 @@ declare function getGlobalCommandCapabilities(): {
490
559
  };
491
560
  workspace: {
492
561
  command: string;
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")[];
562
+ subcommands: ("archive" | "snapshot" | "list" | "import" | "init" | "sync" | "agent-sync" | "contract" | "model" | "share" | "remediation-plan" | "run" | "diff" | "impact" | "verify" | "explain" | "why" | "trace" | "registry" | "foundation" | "intelligence" | "goal" | "graph" | "watch" | "context" | "repair" | "feedback" | "eval" | "mcp" | "policy" | "export" | "hydrate" | "connect")[];
563
+ intelligenceSubcommands: ("snapshot" | "agent-sync" | "contract" | "model" | "remediation-plan" | "diff" | "impact" | "verify" | "explain" | "why" | "trace" | "intelligence" | "goal" | "graph" | "watch" | "context" | "repair" | "feedback" | "eval" | "mcp")[];
495
564
  };
496
565
  commandMap: any;
497
566
  runtimeInventory: RuntimeCommandInventoryPayload;