@dotdotgod/context 0.2.24 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -4
- package/package.json +2 -2
- package/src/server.mjs +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,129 @@
|
|
|
1
1
|
# @dotdotgod/context
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@dotdotgod/context) [](https://github.com/dotdotgod/dotdotgod-kit/tree/main/packages/context) [](https://github.com/dotdotgod/dotdotgod-kit/blob/main/LICENSE)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Local-first execution, ingestion, and retrieval runtime for dotdotgod adapters.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The package exposes a local stdio MCP server and reusable core modules. Claude Code and Codex start the server through their adapter packages. Pi calls the same core through native extension tools and does not start an MCP child. Only dotdotgod execution tools use the capture and indexing behavior described here; the adapters do not transparently intercept ordinary host Bash or shell tools.
|
|
8
|
+
|
|
9
|
+
## Tool Surface
|
|
8
10
|
|
|
9
11
|
- `execute`, `batch_execute`, `execute_file`
|
|
10
12
|
- `index`, `search`, `fetch_and_index`
|
|
11
13
|
- `stats`, `doctor`, `purge`
|
|
12
14
|
- `dotdotgod_project_load`, `dotdotgod_project_impact`, `dotdotgod_project_initialize`
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
Run the stdio MCP server directly with:
|
|
15
17
|
|
|
16
18
|
```bash
|
|
17
19
|
dotdotgod-context
|
|
18
20
|
```
|
|
21
|
+
|
|
22
|
+
The MCP server reserves stdout for JSON-RPC. Child stdout and stderr flow through private temporary files and are removed after the result has been bounded or indexed.
|
|
23
|
+
|
|
24
|
+
## Command Output
|
|
25
|
+
|
|
26
|
+
The dotdotgod execution tools support four output modes:
|
|
27
|
+
|
|
28
|
+
| Mode | Behavior |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `auto` | Returns bounded direct output when small and indexes larger output. |
|
|
31
|
+
| `direct` | Returns bounded stdout and stderr excerpts and reports truncation. |
|
|
32
|
+
| `indexed` | Indexes output and returns metadata instead of the raw streams. |
|
|
33
|
+
| `discard` | Returns status and metrics without stream content. |
|
|
34
|
+
|
|
35
|
+
Each command has one **10 MiB combined capture ceiling** shared by stdout and stderr. If either stream exceeds the remaining shared budget, the runtime terminates the process and reports `captureLimitExceeded`. A direct response is capped at **1 MiB per stream**, even if a caller requests more. Automatically indexed command output defaults to session scope and a 24-hour expiry.
|
|
36
|
+
|
|
37
|
+
`batch_execute` accepts up to 100 commands, uses concurrency from 1 through 8, and preserves input order. Execution and explicit shell mode remain write-capable operations subject to the host's approval model.
|
|
38
|
+
|
|
39
|
+
## Local Storage And Retrieval
|
|
40
|
+
|
|
41
|
+
Indexed content is stored in the project-local SQLite FTS5 database:
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
.dotdotgod/context/context.sqlite
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The store is local ignored state, not maintained project truth. Sources can use transient, session, or project scope and carry optional expiry metadata. Search applies scope, session, and source predicates before candidate fusion, then:
|
|
48
|
+
|
|
49
|
+
1. retrieves bounded Porter-tokenized FTS5 candidates;
|
|
50
|
+
2. retrieves bounded label/path candidates;
|
|
51
|
+
3. combines lists with reciprocal-rank fusion (RRF);
|
|
52
|
+
4. reranks deterministically using title, path, and term-proximity signals;
|
|
53
|
+
5. returns bounded excerpts with ranking and provenance evidence.
|
|
54
|
+
|
|
55
|
+
This is bounded indexing and retrieval, not LLM summarization. Search does not add execution output to the maintained documentation graph automatically.
|
|
56
|
+
|
|
57
|
+
## Structural Ingestion
|
|
58
|
+
|
|
59
|
+
Local `index` accepts one regular text file up to **25 MiB**. Directory ingestion is not supported.
|
|
60
|
+
|
|
61
|
+
- Markdown is split around headings, prose blocks, and fenced blocks while retaining heading and fence metadata.
|
|
62
|
+
- JSON is parsed into deterministic key-path chunks; invalid JSON falls back to bounded text chunks.
|
|
63
|
+
- Generic and legacy plain text keeps overlapping text chunks.
|
|
64
|
+
- Structural and fallback chunks enforce a UTF-8 byte ceiling.
|
|
65
|
+
|
|
66
|
+
Extractor and chunker versions make new and legacy records observable without a mandatory reindex or migration.
|
|
67
|
+
|
|
68
|
+
## Provenance And Instruction Boundary
|
|
69
|
+
|
|
70
|
+
The indexing operation owns security-sensitive provenance fields, so caller metadata cannot promote trust or spoof origin and content hashes. New records include source type, trust, origin, SHA-256 content hash, indexed time, extractor, and chunker version. Legacy or inconsistent records remain readable with `unknown` provenance instead of being rewritten.
|
|
71
|
+
|
|
72
|
+
Trust defaults include:
|
|
73
|
+
|
|
74
|
+
- project files: `project-maintained`;
|
|
75
|
+
- command output: `tool-output`;
|
|
76
|
+
- fetched URLs: `external-untrusted`.
|
|
77
|
+
|
|
78
|
+
Search results set `instructionAuthority: "none"` and the MCP response describes retrieved text as data with no authority to request tool calls, command execution, configuration changes, upgrades, or destructive confirmation. This non-authoritative rendering and provenance are defense in depth; they are not a guarantee that prompt injection is prevented.
|
|
79
|
+
|
|
80
|
+
## Strict URL Fetching
|
|
81
|
+
|
|
82
|
+
`fetch_and_index` accepts credential-free HTTP(S) URLs and indexes bounded text without returning the complete body. Both the wire response and decoded body have independent **10 MiB maximums**.
|
|
83
|
+
|
|
84
|
+
The application-level fetch policy:
|
|
85
|
+
|
|
86
|
+
- rejects URL credentials and non-HTTP(S) schemes;
|
|
87
|
+
- resolves and validates every DNS answer against private and reserved address policy;
|
|
88
|
+
- pins lookup to accepted addresses and rechecks the connected socket peer;
|
|
89
|
+
- manually revalidates every redirect, with at most five redirects by default;
|
|
90
|
+
- enforces timeout, declared length, wire-byte, and decoded-byte limits;
|
|
91
|
+
- supports identity, gzip, deflate, and Brotli encodings and rejects unsupported encodings;
|
|
92
|
+
- accepts bounded text-oriented MIME types and fails closed for unsupported types or HTTP statuses.
|
|
93
|
+
|
|
94
|
+
HTML is handled as bounded untrusted text; the package does not claim rich HTML extraction. These controls provide application-level URL and address validation, not a network namespace or process sandbox.
|
|
95
|
+
|
|
96
|
+
## Diagnostics And Deletion
|
|
97
|
+
|
|
98
|
+
`doctor` performs local, read-only checks for:
|
|
99
|
+
|
|
100
|
+
- the minimum Node.js runtime;
|
|
101
|
+
- project and storage-path readiness;
|
|
102
|
+
- SQLite FTS5 with the Porter tokenizer;
|
|
103
|
+
- compatibility of an existing context database schema;
|
|
104
|
+
- current store statistics when supplied;
|
|
105
|
+
- the configured strict fetch policy.
|
|
106
|
+
|
|
107
|
+
Doctor does not create the database, execute commands, contact npm or other networks, migrate schemas, repair configuration, or install upgrades.
|
|
108
|
+
|
|
109
|
+
`purge` permanently deletes indexed data only when `confirm: true` is supplied with exactly one selector: scope, session ID, or source ID.
|
|
110
|
+
|
|
111
|
+
## Project Workflow Boundaries
|
|
112
|
+
|
|
113
|
+
The MCP server also exposes bounded project load, graph impact, and initializer services. Project initialization defaults to dry-run and requires both `dryRun: false` and `confirmWrite: true` before writing.
|
|
114
|
+
|
|
115
|
+
Claude Code and Codex adapter hooks may tell the model to call these MCP tools and retry a denied operation. Hooks do not transform an ordinary host shell call into an MCP call. Pi retains its native project-memory lifecycle and calls the shared runtime directly.
|
|
116
|
+
|
|
117
|
+
## Learn More
|
|
118
|
+
|
|
119
|
+
- [Behavior specification](https://github.com/dotdotgod/dotdotgod-kit/blob/main/docs/spec/CONTEXT_EXECUTION.md)
|
|
120
|
+
- [Runtime architecture](https://github.com/dotdotgod/dotdotgod-kit/blob/main/docs/arch/CONTEXT_EXECUTION_ARCHITECTURE.md)
|
|
121
|
+
- [Verification strategy](https://github.com/dotdotgod/dotdotgod-kit/blob/main/docs/test/CONTEXT_EXECUTION.md)
|
|
122
|
+
- [Repository README](https://github.com/dotdotgod/dotdotgod-kit#readme)
|
|
123
|
+
|
|
124
|
+
## Local Development
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
pnpm --filter @dotdotgod/context verify
|
|
128
|
+
pnpm --filter @dotdotgod/context pack:dry-run
|
|
129
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotdotgod/context",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"description": "Local-first MCP execution, indexing, and retrieval runtime for dotdotgod adapters.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Elastic-2.0",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
30
30
|
"zod": "^3.25.76",
|
|
31
|
-
"@dotdotgod/cli": "0.2.
|
|
31
|
+
"@dotdotgod/cli": "0.2.25"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=22.5.0"
|
package/src/server.mjs
CHANGED
|
@@ -15,7 +15,7 @@ function getStore() {
|
|
|
15
15
|
contextStore ??= new ContextStore(root);
|
|
16
16
|
return contextStore;
|
|
17
17
|
}
|
|
18
|
-
const server = new McpServer({ name: 'dotdotgod-context', version: '0.2.
|
|
18
|
+
const server = new McpServer({ name: 'dotdotgod-context', version: '0.2.25' });
|
|
19
19
|
|
|
20
20
|
const scopeSchema = z.enum(['transient', 'session', 'project']).optional();
|
|
21
21
|
const outputModeSchema = z.enum(['auto', 'direct', 'indexed', 'discard']).optional();
|