workspai 0.75.1 → 0.75.2
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/dist/analyze-6UEBC5OJ.js +1 -0
- package/dist/{artifact-remediation-plan-HD5K52UJ.js → artifact-remediation-plan-SRH2Q6N2.js} +1 -1
- package/dist/autopilot-release-H5TO6NYY.js +1 -0
- package/dist/chunk-2DZLCINC.js +1 -0
- package/dist/{chunk-W7I65IXY.js → chunk-3HXEPDFF.js} +2 -2
- package/dist/chunk-3N27P3KO.js +7 -0
- package/dist/{chunk-6NSJBKKK.js → chunk-3RNWBFRP.js} +1 -1
- package/dist/{chunk-2OCJKLTW.js → chunk-4JXJRIJM.js} +1 -1
- package/dist/chunk-5HNQIMGW.js +1 -0
- package/dist/chunk-5K4O3TAW.js +4 -0
- package/dist/{chunk-566NQQTJ.js → chunk-66O62XNJ.js} +49 -49
- package/dist/{chunk-SCKEFXF5.js → chunk-ADHX7D3F.js} +1 -1
- package/dist/chunk-DTNOF3MP.js +1 -0
- package/dist/{chunk-OH6LV5JP.js → chunk-E42IFQFR.js} +4 -4
- package/dist/{chunk-6B7L4NZE.js → chunk-EFHSRPW7.js} +6 -6
- package/dist/{chunk-NI5QWBZK.js → chunk-EP7SUMAX.js} +1 -1
- package/dist/chunk-EWD6QTAM.js +2 -0
- package/dist/{chunk-6KMR5PKQ.js → chunk-FNVWDXK2.js} +3 -3
- package/dist/{chunk-AICCXYY5.js → chunk-FZWLWFR4.js} +1 -1
- package/dist/chunk-G5UCEXP6.js +1 -0
- package/dist/{chunk-2CT5SN2L.js → chunk-GDOO2YZW.js} +1 -1
- package/dist/{chunk-2GWQ6NZV.js → chunk-IKBE3HOH.js} +1 -1
- package/dist/{chunk-4VSQNSGH.js → chunk-K52IQX3J.js} +1 -1
- package/dist/{chunk-UE7ART6X.js → chunk-KDVNRNDU.js} +1 -1
- package/dist/chunk-LARREYZN.js +1 -0
- package/dist/{chunk-HDISUL3F.js → chunk-LFY7KTPD.js} +1 -1
- package/dist/{chunk-RTD5D35M.js → chunk-P36TACKN.js} +1 -1
- package/dist/{chunk-NGZF4YJS.js → chunk-PFAGXI3G.js} +1 -1
- package/dist/chunk-ROOPODG6.js +2 -0
- package/dist/{chunk-5EEXLM45.js → chunk-SZHRPELL.js} +1 -1
- package/dist/{chunk-DJH2CH42.js → chunk-UHIN3RS6.js} +1 -1
- package/dist/{chunk-25V5XMWB.js → chunk-VWBWDDU2.js} +1 -1
- package/dist/chunk-VXFIMEC6.js +2 -0
- package/dist/{chunk-3WQ5TYCO.js → chunk-WHBKKJ7L.js} +1 -1
- package/dist/chunk-WXUCAVFT.js +681 -0
- package/dist/chunk-X7OI24LO.js +418 -0
- package/dist/{chunk-RPM67N7A.js → chunk-XHUM372O.js} +1 -1
- package/dist/{chunk-NRIMJMTF.js → chunk-ZGVODK5C.js} +8 -8
- package/dist/{create-P4XJVZCL.js → create-ZFSFWAW3.js} +1 -1
- package/dist/{demo-kit-ALW6OSQV.js → demo-kit-QNGY4KQ5.js} +1 -1
- package/dist/{doctor-PFN6KB6P.js → doctor-4KL4XUCS.js} +1 -1
- package/dist/{dotnet-webapi-clean-6Z4EXEJY.js → dotnet-webapi-clean-GXTNZMKO.js} +1 -1
- package/dist/{goal-lifecycle-BDWTWS55.js → goal-lifecycle-EXQZD7IA.js} +1 -1
- package/dist/{goal-pack-5JDNZFKV.js → goal-pack-DKJU2DEP.js} +1 -1
- package/dist/{gofiber-standard-TDJQIVQZ.js → gofiber-standard-PFBIAMGR.js} +1 -1
- package/dist/{gogin-standard-UEF3IHSJ.js → gogin-standard-DW5GL7YG.js} +1 -1
- package/dist/index.js +86 -85
- package/dist/{pipeline-OUYS4ZYV.js → pipeline-4GVAOCEN.js} +1 -1
- package/dist/{project-agent-entry-75WO3QWP.js → project-agent-entry-7QKNEEXP.js} +1 -1
- package/dist/{project-intelligence-lens-JCHFOIA7.js → project-intelligence-lens-IHRYCLNU.js} +1 -1
- package/dist/{proof-carrying-change-LAYV4LTI.js → proof-carrying-change-O37XUPIZ.js} +1 -1
- package/dist/{rust-axum-4TRVPFMB.js → rust-axum-L7UAYARA.js} +1 -1
- package/dist/{springboot-standard-COWL75GT.js → springboot-standard-CZH24KWD.js} +1 -1
- package/dist/verified-goal-XI4RQESU.js +1 -0
- package/dist/{workspace-CBQDOUSH.js → workspace-EYXAKMVI.js} +1 -1
- package/dist/{workspace-agent-sync-RTOTO3DY.js → workspace-agent-sync-SN55KT6N.js} +1 -1
- package/dist/{workspace-context-STRZO2N3.js → workspace-context-PW6ESEHH.js} +1 -1
- package/dist/{workspace-contract-PMHUUKFM.js → workspace-contract-FPLFL4G3.js} +1 -1
- package/dist/{workspace-explain-CATMJUMN.js → workspace-explain-TVQ5IF5D.js} +1 -1
- package/dist/{workspace-foundation-OULCDCXG.js → workspace-foundation-DWIJPZRH.js} +1 -1
- package/dist/{workspace-graph-stream-Q55CI4K4.js → workspace-graph-stream-RUTNWLQB.js} +1 -1
- package/dist/workspace-graph-token-efficiency-WF6TGSK7.js +1 -0
- package/dist/{workspace-intelligence-3RPZRWSF.js → workspace-intelligence-4CA2CSPZ.js} +1 -1
- package/dist/{workspace-intelligence-benchmark-R5MEGJQS.js → workspace-intelligence-benchmark-V6AEVDMB.js} +1 -1
- package/dist/{workspace-intelligence-runner-BNZUYUUN.js → workspace-intelligence-runner-VM5SXXAT.js} +1 -1
- package/dist/{workspace-knowledge-graph-VJLD35ES.js → workspace-knowledge-graph-JXN2ZOAF.js} +1 -1
- package/dist/workspace-knowledge-graph-query-BROIV27M.js +1 -0
- package/dist/workspace-knowledge-graph-snapshot-KBNUXA64.js +1 -0
- package/dist/{workspace-mcp-serve-67NTYD67.js → workspace-mcp-serve-4WN4CSD7.js} +1 -1
- package/dist/{workspace-model-6TKZMNEF.js → workspace-model-D4IECQML.js} +1 -1
- package/dist/{workspace-onboarding-7V7EH3RH.js → workspace-onboarding-6XWDKLM5.js} +1 -1
- package/dist/{workspace-registry-summary-ILVO7DEU.js → workspace-registry-summary-Y3ET36NH.js} +1 -1
- package/dist/{workspace-repair-engine-2VGFB3DJ.js → workspace-repair-engine-HBUXRHDY.js} +1 -1
- package/dist/workspace-run-VN7KV4BU.js +1 -0
- package/dist/{workspace-verify-VQWYDAF2.js → workspace-verify-OOAZ3NMZ.js} +1 -1
- package/dist/{workspace-watch-2Z636HWS.js → workspace-watch-BNM5B6HU.js} +1 -1
- package/docs/README.md +1 -1
- package/docs/agent-framework-adapters.md +33 -14
- package/docs/ci-workflows.md +17 -1
- package/docs/commands-reference.md +18 -11
- package/docs/creating-workspaces-and-projects.md +28 -10
- package/docs/doctor-command.md +4 -0
- package/docs/native-kit-baselines.md +3 -0
- package/docs/workspace-run.md +8 -0
- package/package.json +5 -4
- package/dist/analyze-Z3EZNJRI.js +0 -1
- package/dist/autopilot-release-T6XFRWZT.js +0 -1
- package/dist/chunk-65AE7EC5.js +0 -2
- package/dist/chunk-ABUSBLBH.js +0 -1
- package/dist/chunk-CMLLERGG.js +0 -418
- package/dist/chunk-FU6SQ2ND.js +0 -1
- package/dist/chunk-M6DVNC6X.js +0 -2
- package/dist/chunk-O5XQP5E7.js +0 -1
- package/dist/chunk-PTI743SC.js +0 -7
- package/dist/chunk-QBKOPXKC.js +0 -1
- package/dist/chunk-VJQPIH2S.js +0 -681
- package/dist/chunk-WPPRUFJW.js +0 -4
- package/dist/chunk-ZKYH44ER.js +0 -1
- package/dist/verified-goal-75KGBWTE.js +0 -1
- package/dist/workspace-graph-token-efficiency-YHXFGH3Z.js +0 -1
- package/dist/workspace-knowledge-graph-query-TT2KK3SF.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-TQAKDDUA.js +0 -1
- package/dist/workspace-run-X7KV6MIT.js +0 -1
package/dist/chunk-WPPRUFJW.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import {f as f$1,e}from'./chunk-XF65LQ6M.js';import {a as a$1,b as b$2}from'./chunk-X7FYEKLI.js';import {c,d as d$1}from'./chunk-N4B2M44I.js';import {a,b}from'./chunk-COOVCORC.js';import {j as j$1,i}from'./chunk-OH6LV5JP.js';import {a as a$2,h}from'./chunk-BLEIUQL6.js';import {b as b$1}from'./chunk-VN2MKTQO.js';import {t}from'./chunk-VQZ5PI5J.js';import {q as q$1,p as p$1}from'./chunk-ODK4LCEL.js';import p from'chalk';import d from'fs';import f from'path';var K=p$1.readiness;function H(n){return n.vulnerableDependencies>0?`${n.vulnerableDependencies} known dependency vulnerability finding(s) reported`:`${n.blockingFindings} blocking dependency/security finding(s) reported`}var U=q$1.readiness;function q(n){let e=j(n,"workspace.contract.json");if(!d.existsSync(e))return [];try{let t=JSON.parse(d.readFileSync(e,"utf-8"));return (Array.isArray(t.projects)?t.projects:[]).map(i=>{let c=v(i),o=typeof c.externalPath=="string"?c.externalPath.trim():"",s=typeof c.relativePath=="string"?c.relativePath.trim():"",r=o||s;return r?f.resolve(n,r):""}).filter(Boolean)}catch{return []}}function B(n,e){let t=f.resolve(n);if(!b(t))return t;let a=j(e,"workspace.contract.json");if(d.existsSync(a))try{let o=JSON.parse(d.readFileSync(a,"utf-8")),s=Array.isArray(o.projects)?o.projects:[];for(let r of s){let y=v(r),m=typeof y.externalPath=="string"?y.externalPath.trim():"";if(m)return f.resolve(e,m);let g=typeof y.relativePath=="string"?y.relativePath.trim():"";if(g)return f.join(e,g)}}catch{}let i=M(e),c=Array.isArray(i.payload?.projects)?i.payload.projects:[];for(let o of c){let s=v(o),r=typeof s.path=="string"?s.path.trim():"";if(r)return f.resolve(r)}return t}function z(n){let e=j$1(n);return i(e,n)}function _(n,e){if(!d.existsSync(n))return null;let t=d.readdirSync(n).filter(a=>a.endsWith(".json")&&e.some(i=>i.test(a))).map(a=>f.join(n,a));return t.length===0?null:(t.sort((a,i)=>d.statSync(i).mtimeMs-d.statSync(a).mtimeMs),t[0])}function v(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function J(n){for(let e of n)if(d.existsSync(e))return e;return null}function j(n,...e){let t$1=t(n,...e);return J(t$1)??t$1[0]}function A(n,e){let t=a$2(n,`.workspai/reports/${e}`);return J([t,f.join(n,".rapidkit","reports",e)])??t}async function Q(n){let{readWorkspaceRegistrySummary:e,resolveWorkspaceRegisteredProjects:t}=await import('./workspace-registry-summary-ILVO7DEU.js'),a=await e(n);return a?a.projectCount:(await t(n)).summary.projectCount}function X(n,e,t){let a=j(n,"toolchain.lock");if(!d.existsSync(a))return {gate:"env",status:"fail",summary:"toolchain.lock is missing",details:["Run workspai bootstrap to pin runtime versions and generate a reproducible toolchain."],evidencePath:a};try{let i=JSON.parse(d.readFileSync(a,"utf-8")),c=v(i.runtime),o=["python","node","go","java","dotnet","rust","php"],s=o.filter(l=>{let u=v(c[l]);return typeof u.version=="string"&&u.version.trim().length>0});if(s.length===0)return {gate:"env",status:"fail",summary:"No runtime versions are pinned in toolchain.lock",details:["Pin at least one runtime version via workspai setup <runtime> and re-run bootstrap."],evidencePath:a};let r=[...new Set((Array.isArray(e)?e:[e]).filter(l=>l!=="unknown"))],y=r.filter(l=>o.includes(l)),m=r.filter(l=>!o.includes(l)),g=y.filter(l=>{let u=v(c[l]);return typeof u.version!="string"||u.version.trim().length===0});return g.length>0?{gate:"env",status:"fail",summary:`${t?.hasRegisteredProjects?"Project runtime":"Workspace"}${g.length===1?"":"s"} (${g.join(", ")}) ${g.length===1?"is":"are"} not pinned in toolchain.lock`,details:g.map(u=>`Run workspai setup ${u} and workspai bootstrap to lock ${u} for this workspace.`),evidencePath:a}:m.length>0?{gate:"env",status:"warn",summary:`${t?.hasRegisteredProjects?"Project runtime":"Workspace"}${m.length===1?"":"s"} (${m.join(", ")}) cannot be verified by toolchain.lock`,details:[`Pinned Workspai runtimes (${s.join(", ")}) do not prove the ${m.join(", ")} compiler or runtime toolchain.`,"Declare and verify this runtime or toolchain through the project command contract or organization CI policy."],evidencePath:a}:{gate:"env",status:"pass",summary:`Pinned runtimes: ${s.join(", ")}`,details:[],evidencePath:a}}catch{return {gate:"env",status:"fail",summary:"toolchain.lock is invalid JSON",details:["Regenerate lockfile with workspai bootstrap."],evidencePath:a}}}function M(n){let e=A(n,"doctor-last-run.json");if(!d.existsSync(e))return {payload:null,path:e};try{let t=JSON.parse(d.readFileSync(e,"utf-8"));return c(t,"workspace")?(d$1(t),{payload:t,path:e}):{payload:null,path:e}}catch{return {payload:null,path:e}}}function Y(n){let e=M(n);if(!e.payload)return {gate:{gate:"doctor",status:"fail",summary:"Doctor evidence is missing",details:["Run workspai doctor workspace --json before release readiness checks."],evidencePath:e.path},payload:null};let t=a$1(e.payload);if(t.hasSystemErrors)return {gate:{gate:"doctor",status:"fail",summary:"Doctor reported system errors",details:["Resolve system-level doctor errors before proceeding."],evidencePath:e.path},payload:e.payload};if(t.blockingFindings>0)return {gate:{gate:"doctor",status:"fail",summary:`Doctor reported ${t.blockingFindings} blocking finding(s)`,details:["Resolve the canonical Doctor findings and regenerate fresh Doctor evidence."],evidencePath:e.path},payload:e.payload};let a=[...t.advisoryFindings>0?[`${t.advisoryFindings} advisory finding(s)`]:[],...t.unknownFindings>0?[`${t.unknownFindings} unknown finding(s)`]:[],...t.contradictionCount>0?[`${t.contradictionCount} evidence contradiction(s)`]:[],...t.missingDiagnosisProjects>0?[`${t.missingDiagnosisProjects} project(s) without canonical diagnosis`]:[],...t.staleEvidence?["stale Doctor evidence"]:[],...t.unknownFreshness?["unknown Doctor evidence freshness"]:[],...t.minimumDiagnosisCompleteness<100?[`diagnosis completeness ${t.minimumDiagnosisCompleteness}%`]:[]];return a.length>0?{gate:{gate:"doctor",status:"warn",summary:"Doctor evidence requires attention",details:a,evidencePath:e.path},payload:e.payload}:{gate:{gate:"doctor",status:"pass",summary:"Doctor checks passed without issues",details:[],evidencePath:e.path},payload:e.payload}}function Z(n){let e=A(n,"analyze-last-run.json");if(!d.existsSync(e))return {gate:"analyze",status:"fail",summary:"Analyze evidence is missing",details:["Run workspai analyze --json before release readiness checks."],evidencePath:e};try{let t=JSON.parse(d.readFileSync(e,"utf-8"));b$1(p$1.analyze,t,e);let a=v(t.summary),i=String(a.verdict??"").toLowerCase(),c=Number(a.score??0),o=v(a.findings),s=Number(o.fail??0);return i==="blocked"||s>0?{gate:"analyze",status:"fail",summary:`Analyze verdict is blocked (score ${c}/100)`,details:["Resolve analyze findings and regenerate analyze-last-run.json."],evidencePath:e}:i==="needs-attention"?{gate:"analyze",status:"warn",summary:`Analyze needs attention (score ${c}/100)`,details:["Review analyze warnings before release."],evidencePath:e}:{gate:"analyze",status:"pass",summary:`Analyze passed (score ${c}/100)`,details:[],evidencePath:e}}catch{return {gate:"analyze",status:"fail",summary:"Analyze evidence is invalid or violates its contract",details:["Re-run workspai analyze --json to regenerate evidence."],evidencePath:e}}}function ee(n){try{let e=JSON.parse(d.readFileSync(n,"utf-8")),t=String(e.status??"").toLowerCase(),a=v(e.summary),i=Number(a.failedChecks??0);return t==="fail"||i>0?{gate:"verify",status:"fail",summary:"Verify-pack contract reports failed checks",details:["Fix failed verify checks and regenerate verify-pack contract evidence."],evidencePath:n}:t==="pass"?{gate:"verify",status:"pass",summary:"Verify-pack contract passed",details:[],evidencePath:n}:{gate:"verify",status:"warn",summary:"Verify-pack contract status is not explicit",details:["Ensure contract status is pass/fail and keep schema aligned with v1 contract."],evidencePath:n}}catch{return {gate:"verify",status:"fail",summary:"Verify-pack contract is invalid JSON",details:["Regenerate verify-pack contract artifact."],evidencePath:n}}}async function te(n,e){if(e.skipVerify)return {gate:"verify",status:"pass",summary:"Verify gate skipped (--skip-verify)",details:["Verification was explicitly skipped for this readiness run."]};let t=[a$2(n,".workspai/reports"),f.join(n,".rapidkit","reports")],a=t[0],i=t.map(s=>_(s,[/verify-pack-contract/i,/^verify.*\.json$/i])).find(s=>typeof s=="string")??null;if(i)return ee(i);let c=a$2(n,p$1.contractVerify),o=t.map(s=>_(s,[/workspace-contract-verify-last-run/i,/workspace-contract-verify/i])).find(s=>typeof s=="string")??null;if(o)try{let s=JSON.parse(d.readFileSync(o,"utf-8")),r=String(s.status??"").toLowerCase();if(r==="passed"||r==="pass")return {gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI cache)",details:[],evidencePath:o};if(r==="failed"||r==="fail")return {gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI cache)",details:(Array.isArray(s.violations)?s.violations:[]).slice(0,5),evidencePath:o}}catch{}try{let{verifyWorkspaceContract:s}=await import('./workspace-contract-PMHUUKFM.js'),r=await s({workspacePath:n}),y={schemaVersion:"v1",source:"cli",generatedAt:new Date().toISOString(),status:r.status,contractPath:r.contractPath,projectCount:r.projectCount,checks:r.checks,violations:r.violations};return await h(n,p$1.contractVerify,y),r.status==="failed"?{gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI)",details:r.violations.slice(0,5),evidencePath:c}:{gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI)",details:[],evidencePath:c}}catch(s){return {gate:"verify",status:"fail",summary:"No verify evidence and workspace contract verification unavailable",details:["Run workspai workspace contract verify --json or export verify-pack contract from CI.",s instanceof Error?s.message:String(s)],evidencePath:f.join(a,"*verify*.json")}}}function ne(n,e){let t=A(e,"doctor-last-run.json");if(!n)return {gate:"dependency",status:"warn",summary:"Dependency risk check skipped (doctor evidence missing)",details:["Run workspai doctor workspace --json to include dependency findings."],evidencePath:t};let a=b$2(n);return a.blockingFindings>0||a.vulnerableDependencies>0?{gate:"dependency",status:"fail",summary:H(a),details:["Resolve the typed dependency/security findings and regenerate focused audit evidence."],evidencePath:t}:a.auditFailed>0?{gate:"dependency",status:"fail",summary:`${a.auditFailed} dependency audit(s) failed`,details:["Repair the audit runner or dependency environment; failed audits are not clean."],evidencePath:t}:a.missingDependencies>0||a.auditUnavailable>0||a.unknownFindings>0||a.advisoryFindings>0?{gate:"dependency",status:"warn",summary:"Dependency evidence is incomplete or requires attention",details:[...a.missingDependencies>0?[`${a.missingDependencies} project(s) have no materialized dependency tree.`]:[],...a.auditUnavailable>0?[`${a.auditUnavailable} audit provider(s) are unavailable or unsupported.`]:[],...a.unknownFindings>0?[`${a.unknownFindings} dependency/security finding(s) remain unknown.`]:[],...a.advisoryFindings>0?[`${a.advisoryFindings} dependency/security advisory finding(s) remain.`]:[]],evidencePath:t}:{gate:"dependency",status:"pass",summary:"No dependency vulnerabilities reported",details:[],evidencePath:t}}function ae(n){return n.some(e=>e.status==="fail")?"fail":n.some(e=>e.status==="warn")?"warn":"pass"}async function se(n,e){return h(n,K,e)}async function re(n={}){let e$1=f.resolve(n.startPath??process.cwd()),t=a(e$1)??e$1,a$1=await Q(t)>0,i=a$1&&b(e$1)?t:B(e$1,t),c=i===t?"unknown":z(i),o=a$1?c:"unknown";if(a$1&&i===t){let{resolveWorkspaceRegisteredProjects:h}=await import('./workspace-registry-summary-ILVO7DEU.js'),T=await h(t),E=q(t);o=(E.length>0?E:T.summary.projects.map(w=>f.resolve(t,w.relativePath))).map(w=>z(w));}let s=X(t,o,{hasRegisteredProjects:a$1}),r=Y(t),y=Z(t),m=await te(t,{skipVerify:n.skipVerify}),g=ne(r.payload,t),l=[s,r.gate,y,m,g],u=ae(l),k={schemaVersion:U,generatedAt:new Date().toISOString(),workspacePath:t,projectPath:i,action:n.action,overallStatus:u,blocking:u==="fail",blockingReasons:l.filter(h=>h.status==="fail").map(h=>`${h.gate}: ${h.summary}`),gates:l};if(n.writeReport!==false){let h=f$1(k,{commandId:"workspaceReadiness",exitCode:u==="fail"?2:u==="warn"?1:0,generatedAt:k.generatedAt,blockers:k.blockingReasons,runId:e()});k.evidencePath=await se(t,h);}return k}function ie(n){return n==="pass"?p.green("PASS"):n==="warn"?p.yellow("WARN"):p.red("FAIL")}function oe(n){return n==="pass"?p.green("PASS"):n==="warn"?p.yellow("WARN"):p.red("FAIL")}async function Se(n){let e=await re({startPath:n.workspace,writeReport:true,skipVerify:n.skipVerify===true});if(n.json)console.log(JSON.stringify(e,null,2));else {console.log(p.bold.cyan(`
|
|
2
|
-
\u{1F6A6} Workspai Release Readiness
|
|
3
|
-
`)),console.log(p.bold(`Workspace: ${p.cyan(f.basename(e.workspacePath))}`)),console.log(p.gray(`Path: ${e.workspacePath}`)),console.log(`Overall: ${oe(e.overallStatus)}`);for(let t of e.gates){console.log(` - ${t.gate}: ${ie(t.status)} ${t.summary}`);for(let a of t.details)console.log(p.gray(` ${a}`));t.evidencePath&&console.log(p.gray(` evidence: ${t.evidencePath}`));}e.evidencePath&&console.log(p.gray(`
|
|
4
|
-
Evidence saved: ${e.evidencePath}`));}n.strict&&e.overallStatus!=="pass"&&process.exit(1);}export{re as a,Se as b};
|
package/dist/chunk-ZKYH44ER.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import ce from'path';var le="workspace-knowledge-search.v1";function w(e){return e.trim().toLowerCase()}var Z=new WeakMap;function O(e){let t=Z.get(e);if(t)return t;let s=new Map(e.relations.map(i=>[i.id,i])),o=new Map(e.entities.map(i=>[i.id,i])),r=new Map(e.proofs.map(i=>[i.id,i])),a=new Map,c=new Map,d=(i,g)=>{let u=c.get(i)??[];u.push(g),c.set(i,u);};for(let i of e.entities){let g=[i.id,i.label,i.identity.key,...i.kind==="project"&&i.projectId?[i.projectId]:[],...i.identity.aliases];for(let u of new Set(g.map(w))){let y=a.get(u)??[];y.push(i),a.set(u,y);}}for(let i of e.relations)d(i.from,{from:i.from,to:i.to,relationId:i.id,kind:i.kind,direction:"forward",proofIds:i.proofIds}),d(i.to,{from:i.to,to:i.from,relationId:i.id,kind:i.kind,direction:"reverse",proofIds:i.proofIds});for(let i of a.values())i.sort((g,u)=>g.id.localeCompare(u.id));for(let i of c.values())i.sort((g,u)=>g.to.localeCompare(u.to)||g.relationId.localeCompare(u.relationId));let p={entitiesById:o,relationsById:s,entitiesByAlias:a,proofsById:r,adjacency:c};return Z.set(e,p),p}function H(e,t,s){let o=O(e),r=o.relationsById.get(t);if(r)return {found:true,targetType:"relation",relation:r};let a=w(t),c=(o.entitiesByAlias.get(a)??[]).filter(d=>!s||d.projectId===s);return c.length===1?{found:true,targetType:"entity",entity:c[0]}:{found:false,query:t,candidates:c.map(d=>d.id).sort()}}function _e(e,t,s){let o=H(e,t,s);if(!o.found)return {query:t,found:false,target:null,proofs:[],candidates:o.candidates};let r=o.targetType==="entity"?o.entity:o.relation,a=new Set(r.proofIds);return {query:t,found:true,target:r,candidates:[],proofs:[...a].map(c=>O(e).proofsById.get(c)).filter(c=>!!c).sort((c,d)=>c.id.localeCompare(d.id))}}function Ae(e,t,s,o){let r=H(e,t,o),a=H(e,s,o);if(!r.found||r.targetType!=="entity"||!a.found||a.targetType!=="entity")return {from:t,to:s,found:false,resolvedFrom:r.found&&r.targetType==="entity"?r.entity.id:null,resolvedTo:a.found&&a.targetType==="entity"?a.entity.id:null,entityPath:[],hops:[],proofs:[]};let c=O(e),d=[r.entity.id],p=new Map,i=new Set(d),g=0;for(;g<d.length&&!i.has(a.entity.id);){let h=d[g++];for(let m of c.adjacency.get(h)??[])i.has(m.to)||(i.add(m.to),p.set(m.to,m),d.push(m.to));}if(!i.has(a.entity.id))return {from:t,to:s,found:false,resolvedFrom:r.entity.id,resolvedTo:a.entity.id,entityPath:[],hops:[],proofs:[]};let u=[],y=a.entity.id;for(;y!==r.entity.id;){let h=p.get(y);if(!h)break;u.push(h),y=h.from;}u.reverse();let K=new Set(u.flatMap(h=>h.proofIds));return {from:t,to:s,found:true,resolvedFrom:r.entity.id,resolvedTo:a.entity.id,entityPath:[r.entity.id,...u.map(h=>h.to)],hops:u,proofs:[...K].map(h=>c.proofsById.get(h)).filter(h=>!!h).sort((h,m)=>h.id.localeCompare(m.id))}}function Ce(e,t,s){return e.entities.filter(o=>(!t||o.kind===t)&&(!s||o.projectId===s)).sort((o,r)=>o.kind.localeCompare(r.kind)||o.label.localeCompare(r.label))}var b={relations:12,relatedEntities:12,proofs:8,proofIdsPerItem:4,aliasesPerEntity:8,attributeArrayItems:8,attributeStringCharacters:256};function de(e){let t=[],s=new Set;for(let o=0;o<b.proofIdsPerItem&&t.length<b.proofs;o+=1)for(let r of e){let a=r.proofIds[o];if(!(!a||s.has(a))&&(s.add(a),t.push(a),t.length>=b.proofs))break}return t}function pe(e,t,s){let o=e.identity.aliases.slice(0,b.aliasesPerEntity);s.aliases+=e.identity.aliases.length-o.length;let r=Object.fromEntries(Object.entries(e.attributes).map(([c,d])=>{if(Array.isArray(d)){let p=d.slice(0,b.attributeArrayItems);return s.attributeValues+=d.length-p.length,[c,p]}return typeof d=="string"&&d.length>b.attributeStringCharacters?(s.attributeValues+=1,[c,d.slice(0,b.attributeStringCharacters)]):[c,d]})),a=e.proofIds.filter(c=>t.has(c)).slice(0,b.proofIdsPerItem);return s.proofReferences+=e.proofIds.length-a.length,{...e,identity:{...e.identity,aliases:o},attributes:r,proofIds:a}}function ue(e){let t=Object.values(e.attributes).flatMap(s=>Array.isArray(s)?s:[s]);return [e.id,e.kind,e.label,e.projectId??"",e.identity.key,...e.identity.aliases,...t.map(s=>String(s??""))].join(" ").toLowerCase()}var ge=new Set(["a","an","and","are","as","at","be","been","being","by","can","check","could","did","do","does","find","for","from","give","had","has","have","how","i","in","into","is","it","its","may","might","of","on","or","our","show","should","that","the","their","them","then","there","these","they","this","those","tell","to","was","we","were","what","when","where","which","who","why","will","with","would","you","your"]),he=new Map([["authenticate","auth"],["authenticated","auth"],["authentication","auth"],["authorization","auth"],["authorizing","auth"],["built","build"],["config","configuration"],["configs","configuration"],["dependencies","dependency"],["connected","connect"],["connecting","connect"],["connection","connect"],["connections","connect"],["diagnostics","diagnostic"],["defined","define"],["definition","define"],["definitions","define"],["events","event"],["handled","handle"],["handling","handle"],["implemented","implement"],["implementing","implement"],["implementations","implementation"],["implements","implement"],["reliable","reliability"],["tested","test"],["testing","test"],["tests","test"],["tools","tool"],["verification","verify"],["verified","verify"],["verifies","verify"],["verifying","verify"]]);function M(e){let t=s=>w(s).replace(/\bc\+\+/gu," cplusplus ").replace(/\bc#/gu," csharp ").split(/[^a-z0-9]+/u).filter(o=>o.length>1||o==="c"||o==="r").map(o=>he.get(o)??o);return [...new Set([...t(e),...t(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2"))])]}function fe(e){let t=w(e.label),s=w(e.identity.key),o=e.identity.aliases.map(w),r=ue(e),a=new Set(M(e.label)),c=new Set(M(e.identity.key)),d=new Set(e.identity.aliases.flatMap(M));return {entity:e,label:t,identity:s,aliases:o,haystack:r,labelTokens:a,identityTokens:c,aliasTokens:d,allTokens:new Set([...M(r),...a,...c,...d])}}function J(e,t){return t.length>=5&&e.startsWith(t)}function W(e,t){return e.has(t)||[...e].some(s=>J(s,t))}function q(e,t){return W(e.labelTokens,t)||W(e.identityTokens,t)||W(e.aliasTokens,t)||W(e.allTokens,t)}function ye(e,t,s,o){let{label:r,identity:a,aliases:c,haystack:d}=e,p=0;(r===t||a===t||c.includes(t))&&(p+=1e4),(r.startsWith(t)||a.startsWith(t))&&(p+=250),d.includes(t)&&(p+=100);let i=0;for(let g of s){let u=o.get(g)??1,y=W(e.labelTokens,g),K=W(e.identityTokens,g),h=W(e.aliasTokens,g),m=q(e,g);m&&(i+=1),r===g?p+=80*u:y&&(p+=36*u),K&&(p+=24*u),h&&(p+=20*u),m&&(p+=10*u);}return s.length>0&&(p+=i/s.length*120),p}function ke(e,t){if(["build","compiled","dist","generated","fixture","fixtures","testdata","target","third","vendor","vendored"].some(a=>t.has(a)))return 0;if(e.attributes.generated===true)return 5e3;let o=typeof e.attributes.artifact=="string"?e.attributes.artifact:"",r=`${e.label}/${e.identity.key}/${o}`.toLowerCase();return /(?:^|\/)(?:__fixtures__|__testfixtures__|build|compiled|dist|fixture|fixtures|generated|node_modules|target|testdata|third_party|vendor)(?:\/|$)/u.test(r)?5e3:0}function Q(e,t){let s=new Set;for(let o of t){let r=e.allTokens.has(o)?o:void 0,a=r===void 0&&o.length>=3?[...e.allTokens].find(d=>J(d,o)&&!s.has(d)):void 0,c=r??a;c&&!s.has(c)&&s.add(c);}return s.size}function me(e,t){let s=new Set([...e.labelTokens,...e.identityTokens,...e.aliasTokens]);return Q({allTokens:s},t)}var ee=new Map([["c","c"],["clojure","clojure"],["cplusplus","cpp"],["cpp","cpp"],["typescript","typescript"],["ts","typescript"],["javascript","javascript"],["js","javascript"],["nodejs","javascript"],["python","python"],["py","python"],["go","go"],["golang","go"],["csharp","csharp"],["ada","ada"],["assembly","assembly"],["asm","assembly"],["cuda","cuda"],["dotnet","csharp"],["dart","dart"],["elixir","elixir"],["fsharp","fsharp"],["fortran","fortran"],["java","java"],["kotlin","kotlin"],["hlsl","hlsl"],["llvmir","llvm-ir"],["mlir","mlir"],["lua","lua"],["php","php"],["r","r"],["ruby","ruby"],["rust","rust"],["tablegen","tablegen"],["scala","scala"],["svelte","svelte"],["swift","swift"],["vue","vue"]]);function we(e){let t=new Set(e.map(o=>ee.get(o)).filter(o=>!!o));return (e.includes("nodejs")||e.includes("node")&&e.includes("js"))&&(t.add("javascript"),t.add("typescript")),t}function be(e){let t=new Set(e.filter(o=>ee.has(o)));return (e.includes("nodejs")||e.includes("node")&&e.includes("js"))&&(t.add("node"),t.add("js"),t.add("nodejs")),t}function z(e){let t=e.attributes.language;return typeof t=="string"?w(t):null}var Ie=new Set(["api","endpoint","module","package","service"]);function Se(e,t,s){if(s.size===0||!Ie.has(e.entity.kind))return 0;let o=[...e.labelTokens].filter(a=>a.length>=2&&!te(a));if(o.length===0)return 0;let r=t.filter(a=>{let c=z(a.entity);return c!==null&&s.has(c)&&a.entity.projectId===e.entity.projectId&&o.every(d=>a.allTokens.has(d))});return r.length>0?600+Math.min(r.length,10)*10:0}function Ke(e){return {project:1e3,service:900,api:900,package:850,endpoint:800,container:700,deployment:700,environment:650,pipeline:600,"test-suite":550,owner:500,decision:450,document:400}[e.kind]??0}var Ee=new Set(["language","languages","binding","bindings","bridge","bridges","build","dependency","dependencies","depends","core","runtime","owner","owners","ownership","maintainer","ci","pipeline","pipelines","workflow","deploy","deployment","infrastructure","container","doc","docs","document","documentation","service","services","api","endpoint","endpoints","route","routes","rpc","schema","schemas","message","protobuf","proto","contract"]),We=new Set(["app","application","applications","call","calls","code","communicate","communication","connect","define","defined","expose","exposed","handle","handled","implement","implementation","integrate","integration","interact","interaction","project","provide","provided","sdk","system","use","used","uses","using"]);function te(e){return Ee.has(e)||We.has(e)}function Te(e,t){let s=t.has("language")||t.has("languages"),o=t.has("binding")||t.has("bindings")||t.has("bridge")||t.has("bridges"),r=t.has("dependency")||t.has("dependencies")||t.has("depends"),a=t.has("core")||t.has("runtime"),c=t.has("owner")||t.has("owners")||t.has("ownership")||t.has("maintainer"),d=t.has("ci")||t.has("pipeline")||t.has("pipelines")||t.has("workflow"),p=t.has("deploy")||t.has("deployment")||t.has("infrastructure")||t.has("container"),i=t.has("doc")||t.has("docs")||t.has("document")||t.has("documentation"),g=t.has("service")||t.has("services")||t.has("api")||t.has("rpc"),u=t.has("endpoint")||t.has("endpoints")||t.has("route")||t.has("routes"),y=t.has("schema")||t.has("schemas")||t.has("message")||t.has("protobuf")||t.has("proto")||t.has("contract"),K=t.has("build"),h=typeof e.attributes.mechanism=="string"?w(e.attributes.mechanism):"",m=typeof e.attributes.specification=="string"?w(e.attributes.specification):"",G=w(e.label),f=0;if(s&&e.kind==="language"){let R=typeof e.attributes.fileCount=="number"?e.attributes.fileCount:0;f+=900+Math.min(R,1e4)/10;}if(o&&e.kind==="protocol"&&(f+=800),r&&e.kind==="package"&&(f+=650),a&&e.kind==="package"&&/(?:^|[_-])core(?:$|[_-])/u.test(G)&&(f+=700),a&&e.kind==="protocol"&&h.includes("core")&&(f+=300),c&&e.kind==="owner"&&(f+=850),d&&e.kind==="pipeline"&&(f+=800),p&&["deployment","container","environment"].includes(e.kind)&&(f+=775),i&&["document","decision"].includes(e.kind)&&(f+=725),g&&["api","endpoint","service"].includes(e.kind)&&(f+=700),u&&e.kind==="endpoint"&&(f+=1e3),K){let R=typeof e.attributes.artifact=="string"?e.attributes.artifact:e.label,x=ce.basename(R).toLowerCase(),T=typeof e.attributes.stage=="string"?w(e.attributes.stage):"";e.kind==="lifecycle-stage"&&T==="build"?f+=1100:e.kind==="file"&&/^(?:cargo\.toml|composer\.json|dockerfile(?:\..+)?|go\.mod|makefile|package\.json|pom\.xml|pyproject\.toml|requirements[^/]*\.txt)$/u.test(x)?f+=950:(e.kind==="package"||e.kind==="container")&&(f+=700);}return y&&(e.kind==="schema"||(e.kind==="api"||e.kind==="protocol")&&(m.includes("protobuf")||h.includes("protobuf")))&&(f+=750),f}function je(e){return [e.has("language")||e.has("languages"),e.has("binding")||e.has("bindings")||e.has("bridge")||e.has("bridges"),e.has("dependency")||e.has("dependencies")||e.has("depends"),e.has("core")||e.has("runtime"),e.has("owner")||e.has("ownership")||e.has("maintainer"),e.has("ci")||e.has("pipeline")||e.has("workflow"),e.has("deploy")||e.has("deployment")||e.has("infrastructure"),e.has("doc")||e.has("docs")||e.has("documentation"),e.has("service")||e.has("api")||e.has("rpc"),e.has("endpoint")||e.has("endpoints")||e.has("route")||e.has("routes"),e.has("schema")||e.has("protobuf")||e.has("proto")||e.has("contract"),e.has("build")].filter(Boolean).length>=3}function Be(e,t){let s=w(t.query),o=[...new Set(M(t.query))],r=new Set(M(t.projectId??"")),a=t.projectId?o.filter(n=>!r.has(n)):o,c=!!(t.projectId&&o.length>0&&a.length===0),d=a.filter(n=>!ge.has(n)),p=d.length>0?d:a,i=we(p),g=be(p),u=new Set(p),y=p.filter(n=>!g.has(n)&&!te(n)),K=je(u),m=y.length>=2&&/\b(?:and|or)\b/iu.test(t.query)?1:p.length<=1?p.length:Math.min(2,Math.ceil(p.length/3)),G=t.minimumTermMatches===void 0?m:Math.min(m,Math.max(1,Math.trunc(t.minimumTermMatches))),f=Math.max(1,Math.min(Math.trunc(t.limit??12),100)),R=Math.max(0,Math.min(Math.trunc(t.relationsPerEntity??4),20)),x=new Set;if(t.projectId){let n=new Set(e.entities.filter(l=>l.kind==="project"&&(l.projectId===t.projectId||l.label===t.projectId)).map(l=>l.id));for(let l of e.relations)n.has(l.from)&&x.add(l.to),n.has(l.to)&&x.add(l.from);}let T=e.entities.filter(n=>(!t.kind||n.kind===t.kind)&&(!t.projectId||n.projectId===t.projectId||n.projectId===void 0&&x.has(n.id))).map(fe),ne=new Map(p.map(n=>{let l=T.filter(k=>q(k,n)).length;return [n,Math.log((T.length+1)/(l+1))+1]})),P=T.map(n=>{let l=Q(n,p),k=Q(n,y),I=me(n,y),S=z(n.entity),N=S&&i.has(S)?400:0,_=S===null?Se(n,T,i):0,ae=Te(n.entity,u),X=y.length===0||y.some(re=>q(n,re))?ae:0;return {entity:n.entity,matchedTerms:l,matchedQualifiers:k,intentScore:X,languageAffinity:_,score:c?Ke(n.entity):ye(n,s,p,ne)+k*300+I*400+N+_+X-ke(n.entity,u)}}).filter(n=>{let l=z(n.entity),k=l!==null&&i.has(l)&&n.entity.kind==="language";return (i.size===0||l!==null&&i.has(l)||n.languageAffinity>0)&&(s.length===0||n.score>0&&(y.length===0||n.matchedQualifiers>0||k)&&(c||n.matchedTerms>=G||n.intentScore>0&&(K||p.length<=2)))}).sort((n,l)=>l.score-n.score||n.entity.kind.localeCompare(l.entity.kind)||n.entity.label.localeCompare(l.entity.label)),j=(K?(()=>{let n=[],l=[],k=new Map,I=new Set;for(let S of P){let N=k.get(S.entity.kind)??0,_=w(S.entity.label);N<2&&!I.has(_)?(n.push(S),k.set(S.entity.kind,N+1),I.add(_)):l.push(S);}return [...n,...l]})():P).slice(0,f).map(n=>n.entity),A=new Set(j.map(n=>n.id)),F=new Map,D=e.relations.filter(n=>{if(!(A.has(n.from)||A.has(n.to)))return false;let k=A.has(n.from)?n.from:n.to,I=F.get(k)??0;return I>=R?false:(F.set(k,I+1),true)}),E=t.projection==="agent",v=E?D.slice(0,b.relations):D,U=O(e),L=[...new Set(v.flatMap(n=>[n.from,n.to]).filter(n=>!A.has(n)))].map(n=>U.entitiesById.get(n)).filter(n=>!!n).map(({id:n,kind:l,label:k,projectId:I})=>({id:n,kind:l,label:k,...I?{projectId:I}:{}})).sort((n,l)=>n.kind.localeCompare(l.kind)||n.label.localeCompare(l.label)),V=E?L.slice(0,b.relatedEntities):L,$=new Set([...j.flatMap(n=>n.proofIds),...v.flatMap(n=>n.proofIds)]),oe=E?de([...j,...v]):[...$],C=new Set(oe),B={entities:P.length-j.length,relations:D.length-v.length,relatedEntities:L.length-V.length,proofs:$.size-C.size,proofReferences:0,aliases:0,attributeValues:0},Y=E?j.map(n=>pe(n,C,B)):j,se=E?v.map(n=>{let l=n.proofIds.filter(k=>C.has(k)).slice(0,b.proofIdsPerItem);return B.proofReferences+=n.proofIds.length-l.length,{...n,proofIds:l}}):v,ie=[...C].map(n=>U.proofsById.get(n)).filter(n=>!!n).sort((n,l)=>n.id.localeCompare(l.id));return {schemaVersion:le,graphSourceHash:e.source.hash,query:t.query,kind:t.kind??null,...t.projectId?{projectId:t.projectId}:{},limit:f,totalMatches:P.length,truncated:P.length>Y.length||E&&Object.values(B).some(n=>n>0),entities:Y,relatedEntities:V,relations:se,proofs:ie,...E?{budget:{mode:"agent",limits:{...b},omitted:B}}:{}}}export{le as a,H as b,_e as c,Ae as d,Ce as e,Be as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-PTI743SC.js';import {c}from'./chunk-UE7ART6X.js';import {a as a$1}from'./chunk-WPPRUFJW.js';import {d}from'./chunk-ZI54C2AO.js';import {r}from'./chunk-FU6SQ2ND.js';import {a as a$2}from'./chunk-GR6442P7.js';import {h,g}from'./chunk-BLEIUQL6.js';import {a}from'./chunk-AFIFZTOY.js';import {b}from'./chunk-252EKOR6.js';import {p,q as q$1}from'./chunk-ODK4LCEL.js';import {createHash}from'crypto';import u from'path';import v from'fs-extra';var J="workspai.verified-goal.v1",A=q$1.verifiedGoalStatus,V=p.verifiedGoalStatus,H="contracts/workspace-intelligence/verified-goal.v1.json",$="contracts/workspace-intelligence/verified-goal-status.v1.json";function K(e,t,a){if(t.kind==="workspace")return true;let r=u.resolve(e,a.path);return t.kind==="project"?a.name===t.projectName||r===u.resolve(t.projectPath):t.projects.some(i=>i.projectName===a.name||u.resolve(i.projectPath)===r)}function x(e){return Array.isArray(e)?`[${e.map(x).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[a])=>t.localeCompare(a)).map(([t,a])=>`${JSON.stringify(t)}:${x(a)}`).join(",")}}`:JSON.stringify(e)}function z(e){return createHash("sha256").update(x(e)).digest("hex")}var re=["package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","pyproject.toml","requirements.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock","go.mod","go.sum","Cargo.toml","Cargo.lock","pom.xml","build.gradle","build.gradle.kts","gradle.lockfile","packages.lock.json","Directory.Packages.props","composer.json","composer.lock","Gemfile","Gemfile.lock","mix.exs","mix.lock","deps.edn","project.clj","build.sbt"],se=new Set(re.map(e=>e.toLowerCase())),ne=new Set([".git",".hg",".svn",".workspai",".venv","venv",".tox",".mypy_cache",".pytest_cache","__pycache__","node_modules","vendor","pods","dist","build","out","target","bin","obj","coverage",".coverage",".next",".nuxt",".svelte-kit"]),O=1e5;function ie(e){return se.has(e.toLowerCase())||/\.(?:csproj|fsproj|vbproj)$/i.test(e)}async function oe(e){let t=[e],a=[],r=0;for(;t.length>0;){let i=t.shift();if(i===void 0)break;let o=await v.readdir(i,{withFileTypes:true});if(o.sort((n,s)=>n.name.localeCompare(s.name)),r+=o.length,r>O)throw new Error(`Dependency safety baseline exceeded ${O} filesystem entries under ${e}. Narrow the project boundary before creating this goal.`);for(let n of o){let s=u.join(i,n.name);if(n.isDirectory()){!ne.has(n.name.toLowerCase())&&!a$2(n.name)&&t.push(s);continue}n.isFile()&&ie(n.name)&&a.push(s);}}return a}function ce(e){return /^(?:package\.json|package-lock\.json|npm-shrinkwrap\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb?)$/i.test(e)?"node":/^(?:pyproject\.toml|requirements\.txt|Pipfile(?:\.lock)?|poetry\.lock|uv\.lock)$/i.test(e)?"python":/^go\.(?:mod|sum)$/i.test(e)?"go":/^Cargo\.(?:toml|lock)$/i.test(e)?"rust":/^(?:pom\.xml|build\.gradle(?:\.kts)?|gradle\.lockfile)$/i.test(e)?"jvm":/^(?:Directory\.Packages\.props|packages\.lock\.json)$/i.test(e)?"dotnet":/^composer\.(?:json|lock)$/i.test(e)?"php":/^Gemfile(?:\.lock)?$/i.test(e)?"ruby":/^mix\.(?:exs|lock)$/i.test(e)?"elixir":/^(?:deps\.edn|project\.clj)$/i.test(e)?"clojure":/^build\.sbt$/i.test(e)?"scala":/\.(?:csproj|fsproj|vbproj)$/i.test(e)?"dotnet":"unknown"}function U(e){try{let t=JSON.parse(e),a={};for(let r of ["dependencies","devDependencies","peerDependencies","optionalDependencies"]){let i=t[r];if(!(!i||typeof i!="object"||Array.isArray(i)))for(let[o,n]of Object.entries(i))typeof n=="string"&&(a[`${r}:${o}`]=n);}return a}catch{return}}async function Y(e,t){let r$1=(await r({workspacePath:e,includeAbsolutePaths:true})).projects.filter(o=>K(e,t,o)),i=new Map;for(let o of r$1){let n=u.resolve(e,o.path),s=await oe(n);for(let c of s){let g=u.basename(c),f=await v.readFile(c,"utf8"),p=u.relative(e,c).split(u.sep).join("/");i.set(p,{path:p,ecosystem:ce(g),sha256:createHash("sha256").update(f).digest("hex"),...g==="package.json"?{dependencies:U(f)??{}}:{}});}}return {manifests:[...i.values()].sort((o,n)=>o.path.localeCompare(n.path))}}function B(e){let a=e.replace(/^(?:workspace:|npm:[^@]+@)/,"").match(/(?:^|[^\d])(\d+)(?:\.\d+)?(?:\.\d+)?/);return a?Number(a[1]):null}function S(e){return /(?:^|\/)(?:package-lock\.json|npm-shrinkwrap\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb?|poetry\.lock|uv\.lock|Pipfile\.lock|go\.sum|Cargo\.lock|gradle\.lockfile|packages\.lock\.json|composer\.lock|Gemfile\.lock|mix\.lock)$/i.test(e)}async function le(e){let t=e.dependencySafetyBaseline;if(!t)return k({id:"change-policy",label:"Change safety policy",status:"missing",expected:"dependency manifest safety baseline",actual:"baseline unavailable"});let a=[],r=await Y(e.workspace.path,e.scope),i=new Map(r.manifests.map(s=>[s.path,s])),o=new Map(t.manifests.map(s=>[s.path,s])),n=new Set;for(let s of t.manifests){let c=i.get(s.path);(!c||c.sha256!==s.sha256)&&n.add(s.path);}for(let s of r.manifests)o.has(s.path)||n.add(s.path);for(let s of r.manifests)!o.has(s.path)&&!S(s.path)&&a.push(`${s.path} was added after the safety baseline`);for(let s of t.manifests){let c=i.get(s.path);if(!c){a.push(`${s.path} was removed`);continue}if(c.sha256===s.sha256)continue;if(s.dependencies){let p=await v.readFile(u.join(e.workspace.path,s.path),"utf8"),m=U(p);if(!m){a.push(`${s.path} is not valid dependency JSON`);continue}for(let[d,l]of Object.entries(s.dependencies)){let h=m[d];if(!h){a.push(`${d.replace(/^[^:]+:/,"")} was removed`);continue}if(h===l)continue;let G=B(l),R=B(h);(G===null||R===null||G!==R||/(?:latest|\*)/i.test(h))&&a.push(`${d.replace(/^[^:]+:/,"")} changed outside its proven major range (${l} \u2192 ${h})`);}continue}if(S(s.path))continue;let g=u.posix.dirname(s.path);[...i.values()].some(p=>{let m=u.posix.dirname(p.path);return p.ecosystem===s.ecosystem&&(m===g||g.startsWith(`${m}/`))&&S(p.path)&&n.has(p.path)})||a.push(`${s.path} changed without a matching reconciled ${s.ecosystem} lockfile`);}return k({id:"change-policy",label:"Change safety policy",status:a.length===0?"passed":"blocked",expected:"no force, removal, unbounded, or major dependency changes",actual:a.length===0?"manifest changes are within proven bounds":a.join("; ")})}function E(e,t){if(!/^[a-z0-9][a-z0-9._-]{7,95}$/i.test(t))throw new Error(`Invalid verified goal id: ${t}`);let a=u.join(e,".workspai","goals",t);return {directory:a,goal:u.join(a,"goal.json"),status:u.join(a,"status.json"),latestReport:u.join(e,V)}}function ue(e){return {workspacePath:u.resolve(e.workspace.path),kind:e.kind,scope:e.scope,target:e.criteria.kind==="test-coverage"?e.criteria.minimumPercent:null,...e.criteria.kind==="test-coverage"&&e.criteria.runtime?{runtime:e.criteria.runtime}:{},constraints:e.constraints}}async function C(e,t){await v.ensureDir(u.dirname(e));let a=`${e}.${process.pid}.${Date.now()}.tmp`;await v.writeJson(a,t,{spaces:2}),await v.rename(a,e);}async function de(e,t){let a=t?.trim();if(!a||a==="workspace")return {scope:{kind:"workspace"}};let r$1=a.startsWith("projects:")?"projects:":a.startsWith("project:")&&a.slice(8).includes(",")?"project:":null,i=a.startsWith("project:")?a.slice(8).trim():r$1?a.slice(r$1.length).trim():a;if(!i)throw new Error("Project goal scope must name a project.");let o=await r({workspacePath:e,includeAbsolutePaths:true});if(r$1){let g=i.split(",").map(p=>p.trim()).filter(Boolean);if(g.length<2||new Set(g).size!==g.length)throw new Error("A project-set goal scope must name at least two unique projects.");return {scope:{kind:"project-set",projects:g.map(p=>{let m=o.projects.filter(d=>d.name===p||d.path===p);if(m.length!==1)throw new Error(m.length===0?`Project goal scope was not found: ${p}`:`Project goal scope is ambiguous: ${p}`);return m[0]}).map(p=>({projectName:p.name,projectPath:u.resolve(e,p.path)})).sort((p,m)=>p.projectName.localeCompare(m.projectName))}}}let n=o.projects.filter(g=>{let f=u.resolve(e,g.path);return g.name===i||g.path===i||f===u.resolve(i)});if(n.length!==1)throw new Error(n.length===0?`Project goal scope was not found: ${i}`:`Project goal scope is ambiguous: ${i}`);let s=n[0],c=u.resolve(e,s.path);return {project:s,scope:{kind:"project",projectName:s.name,projectPath:c}}}function X(e,t,a){return e===null?"unavailable":a==="minimum"?e>=t?"satisfied":"unsatisfied":e<=t?"satisfied":"unsatisfied"}async function Q(e){if(!e)return null;try{let t=await v.readJson(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function pe(e){return Array.isArray(e.projects)?e.projects.filter(t=>!!t&&typeof t=="object"&&!Array.isArray(t)):e.project&&typeof e.project=="object"&&!Array.isArray(e.project)?[e.project]:[]}function ge(e){let t=e.dependencyAudit;return t&&typeof t=="object"&&!Array.isArray(t)?t:null}async function Z(e,t){let a=await g(e,p.doctor),r=await Q(a);if(!r)return {measuredAt:new Date().toISOString(),value:null,target:0,unit:"blocking-vulnerabilities",status:"unavailable",evidencePaths:[],message:"Fresh Doctor dependency evidence is not available."};let i=pe(r).filter(c=>{if(t.kind==="workspace")return true;let g=typeof c.name=="string"?c.name:typeof c.projectName=="string"?c.projectName:"",f=typeof c.path=="string"?u.resolve(c.path):typeof c.projectPath=="string"?u.resolve(c.projectPath):"";return t.kind==="project"?g===t.projectName||f===u.resolve(t.projectPath):t.projects.some(p=>p.projectName===g||u.resolve(p.projectPath)===f)}),o=i.map(ge).filter(c=>c!==null),n=o.map(c=>c.blockingFindingCount).filter(c=>Number.isInteger(c)&&Number(c)>=0),s=i.length>0&&n.length===i.length?n.reduce((c,g)=>c+g,0):null;return {measuredAt:(()=>{let c=o.map(g=>g.generatedAt).filter(g=>typeof g=="string").sort();return c[c.length-1]??new Date().toISOString()})(),value:s,target:0,unit:"blocking-vulnerabilities",status:X(s,0,"maximum"),evidencePaths:a?[a]:[],message:s===null?"Doctor did not publish complete dependency audit counts for the selected scope.":`${s} blocking dependency vulnerability finding(s) remain.`}}async function ee(e){let t=await a$1({startPath:e,writeReport:false}),a=t.gates.filter(i=>i.status==="pass").length,r=t.gates.length;return {measuredAt:t.generatedAt,value:a,target:r,unit:"gates",status:t.overallStatus==="pass"?"satisfied":"unsatisfied",evidencePaths:[...new Set(t.gates.map(i=>i.evidencePath).filter(i=>typeof i=="string"))],message:t.overallStatus==="pass"?"All release readiness gates pass.":`${r-a} release readiness gate(s) still require work.`}}async function q(e){let t=await d({projectPath:e.projectPath,target:e.target,run:e.run,runtime:e.runtime}),r=t.metrics[t.target.metric]?.percent??null;return {executionStatus:t.status,measurement:{measuredAt:t.generatedAt,value:r,target:e.target,unit:"percent",status:X(r,e.target,"minimum"),evidencePaths:[t.artifactPaths.project],message:t.status==="failed"?"The runtime-native coverage test command failed.":r===null?"Machine-readable coverage evidence is unavailable.":`${t.target.metric} coverage is ${r}% (target ${e.target}%).`}}}async function te(e){if(e.scope.kind==="project"){if(!e.scope.projectPath)throw new Error("Coverage goal project scope does not have a project path.");return q({projectPath:e.scope.projectPath,target:e.target,run:e.run,runtime:e.runtime})}let t=await r({workspacePath:e.workspacePath,includeAbsolutePaths:true});if(t.projects.length===0)return {executionStatus:"unavailable",measurement:{measuredAt:new Date().toISOString(),value:null,target:e.target,unit:"percent",status:"unavailable",evidencePaths:[],message:"The workspace does not contain a registered project to measure."}};let a=t.projects.filter(l=>K(e.workspacePath,e.scope,l)),r$1=e.runtime,i=r$1?a.filter(l=>l.runtimeCandidates.includes(r$1)):a;if(i.length===0)return {executionStatus:"unavailable",measurement:{measuredAt:new Date().toISOString(),value:null,target:e.target,unit:"percent",status:"unavailable",evidencePaths:[],message:`The selected scope does not contain the ${e.runtime} coverage runtime.`}};let o=[];for(let l of i)o.push({projectName:l.name,result:await q({projectPath:u.resolve(e.workspacePath,l.path),target:e.target,run:e.run,runtime:e.runtime})});let n=o.filter(l=>l.result.executionStatus==="failed"),s=o.filter(l=>l.result.measurement.status==="unavailable"),c=o.filter(l=>l.result.measurement.status==="unsatisfied"),g=o.map(l=>l.result.measurement.value).filter(l=>l!==null),f=g.length===o.length&&g.length>0?Math.min(...g):null,p=n.length>0?"failed":s.length>0?"unavailable":c.length>0?"below-target":"passed",m=o.map(l=>l.result.measurement.measuredAt).sort(),d=[...n.map(l=>`${l.projectName}: coverage command failed`),...s.map(l=>`${l.projectName}: coverage unavailable`),...c.map(l=>`${l.projectName}: ${l.result.measurement.value??"unknown"}%`)];return {executionStatus:p,measurement:{measuredAt:m[m.length-1]??new Date().toISOString(),value:f,target:e.target,unit:"percent",status:p==="passed"?"satisfied":p==="below-target"?"unsatisfied":"unavailable",evidencePaths:[...new Set(o.flatMap(l=>l.result.measurement.evidencePaths))],message:p==="passed"?`Every registered project has at least ${e.target}% test coverage.`:`Workspace coverage is not verified: ${d.join("; ")}.`}}}function me(e){let t=e.scope.kind==="project"?`project ${e.scope.projectName??"selected project"}`:e.scope.kind==="project-set"?`projects ${e.scope.projects.map(a=>a.projectName).join(", ")}`:"workspace";return e.kind==="release-readiness"?`Prepare the ${t} for release.`:e.kind==="dependency-security"?`Resolve blocking dependency vulnerabilities in the ${t} without unsafe changes.`:`Raise ${e.runtime?`${e.runtime} `:""}${t} test coverage to ${e.target??80}% without breaking its build.`}function fe(e,t,a){return e==="release-readiness"?{kind:e,readiness:"pass",workspaceVerify:"ready"}:e==="dependency-security"?{kind:e,maximumBlockingVulnerabilities:0,requireFreshAudit:true}:{kind:e,metric:"auto",minimumPercent:t,...a?{runtime:a}:{}}}async function he(e){return e.kind==="release-readiness"?ee(e.workspacePath):e.kind==="dependency-security"?Z(e.workspacePath,e.scope):(await te({workspacePath:e.workspacePath,scope:e.scope,target:e.target,run:false,runtime:e.runtime})).measurement}async function Re(e){let t=u.resolve(e.workspacePath),a$1=Math.max(0,Math.min(100,Math.round(e.target??80))),{scope:r}=await de(t,e.scope),i={workspacePath:u.resolve(t),kind:e.kind,scope:r,target:e.kind==="test-coverage"?a$1:null,...e.kind==="test-coverage"&&e.runtime?{runtime:e.runtime}:{},constraints:{allowBreakingChanges:e.allowBreakingChanges===true,allowForce:e.allowForce===true,requireBuild:e.requireBuild!==false,requireTests:e.requireTests!==false}},o=z(i),n=`goal-${e.kind}-${o.slice(0,16)}`,s=E(t,n);if(await v.pathExists(s.goal)){let{goal:m,status:d}=await ae(t,n);if(m.fingerprint===o)return {goal:m,status:d,resumed:d.state!=="verified"}}let c=new Date().toISOString(),g=await he({workspacePath:t,kind:e.kind,scope:r,target:a$1,runtime:e.runtime}),f={schemaVersion:J,id:n,fingerprint:o,createdAt:c,updatedAt:c,workspace:{name:await b(t),path:t},scope:r,kind:e.kind,summary:me({kind:e.kind,scope:r,target:a$1,runtime:e.runtime}),constraints:i.constraints,criteria:fe(e.kind,a$1,e.runtime),baseline:g,...e.kind==="dependency-security"?{dependencySafetyBaseline:await Y(t,r)}:{},artifactPaths:{goal:s.goal,status:s.status,latestReport:s.latestReport}},p={schemaVersion:A,goalId:n,goalFingerprint:o,workspacePath:t,updatedAt:c,state:"planned",attempt:0,progress:g,checks:[],blockingReasons:[],evidencePaths:g.evidencePaths,nextActions:e.kind==="test-coverage"?["Add focused tests for the lowest-coverage source paths.","Run verified goal checks."]:e.kind==="dependency-security"?["Inspect the fresh project dependency audit.","Apply only compatible non-force dependency repairs.","Reconcile the lockfile, test, build, and verify again."]:["Inspect the current remediation plan and failing release gates.","Repair the next causal blocker, then verify again."],artifactPath:s.status};return a(f,H,"Verified goal"),a(p,$,"Verified goal status"),await C(s.goal,f),await C(s.status,p),await h(t,V,p),{goal:f,status:p,resumed:false}}async function ae(e,t){let a$1=E(u.resolve(e),t),r=await v.readJson(a$1.goal),i=await v.readJson(a$1.status);a(r,H,"Verified goal"),a(i,$,"Verified goal status");let o=u.resolve(e),n=u.resolve(r.artifactPaths.goal)===u.resolve(a$1.goal)&&u.resolve(r.artifactPaths.status)===u.resolve(a$1.status)&&u.resolve(r.artifactPaths.latestReport)===u.resolve(a$1.latestReport);if(r.schemaVersion!==J||i.schemaVersion!==A||r.id!==i.goalId||r.fingerprint!==i.goalFingerprint||r.fingerprint!==z(ue(r))||u.resolve(r.workspace.path)!==o||u.resolve(i.workspacePath)!==o||!n)throw new Error(`Verified goal artifacts are inconsistent: ${t}`);return {goal:r,status:i}}function k(e){return {...e,message:e.message??`${e.label}: ${e.actual}; expected ${e.expected}.`}}async function L(e){let t=[],a=e.goal.scope.kind==="project"?[`project:${e.goal.scope.projectName}`]:e.goal.scope.kind==="project-set"?e.goal.scope.projects.map(r=>`project:${r.projectName}`):[void 0];for(let r of ["test","build"]){if(r==="test"&&e.includeTests===false)continue;if(!(r==="test"?e.goal.constraints.requireTests:e.goal.constraints.requireBuild)){t.push(k({id:r,label:`${r} validation`,status:"skipped",expected:"not required",actual:"skipped by goal contract"}));continue}if(!e.run){t.push(k({id:r,label:`${r} validation`,status:"missing",expected:"fresh passed evidence",actual:"execution disabled"}));continue}let o=false;for(let n of a){let s=await b$1({workspacePath:e.goal.workspace.path,stage:r,scope:n,parallel:false,continueOnError:false,strict:true,json:true,enforceGates:false}),c=n?.replace(/^project:/,"");if(t.push(k({id:c?`${r}:${c}`:r,label:c?`${r} validation \xB7 ${c}`:`${r} validation`,status:s.summary.exitCode===0?"passed":"failed",expected:"exit 0",actual:`exit ${s.summary.exitCode}`,evidencePath:u.join(e.goal.workspace.path,".workspai","reports","workspace-run-last.json")})),s.summary.exitCode!==0){o=true;break}}if(o)break}return t}async function Ne(e){let t=u.resolve(e.workspacePath),{goal:a$1,status:r}=await ae(t,e.goalId),i=e.run!==false,o=[],n;if(i&&e.runIntelligence!==false){let d=await c({workspacePath:t,strict:true,agent:"generic"}),l=d.exitCode===0||d.exitCode===2,h=a$1.kind==="release-readiness";o.push(k({id:"workspace-intelligence-chain",label:"Workspace Intelligence chain",status:d.exitCode===0||d.exitCode===2&&!h?"passed":d.exitCode===2?"blocked":"failed",expected:"passed",actual:d.exitCode===2&&l&&!h?`${d.status}; canonical evidence refreshed for goal-scoped verification`:d.status,evidencePath:u.join(t,p.intelligenceRun)}));}if(a$1.kind==="release-readiness"){n=await ee(t),o.push(k({id:"release-readiness",label:"Release readiness",status:n.status==="satisfied"?"passed":"blocked",expected:"all gates pass",actual:n.message,evidencePath:u.join(t,p.readiness)}));let d=await g(t,p.verify),l=await Q(d),h=l?.summary&&typeof l.summary=="object"&&!Array.isArray(l.summary)?String(l.summary.verdict??"missing"):"missing";o.push(k({id:"workspace-verify",label:"Workspace verification",status:h==="ready"?"passed":h==="missing"?"missing":"blocked",expected:"ready",actual:h,evidencePath:u.join(t,p.verify)}));}else if(a$1.kind==="dependency-security")n=await Z(t,a$1.scope),o.push(k({id:"dependency-audit",label:"Dependency security audit",status:n.status==="satisfied"?"passed":n.status==="unavailable"?"missing":"blocked",expected:"0 blocking vulnerabilities",actual:n.message,evidencePath:n.evidencePaths[0]})),o.push(a$1.constraints.allowBreakingChanges||a$1.constraints.allowForce?k({id:"change-policy",label:"Change safety policy",status:"blocked",expected:"breaking and force changes disabled",actual:`allowBreakingChanges=${a$1.constraints.allowBreakingChanges}, allowForce=${a$1.constraints.allowForce}`}):await le(a$1)),n.status==="satisfied"&&o.push(...await L({goal:a$1,run:i}));else {let d=a$1.criteria.kind==="test-coverage"?a$1.criteria.minimumPercent:a$1.baseline.target;if(d===null)throw new Error("Coverage goal does not have a valid target.");let l=await te({workspacePath:t,scope:a$1.scope,target:d,run:i,runtime:a$1.criteria.kind==="test-coverage"?a$1.criteria.runtime:void 0});n=l.measurement,o.push(k({id:"coverage",label:"Test coverage",status:n.status==="satisfied"?"passed":n.status==="unavailable"?"missing":"blocked",expected:`at least ${d}%`,actual:n.message,evidencePath:n.evidencePaths[0]})),o.push(k({id:"test",label:"Coverage test execution",status:l.executionStatus==="failed"?"failed":l.executionStatus==="unavailable"?"missing":"passed",expected:"runtime-native coverage test command completed",actual:l.executionStatus==="failed"?"coverage test command failed":l.executionStatus==="unavailable"?"coverage execution evidence unavailable":"coverage evidence produced by the test runner",evidencePath:n.evidencePaths[0]})),n.status==="satisfied"&&o.push(...await L({goal:a$1,run:i,includeTests:false}));}let s=o.filter(d=>d.status==="blocked"||d.status==="failed"||d.status==="missing").map(d=>d.message),c$1=[...new Set([...n.evidencePaths,...o.map(d=>d.evidencePath).filter(d=>typeof d=="string")])],g$1=n.status==="satisfied"&&o.every(d=>d.status==="passed"||d.status==="skipped"),f=E(t,a$1.id),p$1=g$1?[]:a$1.kind==="test-coverage"?["Inspect low-coverage files from the coverage artifact.","Add focused tests and verify again."]:a$1.kind==="dependency-security"?["Use fresh audit candidates and compatible package-manager repairs.","Reconcile lockfiles before running verified goal checks again."]:["Repair the first blocking readiness gate and verify the goal again."],m={schemaVersion:A,goalId:a$1.id,goalFingerprint:a$1.fingerprint,workspacePath:t,updatedAt:new Date().toISOString(),state:g$1?"verified":o.some(d=>d.status==="failed")?"failed":"blocked",attempt:r.attempt+1,progress:n,checks:o,blockingReasons:s,evidencePaths:c$1,nextActions:p$1,artifactPath:f.status};return a(m,$,"Verified goal status"),await C(f.status,m),await h(t,V,m),m}export{V as VERIFIED_GOAL_LAST_RUN_REPORT_PATH,J as VERIFIED_GOAL_SCHEMA_VERSION,A as VERIFIED_GOAL_STATUS_SCHEMA_VERSION,Re as planVerifiedGoal,ae as readVerifiedGoal,Ne as verifyVerifiedGoal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as WORKSPACE_GRAPH_TOKEN_EFFICIENCY_SCHEMA_VERSION,b as buildWorkspaceGraphTokenEfficiencyReport}from'./chunk-RPM67N7A.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as WORKSPACE_KNOWLEDGE_SEARCH_SCHEMA_VERSION,e as queryKnowledgeEntities,c as queryKnowledgeEvidence,d as queryKnowledgePath,b as resolveKnowledgeTarget,f as searchKnowledgeGraph}from'./chunk-ZKYH44ER.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as readWorkspaceKnowledgeGraphSnapshot}from'./chunk-25V5XMWB.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as resolveWorkspaceRunStageTimeoutMs,b as runWorkspaceStage}from'./chunk-PTI743SC.js';export{a as WORKSPACE_RUN_LAST_REPORT_FILENAME}from'./chunk-BR6QIYQS.js';
|