workspai 0.79.0 → 0.79.1

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.
Files changed (43) hide show
  1. package/README.md +117 -236
  2. package/dist/autopilot-release-E7ADQH2B.js +1 -0
  3. package/dist/{chunk-EPFEUMYF.js → chunk-5MRDPZU7.js} +1 -1
  4. package/dist/{chunk-FVG5FBA4.js → chunk-5NS322HT.js} +28 -28
  5. package/dist/{chunk-B6FJ6RG6.js → chunk-6CZQXEZ7.js} +1 -1
  6. package/dist/{chunk-7MIOAM4A.js → chunk-CAGOLU4Q.js} +1 -1
  7. package/dist/{chunk-ZDLF77IS.js → chunk-DYSFGHV5.js} +1 -1
  8. package/dist/{chunk-4H3VNKOJ.js → chunk-FJMUBFXO.js} +1 -1
  9. package/dist/{chunk-HXTNPR3M.js → chunk-GIP7YFWR.js} +1 -1
  10. package/dist/{chunk-BGUCDG5N.js → chunk-IF2OWXNY.js} +1 -1
  11. package/dist/{chunk-KTOKU6HQ.js → chunk-L3O2QXKH.js} +1 -1
  12. package/dist/{chunk-CJBDYDVC.js → chunk-LQYMYRGI.js} +1 -1
  13. package/dist/{chunk-7SN4V3RC.js → chunk-MJYWGRCY.js} +1 -1
  14. package/dist/{chunk-H24MEOML.js → chunk-NZQKHGPE.js} +1 -1
  15. package/dist/chunk-WJKQTX4V.js +2 -0
  16. package/dist/{chunk-GUCZOQUS.js → chunk-ZXYTWF2R.js} +1 -1
  17. package/dist/{create-M3TWRHV6.js → create-2ETTECFU.js} +1 -1
  18. package/dist/{doctor-FF3WLJSP.js → doctor-3F7OUVYQ.js} +1 -1
  19. package/dist/{goal-interactive-selection-6YJOK4WC.js → goal-interactive-selection-EMHAM5TM.js} +1 -1
  20. package/dist/{goal-lifecycle-O4MYYTRU.js → goal-lifecycle-PR5O7T6B.js} +1 -1
  21. package/dist/{goal-pack-NUDKANPM.js → goal-pack-TEK2PHAV.js} +1 -1
  22. package/dist/index.js +158 -158
  23. package/dist/{pipeline-V5P2FX2P.js → pipeline-E6YY65GU.js} +1 -1
  24. package/dist/{project-agent-entry-6O7FKWSL.js → project-agent-entry-MXAHZSQR.js} +1 -1
  25. package/dist/{project-intelligence-lens-OQTZ4K7L.js → project-intelligence-lens-IUM66OV2.js} +1 -1
  26. package/dist/{proof-carrying-change-GV37YLDQ.js → proof-carrying-change-XA5HRGSB.js} +1 -1
  27. package/dist/{verified-goal-VB7IOTNO.js → verified-goal-V5OVULY7.js} +1 -1
  28. package/dist/{workspace-AXU6ODER.js → workspace-XVPKQG5W.js} +1 -1
  29. package/dist/{workspace-agent-sync-6427FNME.js → workspace-agent-sync-46L7ZOQQ.js} +1 -1
  30. package/dist/{workspace-foundation-GYL3D7TW.js → workspace-foundation-PZNZWUJ4.js} +1 -1
  31. package/dist/{workspace-intelligence-runner-2EJ7GXG5.js → workspace-intelligence-runner-NZFRFCPN.js} +1 -1
  32. package/dist/{workspace-mcp-serve-BSA6Q4EB.js → workspace-mcp-serve-TIYCW364.js} +1 -1
  33. package/dist/{workspace-onboarding-NH4WFJ5N.js → workspace-onboarding-WUO6KCLF.js} +1 -1
  34. package/dist/{workspace-repair-engine-ODTFFM6O.js → workspace-repair-engine-V4Z7TJGS.js} +1 -1
  35. package/dist/workspace-run-T65CCZIN.js +1 -0
  36. package/docs/README.md +48 -116
  37. package/docs/ci-workflows.md +7 -1
  38. package/docs/creating-workspaces-and-projects.md +5 -0
  39. package/package.json +2 -2
  40. package/dist/autopilot-release-MDMVMU67.js +0 -1
  41. package/dist/chunk-ICPL4WNK.js +0 -2
  42. package/dist/workspace-run-VDQ6BYLS.js +0 -1
  43. /package/dist/{chunk-SV7X5LJW.js → chunk-GOOY7I36.js} +0 -0
package/docs/README.md CHANGED
@@ -1,109 +1,65 @@
1
- # Workspai NPM — Documentation Index
1
+ # Workspai documentation
2
2
 
3
- Workspai helps people and tools understand the same software system. Use these
4
- guides to connect existing projects, create new ones, map their relationships,
5
- check changes, prepare AI context, and automate release checks.
3
+ **New here? Start with your project.** You do not need to learn the architecture
4
+ or move your source to try Workspai.
6
5
 
7
- Start with the [main README](../README.md) for the product overview, or use the
8
- quickstart below. `workspai` is the main package and command; `wspai` is only a
9
- shorter optional name.
6
+ [Product overview](../README.md) · [Command reference](./commands-reference.md) ·
7
+ [Glossary](./GLOSSARY.md)
10
8
 
11
- ## Quickstart: from zero to value in 60 seconds
9
+ ## First run
12
10
 
13
- You have an existing project. You want AI agents (and your team) to understand
14
- it as a system—not just a pile of files. Three commands:
11
+ You need **Node.js 20.19+ and npm**. In your project's terminal:
15
12
 
16
13
  ```bash
17
- # Step 1: Adopt the project (it stays where it is)
18
- cd /path/to/your/project
19
14
  npx workspai adopt .
15
+ npx workspai workspace intelligence run --for-agent generic
16
+ ```
20
17
 
21
- # Step 2: Build the full workspace intelligence
22
- npx workspai workspace intelligence run --for-agent generic --strict --json
18
+ Workspai adds metadata and agent entry files to your project and saves shared
19
+ reports in a linked workspace. The system map and checks do not require an AI
20
+ API key. Read the terminal summary to find context and checks that need attention.
23
21
 
24
- # Step 3: Validate the canonical agent entry
25
- npx workspai agent bootstrap --for-agent generic --strict --json
26
- ```
22
+ Starting a new project? Run `npx workspai create` for guided setup.
27
23
 
28
- That is it. Your project now has:
24
+ ## What do you want to do next?
29
25
 
30
- - A **Workspace Model** describing every project, runtime, and dependency
31
- - A **Knowledge Graph** with searchable, proof-backed relationships
32
- - **Agent grounding** files (`AGENTS.md`, Cursor rules, Claude rules, etc.)
33
- - **Health checks** that name what is broken and why
26
+ | Your goal | Start here |
27
+ | --- | --- |
28
+ | Set up an existing or new project | [Getting started](./creating-workspaces-and-projects.md) |
29
+ | Connect Codex, Claude Code, Cursor, or Copilot | [Agent setup](./agent-entry.md) |
30
+ | Find relationships and their source references | [Explore the graph](./workspace-knowledge-graph.md) |
31
+ | Give an agent a specific outcome | [Plan a goal](./goal-packs.md) |
32
+ | Record and verify an agent's changes | [Proof-Carrying Change](./proof-carrying-change.md) |
33
+ | Fix a reported blocker | [Doctor](./doctor-command.md) · [Repair workflow](./workspace-repair-engine.md) |
34
+ | Run checks in CI | [CI guide](./ci-workflows.md) |
34
35
 
35
- Continue from the same project terminal for any Workspai command—no `cd` needed.
36
+ You can keep working from the same project terminal. After changes, rerun the
37
+ intelligence command to refresh the saved view. A blocked check names something
38
+ to investigate; an empty graph search means no current evidence proves a match.
36
39
 
37
- Use `generic` for a vendor-neutral context pack, or select a published host
38
- target such as `codex`, `claude`, `gemini`, `qwen`, `kimi`, `grok`, `copilot`,
39
- `cursor`, `windsurf`, or `amazon-q`. Agent Sync publishes shared files and thin
40
- host adapters that route every consumer to the same evidence.
40
+ ## For CI and automation
41
41
 
42
- Use the release pipeline when you need the broader release workflow:
42
+ Use the strict JSON runner:
43
43
 
44
44
  ```bash
45
- npx workspai pipeline --json --strict
45
+ npx workspai workspace intelligence run --for-agent generic --strict --json
46
46
  ```
47
47
 
48
- Adoption keeps source in place. The command maps the system and its
49
- connections, checks what changes may affect, runs health and release checks,
50
- and prepares focused AI context under `.workspai/`. When the workspace is not
51
- ready, the report shows the reason and points to the files or reports behind
52
- it. Automation details and supported AI tools are documented in the
53
- [Unified runner](./workspace-intelligence-runner.md). See the
54
- [Artifact Catalog](./contracts/ARTIFACT_CATALOG.md) for exact paths, writers,
55
- schemas, and consumers.
48
+ [Runner behavior and exit codes](./workspace-intelligence-runner.md) ·
49
+ [Generated files and schemas](./contracts/ARTIFACT_CATALOG.md)
56
50
 
57
- To start with a new workspace instead:
51
+ ## Building agents or model gateways?
58
52
 
59
- ```bash
60
- npx workspai create workspace my-workspace --profile minimal --yes
61
- cd ~/.workspai/workspaces/my-workspace
62
- npx workspai create project nextjs web --yes
63
- ```
53
+ [Agent framework adapters](./agent-framework-adapters.md) covers the supported
54
+ framework kits. [Model gateways](./model-gateways.md) covers server-owned SDK
55
+ starters. These are separate from giving a coding agent context about your project.
64
56
 
65
- From the workspace terminal, create a project, use `adopt` to link one in place,
66
- or use `import` to copy or clone one into the workspace.
67
-
68
- ## Table of contents
69
-
70
- - [Choose a guide by goal](#choose-a-guide-by-goal)
71
- - [User documentation](#user-documentation)
72
- - [Operations & security](#operations--security)
73
- - [AI module recommendations](#ai-module-recommendations)
74
- - [Technical contracts](#technical-contracts)
75
- - [Contributor documentation](#contributor-documentation)
76
- - [Validation commands](#validation-commands)
77
-
78
- ## Choose a guide by goal
79
-
80
- | I want to… | Start here | Expected outcome |
81
- | -------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
82
- | Create a workspace or project | [Creating workspaces and projects](./creating-workspaces-and-projects.md) | A registered project with canonical `.workspai` metadata |
83
- | Bring an existing repository under governance | [Workspace operations](./workspace-operations.md#import-and-adoption) | Source stays in place with `adopt`, or is copied/cloned with `import` |
84
- | Run the complete intelligence loop | [Unified runner](./workspace-intelligence-runner.md) | One ordered run report with durable stage evidence |
85
- | Turn plain language into governed work | [Goal Packs](./goal-packs.md) | A scope-bound, evidence-pinned plan and portable agent handoff |
86
- | Prove what an agent changed and why | [Proof-Carrying Change](./proof-carrying-change.md) | A Goal-bound, effect-receipted, independently verified change capsule |
87
- | Define or implement an agent framework integration | [Agent Framework Adapter Contract](./agent-framework-adapters.md) | One provider-neutral manifest, ownership boundary, and conformance gate |
88
- | Create a server-owned model gateway | [AI Gateway](./model-gateways.md) | OpenRouter TypeScript or Python Client SDK starter with workspace lifecycle |
89
- | Ground an agent before broad source discovery | [Canonical-first agent entry](./agent-entry.md) | A portable receipt for host discovery, evidence integrity, and freshness |
90
- | Repair a blocker through an approved transaction | [Workspace Repair Engine](./workspace-repair-engine.md) | Checkpointed execution, validation, canonical verify, and safe rollback |
91
- | Observe current CLI and Studio activity | [Workspai Live](./workspace-live-activity.md) | One bounded activity projection for terminal, IDE, replay, and capture |
92
- | Set a release, security, or coverage outcome | [Verified engineering goals](./workspace-intelligence-runner.md#verified-engineering-goals) | A durable success contract with a current evidence-backed verdict |
93
- | Ask an architecture or dependency question | [Workspace Knowledge Graph](./workspace-knowledge-graph.md) | A bounded answer with proof references rather than the whole graph |
94
- | Measure agent token, cost, and outcome efficiency | [Workspace Intelligence Evaluation](./workspace-intelligence-evaluation.md) | A live, provenance-aware report suitable for CLI, IDE, and CI |
95
- | Benchmark bounded retrieval across fixed scenarios | [Workspace Intelligence Benchmark](./workspace-intelligence-benchmark.md) | An offline suite with honest estimate/measurement boundaries |
96
- | Integrate CI or release gates | [CI workflows](./ci-workflows.md) | Machine-readable exit codes and uploadable evidence |
97
- | Find the writer, schema, or path for an output | [Artifact Catalog](./contracts/ARTIFACT_CATALOG.md) | One canonical source instead of path guessing |
98
- | Understand Workspai terminology | [Glossary](./GLOSSARY.md) | Shared meanings for model, graph, evidence, gate, and artifacts |
99
- | Review or change the main product README | [README content contract](./README_CONTENT_CONTRACT.md) | Stable narrative, claim boundaries, and machine-enforced drift rules |
100
- | Choose a first contribution path | [Contribution Hub](../../../.github/CONTRIBUTING.md) | One bounded task, support route, and file-aware validation plan |
101
- | Contribute to the CLI | [Development](./DEVELOPMENT.md) | Local build, test, contract, and documentation gates |
102
-
103
- There are two different AI-facing features. Workspace Intelligence is
104
- deterministic, proof-backed, and does not require an AI API key. The optional
105
- module recommender uses embeddings to suggest FastAPI or NestJS modules; start
106
- with [AI Quickstart](./AI_QUICKSTART.md) only when that is your goal.
57
+ ## Reference library
58
+
59
+ Looking for a specific feature, integration, or contract? Open the complete index.
60
+
61
+ <details>
62
+ <summary>All guides, technical contracts, and contributor resources</summary>
107
63
 
108
64
  ## User documentation
109
65
 
@@ -210,35 +166,11 @@ npm run validate:docs-examples # example JSON/YAML in docs
210
166
  npm run smoke:readme # CLI help smoke for documented commands
211
167
  ```
212
168
 
213
- ## Repository layout
214
-
215
- ```text
216
- workspai/
217
- ├── README.md # Monorepo overview
218
- ├── package.json # Private workspace root
219
- └── packages/
220
- └── cli/
221
- ├── README.md # CLI user hub (install, quickstarts, doc links)
222
- ├── CHANGELOG.md
223
- ├── RELEASE_NOTES.md
224
- ├── releases/ # Per-version release notes
225
- └── docs/
226
- ├── README.md # This index
227
- ├── README_CONTENT_CONTRACT.md
228
- ├── commands-reference.md
229
- ├── workspace-knowledge-graph.md
230
- ├── workspace-intelligence-evaluation.md
231
- ├── workspace-operations.md
232
- ├── workspace-run.md
233
- ├── ci-workflows.md
234
- ├── doctor-command.md
235
- ├── OPEN_SOURCE_USER_SCENARIOS.md
236
- ├── config-file-guide.md
237
- ├── SECURITY.md
238
- ├── SETUP.md
239
- ├── DEVELOPMENT.md
240
- ├── contracts/ # Contract docs (mirrors + matrices)
241
- └── … # AI guides, policies, examples
242
- ```
243
169
 
244
- Enterprise governance runbooks are maintained outside this OSS docs tree.
170
+ </details>
171
+
172
+ ## Help and feedback
173
+
174
+ [Ask a question](https://github.com/chistiq/workspai/discussions) ·
175
+ [Report a problem](https://github.com/chistiq/workspai/issues) ·
176
+ [Contribute](../../../.github/CONTRIBUTING.md)
@@ -68,6 +68,12 @@ from the changed paths:
68
68
  | Dependency or security surface | npm audit, SBOM, dependency review, and CodeQL |
69
69
 
70
70
  Specialized workflows use identical `push` and `pull_request` path filters.
71
+ The complete Windows CLI suite runs in four shards on separate runners, with
72
+ two Vitest workers per runner to limit filesystem contention. Every shard must
73
+ pass before `CI Gate` succeeds; no test files are excluded. Each shard uploads
74
+ a JSON test report with timings. Linux retains the complete coverage suite;
75
+ macOS retains the complete platform suite. Sharding reduces elapsed time by
76
+ using additional runners; it does not promise lower total runner usage.
71
77
  Manual and scheduled runs remain available for full qualification and upstream
72
78
  drift detection. Workflow definitions and release-gate definitions trigger the
73
79
  lanes they govern.
@@ -139,7 +145,7 @@ Validate or preview the current CLI announcement locally:
139
145
  npm --workspace workspai run check:release-announcement
140
146
  npm --workspace workspai run release:announcement -- \
141
147
  --product workspai-cli \
142
- --tag v0.79.0 \
148
+ --tag v0.79.1 \
143
149
  --markdown-output /tmp/workspai-discord-announcement.md
144
150
  ```
145
151
 
@@ -11,6 +11,11 @@ commands, automation, and the most useful options.
11
11
  For a compact list of command syntax, see
12
12
  [commands-reference.md](./commands-reference.md).
13
13
 
14
+ During interactive `workspai create` setup, selection menus offer **← Back**.
15
+ Text fields accept **`/back`** to return to the previous setup step. Backtracking
16
+ changes your choices before creation begins; it does not undo files or navigate
17
+ prompts owned by an external generator. Ctrl+C still cancels the flow.
18
+
14
19
  ## The two things you can create
15
20
 
16
21
  A **workspace** is the shared home for related projects, rules, and saved
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workspai",
3
- "version": "0.79.0",
3
+ "version": "0.79.1",
4
4
  "type": "module",
5
5
  "description": "Open-source workspace intelligence CLI for software systems: create, adopt, govern, verify, and align polyglot workspaces for humans, CI, IDEs, and AI agents.",
6
6
  "keywords": [
@@ -216,7 +216,7 @@
216
216
  "@vitest/ui": "^4.1.11",
217
217
  "eslint": "^9.39.2",
218
218
  "husky": "^9.1.7",
219
- "lint-staged": "^15.5.2",
219
+ "lint-staged": "^16.4.0",
220
220
  "prettier": "^3.6.2",
221
221
  "size-limit": "12.1.0",
222
222
  "tsup": "^8.5.1",
@@ -1 +0,0 @@
1
- export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-7SN4V3RC.js';
@@ -1,2 +0,0 @@
1
- import {b as b$1}from'./chunk-B6FJ6RG6.js';import {N,M,k as k$1,q as q$1,G,I,O as O$1}from'./chunk-RRZQPFFR.js';import {c}from'./chunk-7HV4U2OV.js';import {e,f as f$1}from'./chunk-EFHSRPW7.js';import {b}from'./chunk-UJXE4UAX.js';import {m,l}from'./chunk-VQZ5PI5J.js';import {promises}from'fs';import c$1 from'path';import L,{homedir}from'os';import {pathToFileURL}from'url';import p from'process';import ie from'fs-extra';var y={schemaVersion:"workspai.model-gateway-qualification.v1",workspaiReleaseAuthority:"source-ready",attach:"unsupported",adapters:[{adapterId:"openrouter-typescript",status:"source-ready",platforms:[]},{adapterId:"openrouter-python",status:"source-ready",platforms:[]}]};var R=["ubuntu-latest","macos-latest","windows-latest"];function B(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Model gateway qualification document must be an object.");let t=e;if(!Array.isArray(t.adapters)||t.adapters.length===0)throw new Error("Model gateway qualification document contains no adapters.");let r=new Set;for(let a of t.adapters){if(!a||typeof a.adapterId!="string")throw new Error("Model gateway qualification adapter is missing adapterId.");if(r.has(a.adapterId))throw new Error(`Duplicate model gateway qualification adapter: ${a.adapterId}`);r.add(a.adapterId);let n=N(a.adapterId);if(!n)throw new Error(`Qualification adapter ${a.adapterId} is not in the version baseline.`);if(a.status!=="source-ready"&&a.status!=="qualified")throw new Error(`Invalid qualification status for ${a.adapterId}.`);if(!Array.isArray(a.platforms))throw new Error(`Qualification platforms missing for ${a.adapterId}.`);if(a.status==="source-ready"){if(a.platforms.length!==0)throw new Error(`Source-ready adapter ${a.adapterId} must not record platform qualification.`);continue}let s=new Set;for(let o of a.platforms){if(!o||!R.includes(o.os)||o.result!=="pass"||o.skippedRequiredStage!==false||o.sdkVersion!==n.sdkVersion)throw new Error(`Qualified adapter ${a.adapterId} is missing a valid platform record bound to ${n.sdkVersion}.`);if(s.has(o.os))throw new Error(`Duplicate platform ${o.os} for ${a.adapterId}.`);s.add(o.os);}for(let o of R)if(!s.has(o))throw new Error(`Qualified adapter ${a.adapterId} is missing ${o} evidence.`)}for(let a of M)if(!r.has(a.adapterId))throw new Error(`Baseline adapter ${a.adapterId} has no qualification record.`);let i=t.adapters.every(a=>a.status==="qualified");if(i)throw new Error("All adapters are qualified; release authority must match.")}B(y);var f=y,W=Object.freeze({schemaVersion:f.schemaVersion,workspaiReleaseAuthority:f.workspaiReleaseAuthority,attach:f.attach,adapters:Object.freeze(f.adapters.map(e=>Object.freeze({...e,platforms:Object.freeze(e.platforms.map(t=>Object.freeze(t)))})))}),z=W.workspaiReleaseAuthority;function K(e){return `${e} \xB7 ${z}`}var w=["backend","frontend","desktop","agent","gateway","extension","gaming"],J=[{id:"backend",label:"Backend",hint:"APIs and services"},{id:"frontend",label:"Frontend",hint:"Web applications"},{id:"desktop",label:"Desktop",hint:"Native desktop applications"},{id:"agent",label:"AI Agent",hint:"Governed agent runtimes"},{id:"gateway",label:"AI Gateway",hint:"Unified model access and routing"},{id:"extension",label:"Extension",hint:"Editor and platform extensions"},{id:"gaming",label:"Gaming",hint:"Game runtimes and tooling"}];function X(e){let r=e.label.indexOf(" \u2014 ");return r>=0?e.label.slice(r+3).trim():e.label.trim()}function Z(e){return w.includes(e.category)?e.category:null}function T(e){let t=c().flatMap(o=>{let l=Z(o);return l?[{value:o.id,label:`${D(l)} \xB7 ${X(o)}`,hint:`${o.runtime} \xB7 tested baseline`,name:o.label,category:l}]:[]}),r=k$1().map(o=>({value:o.kitId,label:`Frontend \xB7 ${o.displayName}`,hint:"official \xB7 latest stable",name:`${o.displayName} \u2014 ${o.framework}`,category:"frontend"})),i=q$1().map(o=>({value:o.kitId,label:`${D(o.category)} \xB7 ${o.displayName}`,hint:`${o.runtimeCandidates.join(" + ")} \xB7 official latest stable`,name:`${o.displayName} \u2014 ${o.category}`,category:o.category})),a=G().map(o=>({value:o.id,label:`AI Agent \xB7 ${o.label}`,hint:`${o.runtime} \xB7 ${I(o)?"release-admitted baseline":`${o.stability} \xB7 awaiting release admission`}`,name:o.label,category:"agent"})),n=O$1().map(o=>({value:o.id,label:`AI Gateway \xB7 ${o.label}`,hint:K(o.runtime),name:o.label,category:"gateway"})),s=[...t,...r,...i,...a,...n].filter(o=>!e||o.category===e).sort((o,l)=>{let Q=w.indexOf(o.category),V=w.indexOf(l.category);return Q-V||(o.label??"").localeCompare(l.label??"")});return O(s),s}function Ae(){let e=new Set(T().map(t=>t.category));return J.filter(t=>e.has(t.id)).map(t=>({value:t.id,label:t.label,hint:t.hint}))}function D(e){return e.charAt(0).toUpperCase()+e.slice(1)}function O(e){let t=new Set,r=new Set;for(let i of e){let a=i.label??i.name??String(i.value),n=String(i.value);if(t.has(a))throw new Error(`Duplicate kit picker label: ${a}`);if(r.has(n))throw new Error(`Duplicate kit picker value: ${n}`);t.add(a),r.add(n);}}var te=".workspairc.json",oe=".rapidkitrc.json",re=["workspai.config.js","workspai.config.mjs","workspai.config.cjs","rapidkit.config.js","rapidkit.config.mjs","rapidkit.config.cjs"],ae=["workspai.config.json","rapidkit.config.json"];function F(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function k(e,t){let r=t instanceof Error?t.message:String(t),i=e.endsWith(".js")&&/module is not defined in ES module scope/i.test(r)?' CommonJS syntax in a .js config is not valid when the project package uses "type": "module"; rename the file to .cjs or use export default.':"";return `Failed to load Workspai config at ${e}.${i} Cause: ${r}`}async function et(){for(let e$1 of [c$1.join(L.homedir(),te),c$1.join(L.homedir(),oe)])try{let t=await promises.readFile(e$1,"utf-8"),r=JSON.parse(t);return e.debug(`Loaded config from ${e$1}`),r}catch{}return e.debug("No user config found, using defaults"),{}}async function tt(e$1=process.cwd(),t={}){let r=e$1,i=c$1.parse(r).root;for(;r!==i;){for(let a of ae){let n=c$1.join(r,a);try{let s=await promises.readFile(n,"utf-8"),o=JSON.parse(s);if(!o||typeof o!="object"||Array.isArray(o))throw new Error("configuration root must be a JSON object");return e.debug(`Loaded data-only Workspai config from ${a}`),o}catch(s){if(F(s))continue;throw new Error(k(n,s))}}for(let a of re){let n=c$1.join(r,a);try{await promises.access(n);}catch(s){if(F(s))continue;throw new Error(k(n,s))}if(e.debug(`Found config file: ${n}`),!t.trustExecutableConfig)throw new Error(`Refusing to execute Workspai config at ${n} without explicit trust. Use a data-only workspai.config.json file, pass --trust-config, or set WORKSPAI_TRUST_CONFIG=1.`);try{let o=await import(pathToFileURL(n).href),l=o.default||o;return e.debug(`Loaded Workspai config from ${a}`),l}catch(s){throw new Error(k(n,s))}}r=c$1.dirname(r);}return e.debug("No Workspai config file found, using defaults"),{}}function ot(e,t,r){return {author:r.author||t.workspace?.defaultAuthor||e.author,pythonVersion:r.pythonVersion||t.workspace?.pythonVersion||e.pythonVersion,defaultInstallMethod:r.defaultInstallMethod||t.workspace?.installMethod||e.defaultInstallMethod,defaultKit:r.defaultKit||t.projects?.defaultKit||e.defaultKit,skipGit:r.skipGit??t.projects?.skipGit??e.skipGit,license:r.license||e.license,testRapidKitPath:r.testRapidKitPath||e.testRapidKitPath}}function rt(e){return f$1("DEV_PATH")||e.testRapidKitPath||void 0}var C=class extends Error{constructor(r,i){super(["Workspai workspaces cannot be nested.",`Target: ${r}`,`Containing workspace: ${i}`,"Choose Managed home or pass --output <path> with a location outside the current workspace."].join(`
2
- `));this.targetPath=r;this.containingWorkspacePath=i;this.name="NestedWorkspaceCreationError";}targetPath;containingWorkspacePath;code="WORKSPACE_NESTING_NOT_SUPPORTED"};async function ne(e){try{return !!await ie.stat(e)}catch{return false}}function se(e,t){let r=e.indexOf(t);if(r>=0&&r+1<e.length)return e[r+1];let i=e.find(a=>a.startsWith(`${t}=`));if(i)return i.slice(t.length+1)}function ce(e){return e.includes("--here")}async function U(e){let t=c$1.resolve(e);for(;;){let r=[c$1.join(t,".workspai-workspace"),c$1.join(t,".rapidkit-workspace"),c$1.join(t,".workspai","workspace.json"),c$1.join(t,".rapidkit","workspace.json")];if((await Promise.all(r.map(ne))).some(Boolean))return t;let i=c$1.dirname(t);if(i===t)return;t=i;}}async function ft(e){let t=c$1.resolve(e),r=await U(c$1.dirname(t));if(r)throw new C(t,r)}async function le(e,t=homedir()){let i=[{value:"managed",label:"Managed home",hint:l(t)}];return await U(e)||i.push({value:"here",label:"Current directory",hint:e}),i}function q(e,t=p.cwd()){if(ce(e))return c$1.resolve(t);let r=se(e,"--output");if(r)return c$1.resolve(r)}function gt(e,t=p.cwd()){let r=c$1.resolve(e),i=c$1.resolve(t),a=c$1.relative(i,r);return a.length>0&&!a.startsWith("..")&&!c$1.isAbsolute(a)?`cd ${a}`:`cd ${r}`}function mt(e,t={}){let r=t.argv??[],i=t.outputParent??q(r,p.cwd());return m(e.trim(),{homeDir:t.homeDir,outputDir:i})}function ht(e,t,r={}){return e?c$1.resolve(e)===c$1.resolve(t)?true:r.outputParent===void 0:false}async function yt(e,t={}){let r=t.cwd??p.cwd(),i=t.homeDir??homedir(),a=q(e,r);if(a!==void 0)return a;let n=t.hasYes??(e.includes("--yes")||e.includes("-y"));if(!(t.interactive??(!n&&!!p.stdin.isTTY&&!b())))return;let o=await le(r,i);if(o.length===1)return;let{location:l}=await b$1([{type:"rawlist",name:"location",message:"Where should the workspace be created?",choices:o,default:0}]);if(l==="here")return c$1.resolve(r)}export{T as a,Ae as b,et as c,tt as d,ot as e,rt as f,ft as g,gt as h,mt as i,ht as j,yt as k};
@@ -1 +0,0 @@
1
- export{a as resolveWorkspaceRunStageTimeoutMs,b as runWorkspaceStage}from'./chunk-SV7X5LJW.js';export{a as WORKSPACE_RUN_LAST_REPORT_FILENAME}from'./chunk-P5LI5DL3.js';
File without changes