ctxcarry 0.3.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/README.md +239 -0
- package/assets/ctxcarry-ascii.svg +39 -0
- package/dist/archive.js +19 -0
- package/dist/capture.js +250 -0
- package/dist/cli.js +213 -0
- package/dist/compile.js +152 -0
- package/dist/content-router.js +93 -0
- package/dist/distill.js +249 -0
- package/dist/git.js +65 -0
- package/dist/learn.js +30 -0
- package/dist/mcp-server.js +94 -0
- package/dist/paths.js +8 -0
- package/dist/redact.js +26 -0
- package/dist/store.js +175 -0
- package/dist/summarizers/openai.js +41 -0
- package/dist/tokens.js +14 -0
- package/dist/types.js +1 -0
- package/package.json +53 -0
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function estimateTokens(text) {
|
|
2
|
+
if (!text.trim()) {
|
|
3
|
+
return 0;
|
|
4
|
+
}
|
|
5
|
+
return Math.ceil(text.length / 4);
|
|
6
|
+
}
|
|
7
|
+
export function estimateSavings(rawText, packedText) {
|
|
8
|
+
const raw = estimateTokens(rawText);
|
|
9
|
+
const packed = estimateTokens(packedText);
|
|
10
|
+
if (raw === 0) {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
return Math.max(0, Math.round(((raw - packed) / raw) * 100));
|
|
14
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ctxcarry",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Portable project memory and handoff context for AI coding agents.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ctxcarry": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"assets",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.json",
|
|
16
|
+
"test": "pnpm run build && node --test tests/*.test.mjs",
|
|
17
|
+
"smoke": "pnpm run build && node dist/cli.js --help",
|
|
18
|
+
"bench": "pnpm run build && node --import tsx bench/report.ts",
|
|
19
|
+
"bench:compression": "pnpm run build && node --import tsx bench/compression.bench.ts",
|
|
20
|
+
"bench:recall": "pnpm run build && node --import tsx bench/recall.bench.ts",
|
|
21
|
+
"bench:e2e": "pnpm run build && node --import tsx bench/e2e.bench.ts",
|
|
22
|
+
"bench:real": "pnpm run build && node --import tsx bench/real-sessions.ts",
|
|
23
|
+
"bench:continuation": "pnpm run build && node --import tsx bench/continuation.ts"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"ai",
|
|
27
|
+
"coding-agents",
|
|
28
|
+
"ctxcarry",
|
|
29
|
+
"claude-code",
|
|
30
|
+
"codex",
|
|
31
|
+
"claude",
|
|
32
|
+
"context",
|
|
33
|
+
"agent-memory",
|
|
34
|
+
"developer-tools"
|
|
35
|
+
],
|
|
36
|
+
"homepage": "https://github.com/shouryasrivastava/ctxcarry#readme",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/shouryasrivastava/ctxcarry/issues"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/shouryasrivastava/ctxcarry.git"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=20"
|
|
46
|
+
},
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^20.17.0",
|
|
50
|
+
"tsx": "^4.20.0",
|
|
51
|
+
"typescript": "^5.5.0"
|
|
52
|
+
}
|
|
53
|
+
}
|