@cortexkit/pi-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.
- package/README.md +6 -1
- package/dist/historian-calibration-extension.js +0 -2
- package/dist/{index-q2vgz0j1.js → index-147qn1yq.js} +4 -1
- package/dist/{index-1yh8g550.js → index-22jkk6wg.js} +2 -15
- package/dist/index-b3eqj1g6.js +51 -0
- package/dist/{index-rgdqj8nj.js → index-e7vx3byk.js} +1 -1
- package/dist/{index-ys39wb43.js → index-jc59f2q7.js} +28713 -49673
- package/dist/{index-9xexf8s7.js → index-rn7gafjr.js} +1 -9
- package/dist/index-v6t0tg85.js +13 -0
- package/dist/index.js +3198 -1130
- package/dist/{index-dynqfgx1.js → module-asyncify-2EFITU5U-rkqjhjxd.js} +69 -8
- package/dist/{prompt-context-3kjq9ejq.js → prompt-context-g3abnc66.js} +0 -2
- package/dist/rpc-notifications-jxy30tgz.js +8 -0
- package/dist/{safe-notification-target-hjcb423r.js → safe-notification-target-em2xnn1k.js} +1 -3
- package/dist/subagent-entry.js +12 -12
- package/dist/transformers-node-wasm.js +328 -328
- package/dist/transformers-web.js +72 -72
- package/dist/{transformers.node-b1wa0hgx.js → transformers.node-dpmf3wpx.js} +74 -74
- package/package.json +1 -1
- package/dist/emscripten-module-49k43zfy.js +0 -507
- package/dist/emscripten-module-ex4v0x4z.js +0 -606
- package/dist/emscripten-module-jfs3d1dq.js +0 -1536
- package/dist/emscripten-module-ss4g4spn.js +0 -4563
- package/dist/ffi-bbm9vkfa.js +0 -92
- package/dist/ffi-kb5r0x1j.js +0 -92
- package/dist/ffi-qnrt0y78.js +0 -80
- package/dist/ffi-yx2hpf4p.js +0 -80
- package/dist/index-hw34xmzk.js +0 -104
- package/dist/index-ss632za9.js +0 -77
- package/dist/index-y63nbvkk.js +0 -251
- package/dist/module-ES6BEMUI-1yjdz59c.js +0 -14
- package/dist/module-asyncify-2EFITU5U-fdkx4fhy.js +0 -9
- package/dist/rpc-notifications-gmhvmfpy.js +0 -17
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EvalFlags,
|
|
3
|
-
GetOwnPropertyNamesFlags,
|
|
4
3
|
IntrinsicsFlags,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
JSPromiseStateEnum,
|
|
5
|
+
GetOwnPropertyNamesFlags,
|
|
6
|
+
IsEqualOp
|
|
7
|
+
} from "./index-rn7gafjr.js";
|
|
8
8
|
|
|
9
9
|
// ../../node_modules/.bun/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.mjs
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
@@ -13,9 +13,6 @@ var __export = (target, all) => {
|
|
|
13
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
14
|
};
|
|
15
15
|
var QTS_DEBUG = false;
|
|
16
|
-
function setDebugMode(enabled = true) {
|
|
17
|
-
QTS_DEBUG = enabled;
|
|
18
|
-
}
|
|
19
16
|
function debugLog(...args) {
|
|
20
17
|
QTS_DEBUG && console.log("quickjs-emscripten:", ...args);
|
|
21
18
|
}
|
|
@@ -1200,4 +1197,68 @@ var QuickJSWASMModule = class {
|
|
|
1200
1197
|
}
|
|
1201
1198
|
};
|
|
1202
1199
|
|
|
1203
|
-
|
|
1200
|
+
// ../../node_modules/.bun/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.mjs
|
|
1201
|
+
var QuickJSAsyncContext = class extends QuickJSContext {
|
|
1202
|
+
async evalCodeAsync(code, filename = "eval.js", options) {
|
|
1203
|
+
let detectModule = options === undefined ? 1 : 0, flags = evalOptionsToFlags(options), resultPtr = 0;
|
|
1204
|
+
try {
|
|
1205
|
+
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));
|
|
1206
|
+
} catch (error) {
|
|
1207
|
+
throw this.runtime.debugLog("QTS_Eval_MaybeAsync threw", error), error;
|
|
1208
|
+
}
|
|
1209
|
+
let errorPtr = this.ffi.QTS_ResolveException(this.ctx.value, resultPtr);
|
|
1210
|
+
return errorPtr ? (this.ffi.QTS_FreeValuePointer(this.ctx.value, resultPtr), this.fail(this.memory.heapValueHandle(errorPtr))) : this.success(this.memory.heapValueHandle(resultPtr));
|
|
1211
|
+
}
|
|
1212
|
+
newAsyncifiedFunction(name, fn) {
|
|
1213
|
+
return this.newFunction(name, fn);
|
|
1214
|
+
}
|
|
1215
|
+
};
|
|
1216
|
+
var QuickJSAsyncRuntime = class extends QuickJSRuntime {
|
|
1217
|
+
constructor(args) {
|
|
1218
|
+
super(args);
|
|
1219
|
+
}
|
|
1220
|
+
newContext(options = {}) {
|
|
1221
|
+
let intrinsics = intrinsicsToFlags(options.intrinsics), ctx = new Lifetime(this.ffi.QTS_NewContext(this.rt.value, intrinsics), undefined, (ctx_ptr) => {
|
|
1222
|
+
this.contextMap.delete(ctx_ptr), this.callbacks.deleteContext(ctx_ptr), this.ffi.QTS_FreeContext(ctx_ptr);
|
|
1223
|
+
}), context = new QuickJSAsyncContext({ module: this.module, ctx, ffi: this.ffi, rt: this.rt, ownedLifetimes: [], runtime: this, callbacks: this.callbacks });
|
|
1224
|
+
return this.contextMap.set(ctx.value, context), context;
|
|
1225
|
+
}
|
|
1226
|
+
setModuleLoader(moduleLoader, moduleNormalizer) {
|
|
1227
|
+
super.setModuleLoader(moduleLoader, moduleNormalizer);
|
|
1228
|
+
}
|
|
1229
|
+
setMaxStackSize(stackSize) {
|
|
1230
|
+
return super.setMaxStackSize(stackSize);
|
|
1231
|
+
}
|
|
1232
|
+
};
|
|
1233
|
+
var QuickJSAsyncWASMModule = class extends QuickJSWASMModule {
|
|
1234
|
+
constructor(module, ffi) {
|
|
1235
|
+
super(module, ffi);
|
|
1236
|
+
this.ffi = ffi, this.module = module;
|
|
1237
|
+
}
|
|
1238
|
+
newRuntime(options = {}) {
|
|
1239
|
+
let rt = new Lifetime(this.ffi.QTS_NewRuntime(), undefined, (rt_ptr) => {
|
|
1240
|
+
this.callbacks.deleteRuntime(rt_ptr), this.ffi.QTS_FreeRuntime(rt_ptr);
|
|
1241
|
+
}), runtime = new QuickJSAsyncRuntime({ module: this.module, ffi: this.ffi, rt, callbacks: this.callbacks });
|
|
1242
|
+
return applyBaseRuntimeOptions(runtime, options), options.moduleLoader && runtime.setModuleLoader(options.moduleLoader), runtime;
|
|
1243
|
+
}
|
|
1244
|
+
newContext(options = {}) {
|
|
1245
|
+
let runtime = this.newRuntime(), lifetimes = options.ownedLifetimes ? options.ownedLifetimes.concat([runtime]) : [runtime], context = runtime.newContext({ ...options, ownedLifetimes: lifetimes });
|
|
1246
|
+
return runtime.context = context, context;
|
|
1247
|
+
}
|
|
1248
|
+
evalCode() {
|
|
1249
|
+
throw new QuickJSNotImplemented("QuickJSWASMModuleAsyncify.evalCode: use evalCodeAsync instead");
|
|
1250
|
+
}
|
|
1251
|
+
evalCodeAsync(code, options) {
|
|
1252
|
+
return Scope.withScopeAsync(async (scope) => {
|
|
1253
|
+
let vm = scope.manage(this.newContext());
|
|
1254
|
+
applyModuleEvalRuntimeOptions(vm.runtime, options);
|
|
1255
|
+
let result = await vm.evalCodeAsync(code, "eval.js");
|
|
1256
|
+
if (options.memoryLimitBytes !== undefined && vm.runtime.setMemoryLimit(-1), result.error)
|
|
1257
|
+
throw vm.dump(scope.manage(result.error));
|
|
1258
|
+
return vm.dump(scope.manage(result.value));
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
};
|
|
1262
|
+
export {
|
|
1263
|
+
QuickJSAsyncWASMModule
|
|
1264
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-1yh8g550.js";
|
|
3
|
+
} from "./index-147qn1yq.js";
|
|
5
4
|
|
|
6
5
|
// ../plugin/src/shared/safe-notification-target.ts
|
|
7
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$/;
|
|
@@ -38,6 +37,5 @@ async function waitForSafeNotificationTarget(client, sessionId, options) {
|
|
|
38
37
|
return "skip";
|
|
39
38
|
}
|
|
40
39
|
export {
|
|
41
|
-
isDefaultSessionTitle,
|
|
42
40
|
waitForSafeNotificationTarget
|
|
43
41
|
};
|
package/dist/subagent-entry.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
registerMagicContextTools,
|
|
6
|
-
resolveProjectIdentityForSession,
|
|
7
|
-
setStoragePrivatePermissionEnforcement
|
|
8
|
-
} from "./index-ys39wb43.js";
|
|
2
|
+
setHarness,
|
|
3
|
+
log
|
|
4
|
+
} from "./index-147qn1yq.js";
|
|
9
5
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
resolveProjectIdentityForSession,
|
|
7
|
+
setStoragePrivatePermissionEnforcement,
|
|
8
|
+
openDatabase,
|
|
9
|
+
resolvePiHarnessKind,
|
|
10
|
+
loadPiConfig,
|
|
11
|
+
ensureProjectRegisteredFromPiDirectory,
|
|
12
|
+
registerMagicContextTools
|
|
13
|
+
} from "./index-jc59f2q7.js";
|
|
14
14
|
|
|
15
15
|
// src/subagent-entry.ts
|
|
16
16
|
var SUBAGENT_DREAMER_ACTIONS_FLAG = "magic-context-dreamer-actions";
|
|
17
17
|
var openedDb;
|
|
18
18
|
function magicContextSubagentExtension(pi) {
|
|
19
|
-
setHarness(
|
|
19
|
+
setHarness(resolvePiHarnessKind());
|
|
20
20
|
pi.registerFlag(SUBAGENT_DREAMER_ACTIONS_FLAG, {
|
|
21
21
|
description: "Register ctx_memory with dreamer actions for Magic Context subagents.",
|
|
22
22
|
type: "boolean",
|