devworkspace 0.3.3 → 0.4.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.
- package/CHANGELOG.md +53 -0
- package/README.md +220 -90
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.js +16 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/help.js +28 -1
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/render.d.ts +2 -0
- package/dist/cli/render.js +10 -0
- package/dist/cli/render.js.map +1 -1
- package/dist/cli/run.js +62 -2
- package/dist/cli/run.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/protocol.d.ts +35 -0
- package/dist/mcp/protocol.js +175 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/server.d.ts +25 -0
- package/dist/mcp/server.js +163 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/setup.d.ts +54 -0
- package/dist/mcp/setup.js +288 -0
- package/dist/mcp/setup.js.map +1 -0
- package/dist/mcp/tools.d.ts +8 -0
- package/dist/mcp/tools.js +446 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/types.d.ts +80 -0
- package/dist/mcp/types.js +15 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/services/taskContext.js +204 -41
- package/dist/services/taskContext.js.map +1 -1
- package/docs/agents.md +32 -0
- package/docs/context-accuracy-report.md +60 -0
- package/docs/context-evaluation.md +170 -0
- package/docs/mcp.md +264 -0
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,59 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes are documented here. This project follows [Semantic Versioning](https://semver.org/). Workspace schema changes are called out under **Breaking**.
|
|
4
4
|
|
|
5
|
+
## [0.4.1] - 2026-11-03
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Integration Test Reliability in Clean Environments**:
|
|
9
|
+
- Automatically compile the CLI on-demand (`ensureCliBuilt`) in `tests/integration/mcp-stdio.test.ts` when running in clean CI runners or coverage workflows where `dist/cli/main.js` has not yet been built.
|
|
10
|
+
- **Documentation & Onboarding Clarity**:
|
|
11
|
+
- Rewrote `README.md` with a plain-English mental model, architecture flowchart, beginner-friendly quick start, and explicit separation of traditional file instructions from MCP integration.
|
|
12
|
+
- Documented tool invocation semantics, testing scope disclaimers, and system `PATH` configuration requirements.
|
|
13
|
+
|
|
14
|
+
## [0.4.0] - 2026-11-03
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- **Model Context Protocol (MCP) Server (`devworkspace mcp serve`)**:
|
|
18
|
+
- Implemented local-first Model Context Protocol (MCP 2024-11-05) server running strictly over stdio with zero runtime dependencies.
|
|
19
|
+
- Zero open network ports, zero external telemetry or cloud dependencies, and complete offline execution.
|
|
20
|
+
- Fully implements the MCP lifecycle: enforces initialization handshake (`initialize` -> `notifications/initialized`) before serving general tool requests, with clean rejection code `-32600` (`INVALID_REQUEST`) for uninitialized requests.
|
|
21
|
+
- Robust stdio transport supporting single-settle promise resolution, clean shutdown, and graceful stdin error/EPIPE handling.
|
|
22
|
+
- **Deterministic MCP Context Tools**:
|
|
23
|
+
- `get_project_overview`: Summarizes repository architecture, detected language stack, UI/backend frameworks, context health, and verification capabilities.
|
|
24
|
+
- `get_task_context`: Generates progressive, role-sliced context (`explorer`, `tester`, `reviewer`) with deterministic keyword retrieval, ADR matching, and mandatory safety rule retention.
|
|
25
|
+
- `get_file_context`: Exposes workspace-relative file contents bounded to 32KB per call with associated DevWorkspace knowledge facts.
|
|
26
|
+
- **AI Coding Agent Setup (`devworkspace mcp setup` / `devworkspace setup --agent`)**:
|
|
27
|
+
- Automated configuration generator for **Claude Code** (`.mcp.json` and `CLAUDE.md`), **OpenAI Codex** (`mcp.json` and `AGENTS.md`), and **Google Antigravity** (`.antigravity/mcp.json` and `.antigravity/rules`).
|
|
28
|
+
- Supports `--check` dry-run mode for previewing configuration changes without modifying disk.
|
|
29
|
+
- Dedicated MCP section markers (`<!-- devworkspace-mcp:start -->` / `<!-- devworkspace-mcp:end -->`) guaranteeing complete coexistence with standard agent instructions (`devworkspace agent install`), preserving custom user content byte-for-byte, and seamlessly migrating legacy MCP blocks.
|
|
30
|
+
- **Security Boundaries & Defense-in-Depth Protections**:
|
|
31
|
+
- Strict workspace-root enforcement (`resolveInside`, `assertNoSymlinkEscape`) blocking path traversal (`..`), absolute paths, and symlink escapes.
|
|
32
|
+
- Secret file exclusion policy refusing credentials, environment files (`.env*`), private keys, tokens, and keystores.
|
|
33
|
+
- Automatic pattern-based secret redaction masking credentials (`[REDACTED:<type>]`) in returned source context.
|
|
34
|
+
- Prompt-injection resistance demarcating retrieved content with `=== BEGIN UNTRUSTED DEVWORKSPACE CONTEXT ===` delimiters.
|
|
35
|
+
- **Documentation & Verification Suite**:
|
|
36
|
+
- Added comprehensive MCP architecture and security documentation in `docs/mcp.md` and updated `docs/agents.md` and `README.md`.
|
|
37
|
+
- Added unit test suites (`tests/unit/mcp.test.ts`, `tests/unit/mcp-setup.test.ts`) and subprocess stdio integration test (`tests/integration/mcp-stdio.test.ts`).
|
|
38
|
+
- Added CLI smoke tests in `scripts/smoke.mjs` verifying help texts and check modes.
|
|
39
|
+
|
|
40
|
+
## [0.3.4] - 2026-11-03
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- **Deterministic Context Accuracy Evaluation Framework (`npm run eval:accuracy`)**:
|
|
44
|
+
- Introduced offline, zero-dependency benchmark engine and dataset in `scripts/eval/` covering 10 engineering archetypes across 4 context roles (`default`, `explorer`, `tester`, `reviewer`).
|
|
45
|
+
- Evaluates mathematical precision, recall, F1-score, 100% safety-retention, verification coverage, and byte/token payload efficiency against ground-truth facts, decisions, and checks.
|
|
46
|
+
- Automated CI integration tests in `tests/integration/context-accuracy.test.ts` to prevent context retrieval regressions.
|
|
47
|
+
- **Semantic Retrieval & Terminology Normalization**:
|
|
48
|
+
- Deterministic word stemming (`normalizeStem`) handling standard English inflectional suffixes (`-ies`, `-es`, `-s`, `-ing`, `-tion`, `-ed`).
|
|
49
|
+
- Explicit engineering domain synonym clusters (`DOMAIN_SYNONYMS`) bridging common developer terminology to repository facts for database schema, migrations, ORM, SQL, auth, tenancy, billing precision, REST APIs, and UI pagination.
|
|
50
|
+
- **Structural Path Guard & Package-Scoped Context Selection**:
|
|
51
|
+
- Excludes generic code structural suffixes and directory names (`PATH_STRUCTURAL_TERMS`: `backend`, `frontend`, `service`, `controller`, `dto`, `worker`, etc.) from source file path matching to eliminate false-positive fact retrieval collisions across unrelated modules.
|
|
52
|
+
- Detects single-package targets (`backend` vs `frontend`) and suppresses cross-package noise facts and global layout dumps while preserving safety rules and verification contracts.
|
|
53
|
+
- Accurately preserves cross-package context for multi-package monorepo tasks.
|
|
54
|
+
- **Enhanced Architectural Decision (ADR) Matching**:
|
|
55
|
+
- Matches prompt queries against complete decision content including titles, context, decisions, consequences, and file references.
|
|
56
|
+
- Filtered through weak-keyword suppressors (`WEAK_TERMS`) to prevent false-positive ADR collisions on generic words like `error`, `check`, or `data`.
|
|
57
|
+
|
|
5
58
|
## [0.3.3] - 2026-11-03
|
|
6
59
|
|
|
7
60
|
### Added
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DevWorkspace
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DevWorkspace is a **local-first engineering memory and verification layer** for software repositories. It provides AI coding agents (such as Claude Code, OpenAI Codex, Cursor, GitHub Copilot, and Google Antigravity) with a small, evidence-backed model of your project's architecture, verification commands, and safety boundaries—without sending your code to a third-party service, creating an account, or requiring an API key.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
cd my-project
|
|
@@ -8,138 +8,268 @@ npx devworkspace init
|
|
|
8
8
|
npx devworkspace analyze
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
---
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## What Problem Does It Solve?
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
AI coding sessions start cold. Agents repeatedly re-read the same directory trees, infer incorrect architectural assumptions, forget past decisions, run the wrong test suites, or claim tasks are complete while the build is failing.
|
|
16
16
|
|
|
17
|
-
DevWorkspace
|
|
17
|
+
DevWorkspace solves this by:
|
|
18
|
+
1. **Storing durable knowledge, not code:** Captures facts, decisions, and verification contracts in `.devworkspace/`.
|
|
19
|
+
2. **Keeping context honest:** Tracks evidence sources, confidence ratings, and staleness so outdated assumptions are flagged.
|
|
20
|
+
3. **Establishing operating rules:** Injects progressive context loading, Git safety rules (preventing destructive resets), and verification gates into agent workflows.
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
| --- | --- |
|
|
21
|
-
| Structural code understanding | [Graphify](https://github.com/Graphify-Labs/graphify) |
|
|
22
|
-
| Engineering workflows (spec, plan, build, test, review, ship) | [Agent Skills](https://github.com/addyosmani/agent-skills) |
|
|
23
|
-
| Quality, simplification, debt review | [Ponytail](https://github.com/DietrichGebert/ponytail) |
|
|
24
|
-
| Model routing (optional, not used in V1) | [OmniRoute](https://github.com/diegosouzapw/OmniRoute) |
|
|
25
|
-
| Correctness | **Your tests** |
|
|
22
|
+
---
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
## How It Works
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
```mermaid
|
|
27
|
+
flowchart LR
|
|
28
|
+
subgraph Local ["Your Local Machine"]
|
|
29
|
+
Repo["Repository Code & Manifests"] --> DW["DevWorkspace (.devworkspace/)"]
|
|
30
|
+
DW -->|"MCP stdio tools"| Agent["AI Coding Agent"]
|
|
31
|
+
DW -->|"Markdown instructions"| Agent
|
|
32
|
+
Agent -->|"Execute verification"| Gate["Tests, Lint & Typecheck"]
|
|
33
|
+
end
|
|
34
|
+
subgraph Cloud ["External AI Provider"]
|
|
35
|
+
Agent -.->|"Context in prompts"| Model["Cloud LLM (Anthropic / OpenAI / Google)"]
|
|
36
|
+
end
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
1. **Discover & Record:** Reads package manifests, configs, and file structure offline to construct a deterministic testing contract (`commands.json`) and discovery report.
|
|
40
|
+
2. **Equip the Agent:** Exposes project context either via the local **Model Context Protocol (MCP)** server or via **file-based instruction blocks** (`CLAUDE.md`, `AGENTS.md`, `.cursor/rules/`).
|
|
41
|
+
3. **Enforce Verification:** Holds the agent accountable to your real test suites, linters, and typecheckers before marking work complete.
|
|
42
|
+
|
|
43
|
+
---
|
|
30
44
|
|
|
31
|
-
|
|
45
|
+
## Quick Start
|
|
32
46
|
|
|
33
|
-
|
|
47
|
+
### Prerequisites
|
|
48
|
+
Node.js **20.11 or newer**. Works on Windows, macOS, and Linux. Git is strongly recommended.
|
|
34
49
|
|
|
50
|
+
### Step 1: Initialize the Workspace
|
|
35
51
|
```bash
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
npm install -g devworkspace
|
|
39
|
-
devworkspace init
|
|
52
|
+
cd my-project
|
|
53
|
+
npx devworkspace init
|
|
40
54
|
```
|
|
55
|
+
Creates `.devworkspace/` with a nested `.gitignore` for machine-local state. It never modifies your source files and is safe to run multiple times.
|
|
41
56
|
|
|
42
|
-
|
|
57
|
+
### Step 2: Analyze Project Structure & Testing Contract
|
|
58
|
+
```bash
|
|
59
|
+
npx devworkspace analyze
|
|
60
|
+
```
|
|
61
|
+
Scans dependencies, frameworks, entry points, and scripts. Generates detected facts and your project's verification contract.
|
|
62
|
+
|
|
63
|
+
### Step 3: Connect Your Coding Agent
|
|
64
|
+
Choose the integration method that fits your agent (both can coexist safely):
|
|
43
65
|
|
|
66
|
+
- **Option A: Model Context Protocol (MCP)** — Recommended for Claude Code, Codex, and Antigravity:
|
|
67
|
+
```bash
|
|
68
|
+
npx devworkspace setup --agent claude-code
|
|
69
|
+
```
|
|
70
|
+
- **Option B: File-Based Instructions** — For Cursor, Copilot, Codex, and Claude:
|
|
71
|
+
```bash
|
|
72
|
+
npx devworkspace agent install --agent all
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Step 4: Verify Workspace Readiness
|
|
44
76
|
```bash
|
|
45
|
-
|
|
46
|
-
npx devworkspace init # safe local setup; creates .devworkspace/
|
|
47
|
-
npx devworkspace analyze # deterministic discovery + onboarding prompt
|
|
77
|
+
npx devworkspace doctor
|
|
48
78
|
```
|
|
79
|
+
Checks workspace health, instruction files, and testing contract consistency. When it reports `Core workspace: READY`, your project is ready for development.
|
|
49
80
|
|
|
50
|
-
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Connecting Your Agent: Two Approaches
|
|
84
|
+
|
|
85
|
+
DevWorkspace supports two ways to equip AI coding agents with project context. You can use either or both:
|
|
86
|
+
|
|
87
|
+
| Capability | Approach A: Model Context Protocol (MCP) | Approach B: File-Based Instructions |
|
|
88
|
+
| --- | --- | --- |
|
|
89
|
+
| **How it works** | Runs a local stdio server exposing structured tools | Injects managed Markdown sections into instruction files |
|
|
90
|
+
| **Target files** | `.mcp.json`, `mcp.json`, `.antigravity/mcp.json` | `CLAUDE.md`, `AGENTS.md`, `.cursor/rules/`, Copilot instructions |
|
|
91
|
+
| **Context retrieval** | Agent invokes tools directly (`get_task_context`, etc.) | Agent reads rules and runs CLI commands (`devworkspace context`) |
|
|
92
|
+
| **Best suited for** | Claude Code, OpenAI Codex, Google Antigravity | Cursor, GitHub Copilot, Codex, Claude Code |
|
|
93
|
+
| **CLI command** | `devworkspace setup --agent <name>` | `devworkspace agent install --agent <name>` |
|
|
94
|
+
|
|
95
|
+
### Seamless Coexistence
|
|
96
|
+
Both approaches can be used simultaneously in the same repository. DevWorkspace uses distinct HTML comment markers:
|
|
97
|
+
- **Standard CLI rules:** `<!-- devworkspace:start -->` ... `<!-- devworkspace:end -->`
|
|
98
|
+
- **MCP instructions:** `<!-- devworkspace-mcp:start -->` ... `<!-- devworkspace-mcp:end -->`
|
|
99
|
+
|
|
100
|
+
Neither command will overwrite or interfere with the other, and custom developer notes outside the markers are preserved byte-for-byte.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Model Context Protocol (MCP) Integration
|
|
105
|
+
|
|
106
|
+
DevWorkspace includes a local-first Model Context Protocol (MCP 2024-11-05) server that enables compatible AI agents to query repository context dynamically over standard input/output (stdio).
|
|
107
|
+
|
|
108
|
+
### Agent Configuration Commands
|
|
51
109
|
|
|
52
110
|
```bash
|
|
53
|
-
|
|
54
|
-
npx devworkspace setup --
|
|
111
|
+
# Configure Claude Code (.mcp.json and CLAUDE.md)
|
|
112
|
+
npx devworkspace setup --agent claude-code
|
|
113
|
+
|
|
114
|
+
# Configure OpenAI Codex (mcp.json and AGENTS.md)
|
|
115
|
+
npx devworkspace setup --agent codex
|
|
116
|
+
|
|
117
|
+
# Configure Google Antigravity (.antigravity/mcp.json and .antigravity/rules)
|
|
118
|
+
npx devworkspace setup --agent antigravity
|
|
119
|
+
|
|
120
|
+
# Configure all supported MCP agents at once
|
|
121
|
+
npx devworkspace setup --agent all
|
|
122
|
+
|
|
123
|
+
# Preview configuration changes without writing files (dry run)
|
|
124
|
+
npx devworkspace setup --agent claude-code --check
|
|
125
|
+
|
|
126
|
+
# Run the stdio MCP server directly
|
|
127
|
+
devworkspace mcp serve
|
|
55
128
|
```
|
|
56
129
|
|
|
57
|
-
|
|
130
|
+
### Available MCP Tools
|
|
131
|
+
|
|
132
|
+
Once configured, the following tools are available to the agent:
|
|
133
|
+
|
|
134
|
+
1. **`get_project_overview`**: Returns the detected language stack, UI/backend frameworks, context health, and verification contract capabilities. Call at the start of a session or when exploring repository architecture.
|
|
135
|
+
2. **`get_task_context`**: Generates progressive, role-sliced context tailored to specific requests (`explorer` for entry points, `tester` for test contracts, `reviewer` for ADRs and security rules). Preserves critical safety rules for all queries.
|
|
136
|
+
3. **`get_file_context`**: Reads workspace-relative files bounded to 32KB per call with associated knowledge facts. Enforces path containment and automatically blocks credential files.
|
|
137
|
+
|
|
138
|
+
### Important Notes on MCP Usage
|
|
58
139
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
4. Run `npx devworkspace doctor`. It should say `READY`.
|
|
140
|
+
- **Tool Invocation Depends on the Agent:** Registering the MCP server makes tools *available* to your coding agent. Whether and when the agent invokes a tool depends on the user's prompt, the agent's internal system prompt, and the model's decision-making. You can prompt the agent directly: *"Use get_project_overview to inspect this project"* or *"Call get_task_context for this bug fix"*.
|
|
141
|
+
- **Automated Tests vs. Live Agent Sessions:** DevWorkspace's MCP server and stdio transport are verified with automated subprocess integration and protocol test suites. However, interactive tool calling in proprietary desktop or terminal sessions (such as closed GUI builds of Claude Code, Codex, or Antigravity) has not been tested in live interactive client sessions and depends on each client's specific implementation.
|
|
142
|
+
- **PATH Requirement:** Generated configurations specify `"command": "devworkspace"`. Ensure `devworkspace` is in your environment `PATH` (e.g. `npm install -g devworkspace`). If running locally without global binaries, change the command in `.mcp.json` / `mcp.json` / `.antigravity/mcp.json` to `"npx"` with arguments `["-y", "devworkspace", "mcp", "serve"]`.
|
|
63
143
|
|
|
64
|
-
|
|
144
|
+
Full MCP technical manual and debugging options: [docs/mcp.md](docs/mcp.md).
|
|
65
145
|
|
|
66
|
-
|
|
146
|
+
---
|
|
67
147
|
|
|
68
|
-
|
|
148
|
+
## Daily Workflow
|
|
69
149
|
|
|
70
|
-
|
|
150
|
+
When working with an AI agent in your repository:
|
|
71
151
|
|
|
72
|
-
|
|
152
|
+
> *"Fix the invoice total rounding error in the billing service."*
|
|
153
|
+
>
|
|
154
|
+
> *"Add supplier management REST API endpoints."*
|
|
155
|
+
>
|
|
156
|
+
> *"Explain how tenant isolation middleware works."*
|
|
73
157
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
158
|
+
The installed instructions direct the agent to follow a proportionate workflow:
|
|
159
|
+
- **Questions:** Read-only inspection; runs no tests.
|
|
160
|
+
- **Bug fixes:** Write a regression test first, implement the fix, and run verified checks.
|
|
161
|
+
- **Refactoring:** Establish a passing test baseline before making modifications.
|
|
162
|
+
- **Explicit constraints:** Constraints like *"only explain"*, *"don't commit"*, or *"no e2e"* are strictly respected.
|
|
77
163
|
|
|
78
|
-
|
|
164
|
+
### Common Daily Workflow Commands
|
|
79
165
|
|
|
80
|
-
|
|
166
|
+
For everyday development with an AI agent:
|
|
81
167
|
|
|
82
168
|
```bash
|
|
83
|
-
devworkspace status
|
|
84
|
-
devworkspace context
|
|
85
|
-
devworkspace
|
|
86
|
-
devworkspace
|
|
169
|
+
devworkspace status # Inspect workspace health, active tasks, and verification checks
|
|
170
|
+
devworkspace context --for "<task>" # Retrieve role-tailored context for a specific request
|
|
171
|
+
devworkspace doctor # Run diagnostic and portability checks
|
|
172
|
+
devworkspace refresh # Re-check repository evidence after pulling or large edits
|
|
87
173
|
```
|
|
88
174
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
| Command | Purpose |
|
|
92
|
-
| --- | --- |
|
|
93
|
-
| `init` | Create `.devworkspace/` (idempotent, never touches source) |
|
|
94
|
-
| `setup` | One-command setup: initialize workspace, discover commands, verify diagnostics, optionally install integrations (`--integrations`) |
|
|
95
|
-
| `integrations` | `status` (observed, never assumed) and `repair` |
|
|
96
|
-
| `analyze` | Deterministic discovery; writes `discovery.json`, testing contract, onboarding prompt |
|
|
97
|
-
| `agent install` | Add managed instruction blocks for your coding agent (`--agent claude\|codex\|cursor\|copilot\|all`) |
|
|
98
|
-
| `agent list` | Show supported and detected coding agent integrations and their capabilities |
|
|
99
|
-
| `status` | Concise overview, read-only (`--deep` also runs the integration health checks; `--json` for tooling) |
|
|
100
|
-
| `doctor` | Health, security and portability checks (`--fix`, `--strict`, `--json`) |
|
|
101
|
-
| `refresh` | Incremental staleness check; writes a refresh prompt when AI re-validation is needed |
|
|
102
|
-
| `context` | Show stored knowledge (`--topic` filters facts and the testing contract; safety rules are always shown; `--full`) |
|
|
103
|
-
| `fact` | `add` / `verify` / `remove` / `list` project knowledge with provenance |
|
|
104
|
-
| `feature` | `list` / `show` / `validate` / `add` feature-level map connecting frontend, backend, database and tests |
|
|
105
|
-
| `graph` | `status` and `trace` bounded knowledge-graph navigation with node and edge verification |
|
|
106
|
-
| `task` | `new` / `list` / `show` / `status` / `update` / `run` / `verify` / `tests` / `attest` with a package-aware completion gate |
|
|
107
|
-
| `testenv` | `declare` / `list` / `revoke` a test environment so database-touching checks may run (local, never committed) |
|
|
108
|
-
| `decision` | Append-only, human-readable decision records |
|
|
109
|
-
| `session` | Save short session summaries (never transcripts) |
|
|
110
|
-
| `export` / `import` | Move portable knowledge between machines safely |
|
|
111
|
-
| `reset` | Delete `.devworkspace/` to start fresh (`--yes` to confirm, `--include-agent-files` to also remove managed agent instruction blocks/skills) |
|
|
112
|
-
| `migrate` | Upgrade workspace files to the current schema, with backups |
|
|
113
|
-
|
|
114
|
-
Global flags: `--json`, `--cwd <dir>`, `--dry-run` (where it applies), `--debug`, `--no-color`, `--ascii`.
|
|
115
|
-
|
|
116
|
-
**Exit codes:** `0` success · `1` failure · `2` usage error · `3` warnings (only with `--strict` on `status`/`doctor`) · `130`/`143` interrupted. Integrations that are not installed are *warnings*, never failures, so CI can use `devworkspace doctor` and fail only on real problems.
|
|
175
|
+
### Command Reference
|
|
117
176
|
|
|
118
|
-
|
|
177
|
+
| Command | Summary | Guide |
|
|
178
|
+
| --- | --- | --- |
|
|
179
|
+
| `init` | Create `.devworkspace/` in the project (safe to re-run) | [Getting Started](docs/getting-started.md) |
|
|
180
|
+
| `setup` | One-command setup: initialize, discover contracts, configure agents | [Getting Started](docs/getting-started.md) |
|
|
181
|
+
| `analyze` | Deterministic repository discovery and onboarding analysis | [Architecture](docs/architecture.md) |
|
|
182
|
+
| `status` | Concise health, Git branch, knowledge, and verification overview | [Getting Started](docs/getting-started.md) |
|
|
183
|
+
| `doctor` | Workspace, security, portability, and integration diagnostics | [Troubleshooting](docs/troubleshooting.md) |
|
|
184
|
+
| `context` | Task-aware context retrieval with optional role slicing | [Task Routing](docs/routing.md) |
|
|
185
|
+
| `refresh` | Re-check repository evidence and mark stale knowledge | [Knowledge Model](docs/knowledge.md) |
|
|
186
|
+
| `task` | Engineering task tracking with completion verification gate | [Testing Contract](docs/testing.md) |
|
|
187
|
+
| `agent` | Manage agent instructions (`agent install`, `agent list`) | [Agent Integrations](docs/agents.md) |
|
|
188
|
+
| `mcp` | Stdio Model Context Protocol server (`serve`) and agent setup (`setup`) | [MCP Guide](docs/mcp.md) |
|
|
189
|
+
| `integrations` | Inspect and repair optional helper tools (Graphify, Skills, Ponytail) | [Integrations](docs/integrations.md) |
|
|
190
|
+
| `fact` | Record, verify, list, or remove project facts with provenance | [Knowledge Model](docs/knowledge.md) |
|
|
191
|
+
| `feature` | End-to-end feature map tracing across routes, services, and tests | [Getting Started](docs/getting-started.md) |
|
|
192
|
+
| `graph` | Inspect and trace Graphify knowledge graphs | [Integrations](docs/integrations.md) |
|
|
193
|
+
| `decision` | Append-only architectural decision records (ADRs) | [Architecture](docs/architecture.md) |
|
|
194
|
+
| `session` | Record concise session summaries (never transcripts) | [Getting Started](docs/getting-started.md) |
|
|
195
|
+
| `testenv` | Declare local test environment for database-touching checks | [Testing Contract](docs/testing.md) |
|
|
196
|
+
| `export` | Export portable project knowledge to a bundle | [Portability](docs/portability.md) |
|
|
197
|
+
| `import` | Safely import an export bundle without silent overwrites | [Portability](docs/portability.md) |
|
|
198
|
+
| `reset` | Reset `.devworkspace/` (optional `--include-agent-files`) | [Getting Started](docs/getting-started.md) |
|
|
199
|
+
| `migrate` | Upgrade workspace files to current schema with backups | [Getting Started](docs/getting-started.md) |
|
|
200
|
+
|
|
201
|
+
Global flags supported across commands: `--json`, `--cwd <dir>`, `--dry-run`, `--debug`, `--no-color`, `--ascii`.
|
|
202
|
+
|
|
203
|
+
Exit codes: `0` success · `1` failure · `2` usage error · `3` warnings (with `--strict`) · `130`/`143` interrupted.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Security, Privacy & Data Transmission
|
|
119
208
|
|
|
120
|
-
|
|
209
|
+
DevWorkspace enforces defense-in-depth safety controls:
|
|
210
|
+
|
|
211
|
+
### Local DevWorkspace Protections
|
|
212
|
+
- **Zero Network Listeners:** DevWorkspace never opens HTTP or TCP ports. MCP runs strictly over local stdio child processes.
|
|
213
|
+
- **No Telemetry or Cloud Accounts:** DevWorkspace does not collect analytics or transmit data to DevWorkspace servers.
|
|
214
|
+
- **Credential Protection:** Credential files (`.env*`, `*.pem`, `*.key`, `id_rsa*`, tokens, keystores) are barred from reads. If an allowed source file contains API keys or tokens, patterns are automatically masked with `[REDACTED:<type>]`.
|
|
215
|
+
- **Workspace Boundary Enforcement:** Paths are validated with canonical checks (`resolveInside`) and symlink escape verification (`assertNoSymlinkEscape`). Directory traversal (`..`) and absolute paths are rejected.
|
|
216
|
+
- **Prompt-Injection Defense:** All retrieved context is demarcated with `=== BEGIN UNTRUSTED DEVWORKSPACE CONTEXT ===` headers, instructing the agent to treat repository content as untrusted evidence rather than executable instructions.
|
|
217
|
+
|
|
218
|
+
### AI Provider Notice
|
|
219
|
+
When an AI coding agent invokes DevWorkspace MCP tools or reads project files, that context enters the agent's context window and is transmitted to the external cloud LLM provider powering that agent (such as Anthropic, OpenAI, or Google). DevWorkspace governs what leaves your local files, while your AI provider's terms and privacy policies govern data processed in their cloud.
|
|
220
|
+
|
|
221
|
+
Full security and threat model: [docs/security.md](docs/security.md).
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Ecosystem & Helper Tools
|
|
226
|
+
|
|
227
|
+
DevWorkspace decides *when and why* engineering workflows apply. It can optionally orchestrate external helper tools:
|
|
228
|
+
|
|
229
|
+
| Concern | Tool | Status |
|
|
230
|
+
| --- | --- | --- |
|
|
231
|
+
| Structural code understanding | [Graphify](https://github.com/Graphify-Labs/graphify) | Optional integration (`setup --integrations`) |
|
|
232
|
+
| Engineering skill workflows | [Agent Skills](https://github.com/addyosmani/agent-skills) | Optional integration (`setup --integrations`) |
|
|
233
|
+
| Code quality & debt review | [Ponytail](https://github.com/DietrichGebert/ponytail) | Optional integration (`setup --integrations`) |
|
|
234
|
+
| Correctness & verification | **Your test suites** | Discovered deterministically in `commands.json` |
|
|
235
|
+
|
|
236
|
+
Details on scopes, prerequisites, and integration health checks: [docs/integrations.md](docs/integrations.md).
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Portability
|
|
121
241
|
|
|
122
|
-
|
|
242
|
+
Commit `.devworkspace/` to your version control system (machine-local files in `.devworkspace/local/` are ignored automatically). On another workstation, clone the repository and run `npx devworkspace doctor`. Project identity is managed via a UUID in `project.json` rather than hardcoded file paths, so repository paths can change without breaking project state. Full guide: [docs/portability.md](docs/portability.md).
|
|
123
243
|
|
|
124
|
-
|
|
125
|
-
- Repository content is treated as **untrusted data**, and the generated instructions say so, to resist prompt injection.
|
|
126
|
-
- Subprocesses use argument arrays, never a shell. Imports are validated before anything is written.
|
|
127
|
-
- DevWorkspace itself sends nothing anywhere and has no telemetry. Generated prompts will, of course, cause *your chosen AI agent* to read repository files.
|
|
244
|
+
---
|
|
128
245
|
|
|
129
|
-
|
|
246
|
+
## Limitations
|
|
130
247
|
|
|
131
|
-
|
|
248
|
+
- **Language Scope:** Manifest and command discovery supports Node.js, Python, Go, Rust, Java, and PHP projects.
|
|
249
|
+
- **Client Environments:** Standard stdio protocol handling is verified via automated tests, but live interactive invocation depends on individual third-party agent desktop or CLI releases.
|
|
250
|
+
- **Model Prerogative:** MCP tool availability does not force an agent to invoke a tool; invocation depends on model planning and prompt specificity.
|
|
251
|
+
- **Integration Prerequisites:** Integrations like Graphify require Python 3.10+ or `uv` and explicit user authorization (`--yes`).
|
|
132
252
|
|
|
133
|
-
|
|
134
|
-
- Integration setup needs prerequisites (Python 3.10+ or uv for Graphify; the Claude Code CLI for native plugins, otherwise portable skills with fewer capabilities) and sometimes your approval. It was not run end to end against GitHub on macOS/Linux; see the verification notes in [docs/integrations.md](docs/integrations.md).
|
|
135
|
-
- DevWorkspace does not build Graphify's graph (that uses the model) or uninstall anything.
|
|
136
|
-
- Deep analysis is not attempted for any language; discovery covers manifests, structure and commands for Node, Python, Go, Rust, Java and PHP projects.
|
|
137
|
-
- The routing classifier is a keyword heuristic used to *propose* a type. The agent decides.
|
|
138
|
-
- Token savings are not claimed. See [docs/benchmarking.md](docs/benchmarking.md) for how to measure them.
|
|
253
|
+
---
|
|
139
254
|
|
|
140
255
|
## Documentation
|
|
141
256
|
|
|
142
|
-
[Getting
|
|
257
|
+
- [Getting Started](docs/getting-started.md)
|
|
258
|
+
- [Architecture & Design](docs/architecture.md)
|
|
259
|
+
- [Model Context Protocol (MCP)](docs/mcp.md)
|
|
260
|
+
- [Coding Agent Integrations](docs/agents.md)
|
|
261
|
+
- [Knowledge & Context Model](docs/knowledge.md)
|
|
262
|
+
- [Testing & Verification Contract](docs/testing.md)
|
|
263
|
+
- [Security & Threat Model](docs/security.md)
|
|
264
|
+
- [Integrations (Graphify, Skills, Ponytail)](docs/integrations.md)
|
|
265
|
+
- [Claude Code Guide](docs/claude.md)
|
|
266
|
+
- [Task Routing & Roles](docs/routing.md)
|
|
267
|
+
- [Portability & Git](docs/portability.md)
|
|
268
|
+
- [Benchmarking & Evaluation](docs/benchmarking.md)
|
|
269
|
+
- [Troubleshooting Guide](docs/troubleshooting.md)
|
|
270
|
+
- [Contributing](docs/contributing.md)
|
|
271
|
+
|
|
272
|
+
---
|
|
143
273
|
|
|
144
274
|
## License
|
|
145
275
|
|
package/dist/cli/args.d.ts
CHANGED
|
@@ -276,5 +276,6 @@ export interface ParsedArgs {
|
|
|
276
276
|
export declare function parseCli(argv: string[]): ParsedArgs;
|
|
277
277
|
export declare function str(v: ParsedArgs['values'], k: string): string | undefined;
|
|
278
278
|
export declare function bool(v: ParsedArgs['values'], k: string): boolean;
|
|
279
|
+
export declare function isCheckOrDryRun(v: ParsedArgs['values']): boolean;
|
|
279
280
|
export declare function list(v: ParsedArgs['values'], k: string): string[];
|
|
280
281
|
export declare function int(v: ParsedArgs['values'], k: string): number | undefined;
|
package/dist/cli/args.js
CHANGED
|
@@ -87,7 +87,16 @@ export const OPTIONS = {
|
|
|
87
87
|
};
|
|
88
88
|
export function parseCli(argv) {
|
|
89
89
|
try {
|
|
90
|
-
const
|
|
90
|
+
const normalizedArgv = argv.map((arg, idx) => {
|
|
91
|
+
if (arg === '--check') {
|
|
92
|
+
const next = argv[idx + 1];
|
|
93
|
+
if (!next || next.startsWith('-')) {
|
|
94
|
+
return '--check=true';
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return arg;
|
|
98
|
+
});
|
|
99
|
+
const { values, positionals } = parseArgs({ args: normalizedArgv, options: OPTIONS, allowPositionals: true, strict: true });
|
|
91
100
|
return { positionals, values: values };
|
|
92
101
|
}
|
|
93
102
|
catch (e) {
|
|
@@ -103,6 +112,12 @@ export function str(v, k) {
|
|
|
103
112
|
export function bool(v, k) {
|
|
104
113
|
return v[k] === true;
|
|
105
114
|
}
|
|
115
|
+
export function isCheckOrDryRun(v) {
|
|
116
|
+
if (bool(v, 'dry-run'))
|
|
117
|
+
return true;
|
|
118
|
+
const checks = list(v, 'check');
|
|
119
|
+
return checks.includes('true');
|
|
120
|
+
}
|
|
106
121
|
export function list(v, k) {
|
|
107
122
|
const x = v[k];
|
|
108
123
|
return Array.isArray(x) ? x : [];
|
package/dist/cli/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,qGAAqG;AACrG,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACrC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACxC,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AC,EAAE;YACtG,IAAI,EAAE,+DAA+D;SACtE,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,CAAuB,EAAE,CAAS;IACpD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACf,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,CAAuB,EAAE,CAAS;IACrD,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,CAAuB,EAAE,CAAS;IACrD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,CAAuB,EAAE,CAAS;IACpD,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpB,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACtC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC;IAC1G,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["import { parseArgs } from 'node:util';\nimport { DevWorkspaceError } from '../errors/index.js';\n\ntype OptionSpec = { type: 'boolean' | 'string'; short?: string; multiple?: boolean };\n\n/** Every flag the CLI understands. Unknown flags are rejected so typos never silently do nothing. */\nexport const OPTIONS = {\n help: { type: 'boolean', short: 'h' },\n version: { type: 'boolean', short: 'v' },\n json: { type: 'boolean' },\n debug: { type: 'boolean' },\n 'no-color': { type: 'boolean' },\n ascii: { type: 'boolean' },\n 'dry-run': { type: 'boolean' },\n yes: { type: 'boolean', short: 'y' },\n 'include-agent-files': { type: 'boolean' },\n integrations: { type: 'boolean' },\n 'with-integrations': { type: 'boolean' },\n only: { type: 'string', multiple: true },\n scope: { type: 'string' },\n restarted: { type: 'boolean' },\n quick: { type: 'boolean' },\n cwd: { type: 'string' },\n root: { type: 'string' },\n fix: { type: 'boolean' },\n strict: { type: 'boolean' },\n out: { type: 'string', short: 'o' },\n overwrite: { type: 'boolean' },\n 'allow-different-project': { type: 'boolean' },\n topic: { type: 'string' },\n full: { type: 'boolean' },\n all: { type: 'boolean' },\n agent: { type: 'string' },\n type: { type: 'string' },\n title: { type: 'string' },\n key: { type: 'string' },\n value: { type: 'string' },\n source: { type: 'string' },\n 'source-type': { type: 'string' },\n file: { type: 'string', multiple: true },\n confidence: { type: 'string' },\n status: { type: 'string' },\n reason: { type: 'string' },\n detail: { type: 'string' },\n note: { type: 'string' },\n phase: { type: 'string' },\n passed: { type: 'string' },\n failed: { type: 'string' },\n criteria: { type: 'string', multiple: true },\n plan: { type: 'string', multiple: true },\n area: { type: 'string', multiple: true },\n 'decision-note': { type: 'string', multiple: true },\n summary: { type: 'string' },\n blocker: { type: 'string', multiple: true },\n 'clear-blockers': { type: 'boolean' },\n require: { type: 'string', multiple: true },\n 'user-work-intact': { type: 'boolean' },\n 'knowledge-reviewed': { type: 'boolean' },\n 'final-state-inspected': { type: 'boolean' },\n context: { type: 'string' },\n for: { type: 'string' },\n role: { type: 'string' },\n decision: { type: 'string' },\n consequences: { type: 'string' },\n supersedes: { type: 'string' },\n goal: { type: 'string' },\n done: { type: 'string', multiple: true },\n 'tests-run': { type: 'string', multiple: true },\n remaining: { type: 'string', multiple: true },\n next: { type: 'string' },\n task: { type: 'string' },\n limit: { type: 'string' },\n package: { type: 'string' },\n check: { type: 'string', multiple: true },\n target: { type: 'string' },\n timeout: { type: 'string' },\n deep: { type: 'boolean' },\n id: { type: 'string' },\n name: { type: 'string' },\n description: { type: 'string' },\n symbol: { type: 'string' },\n entry: { type: 'string', multiple: true },\n route: { type: 'string', multiple: true },\n service: { type: 'string', multiple: true },\n model: { type: 'string', multiple: true },\n test: { type: 'string', multiple: true },\n tag: { type: 'string', multiple: true },\n from: { type: 'string' },\n depth: { type: 'string' },\n} as const satisfies Record<string, OptionSpec>;\n\nexport interface ParsedArgs {\n positionals: string[];\n values: Record<string, string | boolean | string[] | undefined>;\n}\n\nexport function parseCli(argv: string[]): ParsedArgs {\n try {\n const { values, positionals } = parseArgs({ args: argv, options: OPTIONS, allowPositionals: true, strict: true });\n return { positionals, values: values as ParsedArgs['values'] };\n } catch (e) {\n throw new DevWorkspaceError('USAGE', (e as Error).message.replace(/^Unknown option/, 'Unknown option'), {\n hint: 'Run \"devworkspace --help\" or \"devworkspace <command> --help\".',\n });\n }\n}\n\nexport function str(v: ParsedArgs['values'], k: string): string | undefined {\n const x = v[k];\n return typeof x === 'string' ? x : undefined;\n}\n\nexport function bool(v: ParsedArgs['values'], k: string): boolean {\n return v[k] === true;\n}\n\nexport function list(v: ParsedArgs['values'], k: string): string[] {\n const x = v[k];\n return Array.isArray(x) ? x : [];\n}\n\nexport function int(v: ParsedArgs['values'], k: string): number | undefined {\n const s = str(v, k);\n if (s === undefined) return undefined;\n const n = Number(s);\n if (!Number.isInteger(n)) throw new DevWorkspaceError('USAGE', `--${k} must be an integer (got \"${s}\").`);\n return n;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,qGAAqG;AACrG,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,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AO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,CAAuB,EAAE,CAAS;IACpD,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpB,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACtC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC;IAC1G,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["import { parseArgs } from 'node:util';\nimport { DevWorkspaceError } from '../errors/index.js';\n\ntype OptionSpec = { type: 'boolean' | 'string'; short?: string; multiple?: boolean };\n\n/** Every flag the CLI understands. Unknown flags are rejected so typos never silently do nothing. */\nexport const OPTIONS = {\n help: { type: 'boolean', short: 'h' },\n version: { type: 'boolean', short: 'v' },\n json: { type: 'boolean' },\n debug: { type: 'boolean' },\n 'no-color': { type: 'boolean' },\n ascii: { type: 'boolean' },\n 'dry-run': { type: 'boolean' },\n yes: { type: 'boolean', short: 'y' },\n 'include-agent-files': { type: 'boolean' },\n integrations: { type: 'boolean' },\n 'with-integrations': { type: 'boolean' },\n only: { type: 'string', multiple: true },\n scope: { type: 'string' },\n restarted: { type: 'boolean' },\n quick: { type: 'boolean' },\n cwd: { type: 'string' },\n root: { type: 'string' },\n fix: { type: 'boolean' },\n strict: { type: 'boolean' },\n out: { type: 'string', short: 'o' },\n overwrite: { type: 'boolean' },\n 'allow-different-project': { type: 'boolean' },\n topic: { type: 'string' },\n full: { type: 'boolean' },\n all: { type: 'boolean' },\n agent: { type: 'string' },\n type: { type: 'string' },\n title: { type: 'string' },\n key: { type: 'string' },\n value: { type: 'string' },\n source: { type: 'string' },\n 'source-type': { type: 'string' },\n file: { type: 'string', multiple: true },\n confidence: { type: 'string' },\n status: { type: 'string' },\n reason: { type: 'string' },\n detail: { type: 'string' },\n note: { type: 'string' },\n phase: { type: 'string' },\n passed: { type: 'string' },\n failed: { type: 'string' },\n criteria: { type: 'string', multiple: true },\n plan: { type: 'string', multiple: true },\n area: { type: 'string', multiple: true },\n 'decision-note': { type: 'string', multiple: true },\n summary: { type: 'string' },\n blocker: { type: 'string', multiple: true },\n 'clear-blockers': { type: 'boolean' },\n require: { type: 'string', multiple: true },\n 'user-work-intact': { type: 'boolean' },\n 'knowledge-reviewed': { type: 'boolean' },\n 'final-state-inspected': { type: 'boolean' },\n context: { type: 'string' },\n for: { type: 'string' },\n role: { type: 'string' },\n decision: { type: 'string' },\n consequences: { type: 'string' },\n supersedes: { type: 'string' },\n goal: { type: 'string' },\n done: { type: 'string', multiple: true },\n 'tests-run': { type: 'string', multiple: true },\n remaining: { type: 'string', multiple: true },\n next: { type: 'string' },\n task: { type: 'string' },\n limit: { type: 'string' },\n package: { type: 'string' },\n check: { type: 'string', multiple: true },\n target: { type: 'string' },\n timeout: { type: 'string' },\n deep: { type: 'boolean' },\n id: { type: 'string' },\n name: { type: 'string' },\n description: { type: 'string' },\n symbol: { type: 'string' },\n entry: { type: 'string', multiple: true },\n route: { type: 'string', multiple: true },\n service: { type: 'string', multiple: true },\n model: { type: 'string', multiple: true },\n test: { type: 'string', multiple: true },\n tag: { type: 'string', multiple: true },\n from: { type: 'string' },\n depth: { type: 'string' },\n} as const satisfies Record<string, OptionSpec>;\n\nexport interface ParsedArgs {\n positionals: string[];\n values: Record<string, string | boolean | string[] | undefined>;\n}\n\nexport function parseCli(argv: string[]): ParsedArgs {\n try {\n const normalizedArgv = argv.map((arg, idx) => {\n if (arg === '--check') {\n const next = argv[idx + 1];\n if (!next || next.startsWith('-')) {\n return '--check=true';\n }\n }\n return arg;\n });\n const { values, positionals } = parseArgs({ args: normalizedArgv, options: OPTIONS, allowPositionals: true, strict: true });\n return { positionals, values: values as ParsedArgs['values'] };\n } catch (e) {\n throw new DevWorkspaceError('USAGE', (e as Error).message.replace(/^Unknown option/, 'Unknown option'), {\n hint: 'Run \"devworkspace --help\" or \"devworkspace <command> --help\".',\n });\n }\n}\n\nexport function str(v: ParsedArgs['values'], k: string): string | undefined {\n const x = v[k];\n return typeof x === 'string' ? x : undefined;\n}\n\nexport function bool(v: ParsedArgs['values'], k: string): boolean {\n return v[k] === true;\n}\n\nexport function isCheckOrDryRun(v: ParsedArgs['values']): boolean {\n if (bool(v, 'dry-run')) return true;\n const checks = list(v, 'check');\n return checks.includes('true');\n}\n\nexport function list(v: ParsedArgs['values'], k: string): string[] {\n const x = v[k];\n return Array.isArray(x) ? x : [];\n}\n\nexport function int(v: ParsedArgs['values'], k: string): number | undefined {\n const s = str(v, k);\n if (s === undefined) return undefined;\n const n = Number(s);\n if (!Number.isInteger(n)) throw new DevWorkspaceError('USAGE', `--${k} must be an integer (got \"${s}\").`);\n return n;\n}\n"]}
|
package/dist/cli/help.js
CHANGED
|
@@ -22,9 +22,12 @@ export const COMMANDS = [
|
|
|
22
22
|
summary: 'Single-command repository setup (inspect, initialize, discover contract & validate)',
|
|
23
23
|
usage: [
|
|
24
24
|
'devworkspace setup',
|
|
25
|
+
'devworkspace setup --agent claude-code|codex|antigravity|all [--check]',
|
|
25
26
|
'devworkspace setup --integrations [--yes] [--dry-run] [--scope project|user] [--only graphify,agent-skills,ponytail]',
|
|
26
27
|
],
|
|
27
28
|
options: [
|
|
29
|
+
['--agent <name>', 'configure MCP integration for agent (claude-code, codex, antigravity, all)'],
|
|
30
|
+
['--check', 'with --agent: validate and plan without writing files'],
|
|
28
31
|
['--integrations', 'set up external integrations (Graphify, Agent Skills, Ponytail)'],
|
|
29
32
|
['--dry-run', 'show exactly what would run; changes nothing'],
|
|
30
33
|
['--yes', 'with --integrations: approve machine-level and third-party installs'],
|
|
@@ -32,7 +35,13 @@ export const COMMANDS = [
|
|
|
32
35
|
['--only <ids>', 'comma-separated: graphify, agent-skills, ponytail'],
|
|
33
36
|
...COMMON,
|
|
34
37
|
],
|
|
35
|
-
examples: [
|
|
38
|
+
examples: [
|
|
39
|
+
'devworkspace setup',
|
|
40
|
+
'devworkspace setup --agent claude-code',
|
|
41
|
+
'devworkspace setup --agent antigravity --check',
|
|
42
|
+
'devworkspace setup --json',
|
|
43
|
+
'devworkspace setup --integrations --yes',
|
|
44
|
+
],
|
|
36
45
|
},
|
|
37
46
|
{
|
|
38
47
|
name: 'integrations',
|
|
@@ -264,6 +273,24 @@ export const COMMANDS = [
|
|
|
264
273
|
options: [['--dry-run', 'list what would be migrated'], ...COMMON],
|
|
265
274
|
examples: ['devworkspace migrate'],
|
|
266
275
|
},
|
|
276
|
+
{
|
|
277
|
+
name: 'mcp',
|
|
278
|
+
summary: 'Local-first Model Context Protocol (MCP) server and agent configuration',
|
|
279
|
+
usage: [
|
|
280
|
+
'devworkspace mcp serve [--debug]',
|
|
281
|
+
'devworkspace mcp setup [--agent claude-code|codex|antigravity|all] [--check]',
|
|
282
|
+
],
|
|
283
|
+
options: [
|
|
284
|
+
['--agent <name>', 'agent to configure (claude-code, codex, antigravity, all)'],
|
|
285
|
+
['--check', 'validate and plan configuration without modifying files'],
|
|
286
|
+
...COMMON,
|
|
287
|
+
],
|
|
288
|
+
examples: [
|
|
289
|
+
'devworkspace mcp serve',
|
|
290
|
+
'devworkspace mcp setup --agent claude-code',
|
|
291
|
+
'devworkspace mcp setup --agent antigravity --check',
|
|
292
|
+
],
|
|
293
|
+
},
|
|
267
294
|
];
|
|
268
295
|
export function topHelp(version) {
|
|
269
296
|
const w = Math.max(...COMMANDS.map((c) => c.name.length));
|