workspai 0.56.0 → 0.57.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.
- package/README.md +36 -8
- package/contracts/adopt-effects.v1.json +72 -0
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +4 -0
- package/contracts/doctor-project-evidence.v1.json +27 -0
- package/contracts/doctor-workspace-evidence.v1.json +29 -0
- package/contracts/extension-cli-compatibility.v1.json +1 -0
- package/contracts/published-contract-catalog.v1.json +5 -0
- package/contracts/workspace-intelligence/doctor-summary.v1.json +3 -1
- package/dist/autopilot-release-WIFFFQKW.js +1 -0
- package/dist/capabilities-command-44JVOE5S.js +1 -0
- package/dist/{chunk-XH7PDHBF.js → chunk-6OFGLNFS.js} +1 -1
- package/dist/{chunk-QTCZPS5I.js → chunk-75HOCFNH.js} +1 -1
- package/dist/{chunk-5RL254O2.js → chunk-7WUT5ZSO.js} +1 -1
- package/dist/{chunk-KR7CIEQR.js → chunk-AA4PNQKR.js} +1 -1
- package/dist/chunk-CNWUIXF3.js +1 -0
- package/dist/{chunk-6HCAGHCY.js → chunk-DF4NWPB7.js} +1 -1
- package/dist/chunk-DT4X7I5M.js +81 -0
- package/dist/chunk-GDKFN3CM.js +8 -0
- package/dist/{chunk-WLCBXCZV.js → chunk-GTJY55QK.js} +1 -1
- package/dist/{chunk-5ZA4JYOP.js → chunk-GXTCU4WF.js} +1 -1
- package/dist/{chunk-SV2SP22H.js → chunk-IUYZ3NHS.js} +3 -3
- package/dist/{chunk-KS4FB5W7.js → chunk-IXOLHPTN.js} +1 -1
- package/dist/{chunk-2L4PSZQB.js → chunk-L36ZASME.js} +1 -1
- package/dist/{chunk-7PNARN6S.js → chunk-N2BIIUDH.js} +1 -1
- package/dist/{chunk-QFCKHUEP.js → chunk-P475BOJW.js} +1 -1
- package/dist/{chunk-5BGPGNRQ.js → chunk-QHY6F4SS.js} +1 -1
- package/dist/chunk-QK5QOXOE.js +13 -0
- package/dist/{chunk-QAF26ZQX.js → chunk-RPHM7LQW.js} +1 -1
- package/dist/chunk-SNO3WG4V.js +2 -0
- package/dist/chunk-TTFQWH55.js +91 -0
- package/dist/{chunk-HASVV34S.js → chunk-VL3APTVB.js} +1 -1
- package/dist/{chunk-WOTTSPSF.js → chunk-VUR7H2FU.js} +1 -1
- package/dist/chunk-VZPWIILU.js +1 -0
- package/dist/chunk-WP3CXMVA.js +2 -0
- package/dist/{chunk-ESWFBSYM.js → chunk-Z57G62KE.js} +1 -1
- package/dist/{create-DLUWG46F.js → create-O2KLTN5H.js} +1 -1
- package/dist/{doctor-IZ4YOCYE.js → doctor-AL5YWO5X.js} +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +166 -164
- package/dist/{pipeline-IBQYDLFF.js → pipeline-4ST4BQWY.js} +1 -1
- package/dist/{project-intelligence-lens-SIU7IXKG.js → project-intelligence-lens-JHYECYOK.js} +1 -1
- package/dist/{verified-goal-M4GPOXNL.js → verified-goal-KFNRGOKT.js} +1 -1
- package/dist/{workspace-3AAOUELG.js → workspace-O4E5CCGK.js} +1 -1
- package/dist/{workspace-agent-sync-QGYLY7HH.js → workspace-agent-sync-N5DPGU2E.js} +1 -1
- package/dist/{workspace-context-JCLPRYNC.js → workspace-context-ETZNEHOJ.js} +1 -1
- package/dist/{workspace-contract-IUUPBQXU.js → workspace-contract-OSI7NBXS.js} +1 -1
- package/dist/{workspace-explain-CZGBVDE6.js → workspace-explain-EM7IUV6L.js} +1 -1
- package/dist/{workspace-foundation-7IGMO4CW.js → workspace-foundation-QQHX66KE.js} +1 -1
- package/dist/{workspace-graph-stream-5YMLJXAJ.js → workspace-graph-stream-UZJQ75XZ.js} +1 -1
- package/dist/workspace-graph-token-efficiency-TF23UYEF.js +1 -0
- package/dist/{workspace-intelligence-XHSUFTAT.js → workspace-intelligence-A7O7MN6T.js} +1 -1
- package/dist/{workspace-intelligence-runner-EN5V4KSC.js → workspace-intelligence-runner-4EF66L66.js} +1 -1
- package/dist/{workspace-knowledge-graph-VWQTIEYK.js → workspace-knowledge-graph-BVN4NTJ6.js} +1 -1
- package/dist/{workspace-knowledge-graph-query-TXA3KVUV.js → workspace-knowledge-graph-query-6DAOXGGT.js} +1 -1
- package/dist/{workspace-knowledge-graph-snapshot-WB62AVDK.js → workspace-knowledge-graph-snapshot-XSQADCNR.js} +1 -1
- package/dist/{workspace-mcp-serve-NCAGGWQS.js → workspace-mcp-serve-TKX4J3SX.js} +1 -1
- package/dist/{workspace-model-NXFIKX26.js → workspace-model-7ESEP366.js} +1 -1
- package/dist/{workspace-onboarding-OP22NHQ4.js → workspace-onboarding-SY255V7L.js} +1 -1
- package/dist/{workspace-registry-summary-A5VDPRHU.js → workspace-registry-summary-7ISKYEPM.js} +1 -1
- package/dist/{workspace-repair-engine-N4KXNSVL.js → workspace-repair-engine-GMA2YTCF.js} +1 -1
- package/dist/workspace-run-ZZXVNFUS.js +1 -0
- package/dist/{workspace-verify-TUVLFPPN.js → workspace-verify-CNXZPWS5.js} +1 -1
- package/dist/{workspace-watch-2ZNOYSUQ.js → workspace-watch-HGFL2EU3.js} +1 -1
- package/docs/From Code to Shared Understanding-B.png +0 -0
- package/docs/From Code to Shared Understanding.png +0 -0
- package/docs/README_CONTENT_CONTRACT.md +25 -12
- package/docs/ci-workflows.md +9 -1
- package/docs/commands-reference.md +1 -1
- package/docs/contracts/README.md +16 -12
- package/docs/doctor-command.md +35 -11
- package/docs/from-code-to-shared-understanding.md +22 -17
- package/docs/real-world-qualification.md +73 -0
- package/docs/workspace-knowledge-graph.md +24 -3
- package/docs/workspace-operations.md +14 -2
- package/docs/workspace-run.md +16 -4
- package/package.json +5 -1
- package/dist/autopilot-release-CH57CGET.js +0 -1
- package/dist/capabilities-command-WEOGFCWF.js +0 -1
- package/dist/chunk-664GXRLD.js +0 -1
- package/dist/chunk-7Y3KVZJF.js +0 -8
- package/dist/chunk-BDN32Y2N.js +0 -81
- package/dist/chunk-DIZSHNZ5.js +0 -2
- package/dist/chunk-DOIZANFA.js +0 -2
- package/dist/chunk-OX53L237.js +0 -13
- package/dist/chunk-QRWWYL52.js +0 -88
- package/dist/chunk-VGJVIHHR.js +0 -1
- package/dist/workspace-graph-token-efficiency-HK4KNWWP.js +0 -1
- package/dist/workspace-run-PXKC3ELS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'path';import N from'fs-extra';import F from'chalk';async function K(n,o={}){let t=e.resolve(n),{WORKSPACE_CONTRACT_PATH:i,syncWorkspaceContract:c,verifyWorkspaceContract:m,writeWorkspaceContractVerifyEvidence:k}=await import('./workspace-contract-
|
|
1
|
+
import e from'path';import N from'fs-extra';import F from'chalk';async function K(n,o={}){let t=e.resolve(n),{WORKSPACE_CONTRACT_PATH:i,syncWorkspaceContract:c,verifyWorkspaceContract:m,writeWorkspaceContractVerifyEvidence:k}=await import('./workspace-contract-OSI7NBXS.js'),p=await c({workspacePath:t,strict:true}),{syncWorkspaceReadme:f,WORKSPACE_README_PATH:d}=await import('./workspace-readme-IVJXSIBS.js'),h=await f({workspacePath:t,workspaceName:p.contract.workspace.name,profile:p.contract.workspace.profile??"minimal",projectCount:p.contract.projects.length}),{buildWorkspaceModel:u,writeWorkspaceModel:g}=await import('./workspace-model-7ESEP366.js'),a=await u({workspacePath:t,includeEvidence:true}),P=await g(a,t),{buildWorkspaceImpact:W,buildWorkspaceModelSnapshot:C,diffWorkspaceModel:y,writeWorkspaceImpact:A,writeWorkspaceModelDiff:j,writeWorkspaceModelSnapshot:E}=await import('./workspace-intelligence-A7O7MN6T.js'),{WORKSPACE_INTELLIGENCE_ARTIFACTS:s}=await import('./workspace-intelligence-runtime-registry-NCVHKCMP.js'),R=e.join(t,s.snapshot),l=false;if(!await N.pathExists(R)){let r=await C({workspacePath:t,model:a});await E(r,t),l=true;}let S=await y({workspacePath:t,fromPath:s.snapshot,model:a}),b=await j(S,t),v=await W({workspacePath:t,fromPath:s.diff}),O=await A(v,t),T=await m({workspacePath:t,strict:true}),_=await k({workspacePath:t,result:T}),{syncWorkspaceAgentGrounding:M}=await import('./workspace-agent-sync-N5DPGU2E.js'),w=await M({workspacePath:t,model:a,write:true,refreshContext:true,strict:false,preset:"enterprise",targets:["all"],projectGrounding:o.projectGrounding??"managed"}),x=[i,(await import('./workspace-registry-summary-7ISKYEPM.js')).WORKSPACE_REGISTRY_SUMMARY_RELATIVE_PATH,e.relative(t,h).split(e.sep).join("/")||d,e.relative(t,P).split(e.sep).join("/"),s.knowledgeGraph,...l?[s.snapshot]:[],e.relative(t,b).split(e.sep).join("/"),e.relative(t,O).split(e.sep).join("/"),e.relative(t,_).split(e.sep).join("/"),...w.writtenFiles].filter((r,I,G)=>G.indexOf(r)===I);return o.silent||console.log(F.gray(`\u2713 Workspace Intelligence synced \xB7 ${a.summary.projectCount} project(s) \xB7 model + graph + agent grounding`)),{workspacePath:t,projectCount:a.summary.projectCount,baselineCreated:l,writtenFiles:x,warnings:w.projectLenses?.skipped.map(r=>`${r.name}: ${r.reason}`)??[]}}async function D(n,o={}){let t=e.resolve(n),i=o.workspaceName??e.basename(t),{registerWorkspaceStrict:c}=await import('./workspace-O4E5CCGK.js');return await c(t,i),K(t,{silent:o.silent})}export{K as a,D as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b}from'./chunk-UQEQ6CXU.js';import {c}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-UQEQ6CXU.js';import {c}from'./chunk-GDKFN3CM.js';import {p,h,i as i$1}from'./chunk-GXTCU4WF.js';import {a}from'./chunk-SNO3WG4V.js';import {e as e$1,d}from'./chunk-ADL3CK44.js';import {f,e}from'./chunk-5EPPPMAS.js';import I from'path';import R from'fs-extra';var G=f.agentContext,V=e.agentContext;function q(e){if(typeof e!="string"||!e.trim()||e==="true")return "generic";let t=e.trim().toLowerCase();return t==="codex"||t==="claude"||t==="cursor"||t==="orca"?t:"generic"}function M(e){return `npx --yes --package workspai workspai ${e}`.trim()}function l(e){return `npx workspai ${e}`.trim()}function i(e$1){return {id:e$1.id,scope:e$1.scope,display:l(e$1.args),execute:M(e$1.args),description:e$1.description,...e$1.project?{project:e$1.project}:{},freshness:h({id:`command.${e$1.id}`,label:`${e$1.id} command`,scope:"command",value:{display:l(e$1.args),execute:M(e$1.args)},...e$1.project?{project:e$1.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:e$1.generatedAt,now:e$1.now,sourceArtifact:e.model,sourcePath:`safeCommands.${e$1.id}`,reason:"Safe command surfaces are derived from workspace model command capabilities."}}).freshness}}function F(e,t){return `workspace run ${t} --scope project:${e.name}`}function L(e){return (e.startsWith("project:")?e.slice(8):e).trim().toLowerCase()}function D(e){return [e.name,e.path,I.basename(e.path),e.absolutePath].filter(t=>typeof t=="string"&&t.trim().length>0).map(t=>t.trim().toLowerCase())}function K(e,t,n){let r={generatedAt:e.generatedAt,now:n},c=[i({id:"workspace.model",scope:"workspace",args:"workspace model --json",description:"Read the canonical workspace intelligence model.",...r}),i({id:"workspace.graph.entities",scope:"workspace",args:"workspace graph entities --json",description:"Query proof-backed workspace entities without loading the full graph.",...r}),i({id:"workspace.graph.evidence",scope:"workspace",args:"workspace graph evidence <entity-or-relation> --json",description:"Resolve portable evidence for a graph entity or relation.",...r}),i({id:"workspace.graph.path",scope:"workspace",args:"workspace graph path <from> <to> --json",description:"Find a shortest proof-carrying path between workspace entities.",...r}),i({id:"workspace.doctor",scope:"workspace",args:"doctor workspace --json",description:"Check workspace health before claiming verification.",...r}),i({id:"workspace.pipeline",scope:"workspace",args:"pipeline --json",description:"Run the governed sync, doctor, analyze, readiness, and autopilot loop.",...r}),i({id:"workspace.contract.verify",scope:"workspace",args:"workspace contract verify --json",description:"Verify workspace contract and dependency edges.",...r}),i({id:"workspace.verify",scope:"workspace",args:"workspace verify --json",description:"Evaluate evidence freshness and verification gates before release decisions.",...r})],a=t?[t]:e.projects;for(let s of a)s.commands.fleetStages.includes("test")&&c.push(i({id:`project.${s.name}.test`,scope:"project",project:s.name,args:F(s,"test"),description:`Run tests for ${s.name} through workspace orchestration.`,...r})),s.commands.fleetStages.includes("build")&&c.push(i({id:`project.${s.name}.build`,scope:"project",project:s.name,args:F(s,"build"),description:`Build ${s.name} through workspace orchestration.`,...r}));return c}function H(e){return e.commands.fleetStages.filter(t=>t==="test"||t==="build").map(t=>`workspace run ${t}`)}function z(e,t){if(!t?.startsWith("project:"))return;let n=L(t);if(n)return e.projects.find(r=>D(r).includes(n))}function B(e,t,n){let r=[...e.validation?.issues??[]];t?.startsWith("project:")&&!n&&r.push({severity:"error",code:"context.scope.project.missing",message:`Requested project scope was not found: ${t}`,target:t});let c=r.filter(s=>s.severity==="error").length,a=r.filter(s=>s.severity==="warning").length;return {status:c>0?"failed":a>0?"warning":"passed",errors:c,warnings:a,issues:r}}async function U(e,t){let n=[],r=[];for(let[c,a]of Object.entries(e.evidence))a&&await d(t,a.path)!==null?n.push(`${c}: ${a.path}`):r.push(c);return {available:n.sort(),missing:r.sort()}}function X(e){let t=e.summary.projectCount,n=e.summary.runtimes.length?`${e.summary.runtimes.join(", ")} runtime coverage`:"no runtime coverage",r=e.identity.surfaces.length?e.identity.surfaces.join(", "):"no detected surfaces";return `${e.workspace.name} is a ${e.identity.workspaceType} with ${t} project${t===1?"":"s"}, ${n}, and ${r}.`}function J(e){let t=["Do not claim a command passed unless a report or command output proves it.","Do not infer secrets or environment values from file names.","Do not change project scope without checking the selected project."];return e.contracts.exists||t.push("Workspace contract is missing; dependency and API edges may be incomplete."),e.summary.observedProjects>0&&t.push("Some projects are observed rather than first-class; command support may be partial."),t}async function pe(e$1){let t=e$1.model??await p({workspacePath:e$1.workspacePath,includeEvidence:e$1.includeEvidence===true,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),n=q(e$1.agent),r=z(t,e$1.scope),c$1=B(t,e$1.scope,r);if(e$1.strict===true&&c$1.status!=="passed"){let o=c$1.issues.map(m=>`${m.severity}:${m.code}:${m.target}`).join(", ");throw new Error(`Workspace context strict validation failed: ${o}`)}let a=e$1.now??new Date,s=t.facts??[],T=new Set((r?[r]:t.projects).map(o=>o.name)),w=s.filter(o=>o.project?T.has(o.project):true),_=(r?[r]:t.projects).map(o=>{let m=w.filter(N=>N.project===o.name);return {name:o.name,path:o.path,kind:o.kind,category:o.category,runtime:o.runtime,framework:o.frameworkDisplayName,...o.generator?{generator:o.generator}:{},createCapability:o.createCapability,supportTier:o.supportTier,safeCommands:H(o),importantFiles:o.importantFiles,facts:m}}),u=await U(t,e$1.workspacePath),y=I.join(e$1.workspacePath,e.knowledgeGraph),d=await R.pathExists(y)?await R.readJson(y).catch(()=>null):null,C=false;if(d?.schemaVersion===f.knowledgeGraph)try{c(d,t),C=true;}catch{}let v=X(t),j=K(t,r,a),O=j.map(o=>h({id:`context.command.${o.id}`,label:`${o.id} safe command`,scope:"command",value:{display:o.display,execute:o.execute,scope:o.scope},...o.project?{project:o.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:t.generatedAt,now:a,sourceArtifact:e.agentContext,sourcePath:`safeCommands.${o.id}`,reason:"Context safe commands are derived from workspace model command capabilities."}})),b$1=[...w,...O],f$1=i$1({facts:b$1,generatedAt:a.toISOString(),now:a}),h$1=b();return {schemaVersion:G,generatedAt:a.toISOString(),agent:n,workspaceSummary:v,modelRef:e.model,knowledgeGraph:{artifact:e.knowledgeGraph,schemaVersion:f.knowledgeGraph,available:C,...typeof d?.quality?.entityCount=="number"?{entityCount:d.quality.entityCount}:{},...typeof d?.quality?.relationCount=="number"?{relationCount:d.quality.relationCount}:{},...typeof d?.quality?.proofCount=="number"?{proofCount:d.quality.proofCount}:{},queryCommands:[l("workspace graph search <query> --limit 12 --json"),l("workspace graph entities [kind] --json"),l("workspace graph evidence <entity-or-relation> --json"),l("workspace graph path <from> <to> --json")]},intelligenceChain:{schemaVersion:h$1.schemaVersion,contractPath:h$1.contractPath,currentStep:"context",canonicalReadOrder:[...h$1.consumers.agents.canonicalReadOrder]},workspace:{name:t.workspace.name,root:t.workspace.root,type:t.identity.workspaceType,...t.workspace.profile?{profile:t.workspace.profile}:{}},scope:{requested:e$1.scope??"workspace",...r?{activeProject:r.name}:{}},projects:_,safeCommands:j,facts:b$1,factFreshness:f$1,evidence:u,policies:{mode:t.policies.mode,source:t.policies.source},contracts:{exists:t.contracts.exists,path:t.contracts.workspaceContractPath},validation:c$1,agentInstructions:[`Read \`${e.agentIndex}\` first, then this context pack and linked evidence reports.`,"Use `workspace graph search <query> --limit 12 --json` for bounded, proof-backed retrieval before loading the full graph.",`Load \`${e.knowledgeGraph}\` only when a complete graph export is explicitly required.`,"Use this context as the workspace source of truth before inspecting random files.","Prefer workspace-level evidence over generic framework assumptions.","Use `display` commands when explaining steps to a human.","Use `execute` commands when launching commands from automation or tooling.","Treat `facts[].freshness.verifyBeforeUse` as a hard refresh requirement before using that fact in advice, fixes, or release decisions.","Do not carry extracted facts beyond their freshness contract; re-read or regenerate evidence when the contract says stale, unknown, live, or verify-before-use.","Keep project-scoped advice tied to the active project scope.","Regenerate stale grounding with `npx workspai workspace agent-sync --write --refresh-context`."],unsafeAssumptions:[...J(t),...f$1.verifyBeforeUseFacts>0?[`${f$1.verifyBeforeUseFacts} fact(s) require verification before use; do not treat them as durable workspace structure.`]:[]],humanSummary:[v,`Evidence available: ${u.available.length}. Missing evidence groups: ${u.missing.join(", ")||"none"}.`,r?`Active project scope: ${r.name} (${r.frameworkDisplayName}).`:"Scope: whole workspace."].join(`
|
|
2
2
|
`)}}async function de(e,t){return e$1(t,V,a(e))}export{G as a,V as b,pe as c,de as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b,c as c$2}from'./chunk-QK5QOXOE.js';import {a as a$1}from'./chunk-YM77FQB3.js';import {r as r$1}from'./chunk-TTFQWH55.js';import {a as a$2}from'./chunk-N2BIIUDH.js';import {g}from'./chunk-IUYZ3NHS.js';import {j as j$1,e as e$2}from'./chunk-GBMCHFOV.js';import {j,l as l$2}from'./chunk-RPHM7LQW.js';import {c as c$1,d}from'./chunk-VUR7H2FU.js';import {a}from'./chunk-UQEQ6CXU.js';import {f as f$1,g as g$1,h as h$2}from'./chunk-6OFGLNFS.js';import {k,l as l$1,h as h$1,m as m$1,n,p as p$2,q}from'./chunk-QHY6F4SS.js';import {m,p as p$1,s}from'./chunk-GXTCU4WF.js';import {l,o as o$1,p as p$3}from'./chunk-SNO3WG4V.js';import {c,e as e$1}from'./chunk-ADL3CK44.js';import {b as b$1}from'./chunk-LYVDRRDO.js';import {e,f,o,p,n as n$1,m as m$2}from'./chunk-5EPPPMAS.js';import {d as d$1}from'./chunk-VRW6KXNK.js';import ue from'path';import de from'fs-extra';function r(t,s){if(!t)throw new Error(`Workspace Intelligence run semantic violation: ${s}`)}function ce(t,s){return t.length===s.length&&t.every((g,u)=>g===s[u])}function le(t){b$1(e.intelligenceRun,t,"Workspace Intelligence run report"),r(t.chainSchemaVersion===a,`chainSchemaVersion must be ${a}`),r(t.artifactPath===e.intelligenceRun,`artifactPath must be ${e.intelligenceRun}`),r(t.preflight.length===n$1.length,`preflight must contain exactly ${n$1.length} entries`);for(let[l,n]of n$1.entries()){let a=t.preflight[l];r(a?.id===n,`preflight[${l}].id must be ${n}`),r(ce(a.artifacts,o[n]),`${n} preflight artifacts must match the runtime registry`),n==="sync"?r(a.status==="passed"&&a.result==="synchronized"||a.status==="failed"&&a.result==="failed","sync preflight status and result are incoherent"):r(a.status==="passed"&&(a.result==="created"||a.result==="reused")||a.status==="failed"&&a.result==="failed"||a.status==="skipped"&&a.result==="skipped","baseline preflight status and result are incoherent");}let s=t.preflight[1];r(t.baselineCreated===(s?.result==="created"),"baselineCreated must match the baseline preflight result"),r(t.stages.length===m$2.length,`stages must contain exactly ${m$2.length} canonical steps`);let g=t.preflight[0],u=g?.status==="failed";for(let[l,n]of m$2.entries()){let a=t.stages[l];r(a?.id===n,`stages[${l}].id must be ${n}`),r(ce(a.artifacts,p[n].produces),`${n} artifacts must match the runtime registry`),u&&r(a.status==="skipped",`${n} must be skipped after a hard failure`),a.status==="passed"?r(a.exitCode===0,`${n} passed stage must have exitCode 0`):a.status==="blocked"?r(a.exitCode!==0,`${n} blocked stage must have a non-zero exitCode`):a.status==="failed"?(r(a.exitCode===1,`${n} failed stage must have exitCode 1`),u=true):(r(a.exitCode===0,`${n} skipped stage must have exitCode 0`),r(a.durationMs===0,`${n} skipped stage must have durationMs 0`)),l===0&&((g?.status==="failed"||a.status==="failed")&&r(s?.status==="skipped","baseline must be skipped when sync or model fails"),s?.status==="skipped"&&r(g?.status==="failed"||a.status==="failed"||a.status==="skipped","baseline may be skipped only after an upstream failure"),s?.status!=="passed"&&(u=true));}let m=t.preflight.some(l=>l.status==="failed")||t.stages.some(l=>l.status==="failed"),y=t.stages.some(l=>l.status==="blocked"),c=m?"failed":y?"blocked":"passed",f=c==="failed"?1:c==="blocked"?2:0;r(t.status===c,`status must be ${c}`),r(t.exitCode===f,`exitCode must be ${f}`);}var he=e.intelligenceRun,Ie=f.intelligenceRun,x=he;function h(t){d$1({action:"intelligence",status:t.status==="started"?"started":t.status==="passed"?"succeeded":t.status==="failed"?"failed":"warn",message:t.message,metadata:{phase:`workspace.intelligence.${t.kind}.${t.id}`,intelligenceMilestoneId:t.id,intelligenceMilestoneKind:t.kind,intelligenceMilestoneStatus:t.status}});}async function ze(t){let s=ue.resolve(t.workspacePath);return c(s,x,()=>Ee({...t,workspacePath:s}),{timeoutMs:15*6e4,staleAfterMs:3e4})}async function Ee(t){let s$1=t.workspacePath,g$2=[],u=[],m$2=false,y=async(e,i)=>{let o$1=[...o[e]];if(m$2){h({id:e,kind:"preflight",status:"skipped",message:`${e} prerequisite skipped after an upstream failure`}),g$2.push({id:e,status:"skipped",result:"skipped",durationMs:0,artifacts:o$1,message:"skipped because a required upstream operation failed"});return}let I=Date.now();h({id:e,kind:"preflight",status:"started",message:`${e} prerequisite started`});try{let d=await i();h({id:e,kind:"preflight",status:"passed",message:d.message}),g$2.push({id:e,status:"passed",result:d.result,durationMs:Date.now()-I,artifacts:o$1,message:d.message});}catch(d){m$2=true;let k=d instanceof Error?d.message:String(d);h({id:e,kind:"preflight",status:"failed",message:k}),g$2.push({id:e,status:"failed",result:"failed",durationMs:Date.now()-I,artifacts:o$1,message:k});}},c=async(e,i)=>{let o=[...p[e].produces];if(m$2){h({id:e,kind:"stage",status:"skipped",message:`${e} skipped after an upstream failure`}),u.push({id:e,status:"skipped",durationMs:0,artifacts:o,exitCode:0,message:"skipped because a required upstream stage failed"});return}let I=Date.now();h({id:e,kind:"stage",status:"started",message:`${e} started`});try{let d=await i(),k=d.exitCode??0,_=d.blocked||k!==0?"blocked":"passed";h({id:e,kind:"stage",status:_,message:d.message}),u.push({id:e,status:_,durationMs:Date.now()-I,artifacts:o,exitCode:k,message:d.message});}catch(d){m$2=true;let k=d instanceof Error?d.message:String(d);h({id:e,kind:"stage",status:"failed",message:k}),u.push({id:e,status:"failed",durationMs:Date.now()-I,artifacts:o,exitCode:1,message:k});}};await y("sync",async()=>{let e=await g(s$1,true),i=await l({workspacePath:s$1});return {result:"synchronized",message:`registry ${e.added.length} added/${e.skipped} existing; contract ${i.contract.projects.length} projects`}});let f,l$3=()=>{if(!f)throw new Error("canonical workspace model is unavailable");return f};await c("model",async()=>(f={...await p$1({workspacePath:s$1,includeEvidence:true}),build:m({mode:"full",engineStatus:"disabled"})},await s(f,s$1),{message:`${f.summary.projectCount} projects modeled`}));let n$1=ue.join(s$1,e.snapshot),a$3=false;await y("baseline",async()=>{if(!await de.pathExists(n$1)){let o=await k({workspacePath:s$1,model:l$3()});return await l$1(o,s$1),a$3=true,{result:"created",message:"initial structural baseline created"}}let e=await de.readJson(n$1),i=h$1(e);return i?(await l$1(i,s$1),{result:"reused",message:"legacy structural baseline migrated and reused"}):{result:"reused",message:"existing structural baseline reused"}}),await c("diff",async()=>{let e$1=await m$1({workspacePath:s$1,fromPath:e.snapshot,model:l$3()});return await n(e$1,s$1),{message:e$1.summary.changed?"workspace changes detected":"no workspace changes"}}),await c("impact",async()=>{let e$1=await p$2({workspacePath:s$1,fromPath:e.diff});return await q(e$1,s$1),{message:`${e$1.summary.risk} risk; ${e$1.summary.affectedProjects} affected`}}),await c("doctor-evidence",async()=>{let e=await r$1({workspace:s$1,json:true,quiet:true,profile:t.strict===true?"enterprise-strict":"local"});return {exitCode:e,blocked:e!==0,message:`doctor exit ${e}`}}),await c("contract-evidence",async()=>{let e=await o$1({workspacePath:s$1,strict:true});return await p$3({workspacePath:s$1,result:e}),{exitCode:e.status==="passed"?0:1,blocked:e.status!=="passed",message:`contract ${e.status}`}}),await c("analyze-evidence",async()=>{let e=await a$1({workspacePath:s$1,json:true,strict:t.strict===true});return {blocked:e.summary.verdict==="blocked"||t.strict===true&&e.summary.verdict==="needs-attention",exitCode:e.summary.verdict==="blocked"||t.strict===true&&e.summary.verdict==="needs-attention"?1:0,message:`analyze ${e.summary.verdict} (${e.summary.score}/100)`}}),await c("readiness-evidence",async()=>{let e=await a$2({startPath:s$1,writeReport:true,skipVerify:true});return {blocked:e.overallStatus==="fail"||t.strict===true&&e.overallStatus==="warn",exitCode:e.overallStatus==="fail"||t.strict===true&&e.overallStatus==="warn"?1:0,message:`pre-verify readiness ${e.overallStatus}`}}),await c("verify",async()=>{let e$1=await f$1({workspacePath:s$1,fromImpactPath:e.impact});await g$1(e$1,s$1);let i=h$2(e$1,{strict:t.strict===true});return await j$1(s$1,e$2(e$1,i.passed)),{blocked:!i.passed,exitCode:i.exitCode,message:`${e$1.summary.verdict}; gate ${i.passed?"passed":"blocked"}`}}),await c("context",async()=>{let e=await c$1({workspacePath:s$1,model:l$3(),agent:t.agent??"generic",includeEvidence:true});return await d(e,s$1),{message:`context grounded for ${e.agent}`}}),await c("agent-sync",async()=>{let e=await l$2({workspacePath:s$1,agent:t.agent??"generic",write:true,refreshContext:false,strict:t.strict===true,preset:"enterprise"}),i=e.strictViolations??[],o=t.strict===true&&i.length>0;return {blocked:o,exitCode:o?2:0,message:o?`${e.writtenFiles.length} grounding files written; ${i.length} strict grounding violation(s): ${i.join("; ")}`:`${e.writtenFiles.length} grounding files written`}}),await c("explain",async()=>{let e=await b({workspacePath:s$1,target:{kind:"release-blocked"}});await c$2(e,s$1);let i=t.strict===true?u.filter(o=>o.status==="blocked").map(o=>o.id):[];return {message:i.length>0&&e.blocking!==true?`Strict policy blocked advisory or incomplete evidence in ${i.join(", ")}. ${e.summary}`:e.summary}});let pe=u.some(e=>e.status==="blocked"),A=m$2?"failed":pe?"blocked":"passed",ge=m$2?1:A==="blocked"?2:0,R={schemaVersion:Ie,chainSchemaVersion:a,generatedAt:new Date().toISOString(),workspacePath:s$1,baselineCreated:a$3,preflight:g$2,status:A,exitCode:ge,stages:u,artifactPath:x};le(R),await e$1(s$1,x,R);let me=await j({workspacePath:s$1});return await e$1(s$1,e.agentIndex,me),R}export{he as a,Ie as b,ze as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1,c,j,i,g,h}from'./chunk-ZCPT6KC3.js';import {t,u}from'./chunk-MOSXTVPU.js';import B from'fs';import a from'path';import k from'fs-extra';var Z=[{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,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,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,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,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,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,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,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,stability:"preview",versionPolicy:"tested-baseline",generator:"rust-axum",createUsage:"workspai create project rust.axum <name> [--port <number>] [--output <dir>] [--skip-git]"}],K=new Map;for(let e of Z){K.set(e.id.toLowerCase(),e);for(let t of e.aliases)K.set(t.toLowerCase(),e);}function _(e){return e?K.get(e.trim().toLowerCase())??null:null}function Ze(e){return _(e)?.id??e}function et(){return Z.filter(e=>e.owner==="core"||e.generator)}function tt(e){return _(e)?.owner==="npm"}async function rt(e,t){if(!e.generator)throw new Error(`Kit is not backed by an npm generator: ${e.id}`);if(e.generator==="gofiber"){let{generateGoFiberKit:r}=await import('./gofiber-standard-AQGSC7ON.js');await r(t.projectPath,{project_name:t.projectName,module_path:t.projectName,skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="gogin"){let{generateGoGinKit:r}=await import('./gogin-standard-7DU3OCBX.js');await r(t.projectPath,{project_name:t.projectName,module_path:t.projectName,skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="springboot"){let{generateSpringBootKit:r}=await import('./springboot-standard-EK6GYN5T.js');await r(t.projectPath,{project_name:t.projectName,artifact_id:t.projectName,java_version:m(t.args,"--java-version")?.trim(),spring_boot_version:m(t.args,"--spring-boot-version")?.trim(),springdoc_version:m(t.args,"--springdoc-version")?.trim(),group_id:m(t.args,"--group-id")?.trim(),package_name:m(t.args,"--package-name")?.trim(),description:m(t.args,"--description")?.trim(),port:m(t.args,"--port")?.trim(),skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="dotnet-webapi-clean"){let{generateDotnetWebApiCleanKit:r}=await import('./dotnet-webapi-clean-VXEF4SHM.js');await r(t.projectPath,{project_name:t.projectName,target_framework:m(t.args,"--target-framework")?.trim(),root_namespace:m(t.args,"--root-namespace")?.trim(),description:m(t.args,"--description")?.trim(),port:m(t.args,"--port")?.trim(),skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="rust-axum"){let{generateRustAxumKit:r}=await import('./rust-axum-4HXDICIB.js');await r(t.projectPath,{project_name:t.projectName,description:m(t.args,"--description")?.trim(),port:m(t.args,"--port")?.trim(),skipGit:t.skipGit,skipInstall:t.skipInstall});return}throw new Error(`Unhandled npm kit generator: ${e.generator}`)}function m(e,t){let r=e.indexOf(t);if(r>=0&&r+1<e.length)return e[r+1];let n=e.find(i=>i.startsWith(`${t}=`));return n?n.slice(t.length+1):void 0}var y=["init","dev","start","build","test","lint","format","help"],ee={python:{runtime:"python",displayName:"Python",tier:"first-class",scaffoldSupport:true,importSupport:true,lifecycleCommands:y,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:y,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:y,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:y,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:y,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:y,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:y,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:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Bun projects are importable and governed as observed projects until a kit exists."]},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."]}},Ce=["fastapi","nestjs"],ke=["django","flask","nextjs","remix","nuxt","react","vite","vue","sveltekit","svelte","angular","astro","solid","express","fastify","koa","echo","gofiber","gogin","springboot","dotnet","laravel","symfony","rails","sinatra","actix","axum","rocket","phoenix","clojure","scala","kotlin","deno","bun","tauri","electron","vscode-extension","c","cpp"];function x(e){return ee[e||"unknown"]??ee.unknown}function te(e){return Ce.includes(e)?"first-class":ke.includes(e)?"extended":"observed"}function re(e){let t=x(e.runtime);return {lifecycleCommands:t.lifecycleCommands,moduleCommands:e.moduleSupport&&t.moduleCommands,unsupportedLifecycleCommands:y.filter(r=>!t.lifecycleCommands.includes(r))}}var Se=["python","node","go","java","dotnet","rust","php"];function w(e){return !!e&&Se.includes(e)}function A(e,t){return t!=="lint"&&t!=="format"&&t!=="docs"?false:e==="python"}function ne(e){let t=x(e),r=w(t.runtime),n=je[t.runtime]??[],i=we[t.runtime]??[];return {runtime:t.runtime,displayName:t.displayName,lifecycleCommands:t.lifecycleCommands,hasExecutor:r,packageManagers:n,primaryFiles:i,notes:t.notes}}var je={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"]},we={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"]};function v(e,t){let r=g({runtime:typeof e?.runtime=="string"?e.runtime:void 0,framework:typeof e?.framework=="string"?e.framework:void 0,kitName:typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:void 0});return r.runtime!=="unknown"?r.runtime:j(t,e).runtime}function ie(e){let t$1=e;for(;;){for(let n of t(t$1,"project.json"))if(B.existsSync(n))try{return JSON.parse(B.readFileSync(n,"utf8"))}catch{return null}let r=a.dirname(t$1);if(r===t$1)break;t$1=r;}return null}function ft(e,t){return v(e,t)==="go"}function gt(e,t){return v(e,t)==="node"}function yt(e,t){return v(e,t)==="java"}function bt(e,t){return v(e,t)==="dotnet"}function Ct(e,t){return v(e,t)==="python"}var xe=["project.json","context.json","file-hashes.json"];async function Rt(e){let t=a.resolve(e),r=[];for(let n of xe){let i=u(t,n);if(await k.pathExists(i))continue;let c=a.join(t,".rapidkit",n);if(!await k.pathExists(c))continue;let C=await k.readJson(c);await k.ensureDir(a.dirname(i));let S=`${i}.${process.pid}.${Date.now()}.tmp`;try{await k.writeJson(S,C,{spaces:2}),await k.move(S,i,{overwrite:false}),r.push(i);}finally{await k.remove(S).catch(()=>{});}}return r}function ve(e){for(let t$1 of t(e,"context.json"))if(B.existsSync(t$1))try{return JSON.parse(B.readFileSync(t$1,"utf8"))}catch{return null}return null}function Ne(e){let t=e?.engine;return t==="npm"||t==="pip"||t==="python"?t:"unknown"}function Pe(e,t){if(e?.module_support===false||t?.module_support===false||!e&&t)return false;let r=typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:typeof t?.kit=="string"?t.kit:void 0,n=r?_(r):void 0;return n?.owner==="core"&&n.moduleSupport===true}function Re(e,t,r){let n=g({runtime:typeof t?.runtime=="string"?t.runtime:typeof r?.runtime=="string"?r.runtime:void 0,framework:typeof t?.framework=="string"?t.framework:typeof r?.framework=="string"?r.framework:void 0,kitName:typeof t?.kit_name=="string"?t.kit_name:typeof t?.kit=="string"?t.kit:typeof r?.kit=="string"?r.kit:void 0});return n.key!=="unknown"?n:j(e,t)}function ae(e){let t$1=a.resolve(e);if(![...t(t$1,"project.json"),...t(t$1,"context.json")].some(C=>B.existsSync(C)))return null;let n=ie(t$1),i=ve(t$1),c=Re(t$1,n,i);return {projectRoot:t$1,projectJson:n,contextJson:i,detection:c,moduleSupport:Pe(n,i),engine:Ne(i)}}var Ee=["build","dev","start","test","lint","format"],G=["init","test","build","start"],_t=["lint","format","docs"];function At(e){return !!e&&Ee.includes(e)}var Me={dev:["dev","start:dev"],start:["start","start:prod","preview"],build:["build"],test:["test","test:unit","test:ci"],lint:["lint"],format:["format","prettier"]},ce={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 _e(e){let t=a.join(e,"package.json");if(!B.existsSync(t))return {};try{let n=JSON.parse(B.readFileSync(t,"utf8")).scripts??{};return Object.fromEntries(Object.entries(n).filter(i=>typeof i[1]=="string"))}catch{return {}}}function Ae(e,t){let r=t?c(t):"unknown",n=r!=="unknown"?a$1(r,e):[],i=t?ce[t]?.[e]??[]:[],c$1=Me[e]??[],C=[...n,...i,...c$1];return [...new Set(C)]}function me(e,t,r){let n=_e(e),i=new Set(Object.keys(n));if(i.has(t))return {scriptName:t,source:"package.json"};for(let c$1 of Ae(t,r?.framework))if(i.has(c$1))return {scriptName:c$1,source:a$1(c(r?.framework??"unknown"),t).includes(c$1)||ce[r?.framework??""]?.[t]?.includes(c$1)?"framework-candidate":"generic-candidate"};return null}function W(e){return B.existsSync(a.join(e,"package.json"))}function de(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 s(e){try{return B.existsSync(e)}catch{return false}}function b(e){try{return s(e)?B.readFileSync(e,"utf8"):""}catch{return ""}}function f(e,t){let r=b(a.join(e,"Makefile"));return r?new RegExp(`^${t}\\s*:`).test(r):false}function Fe(e){let t=[e];for(;t.length>0;){let r=t.shift();if(!r)break;let n=[];try{n=B.readdirSync(r,{withFileTypes:true});}catch{continue}for(let i of n){if(i.name==="node_modules"||i.name===".git"||i.name==="dist")continue;let c=a.join(r,i.name);if(i.isFile()&&i.name.endsWith(".csproj"))return true;i.isDirectory()&&t.push(c);}}return false}function le(e,t){let r=s(a.join(e,"pyproject.toml")),n=s(a.join(e,"requirements.txt"))||s(a.join(e,"requirements.in")),i=s(a.join(e,"manage.py"));switch(t){case "init":return r||n;case "dev":case "start":return r||i||n;case "test":return r||n||s(a.join(e,"tests"));case "build":return r||n;case "lint":case "format":return r||n||i||s(a.join(e,"setup.py"))||s(a.join(e,"setup.cfg"));default:return false}}function Le(e,t){if(!s(a.join(e,"go.mod")))return false;switch(t){case "init":return true;case "dev":return f(e,"run")||s(a.join(e,"main.go"));case "test":return true;case "build":return true;case "start":return f(e,"run")||s(a.join(e,"main.go"))||s(a.join(e,"cmd"));case "lint":return s(a.join(e,".golangci.yml"))||s(a.join(e,".golangci.yaml"))||f(e,"lint");case "format":return f(e,"fmt")||f(e,"format");default:return false}}function De(e,t){let r=s(a.join(e,"pom.xml")),n=s(a.join(e,"build.gradle"))||s(a.join(e,"build.gradle.kts"));if(!r&&!n)return false;switch(t){case "init":case "test":case "build":case "dev":case "start":return true;case "lint":return f(e,"lint")||b(a.join(e,"pom.xml")).includes("checkstyle")||b(a.join(e,"build.gradle")).includes("checkstyle")||b(a.join(e,"build.gradle.kts")).includes("checkstyle");case "format":return f(e,"format")||b(a.join(e,"build.gradle")).includes("spotless")||b(a.join(e,"build.gradle.kts")).includes("spotless");default:return false}}function Oe(e,t){if(!Fe(e))return false;switch(t){case "init":case "dev":case "test":case "build":case "start":return true;case "lint":return f(e,"lint")||b(a.join(e,"Directory.Build.props")).includes("EnforceCodeStyleInBuild");case "format":return f(e,"format")||s(a.join(e,".editorconfig"));default:return false}}function Te(e,t,r){return t==="init"?W(e):me(e,t,{framework:r})!==null}function Ie(e,t,r){switch(t){case "php":return r==="init"&&s(a.join(e,"composer.json"));case "ruby":return r==="init"&&s(a.join(e,"Gemfile"));case "rust":return s(a.join(e,"Cargo.toml"))?r==="init"||r==="test"||r==="build"||r==="start":false;case "elixir":return r==="init"&&s(a.join(e,"mix.exs"));case "deno":return s(a.join(e,"deno.json"))||s(a.join(e,"deno.jsonc"))?r==="init"||r==="dev"||r==="test"||r==="start":r==="init"&&s(a.join(e,"package.json"));case "bun":return s(a.join(e,"bunfig.toml"))||s(a.join(e,"bun.lock"))?r==="init"||r==="dev"||r==="test"||r==="build"||r==="start":r==="init"&&s(a.join(e,"package.json"));default:return false}}function Ke(e){try{let t=JSON.parse(b(a.join(e,"composer.json")));return new Set(Object.keys(t.scripts??{}))}catch{return new Set}}function Be(e,t){if(!s(a.join(e,"composer.json")))return false;let r=Ke(e),n=s(a.join(e,"artisan"));switch(t){case "init":return true;case "dev":return n||r.has("dev");case "start":return n||r.has("start");case "test":return n||r.has("test");case "build":return r.has("build");case "lint":return r.has("lint")||r.has("analyse")||r.has("analyze");case "format":return r.has("format")||r.has("fmt")||s(a.join(e,"pint.json"))||s(a.join(e,"vendor","bin","pint"));default:return false}}function Ge(e,t){return s(a.join(e,"Cargo.toml"))?t==="init"||t==="dev"||t==="start"||t==="build"||t==="test"||t==="lint"||t==="format":false}function L(e,t,r,n){if(A(t,r))return le(e,r);if(!w(t))return Ie(e,t,r);switch(t){case "node":return Te(e,r,n);case "python":return le(e,r);case "go":return Le(e,r);case "java":return De(e,r);case "dotnet":return Oe(e,r);case "rust":return Ge(e,r);case "php":return Be(e,r);default:return false}}function Ue(e,t,r){return ["init","dev","start","build","test","lint","format"].filter(i=>L(e,t,i,r))}function pe(e){let t=re({runtime:e.runtime,moduleSupport:e.moduleSupport});if(!e.projectPath)return t;let r=Ue(e.projectPath,e.runtime,e.framework),n=new Set(["help"]);for(let c of r)t.lifecycleCommands.includes(c)&&n.add(c);e.runtime==="node"&&W(e.projectPath)&&n.add("init");let i=[...n].sort();return {lifecycleCommands:i,moduleCommands:t.moduleCommands,unsupportedLifecycleCommands:t.lifecycleCommands.filter(c=>!i.includes(c)).sort()}}var q=["version","commands","doctor","project","help"],P=["init","dev","start","build","test","lint","format"],Y=["add","modules","upgrade","diff","merge","reconcile","rollback","uninstall","checkpoint","snapshot","optimize"],H=["create","list","info","frameworks","license"];q.filter(e=>e!=="help");function $e(e){let t$1=a.resolve(e);for(;;){if([...t(t$1,"project.json"),...t(t$1,"context.json")].some(i=>B.existsSync(i)))return t$1;let n=a.dirname(t$1);if(n===t$1)break;t$1=n;}return null}function N(e,t){return {command:e,...t}}var Je=new Set(["dev","lint","format"]),qe=new Set(G);function Ye(e,t){return t?qe.has(e)?{executionScope:"fleet",fleetEligible:true}:Je.has(e)?{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}}function He(e,t){return A(t.runtime,e)?"core":"runtime"}function ze(e,t,r,n){return !e||!n.lifecycleCommands.includes(t)?false:L(e,r.runtime,t,r.key)}function Ve(e,t){let r=!!e&&(t.runtime==="python"||w(t.runtime)&&L(e,t.runtime,"build",t.key));return N("docs",{owner:t.runtime==="python"?"core":"runtime",status:r?"supported":"unsupported",reason:r?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 Xe(e){let t=a.resolve(e),r=$e(e);return r||(h(t).length>0?t:null)}function Qe(e=process.cwd()){let t=Xe(e),r=t?ae(t):null,n=r?.detection??j(e,r?.projectJson??null),i$1=r?.moduleSupport??false,c=r?.engine??"unknown",C=de(n.runtime),S=x(n.runtime),fe=t?i(t):[],h=[n.runtime,...fe.filter(o=>o!==n.runtime)].filter((o,d,E)=>o!=="unknown"&&E.indexOf(o)===d);h.length===0&&h.push("unknown");let D=h.filter(o=>o!=="unknown").length>1,ge=pe({runtime:n.runtime,moduleSupport:i$1,projectPath:t??void 0,framework:n.key}),g={};for(let o of q)g[o]=N(o,{owner:o==="project"?"core":"npm",status:"supported",reason:o==="project"?"Project detection is a Core contract; workspace project lifecycle remains npm-owned.":o==="help"?"Help is available for every Workspai project through the npm CLI.":"Universal command available across Workspai project types."});for(let o of P){let d=ze(t,o,n,ge),E=He(o,n),O=Ye(o,d);g[o]=N(o,{owner:E,status:d?"supported":"unsupported",executionScope:O.executionScope,fleetEligible:O.fleetEligible,reason:d?E==="core"?`Delegated to Python Core for ${n.displayName} projects.`:O.fleetEligible?`Handled by runtime adapter and eligible for workspace fleet stages (${o}).`:o==="dev"?"Local development command only; workspace fleet excludes dev by design.":n.runtime==="node"?`Handled by npm/pnpm/yarn via the resolved ${o} script in package.json.`:`Handled by the ${C?.displayName??n.displayName} runtime adapter for local project execution.`:t?n.runtime==="node"?`No ${o} script was found in package.json for this ${n.displayName} project.`:w(n.runtime)?`The ${n.displayName} runtime is tracked, but ${o} is not available from detected project manifests.`:`${n.displayName} is tracked as an observed runtime; ${o} requires project manifests or explicit scripts.`:"No Workspai project was detected."});}if(D)for(let o of P){let d=g[o];d&&(d.reason=`Composite runtime boundary detected (${h.join(", ")}). This capability describes only the primary ${n.runtime} adapter; nested runtime lifecycle coverage requires explicit project boundaries or command contracts. ${d.reason??""}`.trim());}g.docs=Ve(t,n);for(let o of Y)g[o]=N(o,{owner:i$1?"core":"none",status:i$1?"supported":"unsupported",reason:i$1?"Core module/template command supported for this project.":`Core module/template commands are not available for ${n.displayName} projects.`});for(let o of H)g[o]=N(o,{owner:o==="create"?"npm":"core",status:"global",reason:o==="create"?"Create is orchestrated by npm for multi-language workspace support.":"Engine catalog command; not specific to the selected project runtime."});let R=Object.values(g),z=R.filter(o=>P.includes(o.command)).filter(o=>o.status==="supported"),ye=G.filter(o=>z.some(d=>d.fleetEligible===true&&d.command===o)),be=z.filter(o=>o.executionScope==="local-only").map(o=>o.command).sort();return {schemaVersion:1,scope:"project",projectRoot:t,engine:c,runtime:n.runtime,runtimeCandidates:h,compositeRuntime:D,lifecycleCoverage:D?"primary-runtime-only":"complete",framework:n.key,frameworkDisplayName:n.displayName,frameworkConfidence:n.confidence,frameworkSupportTier:te(n.key),runtimeSupportTier:S.tier,runtimeDoctorSupport:S.doctorSupport,moduleSupport:i$1,fleetStages:ye,localOnlyCommands:be,commandMap:g,supportedCommands:R.filter(o=>o.status==="supported").map(o=>o.command).sort(),unsupportedCommands:R.filter(o=>o.status==="unsupported").map(o=>o.command).sort(),globalCommands:R.filter(o=>o.status==="global").map(o=>o.command).sort()}}function pr(e,t=process.cwd()){let r=e[0];return r?Qe(t).commandMap[r]??null:null}function ur(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(`
|
|
2
|
+
`)}export{_ as a,Ze as b,et as c,tt as d,rt as e,x as f,te as g,w as h,ie as i,ft as j,gt as k,yt as l,bt as m,Ct as n,Rt as o,ae as p,Ee as q,_t as r,At as s,me as t,pe as u,$e as v,Qe as w,pr as x,ur as y,fr as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,l}from'./chunk-
|
|
1
|
+
import {f,l}from'./chunk-GXTCU4WF.js';import {a,b}from'./chunk-S5KTATOU.js';function u(r){let s=new Map;for(let n of r.projects)s.has(n.name)||s.set(n.name,f(n));return s}function w(r){let s=u(r),n=l(r)??{nodes:r.projects.map(t=>({id:t.name,path:t.path})),edges:[]},a$1=a(n),o=new Map;for(let t of n.nodes){let e=s.get(t.id)??f({missing:t.id}),l=[...b(a$1,[t.id],{direction:"dependencies"}).keys()].filter(c=>c!==t.id).sort((c,f)=>c.localeCompare(f)).map(c=>({id:c,hash:s.get(c)??"<unknown>"}));o.set(t.id,{id:t.id,ownHash:e,transitiveInputsHash:f({own:e,dependencies:l})});}return o}function y(r,s){if(!s||Object.keys(s).length===0)return {verdict:"unknown",baseline:"none",changed:[],added:[],removed:[]};let n=[],a=[];for(let[e,i]of r.entries())e in s?s[e]!==i.transitiveInputsHash&&n.push(e):a.push(e);let o=[];for(let e of Object.keys(s))r.has(e)||o.push(e);return n.sort((e,i)=>e.localeCompare(i)),a.sort((e,i)=>e.localeCompare(i)),o.sort((e,i)=>e.localeCompare(i)),{verdict:n.length>0||a.length>0||o.length>0?"stale":"fresh",baseline:"recorded",changed:n,added:a,removed:o}}function M(r){let s={};for(let[n,a]of [...r.entries()].sort((o,t)=>o[0].localeCompare(t[0])))s[n]=a.transitiveInputsHash;return s}export{u as a,w as b,y as c,M as d};
|
|
@@ -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-
|
|
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-P475BOJW.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as DOCTOR_WORKSPACE_REPORT_PATH,n as applyEnvKeyAddFix,j as applyFileAppendFix,k as applyFileCopyFix,i as applyFileCreateFix,m as applyJsonEditFix,o as applyMakefileTargetFix,h as applyPackageScriptFix,f as assertOperationPathInsideProject,g as assertOperationPathInsideProjectResolved,e as buildRepairOperationIdentity,q as computeDoctorFixAwareExitCode,p as computeDoctorGateExitCode,l as decodeJsonPointerSegment,d as parseInternalRepairCommand,c as parsePackageScriptFix,b as resolveDoctorPolicyProfile,r as runDoctor}from'./chunk-
|
|
1
|
+
export{a as DOCTOR_WORKSPACE_REPORT_PATH,n as applyEnvKeyAddFix,j as applyFileAppendFix,k as applyFileCopyFix,i as applyFileCreateFix,m as applyJsonEditFix,o as applyMakefileTargetFix,h as applyPackageScriptFix,f as assertOperationPathInsideProject,g as assertOperationPathInsideProjectResolved,e as buildRepairOperationIdentity,q as computeDoctorFixAwareExitCode,p as computeDoctorGateExitCode,l as decodeJsonPointerSegment,d as parseInternalRepairCommand,c as parsePackageScriptFix,b as resolveDoctorPolicyProfile,r as runDoctor}from'./chunk-TTFQWH55.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ type ProjectGroundingMode = (typeof PROJECT_GROUNDING_MODE_VALUES)[number];
|
|
|
14
14
|
interface AdoptProjectFilePreimage {
|
|
15
15
|
path: string;
|
|
16
16
|
contents: Buffer | null;
|
|
17
|
+
preserve?: 'symbolic-link';
|
|
17
18
|
}
|
|
18
19
|
interface AdoptProjectRollbackSnapshot {
|
|
19
20
|
workspacePath: string;
|
|
@@ -48,6 +49,7 @@ declare function getPublishedContractVersions(): {
|
|
|
48
49
|
workspaceArchiveOperationResult: "workspai-workspace-archive-operation-result-v1";
|
|
49
50
|
ingestionPlan: "workspai.ingestion-plan.v1";
|
|
50
51
|
ingestionResult: "workspai.ingestion-result.v1";
|
|
52
|
+
adoptEffects: "workspai.adopt-effects.v1";
|
|
51
53
|
projectEntryCapability: string;
|
|
52
54
|
projectWorkspaceLink: "project-workspace-link.v1";
|
|
53
55
|
projectWorkspaceResolution: "project-workspace-resolution.v1";
|
|
@@ -246,6 +248,7 @@ declare function getVersionContract(): {
|
|
|
246
248
|
workspaceArchiveOperationResult: "workspai-workspace-archive-operation-result-v1";
|
|
247
249
|
ingestionPlan: "workspai.ingestion-plan.v1";
|
|
248
250
|
ingestionResult: "workspai.ingestion-result.v1";
|
|
251
|
+
adoptEffects: "workspai.adopt-effects.v1";
|
|
249
252
|
projectEntryCapability: string;
|
|
250
253
|
projectWorkspaceLink: "project-workspace-link.v1";
|
|
251
254
|
projectWorkspaceResolution: "project-workspace-resolution.v1";
|
|
@@ -438,6 +441,7 @@ declare function getGlobalCommandCapabilities(): {
|
|
|
438
441
|
workspaceArchiveOperationResult: "workspai-workspace-archive-operation-result-v1";
|
|
439
442
|
ingestionPlan: "workspai.ingestion-plan.v1";
|
|
440
443
|
ingestionResult: "workspai.ingestion-result.v1";
|
|
444
|
+
adoptEffects: "workspai.adopt-effects.v1";
|
|
441
445
|
projectEntryCapability: string;
|
|
442
446
|
projectWorkspaceLink: "project-workspace-link.v1";
|
|
443
447
|
projectWorkspaceResolution: "project-workspace-resolution.v1";
|