workspai 0.46.0 → 0.47.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 +61 -12
- package/contracts/agent-customization-pack.v1.json +6 -1
- package/contracts/bootstrap-compliance.v1.json +14 -0
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +4 -0
- package/contracts/extension-cli-compatibility.v1.json +7 -1
- package/contracts/mirror-ops.v1.json +16 -0
- package/contracts/published-contract-catalog.v1.json +31 -0
- package/contracts/runtime-command-surface.v1.json +149 -1
- package/contracts/transparency-evidence.v1.json +13 -0
- package/contracts/workspace-contract.v1.json +78 -0
- package/contracts/workspace-intelligence/workspace-context.v1.json +20 -0
- package/contracts/workspace-intelligence/workspace-graph-token-efficiency.v1.json +72 -0
- package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +6 -1
- package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +200 -0
- package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +260 -0
- package/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +60 -0
- package/contracts/workspace-intelligence-architecture.v1.json +6 -3
- package/contracts/workspace-intelligence-chain.v1.json +14 -3
- package/contracts/workspace-share-bundle.v1.json +16 -0
- package/dist/analyze-UVXPRGYZ.js +1 -0
- package/dist/artifact-remediation-plan-EPALZ2LC.js +3 -0
- package/dist/autopilot-release-5BQ6F5L2.js +1 -0
- package/dist/chunk-22NJ2ZMG.js +2 -0
- package/dist/{chunk-UQWOVV6V.js → chunk-2GHUZDYA.js} +1 -1
- package/dist/chunk-2TEDAKP6.js +2 -0
- package/dist/chunk-6SWRNA47.js +4 -0
- package/dist/chunk-76YOPAOT.js +1 -0
- package/dist/chunk-7VLCK5JW.js +1 -0
- package/dist/{chunk-J5PIZCAU.js → chunk-BSRVO52Y.js} +1 -1
- package/dist/chunk-COARSXRC.js +1 -0
- package/dist/chunk-CV5HKU4P.js +1 -0
- package/dist/chunk-CW7PGBIQ.js +13 -0
- package/dist/{chunk-WPEEC5BX.js → chunk-DV6GJD4K.js} +1 -1
- package/dist/chunk-FB7SCXAZ.js +1 -0
- package/dist/{chunk-4LGXSBCN.js → chunk-HSGFUKCN.js} +1 -1
- package/dist/{chunk-ZKAI3PJE.js → chunk-ITCAMC2E.js} +1 -1
- package/dist/chunk-KB44JP4M.js +2 -0
- package/dist/{chunk-QA5BGEQW.js → chunk-KZZ36CK5.js} +1 -1
- package/dist/chunk-LNRAB7UY.js +1 -0
- package/dist/{chunk-VFDM65IE.js → chunk-MEMHNE7Y.js} +22 -22
- package/dist/chunk-NOFM7MNA.js +2 -0
- package/dist/chunk-NRYS4CLR.js +2 -0
- package/dist/chunk-OA537ZQ5.js +1 -0
- package/dist/chunk-PBHP6JNY.js +8 -0
- package/dist/chunk-QDWYIRHR.js +8 -0
- package/dist/chunk-RWRLFSKW.js +2 -0
- package/dist/chunk-SK6XRKGG.js +1 -0
- package/dist/chunk-THIOE2PB.js +2 -0
- package/dist/chunk-TNQI5VCW.js +36 -0
- package/dist/chunk-TWNFECMN.js +2 -0
- package/dist/{chunk-6IIZJQLV.js → chunk-U5EZHZBX.js} +1 -1
- package/dist/{chunk-YUATNVOT.js → chunk-VBSQ7MF6.js} +19 -19
- package/dist/chunk-WDKNMTJQ.js +1 -0
- package/dist/chunk-YCL3I2JO.js +2 -0
- package/dist/chunk-ZDN7RHXJ.js +1 -0
- package/dist/chunk-ZM5NQ5Z2.js +1 -0
- package/dist/{create-WCV3L6XH.js → create-7JKJDAQV.js} +1 -1
- package/dist/{doctor-5BWM2EMJ.js → doctor-PGPNIS76.js} +1 -1
- package/dist/index.d.ts +33 -12
- package/dist/index.js +317 -317
- package/dist/pipeline-IB6ILJSV.js +5 -0
- package/dist/{workspace-7OXW5YTJ.js → workspace-H3QXBFGB.js} +1 -1
- package/dist/{workspace-agent-sync-O4IA6VOA.js → workspace-agent-sync-C7SG2Z5W.js} +1 -1
- package/dist/{workspace-archive-H74NBBNW.js → workspace-archive-P76EDIUG.js} +1 -1
- package/dist/{workspace-context-R7IPUBPG.js → workspace-context-BKQBKA4C.js} +1 -1
- package/dist/workspace-contract-RPQQBQXR.js +1 -0
- package/dist/workspace-dependency-graph-23BI2HG7.js +1 -0
- package/dist/workspace-explain-WVN7JH3U.js +1 -0
- package/dist/{workspace-explain-contract-SVFJAAEI.js → workspace-explain-contract-SEFTVF6J.js} +1 -1
- package/dist/{workspace-feedback-REOS36ZZ.js → workspace-feedback-WAID3IOE.js} +1 -1
- package/dist/{workspace-foundation-KXT4QI5O.js → workspace-foundation-5OOJEO2D.js} +1 -1
- package/dist/workspace-graph-token-efficiency-CFGFCJ5V.js +1 -0
- package/dist/{workspace-history-OGOVSKZG.js → workspace-history-C6OP3IAQ.js} +1 -1
- package/dist/workspace-intelligence-VKDL3H2J.js +1 -0
- package/dist/workspace-intelligence-runner-LVALAZY7.js +1 -0
- package/dist/workspace-knowledge-graph-FE2NTZKV.js +1 -0
- package/dist/workspace-knowledge-graph-change-overlay-XG6FC4IX.js +1 -0
- package/dist/workspace-knowledge-graph-query-VOSPPH4W.js +1 -0
- package/dist/workspace-mcp-serve-KT2I676Z.js +3 -0
- package/dist/workspace-model-S33CIB2R.js +1 -0
- package/dist/workspace-model-hash-MHXK5MEI.js +1 -0
- package/dist/{workspace-registry-summary-SZ46R5PD.js → workspace-registry-summary-A3YDL63D.js} +1 -1
- package/dist/workspace-run-M4LNJILC.js +1 -0
- package/dist/{workspace-verify-MFQ7IXGD.js → workspace-verify-ZGH3NXAH.js} +1 -1
- package/dist/workspace-watch-EVBJTMV7.js +1 -0
- package/docs/AI_DYNAMIC_INTEGRATION.md +73 -428
- package/docs/AI_EXAMPLES.md +37 -395
- package/docs/AI_FEATURES.md +76 -456
- package/docs/AI_QUICKSTART.md +49 -212
- package/docs/GLOSSARY.md +60 -0
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +68 -7
- package/docs/README.md +63 -41
- package/docs/commands-reference.md +51 -4
- package/docs/config-file-guide.md +6 -2
- package/docs/contracts/ARTIFACT_CATALOG.md +67 -37
- package/docs/contracts/README.md +44 -8
- package/docs/graph-benchmark-methodology.md +121 -0
- package/docs/workspace-knowledge-graph.md +295 -0
- package/docs/workspace-operations.md +49 -0
- package/package.json +2 -1
- package/dist/analyze-BEBEZSZK.js +0 -1
- package/dist/artifact-remediation-plan-FFQSESAM.js +0 -3
- package/dist/autopilot-release-WUR4CQIT.js +0 -1
- package/dist/chunk-2G7FASAO.js +0 -2
- package/dist/chunk-4EPHWD27.js +0 -8
- package/dist/chunk-CVHMUSRX.js +0 -1
- package/dist/chunk-DIPD72H4.js +0 -2
- package/dist/chunk-EFYHGCGX.js +0 -2
- package/dist/chunk-FWRXA435.js +0 -2
- package/dist/chunk-HDURFXW5.js +0 -2
- package/dist/chunk-HMUKBW2S.js +0 -4
- package/dist/chunk-K4WNYXKK.js +0 -33
- package/dist/chunk-LG6RFLPZ.js +0 -1
- package/dist/chunk-N7DV5L7C.js +0 -1
- package/dist/chunk-PRBVYW3T.js +0 -1
- package/dist/chunk-QZLIURER.js +0 -13
- package/dist/chunk-RIEF2DDX.js +0 -8
- package/dist/chunk-SXMTSV5M.js +0 -1
- package/dist/chunk-SXPY523X.js +0 -1
- package/dist/chunk-V3LRQZ36.js +0 -1
- package/dist/chunk-WYFPXTTS.js +0 -2
- package/dist/pipeline-ORIWVVYM.js +0 -5
- package/dist/workspace-contract-HKCMOMFE.js +0 -1
- package/dist/workspace-explain-GOPQYTPQ.js +0 -1
- package/dist/workspace-intelligence-7IESQSXY.js +0 -1
- package/dist/workspace-intelligence-runner-6GJ5M4HB.js +0 -1
- package/dist/workspace-mcp-serve-FRVWBO36.js +0 -3
- package/dist/workspace-model-PPYX7B4S.js +0 -1
- package/dist/workspace-run-V3KKHTVF.js +0 -1
- package/dist/workspace-watch-SOPZHRWA.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {c as c$2}from'./chunk-
|
|
2
|
-
`);}async function
|
|
3
|
-
`),await
|
|
4
|
-
\u2705 Synced ${i} project(s) to registry`):
|
|
5
|
-
\u2705 All projects already registered (${n} found)`),{workspacePath:
|
|
1
|
+
import {c as c$2}from'./chunk-U5EZHZBX.js';import {a as a$2}from'./chunk-GZTYAEWX.js';import {a}from'./chunk-A5FBGRJA.js';import {b as b$1}from'./chunk-YCL3I2JO.js';import {c as c$1}from'./chunk-Y45WZR5N.js';import {a as a$1}from'./chunk-TQEMLBAG.js';import {p as p$1,o}from'./chunk-5XATWNME.js';import {p as p$2,r,q as q$1}from'./chunk-EYJ2CQSK.js';import {promises}from'fs';import {randomUUID}from'crypto';import p from'path';import c from'chalk';import ae from'fs-extra';import b from'ora';import {execa}from'execa';async function ie(e){try{let t=await execa("git",["rev-parse","--show-toplevel"],{cwd:e,env:a$1()});return t.stdout.trim()?p.resolve(e,t.stdout.trim()):null}catch{return null}}async function q(e,t,r){if(await ie(e)){t.warn("Git initialization skipped because target is already inside a git worktree");return}t.start("Initializing git repository...");try{await execa("git",["init"],{cwd:e,env:a$1()}),await execa("git",["add","."],{cwd:e,env:a$1()}),await execa("git",["-c","user.name=Workspai","-c","user.email=workspai@localhost","commit","-m",r],{cwd:e,env:a$1()}),t.succeed("Git repository initialized");}catch{t.warn("Could not initialize git repository");}}function X(e){let t=a(e.path),r=Array.isArray(e.projects)?e.projects:[],a$1=[],o=new Set;for(let s of r){if(!s||typeof s.name!="string"||typeof s.path!="string")continue;let i=a(s.path);o.has(i)||(o.add(i),a$1.push({name:s.name,path:i}));}return {name:e.name,path:t,mode:e.mode,projects:a$1}}function W(e){let t=[],r=new Set;for(let a of e.workspaces||[]){if(!a||typeof a.name!="string"||typeof a.path!="string")continue;let o=X(a);r.has(o.path)||(r.add(o.path),t.push(o));}return {workspaces:t}}async function se(e){let t;try{t=await promises.readFile(e,"utf8");}catch(r){if(r.code==="ENOENT")return {workspaces:[]};throw r}try{let r=JSON.parse(t);if(!r||!Array.isArray(r.workspaces))throw new Error("missing workspaces array");return W(r)}catch(r){throw new Error(`Workspace registry is invalid: ${e}`,{cause:r})}}async function ne(e){let t;try{t=await promises.readFile(e,"utf8");}catch(a){if(a.code==="ENOENT")return {workspaces:[]};throw a}let r;try{r=JSON.parse(t);}catch(a){throw new Error(`Workspace registry is invalid: ${e}`,{cause:a})}if(!r||typeof r!="object"||!Array.isArray(r.workspaces))throw new Error(`Workspace registry is invalid: ${e}`);for(let a of r.workspaces)if(!a||typeof a.name!="string"||typeof a.path!="string"||a.mode!==void 0&&typeof a.mode!="string"||a.projects!==void 0&&!Array.isArray(a.projects)||Array.isArray(a.projects)&&a.projects.some(o=>!o||typeof o.name!="string"||typeof o.path!="string"))throw new Error(`Workspace registry contains an invalid entry: ${e}`);return W(r)}async function B(){let e={workspaces:[]},t=new Set;for(let r$1 of r()){let a=await se(r$1);for(let o of a.workspaces)t.has(o.path)||(t.add(o.path),e.workspaces.push(o));}return e}async function ce(){let e={workspaces:[]},t=new Set;for(let r$1 of r()){let a=await ne(r$1);for(let o of a.workspaces)t.has(o.path)||(t.add(o.path),e.workspaces.push(o));}return e}function pe(e){let t=e?.code;return process.platform==="win32"&&(t==="EPERM"||t==="EINVAL"||t==="ENOSYS")}async function Q(e){try{await e.sync();}catch(t){if(!pe(t))throw t}}async function V(e,t){let r=p.dirname(e);await promises.mkdir(r,{recursive:true});let a=`${p.basename(e)}.`,o=Date.now();for(let i of await promises.readdir(r)){if(!i.startsWith(a)||!i.endsWith(".tmp"))continue;let n=p.join(r,i),d=await promises.stat(n).catch(()=>null);d&&o-d.mtimeMs>3e4&&await promises.rm(n,{force:true}).catch(()=>{});}let s=await promises.readFile(e,"utf8").catch(()=>null);if(s!==null){let i=false;try{let n=JSON.parse(s);i=Array.isArray(n.workspaces);}catch{i=false;}if(!i){let n=`${e}.corrupt-${Date.now()}`;await promises.copyFile(e,n);}}await K(e,`${JSON.stringify(W(t),null,2)}
|
|
2
|
+
`);}async function K(e,t){let r=p.dirname(e);await promises.mkdir(r,{recursive:true});let a=`${e}.${process.pid}.${randomUUID()}.tmp`;try{await promises.writeFile(a,t);let o=await promises.open(a,"r");try{await Q(o);}finally{await o.close();}try{await promises.rename(a,e);}catch(s){let i=s.code;if(i!=="EEXIST"&&i!=="EPERM")throw s;await ae.move(a,e,{overwrite:true});}}finally{await promises.rm(a,{force:true}).catch(()=>{});}}async function Y(e){try{return {exists:true,content:await promises.readFile(e)}}catch(t){if(t.code==="ENOENT")return {exists:false};throw t}}async function H(e,t){if(!t.exists){await promises.rm(e,{force:true});return}await K(e,t.content);}async function le(e){let t=p$2(),r=p.join(t,"workspaces.json.lock");await promises.mkdir(t,{recursive:true});let a=Date.now(),o;for(;!o;)try{o=await promises.open(r,"wx"),await o.writeFile(`${JSON.stringify({pid:process.pid,createdAt:new Date().toISOString()})}
|
|
3
|
+
`),await Q(o);}catch(s){if(s.code!=="EEXIST")throw s;let i=await promises.stat(r).catch(()=>null);if(i&&Date.now()-i.mtimeMs>3e4){let n=await promises.readFile(r,"utf8").then(f=>JSON.parse(f)).catch(()=>null),d=Number(n?.pid),m=false;if(Number.isInteger(d)&&d>0)try{process.kill(d,0),m=true;}catch(f){m=f.code==="EPERM";}if(!m){await promises.rm(r,{force:true}).catch(()=>{});continue}}if(Date.now()-a>1e4)throw new Error(`Timed out waiting for workspace registry lock: ${r}`);await new Promise(n=>setTimeout(n,25));}try{return await e()}finally{await o.close().catch(()=>{}),await promises.rm(r,{force:true}).catch(()=>{});}}async function P(e){return le(async()=>{let t=p.join(p$2(),"workspaces.json"),r=p.join(q$1(),"workspaces.json"),[a,o]=await Promise.all([Y(t),Y(r)]),s=await ce();await e(s);let i=W(s);try{await V(t,i),await V(r,i);}catch(n){let m=(await Promise.allSettled([H(t,a),H(r,o)])).filter(f=>f.status==="rejected").map(f=>f.reason);throw m.length>0?new AggregateError([n,...m],"Workspace registry transaction failed and could not be fully restored"):n}return i})}async function Z(e,t){let r=a(e);await P(a=>{let o=a.workspaces.find(s=>s.path===r);if(o){o.name=t,o.mode=o.mode||"full",o.projects=Array.isArray(o.projects)?o.projects:[];return}a.workspaces.push({name:t,path:r,mode:"full",projects:[]});});}async function de(e,t){try{await Z(e,t);}catch{console.warn(c.gray("Note: Could not register workspace in shared registry"));}}async function Fe(e,t=false){let r=a(e),a$1={workspacePath:r,workspaceFound:false,added:[],skipped:0};try{let o=await B(),s=o.workspaces.find(u=>u.path===r);if(!s){if(await de(r,p.basename(p.resolve(e))),o=await B(),s=o.workspaces.find(u=>u.path===r),!s)return t||console.log("\u26A0\uFE0F Workspace could not be registered in registry"),a$1;t||console.log("\u2714 Registered workspace in shared registry");}Array.isArray(s.projects)||(s.projects=[]);let i=0,n=0,d=[],m=[],f=[e],g=new Set;for(;f.length>0;){let u=f.shift();if(!u||g.has(u))continue;g.add(u);let y=await promises.readdir(u,{withFileTypes:true});for(let h of y){if(!h.isDirectory()||h.name.startsWith(".")||["node_modules","dist","build","target","coverage","htmlcov"].includes(h.name))continue;let j=p.join(u,h.name),k=a(j);try{let w=false;for(let $ of [...p$1(k,"context.json"),...p$1(k,"project.json")])try{await promises.access($),w=true;break}catch{}if(w){let $=p.basename(k),E=s.projects.some(C=>C.path===k);m.push({name:$,path:k}),E?n++:(s.projects.push({name:$,path:k}),i++,d.push(k),t||console.log(`\u2714 Added: ${p.relative(e,k)}`));continue}}catch{}f.push(j);}}return await P(u=>{let y=u.workspaces.find(k=>k.path===r);if(!y)return;let h=`${r}${p.sep}`,j=(y.projects||[]).filter(k=>k.path!==r&&!k.path.startsWith(h));y.projects=X({...y,projects:[...j,...m]}).projects;}),i>0?t||console.log(`
|
|
4
|
+
\u2705 Synced ${i} project(s) to registry`):t||console.log(`
|
|
5
|
+
\u2705 All projects already registered (${n} found)`),{workspacePath:r,workspaceFound:true,added:d,skipped:n}}catch(o){return t||console.error("\u274C Failed to sync projects:",o.message),a$1}}async function me(e,t,r){let a$1=a(e),o=a(r);await P(s=>{let i=s.workspaces.find(m=>m.path===a$1);if(!i)throw new Error(`Workspace is not registered: ${a$1}`);i.projects=Array.isArray(i.projects)?i.projects:[];let n=i.projects.findIndex(m=>m.path===o||m.name===t),d={name:t,path:o};n>=0?i.projects[n]=d:i.projects.push(d);});}async function Be(e,t,r){try{await me(e,t,r);}catch{}}async function Te(e,t){let r=b("Creating Workspai workspace...").start();try{await promises.mkdir(e,{recursive:true}),await promises.mkdir(p.join(e,".workspai"),{recursive:true});let a={workspace_name:t.name,author:t.author,rapidkit_version:c$1(),created_at:new Date().toISOString(),type:"workspace"};await promises.writeFile(p.join(e,".workspai","config.json"),JSON.stringify(a,null,2));let{syncWorkspaceFoundationFiles:o}=await import('./create-7JKJDAQV.js');await o(e,{workspaceName:t.name,installMethod:"venv",writeMarker:true,writeGitignore:false,onlyIfMissing:true});let s=ge();await promises.writeFile(p.join(e,"rapidkit"),s),await promises.chmod(p.join(e,"rapidkit"),493);let i=ue();await promises.writeFile(p.join(e,"rapidkit.cmd"),i);let n=fe(t.name);await promises.writeFile(p.join(e,"README.md"),n),await promises.writeFile(p.join(e,".gitignore"),`# Workspai workspace
|
|
6
6
|
.env
|
|
7
7
|
.env.*
|
|
8
8
|
!.env.example
|
|
@@ -17,7 +17,7 @@ Thumbs.db
|
|
|
17
17
|
|
|
18
18
|
# Logs
|
|
19
19
|
*.log
|
|
20
|
-
`),await we(e),
|
|
20
|
+
`),await we(e),r.succeed("Workspace created!"),t.skipGit||await q(e,b(),"Initial commit: Workspai workspace"),await Z(e,t.name);let{publishWorkspaceRegistrySummary:m}=await import('./workspace-registry-summary-A3YDL63D.js');await m(e),console.log(`
|
|
21
21
|
${c.green("\u2728 Workspai workspace created successfully!")}
|
|
22
22
|
|
|
23
23
|
${c.bold("\u{1F4C2} Workspace structure:")}
|
|
@@ -33,7 +33,7 @@ ${e}/
|
|
|
33
33
|
\u2514\u2500\u2500 README.md
|
|
34
34
|
|
|
35
35
|
${c.bold("\u{1F680} Get started:")}
|
|
36
|
-
${c.cyan(`cd ${
|
|
36
|
+
${c.cyan(`cd ${t.name}`)}
|
|
37
37
|
${c.cyan("npx workspai create project fastapi.standard my-api --yes")}
|
|
38
38
|
${c.cyan("cd my-api")}
|
|
39
39
|
${c.cyan("npx workspai init")}
|
|
@@ -54,7 +54,7 @@ ${c.bold("\u{1F4DA} Commands:")}
|
|
|
54
54
|
|
|
55
55
|
${c.gray("Alternative: npx workspai dev, make dev")}
|
|
56
56
|
${c.gray("\u{1F4A1} Tip: Install globally (npm i -g workspai) to use without npx")}
|
|
57
|
-
`);}catch(a){throw
|
|
57
|
+
`);}catch(a){throw r.fail("Failed to create workspace"),a}}function ge(){return `#!/usr/bin/env bash
|
|
58
58
|
#
|
|
59
59
|
# Workspai CLI - local workspace commands
|
|
60
60
|
# This script provides legacy ./rapidkit commands within the workspace
|
|
@@ -440,7 +440,7 @@ main() {
|
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
main "$@"
|
|
443
|
-
`}function
|
|
443
|
+
`}function ue(){return `@echo off
|
|
444
444
|
setlocal enabledelayedexpansion
|
|
445
445
|
|
|
446
446
|
set "SCRIPT_DIR=%~dp0"
|
|
@@ -460,7 +460,7 @@ if %ERRORLEVEL%==0 (
|
|
|
460
460
|
echo [Workspai] No sh/bash found. Falling back to npx workspai.
|
|
461
461
|
npx workspai %*
|
|
462
462
|
exit /b %ERRORLEVEL%
|
|
463
|
-
`}function
|
|
463
|
+
`}function fe(e){return `# ${e}
|
|
464
464
|
|
|
465
465
|
Workspai workspace for building API projects.
|
|
466
466
|
|
|
@@ -517,7 +517,7 @@ instructions start at \`AGENTS.md\`.
|
|
|
517
517
|
|
|
518
518
|
- [Workspai Documentation](https://workspai.dev)
|
|
519
519
|
- [GitHub Repository](https://github.com/rapidkitlabs/workspai)
|
|
520
|
-
`}async function we(e){let{fileURLToPath:
|
|
520
|
+
`}async function we(e){let{fileURLToPath:t}=await import('url'),r=t(import.meta.url),a=p.dirname(r),o=p.resolve(a,".."),s=p.join(o,"templates","kits"),i=p.join(e,".workspai","templates"),{default:n}=await import('fs-extra');await n.copy(s,i);let d=p.join(o,"templates","generator.js"),m=p.join(e,".workspai","generator.js");await n.copy(d,m);}async function Je(e,t){let r=t.template==="fastapi",a=r?"FastAPI":"NestJS",o=b(`Creating ${a} project...`).start();try{let{fileURLToPath:s}=await import('url'),i=s(import.meta.url),n=p.dirname(i),d=p.resolve(n,".."),m=r?"fastapi-standard":"nestjs-standard",f=p.join(d,"templates","kits",m);await promises.mkdir(e,{recursive:true});let g={project_name:r?t.name.replace(/-/g,"_").toLowerCase():t.name.replace(/_/g,"-").toLowerCase(),author:t.author,description:t.description||`${a} application generated with Workspai`,app_version:"0.1.0",license:"MIT",package_manager:t.package_manager||"npm",created_at:new Date().toISOString(),rapidkit_version:c$1()};await ee(f,e,g);let u=r?`# Python
|
|
521
521
|
__pycache__/
|
|
522
522
|
*.py[cod]
|
|
523
523
|
*$py.class
|
|
@@ -585,7 +585,7 @@ Thumbs.db
|
|
|
585
585
|
|
|
586
586
|
# Coverage
|
|
587
587
|
coverage/
|
|
588
|
-
`;if(await promises.writeFile(p.join(e,".gitignore"),u),o.succeed(`${a} project created!`),
|
|
588
|
+
`;if(await promises.writeFile(p.join(e,".gitignore"),u),o.succeed(`${a} project created!`),t.skipGit||await q(e,b(),`Initial commit: ${a} project via Workspai`),!t.skipInstall&&!r){let h=t.package_manager||"npm",j=b(`Installing dependencies with ${h}...`).start();try{await execa(h,["install"],{cwd:e}),j.succeed("Dependencies installed");}catch{j.warn(`Could not install dependencies. Run '${h} install' manually.`);}}let y=p.basename(e);console.log(r?`
|
|
589
589
|
${c.green("\u2728 FastAPI project created successfully!")}
|
|
590
590
|
|
|
591
591
|
${c.bold("\u{1F4C2} Project structure:")}
|
|
@@ -632,7 +632,7 @@ ${e}/
|
|
|
632
632
|
|
|
633
633
|
${c.bold("\u{1F680} Get started:")}
|
|
634
634
|
${c.cyan(`cd ${y}`)}
|
|
635
|
-
${
|
|
635
|
+
${t.skipInstall?c.cyan("npx workspai init")+c.gray(" # npm install")+`
|
|
636
636
|
`:""}${c.cyan("cp .env.example .env")}
|
|
637
637
|
${c.cyan("npx workspai dev")} ${c.gray("# Start dev server")}
|
|
638
638
|
|
|
@@ -651,16 +651,16 @@ ${c.bold("\u{1F310} API endpoints:")}
|
|
|
651
651
|
http://localhost:8000/examples/notes # Example API
|
|
652
652
|
|
|
653
653
|
${c.gray("\u{1F4A1} Tip: Install globally (npm i -g workspai) to use without npx")}
|
|
654
|
-
`);}catch(s){throw o.fail(`Failed to create ${a} project`),s}}async function
|
|
654
|
+
`);}catch(s){throw o.fail(`Failed to create ${a} project`),s}}async function ee(e,t,r){let a=await promises.readdir(e,{withFileTypes:true});for(let o of a){let s=p.join(e,o.name),i=o.name.replace(/\.j2$/,""),n=p.join(t,i);if(o.isDirectory())await promises.mkdir(n,{recursive:true}),await ee(s,n,r);else {let d=await promises.readFile(s,"utf-8");o.name.endsWith(".j2")&&(d=ke(d,r)),await promises.writeFile(n,d),(i==="rapidkit"||i==="activate"||i.endsWith(".py")&&(n.includes(".workspai")||n.includes(".rapidkit")))&&await promises.chmod(n,493);}}}function ke(e,t){let r=e;for(let[a,o]of Object.entries(t)){let s=new RegExp(`\\{\\{\\s*${a}\\s*\\}\\}`,"g");r=r.replace(s,String(o));let i=new RegExp(`\\{\\{\\s*${a}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\}\\}`,"g");r=r.replace(i,(m,f,g)=>String(o).replace(new RegExp(f,"g"),g));let n=new RegExp(`\\{\\{\\s*${a}\\s*\\|\\s*lower\\s*\\}\\}`,"g");r=r.replace(n,String(o).toLowerCase());let d=new RegExp(`\\{\\{\\s*${a}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\|\\s*lower\\s*\\}\\}`,"g");r=r.replace(d,(m,f,g)=>String(o).replace(new RegExp(f,"g"),g).toLowerCase());}return r}async function Ge(e={}){let t=p$2(),r=p.join(t,"workspaces.json"),a=await B();if(a.workspaces.length===0){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:[],summary:{total:0,missing:0,registryExists:false}},null,2));return}console.log(c.yellow(`
|
|
655
655
|
\u26A0\uFE0F No workspaces registered yet.
|
|
656
656
|
`)),console.log(c.gray(`Create a workspace with: npx workspai <workspace-name>
|
|
657
|
-
`));return}try{let o=a;if(!o||typeof o!="object"||!Array.isArray(o.workspaces)){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:
|
|
657
|
+
`));return}try{let o=a;if(!o||typeof o!="object"||!Array.isArray(o.workspaces)){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:[],summary:{total:0,missing:0,registryExists:true,registryValid:false},error:{code:"workspace.registry.invalid",message:"Workspace registry is invalid."}},null,2));return}console.log(c.yellow(`
|
|
658
658
|
\u26A0\uFE0F Workspace registry is invalid; resetting to empty state.
|
|
659
|
-
`)),await P(g=>{g.workspaces=[];});return}let s=W(o),i=[],n=0;for(let g of s.workspaces)await promises.stat(g.path).catch(()=>null)?i.push(g):n+=1;let d={workspaces:i},m=JSON.stringify(o),
|
|
659
|
+
`)),await P(g=>{g.workspaces=[];});return}let s=W(o),i=[],n=0;for(let g of s.workspaces)await promises.stat(g.path).catch(()=>null)?i.push(g):n+=1;let d={workspaces:i},m=JSON.stringify(o),f=JSON.stringify(d);if(!e.json&&m!==f){let g=new Set(i.map(u=>u.path));await P(u=>{u.workspaces=u.workspaces.filter(y=>g.has(y.path));});}if(!d.workspaces||d.workspaces.length===0){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:[],summary:{total:0,missing:n,registryExists:true,registryValid:true,cleanupApplied:false}},null,2));return}console.log(c.yellow(`
|
|
660
660
|
\u26A0\uFE0F No workspaces registered yet.
|
|
661
661
|
`)),n>0&&console.log(c.gray(`Cleaned ${n} stale workspace entr${n===1?"y":"ies"}.
|
|
662
|
-
`));return}if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:
|
|
662
|
+
`));return}if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:d.workspaces,summary:{total:d.workspaces.length,missing:n,registryExists:true,registryValid:true,cleanupApplied:false}},null,2));return}console.log(c.bold(`
|
|
663
663
|
\u{1F4E6} Registered Workspai Workspaces:
|
|
664
664
|
`));for(let g of d.workspaces)console.log(c.cyan(` ${g.name}`)),console.log(c.gray(` Path: ${g.path}`)),console.log(c.gray(` Projects: ${g.projects?.length||0}`)),console.log();n>0&&console.log(c.gray(`Cleaned ${n} stale workspace entr${n===1?"y":"ies"}.`)),console.log(c.gray(`Total: ${d.workspaces.length} workspace(s)
|
|
665
|
-
`));}catch(o){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:
|
|
666
|
-
\u274C Failed to read workspace registry`)),console.error(c.gray(String(o)));}}async function
|
|
665
|
+
`));}catch(o){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:[],summary:{total:0,missing:0,registryExists:true,registryValid:false},error:{code:"workspace.registry.read_failed",message:o.message}},null,2));return}console.error(c.red(`
|
|
666
|
+
\u274C Failed to read workspace registry`)),console.error(c.gray(String(o)));}}async function he(e){try{let t=await promises.readFile(e,"utf8");return JSON.parse(t)}catch{return null}}async function L(e){for(let t of e){let r=await he(t);if(r!==null)return r}return null}function ye(e){return c$2(e)}async function $e(e){return a$2(e,{skipDirs:new Set(["node_modules","dist","build","target","coverage","htmlcov"]),includeHiddenDirs:false,descendIntoMatchedProjects:true})}async function O(e){try{return (await promises.readdir(e,{withFileTypes:true})).filter(r=>r.isFile()&&r.name.toLowerCase().endsWith(".json")).map(r=>r.name).sort((r,a)=>r.localeCompare(a))}catch{return []}}async function ze(e,t){let r=t?.includePaths===true,a=t?.includeDoctorEvidence!==false,o$1=t?.includeBlueprint!==false,s=p.resolve(e),i=await L(o(s,"workspace.json")),n=typeof i?.workspace_name=="string"&&i.workspace_name.trim()||p.basename(s),d=typeof i?.profile=="string"?i.profile:void 0,m=typeof i?.rapidkit_version=="string"?i.rapidkit_version:void 0,f=await $e(s),g=[];for(let w of f){let $=await L(p$1(w,"project.json")),E=p.relative(s,w)||".",C=p.dirname(p$1(w,p.join("reports","placeholder"))[0]),T=p.dirname(p$1(w,p.join("reports","placeholder"))[1]),N={name:p.basename(w),relative_path:E,runtime:typeof $?.runtime=="string"?$.runtime:void 0,kit_name:typeof $?.kit_name=="string"?$.kit_name:void 0,modules:Array.isArray($?.modules)?$.modules.filter(_=>typeof _=="string"):void 0};if(r&&(N.absolute_path=w),a){let _=await L([p.join(C,"doctor-last-run.json"),p.join(T,"doctor-last-run.json")]);ye(_)&&(N.doctor_report=_);}let J=[...await O(C),...await O(T)].filter((_,te,re)=>re.indexOf(_)===te);J.length>0&&(N.reports=J),g.push(N);}let u=o(s,"reports"),y=[...await O(u[0]),...await O(u[1])].filter((w,$,E)=>E.indexOf(w)===$),h=await L(o(s,"workspace.contract.json")),j={schema_version:"1.1",generated_at:new Date().toISOString(),generated_by:"workspai",workspace:{name:n,relative_root:".",profile:d,rapidkit_version:m,...r?{absolute_root:s}:{}},summary:{project_count:g.length,doctor_evidence_included:a,contract_included:!!h},reports:{workspace:y},projects:g,...h?{contract:h}:{}};o$1&&(j.blueprint={schema_version:"rapidkit.workspace-blueprint.v1",purpose:"portable-reproducibility",workspace:{name:n,profile:d},projects:g.map(w=>({name:w.name,relative_path:w.relative_path,runtime:w.runtime,kit_name:w.kit_name,modules:w.modules??[],recreate_commands:[...w.kit_name?[`npx workspai create project ${w.kit_name} ${w.name} --yes --skip-install`]:[],`cd ${w.relative_path}`,"npx workspai init","npx workspai test"]})),recommended_commands:["npx workspai workspace contract verify --strict","npx workspai doctor workspace","npx workspai workspace run init --json","npx workspai workspace run test --strict --json","npx workspai readiness --strict --json"]});let k=t?.outputPath?p.resolve(t.outputPath):p.join(u[0],"share-bundle.json");return t?.outputPath||b$1(".workspai/reports/share-bundle.json",j),await promises.mkdir(p.dirname(k),{recursive:true}),await promises.writeFile(k,JSON.stringify(j,null,2),"utf8"),k}export{X as a,Z as b,de as c,Fe as d,me as e,Be as f,Te as g,Je as h,Ge as i,ze as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var M="workspace-knowledge-search.v1";function k(o){return o.trim().toLowerCase()}var I=new WeakMap;function h(o){let n=I.get(o);if(n)return n;let r=new Map(o.relations.map(t=>[t.id,t])),s=new Map(o.entities.map(t=>[t.id,t])),i=new Map(o.proofs.map(t=>[t.id,t])),a=new Map,d=new Map,l=(t,c)=>{let f=d.get(t)??[];f.push(c),d.set(t,f);};for(let t of o.entities){let c=[t.id,t.label,t.identity.key,...t.kind==="project"&&t.projectId?[t.projectId]:[],...t.identity.aliases];for(let f of new Set(c.map(k))){let w=a.get(f)??[];w.push(t),a.set(f,w);}}for(let t of o.relations)l(t.from,{from:t.from,to:t.to,relationId:t.id,kind:t.kind,direction:"forward",proofIds:t.proofIds}),l(t.to,{from:t.to,to:t.from,relationId:t.id,kind:t.kind,direction:"reverse",proofIds:t.proofIds});for(let t of a.values())t.sort((c,f)=>c.id.localeCompare(f.id));for(let t of d.values())t.sort((c,f)=>c.to.localeCompare(f.to)||c.relationId.localeCompare(f.relationId));let p={entitiesById:s,relationsById:r,entitiesByAlias:a,proofsById:i,adjacency:d};return I.set(o,p),p}function W(o,n){let r=h(o),s=r.relationsById.get(n);if(s)return {found:true,targetType:"relation",relation:s};let i=k(n),a=r.entitiesByAlias.get(i)??[];return a.length===1?{found:true,targetType:"entity",entity:a[0]}:{found:false,query:n,candidates:a.map(d=>d.id).sort()}}function S(o,n){let r=W(o,n);if(!r.found)return {query:n,found:false,target:null,proofs:[],candidates:r.candidates};let s=r.targetType==="entity"?r.entity:r.relation,i=new Set(s.proofIds);return {query:n,found:true,target:s,candidates:[],proofs:[...i].map(a=>h(o).proofsById.get(a)).filter(a=>!!a).sort((a,d)=>a.id.localeCompare(d.id))}}function b(o,n,r){let s=W(o,n),i=W(o,r);if(!s.found||s.targetType!=="entity"||!i.found||i.targetType!=="entity")return {from:n,to:r,found:false,resolvedFrom:s.found&&s.targetType==="entity"?s.entity.id:null,resolvedTo:i.found&&i.targetType==="entity"?i.entity.id:null,entityPath:[],hops:[],proofs:[]};let a=h(o),d=[s.entity.id],l=new Map,p=new Set(d),t=0;for(;t<d.length&&!p.has(i.entity.id);){let g=d[t++];for(let y of a.adjacency.get(g)??[])p.has(y.to)||(p.add(y.to),l.set(y.to,y),d.push(y.to));}if(!p.has(i.entity.id))return {from:n,to:r,found:false,resolvedFrom:s.entity.id,resolvedTo:i.entity.id,entityPath:[],hops:[],proofs:[]};let c=[],f=i.entity.id;for(;f!==s.entity.id;){let g=l.get(f);if(!g)break;c.push(g),f=g.from;}c.reverse();let w=new Set(c.flatMap(g=>g.proofIds));return {from:n,to:r,found:true,resolvedFrom:s.entity.id,resolvedTo:i.entity.id,entityPath:[s.entity.id,...c.map(g=>g.to)],hops:c,proofs:[...w].map(g=>a.proofsById.get(g)).filter(g=>!!g).sort((g,y)=>g.id.localeCompare(y.id))}}function B(o,n){return o.entities.filter(r=>!n||r.kind===n).sort((r,s)=>r.kind.localeCompare(s.kind)||r.label.localeCompare(s.label))}function P(o){let n=Object.values(o.attributes).flatMap(r=>Array.isArray(r)?r:[r]);return [o.id,o.kind,o.label,o.projectId??"",o.identity.key,...o.identity.aliases,...n.map(r=>String(r??""))].join(" ").toLowerCase()}function x(o,n,r){let s=k(o.label),i=k(o.identity.key),a=o.identity.aliases.map(k),d=P(o),l=0;(s===n||i===n||a.includes(n))&&(l+=1e3),(s.startsWith(n)||i.startsWith(n))&&(l+=250),d.includes(n)&&(l+=100);for(let p of r)s===p?l+=80:s.includes(p)&&(l+=30),i.includes(p)&&(l+=20),d.includes(p)&&(l+=10);return l}function R(o,n){let r=k(n.query),s=[...new Set(r.split(/[^a-z0-9_.:/@-]+/u).filter(e=>e.length>1))],i=Math.max(1,Math.min(Math.trunc(n.limit??12),100)),a=Math.max(0,Math.min(Math.trunc(n.relationsPerEntity??4),20)),d=o.entities.filter(e=>!n.kind||e.kind===n.kind).map(e=>({entity:e,score:x(e,r,s)})).filter(e=>r.length===0||e.score>0).sort((e,u)=>u.score-e.score||e.entity.kind.localeCompare(u.entity.kind)||e.entity.label.localeCompare(u.entity.label)),l=d.slice(0,i).map(e=>e.entity),p=new Set(l.map(e=>e.id)),t=new Map,c=o.relations.filter(e=>{if(!(p.has(e.from)||p.has(e.to)))return false;let K=p.has(e.from)?e.from:e.to,m=t.get(K)??0;return m>=a?false:(t.set(K,m+1),true)}),f=h(o),g=[...new Set(c.flatMap(e=>[e.from,e.to]).filter(e=>!p.has(e)))].map(e=>f.entitiesById.get(e)).filter(e=>!!e).map(({id:e,kind:u,label:K,projectId:m})=>({id:e,kind:u,label:K,...m?{projectId:m}:{}})).sort((e,u)=>e.kind.localeCompare(u.kind)||e.label.localeCompare(u.label)),E=[...new Set([...l.flatMap(e=>e.proofIds),...c.flatMap(e=>e.proofIds)])].map(e=>f.proofsById.get(e)).filter(e=>!!e).sort((e,u)=>e.id.localeCompare(u.id));return {schemaVersion:M,query:n.query,kind:n.kind??null,limit:i,totalMatches:d.length,truncated:d.length>l.length,entities:l,relatedEntities:g,relations:c,proofs:E}}export{M as a,W as b,S as c,b as d,B as e,R as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-KB44JP4M.js';import {a,c,b,i}from'./chunk-LNRAB7UY.js';import h from'path';var w=Object.keys(a).flatMap(t=>{let o=t,a$1=b[o],r=c[o];return !a$1||!r?[]:[{artifactPath:a[o],schemaVersion:a$1,contractPath:r}]}),m=[{artifactPath:".workspai/workspace.contract.json",schemaVersion:1,contractPath:"contracts/workspace-contract.v1.json"},{artifactPath:".workspai/cache/workspace-model.v1.json",schemaVersion:"workspace-model-cache.v1",contractPath:"contracts/workspace-model-cache.v1.json"},{artifactPath:".workspai/workspace-registry.v1.json",schemaVersion:"workspace-registry.v1",contractPath:"contracts/workspace-registry.v1.json"},{artifactPath:".workspai/compatibility-matrix.json",schemaVersion:"rapidkit.compatibility-matrix.v1",contractPath:"contracts/compatibility-matrix.v1.json"},{artifactPath:".workspai/reports/doctor-workspace-cache.json",schemaVersion:"doctor-workspace-cache-v2",contractPath:"contracts/doctor-workspace-cache.v2.json"},{artifactPath:".workspai/reports/bootstrap-compliance.latest.json",schemaVersion:"bootstrap-compliance.v1",contractPath:"contracts/bootstrap-compliance.v1.json"},{artifactPath:".workspai/reports/mirror-ops.latest.json",schemaVersion:"mirror-ops.v1",contractPath:"contracts/mirror-ops.v1.json"},{artifactPath:".workspai/reports/transparency-evidence.latest.json",schemaVersion:"transparency-evidence.v1",contractPath:"contracts/transparency-evidence.v1.json"},{artifactPath:".workspai/reports/share-bundle.json",schemaVersion:"1.1",schemaVersionField:"schema_version",contractPath:"contracts/workspace-share-bundle.v1.json"},{artifactPath:".workspai/reports/doctor-project-last-run.json",schemaVersion:"doctor-project-evidence-v1",contractPath:"contracts/doctor-project-evidence.v1.json"},{artifactPath:".workspai/reports/doctor-remediation-plan-last-run.json",schemaVersion:"doctor-remediation-plan-v2",contractPath:"contracts/doctor-remediation-plan.v2.json"},{artifactPath:".workspai/reports/artifact-remediation-plan-last-run.json",schemaVersion:"artifact-remediation-plan-v1",contractPath:"contracts/artifact-remediation-plan.v1.json"},{artifactPath:".workspai/reports/doctor-fix-result-last-run.json",schemaVersion:"rapidkit-doctor-fix-result-v1",contractPath:"contracts/workspace-intelligence/doctor-fix-result.v1.json"},{artifactPath:".workspai/reports/pipeline-last-run.json",schemaVersion:"rapidkit-pipeline-v1",contractPath:"contracts/pipeline-last-run.v1.json"},{artifactPath:".workspai/reports/autopilot-release-last-run.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json"},{artifactPath:".workspai/reports/autopilot-release.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json"},{artifactPath:".workspai/reports/workspace-run-last.json",schemaVersion:"workspace-run-v1",contractPath:"contracts/workspace-run-last.v1.json"},{artifactPath:".workspai/reports/workspai-mcp-design.json",schemaVersion:"workspai-mcp-design.v1",contractPath:"contracts/workspace-intelligence/mcp-design.v1.json"},{artifactPath:".workspai/reports/workspace-why-last-run.json",schemaVersion:b.explain,contractPath:c.explain},{artifactPath:".workspai/reports/workspace-trace-last-run.json",schemaVersion:b.explain,contractPath:c.explain},{artifactPath:".vscode/workspai-agent-hooks.json",schemaVersion:"workspai-agent-hooks.v1",contractPath:"contracts/workspace-intelligence/agent-hooks.v1.json"},{artifactPath:".workspai/reports/infra-plan.json",schemaVersion:"rapidkit.infra-plan.v1",contractPath:"contracts/infra-plan.v1.json"}],d={".workspai/workspace.contract.json":[["workspace","sync"],["workspace","contract","sync"]],[a.intelligenceRun]:[["workspace","intelligence","run"]],[a.snapshot]:[["workspace","snapshot"]],[a.history]:[["workspace","feedback","record","--json"]],".workspai/cache/workspace-model.v1.json":[["workspace","model"]],".workspai/workspace-registry.v1.json":[["workspace","sync"]],".workspai/compatibility-matrix.json":[["bootstrap"]],".workspai/reports/doctor-workspace-cache.json":[["doctor","workspace"]],".workspai/reports/bootstrap-compliance.latest.json":[["bootstrap"]],".workspai/reports/mirror-ops.latest.json":[["mirror","status"]],".workspai/reports/transparency-evidence.latest.json":[["mirror","sync"]],".workspai/reports/share-bundle.json":[["workspace","share"]],".workspai/reports/doctor-project-last-run.json":[["doctor","project"]],".workspai/reports/doctor-remediation-plan-last-run.json":[["workspace","remediation-plan"]],".workspai/reports/artifact-remediation-plan-last-run.json":[["workspace","remediation-plan"]],".workspai/reports/doctor-fix-result-last-run.json":[["doctor","workspace"]],".workspai/reports/pipeline-last-run.json":[["pipeline"]],".workspai/reports/autopilot-release-last-run.json":[["autopilot","release"]],".workspai/reports/autopilot-release.json":[["autopilot","release"]],".workspai/reports/workspace-run-last.json":[["workspace","run"]],".workspai/reports/workspai-mcp-design.json":[["workspace","agent-sync","--write"]],".workspai/reports/workspace-why-last-run.json":[["workspace","why"]],".workspai/reports/workspace-trace-last-run.json":[["workspace","trace"]],".vscode/workspai-agent-hooks.json":[["workspace","agent-sync"]],".workspai/reports/infra-plan.json":[["infra","plan"]]};function j(t){let o=Object.values(i).filter(r=>r.produces.includes(t)).map(r=>[...r.command]),a=d[t]??[];return [...o,...a.map(r=>[...r])]}var k=Object.freeze(Object.fromEntries([...w,...m].map(t=>[t.artifactPath,{...t,producerCommands:j(t.artifactPath)}])));function u(t){return t.split(h.sep).join("/").replace(/^\.\//,"")}var f=[{pattern:/^\.workspai\/reports\/bootstrap-compliance-[^/]+\.json$/,canonicalPath:".workspai/reports/bootstrap-compliance.latest.json"},{pattern:/^\.workspai\/reports\/mirror-ops-[^/]+\.json$/,canonicalPath:".workspai/reports/mirror-ops.latest.json"},{pattern:/^\.workspai\/reports\/transparency-evidence-[^/]+\.json$/,canonicalPath:".workspai/reports/transparency-evidence.latest.json"}];function P(t){let o=u(t),a=k[o];if(a)return a;let r=f.find(n=>n.pattern.test(o));return r?k[r.canonicalPath]??null:null}function y(t,o,a=t){let r=P(t);if(!r)return;let n=r.schemaVersionField??"schemaVersion",i=o&&typeof o=="object"?o[n]:void 0;if(i!==r.schemaVersion)throw new Error(`${a} schemaVersion is ${String(i)}, expected ${r.schemaVersion}`);a$1(o,r.contractPath,a);}
|
|
2
|
+
export{P as a,y as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {g,f,b as b$3}from'./chunk-COARSXRC.js';import {d}from'./chunk-OA537ZQ5.js';import {i}from'./chunk-MER6ZBN2.js';import {a as a$4,m}from'./chunk-22NJ2ZMG.js';import {a as a$2}from'./chunk-FXQJX34Z.js';import {c,b as b$2,i as i$1,w,f as f$2}from'./chunk-TWNFECMN.js';import {i as i$2,h as h$1}from'./chunk-4KUIFXHM.js';import {f as f$1,d as d$1,a as a$5,e}from'./chunk-2TEDAKP6.js';import {a as a$1}from'./chunk-GSWPGELT.js';import {a as a$3}from'./chunk-GZTYAEWX.js';import {b as b$1,a}from'./chunk-LNRAB7UY.js';import {p,o}from'./chunk-5XATWNME.js';import p$1 from'path';import C from'fs-extra';import Qe from'crypto';import {createRequire}from'module';var Ue=new Set(["service","frontend","worker","library","infra","docs","test-suite","unknown"]);async function Ie(e){try{if(!await C.pathExists(e))return null;let t=await C.readJSON(e);return t&&typeof t=="object"?t:null}catch{return null}}async function Je(e){for(let t of e){let s=await Ie(t);if(s)return s}return null}function Me(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Ue.has(t)?t:null}async function Oe(e,t){let s=t??await Je(p(e,"project.json")),n=Me(s?.kind)??Me(s?.type);if(n)return n;let a=typeof s?.kit_name=="string"?s.kit_name:s?.kit,r=typeof s?.framework=="string"?s.framework:null,o=typeof s?.runtime=="string"?s.runtime:null,i=`${typeof a=="string"?a:""} ${r??""} ${o??""}`.trim().toLowerCase();if(/\b(frontend|nextjs|next\.js|react|vue|svelte|vite|angular|astro|remix|nuxt)\b/.test(i))return "frontend";if(/\b(fastapi|nestjs|springboot|spring boot|gofiber|gogin|dotnet|webapi|django|flask|express|fastify|python|node|java|go|rust|php|ruby|elixir)\b/.test(i))return "service";let c=await Ie(p$1.join(e,"package.json"));if(c){let d={...c.dependencies??{},...c.devDependencies??{}},u=c.scripts??{},l=Object.values(u).filter(f=>typeof f=="string").join(" ").toLowerCase();if(d.next||d.react||d.vue||d.svelte||d.vite||d["@angular/core"]||l.includes("next ")||l.includes("vite "))return "frontend";if(c.private===true&&!d.express&&!d["@nestjs/core"])return "library"}return await C.pathExists(p$1.join(e,"Dockerfile"))||await C.pathExists(p$1.join(e,"docker-compose.yml"))||await C.pathExists(p$1.join(e,"terraform.tf"))?"infra":"service"}var qe=new Set(c().map(e=>e.id)),Xe=[...i().map(e=>({id:e.kitId,aliases:[...e.aliases],ecosystem:e.framework,status:"available",canExecuteCreate:true,officialCommands:[e.commandDisplay("<name>",{skipGit:false,skipInstall:false})],adoptAfterCreate:true})),{id:"wordpress-site",aliases:["wordpress","wordpress-site","wp","wp-site"],ecosystem:"wordpress",status:"planned",canExecuteCreate:false,officialCommands:["wp core download","wp config create","wp db create","wp core install"],adoptAfterCreate:true},{id:"wordpress-block",aliases:["wordpress-block","wp-block","gutenberg-block"],ecosystem:"wordpress",status:"planned",canExecuteCreate:false,officialCommands:["npx @wordpress/create-block@latest <slug>"],adoptAfterCreate:true},{id:"laravel",aliases:["laravel","php-laravel"],ecosystem:"php",status:"planned",canExecuteCreate:false,officialCommands:["composer create-project laravel/laravel <name>"],adoptAfterCreate:true},{id:"symfony",aliases:["symfony","php-symfony"],ecosystem:"php",status:"planned",canExecuteCreate:false,officialCommands:["composer create-project symfony/skeleton <name>"],adoptAfterCreate:true},{id:"rails",aliases:["rails","ruby-on-rails","ruby-rails"],ecosystem:"ruby",status:"planned",canExecuteCreate:false,officialCommands:["rails new <name>"],adoptAfterCreate:true}],T=new Map;for(let e of Xe){T.set(e.id,e);for(let t of e.aliases)T.set(t,e);}var Ye=new Set(["php","ruby","rust","elixir","clojure","scala","kotlin","unknown"]);function F(e){return e?.trim().toLowerCase()||void 0}function _e(e){let t=F(e.kitId)??F(e.framework)??F(e.runtime)??"unknown";if(e.projectExists)return {lane:"existing",status:"available",canExecuteCreate:false,requested:t,reason:"Existing projects enter Workspace Intelligence through adopt/import."};let s=e.kitId?b$2(e.kitId):void 0;if(s&&qe.has(s))return {lane:"native",status:"available",canExecuteCreate:true,requested:t,resolved:s,reason:"Workspai owns the create contract, project marker, registry, doctor, and workspace model path."};let n=T.get(t)??T.get(F(e.framework)??"")??T.get(F(e.runtime)??"");if(n)return {lane:"official",status:n.status,canExecuteCreate:n.canExecuteCreate,requested:t,resolved:n.id,officialCommands:n.officialCommands,fallbackLane:n.canExecuteCreate?void 0:"existing",reason:n.status==="available"?"Workspai runs the official ecosystem generator, then registers the project in Workspace Intelligence.":"Official generator support is planned but not enabled; use adopt/import until Workspai owns the post-create contract."};let a=F(e.runtime);return a&&Ye.has(a)?{lane:"existing",status:"available",canExecuteCreate:false,requested:t,resolved:a,reason:"Runtime can be governed through Workspace Intelligence, but native create is not supported."}:{lane:"existing",status:"available",canExecuteCreate:false,requested:t,reason:"No native create contract is available; use adopt/import to enter Workspace Intelligence."}}function Wt(e){return !e.canExecuteCreate&&(e.lane==="official"||e.lane==="existing"&&e.resolved!==void 0)}var ae="workspace-model-cache.v1",oe=".workspai/cache/workspace-model.v1.json",De=["package.json","pyproject.toml","requirements.txt","go.mod","go.sum","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","workspai.project.json",".workspai/project.json",".workspai/context.json","rapidkit.project.json",".rapidkit/project.json",".rapidkit/context.json"],Ne=[".workspai/workspace.contract.json",".workspai/workspace.json","workspai.workspace.json",".workspai/policies.yml",".workspai/policies.yaml",".rapidkit/workspace.contract.json",".rapidkit/workspace.json","rapidkit.workspace.json",".rapidkit/policies.yml",".rapidkit/policies.yaml"],et=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs"]),tt=new Set([".git",".workspai",".rapidkit","node_modules","dist","build","out","target","coverage",".next",".turbo",".cache",".venv"]),rt=1500,V=null;function ie(){if(V)return V;try{V=createRequire(import.meta.url)("../package.json")?.version??"0.0.0";}catch{V="0.0.0";}return V}async function X(e){try{let t=await C.readFile(e);return Qe.createHash("sha256").update(t).digest("hex")}catch{return null}}async function st(e){let t={};for(let a of De){let r=await X(p$1.join(e,a));r&&(t[a]=r);}let s=[],n=[e];for(;n.length>0&&s.length<rt;){let a=n.shift();if(!a)continue;let r=[];try{r=await C.readdir(a,{withFileTypes:true});}catch{continue}let o=[];for(let i of r)if(i.isDirectory()){if(tt.has(i.name)||i.name.startsWith("."))continue;o.push(p$1.join(a,i.name));}else if(i.isFile()&&et.has(p$1.extname(i.name))){let c=p$1.join(a,i.name),d=await C.stat(c).catch(()=>null);if(d){let u=p$1.relative(e,c).split(p$1.sep).join("/");s.push(`${u}:${d.size}:${Math.round(d.mtimeMs)}`);}}o.sort((i,c)=>i.localeCompare(c)),n.push(...o);}return s.sort((a,r)=>a.localeCompare(r)),b$3({manifests:t,source:s})}async function Y(e,t){let s=p$1.resolve(e),n={},a=[...new Set(t.map(r=>p$1.relative(s,p$1.resolve(r)).split(p$1.sep).join("/")))].sort((r,o)=>r.localeCompare(o));for(let r of a)n[r]=await st(p$1.join(s,r));return n}async function Q(e){let t=p$1.resolve(e),s={};for(let n of Ne){let a=await X(p$1.join(t,n));a&&(s[n]=a);}return s}async function Z(e){let t=p$1.resolve(e.workspacePath),s=[...new Set(e.projectPaths.map(r=>p$1.relative(t,p$1.resolve(r)).split(p$1.sep).join("/")))].sort((r,o)=>r.localeCompare(o)),n=[];for(let r of s){let o={};for(let i of De){let c=await X(p$1.join(t,r,i));c&&(o[i]=c);}n.push({project:r,manifests:o});}let a={};for(let r of Ne){let o=await X(p$1.join(t,r));o&&(a[r]=o);}return b$3({cacheSchema:ae,cliVersion:e.cliVersion,flags:e.flags,workspaceJson:e.workspaceJson??null,marker:e.marker??null,projects:n,workspaceFiles:a})}async function ce(e){let t=await d$1(e,oe)??a$5(e,oe);try{if(!await C.pathExists(t))return null;let s=await C.readJson(t);return !s||s.schemaVersion!==ae||typeof s.inputsHash!="string"||typeof s.cliVersion!="string"||!s.model?null:s}catch{return null}}async function ee(e$1,t){let s={schemaVersion:ae,...t};return e(e$1,oe,s)}var Te="rapidkit-fact-freshness-v1",G={durable:720*60*60,derived:10080*60,evidenceBacked:1440*60,live:300,verifyBeforeUse:1440*60};function nt(e){switch(e){case "durable":return G.durable;case "derived":return G.derived;case "evidence-backed":return G.evidenceBacked;case "live":return G.live;case "verify-before-use":return G.verifyBeforeUse}}function ot(e){if(e.status)return e.status;if(e.ttlSeconds===null)return "unknown";let t=Date.parse(e.generatedAt);if(!Number.isFinite(t))return "unknown";let s=t+e.ttlSeconds*1e3;return e.now.getTime()>s?"stale":"fresh"}function at(e){let t=e.now??new Date,s=e.generatedAt??t.toISOString(),n=Date.parse(s),a=Number.isFinite(n),r=a?s:t.toISOString(),o=e.ttlSeconds===void 0?nt(e.kind):e.ttlSeconds,i=ot({generatedAt:r,ttlSeconds:o,status:e.status??(a?void 0:"unknown"),now:t}),c=Date.parse(r),d=o===null||!Number.isFinite(c)?void 0:new Date(c+o*1e3),u=e.verifyBeforeUse??(e.kind==="live"||e.kind==="verify-before-use"||e.category!=="structure"||i!=="fresh");return {schemaVersion:Te,kind:e.kind,category:e.category,generatedAt:r,ttlSeconds:o,...d?{expiresAt:d.toISOString()}:{},status:i,verifyBeforeUse:u,...e.sourceArtifact?{sourceArtifact:e.sourceArtifact}:{},...e.sourcePath?{sourcePath:e.sourcePath}:{},inputsHash:e.inputsHash??b$3(e.value??null),reason:e.reason}}function h(e){return {id:e.id,label:e.label,scope:e.scope,value:e.value,...e.project?{project:e.project}:{},freshness:at({...e.freshness,value:e.value})}}function Ve(e){let t=e.generatedAt??(e.now??new Date).toISOString(),s={durable:0,derived:0,"evidence-backed":0,live:0,"verify-before-use":0},n={structure:0,verification:0,state:0},a=0,r=0,o=0,i=0;for(let c of e.facts)s[c.freshness.kind]+=1,n[c.freshness.category]+=1,c.freshness.status==="stale"&&(a+=1),c.freshness.status==="unknown"&&(r+=1),c.freshness.kind==="live"&&(o+=1),c.freshness.verifyBeforeUse&&(i+=1);return {schemaVersion:Te,generatedAt:t,status:a>0?"stale":r>0?"unknown":"fresh",totalFacts:e.facts.length,staleFacts:a,unknownFacts:r,liveFacts:o,verifyBeforeUseFacts:i,byKind:s,byCategory:n}}var it=b$1.model,te=a.model,ct=["package.json","pyproject.toml","requirements.txt","go.mod","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","mix.exs","deno.json","deno.jsonc","bun.lock","bun.lockb","deps.edn","project.clj","build.sbt","docker-compose.yml","docker-compose.yaml","terraform.tf"],lt=new Set([".git",".hg",".svn",".workspai",".rapidkit",".venv","node_modules","dist","build","target","coverage","htmlcov",".next",".turbo"]);function Ge(e,t){return (p$1.relative(e,t)||".").split(p$1.sep).join("/")}async function Ke(e){try{if(!await C.pathExists(e))return null;let t=await C.readJSON(e);return t&&typeof t=="object"?t:null}catch{return null}}async function dt(e,t){for(let s of t)if(await C.pathExists(p$1.join(e,s)))return true;return false}function le(e){let t=Number.parseInt(process.env.RAPIDKIT_WORKSPACE_MODEL_SCAN_DEPTH??"",10),s=typeof e=="number"&&Number.isFinite(e)?e:Number.isFinite(t)?t:4;return Math.min(12,Math.max(1,Math.trunc(s)))}async function de(e,t){let s=p$1.resolve(e),n=[{dirPath:s,depth:0}],a=new Set,r=new Set;for(;n.length>0;){let o=n.shift();if(!o)continue;let i=p$1.resolve(o.dirPath);if(r.has(i))continue;if(r.add(i),i!==s&&await dt(i,ct)){a.add(i);continue}if(o.depth>=t)continue;let c=[];try{c=await C.readdir(i,{withFileTypes:true});}catch{continue}for(let d of c)!d.isDirectory()||lt.has(d.name)||d.name.startsWith(".")&&d.name!==".config"||n.push({dirPath:p$1.join(i,d.name),depth:o.depth+1});}return Array.from(a).sort((o,i)=>o.localeCompare(i))}function pe(e){let t=new Set,s=[];for(let n of e){let a=p$1.resolve(n);t.has(a)||(t.add(a),s.push(a));}return s.sort((n,a)=>n.localeCompare(a))}function $e(e,t){let s=e?.[t];return typeof s=="string"&&s.trim()?s.trim():void 0}function pt(e,t){return e?.[t]===true}function ut(e,t,s){let n=e?.frontend&&typeof e.frontend=="object"&&!Array.isArray(e.frontend)?e.frontend:void 0,a=$e(n,"generator"),r=$e(n,"command_display"),o=typeof t=="string"&&t.startsWith("frontend.");if(!(!a&&!o))return {...a?{id:a}:{},...t?{kit:t}:{},displayName:s,source:pt(n,"official_generator")?"official-generator":"metadata",...r?{commandDisplay:r}:{}}}async function mt(e){let t=[".workspai/project.json",".workspai/context.json",".rapidkit/project.json",".rapidkit/context.json","package.json","pyproject.toml","requirements.txt","go.mod","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","mix.exs","deno.json","Dockerfile","docker-compose.yml","README.md"],s=[];for(let n of t)await C.pathExists(p$1.join(e,n))&&s.push(n);return s}async function S(e,t,s,n=t){let a=await d$1(e,t),r=a!==null,o={path:n.split(p$1.sep).join("/"),exists:r};if(a&&s){let i=await Ke(a);typeof i?.generatedAt=="string"&&(o.generatedAt=i.generatedAt);let c=i?.status??i?.result??i?.verdict;typeof c=="string"&&(o.status=c);}return o}async function ft(e,t,s){let n=Ge(e,t),a=".workspai/reports",r=c=>S(t,`${a}/${c}`,s,`${n}/${a}/${c}`),o=await r("doctor-project-last-run.json");return {doctor:o?.exists===true?o:await r("doctor-last-run.json"),remediationPlan:await r("doctor-remediation-plan-last-run.json"),fixResult:await r("doctor-fix-result-last-run.json"),analyze:await r("analyze-last-run.json"),readiness:await r("release-readiness-last-run.json")}}async function gt(e,t,s){let n=i$1(t),a=i$2(t,n),r=w(t),o=f$2(a.runtime),i=await Oe(t,n),c=typeof n?.name=="string"&&n.name.trim()?n.name.trim():p$1.basename(t),d=typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0,u=typeof n?.engine=="string"?n.engine:r.engine!=="unknown"?r.engine:void 0,l=ut(n,d,a.displayName),f=_e({kitId:d,framework:a.key,runtime:a.runtime});return {name:c,path:Ge(e,t),...s.includeAbsolutePaths?{absolutePath:t}:{},kind:i,runtime:a.runtime,runtimeCandidates:h$1(t),framework:a.key,frameworkDisplayName:a.displayName,confidence:a.confidence,detectionSource:a.source,supportTier:a.supportTier,runtimeSupportTier:o.tier,runtimeDoctorSupport:o.doctorSupport,moduleSupport:r.moduleSupport,...d?{kit:d}:{},...u?{engine:u}:{},...l?{generator:l}:{},createCapability:f,commands:{supported:r.supportedCommands,unsupported:r.unsupportedCommands,global:r.globalCommands,fleetStages:r.fleetStages,localOnly:r.localOnlyCommands,map:r.commandMap},importantFiles:await mt(t),evidence:await ft(e,t,s.includeEvidence),provenance:{path:"filesystem discovery",runtime:a.source,framework:a.source,commands:"project command capability matrix",createCapability:"create planner capability contract",evidence:"project .workspai/reports"}}}async function ue(e){for(let t of o(e,"workspace.json")){let s=await Ke(t);if(s)return s}return null}function kt(e){return e.length===0?"empty-workspace":e.some(t=>t.kind==="frontend")&&e.length>1?"full-stack-workspace":e.some(t=>t.kind==="frontend")?"frontend-workspace":e.length>1?"backend-platform":"backend-workspace"}function ht(e){let t=new Set;for(let s of e){let n=`${s.name} ${s.path}`.toLowerCase();for(let a of ["auth","billing","payment","notification","order","admin","report","search","analytics"])n.includes(a)&&t.add(a);}return Array.from(t).sort()}function b(e,t,s,n){return {severity:e,code:t,message:s,target:n}}function Be(e){let t=[];e.workspace.name.trim()||t.push(b("error","workspace.name.missing","Workspace name could not be resolved.","workspace")),e.workspace.type==="observed-workspace"&&t.push(b("warning","workspace.marker.missing","Workspace marker is missing; model is based on filesystem observation.","workspace.marker")),e.summary.projectCount===0&&t.push(b("warning","workspace.projects.empty","No project roots were detected in this workspace.","projects")),e.contracts.exists||t.push(b("warning","workspace.contract.missing","Workspace contract is missing; dependency and API edges may be incomplete.",e.contracts.workspaceContractPath));let s=new Map;for(let r of e.projects){let o=r.name.toLowerCase(),i=s.get(o)??[];i.push(r),s.set(o,i),r.importantFiles.length||t.push(b("warning","project.markers.missing",`Project ${r.name} has no important manifest files recorded.`,r.path)),r.runtime==="unknown"&&t.push(b("warning","project.runtime.unknown",`Project ${r.name} runtime could not be confidently detected.`,r.path));let c=["test","build"];for(let l of c)r.commands.supported.includes(l)&&r.commands.unsupported.includes(l)&&t.push(b("error","project.commands.conflict",`Project ${r.name} marks ${l} as both supported and unsupported.`,r.path));let d=new Set(r.commands.fleetStages),u=new Set(r.commands.localOnly);for(let l of r.commands.fleetStages){u.has(l)&&t.push(b("error","project.commands.scope-conflict",`Project ${r.name} marks ${l} as both fleet and local-only.`,r.path));let f=r.commands.map[l];(!f||f.status!=="supported"||f.fleetEligible!==true||f.executionScope!=="fleet")&&t.push(b("error","project.commands.fleet-stage-invalid",`Project ${r.name} advertises ${l} as a fleet stage without a supported fleet capability.`,r.path));}for(let l of r.commands.localOnly){let f=r.commands.map[l];(!f||f.status!=="supported"||f.executionScope!=="local-only"||f.fleetEligible===true)&&t.push(b("error","project.commands.local-only-invalid",`Project ${r.name} advertises ${l} as local-only without a matching local-only capability.`,r.path));}for(let l of Object.values(r.commands.map))l.status==="supported"&&(l.fleetEligible===true&&!d.has(l.command)&&t.push(b("error","project.commands.fleet-stage-missing",`Project ${r.name} capability ${l.command} is fleet-eligible but missing from fleetStages.`,r.path)),l.executionScope==="local-only"&&l.fleetEligible!==true&&!u.has(l.command)&&t.push(b("error","project.commands.local-only-missing",`Project ${r.name} capability ${l.command} is local-only but missing from localOnly commands.`,r.path)));}for(let[r,o]of s.entries())o.length>1&&t.push(b("error","project.name.duplicate",`Project name "${r}" is ambiguous across ${o.length} project roots.`,o.map(i=>i.path).join(", ")));let n=t.filter(r=>r.severity==="error").length,a=t.filter(r=>r.severity==="warning").length;return {status:n>0?"failed":a>0?"warning":"passed",errors:n,warnings:a,issues:t}}function cr(e){return Be(e)}function y(e){return e.join(".")}function yt(e,t){let s=te,n=e.generatedAt,a=[h({id:"workspace.name",label:"Workspace name",scope:"workspace",value:e.workspace.name,freshness:{kind:"durable",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["workspace","name"]),reason:"Workspace identity is structural metadata and changes through workspace setup."}}),h({id:"workspace.type",label:"Workspace type",scope:"workspace",value:e.identity.workspaceType,freshness:{kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["identity","workspaceType"]),reason:"Workspace type is derived from the current project inventory."}}),h({id:"workspace.projectCount",label:"Project count",scope:"workspace",value:e.summary.projectCount,freshness:{kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["summary","projectCount"]),reason:"Project count is derived from workspace discovery and should be refreshed after structural changes."}}),h({id:"workspace.runtimeFamilies",label:"Runtime families",scope:"workspace",value:e.identity.runtimeFamilies,freshness:{kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["identity","runtimeFamilies"]),reason:"Runtime coverage is inferred from project surfaces."}}),h({id:"workspace.policyMode",label:"Workspace policy mode",scope:"policy",value:e.policies.mode,freshness:{kind:"durable",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["policies","mode"]),reason:"Policy mode is configuration, not runtime state."}}),h({id:"workspace.contract.exists",label:"Workspace contract presence",scope:"contract",value:e.contracts.exists,freshness:{kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["contracts","exists"]),reason:"Contract presence is derived from workspace files and should be refreshed before release gating."}})];e.graph&&a.push(h({id:"graph.edgeCount",label:"Dependency graph edge count",scope:"graph",value:e.graph.stats.edgeCount,freshness:{kind:"derived",category:"structure",generatedAt:e.graph.generatedAt??n,now:t,sourceArtifact:s,sourcePath:y(["graph","stats","edgeCount"]),reason:"Graph topology is derived from manifests, imports, and workspace contracts."}}),h({id:"graph.evidenceCoverageRatio",label:"Dependency graph evidence coverage",scope:"graph",value:e.graph.stats.evidenceCoverageRatio,freshness:{kind:"derived",category:"structure",generatedAt:e.graph.generatedAt??n,now:t,sourceArtifact:s,sourcePath:y(["graph","stats","evidenceCoverageRatio"]),reason:"Graph evidence coverage changes when dependency evidence or contract edges change."}}));for(let[r,o]of e.projects.entries()){let i=`projects[${r}]`,c={kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,reason:"Project facts are derived from workspace discovery, project metadata, and framework probes."};a.push(h({id:`project.${o.name}.kind`,label:`${o.name} kind`,scope:"project",project:o.name,value:o.kind,freshness:{...c,sourcePath:y([i,"kind"])}}),h({id:`project.${o.name}.runtime`,label:`${o.name} runtime`,scope:"project",project:o.name,value:o.runtime,freshness:{...c,sourcePath:y([i,"runtime"])}}),h({id:`project.${o.name}.framework`,label:`${o.name} framework`,scope:"project",project:o.name,value:o.frameworkDisplayName,freshness:{...c,sourcePath:y([i,"frameworkDisplayName"])}}),h({id:`project.${o.name}.supportTier`,label:`${o.name} support tier`,scope:"project",project:o.name,value:o.supportTier,freshness:{...c,sourcePath:y([i,"supportTier"])}}),h({id:`project.${o.name}.safeFleetStages`,label:`${o.name} safe fleet stages`,scope:"command",project:o.name,value:o.commands.fleetStages,freshness:{...c,sourcePath:y([i,"commands","fleetStages"]),reason:"Safe command availability is derived from package and project command surfaces."}}));for(let[d,u]of Object.entries(o.evidence))a.push(h({id:`project.${o.name}.evidence.${d}`,label:`${o.name} ${d} evidence`,scope:"evidence",project:o.name,value:u?{path:u.path,exists:u.exists,status:u.status??null}:{exists:false},freshness:{kind:u?.exists?"evidence-backed":"verify-before-use",category:"verification",generatedAt:u?.generatedAt??n,now:t,status:u?.exists?void 0:"unknown",sourceArtifact:u?.path??s,sourcePath:y([i,"evidence",d]),verifyBeforeUse:true,reason:u?.exists?"Evidence reports can expire or become stale after source changes.":"Missing evidence must be generated before this fact is used for verification."}}));}for(let[r,o]of Object.entries(e.evidence))a.push(h({id:`workspace.evidence.${r}`,label:`Workspace ${r} evidence`,scope:"evidence",value:o?{path:o.path,exists:o.exists,status:o.status??null}:null,freshness:{kind:o?.exists?"evidence-backed":"verify-before-use",category:"verification",generatedAt:o?.generatedAt??n,now:t,status:o?.exists?void 0:"unknown",sourceArtifact:o?.path??s,sourcePath:y(["evidence",r]),verifyBeforeUse:true,reason:o?.exists?"Workspace evidence can expire or become stale after project, dependency, or policy changes.":"Missing workspace evidence must be generated before release or repair decisions."}}));return a}async function re(e){let t=p$1.resolve(e.workspacePath),s=e.includeAbsolutePaths===true,n=e.includeEvidence===true,a$4=le(e.observableScanDepth),r=e.now??new Date,[o$1,i,c,d,u]=await Promise.all([a$1(t),ue(t),a$2(t),a$3(t,{descendIntoMatchedProjects:false}),de(t,a$4)]),l=pe([...d,...u,...c.map(m=>p$1.isAbsolute(m.path)?m.path:p$1.join(t,m.path))]),f=e.reuseProjectModels,w=await Promise.all(l.map(m=>{if(f){let ze=p$1.relative(t,p$1.resolve(m)).split(p$1.sep).join("/"),me=f.get(ze);if(me)return Promise.resolve(me)}return gt(t,m,{includeAbsolutePaths:s,includeEvidence:n})})),x=typeof i?.workspace_name=="string"?i.workspace_name:typeof i?.name=="string"?i.name:o$1?.name||p$1.basename(t),j=typeof i?.profile=="string"?i.profile:typeof i?.mode=="string"?i.mode:void 0,R=Array.from(new Set(w.map(m=>m.kind))).sort(),E=Array.from(new Set(w.map(m=>m.runtime))).sort(),se=Array.from(new Set(w.map(m=>m.framework))).sort(),M=[".workspai/policies.yml",".workspai/policies.yaml",".rapidkit/policies.yml",".rapidkit/policies.yaml"].find(m=>C.existsSync(p$1.join(t,m))),I=o(t,"workspace.contract.json").map(m=>p$1.relative(t,m).split(p$1.sep).join("/")).find(m=>C.existsSync(p$1.join(t,m)))??".workspai/workspace.contract.json",P=await C.pathExists(p$1.join(t,I)),K={schemaVersion:it,generatedAt:r.toISOString(),workspace:{name:x,root:t,...j?{profile:j}:{},type:o$1?"rapidkit-workspace":"observed-workspace",...o$1?{marker:{createdBy:o$1.createdBy,version:o$1.version,createdAt:o$1.createdAt}}:{}},identity:{workspaceType:kt(w),surfaces:R,runtimeFamilies:E,businessCapabilities:ht(w)},discovery:{observableScanDepth:a$4},projects:w,policies:{mode:typeof i?.policy_mode=="string"?i.policy_mode:typeof i?.policyMode=="string"?i.policyMode:"warn",source:M??null,exists:!!M},contracts:{workspaceContractPath:I,exists:P,status:P?"known":"missing"},evidence:{doctor:await S(t,a.doctor,n),projectDoctor:await S(t,".workspai/reports/doctor-project-last-run.json",n),doctorRemediationPlan:await S(t,".workspai/reports/doctor-remediation-plan-last-run.json",n),artifactRemediationPlan:await S(t,".workspai/reports/artifact-remediation-plan-last-run.json",n),doctorFixResult:await S(t,".workspai/reports/doctor-fix-result-last-run.json",n),analyze:await S(t,a.analyze,n),readiness:await S(t,a.readiness,n),pipeline:await S(t,".workspai/reports/pipeline-last-run.json",n)},summary:{projectCount:w.length,runtimes:E,frameworks:se,firstClassProjects:w.filter(m=>m.supportTier==="first-class").length,observedProjects:w.filter(m=>m.supportTier==="observed").length}},O=await Le(t,K,{contractExists:P,now:r,incrementalGraph:e.incrementalGraph}),_={...K,graph:O},k=Be(_),v=yt({..._},r),W=Ve({facts:v,generatedAt:r.toISOString(),now:r});return {..._,facts:v,factFreshness:W,validation:k}}async function lr(e){if(e.cache!==true)return {model:await re(e),cache:"disabled"};let t=p$1.resolve(e.workspacePath),s=le(e.observableScanDepth),n=ie(),[a,r,o,i,c]=await Promise.all([a$1(t),ue(t),a$2(t),a$3(t,{descendIntoMatchedProjects:false}),de(t,s)]),d=pe([...i,...c,...o.map(j=>p$1.isAbsolute(j.path)?j.path:p$1.join(t,j.path))]),u=await Z({workspacePath:t,cliVersion:n,flags:{includeAbsolutePaths:e.includeAbsolutePaths===true,includeEvidence:e.includeEvidence===true,observableScanDepth:s},projectPaths:d,workspaceJson:r,marker:a}),l=await ce(t);if(l&&l.cliVersion===n&&l.inputsHash===u)return {model:l.model,cache:"hit"};let f=await re({...e}),[w,x]=await Promise.all([Y(t,d),Q(t)]);return await ee(t,{cliVersion:n,inputsHash:u,generatedAt:(e.now??new Date).toISOString(),model:f,projectSignatures:w,workspaceFileSignatures:x}),{model:f,cache:"miss"}}function wt(e,t){let s=new Set,n=new Set,a=new Set;for(let[r,o]of Object.entries(t))r in e?e[r]!==o&&s.add(r):n.add(r);for(let r of Object.keys(e))r in t||a.add(r);return {changed:s,added:n,removed:a}}function vt(e={},t={}){let s=new Set([...Object.keys(e),...Object.keys(t)]);for(let n of s)if(e[n]!==t[n])return false;return true}async function dr(e){let t=p$1.resolve(e.workspacePath),s=le(e.observableScanDepth),n=ie(),a=e.now??new Date,[r,o,i,c,d]=await Promise.all([a$1(t),ue(t),a$2(t),a$3(t,{descendIntoMatchedProjects:false}),de(t,s)]),u=pe([...c,...d,...i.map(k=>p$1.isAbsolute(k.path)?k.path:p$1.join(t,k.path))]),l=await ce(t),f=async()=>{let k=await re({...e}),v=await Z({workspacePath:t,cliVersion:n,flags:{includeAbsolutePaths:e.includeAbsolutePaths===true,includeEvidence:e.includeEvidence===true,observableScanDepth:s},projectPaths:u,workspaceJson:o,marker:r}),[W,m]=await Promise.all([Y(t,u),Q(t)]);return await ee(t,{cliVersion:n,inputsHash:v,generatedAt:a.toISOString(),model:k,projectSignatures:W,workspaceFileSignatures:m}),{model:k,mode:"full"}};if(!l||l.cliVersion!==n||!l.projectSignatures||!l.model?.graph)return f();let w=await Q(t);if(!vt(l.workspaceFileSignatures,w))return f();let x=await Y(t,u),{changed:j,added:R,removed:E}=wt(l.projectSignatures,x);if(j.size===0&&R.size===0&&E.size===0)return {model:l.model,mode:"unchanged"};let se=new Set([...j,...R]),M=new Map;for(let k of l.model.projects){let v=k.path.split(p$1.sep).join("/");!se.has(v)&&!E.has(v)&&M.set(v,k);}let I=new Set,P=false;for(let k of l.model.projects){let v=k.path.split(p$1.sep).join("/");j.has(v)&&I.add(k.name);}let K=R.size>0||E.size>0,O=await re({...e,reuseProjectModels:M,incrementalGraph:{previousGraph:l.model.graph,changedProjectIds:I,structuralChange:K||P}});for(let k of l.model.projects){let v=k.path.split(p$1.sep).join("/");if(!j.has(v))continue;let W=O.projects.find(m=>m.path.split(p$1.sep).join("/")===v);if(W&&W.name!==k.name){P=true;break}}if(P)return f();let _=await Z({workspacePath:t,cliVersion:n,flags:{includeAbsolutePaths:e.includeAbsolutePaths===true,includeEvidence:e.includeEvidence===true,observableScanDepth:s},projectPaths:u,workspaceJson:o,marker:r});return await ee(t,{cliVersion:n,inputsHash:_,generatedAt:a.toISOString(),model:O,projectSignatures:x,workspaceFileSignatures:w}),{model:O,mode:"incremental"}}async function He(e){try{let{contract:t}=await m({workspacePath:e});return t&&typeof t=="object"?t:null}catch{return null}}async function Le(e,t,s){let n=s.contractExists?await He(e):null;try{return s.incrementalGraph?await g({workspacePath:e,model:t,contract:n,now:s.now,previousGraph:s.incrementalGraph.previousGraph,changedProjectIds:s.incrementalGraph.changedProjectIds,structuralChange:s.incrementalGraph.structuralChange}):await f({workspacePath:e,model:t,contract:n,now:s.now})}catch{let a=t.projects.map(r=>({id:r.name,path:r.path}));return {schemaVersion:"workspace-dependency-graph.v1",generatedAt:s.now.toISOString(),nodes:a,edges:[],stats:{nodeCount:a.length,edgeCount:0,inferredEdges:0,contractEdges:0,manualEdges:0,authoritativeEdges:0,lowConfidenceEdges:0,orphanCount:a.length,connectedNodeCount:0,density:0,edgeCoverageRatio:a.length>0?0:1,evidenceCoverageRatio:1,hotspotCount:0,hasCycle:false},diagnostics:a.length>1?[{code:"graph.inference.failed",severity:"warning",message:"Dependency graph inference failed; model contains projects but no dependency edges.",recommendation:"Run workspace model again after fixing graph inputs, or add workspace contract/manual graph overrides.",nodeIds:a.map(r=>r.id).sort((r,o)=>r.localeCompare(o))}]:void 0}}}async function pr(e,t){let s=e.contracts.exists?await He(t):null,{buildWorkspaceKnowledgeGraph:n}=await import('./workspace-knowledge-graph-FE2NTZKV.js'),a$1=a$4(e),r=await n({workspacePath:t,workspace:{name:e.workspace.name,...e.workspace.profile?{profile:e.workspace.profile}:{}},projects:e.projects.map(i=>({id:i.name,path:i.path,...i.absolutePath?{absolutePath:i.absolutePath}:{},runtime:i.runtime,framework:i.framework,...i.kit?{kit:i.kit}:{}})),projectTopology:e.graph??await Le(t,e,{contractExists:e.contracts.exists,now:new Date(e.generatedAt)}),contract:s,now:new Date(e.generatedAt),source:{kind:"workspace-model",artifact:te,hashAlgorithm:"sha256",hash:d(a$1)}}),[,o]=await f$1(t,te,[{relativePath:a.knowledgeGraph,payload:r},{relativePath:te,payload:a$1}]);return o}export{Te as a,h as b,Ve as c,_e as d,Wt as e,Oe as f,it as g,te as h,cr as i,yt as j,re as k,lr as l,dr as m,pr as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$2,b as b$3}from'./chunk-PYCJWW4B.js';import {b as b$2,c,d as d$1}from'./chunk-ITCAMC2E.js';import {c as c$1}from'./chunk-DV6GJD4K.js';import {o,a as a$1,n,g,d as d$3,f}from'./chunk-NOFM7MNA.js';import {k}from'./chunk-ZDN7RHXJ.js';import {b as b$4}from'./chunk-COARSXRC.js';import {d}from'./chunk-OA537ZQ5.js';import {a as a$3}from'./chunk-22NJ2ZMG.js';import {d as d$2,e}from'./chunk-2TEDAKP6.js';import {a as a$4}from'./chunk-KB44JP4M.js';import {b as b$1,a,c as c$2}from'./chunk-LNRAB7UY.js';import m from'path';import v from'fs-extra';var oe="rapidkit-blocker-resolution-v1";function ae(e){let t=e.blockers.map(s=>s.trim()).filter(Boolean).slice(0,12),r=e.stderrTail?.trim().slice(-400)??"";return b$4({blockers:t,exitCode:e.exitCode??null,stderrTail:r})}function ge(e){let t=e.trim().toLowerCase();return t?t.includes("missing evidence")||t.includes(": missing")||t.includes("artifact missing")||t.includes("not found on disk")?"artifact-missing":t.includes("policy.")||t.includes("contract")?"config-fixable":t.includes("impact")||t.includes("untracked")||t.includes("grounding")?"semantic-attention":t.includes("failed")||t.includes("blocked")||t.includes(": fail")?"command-failed-repeat":"config-fixable":"unresolvable-without-human"}function ke(e){let t=ge(e.reason),r=ae({blockers:[e.reason]}),s=t==="artifact-missing"?[{actionKind:"run-once",detail:e.sourceCommand?`Run the source command once: ${e.sourceCommand}`:"Run the mapped workspace intelligence command once to generate the missing artifact.",studioActionId:"run-analyze"}]:t==="semantic-attention"?[{actionKind:"commit-files",detail:"Review workspace-level grounding files (AGENTS.md, agent-sync outputs) and commit or refresh the impact baseline."},{actionKind:"refresh-baseline",detail:"Refresh snapshot + diff + impact before re-running verify."}]:[{actionKind:"edit-file",detail:"Apply the smallest safe file or policy fix for this blocker before re-running verification.",studioActionId:"fix-lens"}];return {schemaVersion:oe,blockerId:e.blockerId,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,resolutionClass:t,blockerSignature:r,commandRetryHint:t==="artifact-missing"?"Run the source command once, then verify.":"Do not re-run the same failing command; fix the source issue first, then verify.",fixHints:s,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}}function ce(e){return Array.from(new Set(e.blockingReasons.map(r=>r.trim()).filter(Boolean))).slice(0,12).map((r,s)=>ke({reason:r,blockerId:`blocker-${s+1}`,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}))}function ye(e){let t=e.toLowerCase();return t.includes("stale")||t.includes("missing evidence")||t.includes("no projects")||t.includes("projects.empty")||t.includes("projects discovered")||t.includes("projects.missing")||t.includes("not yet run")||t.includes("doctor-last-run")||t.includes("doctor-project-last-run")||t.includes("doctor-remediation-plan-last-run")||t.includes("doctor-fix-result-last-run")||t.includes("pipeline-last-run")||t.includes("release-readiness")||t.includes("analyze-last-run")||t.includes("analyze reported")||t.includes("analyze verdict")||t.includes("analyze needs attention")||t.includes("toolchain.lock")||t.includes("not pinned")||t.includes("readiness:")||t.includes("env:")||t.includes("workspace-run-last")||t.includes("pre-project")||t.includes("before adding projects")||t.includes("workspace.projects.missing")||t.includes("no backend projects")||t.includes("index.json")||t.includes("workspace-intelligence-history")||t.includes("validation warning")||t.includes("workspace model validation")||t.includes("workspace.marker")||t.includes("no project roots")||t.includes("no infrastructure services")||t.includes("infra/overrides")||t.includes("infra dependencies")||t.includes("contract verify")||t.includes("contract inspect")||t.includes("publish verify evidence")}function he(e){return e.length===0||e.every(t=>ye(t))}function de(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&he(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function Ue(e,t){let r=t&&t!=="ready"?` (${t.replace(/-/g," ")})`:"";return e===0?`Workspace scaffold ready${r} \u2014 add your first project to continue.`:`Workspace scaffold${r}: ${e} pre-project signal(s) \u2014 add your first project to continue.`}var ue=b$1.verify,z=a.verify;function ve(e,t){return m.isAbsolute(t)?t:m.join(e,t)}async function le(e){let t=await v.readJson(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Workspace impact input is not a JSON object: ${e}`);let r=t;if(r.schemaVersion!==f)throw new Error(`Unsupported workspace impact schema: ${String(r.schemaVersion)}`);a$4(t,"contracts/workspace-intelligence/workspace-impact.v1.json",`Workspace impact ${e}`);let s=r;a$4(s.diff,"contracts/workspace-intelligence/workspace-model-diff.v1.json",`Embedded workspace diff in ${e}`);let i=[];s.summary.affectedProjects!==s.affectedProjects.length&&i.push("summary.affectedProjects does not match affectedProjects.length"),s.summary.workspaceItems!==s.workspaceImpact.length&&i.push("summary.workspaceItems does not match workspaceImpact.length"),s.summary.recommendedCommands!==s.verificationPlan.length&&i.push("summary.recommendedCommands does not match verificationPlan.length"),s.summary.blastRadius.directlyAffected!==s.affectedProjects.length&&i.push("blastRadius.directlyAffected does not match affectedProjects.length"),s.summary.blastRadius.transitivelyAffected!==s.transitiveImpact.length&&i.push("blastRadius.transitivelyAffected does not match transitiveImpact.length");let o=s.transitiveImpact.reduce((u,d)=>Math.max(u,d.distance??0),0);s.summary.blastRadius.maxDistance!==o&&i.push("blastRadius.maxDistance does not match transitive impact distances");let k=s.diff.currentModel.graph?.edges.length??0;if(s.summary.blastRadius.graphEdges!==k&&i.push("blastRadius.graphEdges does not match the embedded model graph"),s.summary.changed!==s.diff.summary.changed&&i.push("summary.changed does not match embedded diff summary"),s.fromRef!==s.diff.fromRef&&i.push("fromRef does not match embedded diff fromRef"),s.workspace.name!==s.diff.currentModel.workspace.name&&i.push("workspace.name does not match the embedded model"),s.diff.toHash!==d(s.diff.currentModel)&&i.push("embedded diff current-model hash does not match toHash"),i.length>0)throw new Error(`Workspace impact semantic integrity failed: ${i.join("; ")} (${e})`);return s}function be(e){let t=new Set,r=[];for(let s of e){let i=`${s.scope}:${s.project??""}:${s.display}`;t.has(i)||(t.add(i),r.push(s));}return r}function we(e,t){if(!e||e==="workspace")return true;let r=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return t.scope==="workspace"?true:(t.project??"").trim().toLowerCase()===r}function Re(e,t){if(e.id==="workspace.doctor")return m.join(t,a.doctor);if(e.id==="workspace.contract.verify")return m.join(t,a.contractVerify);if(e.id==="workspace.readiness")return m.join(t,a.readiness);if(e.id==="workspace.analyze")return m.join(t,".workspai","reports","analyze-last-run.json");if(e.id==="workspace.pipeline")return m.join(t,".workspai","reports","pipeline-last-run.json");if(e.id==="workspace.doctor-fix")return m.join(t,".workspai","reports","doctor-fix-result-last-run.json");if(e.id.startsWith("project.")&&e.id.includes("."))return m.join(t,".workspai","reports","workspace-run-last.json")}function b(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function Ce(e){let t=b(e.healthScore),r=b(e.summary),s=typeof t?.errors=="number"?t.errors:0,i=typeof t?.percent=="number"?t.percent:void 0;return s>0||r?.hasSystemErrors===true?{status:"fail",message:`Doctor evidence reports ${s} error(s).`}:typeof i=="number"&&i<70?{status:"warn",message:`Doctor health score is ${i}%.`}:{status:"pass",message:"Doctor evidence is present and healthy."}}function Ae(e){let t=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return t==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:t==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:t==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${t}.`}}function Ee(e){let t=typeof e.status=="string"?e.status:"unknown";return t==="failed"||t==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:t==="passed"||t==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${t}.`}}function Se(e){let t=b(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Analyze evidence reports blocking findings."}:r==="needs-attention"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is ready."}}function We(e){let t=e.schemaVersion==="rapidkit-doctor-fix-result-v1"?e:e.fixResult;if(!t||typeof t!="object"||Array.isArray(t))return {status:"skipped",message:"Doctor fix result not present; run doctor workspace --fix --json to record fixes."};let r=t,s=Array.isArray(r.remainingBlockers)?r.remainingBlockers:[];if(s.length>0)return {status:"fail",message:`Doctor fix result reports ${s.length} remaining blocker(s).`};let i=Array.isArray(r.appliedFixes)?r.appliedFixes:[];return i.length===0?{status:"pass",message:"Doctor fix result recorded with no remaining blockers."}:{status:"pass",message:`Doctor fix result recorded ${i.length} applied fix(es) with no remaining blockers.`}}async function je(e,t){let r=await d$2(e,".workspai/reports/doctor-remediation-plan-last-run.json");if(!r)return false;try{let s=b(await v.readJson(r));if(!s||(Array.isArray(s.steps)?s.steps:[]).length>0)return false;let o=typeof s.generatedAt=="string"?s.generatedAt:void 0;if(!o||!t)return true;let k=Date.parse(o),u=Date.parse(t);return !Number.isFinite(k)||!Number.isFinite(u)?true:k>=u}catch{return false}}function xe(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function Pe(e){let t=b(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:r==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:r==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function Ie(e,t,r){let s=xe(t),i=c$1(e,s??void 0);if(!i)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let o=i.stage;if(s&&o!==s)return {status:"missing",message:`Workspace run evidence is for stage "${o}", expected "${s}".`};let k=Array.isArray(i.projects)?i.projects:[],u=t.project?.toLowerCase();if(!u)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let d=k.find(g=>{let c=b(g);if(!c)return false;let n=typeof c.projectName=="string"?c.projectName.toLowerCase():"",a=["projectPath","relativePath","path"].map(f=>c[f]).filter(f=>typeof f=="string"&&f.trim().length>0).map(f=>f.replace(/\\/g,"/").toLowerCase());return n===u||a.some(f=>f.endsWith(`/${u}`)||f===u)});if(d){let g=C(i.generatedAt,r,`Workspace run evidence for ${t.project??t.id}`);if(g)return {status:"fail",message:g};let c=b(d),n=typeof c?.status=="string"?c.status:"unknown";return n==="failed"?{status:"fail",message:`Workspace run evidence failed for ${t.project}.`}:n==="passed"?{status:"pass",message:`Workspace run evidence passed for ${t.project}.`}:n==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${t.project}.`}:{status:"warn",message:`Workspace run evidence status is ${n} for ${t.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${t.project}.`}}function C(e,t,r){if(!t)return null;if(typeof e!="string"||e.trim().length===0)return `${r} is stale: missing generatedAt timestamp (required after impact ${t}).`;let s=Date.parse(e),i=Date.parse(t);return Number.isFinite(s)?Number.isFinite(i)&&s<i?`${r} is stale: generated at ${e}, before impact ${t}.`:null:`${r} is stale: invalid generatedAt timestamp (required after impact ${t}).`}function Ve(e){if(e.id==="workspace.doctor")return c$2.doctor;if(e.id==="workspace.readiness")return c$2.readiness;if(e.id==="workspace.contract.verify")return c$2.contractVerify;if(e.id==="workspace.analyze")return c$2.analyze;if(e.id==="workspace.pipeline")return "contracts/pipeline-last-run.v1.json"}async function $e(e,t,r,s){let i=Re(e,t),o=i?m.relative(t,i).split(m.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!r)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};let k=i?await d$2(t,o??""):null;if(!i||!k)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:o,message:o?`Missing evidence report: ${o}`:"No evidence mapping exists for this command."};let u;try{u=await v.readJson(k);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is unreadable JSON: ${n instanceof Error?n.message:String(n)}`}}let d=b(u);if(!d)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:"Evidence report is not a JSON object."};let g=Ve(e);if(g)try{a$4(d,g,`${e.label} evidence`);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is invalid: ${n instanceof Error?n.message:String(n)}`}}let c;if(e.id==="workspace.doctor"){let n=C(d.generatedAt,s,"Doctor evidence");n?c={status:"fail",message:n}:c=Ce(d);}else if(e.id==="workspace.readiness"){let n=C(d.generatedAt,s,"Release readiness evidence");n?c={status:"fail",message:n}:c=Ae(d);}else if(e.id==="workspace.contract.verify"){let n=C(d.generatedAt,s,"Workspace contract verify evidence");n?c={status:"fail",message:n}:c=Ee(d);}else if(e.id==="workspace.analyze"){let n=C(d.generatedAt,s,"Analyze evidence");n?c={status:"fail",message:n}:c=Se(d);}else if(e.id==="workspace.pipeline"){let n=C(d.generatedAt,s,"Pipeline evidence");n?c={status:"fail",message:n}:c=Pe(d);}else if(e.id==="workspace.doctor-fix"){let n=d.schemaVersion==="rapidkit-doctor-fix-result-v1"?d:d.fixResult,a=b(n),f=typeof a?.generatedAt=="string"?a.generatedAt:void 0,y=C(f,s,"Doctor fix result");y?c={status:"fail",message:y}:await je(t,f)?c={status:"skipped",message:"No current doctor remediation steps are pending."}:c=We(d);}else if(e.id.startsWith("project."))c=Ie(d,e,s);else {let n=C(d.generatedAt,s,"Evidence report");n?c={status:"fail",message:n}:c={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:c.status,required:e.required,evidencePath:o,message:c.message}}function Fe(e,t={blockingReasons:[],needsAttention:false}){let r=e.filter(n=>n.status==="pass").length,s=e.filter(n=>n.status==="warn").length,i=e.filter(n=>n.status==="fail").length,o=e.filter(n=>n.status==="missing").length,k=e.filter(n=>n.status==="skipped").length,u=e.filter(n=>n.required&&(n.status==="fail"||n.status==="missing")).map(n=>`${n.id}: ${n.message}`),d=e.filter(n=>n.required&&n.status==="missing").length,g="ready",c=0;return u.length>0||t.blockingReasons.length>0?(g="blocked",c=2):(s>0||e.some(n=>!n.required&&n.status==="fail")||d>0||t.needsAttention)&&(g="needs-attention",c=1),{verdict:g,exitCode:c,stepsPassed:r,stepsWarn:s,stepsFailed:i,stepsMissing:o,stepsSkipped:k}}function Oe(e,t){let r=W(e.affectedProjects.map(a=>a.project?.name).filter(a=>typeof a=="string")),s=new Set(r.map(a=>a.toLowerCase())),i=W(e.transitiveImpact.map(a=>a.project?.name).filter(a=>typeof a=="string").filter(a=>!s.has(a.toLowerCase()))),o=new Map;for(let a of t){if(a.scope!=="project"||!a.project)continue;let f=a.project.toLowerCase(),y=o.get(f)??[];y.push(a),o.set(f,y);}let k=[],u=[],d=[],g=[],c=false,n=(a,f)=>{let y=o.get(a.toLowerCase())??[];if(y.length===0){d.push(a);return}let j=y.filter(p=>p.status==="fail"),w=j.filter(p=>p.required),x=y.filter(p=>p.status==="missing"),A=x.filter(p=>p.required),P=y.some(p=>p.status==="pass"||p.status==="warn");if(w.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has failed verification evidence (${w.map(p=>p.id).join(", ")}).`);return}if(j.length>0){u.push(a),c=true;return}if(A.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has missing required verification evidence (${A.map(p=>p.id).join(", ")}).`);return}if(x.length>0){u.push(a),c=true;return}if(P){k.push(a);return}d.push(a);};for(let a of r)n(a,"directly-changed");for(let a of i)n(a,"transitive dependent");return {subgraph:{totalProjects:r.length+i.length,directlyChanged:r,transitiveDependents:i,covered:W(k),uncovered:W(u),unverifiable:W(d)},blockingReasons:g,needsAttention:c}}function W(e){return [...new Set(e)].sort((t,r)=>t.localeCompare(r))}async function Be(e){let t=m.resolve(e.workspacePath);if(e.fromImpactPath){let o=ve(t,e.fromImpactPath);return {impact:await le(o),fromImpactRef:m.relative(t,o).split(m.sep).join("/"),impactFromDisk:true}}let r=m.join(t,g);if(await v.pathExists(r))return {impact:await le(r),fromImpactRef:g,impactFromDisk:true};let s=m.join(t,d$3);if(await v.pathExists(s))return {impact:await o({workspacePath:t,fromPath:d$3,scope:e.scope,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}),fromImpactRef:d$3,impactFromDisk:false};let i=await k({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now});return {impact:{schemaVersion:f,generatedAt:(e.now??new Date).toISOString(),fromRef:"baseline",diffRef:a.diff,workspace:{name:i.workspace.name,profile:i.workspace.profile,type:i.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:i.graph?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:b$1.diff,generatedAt:(e.now??new Date).toISOString(),fromRef:"baseline",toRef:a.model,fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:i}},impactFromDisk:false}}function _e(e,t){if(t)return e.generatedAt}async function ft(e){let t=m.resolve(e.workspacePath),{impact:r,fromImpactRef:s,impactFromDisk:i}=await Be(e),o$1=r.diff.currentModel,k$1=i?await k({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}):o$1,u=[];if(i){let l=await o({workspacePath:t,fromPath:r.diff.fromRef,diff:r.diff,scope:e.scope,now:e.now}),B=[r.affectedProjects,r.transitiveImpact,r.verificationPlan],_=[l.affectedProjects,l.transitiveImpact,l.verificationPlan];JSON.stringify(B)!==JSON.stringify(_)&&u.push("workspace.impact: Persisted impact semantics do not match the impact re-derived from the embedded diff. Regenerate diff and impact.");}i&&d(k$1)!==r.diff.toHash&&u.push("workspace.impact: Impact evidence is stale because the current workspace model no longer matches the embedded model. Regenerate diff and impact.");let d$2=r.diff.git;if(i&&d$2?.available){let l=a$1(t,{ref:d$2.ref}),B=r.diff.changes.filter(h=>h.type.startsWith("git.")).map(h=>`${h.type}:${h.target.replace(/^git:/,"")}`).sort(),_=[...l.changedFiles.map(h=>`git.file.changed:${h}`),...l.untrackedFiles.map(h=>`git.untracked:${h}`),...l.deletedFiles.map(h=>`git.deleted:${h}`)].sort();(!l.available||l.commit!==d$2.commit||JSON.stringify(_)!==JSON.stringify(B))&&u.push("workspace.impact: Impact evidence is stale because Git changes no longer match the diff observation. Regenerate diff and impact.");}let g=_e(r,i),c$1=be([...n(),...r.verificationPlan]).filter(l=>we(e.scope,l)),n$1=[];for(let l of c$1)n$1.push(await $e(l,t,o$1.contracts.exists===true,g));let a=Oe(r,n$1),f=a$2(o$1.graph??{nodes:[],edges:[]}),y=b$2(o$1),j=await Ne(t),w=c(y,j?.freshness?.projectHashes),x={verdict:w.verdict,baseline:w.baseline,changed:w.changed,added:w.added,removed:w.removed,projectHashes:d$1(y)},A=b$3(f),P=o$1.policies?.mode??"warn",p=await De(o$1,t),O=He(P,p),E=Fe(n$1,{blockingReasons:[...a.blockingReasons,...A,...O.blockingReasons,...u],needsAttention:a.needsAttention||O.needsAttention}),fe=n$1.filter(l=>l.status==="missing"&&l.evidencePath).map(l=>l.evidencePath),I=[...n$1.filter(l=>l.required&&(l.status==="fail"||l.status==="missing")).map(l=>`${l.id}: ${l.message}`),...a.blockingReasons,...A,...O.blockingReasons,...u],pe=p.filter(l=>l.severity==="error").length,me=o$1.summary?.projectCount??o$1.projects.length,J=de({projectCount:me,verdict:E.verdict,exitCode:E.exitCode,blockingReasons:I,policyErrorCount:pe});E.verdict=J.verdict,E.exitCode=J.exitCode;let G=I.length>0?ce({blockingReasons:I,verifyCommand:"npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json",verifyArtifact:z}):[];return {schemaVersion:ue,generatedAt:(e.now??new Date).toISOString(),workspacePath:t,mode:"evidence",fromImpactRef:s,scope:e.scope,impact:{changed:r.summary.changed,risk:r.summary.risk,affectedProjects:r.summary.affectedProjects,recommendedCommands:r.summary.recommendedCommands},summary:E,steps:n$1,missingEvidence:fe,blockingReasons:I,...G.length>0?{resolutionHints:G}:{},verificationPlan:c$1,affectedSubgraph:a.subgraph,graphIntegrity:f,freshness:x,policyMode:P,policyViolations:p}}async function De(e,t){let r=[];for(let i of e.validation?.issues??[])r.push({source:"model",severity:i.severity,code:i.code,message:i.message,target:i.target});let s=await d$2(t,a.contractVerify);try{if(s&&await v.pathExists(s)){let i=await v.readJson(s);if(Array.isArray(i.violations))for(let o of i.violations)typeof o=="string"&&o.trim().length>0&&r.push({source:"contract",severity:"error",code:"contract.violation",message:o});}}catch{}return r.sort((i,o)=>i.source!==o.source?i.source.localeCompare(o.source):i.code!==o.code?i.code.localeCompare(o.code):i.message.localeCompare(o.message))}function He(e,t){let r=t.filter(s=>s.severity==="error");return e==="enforce"&&r.length>0?{blockingReasons:r.map(s=>`policy.${s.code}: ${s.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:r.length>0}}async function Ne(e){let t=m.join(e,z);try{if(!await v.pathExists(t))return null;let r=await v.readJson(t);return r&&r.schemaVersion===ue?r:null}catch{return null}}async function pt(e$1,t){return e(t,z,a$3(e$1))}function Me(e,t){let r=t?.strict?"strict":"default",s=[];if(e.summary.verdict==="blocked")return s.push(...e.blockingReasons),s.length===0&&s.push("verify verdict is blocked."),{passed:false,mode:r,exitCode:2,reasons:s};if(r==="strict"){if(e.summary.verdict!=="ready"&&s.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let i=[...e.freshness.changed,...e.freshness.added].slice(0,5);s.push(`freshness is stale${i.length>0?`: ${i.join(", ")}`:""} (strict requires fresh).`);}if(s.length>0)return {passed:false,mode:r,exitCode:1,reasons:s}}return {passed:true,mode:r,exitCode:0,reasons:s}}function mt(e,t){return Me(e,t).exitCode}export{oe as a,Ue as b,ue as c,z as d,Oe as e,ft as f,pt as g,Me as h,mt as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-
|
|
1
|
+
export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-BSRVO52Y.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as DOCTOR_WORKSPACE_REPORT_PATH,m as applyEnvKeyAddFix,i as applyFileAppendFix,j as applyFileCopyFix,h as applyFileCreateFix,l as applyJsonEditFix,n as applyMakefileTargetFix,g as applyPackageScriptFix,f as assertOperationPathInsideProject,e as buildRepairOperationIdentity,p as computeDoctorFixAwareExitCode,o as computeDoctorGateExitCode,k as decodeJsonPointerSegment,d as parseInternalRepairCommand,c as parsePackageScriptFix,b as resolveDoctorPolicyProfile,q as runDoctor}from'./chunk-
|
|
1
|
+
export{a as DOCTOR_WORKSPACE_REPORT_PATH,m as applyEnvKeyAddFix,i as applyFileAppendFix,j as applyFileCopyFix,h as applyFileCreateFix,l as applyJsonEditFix,n as applyMakefileTargetFix,g as applyPackageScriptFix,f as assertOperationPathInsideProject,e as buildRepairOperationIdentity,p as computeDoctorFixAwareExitCode,o as computeDoctorGateExitCode,k as decodeJsonPointerSegment,d as parseInternalRepairCommand,c as parsePackageScriptFix,b as resolveDoctorPolicyProfile,q as runDoctor}from'./chunk-MEMHNE7Y.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ declare function getPublishedContractVersions(): {
|
|
|
35
35
|
workspaceWatchEvent: "workspace-watch-event.v1";
|
|
36
36
|
doctorProjectScan: "doctor-project-scan-v2";
|
|
37
37
|
doctorWorkspaceCache: "doctor-workspace-cache-v2";
|
|
38
|
+
workspaceContract: number;
|
|
38
39
|
runtimeCommandSurface: string;
|
|
39
40
|
cliRuntimeCommandInventory: "workspai-cli-runtime-command-inventory-v1";
|
|
40
41
|
cliOperationResult: "workspai-cli-operation-result-v1";
|
|
@@ -47,6 +48,7 @@ declare function getPublishedContractVersions(): {
|
|
|
47
48
|
workspaceIntelligenceChain: "workspai-workspace-intelligence-chain-v1";
|
|
48
49
|
workspaceIntelligenceArtifacts: {
|
|
49
50
|
readonly model: "workspace-model.v1";
|
|
51
|
+
readonly knowledgeGraph: "workspace-knowledge-graph.v1";
|
|
50
52
|
readonly snapshot: "workspace-model-snapshot.v1";
|
|
51
53
|
readonly diff: "workspace-model-diff.v1";
|
|
52
54
|
readonly impact: "workspace-impact.v1";
|
|
@@ -73,6 +75,10 @@ declare function getPublishedContractVersions(): {
|
|
|
73
75
|
workspaceVerify: "workspace-verify.v1";
|
|
74
76
|
workspaceContext: "workspace-context.v1";
|
|
75
77
|
workspaceDependencyGraph: "workspace-dependency-graph.v1";
|
|
78
|
+
workspaceKnowledgeGraph: "workspace-knowledge-graph.v1";
|
|
79
|
+
workspaceKnowledgeGraphChangeOverlay: "workspace-knowledge-graph-change-overlay.v1";
|
|
80
|
+
workspaceKnowledgeSearch: "workspace-knowledge-search.v1";
|
|
81
|
+
workspaceGraphTokenEfficiency: "workspace-graph-token-efficiency.v1";
|
|
76
82
|
workspaceIntelligenceHistory: "workspace-intelligence-history.v1";
|
|
77
83
|
agentCustomizationPackCapabilities: "workspai-agent-customization-pack-capabilities.v1";
|
|
78
84
|
agentCustomizationPackReport: "rapidkit-agent-customization-pack.v1";
|
|
@@ -89,13 +95,14 @@ declare function getPublishedContractCatalog(): {
|
|
|
89
95
|
[k: string]: {
|
|
90
96
|
artifacts?: {
|
|
91
97
|
[k: string]: {
|
|
92
|
-
path: ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | "AGENTS.md" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json";
|
|
93
|
-
schemaVersion: "workspace-model.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | null;
|
|
94
|
-
contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | null;
|
|
98
|
+
path: ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-knowledge-graph.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | "AGENTS.md" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json";
|
|
99
|
+
schemaVersion: "workspace-model.v1" | "workspace-knowledge-graph.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | null;
|
|
100
|
+
contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | null;
|
|
95
101
|
};
|
|
96
102
|
} | undefined;
|
|
97
|
-
schemaVersion: string | {
|
|
103
|
+
schemaVersion: string | number | {
|
|
98
104
|
readonly model: "workspace-model.v1";
|
|
105
|
+
readonly knowledgeGraph: "workspace-knowledge-graph.v1";
|
|
99
106
|
readonly snapshot: "workspace-model-snapshot.v1";
|
|
100
107
|
readonly diff: "workspace-model-diff.v1";
|
|
101
108
|
readonly impact: "workspace-impact.v1";
|
|
@@ -176,6 +183,7 @@ declare function getVersionContract(): {
|
|
|
176
183
|
workspaceWatchEvent: "workspace-watch-event.v1";
|
|
177
184
|
doctorProjectScan: "doctor-project-scan-v2";
|
|
178
185
|
doctorWorkspaceCache: "doctor-workspace-cache-v2";
|
|
186
|
+
workspaceContract: number;
|
|
179
187
|
runtimeCommandSurface: string;
|
|
180
188
|
cliRuntimeCommandInventory: "workspai-cli-runtime-command-inventory-v1";
|
|
181
189
|
cliOperationResult: "workspai-cli-operation-result-v1";
|
|
@@ -188,6 +196,7 @@ declare function getVersionContract(): {
|
|
|
188
196
|
workspaceIntelligenceChain: "workspai-workspace-intelligence-chain-v1";
|
|
189
197
|
workspaceIntelligenceArtifacts: {
|
|
190
198
|
readonly model: "workspace-model.v1";
|
|
199
|
+
readonly knowledgeGraph: "workspace-knowledge-graph.v1";
|
|
191
200
|
readonly snapshot: "workspace-model-snapshot.v1";
|
|
192
201
|
readonly diff: "workspace-model-diff.v1";
|
|
193
202
|
readonly impact: "workspace-impact.v1";
|
|
@@ -214,6 +223,10 @@ declare function getVersionContract(): {
|
|
|
214
223
|
workspaceVerify: "workspace-verify.v1";
|
|
215
224
|
workspaceContext: "workspace-context.v1";
|
|
216
225
|
workspaceDependencyGraph: "workspace-dependency-graph.v1";
|
|
226
|
+
workspaceKnowledgeGraph: "workspace-knowledge-graph.v1";
|
|
227
|
+
workspaceKnowledgeGraphChangeOverlay: "workspace-knowledge-graph-change-overlay.v1";
|
|
228
|
+
workspaceKnowledgeSearch: "workspace-knowledge-search.v1";
|
|
229
|
+
workspaceGraphTokenEfficiency: "workspace-graph-token-efficiency.v1";
|
|
217
230
|
workspaceIntelligenceHistory: "workspace-intelligence-history.v1";
|
|
218
231
|
agentCustomizationPackCapabilities: "workspai-agent-customization-pack-capabilities.v1";
|
|
219
232
|
agentCustomizationPackReport: "rapidkit-agent-customization-pack.v1";
|
|
@@ -230,13 +243,14 @@ declare function getVersionContract(): {
|
|
|
230
243
|
[k: string]: {
|
|
231
244
|
artifacts?: {
|
|
232
245
|
[k: string]: {
|
|
233
|
-
path: ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | "AGENTS.md" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json";
|
|
234
|
-
schemaVersion: "workspace-model.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | null;
|
|
235
|
-
contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | null;
|
|
246
|
+
path: ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-knowledge-graph.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | "AGENTS.md" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json";
|
|
247
|
+
schemaVersion: "workspace-model.v1" | "workspace-knowledge-graph.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | null;
|
|
248
|
+
contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | null;
|
|
236
249
|
};
|
|
237
250
|
} | undefined;
|
|
238
|
-
schemaVersion: string | {
|
|
251
|
+
schemaVersion: string | number | {
|
|
239
252
|
readonly model: "workspace-model.v1";
|
|
253
|
+
readonly knowledgeGraph: "workspace-knowledge-graph.v1";
|
|
240
254
|
readonly snapshot: "workspace-model-snapshot.v1";
|
|
241
255
|
readonly diff: "workspace-model-diff.v1";
|
|
242
256
|
readonly impact: "workspace-impact.v1";
|
|
@@ -311,6 +325,7 @@ declare function getGlobalCommandCapabilities(): {
|
|
|
311
325
|
workspaceWatchEvent: "workspace-watch-event.v1";
|
|
312
326
|
doctorProjectScan: "doctor-project-scan-v2";
|
|
313
327
|
doctorWorkspaceCache: "doctor-workspace-cache-v2";
|
|
328
|
+
workspaceContract: number;
|
|
314
329
|
runtimeCommandSurface: string;
|
|
315
330
|
cliRuntimeCommandInventory: "workspai-cli-runtime-command-inventory-v1";
|
|
316
331
|
cliOperationResult: "workspai-cli-operation-result-v1";
|
|
@@ -323,6 +338,7 @@ declare function getGlobalCommandCapabilities(): {
|
|
|
323
338
|
workspaceIntelligenceChain: "workspai-workspace-intelligence-chain-v1";
|
|
324
339
|
workspaceIntelligenceArtifacts: {
|
|
325
340
|
readonly model: "workspace-model.v1";
|
|
341
|
+
readonly knowledgeGraph: "workspace-knowledge-graph.v1";
|
|
326
342
|
readonly snapshot: "workspace-model-snapshot.v1";
|
|
327
343
|
readonly diff: "workspace-model-diff.v1";
|
|
328
344
|
readonly impact: "workspace-impact.v1";
|
|
@@ -349,6 +365,10 @@ declare function getGlobalCommandCapabilities(): {
|
|
|
349
365
|
workspaceVerify: "workspace-verify.v1";
|
|
350
366
|
workspaceContext: "workspace-context.v1";
|
|
351
367
|
workspaceDependencyGraph: "workspace-dependency-graph.v1";
|
|
368
|
+
workspaceKnowledgeGraph: "workspace-knowledge-graph.v1";
|
|
369
|
+
workspaceKnowledgeGraphChangeOverlay: "workspace-knowledge-graph-change-overlay.v1";
|
|
370
|
+
workspaceKnowledgeSearch: "workspace-knowledge-search.v1";
|
|
371
|
+
workspaceGraphTokenEfficiency: "workspace-graph-token-efficiency.v1";
|
|
352
372
|
workspaceIntelligenceHistory: "workspace-intelligence-history.v1";
|
|
353
373
|
agentCustomizationPackCapabilities: "workspai-agent-customization-pack-capabilities.v1";
|
|
354
374
|
agentCustomizationPackReport: "rapidkit-agent-customization-pack.v1";
|
|
@@ -365,13 +385,14 @@ declare function getGlobalCommandCapabilities(): {
|
|
|
365
385
|
[k: string]: {
|
|
366
386
|
artifacts?: {
|
|
367
387
|
[k: string]: {
|
|
368
|
-
path: ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | "AGENTS.md" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json";
|
|
369
|
-
schemaVersion: "workspace-model.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | null;
|
|
370
|
-
contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | null;
|
|
388
|
+
path: ".workspai/reports/workspace-model.json" | ".workspai/reports/workspace-knowledge-graph.json" | ".workspai/reports/workspace-model-snapshot.json" | ".workspai/reports/workspace-model-diff-last-run.json" | ".workspai/reports/workspace-impact-last-run.json" | ".workspai/reports/analyze-last-run.json" | ".workspai/reports/doctor-last-run.json" | ".workspai/reports/workspace-contract-verify-last-run.json" | ".workspai/reports/release-readiness-last-run.json" | ".workspai/reports/workspace-verify-last-run.json" | ".workspai/reports/workspace-intelligence-history.json" | ".workspai/reports/workspace-context-agent.json" | ".workspai/reports/INDEX.json" | ".workspai/reports/agent-customization-pack.json" | ".workspai/reports/workspace-skills-index.json" | "AGENTS.md" | ".workspai/reports/workspace-explain-last-run.json" | ".workspai/reports/workspace-intelligence-run-last-run.json";
|
|
389
|
+
schemaVersion: "workspace-model.v1" | "workspace-knowledge-graph.v1" | "workspace-model-snapshot.v1" | "workspace-model-diff.v1" | "workspace-impact.v1" | "rapidkit-analyze-v1" | "doctor-workspace-evidence-v1" | "workspace-contract-verify.v1" | "release-readiness-v1" | "workspace-verify.v1" | "workspace-intelligence-history.v1" | "workspace-context.v1" | "rapidkit-agent-reports-index.v1" | "rapidkit-agent-customization-pack.v1" | "workspace-skills-index.v1" | "workspace-explain.v1" | "workspace-intelligence-run.v1" | null;
|
|
390
|
+
contractPath: "contracts/workspace-intelligence/workspace-model.v1.json" | "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json" | "contracts/workspace-intelligence/workspace-model-snapshot.v1.json" | "contracts/workspace-intelligence/workspace-model-diff.v1.json" | "contracts/workspace-intelligence/workspace-impact.v1.json" | "contracts/analyze-last-run.v1.json" | "contracts/doctor-workspace-evidence.v1.json" | "contracts/workspace-intelligence/workspace-contract-verify.v1.json" | "contracts/release-readiness.v1.json" | "contracts/workspace-intelligence/workspace-verify.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-history.v1.json" | "contracts/workspace-intelligence/workspace-context.v1.json" | "contracts/workspace-intelligence/agent-reports-index.v1.json" | "contracts/workspace-intelligence/agent-customization-pack-report.v1.json" | "contracts/workspace-intelligence/workspace-skills-index.v1.json" | "contracts/workspace-intelligence/workspace-explain.v1.json" | "contracts/workspace-intelligence/workspace-intelligence-run.v1.json" | null;
|
|
371
391
|
};
|
|
372
392
|
} | undefined;
|
|
373
|
-
schemaVersion: string | {
|
|
393
|
+
schemaVersion: string | number | {
|
|
374
394
|
readonly model: "workspace-model.v1";
|
|
395
|
+
readonly knowledgeGraph: "workspace-knowledge-graph.v1";
|
|
375
396
|
readonly snapshot: "workspace-model-snapshot.v1";
|
|
376
397
|
readonly diff: "workspace-model-diff.v1";
|
|
377
398
|
readonly impact: "workspace-impact.v1";
|