@cortexkit/pi-magic-context 0.47.0 → 0.49.0

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 (60) hide show
  1. package/dist/auto-search-worker.js +27 -22
  2. package/dist/embedding-activity-ew6dshfd.js +10 -0
  3. package/dist/embedding-backfill-b71dvfs8.js +20 -0
  4. package/dist/embedding-cache-7rp4gqzr.js +16 -0
  5. package/dist/embedding-worker.js +11 -8
  6. package/dist/harness-9872e0ym.js +10 -0
  7. package/dist/historian-calibration-extension.js +30 -4
  8. package/dist/index-041ex0cj.js +519 -0
  9. package/dist/index-0h2mkab2.js +17 -0
  10. package/dist/{index-2p1e8706.js → index-0vrkp1jq.js} +3 -3
  11. package/dist/index-135e8hvg.js +43 -0
  12. package/dist/{index-vgcemg0n.js → index-1evzceyw.js} +151 -2452
  13. package/dist/index-21v1kfs7.js +2309 -0
  14. package/dist/{index-n3g5mwa8.js → index-290tzwp1.js} +3 -3
  15. package/dist/{index-0qejsd7f.js → index-3cgbv47m.js} +289 -45
  16. package/dist/{index-xpbh1ypk.js → index-3mgf68pn.js} +38 -741
  17. package/dist/index-3rea6zd9.js +2396 -0
  18. package/dist/index-674f6qs2.js +16 -0
  19. package/dist/index-8976mezv.js +209 -0
  20. package/dist/index-904reqtg.js +152 -0
  21. package/dist/index-9p40dgkm.js +22 -0
  22. package/dist/index-9x1f96r8.js +11 -0
  23. package/dist/index-bejpsj10.js +1060 -0
  24. package/dist/{index-spk5vrhy.js → index-bgmv2kaf.js} +1 -16
  25. package/dist/{index-k3ezsjng.js → index-ehybv5nr.js} +14657 -13951
  26. package/dist/index-fapenpch.js +13 -0
  27. package/dist/index-hwqb3s7f.js +3804 -0
  28. package/dist/index-kjd1fj55.js +3106 -0
  29. package/dist/{index-td885aah.js → index-mcgehvgw.js} +181 -230
  30. package/dist/index-r024r8da.js +171 -0
  31. package/dist/{index-266qrgss.js → index-r56xgha8.js} +301 -27
  32. package/dist/{index-kztsbkqq.js → index-t7xfqtg6.js} +171 -168
  33. package/dist/index-vakawmbc.js +1262 -0
  34. package/dist/{index-7n8gb6j3.js → index-x3dcnxh0.js} +34 -33
  35. package/dist/index-xjqheg7a.js +931 -0
  36. package/dist/index-yarjn32j.js +3026 -0
  37. package/dist/index-yhzhdp3m.js +143 -0
  38. package/dist/index-yzcjxnt2.js +787 -0
  39. package/dist/{index-w76x3af7.js → index-zh1jw8qp.js} +107 -4
  40. package/dist/index.js +4926 -2437
  41. package/dist/logger-j6tecd1h.js +19 -0
  42. package/dist/message-index-bounded-qz5dz2se.js +120 -0
  43. package/dist/{message-time-backfill-d3db2etr.js → message-time-backfill-05ppypkz.js} +7 -6
  44. package/dist/migration-worker.js +20 -14
  45. package/dist/project-embedding-registry-ky7wrkr1.js +85 -0
  46. package/dist/raw-ordinal-warmup-worker.js +60 -0
  47. package/dist/{read-session-chunk-atxsyfqv.js → read-session-chunk-24sd89tf.js} +14 -6
  48. package/dist/read-session-raw-npx3920c.js +57 -0
  49. package/dist/{safe-notification-target-6cn3z99t.js → safe-notification-target-vn9kpmv4.js} +3 -2
  50. package/dist/search-jbh28nwy.js +40 -0
  51. package/dist/sqlite-3yye76ht.js +44 -0
  52. package/dist/sqlite-context-pragmas-gcgch6qz.js +6 -0
  53. package/dist/storage-memory-1z20y55x.js +71 -0
  54. package/dist/storage-tags-kjnsqbdb.js +127 -0
  55. package/dist/subagent-entry.js +35 -17
  56. package/dist/transformers-node-wasm.js +18415 -18415
  57. package/package.json +3 -3
  58. package/dist/index-7s8vw2y0.js +0 -5207
  59. package/dist/index-qaa5j277.js +0 -8544
  60. /package/dist/{index-en1k8h8m.js → index-5prbx026.js} +0 -0
@@ -0,0 +1,127 @@
1
+ import {
2
+ updateTagByteSize2,
3
+ getRecentTagOwnerMessageIds2,
4
+ getActiveTagTokenAggregate2,
5
+ AGE_RECLAIM_MIN_TOKENS2,
6
+ getOldestActiveUnprotectedToolTags2,
7
+ getActiveToolTagsForAgeReclaim2,
8
+ getTriggerTagTokenUpperBound2,
9
+ getActiveTagTokenTotalsByMessage2,
10
+ updateTagInputByteSize2,
11
+ updateTagTokenCount2,
12
+ getPersistedToolTagAccounting2,
13
+ getAllStatusTagTokenTotalsFlat2,
14
+ getReasoningTokenEstimatesByMessage2,
15
+ tryGetReasoningTokenEstimatesByMessage2,
16
+ getMaxTagNumberByOwnerMessage2,
17
+ scanTagOwnerSummary2,
18
+ scanTagOwnerDelta2,
19
+ updateTagInputTokenCount2,
20
+ tagTokenCountIsNull2,
21
+ backfillTagTokenCounts2,
22
+ insertTag2,
23
+ updateTagStatus2,
24
+ getInertWhitespaceAssistantTagsByNumbers2,
25
+ updateTagDropMode2,
26
+ updateCavemanDepth2,
27
+ updateTagMessageId2,
28
+ hasPiFallbackMessageTags2,
29
+ findAdoptableFallbackTags2,
30
+ adoptFallbackTagMessageId2,
31
+ foldShrunkPartTags2,
32
+ hasPiFallbackToolOwnerTags2,
33
+ findPiFallbackToolOwnerTags2,
34
+ PiTagIdentityConflictError2,
35
+ getPiMessageTagCandidates2,
36
+ findPiTagIdentityConflict2,
37
+ adoptPiFallbackToolOwnerTag2,
38
+ adoptPiFallbackMessageTag2,
39
+ markTagsCompactedByMessageIds2,
40
+ deleteTagsByMessageId2,
41
+ getMaxTagNumberBySession2,
42
+ getTagNumberByMessageId2,
43
+ getAssignableTagNumberByMessageId2,
44
+ getMinMessageTagNumberForRawId2,
45
+ deriveTagLoadFloor2,
46
+ TAG_SELECT_COLUMNS2,
47
+ getTagsBySession2,
48
+ getActiveTagsBySession2,
49
+ getTagsForPendingOperations2,
50
+ getTagsByNumbers2,
51
+ getNewestToolTagNumbers2,
52
+ getDroppedTagsByNumbers2,
53
+ getMaxDroppedTagNumber2,
54
+ getTagById2,
55
+ getTopNBySize2,
56
+ getToolTagNumberByOwner2,
57
+ getNullOwnerToolTag2,
58
+ adoptNullOwnerToolTag2,
59
+ getCandidateToolOwners2,
60
+ pickNearestPriorOwner2
61
+ } from "./index-kjd1fj55.js";
62
+ import"./index-mcgehvgw.js";
63
+ import"./index-3cgbv47m.js";
64
+ import"./index-r56xgha8.js";
65
+ import"./index-x3dcnxh0.js";
66
+ import"./index-0h2mkab2.js";
67
+ export {
68
+ AGE_RECLAIM_MIN_TOKENS2 as AGE_RECLAIM_MIN_TOKENS,
69
+ PiTagIdentityConflictError2 as PiTagIdentityConflictError,
70
+ TAG_SELECT_COLUMNS2 as TAG_SELECT_COLUMNS,
71
+ adoptFallbackTagMessageId2 as adoptFallbackTagMessageId,
72
+ adoptNullOwnerToolTag2 as adoptNullOwnerToolTag,
73
+ adoptPiFallbackMessageTag2 as adoptPiFallbackMessageTag,
74
+ adoptPiFallbackToolOwnerTag2 as adoptPiFallbackToolOwnerTag,
75
+ backfillTagTokenCounts2 as backfillTagTokenCounts,
76
+ deleteTagsByMessageId2 as deleteTagsByMessageId,
77
+ deriveTagLoadFloor2 as deriveTagLoadFloor,
78
+ findAdoptableFallbackTags2 as findAdoptableFallbackTags,
79
+ findPiFallbackToolOwnerTags2 as findPiFallbackToolOwnerTags,
80
+ findPiTagIdentityConflict2 as findPiTagIdentityConflict,
81
+ foldShrunkPartTags2 as foldShrunkPartTags,
82
+ getActiveTagTokenAggregate2 as getActiveTagTokenAggregate,
83
+ getActiveTagTokenTotalsByMessage2 as getActiveTagTokenTotalsByMessage,
84
+ getActiveTagsBySession2 as getActiveTagsBySession,
85
+ getActiveToolTagsForAgeReclaim2 as getActiveToolTagsForAgeReclaim,
86
+ getAllStatusTagTokenTotalsFlat2 as getAllStatusTagTokenTotalsFlat,
87
+ getAssignableTagNumberByMessageId2 as getAssignableTagNumberByMessageId,
88
+ getCandidateToolOwners2 as getCandidateToolOwners,
89
+ getDroppedTagsByNumbers2 as getDroppedTagsByNumbers,
90
+ getInertWhitespaceAssistantTagsByNumbers2 as getInertWhitespaceAssistantTagsByNumbers,
91
+ getMaxDroppedTagNumber2 as getMaxDroppedTagNumber,
92
+ getMaxTagNumberByOwnerMessage2 as getMaxTagNumberByOwnerMessage,
93
+ getMaxTagNumberBySession2 as getMaxTagNumberBySession,
94
+ getMinMessageTagNumberForRawId2 as getMinMessageTagNumberForRawId,
95
+ getNewestToolTagNumbers2 as getNewestToolTagNumbers,
96
+ getNullOwnerToolTag2 as getNullOwnerToolTag,
97
+ getOldestActiveUnprotectedToolTags2 as getOldestActiveUnprotectedToolTags,
98
+ getPersistedToolTagAccounting2 as getPersistedToolTagAccounting,
99
+ getPiMessageTagCandidates2 as getPiMessageTagCandidates,
100
+ getReasoningTokenEstimatesByMessage2 as getReasoningTokenEstimatesByMessage,
101
+ getRecentTagOwnerMessageIds2 as getRecentTagOwnerMessageIds,
102
+ getTagById2 as getTagById,
103
+ getTagNumberByMessageId2 as getTagNumberByMessageId,
104
+ getTagsByNumbers2 as getTagsByNumbers,
105
+ getTagsBySession2 as getTagsBySession,
106
+ getTagsForPendingOperations2 as getTagsForPendingOperations,
107
+ getToolTagNumberByOwner2 as getToolTagNumberByOwner,
108
+ getTopNBySize2 as getTopNBySize,
109
+ getTriggerTagTokenUpperBound2 as getTriggerTagTokenUpperBound,
110
+ hasPiFallbackMessageTags2 as hasPiFallbackMessageTags,
111
+ hasPiFallbackToolOwnerTags2 as hasPiFallbackToolOwnerTags,
112
+ insertTag2 as insertTag,
113
+ markTagsCompactedByMessageIds2 as markTagsCompactedByMessageIds,
114
+ pickNearestPriorOwner2 as pickNearestPriorOwner,
115
+ scanTagOwnerDelta2 as scanTagOwnerDelta,
116
+ scanTagOwnerSummary2 as scanTagOwnerSummary,
117
+ tagTokenCountIsNull2 as tagTokenCountIsNull,
118
+ tryGetReasoningTokenEstimatesByMessage2 as tryGetReasoningTokenEstimatesByMessage,
119
+ updateCavemanDepth2 as updateCavemanDepth,
120
+ updateTagByteSize2 as updateTagByteSize,
121
+ updateTagDropMode2 as updateTagDropMode,
122
+ updateTagInputByteSize2 as updateTagInputByteSize,
123
+ updateTagInputTokenCount2 as updateTagInputTokenCount,
124
+ updateTagMessageId2 as updateTagMessageId,
125
+ updateTagStatus2 as updateTagStatus,
126
+ updateTagTokenCount2 as updateTagTokenCount
127
+ };
@@ -1,39 +1,56 @@
1
1
  import {
2
2
  TOKEN_BUDGET_TOOL_REFUSAL
3
- } from "./index-7s8vw2y0.js";
3
+ } from "./index-3rea6zd9.js";
4
4
  import {
5
- setHarness,
6
- log
7
- } from "./index-7n8gb6j3.js";
5
+ setHarness2
6
+ } from "./index-0h2mkab2.js";
7
+ import {
8
+ log2
9
+ } from "./index-x3dcnxh0.js";
8
10
  import {
9
11
  resolveProjectIdentityForSession
10
- } from "./index-xpbh1ypk.js";
12
+ } from "./index-041ex0cj.js";
11
13
  import {
12
14
  openDatabase
13
- } from "./index-kztsbkqq.js";
14
- import"./index-0qejsd7f.js";
15
- import"./index-td885aah.js";
16
- import"./index-266qrgss.js";
15
+ } from "./index-t7xfqtg6.js";
16
+ import"./index-3cgbv47m.js";
17
+ import"./index-fapenpch.js";
18
+ import"./index-r024r8da.js";
19
+ import"./index-3mgf68pn.js";
20
+ import"./index-mcgehvgw.js";
21
+ import"./index-135e8hvg.js";
22
+ import"./index-8976mezv.js";
23
+ import"./index-r56xgha8.js";
17
24
  import {
18
25
  loadPiConfig,
19
26
  ensureProjectRegisteredFromPiDirectory,
20
27
  resolvePiHarnessKind,
21
28
  registerMagicContextTools
22
- } from "./index-k3ezsjng.js";
23
- import"./index-vgcemg0n.js";
24
- import"./index-spk5vrhy.js";
25
- import"./index-qaa5j277.js";
29
+ } from "./index-ehybv5nr.js";
30
+ import"./index-1evzceyw.js";
31
+ import"./index-bgmv2kaf.js";
32
+ import"./index-21v1kfs7.js";
33
+ import"./index-bejpsj10.js";
34
+ import"./index-yarjn32j.js";
35
+ import"./index-9p40dgkm.js";
36
+ import"./index-yhzhdp3m.js";
37
+ import"./index-904reqtg.js";
38
+ import"./index-yzcjxnt2.js";
39
+ import"./index-kjd1fj55.js";
40
+ import"./index-vakawmbc.js";
41
+ import"./index-hwqb3s7f.js";
42
+ import"./index-xjqheg7a.js";
43
+ import"./index-0vrkp1jq.js";
26
44
  import {
27
45
  setStoragePrivatePermissionEnforcement
28
46
  } from "./index-vf38qhee.js";
29
- import"./index-2p1e8706.js";
30
47
 
31
48
  // src/subagent-entry.ts
32
49
  import { readFileSync } from "node:fs";
33
50
  var SUBAGENT_DREAMER_ACTIONS_FLAG = "magic-context-dreamer-actions";
34
51
  var openedDb;
35
52
  function magicContextSubagentExtension(pi) {
36
- setHarness(resolvePiHarnessKind());
53
+ setHarness2(resolvePiHarnessKind());
37
54
  pi.registerFlag(SUBAGENT_DREAMER_ACTIONS_FLAG, {
38
55
  description: "Register ctx_memory with dreamer actions for Magic Context subagents.",
39
56
  type: "boolean",
@@ -67,6 +84,7 @@ function magicContextSubagentExtension(pi) {
67
84
  await ensureProjectRegisteredFromPiDirectory(directory, db);
68
85
  const dreamerActionsEnabled = pi.getFlag(SUBAGENT_DREAMER_ACTIONS_FLAG) === true;
69
86
  registerMagicContextTools(pi, {
87
+ rerankConnectionFile: cfg.subc?.connection_file,
70
88
  db,
71
89
  ensureProjectRegistered: ensureProjectRegisteredFromPiDirectory,
72
90
  resolveProjectIdentity: (ctx) => resolveProjectIdentityForSession(ctx.cwd, cfg.allow_home_project),
@@ -77,10 +95,10 @@ function magicContextSubagentExtension(pi) {
77
95
  todowriteCommandEnabled: false,
78
96
  promptSurface: registrationPromptSurface
79
97
  });
80
- 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})`);
98
+ log2(`[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})`);
81
99
  } catch (err) {
82
100
  const message = err instanceof Error ? err.message : String(err);
83
- log(`[pi-subagent] startup failed: ${message}`);
101
+ log2(`[pi-subagent] startup failed: ${message}`);
84
102
  process.exitCode = 1;
85
103
  throw err;
86
104
  }