context-mode 2.0.0-next.8 → 2.0.0-next.9

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.
@@ -330,7 +330,7 @@ var DECISION_OPTION_KEY = "option";
330
330
  var DECISION_LABEL_JOIN = " | ";
331
331
  var RELEASE_REPO_URL = "https://github.com/mksglu/context-mode.git";
332
332
  var RELEASE_BRANCH = "release";
333
- var BUNDLE_SHA = true ? "4fb62aa646f6f53db6e655a59f4397d5ef78c0a4" : void 0;
333
+ var BUNDLE_SHA = true ? "b808edb09ed5aa8e48225f4c77d0d966f0dbc228" : void 0;
334
334
  var DOCTOR_CHECK_ORDER = Object.freeze(["D1", "D2", "D3", "D4", "D5", "D5b", "D6", "D7", "D8", "D9", "D10", "D11"]);
335
335
  var DOCTOR_LABEL = Object.freeze({
336
336
  D1: "version",
@@ -3601,14 +3601,15 @@ function gitDirs(dir) {
3601
3601
  } catch {
3602
3602
  throw new CtxError("NO_GIT_DIR", { path: dir });
3603
3603
  }
3604
+ const start = cur;
3604
3605
  for (; ; ) {
3605
3606
  const gitDir = gitDirAt(join4(cur, GIT_DIR_NAME));
3606
3607
  if (gitDir !== null) {
3607
3608
  const common = firstLine(join4(gitDir, GIT_COMMONDIR_FILE));
3608
- return { commonDir: realpathSync3.native(common === null ? gitDir : resolve2(gitDir, common)), worktree: cur };
3609
+ return { commonDir: realpathSync3.native(common === null ? gitDir : resolve2(gitDir, common)), worktree: cur, start };
3609
3610
  }
3610
3611
  const up = dirname2(cur);
3611
- if (up === cur) return null;
3612
+ if (up === cur) return { commonDir: null, start };
3612
3613
  cur = up;
3613
3614
  }
3614
3615
  }
@@ -3654,16 +3655,24 @@ function resolveProject(agent, src) {
3654
3655
  const dir = dirOf(source, src);
3655
3656
  if (dir === void 0) throw new CtxError("NO_PROJECT", { kind: source });
3656
3657
  const repo = gitDirs(dir);
3657
- const plain = repo === null ? realpathSync3.native(dir) : void 0;
3658
- const commonDir = repo?.commonDir ?? plain;
3659
- const worktree = repo?.worktree ?? plain;
3660
- const projectKey = sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
3661
- const projectDir = join4(resolveConfigDir(process.env), PROJECTS_DIR_NAME, projectKey);
3658
+ const plain = repo.commonDir === null ? repo.start : void 0;
3659
+ const commonDir = repo.commonDir ?? repo.start;
3660
+ const worktree = repo.commonDir === null ? repo.start : repo.worktree;
3661
+ let key;
3662
+ let pdir;
3662
3663
  let root;
3663
3664
  return {
3664
- projectKey,
3665
- projectDir,
3666
- dbPath: join4(projectDir, DB_FILE_NAME),
3665
+ get projectKey() {
3666
+ key ??= sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
3667
+ return key;
3668
+ },
3669
+ get projectDir() {
3670
+ pdir ??= join4(resolveConfigDir(process.env), PROJECTS_DIR_NAME, this.projectKey);
3671
+ return pdir;
3672
+ },
3673
+ get dbPath() {
3674
+ return join4(this.projectDir, DB_FILE_NAME);
3675
+ },
3667
3676
  worktree,
3668
3677
  get containmentRoot() {
3669
3678
  root ??= plain ?? containmentRootOf(dir, commonDir);
package/package.json CHANGED
@@ -2,6 +2,10 @@
2
2
  "bin": {
3
3
  "context-mode": "cli.mjs"
4
4
  },
5
+ "bugs": {
6
+ "url": "https://github.com/mksglu/context-mode/issues"
7
+ },
8
+ "description": "Context window saver for 10 coding agents. Local and free: sandboxed code execution, FTS5 search, session continuity.",
5
9
  "engines": {
6
10
  "node": ">=24.15.0"
7
11
  },
@@ -25,6 +29,25 @@
25
29
  "server.mjs",
26
30
  "skills"
27
31
  ],
32
+ "homepage": "https://github.com/mksglu/context-mode#readme",
33
+ "keywords": [
34
+ "claude-code",
35
+ "codex",
36
+ "gemini-cli",
37
+ "qwen-code",
38
+ "copilot-cli",
39
+ "vscode",
40
+ "opencode",
41
+ "pi",
42
+ "kiro",
43
+ "zcode",
44
+ "mcp",
45
+ "context-window",
46
+ "sandbox",
47
+ "fts5",
48
+ "pi-package"
49
+ ],
50
+ "license": "Elastic-2.0",
28
51
  "main": "./opencode/plugin.js",
29
52
  "name": "context-mode",
30
53
  "pi": {
@@ -40,5 +63,5 @@
40
63
  "url": "git+https://github.com/mksglu/context-mode.git"
41
64
  },
42
65
  "type": "module",
43
- "version": "2.0.0-next.8"
66
+ "version": "2.0.0-next.9"
44
67
  }
package/pi/index.js CHANGED
@@ -11476,7 +11476,7 @@ var DECISION_OPTION_KEY = "option";
11476
11476
  var DECISION_LABEL_JOIN = " | ";
11477
11477
  var RELEASE_REPO_URL = "https://github.com/mksglu/context-mode.git";
11478
11478
  var RELEASE_BRANCH = "release";
11479
- var BUNDLE_SHA = true ? "4fb62aa646f6f53db6e655a59f4397d5ef78c0a4" : void 0;
11479
+ var BUNDLE_SHA = true ? "b808edb09ed5aa8e48225f4c77d0d966f0dbc228" : void 0;
11480
11480
  var DOCTOR_CHECK_ORDER = Object.freeze(["D1", "D2", "D3", "D4", "D5", "D5b", "D6", "D7", "D8", "D9", "D10", "D11"]);
11481
11481
  var DOCTOR_LABEL = Object.freeze({
11482
11482
  D1: "version",
@@ -14747,14 +14747,15 @@ function gitDirs(dir) {
14747
14747
  } catch {
14748
14748
  throw new CtxError("NO_GIT_DIR", { path: dir });
14749
14749
  }
14750
+ const start = cur;
14750
14751
  for (; ; ) {
14751
14752
  const gitDir = gitDirAt(join4(cur, GIT_DIR_NAME));
14752
14753
  if (gitDir !== null) {
14753
14754
  const common = firstLine(join4(gitDir, GIT_COMMONDIR_FILE));
14754
- return { commonDir: realpathSync3.native(common === null ? gitDir : resolve2(gitDir, common)), worktree: cur };
14755
+ return { commonDir: realpathSync3.native(common === null ? gitDir : resolve2(gitDir, common)), worktree: cur, start };
14755
14756
  }
14756
14757
  const up = dirname2(cur);
14757
- if (up === cur) return null;
14758
+ if (up === cur) return { commonDir: null, start };
14758
14759
  cur = up;
14759
14760
  }
14760
14761
  }
@@ -14800,16 +14801,24 @@ function resolveProject(agent, src) {
14800
14801
  const dir = dirOf(source, src);
14801
14802
  if (dir === void 0) throw new CtxError("NO_PROJECT", { kind: source });
14802
14803
  const repo = gitDirs(dir);
14803
- const plain = repo === null ? realpathSync3.native(dir) : void 0;
14804
- const commonDir = repo?.commonDir ?? plain;
14805
- const worktree = repo?.worktree ?? plain;
14806
- const projectKey = sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
14807
- const projectDir = join4(resolveConfigDir(process.env), PROJECTS_DIR_NAME, projectKey);
14804
+ const plain = repo.commonDir === null ? repo.start : void 0;
14805
+ const commonDir = repo.commonDir ?? repo.start;
14806
+ const worktree = repo.commonDir === null ? repo.start : repo.worktree;
14807
+ let key;
14808
+ let pdir;
14808
14809
  let root;
14809
14810
  return {
14810
- projectKey,
14811
- projectDir,
14812
- dbPath: join4(projectDir, DB_FILE_NAME),
14811
+ get projectKey() {
14812
+ key ??= sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
14813
+ return key;
14814
+ },
14815
+ get projectDir() {
14816
+ pdir ??= join4(resolveConfigDir(process.env), PROJECTS_DIR_NAME, this.projectKey);
14817
+ return pdir;
14818
+ },
14819
+ get dbPath() {
14820
+ return join4(this.projectDir, DB_FILE_NAME);
14821
+ },
14813
14822
  worktree,
14814
14823
  get containmentRoot() {
14815
14824
  root ??= plain ?? containmentRootOf(dir, commonDir);
@@ -1,4 +1,5 @@
1
1
  {
2
+ "description": "Context window saver for 10 coding agents. Local and free: sandboxed code execution, FTS5 search, session continuity.",
2
3
  "hooks": "hooks/qwen.json",
3
4
  "mcpServers": {
4
5
  "context-mode": {
@@ -11,5 +12,5 @@
11
12
  }
12
13
  },
13
14
  "name": "context-mode",
14
- "version": "2.0.0-next.8"
15
+ "version": "2.0.0-next.9"
15
16
  }
package/run.mjs CHANGED
@@ -5007,14 +5007,15 @@ function gitDirs(dir) {
5007
5007
  } catch {
5008
5008
  throw new CtxError("NO_GIT_DIR", { path: dir });
5009
5009
  }
5010
+ const start = cur;
5010
5011
  for (; ; ) {
5011
5012
  const gitDir = gitDirAt(join4(cur, GIT_DIR_NAME));
5012
5013
  if (gitDir !== null) {
5013
5014
  const common = firstLine(join4(gitDir, GIT_COMMONDIR_FILE));
5014
- return { commonDir: realpathSync3.native(common === null ? gitDir : resolve2(gitDir, common)), worktree: cur };
5015
+ return { commonDir: realpathSync3.native(common === null ? gitDir : resolve2(gitDir, common)), worktree: cur, start };
5015
5016
  }
5016
5017
  const up = dirname2(cur);
5017
- if (up === cur) return null;
5018
+ if (up === cur) return { commonDir: null, start };
5018
5019
  cur = up;
5019
5020
  }
5020
5021
  }
@@ -5060,16 +5061,24 @@ function resolveProject(agent, src) {
5060
5061
  const dir = dirOf(source, src);
5061
5062
  if (dir === void 0) throw new CtxError("NO_PROJECT", { kind: source });
5062
5063
  const repo = gitDirs(dir);
5063
- const plain = repo === null ? realpathSync3.native(dir) : void 0;
5064
- const commonDir = repo?.commonDir ?? plain;
5065
- const worktree = repo?.worktree ?? plain;
5066
- const projectKey = sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
5067
- const projectDir = join4(resolveConfigDir(process.env), PROJECTS_DIR_NAME, projectKey);
5064
+ const plain = repo.commonDir === null ? repo.start : void 0;
5065
+ const commonDir = repo.commonDir ?? repo.start;
5066
+ const worktree = repo.commonDir === null ? repo.start : repo.worktree;
5067
+ let key;
5068
+ let pdir;
5068
5069
  let root;
5069
5070
  return {
5070
- projectKey,
5071
- projectDir,
5072
- dbPath: join4(projectDir, DB_FILE_NAME),
5071
+ get projectKey() {
5072
+ key ??= sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
5073
+ return key;
5074
+ },
5075
+ get projectDir() {
5076
+ pdir ??= join4(resolveConfigDir(process.env), PROJECTS_DIR_NAME, this.projectKey);
5077
+ return pdir;
5078
+ },
5079
+ get dbPath() {
5080
+ return join4(this.projectDir, DB_FILE_NAME);
5081
+ },
5073
5082
  worktree,
5074
5083
  get containmentRoot() {
5075
5084
  root ??= plain ?? containmentRootOf(dir, commonDir);
package/search.mjs CHANGED
@@ -5007,14 +5007,15 @@ function gitDirs(dir) {
5007
5007
  } catch {
5008
5008
  throw new CtxError("NO_GIT_DIR", { path: dir });
5009
5009
  }
5010
+ const start = cur;
5010
5011
  for (; ; ) {
5011
5012
  const gitDir = gitDirAt(join4(cur, GIT_DIR_NAME));
5012
5013
  if (gitDir !== null) {
5013
5014
  const common = firstLine(join4(gitDir, GIT_COMMONDIR_FILE));
5014
- return { commonDir: realpathSync3.native(common === null ? gitDir : resolve2(gitDir, common)), worktree: cur };
5015
+ return { commonDir: realpathSync3.native(common === null ? gitDir : resolve2(gitDir, common)), worktree: cur, start };
5015
5016
  }
5016
5017
  const up = dirname2(cur);
5017
- if (up === cur) return null;
5018
+ if (up === cur) return { commonDir: null, start };
5018
5019
  cur = up;
5019
5020
  }
5020
5021
  }
@@ -5060,16 +5061,24 @@ function resolveProject(agent, src) {
5060
5061
  const dir = dirOf(source, src);
5061
5062
  if (dir === void 0) throw new CtxError("NO_PROJECT", { kind: source });
5062
5063
  const repo = gitDirs(dir);
5063
- const plain = repo === null ? realpathSync3.native(dir) : void 0;
5064
- const commonDir = repo?.commonDir ?? plain;
5065
- const worktree = repo?.worktree ?? plain;
5066
- const projectKey = sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
5067
- const projectDir = join4(resolveConfigDir(process.env), PROJECTS_DIR_NAME, projectKey);
5064
+ const plain = repo.commonDir === null ? repo.start : void 0;
5065
+ const commonDir = repo.commonDir ?? repo.start;
5066
+ const worktree = repo.commonDir === null ? repo.start : repo.worktree;
5067
+ let key;
5068
+ let pdir;
5068
5069
  let root;
5069
5070
  return {
5070
- projectKey,
5071
- projectDir,
5072
- dbPath: join4(projectDir, DB_FILE_NAME),
5071
+ get projectKey() {
5072
+ key ??= sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
5073
+ return key;
5074
+ },
5075
+ get projectDir() {
5076
+ pdir ??= join4(resolveConfigDir(process.env), PROJECTS_DIR_NAME, this.projectKey);
5077
+ return pdir;
5078
+ },
5079
+ get dbPath() {
5080
+ return join4(this.projectDir, DB_FILE_NAME);
5081
+ },
5073
5082
  worktree,
5074
5083
  get containmentRoot() {
5075
5084
  root ??= plain ?? containmentRootOf(dir, commonDir);
package/server.mjs CHANGED
@@ -28312,7 +28312,7 @@ var DECISION_SOURCE = "decision";
28312
28312
  var DECISION_USER_LABEL = "decision (user)";
28313
28313
  var RELEASE_REPO_URL = "https://github.com/mksglu/context-mode.git";
28314
28314
  var RELEASE_BRANCH = "release";
28315
- var BUNDLE_SHA = true ? "4fb62aa646f6f53db6e655a59f4397d5ef78c0a4" : void 0;
28315
+ var BUNDLE_SHA = true ? "b808edb09ed5aa8e48225f4c77d0d966f0dbc228" : void 0;
28316
28316
  var DOCTOR_CHECK_ORDER = Object.freeze(["D1", "D2", "D3", "D4", "D5", "D5b", "D6", "D7", "D8", "D9", "D10", "D11"]);
28317
28317
  var DOCTOR_LABEL = Object.freeze({
28318
28318
  D1: "version",
@@ -29352,14 +29352,15 @@ function gitDirs(dir) {
29352
29352
  } catch {
29353
29353
  throw new CtxError("NO_GIT_DIR", { path: dir });
29354
29354
  }
29355
+ const start = cur;
29355
29356
  for (; ; ) {
29356
29357
  const gitDir = gitDirAt(join2(cur, GIT_DIR_NAME));
29357
29358
  if (gitDir !== null) {
29358
29359
  const common = firstLine(join2(gitDir, GIT_COMMONDIR_FILE));
29359
- return { commonDir: realpathSync3.native(common === null ? gitDir : resolve(gitDir, common)), worktree: cur };
29360
+ return { commonDir: realpathSync3.native(common === null ? gitDir : resolve(gitDir, common)), worktree: cur, start };
29360
29361
  }
29361
29362
  const up = dirname2(cur);
29362
- if (up === cur) return null;
29363
+ if (up === cur) return { commonDir: null, start };
29363
29364
  cur = up;
29364
29365
  }
29365
29366
  }
@@ -29405,16 +29406,24 @@ function resolveProject(agent, src) {
29405
29406
  const dir = dirOf(source, src);
29406
29407
  if (dir === void 0) throw new CtxError("NO_PROJECT", { kind: source });
29407
29408
  const repo = gitDirs(dir);
29408
- const plain = repo === null ? realpathSync3.native(dir) : void 0;
29409
- const commonDir = repo?.commonDir ?? plain;
29410
- const worktree = repo?.worktree ?? plain;
29411
- const projectKey = sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
29412
- const projectDir = join2(resolveConfigDir(process.env), PROJECTS_DIR_NAME, projectKey);
29409
+ const plain = repo.commonDir === null ? repo.start : void 0;
29410
+ const commonDir = repo.commonDir ?? repo.start;
29411
+ const worktree = repo.commonDir === null ? repo.start : repo.worktree;
29412
+ let key;
29413
+ let pdir;
29413
29414
  let root;
29414
29415
  return {
29415
- projectKey,
29416
- projectDir,
29417
- dbPath: join2(projectDir, DB_FILE_NAME),
29416
+ get projectKey() {
29417
+ key ??= sha256Hex(commonDir).slice(0, PROJECT_KEY_HEX_LEN);
29418
+ return key;
29419
+ },
29420
+ get projectDir() {
29421
+ pdir ??= join2(resolveConfigDir(process.env), PROJECTS_DIR_NAME, this.projectKey);
29422
+ return pdir;
29423
+ },
29424
+ get dbPath() {
29425
+ return join2(this.projectDir, DB_FILE_NAME);
29426
+ },
29418
29427
  worktree,
29419
29428
  get containmentRoot() {
29420
29429
  root ??= plain ?? containmentRootOf(dir, commonDir);