workspai 0.43.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/LICENSE +21 -0
- package/README.md +624 -0
- package/contracts/agent-customization-pack.v1.json +229 -0
- package/contracts/analyze-last-run.v1.json +106 -0
- package/contracts/artifact-remediation-plan.v1.json +163 -0
- package/contracts/backend-import-stack-parity.snapshot.json +37 -0
- package/contracts/cli-log-event.v1.json +51 -0
- package/contracts/create-planner-capabilities.v1.json +251 -0
- package/contracts/doctor-project-evidence.v1.json +304 -0
- package/contracts/doctor-remediation-plan.v1.json +496 -0
- package/contracts/doctor-workspace-evidence.v1.json +315 -0
- package/contracts/extension-cli-compatibility.v1.json +26 -0
- package/contracts/infra-stack.v1.json +305 -0
- package/contracts/module-layout.v1.json +34 -0
- package/contracts/module-support.v1.json +20 -0
- package/contracts/pipeline-last-run.v1.json +80 -0
- package/contracts/release-readiness.v1.json +60 -0
- package/contracts/runtime-command-surface.v1.json +364 -0
- package/contracts/workspace-intelligence/agent-action-outcome.v1.json +38 -0
- package/contracts/workspace-intelligence/blocker-resolution.v1.json +65 -0
- package/contracts/workspace-intelligence/doctor-fix-result.v1.json +44 -0
- package/contracts/workspace-intelligence/fact-freshness.v1.json +58 -0
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +115 -0
- package/contracts/workspace-intelligence/workspace-context.v1.json +142 -0
- package/contracts/workspace-intelligence/workspace-contract-verify.v1.json +51 -0
- package/contracts/workspace-intelligence/workspace-dependency-graph.v1.json +152 -0
- package/contracts/workspace-intelligence/workspace-explain.v1.json +31 -0
- package/contracts/workspace-intelligence/workspace-impact.v1.json +114 -0
- package/contracts/workspace-intelligence/workspace-intelligence-history.v1.json +40 -0
- package/contracts/workspace-intelligence/workspace-model-diff.v1.json +105 -0
- package/contracts/workspace-intelligence/workspace-model-snapshot.v1.json +36 -0
- package/contracts/workspace-intelligence/workspace-model.v1.json +135 -0
- package/contracts/workspace-intelligence/workspace-operational-skill.v1.json +37 -0
- package/contracts/workspace-intelligence/workspace-skills-index.v1.json +27 -0
- package/contracts/workspace-intelligence/workspace-verify.v1.json +213 -0
- package/contracts/workspace-registry.v1.json +83 -0
- package/contracts/workspace-run-last.v1.json +112 -0
- package/data/modules-embeddings.json +16953 -0
- package/dist/analyze-5BU4QIPK.js +1 -0
- package/dist/artifact-remediation-plan-5GJWPPRS.js +3 -0
- package/dist/autopilot-release-QYUOVB26.js +1 -0
- package/dist/chunk-22DT744Z.js +1 -0
- package/dist/chunk-2E6WGUN6.js +1 -0
- package/dist/chunk-2FIX2MDC.js +1 -0
- package/dist/chunk-3KXW53QI.js +1 -0
- package/dist/chunk-3ZK2GU7C.js +1 -0
- package/dist/chunk-4KUIFXHM.js +5 -0
- package/dist/chunk-54XJNLYC.js +13 -0
- package/dist/chunk-5SWNSJGW.js +1 -0
- package/dist/chunk-5XATWNME.js +1 -0
- package/dist/chunk-753LOKFZ.js +2 -0
- package/dist/chunk-7YHK5NM3.js +2 -0
- package/dist/chunk-A5FBGRJA.js +1 -0
- package/dist/chunk-AAKUNWPR.js +78 -0
- package/dist/chunk-AFSZHLQT.js +1 -0
- package/dist/chunk-AQ4XZZC6.js +1 -0
- package/dist/chunk-CVTCPPEF.js +1 -0
- package/dist/chunk-DNAY5ALC.js +1 -0
- package/dist/chunk-EWYYLJQY.js +2 -0
- package/dist/chunk-GSWPGELT.js +2 -0
- package/dist/chunk-GZTYAEWX.js +1 -0
- package/dist/chunk-HTYMXMQM.js +1 -0
- package/dist/chunk-IBJEQHJR.js +205 -0
- package/dist/chunk-ICGWHIMK.js +1 -0
- package/dist/chunk-JEI6BTZI.js +3 -0
- package/dist/chunk-JHC6SCJC.js +1 -0
- package/dist/chunk-LO4C4VXR.js +4 -0
- package/dist/chunk-LPZFK3Y6.js +920 -0
- package/dist/chunk-LUP4U6EE.js +1 -0
- package/dist/chunk-LYC6AIF2.js +2 -0
- package/dist/chunk-LZQNVH7D.js +1 -0
- package/dist/chunk-NAAQMSO3.js +1 -0
- package/dist/chunk-NFUXULIF.js +1 -0
- package/dist/chunk-OCGZNSOE.js +1 -0
- package/dist/chunk-OJEWQO3Z.js +33 -0
- package/dist/chunk-OL64GWQC.js +9 -0
- package/dist/chunk-PI5KUXDA.js +7 -0
- package/dist/chunk-PYCJWW4B.js +1 -0
- package/dist/chunk-RE773WOX.js +13 -0
- package/dist/chunk-RO73VVHW.js +2 -0
- package/dist/chunk-S5KTATOU.js +1 -0
- package/dist/chunk-SI3AQKIP.js +1 -0
- package/dist/chunk-T3GJ7YVG.js +1 -0
- package/dist/chunk-T6OR6YOI.js +2 -0
- package/dist/chunk-VRDF2J46.js +653 -0
- package/dist/chunk-VZKSNUEE.js +2 -0
- package/dist/chunk-WU4ZRRA5.js +4 -0
- package/dist/chunk-XEJD4KCV.js +33 -0
- package/dist/chunk-XZGVNGRB.js +1 -0
- package/dist/chunk-Y45WZR5N.js +5 -0
- package/dist/create-WRZO4HK2.js +1 -0
- package/dist/demo-kit-AJ5LIM5G.js +149 -0
- package/dist/doctor-MF3M3FS3.js +1 -0
- package/dist/dotnet-webapi-clean-IPY3MCGQ.js +425 -0
- package/dist/gofiber-standard-N5N3QGH3.js +1397 -0
- package/dist/gogin-standard-LAWQTBWL.js +1459 -0
- package/dist/imported-projects-registry-FOIE27WT.js +1 -0
- package/dist/index.d.ts +141 -0
- package/dist/index.js +454 -0
- package/dist/managed-agent-markers-AXUM75OE.js +8 -0
- package/dist/module-layout-NZ43RSC5.js +1 -0
- package/dist/pipeline-QCUHFWDY.js +5 -0
- package/dist/platform-capabilities-XAVU4HSM.js +1 -0
- package/dist/pythonRapidkitExec-3L3XJBSY.js +1 -0
- package/dist/springboot-standard-OZYF7ZM7.js +697 -0
- package/dist/workspace-PR6VZRBG.js +1 -0
- package/dist/workspace-agent-sync-KTYF3HQR.js +1 -0
- package/dist/workspace-archive-GCZNI44O.js +3 -0
- package/dist/workspace-context-QUTOP2XV.js +1 -0
- package/dist/workspace-contract-XUGMCUSQ.js +1 -0
- package/dist/workspace-explain-JEONEGZZ.js +1 -0
- package/dist/workspace-explain-contract-DNS2YEL7.js +1 -0
- package/dist/workspace-feedback-R6H4UFZB.js +1 -0
- package/dist/workspace-foundation-KGSV4E6D.js +1 -0
- package/dist/workspace-graph-2A5THUCI.js +1 -0
- package/dist/workspace-history-CGCK2DJI.js +1 -0
- package/dist/workspace-intelligence-QJGVL37U.js +1 -0
- package/dist/workspace-marker-SMBC3Z2Q.js +1 -0
- package/dist/workspace-mcp-serve-AK4MYEHQ.js +3 -0
- package/dist/workspace-model-PNXXOGPO.js +1 -0
- package/dist/workspace-python-engine-state-MTWIIZPY.js +2 -0
- package/dist/workspace-registry-summary-RUJE6RPH.js +1 -0
- package/dist/workspace-run-Y7YMUIHX.js +1 -0
- package/dist/workspace-verify-WSDUUTR5.js +1 -0
- package/dist/workspace-watch-AGPOJ74Q.js +1 -0
- package/docs/AI_DYNAMIC_INTEGRATION.md +440 -0
- package/docs/AI_EXAMPLES.md +419 -0
- package/docs/AI_FEATURES.md +460 -0
- package/docs/AI_QUICKSTART.md +245 -0
- package/docs/DEVELOPMENT.md +90 -0
- package/docs/From Code to Shared Understanding.png +0 -0
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +170 -0
- package/docs/OPTIMIZATION_GUIDE.md +504 -0
- package/docs/PACKAGE_MANAGER_POLICY.md +25 -0
- package/docs/README.md +125 -0
- package/docs/SECURITY.md +63 -0
- package/docs/SETUP.md +107 -0
- package/docs/UTILITIES.md +221 -0
- package/docs/WORKSPACE_MARKER_SPEC.md +276 -0
- package/docs/ci-workflows.md +59 -0
- package/docs/commands-reference.md +172 -0
- package/docs/config-file-guide.md +299 -0
- package/docs/contracts/ARTIFACT_CATALOG.md +333 -0
- package/docs/contracts/CLI_LOG_EVENT_STREAM.md +123 -0
- package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +138 -0
- package/docs/contracts/NAMING_AND_COEXISTENCE.md +60 -0
- package/docs/contracts/README.md +86 -0
- package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +98 -0
- package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +75 -0
- package/docs/contracts/rapidkit-cli-contracts.json +239 -0
- package/docs/create-planner-capabilities.md +81 -0
- package/docs/doctor-command.md +467 -0
- package/docs/examples/ci-agent-grounding.yml +65 -0
- package/docs/from-code-to-shared-understanding.md +45 -0
- package/docs/governance-policy.enterprise.example.json +40 -0
- package/docs/mirror-config.enterprise.example.json +60 -0
- package/docs/policies.workspace.example.yml +23 -0
- package/docs/workspace-operations.md +160 -0
- package/docs/workspace-run.md +104 -0
- package/package.json +179 -0
- package/rapidkit.config.example.cjs +62 -0
- package/scripts/check-agent-customization-drift.mjs +78 -0
- package/scripts/check-cli-resolution.cjs +72 -0
- package/scripts/enforce-package-manager.cjs +10 -0
- package/scripts/enterprise-package-smoke.mjs +463 -0
- package/scripts/prepack-enterprise.mjs +43 -0
- package/templates/generator.js +179 -0
- package/templates/kits/fastapi-ddd/README.md.j2 +117 -0
- package/templates/kits/fastapi-ddd/common/env.example.j2 +10 -0
- package/templates/kits/fastapi-ddd/env.example.j2 +1 -0
- package/templates/kits/fastapi-ddd/pyproject.toml.j2 +64 -0
- package/templates/kits/fastapi-ddd/src/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/app/__init__.py.j2 +11 -0
- package/templates/kits/fastapi-ddd/src/app/application/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/application/interfaces.py.j2 +43 -0
- package/templates/kits/fastapi-ddd/src/app/application/use_cases/__init__.py.j2 +6 -0
- package/templates/kits/fastapi-ddd/src/app/application/use_cases/health.py.j2 +14 -0
- package/templates/kits/fastapi-ddd/src/app/application/use_cases/notes.py.j2 +24 -0
- package/templates/kits/fastapi-ddd/src/app/config/__init__.py.j2 +16 -0
- package/templates/kits/fastapi-ddd/src/app/domain/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/app/domain/models/__init__.py.j2 +6 -0
- package/templates/kits/fastapi-ddd/src/app/domain/models/health.py.j2 +16 -0
- package/templates/kits/fastapi-ddd/src/app/domain/models/note.py.j2 +27 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/repositories/__init__.py.j2 +6 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/repositories/health.py.j2 +17 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/repositories/notes.py.j2 +28 -0
- package/templates/kits/fastapi-ddd/src/app/main.py.j2 +61 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/dependencies/__init__.py.j2 +19 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/router.py.j2 +10 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/routes/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/routes/health.py.j2 +27 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/routes/notes.py.j2 +50 -0
- package/templates/kits/fastapi-ddd/src/app/shared/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/shared/result.py.j2 +28 -0
- package/templates/kits/fastapi-ddd/src/cli.py.j2 +170 -0
- package/templates/kits/fastapi-ddd/src/main.py.j2 +35 -0
- package/templates/kits/fastapi-ddd/src/modules/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/routing/__init__.py.j2 +13 -0
- package/templates/kits/fastapi-ddd/src/routing/health.py.j2 +7 -0
- package/templates/kits/fastapi-ddd/src/routing/notes.py.j2 +7 -0
- package/templates/kits/fastapi-ddd/tests/__init__.py.j2 +1 -0
- package/templates/kits/fastapi-ddd/tests/test_app_factory.py.j2 +22 -0
- package/templates/kits/fastapi-ddd/tests/test_health.py.j2 +17 -0
- package/templates/kits/fastapi-ddd/tests/test_notes.py.j2 +27 -0
- package/templates/kits/fastapi-standard/README.md.j2 +140 -0
- package/templates/kits/fastapi-standard/common/env.example.j2 +10 -0
- package/templates/kits/fastapi-standard/env.example.j2 +1 -0
- package/templates/kits/fastapi-standard/pyproject.toml.j2 +64 -0
- package/templates/kits/fastapi-standard/src/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-standard/src/cli.py.j2 +171 -0
- package/templates/kits/fastapi-standard/src/main.py.j2 +66 -0
- package/templates/kits/fastapi-standard/src/modules/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-standard/src/routing/__init__.py.j2 +16 -0
- package/templates/kits/fastapi-standard/src/routing/examples.py.j2 +71 -0
- package/templates/kits/fastapi-standard/src/routing/health.py.j2 +22 -0
- package/templates/kits/fastapi-standard/tests/__init__.py.j2 +1 -0
- package/templates/kits/fastapi-standard/tests/test_examples.py.j2 +29 -0
- package/templates/kits/fastapi-standard/tests/test_health.py.j2 +17 -0
- package/templates/kits/nestjs-standard/Dockerfile.j2 +41 -0
- package/templates/kits/nestjs-standard/README.md.j2 +134 -0
- package/templates/kits/nestjs-standard/docker-compose.yml.j2 +94 -0
- package/templates/kits/nestjs-standard/docs/README.md.j2 +15 -0
- package/templates/kits/nestjs-standard/env.example.j2 +18 -0
- package/templates/kits/nestjs-standard/eslint.config.cjs.j2 +9 -0
- package/templates/kits/nestjs-standard/jest.config.ts.j2 +28 -0
- package/templates/kits/nestjs-standard/nest-cli.json.j2 +10 -0
- package/templates/kits/nestjs-standard/package.json.j2 +101 -0
- package/templates/kits/nestjs-standard/src/app.controller.ts.j2 +14 -0
- package/templates/kits/nestjs-standard/src/app.module.ts.j2 +26 -0
- package/templates/kits/nestjs-standard/src/app.service.ts.j2 +16 -0
- package/templates/kits/nestjs-standard/src/auth/auth.controller.ts.j2 +20 -0
- package/templates/kits/nestjs-standard/src/auth/auth.module.ts.j2 +13 -0
- package/templates/kits/nestjs-standard/src/auth/auth.service.ts.j2 +6 -0
- package/templates/kits/nestjs-standard/src/auth/entities/token.entity.ts.j2 +3 -0
- package/templates/kits/nestjs-standard/src/auth/entities/user.entity.ts.j2 +3 -0
- package/templates/kits/nestjs-standard/src/auth/entities/webauthn.entity.ts.j2 +3 -0
- package/templates/kits/nestjs-standard/src/config/configuration.ts.j2 +85 -0
- package/templates/kits/nestjs-standard/src/config/index.ts.j2 +2 -0
- package/templates/kits/nestjs-standard/src/config/validation.ts.j2 +21 -0
- package/templates/kits/nestjs-standard/src/examples/dto/create-note.dto.ts.j2 +11 -0
- package/templates/kits/nestjs-standard/src/examples/examples.controller.ts.j2 +24 -0
- package/templates/kits/nestjs-standard/src/examples/examples.module.ts.j2 +10 -0
- package/templates/kits/nestjs-standard/src/examples/examples.service.ts.j2 +33 -0
- package/templates/kits/nestjs-standard/src/main.ts.j2 +53 -0
- package/templates/kits/nestjs-standard/src/modules/index.ts.j2 +25 -0
- package/templates/kits/nestjs-standard/test/app.controller.spec.ts.j2 +24 -0
- package/templates/kits/nestjs-standard/test/app.e2e-spec.ts.j2 +60 -0
- package/templates/kits/nestjs-standard/test/examples.controller.spec.ts.j2 +28 -0
- package/templates/kits/nestjs-standard/test/jest-e2e.json.j2 +15 -0
- package/templates/kits/nestjs-standard/tsconfig.build.json.j2 +12 -0
- package/templates/kits/nestjs-standard/tsconfig.json.j2 +26 -0
- package/workspai.config.example.cjs +62 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
version: "1.0"
|
|
2
|
+
mode: warn # "warn" or "strict"
|
|
3
|
+
dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
|
|
4
|
+
# change profile (recommended): npx workspai bootstrap --profile polyglot
|
|
5
|
+
# change mode/dependency manually: edit this file and rerun npx workspai init
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
enforce_workspace_marker: true
|
|
9
|
+
enforce_toolchain_lock: false
|
|
10
|
+
disallow_untrusted_tool_sources: false
|
|
11
|
+
enforce_compatibility_matrix: false
|
|
12
|
+
require_mirror_lock_for_offline: true
|
|
13
|
+
|
|
14
|
+
# preferred policy management commands:
|
|
15
|
+
# npx workspai workspace policy show
|
|
16
|
+
# npx workspai workspace policy set mode strict
|
|
17
|
+
# npx workspai workspace policy set dependency_sharing_mode shared-runtime-caches
|
|
18
|
+
# npx workspai workspace policy set rules.enforce_toolchain_lock true
|
|
19
|
+
|
|
20
|
+
# dependency_sharing_mode options:
|
|
21
|
+
# - isolated (default, safest)
|
|
22
|
+
# - shared-runtime-caches (share Node/Python/Go caches at workspace level)
|
|
23
|
+
# - shared-node-deps (compat alias for Node shared mode)
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Workspace Operations
|
|
2
|
+
|
|
3
|
+
Behavioral guide for import, adoption, snapshots, archives, contracts, collaboration bundles, and local infra sidecars.
|
|
4
|
+
|
|
5
|
+
Command syntax: [commands-reference.md](./commands-reference.md).
|
|
6
|
+
|
|
7
|
+
## Import and adoption
|
|
8
|
+
|
|
9
|
+
Use `import` to copy or clone an existing project into a Workspai workspace.
|
|
10
|
+
Use `adopt` when the project must stay where it already lives but should become visible to RapidKit and Workspai workspace intelligence.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx workspai import ../orders-api
|
|
14
|
+
npx workspai import https://github.com/acme/orders-api.git --git
|
|
15
|
+
npx workspai import ../orders-api --workspace ./my-workspace --name orders-api --json
|
|
16
|
+
npx workspai adopt ../marketing-web --workspace ./my-workspace
|
|
17
|
+
npx workspai adopt --json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Import behavior
|
|
21
|
+
|
|
22
|
+
- Local folders are copied; git sources are cloned with shallow history.
|
|
23
|
+
- Outside any workspace (no `--workspace`), Workspai auto-creates/reuses the managed workspace at `~/.workspai/workspaces/workspai`.
|
|
24
|
+
- Existing workspaces under `~/rapidkit/workspaces/*` and `~/Workspai/rapidkits/*` remain registered after upgrade.
|
|
25
|
+
- CLI prints a next-step `cd ...` hint (`suggestedCdCommand` in JSON mode).
|
|
26
|
+
- Failed workspace sync rolls back imported files and registry entries.
|
|
27
|
+
|
|
28
|
+
### Adopt behavior
|
|
29
|
+
|
|
30
|
+
- Source files are not moved or copied.
|
|
31
|
+
- Default workspace resolution matches import (`workspai` under `~/.workspai/workspaces/`).
|
|
32
|
+
- Writes `.workspai/project.json`, `.workspai/adopt.json`, and `.workspai/adopt-readiness.json`.
|
|
33
|
+
- Registry and contract sync include adopted projects for `workspace model`, `workspace context`, Dashboard, and agents.
|
|
34
|
+
- `--dry-run --json` previews detection without writing metadata.
|
|
35
|
+
|
|
36
|
+
### JSON output (`--json`)
|
|
37
|
+
|
|
38
|
+
- `workspacePath`, `workspaceResolution` (`explicit` | `nearest` | `default-auto`)
|
|
39
|
+
- `defaultWorkspaceCreated`, `suggestedCdCommand`
|
|
40
|
+
- `importedProject` or `adoptedProject` (`name`, `path`, `stack`, `runtime`, `framework`, `supportTier`, `moduleSupport`, `confidence`, `source`)
|
|
41
|
+
|
|
42
|
+
Imported projects receive `.workspai/import-readiness.json`. Adopted projects add frontend-aware detection for Next.js, React, Vite, Vue, Angular, SvelteKit, Nuxt, Astro, Remix, and Solid.
|
|
43
|
+
|
|
44
|
+
## Workspace snapshots and safe project operations
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx workspai snapshot create before-upgrade --reason "before dependency upgrade"
|
|
48
|
+
npx workspai snapshot list
|
|
49
|
+
npx workspai snapshot inspect before-upgrade
|
|
50
|
+
npx workspai snapshot restore before-upgrade --dry-run
|
|
51
|
+
npx workspai snapshot restore before-upgrade --force
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Project delete is safe-by-default:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx workspai project archive orders-api --reason "replaced by orders-v2"
|
|
58
|
+
npx workspai project archives
|
|
59
|
+
npx workspai project restore orders-api
|
|
60
|
+
npx workspai project delete orders-api
|
|
61
|
+
npx workspai project delete orders-api --permanent --confirm orders-api
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Lifecycle safety:
|
|
65
|
+
|
|
66
|
+
- `project delete` archives by default; permanent removal requires `--permanent --confirm <exact-name>`.
|
|
67
|
+
- `snapshot restore` requires `--force` unless dry-run.
|
|
68
|
+
- Restore, archive, and permanent delete create pre-operation metadata snapshots.
|
|
69
|
+
- Archive manifests live under `.workspai/archive/projects`.
|
|
70
|
+
- Audit records append to `.workspai/audit/events.jsonl`.
|
|
71
|
+
- Workspace policy can require reasons, safety snapshots, or block permanent delete via `.workspai/policies.yml`.
|
|
72
|
+
|
|
73
|
+
## Workspace collaboration bundle
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npx workspai workspace share
|
|
77
|
+
npx workspai workspace share --output ./team-share.json
|
|
78
|
+
npx workspai workspace share --include-paths
|
|
79
|
+
npx workspai workspace share --no-doctor
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Bundle includes workspace metadata, discovered projects, report index, and latest doctor evidence (unless `--no-doctor`). `--include-paths` is for internal teams only (absolute paths).
|
|
83
|
+
|
|
84
|
+
## Workspace contract registry
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npx workspai workspace contract init
|
|
88
|
+
npx workspai workspace contract inspect
|
|
89
|
+
npx workspai workspace contract verify --strict
|
|
90
|
+
npx workspai workspace contract graph
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Contract file: `.workspai/workspace.contract.json`. Verification checks schema, duplicate slugs, port collisions, and unknown dependencies.
|
|
94
|
+
|
|
95
|
+
Workspai keeps the contract alive during `create project` and `workspace sync` without overwriting manual API/event/owner declarations.
|
|
96
|
+
|
|
97
|
+
## Portable workspace archives
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npx workspai workspace export --output team-workspace.workspai-archive.zip
|
|
101
|
+
npx workspai workspace archive inspect team-workspace.workspai-archive.zip
|
|
102
|
+
npx workspai workspace archive verify team-workspace.workspai-archive.zip --strict
|
|
103
|
+
npx workspai workspace archive doctor team-workspace.workspai-archive.zip
|
|
104
|
+
npx workspai workspace hydrate team-workspace.workspai-archive.zip --output ./team-workspace
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Export excludes dependency folders, build output, git history, logs, `.env`, and private keys by default. Use `--include-env` only for trusted internal handoffs. Hydrate accepts legacy `.rapidkit-workspace` and `.rapidkit/*` archive entries, but restores them as canonical `.workspai-workspace` and `.workspai/*` paths.
|
|
108
|
+
|
|
109
|
+
## Workspace infrastructure (sidecar)
|
|
110
|
+
|
|
111
|
+
Discovery sources: Core module slugs, project `.env.example`, workspace contract env, and `.workspai/infra/overrides.json`.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
cd my-workspace
|
|
115
|
+
npx workspai infra plan
|
|
116
|
+
npx workspai infra up
|
|
117
|
+
npx workspai infra status --strict
|
|
118
|
+
npx workspai infra down
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Artifacts:
|
|
122
|
+
|
|
123
|
+
- `.workspai/infra/docker-compose.yml`
|
|
124
|
+
- `.workspai/reports/infra-plan.json`
|
|
125
|
+
- `.workspai/infra/.env.example`
|
|
126
|
+
|
|
127
|
+
## Command ownership
|
|
128
|
+
|
|
129
|
+
| Command family | Owner | Notes |
|
|
130
|
+
| ----------------------------------------------------------- | ---------------------- | -------------------------------------------------- |
|
|
131
|
+
| `create workspace`, `workspace`, `cache`, `mirror`, `infra` | Workspai CLI | Platform orchestration |
|
|
132
|
+
| `init` | Wrapper orchestrated | Project init; full-init alias at workspace root |
|
|
133
|
+
| `dev`, `test`, `build`, `start` | Runtime aware | Delegates to active project/runtime |
|
|
134
|
+
| `readiness` | Wrapper release gate | Env + doctor + analyze + verify + dependency gates |
|
|
135
|
+
| `pipeline` | Wrapper orchestrator | sync → doctor → analyze → readiness → autopilot |
|
|
136
|
+
| `autopilot release` | Wrapper orchestrator | End-to-end release gate evidence |
|
|
137
|
+
| `import` | Workspace ingestion | Rollback-safe sync |
|
|
138
|
+
| `adopt` | Workspace adoption | In-place linking + registry sync |
|
|
139
|
+
| `workspace model/context/diff/impact/verify` | Workspace intelligence | Model, context packs, blast radius |
|
|
140
|
+
| `snapshot` | Workspace recovery | Metadata or full snapshots |
|
|
141
|
+
| `project archive/restore/delete` | Project lifecycle | Safe delete with confirmation |
|
|
142
|
+
| `doctor` / `doctor workspace` / `doctor project` | Wrapper health | Host, workspace, and project scopes |
|
|
143
|
+
| `workspace run` | Workspace orchestrator | Fleet stage execution |
|
|
144
|
+
| `infra` | Workspace sidecar | Contract-driven local dependencies |
|
|
145
|
+
|
|
146
|
+
## Verification evidence freshness
|
|
147
|
+
|
|
148
|
+
`workspace verify` treats evidence as release-gate material, not just as a file
|
|
149
|
+
presence check. Required project evidence must match the affected project in
|
|
150
|
+
`workspace-run-last.json`, and evidence generated before the current impact
|
|
151
|
+
report is treated as stale and blocking. Re-run the recommended commands from
|
|
152
|
+
`workspace impact --json` before using `workspace verify --strict` in CI.
|
|
153
|
+
|
|
154
|
+
For doctor CI exit codes and JSON evidence fields, see [doctor-command.md](./doctor-command.md).
|
|
155
|
+
|
|
156
|
+
## See also
|
|
157
|
+
|
|
158
|
+
- [Documentation index](./README.md)
|
|
159
|
+
- [commands-reference.md](./commands-reference.md)
|
|
160
|
+
- [doctor-command.md](./doctor-command.md)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Workspace Run — Polyglot Fleet Orchestration
|
|
2
|
+
|
|
3
|
+
`workspace run` executes CI-safe stages (`init`, `test`, `build`, `start`) across discovered projects in a workspace. Command syntax is in [commands-reference.md](./commands-reference.md).
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx workspai workspace run test --parallel
|
|
9
|
+
npx workspai workspace run test --affected --since HEAD~1
|
|
10
|
+
npx workspai workspace run test --affected --blast-radius
|
|
11
|
+
npx workspai workspace run build --json --max-workers 8
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`--blast-radius` uses `.workspai/workspace.contract.json` (and legacy `.rapidkit/workspace-dependency-graph.json` as fallback) to expand direct `dependsOn` and publish/consume event relationships.
|
|
15
|
+
|
|
16
|
+
## Supported runtimes
|
|
17
|
+
|
|
18
|
+
| Runtime | Frameworks | Status |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| Node | NestJS, Express, Next.js, Nuxt | Built-in |
|
|
21
|
+
| Go | Fiber, Gin, Echo, Chi | Built-in |
|
|
22
|
+
| Java | Spring Boot, Quarkus, Gradle | Built-in |
|
|
23
|
+
| Python | FastAPI, Django, Flask, Poetry | Built-in |
|
|
24
|
+
| PHP | Laravel, Symfony, Slim | Observed |
|
|
25
|
+
| Rust | Actix, Axum, Rocket, Tokio | Observed |
|
|
26
|
+
| .NET | ASP.NET Core, Entity Framework | Built-in |
|
|
27
|
+
| Elixir | Phoenix, Umbrella | Observed |
|
|
28
|
+
| Ruby | Rails, Sinatra, RSpec | Observed |
|
|
29
|
+
|
|
30
|
+
Public scaffold/import/lifecycle contract: [contracts/RUNTIME_SUPPORT_MATRIX.md](./contracts/RUNTIME_SUPPORT_MATRIX.md).
|
|
31
|
+
|
|
32
|
+
## Enterprise configuration
|
|
33
|
+
|
|
34
|
+
Override stage commands per project via `.workspai/context.json`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"runtime": "php",
|
|
39
|
+
"framework": "Laravel",
|
|
40
|
+
"commands": {
|
|
41
|
+
"test": "php artisan test --parallel=4",
|
|
42
|
+
"build": "php artisan config:cache && php artisan route:cache",
|
|
43
|
+
"lint": "php bin/phpstan analyse --level=8"
|
|
44
|
+
},
|
|
45
|
+
"environment": "dev"
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Enterprise features include command overrides, multi-framework projects, error categorization (setup vs test vs runtime), preflight validation, health checks, custom stages (via `.workspai/context.json` `commands`), stage dependencies (from framework registry), environment variants, result caching (`--reuse-passed`), and composite steps.
|
|
50
|
+
|
|
51
|
+
### Custom stages
|
|
52
|
+
|
|
53
|
+
Declare extra fleet stages in `.workspai/context.json`:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"commands": {
|
|
58
|
+
"lint": "php bin/phpstan analyse --level=8"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Run them with `npx workspai workspace run lint --scope project:<name>`.
|
|
64
|
+
|
|
65
|
+
### Stage dependencies and caching
|
|
66
|
+
|
|
67
|
+
Framework registry entries may declare `dependencies` (for example `start` depends on `build`). When `.workspai/reports/workspace-run-last.json` exists, projects skip until dependency stages show `passed`.
|
|
68
|
+
|
|
69
|
+
Use `--reuse-passed` to skip projects that already passed the requested stage in the cached report:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx workspai workspace run test --reuse-passed --json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## JSON reporting
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx workspai workspace run test --json > test-results.json
|
|
79
|
+
cat test-results.json | jq '.projects[] | {path, status, errorCategory}'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`errorCategory` values: `setup`, `test-failure`, `runtime`, `dependency`, `timeout`.
|
|
83
|
+
|
|
84
|
+
## Command semantics
|
|
85
|
+
|
|
86
|
+
Workspai has two workspace-level execution surfaces and three equivalent full-init aliases at workspace root:
|
|
87
|
+
|
|
88
|
+
| Command | Intent | Scope |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| `init`, `workspace init`, `workspace run init` (at workspace root) | Mirrored full-init (workspace deps + project init) | Workspace + fleet |
|
|
91
|
+
| `workspace run <test\|build\|start>` | Fleet stage execution | Selected projects |
|
|
92
|
+
| `init`, `test`, `build`, `start`, `dev` (inside project dir) | Project primitive | Single project |
|
|
93
|
+
|
|
94
|
+
At workspace root, `npx workspai init`, `npx workspai workspace init`, and `npx workspai workspace run init` are equivalent aliases.
|
|
95
|
+
|
|
96
|
+
Inside a project directory, `npx workspai init` remains project-scoped.
|
|
97
|
+
|
|
98
|
+
`dev` is excluded from `workspace run` — it is a long-running local process, not a CI batch stage.
|
|
99
|
+
|
|
100
|
+
## See also
|
|
101
|
+
|
|
102
|
+
- [Documentation index](./README.md)
|
|
103
|
+
- [commands-reference.md](./commands-reference.md)
|
|
104
|
+
- [contracts/RUNTIME_SUPPORT_MATRIX.md](./contracts/RUNTIME_SUPPORT_MATRIX.md)
|
package/package.json
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workspai",
|
|
3
|
+
"version": "0.43.0",
|
|
4
|
+
"type": "module",
|
|
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
|
+
"keywords": [
|
|
7
|
+
"rapidkit",
|
|
8
|
+
"workspai",
|
|
9
|
+
"ai",
|
|
10
|
+
"cli",
|
|
11
|
+
"create",
|
|
12
|
+
"workspace",
|
|
13
|
+
"workspace-intelligence",
|
|
14
|
+
"governance",
|
|
15
|
+
"backend",
|
|
16
|
+
"frontend",
|
|
17
|
+
"fastapi",
|
|
18
|
+
"nestjs",
|
|
19
|
+
"nextjs",
|
|
20
|
+
"react",
|
|
21
|
+
"springboot",
|
|
22
|
+
"spring",
|
|
23
|
+
"gofiber",
|
|
24
|
+
"gogin",
|
|
25
|
+
"microservices",
|
|
26
|
+
"api",
|
|
27
|
+
"generator",
|
|
28
|
+
"scaffold"
|
|
29
|
+
],
|
|
30
|
+
"author": "RapidKit Labs",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/rapidkitlabs/workspai.git",
|
|
35
|
+
"directory": "packages/cli"
|
|
36
|
+
},
|
|
37
|
+
"bin": {
|
|
38
|
+
"workspai": "dist/index.js"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"contracts",
|
|
43
|
+
"docs",
|
|
44
|
+
"templates",
|
|
45
|
+
"workspai.config.example.cjs",
|
|
46
|
+
"rapidkit.config.example.cjs",
|
|
47
|
+
"data/modules-embeddings.json",
|
|
48
|
+
"scripts/enforce-package-manager.cjs",
|
|
49
|
+
"scripts/check-cli-resolution.cjs",
|
|
50
|
+
"scripts/check-agent-customization-drift.mjs",
|
|
51
|
+
"scripts/enterprise-package-smoke.mjs",
|
|
52
|
+
"scripts/prepack-enterprise.mjs"
|
|
53
|
+
],
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"registry": "https://registry.npmjs.org",
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"preinstall": "node scripts/enforce-package-manager.cjs",
|
|
60
|
+
"postinstall": "node scripts/check-cli-resolution.cjs",
|
|
61
|
+
"sync-kits": "bash scripts/sync-kits.sh",
|
|
62
|
+
"build": "tsup",
|
|
63
|
+
"build:watch": "tsup --watch",
|
|
64
|
+
"dev": "tsup --watch",
|
|
65
|
+
"dev:local": "corepack npm run build && corepack npm link",
|
|
66
|
+
"install:local": "corepack npm unlink -g workspai || true && corepack npm run build && corepack npm link",
|
|
67
|
+
"uninstall:local": "corepack npm unlink -g workspai || true",
|
|
68
|
+
"prepare": "node scripts/prepare-husky.mjs",
|
|
69
|
+
"test:e2e:first-install": "bash scripts/e2e-first-install.sh",
|
|
70
|
+
"test:e2e:user-first-install": "bash scripts/e2e-user-first-install.sh",
|
|
71
|
+
"test": "vitest run",
|
|
72
|
+
"test:drift": "node scripts/run-drift-guard.mjs",
|
|
73
|
+
"benchmark:intelligence": "vitest run src/__tests__/workspace-intelligence-benchmark.test.ts",
|
|
74
|
+
"sync:shared-contracts": "node scripts/sync-shared-contracts.mjs",
|
|
75
|
+
"check:shared-contracts": "node scripts/sync-shared-contracts.mjs --check",
|
|
76
|
+
"sync:parity-snapshot": "node scripts/sync-shared-contracts.mjs",
|
|
77
|
+
"check:parity-snapshot": "node scripts/sync-shared-contracts.mjs --check",
|
|
78
|
+
"generate:contracts": "node scripts/generate-shared-contracts.mjs",
|
|
79
|
+
"check:generated-contracts": "node scripts/generate-shared-contracts.mjs --check",
|
|
80
|
+
"check:agent-customization-drift": "node scripts/check-agent-customization-drift.mjs",
|
|
81
|
+
"validate:contracts": "corepack npm run check:shared-contracts && vitest run src/__tests__/contracts/",
|
|
82
|
+
"test:parity-contract": "corepack npm run check:shared-contracts && vitest run src/__tests__/contracts/import-stack-parity.snapshot.test.ts",
|
|
83
|
+
"test:watch": "vitest",
|
|
84
|
+
"test:coverage": "vitest run --coverage",
|
|
85
|
+
"test:prepare-embeddings": "node scripts/prepare-mock-embeddings.mjs",
|
|
86
|
+
"generate-embeddings": "npx tsx src/ai/generate-embeddings.ts",
|
|
87
|
+
"verify:package-cli": "node scripts/verify-package-cli.mjs",
|
|
88
|
+
"smoke:enterprise-package": "node scripts/enterprise-package-smoke.mjs",
|
|
89
|
+
"prepack": "node scripts/prepack-enterprise.mjs",
|
|
90
|
+
"test:e2e": "vitest run src/__tests__/e2e.test.ts",
|
|
91
|
+
"test:scenarios": "node scripts/run-scenario-matrix-local.mjs",
|
|
92
|
+
"test:scenarios:full": "node scripts/run-scenario-matrix-local.mjs --full",
|
|
93
|
+
"test:scenarios:docker": "bash scripts/scenario-matrix.sh",
|
|
94
|
+
"test:runtime-matrix": "node scripts/runtime-acceptance-matrix.mjs",
|
|
95
|
+
"test:runtime-matrix:full": "node scripts/runtime-acceptance-matrix.mjs --full",
|
|
96
|
+
"lint": "eslint src --ext .ts",
|
|
97
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
98
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
99
|
+
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
100
|
+
"typecheck": "tsc --noEmit",
|
|
101
|
+
"validate": "corepack npm run typecheck && corepack npm run lint && corepack npm run format:check && corepack npm test",
|
|
102
|
+
"security": "npm audit --audit-level=moderate",
|
|
103
|
+
"security:fix": "npm audit fix",
|
|
104
|
+
"metrics": "npx tsx scripts/metrics.ts",
|
|
105
|
+
"validate:docs-examples": "node scripts/validate-doc-examples.mjs",
|
|
106
|
+
"check:markdown-links": "node scripts/check-markdown-links.mjs",
|
|
107
|
+
"check:docs-drift": "node scripts/docs-drift-guard.mjs",
|
|
108
|
+
"smoke:readme": "node scripts/smoke-readme-commands.mjs",
|
|
109
|
+
"validate:docs": "corepack npm run check:markdown-links && corepack npm run check:docs-drift && corepack npm run validate:docs-examples && corepack npm run smoke:readme",
|
|
110
|
+
"smoke:frontend-generators": "tsup && node scripts/smoke-frontend-generators.mjs",
|
|
111
|
+
"smoke:frontend-generators:network": "tsup && node scripts/smoke-frontend-generators.mjs --execute",
|
|
112
|
+
"sync:contracts": "node scripts/sync-contracts.mjs",
|
|
113
|
+
"check:contracts": "node scripts/sync-contracts.mjs --check",
|
|
114
|
+
"bundle-size": "corepack npm run build && node scripts/report-dist-size.mjs",
|
|
115
|
+
"analyze": "corepack npm run build && node scripts/analyze-dist.mjs",
|
|
116
|
+
"size-check": "corepack npm run build && size-limit",
|
|
117
|
+
"bench": "npx tsx scripts/benchmarks.ts",
|
|
118
|
+
"quality": "corepack npm run typecheck && corepack npm run lint && corepack npm run format:check && corepack npm test && corepack npm run size-check && corepack npm run security && corepack npm run validate:docs && corepack npm run smoke:frontend-generators && corepack npm run check:contracts && corepack npm run check:shared-contracts && corepack npm run check:parity-snapshot && corepack npm run check:agent-customization-drift",
|
|
119
|
+
"act-matrix": "act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-22.04 -P macos-latest=ghcr.io/catthehacker/ubuntu:act-22.04 -P windows-latest=ghcr.io/catthehacker/ubuntu:act-22.04 --pull=false -j build-test-matrix",
|
|
120
|
+
"release:dry": "bash scripts/release.sh --no-publish --yes --allow-dirty",
|
|
121
|
+
"release:patch": "bash scripts/release.sh patch",
|
|
122
|
+
"release:minor": "bash scripts/release.sh minor",
|
|
123
|
+
"release:major": "bash scripts/release.sh major"
|
|
124
|
+
},
|
|
125
|
+
"dependencies": {
|
|
126
|
+
"@clack/prompts": "^0.9.1",
|
|
127
|
+
"chalk": "^5.3.0",
|
|
128
|
+
"cli-progress": "^3.12.0",
|
|
129
|
+
"commander": "^12.1.0",
|
|
130
|
+
"execa": "^9.3.1",
|
|
131
|
+
"fs-extra": "^11.2.0",
|
|
132
|
+
"inquirer": "^13.2.2",
|
|
133
|
+
"nunjucks": "^3.2.4",
|
|
134
|
+
"openai": "^6.22.0",
|
|
135
|
+
"ora": "^8.0.1",
|
|
136
|
+
"validate-npm-package-name": "^5.0.1"
|
|
137
|
+
},
|
|
138
|
+
"devDependencies": {
|
|
139
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
140
|
+
"@size-limit/preset-big-lib": "^12.0.0",
|
|
141
|
+
"@types/cli-progress": "^3.11.6",
|
|
142
|
+
"@types/fs-extra": "^11.0.4",
|
|
143
|
+
"@types/inquirer": "^9.0.7",
|
|
144
|
+
"@types/node": "^20.14.0",
|
|
145
|
+
"@types/nunjucks": "^3.2.6",
|
|
146
|
+
"@types/validate-npm-package-name": "^4.0.2",
|
|
147
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
148
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
149
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
150
|
+
"@vitest/ui": "^4.0.15",
|
|
151
|
+
"eslint": "^9.39.2",
|
|
152
|
+
"husky": "^9.1.7",
|
|
153
|
+
"lint-staged": "^15.5.2",
|
|
154
|
+
"prettier": "^3.6.2",
|
|
155
|
+
"size-limit": "^12.0.0",
|
|
156
|
+
"tsup": "^8.5.1",
|
|
157
|
+
"tsx": "^4.20.6",
|
|
158
|
+
"typescript": "^5.5.0",
|
|
159
|
+
"vite-bundle-visualizer": "^1.2.1",
|
|
160
|
+
"vitest": "^4.0.15"
|
|
161
|
+
},
|
|
162
|
+
"optionalDependencies": {
|
|
163
|
+
"@rollup/rollup-win32-x64-msvc": "*"
|
|
164
|
+
},
|
|
165
|
+
"engines": {
|
|
166
|
+
"node": ">=20.19.0"
|
|
167
|
+
},
|
|
168
|
+
"lint-staged": {
|
|
169
|
+
"*.ts": [
|
|
170
|
+
"eslint --fix",
|
|
171
|
+
"prettier --write"
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"overrides": {
|
|
175
|
+
"minimatch": "^10.2.1",
|
|
176
|
+
"esbuild": "^0.28.1"
|
|
177
|
+
},
|
|
178
|
+
"packageManager": "npm@10.8.2"
|
|
179
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy RapidKit Configuration File
|
|
3
|
+
*
|
|
4
|
+
* New Workspai projects should prefer workspai.config.cjs or workspai.config.mjs.
|
|
5
|
+
* This legacy filename remains supported as a fallback during migration.
|
|
6
|
+
*
|
|
7
|
+
* Place this file in your project root as:
|
|
8
|
+
* - rapidkit.config.cjs (CommonJS explicit, safest across package types)
|
|
9
|
+
* - rapidkit.config.mjs (ES Module, use export default)
|
|
10
|
+
* - rapidkit.config.js (only when it matches your package.json module type)
|
|
11
|
+
*
|
|
12
|
+
* This file is automatically detected when creating workspaces or projects.
|
|
13
|
+
* CLI arguments override config file settings.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
module.exports = {
|
|
17
|
+
// Workspace configuration
|
|
18
|
+
workspace: {
|
|
19
|
+
// Default author name for new workspaces
|
|
20
|
+
defaultAuthor: 'Your Name or Team',
|
|
21
|
+
|
|
22
|
+
// Default Python version to use
|
|
23
|
+
// Options: '3.10' | '3.11' | '3.12'
|
|
24
|
+
pythonVersion: '3.10',
|
|
25
|
+
|
|
26
|
+
// Default installation method for RapidKit Core
|
|
27
|
+
// Options: 'poetry' | 'venv' | 'pipx'
|
|
28
|
+
installMethod: 'poetry',
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
// Project configuration
|
|
32
|
+
projects: {
|
|
33
|
+
// Default kit/template to use when creating projects
|
|
34
|
+
// Examples: 'fastapi.standard', 'fastapi.ddd', 'nestjs.standard'
|
|
35
|
+
defaultKit: 'fastapi.standard',
|
|
36
|
+
|
|
37
|
+
// Default modules to add to new projects
|
|
38
|
+
// These modules will be automatically added after project creation
|
|
39
|
+
addDefaultModules: [
|
|
40
|
+
// 'prisma', // Database ORM
|
|
41
|
+
// 'redis', // Caching
|
|
42
|
+
// 'auth-jwt', // JWT Authentication
|
|
43
|
+
// 'monitoring', // Monitoring and logging
|
|
44
|
+
],
|
|
45
|
+
|
|
46
|
+
// Skip git initialization by default
|
|
47
|
+
skipGit: false,
|
|
48
|
+
|
|
49
|
+
// Skip dependency installation by default
|
|
50
|
+
skipInstall: false,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Example usage:
|
|
55
|
+
// npx workspai my-workspace
|
|
56
|
+
// -> Uses config: author='Your Name or Team', pythonVersion='3.10', installMethod='poetry'
|
|
57
|
+
//
|
|
58
|
+
// npx workspai my-workspace --author "Different Author"
|
|
59
|
+
// -> Overrides: author='Different Author', but still uses pythonVersion='3.10', installMethod='poetry'
|
|
60
|
+
//
|
|
61
|
+
// npx workspai create project my-api
|
|
62
|
+
// -> Uses config: defaultKit='fastapi.standard', adds default modules
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
const GENERATED_AGENT_PATHS = [
|
|
6
|
+
'.workspai/reports/INDEX.json',
|
|
7
|
+
'.workspai/reports/agent-customization-pack.json',
|
|
8
|
+
'.workspai/reports/workspai-mcp-design.json',
|
|
9
|
+
'.workspai/reports/workspace-context-agent.json',
|
|
10
|
+
'.workspai/reports/workspace-skills-index.json',
|
|
11
|
+
'.workspai/skills',
|
|
12
|
+
'.workspai/AGENT-GROUNDING.md',
|
|
13
|
+
'AGENTS.md',
|
|
14
|
+
'CLAUDE.md',
|
|
15
|
+
'.github/copilot-instructions.md',
|
|
16
|
+
'.github/instructions',
|
|
17
|
+
'.github/prompts',
|
|
18
|
+
'.github/skills/workspai-grounding',
|
|
19
|
+
'.github/skills/workspai-workspace-intelligence',
|
|
20
|
+
'.github/agents',
|
|
21
|
+
'.cursor/rules/workspai-grounding.mdc',
|
|
22
|
+
'.claude/rules/workspai-evidence.md',
|
|
23
|
+
'.claude/rules/rapidkit-evidence.md',
|
|
24
|
+
'.vscode/workspai-agent-hooks.json',
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
function parseWorkspaceArg(argv) {
|
|
28
|
+
const workspaceIndex = argv.indexOf('--workspace');
|
|
29
|
+
if (workspaceIndex >= 0 && argv[workspaceIndex + 1]) {
|
|
30
|
+
return argv[workspaceIndex + 1];
|
|
31
|
+
}
|
|
32
|
+
const inline = argv.find((arg) => arg.startsWith('--workspace='));
|
|
33
|
+
if (inline) {
|
|
34
|
+
return inline.slice('--workspace='.length);
|
|
35
|
+
}
|
|
36
|
+
return process.cwd();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function runGit(workspacePath, args) {
|
|
40
|
+
return spawnSync('git', ['-C', workspacePath, ...args], {
|
|
41
|
+
encoding: 'utf8',
|
|
42
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const workspacePath = path.resolve(parseWorkspaceArg(process.argv.slice(2)));
|
|
47
|
+
const gitCheck = runGit(workspacePath, ['rev-parse', '--is-inside-work-tree']);
|
|
48
|
+
|
|
49
|
+
if (gitCheck.status !== 0 || gitCheck.stdout.trim() !== 'true') {
|
|
50
|
+
console.warn(
|
|
51
|
+
`[workspai] Agent customization drift check skipped: ${workspacePath} is not a git work tree.`
|
|
52
|
+
);
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const status = runGit(workspacePath, ['status', '--porcelain', '--', ...GENERATED_AGENT_PATHS]);
|
|
57
|
+
|
|
58
|
+
if (status.status !== 0) {
|
|
59
|
+
console.error('[workspai] Failed to inspect generated agent customization drift.');
|
|
60
|
+
if (status.stderr.trim()) {
|
|
61
|
+
console.error(status.stderr.trim());
|
|
62
|
+
}
|
|
63
|
+
process.exit(status.status ?? 1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const drift = status.stdout.trim();
|
|
67
|
+
|
|
68
|
+
if (drift.length > 0) {
|
|
69
|
+
console.error('[workspai] Agent customization drift detected.');
|
|
70
|
+
console.error(
|
|
71
|
+
'Run `npx workspai workspace agent-sync --write --refresh-context --preset enterprise`, review the generated files, and commit the changes.'
|
|
72
|
+
);
|
|
73
|
+
console.error('');
|
|
74
|
+
console.error(drift);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
console.log('[workspai] Agent customization files are in sync.');
|