context-mode 2.0.0-next.34 → 2.0.0-next.37
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 +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +392 -111
- package/SHA256SUMS +16 -16
- package/cli.mjs +2 -1
- package/copilot/plugin.json +1 -1
- package/fixtures/hook-roundtrip.json +113 -0
- package/gemini-extension.json +1 -1
- package/hook.mjs +60 -58
- package/opencode/plugin.js +403 -183
- package/package.json +1 -1
- package/pi/index.js +443 -219
- package/qwen-extension.json +1 -1
- package/run.mjs +5 -2
- package/search.mjs +5 -2
- package/server.mjs +430 -206
package/qwen-extension.json
CHANGED
package/run.mjs
CHANGED
|
@@ -1385,7 +1385,8 @@ function getAdapter(id) {
|
|
|
1385
1385
|
var ERROR_TEXT = Object.freeze({
|
|
1386
1386
|
NODE_TOO_OLD: "Node <v> is below 24.15.0. Fix: install Node 24.15.0 or later.",
|
|
1387
1387
|
NO_SQLITE: "node:sqlite failed to load. Fix: run ctx_doctor.",
|
|
1388
|
-
DB_GONE: "context.db
|
|
1388
|
+
DB_GONE: "context.db is gone and its WAL file is still in place. Fix: run ctx_doctor once; it keeps the WAL file in a dated folder and starts a new index.",
|
|
1389
|
+
// D-ORPHAN-WAL-1
|
|
1389
1390
|
NO_PROJECT: "Project source <kind> is missing. Fix: run ctx_doctor.",
|
|
1390
1391
|
UNKNOWN_FIELD: 'Unknown field "<f>". Fix: use "queries".',
|
|
1391
1392
|
TIMEOUT: "Timed out after <ms> ms. Fix: pass background: true.",
|
|
@@ -3276,6 +3277,7 @@ var PORTER_MATCH = `
|
|
|
3276
3277
|
AND (:scope <> 'session' OR chunks.session_id = :session_id)
|
|
3277
3278
|
AND (:scope <> 'worktree' OR chunks.worktree = :worktree)
|
|
3278
3279
|
AND (:source IS NULL OR s.label = :source)
|
|
3280
|
+
AND (:ids IS NULL OR s.id IN (SELECT value FROM json_each(:ids)))
|
|
3279
3281
|
${NOT_RAW}`;
|
|
3280
3282
|
var PORTER_ORDER = `
|
|
3281
3283
|
ORDER BY (session_id = :session_id) DESC, (worktree = :worktree) DESC, full DESC, score DESC, source_id DESC, ord ASC`;
|
|
@@ -3301,6 +3303,7 @@ WHERE chunks_tri MATCH :match
|
|
|
3301
3303
|
AND (:scope <> 'session' OR c.session_id = :session_id)
|
|
3302
3304
|
AND (:scope <> 'worktree' OR c.worktree = :worktree)
|
|
3303
3305
|
AND (:source IS NULL OR s.label = :source)
|
|
3306
|
+
AND (:ids IS NULL OR s.id IN (SELECT value FROM json_each(:ids)))
|
|
3304
3307
|
${NOT_RAW}
|
|
3305
3308
|
ORDER BY bm25(chunks_tri, 1.0, ${TITLE_WEIGHT}) ASC, c.source_id DESC, c.ord ASC`;
|
|
3306
3309
|
var INSERT_TRI = "INSERT INTO chunks_tri(rowid, body, title) VALUES (?, ?, ?)";
|
|
@@ -5013,7 +5016,7 @@ function matchesAnyDenyPattern(text, patterns, subject = BASH_SUBJECT) {
|
|
|
5013
5016
|
|
|
5014
5017
|
// src/prompt/_generated.ts
|
|
5015
5018
|
var TOOL_DESCRIPTIONS = Object.freeze({
|
|
5016
|
-
ctx_execute: 'Example: `ctx_execute({language:"shell",code:"git log --oneline -5"})`. Required: language, code.\
|
|
5019
|
+
ctx_execute: 'Example: `ctx_execute({language:"shell",code:"git log --oneline -5"})`. Required: language, code.\nWrite code that prints only the answer, not the raw data. Runs code in a sandboxed subprocess in the project directory (shell, powershell, javascript, typescript, python, or another runtime on PATH); only what the code prints comes back. For a large file, set `file` to its local path: the code gets it in the CTX_FILE environment variable. Set `intent` when output may be large: the matching sections come back and the full output is indexed for ctx_search. `timeoutMs` defaults to and caps at 600000; then the whole process tree is killed.',
|
|
5017
5020
|
ctx_batch: 'Example: `ctx_batch({commands:["git log --oneline -5"],queries:["recent changes"]})`. Required: commands, queries.\nRuns several shell commands, then answers several search queries over their combined output, in one call. Use it to collect facts from more than one command at once, for example test results plus recent commits, when you need specific answers rather than the full text. Returns the matching sections and a one-line footer.',
|
|
5018
5021
|
ctx_index: 'Example: `ctx_index({path:"docs/api.md"})`. Required: one of path, content, url.\nStores content so it can be searched later: a local file or folder (nested .gitignore files are respected), raw text, or a URL, which is fetched and converted to Markdown. Use it for documentation or large files you will query more than once, then use ctx_search instead of reading the content again. Returns the source label and how many chunks were stored.',
|
|
5019
5022
|
ctx_search: 'Example: `ctx_search({queries:["auth middleware"]})`. Required: queries.\nSearches content stored with ctx_index and earlier sandbox output in this project. Pass several queries in one call. By default it searches the current worktree; set `scope` to `project` for all worktrees or `session` for this session only. Results from the current session rank first, then by relevance, ranked with measurably better recall than plain keyword search. Set `sort` to `timeline` for oldest-first order across this session, prior sessions and memory, paged with `after`; `offset` is for relevance order only. Set `source` to `decision` to search only rows where the user answered a question. Every hit names its source. When nothing matches, the reply states the scope and how many sources are indexed.',
|
package/search.mjs
CHANGED
|
@@ -1385,7 +1385,8 @@ function getAdapter(id) {
|
|
|
1385
1385
|
var ERROR_TEXT = Object.freeze({
|
|
1386
1386
|
NODE_TOO_OLD: "Node <v> is below 24.15.0. Fix: install Node 24.15.0 or later.",
|
|
1387
1387
|
NO_SQLITE: "node:sqlite failed to load. Fix: run ctx_doctor.",
|
|
1388
|
-
DB_GONE: "context.db
|
|
1388
|
+
DB_GONE: "context.db is gone and its WAL file is still in place. Fix: run ctx_doctor once; it keeps the WAL file in a dated folder and starts a new index.",
|
|
1389
|
+
// D-ORPHAN-WAL-1
|
|
1389
1390
|
NO_PROJECT: "Project source <kind> is missing. Fix: run ctx_doctor.",
|
|
1390
1391
|
UNKNOWN_FIELD: 'Unknown field "<f>". Fix: use "queries".',
|
|
1391
1392
|
TIMEOUT: "Timed out after <ms> ms. Fix: pass background: true.",
|
|
@@ -3276,6 +3277,7 @@ var PORTER_MATCH = `
|
|
|
3276
3277
|
AND (:scope <> 'session' OR chunks.session_id = :session_id)
|
|
3277
3278
|
AND (:scope <> 'worktree' OR chunks.worktree = :worktree)
|
|
3278
3279
|
AND (:source IS NULL OR s.label = :source)
|
|
3280
|
+
AND (:ids IS NULL OR s.id IN (SELECT value FROM json_each(:ids)))
|
|
3279
3281
|
${NOT_RAW}`;
|
|
3280
3282
|
var PORTER_ORDER = `
|
|
3281
3283
|
ORDER BY (session_id = :session_id) DESC, (worktree = :worktree) DESC, full DESC, score DESC, source_id DESC, ord ASC`;
|
|
@@ -3301,6 +3303,7 @@ WHERE chunks_tri MATCH :match
|
|
|
3301
3303
|
AND (:scope <> 'session' OR c.session_id = :session_id)
|
|
3302
3304
|
AND (:scope <> 'worktree' OR c.worktree = :worktree)
|
|
3303
3305
|
AND (:source IS NULL OR s.label = :source)
|
|
3306
|
+
AND (:ids IS NULL OR s.id IN (SELECT value FROM json_each(:ids)))
|
|
3304
3307
|
${NOT_RAW}
|
|
3305
3308
|
ORDER BY bm25(chunks_tri, 1.0, ${TITLE_WEIGHT}) ASC, c.source_id DESC, c.ord ASC`;
|
|
3306
3309
|
var INSERT_TRI = "INSERT INTO chunks_tri(rowid, body, title) VALUES (?, ?, ?)";
|
|
@@ -5013,7 +5016,7 @@ function matchesAnyDenyPattern(text, patterns, subject = BASH_SUBJECT) {
|
|
|
5013
5016
|
|
|
5014
5017
|
// src/prompt/_generated.ts
|
|
5015
5018
|
var TOOL_DESCRIPTIONS = Object.freeze({
|
|
5016
|
-
ctx_execute: 'Example: `ctx_execute({language:"shell",code:"git log --oneline -5"})`. Required: language, code.\
|
|
5019
|
+
ctx_execute: 'Example: `ctx_execute({language:"shell",code:"git log --oneline -5"})`. Required: language, code.\nWrite code that prints only the answer, not the raw data. Runs code in a sandboxed subprocess in the project directory (shell, powershell, javascript, typescript, python, or another runtime on PATH); only what the code prints comes back. For a large file, set `file` to its local path: the code gets it in the CTX_FILE environment variable. Set `intent` when output may be large: the matching sections come back and the full output is indexed for ctx_search. `timeoutMs` defaults to and caps at 600000; then the whole process tree is killed.',
|
|
5017
5020
|
ctx_batch: 'Example: `ctx_batch({commands:["git log --oneline -5"],queries:["recent changes"]})`. Required: commands, queries.\nRuns several shell commands, then answers several search queries over their combined output, in one call. Use it to collect facts from more than one command at once, for example test results plus recent commits, when you need specific answers rather than the full text. Returns the matching sections and a one-line footer.',
|
|
5018
5021
|
ctx_index: 'Example: `ctx_index({path:"docs/api.md"})`. Required: one of path, content, url.\nStores content so it can be searched later: a local file or folder (nested .gitignore files are respected), raw text, or a URL, which is fetched and converted to Markdown. Use it for documentation or large files you will query more than once, then use ctx_search instead of reading the content again. Returns the source label and how many chunks were stored.',
|
|
5019
5022
|
ctx_search: 'Example: `ctx_search({queries:["auth middleware"]})`. Required: queries.\nSearches content stored with ctx_index and earlier sandbox output in this project. Pass several queries in one call. By default it searches the current worktree; set `scope` to `project` for all worktrees or `session` for this session only. Results from the current session rank first, then by relevance, ranked with measurably better recall than plain keyword search. Set `sort` to `timeline` for oldest-first order across this session, prior sessions and memory, paged with `after`; `offset` is for relevance order only. Set `source` to `decision` to search only rows where the user answered a question. Every hit names its source. When nothing matches, the reply states the scope and how many sources are indexed.',
|