workspai 0.70.0 → 0.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -80
- package/contracts/artifact-remediation-plan.v1.json +49 -0
- package/contracts/workspace-intelligence/goal-lifecycle-result.v1.json +19 -0
- package/contracts/workspace-repair-capabilities.v1.json +7 -1
- package/dist/analyze-5ENZTHOT.js +1 -0
- package/dist/{artifact-remediation-plan-URQL5MBN.js → artifact-remediation-plan-WDK5ISRU.js} +1 -1
- package/dist/autopilot-release-PNSWAVZG.js +1 -0
- package/dist/{chunk-EP6Q2QBU.js → chunk-2RF75G5T.js} +1 -1
- package/dist/{chunk-4R7STECB.js → chunk-5OLNT6YD.js} +63 -63
- package/dist/{chunk-GED7JURY.js → chunk-5PFFR5S7.js} +1 -1
- package/dist/{chunk-QZODGRAI.js → chunk-5TKRCE6F.js} +1 -1
- package/dist/{chunk-IGJA6GBQ.js → chunk-62YBFWHY.js} +1 -1
- package/dist/chunk-6WOFOOM7.js +7 -0
- package/dist/{chunk-ZLCLGIM6.js → chunk-7LKCWDX6.js} +1 -1
- package/dist/chunk-7Q7X4X5I.js +1 -0
- package/dist/chunk-BVWDG66W.js +1 -0
- package/dist/{chunk-DNZHKBQ3.js → chunk-COBU44T5.js} +1 -1
- package/dist/chunk-CQBM6BBP.js +2 -0
- package/dist/chunk-CY4QZ3PE.js +3 -0
- package/dist/{chunk-LE2I2E6R.js → chunk-D5RUGSBC.js} +2 -2
- package/dist/chunk-EDPUQXP6.js +5 -0
- package/dist/{chunk-IBJEQHJR.js → chunk-HV6EQMUJ.js} +24 -7
- package/dist/{chunk-V52R2W2Q.js → chunk-IX5Z6EK6.js} +1 -1
- package/dist/{chunk-N6FJZ62B.js → chunk-JQINCVK5.js} +1 -1
- package/dist/{chunk-GL3KLNIG.js → chunk-KVPTZMEV.js} +1 -1
- package/dist/{chunk-UT57IFS4.js → chunk-LDNX2R6V.js} +6 -6
- package/dist/{chunk-WUXJCSYO.js → chunk-LLEKVSMX.js} +1 -1
- package/dist/{chunk-ZPOZ6MDX.js → chunk-N2PAAQKI.js} +1 -1
- package/dist/{chunk-S2TOSHQW.js → chunk-ONV6WW7A.js} +1 -1
- package/dist/{chunk-TEMFNVO2.js → chunk-QVUVJU56.js} +1 -1
- package/dist/{chunk-AGZWDYMF.js → chunk-QYXX6G5O.js} +8 -8
- package/dist/{chunk-S42KDOGG.js → chunk-S66NO5BX.js} +1 -1
- package/dist/{chunk-KFTJVVJR.js → chunk-SATPH22S.js} +1 -1
- package/dist/{chunk-IFHM2SI6.js → chunk-SG3QRCMM.js} +1 -1
- package/dist/{chunk-Z7JIUA6I.js → chunk-SS7X2YF5.js} +1 -1
- package/dist/{chunk-IET57ZKN.js → chunk-T6KHOIEY.js} +1 -1
- package/dist/{chunk-TLMP2MGH.js → chunk-T6LCDLJ7.js} +1 -1
- package/dist/{chunk-QNHKUSBH.js → chunk-TDQ2PRHV.js} +1 -1
- package/dist/{chunk-3S2U7WRM.js → chunk-TQQEZQLC.js} +1 -1
- package/dist/{chunk-LU6CYDLN.js → chunk-UHAPXPGW.js} +1 -1
- package/dist/chunk-V4LCPLV6.js +1 -0
- package/dist/{chunk-GYN6RPNU.js → chunk-WMC2H7MJ.js} +1 -1
- package/dist/{chunk-PTSEDZIV.js → chunk-WPZUKU2B.js} +1 -1
- package/dist/chunk-X5ZNFXFI.js +1 -0
- package/dist/{create-BBALBC3U.js → create-7CWWGDXQ.js} +1 -1
- package/dist/{doctor-WWVY7NB6.js → doctor-WYBSI3GC.js} +1 -1
- package/dist/{dotnet-webapi-clean-XL4IBUQV.js → dotnet-webapi-clean-VJX6SGGP.js} +39 -33
- package/dist/{goal-lifecycle-CEUTKUNV.js → goal-lifecycle-PSPYQ4TR.js} +1 -1
- package/dist/{goal-pack-JQL3YOKT.js → goal-pack-G7SAYDIC.js} +1 -1
- package/dist/{gofiber-standard-OHHMCNMJ.js → gofiber-standard-I6ASLOEE.js} +77 -66
- package/dist/{gogin-standard-BAZXPOKL.js → gogin-standard-U2LSRLIP.js} +78 -67
- package/dist/index.js +121 -121
- package/dist/{pipeline-V46WWMP4.js → pipeline-NDV7DBB7.js} +1 -1
- package/dist/{project-agent-entry-MRAYG7QD.js → project-agent-entry-HEBGPLMX.js} +1 -1
- package/dist/{project-intelligence-lens-4BKPN4PE.js → project-intelligence-lens-QTQEZXUY.js} +1 -1
- package/dist/{project-test-coverage-4RRCHY5W.js → project-test-coverage-4BGDDBBL.js} +1 -1
- package/dist/{proof-carrying-change-B7ONTBYO.js → proof-carrying-change-SHO2E3DX.js} +1 -1
- package/dist/{rust-axum-CCJ6UCBW.js → rust-axum-JMV7UPO7.js} +25 -20
- package/dist/{springboot-standard-M5JQEJML.js → springboot-standard-OC2RS3KC.js} +41 -39
- package/dist/verified-goal-BSREU6R7.js +1 -0
- package/dist/{workspace-FJ6JRYWA.js → workspace-E3MM3AIE.js} +1 -1
- package/dist/{workspace-agent-sync-V33UGII3.js → workspace-agent-sync-NBIOSXCG.js} +1 -1
- package/dist/{workspace-context-O6UBCBEA.js → workspace-context-ZDXF6S7S.js} +1 -1
- package/dist/{workspace-contract-S2JYDA4K.js → workspace-contract-E7GVWM7W.js} +1 -1
- package/dist/{workspace-explain-RP6VJ6QM.js → workspace-explain-YB66UFAS.js} +1 -1
- package/dist/{workspace-foundation-7QXEJJKZ.js → workspace-foundation-LRLYPR36.js} +1 -1
- package/dist/{workspace-graph-stream-YY65R5EC.js → workspace-graph-stream-SJUCBPS4.js} +1 -1
- package/dist/workspace-graph-token-efficiency-BTIS6JXL.js +1 -0
- package/dist/{workspace-intelligence-LMR42ICR.js → workspace-intelligence-3IAAM3H3.js} +1 -1
- package/dist/{workspace-intelligence-benchmark-S5OXVNLC.js → workspace-intelligence-benchmark-UCGDKMDF.js} +1 -1
- package/dist/{workspace-intelligence-runner-FXFSTCHC.js → workspace-intelligence-runner-FPPKTSNK.js} +1 -1
- package/dist/{workspace-knowledge-graph-3564KQXT.js → workspace-knowledge-graph-WNQMNAVL.js} +1 -1
- package/dist/{workspace-knowledge-graph-query-WHCGPBGS.js → workspace-knowledge-graph-query-3GPXGWYN.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-MTFTCVFF.js +1 -0
- package/dist/{workspace-mcp-serve-ZK46EZUD.js → workspace-mcp-serve-KSZ2O66S.js} +1 -1
- package/dist/{workspace-model-6UMQAGUK.js → workspace-model-5FA2636K.js} +1 -1
- package/dist/{workspace-onboarding-C57OQ7XZ.js → workspace-onboarding-RJMTHN7Z.js} +1 -1
- package/dist/{workspace-registry-summary-GLQO4ZUF.js → workspace-registry-summary-WKENOFEA.js} +1 -1
- package/dist/workspace-repair-engine-4JTNNDZL.js +3 -0
- package/dist/workspace-run-HFOY2UYT.js +1 -0
- package/dist/{workspace-verify-LQHXBH2D.js → workspace-verify-37QL2JYE.js} +1 -1
- package/dist/{workspace-watch-Z32443UP.js → workspace-watch-P5X6TAFK.js} +1 -1
- package/docs/README.md +5 -2
- package/docs/README_CONTENT_CONTRACT.md +14 -9
- package/docs/ci-workflows.md +1 -1
- package/docs/commands-reference.md +53 -34
- package/docs/contracts/ARTIFACT_CATALOG.md +4 -1
- package/docs/doctor-command.md +13 -0
- package/docs/native-kit-baselines.md +82 -0
- package/docs/workspace-knowledge-graph.md +17 -2
- package/docs/workspace-repair-engine.md +9 -1
- package/docs/workspace-run.md +29 -0
- package/package.json +1 -1
- package/dist/analyze-OGWDSPXQ.js +0 -1
- package/dist/autopilot-release-QQDFEPT7.js +0 -1
- package/dist/chunk-DWL3PPLA.js +0 -1
- package/dist/chunk-EZPLMAW2.js +0 -1
- package/dist/chunk-IHKG5C6G.js +0 -1
- package/dist/chunk-IRLKWRLP.js +0 -3
- package/dist/chunk-TKXRP2B4.js +0 -1
- package/dist/chunk-U5ENEDJA.js +0 -7
- package/dist/chunk-WCJU3CFG.js +0 -1
- package/dist/chunk-XSSNM4F5.js +0 -5
- package/dist/verified-goal-YNSBL7L3.js +0 -1
- package/dist/workspace-graph-token-efficiency-WNAFAN2F.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-P27RPMV5.js +0 -1
- package/dist/workspace-repair-engine-5ZSSF3T5.js +0 -3
- package/dist/workspace-run-UGWGT3K2.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-LDNX2R6V.js';import {c as c$1}from'./chunk-LPCWROQ3.js';import {a as a$3}from'./chunk-N2PAAQKI.js';import {g as g$1}from'./chunk-D5RUGSBC.js';import {u}from'./chunk-5OLNT6YD.js';import {c as c$3}from'./chunk-X7FYEKLI.js';import {a as a$2}from'./chunk-LLEKVSMX.js';import {f,e}from'./chunk-NSH7TTSV.js';import {a}from'./chunk-MGL6DBOR.js';import {g,a as a$1,h}from'./chunk-FE5R6EUV.js';import {p,t,s}from'./chunk-ODK4LCEL.js';import c$2 from'chalk';import d from'path';import G from'fs-extra';function L(s){return s===0?"pass":s===2?"warn":"fail"}async function _(s){try{let a=G.readJsonSync(s),i=a.policyProfile,t=c$3(a).filter(n=>n.status==="blocking").map(n=>`${n.projectName}: ${n.message}`);return {policyProfile:typeof i?.name=="string"?i.name:void 0,blockers:[...new Set(t)].slice(0,12)}}catch{return {blockers:[]}}}function j(s){return s.some(a=>a.status==="fail")?"blocked":s.some(a=>a.status==="warn")?"needs-attention":"ready"}function V(s,a){if(a)return 3;let i=s.some(n=>n.status==="fail"),t=s.some(n=>n.status==="warn");return i?1:t?2:0}function K(s,a){return s===2&&!a?0:s}async function J(s){let a=await g$1(s,true),i=false;try{let{syncWorkspaceContract:t}=await import('./workspace-contract-E7GVWM7W.js');await t({workspacePath:s}),i=true;}catch{i=false;}return {sync:a,contractSynced:i}}async function U(s$1={}){let a$4=d.resolve(s$1.workspacePath??process.cwd()),i=a(a$4);if(!i)throw new Error("No Workspai workspace found in current directory or parents");let t$1=[],n=[],u$1=false,m,w,g$1,h$1=Date.now();try{let{sync:e,contractSynced:r}=await J(i),o=e.workspaceFound&&(e.added.length>0||e.skipped>=0)||e.workspaceFound?"pass":"warn";t$1.push({name:"sync",status:o,durationMs:Date.now()-h$1,summary:e.workspaceFound?`registry sync complete (${e.added.length} added, ${e.skipped} existing)${r?", contract synced":""}`:"workspace not registered in global registry; contract sync attempted"}),e.workspaceFound||n.push("workspace registry entry missing \u2014 run workspai create workspace or register manually");}catch(e){u$1=true,t$1.push({name:"sync",status:"fail",durationMs:Date.now()-h$1,summary:`sync failed: ${e instanceof Error?e.message:String(e)}`}),n.push("workspace sync stage failed");}let P=Date.now();try{let e=await u({workspace:true,json:true,quiet:true,strict:s$1.strict===true,ci:s$1.strict!==true}),r=L(e),o=await g(i,p.doctor)??a$1(i,p.doctor),l=await _(o);t$1.push({name:"doctor",status:r,durationMs:Date.now()-P,summary:r==="pass"?"doctor workspace passed":r==="warn"?"doctor workspace reported warnings":"doctor workspace did not pass",exitCode:e,evidencePath:o,policyProfile:l.policyProfile,blockers:l.blockers}),r==="fail"?n.push(...l.blockers.length>0?l.blockers.map(O=>`doctor: ${O}`):["doctor workspace gate failed"]):r==="warn"&&n.push("doctor workspace reported warnings");}catch(e){u$1=true,t$1.push({name:"doctor",status:"fail",durationMs:Date.now()-P,summary:`doctor failed: ${e instanceof Error?e.message:String(e)}`}),n.push("doctor workspace stage failed");}if(s$1.skipAnalyze)t$1.push({name:"analyze",status:"skipped",durationMs:0,summary:"analyze stage skipped"});else {let e=Date.now();try{let r=await a$2({workspacePath:i,json:true,strict:s$1.strict===true});m=d.isAbsolute(r.enterpriseControls.evidencePath)?r.enterpriseControls.evidencePath:d.join(i,r.enterpriseControls.evidencePath);let o=r.summary.verdict==="blocked"?"fail":r.summary.verdict==="needs-attention"?"warn":"pass";t$1.push({name:"analyze",status:o,durationMs:Date.now()-e,summary:`analyze verdict: ${r.summary.verdict} (score ${r.summary.score}/100)`,evidencePath:m}),o==="fail"?n.push("analyze reported blocked verdict"):o==="warn"&&n.push("analyze reported needs-attention verdict");}catch(r){u$1=true,t$1.push({name:"analyze",status:"fail",durationMs:Date.now()-e,summary:`analyze failed: ${r instanceof Error?r.message:String(r)}`}),n.push("analyze stage failed");}}let k=Date.now();try{let e=await a$3({startPath:i,writeReport:true,skipVerify:s$1.skipVerify===true});w=e.evidencePath;let r=e.overallStatus==="pass"?"pass":e.overallStatus==="warn"?"warn":"fail";t$1.push({name:"readiness",status:r,durationMs:Date.now()-k,summary:`readiness overall: ${e.overallStatus}`,evidencePath:e.evidencePath}),r==="fail"?n.push(...e.blockingReasons.map(o=>`readiness: ${o}`)):r==="warn"&&n.push(...e.gates.filter(o=>o.status==="warn").map(o=>`readiness warn: ${o.gate}: ${o.summary}`));}catch(e){u$1=true,t$1.push({name:"readiness",status:"fail",durationMs:Date.now()-k,summary:`readiness failed: ${e instanceof Error?e.message:String(e)}`}),n.push("readiness stage failed");}if(s$1.skipAutopilot)t$1.push({name:"autopilot",status:"skipped",durationMs:0,summary:"autopilot stage skipped"});else {let e=Date.now(),r=s$1.autopilotMode??"audit";try{let o=await c({workspacePath:i,mode:r,json:true,skipPipelineStages:true});g$1=o.artifacts.reportPath;let l=o.summary.verdict==="approved"?"pass":o.summary.verdict==="partial"?"warn":"fail";t$1.push({name:"autopilot",status:l,durationMs:Date.now()-e,summary:`autopilot ${r}: ${o.summary.verdict}`,exitCode:o.summary.exitCode,evidencePath:g$1}),l!=="pass"&&n.push(...o.blockingReasons.slice(0,5));}catch(o){u$1=true,t$1.push({name:"autopilot",status:"fail",durationMs:Date.now()-e,summary:`autopilot failed: ${o instanceof Error?o.message:String(o)}`}),n.push("autopilot release stage failed");}}let N=j(t$1),S=V(t$1,u$1),I=d.join(i,t.pipelineLastRun),p$1={schemaVersion:s.pipelineLastRun.schemaVersion,generatedAt:new Date().toISOString(),workspacePath:i,summary:{verdict:N,exitCode:S,stagesPassed:t$1.filter(e=>e.status==="pass").length,stagesWarn:t$1.filter(e=>e.status==="warn").length,stagesFailed:t$1.filter(e=>e.status==="fail").length},stages:t$1,blockingReasons:[...new Set(n)],artifacts:{reportPath:I,analyzeEvidencePath:m,readinessEvidencePath:w,autopilotEvidencePath:g$1}};if(s$1.writeReport!==false){let e$1=f(p$1,{commandId:"workspacePipeline",exitCode:S,generatedAt:p$1.generatedAt,blockers:p$1.blockingReasons,runId:e()});await h(i,t.pipelineLastRun,e$1);}if(s$1.writeReport!==false&&s$1.noAgentSync!==true&&process.env.RAPIDKIT_NO_AGENT_SYNC!=="1"&&s$1.agentSync!==false)try{let{syncWorkspaceAgentGrounding:e}=await import('./workspace-agent-sync-NBIOSXCG.js'),r=await e({workspacePath:i,write:true,refreshContext:true,strict:false});p$1.agentGrounding={indexPath:r.indexPath,writtenFiles:r.writtenFiles,blockers:r.blockers};}catch{}return p$1}async function ue(s){let a;try{a=await U(s);}catch(t){let n=t instanceof Error?t.message:String(t);s.json?console.log(JSON.stringify(c$1({operation:"pipeline",code:"pipeline.failed",message:n}),null,2)):console.log(c$2.red(`Pipeline failed: ${n}`)),process.exit(1);}if(s.json)console.log(JSON.stringify(a,null,2));else {console.log(c$2.bold.cyan(`
|
|
2
2
|
\u{1F517} Workspai Governance Pipeline
|
|
3
3
|
`)),console.log(c$2.bold(`Workspace: ${c$2.cyan(d.basename(a.workspacePath))}`)),console.log(c$2.gray(`Path: ${a.workspacePath}`)),console.log(c$2.white(`Verdict: ${a.summary.verdict} Exit: ${a.summary.exitCode} (${a.summary.stagesPassed} pass / ${a.summary.stagesWarn} warn / ${a.summary.stagesFailed} fail)`));for(let t of a.stages){let n=t.status==="pass"?c$2.green("PASS"):t.status==="warn"?c$2.yellow("WARN"):t.status==="skipped"?c$2.gray("SKIP"):c$2.red("FAIL");console.log(` - ${t.name}: ${n} ${t.summary}`);}if(a.blockingReasons.length>0){console.log(c$2.bold(`
|
|
4
4
|
Blocking reasons:`));for(let t of a.blockingReasons.slice(0,8))console.log(c$2.gray(` \u2022 ${t}`));}console.log(c$2.gray(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as AGENT_BOOTSTRAP_RECEIPT_SCHEMA_VERSION,f as AGENT_ENTRY_HOST_IDS,g as PROJECT_AGENT_ADAPTER_ENTRY_FILES,b as PROJECT_AGENT_ENTRY_RELATIVE_PATH,a as PROJECT_AGENT_ENTRY_SCHEMA_VERSION,e as WORKSPAI_AGENT_ENTRY_END,d as WORKSPAI_AGENT_ENTRY_START,j as buildAgentBootstrapReceipt,i as buildProjectAgentEntryManifest,h as normalizeAgentEntryHost}from'./chunk-
|
|
1
|
+
export{c as AGENT_BOOTSTRAP_RECEIPT_SCHEMA_VERSION,f as AGENT_ENTRY_HOST_IDS,g as PROJECT_AGENT_ADAPTER_ENTRY_FILES,b as PROJECT_AGENT_ENTRY_RELATIVE_PATH,a as PROJECT_AGENT_ENTRY_SCHEMA_VERSION,e as WORKSPAI_AGENT_ENTRY_END,d as WORKSPAI_AGENT_ENTRY_START,j as buildAgentBootstrapReceipt,i as buildProjectAgentEntryManifest,h as normalizeAgentEntryHost}from'./chunk-5TKRCE6F.js';
|
package/dist/{project-intelligence-lens-4BKPN4PE.js → project-intelligence-lens-QTQEZXUY.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as PROJECT_CONTEXT_AGENT_SCHEMA_VERSION,c as PROJECT_GROUNDING_MODE_VALUES,g as PROJECT_PORTABLE_GROUNDING_SKILL_PATH,e as WORKSPAI_PROJECT_GROUNDING_END,d as WORKSPAI_PROJECT_GROUNDING_START,f as WORKSPAI_PROJECT_SKILL_MARKER,i as buildProjectContextAgent,j as resolveProjectPortableSkillTransactionPaths,m as resolveWorkspaceProjectLensTargets,h as selectBoundedProjectLensEntities,k as syncProjectIntelligenceLens,l as syncWorkspaceProjectLenses}from'./chunk-
|
|
1
|
+
export{b as PROJECT_CONTEXT_AGENT_SCHEMA_VERSION,c as PROJECT_GROUNDING_MODE_VALUES,g as PROJECT_PORTABLE_GROUNDING_SKILL_PATH,e as WORKSPAI_PROJECT_GROUNDING_END,d as WORKSPAI_PROJECT_GROUNDING_START,f as WORKSPAI_PROJECT_SKILL_MARKER,i as buildProjectContextAgent,j as resolveProjectPortableSkillTransactionPaths,m as resolveWorkspaceProjectLensTargets,h as selectBoundedProjectLensEntities,k as syncProjectIntelligenceLens,l as syncWorkspaceProjectLenses}from'./chunk-5PFFR5S7.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as PROJECT_TEST_COVERAGE_ARTIFACT,a as PROJECT_TEST_COVERAGE_SCHEMA,d as collectProjectTestCoverage,c as inspectProjectTestCoverageCapability}from'./chunk-
|
|
1
|
+
export{b as PROJECT_TEST_COVERAGE_ARTIFACT,a as PROJECT_TEST_COVERAGE_SCHEMA,d as collectProjectTestCoverage,c as inspectProjectTestCoverageCapability}from'./chunk-KVPTZMEV.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{l as abortProofCarryingChange,s as assertSealedProofCarryingChangeCurrent,d as authorizeProofCarryingChange,b as beginProofCarryingChange,a as createDeletedArtifactReference,r as decisionTransactionForCapsule,n as exportProofCarryingChangeCapsule,h as findUncoveredEffectArtifacts,j as inspectProofCarryingChange,k as listProofCarryingChanges,f as recordProofCarryingChangeEffect,c as recordProofCarryingChangePrediction,g as recordProofCarryingChangeVerification,e as resumeProofCarryingChange,p as validateEffectReceiptInput,o as validatePredictedArchitectureChangeInput,m as validateProofCarryingChangeCapsule,q as validateVerificationReceiptInput,i as verifyProofCarryingChange}from'./chunk-
|
|
1
|
+
export{l as abortProofCarryingChange,s as assertSealedProofCarryingChangeCurrent,d as authorizeProofCarryingChange,b as beginProofCarryingChange,a as createDeletedArtifactReference,r as decisionTransactionForCapsule,n as exportProofCarryingChangeCapsule,h as findUncoveredEffectArtifacts,j as inspectProofCarryingChange,k as listProofCarryingChanges,f as recordProofCarryingChangeEffect,c as recordProofCarryingChangePrediction,g as recordProofCarryingChangeVerification,e as resumeProofCarryingChange,p as validateEffectReceiptInput,o as validatePredictedArchitectureChangeInput,m as validateProofCarryingChangeCapsule,q as validateVerificationReceiptInput,i as verifyProofCarryingChange}from'./chunk-ONV6WW7A.js';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
name = "${
|
|
1
|
+
import {e,a,b as b$1}from'./chunk-HV6EQMUJ.js';import {h as h$1}from'./chunk-PKKSRXUS.js';import {b as b$2,a as a$1}from'./chunk-TQEMLBAG.js';import {promises}from'fs';import e$1 from'path';import s from'chalk';import {execa}from'execa';var k="3000";function _(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").replace(/-+/g,"-")||"axum-api"}function h(t,i){return `[package]
|
|
2
|
+
name = "${t}"
|
|
3
3
|
version = "0.1.0"
|
|
4
|
-
edition = "
|
|
4
|
+
edition = "${a.rust.edition}"
|
|
5
|
+
rust-version = "${a.rust.toolchain}"
|
|
5
6
|
description = "${i.replace(/["\r\n]/g," ")}"
|
|
6
7
|
|
|
7
8
|
[dependencies]
|
|
8
|
-
axum = "
|
|
9
|
+
axum = "${a.rust.axum}"
|
|
9
10
|
serde = { version = "1", features = ["derive"] }
|
|
10
11
|
tokio = { version = "1", features = ["macros", "rt-multi-thread", "signal"] }
|
|
11
12
|
tower-http = { version = "0.6", features = ["trace"] }
|
|
@@ -14,7 +15,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
|
|
|
14
15
|
|
|
15
16
|
[dev-dependencies]
|
|
16
17
|
tower = { version = "0.5", features = ["util"] }
|
|
17
|
-
`}function
|
|
18
|
+
`}function b(t){return `use axum::{routing::get, Json, Router};
|
|
18
19
|
use serde::Serialize;
|
|
19
20
|
use std::{env, net::SocketAddr};
|
|
20
21
|
use tower_http::trace::TraceLayer;
|
|
@@ -40,7 +41,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
40
41
|
)
|
|
41
42
|
.init();
|
|
42
43
|
|
|
43
|
-
let port = env::var("PORT").unwrap_or_else(|_| "${
|
|
44
|
+
let port = env::var("PORT").unwrap_or_else(|_| "${t}".to_string());
|
|
44
45
|
let address: SocketAddr = format!("0.0.0.0:{port}").parse()?;
|
|
45
46
|
let listener = tokio::net::TcpListener::bind(address).await?;
|
|
46
47
|
info!(%address, "Axum service listening");
|
|
@@ -69,7 +70,7 @@ mod tests {
|
|
|
69
70
|
assert_eq!(response.status(), StatusCode::OK);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
`}function
|
|
73
|
+
`}function y(t){return `FROM rust:${a.rust.toolchain}-bookworm AS builder
|
|
73
74
|
WORKDIR /app
|
|
74
75
|
COPY Cargo.toml Cargo.lock* ./
|
|
75
76
|
COPY src ./src
|
|
@@ -77,12 +78,12 @@ RUN cargo build --release
|
|
|
77
78
|
|
|
78
79
|
FROM debian:bookworm-slim
|
|
79
80
|
RUN useradd --create-home --uid 10001 app
|
|
80
|
-
COPY --from=builder /app/target/release/${
|
|
81
|
+
COPY --from=builder /app/target/release/${t} /usr/local/bin/${t}
|
|
81
82
|
USER app
|
|
82
83
|
ENV PORT=3000
|
|
83
84
|
EXPOSE 3000
|
|
84
|
-
CMD ["/usr/local/bin/${
|
|
85
|
-
`}function
|
|
85
|
+
CMD ["/usr/local/bin/${t}"]
|
|
86
|
+
`}function v(){return `name: CI
|
|
86
87
|
on:
|
|
87
88
|
push:
|
|
88
89
|
pull_request:
|
|
@@ -92,16 +93,16 @@ jobs:
|
|
|
92
93
|
verify:
|
|
93
94
|
runs-on: ubuntu-latest
|
|
94
95
|
steps:
|
|
95
|
-
- uses: actions/checkout
|
|
96
|
-
- uses: dtolnay/rust-toolchain
|
|
96
|
+
- uses: actions/checkout@${a.actions.checkout}
|
|
97
|
+
- uses: dtolnay/rust-toolchain@${a.rust.toolchain}
|
|
97
98
|
with:
|
|
98
99
|
components: rustfmt, clippy
|
|
99
|
-
- uses: Swatinem/rust-cache
|
|
100
|
+
- uses: Swatinem/rust-cache@${a.actions.rustCache}
|
|
100
101
|
- run: cargo fmt --check
|
|
101
102
|
- run: cargo clippy --all-targets --all-features -- -D warnings
|
|
102
103
|
- run: cargo test --all-targets --all-features
|
|
103
104
|
- run: cargo build --release
|
|
104
|
-
`}function
|
|
105
|
+
`}function O(){return `#!/usr/bin/env sh
|
|
105
106
|
set -eu
|
|
106
107
|
COMMAND="\${1:-help}"
|
|
107
108
|
shift 2>/dev/null || true
|
|
@@ -118,7 +119,7 @@ case "$COMMAND" in
|
|
|
118
119
|
;;
|
|
119
120
|
*) echo "Unknown command: $COMMAND" >&2; exit 1 ;;
|
|
120
121
|
esac
|
|
121
|
-
`}function
|
|
122
|
+
`}function x(){return `@echo off
|
|
122
123
|
set COMMAND=%1
|
|
123
124
|
if "%COMMAND%"=="init" cargo fetch
|
|
124
125
|
if "%COMMAND%"=="dev" cargo run
|
|
@@ -128,13 +129,17 @@ if "%COMMAND%"=="test" cargo test --all-targets --all-features
|
|
|
128
129
|
if "%COMMAND%"=="lint" cargo clippy --all-targets --all-features -- -D warnings
|
|
129
130
|
if "%COMMAND%"=="format" cargo fmt --all
|
|
130
131
|
if "%COMMAND%"=="help" echo Workspai Rust/Axum commands: init, dev, start, build, test, lint, format
|
|
131
|
-
`}async function
|
|
132
|
+
`}async function A(t,i){i||await b$2(t)||await promises.stat(e$1.join(t,".git")).then(()=>true).catch(()=>false)||await execa("git",["init"],{cwd:t,reject:false,env:a$1()});}async function I(t,i){let a$1=_(i.project_name),o=i.port&&/^\d+$/.test(i.port)?i.port:k,f=i.description?.trim()||"Production-ready Axum API scaffolded by Workspai.",w=new Date().toISOString(),c=h$1();if(await promises.mkdir(t,{recursive:true}),await e(e$1.join(t,"Cargo.toml"),h(a$1,f)),await e(e$1.join(t,"rust-toolchain.toml"),`[toolchain]
|
|
133
|
+
channel = "${a.rust.toolchain}"
|
|
134
|
+
profile = "minimal"
|
|
135
|
+
components = ["clippy", "rustfmt"]
|
|
136
|
+
`),await e(e$1.join(t,"src","main.rs"),b(o)),await e(e$1.join(t,".env.example"),`PORT=${o}
|
|
132
137
|
RUST_LOG=info
|
|
133
|
-
`),await
|
|
138
|
+
`),await e(e$1.join(t,".gitignore"),`/target
|
|
134
139
|
.env
|
|
135
|
-
`),await
|
|
140
|
+
`),await e(e$1.join(t,"Dockerfile"),y(a$1)),await e(e$1.join(t,".dockerignore"),`target
|
|
136
141
|
.git
|
|
137
142
|
.env
|
|
138
|
-
`),await
|
|
143
|
+
`),await e(e$1.join(t,".github","workflows","ci.yml"),v()),await e(e$1.join(t,".github","dependabot.yml"),b$1("cargo")),await e(e$1.join(t,"rapidkit"),O()),await e(e$1.join(t,"rapidkit.cmd"),x()),await e(e$1.join(t,".workspai","context.json"),JSON.stringify({engine:"npm",runtime:"rust",framework:"axum",kind:"backend",category:"backend"},null,2)),await e(e$1.join(t,".workspai","project.json"),JSON.stringify({schema_version:"1.0",name:a$1,slug:a$1,kind:"backend",project_type:"backend",category:"backend",runtime:"rust",framework:"axum",framework_display_name:"Axum",kit_name:"rust.axum",kit:"rust.axum",engine:"npm",support_tier:"extended",module_support:false,modules:[],workspai_version:c,rapidkit_version:c,generated_by:"workspai",generated_at:w,ports:[{name:"http",port:Number(o),protocol:"http"}],contracts:{owns:[],apis:[{method:"GET",path:"/health"}],publishes:[],consumes:[],dependsOn:[],env:["PORT","RUST_LOG"]}},null,2)),process.platform!=="win32"&&await promises.chmod(e$1.join(t,"rapidkit"),493),!(i.skipInstall??false))try{await execa("cargo",["generate-lockfile"],{cwd:t,timeout:12e4}),await execa("cargo",["fetch","--locked"],{cwd:t,timeout:12e4});}catch{console.log(s.yellow(`\u26A0 Cargo dependency warm-up skipped; install Rust ${a.rust.toolchain} and run npx workspai init.`));}await A(t,i.skipGit??false),console.log(s.green(`
|
|
139
144
|
\u2705 Rust/Axum project ready!
|
|
140
|
-
`)),console.log(
|
|
145
|
+
`)),console.log(s.gray(`Next: cd ${i.project_name} && npx workspai init`));}export{k as DEFAULT_AXUM_PORT,I as generateRustAxumKit};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b,
|
|
1
|
+
import {a,d,b as b$1,e}from'./chunk-HV6EQMUJ.js';import {h}from'./chunk-PKKSRXUS.js';import {b as b$2,a as a$1}from'./chunk-TQEMLBAG.js';import {promises}from'fs';import m from'path';import r from'chalk';import j from'ora';import {execa}from'execa';var E=a.springBoot.java,M=a.springBoot.version,T=a.springBoot.springdoc;function v(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,".").replace(/^\.+|\.+$/g,"").replace(/\.{2,}/g,".").split(".").map(c=>c.replace(/^[^a-z]+/,"").replace(/[^a-z0-9]/g,"")).filter(Boolean).join(".")}function b(e,t){return e.replace(/[\r\n\t]+/g," ").trim()||t}function A(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")}function B(e,t){let p=v(e)||"com.workspai.apps",c=v(t)||"service";return `${p}.${c}`}function P(e){return e.replace(/\./g,"/")}function C(){return JSON.stringify({engine:"npm",runtime:"java"},null,2)}function D(e,t){return JSON.stringify({kit_name:"springboot.standard",runtime:"java",module_support:false,project_name:e.project_name,artifact_id:e.artifact_id,group_id:e.group_id,package_name:e.package_name,app_version:e.app_version,created_by:"workspai",workspai_version:t,rapidkit_version:t,created_at:new Date().toISOString()},null,2)}function O(e){return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
4
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
@@ -74,7 +74,7 @@ import {b,c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-PKKSRXUS.js'
|
|
|
74
74
|
<plugin>
|
|
75
75
|
<groupId>org.apache.maven.plugins</groupId>
|
|
76
76
|
<artifactId>maven-enforcer-plugin</artifactId>
|
|
77
|
-
<version>3.
|
|
77
|
+
<version>3.6.3</version>
|
|
78
78
|
<executions>
|
|
79
79
|
<execution>
|
|
80
80
|
<id>enforce-java-and-maven</id>
|
|
@@ -97,7 +97,7 @@ import {b,c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-PKKSRXUS.js'
|
|
|
97
97
|
<plugin>
|
|
98
98
|
<groupId>com.diffplug.spotless</groupId>
|
|
99
99
|
<artifactId>spotless-maven-plugin</artifactId>
|
|
100
|
-
<version>
|
|
100
|
+
<version>3.9.0</version>
|
|
101
101
|
<configuration>
|
|
102
102
|
<java>
|
|
103
103
|
<googleJavaFormat version="1.23.0" />
|
|
@@ -109,7 +109,7 @@ import {b,c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-PKKSRXUS.js'
|
|
|
109
109
|
<plugin>
|
|
110
110
|
<groupId>org.cyclonedx</groupId>
|
|
111
111
|
<artifactId>cyclonedx-maven-plugin</artifactId>
|
|
112
|
-
<version>2.
|
|
112
|
+
<version>2.9.3</version>
|
|
113
113
|
<executions>
|
|
114
114
|
<execution>
|
|
115
115
|
<phase>verify</phase>
|
|
@@ -122,7 +122,7 @@ import {b,c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-PKKSRXUS.js'
|
|
|
122
122
|
<plugin>
|
|
123
123
|
<groupId>org.owasp</groupId>
|
|
124
124
|
<artifactId>dependency-check-maven</artifactId>
|
|
125
|
-
<version>
|
|
125
|
+
<version>12.2.2</version>
|
|
126
126
|
<configuration>
|
|
127
127
|
<format>HTML</format>
|
|
128
128
|
<failBuildOnCVSS>9</failBuildOnCVSS>
|
|
@@ -131,7 +131,7 @@ import {b,c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-PKKSRXUS.js'
|
|
|
131
131
|
</plugins>
|
|
132
132
|
</build>
|
|
133
133
|
</project>
|
|
134
|
-
`}function
|
|
134
|
+
`}function V(e,t){return `package ${e.package_name};
|
|
135
135
|
|
|
136
136
|
import ${e.package_name}.config.ApplicationInfoProperties;
|
|
137
137
|
import org.springframework.boot.SpringApplication;
|
|
@@ -146,7 +146,7 @@ public class ${t} {
|
|
|
146
146
|
SpringApplication.run(${t}.class, args);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
`}function
|
|
149
|
+
`}function L(e){return `package ${e.package_name}.config;
|
|
150
150
|
|
|
151
151
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
152
152
|
|
|
@@ -157,7 +157,7 @@ public record ApplicationInfoProperties(
|
|
|
157
157
|
String version,
|
|
158
158
|
String owner
|
|
159
159
|
) {}
|
|
160
|
-
`}function
|
|
160
|
+
`}function N(e){return `package ${e.package_name}.config;
|
|
161
161
|
|
|
162
162
|
import io.swagger.v3.oas.models.OpenAPI;
|
|
163
163
|
import io.swagger.v3.oas.models.info.Contact;
|
|
@@ -180,7 +180,7 @@ public class OpenApiConfiguration {
|
|
|
180
180
|
.license(new License().name("MIT")));
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
`}function
|
|
183
|
+
`}function q(e){return `package ${e.package_name}.api.http.dto;
|
|
184
184
|
|
|
185
185
|
import java.time.Instant;
|
|
186
186
|
import java.util.List;
|
|
@@ -193,7 +193,7 @@ public record SystemInfoResponse(
|
|
|
193
193
|
List<String> profiles,
|
|
194
194
|
Instant timestamp
|
|
195
195
|
) {}
|
|
196
|
-
`}function
|
|
196
|
+
`}function W(e){return `package ${e.package_name}.application;
|
|
197
197
|
|
|
198
198
|
import ${e.package_name}.api.http.dto.SystemInfoResponse;
|
|
199
199
|
import ${e.package_name}.config.ApplicationInfoProperties;
|
|
@@ -232,7 +232,7 @@ public class SystemInfoService {
|
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
`}function
|
|
235
|
+
`}function J(e){return `package ${e.package_name}.api.http;
|
|
236
236
|
|
|
237
237
|
import ${e.package_name}.api.http.dto.SystemInfoResponse;
|
|
238
238
|
import ${e.package_name}.application.SystemInfoService;
|
|
@@ -259,7 +259,7 @@ public class SystemInfoController {
|
|
|
259
259
|
return systemInfoService.snapshot();
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
`}function
|
|
262
|
+
`}function U(e){return `package ${e.package_name}.api.http;
|
|
263
263
|
|
|
264
264
|
import java.time.Instant;
|
|
265
265
|
import java.util.Map;
|
|
@@ -292,7 +292,7 @@ public class ApiExceptionHandler {
|
|
|
292
292
|
));
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
`}function
|
|
295
|
+
`}function G(e){return `server:
|
|
296
296
|
port: \${PORT:${e.port}}
|
|
297
297
|
shutdown: graceful
|
|
298
298
|
|
|
@@ -331,7 +331,7 @@ rapidkit:
|
|
|
331
331
|
description: ${e.description}
|
|
332
332
|
version: ${e.app_version}
|
|
333
333
|
owner: ${e.author}
|
|
334
|
-
`}function
|
|
334
|
+
`}function H(){return `spring:
|
|
335
335
|
main:
|
|
336
336
|
banner-mode: off
|
|
337
337
|
|
|
@@ -340,11 +340,11 @@ management:
|
|
|
340
340
|
web:
|
|
341
341
|
exposure:
|
|
342
342
|
include: health,info
|
|
343
|
-
`}function
|
|
343
|
+
`}function F(e){return `PORT=${e.port}
|
|
344
344
|
SPRING_PROFILES_ACTIVE=local
|
|
345
345
|
API_BASE_PATH=/api/v1
|
|
346
|
-
|
|
347
|
-
`}function
|
|
346
|
+
JAVA_TOOL_OPTIONS=-Xms256m -Xmx512m
|
|
347
|
+
`}function z(e){return `FROM maven:${a.springBoot.maven}-eclipse-temurin-${e.java_version} AS build
|
|
348
348
|
WORKDIR /workspace
|
|
349
349
|
|
|
350
350
|
COPY pom.xml ./
|
|
@@ -357,12 +357,14 @@ FROM eclipse-temurin:${e.java_version}-jre
|
|
|
357
357
|
WORKDIR /app
|
|
358
358
|
|
|
359
359
|
COPY --from=build /workspace/target/*.jar /app/app.jar
|
|
360
|
+
RUN useradd --system --uid 10001 --create-home workspai && chown -R 10001:0 /app
|
|
360
361
|
|
|
361
362
|
EXPOSE ${e.port}
|
|
362
|
-
ENV
|
|
363
|
+
ENV JAVA_TOOL_OPTIONS=""
|
|
364
|
+
USER 10001
|
|
363
365
|
|
|
364
|
-
ENTRYPOINT ["
|
|
365
|
-
`}function
|
|
366
|
+
ENTRYPOINT ["java", "-jar", "/app/app.jar"]
|
|
367
|
+
`}function Y(e){return `services:
|
|
366
368
|
${e.artifact_id}:
|
|
367
369
|
build:
|
|
368
370
|
context: .
|
|
@@ -373,20 +375,20 @@ ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /app/app.jar"]
|
|
|
373
375
|
- .env
|
|
374
376
|
environment:
|
|
375
377
|
SPRING_PROFILES_ACTIVE: docker
|
|
376
|
-
`}function
|
|
378
|
+
`}function X(){return `target
|
|
377
379
|
.git
|
|
378
380
|
.idea
|
|
379
381
|
.vscode
|
|
380
382
|
node_modules
|
|
381
383
|
coverage
|
|
382
|
-
`}function
|
|
384
|
+
`}function K(){return `.idea/
|
|
383
385
|
.vscode/
|
|
384
386
|
target/
|
|
385
387
|
.mvn/
|
|
386
388
|
*.log
|
|
387
389
|
.DS_Store
|
|
388
390
|
.env
|
|
389
|
-
`}function
|
|
391
|
+
`}function Q(){return `root = true
|
|
390
392
|
|
|
391
393
|
[*]
|
|
392
394
|
charset = utf-8
|
|
@@ -398,8 +400,8 @@ trim_trailing_whitespace = true
|
|
|
398
400
|
|
|
399
401
|
[*.md]
|
|
400
402
|
trim_trailing_whitespace = false
|
|
401
|
-
`}function
|
|
402
|
-
`)}function
|
|
403
|
+
`}function Z(e){return ["name: ci","","on:"," push:"," branches: [main]"," pull_request:","","permissions:"," contents: read","","jobs:"," build-test-e2e:"," runs-on: ${{ matrix.os }}"," strategy:"," fail-fast: false"," matrix:"," os: [ubuntu-latest, windows-latest]",` java: ['${e.java_version}', '${a.springBoot.compatibilityJava}']`," steps:",` - uses: actions/checkout@${a.actions.checkout}`,` - uses: actions/setup-java@${a.actions.setupJava}`," with:"," distribution: temurin"," java-version: ${{ matrix.java }}"," cache: maven"," - name: Generate Maven Wrapper (Unix)"," if: runner.os != 'Windows'"," run: |"," if [ ! -f mvnw ]; then",` mvn -N wrapper:wrapper -Dmaven=${a.springBoot.maven}`," chmod +x mvnw"," fi"," - name: Generate Maven Wrapper (Windows)"," if: runner.os == 'Windows'"," shell: pwsh"," run: |"," if (-not (Test-Path 'mvnw.cmd')) {",` mvn -N wrapper:wrapper -Dmaven=${a.springBoot.maven}`," }"," - name: Verify (Unix)"," if: runner.os != 'Windows'"," run: ./mvnw -B verify"," - name: Verify (Windows)"," if: runner.os == 'Windows'"," run: .\\mvnw.cmd -B verify"," - name: Package (Unix)"," if: runner.os != 'Windows'"," run: ./mvnw -B -DskipTests package"," - name: Package (Windows)"," if: runner.os == 'Windows'"," run: .\\mvnw.cmd -B -DskipTests package"," - name: Security scan (Unix)"," if: runner.os != 'Windows'"," run: ./mvnw -B -DskipTests org.owasp:dependency-check-maven:check -DfailBuildOnCVSS=9"," - name: Security scan (Windows)"," if: runner.os == 'Windows'"," run: .\\mvnw.cmd -B -DskipTests org.owasp:dependency-check-maven:check -DfailBuildOnCVSS=9"," - name: Upload SCA report"," if: always()",` uses: actions/upload-artifact@${a.actions.uploadArtifact}`," with:"," name: dependency-check-report-${{ matrix.os }}-${{ matrix.java }}"," path: target/dependency-check-report.html"," if-no-files-found: ignore"," - name: Upload SBOM"," if: always()",` uses: actions/upload-artifact@${a.actions.uploadArtifact}`," with:"," name: sbom-${{ matrix.os }}-${{ matrix.java }}"," path: target/bom.xml"," if-no-files-found: ignore",""].join(`
|
|
404
|
+
`)}function ee(e){return `# ${e.project_name}
|
|
403
405
|
|
|
404
406
|
Built with Spring Boot and scaffolded by Workspai.
|
|
405
407
|
|
|
@@ -453,7 +455,7 @@ src/main/resources # Spring configuration
|
|
|
453
455
|
- This kit is npm-level and intentionally independent from rapidkit-core modules.
|
|
454
456
|
- Use environment variables for deployment concerns; Spring Boot maps them automatically.
|
|
455
457
|
- CI runs matrix build/test + dependency scan + SBOM artifact generation by default.
|
|
456
|
-
`}function
|
|
458
|
+
`}function te(e){return `#!/usr/bin/env sh
|
|
457
459
|
set -eu
|
|
458
460
|
|
|
459
461
|
PORT="${e.port}"
|
|
@@ -484,7 +486,7 @@ done
|
|
|
484
486
|
READY_EPOCH=$(date +%s)
|
|
485
487
|
echo "startup_seconds=$((READY_EPOCH - START_EPOCH))" >> "$LOG_FILE"
|
|
486
488
|
cat "$LOG_FILE"
|
|
487
|
-
`}function
|
|
489
|
+
`}function ne(e){return `#!/usr/bin/env sh
|
|
488
490
|
# Workspai Spring Boot project launcher - generated by Workspai CLI
|
|
489
491
|
|
|
490
492
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
@@ -569,7 +571,7 @@ case "$CMD" in
|
|
|
569
571
|
exit 1
|
|
570
572
|
;;
|
|
571
573
|
esac
|
|
572
|
-
`}function
|
|
574
|
+
`}function ie(){return `@echo off
|
|
573
575
|
set CMD=%1
|
|
574
576
|
if "%CMD%"=="" goto usage
|
|
575
577
|
shift
|
|
@@ -605,7 +607,7 @@ if "%CMD%"=="start" (
|
|
|
605
607
|
:usage
|
|
606
608
|
echo Available: init, dev, test, build, start
|
|
607
609
|
exit /b 1
|
|
608
|
-
`}function
|
|
610
|
+
`}function re(e,t){return `package ${e.package_name};
|
|
609
611
|
|
|
610
612
|
import org.junit.jupiter.api.Test;
|
|
611
613
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
@@ -617,7 +619,7 @@ class ${t}Tests {
|
|
|
617
619
|
void contextLoads() {
|
|
618
620
|
}
|
|
619
621
|
}
|
|
620
|
-
`}function
|
|
622
|
+
`}function oe(e){return `package ${e.package_name}.api.http;
|
|
621
623
|
|
|
622
624
|
import static org.mockito.BDDMockito.given;
|
|
623
625
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
|
@@ -631,8 +633,8 @@ import java.util.List;
|
|
|
631
633
|
import org.junit.jupiter.api.Test;
|
|
632
634
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
633
635
|
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
|
|
634
|
-
import org.springframework.boot.test.mock.mockito.MockBean;
|
|
635
636
|
import org.springframework.context.annotation.Import;
|
|
637
|
+
import org.springframework.test.context.bean.override.mockito.MockitoBean;
|
|
636
638
|
import org.springframework.test.web.servlet.MockMvc;
|
|
637
639
|
|
|
638
640
|
@WebMvcTest(SystemInfoController.class)
|
|
@@ -642,7 +644,7 @@ class SystemInfoControllerTest {
|
|
|
642
644
|
@Autowired
|
|
643
645
|
private MockMvc mockMvc;
|
|
644
646
|
|
|
645
|
-
@
|
|
647
|
+
@MockitoBean
|
|
646
648
|
private SystemInfoService systemInfoService;
|
|
647
649
|
|
|
648
650
|
@Test
|
|
@@ -663,7 +665,7 @@ class SystemInfoControllerTest {
|
|
|
663
665
|
.andExpect(jsonPath("$.environment").value("test"));
|
|
664
666
|
}
|
|
665
667
|
}
|
|
666
|
-
`}function
|
|
668
|
+
`}function ae(e){return `package ${e.package_name};
|
|
667
669
|
|
|
668
670
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
669
671
|
|
|
@@ -687,11 +689,11 @@ class ServiceRuntimeE2ETest {
|
|
|
687
689
|
assertThat(response.getBody()).containsEntry("status", "UP");
|
|
688
690
|
}
|
|
689
691
|
}
|
|
690
|
-
`}async function
|
|
691
|
-
\u26A0 Maven not found in PATH - project will be scaffolded, but init/build commands require Maven 3.9+`)),console.log(
|
|
692
|
-
`));}let
|
|
692
|
+
`}async function se(e){try{await execa("mvn",["-N","wrapper:wrapper",`-Dmaven=${a.springBoot.maven}`],{cwd:e,timeout:12e4});let t=m.join(e,"mvnw");return await promises.stat(t).then(()=>true).catch(()=>false)&&await promises.chmod(t,493),true}catch{return false}}async function _e(e$1,t){let p=A(t.artifact_id||t.project_name)||"service",c=v(t.group_id||"com.workspai.apps")||"com.workspai.apps",$=v(t.package_name||B(c,p))||"com.workspai.apps.service",i={project_name:t.project_name,artifact_id:p,group_id:c,package_name:$,author:b(t.author||"","Workspai User"),description:b(t.description||"",`Spring Boot service generated with Workspai - ${t.project_name}`),java_version:t.java_version||E,spring_boot_version:t.spring_boot_version||M,springdoc_version:t.springdoc_version||T,app_version:t.app_version||"0.1.0",port:t.port||"8080",skipGit:t.skipGit??false,skipInstall:t.skipInstall??false},y=h(),u=`${d(i.project_name)}Application`,a=P(i.package_name);if(!i.skipInstall)try{await execa("mvn",["-version"],{timeout:3e3});}catch{console.log(r.yellow(`
|
|
693
|
+
\u26A0 Maven not found in PATH - project will be scaffolded, but init/build commands require Maven 3.9+`)),console.log(r.gray(` Install: https://maven.apache.org/install.html
|
|
694
|
+
`));}let g=j(`Generating Spring Boot project: ${i.project_name}...`).start();try{let n=(l,k)=>e(m.join(e$1,l),k),R=m.join(e$1,"rapidkit"),x=m.join(e$1,"rapidkit.cmd");if(await Promise.all([n("pom.xml",O(i)),n(".gitignore",K()),n(".editorconfig",Q()),n(".env.example",F(i)),n(".dockerignore",X()),n("Dockerfile",z(i)),n("docker-compose.yml",Y(i)),n(".github/workflows/ci.yml",Z(i)),n(".github/dependabot.yml",b$1("maven")),n("README.md",ee(i)),n("src/main/resources/application.yml",G(i)),n("src/test/resources/application.yml",H()),n(`src/main/java/${a}/${u}.java`,V(i,u)),n(`src/main/java/${a}/config/ApplicationInfoProperties.java`,L(i)),n(`src/main/java/${a}/config/OpenApiConfiguration.java`,N(i)),n(`src/main/java/${a}/application/SystemInfoService.java`,W(i)),n(`src/main/java/${a}/api/http/dto/SystemInfoResponse.java`,q(i)),n(`src/main/java/${a}/api/http/SystemInfoController.java`,J(i)),n(`src/main/java/${a}/api/http/ApiExceptionHandler.java`,U(i)),n(`src/test/java/${a}/${u}Tests.java`,re(i,u)),n(`src/test/java/${a}/api/http/SystemInfoControllerTest.java`,oe(i)),n(`src/test/java/${a}/ServiceRuntimeE2ETest.java`,ae(i)),n("scripts/perf-smoke.sh",te(i)),n(".workspai/project.json",D(i,y)),n(".workspai/context.json",C()),n("rapidkit",ne(i)),n("rapidkit.cmd",ie())]),await promises.chmod(R,493),await promises.chmod(x,493),await promises.chmod(m.join(e$1,"scripts","perf-smoke.sh"),493),i.skipInstall||await se(e$1)||console.log(r.yellow("\u26A0 Maven Wrapper could not be generated automatically. Run `mvn -N wrapper:wrapper -Dmaven=3.9.9` inside the project.")),g.succeed(r.green(`Project created at ${e$1}`)),i.skipInstall)g.info(r.gray("Skipped Maven dependency warm-up (--skip-install)."));else try{g.start("Resolving Maven dependencies...");let l=m.join(e$1,process.platform==="win32"?"mvnw.cmd":"mvnw"),k=await promises.stat(l).then(()=>l).catch(()=>"mvn");await execa(k,["-B","-q","-DskipTests","dependency:go-offline"],{cwd:e$1,timeout:18e4}),g.succeed(r.gray("\u2713 maven dependency warm-up completed"));}catch{g.warn(r.yellow("\u26A0 Maven dependency warm-up failed - run manually: mvn -B -DskipTests dependency:go-offline"));}if(!i.skipGit)try{await b$2(e$1)?console.log(r.gray("\u26A0 git init skipped (target is inside an existing git worktree)")):(await execa("git",["init"],{cwd:e$1,env:a$1()}),await execa("git",["add","-A"],{cwd:e$1,env:a$1()}),await execa("git",["commit","-m","chore: initial scaffold (rapidkit springboot.standard)"],{cwd:e$1,env:a$1()}));}catch{console.log(r.yellow("\u26A0 Git initialization failed - continuing without initial commit"));}console.log(r.green(`
|
|
693
695
|
\u2728 Spring Boot project created successfully!
|
|
694
|
-
`)),console.log(
|
|
696
|
+
`)),console.log(r.cyan("\u{1F4C2} Location:"),r.white(e$1)),console.log(r.cyan(`
|
|
695
697
|
\u{1F680} Get started:
|
|
696
|
-
`)),console.log(
|
|
697
|
-
`)),console.log(
|
|
698
|
+
`)),console.log(r.white(` cd ${i.project_name}`)),console.log(r.white(" npx workspai init")),console.log(r.white(` npx workspai dev
|
|
699
|
+
`)),console.log(r.gray("Endpoints: /actuator/health, /api/v1/system/info, /docs"));}catch(n){g.fail("Failed to create Spring Boot project");try{await promises.rm(e$1,{recursive:true,force:true});}catch{}throw n}}export{E as DEFAULT_JAVA_VERSION,T as DEFAULT_SPRINGDOC_VERSION,M as DEFAULT_SPRING_BOOT_VERSION,_e as generateSpringBootKit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {d}from'./chunk-KVPTZMEV.js';import {b}from'./chunk-EDPUQXP6.js';import {c}from'./chunk-7LKCWDX6.js';import {a as a$1}from'./chunk-N2PAAQKI.js';import {q as q$2}from'./chunk-BVWDG66W.js';import {a as a$2}from'./chunk-GR6442P7.js';import {h,g}from'./chunk-FE5R6EUV.js';import {a}from'./chunk-AFIFZTOY.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 W="workspai.verified-goal.v1",A=q$1.verifiedGoalStatus,V=p.verifiedGoalStatus,J="contracts/workspace-intelligence/verified-goal.v1.json",$="contracts/workspace-intelligence/verified-goal-status.v1.json";function H(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 K(e){return createHash("sha256").update(x(e)).digest("hex")}var ae=["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"],re=new Set(ae.map(e=>e.toLowerCase())),se=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"]),F=1e5;function ne(e){return re.has(e.toLowerCase())||/\.(?:csproj|fsproj|vbproj)$/i.test(e)}async function ie(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>F)throw new Error(`Dependency safety baseline exceeded ${F} 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()){!se.has(n.name.toLowerCase())&&!a$2(n.name)&&t.push(s);continue}n.isFile()&&ne(n.name)&&a.push(s);}}return a}function oe(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 z(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 U(e,t){let r=(await q$2({workspacePath:e,includeAbsolutePaths:true})).projects.filter(o=>H(e,t,o)),i=new Map;for(let o of r){let n=u.resolve(e,o.path),s=await ie(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:oe(g),sha256:createHash("sha256").update(f).digest("hex"),...g==="package.json"?{dependencies:z(f)??{}}:{}});}}return {manifests:[...i.values()].sort((o,n)=>o.path.localeCompare(n.path))}}function O(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 ce(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 U(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=z(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=O(l),R=O(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 le(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 ue(e,t){let a=t?.trim();if(!a||a==="workspace")return {scope:{kind:"workspace"}};let r=a.startsWith("projects:")?"projects:":a.startsWith("project:")&&a.slice(8).includes(",")?"project:":null,i=a.startsWith("project:")?a.slice(8).trim():r?a.slice(r.length).trim():a;if(!i)throw new Error("Project goal scope must name a project.");let o=await q$2({workspacePath:e,includeAbsolutePaths:true});if(r){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 Y(e,t,a){return e===null?"unavailable":a==="minimum"?e>=t?"satisfied":"unsatisfied":e<=t?"satisfied":"unsatisfied"}async function X(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 de(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 pe(e){let t=e.dependencyAudit;return t&&typeof t=="object"&&!Array.isArray(t)?t:null}async function Q(e,t){let a=await g(e,p.doctor),r=await X(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=de(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(pe).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:Y(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 Z(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 B(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:Y(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 ee(e){if(e.scope.kind==="project"){if(!e.scope.projectPath)throw new Error("Coverage goal project scope does not have a project path.");return B({projectPath:e.scope.projectPath,target:e.target,run:e.run,runtime:e.runtime})}let t=await q$2({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=>H(e.workspacePath,e.scope,l)),r=e.runtime,i=r?a.filter(l=>l.runtimeCandidates.includes(r)):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 B({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 ge(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 me(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 fe(e){return e.kind==="release-readiness"?Z(e.workspacePath):e.kind==="dependency-security"?Q(e.workspacePath,e.scope):(await ee({workspacePath:e.workspacePath,scope:e.scope,target:e.target,run:false,runtime:e.runtime})).measurement}async function Ee(e){let t=u.resolve(e.workspacePath),a$1=Math.max(0,Math.min(100,Math.round(e.target??80))),{scope:r}=await ue(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=K(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 te(t,n);if(m.fingerprint===o)return {goal:m,status:d,resumed:d.state!=="verified"}}let c=new Date().toISOString(),g=await fe({workspacePath:t,kind:e.kind,scope:r,target:a$1,runtime:e.runtime}),f={schemaVersion:W,id:n,fingerprint:o,createdAt:c,updatedAt:c,workspace:{name:u.basename(t),path:t},scope:r,kind:e.kind,summary:ge({kind:e.kind,scope:r,target:a$1,runtime:e.runtime}),constraints:i.constraints,criteria:me(e.kind,a$1,e.runtime),baseline:g,...e.kind==="dependency-security"?{dependencySafetyBaseline:await U(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,J,"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 te(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,J,"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!==W||i.schemaVersion!==A||r.id!==i.goalId||r.fingerprint!==i.goalFingerprint||r.fingerprint!==K(le(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 q(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({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 Ge(e){let t=u.resolve(e.workspacePath),{goal:a$1,status:r}=await te(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 Z(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 X(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 Q(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 ce(a$1)),n.status==="satisfied"&&o.push(...await q({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 ee({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 q({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,W as VERIFIED_GOAL_SCHEMA_VERSION,A as VERIFIED_GOAL_STATUS_SCHEMA_VERSION,Ee as planVerifiedGoal,te as readVerifiedGoal,Ge as verifyVerifiedGoal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as captureWorkspaceRegistrationStrict,k as createProject,j as createWorkspace,m as createWorkspaceShareBundle,l as listWorkspaces,a as normalizeWorkspaceEntry,i as registerProjectInWorkspace,h as registerProjectInWorkspaceStrict,f as registerWorkspace,b as registerWorkspaceStrict,d as restoreWorkspaceRegistrationStrict,g as syncWorkspaceProjects,e as unregisterWorkspaceStrict}from'./chunk-
|
|
1
|
+
export{c as captureWorkspaceRegistrationStrict,k as createProject,j as createWorkspace,m as createWorkspaceShareBundle,l as listWorkspaces,a as normalizeWorkspaceEntry,i as registerProjectInWorkspace,h as registerProjectInWorkspaceStrict,f as registerWorkspace,b as registerWorkspaceStrict,d as restoreWorkspaceRegistrationStrict,g as syncWorkspaceProjects,e as unregisterWorkspaceStrict}from'./chunk-D5RUGSBC.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as AGENT_CUSTOMIZATION_PACK_REPORT_PATH,e as AGENT_CUSTOMIZATION_PACK_SCHEMA,f as AGENT_REPORTS_INDEX_PATH,d as AGENT_REPORTS_INDEX_SCHEMA,h as AGENT_REPORT_CATALOG,i as buildCanonicalAgentReportReadOrder,j as buildWorkspaceAgentReportsIndex,k as parseAgentGroundingTargets,l as syncWorkspaceAgentGrounding}from'./chunk-
|
|
1
|
+
export{g as AGENT_CUSTOMIZATION_PACK_REPORT_PATH,e as AGENT_CUSTOMIZATION_PACK_SCHEMA,f as AGENT_REPORTS_INDEX_PATH,d as AGENT_REPORTS_INDEX_SCHEMA,h as AGENT_REPORT_CATALOG,i as buildCanonicalAgentReportReadOrder,j as buildWorkspaceAgentReportsIndex,k as parseAgentGroundingTargets,l as syncWorkspaceAgentGrounding}from'./chunk-COBU44T5.js';export{f as AGENT_GROUNDING_DOC_PATH,g as LEGACY_AGENT_GROUNDING_DOC_PATH,L as LEGACY_COPILOT_GROUNDING_SKILL_PATH,x as LEGACY_COPILOT_WORKSPACE_INSTRUCTIONS_PATH,N as LEGACY_COPILOT_WORKSPACE_INTELLIGENCE_SKILL_PATH,m as LEGACY_CURSOR_GROUNDING_RULE_PATH,T as LEGACY_MCP_DESIGN_REPORT_PATH,V as LEGACY_VSCODE_AGENT_HOOKS_PATH,K as WORKSPAI_COPILOT_GROUNDING_SKILL_PATH,w as WORKSPAI_COPILOT_WORKSPACE_INSTRUCTIONS_PATH,M as WORKSPAI_COPILOT_WORKSPACE_INTELLIGENCE_SKILL_PATH,j as WORKSPAI_CURSOR_DIAGNOSE_RULE_PATH,i as WORKSPAI_CURSOR_EVIDENCE_RULE_PATH,h as WORKSPAI_CURSOR_GROUNDING_RULE_PATH,l as WORKSPAI_CURSOR_RELEASE_RULE_PATH,k as WORKSPAI_CURSOR_REPAIR_RULE_PATH,S as WORKSPAI_MCP_DESIGN_REPORT_PATH,U as WORKSPAI_VSCODE_AGENT_HOOKS_PATH,n as WORKSPAI_WINDSURF_RULES_PATH}from'./chunk-QYEQVNBF.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as WORKSPACE_CONTEXT_AGENT_REPORT_PATH,a as WORKSPACE_CONTEXT_SCHEMA_VERSION,c as buildWorkspaceAgentContext,d as writeWorkspaceAgentContext}from'./chunk-
|
|
1
|
+
export{b as WORKSPACE_CONTEXT_AGENT_REPORT_PATH,a as WORKSPACE_CONTEXT_SCHEMA_VERSION,c as buildWorkspaceAgentContext,d as writeWorkspaceAgentContext}from'./chunk-JQINCVK5.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as WORKSPACE_CONTRACT_PATH,i as WORKSPACE_CONTRACT_SCHEMA_VERSION,h as WORKSPACE_CONTRACT_VERIFY_REPORT_PATH,j as WORKSPACE_CONTRACT_VERIFY_SCHEMA_VERSION,k as WorkspaceContractVerificationError,m as buildWorkspaceContract,q as buildWorkspaceContractGraph,l as discoverProjectJsonFiles,p as readWorkspaceContract,o as syncWorkspaceContract,r as verifyWorkspaceContract,n as writeWorkspaceContract,s as writeWorkspaceContractVerifyEvidence}from'./chunk-
|
|
1
|
+
export{g as WORKSPACE_CONTRACT_PATH,i as WORKSPACE_CONTRACT_SCHEMA_VERSION,h as WORKSPACE_CONTRACT_VERIFY_REPORT_PATH,j as WORKSPACE_CONTRACT_VERIFY_SCHEMA_VERSION,k as WorkspaceContractVerificationError,m as buildWorkspaceContract,q as buildWorkspaceContractGraph,l as discoverProjectJsonFiles,p as readWorkspaceContract,o as syncWorkspaceContract,r as verifyWorkspaceContract,n as writeWorkspaceContract,s as writeWorkspaceContractVerifyEvidence}from'./chunk-WPZUKU2B.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as buildWorkspaceExplain,a as resolveWorkspaceExplainArtifactPath,c as writeWorkspaceExplainReport}from'./chunk-
|
|
1
|
+
export{b as buildWorkspaceExplain,a as resolveWorkspaceExplainArtifactPath,c as writeWorkspaceExplainReport}from'./chunk-T6KHOIEY.js';export{c as WORKSPACE_EXPLAIN_REPORT_PATH,e as WORKSPACE_TRACE_REPORT_PATH,d as WORKSPACE_WHY_REPORT_PATH}from'./chunk-QYEQVNBF.js';export{e as WORKSPACE_MODEL_DIFF_REPORT_PATH}from'./chunk-QVUVJU56.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c as c$1}from'./chunk-
|
|
1
|
+
import {c as c$1}from'./chunk-TQQEZQLC.js';import {a}from'./chunk-2LIVMG5C.js';import c from'path';import u from'fs-extra';async function W(t,r){let o=await a(t),d=o?.name||c.basename(t),n,i=c.join(t,".python-version");if(await u.pathExists(i)){let a=(await u.readFile(i,"utf-8")).trim();a&&(n=a);}let e=r?.profile||"polyglot",m=e==="python-only"||e==="polyglot"||e==="enterprise",f=r?.installMethod||o?.metadata?.npm?.installMethod||(m?"poetry":"venv"),s=await c$1(t,{workspaceName:d,installMethod:f,pythonVersion:n,profile:e,writeMarker:true,writeGitignore:true,onlyIfMissing:!r?.force}),{publishWorkspaceRegistrySummary:y}=await import('./workspace-registry-summary-WKENOFEA.js');return await y(t),{workspacePath:t,created:s,status:s.length>0?"passed":"skipped"}}export{W as ensureWorkspaceFoundation};
|