@dtoolkit/dcontext 0.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Iván Campillo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/ivncmp/dtoolkit/main/logo.png" alt="dtoolkit" />
3
+ </p>
4
+
5
+ <h1 align="center">@dtoolkit/dcontext</h1>
6
+ <p align="center">Tool cache + background compactor for AI coding agents</p>
7
+
8
+ <p align="center">
9
+ <a href="https://www.npmjs.com/package/@dtoolkit/dcontext"><img src="https://img.shields.io/npm/v/@dtoolkit/dcontext.svg" alt="npm"></a>
10
+ <a href="../../LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"></a>
11
+ </p>
12
+
13
+ > **Status:** not yet implemented
14
+
15
+ ## What it does
16
+
17
+ dcontext runs **locally** on the developer's machine and optimizes the agent's context window in real time:
18
+
19
+ - **Tool cache** — content-addressable cache of tool outputs to avoid redundant reads
20
+ - **Background compactor** — compresses context with a fast model (Haiku) while the dev thinks, eliminating the compaction pause
21
+ - **Context doctor** — detects and warns about context bloat before it impacts quality
22
+ - **Fact extraction** — extracts reusable knowledge during compaction and stores it in dbrain
23
+
24
+ ## Design
25
+
26
+ dcontext is **not** memory (that's dbrain) — it's a cache with TTL. It doesn't know the provider (that's dproxy) and doesn't format briefings (that's dprime).
27
+
28
+ ```bash
29
+ dproxy chat --context dcontext # enable context optimization
30
+ dproxy ask "x" --memory dbrain --context dcontext --prime . # full stack
31
+ ```
32
+
33
+ ## License
34
+
35
+ [MIT](../../LICENSE)
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export {};
2
+ // placeholder
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@dtoolkit/dcontext",
3
+ "version": "0.0.0",
4
+ "description": "Tool cache + background compactor for AI coding agents",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Iván Campillo <ivncmp@gmail.com>",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/ivncmp/dtoolkit.git",
11
+ "directory": "packages/dcontext"
12
+ },
13
+ "homepage": "https://github.com/ivncmp/dtoolkit/tree/main/packages/dcontext",
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "bin": {
18
+ "dcontext": "./dist/index.js"
19
+ },
20
+ "exports": {
21
+ ".": {
22
+ "import": "./dist/index.js",
23
+ "types": "./dist/index.d.ts"
24
+ }
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "engines": {
30
+ "node": ">=22"
31
+ },
32
+ "keywords": [
33
+ "ai",
34
+ "context",
35
+ "cache",
36
+ "compactor",
37
+ "dtoolkit"
38
+ ],
39
+ "dependencies": {
40
+ "@dtoolkit/core": "0.1.0"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^22.0.0",
44
+ "typescript": "^5.7.0"
45
+ },
46
+ "scripts": {
47
+ "build": "tsc",
48
+ "lint": "eslint src/",
49
+ "lint:fix": "eslint src/ --fix"
50
+ }
51
+ }