@jigyasudham/veto 3.3.0 → 3.5.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 +89 -7
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +1 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/agents/llm-runner.d.ts.map +1 -1
- package/dist/agents/llm-runner.js +78 -8
- package/dist/agents/llm-runner.js.map +1 -1
- package/dist/cli/context-guidance.d.ts +16 -0
- package/dist/cli/context-guidance.d.ts.map +1 -0
- package/dist/cli/context-guidance.js +20 -0
- package/dist/cli/context-guidance.js.map +1 -0
- package/dist/cli/leftover-guides.d.ts +38 -0
- package/dist/cli/leftover-guides.d.ts.map +1 -0
- package/dist/cli/leftover-guides.js +135 -0
- package/dist/cli/leftover-guides.js.map +1 -0
- package/dist/cli/lessons.d.ts +17 -0
- package/dist/cli/lessons.d.ts.map +1 -0
- package/dist/cli/lessons.js +448 -0
- package/dist/cli/lessons.js.map +1 -0
- package/dist/cli/statusline-hosts.d.ts +36 -0
- package/dist/cli/statusline-hosts.d.ts.map +1 -0
- package/dist/cli/statusline-hosts.js +212 -0
- package/dist/cli/statusline-hosts.js.map +1 -0
- package/dist/cli/statusline.d.ts +7 -0
- package/dist/cli/statusline.d.ts.map +1 -1
- package/dist/cli/statusline.js +69 -11
- package/dist/cli/statusline.js.map +1 -1
- package/dist/cli.js +114 -47
- package/dist/cli.js.map +1 -1
- package/dist/council/llm-council.d.ts.map +1 -1
- package/dist/council/llm-council.js +13 -8
- package/dist/council/llm-council.js.map +1 -1
- package/dist/lessons/adapters/claude.d.ts +10 -0
- package/dist/lessons/adapters/claude.d.ts.map +1 -0
- package/dist/lessons/adapters/claude.js +18 -0
- package/dist/lessons/adapters/claude.js.map +1 -0
- package/dist/lessons/adapters/codex.d.ts +7 -0
- package/dist/lessons/adapters/codex.d.ts.map +1 -0
- package/dist/lessons/adapters/codex.js +9 -0
- package/dist/lessons/adapters/codex.js.map +1 -0
- package/dist/lessons/adapters/gemini.d.ts +4 -0
- package/dist/lessons/adapters/gemini.d.ts.map +1 -0
- package/dist/lessons/adapters/gemini.js +44 -0
- package/dist/lessons/adapters/gemini.js.map +1 -0
- package/dist/lessons/adapters/index.d.ts +6 -0
- package/dist/lessons/adapters/index.d.ts.map +1 -0
- package/dist/lessons/adapters/index.js +14 -0
- package/dist/lessons/adapters/index.js.map +1 -0
- package/dist/lessons/adapters/markdown.d.ts +16 -0
- package/dist/lessons/adapters/markdown.d.ts.map +1 -0
- package/dist/lessons/adapters/markdown.js +130 -0
- package/dist/lessons/adapters/markdown.js.map +1 -0
- package/dist/lessons/adapters/types.d.ts +27 -0
- package/dist/lessons/adapters/types.d.ts.map +1 -0
- package/dist/lessons/adapters/types.js +2 -0
- package/dist/lessons/adapters/types.js.map +1 -0
- package/dist/lessons/classify.d.ts +33 -0
- package/dist/lessons/classify.d.ts.map +1 -0
- package/dist/lessons/classify.js +108 -0
- package/dist/lessons/classify.js.map +1 -0
- package/dist/lessons/consent.d.ts +30 -0
- package/dist/lessons/consent.d.ts.map +1 -0
- package/dist/lessons/consent.js +86 -0
- package/dist/lessons/consent.js.map +1 -0
- package/dist/lessons/discover.d.ts +26 -0
- package/dist/lessons/discover.d.ts.map +1 -0
- package/dist/lessons/discover.js +65 -0
- package/dist/lessons/discover.js.map +1 -0
- package/dist/lessons/harvest.d.ts +84 -0
- package/dist/lessons/harvest.d.ts.map +1 -0
- package/dist/lessons/harvest.js +271 -0
- package/dist/lessons/harvest.js.map +1 -0
- package/dist/lessons/identity.d.ts +23 -0
- package/dist/lessons/identity.d.ts.map +1 -0
- package/dist/lessons/identity.js +81 -0
- package/dist/lessons/identity.js.map +1 -0
- package/dist/lessons/manage.d.ts +163 -0
- package/dist/lessons/manage.d.ts.map +1 -0
- package/dist/lessons/manage.js +337 -0
- package/dist/lessons/manage.js.map +1 -0
- package/dist/lessons/mask.d.ts +6 -0
- package/dist/lessons/mask.d.ts.map +1 -0
- package/dist/lessons/mask.js +22 -0
- package/dist/lessons/mask.js.map +1 -0
- package/dist/lessons/on-save.d.ts +18 -0
- package/dist/lessons/on-save.d.ts.map +1 -0
- package/dist/lessons/on-save.js +53 -0
- package/dist/lessons/on-save.js.map +1 -0
- package/dist/lessons/select.d.ts +23 -0
- package/dist/lessons/select.d.ts.map +1 -0
- package/dist/lessons/select.js +136 -0
- package/dist/lessons/select.js.map +1 -0
- package/dist/lessons/source-project.d.ts +9 -0
- package/dist/lessons/source-project.d.ts.map +1 -0
- package/dist/lessons/source-project.js +149 -0
- package/dist/lessons/source-project.js.map +1 -0
- package/dist/lessons/store.d.ts +135 -0
- package/dist/lessons/store.d.ts.map +1 -0
- package/dist/lessons/store.js +222 -0
- package/dist/lessons/store.js.map +1 -0
- package/dist/memory/config.d.ts +27 -0
- package/dist/memory/config.d.ts.map +1 -1
- package/dist/memory/config.js +67 -0
- package/dist/memory/config.js.map +1 -1
- package/dist/memory/local.d.ts.map +1 -1
- package/dist/memory/local.js +19 -1
- package/dist/memory/local.js.map +1 -1
- package/dist/memory/schema.d.ts +1 -1
- package/dist/memory/schema.d.ts.map +1 -1
- package/dist/memory/schema.js +104 -0
- package/dist/memory/schema.js.map +1 -1
- package/dist/server/handlers/council.d.ts.map +1 -1
- package/dist/server/handlers/council.js +40 -4
- package/dist/server/handlers/council.js.map +1 -1
- package/dist/server/handlers/memory.d.ts.map +1 -1
- package/dist/server/handlers/memory.js +13 -3
- package/dist/server/handlers/memory.js.map +1 -1
- package/dist/server/handlers/session.d.ts.map +1 -1
- package/dist/server/handlers/session.js +61 -21
- package/dist/server/handlers/session.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +12 -3
- package/dist/server.js.map +1 -1
- package/dist/transcripts/cache.d.ts +1 -0
- package/dist/transcripts/cache.d.ts.map +1 -1
- package/dist/transcripts/cache.js +0 -0
- package/dist/transcripts/cache.js.map +1 -1
- package/dist/transcripts/claude-paths.d.ts +5 -0
- package/dist/transcripts/claude-paths.d.ts.map +1 -0
- package/dist/transcripts/claude-paths.js +21 -0
- package/dist/transcripts/claude-paths.js.map +1 -0
- package/dist/transcripts/context.d.ts +41 -0
- package/dist/transcripts/context.d.ts.map +1 -0
- package/dist/transcripts/context.js +144 -0
- package/dist/transcripts/context.js.map +1 -0
- package/dist/transcripts/discover.d.ts +12 -2
- package/dist/transcripts/discover.d.ts.map +1 -1
- package/dist/transcripts/discover.js +55 -7
- package/dist/transcripts/discover.js.map +1 -1
- package/dist/transcripts/manage.d.ts +8 -0
- package/dist/transcripts/manage.d.ts.map +1 -1
- package/dist/transcripts/manage.js +28 -13
- package/dist/transcripts/manage.js.map +1 -1
- package/dist/transcripts/mapping.d.ts.map +1 -1
- package/dist/transcripts/mapping.js +4 -2
- package/dist/transcripts/mapping.js.map +1 -1
- package/dist/transcripts/on-save.d.ts +9 -0
- package/dist/transcripts/on-save.d.ts.map +1 -1
- package/dist/transcripts/on-save.js +36 -9
- package/dist/transcripts/on-save.js.map +1 -1
- package/dist/transcripts/project-key.d.ts +4 -0
- package/dist/transcripts/project-key.d.ts.map +1 -0
- package/dist/transcripts/project-key.js +30 -0
- package/dist/transcripts/project-key.js.map +1 -0
- package/dist/transcripts/recall.d.ts +4 -0
- package/dist/transcripts/recall.d.ts.map +1 -1
- package/dist/transcripts/recall.js +6 -5
- package/dist/transcripts/recall.js.map +1 -1
- package/dist/transcripts/stopwords.d.ts +2 -0
- package/dist/transcripts/stopwords.d.ts.map +1 -0
- package/dist/transcripts/stopwords.js +8 -0
- package/dist/transcripts/stopwords.js.map +1 -0
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-save.js","sourceRoot":"","sources":["../../src/lessons/on-save.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,EAAE;AACF,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,qBAAqB;AACrB,EAAE;AACF,8EAA8E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Selection = {
|
|
3
|
+
lessonIds: string[];
|
|
4
|
+
estimatedTokens: number;
|
|
5
|
+
targetProjectIdentity: string | null;
|
|
6
|
+
reason: 'selected' | 'no_match' | 'consent_off' | 'project_excluded';
|
|
7
|
+
};
|
|
8
|
+
/** Rough, model-agnostic: about four characters per token. */
|
|
9
|
+
export declare const estimateTokens: (text: string) => number;
|
|
10
|
+
/** Deterministic, non-delivering selection used only for prospective shadow logs. */
|
|
11
|
+
export declare function selectLessonsForShadow(input: {
|
|
12
|
+
query: string;
|
|
13
|
+
targetProjectDir: string;
|
|
14
|
+
targetHost: LessonSource;
|
|
15
|
+
now?: number;
|
|
16
|
+
}): ShadowSelection;
|
|
17
|
+
/** Append-only prospective evidence. It records IDs and metadata, never delivery. */
|
|
18
|
+
export declare function logShadowSelection(input: {
|
|
19
|
+
query: string;
|
|
20
|
+
targetHost: LessonSource;
|
|
21
|
+
selection: ShadowSelection;
|
|
22
|
+
}): string;
|
|
23
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/lessons/select.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAcxD,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,kBAAkB,CAAC;CACtE,CAAC;AAIF,8DAA8D;AAC9D,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,MAAoC,CAAC;AA2DnF,qFAAqF;AACrF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,YAAY,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CA+ClJ;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAAE,GAAG,MAAM,CAOzH"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { basename, dirname } from 'node:path';
|
|
3
|
+
import { getDb } from '../memory/local.js';
|
|
4
|
+
import { tokenize } from '../transcripts/tokenize.js';
|
|
5
|
+
import { STOPWORDS } from '../transcripts/stopwords.js';
|
|
6
|
+
import { isLessonsSharingEnabled } from '../memory/config.js';
|
|
7
|
+
import { resolveProjectIdentity } from './identity.js';
|
|
8
|
+
import { claudeProjectSlug, sameClaudeSlug } from './source-project.js';
|
|
9
|
+
import { disabledLessonSources, isProjectExcluded, lessonEntryKey } from './store.js';
|
|
10
|
+
const K1 = 1.2;
|
|
11
|
+
const B = 0.75;
|
|
12
|
+
const TOKEN_CAP = 500;
|
|
13
|
+
// A note must share at least this many distinct query terms: one common word
|
|
14
|
+
// in common ("code", "user") is coincidence, not relevance.
|
|
15
|
+
const MIN_MATCHED_TERMS = 2;
|
|
16
|
+
const STATUS_TTL_MS = 7 * 24 * 60 * 60 * 1000;
|
|
17
|
+
const STATUS_TITLE_RE = /\b(status|progress|next steps?|todo|wip|in progress)\b/i;
|
|
18
|
+
const title = (row) => row.text_masked.split('\n', 1)[0].trim();
|
|
19
|
+
/** Rough, model-agnostic: about four characters per token. */
|
|
20
|
+
export const estimateTokens = (text) => Math.ceil(text.length / 4);
|
|
21
|
+
/**
|
|
22
|
+
* The host already has this note in context, so re-injecting it only spends
|
|
23
|
+
* the budget. Claude loads the memory folder of the project it runs in; Codex
|
|
24
|
+
* and Gemini load their global file in every session. A Claude note from the
|
|
25
|
+
* SAME project but another checkout's folder (D: vs F:) is not loaded, and is
|
|
26
|
+
* exactly what sharing is for.
|
|
27
|
+
*/
|
|
28
|
+
function nativelyLoaded(row, host, projectDir) {
|
|
29
|
+
if (row.source_cli !== host)
|
|
30
|
+
return false;
|
|
31
|
+
if (host !== 'claude')
|
|
32
|
+
return true;
|
|
33
|
+
return sameClaudeSlug(basename(dirname(dirname(row.source_path))), claudeProjectSlug(projectDir));
|
|
34
|
+
}
|
|
35
|
+
function staleStatus(row, now) {
|
|
36
|
+
return STATUS_TITLE_RE.test(title(row)) && now - Date.parse(row.source_mtime) > STATUS_TTL_MS;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Which rows may reach this project at all: its own project's notes (any
|
|
40
|
+
* scope, quarantined included, since they never leave the project), plus other
|
|
41
|
+
* projects' user/machine notes that are not quarantined.
|
|
42
|
+
*/
|
|
43
|
+
function eligible(row, targetIdentity) {
|
|
44
|
+
if (row.project_identity === targetIdentity)
|
|
45
|
+
return true;
|
|
46
|
+
return row.scope !== 'project' && row.quarantined === 0;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* BM25 of each candidate against the query. Collection statistics (document
|
|
50
|
+
* frequency, average length) come from the WHOLE lessons table: computed over
|
|
51
|
+
* the few eligible candidates they would make any shared word look rare.
|
|
52
|
+
*/
|
|
53
|
+
function rank(query, candidates, collection) {
|
|
54
|
+
// Scored on sub-tokens (recall), gated on whole words: `git-bash` expands to
|
|
55
|
+
// three terms but is one word, and one word must not clear the two-word bar.
|
|
56
|
+
const terms = [...new Set(tokenize(query).filter(term => !STOPWORDS.has(term)))];
|
|
57
|
+
const words = [...new Set(tokenize(query, false).filter(word => !STOPWORDS.has(word)))];
|
|
58
|
+
const docs = new Map(collection.map(row => [row.id, tokenize(row.text_masked)]));
|
|
59
|
+
const avg = [...docs.values()].reduce((sum, doc) => sum + doc.length, 0) / Math.max(docs.size, 1);
|
|
60
|
+
const df = new Map(terms.map(term => [term, [...docs.values()].filter(doc => doc.includes(term)).length]));
|
|
61
|
+
const needed = Math.min(MIN_MATCHED_TERMS, words.length);
|
|
62
|
+
return candidates.map(row => {
|
|
63
|
+
const doc = docs.get(row.id) ?? tokenize(row.text_masked);
|
|
64
|
+
const docWords = new Set(tokenize(row.text_masked, false));
|
|
65
|
+
const matched = words.filter(word => docWords.has(word)).length;
|
|
66
|
+
let score = 0;
|
|
67
|
+
for (const term of terms) {
|
|
68
|
+
const tf = doc.filter(token => token === term).length;
|
|
69
|
+
if (!tf)
|
|
70
|
+
continue;
|
|
71
|
+
const n = df.get(term) ?? 0;
|
|
72
|
+
const idf = Math.log(1 + (docs.size - n + 0.5) / (n + 0.5));
|
|
73
|
+
score += idf * (tf * (K1 + 1)) / (tf + K1 * (1 - B + B * (doc.length / Math.max(avg, 1))));
|
|
74
|
+
}
|
|
75
|
+
return { row, score: matched >= needed ? score : 0, matched };
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/** Deterministic, non-delivering selection used only for prospective shadow logs. */
|
|
79
|
+
export function selectLessonsForShadow(input) {
|
|
80
|
+
if (!isLessonsSharingEnabled())
|
|
81
|
+
return { lessonIds: [], estimatedTokens: 0, targetProjectIdentity: null, reason: 'consent_off' };
|
|
82
|
+
const targetIdentity = resolveProjectIdentity(input.targetProjectDir);
|
|
83
|
+
if (isProjectExcluded(targetIdentity))
|
|
84
|
+
return { lessonIds: [], estimatedTokens: 0, targetProjectIdentity: targetIdentity, reason: 'project_excluded' };
|
|
85
|
+
const now = input.now ?? Date.now();
|
|
86
|
+
const disabled = disabledLessonSources();
|
|
87
|
+
const all = getDb().prepare('SELECT * FROM lessons').all();
|
|
88
|
+
const candidates = all.filter(row => !disabled.has(row.source_cli)
|
|
89
|
+
&& !nativelyLoaded(row, input.targetHost, input.targetProjectDir)
|
|
90
|
+
&& !staleStatus(row, now)
|
|
91
|
+
&& eligible(row, targetIdentity));
|
|
92
|
+
// Relevance first, then newest source on ties; a note without enough query
|
|
93
|
+
// terms in common is not selected at all, however much budget is left.
|
|
94
|
+
const ranked = rank(input.query, candidates, all)
|
|
95
|
+
.filter(entry => entry.score > 0)
|
|
96
|
+
.sort((a, b) => b.score - a.score || Date.parse(b.row.source_mtime) - Date.parse(a.row.source_mtime) || a.row.id.localeCompare(b.row.id));
|
|
97
|
+
// Newest wins on conflict: the same entry held in several places (one memory
|
|
98
|
+
// file copied into the D:, F: and G: checkouts' folders) counts once, as its
|
|
99
|
+
// newest version, even when an older copy ranks higher. Identical text from
|
|
100
|
+
// different entries is served once too. Same-named files of two different
|
|
101
|
+
// projects are two entries.
|
|
102
|
+
const newestByEntry = new Map();
|
|
103
|
+
for (const row of candidates) {
|
|
104
|
+
const held = newestByEntry.get(lessonEntryKey(row));
|
|
105
|
+
if (!held || Date.parse(row.source_mtime) > Date.parse(held.source_mtime))
|
|
106
|
+
newestByEntry.set(lessonEntryKey(row), row);
|
|
107
|
+
}
|
|
108
|
+
const chosen = [];
|
|
109
|
+
const seenText = new Set();
|
|
110
|
+
let tokens = 0;
|
|
111
|
+
for (const { row } of ranked) {
|
|
112
|
+
if (newestByEntry.get(lessonEntryKey(row)) !== row || seenText.has(row.text_masked))
|
|
113
|
+
continue;
|
|
114
|
+
const estimate = estimateTokens(row.text_masked);
|
|
115
|
+
if (tokens + estimate > TOKEN_CAP)
|
|
116
|
+
continue;
|
|
117
|
+
chosen.push(row);
|
|
118
|
+
seenText.add(row.text_masked);
|
|
119
|
+
tokens += estimate;
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
lessonIds: chosen.map(row => row.id),
|
|
123
|
+
estimatedTokens: tokens,
|
|
124
|
+
targetProjectIdentity: targetIdentity,
|
|
125
|
+
reason: chosen.length ? 'selected' : 'no_match',
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** Append-only prospective evidence. It records IDs and metadata, never delivery. */
|
|
129
|
+
export function logShadowSelection(input) {
|
|
130
|
+
const id = randomUUID();
|
|
131
|
+
getDb().prepare(`INSERT INTO lesson_shadow_log (id, query, target_project_identity, target_host, lesson_ids, estimated_tokens, reason, created_at)
|
|
132
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`)
|
|
133
|
+
.run(id, input.query, input.selection.targetProjectIdentity ?? '', input.targetHost, JSON.stringify(input.selection.lessonIds), input.selection.estimatedTokens, input.selection.reason, new Date().toISOString());
|
|
134
|
+
return id;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/lessons/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,cAAc,EAAkB,MAAM,YAAY,CAAC;AAEtG,MAAM,EAAE,GAAG,GAAG,CAAC;AACf,MAAM,CAAC,GAAG,IAAI,CAAC;AACf,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,6EAA6E;AAC7E,4DAA4D;AAC5D,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC9C,MAAM,eAAe,GAAG,yDAAyD,CAAC;AASlF,MAAM,KAAK,GAAG,CAAC,GAAc,EAA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CAAC,CAAC;QACjB,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC9B,MAAM,IAAI,QAAQ,CAAC;IACrB,CAAC;IACD,OAAO;QACL,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QACpC,eAAe,EAAE,MAAM;QACvB,qBAAqB,EAAE,cAAc;QACrC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU;KAChD,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,kBAAkB,CAAC,KAA8E;IAC/G,MAAM,EAAE,GAAG,UAAU,EAAE,CAAC;IACxB,KAAK,EAAE,CAAC,OAAO,CAAC;oCACkB,CAAC;SAChC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,qBAAqB,IAAI,EAAE,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,EAC5H,KAAK,CAAC,SAAS,CAAC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IACvF,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { claudeProjectSlug, sameClaudeSlug } from '../transcripts/claude-paths.js';
|
|
2
|
+
export { claudeProjectSlug, sameClaudeSlug };
|
|
3
|
+
export type ClaudeFolderProject = {
|
|
4
|
+
projectDir: string | null;
|
|
5
|
+
via: 'transcript' | 'known' | 'walk' | 'unresolved';
|
|
6
|
+
};
|
|
7
|
+
/** Resolve a ~/.claude/projects/<slug> folder to the project directory it was created for. */
|
|
8
|
+
export declare function resolveClaudeProjectFolder(folder: string, slug: string): ClaudeFolderProject;
|
|
9
|
+
//# sourceMappingURL=source-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-project.d.ts","sourceRoot":"","sources":["../../src/lessons/source-project.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEnF,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC;AAqF7C,MAAM,MAAM,mBAAmB,GAAG;IAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAA;CAAE,CAAC;AAErH,8FAA8F;AAC9F,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAQ5F"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// Which project does a Claude memory folder belong to?
|
|
2
|
+
//
|
|
3
|
+
// Claude Code keeps a project's memory in ~/.claude/projects/<slug>/memory,
|
|
4
|
+
// where <slug> is the project's cwd with every non-alphanumeric character
|
|
5
|
+
// replaced by '-'. The slug is lossy (D:\a-b and D:\a\b share one), so it is
|
|
6
|
+
// reversed from evidence, most reliable first:
|
|
7
|
+
// 1. a transcript in the same folder recording its `cwd` (Claude deletes
|
|
8
|
+
// these after about 30 days, so many folders have none left);
|
|
9
|
+
// 2. a project directory Veto already knows about with the same slug;
|
|
10
|
+
// 3. a walk down from the drive or filesystem root, entering only folders
|
|
11
|
+
// whose own slug prefixes what is left. The walk is bounded, and more
|
|
12
|
+
// than one match counts as unresolved.
|
|
13
|
+
// Unresolved folders keep a slug identity that matches no other project.
|
|
14
|
+
import { closeSync, openSync, readdirSync, readSync, statSync } from 'node:fs';
|
|
15
|
+
import { join } from 'node:path';
|
|
16
|
+
import { getDb } from '../memory/local.js';
|
|
17
|
+
import { claudeProjectSlug, sameClaudeSlug } from '../transcripts/claude-paths.js';
|
|
18
|
+
export { claudeProjectSlug, sameClaudeSlug };
|
|
19
|
+
const HEAD_BYTES = 256 * 1024;
|
|
20
|
+
const TRANSCRIPTS_TO_TRY = 3;
|
|
21
|
+
const WALK_BUDGET = 400;
|
|
22
|
+
const WALK_DEPTH = 16;
|
|
23
|
+
const win32 = process.platform === 'win32';
|
|
24
|
+
function readHead(path) {
|
|
25
|
+
let fd = null;
|
|
26
|
+
try {
|
|
27
|
+
fd = openSync(path, 'r');
|
|
28
|
+
const buf = Buffer.allocUnsafe(HEAD_BYTES);
|
|
29
|
+
return buf.toString('utf8', 0, readSync(fd, buf, 0, HEAD_BYTES, 0));
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return '';
|
|
33
|
+
}
|
|
34
|
+
finally {
|
|
35
|
+
if (fd !== null) {
|
|
36
|
+
try {
|
|
37
|
+
closeSync(fd);
|
|
38
|
+
}
|
|
39
|
+
catch { /* ignore */ }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function cwdFromTranscripts(folder, slug) {
|
|
44
|
+
let names;
|
|
45
|
+
try {
|
|
46
|
+
names = readdirSync(folder).filter(name => name.endsWith('.jsonl'));
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const newest = names
|
|
52
|
+
.map(name => { try {
|
|
53
|
+
return { path: join(folder, name), mtime: statSync(join(folder, name)).mtimeMs };
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return null;
|
|
57
|
+
} })
|
|
58
|
+
.filter((entry) => entry !== null)
|
|
59
|
+
.sort((a, b) => b.mtime - a.mtime)
|
|
60
|
+
.slice(0, TRANSCRIPTS_TO_TRY);
|
|
61
|
+
for (const { path } of newest) {
|
|
62
|
+
for (const match of readHead(path).matchAll(/"cwd"\s*:\s*("(?:[^"\\]|\\.)*")/g)) {
|
|
63
|
+
try {
|
|
64
|
+
const cwd = JSON.parse(match[1]);
|
|
65
|
+
if (cwd && sameClaudeSlug(claudeProjectSlug(cwd), slug))
|
|
66
|
+
return cwd;
|
|
67
|
+
}
|
|
68
|
+
catch { /* a truncated field at the end of the head */ }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function cwdFromKnownProjects(slug) {
|
|
74
|
+
const db = getDb();
|
|
75
|
+
// Keyed case-folded on Windows so D:\Veto and d:\veto count once; the first
|
|
76
|
+
// spelling seen (sessions before the case-folded alias table) is kept.
|
|
77
|
+
const found = new Map();
|
|
78
|
+
for (const sql of [
|
|
79
|
+
'SELECT DISTINCT project_dir AS dir FROM sessions WHERE project_dir IS NOT NULL',
|
|
80
|
+
'SELECT alias_path AS dir FROM project_identity_aliases',
|
|
81
|
+
]) {
|
|
82
|
+
try {
|
|
83
|
+
for (const { dir } of db.prepare(sql).all()) {
|
|
84
|
+
const key = (win32 ? dir.toLowerCase() : dir).replace(/[\\/]+$/, '');
|
|
85
|
+
if (sameClaudeSlug(claudeProjectSlug(dir), slug) && !found.has(key))
|
|
86
|
+
found.set(key, dir);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch { /* table absent in an old database */ }
|
|
90
|
+
}
|
|
91
|
+
return found.size === 1 ? [...found.values()][0] : null;
|
|
92
|
+
}
|
|
93
|
+
function cwdFromWalk(slug) {
|
|
94
|
+
const drive = /^([A-Za-z])--(.*)$/.exec(slug);
|
|
95
|
+
let root;
|
|
96
|
+
let rest;
|
|
97
|
+
if (win32 && drive) {
|
|
98
|
+
root = `${drive[1]}:\\`;
|
|
99
|
+
rest = drive[2];
|
|
100
|
+
}
|
|
101
|
+
else if (!win32 && slug.startsWith('-')) {
|
|
102
|
+
root = '/';
|
|
103
|
+
rest = slug.slice(1);
|
|
104
|
+
}
|
|
105
|
+
else
|
|
106
|
+
return null;
|
|
107
|
+
const matches = [];
|
|
108
|
+
let budget = WALK_BUDGET;
|
|
109
|
+
const visit = (dir, remaining, depth) => {
|
|
110
|
+
if (matches.length > 1 || budget-- <= 0 || depth > WALK_DEPTH)
|
|
111
|
+
return;
|
|
112
|
+
let entries;
|
|
113
|
+
try {
|
|
114
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
for (const entry of entries) {
|
|
120
|
+
if (!entry.isDirectory() && !entry.isSymbolicLink())
|
|
121
|
+
continue;
|
|
122
|
+
const part = claudeProjectSlug(entry.name);
|
|
123
|
+
if (sameClaudeSlug(part, remaining)) {
|
|
124
|
+
matches.push(join(dir, entry.name));
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const prefix = `${part}-`;
|
|
128
|
+
if (sameClaudeSlug(remaining.slice(0, prefix.length), prefix))
|
|
129
|
+
visit(join(dir, entry.name), remaining.slice(prefix.length), depth + 1);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
if (rest)
|
|
133
|
+
visit(root, rest, 0);
|
|
134
|
+
return matches.length === 1 ? matches[0] : null;
|
|
135
|
+
}
|
|
136
|
+
/** Resolve a ~/.claude/projects/<slug> folder to the project directory it was created for. */
|
|
137
|
+
export function resolveClaudeProjectFolder(folder, slug) {
|
|
138
|
+
const fromTranscript = cwdFromTranscripts(folder, slug);
|
|
139
|
+
if (fromTranscript)
|
|
140
|
+
return { projectDir: fromTranscript, via: 'transcript' };
|
|
141
|
+
const known = cwdFromKnownProjects(slug);
|
|
142
|
+
if (known)
|
|
143
|
+
return { projectDir: known, via: 'known' };
|
|
144
|
+
const walked = cwdFromWalk(slug);
|
|
145
|
+
if (walked)
|
|
146
|
+
return { projectDir: walked, via: 'walk' };
|
|
147
|
+
return { projectDir: null, via: 'unresolved' };
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=source-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-project.js","sourceRoot":"","sources":["../../src/lessons/source-project.ts"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135 @@
|
|
|
1
|
+
import type { LessonSource } from './adapters/index.js';
|
|
2
|
+
import type { LessonScope, ScopeReason } from './classify.js';
|
|
3
|
+
export type LessonRow = {
|
|
4
|
+
id: string;
|
|
5
|
+
source_cli: LessonSource;
|
|
6
|
+
source_path: string;
|
|
7
|
+
section_anchor: string;
|
|
8
|
+
project_identity: string;
|
|
9
|
+
project_label: string | null;
|
|
10
|
+
scope: LessonScope;
|
|
11
|
+
scope_reason: ScopeReason | null;
|
|
12
|
+
kind: string;
|
|
13
|
+
text_masked: string;
|
|
14
|
+
source_hash: string;
|
|
15
|
+
source_mtime: string;
|
|
16
|
+
quarantined: number;
|
|
17
|
+
quarantine_reason: string | null;
|
|
18
|
+
created_at: string;
|
|
19
|
+
updated_at: string;
|
|
20
|
+
};
|
|
21
|
+
/** A section after masking and classification; raw memory text never reaches the store. */
|
|
22
|
+
export type HarvestedSection = {
|
|
23
|
+
anchor: string;
|
|
24
|
+
textMasked: string;
|
|
25
|
+
scope: LessonScope;
|
|
26
|
+
scopeReason: ScopeReason;
|
|
27
|
+
kind: string;
|
|
28
|
+
quarantineReason: string | null;
|
|
29
|
+
};
|
|
30
|
+
export type SyncLessonsInput = {
|
|
31
|
+
sourceCli: LessonSource;
|
|
32
|
+
sourcePath: string;
|
|
33
|
+
projectIdentity: string;
|
|
34
|
+
projectLabel: string | null;
|
|
35
|
+
sourceMtime: string;
|
|
36
|
+
sections: HarvestedSection[];
|
|
37
|
+
};
|
|
38
|
+
/** A note's text, compared the way a person would: case and spacing do not make it a different note. */
|
|
39
|
+
export declare function lessonSignature(textMasked: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* One memory entry wherever it is kept: the same file name and section in any
|
|
42
|
+
* checkout of the same project (the D:, F: and G: copies of one Claude memory
|
|
43
|
+
* folder) is one entry, held in several places.
|
|
44
|
+
*/
|
|
45
|
+
export declare function lessonEntryKey(row: {
|
|
46
|
+
source_cli: string;
|
|
47
|
+
project_identity: string;
|
|
48
|
+
source_path: string;
|
|
49
|
+
section_anchor: string;
|
|
50
|
+
}): string;
|
|
51
|
+
/**
|
|
52
|
+
* Tombstone a note and delete it with every version and copy of it. Each row
|
|
53
|
+
* removed gets a tombstone of its own, so a copy's later edits stay forgotten,
|
|
54
|
+
* and so does text identical to a copy (not only to the note picked). Returns
|
|
55
|
+
* how many rows were removed, the note itself included.
|
|
56
|
+
*/
|
|
57
|
+
export declare function tombstoneLesson(row: LessonRow): number;
|
|
58
|
+
export declare function isProjectExcluded(projectIdentity: string): boolean;
|
|
59
|
+
export type ProjectExclusion = {
|
|
60
|
+
project_identity: string;
|
|
61
|
+
project_label: string | null;
|
|
62
|
+
created_at: string;
|
|
63
|
+
};
|
|
64
|
+
export declare function excludedProjects(): ProjectExclusion[];
|
|
65
|
+
/** Keep a project out of sharing, and delete what was already harvested from it. */
|
|
66
|
+
export declare function excludeProject(projectIdentity: string, projectLabel: string | null): {
|
|
67
|
+
added: boolean;
|
|
68
|
+
removed: number;
|
|
69
|
+
};
|
|
70
|
+
export declare function includeProject(projectIdentity: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Make a source's rows exactly its current sections: insert new ones, update
|
|
73
|
+
* changed ones, delete the rest (lifetime = source). A source that failed to
|
|
74
|
+
* parse never reaches this function, so a malformed file cannot erase rows;
|
|
75
|
+
* an empty section list is a successful parse of nothing and clears them.
|
|
76
|
+
* A forgotten section counts as absent: it is deleted, never re-added.
|
|
77
|
+
*/
|
|
78
|
+
export declare function syncLessons(input: SyncLessonsInput): {
|
|
79
|
+
inserted: number;
|
|
80
|
+
updated: number;
|
|
81
|
+
removed: number;
|
|
82
|
+
};
|
|
83
|
+
/** Delete every row harvested from one source file. */
|
|
84
|
+
export declare function deleteLessonSource(source: LessonSource, sourcePath: string): number;
|
|
85
|
+
/** Delete every row whose source file is no longer among the discovered ones. */
|
|
86
|
+
export declare function purgeVanishedLessonSources(present: Array<{
|
|
87
|
+
source: LessonSource;
|
|
88
|
+
sourcePath: string;
|
|
89
|
+
}>): number;
|
|
90
|
+
export type LessonFileState = {
|
|
91
|
+
mtime: string | null;
|
|
92
|
+
size: number | null;
|
|
93
|
+
content_hash: string | null;
|
|
94
|
+
project_identity: string | null;
|
|
95
|
+
harvester_version: number;
|
|
96
|
+
unavailable_streak: number;
|
|
97
|
+
};
|
|
98
|
+
/** What this file looked like when it was last harvested, or null if never. */
|
|
99
|
+
export declare function lessonFileState(source: LessonSource, sourcePath: string): LessonFileState | null;
|
|
100
|
+
/** Remember a successful look at a file. Clears any unavailable streak. */
|
|
101
|
+
export declare function recordLessonFileState(input: {
|
|
102
|
+
source: LessonSource;
|
|
103
|
+
sourcePath: string;
|
|
104
|
+
mtime: string;
|
|
105
|
+
size: number;
|
|
106
|
+
contentHash: string;
|
|
107
|
+
projectIdentity: string;
|
|
108
|
+
harvesterVersion: number;
|
|
109
|
+
}): void;
|
|
110
|
+
/**
|
|
111
|
+
* A file that could not be read. The streak grows so a source that is gone —
|
|
112
|
+
* an unplugged drive, most often — is probed less and less on the save path,
|
|
113
|
+
* where a multi-second stat would be paid by the user for nothing.
|
|
114
|
+
*/
|
|
115
|
+
export declare function recordLessonFileUnavailable(source: LessonSource, sourcePath: string): number;
|
|
116
|
+
/** Drop remembered state for files no longer discovered, so it cannot outlive them. */
|
|
117
|
+
export declare function purgeVanishedLessonFileState(present: Array<{
|
|
118
|
+
source: LessonSource;
|
|
119
|
+
sourcePath: string;
|
|
120
|
+
}>): number;
|
|
121
|
+
/**
|
|
122
|
+
* Projects whose Claude folder was never traced back to a directory on this
|
|
123
|
+
* machine - an unplugged drive, most often. Counted from what is stored rather
|
|
124
|
+
* than from a pass, because a pass that changed nothing resolves no projects.
|
|
125
|
+
*/
|
|
126
|
+
export declare function unresolvedProjectCount(): number;
|
|
127
|
+
/** `veto lessons off` and a forced refresh both need the memory of files cleared. */
|
|
128
|
+
export declare function clearLessonFileState(): number;
|
|
129
|
+
export declare function enableLessonSource(source: LessonSource): boolean;
|
|
130
|
+
export declare function disableLessonSource(source: LessonSource, reason: string): void;
|
|
131
|
+
export declare function isLessonSourceEnabled(source: LessonSource): boolean;
|
|
132
|
+
/** Hosts whose adapter tripped the format-drift canary; their rows are not served. */
|
|
133
|
+
export declare function disabledLessonSources(): Set<LessonSource>;
|
|
134
|
+
export declare function disabledLessonSourceReasons(): Map<LessonSource, string>;
|
|
135
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/lessons/store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,YAAY,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,WAAW,CAAC;IACnB,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,2FAA2F;AAC3F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,MAAM,CAA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