context-mode 1.0.144 → 1.0.146
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 +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/README.md +1 -11
- package/build/adapters/base.d.ts +34 -0
- package/build/adapters/base.js +50 -2
- package/build/adapters/claude-code/index.js +9 -1
- package/build/adapters/codex/index.js +16 -2
- package/build/adapters/omp/plugin.js +34 -8
- package/build/adapters/openclaw/plugin.js +40 -8
- package/build/adapters/opencode/index.js +9 -2
- package/build/adapters/pi/extension.js +36 -8
- package/build/adapters/pi/mcp-bridge.js +58 -2
- package/build/adapters/vscode-copilot/index.js +11 -0
- package/build/store.js +17 -5
- package/cli.bundle.mjs +135 -135
- package/hooks/sessionstart.mjs +8 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server.bundle.mjs +97 -97
package/build/store.js
CHANGED
|
@@ -524,7 +524,7 @@ export class ContentStore {
|
|
|
524
524
|
highlight(chunks, 1, char(2), char(3)) AS highlighted
|
|
525
525
|
FROM chunks
|
|
526
526
|
JOIN sources ON sources.id = chunks.source_id
|
|
527
|
-
WHERE chunks MATCH ? AND sources.label LIKE ?
|
|
527
|
+
WHERE chunks MATCH ? AND sources.label LIKE ? ESCAPE '\\'
|
|
528
528
|
ORDER BY rank
|
|
529
529
|
LIMIT ?
|
|
530
530
|
`);
|
|
@@ -569,7 +569,7 @@ export class ContentStore {
|
|
|
569
569
|
highlight(chunks_trigram, 1, char(2), char(3)) AS highlighted
|
|
570
570
|
FROM chunks_trigram
|
|
571
571
|
JOIN sources ON sources.id = chunks_trigram.source_id
|
|
572
|
-
WHERE chunks_trigram MATCH ? AND sources.label LIKE ?
|
|
572
|
+
WHERE chunks_trigram MATCH ? AND sources.label LIKE ? ESCAPE '\\'
|
|
573
573
|
ORDER BY rank
|
|
574
574
|
LIMIT ?
|
|
575
575
|
`);
|
|
@@ -615,7 +615,7 @@ export class ContentStore {
|
|
|
615
615
|
highlight(chunks, 1, char(2), char(3)) AS highlighted
|
|
616
616
|
FROM chunks
|
|
617
617
|
JOIN sources ON sources.id = chunks.source_id
|
|
618
|
-
WHERE chunks MATCH ? AND sources.label LIKE ? AND chunks.content_type = ?
|
|
618
|
+
WHERE chunks MATCH ? AND sources.label LIKE ? ESCAPE '\\' AND chunks.content_type = ?
|
|
619
619
|
ORDER BY rank
|
|
620
620
|
LIMIT ?
|
|
621
621
|
`);
|
|
@@ -660,7 +660,7 @@ export class ContentStore {
|
|
|
660
660
|
highlight(chunks_trigram, 1, char(2), char(3)) AS highlighted
|
|
661
661
|
FROM chunks_trigram
|
|
662
662
|
JOIN sources ON sources.id = chunks_trigram.source_id
|
|
663
|
-
WHERE chunks_trigram MATCH ? AND sources.label LIKE ? AND chunks_trigram.content_type = ?
|
|
663
|
+
WHERE chunks_trigram MATCH ? AND sources.label LIKE ? ESCAPE '\\' AND chunks_trigram.content_type = ?
|
|
664
664
|
ORDER BY rank
|
|
665
665
|
LIMIT ?
|
|
666
666
|
`);
|
|
@@ -859,7 +859,19 @@ export class ContentStore {
|
|
|
859
859
|
}));
|
|
860
860
|
}
|
|
861
861
|
#sourceFilterParam(source, sourceMatchMode) {
|
|
862
|
-
|
|
862
|
+
if (sourceMatchMode === "exact")
|
|
863
|
+
return source;
|
|
864
|
+
// Escape SQLite LIKE metacharacters so user-supplied source labels
|
|
865
|
+
// containing `_`, `%`, or `\` are matched literally rather than as
|
|
866
|
+
// wildcards. Backslash must be replaced first (otherwise subsequent
|
|
867
|
+
// escapes would themselves be re-escaped). Paired with `ESCAPE '\'`
|
|
868
|
+
// in the four prepared LIKE statements (#stmtSearchPorter*,
|
|
869
|
+
// #stmtSearchTrigram*). Regression: #646.
|
|
870
|
+
const escaped = source
|
|
871
|
+
.replace(/\\/g, "\\\\")
|
|
872
|
+
.replace(/%/g, "\\%")
|
|
873
|
+
.replace(/_/g, "\\_");
|
|
874
|
+
return `%${escaped}%`;
|
|
863
875
|
}
|
|
864
876
|
search(query, limit = 3, source, mode = "AND", contentType, sourceMatchMode = "like") {
|
|
865
877
|
const sanitized = sanitizeQuery(query, mode);
|