@cortexkit/opencode-magic-context 0.41.2 → 0.41.4

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 (230) hide show
  1. package/README.md +9 -3
  2. package/dist/announcement-3c1vertn.js +14 -0
  3. package/dist/config/index.d.ts +9 -0
  4. package/dist/config/index.d.ts.map +1 -1
  5. package/dist/config/project-security.d.ts.map +1 -1
  6. package/dist/config/schema/magic-context.d.ts +756 -4
  7. package/dist/config/schema/magic-context.d.ts.map +1 -1
  8. package/dist/conflict-warning-hook-ejkc9sjn.js +16 -0
  9. package/dist/derive-budgets-bc366cz8.js +13 -0
  10. package/dist/features/magic-context/compartment-lease.d.ts +6 -0
  11. package/dist/features/magic-context/compartment-lease.d.ts.map +1 -1
  12. package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
  13. package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +13 -0
  14. package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
  15. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  16. package/dist/features/magic-context/dreamer/task-scheduler.d.ts +3 -0
  17. package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
  18. package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
  19. package/dist/features/magic-context/migrations.d.ts.map +1 -1
  20. package/dist/features/magic-context/storage-db.d.ts +18 -1
  21. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  22. package/dist/features/magic-context/storage-meta-persisted.d.ts +13 -14
  23. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  24. package/dist/features/magic-context/storage-meta.d.ts +1 -1
  25. package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
  26. package/dist/features/magic-context/storage-subagent-invocations.d.ts +3 -2
  27. package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -1
  28. package/dist/features/magic-context/storage-tags.d.ts +6 -0
  29. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  30. package/dist/features/magic-context/storage.d.ts +2 -2
  31. package/dist/features/magic-context/storage.d.ts.map +1 -1
  32. package/dist/features/magic-context/subagent-token-capture.d.ts +2 -1
  33. package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
  34. package/dist/hooks/magic-context/command-handler.d.ts +5 -1
  35. package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
  36. package/dist/hooks/magic-context/compaction-marker-manager.d.ts +6 -1
  37. package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
  38. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  39. package/dist/hooks/magic-context/compartment-runner-types.d.ts +4 -0
  40. package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
  41. package/dist/hooks/magic-context/compartment-runner.d.ts +2 -1
  42. package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
  43. package/dist/hooks/magic-context/derive-budgets.d.ts +1 -0
  44. package/dist/hooks/magic-context/derive-budgets.d.ts.map +1 -1
  45. package/dist/hooks/magic-context/emergency-drop.d.ts +3 -1
  46. package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
  47. package/dist/hooks/magic-context/execute-status.d.ts +7 -1
  48. package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
  49. package/dist/hooks/magic-context/heuristic-cleanup.d.ts +4 -3
  50. package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
  51. package/dist/hooks/magic-context/hook-handlers.d.ts +2 -0
  52. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  53. package/dist/hooks/magic-context/hook.d.ts +9 -5
  54. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  55. package/dist/hooks/magic-context/inject-compartments.d.ts +6 -0
  56. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  57. package/dist/hooks/magic-context/issue-423-fixture.d.ts +37 -0
  58. package/dist/hooks/magic-context/issue-423-fixture.d.ts.map +1 -0
  59. package/dist/hooks/magic-context/issue-424-fixture.d.ts +11 -0
  60. package/dist/hooks/magic-context/issue-424-fixture.d.ts.map +1 -0
  61. package/dist/hooks/magic-context/module-state-sync.d.ts +2 -1
  62. package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
  63. package/dist/hooks/magic-context/module-transport.d.ts +11 -4
  64. package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
  65. package/dist/hooks/magic-context/module-wire.d.ts +6 -1
  66. package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
  67. package/dist/hooks/magic-context/producer-window-guard.d.ts +8 -0
  68. package/dist/hooks/magic-context/producer-window-guard.d.ts.map +1 -0
  69. package/dist/hooks/magic-context/protected-tail-boundary.d.ts +59 -0
  70. package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
  71. package/dist/hooks/magic-context/read-session-chunk.d.ts +2 -0
  72. package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
  73. package/dist/hooks/magic-context/read-session-db.d.ts +15 -0
  74. package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
  75. package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +4 -1
  76. package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
  77. package/dist/hooks/magic-context/recomp-orchestrator.d.ts +2 -0
  78. package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
  79. package/dist/hooks/magic-context/rust-mode-transform.d.ts +15 -2
  80. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  81. package/dist/hooks/magic-context/send-session-notification.d.ts +6 -0
  82. package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
  83. package/dist/hooks/magic-context/sentinel.d.ts +8 -19
  84. package/dist/hooks/magic-context/sentinel.d.ts.map +1 -1
  85. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  86. package/dist/hooks/magic-context/tag-messages.d.ts +2 -0
  87. package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
  88. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +8 -3
  89. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
  90. package/dist/hooks/magic-context/tool-drop-target.d.ts +1 -0
  91. package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
  92. package/dist/hooks/magic-context/transform-compartment-phase.d.ts +2 -0
  93. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  94. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +32 -0
  95. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  96. package/dist/hooks/magic-context/transform.d.ts +4 -0
  97. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  98. package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
  99. package/dist/{index-j8r0ejb3.js → index-0y2mcg5y.js} +1971 -11203
  100. package/dist/{index-1yh8g550.js → index-22jkk6wg.js} +2 -15
  101. package/dist/{index-dmvy29z0.js → index-3wzdwt6p.js} +11 -15
  102. package/dist/{index-eq9wr75c.js → index-4avmwfp5.js} +57 -108
  103. package/dist/{index-d1mxrd3p.js → index-7k55qm8a.js} +17 -12
  104. package/dist/{index-2wchnyk6.js → index-avwt563y.js} +8 -1
  105. package/dist/{index-4x691bz5.js → index-dkv2dn46.js} +5 -2
  106. package/dist/{index-rgdqj8nj.js → index-e7vx3byk.js} +1 -1
  107. package/dist/{index-szf8w1p5.js → index-fmsr7v69.js} +2 -2
  108. package/dist/{index-y1yr57fw.js → index-fz104x1j.js} +18 -18
  109. package/dist/{index-d62ypazr.js → index-jdxxq8cz.js} +6 -11
  110. package/dist/{index-9j3tx8hy.js → index-may8skc8.js} +6 -25
  111. package/dist/{index-cvda5jb3.js → index-mjv9je4e.js} +23 -19
  112. package/dist/{index-zwjhba2r.js → index-q264erdp.js} +122 -41
  113. package/dist/{index-b9j85d29.js → index-raatkvw5.js} +49 -11
  114. package/dist/{index-9xexf8s7.js → index-rn7gafjr.js} +1 -9
  115. package/dist/index-sd3egckz.js +1583 -0
  116. package/dist/index-v6t0tg85.js +13 -0
  117. package/dist/index.d.ts.map +1 -1
  118. package/dist/index.js +2660 -3255
  119. package/dist/model-resolution-dxatzjde.js +12 -0
  120. package/dist/{index-dynqfgx1.js → module-asyncify-2EFITU5U-rkqjhjxd.js} +69 -8
  121. package/dist/plugin/boot-deadline.d.ts +47 -0
  122. package/dist/plugin/boot-deadline.d.ts.map +1 -0
  123. package/dist/plugin/conflict-warning-hook.d.ts +10 -0
  124. package/dist/plugin/conflict-warning-hook.d.ts.map +1 -1
  125. package/dist/plugin/hooks/create-session-hooks.d.ts +5 -0
  126. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  127. package/dist/plugin/messages-transform.d.ts.map +1 -1
  128. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  129. package/dist/prompt-context-5y5ms8f9.js +6 -0
  130. package/dist/recomp-orchestrator-q98r6rga.js +19 -0
  131. package/dist/rpc-notifications-4amf6mf4.js +14 -0
  132. package/dist/{index-vnz6jvdc.js → safe-notification-target-q9z81zt3.js} +4 -3
  133. package/dist/send-session-notification-hdh02wy9.js +16 -0
  134. package/dist/shared/cache-ttl-display.d.ts +23 -0
  135. package/dist/shared/cache-ttl-display.d.ts.map +1 -0
  136. package/dist/shared/cache-ttl-seed.d.ts +10 -0
  137. package/dist/shared/cache-ttl-seed.d.ts.map +1 -0
  138. package/dist/shared/config-diagnostics.d.ts +30 -0
  139. package/dist/shared/config-diagnostics.d.ts.map +1 -0
  140. package/dist/shared/config-warning-surface.d.ts +3 -0
  141. package/dist/shared/config-warning-surface.d.ts.map +1 -0
  142. package/dist/shared/conflict-detector.d.ts +3 -1
  143. package/dist/shared/conflict-detector.d.ts.map +1 -1
  144. package/dist/shared/data-path.d.ts +10 -9
  145. package/dist/shared/data-path.d.ts.map +1 -1
  146. package/dist/shared/harness-provider-map.d.ts +7 -0
  147. package/dist/shared/harness-provider-map.d.ts.map +1 -1
  148. package/dist/shared/harness.d.ts +3 -3
  149. package/dist/shared/harness.d.ts.map +1 -1
  150. package/dist/shared/jsonc-parser.d.ts +12 -0
  151. package/dist/shared/jsonc-parser.d.ts.map +1 -1
  152. package/dist/shared/model-resolution.d.ts +3 -3
  153. package/dist/shared/model-resolution.d.ts.map +1 -1
  154. package/dist/shared/model-suggestion-retry.d.ts +14 -10
  155. package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
  156. package/dist/shared/pi-executable.d.ts +6 -0
  157. package/dist/shared/pi-executable.d.ts.map +1 -0
  158. package/dist/shared/prompt-surface-runtime.d.ts +2 -2
  159. package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
  160. package/dist/shared/rpc-types.d.ts +6 -0
  161. package/dist/shared/rpc-types.d.ts.map +1 -1
  162. package/dist/shared/rpc-utils.d.ts.map +1 -1
  163. package/dist/shared/status-detail-text.d.ts.map +1 -1
  164. package/dist/shared/tag-transcript.d.ts.map +1 -1
  165. package/dist/shared/transcript.d.ts +2 -1
  166. package/dist/shared/transcript.d.ts.map +1 -1
  167. package/dist/storage-meta-session-dvwfw778.js +20 -0
  168. package/dist/task-config-hnv93r7p.js +9 -0
  169. package/dist/transformers-node-wasm.js +328 -328
  170. package/dist/transformers-web.js +72 -72
  171. package/dist/{transformers.node-b1wa0hgx.js → transformers.node-dpmf3wpx.js} +74 -74
  172. package/package.json +1 -1
  173. package/src/config/index.test.ts +72 -0
  174. package/src/config/index.ts +96 -15
  175. package/src/config/project-security.hostile-matrix.test.ts +78 -9
  176. package/src/config/project-security.ts +4 -3
  177. package/src/config/schema/magic-context.test.ts +64 -0
  178. package/src/config/schema/magic-context.ts +100 -6
  179. package/src/shared/cache-ttl-display.test.ts +84 -0
  180. package/src/shared/cache-ttl-display.ts +64 -0
  181. package/src/shared/cache-ttl-seed.ts +23 -0
  182. package/src/shared/config-diagnostics.test.ts +29 -0
  183. package/src/shared/config-diagnostics.ts +64 -0
  184. package/src/shared/config-warning-surface.ts +28 -0
  185. package/src/shared/conflict-detector.test.ts +24 -0
  186. package/src/shared/conflict-detector.ts +25 -7
  187. package/src/shared/data-path.ts +10 -9
  188. package/src/shared/harness-provider-map.test.ts +16 -0
  189. package/src/shared/harness-provider-map.ts +15 -0
  190. package/src/shared/harness.ts +3 -3
  191. package/src/shared/jsonc-parser.test.ts +14 -1
  192. package/src/shared/jsonc-parser.ts +93 -0
  193. package/src/shared/model-resolution.test.ts +61 -0
  194. package/src/shared/model-resolution.ts +14 -5
  195. package/src/shared/model-suggestion-retry.ts +143 -28
  196. package/src/shared/pi-executable.ts +20 -0
  197. package/src/shared/prompt-surface-runtime.ts +3 -3
  198. package/src/shared/rpc-types.ts +6 -0
  199. package/src/shared/rpc-utils.ts +2 -3
  200. package/src/shared/status-detail-text.test.ts +2 -1
  201. package/src/shared/status-detail-text.ts +5 -1
  202. package/src/shared/tag-transcript.ts +32 -2
  203. package/src/shared/transcript.ts +3 -1
  204. package/src/tui/index.tsx +15 -1
  205. package/src/tui-compiled/index.tsx +234 -222
  206. package/dist/announcement-3g9xg433.js +0 -18
  207. package/dist/conflict-warning-hook-rf17b6et.js +0 -17
  208. package/dist/derive-budgets-9q2d3r93.js +0 -14
  209. package/dist/emscripten-module-49k43zfy.js +0 -507
  210. package/dist/emscripten-module-ex4v0x4z.js +0 -606
  211. package/dist/emscripten-module-jfs3d1dq.js +0 -1536
  212. package/dist/emscripten-module-ss4g4spn.js +0 -4563
  213. package/dist/ffi-bbm9vkfa.js +0 -92
  214. package/dist/ffi-kb5r0x1j.js +0 -92
  215. package/dist/ffi-qnrt0y78.js +0 -80
  216. package/dist/ffi-yx2hpf4p.js +0 -80
  217. package/dist/index-8mtsfhyg.js +0 -146
  218. package/dist/index-8sseka65.js +0 -251
  219. package/dist/index-ss632za9.js +0 -77
  220. package/dist/model-resolution-6w6wzw18.js +0 -17
  221. package/dist/module-ES6BEMUI-1yjdz59c.js +0 -14
  222. package/dist/module-asyncify-2EFITU5U-fdkx4fhy.js +0 -9
  223. package/dist/prompt-context-29qkb28f.js +0 -7
  224. package/dist/recomp-orchestrator-m37p3fq6.js +0 -34
  225. package/dist/rpc-notifications-1ffm755w.js +0 -17
  226. package/dist/safe-notification-target-2a8py95v.js +0 -11
  227. package/dist/send-session-notification-bw7eex6w.js +0 -20
  228. package/dist/storage-meta-session-dse3qv6s.js +0 -23
  229. package/dist/task-config-gv6s04fp.js +0 -18
  230. /package/dist/{index-37yzyeca.js → index-3fe78beq.js} +0 -0
@@ -1,251 +0,0 @@
1
- import {
2
- QuickJSAsyncContext,
3
- QuickJSAsyncRuntime,
4
- QuickJSAsyncWASMModule
5
- } from "./index-ss632za9.js";
6
- import {
7
- DefaultIntrinsics,
8
- DisposableFail,
9
- DisposableResult,
10
- DisposableSuccess,
11
- Lifetime,
12
- QuickJSContext,
13
- QuickJSDeferredPromise,
14
- QuickJSEmscriptenModuleError,
15
- QuickJSMemoryLeakDetected,
16
- QuickJSRuntime,
17
- QuickJSWASMModule,
18
- Scope,
19
- StaticLifetime,
20
- UsingDisposable,
21
- WeakLifetime,
22
- createDisposableArray,
23
- debugLog,
24
- errors_exports,
25
- setDebugMode
26
- } from "./index-dynqfgx1.js";
27
- import {
28
- EvalFlags,
29
- GetOwnPropertyNamesFlags,
30
- IntrinsicsFlags,
31
- IsEqualOp,
32
- JSPromiseStateEnum,
33
- assertSync
34
- } from "./index-9xexf8s7.js";
35
- import {
36
- __require
37
- } from "./index-1yh8g550.js";
38
-
39
- // ../../node_modules/.bun/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/index.mjs
40
- async function newQuickJSWASMModuleFromVariant(variantOrPromise) {
41
- let variant = smartUnwrap(await variantOrPromise), [wasmModuleLoader, QuickJSFFI, { QuickJSWASMModule: QuickJSWASMModule2 }] = await Promise.all([variant.importModuleLoader().then(smartUnwrap), variant.importFFI(), import("./module-ES6BEMUI-1yjdz59c.js").then(smartUnwrap)]), wasmModule = await wasmModuleLoader();
42
- wasmModule.type = "sync";
43
- let ffi = new QuickJSFFI(wasmModule);
44
- return new QuickJSWASMModule2(wasmModule, ffi);
45
- }
46
- async function newQuickJSAsyncWASMModuleFromVariant(variantOrPromise) {
47
- let variant = smartUnwrap(await variantOrPromise), [wasmModuleLoader, QuickJSAsyncFFI, { QuickJSAsyncWASMModule: QuickJSAsyncWASMModule2 }] = await Promise.all([variant.importModuleLoader().then(smartUnwrap), variant.importFFI(), import("./module-asyncify-2EFITU5U-fdkx4fhy.js").then(smartUnwrap)]), wasmModule = await wasmModuleLoader();
48
- wasmModule.type = "async";
49
- let ffi = new QuickJSAsyncFFI(wasmModule);
50
- return new QuickJSAsyncWASMModule2(wasmModule, ffi);
51
- }
52
- function memoizePromiseFactory(fn) {
53
- let promise;
54
- return () => promise ?? (promise = fn());
55
- }
56
- function smartUnwrap(val) {
57
- return val && "default" in val && val.default ? val.default && "default" in val.default && val.default.default ? val.default.default : val.default : val;
58
- }
59
- function newVariant(baseVariant, options) {
60
- return { ...baseVariant, async importModuleLoader() {
61
- let moduleLoader = smartUnwrap(await baseVariant.importModuleLoader());
62
- return async function() {
63
- let moduleLoaderArg = options.emscriptenModule ? { ...options.emscriptenModule } : {}, log = options.log ?? ((...args) => debugLog("newVariant moduleLoader:", ...args)), tapValue = (message, val) => (log(...message, val), val), force = (val) => typeof val == "function" ? val() : val;
64
- (options.wasmLocation || options.wasmSourceMapLocation || options.locateFile) && (moduleLoaderArg.locateFile = (fileName, relativeTo) => {
65
- let args = { fileName, relativeTo };
66
- if (fileName.endsWith(".wasm") && options.wasmLocation !== undefined)
67
- return tapValue(["locateFile .wasm: provide wasmLocation", args], options.wasmLocation);
68
- if (fileName.endsWith(".map")) {
69
- if (options.wasmSourceMapLocation !== undefined)
70
- return tapValue(["locateFile .map: provide wasmSourceMapLocation", args], options.wasmSourceMapLocation);
71
- if (options.wasmLocation && !options.locateFile)
72
- return tapValue(["locateFile .map: infer from wasmLocation", args], options.wasmLocation + ".map");
73
- }
74
- return options.locateFile ? tapValue(["locateFile: use provided fn", args], options.locateFile(fileName, relativeTo)) : tapValue(["locateFile: unhandled, passthrough", args], fileName);
75
- }), options.wasmBinary && (moduleLoaderArg.wasmBinary = await force(options.wasmBinary)), options.wasmMemory && (moduleLoaderArg.wasmMemory = await force(options.wasmMemory));
76
- let optionsWasmModule = options.wasmModule, modulePromise;
77
- optionsWasmModule && (moduleLoaderArg.instantiateWasm = async (imports, onSuccess) => {
78
- modulePromise ?? (modulePromise = Promise.resolve(force(optionsWasmModule)));
79
- let wasmModule = await modulePromise;
80
- if (!wasmModule)
81
- throw new QuickJSEmscriptenModuleError(`options.wasmModule returned ${String(wasmModule)}`);
82
- let instance = await WebAssembly.instantiate(wasmModule, imports);
83
- return onSuccess(instance), instance.exports;
84
- }), moduleLoaderArg.monitorRunDependencies = (left) => {
85
- log("monitorRunDependencies:", left);
86
- }, moduleLoaderArg.quickjsEmscriptenInit = () => newMockExtensions(log);
87
- let resultPromise = moduleLoader(moduleLoaderArg), extensions = moduleLoaderArg.quickjsEmscriptenInit?.(log);
88
- if (optionsWasmModule && extensions?.receiveWasmOffsetConverter && !extensions.existingWasmOffsetConverter) {
89
- let wasmBinary = await force(options.wasmBinary) ?? new ArrayBuffer(0);
90
- modulePromise ?? (modulePromise = Promise.resolve(force(optionsWasmModule)));
91
- let wasmModule = await modulePromise;
92
- if (!wasmModule)
93
- throw new QuickJSEmscriptenModuleError(`options.wasmModule returned ${String(wasmModule)}`);
94
- extensions.receiveWasmOffsetConverter(wasmBinary, wasmModule);
95
- }
96
- if (extensions?.receiveSourceMapJSON) {
97
- let loadedSourceMapData = await force(options.wasmSourceMapData);
98
- typeof loadedSourceMapData == "string" ? extensions.receiveSourceMapJSON(JSON.parse(loadedSourceMapData)) : loadedSourceMapData ? extensions.receiveSourceMapJSON(loadedSourceMapData) : extensions.receiveSourceMapJSON({ version: 3, names: [], sources: [], mappings: "" });
99
- }
100
- return resultPromise;
101
- };
102
- } };
103
- }
104
- function newMockExtensions(log) {
105
- let mockMessage = "mock called, emscripten module may not be initialized yet";
106
- return { mock: true, removeRunDependency(name) {
107
- log(`${mockMessage}: removeRunDependency called:`, name);
108
- }, receiveSourceMapJSON(data) {
109
- log(`${mockMessage}: receiveSourceMapJSON called:`, data);
110
- }, WasmOffsetConverter: undefined, receiveWasmOffsetConverter(bytes, mod) {
111
- log(`${mockMessage}: receiveWasmOffsetConverter called:`, bytes, mod);
112
- } };
113
- }
114
- function isSuccess(successOrFail) {
115
- return !("error" in successOrFail);
116
- }
117
- function isFail(successOrFail) {
118
- return "error" in successOrFail;
119
- }
120
- function shouldInterruptAfterDeadline(deadline) {
121
- let deadlineAsNumber = typeof deadline == "number" ? deadline : deadline.getTime();
122
- return function() {
123
- return Date.now() > deadlineAsNumber;
124
- };
125
- }
126
- var TestQuickJSWASMModule = class {
127
- constructor(parent) {
128
- this.parent = parent;
129
- this.contexts = new Set;
130
- this.runtimes = new Set;
131
- }
132
- newRuntime(options) {
133
- let runtime = this.parent.newRuntime({ ...options, ownedLifetimes: [new Lifetime(undefined, undefined, () => this.runtimes.delete(runtime)), ...options?.ownedLifetimes ?? []] });
134
- return this.runtimes.add(runtime), runtime;
135
- }
136
- newContext(options) {
137
- let context = this.parent.newContext({ ...options, ownedLifetimes: [new Lifetime(undefined, undefined, () => this.contexts.delete(context)), ...options?.ownedLifetimes ?? []] });
138
- return this.contexts.add(context), context;
139
- }
140
- evalCode(code, options) {
141
- return this.parent.evalCode(code, options);
142
- }
143
- disposeAll() {
144
- let allDisposables = [...this.contexts, ...this.runtimes];
145
- this.runtimes.clear(), this.contexts.clear(), allDisposables.forEach((d) => {
146
- d.alive && d.dispose();
147
- });
148
- }
149
- assertNoMemoryAllocated() {
150
- if (this.getFFI().QTS_RecoverableLeakCheck())
151
- throw new QuickJSMemoryLeakDetected("Leak sanitizer detected un-freed memory");
152
- if (this.contexts.size > 0)
153
- throw new QuickJSMemoryLeakDetected(`${this.contexts.size} contexts leaked`);
154
- if (this.runtimes.size > 0)
155
- throw new QuickJSMemoryLeakDetected(`${this.runtimes.size} runtimes leaked`);
156
- }
157
- getWasmMemory() {
158
- return this.parent.getWasmMemory();
159
- }
160
- getFFI() {
161
- return this.parent.getFFI();
162
- }
163
- };
164
-
165
- // ../../node_modules/.bun/@jitl+quickjs-wasmfile-debug-sync@0.32.0/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.mjs
166
- var variant = { type: "sync", importFFI: () => import("./ffi-yx2hpf4p.js").then((mod) => mod.QuickJSFFI), importModuleLoader: () => import("./emscripten-module-ss4g4spn.js").then((mod) => mod.default) };
167
- var src_default = variant;
168
-
169
- // ../../node_modules/.bun/@jitl+quickjs-wasmfile-release-sync@0.32.0/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs
170
- var variant2 = { type: "sync", importFFI: () => import("./ffi-qnrt0y78.js").then((mod) => mod.QuickJSFFI), importModuleLoader: () => import("./emscripten-module-49k43zfy.js").then((mod) => mod.default) };
171
- var src_default2 = variant2;
172
-
173
- // ../../node_modules/.bun/@jitl+quickjs-wasmfile-debug-asyncify@0.32.0/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.mjs
174
- var variant3 = { type: "async", importFFI: () => import("./ffi-bbm9vkfa.js").then((mod) => mod.QuickJSAsyncFFI), importModuleLoader: () => import("./emscripten-module-jfs3d1dq.js").then((mod) => mod.default) };
175
- var src_default3 = variant3;
176
-
177
- // ../../node_modules/.bun/@jitl+quickjs-wasmfile-release-asyncify@0.32.0/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.mjs
178
- var variant4 = { type: "async", importFFI: () => import("./ffi-kb5r0x1j.js").then((mod) => mod.QuickJSAsyncFFI), importModuleLoader: () => import("./emscripten-module-ex4v0x4z.js").then((mod) => mod.default) };
179
- var src_default4 = variant4;
180
-
181
- // ../../node_modules/.bun/quickjs-emscripten@0.32.0/node_modules/quickjs-emscripten/dist/chunk-OHAYRCBA.mjs
182
- async function newQuickJSWASMModule(variantOrPromise = src_default2) {
183
- return newQuickJSWASMModuleFromVariant(variantOrPromise);
184
- }
185
- async function newQuickJSAsyncWASMModule(variantOrPromise = src_default4) {
186
- return newQuickJSAsyncWASMModuleFromVariant(variantOrPromise);
187
- }
188
-
189
- // ../../node_modules/.bun/quickjs-emscripten@0.32.0/node_modules/quickjs-emscripten/dist/index.mjs
190
- var singleton;
191
- var singletonPromise;
192
- async function getQuickJS() {
193
- return singletonPromise ?? (singletonPromise = newQuickJSWASMModule().then((instance) => (singleton = instance, instance))), await singletonPromise;
194
- }
195
- function getQuickJSSync() {
196
- if (!singleton)
197
- throw new Error("QuickJS not initialized. Await getQuickJS() at least once.");
198
- return singleton;
199
- }
200
- async function newAsyncRuntime(options) {
201
- return (await newQuickJSAsyncWASMModule()).newRuntime(options);
202
- }
203
- async function newAsyncContext(options) {
204
- return (await newQuickJSAsyncWASMModule()).newContext(options);
205
- }
206
- export {
207
- src_default3 as DEBUG_ASYNC,
208
- src_default as DEBUG_SYNC,
209
- DefaultIntrinsics,
210
- DisposableFail,
211
- DisposableResult,
212
- DisposableSuccess,
213
- EvalFlags,
214
- GetOwnPropertyNamesFlags,
215
- IntrinsicsFlags,
216
- IsEqualOp,
217
- JSPromiseStateEnum,
218
- Lifetime,
219
- QuickJSAsyncContext,
220
- QuickJSAsyncRuntime,
221
- QuickJSAsyncWASMModule,
222
- QuickJSContext,
223
- QuickJSDeferredPromise,
224
- QuickJSRuntime,
225
- QuickJSWASMModule,
226
- src_default4 as RELEASE_ASYNC,
227
- src_default2 as RELEASE_SYNC,
228
- Scope,
229
- StaticLifetime,
230
- TestQuickJSWASMModule,
231
- UsingDisposable,
232
- WeakLifetime,
233
- assertSync,
234
- createDisposableArray,
235
- debugLog,
236
- errors_exports as errors,
237
- getQuickJS,
238
- getQuickJSSync,
239
- isFail,
240
- isSuccess,
241
- memoizePromiseFactory,
242
- newAsyncContext,
243
- newAsyncRuntime,
244
- newQuickJSAsyncWASMModule,
245
- newQuickJSAsyncWASMModuleFromVariant,
246
- newQuickJSWASMModule,
247
- newQuickJSWASMModuleFromVariant,
248
- newVariant,
249
- setDebugMode,
250
- shouldInterruptAfterDeadline
251
- };
@@ -1,77 +0,0 @@
1
- import {
2
- Lifetime,
3
- QuickJSContext,
4
- QuickJSNotImplemented,
5
- QuickJSRuntime,
6
- QuickJSWASMModule,
7
- Scope,
8
- applyBaseRuntimeOptions,
9
- applyModuleEvalRuntimeOptions,
10
- evalOptionsToFlags,
11
- intrinsicsToFlags
12
- } from "./index-dynqfgx1.js";
13
-
14
- // ../../node_modules/.bun/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.mjs
15
- var QuickJSAsyncContext = class extends QuickJSContext {
16
- async evalCodeAsync(code, filename = "eval.js", options) {
17
- let detectModule = options === undefined ? 1 : 0, flags = evalOptionsToFlags(options), resultPtr = 0;
18
- try {
19
- resultPtr = await this.memory.newHeapCharPointer(code).consume((charHandle) => this.ffi.QTS_Eval_MaybeAsync(this.ctx.value, charHandle.value.ptr, charHandle.value.strlen, filename, detectModule, flags));
20
- } catch (error) {
21
- throw this.runtime.debugLog("QTS_Eval_MaybeAsync threw", error), error;
22
- }
23
- let errorPtr = this.ffi.QTS_ResolveException(this.ctx.value, resultPtr);
24
- return errorPtr ? (this.ffi.QTS_FreeValuePointer(this.ctx.value, resultPtr), this.fail(this.memory.heapValueHandle(errorPtr))) : this.success(this.memory.heapValueHandle(resultPtr));
25
- }
26
- newAsyncifiedFunction(name, fn) {
27
- return this.newFunction(name, fn);
28
- }
29
- };
30
- var QuickJSAsyncRuntime = class extends QuickJSRuntime {
31
- constructor(args) {
32
- super(args);
33
- }
34
- newContext(options = {}) {
35
- let intrinsics = intrinsicsToFlags(options.intrinsics), ctx = new Lifetime(this.ffi.QTS_NewContext(this.rt.value, intrinsics), undefined, (ctx_ptr) => {
36
- this.contextMap.delete(ctx_ptr), this.callbacks.deleteContext(ctx_ptr), this.ffi.QTS_FreeContext(ctx_ptr);
37
- }), context = new QuickJSAsyncContext({ module: this.module, ctx, ffi: this.ffi, rt: this.rt, ownedLifetimes: [], runtime: this, callbacks: this.callbacks });
38
- return this.contextMap.set(ctx.value, context), context;
39
- }
40
- setModuleLoader(moduleLoader, moduleNormalizer) {
41
- super.setModuleLoader(moduleLoader, moduleNormalizer);
42
- }
43
- setMaxStackSize(stackSize) {
44
- return super.setMaxStackSize(stackSize);
45
- }
46
- };
47
- var QuickJSAsyncWASMModule = class extends QuickJSWASMModule {
48
- constructor(module, ffi) {
49
- super(module, ffi);
50
- this.ffi = ffi, this.module = module;
51
- }
52
- newRuntime(options = {}) {
53
- let rt = new Lifetime(this.ffi.QTS_NewRuntime(), undefined, (rt_ptr) => {
54
- this.callbacks.deleteRuntime(rt_ptr), this.ffi.QTS_FreeRuntime(rt_ptr);
55
- }), runtime = new QuickJSAsyncRuntime({ module: this.module, ffi: this.ffi, rt, callbacks: this.callbacks });
56
- return applyBaseRuntimeOptions(runtime, options), options.moduleLoader && runtime.setModuleLoader(options.moduleLoader), runtime;
57
- }
58
- newContext(options = {}) {
59
- let runtime = this.newRuntime(), lifetimes = options.ownedLifetimes ? options.ownedLifetimes.concat([runtime]) : [runtime], context = runtime.newContext({ ...options, ownedLifetimes: lifetimes });
60
- return runtime.context = context, context;
61
- }
62
- evalCode() {
63
- throw new QuickJSNotImplemented("QuickJSWASMModuleAsyncify.evalCode: use evalCodeAsync instead");
64
- }
65
- evalCodeAsync(code, options) {
66
- return Scope.withScopeAsync(async (scope) => {
67
- let vm = scope.manage(this.newContext());
68
- applyModuleEvalRuntimeOptions(vm.runtime, options);
69
- let result = await vm.evalCodeAsync(code, "eval.js");
70
- if (options.memoryLimitBytes !== undefined && vm.runtime.setMemoryLimit(-1), result.error)
71
- throw vm.dump(scope.manage(result.error));
72
- return vm.dump(scope.manage(result.value));
73
- });
74
- }
75
- };
76
-
77
- export { QuickJSAsyncContext, QuickJSAsyncRuntime, QuickJSAsyncWASMModule };
@@ -1,17 +0,0 @@
1
- import {
2
- normalizeModelEntry,
3
- resolveDreamerTaskModel,
4
- resolveFallbackEntries,
5
- resolveHistorianAgentOverrides,
6
- resolveHistorianModel,
7
- resolveOpenCodeAgentOverrides
8
- } from "./index-d1mxrd3p.js";
9
- import"./index-1yh8g550.js";
10
- export {
11
- normalizeModelEntry,
12
- resolveDreamerTaskModel,
13
- resolveFallbackEntries,
14
- resolveHistorianAgentOverrides,
15
- resolveHistorianModel,
16
- resolveOpenCodeAgentOverrides
17
- };
@@ -1,14 +0,0 @@
1
- import {
2
- QuickJSModuleCallbacks,
3
- QuickJSWASMModule,
4
- applyBaseRuntimeOptions,
5
- applyModuleEvalRuntimeOptions
6
- } from "./index-dynqfgx1.js";
7
- import"./index-9xexf8s7.js";
8
- import"./index-1yh8g550.js";
9
- export {
10
- QuickJSModuleCallbacks,
11
- QuickJSWASMModule,
12
- applyBaseRuntimeOptions,
13
- applyModuleEvalRuntimeOptions
14
- };
@@ -1,9 +0,0 @@
1
- import {
2
- QuickJSAsyncWASMModule
3
- } from "./index-ss632za9.js";
4
- import"./index-dynqfgx1.js";
5
- import"./index-9xexf8s7.js";
6
- import"./index-1yh8g550.js";
7
- export {
8
- QuickJSAsyncWASMModule
9
- };
@@ -1,7 +0,0 @@
1
- import {
2
- resolvePromptContext
3
- } from "./index-szf8w1p5.js";
4
- import"./index-1yh8g550.js";
5
- export {
6
- resolvePromptContext
7
- };
@@ -1,34 +0,0 @@
1
- import {
2
- contextualizeUpgradeReason,
3
- extractRecompReason,
4
- isRecompComplete,
5
- isRecompFailure,
6
- isRecompSkip,
7
- runManagedRecomp,
8
- runManagedUpgrade,
9
- setRecompNote,
10
- setRecompStarting,
11
- setRecompTerminal
12
- } from "./index-j8r0ejb3.js";
13
- import"./index-cvda5jb3.js";
14
- import"./index-zwjhba2r.js";
15
- import"./index-y1yr57fw.js";
16
- import"./index-2wchnyk6.js";
17
- import"./index-b9j85d29.js";
18
- import"./index-8mtsfhyg.js";
19
- import"./index-d62ypazr.js";
20
- import"./index-4x691bz5.js";
21
- import"./index-37yzyeca.js";
22
- import"./index-1yh8g550.js";
23
- export {
24
- contextualizeUpgradeReason,
25
- extractRecompReason,
26
- isRecompComplete,
27
- isRecompFailure,
28
- isRecompSkip,
29
- runManagedRecomp,
30
- runManagedUpgrade,
31
- setRecompNote,
32
- setRecompStarting,
33
- setRecompTerminal
34
- };
@@ -1,17 +0,0 @@
1
- import {
2
- __resetNotificationStateForTests,
3
- acknowledgeNotifications,
4
- drainNotifications,
5
- isTuiConnected,
6
- pushNotification,
7
- registerNotificationSink
8
- } from "./index-d62ypazr.js";
9
- import"./index-1yh8g550.js";
10
- export {
11
- __resetNotificationStateForTests,
12
- acknowledgeNotifications,
13
- drainNotifications,
14
- isTuiConnected,
15
- pushNotification,
16
- registerNotificationSink
17
- };
@@ -1,11 +0,0 @@
1
- import {
2
- isDefaultSessionTitle,
3
- waitForSafeNotificationTarget
4
- } from "./index-vnz6jvdc.js";
5
- import"./index-4x691bz5.js";
6
- import"./index-37yzyeca.js";
7
- import"./index-1yh8g550.js";
8
- export {
9
- isDefaultSessionTitle,
10
- waitForSafeNotificationTarget
11
- };
@@ -1,20 +0,0 @@
1
- import {
2
- MAX_QUEUED_IGNORED_NOTIFICATIONS,
3
- __ignoredNotificationTest,
4
- clearIgnoredMessages,
5
- flushIgnoredMessages,
6
- sendIgnoredMessage,
7
- sendUserPrompt
8
- } from "./index-zwjhba2r.js";
9
- import"./index-b9j85d29.js";
10
- import"./index-4x691bz5.js";
11
- import"./index-37yzyeca.js";
12
- import"./index-1yh8g550.js";
13
- export {
14
- MAX_QUEUED_IGNORED_NOTIFICATIONS,
15
- __ignoredNotificationTest,
16
- clearIgnoredMessages,
17
- flushIgnoredMessages,
18
- sendIgnoredMessage,
19
- sendUserPrompt
20
- };
@@ -1,23 +0,0 @@
1
- import {
2
- advanceToolReclaimWatermark,
3
- clearSession,
4
- getOrCreateSessionMeta,
5
- markSessionCleanupPending,
6
- retryPendingRustSessionCleanupsForProject,
7
- retryPendingSessionCleanups,
8
- updateSessionMeta
9
- } from "./index-y1yr57fw.js";
10
- import"./index-2wchnyk6.js";
11
- import"./index-b9j85d29.js";
12
- import"./index-4x691bz5.js";
13
- import"./index-37yzyeca.js";
14
- import"./index-1yh8g550.js";
15
- export {
16
- advanceToolReclaimWatermark,
17
- clearSession,
18
- getOrCreateSessionMeta,
19
- markSessionCleanupPending,
20
- retryPendingRustSessionCleanupsForProject,
21
- retryPendingSessionCleanups,
22
- updateSessionMeta
23
- };
@@ -1,18 +0,0 @@
1
- import {
2
- buildDreamTaskRuntimeConfigs,
3
- dreamTaskScheduled,
4
- enabledDreamTasks,
5
- summarizeDreamSchedule,
6
- userMemoryCollectionEnabled,
7
- userMemoryPromotionThreshold
8
- } from "./index-9j3tx8hy.js";
9
- import"./index-d1mxrd3p.js";
10
- import"./index-1yh8g550.js";
11
- export {
12
- buildDreamTaskRuntimeConfigs,
13
- dreamTaskScheduled,
14
- enabledDreamTasks,
15
- summarizeDreamSchedule,
16
- userMemoryCollectionEnabled,
17
- userMemoryPromotionThreshold
18
- };
File without changes