@tyroneross/bookmark 0.1.0 → 0.3.2
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/.claude-plugin/marketplace.json +29 -12
- package/.claude-plugin/plugin.json +12 -8
- package/.codex-plugin/plugin.json +31 -0
- package/.mcp.json +8 -0
- package/CLAUDE.md +83 -49
- package/LICENSE +202 -21
- package/README.md +150 -57
- package/agents/snapshot-analyst.md +1 -1
- package/commands/bookmark.md +29 -0
- package/commands/feedback.md +37 -0
- package/commands/restore.md +14 -4
- package/commands/snapshot.md +19 -7
- package/commands/status.md +1 -1
- package/dist/cli/index.js +627 -87
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/snapshot-resolution.d.ts +15 -0
- package/dist/cli/snapshot-resolution.d.ts.map +1 -0
- package/dist/cli/snapshot-resolution.js +21 -0
- package/dist/cli/snapshot-resolution.js.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +149 -23
- package/dist/config.js.map +1 -1
- package/dist/context/freshness.d.ts +3 -0
- package/dist/context/freshness.d.ts.map +1 -0
- package/dist/context/freshness.js +29 -0
- package/dist/context/freshness.js.map +1 -0
- package/dist/context/handoff-prompt.d.ts +12 -0
- package/dist/context/handoff-prompt.d.ts.map +1 -0
- package/dist/context/handoff-prompt.js +29 -0
- package/dist/context/handoff-prompt.js.map +1 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +9 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +85 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +97 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +304 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/registry.d.ts +40 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +134 -0
- package/dist/registry.js.map +1 -0
- package/dist/restore/index.d.ts +13 -1
- package/dist/restore/index.d.ts.map +1 -1
- package/dist/restore/index.js +163 -43
- package/dist/restore/index.js.map +1 -1
- package/dist/setup/auto-setup.d.ts +8 -2
- package/dist/setup/auto-setup.d.ts.map +1 -1
- package/dist/setup/auto-setup.js +287 -67
- package/dist/setup/auto-setup.js.map +1 -1
- package/dist/setup/configure-hooks.d.ts +14 -3
- package/dist/setup/configure-hooks.d.ts.map +1 -1
- package/dist/setup/configure-hooks.js +156 -24
- package/dist/setup/configure-hooks.js.map +1 -1
- package/dist/snapshot/capture.d.ts +13 -9
- package/dist/snapshot/capture.d.ts.map +1 -1
- package/dist/snapshot/capture.js +42 -105
- package/dist/snapshot/capture.js.map +1 -1
- package/dist/snapshot/compress.d.ts +3 -3
- package/dist/snapshot/compress.d.ts.map +1 -1
- package/dist/snapshot/compress.js +35 -67
- package/dist/snapshot/compress.js.map +1 -1
- package/dist/snapshot/storage.d.ts +7 -0
- package/dist/snapshot/storage.d.ts.map +1 -1
- package/dist/snapshot/storage.js +31 -6
- package/dist/snapshot/storage.js.map +1 -1
- package/dist/threshold/state.d.ts +5 -0
- package/dist/threshold/state.d.ts.map +1 -1
- package/dist/threshold/state.js +28 -2
- package/dist/threshold/state.js.map +1 -1
- package/dist/threshold/token-usage.d.ts +29 -0
- package/dist/threshold/token-usage.d.ts.map +1 -0
- package/dist/threshold/token-usage.js +128 -0
- package/dist/threshold/token-usage.js.map +1 -0
- package/dist/trails/identity.d.ts +76 -0
- package/dist/trails/identity.d.ts.map +1 -0
- package/dist/trails/identity.js +117 -0
- package/dist/trails/identity.js.map +1 -0
- package/dist/trails/reader.d.ts +7 -0
- package/dist/trails/reader.d.ts.map +1 -0
- package/dist/trails/reader.js +22 -0
- package/dist/trails/reader.js.map +1 -0
- package/dist/trails/writer.d.ts +9 -0
- package/dist/trails/writer.d.ts.map +1 -0
- package/dist/trails/writer.js +110 -0
- package/dist/trails/writer.js.map +1 -0
- package/dist/transcript/extractor.d.ts +17 -4
- package/dist/transcript/extractor.d.ts.map +1 -1
- package/dist/transcript/extractor.js +141 -174
- package/dist/transcript/extractor.js.map +1 -1
- package/dist/transcript/parser.d.ts.map +1 -1
- package/dist/transcript/parser.js +69 -7
- package/dist/transcript/parser.js.map +1 -1
- package/dist/types.d.ts +37 -38
- package/dist/types.d.ts.map +1 -1
- package/hooks/hooks.json +12 -14
- package/package.json +13 -10
- package/scripts/install-plugin.sh +48 -0
- package/skills/context-continuity/SKILL.md +43 -24
- package/commands/activate.md +0 -20
- package/dist/transcript/estimator.d.ts +0 -20
- package/dist/transcript/estimator.d.ts.map +0 -1
- package/dist/transcript/estimator.js +0 -95
- package/dist/transcript/estimator.js.map +0 -1
|
@@ -1,45 +1,76 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, realpathSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
const BOOKMARK_HOOKS = {
|
|
4
|
-
|
|
4
|
+
Stop: {
|
|
5
5
|
matcher: '',
|
|
6
6
|
hooks: [{
|
|
7
7
|
type: 'command',
|
|
8
|
-
command:
|
|
9
|
-
timeout:
|
|
10
|
-
async: true,
|
|
8
|
+
command: `npx @tyroneross/bookmark stop 2>/dev/null || echo '{"decision": "approve"}'`,
|
|
9
|
+
timeout: 10000,
|
|
11
10
|
}],
|
|
12
11
|
},
|
|
13
|
-
|
|
12
|
+
PreCompact: {
|
|
14
13
|
matcher: '',
|
|
15
14
|
hooks: [{
|
|
16
15
|
type: 'command',
|
|
17
|
-
command:
|
|
18
|
-
timeout:
|
|
16
|
+
command: `npx @tyroneross/bookmark precompact 2>/dev/null || echo '{}'`,
|
|
17
|
+
timeout: 10000,
|
|
19
18
|
}],
|
|
20
19
|
},
|
|
21
|
-
|
|
20
|
+
SessionStart: {
|
|
22
21
|
matcher: '',
|
|
23
22
|
hooks: [{
|
|
24
23
|
type: 'command',
|
|
25
|
-
command:
|
|
26
|
-
timeout:
|
|
27
|
-
async: true,
|
|
24
|
+
command: `npx @tyroneross/bookmark restore 2>/dev/null || echo '{}'`,
|
|
25
|
+
timeout: 5000,
|
|
28
26
|
}],
|
|
29
27
|
},
|
|
30
|
-
|
|
28
|
+
UserPromptSubmit: {
|
|
31
29
|
matcher: '',
|
|
32
30
|
hooks: [{
|
|
33
31
|
type: 'command',
|
|
34
|
-
command:
|
|
35
|
-
timeout:
|
|
32
|
+
command: `npx @tyroneross/bookmark context-check 2>/dev/null || echo '{}'`,
|
|
33
|
+
timeout: 10000,
|
|
36
34
|
}],
|
|
37
35
|
},
|
|
38
36
|
};
|
|
39
37
|
const BOOKMARK_MARKER = '@tyroneross/bookmark';
|
|
38
|
+
const BOOKMARK_PROMPT_MARKER = '.bookmark/bookmark.context.md';
|
|
39
|
+
/**
|
|
40
|
+
* Resolve the plugin path for the settings.json plugins array.
|
|
41
|
+
* Checks for local npm install first, then global symlink.
|
|
42
|
+
*/
|
|
43
|
+
function resolvePluginPath(cwd) {
|
|
44
|
+
// Check local npm install
|
|
45
|
+
const localPlugin = join(cwd, 'node_modules', '@tyroneross', 'bookmark', '.claude-plugin');
|
|
46
|
+
if (existsSync(localPlugin)) {
|
|
47
|
+
return 'node_modules/@tyroneross/bookmark/.claude-plugin';
|
|
48
|
+
}
|
|
49
|
+
// Check global symlink
|
|
50
|
+
const home = process.env.HOME || process.env.USERPROFILE || '';
|
|
51
|
+
if (home) {
|
|
52
|
+
const globalLink = join(home, '.claude', 'plugins', 'bookmark');
|
|
53
|
+
if (existsSync(globalLink)) {
|
|
54
|
+
try {
|
|
55
|
+
const resolved = realpathSync(globalLink);
|
|
56
|
+
return join(resolved, '.claude-plugin');
|
|
57
|
+
}
|
|
58
|
+
catch { /* fall through */ }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if a hook group contains a bookmark hook (command or prompt type).
|
|
65
|
+
*/
|
|
66
|
+
function isBookmarkHook(hookGroup) {
|
|
67
|
+
return hookGroup.hooks.some(hh => hh.command?.includes(BOOKMARK_MARKER) ||
|
|
68
|
+
hh.prompt?.includes(BOOKMARK_PROMPT_MARKER));
|
|
69
|
+
}
|
|
40
70
|
/**
|
|
41
|
-
* Configure hooks in the project's .claude/settings.json.
|
|
42
|
-
*
|
|
71
|
+
* Configure hooks and plugin registration in the project's .claude/settings.json.
|
|
72
|
+
* All hooks are command-type. One synchronous `context-check` hook handles
|
|
73
|
+
* interval capture and token alerts through a single state writer.
|
|
43
74
|
*/
|
|
44
75
|
export function configureHooks(cwd) {
|
|
45
76
|
const settingsDir = join(cwd, '.claude');
|
|
@@ -56,6 +87,18 @@ export function configureHooks(cwd) {
|
|
|
56
87
|
settings = {};
|
|
57
88
|
}
|
|
58
89
|
}
|
|
90
|
+
// ─── Plugin registration in settings.plugins ───
|
|
91
|
+
if (!settings.plugins) {
|
|
92
|
+
settings.plugins = [];
|
|
93
|
+
}
|
|
94
|
+
const pluginPath = resolvePluginPath(cwd);
|
|
95
|
+
if (pluginPath) {
|
|
96
|
+
const alreadyRegistered = settings.plugins.some(p => p.includes('bookmark'));
|
|
97
|
+
if (!alreadyRegistered) {
|
|
98
|
+
settings.plugins.push(pluginPath);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// ─── Hook configuration ───
|
|
59
102
|
if (!settings.hooks) {
|
|
60
103
|
settings.hooks = {};
|
|
61
104
|
}
|
|
@@ -63,19 +106,77 @@ export function configureHooks(cwd) {
|
|
|
63
106
|
if (!settings.hooks[event]) {
|
|
64
107
|
settings.hooks[event] = [];
|
|
65
108
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
109
|
+
const existingIdx = settings.hooks[event].findIndex(isBookmarkHook);
|
|
110
|
+
if (existingIdx === -1) {
|
|
111
|
+
// No existing bookmark hook — add the new one
|
|
69
112
|
settings.hooks[event].push(hookConfig);
|
|
70
113
|
}
|
|
114
|
+
else {
|
|
115
|
+
// Replace existing bookmark hook (upgrades old prompt hooks to command hooks)
|
|
116
|
+
settings.hooks[event][existingIdx] = hookConfig;
|
|
117
|
+
}
|
|
71
118
|
}
|
|
72
119
|
writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
|
|
73
120
|
}
|
|
74
121
|
/**
|
|
75
|
-
*
|
|
122
|
+
* Configure hooks in the GLOBAL ~/.claude/settings.json.
|
|
123
|
+
* This makes bookmark fire in every project without per-project setup.
|
|
124
|
+
* Merges with existing hooks — never overwrites user's other hooks.
|
|
76
125
|
*/
|
|
77
|
-
export function
|
|
78
|
-
const
|
|
126
|
+
export function configureGlobalHooks() {
|
|
127
|
+
const home = process.env.HOME || process.env.USERPROFILE || '';
|
|
128
|
+
if (!home)
|
|
129
|
+
return;
|
|
130
|
+
const settingsDir = join(home, '.claude');
|
|
131
|
+
const settingsPath = join(settingsDir, 'settings.json');
|
|
132
|
+
if (!existsSync(settingsDir)) {
|
|
133
|
+
mkdirSync(settingsDir, { recursive: true });
|
|
134
|
+
}
|
|
135
|
+
let settings = {};
|
|
136
|
+
if (existsSync(settingsPath)) {
|
|
137
|
+
try {
|
|
138
|
+
settings = JSON.parse(readFileSync(settingsPath, 'utf-8'));
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
settings = {};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (!settings.hooks) {
|
|
145
|
+
settings.hooks = {};
|
|
146
|
+
}
|
|
147
|
+
let changed = false;
|
|
148
|
+
for (const [event, hookConfig] of Object.entries(BOOKMARK_HOOKS)) {
|
|
149
|
+
if (!settings.hooks[event]) {
|
|
150
|
+
settings.hooks[event] = [];
|
|
151
|
+
}
|
|
152
|
+
const existingIdx = settings.hooks[event].findIndex(isBookmarkHook);
|
|
153
|
+
if (existingIdx === -1) {
|
|
154
|
+
// No existing bookmark hook — append (don't replace user's other hooks)
|
|
155
|
+
settings.hooks[event].push(hookConfig);
|
|
156
|
+
changed = true;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
// Update existing bookmark hook in place
|
|
160
|
+
const existing = JSON.stringify(settings.hooks[event][existingIdx]);
|
|
161
|
+
const updated = JSON.stringify(hookConfig);
|
|
162
|
+
if (existing !== updated) {
|
|
163
|
+
settings.hooks[event][existingIdx] = hookConfig;
|
|
164
|
+
changed = true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (changed) {
|
|
169
|
+
writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Remove bookmark hooks from the GLOBAL ~/.claude/settings.json.
|
|
174
|
+
*/
|
|
175
|
+
export function removeGlobalHooks() {
|
|
176
|
+
const home = process.env.HOME || process.env.USERPROFILE || '';
|
|
177
|
+
if (!home)
|
|
178
|
+
return;
|
|
179
|
+
const settingsPath = join(home, '.claude', 'settings.json');
|
|
79
180
|
if (!existsSync(settingsPath))
|
|
80
181
|
return;
|
|
81
182
|
try {
|
|
@@ -83,7 +184,7 @@ export function removeHooks(cwd) {
|
|
|
83
184
|
if (!settings.hooks)
|
|
84
185
|
return;
|
|
85
186
|
for (const event of Object.keys(settings.hooks)) {
|
|
86
|
-
settings.hooks[event] = settings.hooks[event].filter(h => !h
|
|
187
|
+
settings.hooks[event] = settings.hooks[event].filter(h => !isBookmarkHook(h));
|
|
87
188
|
if (settings.hooks[event].length === 0) {
|
|
88
189
|
delete settings.hooks[event];
|
|
89
190
|
}
|
|
@@ -94,4 +195,35 @@ export function removeHooks(cwd) {
|
|
|
94
195
|
// Silent
|
|
95
196
|
}
|
|
96
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Remove bookmark hooks and plugin entry from a project's settings.json.
|
|
200
|
+
*/
|
|
201
|
+
export function removeHooks(cwd) {
|
|
202
|
+
const settingsPath = join(cwd, '.claude', 'settings.json');
|
|
203
|
+
if (!existsSync(settingsPath))
|
|
204
|
+
return;
|
|
205
|
+
try {
|
|
206
|
+
const settings = JSON.parse(readFileSync(settingsPath, 'utf-8'));
|
|
207
|
+
// Remove from plugins array
|
|
208
|
+
if (settings.plugins) {
|
|
209
|
+
settings.plugins = settings.plugins.filter(p => !p.includes('bookmark'));
|
|
210
|
+
if (settings.plugins.length === 0) {
|
|
211
|
+
delete settings.plugins;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// Remove hooks (both command and prompt types)
|
|
215
|
+
if (settings.hooks) {
|
|
216
|
+
for (const event of Object.keys(settings.hooks)) {
|
|
217
|
+
settings.hooks[event] = settings.hooks[event].filter(h => !isBookmarkHook(h));
|
|
218
|
+
if (settings.hooks[event].length === 0) {
|
|
219
|
+
delete settings.hooks[event];
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
// Silent
|
|
227
|
+
}
|
|
228
|
+
}
|
|
97
229
|
//# sourceMappingURL=configure-hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-hooks.js","sourceRoot":"","sources":["../../src/setup/configure-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"configure-hooks.js","sourceRoot":"","sources":["../../src/setup/configure-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqBjC,MAAM,cAAc,GAAiC;IACnD,IAAI,EAAE;QACJ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C,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAChD,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9E,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACvC,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC/B,CAAC;YACH,CAAC;QACH,CAAC;QAED,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;AACH,CAAC"}
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import type { Snapshot, SnapshotTrigger } from '../types.js';
|
|
2
|
+
import type { ContextUsage } from '../threshold/token-usage.js';
|
|
2
3
|
export interface CaptureOptions {
|
|
3
4
|
trigger: SnapshotTrigger;
|
|
4
5
|
transcriptPath: string;
|
|
5
6
|
cwd: string;
|
|
6
7
|
sessionId?: string;
|
|
7
|
-
|
|
8
|
+
contextUsage?: ContextUsage;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Snapshot capture pipeline (v0.3 — file tracking only):
|
|
11
12
|
* 1. Parse transcript
|
|
12
|
-
* 2.
|
|
13
|
-
* 3.
|
|
14
|
-
* 4.
|
|
15
|
-
* 5.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
13
|
+
* 2. Extract file changes + tool usage (the parts that actually work)
|
|
14
|
+
* 3. Build snapshot object
|
|
15
|
+
* 4. Store snapshot JSON + write LATEST.md + trail files
|
|
16
|
+
* 5. Update state
|
|
17
|
+
*
|
|
18
|
+
* Intent, decisions, and progress are NOT extracted from transcripts —
|
|
19
|
+
* regex can't do semantic extraction reliably. Instead, Claude writes
|
|
20
|
+
* bookmark.context.md directly after the token hook requests a handoff or the
|
|
21
|
+
* Stop hook blocks for one.
|
|
22
|
+
* This pipeline provides supplementary file tracking data.
|
|
19
23
|
*/
|
|
20
24
|
export declare function captureSnapshot(options: CaptureOptions): Promise<Snapshot>;
|
|
21
25
|
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/snapshot/capture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/snapshot/capture.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,eAAe,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,CAwDhF"}
|
package/dist/snapshot/capture.js
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
1
2
|
import { parseTranscript } from '../transcript/parser.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { storeSnapshot, writeLatestMd, loadLatestSnapshot } from './storage.js';
|
|
3
|
+
import { extractFilesAndTools } from '../transcript/extractor.js';
|
|
4
|
+
import { storeSnapshot, writeLatestMd, loadLatestSnapshot, getSnapshotsDir, generateSnapshotId } from './storage.js';
|
|
5
5
|
import { compressToMarkdown } from './compress.js';
|
|
6
|
-
import {
|
|
6
|
+
import { writeTrails } from '../trails/writer.js';
|
|
7
|
+
import { loadState, saveState, updateSnapshotTime, incrementSnapshotCount } from '../threshold/state.js';
|
|
7
8
|
import { loadConfig, getStoragePath } from '../config.js';
|
|
9
|
+
import { appendToRegistry } from '../registry.js';
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
11
|
+
* Snapshot capture pipeline (v0.3 — file tracking only):
|
|
10
12
|
* 1. Parse transcript
|
|
11
|
-
* 2.
|
|
12
|
-
* 3.
|
|
13
|
-
* 4.
|
|
14
|
-
* 5.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* 2. Extract file changes + tool usage (the parts that actually work)
|
|
14
|
+
* 3. Build snapshot object
|
|
15
|
+
* 4. Store snapshot JSON + write LATEST.md + trail files
|
|
16
|
+
* 5. Update state
|
|
17
|
+
*
|
|
18
|
+
* Intent, decisions, and progress are NOT extracted from transcripts —
|
|
19
|
+
* regex can't do semantic extraction reliably. Instead, Claude writes
|
|
20
|
+
* bookmark.context.md directly after the token hook requests a handoff or the
|
|
21
|
+
* Stop hook blocks for one.
|
|
22
|
+
* This pipeline provides supplementary file tracking data.
|
|
18
23
|
*/
|
|
19
24
|
export async function captureSnapshot(options) {
|
|
20
25
|
const config = loadConfig(options.cwd);
|
|
@@ -22,18 +27,10 @@ export async function captureSnapshot(options) {
|
|
|
22
27
|
const state = loadState(storagePath);
|
|
23
28
|
// 1. Parse transcript
|
|
24
29
|
const { entries } = parseTranscript(options.transcriptPath);
|
|
25
|
-
// 2.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
// 3. Extract structured content
|
|
31
|
-
let extraction = extractFromEntries(entries);
|
|
32
|
-
// 4. Optional LLM enhancement
|
|
33
|
-
if (options.smart ?? config.smartDefault) {
|
|
34
|
-
extraction = await enhanceWithLLM(extraction, entries);
|
|
35
|
-
}
|
|
36
|
-
// 5. Build snapshot
|
|
30
|
+
// 2. Extract file changes + tool usage only (working parts of extractor)
|
|
31
|
+
// Intent, decisions, and progress are NOT extracted — Claude writes the handoff.
|
|
32
|
+
const extraction = extractFilesAndTools(entries, { projectPath: options.cwd });
|
|
33
|
+
// 3. Build snapshot
|
|
37
34
|
const snapshotId = generateSnapshotId();
|
|
38
35
|
const priorSnapshot = loadLatestSnapshot(storagePath);
|
|
39
36
|
const snapshot = {
|
|
@@ -43,92 +40,32 @@ export async function captureSnapshot(options) {
|
|
|
43
40
|
project_path: options.cwd,
|
|
44
41
|
trigger: options.trigger,
|
|
45
42
|
compaction_cycle: state.compaction_count,
|
|
46
|
-
context_remaining_pct: estimate.remaining_pct,
|
|
47
|
-
token_estimate: estimate.total_tokens,
|
|
48
|
-
current_status: extraction.current_status,
|
|
49
|
-
decisions: extraction.decisions,
|
|
50
|
-
open_items: extraction.open_items,
|
|
51
|
-
unknowns: extraction.unknowns,
|
|
52
43
|
files_changed: extraction.files_changed,
|
|
53
|
-
errors_encountered: extraction.errors_encountered,
|
|
54
44
|
tools_summary: extraction.tools_summary,
|
|
55
45
|
prior_snapshot_id: priorSnapshot?.snapshot_id,
|
|
46
|
+
context_remaining_pct: options.contextUsage?.remainingFraction,
|
|
47
|
+
context_used_pct: options.contextUsage?.usedFraction,
|
|
48
|
+
token_estimate: options.contextUsage?.usedTokens,
|
|
49
|
+
context_limit_tokens: options.contextUsage?.contextLimitTokens,
|
|
50
|
+
model: options.contextUsage?.model,
|
|
56
51
|
};
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
// 4. Skip empty snapshots — don't write JSON/index for 0-file non-manual captures
|
|
53
|
+
// This prevents accumulation of empty session_end snapshots
|
|
54
|
+
const hasContent = snapshot.files_changed.length > 0 ||
|
|
55
|
+
snapshot.trigger === 'manual' ||
|
|
56
|
+
snapshot.trigger === 'token_threshold';
|
|
57
|
+
if (hasContent) {
|
|
58
|
+
storeSnapshot(storagePath, snapshot);
|
|
59
|
+
const markdown = compressToMarkdown(snapshot);
|
|
60
|
+
writeLatestMd(storagePath, markdown);
|
|
61
|
+
writeTrails(storagePath, snapshot);
|
|
62
|
+
const canonicalFile = join(getSnapshotsDir(storagePath), `${snapshot.snapshot_id}.json`);
|
|
63
|
+
appendToRegistry(snapshot, canonicalFile);
|
|
64
|
+
}
|
|
65
|
+
// 6. Update state + increment snapshot counter
|
|
63
66
|
const updatedState = updateSnapshotTime(state);
|
|
64
|
-
|
|
67
|
+
const finalState = incrementSnapshotCount(updatedState);
|
|
68
|
+
saveState(storagePath, finalState);
|
|
65
69
|
return snapshot;
|
|
66
70
|
}
|
|
67
|
-
function generateSnapshotId() {
|
|
68
|
-
const now = new Date();
|
|
69
|
-
const pad = (n, len = 2) => String(n).padStart(len, '0');
|
|
70
|
-
const date = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}`;
|
|
71
|
-
const time = `${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
|
72
|
-
return `SNAP_${date}_${time}`;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Enhance extraction with Claude Haiku for higher-quality summaries.
|
|
76
|
-
* Falls back to original extraction if SDK not available or API key missing.
|
|
77
|
-
*/
|
|
78
|
-
async function enhanceWithLLM(extraction, entries) {
|
|
79
|
-
const apiKey = process.env.ANTHROPIC_API_KEY;
|
|
80
|
-
if (!apiKey)
|
|
81
|
-
return extraction;
|
|
82
|
-
try {
|
|
83
|
-
// Dynamic import — @anthropic-ai/sdk is an optional dependency
|
|
84
|
-
const { default: Anthropic } = await import('@anthropic-ai/sdk');
|
|
85
|
-
const client = new Anthropic({ apiKey });
|
|
86
|
-
// Build a compressed transcript excerpt (last ~2000 tokens worth)
|
|
87
|
-
const recentEntries = entries.slice(-50); // Last 50 entries
|
|
88
|
-
const transcript = recentEntries
|
|
89
|
-
.filter(e => e.type === 'assistant' || e.type === 'user')
|
|
90
|
-
.map(e => `[${e.type}]: ${typeof e.content === 'string' ? e.content.slice(0, 200) : ''}`)
|
|
91
|
-
.join('\n')
|
|
92
|
-
.slice(-4000);
|
|
93
|
-
const response = await client.messages.create({
|
|
94
|
-
model: 'claude-haiku-4-5-20251001',
|
|
95
|
-
max_tokens: 1000,
|
|
96
|
-
messages: [{
|
|
97
|
-
role: 'user',
|
|
98
|
-
content: `Analyze this coding session transcript and extract:
|
|
99
|
-
1. Key decisions made (with brief rationale)
|
|
100
|
-
2. Current status (1-2 sentences)
|
|
101
|
-
3. Open items/TODOs (with priority: high/medium/low)
|
|
102
|
-
4. Unknowns or blockers
|
|
103
|
-
|
|
104
|
-
Transcript excerpt:
|
|
105
|
-
${transcript}
|
|
106
|
-
|
|
107
|
-
Respond in JSON format:
|
|
108
|
-
{
|
|
109
|
-
"current_status": "...",
|
|
110
|
-
"decisions": [{"description": "...", "rationale": "..."}],
|
|
111
|
-
"open_items": [{"description": "...", "priority": "high|medium|low"}],
|
|
112
|
-
"unknowns": ["..."]
|
|
113
|
-
}`,
|
|
114
|
-
}],
|
|
115
|
-
});
|
|
116
|
-
const text = response.content[0]?.type === 'text' ? response.content[0].text : '';
|
|
117
|
-
const jsonMatch = text.match(/\{[\s\S]*\}/);
|
|
118
|
-
if (jsonMatch) {
|
|
119
|
-
const enhanced = JSON.parse(jsonMatch[0]);
|
|
120
|
-
return {
|
|
121
|
-
...extraction,
|
|
122
|
-
current_status: enhanced.current_status ?? extraction.current_status,
|
|
123
|
-
decisions: enhanced.decisions?.length ? enhanced.decisions : extraction.decisions,
|
|
124
|
-
open_items: enhanced.open_items?.length ? enhanced.open_items : extraction.open_items,
|
|
125
|
-
unknowns: enhanced.unknowns?.length ? enhanced.unknowns : extraction.unknowns,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch {
|
|
130
|
-
// Fall back silently to pattern-based extraction
|
|
131
|
-
}
|
|
132
|
-
return extraction;
|
|
133
|
-
}
|
|
134
71
|
//# sourceMappingURL=capture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/snapshot/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/snapshot/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrH,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYlD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAuB;IAC3D,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IAErC,sBAAsB;IACtB,MAAM,EAAE,OAA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,MAAM,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC9C,aAAa,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACrC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QAEnC,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,GAAG,QAAQ,CAAC,WAAW,OAAO,CAAC,CAAC;QACzF,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC5C,CAAC;IAED,+CAA+C;IAC/C,MAAM,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,sBAAsB,CAAC,YAAY,CAAC,CAAC;IACxD,SAAS,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAEnC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Snapshot } from '../types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Compress a
|
|
4
|
-
*
|
|
5
|
-
* This becomes LATEST.md —
|
|
3
|
+
* Compress a snapshot into markdown — now focused on file tracking data only.
|
|
4
|
+
* Intent/decisions/progress come from Claude-written bookmark.context.md, not this.
|
|
5
|
+
* This becomes LATEST.md — supplementary file change data.
|
|
6
6
|
*/
|
|
7
7
|
export declare function compressToMarkdown(snapshot: Snapshot): string;
|
|
8
8
|
//# sourceMappingURL=compress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress.d.ts","sourceRoot":"","sources":["../../src/snapshot/compress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"compress.d.ts","sourceRoot":"","sources":["../../src/snapshot/compress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CA6C7D"}
|