workspai 0.69.0 → 0.71.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/workspace-intelligence/decision-event.v1.json +20 -0
- package/contracts/workspace-intelligence/goal-lifecycle-result.v1.json +19 -0
- package/contracts/workspace-intelligence/proof-carrying-change-capsule.v1.json +1 -0
- package/dist/analyze-4YQ67OCK.js +1 -0
- package/dist/{artifact-remediation-plan-JHHZ4L24.js → artifact-remediation-plan-URQL5MBN.js} +1 -1
- package/dist/autopilot-release-V3A3YCDD.js +1 -0
- package/dist/capabilities-command-NFGX42CH.js +1 -0
- package/dist/chunk-26VNCHVV.js +8 -0
- package/dist/{chunk-3G5FF2JZ.js → chunk-2KJNASF3.js} +1 -1
- package/dist/chunk-37SWTS2B.js +1 -0
- package/dist/{chunk-37ZLNFV5.js → chunk-4CE3GI4Y.js} +2 -2
- package/dist/chunk-554W2TXP.js +9 -0
- package/dist/{chunk-OU3BBWH5.js → chunk-5HURQABR.js} +5 -5
- package/dist/chunk-7V3YDKMG.js +4 -0
- package/dist/{chunk-MAWHHHU3.js → chunk-ACCWXKZW.js} +2 -2
- package/dist/{chunk-WZ5V5U2K.js → chunk-AUQLOQ2S.js} +1 -1
- package/dist/chunk-AUVWD3WV.js +2 -0
- package/dist/chunk-C563KVBD.js +1 -0
- package/dist/{chunk-N2Q4MSSP.js → chunk-CX6PAQTQ.js} +5 -5
- package/dist/chunk-FE5R6EUV.js +2 -0
- package/dist/{chunk-AD4ZY3RF.js → chunk-FFE2JZZJ.js} +8 -8
- package/dist/{chunk-EBEAJIBI.js → chunk-GL3KLNIG.js} +1 -1
- package/dist/{chunk-BM2F5C4J.js → chunk-H64KAPJJ.js} +1 -1
- package/dist/chunk-HMKDU7OU.js +2 -0
- package/dist/{chunk-IBJEQHJR.js → chunk-HV6EQMUJ.js} +24 -7
- package/dist/{chunk-EG6EZ7HW.js → chunk-IOKEF3DE.js} +1 -1
- package/dist/{chunk-A3MYO55A.js → chunk-IRLKWRLP.js} +2 -2
- package/dist/chunk-JK6XEF7K.js +6 -0
- package/dist/{chunk-ABMB6MJT.js → chunk-K2LKJBQ4.js} +1 -1
- package/dist/{chunk-V6TIT6M3.js → chunk-L5IV2SI4.js} +1 -1
- package/dist/{chunk-M37ALD4V.js → chunk-LOXR5QUX.js} +1 -1
- package/dist/{chunk-KFTJVVJR.js → chunk-M2R6UXJB.js} +1 -1
- package/dist/{chunk-XPGCFVGC.js → chunk-QHHSSIMZ.js} +1 -1
- package/dist/chunk-RMGSMDJW.js +5 -0
- package/dist/chunk-TD5TQZEG.js +2 -0
- package/dist/{chunk-YKY4JFCF.js → chunk-XVTN5DDV.js} +1 -1
- package/dist/chunk-XY537LCX.js +1 -0
- package/dist/chunk-YC676TPF.js +1 -0
- package/dist/chunk-YS34N35Y.js +2 -0
- package/dist/chunk-ZOE43SGQ.js +1 -0
- package/dist/{create-GWBQ74ZI.js → create-HSHAZYAK.js} +1 -1
- package/dist/{doctor-OQAXSMEM.js → doctor-VZ2MZ7EI.js} +1 -1
- package/dist/{dotnet-webapi-clean-XL4IBUQV.js → dotnet-webapi-clean-VJX6SGGP.js} +39 -33
- package/dist/{goal-lifecycle-YWBVQ2DF.js → goal-lifecycle-NKSCALES.js} +1 -1
- package/dist/{goal-pack-KUXPZVNO.js → goal-pack-MPKW4K6F.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 +102 -102
- package/dist/pipeline-RIA5UXUC.js +5 -0
- package/dist/{project-agent-entry-H3JAGNLS.js → project-agent-entry-GQAPCSOT.js} +1 -1
- package/dist/{project-intelligence-lens-7NMKHV5N.js → project-intelligence-lens-5I2GQBWC.js} +1 -1
- package/dist/{project-test-coverage-3DKZKLWY.js → project-test-coverage-4RRCHY5W.js} +1 -1
- package/dist/proof-carrying-change-T33C2SSD.js +1 -0
- 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-MK5MXGRY.js +1 -0
- package/dist/{workspace-TJHCETBV.js → workspace-AZKZPG45.js} +1 -1
- package/dist/{workspace-agent-sync-Z35NTXCB.js → workspace-agent-sync-CGK44F3O.js} +1 -1
- package/dist/{workspace-context-KNJQUJWC.js → workspace-context-S6ZWRUFZ.js} +1 -1
- package/dist/{workspace-contract-VIUQT5SZ.js → workspace-contract-Y7WRHLYR.js} +1 -1
- package/dist/{workspace-explain-HM6GMK26.js → workspace-explain-CSJL3GJR.js} +1 -1
- package/dist/{workspace-feedback-YSPEGCON.js → workspace-feedback-D6HJLKBQ.js} +1 -1
- package/dist/{workspace-foundation-PLXFPI3J.js → workspace-foundation-LLND2WIF.js} +1 -1
- package/dist/{workspace-graph-stream-FNRQ2FTB.js → workspace-graph-stream-PHFO2J2E.js} +1 -1
- package/dist/{workspace-history-HDDFG6LH.js → workspace-history-WWPS4U7H.js} +1 -1
- package/dist/{workspace-intelligence-QLSD5EEV.js → workspace-intelligence-ND2N3B2A.js} +1 -1
- package/dist/{workspace-intelligence-runner-4EW4T2OW.js → workspace-intelligence-runner-LHHJM2AT.js} +1 -1
- package/dist/{workspace-knowledge-graph-EEOW5VAJ.js → workspace-knowledge-graph-NOGGGENE.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-7XHZNRFK.js +1 -0
- package/dist/workspace-mcp-serve-6NVF7AS6.js +3 -0
- package/dist/{workspace-model-NCOOY5LC.js → workspace-model-VOQOEDVU.js} +1 -1
- package/dist/{workspace-onboarding-JNC7ZFMR.js → workspace-onboarding-ZRLUMBLE.js} +1 -1
- package/dist/{workspace-readme-OV2ADTLW.js → workspace-readme-HA6XLDME.js} +2 -2
- package/dist/{workspace-registry-summary-ONT4VOJX.js → workspace-registry-summary-NWZK5IKS.js} +1 -1
- package/dist/workspace-repair-engine-VUOCH66O.js +3 -0
- package/dist/workspace-run-3YZTVOU6.js +1 -0
- package/dist/{workspace-verify-MLABQUWK.js → workspace-verify-4EQI3MCW.js} +1 -1
- package/dist/{workspace-watch-MJOG5AZ3.js → workspace-watch-BPRU2X7K.js} +1 -1
- package/docs/README.md +39 -34
- package/docs/README_CONTENT_CONTRACT.md +14 -9
- package/docs/ci-workflows.md +1 -1
- package/docs/commands-reference.md +41 -33
- package/docs/contracts/PROOF_CARRYING_CHANGE_CONTRACT_PLAN.md +6 -3
- package/docs/native-kit-baselines.md +82 -0
- package/docs/proof-carrying-change.implementation.v1.json +3 -2
- package/docs/proof-carrying-change.md +42 -8
- package/docs/real-world-qualification.md +8 -3
- package/docs/workspace-knowledge-graph.md +6 -2
- package/docs/workspace-run.md +16 -0
- package/package.json +1 -1
- package/dist/analyze-GPYPXXRT.js +0 -1
- package/dist/autopilot-release-FL47VMF7.js +0 -1
- package/dist/capabilities-command-MYSLJIYS.js +0 -1
- package/dist/chunk-2LZWBUJD.js +0 -1
- package/dist/chunk-3HFFKW4Q.js +0 -2
- package/dist/chunk-ERVWW5HX.js +0 -1
- package/dist/chunk-GSSJJS5M.js +0 -6
- package/dist/chunk-I3UCODXU.js +0 -1
- package/dist/chunk-MBICKDYP.js +0 -1
- package/dist/chunk-MHQHRMKU.js +0 -5
- package/dist/chunk-OZXCNVGW.js +0 -2
- package/dist/chunk-RVOW3BHQ.js +0 -2
- package/dist/chunk-UW4SESKD.js +0 -2
- package/dist/chunk-VNKAISFE.js +0 -8
- package/dist/chunk-W6WRT77T.js +0 -1
- package/dist/chunk-WHR5SL33.js +0 -4
- package/dist/chunk-YWZBGSFE.js +0 -9
- package/dist/chunk-YZL7ZY7J.js +0 -2
- package/dist/pipeline-PGB5TEV3.js +0 -5
- package/dist/proof-carrying-change-QFH7WI2E.js +0 -1
- package/dist/verified-goal-7XHRWYSE.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-X347REDB.js +0 -1
- package/dist/workspace-mcp-serve-NQ42PE2I.js +0 -3
- package/dist/workspace-repair-engine-WMJCYWO4.js +0 -3
- package/dist/workspace-run-3S35MDX6.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b}from'./chunk-K33JJVQZ.js';import {t}from'./chunk-ODK4LCEL.js';import {d}from'./chunk-25AWHAB5.js';import {w,x as x$1}from'./chunk-VQZ5PI5J.js';import s from'path';import {randomUUID}from'crypto';import {open,link,copyFile}from'fs/promises';import f from'fs-extra';function N(e,t){let n=s.resolve(e),r=t.trim();if(!r||s.isAbsolute(r))throw new Error(`Workspace artifact path must be non-empty and relative: ${t}`);let l=s.resolve(n,r),o=s.relative(n,l);if(o===".."||o.startsWith(`..${s.sep}`)||s.isAbsolute(o))throw new Error(`Workspace artifact path escapes workspace root: ${t}`);return l}function m(e,t){return N(e,w(t))}async function T(e,t,n="file"){let r=s.resolve(e),l=m(r,t);if(!await f.pathExists(r)||!await f.pathExists(l))return null;let[o,p,a]=await Promise.all([f.realpath(r),f.realpath(l),f.stat(l)]),c=s.relative(o,p);if(c===".."||c.startsWith(`..${s.sep}`)||s.isAbsolute(c))throw new Error(`Workspace artifact resolves outside workspace root: ${t}`);if(!(n==="file"?a.isFile():a.isDirectory()))throw new Error(`Workspace artifact is not a regular ${n}: ${t}`);return p}async function rt(e,t$1){let n=t$1.trim().replace(/\\/g,"/").replace(/^\.\//,"");if(!n||s.isAbsolute(n))return null;let r=await T(e,n);if(r)return r;let l=t.workspaceContract;for(let o of [l,x$1(l)]){let p=await T(e,o);if(!p)continue;let a=[];try{a=(await f.readJson(p)).projects??[];}catch{return null}let c=a.filter(i=>typeof i.relativePath=="string"&&typeof i.externalPath=="string"&&s.isAbsolute(i.externalPath)).map(i=>({prefix:i.relativePath.replace(/\\/g,"/").replace(/\/$/,""),root:s.resolve(i.externalPath)})).filter(({prefix:i})=>n.startsWith(`${i}/`)).sort((i,u)=>u.prefix.length-i.prefix.length);for(let i of c){let u=n.slice(i.prefix.length+1),d=s.resolve(i.root,u),w=s.relative(i.root,d);if(!w||w===".."||w.startsWith(`..${s.sep}`)||s.isAbsolute(w)||!await f.pathExists(i.root)||!await f.pathExists(d))continue;let[g,h,P]=await Promise.all([f.realpath(i.root),f.realpath(d),f.stat(d)]),v=s.relative(g,h);if(v===".."||v.startsWith(`..${s.sep}`)||s.isAbsolute(v))throw new Error(`External evidence resolves outside its contracted root: ${t$1}`);if(!P.isFile())throw new Error(`External evidence is not a regular file: ${t$1}`);return h}return null}return null}async function C(e,t,n){let r=s.resolve(e),l=s.resolve(r,t),o=s.relative(r,l);if(!o||o===".."||o.startsWith(`..${s.sep}`)||s.isAbsolute(o)||!await f.pathExists(r))return null;let p=await f.realpath(r),a=l;for(;!await f.pathExists(a);){let u=s.dirname(a);if(u===a)return null;a=u;}let c=await f.realpath(a),i=s.relative(p,c);if(i===".."||i.startsWith(`..${s.sep}`)||s.isAbsolute(i))throw new Error(n);return l}async function at(e,t$1){let n=t$1.trim().replace(/\\/g,"/").replace(/^\.\//,"");if(!n||s.isAbsolute(n))return null;let r=t.workspaceContract;for(let l of [r,x$1(r)]){let o=await T(e,l);if(!o)continue;let p=[];try{p=(await f.readJson(o)).projects??[];}catch{return null}let a=p.filter(c=>typeof c.relativePath=="string"&&typeof c.externalPath=="string"&&s.isAbsolute(c.externalPath)).map(c=>({prefix:c.relativePath.replace(/\\/g,"/").replace(/\/$/,""),root:s.resolve(c.externalPath)})).filter(({prefix:c})=>n.startsWith(`${c}/`)).sort((c,i)=>i.prefix.length-c.prefix.length);if(a.length>0){for(let c of a){let i=n.slice(c.prefix.length+1),u=await C(c.root,i,`External evidence candidate resolves outside its contracted root: ${t$1}`);if(u)return u}return null}break}return C(e,n,`Workspace evidence candidate resolves outside workspace root: ${t$1}`)}function O(e,t){return N(e,x$1(t))}async function _(e,t){let n=s.resolve(e);await f.ensureDir(n);let r=s.dirname(t);await f.ensureDir(r);let[l,o]=await Promise.all([f.realpath(n),f.realpath(r)]),p=s.relative(l,o);if(p===".."||p.startsWith(`..${s.sep}`)||s.isAbsolute(p))throw new Error(`Workspace artifact parent resolves outside workspace root: ${r}`)}async function J(e,t){let n=s.resolve(e),[r,l]=await Promise.all([f.realpath(n),f.realpath(t)]),o=s.relative(r,l);if(o===".."||o.startsWith(`..${s.sep}`)||s.isAbsolute(o))throw new Error(`Workspace artifact resolves outside workspace root: ${t}`)}function j(e){let t=e?.code;return process.platform==="win32"&&(t==="EPERM"||t==="EINVAL"||t==="ENOSYS")}function F(e,t=process.platform){if(t!=="win32")return false;let n=e?.code;return n==="EPERM"||n==="EACCES"||n==="EBUSY"}async function E(e){let t=process.platform==="win32"?6:1,n;for(let r=0;r<t;r+=1)try{await f.remove(e);return}catch(l){if(n=l,!F(l)||r===t-1)throw l;await new Promise(o=>setTimeout(o,10*2**r));}throw n}var x=new Map;async function K(e,t){let n=x.get(e)??Promise.resolve(),r,l=new Promise(p=>{r=p;}),o=n.catch(()=>{}).then(()=>l);x.set(e,o),await n.catch(()=>{});try{return await t()}finally{r(),x.get(e)===o&&x.delete(e);}}async function L(e){try{await e.sync();}catch(t){if(!j(t))throw t}}async function k(e,t,n){await _(e,t);let r=s.dirname(t),l=`${s.basename(t)}.`,o=Date.now();for(let a of await f.readdir(r)){if(!a.startsWith(l)||!a.endsWith(".tmp"))continue;let c=s.join(r,a),i=await f.stat(c).catch(()=>null);i&&o-i.mtimeMs>3e4&&await f.remove(c).catch(()=>{});}let p=`${t}.${process.pid}.${randomUUID()}.tmp`;try{await n(p);let a=await open(p,"r");try{await L(a);}finally{await a.close();}let c=Number(process.env.WORKSPAI_TEST_ATOMIC_WRITE_DELAY_MS??0);Number.isFinite(c)&&c>0&&await new Promise(i=>setTimeout(i,Math.min(c,3e4)));try{await f.rename(p,t);}catch(i){let u=i.code;if(u!=="EEXIST"&&u!=="EPERM")throw i;await f.move(p,t,{overwrite:true});}}finally{await f.remove(p).catch(()=>{});}}async function U(e,t,n,r={}){let l=m(e,t);await _(e,l);let o=`${l}.lock`;return K(o,()=>z(o,t,n,r))}async function z(e,t,n,r){let l=r.timeoutMs??1e4,o=r.staleAfterMs??3e4,p=Date.now(),a;for(;!a;)try{a=await open(e,"wx"),await a.writeFile(`${JSON.stringify({pid:process.pid,createdAt:new Date().toISOString()})}
|
|
2
|
+
`),await L(a);}catch(c){if(!(c.code==="EEXIST"||F(c)))throw a&&(await a.close().catch(()=>{}),a=void 0,await E(e).catch(()=>{})),c;a&&(await a.close().catch(()=>{}),a=void 0,await E(e).catch(()=>{}));let[d,w]=await Promise.all([f.stat(e).catch(()=>null),f.readJson(e).catch(()=>null)]),g=Number(w?.pid),h=Number.isInteger(g)&&g>0,P=false;if(h)try{process.kill(g,0),P=true;}catch(b){P=b.code==="EPERM";}let v=!h&&!!(d&&Date.now()-d.mtimeMs>o);if(h&&!P||v){await E(e).catch(()=>{});continue}if(Date.now()-p>=l)throw new Error(`Timed out waiting for workspace artifact lock: ${t}`);await new Promise(b=>setTimeout(b,20));}try{return await n()}finally{await a.close().catch(()=>{}),await E(e);}}async function nt(e,t){let n=[m(e,t),O(e,t)];for(let r of n)if(await f.pathExists(r))return await J(e,r),r;return null}async function ot(e,t,n){b(t,n);let r=m(e,t);return await k(e,r,l=>f.writeJson(l,n,{spaces:2})),d({workspacePath:e,relativePath:t}),r}async function it(e,t,n){return Y(e,t,n.map(r=>({rootPath:e,...r})))}async function Y(e,t,n){if(n.length===0)return [];let r=n.map(o=>({...o,rootPath:s.resolve(o.rootPath),path:m(o.rootPath,o.relativePath)})),l=r.find((o,p)=>r.findIndex(a=>a.path===o.path)!==p);if(l)throw new Error(`Duplicate workspace artifact transaction target: ${l.relativePath}`);for(let o of r)b(o.relativePath,o.payload);return U(e,t,async()=>{let o=randomUUID(),p=[];try{for(let a of r){let c=await f.pathExists(a.path),i={path:a.path,rootPath:a.rootPath,exists:c,backupPath:null};if(p.push(i),c){let u=`${a.path}.${process.pid}.${o}.rollback`;await J(a.rootPath,a.path);try{try{await link(a.path,u);}catch{await copyFile(a.path,u);}i.backupPath=u;}catch(d){throw await f.remove(u).catch(()=>{}),d}}}for(let a=0;a<r.length;a+=1){let c=r[a];await k(c.rootPath,c.path,u=>f.writeJson(u,c.payload,{spaces:2}));let i=Number(process.env.WORKSPAI_TEST_FAIL_ARTIFACT_SET_AFTER??0);if(Number.isInteger(i)&&i===a+1)throw new Error(`Injected artifact-set failure after ${i} write(s).`)}for(let a of r)d({workspacePath:a.rootPath,relativePath:a.relativePath});return r.map(a=>a.path)}catch(a){let i=(await Promise.allSettled(p.map(async u=>{if(!u.exists){await f.remove(u.path);return}u.backupPath&&await k(u.rootPath,u.path,d=>copyFile(u.backupPath,d));}))).filter(u=>u.status==="rejected");throw i.length>0?new AggregateError([a,...i.map(u=>u.reason)],"Workspace artifact transaction failed and rollback was incomplete."):a}finally{await Promise.all(p.map(a=>a.backupPath?f.remove(a.backupPath).catch(()=>{}):Promise.resolve()));}})}async function st(e,t,n){let r=m(e,t);return await k(e,r,l=>f.writeFile(l,n,"utf-8")),d({workspacePath:e,relativePath:t}),r}export{m as a,T as b,rt as c,at as d,O as e,U as f,nt as g,ot as h,it as i,Y as j,st as k};
|