workspai 0.75.0 → 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-J4J3RYCL.js → chunk-3RNWBFRP.js} +1 -1
- package/dist/{chunk-GE46XKD2.js → chunk-4JXJRIJM.js} +1 -1
- package/dist/chunk-5HNQIMGW.js +1 -0
- package/dist/chunk-5K4O3TAW.js +4 -0
- package/dist/{chunk-CGNMS32W.js → chunk-66O62XNJ.js} +49 -49
- package/dist/{chunk-GIFAGOMK.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-CK73SQFF.js → chunk-EP7SUMAX.js} +1 -1
- package/dist/chunk-EWD6QTAM.js +2 -0
- package/dist/{chunk-HLSOZOL3.js → chunk-FNVWDXK2.js} +3 -3
- package/dist/{chunk-RX3U7JKF.js → chunk-FZWLWFR4.js} +1 -1
- package/dist/chunk-G5UCEXP6.js +1 -0
- package/dist/{chunk-WOPZX56J.js → chunk-GDOO2YZW.js} +1 -1
- package/dist/{chunk-V5WVGPOP.js → chunk-IKBE3HOH.js} +1 -1
- package/dist/{chunk-NGU7RYXA.js → chunk-K52IQX3J.js} +1 -1
- package/dist/{chunk-DT3LRKZQ.js → chunk-KDVNRNDU.js} +1 -1
- package/dist/chunk-LARREYZN.js +1 -0
- package/dist/{chunk-MXI2DWLL.js → chunk-LFY7KTPD.js} +1 -1
- package/dist/{chunk-SRCZX2KC.js → chunk-P36TACKN.js} +1 -1
- package/dist/{chunk-4KEZQLBU.js → chunk-PFAGXI3G.js} +1 -1
- package/dist/chunk-ROOPODG6.js +2 -0
- package/dist/{chunk-G3ZC5W4U.js → chunk-SZHRPELL.js} +1 -1
- package/dist/{chunk-DJH2CH42.js → chunk-UHIN3RS6.js} +1 -1
- package/dist/{chunk-FS3WLRQ4.js → chunk-VWBWDDU2.js} +1 -1
- package/dist/chunk-VXFIMEC6.js +2 -0
- package/dist/{chunk-ZW4QV6SB.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-ZGVODK5C.js +12 -0
- package/dist/{create-7UENFCJK.js → create-ZFSFWAW3.js} +1 -1
- package/dist/{demo-kit-ALW6OSQV.js → demo-kit-QNGY4KQ5.js} +1 -1
- package/dist/{doctor-KGADT4PI.js → doctor-4KL4XUCS.js} +1 -1
- package/dist/{dotnet-webapi-clean-6Z4EXEJY.js → dotnet-webapi-clean-GXTNZMKO.js} +1 -1
- package/dist/{goal-lifecycle-HIQGDEEP.js → goal-lifecycle-EXQZD7IA.js} +1 -1
- package/dist/{goal-pack-63PEP2ND.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 +182 -174
- package/dist/{pipeline-VFI35PR4.js → pipeline-4GVAOCEN.js} +1 -1
- package/dist/{project-agent-entry-Z3OY3S7T.js → project-agent-entry-7QKNEEXP.js} +1 -1
- package/dist/{project-intelligence-lens-YWICXW6P.js → project-intelligence-lens-IHRYCLNU.js} +1 -1
- package/dist/{proof-carrying-change-BAP2C3KV.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-PAXTJCMH.js → workspace-EYXAKMVI.js} +1 -1
- package/dist/{workspace-agent-sync-MGCEF4ON.js → workspace-agent-sync-SN55KT6N.js} +1 -1
- package/dist/{workspace-context-2G6QZ6D3.js → workspace-context-PW6ESEHH.js} +1 -1
- package/dist/{workspace-contract-VWPOIYHJ.js → workspace-contract-FPLFL4G3.js} +1 -1
- package/dist/{workspace-explain-HLEBUK4K.js → workspace-explain-TVQ5IF5D.js} +1 -1
- package/dist/{workspace-foundation-X7LOGTS3.js → workspace-foundation-DWIJPZRH.js} +1 -1
- package/dist/{workspace-graph-stream-XGSRDRLI.js → workspace-graph-stream-RUTNWLQB.js} +1 -1
- package/dist/workspace-graph-token-efficiency-WF6TGSK7.js +1 -0
- package/dist/{workspace-intelligence-GFJKIWBX.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-BU6JKNUD.js → workspace-intelligence-runner-VM5SXXAT.js} +1 -1
- package/dist/{workspace-knowledge-graph-OUTCLYS2.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-JYUKX3YS.js → workspace-mcp-serve-4WN4CSD7.js} +1 -1
- package/dist/{workspace-model-DUGPW5IB.js → workspace-model-D4IECQML.js} +1 -1
- package/dist/{workspace-onboarding-C4CKWTJ3.js → workspace-onboarding-6XWDKLM5.js} +1 -1
- package/dist/{workspace-registry-summary-4KX4QD55.js → workspace-registry-summary-Y3ET36NH.js} +1 -1
- package/dist/{workspace-repair-engine-OVW4J3DI.js → workspace-repair-engine-HBUXRHDY.js} +1 -1
- package/dist/workspace-run-VN7KV4BU.js +1 -0
- package/dist/{workspace-verify-B7HEFYO6.js → workspace-verify-OOAZ3NMZ.js} +1 -1
- package/dist/{workspace-watch-TQYAMLIV.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 +31 -8
- package/docs/commands-reference.md +24 -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-operations.md +12 -2
- package/docs/workspace-run.md +8 -0
- package/package.json +5 -4
- package/dist/analyze-FRQVJ3VJ.js +0 -1
- package/dist/autopilot-release-D3UES53H.js +0 -1
- package/dist/chunk-36VNERGC.js +0 -1
- package/dist/chunk-4DX4HBG3.js +0 -4
- package/dist/chunk-CMLLERGG.js +0 -418
- package/dist/chunk-D4AMCZJU.js +0 -7
- package/dist/chunk-LMOTDLJF.js +0 -2
- package/dist/chunk-NFWUAEVQ.js +0 -12
- package/dist/chunk-O2CFT2A3.js +0 -1
- package/dist/chunk-O5XQP5E7.js +0 -1
- package/dist/chunk-P5RZO5BY.js +0 -681
- package/dist/chunk-TXVMHEJS.js +0 -1
- package/dist/chunk-YP436V7Q.js +0 -2
- package/dist/chunk-ZKYH44ER.js +0 -1
- package/dist/verified-goal-A6WOMNTU.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-XWJRUMAC.js +0 -1
- package/dist/workspace-run-NVQGRZYO.js +0 -1
package/dist/chunk-TXVMHEJS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {c}from'./chunk-DT3LRKZQ.js';import {j,i,d as d$1,f as f$1,c as c$2,e,h}from'./chunk-36VNERGC.js';import {f as f$2}from'./chunk-ZKYH44ER.js';import {a as a$1}from'./chunk-FS3WLRQ4.js';import {c as c$3}from'./chunk-ZI54C2AO.js';import {b}from'./chunk-OA2YJN22.js';import {b as b$1}from'./chunk-NFWUAEVQ.js';import {f,i as i$1}from'./chunk-BLEIUQL6.js';import {a}from'./chunk-AFIFZTOY.js';import {d,c as c$1}from'./chunk-EWZZUQBR.js';import {q,p}from'./chunk-ODK4LCEL.js';import C from'path';import _ from'fs-extra';var be=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/,we=/(?:^|\s)(?:\/(?:home|Users|private|var|tmp|mnt|opt|srv|root|workspace|workspaces|data|Volumes|etc|usr|run|dev|proc|sys)\/[^\s]+|[A-Za-z]:[\\/][^\s]+|\\\\[^\\\s]+\\[^\s]+)/,ke=/(?:-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----|\b(?:github_pat_|gh[pousr]_|glpat-|npm_|xox[baprs]-|sk-(?:proj-)?)[A-Za-z0-9_-]{12,}|\b(?:AKIA|ASIA)[A-Z0-9]{16}\b|\bAIza[A-Za-z0-9_-]{20,}|\bBearer\s+[A-Za-z0-9._~+/-]{16,}|[a-z][a-z0-9+.-]*:\/\/[^\s:/]+:[^\s@/]+@|\b(?:password|passwd|secret|token|api[_-]?key)\s*[:=]\s*[^\s]{6,})/i,ve=[{category:"test-coverage",patterns:[/\b(?:test\s+)?coverage\b/i,/\bcoverage\s+(?:to|above|at least)\b/i]},{category:"dependency-security",patterns:[/\b(?:dependency|dependencies|package|packages)\b.*\b(?:security|vulnerab|audit)\b/i,/\b(?:security|vulnerab|audit)\b.*\b(?:dependency|dependencies|package|packages)\b/i]},{category:"release-readiness",patterns:[/\brelease[ -]readiness\b/i,/\bready (?:this |the )?(?:workspace|project) for release\b/i,/\bprepare (?:this |the )?(?:workspace|project) for release\b/i,/\bprepare\b[^\n]{0,80}\bfor release\b/i]},{category:"defect-repair",patterns:[/\b(?:fix|repair|resolve|debug)\b.*\b(?:bug|error|failure|issue|regression)\b/i]},{category:"performance",patterns:[/\b(?:performance|latency|throughput|cpu|optimi[sz]e|faster|slower)\b/i,/\b(?:memory\s+(?:allocation|consumption|footprint|leak|pressure|usage)|out[ -]of[ -]memory|heap|ram)\b/i]},{category:"refactor",patterns:[/\b(?:refactor|restructure|decouple|extract|simplify|cleanup|clean up)\b/i]},{category:"documentation",patterns:[/\b(?:document|documentation|readme|guide|tutorial|docs)\b/i]},{category:"feature-change",patterns:[/\b(?:add|build|create|enforce|enhance|harden|implement|improve|introduce|support)\b/i]},{category:"system-understanding",patterns:[/\b(?:understand|explain|map|find|where|how|architecture|analy[sz]e|search)\b/i]}];function ye(e){if(typeof e!="string")throw new Error("Goal intent must be text.");let t=e.trim().replace(/\s+/g," ");if(!t)throw new Error("Goal intent cannot be empty.");if(t.length>2e3)throw new Error("Goal intent exceeds the 2000 character safety limit.");if(be.test(t))throw new Error("Goal intent contains unsupported control characters.");if(we.test(t))throw new Error("Goal intent contains a machine-local absolute path. Use a workspace-relative path or project scope.");if(ke.test(t))throw new Error("Goal intent appears to contain secret material and was not persisted.");return t}function Pe(e){let t=e.match(/\b(?:coverage\D{0,24})?((?:100(?:\.0+)?|\d{1,2}(?:\.\d+)?))\s*(?:%|percent(?:age)?(?:\s+points?)?)/i);if(!t||!/coverage/i.test(e))return null;let r=Number(t[1]);return Number.isFinite(r)&&r>=0&&r<=100?r:null}var re=[{runtime:"cpp",patterns:[/\bc\+\+/i,/\bcpp\b/i]},{runtime:"dotnet",patterns:[/\.net\b/i,/\bdotnet\b/i,/\bc#/i,/\bcsharp\b/i]},{runtime:"node",patterns:[/\bnode(?:\.js)?\b/i,/\btypescript\b/i,/\bjavascript\b/i,/\b(?:js|ts)\b/i]},{runtime:"python",patterns:[/\bpython\b/i,/\bpytest\b/i]},{runtime:"go",patterns:[/\bgolang\b/i,/\bgo(?:\s+(?:test|coverage|tests))\b/i]},{runtime:"java",patterns:[/\bjava\b/i,/\bjunit\b/i,/\bjacoco\b/i]},{runtime:"rust",patterns:[/\brust\b/i,/\bcargo\b/i]},{runtime:"php",patterns:[/\bphp\b/i,/\bphpunit\b/i]},{runtime:"ruby",patterns:[/\bruby\b/i,/\brspec\b/i]},{runtime:"kotlin",patterns:[/\bkotlin\b/i]},{runtime:"scala",patterns:[/\bscala\b/i]},{runtime:"clojure",patterns:[/\bclojure\b/i]},{runtime:"elixir",patterns:[/\belixir\b/i]},{runtime:"deno",patterns:[/\bdeno\b/i]},{runtime:"bun",patterns:[/\bbun\b/i]},{runtime:"c",patterns:[/\bc(?:\s+(?:test|coverage|tests|code))\b/i]}];function je(e){return re.filter(t=>t.patterns.some(r=>r.test(e))).map(t=>t.runtime)}function K(e,t={}){let r=ye(e),n=ve.filter(u=>u.patterns.some(j=>j.test(r))).map(u=>u.category),a=n.some(u=>u!=="feature-change")?n.filter(u=>u!=="feature-change"):n,s=a[0]??"feature-change",l=Pe(r),d=je(r),p=d.length===0&&t.selectedCoverageRuntime?[t.selectedCoverageRuntime]:d,m=[...new Set((t.availableCoverageRuntimes??[]).filter(u=>re.some(j=>j.runtime===u)))].sort(),b=[];return a.length>1&&a[0]!=="test-coverage"&&b.push(`The intent also contains signals for: ${a.slice(1).join(", ")}.`),s==="test-coverage"&&l===null&&b.push("A numeric test coverage target is required for machine verification."),s==="test-coverage"&&p.length>1&&b.push(`The Goal names multiple coverage runtimes: ${p.join(", ")}. Select one runtime per Goal.`),s==="test-coverage"&&p.length===0&&m.length>1&&b.push(`Coverage scope is ambiguous across detected runtimes: ${m.join(", ")}. Name one runtime or language in the Goal.`),s==="test-coverage"&&p.length===1&&m.length>0&&!m.includes(p[0])&&b.push(`The requested ${p[0]} coverage runtime is not present in the selected scope. Detected runtimes: ${m.join(", ")}.`),{original:r,normalized:r.toLocaleLowerCase("en-US"),statement:r.replace(/[.!?]+$/,""),category:s,confidence:a.length===1?"high":a.length>1?"medium":"low",ambiguities:b,...l===null?{}:{requestedTarget:{metric:"test-coverage-percent",operator:"at-least",value:l,...p.length===1?{runtime:p[0]}:{}}}}}function oe(e){let t={"test-coverage":["test suite coverage configuration instrumentation","CI tests LCOV Cobertura JaCoCo LLVM coverage"],"dependency-security":["dependency manifest lockfile security audit vulnerability"],"release-readiness":["release pipeline readiness gates build test deploy"],"defect-repair":["failure error test implementation call path"],"feature-change":["API implementation module dependency tests"],refactor:["module dependency ownership implementation tests"],performance:["performance benchmark latency throughput runtime"],documentation:["documentation README guide architecture decision"],"system-understanding":["architecture service API dependency ownership"]};return [...new Set([e.statement,...t[e.category]])].slice(0,3)}var ae="contracts/workspace-intelligence/goal-pack.v1.json",se="contracts/workspace-intelligence/goal-agent-handoff.v1.json",Ge="contracts/workspace-intelligence/goal-plan-result.v1.json",pe="contracts/workspace-intelligence/goal-index.v1.json",ue=new Set(["node","bun","deno","python","go","java","dotnet","rust","php","ruby","elixir","clojure","scala","kotlin","c","cpp"]);function Ce(e,t){let r=e.match(/[A-Za-z0-9][A-Za-z0-9+#.%_-]*/g)??[],n=new Set(t.map(m=>m.toLocaleLowerCase("en-US").replace(/[^a-z0-9]/g,"")).filter(Boolean)),a=[];for(let m=0;m<r.length;){let b=0;for(let u=Math.min(4,r.length-m);u>=1;u-=1){let j=r.slice(m,m+u).join("").toLocaleLowerCase("en-US").replace(/[^a-z0-9]/g,"");if(n.has(j)){b=u;break}}if(b>0){m+=b;continue}a.push(r[m]),m+=1;}let s=a.findIndex((m,b)=>{let u=m.toLocaleLowerCase("en-US"),j=a[b+1]?.toLocaleLowerCase("en-US");return u==="without"&&["breaking","changing","modifying","removing"].includes(j??"")||u==="while"&&["keeping","maintaining","preserving"].includes(j??"")}),l=s>=2?a.slice(0,s):a,d=l.length>=2?l.join(" "):e;if(s<2)return [d];let p=a.slice(s).filter(m=>!["without","while","breaking","changing","modifying","removing","keeping","maintaining","preserving"].includes(m.toLocaleLowerCase("en-US")));return p.length>0?[d,p.join(" ")]:[d]}function ie(e){return e.split(C.sep).join("/")}function V(e,t){return C.resolve(t.absolutePath??C.join(e,t.path))}function ce(e){let t=e.requested.trim().replace(/^project:/,"");if(!t)throw new Error("Project goal scope must name a project.");let r=C.isAbsolute(t)?C.resolve(t):null,n=e.model.projects.filter(a=>a.name===t||ie(a.path)===ie(t)||r!==null&&V(e.workspacePath,a)===r);if(n.length!==1)throw new Error(n.length===0?`Project goal scope was not found in the canonical model: ${t}`:`Project goal scope is ambiguous in the canonical model: ${t}`);return n[0]}async function Ae(e){let t=await a$1(e);if(t.status==="miss")throw new Error(`Canonical model and live graph evidence are required (${t.reason}). Run \`workspai workspace intelligence run --for-agent generic --strict --json\` or retry with --refresh.`);let{model:r,graph:n}=t;return a(r,"contracts/workspace-intelligence/workspace-model.v1.json","Goal source model"),a(n,"contracts/workspace-intelligence/workspace-knowledge-graph.v1.json","Goal source graph"),b$1(n,r),{model:r,graph:n}}function le(e){let t=e.scope.trim();if(t==="workspace")return {kind:"workspace",projects:e.model.projects.map(n=>n.name).sort(),selectionSource:e.selectionSource,resolution:"selected"};let r=t.startsWith("projects:")?"projects:":t.startsWith("project:")&&t.slice(8).includes(",")?"project:":null;if(r){let n=t.slice(r.length).split(",").map(l=>l.trim()).filter(Boolean);if(n.length<2)throw new Error("A project-set Goal scope must name at least two projects.");let a=n.map(l=>ce({workspacePath:e.workspacePath,model:e.model,requested:l})),s=[...new Set(a.map(l=>l.name))].sort();if(s.length!==n.length)throw new Error("A project-set Goal scope must not contain duplicate projects.");return {kind:"project-set",projects:s,selectionSource:e.selectionSource,resolution:"selected"}}if(t)return {kind:"project",projects:[ce({workspacePath:e.workspacePath,model:e.model,requested:t}).name],selectionSource:e.selectionSource,resolution:"selected"};throw new Error("Goal scope cannot be empty.")}async function Re(e){if(e.explicitScope?.trim())return {scope:le({workspacePath:e.workspacePath,model:e.model,scope:e.explicitScope,selectionSource:"explicit"}),selectionRequired:false};if(e.invocationProjectPath){let t=C.resolve(e.invocationProjectPath),r=e.model.projects.filter(n=>V(e.workspacePath,n)===t);if(r.length!==1)throw new Error("The invocation project is not represented uniquely in the canonical workspace model. Refresh intelligence or pass --scope explicitly.");return {scope:{kind:"project",projects:[r[0].name],selectionSource:"invocation-project",resolution:"selected"},selectionRequired:false}}if(e.model.projects.length===1)return {scope:{kind:"project",projects:[e.model.projects[0].name],selectionSource:"single-project-workspace",resolution:"selected"},selectionRequired:false};if(e.selectScope){let t=await e.selectScope({workspaceName:e.model.workspace.name,projects:e.model.projects.map(n=>({name:n.name,runtime:n.runtime,runtimeCandidates:[...n.runtimeCandidates].sort(),framework:n.framework})).sort((n,a)=>n.name.localeCompare(a.name))}),r=t.kind==="workspace"?"workspace":t.projects.length===1?`project:${t.projects[0]}`:`projects:${t.projects.join(",")}`;return {scope:le({workspacePath:e.workspacePath,model:e.model,scope:r,selectionSource:"interactive"}),selectionRequired:false}}return {scope:{kind:"workspace",projects:e.model.projects.map(t=>t.name).sort(),selectionSource:"workspace",resolution:"selection-required"},selectionRequired:true}}function Se(e,t){if(t.kind==="workspace")return {entities:e.quality.entityCount,relationships:e.quality.relationCount,proofs:e.quality.proofCount,unresolved:e.quality.unknownCount,proofCoveragePercent:Number((e.quality.relationProofCoverageRatio*100).toFixed(2))};let r=new Set(t.projects),n=e.entities.filter(p=>p.projectId!==void 0&&r.has(p.projectId)),a=new Set(n.map(p=>p.id)),s=e.relations.filter(p=>a.has(p.from)||a.has(p.to)),l=new Set([...n.flatMap(p=>p.proofIds),...s.flatMap(p=>p.proofIds)]),d=s.filter(p=>p.proofIds.length>0).length;return {entities:n.length,relationships:s.length,proofs:l.size,unresolved:s.length-d,proofCoveragePercent:s.length===0?100:Number((d/s.length*100).toFixed(2))}}function Ee(e){let t=new Map;for(let n of e){let a=t.get(n.kind)??[];a.push(n),t.set(n.kind,a);}let r=[];for(let n=0;[...t.values()].some(a=>n<a.length);n+=1)for(let a of t.values()){let s=a[n];s&&r.push(s);}return r}async function Ie(e){let t=C.join(e.workspacePath,p.intelligenceRun),r=await _.readJson(t).catch(()=>null),a=(Array.isArray(r?.stages)?r.stages:[]).filter(o=>o.status==="blocked"||o.status==="failed").map(o=>String(o.id??"unknown")).sort(),s=r?.status,l={status:s==="passed"?"passed":s==="blocked"||s==="failed"?"blocked":"unknown",artifact:p.intelligenceRun,blockedStages:a},d={status:"not-applicable",runtime:null,runtimeChoices:[],runner:null,existingEvidence:[],prerequisites:[]};if(e.intent.category==="test-coverage"){let o=e.intent.requestedTarget?.runtime;if(e.intent.ambiguities.some(P=>P.startsWith("Coverage scope is ambiguous")||P.startsWith("The Goal names multiple coverage runtimes")||P.startsWith("The selected projects do not share a common canonical coverage runtime")||P.startsWith("The requested ")))d={status:"requires-setup",runtime:o??null,runtimeChoices:e.coverageRuntimeChoices,runner:null,existingEvidence:[],prerequisites:["Select exactly one detected runtime or language for this coverage Goal."]};else {let P=o?e.projects.filter(c=>c.runtimeCandidates.includes(o)):e.projects,i=await Promise.all(P.map(async c=>({project:c,capability:await c$3(V(e.workspacePath,c),o??(ue.has(c.runtime)?c.runtime:"unknown"))}))),h=i.map(c=>c.capability.status);d={status:h.includes("unsupported")?"unsupported":h.includes("requires-setup")?"requires-setup":"available",runtime:i.length===1?i[0].capability.runtime:[...new Set(i.map(c=>c.capability.runtime))].join(","),runtimeChoices:e.coverageRuntimeChoices,runner:i.length===1?i[0].capability.runner:[...new Set(i.flatMap(c=>c.capability.runner?[c.capability.runner]:[]))].join(",")||null,existingEvidence:i.flatMap(c=>c.capability.existingEvidence.map(A=>({project:c.project.name,...A}))).filter((c,A,w)=>w.findIndex(k=>k.project===c.project&&k.path===c.path&&k.sha256===c.sha256)===A).sort((c,A)=>c.project.localeCompare(A.project)||c.path.localeCompare(A.path)),prerequisites:[...new Set(i.flatMap(c=>c.capability.prerequisites))].sort()};}}let p$1=oe(e.intent),m=[...Ce(p$1[0],e.projects.map(o=>o.name)),...p$1.slice(1)].filter((o,y,P)=>P.indexOf(o)===y).slice(0,3),b=m.map((o,y)=>{let P=o.match(/[A-Za-z0-9][A-Za-z0-9+#.%_-]*/g)?.length??0,i=y===0&&P>=4?2:1,h=e.projects.map(w=>{let k=G=>f$2(e.graph,{query:o,projectId:w.name,...G?{kind:G}:{},limit:60,relationsPerEntity:0,minimumTermMatches:i}).entities,S=k(),de=[...new Set(e.graph.entities.filter(G=>G.projectId===w.name||G.projectId===void 0&&G.identity.scope==="workspace").map(G=>G.kind))].flatMap(G=>k(G).slice(0,8)),U=[...S,...de];return U.filter((G,me)=>U.findIndex(ge=>ge.id===G.id)===me)}),c=[],A=new Set;for(let w=0;h.some(k=>w<k.length);w+=1)for(let k of h){let S=k[w];!S||A.has(S.id)||(A.add(S.id),c.push(S));}return Ee(c)}),u={"test-coverage":["test-suite"],"dependency-security":["package","module"],"release-readiness":["pipeline","deployment","lifecycle-stage"],"defect-repair":["test-suite","lifecycle-stage"],"feature-change":["project","runtime-unit","api","package","module","test-suite"],refactor:["package","module","api","test-suite"],performance:["lifecycle-stage","test-suite","pipeline"],documentation:["document","decision"],"system-understanding":["project","service","api","package","protocol"]},j=new Set(e.projects.map(o=>o.name)),v=e.graph.entities.filter(o=>o.proofIds.length>0&&(!o.projectId||j.has(o.projectId))&&u[e.intent.category].includes(o.kind)).sort((o,y)=>u[e.intent.category].indexOf(o.kind)-u[e.intent.category].indexOf(y.kind)||o.label.localeCompare(y.label)),f=[],M=new Set,E=o=>{!o||f.length>=20||M.has(o.id)||(M.add(o.id),f.push(o));},I=(e.intent.statement.match(/[A-Za-z][A-Za-z0-9+#.-]{1,}/g)??[]).length>=2,g=I?b[0]??[]:[];for(let o of g.slice(0,12))E(o);if(!I)for(let o of v)E(o);for(let o=0;f.length<20&&b.slice(1).some(y=>o<y.length);o+=1)for(let y of b.slice(1))E(y[o]);if(I)for(let o of v)E(o);for(let o of g.slice(12))E(o);let T=f.map(o=>({entityId:o.id,kind:o.kind,label:o.label,proofIds:o.proofIds.slice(0,12)})),L=b[0]?.length??0;return {workspaceIntelligence:l,measurement:d,retrieval:{status:I&&L>=3?"grounded":T.length>0?"partial":"empty",strategy:"deterministic-category-v1",queries:m,anchors:T}}}async function Te(e$1){let t=C.join(e$1,f$1);if(!await _.pathExists(t))return {schemaVersion:e,generatedAt:new Date(0).toISOString(),activeGoalId:null,goals:[]};let r=await _.readJson(t);a(r,pe,"Goal index");try{i(r);}catch(n){let a=h(r);if(!(a!==null&&n instanceof Error&&n.message==="Goal index is inconsistent: activeGoalId must identify the only selected actionable lifecycle entry.")||!a)throw n;return a}return r}function xe(e$1,t,r){let n=e$1.goals.find(l=>l.id===t.id),a=t.state==="ready-to-plan",s={id:t.id,fingerprint:t.fingerprint,objective:t.intent.statement,category:t.intent.category,state:t.state,lifecycle:n?.lifecycle==="cancelled"?"cancelled":a?"active":"planned",scope:t.scope,createdAt:n?.createdAt??t.generatedAt,updatedAt:r,goalPack:t.artifacts.goalPack,agentHandoff:t.artifacts.agentHandoff,...n?.verifiedGoalId?{verifiedGoalId:n.verifiedGoalId}:{},...n?.repairTransactionId?{repairTransactionId:n.repairTransactionId}:{},...n?.repairTransactionIds?{repairTransactionIds:n.repairTransactionIds}:{},...n?.changeTransactionId?{changeTransactionId:n.changeTransactionId}:{},...n?.changeTransactionIds?{changeTransactionIds:n.changeTransactionIds}:{},...n?.verificationReceipt?{verificationReceipt:n.verificationReceipt}:{}};return {schemaVersion:e,generatedAt:r,activeGoalId:s.lifecycle==="active"?t.id:e$1.activeGoalId===t.id?null:e$1.activeGoalId,goals:[...e$1.goals.filter(l=>l.id!==t.id).map(l=>s.lifecycle==="active"&&l.lifecycle==="active"?{...l,lifecycle:"planned",updatedAt:r}:l),s].sort((l,d)=>l.id.localeCompare(d.id))}}async function et(e){let t=b({startPath:C.resolve(e.startPath),explicitWorkspacePath:e.workspacePath,strict:true,requireProjectMembership:!e.scope?.trim()});if(!t)throw new Error("No canonical Workspai workspace could be resolved.");let r=C.resolve(t.workspacePath);e.refresh&&await c({workspacePath:r,strict:false,agent:"generic"});let{model:n,graph:a$1}=await Ae(r),s=await Re({workspacePath:r,invocationProjectPath:t.projectPath,model:n,explicitScope:e.scope,selectScope:e.selectScope}),l=s.scope,d$2=n.projects.filter(i=>l.projects.includes(i.name));if(d$2.length===0)throw new Error("A Goal Pack requires at least one registered project in its selected scope.");let p$1=e.maxAttempts??5;if(!Number.isInteger(p$1)||p$1<1||p$1>25)throw new Error("--max-attempts must be an integer from 1 to 25.");let m=new Date().toISOString(),b$1=d(n),u=d$2.map(i=>({name:i.name,runtimes:[...new Set(i.runtimeCandidates.filter(h=>ue.has(h)))].sort()})),j$1=[...new Set(u.flatMap(i=>i.runtimes))].sort(),v=u.length<=1?j$1:u[0].runtimes.filter(i=>u.every(h=>h.runtimes.includes(i))),f$2=K(e.intent,{availableCoverageRuntimes:v,...e.runtime?{selectedCoverageRuntime:e.runtime}:v.length===1?{selectedCoverageRuntime:v[0]}:{}});if(e.runtime&&!v.includes(e.runtime)){let i=e.runtime,h=u.filter(c=>!c.runtimes.includes(i)).map(c=>c.name);throw new Error(d$2.length>1&&h.length>0?`--runtime ${e.runtime} is not canonical for every project in the selected Goal scope. Missing from: ${h.join(", ")}. Split the projects into runtime-compatible Goal scopes.`:`--runtime ${e.runtime} is not present in the canonical Workspace Model for the selected Goal scope. Available runtimes: ${v.join(", ")||"none"}.`)}if(e.runtime&&f$2.category!=="test-coverage")throw new Error("--runtime is valid only for a test-coverage Goal.");if(e.runtime&&f$2.requestedTarget?.runtime&&f$2.requestedTarget.runtime!==e.runtime)throw new Error(`--runtime ${e.runtime} conflicts with the ${f$2.requestedTarget.runtime} runtime named in the Goal intent.`);if(!s.selectionRequired&&f$2.category==="test-coverage"&&f$2.requestedTarget&&!f$2.requestedTarget.runtime&&v.length>1&&!e.runtime&&e.selectCoverageRuntime){let i=await e.selectCoverageRuntime({workspaceName:n.workspace.name,scope:l,projects:d$2.map(h=>({name:h.name,runtime:h.runtime,runtimeCandidates:[...h.runtimeCandidates].sort()})),runtimes:v});if(!v.includes(i))throw new Error("The selected coverage runtime is outside the canonical Goal scope.");f$2=K(e.intent,{availableCoverageRuntimes:v,selectedCoverageRuntime:i});}!s.selectionRequired&&f$2.category==="test-coverage"&&d$2.length>1&&v.length===0&&(f$2={...f$2,ambiguities:[`The selected projects do not share a common canonical coverage runtime: ${u.map(i=>`${i.name} (${i.runtimes.join(", ")||"none"})`).join("; ")}. Split them into runtime-compatible Goal scopes so every selected project is verified.`,...f$2.ambiguities]}),s.selectionRequired&&(f$2={...f$2,ambiguities:[`Goal scope is unresolved across ${l.projects.length} registered projects: ${l.projects.join(", ")}. Select one project, multiple projects, or the entire workspace.`,...f$2.ambiguities]});let M=await Ie({workspacePath:r,projects:d$2,graph:a$1,intent:f$2,coverageRuntimeChoices:v}),E={generatedAt:m,intent:f$2,workspaceName:n.workspace.name,scope:l,sourceBinding:{model:{artifact:p.model,schemaVersion:q.model,hashAlgorithm:"sha256",hashSemantics:"workspace-model-structural-v1",hash:b$1,generatedAt:n.generatedAt},graph:{artifact:p.knowledgeGraph,schemaVersion:q.knowledgeGraph,hashAlgorithm:"sha256",hashSemantics:"canonical-json-v1",hash:c$1(a$1),generatedAt:a$1.generatedAt,modelHash:a$1.source.hash,...a$1.source.inputs?.hash?{inputHash:a$1.source.inputs.hash}:{}}},preflight:M,baseline:{projectCount:d$2.length,runtimes:[...new Set(d$2.flatMap(i=>i.runtimeCandidates))].sort(),frameworks:[...new Set(d$2.map(i=>i.framework))].sort(),graph:Se(a$1,l)},maxAttempts:p$1,consumer:e.consumer??"generic"},I={digestCanonical:c$1},{goalPack:g,handoff:T}=j(E,I);a(g,ae,"Goal Pack"),a(T,se,"Goal agent handoff");let L=false,o=async()=>{let i=C.join(r,g.artifacts.goalPack),h=C.join(r,g.artifacts.agentHandoff),[c,A]=await Promise.all([_.pathExists(i),_.pathExists(h)]);if(c!==A)throw new Error(`Goal Pack instance is incomplete and cannot be resumed: ${g.id}`);if(!c)return;let[w,k]=await Promise.all([_.readJson(i),_.readJson(h)]);a(w,ae,"Persisted Goal Pack"),a(k,se,"Persisted goal agent handoff");let S=j({...E,generatedAt:w.generatedAt,sourceBinding:w.sourceBinding},I);if(w.id!==g.id||k.goalId!==g.id||c$1(w)!==c$1(S.goalPack)||c$1(k)!==c$1(S.handoff))throw new Error(`Goal Pack instance failed immutable integrity validation: ${g.id}`);g=w,T=k,L=true;};if(e.dryRun)await o();else {let i$2=`.workspai/goals/${g.id}/publication`;await f(r,i$2,async()=>{await o();let h=xe(await Te(r),g,new Date().toISOString());a(h,pe,"Goal index"),i(h),await i$1(r,d$1,L?[{relativePath:d$1,payload:g},{relativePath:f$1,payload:h}]:[{relativePath:g.artifacts.goalPack,payload:g},{relativePath:g.artifacts.agentHandoff,payload:T},{relativePath:d$1,payload:g},{relativePath:f$1,payload:h}]);});}let y=[g.artifacts.goalPack,g.artifacts.agentHandoff,d$1,f$1],P={schemaVersion:c$2,result:g.state==="needs-confirmation"?"needs-confirmation":g.state==="blocked"?"blocked":g.state==="needs-evidence"?"needs-evidence":"planned",resolution:{source:t.source,invocationScope:t.projectPath?"project":"workspace"},goalPack:g,agentHandoff:T,writtenArtifacts:e.dryRun?[]:L?[d$1,f$1]:y,dryRun:e.dryRun===true,resumed:L};return a(P,Ge,"Goal plan result"),P}export{et as a};
|
package/dist/chunk-YP436V7Q.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-B6FJ6RG6.js';import {k,q as q$1,G as G$1}from'./chunk-CMLLERGG.js';import {a}from'./chunk-LMOTDLJF.js';import {c,j}from'./chunk-OH6LV5JP.js';import {m as m$2}from'./chunk-7NKM6EHE.js';import {e,f}from'./chunk-6B7L4NZE.js';import {b}from'./chunk-UJXE4UAX.js';import {m as m$1,t,k as k$1,u,l}from'./chunk-VQZ5PI5J.js';import fe,{promises}from'fs';import c$1 from'path';import J,{homedir}from'os';import {pathToFileURL}from'url';import m from'process';import h from'fs-extra';var R=["backend","frontend","desktop","agent","extension","gaming"],te=[{id:"backend",label:"Backend",hint:"APIs and services"},{id:"frontend",label:"Frontend",hint:"Web applications"},{id:"desktop",label:"Desktop",hint:"Native desktop applications"},{id:"agent",label:"AI Agent",hint:"Governed agent runtimes"},{id:"extension",label:"Extension",hint:"Editor and platform extensions"},{id:"gaming",label:"Gaming",hint:"Game runtimes and tooling"}];function oe(t){let o=t.label.indexOf(" \u2014 ");return o>=0?t.label.slice(o+3).trim():t.label.trim()}function ne(t){return R.includes(t.category)?t.category:null}function G(t){let e=c().flatMap(n=>{let s=ne(n);return s?[{value:n.id,label:`${U(s)} \xB7 ${oe(n)}`,hint:`${n.runtime} \xB7 tested baseline`,name:n.label,category:s}]:[]}),o=k().map(n=>({value:n.kitId,label:`Frontend \xB7 ${n.displayName}`,hint:"official \xB7 latest stable",name:`${n.displayName} \u2014 ${n.framework}`,category:"frontend"})),r=q$1().map(n=>({value:n.kitId,label:`${U(n.category)} \xB7 ${n.displayName}`,hint:`${n.runtimeCandidates.join(" + ")} \xB7 official latest stable`,name:`${n.displayName} \u2014 ${n.category}`,category:n.category})),a=G$1().map(n=>({value:n.id,label:`AI Agent \xB7 ${n.label}`,hint:`${n.runtime} \xB7 release-admitted baseline`,name:n.label,category:"agent"})),i=[...e,...o,...r,...a].filter(n=>!t||n.category===t).sort((n,s)=>{let l=R.indexOf(n.category),d=R.indexOf(s.category);return l-d||(n.label??"").localeCompare(s.label??"")});return B(i),i}function je(){let t=new Set(G().map(e=>e.category));return te.filter(e=>t.has(e.id)).map(e=>({value:e.id,label:e.label,hint:e.hint}))}function U(t){return t.charAt(0).toUpperCase()+t.slice(1)}function B(t){let e=new Set,o=new Set;for(let r of t){let a=r.label??r.name??String(r.value),i=String(r.value);if(e.has(a))throw new Error(`Duplicate kit picker label: ${a}`);if(o.has(i))throw new Error(`Duplicate kit picker value: ${i}`);e.add(a),o.add(i);}}var ie=".workspairc.json",ae=".rapidkitrc.json",se=["workspai.config.js","workspai.config.mjs","workspai.config.cjs","rapidkit.config.js","rapidkit.config.mjs","rapidkit.config.cjs"],ce=["workspai.config.json","rapidkit.config.json"];function Y(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="ENOENT"}function x(t,e){let o=e instanceof Error?e.message:String(e),r=t.endsWith(".js")&&/module is not defined in ES module scope/i.test(o)?' CommonJS syntax in a .js config is not valid when the project package uses "type": "module"; rename the file to .cjs or use export default.':"";return `Failed to load Workspai config at ${t}.${r} Cause: ${o}`}async function nt(){for(let t of [c$1.join(J.homedir(),ie),c$1.join(J.homedir(),ae)])try{let e$1=await promises.readFile(t,"utf-8"),o=JSON.parse(e$1);return e.debug(`Loaded config from ${t}`),o}catch{}return e.debug("No user config found, using defaults"),{}}async function rt(t=process.cwd(),e$1={}){let o=t,r=c$1.parse(o).root;for(;o!==r;){for(let a of ce){let i=c$1.join(o,a);try{let n=await promises.readFile(i,"utf-8"),s=JSON.parse(n);if(!s||typeof s!="object"||Array.isArray(s))throw new Error("configuration root must be a JSON object");return e.debug(`Loaded data-only Workspai config from ${a}`),s}catch(n){if(Y(n))continue;throw new Error(x(i,n))}}for(let a of se){let i=c$1.join(o,a);try{await promises.access(i);}catch(n){if(Y(n))continue;throw new Error(x(i,n))}if(e.debug(`Found config file: ${i}`),!e$1.trustExecutableConfig)throw new Error(`Refusing to execute Workspai config at ${i} without explicit trust. Use a data-only workspai.config.json file, pass --trust-config, or set WORKSPAI_TRUST_CONFIG=1.`);try{let s=await import(pathToFileURL(i).href),l=s.default||s;return e.debug(`Loaded Workspai config from ${a}`),l}catch(n){throw new Error(x(i,n))}}o=c$1.dirname(o);}return e.debug("No Workspai config file found, using defaults"),{}}function it(t,e,o){return {author:o.author||e.workspace?.defaultAuthor||t.author,pythonVersion:o.pythonVersion||e.workspace?.pythonVersion||t.pythonVersion,defaultInstallMethod:o.defaultInstallMethod||e.workspace?.installMethod||t.defaultInstallMethod,defaultKit:o.defaultKit||e.projects?.defaultKit||t.defaultKit,skipGit:o.skipGit??e.projects?.skipGit??t.skipGit,license:o.license||t.license,testRapidKitPath:o.testRapidKitPath||t.testRapidKitPath}}function at(t){return f("DEV_PATH")||t.testRapidKitPath||void 0}var E=class extends Error{constructor(o,r){super(["Workspai workspaces cannot be nested.",`Target: ${o}`,`Containing workspace: ${r}`,"Choose Managed home or pass --output <path> with a location outside the current workspace."].join(`
|
|
2
|
-
`));this.targetPath=o;this.containingWorkspacePath=r;this.name="NestedWorkspaceCreationError";}targetPath;containingWorkspacePath;code="WORKSPACE_NESTING_NOT_SUPPORTED"};async function de(t){try{return !!await h.stat(t)}catch{return false}}function pe(t,e){let o=t.indexOf(e);if(o>=0&&o+1<t.length)return t[o+1];let r=t.find(a=>a.startsWith(`${e}=`));if(r)return r.slice(e.length+1)}function ue(t){return t.includes("--here")}async function H(t){let e=c$1.resolve(t);for(;;){let o=[c$1.join(e,".workspai-workspace"),c$1.join(e,".rapidkit-workspace"),c$1.join(e,".workspai","workspace.json"),c$1.join(e,".rapidkit","workspace.json")];if((await Promise.all(o.map(de))).some(Boolean))return e;let r=c$1.dirname(e);if(r===e)return;e=r;}}async function yt(t){let e=c$1.resolve(t),o=await H(c$1.dirname(e));if(o)throw new E(e,o)}async function me(t,e=homedir()){let r=[{value:"managed",label:"Managed home",hint:l(e)}];return await H(t)||r.push({value:"here",label:"Current directory",hint:t}),r}function z(t,e=m.cwd()){if(ue(t))return c$1.resolve(e);let o=pe(t,"--output");if(o)return c$1.resolve(o)}function ht(t,e=m.cwd()){let o=c$1.resolve(t),r=c$1.resolve(e),a=c$1.relative(r,o);return a.length>0&&!a.startsWith("..")&&!c$1.isAbsolute(a)?`cd ${a}`:`cd ${o}`}function kt(t,e={}){let o=e.argv??[],r=e.outputParent??z(o,m.cwd());return m$1(t.trim(),{homeDir:e.homeDir,outputDir:r})}function Pt(t,e,o={}){return t?c$1.resolve(t)===c$1.resolve(e)?true:o.outputParent===void 0:false}async function wt(t,e={}){let o=e.cwd??m.cwd(),r=e.homeDir??homedir(),a=z(t,o);if(a!==void 0)return a;let i=e.hasYes??(t.includes("--yes")||t.includes("-y"));if(!(e.interactive??(!i&&!!m.stdin.isTTY&&!b())))return;let s=await me(o,r);if(s.length===1)return;let{location:l}=await b$1([{type:"rawlist",name:"location",message:"Where should the workspace be created?",choices:s,default:0}]);if(l==="here")return c$1.resolve(o)}var ge=["minimal","python-only","node-only","go-only","java-only","dotnet-only","polyglot","enterprise"],ye=new Set(["minimal","node-only","go-only","java-only","dotnet-only"]),Ft=new Set(["python-only","polyglot","enterprise"]);function he(t){return typeof t=="string"&&ge.includes(t)}function At(t){return he(t)&&ye.has(t)}var X={"python-only":"python","node-only":"node","go-only":"go","java-only":"java","dotnet-only":"dotnet"},ke={python:"Python",node:"Node",go:"Go",java:"Java",dotnet:".NET",php:"PHP",ruby:"Ruby",rust:"Rust",elixir:"Elixir",clojure:"Clojure",scala:"Scala",kotlin:"Kotlin",deno:"Deno",bun:"Bun",c:"C",cpp:"C++",unknown:"Unknown"},Pe={python:"python-only",node:"node-only",go:"go-only",java:"java-only",dotnet:"dotnet-only"},q=["node","deno","bun","python","go","java","kotlin","scala","dotnet","php","ruby","rust","elixir","clojure","c","cpp","unknown"];function v(t){return t==="bun"||t==="deno"?"node":t==="kotlin"||t==="scala"?"java":t}function I(t){return typeof t!="string"||t.trim().length===0?"minimal":t.trim().toLowerCase()}function g(t){if(typeof t!="string")return "unknown";let e=t.trim().toLowerCase();return e==="python"||e==="node"||e==="go"||e==="java"||e==="dotnet"||e==="php"||e==="ruby"||e==="rust"||e==="elixir"||e==="clojure"||e==="scala"||e==="kotlin"||e==="deno"||e==="bun"||e==="c"||e==="cpp"?e:e==="c++"||e==="cplusplus"||e==="cc"||e==="clang++"||e==="g++"?"cpp":e==="clang"||e==="gcc"?"c":"unknown"}function w(t){let e=new Set;for(let o of t)e.add(g(o));return [...e].sort((o,r)=>q.indexOf(o)-q.indexOf(r))}function we(t){let e=w(t).filter(o=>o!=="unknown");if(e.length!==0)return e.length===1?Pe[e[0]]:"polyglot"}function Q(t,e={}){return `npx workspai bootstrap --profile ${t}${e.ci?" --ci --json":""}`}function be(t,e){return t?"none":e==="strict"?"error":"warning"}function y(t){let e=t.ok?void 0:we(t.runtimes)??"polyglot";return {ok:t.ok,checkId:t.checkId,status:t.ok?"passed":"failed",profile:t.profile,runtimes:t.runtimes,message:t.message,recommendedProfile:e,recommendedCommand:e?Q(e):void 0,ciRecommendedCommand:e?Q(e,{ci:true}):void 0,severity:be(t.ok,t.mode)}}function $t(t){let e=I(t.profile),o=w(t.runtimes),r=t.mode??"warn",a=X[e];if(a){let i=o.length===0||o.every(n=>v(n)===a);return y({ok:i,checkId:`profile.${e}`,profile:e,runtimes:o,message:i?`${e} profile validated for discovered projects.`:`${e} profile mismatch: detected runtimes [${o.join(", ")}].`,mode:r})}if(e==="minimal"){let i=o.filter(l=>l!=="unknown"),s=new Set(i.map(l=>v(l))).size<=1;return y({ok:s,checkId:"profile.minimal",profile:e,runtimes:o,message:s?"minimal profile is compatible with detected runtime mix.":`minimal profile mismatch: multiple runtimes detected [${i.join(", ")}].`,mode:r})}return y({ok:true,checkId:`profile.${e}`,profile:e,runtimes:o,message:`${e} profile accepts the detected runtime mix.`,mode:r})}function Kt(t){let e=I(t.profile),o=g(t.runtime),r=t.mode??"warn",a=X[e];if(!a||o==="unknown")return y({ok:true,checkId:`profile.${e}`,profile:e,runtimes:[o],message:o==="unknown"?`Project "${t.subjectLabel}" runtime is unknown; profile compatibility will be checked by workspace doctor.`:`${e} profile accepts project "${t.subjectLabel}".`,mode:r});let i=v(o)===a;return y({ok:i,checkId:`profile.${e}`,profile:e,runtimes:i?[o]:w([a,o]),message:i?`Project "${t.subjectLabel}" is compatible with workspace profile "${e}".`:`Project "${t.subjectLabel}" is ${ke[o]}, but workspace profile is "${e}".`,mode:r})}async function St(t$1){let e=(await Promise.all(t(t$1,"policies.yml").map(async o=>await h.pathExists(o)?o:null))).find(o=>typeof o=="string");if(!e)return "warn";try{return (await h.readFile(e,"utf-8")).match(/^\s*mode:\s*(warn|strict)\s*(?:#.*)?$/m)?.[1]==="strict"?"strict":"warn"}catch{return "warn"}}async function _t(t$1){let e=(await Promise.all(t(t$1,"workspace.json").map(async o=>await h.pathExists(o)?o:null))).find(o=>typeof o=="string");if(!e)return "minimal";try{let o=await h.readJson(e);return I(o.profile)}catch{return "minimal"}}async function Lt(t,e={}){let o=new Set,r=[],a$1=new Set,i=[t];for(;i.length>0;){let n=i.pop();if(!n||a$1.has(n))continue;a$1.add(n);let s=[];try{s=await fe.promises.readdir(n,{withFileTypes:true});}catch{continue}for(let l of s){if(!l.isDirectory()||l.name.startsWith(".")||["node_modules","dist","build","target","coverage","htmlcov"].includes(l.name))continue;let d=c$1.join(n,l.name);if(d!==t&&k$1(d))continue;if((await Promise.all([...u(d,"context.json"),...u(d,"project.json")].map(async ee=>h.pathExists(ee)))).some(Boolean)){r.push(d);continue}i.push(d);}}for(let n of r){if(e.excludeProjectPath&&c$1.resolve(n)===c$1.resolve(e.excludeProjectPath))continue;let s=j(n);o.add(g(m$2(n,s).runtime));}for(let n of await a(t))e.excludeProjectPath&&c$1.resolve(n.path)===c$1.resolve(e.excludeProjectPath)||o.add(g(n.runtime));for(let n of e.additionalRuntimes??[])o.add(g(n));return w(o)}function Nt(t,e={}){let o=e.ci?t.ciRecommendedCommand:t.recommendedCommand;return o?`Recommended: ${o}`:null}export{G as a,je as b,nt as c,rt as d,it as e,at as f,yt as g,ht as h,kt as i,Pt as j,wt as k,Ft as l,At as m,$t as n,Kt as o,St as p,_t as q,Lt as r,Nt as s};
|
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-D4AMCZJU.js';import {c}from'./chunk-DT3LRKZQ.js';import {a as a$1}from'./chunk-4DX4HBG3.js';import {d}from'./chunk-ZI54C2AO.js';import {r}from'./chunk-O2CFT2A3.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-FS3WLRQ4.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as resolveWorkspaceRunStageTimeoutMs,b as runWorkspaceStage}from'./chunk-D4AMCZJU.js';export{a as WORKSPACE_RUN_LAST_REPORT_FILENAME}from'./chunk-BR6QIYQS.js';
|