@cortexkit/pi-magic-context 0.43.2 → 0.44.1

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.
@@ -1,7 +1,7 @@
1
- import"./index-bfd52y8p.js";
1
+ import"./index-59dmj4zs.js";
2
2
  import {
3
3
  logSlowWriteTransaction
4
- } from "./index-17102c1m.js";
4
+ } from "./index-97e5fzy3.js";
5
5
 
6
6
  // ../plugin/src/features/magic-context/message-time-backfill.ts
7
7
  var MESSAGE_TIME_BACKFILL_BATCH_SIZE = 500;
@@ -78,7 +78,7 @@ function backfillMessageTimesBatch(db, reader, batchSize = MESSAGE_TIME_BACKFILL
78
78
  db.prepare(`UPDATE message_time_backfill_state
79
79
  SET cursor_session_id = ?, cursor_ordinal = ?, completed = ?, updated_at = ?
80
80
  WHERE id = ?`).run(cursorSessionId, cursorOrdinal, completed ? 1 : 0, Date.now(), BACKFILL_STATE_ID);
81
- })();
81
+ }).immediate();
82
82
  logSlowWriteTransaction("message_time_backfill", transactionStartedAt);
83
83
  return {
84
84
  processed: rows.length,
@@ -10,6 +10,7 @@ import {
10
10
  readRawSessionMessages2,
11
11
  readRawSessionMessagePage2,
12
12
  getRawSessionMessageOrdinalCount2,
13
+ visitRawSessionMessages2,
13
14
  readRawSessionMessageRange2,
14
15
  primeTailRawMessageCache2,
15
16
  getCachedAbsoluteMessageCount2,
@@ -17,14 +18,16 @@ import {
17
18
  readRawSessionMessageIdOrdinalsForRange2,
18
19
  hasRawSessionMessageById2,
19
20
  readRawSessionMessageOrdinalById2,
21
+ compareRawSessionMessageOrder2,
20
22
  getRawSessionMessageCount2,
21
23
  getRawSessionTagKeysThrough2,
22
24
  getLegacyProtectedTailStartOrdinal2,
23
25
  readSessionChunk2
24
- } from "./index-mea04n1j.js";
25
- import"./index-bfd52y8p.js";
26
+ } from "./index-nm3c0sn8.js";
27
+ import"./index-59dmj4zs.js";
26
28
  export {
27
29
  cleanUserText2 as cleanUserText,
30
+ compareRawSessionMessageOrder2 as compareRawSessionMessageOrder,
28
31
  extractTexts2 as extractTexts,
29
32
  getCachedAbsoluteMessageCount2 as getCachedAbsoluteMessageCount,
30
33
  getLegacyProtectedTailStartOrdinal2 as getLegacyProtectedTailStartOrdinal,
@@ -44,6 +47,7 @@ export {
44
47
  readSessionChunk2 as readSessionChunk,
45
48
  resolveHostServedBoundaryId2 as resolveHostServedBoundaryId,
46
49
  setRawMessageProvider2 as setRawMessageProvider,
50
+ visitRawSessionMessages2 as visitRawSessionMessages,
47
51
  withRawMessageProvider2 as withRawMessageProvider,
48
52
  withRawSessionMessageCache2 as withRawSessionMessageCache
49
53
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  isDefaultSessionTitle2,
3
3
  waitForSafeNotificationTarget2
4
- } from "./index-5v60m046.js";
5
- import"./index-bfd52y8p.js";
4
+ } from "./index-5fw91enm.js";
5
+ import"./index-59dmj4zs.js";
6
6
  export {
7
7
  isDefaultSessionTitle2 as isDefaultSessionTitle,
8
8
  waitForSafeNotificationTarget2 as waitForSafeNotificationTarget
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  setHarness,
3
3
  log
4
- } from "./index-bfd52y8p.js";
4
+ } from "./index-59dmj4zs.js";
5
5
  import {
6
6
  setStoragePrivatePermissionEnforcement,
7
7
  resolveProjectIdentityForSession,
@@ -10,9 +10,9 @@ import {
10
10
  ensureProjectRegisteredFromPiDirectory,
11
11
  resolvePiHarnessKind,
12
12
  registerMagicContextTools
13
- } from "./index-bkrh6jhp.js";
14
- import"./index-mea04n1j.js";
15
- import"./index-17102c1m.js";
13
+ } from "./index-mwpk0wn9.js";
14
+ import"./index-nm3c0sn8.js";
15
+ import"./index-97e5fzy3.js";
16
16
 
17
17
  // src/subagent-entry.ts
18
18
  var SUBAGENT_DREAMER_ACTIONS_FLAG = "magic-context-dreamer-actions";
@@ -45,11 +45,11 @@ function magicContextSubagentExtension(pi) {
45
45
  memoryToolEnabled: dreamerActionsEnabled,
46
46
  allowDreamerActions: dreamerActionsEnabled,
47
47
  sessionScopedToolsDisabled: true,
48
- todowriteEnabled: cfg.todowrite.enabled !== false,
48
+ todowriteEnabled: cfg.todowrite.enabled,
49
49
  todowriteCommandEnabled: false,
50
50
  promptSurface: registrationPromptSurface
51
51
  });
52
- log(`[pi-subagent] registered tools: ctx_search${dreamerActionsEnabled ? ", ctx_memory" : ""}${cfg.todowrite.enabled !== false ? ", todowrite" : ""}` + ` (ctx_note/ctx_expand omitted: --no-session child;` + ` memory=${cfg.memory.enabled}, embedding=${cfg.embedding.provider !== "off"},` + ` git_commits=${cfg.memory.git_commit_indexing.enabled}, dreamer_actions=${dreamerActionsEnabled})`);
52
+ log(`[pi-subagent] registered tools: ctx_search${dreamerActionsEnabled ? ", ctx_memory" : ""}${cfg.todowrite.enabled ? ", todowrite" : ""}` + ` (ctx_note/ctx_expand omitted: --no-session child;` + ` memory=${cfg.memory.enabled}, embedding=${cfg.embedding.provider !== "off"},` + ` git_commits=${cfg.memory.git_commit_indexing.enabled}, dreamer_actions=${dreamerActionsEnabled})`);
53
53
  } catch (err) {
54
54
  const message = err instanceof Error ? err.message : String(err);
55
55
  log(`[pi-subagent] startup failed: ${message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-magic-context",
3
- "version": "0.43.2",
3
+ "version": "0.44.1",
4
4
  "type": "module",
5
5
  "description": "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",
@@ -27,6 +27,7 @@
27
27
  "dist",
28
28
  "README.md"
29
29
  ],
30
+ "//": "The build intentionally bundles typebox (no --external typebox) and keeps it a regular dependency. OMP's extension loader rewrites every bare `typebox` import to its own omptype-based shim, whose schemas are callable objects rather than JSON Schema; they fail structuredClone during tool registration, so an external typebox import stops Magic Context loading on OMP. src/typebox-bundling.test.ts guards this.",
30
31
  "scripts": {
31
32
  "build": "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json && rm -f dist/index.js dist/subagent-entry.js dist/historian-calibration-extension.js dist/transformers-web.js dist/transformers-node-wasm.js dist/*-*.js && bun build ../plugin/src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun ../plugin/scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts src/subagent-entry.ts src/historian-calibration-extension.ts --outdir dist --target node --format esm --splitting --external @earendil-works/pi-coding-agent --external @earendil-works/pi-tui --external onnxruntime-node --external onnxruntime-web --external sharp --external node:sqlite",
32
33
  "build:e2e-argv": "bun build src/subagent-runner.ts --outfile ../../tests/docker/.generated/subagent-runner-e2e.mjs --target node --format esm --external node:sqlite",
@@ -41,7 +42,7 @@
41
42
  "prepublishOnly": "bun run build"
42
43
  },
43
44
  "dependencies": {
44
- "@cortexkit/subc-client": "0.4.1",
45
+ "@cortexkit/subc-client": "0.11.1",
45
46
  "@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
46
47
  "ai-tokenizer": "^1.0.6",
47
48
  "comment-json": "^5.0.0",
@@ -63,6 +64,7 @@
63
64
  "@types/better-sqlite3": "^7.6.13",
64
65
  "@types/bun": "^1.3.10",
65
66
  "@types/node": "^22.20.0",
67
+ "pi-agent-core-087": "npm:@earendil-works/pi-agent-core@0.87.1",
66
68
  "pi-ai-086": "npm:@earendil-works/pi-ai@0.86.0",
67
69
  "pi-coding-agent-086": "npm:@earendil-works/pi-coding-agent@0.86.0",
68
70
  "pi-coding-agent-087": "npm:@earendil-works/pi-coding-agent@0.87.1",