workspai 0.75.2 → 0.77.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 (118) hide show
  1. package/README.md +2 -2
  2. package/contracts/agent-framework-capabilities.v1.json +2 -2
  3. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +12 -0
  4. package/contracts/create-planner-capabilities.v1.json +48 -0
  5. package/contracts/extension-cli-compatibility.v1.json +4 -2
  6. package/contracts/published-contract-catalog.v1.json +10 -0
  7. package/contracts/runtime-command-surface.v1.json +5 -1
  8. package/contracts/workspace-intelligence/agent-framework-admission-candidate.v2.json +217 -0
  9. package/contracts/workspace-intelligence/agent-framework-conformance-report.v2.json +274 -0
  10. package/contracts/workspace-intelligence/workspace-model.v1.json +4 -0
  11. package/contracts/workspace-intelligence-architecture.v1.json +7 -3
  12. package/dist/analyze-TJM66CPF.js +1 -0
  13. package/dist/autopilot-release-C7Q4OTPY.js +1 -0
  14. package/dist/capabilities-command-TIBIKWPK.js +1 -0
  15. package/dist/{chunk-K52IQX3J.js → chunk-223SWPTL.js} +1 -1
  16. package/dist/chunk-3EMAC3MF.js +4 -0
  17. package/dist/{chunk-GDOO2YZW.js → chunk-3EPR3D5Q.js} +1 -1
  18. package/dist/chunk-3SQIV3F4.js +1 -0
  19. package/dist/{chunk-ZI54C2AO.js → chunk-475GQJ2D.js} +1 -1
  20. package/dist/{chunk-P36TACKN.js → chunk-47UR6ZH4.js} +1 -1
  21. package/dist/{chunk-VHMDWRDG.js → chunk-4BPZJR4Z.js} +4 -4
  22. package/dist/{chunk-VWBWDDU2.js → chunk-4CXV3PPV.js} +1 -1
  23. package/dist/chunk-4ZUBPFSO.js +6 -0
  24. package/dist/chunk-5KXOV7W4.js +1 -0
  25. package/dist/chunk-6BO4QHKA.js +1 -0
  26. package/dist/{chunk-OA2YJN22.js → chunk-DWDYLKVW.js} +1 -1
  27. package/dist/{chunk-KDVNRNDU.js → chunk-DWKCFHHL.js} +1 -1
  28. package/dist/{chunk-EP7SUMAX.js → chunk-E7WJ2QX7.js} +1 -1
  29. package/dist/{chunk-FNVWDXK2.js → chunk-GLBFY7AB.js} +5 -5
  30. package/dist/{chunk-ZGVODK5C.js → chunk-HRVHQBTA.js} +1 -1
  31. package/dist/{chunk-WHBKKJ7L.js → chunk-IAXRGH4Q.js} +1 -1
  32. package/dist/chunk-IDETNYCF.js +1 -0
  33. package/dist/chunk-IHWS3ALP.js +2 -0
  34. package/dist/{chunk-FZWLWFR4.js → chunk-J2MPBSQJ.js} +1 -1
  35. package/dist/{chunk-PFAGXI3G.js → chunk-JVZA35OL.js} +1 -1
  36. package/dist/chunk-LUPKDFQ3.js +7 -0
  37. package/dist/chunk-N7DOKE7V.js +2 -0
  38. package/dist/chunk-O3TVVQ6X.js +6 -0
  39. package/dist/chunk-P5LI5DL3.js +1 -0
  40. package/dist/{chunk-4JXJRIJM.js → chunk-QCX6BO2M.js} +1 -1
  41. package/dist/chunk-SC43A6LH.js +97 -0
  42. package/dist/chunk-SEZTSMRR.js +1 -0
  43. package/dist/{chunk-COOVCORC.js → chunk-SVO2GGTV.js} +1 -1
  44. package/dist/{chunk-5K4O3TAW.js → chunk-TGNPMOM6.js} +1 -1
  45. package/dist/chunk-UNEK3VVR.js +2684 -0
  46. package/dist/{chunk-IKBE3HOH.js → chunk-UP3UWAJV.js} +1 -1
  47. package/dist/{chunk-LFY7KTPD.js → chunk-UTIK3K3M.js} +1 -1
  48. package/dist/{chunk-WXUCAVFT.js → chunk-V6HVDVKJ.js} +8 -8
  49. package/dist/chunk-WC2K5QFI.js +10 -0
  50. package/dist/{chunk-DTNOF3MP.js → chunk-X5XFT5UZ.js} +1 -1
  51. package/dist/{chunk-ADHX7D3F.js → chunk-ZIWWE4BQ.js} +1 -1
  52. package/dist/{create-ZFSFWAW3.js → create-YPAZJYCE.js} +1 -1
  53. package/dist/{doctor-4KL4XUCS.js → doctor-W5PXJ5FL.js} +1 -1
  54. package/dist/{goal-lifecycle-EXQZD7IA.js → goal-lifecycle-5R55CA7H.js} +1 -1
  55. package/dist/{goal-pack-DKJU2DEP.js → goal-pack-IS6GGJPH.js} +1 -1
  56. package/dist/index.d.ts +12 -6
  57. package/dist/index.js +181 -171
  58. package/dist/{pipeline-4GVAOCEN.js → pipeline-LW3SW2WT.js} +1 -1
  59. package/dist/platform-capabilities-RWOWND5Q.js +1 -0
  60. package/dist/{project-agent-entry-7QKNEEXP.js → project-agent-entry-5TYKK5IV.js} +1 -1
  61. package/dist/{project-intelligence-lens-IHRYCLNU.js → project-intelligence-lens-TEOSTKNU.js} +1 -1
  62. package/dist/{project-test-coverage-3P5FH6E5.js → project-test-coverage-T4TIWGKN.js} +1 -1
  63. package/dist/proof-carrying-change-2TKRADCW.js +1 -0
  64. package/dist/{pythonRapidkitExec-UMFLDIYR.js → pythonRapidkitExec-S35OEIEF.js} +1 -1
  65. package/dist/{verified-goal-XI4RQESU.js → verified-goal-RN4TOV34.js} +1 -1
  66. package/dist/{workspace-EYXAKMVI.js → workspace-A33YMF2N.js} +1 -1
  67. package/dist/{workspace-agent-sync-SN55KT6N.js → workspace-agent-sync-VCA4G4DT.js} +1 -1
  68. package/dist/{workspace-context-PW6ESEHH.js → workspace-context-YBWLSKR6.js} +1 -1
  69. package/dist/{workspace-contract-FPLFL4G3.js → workspace-contract-3QUZDBMM.js} +1 -1
  70. package/dist/{workspace-explain-TVQ5IF5D.js → workspace-explain-NXYRAQFI.js} +1 -1
  71. package/dist/{workspace-foundation-DWIJPZRH.js → workspace-foundation-DZ52PECX.js} +1 -1
  72. package/dist/{workspace-graph-stream-RUTNWLQB.js → workspace-graph-stream-4VT46HZ7.js} +1 -1
  73. package/dist/{workspace-intelligence-4CA2CSPZ.js → workspace-intelligence-FKYQQDJ6.js} +1 -1
  74. package/dist/{workspace-intelligence-runner-VM5SXXAT.js → workspace-intelligence-runner-3K2JZH6Q.js} +1 -1
  75. package/dist/{workspace-knowledge-graph-JXN2ZOAF.js → workspace-knowledge-graph-CPBKNXQI.js} +1 -1
  76. package/dist/workspace-knowledge-graph-snapshot-67XDXUOT.js +1 -0
  77. package/dist/{workspace-mcp-serve-4WN4CSD7.js → workspace-mcp-serve-UXPKX7K6.js} +1 -1
  78. package/dist/{workspace-model-D4IECQML.js → workspace-model-POCPMNRT.js} +1 -1
  79. package/dist/{workspace-onboarding-6XWDKLM5.js → workspace-onboarding-KLG3GG7S.js} +1 -1
  80. package/dist/{workspace-registry-summary-Y3ET36NH.js → workspace-registry-summary-M4WMFDQ4.js} +1 -1
  81. package/dist/{workspace-repair-engine-HBUXRHDY.js → workspace-repair-engine-2VGN42QD.js} +1 -1
  82. package/dist/workspace-run-5YQR7GEZ.js +1 -0
  83. package/dist/{workspace-verify-OOAZ3NMZ.js → workspace-verify-PLAKTF3J.js} +1 -1
  84. package/dist/{workspace-watch-BNM5B6HU.js → workspace-watch-VNU4KVYN.js} +1 -1
  85. package/docs/README.md +4 -2
  86. package/docs/agent-framework-adapters.md +168 -39
  87. package/docs/ci-workflows.md +40 -22
  88. package/docs/commands-reference.md +19 -8
  89. package/docs/create-planner-capabilities.md +1 -0
  90. package/docs/creating-workspaces-and-projects.md +28 -9
  91. package/docs/doctor-command.md +9 -4
  92. package/docs/model-gateways.md +204 -0
  93. package/docs/native-kit-baselines.md +4 -2
  94. package/docs/workspace-run.md +3 -1
  95. package/package.json +5 -1
  96. package/scripts/enterprise-package-smoke.mjs +200 -5
  97. package/dist/analyze-6UEBC5OJ.js +0 -1
  98. package/dist/autopilot-release-H5TO6NYY.js +0 -1
  99. package/dist/capabilities-command-VK3LQLP2.js +0 -1
  100. package/dist/chunk-3N27P3KO.js +0 -7
  101. package/dist/chunk-3RNWBFRP.js +0 -4
  102. package/dist/chunk-66O62XNJ.js +0 -97
  103. package/dist/chunk-7NKM6EHE.js +0 -7
  104. package/dist/chunk-BR6QIYQS.js +0 -1
  105. package/dist/chunk-DFREJHG7.js +0 -1
  106. package/dist/chunk-E42IFQFR.js +0 -6
  107. package/dist/chunk-EWD6QTAM.js +0 -2
  108. package/dist/chunk-G5UCEXP6.js +0 -1
  109. package/dist/chunk-JKAAKE4Z.js +0 -6
  110. package/dist/chunk-LARREYZN.js +0 -1
  111. package/dist/chunk-RGNCL5OB.js +0 -1
  112. package/dist/chunk-SZHRPELL.js +0 -1
  113. package/dist/chunk-VXFIMEC6.js +0 -2
  114. package/dist/chunk-X7OI24LO.js +0 -418
  115. package/dist/platform-capabilities-DB4BZPTD.js +0 -1
  116. package/dist/proof-carrying-change-O37XUPIZ.js +0 -1
  117. package/dist/workspace-knowledge-graph-snapshot-KBNUXA64.js +0 -1
  118. package/dist/workspace-run-VN7KV4BU.js +0 -1
@@ -0,0 +1,6 @@
1
+ import {h,j as j$1,i,m,a as a$1,c,l as l$1,k}from'./chunk-LUPKDFQ3.js';import {q,m as m$1,r,s,i as i$1,n}from'./chunk-6BO4QHKA.js';import {u,v}from'./chunk-VQZ5PI5J.js';import f from'fs';import l from'path';import A from'fs-extra';var xe=[{id:"fastapi.standard",aliases:["fastapi","fastapi.standard"],label:"fastapi \u2014 FastAPI Standard Kit",description:"Core-backed FastAPI service scaffold.",owner:"core",runtime:"python",framework:"fastapi",category:"backend",moduleSupport:true,workspacePythonEngine:"required",stability:"stable",versionPolicy:"tested-baseline"},{id:"fastapi.ddd",aliases:["fastapi.ddd","fastapi-ddd"],label:"fastapi \u2014 FastAPI DDD Kit",description:"Core-backed FastAPI DDD service scaffold.",owner:"core",runtime:"python",framework:"fastapi",category:"backend",moduleSupport:true,workspacePythonEngine:"required",stability:"stable",versionPolicy:"tested-baseline"},{id:"nestjs.standard",aliases:["nestjs","nest","nestjs.standard"],label:"nestjs \u2014 NestJS Standard Kit",description:"Core-backed NestJS service scaffold.",owner:"core",runtime:"node",framework:"nestjs",category:"backend",moduleSupport:true,workspacePythonEngine:"optional",stability:"stable",versionPolicy:"tested-baseline"},{id:"springboot.standard",aliases:["spring","springboot","springboot.standard","java"],label:"spring \u2014 Spring Boot Standard Kit",description:"npm-backed Spring Boot service scaffold.",owner:"npm",runtime:"java",framework:"springboot",category:"backend",moduleSupport:false,workspacePythonEngine:"none",stability:"stable",versionPolicy:"tested-baseline",generator:"springboot",createUsage:"workspai create project springboot.standard <name> [--java-version <major>] [--spring-boot-version <semver>] [--group-id <com.example>] [--package-name <com.example.app>] [--port <number>]"},{id:"gofiber.standard",aliases:["go","go.standard","fiber","gofiber","gofiber.standard","go/fiber"],label:"go/fiber \u2014 Go Fiber Standard Kit",description:"npm-backed Go Fiber service scaffold.",owner:"npm",runtime:"go",framework:"gofiber",category:"backend",moduleSupport:false,workspacePythonEngine:"none",stability:"stable",versionPolicy:"tested-baseline",generator:"gofiber",createUsage:"workspai create project gofiber.standard <name> [--output <dir>]"},{id:"gogin.standard",aliases:["gin","gogin","gogin.standard","go/gin"],label:"go/gin \u2014 Go Gin Standard Kit",description:"npm-backed Go Gin service scaffold.",owner:"npm",runtime:"go",framework:"gogin",category:"backend",moduleSupport:false,workspacePythonEngine:"none",stability:"stable",versionPolicy:"tested-baseline",generator:"gogin",createUsage:"workspai create project gogin.standard <name> [--output <dir>]"},{id:"dotnet.webapi.clean",aliases:["dotnet","dotnet.webapi","dotnet.webapi.clean","aspnet","aspnetcore","asp.net","asp.net-core","csharp","c#"],label:"dotnet \u2014 ASP.NET Core Clean Web API",description:"npm-backed ASP.NET Core Web API with clean architecture boundaries.",owner:"npm",runtime:"dotnet",framework:"dotnet",category:"backend",moduleSupport:false,workspacePythonEngine:"none",stability:"preview",versionPolicy:"tested-baseline",generator:"dotnet-webapi-clean",createUsage:"workspai create project dotnet.webapi.clean <name> [--target-framework net8.0] [--root-namespace <Company.Product>] [--port <number>]"},{id:"rust.axum",aliases:["rust.axum","axum","rust-axum"],label:"rust/axum \u2014 Rust Axum API",description:"Workspai-owned Axum service with health, tests, CI, and container baseline.",owner:"npm",runtime:"rust",framework:"axum",category:"backend",moduleSupport:false,workspacePythonEngine:"none",stability:"preview",versionPolicy:"tested-baseline",generator:"rust-axum",createUsage:"workspai create project rust.axum <name> [--port <number>] [--output <dir>] [--skip-git]"}],ne=new Map;for(let e of xe){ne.set(e.id.toLowerCase(),e);for(let t of e.aliases)ne.set(t.toLowerCase(),e);}function W(e){return e?ne.get(e.trim().toLowerCase())??null:null}function Vt(e){return W(e)?.id??e}function Ht(){return xe.filter(e=>e.owner==="core"||e.generator)}function zt(e){return W(e)?.owner==="npm"}async function Xt(e,t){if(!e.generator)throw new Error(`Kit is not backed by an npm generator: ${e.id}`);if(e.generator==="gofiber"){let{generateGoFiberKit:n}=await import('./gofiber-standard-PFBIAMGR.js');await n(t.projectPath,{project_name:t.projectName,module_path:t.projectName,skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="gogin"){let{generateGoGinKit:n}=await import('./gogin-standard-DW5GL7YG.js');await n(t.projectPath,{project_name:t.projectName,module_path:t.projectName,skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="springboot"){let{generateSpringBootKit:n}=await import('./springboot-standard-CZH24KWD.js');await n(t.projectPath,{project_name:t.projectName,artifact_id:t.projectName,java_version:j(t.args,"--java-version")?.trim(),spring_boot_version:j(t.args,"--spring-boot-version")?.trim(),springdoc_version:j(t.args,"--springdoc-version")?.trim(),group_id:j(t.args,"--group-id")?.trim(),package_name:j(t.args,"--package-name")?.trim(),description:j(t.args,"--description")?.trim(),port:j(t.args,"--port")?.trim(),skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="dotnet-webapi-clean"){let{generateDotnetWebApiCleanKit:n}=await import('./dotnet-webapi-clean-GXTNZMKO.js');await n(t.projectPath,{project_name:t.projectName,target_framework:j(t.args,"--target-framework")?.trim(),root_namespace:j(t.args,"--root-namespace")?.trim(),description:j(t.args,"--description")?.trim(),port:j(t.args,"--port")?.trim(),skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="rust-axum"){let{generateRustAxumKit:n}=await import('./rust-axum-L7UAYARA.js');await n(t.projectPath,{project_name:t.projectName,description:j(t.args,"--description")?.trim(),port:j(t.args,"--port")?.trim(),skipGit:t.skipGit,skipInstall:t.skipInstall});return}throw new Error(`Unhandled npm kit generator: ${e.generator}`)}function j(e,t){let n=e.indexOf(t);if(n>=0&&n+1<e.length)return e[n+1];let r=e.find(o=>o.startsWith(`${t}=`));return r?r.slice(t.length+1):void 0}var N=["init","dev","start","build","test","lint","format","help"],we={python:{runtime:"python",displayName:"Python",tier:"first-class",scaffoldSupport:true,importSupport:true,lifecycleCommands:N,moduleCommands:true,doctorSupport:"full",notes:["Core-backed Python projects support RapidKit Core modules and lifecycle commands."]},node:{runtime:"node",displayName:"Node.js",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:N,moduleCommands:true,doctorSupport:"full",notes:["Node projects support npm-owned lifecycle commands; NestJS is the first-class Node framework."]},go:{runtime:"go",displayName:"Go",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:N,moduleCommands:false,doctorSupport:"readiness",notes:["Go projects support workspace governance and lifecycle commands via Go tooling."]},java:{runtime:"java",displayName:"Java / Spring Boot",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:N,moduleCommands:false,doctorSupport:"readiness",notes:["Java projects support Maven/Gradle lifecycle commands and workspace governance."]},dotnet:{runtime:"dotnet",displayName:".NET / ASP.NET Core",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:N,moduleCommands:false,doctorSupport:"readiness",notes:[".NET projects support dotnet CLI lifecycle commands and workspace governance."]},php:{runtime:"php",displayName:"PHP",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:N,moduleCommands:false,doctorSupport:"readiness",notes:["Laravel projects use the official Composer generator and PHP/Composer lifecycle adapter."]},ruby:{runtime:"ruby",displayName:"Ruby",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Ruby projects are importable and governed as observed projects until a kit exists."]},rust:{runtime:"rust",displayName:"Rust",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:N,moduleCommands:false,doctorSupport:"readiness",notes:["Rust projects support Axum and Tauri scaffolding plus Cargo lifecycle commands."]},elixir:{runtime:"elixir",displayName:"Elixir",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Elixir projects are importable and governed as observed projects until a kit exists."]},clojure:{runtime:"clojure",displayName:"Clojure",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Clojure projects are importable and governed as observed projects until a kit exists."]},scala:{runtime:"scala",displayName:"Scala",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Scala projects are importable and governed as observed projects until a kit exists."]},kotlin:{runtime:"kotlin",displayName:"Kotlin",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Kotlin projects are importable and governed as observed projects until a kit exists."]},deno:{runtime:"deno",displayName:"Deno",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Deno projects are importable and governed as observed projects until a kit exists."]},bun:{runtime:"bun",displayName:"Bun",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["init","dev","start","build","test","lint","format","help"],moduleCommands:false,doctorSupport:"observed",notes:["Bun projects are importable and governed as observed projects until a kit exists.","Declared package scripts execute through the Bun-aware npm wrapper; undeclared lifecycle commands remain unavailable."]},c:{runtime:"c",displayName:"C",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["C projects are importable and receive manifest, test, quality, security, and coverage evidence without assuming a package manager."]},cpp:{runtime:"cpp",displayName:"C++",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["C++ projects are importable and receive manifest, test, quality, security, and coverage evidence without assuming a package manager."]},unknown:{runtime:"unknown",displayName:"Unknown",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Unknown projects are tracked safely but require manual command configuration."]}};function O(e){return we[e||"unknown"]??we.unknown}function ve(e){return h(e).supportTier}function Pe(e){let t=O(e.runtime);return {lifecycleCommands:t.lifecycleCommands,moduleCommands:e.moduleSupport&&t.moduleCommands,unsupportedLifecycleCommands:N.filter(n=>!t.lifecycleCommands.includes(n))}}var Xe=["python","node","bun","go","java","dotnet","rust","php"];function M(e){return !!e&&Xe.includes(e)}function J(e,t){return t!=="lint"&&t!=="format"&&t!=="docs"?false:e==="python"}function Ne(e){let t=O(e),n=M(t.runtime),r=Ze[t.runtime]??[],o=Qe[t.runtime]??[];return {runtime:t.runtime,displayName:t.displayName,lifecycleCommands:t.lifecycleCommands,hasExecutor:n,packageManagers:r,primaryFiles:o,notes:t.notes}}var Ze={python:["poetry","pip","uv"],node:["npm","pnpm","yarn","bun"],go:["go"],java:["maven","gradle"],dotnet:["dotnet"],php:["composer"],ruby:["bundle"],rust:["cargo"],elixir:["mix"],kotlin:["gradle"],deno:["deno"],bun:["bun"]},Qe={python:["pyproject.toml","requirements.txt","requirements.in"],node:["package.json"],go:["go.mod"],java:["pom.xml","build.gradle","build.gradle.kts"],dotnet:["*.csproj","*.sln"],php:["composer.json"],ruby:["Gemfile"],rust:["Cargo.toml"],elixir:["mix.exs"],kotlin:["settings.gradle.kts"],deno:["deno.json","deno.jsonc"],bun:["package.json","bunfig.toml",".bunfig.toml"]};function D(e,t){let n=j$1(e)?null:e,r=i({runtime:typeof n?.runtime=="string"?n.runtime:void 0,framework:typeof n?.framework=="string"?n.framework:void 0,kitName:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0});return r.runtime!=="unknown"?r.runtime:m(t,n).runtime}function Ee(e,t={}){let n=e;for(;;){for(let o of u(n,"project.json"))if(f.existsSync(o))try{return JSON.parse(f.readFileSync(o,"utf8"))}catch{return null}if(t.searchParents===false)break;let r=l.dirname(n);if(r===n)break;n=r;}return null}function pn(e,t){return D(e,t)==="go"}function mn(e,t){return D(e,t)==="node"}function dn(e,t){return D(e,t)==="java"}function fn(e,t){return D(e,t)==="dotnet"}function gn(e,t){return D(e,t)==="python"}var tt=["project.json","context.json","file-hashes.json"];async function vn(e){let t=l.resolve(e),n=[];for(let r of tt){let o=v(t,r);if(await A.pathExists(o))continue;let i=l.join(t,".rapidkit",r);if(!await A.pathExists(i))continue;let u=await A.readJson(i);await A.ensureDir(l.dirname(o));let g=`${o}.${process.pid}.${Date.now()}.tmp`;try{await A.writeJson(g,u,{spaces:2}),await A.move(g,o,{overwrite:false}),n.push(o);}finally{await A.remove(g).catch(()=>{});}}return n}function nt(e){for(let t of u(e,"context.json"))if(f.existsSync(t))try{return JSON.parse(f.readFileSync(t,"utf8"))}catch{return null}return null}function rt(e){let t=e?.engine;return t==="npm"||t==="pip"||t==="python"||t==="poetry"||t==="venv"||t==="pipx"||t==="uv"?t:"unknown"}function ot(e,t){if(e?.module_support===false||t?.module_support===false||!e&&t)return false;let n=typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:typeof t?.kit=="string"?t.kit:void 0,r=n?W(n):void 0;return r?.owner==="core"&&r.moduleSupport===true}function it(e,t,n){let r=j$1(t)?null:t,o=i({runtime:typeof r?.runtime=="string"?r.runtime:typeof n?.runtime=="string"?n.runtime:void 0,framework:typeof r?.framework=="string"?r.framework:typeof n?.framework=="string"?n.framework:void 0,kitName:typeof r?.kit_name=="string"?r.kit_name:typeof r?.kit=="string"?r.kit:typeof n?.kit=="string"?n.kit:void 0});return o.key!=="unknown"?o:m(e,r)}function Me(e){let t=l.resolve(e);if(![...u(t,"project.json"),...u(t,"context.json")].some(u=>f.existsSync(u)))return null;let r=Ee(t,{searchParents:false}),o=nt(t),i=it(t,r,o);return {projectRoot:t,projectJson:r,contextJson:o,detection:i,moduleSupport:ot(r,o),engine:rt(o)}}var st=["build","dev","start","test","lint","format"],oe=["init","test","build","start"],Rn=["lint","format","docs"];function En(e){return !!e&&st.includes(e)}var at={dev:["dev","start:dev","watch"],start:["start","start:prod","preview"],build:["build","compile"],test:["test","test:unit","test:ci"],lint:["lint","eslint"],format:["format","prettier"]},Le={nestjs:{dev:["dev","start:dev"],start:["start","start:prod"],build:["build"],test:["test","test:e2e"],lint:["lint"],format:["format"]},express:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},fastify:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},koa:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function ct(e){let t=l.join(e,"package.json");if(!f.existsSync(t))return {};try{let r=JSON.parse(f.readFileSync(t,"utf8")).scripts??{};return Object.fromEntries(Object.entries(r).filter(o=>typeof o[1]=="string"))}catch{return {}}}function lt(e,t){let n=t?c(t):"unknown",r=n!=="unknown"?a$1(n,e):[],o=t?Le[t]?.[e]??[]:[],i=at[e]??[],u=[...r,...o,...i];return [...new Set(u)]}function _e(e,t,n){let r=ct(e),o=new Set(Object.keys(r));if(o.has(t))return {scriptName:t,source:"package.json"};for(let i of lt(t,n?.framework))if(o.has(i))return {scriptName:i,source:a$1(c(n?.framework??"unknown"),t).includes(i)||Le[n?.framework??""]?.[t]?.includes(i)?"framework-candidate":"generic-candidate"};return null}function se(e){return f.existsSync(l.join(e,"package.json"))}function ut(e){try{let t=JSON.parse(f.readFileSync(l.join(e,"package.json"),"utf8"));return typeof t.packageManager!="string"?null:t.packageManager.trim().match(/^(npm|pnpm|yarn|bun)(?:@|$)/)?.[1]??null}catch{return null}}function Y(e){let t=ut(e);return t||(f.existsSync(l.join(e,"bun.lock"))||f.existsSync(l.join(e,"bunfig.toml"))?"bun":f.existsSync(l.join(e,"pnpm-lock.yaml"))?"pnpm":f.existsSync(l.join(e,"yarn.lock"))?"yarn":f.existsSync(l.join(e,"package-lock.json"))?"npm":f.existsSync(l.join(e,"pnpm-workspace.yaml"))?"pnpm":"npm")}function $n(e,t,n=Y(e)){return n==="npm"?`npm run ${t}`:`${n} run ${t}`}function Bn(e,t=Y(e)){return `${t} install`}var pt="polyglot-lifecycle-plan.v1",$e=new Set([".git",".workspai",".rapidkit",".venv","bin","build","dist","node_modules","obj","target","third_party","vendor","fixture","fixtures","__fixtures__","testdata"]);function I(e,t){return l.relative(e,t).split(l.sep).join("/")||"."}function mt(e){let t=new Set,n=(r,o)=>{if(o>4)return;let i=[];try{i=f.readdirSync(r,{withFileTypes:true});}catch{return}for(let u of i){if(u.isDirectory()){$e.has(u.name)||n(l.join(r,u.name),o+1);continue}if(!u.isFile()||!u.name.endsWith(".go")||u.name.endsWith("_test.go"))continue;let g=l.join(r,u.name);try{let s=f.readFileSync(g,"utf8");/^\s*package\s+main\b/m.test(s)&&/^\s*func\s+main\s*\(/m.test(s)&&t.add(I(e,r));}catch{}}};return n(e,0),t.size===1?[...t][0]:null}function Fe(e,t,n){let r=false;for(let o of e.split(/\r?\n/)){let i=o.match(/^\s*\[([^\]]+)\]\s*(?:#.*)?$/)?.[1]?.trim();if(i!==void 0){r=i===t;continue}if(r&&new RegExp(`^\\s*${n}\\s*=`).test(o))return true}return false}function dt(e,t){let n=[],r=(o,i)=>{if(i>t)return;let u=[];try{u=f.readdirSync(o,{withFileTypes:true});}catch{return}for(let g of u.sort((s,d)=>s.name.localeCompare(d.name))){let s=l.join(o,g.name);if(g.isDirectory()){$e.has(g.name)||r(s,i+1);continue}g.isFile()&&(["package.json","deno.json","deno.jsonc","pyproject.toml","go.mod","Cargo.toml","pom.xml","build.gradle","build.gradle.kts","build.sbt","deps.edn","composer.json","Gemfile","mix.exs","CMakeLists.txt","meson.build"].includes(g.name)||/\.(?:cs|fs|vb)proj$/i.test(g.name))&&n.push(s);}};return r(e,0),n}function ft(e,t){if(l.dirname(t)!==e)return false;let n,r;try{n=JSON.parse(f.readFileSync(l.join(e,".workspai","project.json"),"utf8")),r=f.readFileSync(t,"utf8").replace(/\r\n/g,`
2
+ `).trim();}catch{return false}if(n.generated_by!=="workspai")return false;let o=String(n.kit??n.kit_name??"");if(o==="agent.microsoft.python"&&l.basename(t)==="pyproject.toml"){let i=typeof n.name=="string"?n.name:"",u=["[project]",`name = ${JSON.stringify(i)}`,'version = "0.1.0"','requires-python = ">=3.10"',"dependencies = []","","[tool.uv]","package = false"].join(`
3
+ `);return i.length>0&&r===u&&f.existsSync(l.join(e,"agents","primary","pyproject.toml"))}if(o==="agent.microsoft.dotnet"&&/\.(?:cs|fs|vb)proj$/iu.test(t)){let i=['<Project Sdk="Microsoft.NET.Sdk">'," <PropertyGroup>"," <TargetFramework>net8.0</TargetFramework>"," <ImplicitUsings>enable</ImplicitUsings>"," <Nullable>enable</Nullable>"," </PropertyGroup>","</Project>"].join(`
4
+ `);return r===i&&f.existsSync(l.join(e,"agents","primary","Primary.csproj"))}return false}function gt(e,t){let n=I(e,t).toLowerCase().split("/"),r=n.findIndex(o=>["test","tests","spec","specs","e2e","integration","integration-tests","eval","evals","bench","benchmark","benchmarks","benchmark-app","benchmark-apps"].includes(o));return r<0?false:n.length-r>2}function yt(e){if(l.basename(e)!=="package.json")return true;try{let t=l.dirname(e),n=JSON.parse(f.readFileSync(e,"utf8")),r=i=>{let u=n[i];return !!(u&&typeof u=="object"&&Object.keys(u).length>0)},o=n.scripts&&typeof n.scripts=="object"?n.scripts:{};return ["dependencies","devDependencies","optionalDependencies","peerDependencies"].some(r)||["preinstall","install","postinstall","prepare","init","test","build","start"].some(i=>typeof o[i]=="string")||["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb"].some(i=>f.existsSync(l.join(t,i)))||Be(e).length>0||f.existsSync(l.join(t,"pnpm-workspace.yaml"))}catch{return true}}function bt(e,t){let n=l.basename(t);return n!=="build.gradle"&&n!=="build.gradle.kts"||l.dirname(t)===e?false:f.existsSync(l.join(e,"settings.gradle"))||f.existsSync(l.join(e,"settings.gradle.kts"))}function kt(e,t){if(l.basename(t)!=="CMakeLists.txt")return false;let n=l.dirname(t),r=l.dirname(n);for(;r.startsWith(`${e}${l.sep}`)||r===e;){let o=l.join(r,"CMakeLists.txt");if(f.existsSync(o))try{let i=f.readFileSync(o,"utf8");for(let u of i.matchAll(/add_subdirectory\s*\(\s*["']?([^\s)"']+)/giu)){let g=u[1];if(g&&l.resolve(r,g)===n)return true}}catch{}if(r===e)break;r=l.dirname(r);}return false}function Te(e,t){let n=e.match(new RegExp(`^\\s*${t}\\s*=\\s*\\[([\\s\\S]*?)\\]`,"m"));return n?.[1]?[...n[1].matchAll(/["']([^"']+)["']/g)].map(r=>r[1]??""):[]}function Be(e){try{let t=JSON.parse(f.readFileSync(e,"utf8"));if(Array.isArray(t.workspaces))return t.workspaces.filter(n=>typeof n=="string");if(t.workspaces&&typeof t.workspaces=="object"&&!Array.isArray(t.workspaces)){let n=t.workspaces.packages;return Array.isArray(n)?n.filter(r=>typeof r=="string"):[]}}catch{}return []}function ht(e){if(!f.existsSync(e))return [];try{let t=f.readFileSync(e,"utf8"),n=t.match(/^packages\s*:\s*\[([^\]]*)\]/m)?.[1];return n!==void 0?[...n.matchAll(/["']([^"']+)["']/g)].map(o=>o[1]??""):[...(t.match(/^packages\s*:\s*\n((?:^[ \t]+-.*\n?)*)/m)?.[1]??"").matchAll(/^[ \t]+-[ \t]+["']?([^"'#\n]+?)["']?[ \t]*$/gm)].map(o=>(o[1]??"").trim())}catch{return []}}function Oe(e,t){let n=t.replace(/^\.\//,"").replace(/\/$/,""),r="^";for(let o=0;o<n.length;o+=1){let i=n[o]??"";i==="*"&&n[o+1]==="*"?(r+=".*",o+=1):i==="*"?r+="[^/]*":i==="?"?r+="[^/]":r+=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&");}return new RegExp(`${r}$`).test(e)}function Ct(e,t){let n=I(e.root,t);return n==="."||n.startsWith("../")||!e.patterns.some(o=>!o.startsWith("!")&&Oe(n,o))?false:!e.exclusions.some(o=>Oe(n,o))}function St(e){return e.filter(t=>l.basename(t)==="package.json").map(t=>{let n=l.dirname(t),r=[...Be(t),...ht(l.join(n,"pnpm-workspace.yaml"))];return {root:n,patterns:r.filter(o=>!o.startsWith("!")),exclusions:r.filter(o=>o.startsWith("!")).map(o=>o.slice(1))}}).filter(t=>t.patterns.length>0)}function jt(e){return e.filter(t=>l.basename(t)==="Cargo.toml").map(t=>{try{let n=f.readFileSync(t,"utf8");return /^\s*\[workspace\]\s*$/m.test(n)?{root:l.dirname(t),patterns:Te(n,"members"),exclusions:Te(n,"exclude")}:null}catch{return null}}).filter(t=>!!t?.patterns.length)}function De(e,t,n){if(l.basename(e)!==n)return false;let r=l.dirname(e);return t.some(o=>o.root!==r&&Ct(o,r))}function Ie(e){return /^[A-Za-z0-9_./:@%+,=\\-]+$/.test(e)?e:`"${e.replace(/(["\\])/g,"\\$1")}"`}function xt(e){return e.map(t=>[Ie(t.executable),...t.args.map(Ie)].join(" ")).join(" && ")}function a(e,t,n="high",r){return {stage:e,command:t,confidence:n,preflight:"executable-and-inputs",...r&&r.length>0?{argvSequence:r}:{}}}function wt(e){let{unitRoot:t,contents:n$1,poetryManaged:r$1}=e,o=q({unitRoot:t,projectRoot:e.projectRoot}),i=Fe(n$1,"tool.poetry.scripts","start")||Fe(n$1,"project.scripts","start"),u=f.existsSync(l.join(t,"main.py")),g=/^\s*\[tool\.workspai\]\s*$[\s\S]*?^\s*lifecycle-lock-tool\s*=\s*["']uv["']\s*$/m.test(n$1),s$1=m$1(o.venvPath),d=r(t,s$1),b=s(t,s$1),k=r$1?i$1():d,p=Pt(t,n$1,r$1,k);if(r$1)return [a("init","poetry install"),...p?[a("test",p)]:[],...u?[a("build",`${k} -m compileall .`)]:/\[build-system\]/.test(n$1)?[a("build","poetry build","medium")]:[],...u?[a("start",`${k} main.py`)]:i?[a("start","poetry run start","medium")]:[]];let h=s(t,o.venvPath),v=o.pipAvailable||f.existsSync(n(o.venvPath)),C=[];o.venvExists||C.push({executable:i$1(),args:["-m","venv",h]}),(!o.venvExists||!v)&&C.push({executable:b,args:["-m","ensurepip","--upgrade"]}),C.push({executable:b,args:["-m","pip","install","-e","."]}),g&&C.push({executable:"uv",args:["lock"]});let K=!!(p&&(p.includes(" -m pytest")||p.includes("pytest")));return [a("init",xt(C),"high",C),...p?[a("test",p,"high",[{executable:b,args:K?["-m","pytest"]:["-m","unittest","discover","-s","tests"]}])]:[],...u?[a("build",`${d} -m compileall .`,"high",[{executable:b,args:["-m","compileall","."]}])]:/\[build-system\]/.test(n$1)?[a("build",`${d} -m build`,"medium",[{executable:b,args:["-m","build"]}])]:[],...u?[a("start",`${d} main.py`,"high",[{executable:b,args:["main.py"]}])]:i?[a("start","start","medium")]:[]]}function vt(e,t){let n={};try{let i=JSON.parse(t);i.scripts&&typeof i.scripts=="object"&&!Array.isArray(i.scripts)&&(n=i.scripts);}catch{}let r=Y(e),o=i=>`${r} run ${i}`;return [a("init",r==="yarn"?"yarn install":`${r} install`),...typeof n.test=="string"?[a("test",o("test"))]:[],...typeof n.build=="string"?[a("build",o("build"))]:[],...typeof n.start=="string"?[a("start",o("start"))]:[]]}function Pt(e,t,n,r){let o=f.existsSync(l.join(e,"tests")),i=["requirements.txt","requirements-dev.txt","requirements-test.txt"].some(g=>{try{return /^\s*pytest(?:\[|\s|[<>=~!])/im.test(f.readFileSync(l.join(e,g),"utf8"))}catch{return false}});return /\[tool\.pytest(?:\.|\])/i.test(t)||/["']pytest(?:\[|[<>=~!]|["'])/i.test(t)||f.existsSync(l.join(e,"pytest.ini"))||f.existsSync(l.join(e,"conftest.py"))||i?n?"poetry run pytest":`${r} -m pytest`:o?n?"poetry run python -m unittest discover -s tests":`${r} -m unittest discover -s tests`:null}function Nt(e,t){let n=l.basename(t),r=l.dirname(t),o=I(e,r),i=I(e,t),u=i.toLowerCase().split("/"),g=u.some(p=>["example","examples","sample","samples","worked","eval","evals","bench","benchmark","benchmarks","benchmark-app","benchmark-apps"].includes(p))?"example":u.some(p=>["test","tests","e2e","integration","integration-tests"].includes(p))?"test":u.some(p=>["script","scripts","tool","tools","tooling"].includes(p))?"tooling":"production",s="";try{s=f.readFileSync(t,"utf8");}catch{return null}let d,b,k;if(n==="package.json"){let p=f.existsSync(l.join(r,"bun.lock"))||f.existsSync(l.join(r,"bun.lockb"))||f.existsSync(l.join(r,"bunfig.toml"))||f.existsSync(l.join(r,".bunfig.toml"));d=p?"bun":"node",b=p?"bun":"npm",k=vt(r,s);}else if(n==="deno.json"||n==="deno.jsonc"){d="deno",b="deno";let p={};try{let h=JSON.parse(s);h.tasks&&typeof h.tasks=="object"&&!Array.isArray(h.tasks)&&(p=h.tasks);}catch{}k=[...typeof p.test=="string"?[a("test","deno task test")]:[a("test","deno test","medium")],...typeof p.build=="string"?[a("build","deno task build")]:[],...typeof p.start=="string"?[a("start","deno task start")]:typeof p.dev=="string"?[a("start","deno task dev","medium")]:[]];}else if(n==="pyproject.toml"){d="python",b="python";let p=/^\s*\[tool\.poetry\]\s*$/m.test(s);k=wt({projectRoot:e,unitRoot:r,contents:s,poetryManaged:p});}else if(n==="go.mod"){d="go",b="go";let p=mt(r);k=[a("init","go mod download"),a("test","go test ./..."),a("build","go build ./..."),...p?[a("start",p==="."?"go run .":`go run ./${p}`)]:[]];}else if(n==="Cargo.toml")d="rust",b="cargo",k=[a("init","cargo fetch"),a("test","cargo test"),a("build","cargo build"),...f.existsSync(l.join(r,"src","main.rs"))?[a("start","cargo run")]:[]];else if(n==="pom.xml"){d="java",b="maven";let p=f.existsSync(l.join(r,"mvnw"))?"./mvnw":"mvn";k=[a("init",`${p} dependency:go-offline`),a("test",`${p} test`),a("build",`${p} package`)];}else if(n==="build.gradle"||n==="build.gradle.kts"){d=/(?:kotlin|org\.jetbrains\.kotlin)/i.test(s)?"kotlin":"java",b="gradle";let p=f.existsSync(l.join(r,"gradlew"))?"./gradlew":"gradle";k=[a("init",`${p} dependencies`),a("test",`${p} test`),a("build",`${p} build`)];}else if(n==="build.sbt")d="scala",b="sbt",k=[a("init","sbt update"),a("test","sbt test"),a("build","sbt compile")];else if(n==="deps.edn")d="clojure",b="clojure-cli",k=[a("init","clojure -P"),.../:test\b/.test(s)?[a("test","clojure -X:test","medium")]:[]];else if(/\.(?:cs|fs|vb)proj$/i.test(n)){d="dotnet",b="nuget";let p=g==="test"||/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test(s)||/PackageReference\s+Include=["']Microsoft\.NET\.Test\.Sdk["']/i.test(s);k=[a("init",`dotnet restore ${n}`),...p?[a("test",`dotnet test ${n}`)]:[],a("build",`dotnet build ${n}`),...!p&&(/<Project\s+Sdk=["']Microsoft\.NET\.Sdk\.Web["']/i.test(s)||/<OutputType>\s*(?:Exe|WinExe)\s*<\/OutputType>/i.test(s))?[a("start",`dotnet run --project ${n}`)]:[]];}else if(n==="composer.json"){d="php",b="composer";let p={};try{let h=JSON.parse(s);h.scripts&&typeof h.scripts=="object"&&!Array.isArray(h.scripts)&&(p=h.scripts);}catch{}k=[a("init","composer install"),...typeof p.test<"u"?[a("test","composer test")]:f.existsSync(l.join(r,"vendor","bin","phpunit"))||f.existsSync(l.join(r,"phpunit.xml"))||f.existsSync(l.join(r,"phpunit.xml.dist"))?[a("test","vendor/bin/phpunit","medium")]:[],...typeof p.build<"u"?[a("build","composer build")]:[],...typeof p.start<"u"?[a("start","composer start")]:[]];}else if(n==="Gemfile"){d="ruby",b="bundler";let p=f.existsSync(l.join(r,"bin","rails")),h=p||/\bgem\s+['\"]rails['\"]/.test(s),v=f.existsSync(l.join(r,"spec"))||/\bgem\s+['\"]rspec(?:-rails)?['\"]/.test(s),C=f.existsSync(l.join(r,"test"));k=[a("init","bundle install"),...C&&h?[a("test","bundle exec rails test")]:v?[a("test","bundle exec rspec")]:f.existsSync(l.join(r,"Rakefile"))?[a("test","bundle exec rake test","medium")]:[],...p?[a("start","bundle exec rails server")]:[]];}else if(n==="mix.exs")d="elixir",b="mix",k=[a("init","mix deps.get"),a("test","mix test"),a("build","mix compile"),.../(?:phoenix|phx\.server)/i.test(s)?[a("start","mix phx.server")]:[]];else if(n==="CMakeLists.txt")d=/(?:\bcxx\b|\bcplusplus\b|\bc\+\+\b)/iu.test(s)?"cpp":"c",b="cmake",k=[a("init","cmake -S . -B build"),a("test","ctest --test-dir build --output-on-failure","medium"),a("build","cmake --build build")];else if(n==="meson.build")d=/(?:cpp|c\+\+)/iu.test(s)?"cpp":"c",b="meson",k=[a("init","meson setup build"),a("test","meson test -C build","medium"),a("build","meson compile -C build")];else return null;return {id:`${d}:${o}:${l.basename(i)}`,runtime:d,ecosystem:b,role:g,root:o,manifest:i,stages:k}}function Ke(e,t={}){let n=l.resolve(e),r=dt(n,Math.max(0,Math.min(t.maxDepth??4,12))),o=St(r),i=jt(r),u=r.filter(s=>!ft(n,s)).filter(s=>!gt(n,s)).filter(s=>!bt(n,s)).filter(s=>!kt(n,s)).filter(s=>yt(s)).filter(s=>!De(s,o,"package.json")).filter(s=>!De(s,i,"Cargo.toml")).map(s=>Nt(n,s)).filter(s=>!!s).filter(s=>t.includeExamples===true||s.role!=="example").sort((s,d)=>s.runtime.localeCompare(d.runtime)||s.root.localeCompare(d.root)||s.manifest.localeCompare(d.manifest)),g=[...new Set(u.map(s=>s.runtime))].sort();return {schemaVersion:pt,projectRoot:".",polyglot:g.length>1,runtimes:g,units:u}}function Ge(e){let t=Ne(e);return t.runtime==="unknown"&&e!=="unknown"?null:{runtime:t.runtime,displayName:t.displayName,supportedCommands:t.lifecycleCommands,packageManagers:t.packageManagers,primaryFiles:t.primaryFiles,notes:t.notes,hasExecutor:t.hasExecutor}}function ae(e){try{let t=f.readFileSync(e,"utf8");return /^\s*package\s+main\b/m.test(t)&&/\bfunc\s+main\s*\(/m.test(t)}catch{return false}}function le(e){let t=l.join(e,"main.go");if(ae(t))return "./.";try{if(f.readdirSync(e,{withFileTypes:true}).filter(o=>o.isFile()&&o.name.endsWith(".go")).map(o=>l.join(e,o.name)).filter(ae).length>0)return "./."}catch{}let n=l.join(e,"cmd");try{let r=f.readdirSync(n,{withFileTypes:true}).filter(o=>o.isDirectory()).map(o=>({name:o.name,mainPath:l.join(n,o.name,"main.go")})).filter(o=>ae(o.mainPath)).map(o=>`./cmd/${o.name}`).sort();return r.length===1?r[0]:null}catch{return null}}function Et(e){try{let t=l.join(e,"Makefile");return f.existsSync(t)?f.readFileSync(t,"utf8"):""}catch{return ""}}function R(e,t){let n=Et(e);return n?new RegExp(`^${t}\\s*:`,"m").test(n):false}function y(e){try{return f.existsSync(e)}catch{return false}}function E(e){try{return y(e)?f.readFileSync(e,"utf8"):""}catch{return ""}}function Mt(e){let t=[e];for(;t.length>0;){let n=t.shift();if(!n)break;let r=[];try{r=f.readdirSync(n,{withFileTypes:true});}catch{continue}for(let o of r){if(o.name==="node_modules"||o.name===".git"||o.name==="dist")continue;let i=l.join(n,o.name);if(o.isFile()&&o.name.endsWith(".csproj"))return true;o.isDirectory()&&t.push(i);}}return false}function We(e,t){let n=y(l.join(e,"pyproject.toml")),r=y(l.join(e,"requirements.txt"))||y(l.join(e,"requirements.in")),o=y(l.join(e,"manage.py")),i=y(l.join(e,".workspai","cli.py"))||y(l.join(e,".rapidkit","cli.py")),u=E(l.join(e,"pyproject.toml")),g=y(l.join(e,"tests"))||y(l.join(e,"test"))||/\[tool\.pytest/i.test(u),s=/^\s*\[build-system\]\s*$/m.test(u),d=/^\s*\[(?:project\.scripts|tool\.poetry\.scripts)\]\s*$/m.test(u)&&/^\s*(?:start|serve)\s*=/m.test(u);switch(t){case "init":return n||r;case "dev":case "start":return o||d||i;case "test":return g||i;case "build":return s||i;case "lint":case "format":return n||r||o||y(l.join(e,"setup.py"))||y(l.join(e,"setup.cfg"));default:return false}}function At(e,t){if(!y(l.join(e,"go.mod")))return false;switch(t){case "init":return true;case "dev":return R(e,"run")||le(e)!==null;case "test":return true;case "build":return true;case "start":return R(e,"run")||le(e)!==null;case "lint":return y(l.join(e,".golangci.yml"))||y(l.join(e,".golangci.yaml"))||R(e,"lint");case "format":return true;default:return false}}function Lt(e,t,n){let r=y(l.join(e,"pom.xml")),o=y(l.join(e,"build.gradle"))||y(l.join(e,"build.gradle.kts"));if(!r&&!o)return false;let i=E(l.join(e,"pom.xml")),u=[E(l.join(e,"build.gradle")),E(l.join(e,"build.gradle.kts"))].join(`
5
+ `),g=n==="springboot"||i.includes("spring-boot-maven-plugin")||/org\.springframework\.boot|id\s*\(?\s*['"]org\.springframework\.boot['"]/u.test(u),s=g||/<mainClass>\s*[^<]+\s*<\/mainClass>/iu.test(i)||/\bmainClass(?:Name)?\s*(?:=|\.)/u.test(u);switch(t){case "init":case "test":case "build":return true;case "dev":return g;case "start":return s;case "lint":return R(e,"lint")||i.includes("checkstyle")||i.includes("spotless-maven-plugin")||u.includes("checkstyle")||u.includes("spotless");case "format":return R(e,"format")||i.includes("spotless-maven-plugin")||u.includes("spotless");default:return false}}function _t(e,t){if(!Mt(e))return false;let r=[],o=s=>{let d=[];try{d=f.readdirSync(s,{withFileTypes:true});}catch{return}for(let b of d){if([".git",".workspai","bin","obj","node_modules"].includes(b.name))continue;let k=l.join(s,b.name);b.isDirectory()?o(k):/\.(?:cs|fs|vb)proj$/i.test(b.name)&&r.push(k);}};o(e);let i=r.map(E),u=i.some(s=>/<IsTestProject>\s*true\s*<\/IsTestProject>/i.test(s)||/Microsoft\.NET\.Test\.Sdk/i.test(s)),g=i.some(s=>/Microsoft\.NET\.Sdk\.Web/i.test(s)||/<OutputType>\s*(?:Exe|WinExe)\s*<\/OutputType>/i.test(s));switch(t){case "init":case "build":return true;case "dev":case "start":return g;case "test":return u;case "lint":return R(e,"lint")||E(l.join(e,"Directory.Build.props")).includes("EnforceCodeStyleInBuild");case "format":return R(e,"format")||y(l.join(e,".editorconfig"));default:return false}}function Je(e,t,n){return t==="init"?se(e):_e(e,t,{framework:n})!==null}function Ft(e,t,n){switch(t){case "php":return n==="init"&&y(l.join(e,"composer.json"));case "ruby":return n==="init"&&y(l.join(e,"Gemfile"));case "rust":return y(l.join(e,"Cargo.toml"))?n==="init"||n==="test"||n==="build"||n==="start":false;case "elixir":return n==="init"&&y(l.join(e,"mix.exs"));case "deno":return y(l.join(e,"deno.json"))||y(l.join(e,"deno.jsonc"))?n==="init"||n==="dev"||n==="test"||n==="start":n==="init"&&y(l.join(e,"package.json"));case "bun":return y(l.join(e,"bunfig.toml"))||y(l.join(e,".bunfig.toml"))||y(l.join(e,"bun.lock"))?n==="init"||n==="dev"||n==="test"||n==="build"||n==="start":n==="init"&&y(l.join(e,"package.json"));default:return false}}function Tt(e){try{let t=JSON.parse(E(l.join(e,"composer.json")));return new Set(Object.keys(t.scripts??{}))}catch{return new Set}}function Ot(e,t){if(!y(l.join(e,"composer.json")))return false;let n=Tt(e),r=y(l.join(e,"artisan"));switch(t){case "init":return true;case "dev":return r||n.has("dev");case "start":return r||n.has("start");case "test":return r||n.has("test");case "build":return n.has("build");case "lint":return n.has("lint")||n.has("analyse")||n.has("analyze");case "format":return n.has("format")||n.has("fmt")||y(l.join(e,"pint.json"))||y(l.join(e,"vendor","bin","pint"));default:return false}}function Dt(e,t){let n=l.join(e,"Cargo.toml");if(!y(n))return false;if(t==="dev"||t==="start"){let r=E(n);if(!/^\s*\[package\]\s*$/m.test(r))return false;let i=/^\s*\[\[bin\]\]\s*$/m.test(r),g=!/^\s*autobins\s*=\s*false\s*(?:#.*)?$/m.test(r)&&y(l.join(e,"src","main.rs"));return i||g}return t==="init"||t==="build"||t==="test"||t==="lint"||t==="format"}function z(e,t,n,r){if(J(t,n))return We(e,n);if(!M(t))return Ft(e,t,n);switch(t){case "node":return Je(e,n,r);case "bun":return Je(e,n,r);case "python":return We(e,n);case "go":return At(e,n);case "java":return Lt(e,n,r);case "dotnet":return _t(e,n);case "rust":return Dt(e,n);case "php":return Ot(e,n);default:return false}}function It(e,t,n){return ["init","dev","start","build","test","lint","format"].filter(o=>z(e,t,o,n))}function qe(e){let t=Pe({runtime:e.runtime,moduleSupport:e.moduleSupport});if(!e.projectPath)return t;let n=It(e.projectPath,e.runtime,e.framework),r=new Set(["help"]);for(let i of n)t.lifecycleCommands.includes(i)&&r.add(i);e.runtime==="node"&&se(e.projectPath)&&r.add("init");let o=[...r].sort();return {lifecycleCommands:o,moduleCommands:t.moduleCommands,unsupportedLifecycleCommands:t.lifecycleCommands.filter(i=>!o.includes(i)).sort()}}var pe=["version","commands","doctor","project","help"],B=["init","dev","start","build","test","lint","format"],me=["add","modules","upgrade","diff","merge","reconcile","rollback","uninstall","checkpoint","snapshot","optimize"],de=["create","list","info","frameworks","license"];pe.filter(e=>e!=="help");function Bt(e){let t=l.resolve(e);for(;;){if([...u(t,"project.json"),...u(t,"context.json")].some(o=>f.existsSync(o)))return t;let r=l.dirname(t);if(r===t)break;t=r;}return null}function $(e,t){return {command:e,...t}}var Kt=new Set(["dev","lint","format"]),Ve=new Set(oe);function Gt(e,t){return t?Ve.has(e)?{executionScope:"fleet",fleetEligible:true}:Kt.has(e)?{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}}function Ut(e,t){return J(t.runtime,e)?"core":"runtime"}function Wt(e,t,n,r){return !e||!r.lifecycleCommands.includes(t)?false:z(e,n.runtime,t,n.key)}function Jt(e,t){let n=!!e&&(t.runtime==="python"||M(t.runtime)&&z(e,t.runtime,"build",t.key));return $("docs",{owner:t.runtime==="python"?"core":"runtime",status:n?"supported":"unsupported",reason:n?t.runtime==="python"?"Documentation generation is delegated to Python Core for this project.":"Project documentation commands are available through the npm wrapper for this runtime.":"Documentation commands require a supported Python or npm-executor project manifest."})}function qt(e){let t=l.resolve(e),n=Bt(e);return n||(k(t).length>0?t:null)}function Yt(e=process.cwd()){let t=qt(e),n=t?Me(t):null,r=n?.detection??m(e,n?.projectJson??null),o=n?.moduleSupport??false,i=n?.engine??"unknown",u=Ge(r.runtime),g=O(r.runtime),s=t?l$1(t):[],d=[r.runtime,...s.filter(c=>c!==r.runtime)].filter((c,S,T)=>c!=="unknown"&&T.indexOf(c)===S);d.length===0&&d.push("unknown");let b=d.filter(c=>c!=="unknown").length>1,k=qe({runtime:r.runtime,moduleSupport:o,projectPath:t??void 0,framework:r.key}),p=t?Ke(t):null,h=new Set(p?.units.flatMap(c=>c.stages.map(S=>S.stage))??[]),v={};for(let c of pe)v[c]=$(c,{owner:"npm",status:"supported",reason:c==="project"?"The npm CLI owns the project command surface and delegates only Core-specific detection operations.":c==="help"?"Help is available for every Workspai project through the npm CLI.":"Universal command available across Workspai project types."});for(let c of B){let S=Ve.has(c)&&h.has(c),T=Wt(t,c,r,k)||M(r.runtime)&&S,fe=Ut(c,r),X=S?{executionScope:"fleet",fleetEligible:true}:Gt(c,T);v[c]=$(c,{owner:fe,status:T?"supported":"unsupported",executionScope:X.executionScope,fleetEligible:X.fleetEligible,reason:T?fe==="core"?`Delegated to Python Core for ${r.displayName} projects.`:X.fleetEligible?`Handled by runtime adapter and eligible for workspace fleet stages (${c}).`:c==="dev"?"Local development command only; workspace fleet excludes dev by design.":r.runtime==="node"?`Handled by npm/pnpm/yarn via the resolved ${c} script in package.json.`:`Handled by the ${u?.displayName??r.displayName} runtime adapter for local project execution.`:t?r.runtime==="node"?`No ${c} script was found in package.json for this ${r.displayName} project.`:M(r.runtime)?`The ${r.displayName} runtime is tracked, but ${c} is not available from detected project manifests.`:`${r.displayName} is tracked as an observed runtime; ${c} requires project manifests or explicit scripts.`:"No Workspai project was detected."});}if(b)for(let c of B){let S=v[c];S&&(S.reason=`Composite runtime boundary detected (${d.join(", ")}). The project-local shortcut describes only the primary ${r.runtime} adapter; workspace fleet planning covers detected nested runtime units separately through \`workspace run <stage> --plan\`. ${S.reason??""}`.trim());}v.docs=Jt(t,r);for(let c of me)v[c]=$(c,{owner:o?"core":"none",status:o?"supported":"unsupported",reason:o?"Core module/template command supported for this project.":`Core module/template commands are not available for ${r.displayName} projects.`});for(let c of de)v[c]=$(c,{owner:c==="create"?"npm":"core",status:"global",reason:c==="create"?"Create is orchestrated by npm for multi-language workspace support.":"Engine catalog command; not specific to the selected project runtime."});let C=Object.values(v),K=C.filter(c=>B.includes(c.command)).filter(c=>c.status==="supported"),He=oe.filter(c=>K.some(S=>S.fleetEligible===true&&S.command===c)||h.has(c)),ze=K.filter(c=>c.executionScope==="local-only").map(c=>c.command).sort();return {schemaVersion:1,scope:"project",projectRoot:t,engine:i,runtime:r.runtime,runtimeCandidates:d,compositeRuntime:b,lifecycleCoverage:b?"primary-runtime-only":"complete",framework:r.key,frameworkDisplayName:r.displayName,frameworkConfidence:r.confidence,frameworkSupportTier:ve(r.key),runtimeSupportTier:g.tier,runtimeDoctorSupport:g.doctorSupport,moduleSupport:o,fleetStages:He,localOnlyCommands:ze,commandMap:v,supportedCommands:C.filter(c=>c.status==="supported").map(c=>c.command).sort(),unsupportedCommands:C.filter(c=>c.status==="unsupported").map(c=>c.command).sort(),globalCommands:C.filter(c=>c.status==="global").map(c=>c.command).sort()}}function Lr(e,t=process.cwd()){let n=e[0];return n?Yt(t).commandMap[n]??null:null}function _r(e){if(e[0]==="project"&&e[1]==="commands")return true;if(e[0]==="commands"&&e.includes("--scope")){let t=e.indexOf("--scope");return e[t+1]==="project"}return e.some(t=>t==="--scope=project")&&e[0]==="commands"}function Fr(e,t){return [`Workspai command not supported for this project: ${e.command}`,"",`Project: ${t.projectRoot??"not detected"}`,`Runtime: ${t.runtime}`,`Framework: ${t.frameworkDisplayName}`,`Reason: ${e.reason??"Unsupported for this project type."}`,"","Run `workspai project commands` to inspect supported commands for this project."].join(`
6
+ `)}export{Bn as A,Ke as B,Bt as C,Yt as D,Lr as E,_r as F,Fr as G,W as a,Vt as b,Ht as c,zt as d,Xt as e,O as f,ve as g,M as h,D as i,Ee as j,pn as k,mn as l,dn as m,fn as n,gn as o,vn as p,Me as q,st as r,Rn as s,En as t,_e as u,le as v,R as w,qe as x,Y as y,$n as z};
@@ -0,0 +1 @@
1
+ import {f,h as h$1}from'./chunk-BLEIUQL6.js';import {t as t$1}from'./chunk-VQZ5PI5J.js';import {t,s}from'./chunk-ODK4LCEL.js';import g from'fs';import W from'path';var c=s.workspaceRunLast.schemaVersion,P="workspace-run-last.json",a=t.workspaceRunLast;var _=new Set(["init","test","build","start"]);function C(e){return _.has(e)}async function A(e){try{return await g.promises.access(e,g.constants.F_OK),true}catch{return false}}async function w(e){try{let t=await g.promises.readFile(e,"utf-8");return JSON.parse(t)}catch{return null}}function h(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function N(e){let t=e.stage;return typeof t!="string"||t.trim().length===0||!Array.isArray(e.projects)?false:C(t)||/^[a-z][a-z0-9_-]*$/i.test(t)}function v(e){let t=h(e);return !t||t.schemaVersion===c?false:N(t)}function j(e){let t=h(e);return t?t.schemaVersion===c&&t.stages!=null:false}function l(e){if(j(e)){let t=e.enterpriseControls;return {...e,projectStages:e.projectStages??t.projectStages,enterpriseControls:t}}if(v(e)){let t=e.stage;return {schemaVersion:c,generatedAt:e.generatedAt,workspacePath:e.workspacePath,latestStage:t,stages:{[t]:e},enterpriseControls:e.enterpriseControls??{jsonReady:true,evidencePath:a}}}return null}function V(e,t){let n=l(e);if(!n)return null;let s=t??n.latestStage;return n.stages[s]??null}async function K(e){let t=(await Promise.all(t$1(W.resolve(e),"reports",P).map(async s=>await A(s)?s:null))).find(s=>typeof s=="string");if(!t)return null;let n=await w(t);return l(n)}function T(e){let t=typeof e.relativePath=="string"?e.relativePath.replace(/\\/g,"/"):"";if(t)return t.toLowerCase();let n=typeof e.path=="string"?e.path.replace(/\\/g,"/"):"";return n?n.toLowerCase():(e.projectName??"").toLowerCase()}async function F(e,t){let n=W.resolve(e);return f(n,a,async()=>{let s=(await Promise.all(t$1(n,"reports",P).map(async r=>await A(r)?r:null))).find(r=>typeof r=="string"),R=s?await w(s):null,o=l(R);if(s&&!o)throw new Error(`Workspace run evidence is unreadable or invalid; refusing to overwrite: ${s}`);let k=o?{...o.stages}:{};k[t.stage]=t;let i={...o?.projectStages??o?.enterpriseControls?.projectStages??{}};for(let r of t.projects){if(!r.selected)continue;let u=T(r);u&&(i[u]={...i[u],[t.stage]:{generatedAt:t.generatedAt,status:r.status,projectName:r.projectName,relativePath:r.relativePath,command:r.executionCommand,exitCode:r.exitCode,runtime:r.runtimeDetected}});}let d={schemaVersion:c,generatedAt:t.generatedAt,workspacePath:t.workspacePath,latestStage:t.stage,stages:k,enterpriseControls:{jsonReady:true,evidencePath:a,projectStages:i}};return await h$1(n,a,d),d})}export{P as a,a as b,V as c,K as d,F as e};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-A5FBGRJA.js';import {g as g$1,p}from'./chunk-VXFIMEC6.js';import {g,h}from'./chunk-BLEIUQL6.js';import {s as s$1,q}from'./chunk-RGNCL5OB.js';import {t as t$1}from'./chunk-VQZ5PI5J.js';import {t,s}from'./chunk-ODK4LCEL.js';import a from'path';import {existsSync}from'fs';import m from'fs-extra';var f=t.workspaceRegistry,w=s.workspaceRegistry.schemaVersion;function E(r){return {slug:r.slug,relativePath:r.relativePath,framework:r.framework,kit:r.kit,source:r.source}}async function b(r){let e=t$1(r,"workspace.json").find(t=>existsSync(t));if(!e)return {exists:false,legacyProjectCount:0};try{let t=await m.readJson(e),c=Array.isArray(t.projects)?t.projects.length:0,o=typeof t.workspace_name=="string"&&t.workspace_name.trim()||typeof t.name=="string"&&t.name.trim()||a.basename(r);return {exists:true,manifestPath:e,workspaceName:o,profile:typeof t.profile=="string"?t.profile:void 0,legacyProjectCount:c}}catch{return {exists:true,manifestPath:e,legacyProjectCount:0,workspaceName:a.basename(r)}}}async function _(r){let e=a$1(r);for(let t of s$1())if(await m.pathExists(t))try{let o=((await m.readJson(t)).workspaces||[]).find(s=>a$1(s.path)===e);if(o)return {exists:true,projectCount:Array.isArray(o.projects)?o.projects.length:0,registryPath:t}}catch{continue}return {exists:false,projectCount:0,registryPath:a.join(q(),"workspaces.json")}}async function T(r,e){let t=a.resolve(r),c=await g(t,g$1),o=await b(t),s=await _(t),i=e?.contract!==void 0||!!c,n=[];if(e?.contract)n=e.contract.projects||[];else if(i)try{let{contract:A}=await p({workspacePath:t});n=A.projects||[];}catch{n=[];}let d={contract:{exists:i,projectCount:n.length,path:g$1},globalRegistry:{exists:s.exists,projectCount:s.projectCount,path:s.registryPath},legacyWorkspaceJson:{exists:o.exists,projectCount:o.legacyProjectCount,path:o.manifestPath?a.relative(t,o.manifestPath):void 0}},p$1="none",u=[],y=0;return i?(p$1="workspace.contract.json",u=n.map(E),y=u.length):s.projectCount>0?(p$1="global-registry",y=s.projectCount):o.legacyProjectCount>0&&(p$1="legacy-workspace.json",y=o.legacyProjectCount),{contractExists:i,summary:{schemaVersion:w,kind:"rapidkit.workspace.registry",workspacePath:t,workspaceName:o.workspaceName||a.basename(t),profile:o.profile,projectCount:y,authority:p$1,contractPath:g$1,projects:u,sources:d}}}async function U(r){let e=await g(r,f);if(!e)return null;try{let t=await m.readJson(e);return t?.schemaVersion!==w?null:t}catch{return null}}async function D(r,e){let t=await M(r,e);return await h(r,f,t),t}async function M(r,e){return {...(await T(r,{contract:e?.contract})).summary,generatedAt:(e?.now??new Date).toISOString(),registrySummaryPath:f}}function F(r,e=""){return r.projectCount>0?r.authority==="workspace.contract.json"?`${r.projectCount} project(s) registered in workspace contract${e}.`:r.authority==="global-registry"?`${r.projectCount} project(s) registered in global workspace registry${e}.`:`${r.projectCount} project(s) registered in legacy workspace manifest${e}.`:`Workspace state exists, but no projects are registered yet${e}.`}export{f as a,w as b,T as c,U as d,D as e,M as f,F as g};
1
+ import {a as a$1}from'./chunk-A5FBGRJA.js';import {g as g$1,p}from'./chunk-IHWS3ALP.js';import {g,h}from'./chunk-BLEIUQL6.js';import {y,w as w$1}from'./chunk-6BO4QHKA.js';import {t as t$1}from'./chunk-VQZ5PI5J.js';import {t,s}from'./chunk-ODK4LCEL.js';import a from'path';import {existsSync}from'fs';import m from'fs-extra';var f=t.workspaceRegistry,w=s.workspaceRegistry.schemaVersion;function E(r){return {slug:r.slug,relativePath:r.relativePath,framework:r.framework,kit:r.kit,source:r.source}}async function b(r){let e=t$1(r,"workspace.json").find(t=>existsSync(t));if(!e)return {exists:false,legacyProjectCount:0};try{let t=await m.readJson(e),c=Array.isArray(t.projects)?t.projects.length:0,o=typeof t.workspace_name=="string"&&t.workspace_name.trim()||typeof t.name=="string"&&t.name.trim()||a.basename(r);return {exists:true,manifestPath:e,workspaceName:o,profile:typeof t.profile=="string"?t.profile:void 0,legacyProjectCount:c}}catch{return {exists:true,manifestPath:e,legacyProjectCount:0,workspaceName:a.basename(r)}}}async function _(r){let e=a$1(r);for(let t of y())if(await m.pathExists(t))try{let o=((await m.readJson(t)).workspaces||[]).find(s=>a$1(s.path)===e);if(o)return {exists:true,projectCount:Array.isArray(o.projects)?o.projects.length:0,registryPath:t}}catch{continue}return {exists:false,projectCount:0,registryPath:a.join(w$1(),"workspaces.json")}}async function T(r,e){let t=a.resolve(r),c=await g(t,g$1),o=await b(t),s=await _(t),i=e?.contract!==void 0||!!c,n=[];if(e?.contract)n=e.contract.projects||[];else if(i)try{let{contract:A}=await p({workspacePath:t});n=A.projects||[];}catch{n=[];}let d={contract:{exists:i,projectCount:n.length,path:g$1},globalRegistry:{exists:s.exists,projectCount:s.projectCount,path:s.registryPath},legacyWorkspaceJson:{exists:o.exists,projectCount:o.legacyProjectCount,path:o.manifestPath?a.relative(t,o.manifestPath):void 0}},p$1="none",u=[],y=0;return i?(p$1="workspace.contract.json",u=n.map(E),y=u.length):s.projectCount>0?(p$1="global-registry",y=s.projectCount):o.legacyProjectCount>0&&(p$1="legacy-workspace.json",y=o.legacyProjectCount),{contractExists:i,summary:{schemaVersion:w,kind:"rapidkit.workspace.registry",workspacePath:t,workspaceName:o.workspaceName||a.basename(t),profile:o.profile,projectCount:y,authority:p$1,contractPath:g$1,projects:u,sources:d}}}async function U(r){let e=await g(r,f);if(!e)return null;try{let t=await m.readJson(e);return t?.schemaVersion!==w?null:t}catch{return null}}async function D(r,e){let t=await M(r,e);return await h(r,f,t),t}async function M(r,e){return {...(await T(r,{contract:e?.contract})).summary,generatedAt:(e?.now??new Date).toISOString(),registrySummaryPath:f}}function F(r,e=""){return r.projectCount>0?r.authority==="workspace.contract.json"?`${r.projectCount} project(s) registered in workspace contract${e}.`:r.authority==="global-registry"?`${r.projectCount} project(s) registered in global workspace registry${e}.`:`${r.projectCount} project(s) registered in legacy workspace manifest${e}.`:`Workspace state exists, but no projects are registered yet${e}.`}export{f as a,w as b,T as c,U as d,D as e,M as f,F as g};