@cortexkit/pi-magic-context 0.49.47 → 0.49.49

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.
Files changed (55) hide show
  1. package/dist/auto-search-worker.js +5 -5
  2. package/dist/chunk-embedding-write-worker.js +12 -12
  3. package/dist/{compaction-marker-candidates-17a21jfn.js → compaction-marker-candidates-9yhrstyb.js} +2 -2
  4. package/dist/compaction-marker-candidates-worker.js +1 -1
  5. package/dist/{compartment-chunk-embedding-nyjs3dfh.js → compartment-chunk-embedding-wg7emg3z.js} +7 -7
  6. package/dist/{embedding-backfill-er9jc4xf.js → embedding-backfill-xsd7fc5c.js} +12 -12
  7. package/dist/embedding-worker-process.js +1 -1
  8. package/dist/embedding-worker.js +4 -4
  9. package/dist/historian-calibration-extension.js +1 -1
  10. package/dist/{index-w26zvs1q.js → index-46wk0td0.js} +1 -1
  11. package/dist/{index-bbbp8zs1.js → index-6d0bby9d.js} +2 -2
  12. package/dist/{index-000fthre.js → index-7y60kyea.js} +1 -1
  13. package/dist/{index-tcm1gqcb.js → index-8bpxfq4c.js} +3 -3
  14. package/dist/{index-7esg5v2x.js → index-9036v8ay.js} +6 -6
  15. package/dist/{index-nev91y6k.js → index-9n1hyjck.js} +10 -10
  16. package/dist/{index-qt711raa.js → index-bjeb4ya4.js} +10 -10
  17. package/dist/{index-rcenqffj.js → index-cmyk3bmf.js} +8 -8
  18. package/dist/{index-0wtm7g7f.js → index-j0eagxkz.js} +1 -1
  19. package/dist/{index-yacs388s.js → index-jxm4bvm4.js} +1 -1
  20. package/dist/{index-4sa1rx3h.js → index-ndg15t3x.js} +4 -4
  21. package/dist/{index-jaqdcqwz.js → index-pkg07s54.js} +2 -2
  22. package/dist/{index-zchc0df8.js → index-qcsjj9m0.js} +4 -12
  23. package/dist/{index-gwvahsdz.js → index-qm139qq2.js} +2 -2
  24. package/dist/{index-3g9fnq6y.js → index-szn2tac8.js} +1 -1
  25. package/dist/{index-j9bhd718.js → index-vdrqxca5.js} +19 -19
  26. package/dist/{index-fzadydec.js → index-wz66mger.js} +4 -4
  27. package/dist/{index-2kmwjq42.js → index-xssjy4z9.js} +1 -1
  28. package/dist/{index-6pk49fc3.js → index-xx1911hb.js} +1 -1
  29. package/dist/{index-wwf9vxpf.js → index-y2g8rdmm.js} +8 -8
  30. package/dist/{index-zwbgxt01.js → index-yc4vfwvm.js} +4 -4
  31. package/dist/{index-cq71g4dk.js → index-yjgkjkjs.js} +1 -1
  32. package/dist/{index-gymgz20n.js → index-yxeg8zaa.js} +23 -20
  33. package/dist/{index-d107f484.js → index-zc6fdyx7.js} +4 -4
  34. package/dist/{index-v7m1nqwz.js → index-zggajt0j.js} +2 -2
  35. package/dist/{index-tsg6swzr.js → index-zrbvwxtb.js} +2 -2
  36. package/dist/{index-mp0gh04g.js → index-zxm7ckvc.js} +2 -2
  37. package/dist/index.js +59 -37
  38. package/dist/{logger-2j70hhz4.js → logger-hhgpkbx1.js} +1 -1
  39. package/dist/{message-fts-rowid-map-ff4qg3e4.js → message-fts-rowid-map-tec2x7qe.js} +4 -4
  40. package/dist/{message-index-bounded-cqn6x6fc.js → message-index-bounded-6zghm1jn.js} +9 -9
  41. package/dist/{message-time-backfill-x45573rs.js → message-time-backfill-krre2qnb.js} +2 -2
  42. package/dist/migration-worker.js +9 -9
  43. package/dist/{project-embedding-registry-ysaezfqw.js → project-embedding-registry-j4ywdpq0.js} +11 -11
  44. package/dist/raw-ordinal-warmup-worker.js +8 -8
  45. package/dist/{read-session-chunk-0ecmbegv.js → read-session-chunk-hs4jtxsm.js} +7 -7
  46. package/dist/{read-session-raw-nttnwy8p.js → read-session-raw-75dcxtdy.js} +2 -2
  47. package/dist/{render-zcwm5nz3.js → render-n3y6kvwq.js} +16 -16
  48. package/dist/{safe-notification-target-jk69jxwp.js → safe-notification-target-8s1xg0q9.js} +2 -2
  49. package/dist/{search-archive-9svkd0f6.js → search-archive-1g44f9jt.js} +9 -9
  50. package/dist/{search-p4fj69gn.js → search-gzkbjgx0.js} +19 -19
  51. package/dist/{storage-tags-g0j9mr4b.js → storage-tags-ahhwtfdq.js} +4 -4
  52. package/dist/subagent-entry.js +25 -25
  53. package/dist/tag-snapshot-worker-pi.js +11 -11
  54. package/dist/{v2-archive-reader-ksmk6bfw.js → v2-archive-reader-sez4pjd8.js} +1 -1
  55. package/package.json +1 -1
@@ -17,7 +17,7 @@ import {
17
17
  getMagicContextStorageDir,
18
18
  log2,
19
19
  sessionLog2
20
- } from "./index-gymgz20n.js";
20
+ } from "./index-yxeg8zaa.js";
21
21
  import {
22
22
  piModelRefToCanonical,
23
23
  modelRefLookupOrder,
@@ -38,25 +38,25 @@ import {
38
38
  } from "./index-135e8hvg.js";
39
39
  import {
40
40
  estimateTokens
41
- } from "./index-000fthre.js";
41
+ } from "./index-7y60kyea.js";
42
42
  import {
43
43
  SubcClient,
44
44
  connectionFileExists,
45
45
  SYNAPSE_DEFAULT_MODEL,
46
46
  toSynapseLaneDescriptor,
47
47
  SynapseEmbeddingProvider
48
- } from "./index-gwvahsdz.js";
48
+ } from "./index-qm139qq2.js";
49
49
  import {
50
50
  inRootAsyncContext2,
51
51
  Database2
52
52
  } from "./index-2qtx0q6h.js";
53
53
  import {
54
54
  noteRawSessionSummaryRowWritten2
55
- } from "./index-3g9fnq6y.js";
55
+ } from "./index-szn2tac8.js";
56
56
  import {
57
57
  piHarnessKindFromExecutable,
58
58
  getErrorMessage
59
- } from "./index-wwf9vxpf.js";
59
+ } from "./index-y2g8rdmm.js";
60
60
  import {
61
61
  getOrCreateSessionMeta,
62
62
  updateSessionMeta,
@@ -70,10 +70,10 @@ import {
70
70
  renderMessageByOrdinal2,
71
71
  renderVerboseRange2,
72
72
  renderItemByTag2
73
- } from "./index-nev91y6k.js";
73
+ } from "./index-9n1hyjck.js";
74
74
  import {
75
75
  getLastIndexedOrdinal
76
- } from "./index-fzadydec.js";
76
+ } from "./index-wz66mger.js";
77
77
  import {
78
78
  setNoteLastReadAt,
79
79
  getPersistedCompactionMarkerState,
@@ -83,10 +83,10 @@ import {
83
83
  hasRawMessageProvider2,
84
84
  setRawMessageProvider2,
85
85
  readSessionChunk2
86
- } from "./index-7esg5v2x.js";
86
+ } from "./index-9036v8ay.js";
87
87
  import {
88
88
  stableStringify
89
- } from "./index-yacs388s.js";
89
+ } from "./index-jxm4bvm4.js";
90
90
  import {
91
91
  computeCueContentHash,
92
92
  getMuralCueState,
@@ -109,7 +109,7 @@ import {
109
109
  } from "./index-yhzhdp3m.js";
110
110
  import {
111
111
  preflightLocalEmbeddingPooling
112
- } from "./index-tsg6swzr.js";
112
+ } from "./index-zrbvwxtb.js";
113
113
  import {
114
114
  withQueryEmbeddingDeadline,
115
115
  markProjectLoadUntrusted2,
@@ -121,20 +121,20 @@ import {
121
121
  unregisterProjectEmbedding2,
122
122
  getProjectEmbeddingSnapshot2,
123
123
  embedTextForProject2
124
- } from "./index-rcenqffj.js";
124
+ } from "./index-cmyk3bmf.js";
125
125
  import {
126
126
  directoryHasGitMetadata,
127
127
  resolveProjectIdentityForSession,
128
128
  normalizeStoredProjectPath,
129
129
  storedPathBelongsToIdentity
130
- } from "./index-6pk49fc3.js";
130
+ } from "./index-xx1911hb.js";
131
131
  import {
132
132
  createUnifiedSearchDiagnostics2,
133
133
  parseIdShapedQuery2,
134
134
  resolveMemoriesByIdsForSearch2,
135
135
  unifiedSearch2,
136
136
  formatSearchResults2
137
- } from "./index-qt711raa.js";
137
+ } from "./index-bjeb4ya4.js";
138
138
  import {
139
139
  TODO_STATUSES,
140
140
  TODO_PRIORITIES,
@@ -145,7 +145,7 @@ import {
145
145
  getInertWhitespaceAssistantTagsByNumbers2,
146
146
  getTagNumberByMessageId2,
147
147
  getTagsBySession2
148
- } from "./index-zchc0df8.js";
148
+ } from "./index-qcsjj9m0.js";
149
149
  import {
150
150
  resolveOpenCodeDbPath,
151
151
  assertOpenCodeStoreGeneration
@@ -159,7 +159,7 @@ import {
159
159
  expandWorkspaceIdentitySetWithAliases,
160
160
  resolveStoredPathWorkspaceIdentity,
161
161
  storedPathBelongsToWorkspace
162
- } from "./index-d107f484.js";
162
+ } from "./index-zc6fdyx7.js";
163
163
  import {
164
164
  getNoteByIdInScope,
165
165
  getNotes,
@@ -170,7 +170,7 @@ import {
170
170
  updateNote,
171
171
  dismissNotes,
172
172
  dismissNote
173
- } from "./index-w26zvs1q.js";
173
+ } from "./index-46wk0td0.js";
174
174
  import {
175
175
  isMarkerCandidateBasisCurrent2,
176
176
  invalidateMarkerCandidateBasis2,
@@ -181,10 +181,10 @@ import {
181
181
  certifiedMarkerReferenceFloor2,
182
182
  readMarkerReferenceRows2,
183
183
  readKnownMarkerReferenceRows2
184
- } from "./index-2kmwjq42.js";
184
+ } from "./index-xssjy4z9.js";
185
185
  import {
186
186
  renderSearchArchive2
187
- } from "./index-v7m1nqwz.js";
187
+ } from "./index-zggajt0j.js";
188
188
  import {
189
189
  computeNormalizedHash
190
190
  } from "./index-9x1f96r8.js";
@@ -193,7 +193,7 @@ import {
193
193
  } from "./index-nrzkqte4.js";
194
194
  import {
195
195
  logSlowWriteTransaction
196
- } from "./index-0wtm7g7f.js";
196
+ } from "./index-j0eagxkz.js";
197
197
  import {
198
198
  ensureStorageDirectorySync,
199
199
  writeStorageFileAtomicSync
@@ -6,19 +6,19 @@ import {
6
6
  removeNestedBlocks,
7
7
  hasMeaningfulUserText2,
8
8
  extractTexts2
9
- } from "./index-000fthre.js";
9
+ } from "./index-7y60kyea.js";
10
10
  import {
11
11
  cleanUserText2
12
- } from "./index-7esg5v2x.js";
12
+ } from "./index-9036v8ay.js";
13
13
  import {
14
14
  recordMessageFtsRowid2,
15
15
  recordIndexedMessageTime2,
16
16
  messageFtsOrdinalRangeIsMapped2,
17
17
  deleteUnmappedMessageFtsRows2
18
- } from "./index-bbbp8zs1.js";
18
+ } from "./index-6d0bby9d.js";
19
19
  import {
20
20
  logSlowWriteTransaction
21
- } from "./index-0wtm7g7f.js";
21
+ } from "./index-j0eagxkz.js";
22
22
 
23
23
  // ../plugin/src/features/magic-context/compression-depth-storage.ts
24
24
  var incrementDepthStatements = new WeakMap;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-8sqebjzk.js";
4
4
  import {
5
5
  log2
6
- } from "./index-gymgz20n.js";
6
+ } from "./index-yxeg8zaa.js";
7
7
  import {
8
8
  inRootAsyncContext2,
9
9
  getSqliteDatabasePath2
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getMagicContextStorageDir,
3
3
  log2
4
- } from "./index-gymgz20n.js";
4
+ } from "./index-yxeg8zaa.js";
5
5
  import {
6
6
  inRootAsyncContext2
7
7
  } from "./index-2qtx0q6h.js";
@@ -8,7 +8,7 @@ import {
8
8
  importPluginModule,
9
9
  writeForwardedLogLine2,
10
10
  log2
11
- } from "./index-gymgz20n.js";
11
+ } from "./index-yxeg8zaa.js";
12
12
  import {
13
13
  inRootAsyncContext2,
14
14
  registerSlowWriteReporter2,
@@ -24,7 +24,7 @@ import {
24
24
  } from "./index-2qtx0q6h.js";
25
25
  import {
26
26
  scheduleAfterBootQuiet
27
- } from "./index-6pk49fc3.js";
27
+ } from "./index-xx1911hb.js";
28
28
  import {
29
29
  configureContextDatabasePragmas2
30
30
  } from "./index-fapenpch.js";
@@ -36,7 +36,7 @@ import {
36
36
  } from "./index-wfqysrwq.js";
37
37
  import {
38
38
  startMessageFtsRowidMapBackfill2
39
- } from "./index-bbbp8zs1.js";
39
+ } from "./index-6d0bby9d.js";
40
40
  import {
41
41
  LKG_SLOT_CHUNKS_DDL,
42
42
  SESSION_REPLAY_DECISIONS_DDL,
@@ -46,12 +46,12 @@ import {
46
46
  hasPendingMigrations,
47
47
  getMainThreadMigrationBodyCount,
48
48
  runMigrations
49
- } from "./index-d107f484.js";
49
+ } from "./index-zc6fdyx7.js";
50
50
  import {
51
51
  ensureColumn,
52
52
  installV95PerfSchema,
53
53
  installTagIdentityRevisionTrigger
54
- } from "./index-yacs388s.js";
54
+ } from "./index-jxm4bvm4.js";
55
55
  import {
56
56
  resolveOpenCodeDbPath,
57
57
  hasV1MessageTables
@@ -65,7 +65,7 @@ import {
65
65
  } from "./index-nrzkqte4.js";
66
66
  import {
67
67
  logSlowWriteTransaction
68
- } from "./index-0wtm7g7f.js";
68
+ } from "./index-j0eagxkz.js";
69
69
  import {
70
70
  shouldEnforcePrivateStoragePermissions,
71
71
  ensureStorageDirectorySync,
@@ -1788,8 +1788,8 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
1788
1788
  state.running = startMessageFtsRowidMapBackfill2(db, signal).then(async () => {
1789
1789
  if (signal.aborted || !readsOpenCodeStore)
1790
1790
  return;
1791
- const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-0ecmbegv.js"));
1792
- const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-x45573rs.js"));
1791
+ const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-hs4jtxsm.js"));
1792
+ const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-krre2qnb.js"));
1793
1793
  if (signal.aborted)
1794
1794
  return;
1795
1795
  await startMessageTimeBackfill(db, Object.assign(readRawSessionMessages, {
@@ -3,19 +3,19 @@ import {
3
3
  } from "./index-gzk7d940.js";
4
4
  import {
5
5
  log2
6
- } from "./index-gymgz20n.js";
6
+ } from "./index-yxeg8zaa.js";
7
7
  import {
8
8
  isSynapseEmbeddingTruncated,
9
9
  SynapseEmbeddingProvider
10
- } from "./index-gwvahsdz.js";
10
+ } from "./index-qm139qq2.js";
11
11
  import {
12
12
  LocalEmbeddingProvider
13
- } from "./index-tsg6swzr.js";
13
+ } from "./index-zrbvwxtb.js";
14
14
  import {
15
15
  OpenAICompatibleEmbeddingProvider,
16
16
  getProjectEmbeddingSnapshot2,
17
17
  embedBatchForProject2
18
- } from "./index-rcenqffj.js";
18
+ } from "./index-cmyk3bmf.js";
19
19
  import {
20
20
  isEmbeddingHostBusy2
21
21
  } from "./index-9p40dgkm.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log2
3
- } from "./index-gymgz20n.js";
3
+ } from "./index-yxeg8zaa.js";
4
4
 
5
5
  // ../plugin/src/shared/safe-notification-target.ts
6
6
  var DEFAULT_TITLE_RE = /^(New session - |Child session - )\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
@@ -18,6 +18,7 @@ import {
18
18
  readFileSync,
19
19
  readlinkSync,
20
20
  realpathSync,
21
+ unlinkSync,
21
22
  writeFileSync
22
23
  } from "node:fs";
23
24
  import * as os from "node:os";
@@ -43,29 +44,31 @@ function getMagicContextLogPath(harness = getHarness2()) {
43
44
  function getProjectMagicContextDir(directory) {
44
45
  return path.join(directory, ".cortexkit", "magic-context");
45
46
  }
46
- var GITIGNORE_GUARD_OPEN = "# >>> cortexkit:magic-context";
47
- var GITIGNORE_GUARD_CLOSE = "# <<< cortexkit:magic-context";
48
47
  function ensureCortexKitArtifactGitignore(directory) {
49
48
  try {
50
- const cortexKitDir = path.join(directory, ".cortexkit");
51
- const gitignorePath = path.join(cortexKitDir, ".gitignore");
52
- let existing = "";
53
- if (existsSync(gitignorePath)) {
54
- existing = readFileSync(gitignorePath, "utf8");
55
- if (existing.includes(GITIGNORE_GUARD_OPEN))
56
- return;
49
+ const artifactDir = getProjectMagicContextDir(directory);
50
+ const gitignorePath = path.join(artifactDir, ".gitignore");
51
+ mkdirSync(artifactDir, { recursive: true });
52
+ if (!existsSync(gitignorePath) || readFileSync(gitignorePath, "utf8") !== `*
53
+ `) {
54
+ writeFileSync(gitignorePath, `*
55
+ `, "utf8");
57
56
  }
58
- const block = `${GITIGNORE_GUARD_OPEN}
59
- magic-context/
60
- ${GITIGNORE_GUARD_CLOSE}
61
- `;
62
- const needsLeadingNewline = existing.length > 0 && !existing.endsWith(`
63
- `);
64
- const next = existing + (needsLeadingNewline ? `
65
- ` : "") + block;
66
- mkdirSync(cortexKitDir, { recursive: true });
67
- writeFileSync(gitignorePath, next, "utf8");
68
- } catch {}
57
+ const sharedPath = path.join(directory, ".cortexkit", ".gitignore");
58
+ if (!existsSync(sharedPath))
59
+ return;
60
+ const existing = readFileSync(sharedPath).toString("latin1");
61
+ const next = existing.replace(/^# >>> cortexkit:magic-context\r?\n(?:(?!^# (?:>>>|<<<) cortexkit:)[\s\S])*?^# <<< cortexkit:magic-context(?:\r?\n|$)/gm, "");
62
+ if (next === existing)
63
+ return;
64
+ const remaining = Buffer.from(next, "latin1");
65
+ if (remaining.toString("utf8").trim() === "")
66
+ unlinkSync(sharedPath);
67
+ else
68
+ writeFileSync(sharedPath, remaining);
69
+ } catch (error) {
70
+ log2("Failed to ensure project artifact gitignore", { directory, error: String(error) });
71
+ }
69
72
  }
70
73
  function getProjectMagicContextHistorianDir(directory) {
71
74
  return path.join(getProjectMagicContextDir(directory), "historian");
@@ -3,12 +3,12 @@ import {
3
3
  } from "./index-135e8hvg.js";
4
4
  import {
5
5
  log2
6
- } from "./index-gymgz20n.js";
6
+ } from "./index-yxeg8zaa.js";
7
7
  import {
8
8
  ensureColumn,
9
9
  healAllNullColumns,
10
10
  installV95PerfSchema
11
- } from "./index-yacs388s.js";
11
+ } from "./index-jxm4bvm4.js";
12
12
  import {
13
13
  resolveOpenCodeDbPath,
14
14
  openCodeDbPathExists,
@@ -20,10 +20,10 @@ import {
20
20
  import {
21
21
  normalizeStoredProjectPath,
22
22
  storedPathBelongsToIdentity
23
- } from "./index-6pk49fc3.js";
23
+ } from "./index-xx1911hb.js";
24
24
  import {
25
25
  logSlowWriteTransaction
26
- } from "./index-0wtm7g7f.js";
26
+ } from "./index-j0eagxkz.js";
27
27
 
28
28
  // ../plugin/src/features/magic-context/migrations.ts
29
29
  import { isMainThread } from "node:worker_threads";
@@ -3,10 +3,10 @@ import {
3
3
  } from "./index-1cvyaw9a.js";
4
4
  import {
5
5
  estimateTokens
6
- } from "./index-000fthre.js";
6
+ } from "./index-7y60kyea.js";
7
7
  import {
8
8
  readRawSessionMessageIdOrdinalsForRange2
9
- } from "./index-7esg5v2x.js";
9
+ } from "./index-9036v8ay.js";
10
10
 
11
11
  // ../plugin/src/tools/ctx-expand/search-archive.ts
12
12
  var archiveReadsOnThisThread = 0;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-gzk7d940.js";
4
4
  import {
5
5
  getSynapseLaneIdentity
6
- } from "./index-gwvahsdz.js";
6
+ } from "./index-qm139qq2.js";
7
7
  import {
8
8
  getHarness2
9
9
  } from "./index-0h2mkab2.js";
@@ -11,7 +11,7 @@ import {
11
11
  getMagicContextStorageDir,
12
12
  importPluginModule,
13
13
  log2
14
- } from "./index-gymgz20n.js";
14
+ } from "./index-yxeg8zaa.js";
15
15
  import {
16
16
  inRootAsyncContext2
17
17
  } from "./index-2qtx0q6h.js";
@@ -3,10 +3,10 @@ import {
3
3
  } from "./index-0h2mkab2.js";
4
4
  import {
5
5
  isUserHomeDirectory
6
- } from "./index-6pk49fc3.js";
6
+ } from "./index-xx1911hb.js";
7
7
  import {
8
8
  logSlowWriteTransaction
9
- } from "./index-0wtm7g7f.js";
9
+ } from "./index-j0eagxkz.js";
10
10
 
11
11
  // ../plugin/src/features/magic-context/session-project-storage.ts
12
12
  var SESSION_CHUNK_REPAIR_BATCH_SIZE = 100;