@log0u7/opencode-memory 0.2.0 → 0.4.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/CHANGELOG.md +104 -1
- package/README.md +36 -5
- package/dist/lib/db.d.ts.map +1 -1
- package/dist/lib/db.js +25 -2
- package/dist/lib/db.js.map +1 -1
- package/dist/lib/memory-ops.d.ts +58 -0
- package/dist/lib/memory-ops.d.ts.map +1 -0
- package/dist/lib/memory-ops.js +138 -0
- package/dist/lib/memory-ops.js.map +1 -0
- package/dist/lib/reflection.d.ts +27 -0
- package/dist/lib/reflection.d.ts.map +1 -0
- package/dist/lib/reflection.js +130 -0
- package/dist/lib/reflection.js.map +1 -0
- package/dist/lib/sqlite.d.ts.map +1 -1
- package/dist/lib/sqlite.js +5 -3
- package/dist/lib/sqlite.js.map +1 -1
- package/dist/lib/store.d.ts +49 -2
- package/dist/lib/store.d.ts.map +1 -1
- package/dist/lib/store.js +175 -24
- package/dist/lib/store.js.map +1 -1
- package/dist/plugin-v2.d.ts.map +1 -1
- package/dist/plugin-v2.js +135 -75
- package/dist/plugin-v2.js.map +1 -1
- package/dist/plugin.d.ts +8 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +143 -73
- package/dist/plugin.js.map +1 -1
- package/package.json +2 -2
package/dist/lib/sqlite.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
function createPreparedConn(db) {
|
|
2
3
|
return {
|
|
3
4
|
all(sql, params) {
|
|
@@ -46,9 +47,10 @@ export function openSqlite(path) {
|
|
|
46
47
|
if (globalRuntime.Bun) {
|
|
47
48
|
return createBunConn(new globalRuntime.Bun.sqlite.Database(path));
|
|
48
49
|
}
|
|
49
|
-
// node:sqlite ships with Node >= 22.5
|
|
50
|
-
//
|
|
51
|
-
const { DatabaseSync } =
|
|
50
|
+
// node:sqlite ships with Node >= 22.5. createRequire keeps the load lazy for
|
|
51
|
+
// runtimes without node:sqlite: a bare require is not defined in an ES module.
|
|
52
|
+
const { DatabaseSync } = nodeRequire("node:sqlite");
|
|
52
53
|
return createPreparedConn(new DatabaseSync(path));
|
|
53
54
|
}
|
|
55
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
54
56
|
//# sourceMappingURL=sqlite.js.map
|
package/dist/lib/sqlite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.js","sourceRoot":"","sources":["../../src/lib/sqlite.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sqlite.js","sourceRoot":"","sources":["../../src/lib/sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgC5C,SAAS,kBAAkB,CAAC,EAAsB;IAChD,OAAO;QACL,GAAG,CAAc,GAAW,EAAE,MAAkB;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAQ,CAAC;QAC5C,CAAC;QACD,GAAG,CAAc,GAAW,EAAE,MAAkB;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC7B,OAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAmB,IAAI,IAAI,CAAC;QAChE,CAAC;QACD,GAAG,CAAC,GAAW,EAAE,MAAkB;YACjC,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,GAAW;YACd,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QACD,KAAK;YACH,EAA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AC"}
|
package/dist/lib/store.d.ts
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
import type { MemoryDb } from "./db.js";
|
|
2
2
|
import type { Entry, EntryInput } from "../types/entry.js";
|
|
3
|
+
export declare const TAG_MAX = 64;
|
|
4
|
+
export declare const KIND_MAX = 64;
|
|
5
|
+
/** Hard ceiling on how many entries one read can return, whatever the caller asks. */
|
|
6
|
+
export declare const MAX_LIMIT = 50;
|
|
7
|
+
/** A rendered body is a preview, never the full text: it bounds a tool result. */
|
|
8
|
+
export declare const BODY_PREVIEW_MAX = 500;
|
|
9
|
+
export declare const DEFAULT_LIMIT: {
|
|
10
|
+
search: number;
|
|
11
|
+
list: number;
|
|
12
|
+
};
|
|
13
|
+
/** Scope used when no worktree and no directory is known, so rows stay addressable. */
|
|
14
|
+
export declare const FALLBACK_SCOPE = "/";
|
|
3
15
|
export declare class SecretDetectedError extends Error {
|
|
4
16
|
constructor();
|
|
5
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* One canonical scope string for one location. Callers hand in a worktree, a
|
|
20
|
+
* directory, or both, so an entry written by either plugin entry point is found
|
|
21
|
+
* by the other.
|
|
22
|
+
*/
|
|
23
|
+
export declare function canonicalScope(...candidates: Array<string | undefined>): string;
|
|
24
|
+
/** A model-supplied limit is untrusted: SQLite reads a negative LIMIT as unbounded,
|
|
25
|
+
* so anything below one falls back to the default, and anything above the store
|
|
26
|
+
* ceiling is clamped. */
|
|
27
|
+
export declare function clampLimit(requested: number | undefined, fallback: number): number;
|
|
28
|
+
/**
|
|
29
|
+
* Model-facing rendering of a result set. Compact JSON and truncated bodies keep a
|
|
30
|
+
* tool result inside a known size regardless of how much is stored.
|
|
31
|
+
*/
|
|
32
|
+
export declare function renderEntries(entries: Entry[]): string;
|
|
33
|
+
export declare function sweep(db: MemoryDb, options?: {
|
|
34
|
+
now?: number;
|
|
35
|
+
}): number;
|
|
6
36
|
export declare function save(db: MemoryDb, input: EntryInput, options?: {
|
|
7
37
|
now?: number;
|
|
8
38
|
}): Entry;
|
|
@@ -16,10 +46,27 @@ export declare function list(db: MemoryDb, query: {
|
|
|
16
46
|
scope: string;
|
|
17
47
|
limit?: number;
|
|
18
48
|
now?: number;
|
|
49
|
+
kind?: string;
|
|
19
50
|
}): Entry[];
|
|
20
|
-
export
|
|
51
|
+
export type ForgetTarget = {
|
|
52
|
+
scope: string;
|
|
53
|
+
} & ({
|
|
21
54
|
id: string;
|
|
22
55
|
} | {
|
|
23
56
|
query: string;
|
|
24
|
-
})
|
|
57
|
+
});
|
|
58
|
+
/** Counts by kind for one scope plus `global`, expired entries excluded. */
|
|
59
|
+
export declare function stats(db: MemoryDb, query: {
|
|
60
|
+
scope: string;
|
|
61
|
+
now?: number;
|
|
62
|
+
}): Array<{
|
|
63
|
+
kind: string;
|
|
64
|
+
count: number;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Query deletes stay inside one scope (plus the shared `global` scope): a fuzzy match
|
|
68
|
+
* must never silently hit other projects' entries. Id deletes are machine-wide because
|
|
69
|
+
* the id is globally unique: closed worktrees stay cleanable from any project.
|
|
70
|
+
*/
|
|
71
|
+
export declare function forget(db: MemoryDb, target: ForgetTarget): number;
|
|
25
72
|
//# sourceMappingURL=store.d.ts.map
|
package/dist/lib/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/lib/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/lib/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,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AAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACpE,KAAK,EAAE,CAgBT;AAED,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEpF,4EAA4E;AAC5E,wBAAgB,KAAK,CACnB,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACrC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CASxC;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAqBjE"}
|
package/dist/lib/store.js
CHANGED
|
@@ -2,10 +2,27 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
const TITLE_MAX = 120;
|
|
3
3
|
const BODY_MAX = 8000;
|
|
4
4
|
const TAGS_MAX = 12;
|
|
5
|
+
export const TAG_MAX = 64;
|
|
6
|
+
export const KIND_MAX = 64;
|
|
7
|
+
/** Hard ceiling on how many entries one read can return, whatever the caller asks. */
|
|
8
|
+
export const MAX_LIMIT = 50;
|
|
9
|
+
/** A rendered body is a preview, never the full text: it bounds a tool result. */
|
|
10
|
+
export const BODY_PREVIEW_MAX = 500;
|
|
11
|
+
export const DEFAULT_LIMIT = { search: 10, list: 20 };
|
|
12
|
+
/** Scope used when no worktree and no directory is known, so rows stay addressable. */
|
|
13
|
+
export const FALLBACK_SCOPE = "/";
|
|
14
|
+
// High-confidence credential formats only: a generic "password =" rule would block
|
|
15
|
+
// ordinary prose. Extend with care, one false positive costs a legitimate save.
|
|
5
16
|
const SECRET_PATTERNS = [
|
|
6
|
-
/\bsk-[A-Za-z0-9_-]{20,}\b/,
|
|
7
|
-
/\bghp_[A-Za-z0-9]{30,}\b/,
|
|
8
|
-
/\bxoxb-\d{10,}-\d{10,}\b/,
|
|
17
|
+
/\bsk-[A-Za-z0-9_-]{20,}\b/, // OpenAI-style
|
|
18
|
+
/\bghp_[A-Za-z0-9]{30,}\b/, // GitHub PAT
|
|
19
|
+
/\bxoxb-\d{10,}-\d{10,}\b/, // Slack bot token
|
|
20
|
+
/\bxox[ap]-[0-9A-Za-z-]{10,}/, // Slack user / app token
|
|
21
|
+
/\bAKIA[0-9A-Z]{16}\b/, // AWS access key id
|
|
22
|
+
/\bglpat-[0-9A-Za-z_-]{20,}\b/, // GitLab PAT
|
|
23
|
+
/\bAIza[0-9A-Za-z_-]{35}/, // Google API key
|
|
24
|
+
/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/, // JWT
|
|
25
|
+
/-----BEGIN [A-Z ]*PRIVATE KEY-----/, // PEM private key block header
|
|
9
26
|
];
|
|
10
27
|
export class SecretDetectedError extends Error {
|
|
11
28
|
constructor() {
|
|
@@ -13,6 +30,18 @@ export class SecretDetectedError extends Error {
|
|
|
13
30
|
this.name = "SecretDetectedError";
|
|
14
31
|
}
|
|
15
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* One canonical scope string for one location. Callers hand in a worktree, a
|
|
35
|
+
* directory, or both, so an entry written by either plugin entry point is found
|
|
36
|
+
* by the other.
|
|
37
|
+
*/
|
|
38
|
+
export function canonicalScope(...candidates) {
|
|
39
|
+
const first = candidates.find((c) => typeof c === "string" && c.trim().length > 0);
|
|
40
|
+
if (first === undefined) {
|
|
41
|
+
return FALLBACK_SCOPE;
|
|
42
|
+
}
|
|
43
|
+
return first.trim().replace(/\/+$/, "") || FALLBACK_SCOPE;
|
|
44
|
+
}
|
|
16
45
|
function validateEntry(input) {
|
|
17
46
|
if (input.title.length === 0 || input.title.length > TITLE_MAX) {
|
|
18
47
|
throw new TypeError(`title must be 1..${TITLE_MAX} characters`);
|
|
@@ -20,20 +49,91 @@ function validateEntry(input) {
|
|
|
20
49
|
if (input.body.length > BODY_MAX) {
|
|
21
50
|
throw new TypeError(`body must be at most ${BODY_MAX} characters`);
|
|
22
51
|
}
|
|
52
|
+
if (input.kind.length === 0 || input.kind.length > KIND_MAX) {
|
|
53
|
+
throw new TypeError(`kind must be 1..${KIND_MAX} characters`);
|
|
54
|
+
}
|
|
23
55
|
if (input.tags.length > TAGS_MAX) {
|
|
24
56
|
throw new TypeError(`at most ${TAGS_MAX} tags allowed`);
|
|
25
57
|
}
|
|
26
|
-
|
|
58
|
+
// A tool result stays bounded, so a tag cannot smuggle an unbounded payload either.
|
|
59
|
+
if (input.tags.some((tag) => tag.length > TAG_MAX)) {
|
|
60
|
+
throw new TypeError(`each tag must be at most ${TAG_MAX} characters`);
|
|
61
|
+
}
|
|
62
|
+
if (SECRET_PATTERNS.some((pattern) => looksLikeSecret(input, pattern))) {
|
|
27
63
|
throw new SecretDetectedError();
|
|
28
64
|
}
|
|
29
65
|
}
|
|
66
|
+
function looksLikeSecret(input, pattern) {
|
|
67
|
+
if (pattern.test(input.title) || pattern.test(input.kind) || pattern.test(input.body)) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
return input.tags.some((t) => pattern.test(t));
|
|
71
|
+
}
|
|
72
|
+
/** A model-supplied limit is untrusted: SQLite reads a negative LIMIT as unbounded,
|
|
73
|
+
* so anything below one falls back to the default, and anything above the store
|
|
74
|
+
* ceiling is clamped. */
|
|
75
|
+
export function clampLimit(requested, fallback) {
|
|
76
|
+
if (requested === undefined || !Number.isFinite(requested) || requested < 1) {
|
|
77
|
+
return fallback;
|
|
78
|
+
}
|
|
79
|
+
return Math.min(Math.trunc(requested), MAX_LIMIT);
|
|
80
|
+
}
|
|
81
|
+
function previewBody(body) {
|
|
82
|
+
if (body.length <= BODY_PREVIEW_MAX) {
|
|
83
|
+
return body;
|
|
84
|
+
}
|
|
85
|
+
return `${body.slice(0, BODY_PREVIEW_MAX)}… [truncated]`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Model-facing rendering of a result set. Compact JSON and truncated bodies keep a
|
|
89
|
+
* tool result inside a known size regardless of how much is stored.
|
|
90
|
+
*/
|
|
91
|
+
export function renderEntries(entries) {
|
|
92
|
+
return JSON.stringify(entries.map((entry) => ({ ...entry, body: previewBody(entry.body) })));
|
|
93
|
+
}
|
|
94
|
+
export function sweep(db, options = {}) {
|
|
95
|
+
const now = options.now ?? Date.now();
|
|
96
|
+
db.conn.run("DELETE FROM entries WHERE expires_at IS NOT NULL AND expires_at <= ?", [now]);
|
|
97
|
+
return db.conn.get("SELECT changes() AS changes")?.changes ?? 0;
|
|
98
|
+
}
|
|
30
99
|
export function save(db, input, options = {}) {
|
|
31
100
|
validateEntry(input);
|
|
101
|
+
const scope = canonicalScope(input.scope);
|
|
32
102
|
const now = options.now ?? Date.now();
|
|
103
|
+
// Expired rows are dead weight in search, so drop them with the save.
|
|
104
|
+
sweep(db, { now });
|
|
105
|
+
// A repeated title in the same scope is the same knowledge: rewrite it instead of
|
|
106
|
+
// stacking duplicates.
|
|
107
|
+
// ponytail: SQLite lower() folds ASCII only, so a non-ASCII title re-saved in a
|
|
108
|
+
// different case is not deduped; and the read-then-write is not transactional, so two
|
|
109
|
+
// concurrent saves of the same title can both insert. Ceiling is a rare duplicate, not
|
|
110
|
+
// data loss. Upgrade path: a normalized key column plus BEGIN IMMEDIATE.
|
|
111
|
+
const existing = db.conn.get("SELECT id, created_at FROM entries WHERE scope = ? AND lower(trim(title)) = ?", [scope, input.title.trim().toLowerCase()]);
|
|
112
|
+
if (existing) {
|
|
113
|
+
db.conn.run("UPDATE entries SET kind = ?, body = ?, tags = ?, updated_at = ?, expires_at = ? WHERE id = ?", [
|
|
114
|
+
input.kind,
|
|
115
|
+
input.body,
|
|
116
|
+
JSON.stringify(input.tags),
|
|
117
|
+
now,
|
|
118
|
+
input.expires_at ?? null,
|
|
119
|
+
existing.id,
|
|
120
|
+
]);
|
|
121
|
+
return {
|
|
122
|
+
id: existing.id,
|
|
123
|
+
scope,
|
|
124
|
+
kind: input.kind,
|
|
125
|
+
title: input.title,
|
|
126
|
+
body: input.body,
|
|
127
|
+
tags: input.tags,
|
|
128
|
+
created_at: existing.created_at,
|
|
129
|
+
updated_at: now,
|
|
130
|
+
expires_at: input.expires_at,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
33
133
|
const id = randomUUID();
|
|
34
134
|
db.conn.run("INSERT INTO entries (id, scope, kind, title, body, tags, created_at, updated_at, expires_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", [
|
|
35
135
|
id,
|
|
36
|
-
|
|
136
|
+
scope,
|
|
37
137
|
input.kind,
|
|
38
138
|
input.title,
|
|
39
139
|
input.body,
|
|
@@ -44,7 +144,7 @@ export function save(db, input, options = {}) {
|
|
|
44
144
|
]);
|
|
45
145
|
return {
|
|
46
146
|
id,
|
|
47
|
-
scope
|
|
147
|
+
scope,
|
|
48
148
|
kind: input.kind,
|
|
49
149
|
title: input.title,
|
|
50
150
|
body: input.body,
|
|
@@ -55,34 +155,67 @@ export function save(db, input, options = {}) {
|
|
|
55
155
|
};
|
|
56
156
|
}
|
|
57
157
|
export function search(db, query) {
|
|
58
|
-
const
|
|
158
|
+
const scope = canonicalScope(query.scope);
|
|
159
|
+
const limit = clampLimit(query.limit, DEFAULT_LIMIT.search);
|
|
59
160
|
const now = query.now ?? Date.now();
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
AND (e.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
161
|
+
for (const match of searchCandidates(query.query)) {
|
|
162
|
+
const hits = db.conn
|
|
163
|
+
.all(`SELECT e.* FROM entries_fts JOIN entries e ON e.rowid = entries_fts.rowid
|
|
164
|
+
WHERE entries_fts MATCH ? AND (e.scope = ? OR e.scope = 'global')
|
|
165
|
+
AND (e.expires_at IS NULL OR e.expires_at > ?)
|
|
166
|
+
ORDER BY bm25(entries_fts) ASC, e.updated_at DESC
|
|
167
|
+
LIMIT ?`, [match, scope, now, limit])
|
|
168
|
+
.map(rowToEntry);
|
|
169
|
+
if (hits.length > 0) {
|
|
170
|
+
return hits;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return [];
|
|
67
174
|
}
|
|
68
175
|
export function list(db, query) {
|
|
69
|
-
const
|
|
176
|
+
const scope = canonicalScope(query.scope);
|
|
177
|
+
const limit = clampLimit(query.limit, DEFAULT_LIMIT.list);
|
|
70
178
|
const now = query.now ?? Date.now();
|
|
179
|
+
const kindFilter = query.kind === undefined ? "" : "AND kind = ? ";
|
|
180
|
+
const kindArgs = query.kind === undefined ? [] : [query.kind];
|
|
71
181
|
return db.conn
|
|
72
182
|
.all(`SELECT * FROM entries
|
|
73
|
-
WHERE (scope = ? OR scope = 'global') AND (expires_at IS NULL OR expires_at > ?)
|
|
183
|
+
WHERE (scope = ? OR scope = 'global') AND (expires_at IS NULL OR expires_at > ?) ${kindFilter}
|
|
74
184
|
ORDER BY updated_at DESC, id ASC
|
|
75
|
-
LIMIT ?`, [
|
|
185
|
+
LIMIT ?`, [scope, now, ...kindArgs, limit])
|
|
76
186
|
.map(rowToEntry);
|
|
77
187
|
}
|
|
188
|
+
/** Counts by kind for one scope plus `global`, expired entries excluded. */
|
|
189
|
+
export function stats(db, query) {
|
|
190
|
+
const scope = canonicalScope(query.scope);
|
|
191
|
+
const now = query.now ?? Date.now();
|
|
192
|
+
return db.conn.all(`SELECT kind, COUNT(*) AS count FROM entries
|
|
193
|
+
WHERE (scope = ? OR scope = 'global') AND (expires_at IS NULL OR expires_at > ?)
|
|
194
|
+
GROUP BY kind ORDER BY count DESC, kind ASC`, [scope, now]);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Query deletes stay inside one scope (plus the shared `global` scope): a fuzzy match
|
|
198
|
+
* must never silently hit other projects' entries. Id deletes are machine-wide because
|
|
199
|
+
* the id is globally unique: closed worktrees stay cleanable from any project.
|
|
200
|
+
*/
|
|
78
201
|
export function forget(db, target) {
|
|
79
202
|
if ("id" in target) {
|
|
80
203
|
db.conn.run("DELETE FROM entries WHERE id = ?", [target.id]);
|
|
81
|
-
return db
|
|
204
|
+
return changesOf(db);
|
|
205
|
+
}
|
|
206
|
+
const scope = canonicalScope(target.scope);
|
|
207
|
+
// Deleting is precision-first: only the strict all-token match, never the fuzzy
|
|
208
|
+
// fallback. A wrong read costs the model a retry, a wrong delete is unrecoverable.
|
|
209
|
+
const match = strictMatch(target.query);
|
|
210
|
+
if (match === null) {
|
|
211
|
+
return 0;
|
|
82
212
|
}
|
|
83
213
|
db.conn.run(`DELETE FROM entries WHERE id IN (
|
|
84
214
|
SELECT e.id FROM entries_fts JOIN entries e ON e.rowid = entries_fts.rowid WHERE entries_fts MATCH ?
|
|
85
|
-
)`, [
|
|
215
|
+
) AND (scope = ? OR scope = 'global')`, [match, scope]);
|
|
216
|
+
return changesOf(db);
|
|
217
|
+
}
|
|
218
|
+
function changesOf(db) {
|
|
86
219
|
return db.conn.get("SELECT changes() AS changes")?.changes ?? 0;
|
|
87
220
|
}
|
|
88
221
|
function rowToEntry(row) {
|
|
@@ -107,13 +240,31 @@ function parseTags(raw) {
|
|
|
107
240
|
return [];
|
|
108
241
|
}
|
|
109
242
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
243
|
+
/**
|
|
244
|
+
* FTS5 candidates, most precise first, each quoted so arbitrary model input stays a
|
|
245
|
+
* literal search. The strict AND match is tried before the looser prefix OR match:
|
|
246
|
+
* recall matters more than precision once the strict match found nothing.
|
|
247
|
+
*/
|
|
248
|
+
function searchCandidates(raw) {
|
|
249
|
+
const strict = strictMatch(raw);
|
|
250
|
+
const loose = prefixMatch(raw);
|
|
251
|
+
return [strict, loose].filter((candidate) => candidate !== null);
|
|
252
|
+
}
|
|
253
|
+
/** Every token must appear. Used alone by destructive paths, where a false positive
|
|
254
|
+
* cannot be undone. */
|
|
255
|
+
function strictMatch(raw) {
|
|
256
|
+
const tokens = tokenize(raw);
|
|
257
|
+
return tokens.length === 0 ? null : tokens.map((token) => `"${token}"`).join(" ");
|
|
258
|
+
}
|
|
259
|
+
/** Any token may match, each as a prefix. Read-only recall only. */
|
|
260
|
+
function prefixMatch(raw) {
|
|
261
|
+
const tokens = tokenize(raw);
|
|
262
|
+
return tokens.length === 0 ? null : tokens.map((token) => `"${token}" *`).join(" OR ");
|
|
263
|
+
}
|
|
264
|
+
function tokenize(raw) {
|
|
113
265
|
return raw
|
|
114
266
|
.split(/\s+/)
|
|
115
267
|
.filter(Boolean)
|
|
116
|
-
.map((token) =>
|
|
117
|
-
.join(" ");
|
|
268
|
+
.map((token) => token.replaceAll('"', ""));
|
|
118
269
|
}
|
|
119
270
|
//# sourceMappingURL=store.js.map
|
package/dist/lib/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/lib/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,QAAQ,GAAG,IAAI,CAAC;AACtB,MAAM,QAAQ,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/lib/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,QAAQ,GAAG,IAAI,CAAC;AACtB,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC;AAC1B,MAAM,CAAC,MAAM,QAAQ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,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
package/dist/plugin-v2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-v2.d.ts","sourceRoot":"","sources":["../src/plugin-v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-v2.d.ts","sourceRoot":"","sources":["../src/plugin-v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA6C1C,eAAO,MAAM,QAAQ,eA2NnB,CAAC"}
|