devworkspace 0.4.1 → 0.4.3

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/docs/agents.md CHANGED
@@ -78,9 +78,23 @@ DevWorkspace strictly segregates standard CLI instructions from MCP instructions
78
78
 
79
79
  Both sets of instructions can coexist in the same project files (e.g. `CLAUDE.md`, `AGENTS.md`, or `.antigravity/rules`). Running `devworkspace agent install` or `devworkspace setup --agent <name>` will never overwrite or clobber the other block, and all custom user notes outside the blocks are preserved byte-for-byte.
80
80
 
81
- ### MCP PATH Requirements
81
+ ### MCP Launcher Resolution
82
82
 
83
- The generated agent configurations register `"command": "devworkspace"`. Ensure that `devworkspace` is available in your system `PATH` (such as via `npm install -g devworkspace`). If you prefer running without global binaries, modify the command in `.mcp.json` / `mcp.json` / `.antigravity/mcp.json` to `"npx"` with arguments `["-y", "devworkspace", "mcp", "serve"]`.
83
+ DevWorkspace automatically determines the optimal launcher for your agent configuration:
84
+ - **Global Binary (`command: "devworkspace"`):** Used when `devworkspace` is installed globally or found on system `PATH`.
85
+ - **npx Launcher (`command: "npx"`, `args: ["-y", "devworkspace", "mcp", "serve"]`):** Used automatically when running via `npx` or when no global `devworkspace` executable is detected on `PATH`. No manual edits to `.mcp.json` are required.
86
+
87
+ You can explicitly control the launcher strategy via the `--launcher` flag during setup:
88
+ ```bash
89
+ # Force npx launcher:
90
+ devworkspace setup --agent claude-code --launcher npx
91
+
92
+ # Force direct global binary:
93
+ devworkspace setup --agent claude-code --launcher direct
94
+
95
+ # Automatically detect (default):
96
+ devworkspace setup --agent claude-code --launcher auto
97
+ ```
84
98
 
85
99
  ## Adding a New Agent Adapter
86
100
 
package/docs/mcp.md CHANGED
@@ -11,6 +11,8 @@ The DevWorkspace MCP integration exposes DevWorkspace's deterministic context re
11
11
  - High-level project architecture and stack detection (`get_project_overview`)
12
12
  - Natural-language task context with role slicing (`get_task_context` for `explorer`, `tester`, `reviewer`)
13
13
  - Workspace-relative file context bounded to 32KB (`get_file_context`)
14
+ - Server readiness, context freshness, and agent configuration diagnostics (`check_mcp_health`)
15
+ - Retrieval evidence, domain synonyms, and selection explanations (`explain_context`)
14
16
 
15
17
  The developer does not need to manually copy and paste context into conversation prompts.
16
18
 
@@ -76,17 +78,18 @@ npx devworkspace setup --agent claude-code
76
78
  ```
77
79
 
78
80
  **What this configures:**
79
- - Creates or updates `.mcp.json` at the project root:
81
+ - Creates or updates `.mcp.json` at the project root with the appropriate launcher (automatically uses `npx` when run via npx or when no global binary exists, or `devworkspace` when installed globally):
80
82
  ```json
81
83
  {
82
84
  "mcpServers": {
83
85
  "devworkspace": {
84
- "command": "devworkspace",
85
- "args": ["mcp", "serve"]
86
+ "command": "npx",
87
+ "args": ["-y", "devworkspace", "mcp", "serve"]
86
88
  }
87
89
  }
88
90
  }
89
91
  ```
92
+ *(Pass `--launcher direct` to force the global binary, or `--launcher npx` to force npx).*
90
93
  - Appends or updates instructions in `CLAUDE.md` directing Claude Code to invoke `get_project_overview` when starting work and `get_task_context` when addressing issues.
91
94
 
92
95
  ### OpenAI Codex
@@ -164,12 +167,95 @@ printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion
164
167
 
165
168
  ---
166
169
 
167
- ## 8. What the Agent Can and Cannot Access
170
+ ## 8. Available MCP Tools Specification
171
+
172
+ DevWorkspace advertises 6 tools over the standard MCP protocol:
173
+
174
+ ### 1. `get_project_overview`
175
+ - **Description:** Retrieve the architectural summary, detected stack, health status, context freshness, and context capabilities of the current DevWorkspace project.
176
+ - **Input Schema:**
177
+ - `refresh` (optional boolean): Re-evaluate context staleness against the filesystem.
178
+ - **Returns:**
179
+ - Workspace health, project ID, and Git branch status.
180
+ - Detected stack (languages, frameworks, monorepo packages).
181
+ - Context capabilities (supported role slices, configured verification checks).
182
+ - Context freshness state (`Current`, `Stale`, `Empty`) with stale item details.
183
+
184
+ ### 2. `get_task_context`
185
+ - **Description:** Retrieve deterministic, role-aware project context (facts, rules, checks, decisions, documents) for a natural-language task.
186
+ - **Input Schema:**
187
+ - `task` (required string): Natural-language description of the task (e.g. `"fix rounding error in invoice calculation"`).
188
+ - `role` (optional enum: `"explorer"`, `"tester"`, `"reviewer"`):
189
+ - `explorer`: Prioritizes entry points, feature components, and graph nodes while omitting execution checks.
190
+ - `tester`: Prioritizes verification checks, test framework conventions, and zero-test safeguards.
191
+ - `reviewer`: Prioritizes git diff notices, security rules, and architectural decision records (ADRs).
192
+ - `max_context_chars` (optional number, 500-64000, default 16000): Upper bound on context length in characters.
193
+ - **Context Intelligence Enhancements:**
194
+ - **Fact Ranking, Source Paths & Verification Status:** Facts are ranked by task relevance and authority (`USER_DECISION` > `VERIFIED` / `DETECTED` > `INFERRED`), displaying verification status, normalized source attribution, and staleness warnings: `- **key** [VERIFIED] (source: path): value`.
195
+ - **Ranked Relevant Files to Inspect:** Automatically synthesizes high-signal file recommendations derived from matching facts, feature components (routes, services, models, tests), graph nodes, and ADR files.
196
+ - **Feature Components:** Lists concrete repository paths mapped to the feature.
197
+ - **Missing Information Transparency:** When facts or ADRs for an area are unrecorded, DevWorkspace explicitly explains what is missing rather than omitting sections or hallucinating.
198
+
199
+ ### 3. `get_file_context`
200
+ - **Description:** Retrieve bounded file contents (full file or specific line ranges) and associated knowledge facts, mapped feature tests, and governing ADRs for a workspace-relative file path.
201
+ - **Input Schema:**
202
+ - `path` (required string): Workspace-relative path to inspect (e.g. `"src/index.ts"`).
203
+ - `start_line` (optional integer): 1-indexed starting line number (inclusive) for bounded line retrieval.
204
+ - `end_line` (optional integer): 1-indexed ending line number (inclusive) for bounded line retrieval (maximum window: 1000 lines).
205
+ - **Protection Rules:**
206
+ - Rejects absolute paths (`/etc/passwd`, `C:\...`).
207
+ - Rejects directory traversal escaping workspace root (`../../`).
208
+ - Rejects credential files (`.env`, private keys, secrets).
209
+ - Enforces workspace ignore policies (`.devworkspaceignore`, `.gitignore`, and excluded build/vendor directories).
210
+ - Bounds full file text to 32KB; returns line-numbered code when line ranges are specified.
211
+ - Automatically correlates and appends associated features, mapped test suites, governing ADRs, and knowledge facts referencing this file.
212
+
213
+ ### 4. `check_mcp_health`
214
+ - **Description:** Diagnose DevWorkspace MCP server readiness, workspace detection, knowledge freshness, verification contract, and agent configuration integrity.
215
+ - **Input Schema:**
216
+ - `check_integrations` (optional boolean): Inspect external integrations.
217
+ - **Returns:**
218
+ - Server protocol readiness (`MCP 2024-11-05`, Node version, devworkspace version).
219
+ - Workspace detection and health state.
220
+ - Knowledge base freshness: total facts, fresh vs. stale count, list of stale items.
221
+ - Verification contract: configured checks and required commands.
222
+ - Agent configuration status: checks `.mcp.json`, `CLAUDE.md`, `mcp.json`, `AGENTS.md`, `.antigravity/mcp.json`, and `.antigravity/rules`, verifying configuration presence and balanced `<!-- devworkspace-mcp:start -->` instruction markers.
223
+ - Actionable remediations: numbered, copy-pasteable commands to fix any detected issues.
224
+
225
+ ### 5. `explain_context`
226
+ - **Description:** Explain the deterministic retrieval logic, matched query evidence, domain synonyms, role slicing, and selection reasons behind task-context retrieval.
227
+ - **Input Schema:**
228
+ - `task` (required string): Natural-language description of the task to explain.
229
+ - `role` (optional enum: `"explorer"`, `"tester"`, `"reviewer"`).
230
+ - **Returns:**
231
+ - Request classification (task type, confidence, read-only status).
232
+ - Query analysis: extracted keywords, expanded stems, and matched domain synonym clusters.
233
+ - Identified package scope (e.g. backend vs frontend isolation).
234
+ - Selected context evidence: explicit inclusion reason for every fact, check, ADR, and document.
235
+ - Omissions and slicing rationale: why checks or documents were omitted for the active role slice, and folded detector aliases.
236
+ - Retrieval counts and efficiency percentage.
237
+
238
+ ### 6. `trace_symbol_dependencies`
239
+ - **Description:** Trace symbol call hierarchies, imports, definitions, and relationships in the codebase using the project knowledge graph.
240
+ - **Input Schema:**
241
+ - `symbol` (required string): Symbol name, file path, or node identifier to trace (e.g. `"InvoiceService"`, `"calculateTax"`, `"src/services/invoice.ts"`).
242
+ - `depth` (optional integer): Traversal depth between 1 and 5 (default 2).
243
+ - **Returns:**
244
+ - Root matched node with verification status against the filesystem (`[VERIFIED]` or `[HYPOTHESIS]`).
245
+ - Connected dependency nodes bounded to 50 nodes max, sorted deterministically by depth.
246
+ - Directed relationship edges (e.g. `src/app.ts --[imports]--> src/routes/auth.ts`).
247
+ - Actionable guidance when the graph is missing or when the symbol is not found.
248
+
249
+ ---
250
+
251
+ ## 9. What the Agent Can and Cannot Access
168
252
 
169
253
  ### What the agent CAN access:
170
254
  - **Project architecture summary:** Detected languages, web/UI frameworks, package structure, and health state.
171
255
  - **Task context:** Facts, verification commands (`commands.json`), architectural decision records (`.devworkspace/decisions/`), and safety rules.
172
- - **Specific source files:** Regular files within the project root, bounded to 32KB per call.
256
+ - **Specific source files & line ranges:** Regular files within the project root, bounded to 32KB per call, or specific line-numbered ranges.
257
+ - **Dependency traces:** Call hierarchies, definitions, imports, and symbol relationships from the verified repository knowledge graph.
258
+ - **Health and diagnostics:** Stored knowledge freshness, verification contract status, and agent configuration integrity.
173
259
 
174
260
  ### What the agent CANNOT access:
175
261
  - **No arbitrary shell execution:** The MCP server contains zero execution tools. It cannot run commands, scripts, or package managers.
@@ -179,7 +265,7 @@ printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion
179
265
 
180
266
  ---
181
267
 
182
- ## 9. Secret Exclusions and Workspace Boundaries
268
+ ## 10. Secret Exclusions and Workspace Boundaries
183
269
 
184
270
  DevWorkspace enforces defense-in-depth security:
185
271
 
@@ -200,14 +286,14 @@ DevWorkspace enforces defense-in-depth security:
200
286
 
201
287
  ---
202
288
 
203
- ## 10. Privacy and External Data Transmission
289
+ ## 11. Privacy and External Data Transmission
204
290
 
205
291
  - **Local Execution:** DevWorkspace runs entirely on your local machine. It does not send telemetry, analytics, or file contents to any DevWorkspace server.
206
292
  - **AI Provider Notice:** When an AI coding agent calls DevWorkspace MCP tools, the retrieved context enters the agent's context window. Depending on your agent configuration and AI provider (e.g., Anthropic, OpenAI, Google), the agent will send this context to its cloud model.
207
293
 
208
294
  ---
209
295
 
210
- ## 11. Troubleshooting
296
+ ## 12. Troubleshooting
211
297
 
212
298
  | Issue | Cause | Resolution |
213
299
  | --- | --- | --- |
@@ -219,7 +305,7 @@ DevWorkspace enforces defense-in-depth security:
219
305
 
220
306
  ---
221
307
 
222
- ## 12. Uninstallation and Cleanup
308
+ ## 13. Uninstallation and Cleanup
223
309
 
224
310
  To remove DevWorkspace MCP configuration:
225
311
 
@@ -232,7 +318,7 @@ To remove DevWorkspace MCP configuration:
232
318
 
233
319
  ---
234
320
 
235
- ## 13. Known Client Limitations & PATH Requirements
321
+ ## 14. Known Client Limitations & PATH Requirements
236
322
 
237
323
  - **CLI PATH requirement:** The generated MCP configuration specifies `"command": "devworkspace"`, which requires `devworkspace` to be discoverable in the coding agent's executable `PATH` (for instance, via `npm install -g devworkspace` or having the package manager's bin folder in PATH).
238
324
  - If `devworkspace` is installed locally as a devDependency and not globally in PATH, adjust the agent configuration to use `npx`:
@@ -253,7 +339,7 @@ To remove DevWorkspace MCP configuration:
253
339
 
254
340
  ---
255
341
 
256
- ## 14. Manual Debugging
342
+ ## 15. Manual Debugging
257
343
 
258
344
  To run the MCP server with diagnostic debug logging to stderr:
259
345
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devworkspace",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Project-local AI engineering workspace: deterministic repository discovery, portable project knowledge, tasks, decisions and verification gates for AI coding agents.",
5
5
  "type": "module",
6
6
  "bin": {