@cortexkit/opencode-magic-context 0.49.15 → 0.49.16

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 (123) hide show
  1. package/dist/auto-search-worker.js +3 -3
  2. package/dist/chunk-embedding-write-worker.js +5 -3
  3. package/dist/config/schema/magic-context.d.ts +65 -65
  4. package/dist/config/schema/magic-context.d.ts.map +1 -1
  5. package/dist/{conflict-warning-hook-mgq17yr3.js → conflict-warning-hook-znry4j76.js} +5 -5
  6. package/dist/{context-0m46day0.js → context-3znk23va.js} +26 -20
  7. package/dist/{embedding-backfill-5e1t5wha.js → embedding-backfill-q4n8dend.js} +8 -6
  8. package/dist/embedding-worker.js +2 -2
  9. package/dist/features/magic-context/message-fts-rowid-map.d.ts +2 -2
  10. package/dist/features/magic-context/message-fts-rowid-map.d.ts.map +1 -1
  11. package/dist/features/magic-context/message-fts-session-filter.d.ts +2 -0
  12. package/dist/features/magic-context/message-fts-session-filter.d.ts.map +1 -1
  13. package/dist/features/magic-context/message-time-backfill.d.ts +2 -2
  14. package/dist/features/magic-context/message-time-backfill.d.ts.map +1 -1
  15. package/dist/features/magic-context/storage-db.d.ts +2 -1
  16. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  17. package/dist/hooks/magic-context/compartment-runner-historian.d.ts +2 -2
  18. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  19. package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
  20. package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
  21. package/dist/hooks/magic-context/historian-host-runner.d.ts.map +1 -1
  22. package/dist/hooks/magic-context/historian-prompt-fit.d.ts +2 -1
  23. package/dist/hooks/magic-context/historian-prompt-fit.d.ts.map +1 -1
  24. package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts +26 -0
  25. package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
  26. package/dist/hooks/magic-context/recomp-orchestrator.d.ts +3 -3
  27. package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
  28. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  29. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  30. package/dist/{index-xn6q9pg6.js → index-4qfy7v57.js} +11 -62
  31. package/dist/{index-e4dsjj1p.js → index-5mwk1nek.js} +1 -1
  32. package/dist/index-6a6dq53h.js +96 -0
  33. package/dist/{index-e20m7284.js → index-7b2cfmaz.js} +1 -1
  34. package/dist/{index-mmfa86mt.js → index-7pa32z07.js} +169 -149
  35. package/dist/{index-3kdm78zp.js → index-9nkg2dzk.js} +3 -3
  36. package/dist/{index-snp5wbge.js → index-ayym1x7f.js} +25 -23
  37. package/dist/{index-dgs16axy.js → index-b17m64g9.js} +1 -1
  38. package/dist/{index-yxycg7fs.js → index-cj9g0j7a.js} +22 -14
  39. package/dist/{index-dyvbsvga.js → index-dqe8pq4x.js} +21 -10
  40. package/dist/{index-42vcjcwe.js → index-ek1yxvvz.js} +34 -76
  41. package/dist/{index-3kx0kg0f.js → index-hehkf6zm.js} +3 -3
  42. package/dist/{index-944w16m0.js → index-j6zw70pf.js} +4 -4
  43. package/dist/index-kaqs6h31.js +58 -0
  44. package/dist/{index-ts1hjk1h.js → index-kn4t1haw.js} +15 -12
  45. package/dist/{index-1d289pq2.js → index-mtw9e71a.js} +1 -1
  46. package/dist/{index-mht7bq0z.js → index-nd7m2a5a.js} +7 -5
  47. package/dist/{index-thvnpfsv.js → index-p4vde22c.js} +14 -14
  48. package/dist/{index-y1qysm3q.js → index-qrahzcqv.js} +3 -3
  49. package/dist/{index-1vc7jrkg.js → index-v63beg1z.js} +3 -3
  50. package/dist/{index-mc1cqza6.js → index-v9asb16b.js} +4 -4
  51. package/dist/{index-1sarmj9z.js → index-wgypt3cs.js} +6 -6
  52. package/dist/{index-bxdg2nbt.js → index-wv9n2zcq.js} +1 -1
  53. package/dist/index.js +38 -36
  54. package/dist/message-fts-rowid-map-yvx5a9jw.js +23 -0
  55. package/dist/{message-index-bounded-vtgpq6b4.js → message-index-bounded-6th8djy9.js} +8 -8
  56. package/dist/{message-index-a6gztaqx.js → message-index-t4pz7akd.js} +9 -9
  57. package/dist/{message-time-backfill-qjge9044.js → message-time-backfill-8egzkd3z.js} +4 -4
  58. package/dist/migration-worker.js +4 -2
  59. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  60. package/dist/{project-embedding-registry-x45bv3qr.js → project-embedding-registry-2dea0a77.js} +7 -5
  61. package/dist/raw-ordinal-warmup-worker.js +37 -7
  62. package/dist/{read-session-chunk-3ae3nfdn.js → read-session-chunk-4pwqxm5a.js} +6 -6
  63. package/dist/{read-session-raw-m56hc7v2.js → read-session-raw-5ar8se5v.js} +1 -1
  64. package/dist/{recomp-orchestrator-nwzcfhx4.js → recomp-orchestrator-tjcaj5x7.js} +17 -17
  65. package/dist/search-archive-02jws7hw.js +25 -0
  66. package/dist/{search-deajrd90.js → search-rb01n29x.js} +15 -14
  67. package/dist/{send-session-notification-24r4esbh.js → send-session-notification-2x9edkrp.js} +4 -4
  68. package/dist/shared/model-suggestion-retry.d.ts +2 -0
  69. package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
  70. package/dist/shared/resolve-fallbacks.d.ts +3 -3
  71. package/dist/{storage-tags-s5bg1ahx.js → storage-tags-4z1w27xa.js} +1 -1
  72. package/dist/tools/ctx-expand/search-archive.d.ts +5 -1
  73. package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -1
  74. package/dist/{transform-postprocess-phase-ne3z1zmt.js → transform-postprocess-phase-xaw5c3xp.js} +17 -17
  75. package/dist/v2/auto-search-worker.js +3 -3
  76. package/dist/v2/chunk-embedding-write-worker.js +8 -6
  77. package/dist/v2/{context-4qczzck7.js → context-acw1nhv8.js} +52 -86
  78. package/dist/v2/{embedding-backfill-jmaf8zrr.js → embedding-backfill-jyd6492b.js} +10 -8
  79. package/dist/v2/embedding-worker.js +2 -2
  80. package/dist/v2/hooks/context.d.ts.map +1 -1
  81. package/dist/v2/message-fts-rowid-map-8vf0v7cr.js +22 -0
  82. package/dist/v2/{message-index-bounded-rxxznd34.js → message-index-bounded-dsrf49y7.js} +7 -7
  83. package/dist/v2/{message-index-f947qtbz.js → message-index-e6qzw477.js} +8 -8
  84. package/dist/v2/{message-time-backfill-bsteyc4d.js → message-time-backfill-q5pgxf0d.js} +4 -4
  85. package/dist/v2/migration-worker.js +6 -4
  86. package/dist/v2/{project-embedding-registry-0msp56p8.js → project-embedding-registry-rek75aqw.js} +9 -7
  87. package/dist/v2/raw-ordinal-warmup-worker.js +37 -7
  88. package/dist/v2/{read-session-chunk-rq9nx1nn.js → read-session-chunk-7bpygfv2.js} +5 -5
  89. package/dist/v2/{read-session-raw-b3tf6ra1.js → read-session-raw-pw2n1qgc.js} +1 -1
  90. package/dist/v2/{recomp-orchestrator-5zhxtwha.js → recomp-orchestrator-hzpgg06e.js} +18 -18
  91. package/dist/v2/search-archive-fn4wy8sx.js +24 -0
  92. package/dist/v2/{search-n8wqxb1j.js → search-sf2vg5pk.js} +17 -16
  93. package/dist/v2/{send-session-notification-8ghn9tnv.js → send-session-notification-hmr7q0nt.js} +2 -2
  94. package/dist/v2/{server-k2bzedxk.js → server-00hx04yn.js} +1 -1
  95. package/dist/v2/{server-atbc19ab.js → server-0mzjjw3s.js} +7 -5
  96. package/dist/v2/{server-ehyava47.js → server-1hcbw661.js} +3 -3
  97. package/dist/v2/{server-th4y11y7.js → server-271qxsf5.js} +6 -6
  98. package/dist/v2/{server-prg55b7k.js → server-6714jebr.js} +22 -2
  99. package/dist/v2/{server-dd0tz6cn.js → server-6fyp0v67.js} +26 -24
  100. package/dist/v2/{server-yrvqaswb.js → server-785mb90s.js} +21 -10
  101. package/dist/v2/{server-ef89gdsx.js → server-aavz8pm6.js} +3 -3
  102. package/dist/v2/{server-gvkm8xaj.js → server-e3ftpk7v.js} +1 -1
  103. package/dist/v2/{server-e298hswg.js → server-g59aatsz.js} +14 -14
  104. package/dist/v2/{server-g10mdym6.js → server-gha9x4qq.js} +1 -1
  105. package/dist/v2/{server-4gn3z5an.js → server-hgg55hde.js} +1 -1
  106. package/dist/v2/server-kaqs6h31.js +58 -0
  107. package/dist/v2/{server-qhfvvfxj.js → server-kqpawe1a.js} +3 -3
  108. package/dist/v2/{server-hek6z3w6.js → server-kr2kc9dz.js} +5 -5
  109. package/dist/v2/{server-cfbr1s2x.js → server-n5q841qn.js} +12 -63
  110. package/dist/v2/{server-kmbarfmn.js → server-r9gjxcte.js} +24 -16
  111. package/dist/v2/{server-6cdy4rc0.js → server-vgpab6rd.js} +2 -2
  112. package/dist/v2/{server-zc3e54vy.js → server-y5pznjt9.js} +1 -1
  113. package/dist/v2/server-zyw55ygv.js +96 -0
  114. package/dist/v2/server.js +4 -4
  115. package/dist/v2/{storage-tags-hcc2adpf.js → storage-tags-hkwtbp3g.js} +1 -1
  116. package/dist/v2/{wrapup-orchestrator-65pwye0d.js → wrapup-orchestrator-x4xj1782.js} +18 -18
  117. package/dist/{wrapup-orchestrator-28xzsj5q.js → wrapup-orchestrator-vj2tbp22.js} +18 -18
  118. package/package.json +1 -1
  119. package/src/config/schema/magic-context.ts +14 -6
  120. package/src/shared/model-resolution.test.ts +22 -0
  121. package/src/shared/model-suggestion-retry.ts +9 -3
  122. package/src/shared/resolve-fallbacks.test.ts +2 -3
  123. package/src/shared/resolve-fallbacks.ts +3 -3
@@ -15,7 +15,7 @@ import {
15
15
  getActiveCompartmentRun,
16
16
  markActiveCompartmentRunPublished,
17
17
  registerActiveCompartmentRun
18
- } from "./index-snp5wbge.js";
18
+ } from "./index-ayym1x7f.js";
19
19
  import {
20
20
  inRootAsyncContext2
21
21
  } from "./index-wafzvyhg.js";
@@ -27,17 +27,17 @@ import {
27
27
  getHistorianFailureState,
28
28
  clearEmergencyRecovery,
29
29
  prepareRawSessionOrdinals2
30
- } from "./index-944w16m0.js";
30
+ } from "./index-j6zw70pf.js";
31
31
  import {
32
32
  pushNotification2
33
33
  } from "./index-x8a7jmkh.js";
34
34
  import {
35
35
  sendStatusNotification2
36
- } from "./index-dgs16axy.js";
36
+ } from "./index-b17m64g9.js";
37
37
  import {
38
38
  setRecompStarting2,
39
39
  setRecompTerminal2
40
- } from "./index-1vc7jrkg.js";
40
+ } from "./index-v63beg1z.js";
41
41
 
42
42
  // src/hooks/magic-context/wrapup-orchestrator.ts
43
43
  import * as crypto from "node:crypto";
@@ -5517,18 +5517,18 @@ var OmpEntryObjectSchema = object({
5517
5517
  }).strict();
5518
5518
  var OmpEntrySchema = union([string(), OmpEntryObjectSchema]);
5519
5519
  var OpenCodeHarnessBlockSchema = object({
5520
- model: OcEntrySchema.optional().describe("Primary OpenCode model entry."),
5521
- fallback_models: array(OcEntrySchema).optional().describe("Ordered fallback OpenCode entries. New-shape configuration requires an array; legacy singleton values migrate to a one-element array."),
5520
+ model: OcEntrySchema.optional().describe("Primary historian OpenCode model entry. When set, only this model and fallback_models are used; exhaustion reports failure, never the session model. When absent, OpenCode inherits the session model."),
5521
+ fallback_models: array(OcEntrySchema).optional().describe("Ordered historian fallback OpenCode entries. A configured primary never adds the session model after this list. Requires an array; legacy singleton values migrate to a one-element array."),
5522
5522
  variant: string().optional().describe("OpenCode reasoning variant for the primary entry when it declares none. Fallback entries declare variants per-entry.")
5523
5523
  }).strict().describe("Strict OpenCode model-resolution block. It accepts no Pi vocabulary.");
5524
5524
  var PiHarnessBlockSchema = object({
5525
- model: PiEntrySchema.optional().describe("Primary Pi model entry."),
5526
- fallback_models: array(PiEntrySchema).optional().describe("Ordered fallback Pi entries. New-shape configuration requires an array; legacy singleton values migrate to a one-element array."),
5525
+ model: PiEntrySchema.optional().describe("Primary historian Pi model entry. When set, only this model and fallback_models are used; exhaustion reports failure, never the session model. When absent, Pi does not run the historian."),
5526
+ fallback_models: array(PiEntrySchema).optional().describe("Ordered historian fallback Pi entries. The session model is never appended. Requires an array; legacy singleton values migrate to a one-element array."),
5527
5527
  thinking_level: PiThinkingLevelSchema.describe("Pi thinking level for the primary entry when it declares none. Fallback entries declare thinking levels per-entry.")
5528
5528
  }).strict().describe("Strict Pi model-resolution block. It accepts no OpenCode vocabulary.");
5529
5529
  var OmpHarnessBlockSchema = object({
5530
- model: OmpEntrySchema.optional().describe("Primary OMP model entry."),
5531
- fallback_models: array(OmpEntrySchema).optional().describe("Ordered fallback OMP entries."),
5530
+ model: OmpEntrySchema.optional().describe("Primary historian OMP model entry. When set, only this model and fallback_models are used; exhaustion reports failure, never the session model. An absent OMP block inherits the Pi block; a selected block without a model does not run the historian."),
5531
+ fallback_models: array(OmpEntrySchema).optional().describe("Ordered historian fallback OMP entries. The session model is never appended."),
5532
5532
  thinking_level: OmpThinkingLevelSchema.describe("OMP thinking level for the primary entry when it declares none. Fallback entries declare thinking levels per-entry.")
5533
5533
  }).strict().describe("Strict OMP model-resolution block. It accepts no OpenCode vocabulary.");
5534
5534
  var OpenCodeTaskExecutionSchema = object({
@@ -17,7 +17,7 @@ import {
17
17
  } from "./index-wk0n1cgt.js";
18
18
  import {
19
19
  embedTextForProject2
20
- } from "./index-y1qysm3q.js";
20
+ } from "./index-qrahzcqv.js";
21
21
  import {
22
22
  saveEmbeddingIfHashMatches
23
23
  } from "./index-4dhv7mqz.js";
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  detectOverflow,
29
29
  isAnthropicFamilyRoute,
30
30
  readRawSessionMessages2
31
- } from "./index-944w16m0.js";
31
+ } from "./index-j6zw70pf.js";
32
32
  import {
33
33
  setHarness2
34
34
  } from "./index-pavzsdc6.js";
@@ -56,7 +56,7 @@ import {
56
56
  record,
57
57
  DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE,
58
58
  DEFAULT_HISTORIAN_TIMEOUT_MS
59
- } from "./index-1sarmj9z.js";
59
+ } from "./index-wgypt3cs.js";
60
60
  import {
61
61
  denyTaskRoutingToCallerAgents,
62
62
  buildHiddenAgentRegistrations,
@@ -97,7 +97,7 @@ import {
97
97
  checkCompactionMarkerConsistency,
98
98
  clearInjectionCache,
99
99
  clearNoteNudgeTriggerOnly
100
- } from "./index-snp5wbge.js";
100
+ } from "./index-ayym1x7f.js";
101
101
  import"./index-sd3egckz.js";
102
102
  import {
103
103
  hasTrustedAbsoluteWall,
@@ -185,7 +185,7 @@ import {
185
185
  parameterDescriptionsFor,
186
186
  MagicContextRpcServer,
187
187
  applyHiddenSubagentTemperature
188
- } from "./index-42vcjcwe.js";
188
+ } from "./index-ek1yxvvz.js";
189
189
  import {
190
190
  resolveOpenCodeDbPath,
191
191
  openCodeDbPathExists,
@@ -209,7 +209,7 @@ import {
209
209
  openDatabaseAsync,
210
210
  isDatabasePersisted,
211
211
  getDatabasePersistenceError
212
- } from "./index-yxycg7fs.js";
212
+ } from "./index-cj9g0j7a.js";
213
213
  import {
214
214
  setHomeProjectPermission,
215
215
  ProjectIdentityError,
@@ -229,13 +229,20 @@ import {
229
229
  observeSessionActivity,
230
230
  backfillSessionActivity,
231
231
  deleteIndexedMessage2
232
- } from "./index-thvnpfsv.js";
232
+ } from "./index-p4vde22c.js";
233
233
  import {
234
234
  recordSessionProjectIdentity
235
235
  } from "./index-saews2s3.js";
236
236
  import"./index-nj7yykkx.js";
237
237
  import"./index-fb3zxn06.js";
238
- import"./index-dyvbsvga.js";
238
+ import {
239
+ registerExitAbort,
240
+ unregisterExitAbort
241
+ } from "./index-v0p37hm2.js";
242
+ import {
243
+ forgetRawSessionOrdinalWatermark2
244
+ } from "./index-7pa32z07.js";
245
+ import"./index-dqe8pq4x.js";
239
246
  import"./index-wk0n1cgt.js";
240
247
  import"./index-fr0wbhdn.js";
241
248
  import {
@@ -249,25 +256,18 @@ import"./index-fkx2qnvw.js";
249
256
  import {
250
257
  getDefaultSubcConnectionFile,
251
258
  SubcModuleTransport
252
- } from "./index-xn6q9pg6.js";
259
+ } from "./index-4qfy7v57.js";
253
260
  import"./index-qt1qqasc.js";
254
261
  import"./index-y9f76s3f.js";
255
- import {
256
- registerExitAbort,
257
- unregisterExitAbort
258
- } from "./index-v0p37hm2.js";
259
- import {
260
- forgetRawSessionOrdinalWatermark2
261
- } from "./index-mmfa86mt.js";
262
262
  import {
263
263
  observeOpenCodeTurnEvent,
264
264
  clearTrackedOpenCodeSession,
265
265
  findLastAssistantModelFromOpenCodeDb
266
- } from "./index-1d289pq2.js";
266
+ } from "./index-mtw9e71a.js";
267
267
  import {
268
268
  sendCommandResult2,
269
269
  sendStatusNotification2
270
- } from "./index-dgs16axy.js";
270
+ } from "./index-b17m64g9.js";
271
271
  import {
272
272
  detectConflicts,
273
273
  resolveCompactionForBoot
@@ -275,13 +275,13 @@ import {
275
275
  import {
276
276
  sendConflictWarning2,
277
277
  cleanupConflictWarnings2
278
- } from "./index-e4dsjj1p.js";
278
+ } from "./index-5mwk1nek.js";
279
279
  import"./index-1zx87sdm.js";
280
280
  import {
281
281
  stripPersistedAssistantText,
282
282
  deleteTagsByMessageId2,
283
283
  getMaxTagNumberBySession2
284
- } from "./index-mht7bq0z.js";
284
+ } from "./index-nd7m2a5a.js";
285
285
  import {
286
286
  resolveHistorianModel2,
287
287
  resolveOpenCodeAgentOverrides2,
@@ -291,15 +291,15 @@ import {
291
291
  getEmbedDrainUiStatus,
292
292
  clearEmbedSessionState,
293
293
  getEmbeddingCoverageStatus2
294
- } from "./index-y1qysm3q.js";
295
- import"./index-3kx0kg0f.js";
296
- import"./index-bxdg2nbt.js";
294
+ } from "./index-qrahzcqv.js";
295
+ import"./index-hehkf6zm.js";
296
+ import"./index-wv9n2zcq.js";
297
297
  import {
298
298
  pushNotification2
299
299
  } from "./index-x8a7jmkh.js";
300
- import"./index-e20m7284.js";
300
+ import"./index-7b2cfmaz.js";
301
301
  import"./index-4dhv7mqz.js";
302
- import"./index-3kdm78zp.js";
302
+ import"./index-9nkg2dzk.js";
303
303
  import"./index-n78avt2p.js";
304
304
  import"./index-f71thw8j.js";
305
305
  import {
@@ -308,10 +308,10 @@ import {
308
308
  setCtxReduceRegisteredGlobally,
309
309
  clearToolPermissionDenied,
310
310
  resetDegradedCacheCount2
311
- } from "./index-ts1hjk1h.js";
311
+ } from "./index-kn4t1haw.js";
312
312
  import {
313
313
  runManagedRecomp2
314
- } from "./index-1vc7jrkg.js";
314
+ } from "./index-v63beg1z.js";
315
315
  import {
316
316
  isValidSemver,
317
317
  compareSemverCore
@@ -319,7 +319,9 @@ import {
319
319
  import"./index-fmsr7v69.js";
320
320
  import {
321
321
  runManagedWrapup2
322
- } from "./index-mc1cqza6.js";
322
+ } from "./index-v9asb16b.js";
323
+ import"./index-kaqs6h31.js";
324
+ import"./index-6a6dq53h.js";
323
325
  import {
324
326
  isDreamerRunnable,
325
327
  isSmartNoteSurfaceAvailable,
@@ -8187,7 +8189,7 @@ var require_src2 = __commonJS(function(exports, module) {
8187
8189
  // package.json
8188
8190
  var package_default = {
8189
8191
  name: "@cortexkit/opencode-magic-context",
8190
- version: "0.49.15",
8192
+ version: "0.49.16",
8191
8193
  type: "module",
8192
8194
  description: "OpenCode plugin for Magic Context — cross-session memory and context management",
8193
8195
  main: "dist/index.js",
@@ -12033,7 +12035,7 @@ async function setup(context) {
12033
12035
  if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
12034
12036
  log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
12035
12037
  }
12036
- const { registerContext } = await import("./context-0m46day0.js");
12038
+ const { registerContext } = await import("./context-3znk23va.js");
12037
12039
  setHarness2("opencode2");
12038
12040
  bindStaleBuildNotice({}, import.meta.url, "opencode2");
12039
12041
  const duties = await registerContext(context);
@@ -12112,7 +12114,7 @@ var server = async (ctx) => {
12112
12114
  if (hasBannerEntries)
12113
12115
  setTimeout(async () => {
12114
12116
  try {
12115
- const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-24r4esbh.js"));
12117
+ const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-2x9edkrp.js"));
12116
12118
  const clientWithSessions = ctx.client;
12117
12119
  const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
12118
12120
  const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
@@ -12130,7 +12132,7 @@ var server = async (ctx) => {
12130
12132
  log2(`[magic-context] opencode_db_missing path=${openCodeDbResolution.path} source=${openCodeDbResolution.source}`);
12131
12133
  setTimeout(async () => {
12132
12134
  try {
12133
- const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-24r4esbh.js"));
12135
+ const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-2x9edkrp.js"));
12134
12136
  const clientWithSessions = ctx.client;
12135
12137
  const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
12136
12138
  const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
@@ -12407,12 +12409,12 @@ var server = async (ctx) => {
12407
12409
  {
12408
12410
  const fence = getSchemaFenceRejection();
12409
12411
  if (fence) {
12410
- importPluginModule(() => import("./conflict-warning-hook-mgq17yr3.js")).then(({ sendSchemaFenceWarning }) => sendSchemaFenceWarning(ctx.client, ctx.directory, fence)).catch((error) => log2("[magic-context] schema-fence warning unavailable:", error));
12412
+ importPluginModule(() => import("./conflict-warning-hook-znry4j76.js")).then(({ sendSchemaFenceWarning }) => sendSchemaFenceWarning(ctx.client, ctx.directory, fence)).catch((error) => log2("[magic-context] schema-fence warning unavailable:", error));
12411
12413
  }
12412
12414
  }
12413
12415
  const serverUrl = ctx.serverUrl;
12414
12416
  const serverUrlStr = serverUrl instanceof URL ? serverUrl.toString().replace(/\/$/, "") : typeof serverUrl === "string" ? serverUrl.replace(/\/$/, "") : undefined;
12415
- importPluginModule(() => import("./send-session-notification-24r4esbh.js")).then(({ setNotificationServerUrl }) => {
12417
+ importPluginModule(() => import("./send-session-notification-2x9edkrp.js")).then(({ setNotificationServerUrl }) => {
12416
12418
  setNotificationServerUrl(serverUrlStr);
12417
12419
  }).catch((error) => log2("[magic-context] notification transport unavailable:", error));
12418
12420
  if (conflictResult?.hasConflict) {
@@ -12435,7 +12437,7 @@ var server = async (ctx) => {
12435
12437
  }) => {
12436
12438
  if (!shouldShowAnnouncement())
12437
12439
  return;
12438
- return importPluginModule(() => import("./conflict-warning-hook-mgq17yr3.js")).then(({ sendStartupAnnouncement }) => sendStartupAnnouncement(ctx.client, ctx.directory, ANNOUNCEMENT_VERSION, ANNOUNCEMENT_FEATURES, ANNOUNCEMENT_FOOTER, markAnnouncementSeen));
12440
+ return importPluginModule(() => import("./conflict-warning-hook-znry4j76.js")).then(({ sendStartupAnnouncement }) => sendStartupAnnouncement(ctx.client, ctx.directory, ANNOUNCEMENT_VERSION, ANNOUNCEMENT_FEATURES, ANNOUNCEMENT_FOOTER, markAnnouncementSeen));
12439
12441
  }).catch(() => {});
12440
12442
  }, 8000);
12441
12443
  }
@@ -12509,8 +12511,8 @@ var server = async (ctx) => {
12509
12511
  tryReopenStorage,
12510
12512
  rustReplayParticipant: () => magicContextRuntime.magicContext?.getRustReplayParticipant?.() ?? null,
12511
12513
  onStorageBusyRefusal: async (sessionId, message) => {
12512
- const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-24r4esbh.js"));
12513
- const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-ne3z1zmt.js"));
12514
+ const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-2x9edkrp.js"));
12515
+ const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-xaw5c3xp.js"));
12514
12516
  await sendStatusNotification(ctx.client, sessionId, message, {
12515
12517
  toastDurationMs: 15000
12516
12518
  });
@@ -0,0 +1,23 @@
1
+ import {
2
+ recordMessageFtsRowid2,
3
+ recordIndexedMessageTime2,
4
+ runMessageFtsRowidMapBackfill2,
5
+ startMessageFtsRowidMapBackfill2,
6
+ messageFtsOrdinalRangeIsMapped2,
7
+ deleteUnmappedMessageFtsRows2
8
+ } from "./index-dqe8pq4x.js";
9
+ import"./index-7pa32z07.js";
10
+ import"./index-v0p37hm2.js";
11
+ import"./index-k29z4aqh.js";
12
+ import"./index-wafzvyhg.js";
13
+ import"./index-j75v2476.js";
14
+ import"./index-g2q4htwp.js";
15
+ import"./index-pavzsdc6.js";
16
+ export {
17
+ deleteUnmappedMessageFtsRows2 as deleteUnmappedMessageFtsRows,
18
+ messageFtsOrdinalRangeIsMapped2 as messageFtsOrdinalRangeIsMapped,
19
+ recordIndexedMessageTime2 as recordIndexedMessageTime,
20
+ recordMessageFtsRowid2 as recordMessageFtsRowid,
21
+ runMessageFtsRowidMapBackfill2 as runMessageFtsRowidMapBackfill,
22
+ startMessageFtsRowidMapBackfill2 as startMessageFtsRowidMapBackfill
23
+ };
@@ -4,18 +4,18 @@ import {
4
4
  yieldIndexChunk2
5
5
  } from "./index-wafzvyhg.js";
6
6
  import"./index-1zx87sdm.js";
7
- import"./index-mht7bq0z.js";
7
+ import"./index-nd7m2a5a.js";
8
8
  import"./index-hqkczed7.js";
9
9
  import"./index-pavzsdc6.js";
10
10
  import"./index-g2q4htwp.js";
11
11
  import"./index-j75v2476.js";
12
12
  import"./index-bp5083x2.js";
13
- import"./index-1sarmj9z.js";
13
+ import"./index-wgypt3cs.js";
14
14
  import"./index-v0p37hm2.js";
15
- import"./index-mmfa86mt.js";
15
+ import"./index-7pa32z07.js";
16
16
  import"./index-58e3y90n.js";
17
- import"./index-1d289pq2.js";
18
- import"./index-944w16m0.js";
17
+ import"./index-mtw9e71a.js";
18
+ import"./index-j6zw70pf.js";
19
19
  import"./index-n6m03s3n.js";
20
20
  import {
21
21
  MESSAGE_INDEX_MAX_FTS_BYTES2,
@@ -24,11 +24,11 @@ import {
24
24
  markMessageIndexDirty2,
25
25
  getIndexableContent2,
26
26
  indexSingleMessage2
27
- } from "./index-thvnpfsv.js";
28
- import"./index-dyvbsvga.js";
27
+ } from "./index-p4vde22c.js";
28
+ import"./index-dqe8pq4x.js";
29
29
  import"./index-nj7yykkx.js";
30
30
  import"./index-fkx2qnvw.js";
31
- import"./index-3kx0kg0f.js";
31
+ import"./index-hehkf6zm.js";
32
32
  import"./index-k29z4aqh.js";
33
33
 
34
34
  // src/features/magic-context/message-index-bounded.ts
@@ -17,21 +17,21 @@ import {
17
17
  indexMessagesAfterOrdinal2,
18
18
  indexSourcesAfterOrdinal2,
19
19
  sweepOrphanedOpenCodeMessageIndexes2
20
- } from "./index-thvnpfsv.js";
21
- import"./index-944w16m0.js";
22
- import"./index-mht7bq0z.js";
20
+ } from "./index-p4vde22c.js";
21
+ import"./index-j6zw70pf.js";
22
+ import"./index-nd7m2a5a.js";
23
23
  import"./index-1zx87sdm.js";
24
- import"./index-1d289pq2.js";
25
- import"./index-mmfa86mt.js";
26
- import"./index-v0p37hm2.js";
27
- import"./index-1sarmj9z.js";
28
- import"./index-3kx0kg0f.js";
24
+ import"./index-mtw9e71a.js";
25
+ import"./index-wgypt3cs.js";
26
+ import"./index-hehkf6zm.js";
29
27
  import"./index-fkx2qnvw.js";
30
- import"./index-dyvbsvga.js";
28
+ import"./index-dqe8pq4x.js";
31
29
  import"./index-nj7yykkx.js";
32
30
  import"./index-n6m03s3n.js";
33
31
  import"./index-bp5083x2.js";
34
32
  import"./index-58e3y90n.js";
33
+ import"./index-7pa32z07.js";
34
+ import"./index-v0p37hm2.js";
35
35
  import"./index-k29z4aqh.js";
36
36
  import"./index-hqkczed7.js";
37
37
  import"./index-wafzvyhg.js";
@@ -96,20 +96,20 @@ function backfillMessageTimesBatch(db, reader, batchSize = MESSAGE_TIME_BACKFILL
96
96
  completed
97
97
  };
98
98
  }
99
- async function runMessageTimeBackfill(db, reader) {
99
+ async function runMessageTimeBackfill(db, reader, signal) {
100
100
  await new Promise((resolve) => setTimeout(resolve, 0));
101
- for (;; ) {
101
+ while (!signal?.aborted) {
102
102
  const progress = backfillMessageTimesBatch(db, reader);
103
103
  if (progress.completed)
104
104
  return;
105
105
  await new Promise((resolve) => setTimeout(resolve, 0));
106
106
  }
107
107
  }
108
- function startMessageTimeBackfill(db, reader) {
108
+ function startMessageTimeBackfill(db, reader, signal) {
109
109
  const active = activeBackfills.get(db);
110
110
  if (active)
111
111
  return active;
112
- const run = withoutSqliteTransformPass2(() => withSqliteBackgroundWriter2(() => runMessageTimeBackfill(db, reader))).finally(() => activeBackfills.delete(db));
112
+ const run = withoutSqliteTransformPass2(() => withSqliteBackgroundWriter2(() => runMessageTimeBackfill(db, reader, signal))).finally(() => activeBackfills.delete(db));
113
113
  activeBackfills.set(db, run);
114
114
  return run;
115
115
  }
@@ -19,8 +19,10 @@ import"./index-fb3zxn06.js";
19
19
  import {
20
20
  setSqlitePragmaConfig,
21
21
  initializeDatabase
22
- } from "./index-yxycg7fs.js";
23
- import"./index-dyvbsvga.js";
22
+ } from "./index-cj9g0j7a.js";
23
+ import"./index-v0p37hm2.js";
24
+ import"./index-7pa32z07.js";
25
+ import"./index-dqe8pq4x.js";
24
26
  import"./index-hqkczed7.js";
25
27
  import"./index-n6m03s3n.js";
26
28
  import {
@@ -1 +1 @@
1
- {"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;;;;;mBAa3D,CAAC;aACX,CAAC;aAA2B,CAAC;eAA6B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;2BAiHkorC,CAAC;;;;eAA8iB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA3GzvsC;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;;;;;;;;;;;;;qBAkG64I,CAAC;8BAAwC,CAAC;iBAA8C,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAArzF,CAAC;mBAA6B,CAAC;iBAA2B,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;iBAA2D,CAAC;;oBAA4D,CAAC;uBAAiC,CAAC;yBAAoC,CAAC;;;;;;0BAAy25C,CAAC;;;;;;;;;;;;;;;;EAvDp39C;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACjE;;;;;;;;;;;;;qBA6C64I,CAAC;8BAAwC,CAAC;iBAA8C,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAArzF,CAAC;mBAA6B,CAAC;iBAA2B,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;iBAA2D,CAAC;;oBAA4D,CAAC;uBAAiC,CAAC;yBAAoC,CAAC;;;;;;0BAAy25C,CAAC;;;;;;;;;;;;;;;;GADp39C"}
1
+ {"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;;;;;mBAa3D,CAAC;aACX,CAAC;aAA2B,CAAC;eAA6B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;2BAiH44sC,CAAC;;;;eAA8iB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA3GnguC;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;;;;;;;;;;;;;qBAkG64I,CAAC;8BAAwC,CAAC;iBAA8C,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAArzF,CAAC;mBAA6B,CAAC;iBAA2B,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;iBAA2D,CAAC;;oBAA4D,CAAC;uBAAiC,CAAC;yBAAoC,CAAC;;;;;;0BAAq35C,CAAC;;;;;;;;;;;;;;;;EAvDh49C;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACjE;;;;;;;;;;;;;qBA6C64I,CAAC;8BAAwC,CAAC;iBAA8C,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAArzF,CAAC;mBAA6B,CAAC;iBAA2B,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;iBAA2D,CAAC;;oBAA4D,CAAC;uBAAiC,CAAC;yBAAoC,CAAC;;;;;;0BAAq35C,CAAC;;;;;;;;;;;;;;;;GADh49C"}
@@ -34,16 +34,18 @@ import {
34
34
  sweepAllRegisteredProjects2,
35
35
  _setTestProviderFactoryForProject2,
36
36
  _resetProjectEmbeddingRegistryForTests2
37
- } from "./index-y1qysm3q.js";
37
+ } from "./index-qrahzcqv.js";
38
38
  import"./index-4dhv7mqz.js";
39
39
  import"./index-qt1qqasc.js";
40
- import"./index-e20m7284.js";
41
- import"./index-1sarmj9z.js";
40
+ import"./index-7b2cfmaz.js";
41
+ import"./index-wgypt3cs.js";
42
42
  import"./index-saews2s3.js";
43
- import"./index-3kx0kg0f.js";
43
+ import"./index-hehkf6zm.js";
44
44
  import"./index-fkx2qnvw.js";
45
45
  import"./index-a8bvhwqs.js";
46
- import"./index-dyvbsvga.js";
46
+ import"./index-dqe8pq4x.js";
47
+ import"./index-7pa32z07.js";
48
+ import"./index-v0p37hm2.js";
47
49
  import"./index-k29z4aqh.js";
48
50
  import"./index-hqkczed7.js";
49
51
  import"./index-wafzvyhg.js";
@@ -12,7 +12,7 @@ var [
12
12
  { log }
13
13
  ] = await Promise.all([
14
14
  import("./sqlite-4pqyynrs.js"),
15
- import("./read-session-raw-m56hc7v2.js"),
15
+ import("./read-session-raw-5ar8se5v.js"),
16
16
  import("./harness-e4avh192.js"),
17
17
  import("./logger-jm3sqqzr.js")
18
18
  ]);
@@ -21,9 +21,36 @@ registerSqliteDiagnosticSink(log, getHarness);
21
21
  var db;
22
22
  var reply;
23
23
  try {
24
- db = input.indexMessage || input.orphanSweep ? new Database(input.path) : new Database(input.path, { readonly: true });
24
+ if (input.openCancellation && Atomics.load(new Int32Array(input.openCancellation), 0) !== 0) {
25
+ throw new Error("warm-up owner closed before database open");
26
+ }
27
+ db = input.indexMessage || input.orphanSweep || input.ftsRowidBackfill ? new Database(input.path) : new Database(input.path, { readonly: true });
25
28
  db.exec("PRAGMA busy_timeout = 250");
26
- if (input.exactOrdinalIds) {
29
+ if (input.ftsRowidBackfill) {
30
+ const { runMessageFtsRowidMapBackfill } = await import("./message-fts-rowid-map-yvx5a9jw.js");
31
+ db.exec("PRAGMA busy_timeout = 0");
32
+ await runMessageFtsRowidMapBackfill(db);
33
+ reply = { kind: "fts-rowid-backfill" };
34
+ } else if (input.searchArchive) {
35
+ const { renderSearchArchive } = await import("./search-archive-02jws7hw.js");
36
+ const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-5ar8se5v.js");
37
+ const archive = input.searchArchive;
38
+ let raw;
39
+ try {
40
+ reply = {
41
+ kind: "search-archive",
42
+ text: renderSearchArchive(db, input.sessionId, archive.start, archive.end, archive.tokenBudget, archive.archiveOnly, () => {
43
+ if (!archive.rawPath)
44
+ return new Map(archive.rawIds);
45
+ raw = new Database(archive.rawPath, { readonly: true });
46
+ raw.exec("PRAGMA busy_timeout = 250");
47
+ return readRawSessionMessageIdOrdinalsForRangeFromDb(raw, input.sessionId, archive.start, archive.end);
48
+ })
49
+ };
50
+ } finally {
51
+ raw?.close();
52
+ }
53
+ } else if (input.exactOrdinalIds) {
27
54
  reply = {
28
55
  kind: "exact-ordinal-ids",
29
56
  ids: readRawSessionMessageIdsAtOrdinalsFromDb(db, input.sessionId, input.exactOrdinalIds)
@@ -35,7 +62,7 @@ try {
35
62
  { configureContextDatabasePragmas }
36
63
  ] = await Promise.all([
37
64
  import("./harness-e4avh192.js"),
38
- import("./message-index-a6gztaqx.js"),
65
+ import("./message-index-t4pz7akd.js"),
39
66
  import("./sqlite-context-pragmas-mv9jqwjh.js")
40
67
  ]);
41
68
  setHarness(input.harness ?? "opencode");
@@ -49,7 +76,7 @@ try {
49
76
  const { setHarness } = await import("./harness-e4avh192.js");
50
77
  setHarness(input.harness ?? "opencode");
51
78
  const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
52
- import("./message-index-bounded-vtgpq6b4.js"),
79
+ import("./message-index-bounded-6th8djy9.js"),
53
80
  import("./sqlite-context-pragmas-mv9jqwjh.js")
54
81
  ]);
55
82
  configureContextDatabasePragmas(db);
@@ -59,7 +86,7 @@ try {
59
86
  const result = await indexMessageInShortChunks(writer, input.sessionId, message, input, () => !cancellation || Atomics.load(cancellation, 0) === 0);
60
87
  reply = { kind: "indexed", inserted: result.inserted, measurements: result.measurements };
61
88
  } else if (input.tagRatio !== undefined) {
62
- const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-s5bg1ahx.js");
89
+ const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-4z1w27xa.js");
63
90
  const delta = input.tagState ? scanTagOwnerDelta(db, input.sessionId, input.tagState) : null;
64
91
  if (delta)
65
92
  reply = { kind: "tag-delta", delta };
@@ -73,9 +100,12 @@ try {
73
100
  reply = { kind: "scan", scan };
74
101
  }
75
102
  } catch (error) {
103
+ const sqliteError = error;
76
104
  reply = {
77
105
  kind: "error",
78
- error: error instanceof Error ? error.stack ?? error.message : String(error)
106
+ error: error instanceof Error ? error.stack ?? error.message : String(error),
107
+ code: typeof sqliteError?.code === "string" ? sqliteError.code : undefined,
108
+ errcode: typeof sqliteError?.errcode === "number" ? sqliteError.errcode : undefined
79
109
  };
80
110
  } finally {
81
111
  db?.close();
@@ -35,16 +35,16 @@ import {
35
35
  readSessionChunk2,
36
36
  getRawSessionMessageIdsThrough2,
37
37
  readRawSessionSeedTail2
38
- } from "./index-944w16m0.js";
39
- import"./index-mht7bq0z.js";
38
+ } from "./index-j6zw70pf.js";
39
+ import"./index-nd7m2a5a.js";
40
40
  import"./index-1zx87sdm.js";
41
- import"./index-1d289pq2.js";
42
- import"./index-mmfa86mt.js";
43
- import"./index-v0p37hm2.js";
44
- import"./index-1sarmj9z.js";
41
+ import"./index-mtw9e71a.js";
42
+ import"./index-wgypt3cs.js";
45
43
  import"./index-n6m03s3n.js";
46
44
  import"./index-bp5083x2.js";
47
45
  import"./index-58e3y90n.js";
46
+ import"./index-7pa32z07.js";
47
+ import"./index-v0p37hm2.js";
48
48
  import"./index-k29z4aqh.js";
49
49
  import {
50
50
  hasMeaningfulUserText2,
@@ -27,7 +27,7 @@ import {
27
27
  hasRawSessionMessageByIdFromDb2,
28
28
  readRawSeedTailFromDb2,
29
29
  readRawSessionBoundaryEndpointsFromDb2
30
- } from "./index-mmfa86mt.js";
30
+ } from "./index-7pa32z07.js";
31
31
  import"./index-v0p37hm2.js";
32
32
  import"./index-wafzvyhg.js";
33
33
  import"./index-j75v2476.js";
@@ -7,42 +7,42 @@ import {
7
7
  setRecompTerminal2,
8
8
  buildRecompDeps2,
9
9
  runManagedRecomp2
10
- } from "./index-1vc7jrkg.js";
11
- import"./index-snp5wbge.js";
10
+ } from "./index-v63beg1z.js";
11
+ import"./index-ayym1x7f.js";
12
12
  import"./index-f71thw8j.js";
13
- import"./index-bxdg2nbt.js";
14
- import"./index-thvnpfsv.js";
13
+ import"./index-wv9n2zcq.js";
14
+ import"./index-p4vde22c.js";
15
15
  import"./index-sd3egckz.js";
16
- import"./index-3kdm78zp.js";
17
- import"./index-y1qysm3q.js";
16
+ import"./index-9nkg2dzk.js";
17
+ import"./index-qrahzcqv.js";
18
18
  import"./index-n78avt2p.js";
19
19
  import"./index-4dhv7mqz.js";
20
20
  import"./index-v10f1rjv.js";
21
- import"./index-dgs16axy.js";
21
+ import"./index-b17m64g9.js";
22
22
  import"./index-qt1qqasc.js";
23
- import"./index-944w16m0.js";
24
- import"./index-mht7bq0z.js";
23
+ import"./index-j6zw70pf.js";
24
+ import"./index-nd7m2a5a.js";
25
25
  import"./index-1zx87sdm.js";
26
- import"./index-1d289pq2.js";
27
- import"./index-mmfa86mt.js";
28
- import"./index-v0p37hm2.js";
26
+ import"./index-mtw9e71a.js";
29
27
  import"./index-x8a7jmkh.js";
30
28
  import"./index-y9f76s3f.js";
31
- import"./index-e20m7284.js";
32
- import"./index-1sarmj9z.js";
29
+ import"./index-7b2cfmaz.js";
30
+ import"./index-wgypt3cs.js";
33
31
  import"./index-saews2s3.js";
34
- import"./index-3kx0kg0f.js";
32
+ import"./index-hehkf6zm.js";
35
33
  import"./index-fkx2qnvw.js";
36
- import"./index-yxycg7fs.js";
34
+ import"./index-cj9g0j7a.js";
37
35
  import"./index-fb3zxn06.js";
38
36
  import"./index-wk0n1cgt.js";
39
37
  import"./index-a8bvhwqs.js";
40
- import"./index-dyvbsvga.js";
38
+ import"./index-dqe8pq4x.js";
41
39
  import"./index-fr0wbhdn.js";
42
40
  import"./index-nj7yykkx.js";
43
41
  import"./index-n6m03s3n.js";
44
42
  import"./index-bp5083x2.js";
45
43
  import"./index-58e3y90n.js";
44
+ import"./index-7pa32z07.js";
45
+ import"./index-v0p37hm2.js";
46
46
  import"./index-k29z4aqh.js";
47
47
  import"./index-hqkczed7.js";
48
48
  import"./index-wafzvyhg.js";