@cortexkit/magic-context 0.49.0 → 0.49.1
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/dist/index.js +203 -65
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2327,6 +2327,7 @@ import {
|
|
|
2327
2327
|
chmodSync as chmodSync2,
|
|
2328
2328
|
closeSync as closeSync2,
|
|
2329
2329
|
createWriteStream,
|
|
2330
|
+
fsyncSync,
|
|
2330
2331
|
lstatSync,
|
|
2331
2332
|
mkdirSync as mkdirSync2,
|
|
2332
2333
|
openSync as openSync2,
|
|
@@ -2464,44 +2465,9 @@ var enforcePrivateStoragePermissions = true;
|
|
|
2464
2465
|
var init_storage_permissions = () => {};
|
|
2465
2466
|
|
|
2466
2467
|
// ../plugin/src/shared/window-geometry.ts
|
|
2467
|
-
|
|
2468
|
-
if (configuredOverlayPath === path)
|
|
2469
|
-
return;
|
|
2470
|
-
reloadWindowOverlay(path);
|
|
2471
|
-
}
|
|
2472
|
-
function reloadWindowOverlay(path) {
|
|
2473
|
-
configuredOverlayPath = path;
|
|
2474
|
-
loadedOverlayPath = undefined;
|
|
2475
|
-
loadedOverlay = undefined;
|
|
2476
|
-
}
|
|
2477
|
-
var GRADES, UNITS, BOUNDARIES, UNKNOWN_REASONS, NUMERIC_FACT_KEYS, configuredOverlayPath, loadedOverlayPath, loadedOverlay, geometryClampLogSeen;
|
|
2468
|
+
var geometryClampLogSeen;
|
|
2478
2469
|
var init_window_geometry = __esm(() => {
|
|
2479
|
-
init_data_path();
|
|
2480
|
-
init_harness_provider_map();
|
|
2481
2470
|
init_logger();
|
|
2482
|
-
GRADES = new Set([
|
|
2483
|
-
"provider_asserted_runtime",
|
|
2484
|
-
"measured",
|
|
2485
|
-
"provider_asserted_doc",
|
|
2486
|
-
"catalog",
|
|
2487
|
-
"unknown"
|
|
2488
|
-
]);
|
|
2489
|
-
UNITS = new Set(["provider", "estimate"]);
|
|
2490
|
-
BOUNDARIES = new Set(["Observed", "Asserted", "Corrected"]);
|
|
2491
|
-
UNKNOWN_REASONS = new Set([
|
|
2492
|
-
"placeholder_output_equals_context",
|
|
2493
|
-
"placeholder_zero",
|
|
2494
|
-
"never_measured",
|
|
2495
|
-
"not_single_valued_at_key",
|
|
2496
|
-
"retracted"
|
|
2497
|
-
]);
|
|
2498
|
-
NUMERIC_FACT_KEYS = new Set([
|
|
2499
|
-
"window.advertised",
|
|
2500
|
-
"window.enforced",
|
|
2501
|
-
"output.advertised",
|
|
2502
|
-
"output.enforced",
|
|
2503
|
-
"output.default"
|
|
2504
|
-
]);
|
|
2505
2471
|
geometryClampLogSeen = new Set;
|
|
2506
2472
|
});
|
|
2507
2473
|
|
|
@@ -2565,6 +2531,21 @@ function migrateLegacyAgentEnabledInMemory(rawConfig, warnings) {
|
|
|
2565
2531
|
}
|
|
2566
2532
|
var init_agent_disable = () => {};
|
|
2567
2533
|
|
|
2534
|
+
// ../plugin/src/config/deprecated-config.ts
|
|
2535
|
+
function warnDeprecatedMuralModel(config, warnings) {
|
|
2536
|
+
const mural = config.mural;
|
|
2537
|
+
if (typeof mural === "object" && mural !== null && Object.hasOwn(mural, "model")) {
|
|
2538
|
+
warnings.push(MURAL_MODEL_DEPRECATION_WARNING);
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
function warnDeprecatedWindowOverlayPath(config, warnings) {
|
|
2542
|
+
const models = config.models;
|
|
2543
|
+
if (typeof models === "object" && models !== null && Object.hasOwn(models, "window_overlay_path") && !warnings.includes(WINDOW_OVERLAY_PATH_DEPRECATION_WARNING)) {
|
|
2544
|
+
warnings.push(WINDOW_OVERLAY_PATH_DEPRECATION_WARNING);
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2547
|
+
var MURAL_MODEL_DEPRECATION_WARNING = "mural.model is deprecated and ignored; compress-cues now uses the dreamer model for each harness, like every other dreamer task. To override it, set dreamer.opencode.tasks.compress-cues.model (or the pi/omp equivalent). This key no longer does anything; remove it.", WINDOW_OVERLAY_PATH_DEPRECATION_WARNING = "models.window_overlay_path is deprecated and ignored; Fusiform no longer publishes window-overlay data, so this setting no longer changes model window geometry. Remove this key.";
|
|
2548
|
+
|
|
2568
2549
|
// ../plugin/src/shared/jsonc-edit.ts
|
|
2569
2550
|
function parseDocument(text) {
|
|
2570
2551
|
const errors = [];
|
|
@@ -3480,15 +3461,6 @@ function migrateLegacyExperimental(rawConfig, warnings) {
|
|
|
3480
3461
|
return patched;
|
|
3481
3462
|
}
|
|
3482
3463
|
|
|
3483
|
-
// ../plugin/src/config/mural-model-deprecation.ts
|
|
3484
|
-
function warnDeprecatedMuralModel(config, warnings) {
|
|
3485
|
-
const mural = config.mural;
|
|
3486
|
-
if (typeof mural === "object" && mural !== null && Object.hasOwn(mural, "model")) {
|
|
3487
|
-
warnings.push(MURAL_MODEL_DEPRECATION_WARNING);
|
|
3488
|
-
}
|
|
3489
|
-
}
|
|
3490
|
-
var MURAL_MODEL_DEPRECATION_WARNING = "mural.model is deprecated and ignored; compress-cues now uses the dreamer model for each harness, like every other dreamer task. To override it, set dreamer.opencode.tasks.compress-cues.model (or the pi/omp equivalent). This key no longer does anything; remove it.";
|
|
3491
|
-
|
|
3492
3464
|
// ../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
3493
3465
|
function $constructor(name, initializer, params) {
|
|
3494
3466
|
function init(inst, def) {
|
|
@@ -9239,7 +9211,7 @@ var init_magic_context = __esm(() => {
|
|
|
9239
9211
|
document_prefix: string2().optional().describe("OpenAI-compatible stored-document prefix override, prepended verbatim. Defaults to the model-family recipe (empty for Qwen3/gte/e5 instruct; 'search_document: ' for Nomic). Changing it changes stored vectors and triggers re-embedding. User-level only; project values are ignored."),
|
|
9240
9212
|
truncate: string2().optional().describe("Optional truncate mode sent in the embedding request body (e.g. NVIDIA NIM accepts 'NONE' | 'START' | 'END'). Omitted from the request when unset."),
|
|
9241
9213
|
max_input_tokens: number2().int().positive().optional().describe("Optional maximum input tokens for chunk embeddings. Defaults conservatively to 512 when omitted."),
|
|
9242
|
-
local_runtime: _enum(["auto", "native", "wasm"]).default("auto").describe("Local provider only: ONNX runtime selection. 'auto' uses native under Node and uses WASM under Bun versions before 1.4.0, where Bun's NAPI teardown race can panic on quit; native is restored automatically on Bun 1.4.0+. Inference runs in a dedicated worker. On Bun before 1.4.0, even explicit 'native' uses WASM because native worker teardown can crash the process. Set 'wasm' to avoid loading the native addon on newer hosts too."),
|
|
9214
|
+
local_runtime: _enum(["auto", "native", "wasm"]).default("auto").describe("Local provider only: ONNX runtime selection. 'auto' uses native under Node and uses WASM under Bun versions before 1.4.0, where Bun's NAPI teardown race can panic on quit; native is restored automatically on Bun 1.4.0+. Inference runs in a dedicated worker after disabling POSIX telemetry in the native process environment. Compiled Bun hosts and hosts without a verified in-process opt-out use a subprocess instead. Windows native ONNX emits OS-controlled ETW diagnostics, not direct uploads. On Bun before 1.4.0, even explicit 'native' uses WASM because native worker teardown can crash the process. Set 'wasm' to avoid loading the native addon on newer hosts too."),
|
|
9243
9215
|
local_dtype: _enum([
|
|
9244
9216
|
"auto",
|
|
9245
9217
|
"fp32",
|
|
@@ -9348,8 +9320,8 @@ var init_magic_context = __esm(() => {
|
|
|
9348
9320
|
object({ default: number2().min(0) }).catchall(number2().min(0))
|
|
9349
9321
|
]).optional().describe('User-only output-token reservation override. Number or per-model object ({ default: 16384, "provider/model": 8192 }); 0 disables reservation. Takes precedence over every derived source: an explicit value here always wins against catalog output limits, provider window-geometry facts, and the 25%-of-context fallback (usable window = context window minus this reserve). When unset, Magic Context reserves the catalog output limit (capped at 25% of context) for shared-window providers and keeps proven separate-quota Google/Gemini windows unchanged.'),
|
|
9350
9322
|
models: object({
|
|
9351
|
-
window_overlay_path:
|
|
9352
|
-
}).optional().describe("
|
|
9323
|
+
window_overlay_path: unknown().optional().describe("Deprecated: ignored. Fusiform no longer publishes window-overlay data, so this setting no longer changes model window geometry. Remove this key.").meta({ deprecated: true })
|
|
9324
|
+
}).optional().describe("Deprecated user-only Fusiform window-overlay settings; ignored."),
|
|
9353
9325
|
toast_duration_ms: number2().min(0).max(60000).default(5000).describe("TUI toast lifetime in milliseconds for Magic Context notifications. Set to 0 to disable Magic Context toasts entirely (min: 0, max: 60000, default: 5000)"),
|
|
9354
9326
|
execute_threshold_percentage: union([
|
|
9355
9327
|
number2().min(20).max(90, EXECUTE_THRESHOLD_CAP_MESSAGE),
|
|
@@ -9750,7 +9722,7 @@ function stripUnsafeProjectConfigFields(projectRaw) {
|
|
|
9750
9722
|
const models = projectRaw.models;
|
|
9751
9723
|
if (isPlainObject2(models) && "window_overlay_path" in models) {
|
|
9752
9724
|
delete models.window_overlay_path;
|
|
9753
|
-
warnings.push("Ignoring models.window_overlay_path from project config (
|
|
9725
|
+
warnings.push("Ignoring models.window_overlay_path from project config (deprecated; this setting no longer changes model window geometry).");
|
|
9754
9726
|
}
|
|
9755
9727
|
if ("language" in projectRaw) {
|
|
9756
9728
|
delete projectRaw.language;
|
|
@@ -10917,6 +10889,7 @@ function parsePluginConfig(rawConfig, recoveredTopLevelKeys = []) {
|
|
|
10917
10889
|
preMigrationWarnings.push(...misplacedAgentModelWarnings(rawConfig));
|
|
10918
10890
|
const migratedExperimental = migrateLegacyExperimental(configWithoutRemovedAgent, preMigrationWarnings);
|
|
10919
10891
|
warnDeprecatedMuralModel(migratedExperimental, preMigrationWarnings);
|
|
10892
|
+
warnDeprecatedWindowOverlayPath(migratedExperimental, preMigrationWarnings);
|
|
10920
10893
|
const migratedDreamer = migrateDreamerV2(migratedExperimental, preMigrationWarnings);
|
|
10921
10894
|
const migrated = migrateLegacyAgentEnabledInMemory(migratedDreamer, preMigrationWarnings);
|
|
10922
10895
|
const parsed = MagicContextConfigSchema.safeParse(migrated);
|
|
@@ -11168,7 +11141,6 @@ function loadPluginConfigDetailed(directory, applyRuntimeGlobals = true) {
|
|
|
11168
11141
|
config.profile = profileResolution.activeProfile;
|
|
11169
11142
|
if (applyRuntimeGlobals) {
|
|
11170
11143
|
setOutputReserveConfig(config.output_reserve);
|
|
11171
|
-
setWindowOverlayPath(config.models?.window_overlay_path);
|
|
11172
11144
|
}
|
|
11173
11145
|
const leafValidationWarnings = [...config.configWarnings ?? []];
|
|
11174
11146
|
if (config.configWarnings?.length) {
|
|
@@ -11234,7 +11206,6 @@ var init_config = __esm(() => {
|
|
|
11234
11206
|
init_jsonc_parser();
|
|
11235
11207
|
init_logger();
|
|
11236
11208
|
init_models_dev_cache();
|
|
11237
|
-
init_window_geometry();
|
|
11238
11209
|
init_agent_disable();
|
|
11239
11210
|
init_migrate_config_location();
|
|
11240
11211
|
init_migrate_dreamer_v2();
|
|
@@ -32076,15 +32047,111 @@ var init_edit_marker = __esm(() => {
|
|
|
32076
32047
|
DIFF_KEYS = new Set(["oldString", "newString", "content", "old_string", "new_string"]);
|
|
32077
32048
|
});
|
|
32078
32049
|
|
|
32079
|
-
// ../plugin/src/
|
|
32080
|
-
var
|
|
32081
|
-
var
|
|
32082
|
-
|
|
32050
|
+
// ../plugin/src/features/magic-context/merged-reasoning-decisions.ts
|
|
32051
|
+
var decodedDecisions, MAX_DECODED_DECISION_BYTES;
|
|
32052
|
+
var init_merged_reasoning_decisions = __esm(() => {
|
|
32053
|
+
decodedDecisions = new Map;
|
|
32054
|
+
MAX_DECODED_DECISION_BYTES = 32 * 1024 * 1024;
|
|
32055
|
+
});
|
|
32056
|
+
// ../plugin/src/features/magic-context/session-decision-calibration.ts
|
|
32057
|
+
var init_session_decision_calibration = __esm(() => {
|
|
32083
32058
|
init_decision_calibration();
|
|
32084
|
-
|
|
32085
|
-
|
|
32086
|
-
|
|
32087
|
-
|
|
32059
|
+
init_harness_provider_map();
|
|
32060
|
+
});
|
|
32061
|
+
|
|
32062
|
+
// ../plugin/src/features/magic-context/protection-window.ts
|
|
32063
|
+
var init_protection_window = __esm(async () => {
|
|
32064
|
+
init_session_decision_calibration();
|
|
32065
|
+
await init_storage_tags();
|
|
32066
|
+
});
|
|
32067
|
+
|
|
32068
|
+
// ../plugin/src/features/magic-context/storage-meta-shared.ts
|
|
32069
|
+
var BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, sessionMetaExistsStatements;
|
|
32070
|
+
var init_storage_meta_shared = __esm(async () => {
|
|
32071
|
+
init_harness_provider_map();
|
|
32072
|
+
await init_sqlite();
|
|
32073
|
+
BOOLEAN_META_KEYS = new Set(["isSubagent", "compartmentInProgress", "cacheAlertSent"]);
|
|
32074
|
+
NULL_BIND_META_KEYS = new Set([
|
|
32075
|
+
"cachedM0Bytes",
|
|
32076
|
+
"cachedM0MuralDataUrl",
|
|
32077
|
+
"cachedM0MuralHash",
|
|
32078
|
+
"cachedM1Bytes",
|
|
32079
|
+
"cachedM0ProjectMemoryEpoch",
|
|
32080
|
+
"cachedM0WorkspaceFingerprint",
|
|
32081
|
+
"cachedM0ProjectUserProfileVersion",
|
|
32082
|
+
"cachedM0MaxCompartmentSeq",
|
|
32083
|
+
"cachedM0MaxMemoryId",
|
|
32084
|
+
"cachedM0MaxMutationId",
|
|
32085
|
+
"cachedM0MaxMemoryMutationId",
|
|
32086
|
+
"cachedM0ProjectDocsHash",
|
|
32087
|
+
"cachedM0MaterializedAt",
|
|
32088
|
+
"cachedM0SessionFactsVersion",
|
|
32089
|
+
"cachedM0UpgradeState",
|
|
32090
|
+
"cachedM0ProjectIdentity",
|
|
32091
|
+
"lastObservedModelKey",
|
|
32092
|
+
"upgradeRemindedAt",
|
|
32093
|
+
"upgradeReminderLastSentAt",
|
|
32094
|
+
"piStableIdScheme"
|
|
32095
|
+
]);
|
|
32096
|
+
sessionMetaExistsStatements = new WeakMap;
|
|
32097
|
+
});
|
|
32098
|
+
|
|
32099
|
+
// ../plugin/src/features/magic-context/storage-replay-document.ts
|
|
32100
|
+
var MISSING_REPLAY_DOCUMENT_COLUMN, decisionTablePresent, trailingBlankReadCache, TRAILING_BLANK_CACHE_MAX_CHARS, DECISION_CONFLICT;
|
|
32101
|
+
var init_storage_replay_document = __esm(async () => {
|
|
32102
|
+
init_logger();
|
|
32103
|
+
await init_storage_meta_shared();
|
|
32104
|
+
MISSING_REPLAY_DOCUMENT_COLUMN = Symbol("missing replay document column");
|
|
32105
|
+
decisionTablePresent = new WeakMap;
|
|
32106
|
+
trailingBlankReadCache = new WeakMap;
|
|
32107
|
+
TRAILING_BLANK_CACHE_MAX_CHARS = 4 * 1024 * 1024;
|
|
32108
|
+
DECISION_CONFLICT = Symbol("replay decision changed concurrently");
|
|
32109
|
+
});
|
|
32110
|
+
|
|
32111
|
+
// ../plugin/src/features/magic-context/storage-meta-persisted.ts
|
|
32112
|
+
var emergencyRecoveryArmedSessions, emergencyRecoveryArmedAtBySession, providerOverflowReconfirmedSessions, providerOverflowKnownLimitSessions, AUTO_SEARCH_NO_HINT_REASONS, DRAIN_WINDOW_MS, WRAPUP_IN_PROGRESS_TTL_MS, COMPACTION_MODE_RECORD_VALUES, EMERGENCY_DRAIN_MAX_LATCH_MS, pendingAutoSearchRetirements, COMPACTION_MARKER_PENDING_BUDGET_MS, preSnapshotSessions, warnedProtectedTokenTierOverrides;
|
|
32113
|
+
var init_storage_meta_persisted = __esm(async () => {
|
|
32114
|
+
init_magic_context();
|
|
32115
|
+
init_harness_provider_map();
|
|
32116
|
+
init_logger();
|
|
32117
|
+
init_write_transaction_timing();
|
|
32118
|
+
init_merged_reasoning_decisions();
|
|
32119
|
+
await __promiseAll([
|
|
32120
|
+
init_protection_window(),
|
|
32121
|
+
init_storage_meta_shared(),
|
|
32122
|
+
init_storage_replay_document()
|
|
32123
|
+
]);
|
|
32124
|
+
emergencyRecoveryArmedSessions = new Set;
|
|
32125
|
+
emergencyRecoveryArmedAtBySession = new Map;
|
|
32126
|
+
providerOverflowReconfirmedSessions = new Set;
|
|
32127
|
+
providerOverflowKnownLimitSessions = new Set;
|
|
32128
|
+
AUTO_SEARCH_NO_HINT_REASONS = new Set([
|
|
32129
|
+
"below-threshold",
|
|
32130
|
+
"timeout",
|
|
32131
|
+
"empty",
|
|
32132
|
+
"error",
|
|
32133
|
+
"stacked",
|
|
32134
|
+
"too-short"
|
|
32135
|
+
]);
|
|
32136
|
+
DRAIN_WINDOW_MS = 10 * 60 * 1000;
|
|
32137
|
+
WRAPUP_IN_PROGRESS_TTL_MS = 5 * 60 * 1000;
|
|
32138
|
+
COMPACTION_MODE_RECORD_VALUES = new Set([
|
|
32139
|
+
"on",
|
|
32140
|
+
"off",
|
|
32141
|
+
"on_notice_pending",
|
|
32142
|
+
"off_notice_pending",
|
|
32143
|
+
"off_cleanup_pending"
|
|
32144
|
+
]);
|
|
32145
|
+
EMERGENCY_DRAIN_MAX_LATCH_MS = 30 * 60 * 1000;
|
|
32146
|
+
pendingAutoSearchRetirements = new WeakMap;
|
|
32147
|
+
COMPACTION_MARKER_PENDING_BUDGET_MS = 5 * 60000;
|
|
32148
|
+
preSnapshotSessions = new Map;
|
|
32149
|
+
warnedProtectedTokenTierOverrides = new WeakSet;
|
|
32150
|
+
});
|
|
32151
|
+
|
|
32152
|
+
// ../plugin/src/features/magic-context/storage-reasoning-removal.ts
|
|
32153
|
+
var init_storage_reasoning_removal = __esm(async () => {
|
|
32154
|
+
await init_storage_replay_document();
|
|
32088
32155
|
});
|
|
32089
32156
|
|
|
32090
32157
|
// ../plugin/src/features/magic-context/overflow-detection.ts
|
|
@@ -32108,6 +32175,74 @@ var init_sentinel = __esm(() => {
|
|
|
32108
32175
|
NEUTRALIZED_ORIGINALS = new WeakMap;
|
|
32109
32176
|
});
|
|
32110
32177
|
|
|
32178
|
+
// ../plugin/src/hooks/magic-context/active-anthropic-turn.ts
|
|
32179
|
+
var init_active_anthropic_turn = __esm(() => {
|
|
32180
|
+
init_sentinel();
|
|
32181
|
+
});
|
|
32182
|
+
|
|
32183
|
+
// ../plugin/src/hooks/magic-context/strip-content.ts
|
|
32184
|
+
var METADATA_PART_TYPES, CLEARED_REASONING_TYPES, REASONING_IGNORED_PART_TYPES, REASONING_PART_TYPES;
|
|
32185
|
+
var init_strip_content = __esm(() => {
|
|
32186
|
+
init_merged_reasoning_decisions();
|
|
32187
|
+
init_sentinel();
|
|
32188
|
+
init_tag_content_primitives();
|
|
32189
|
+
METADATA_PART_TYPES = new Set([
|
|
32190
|
+
"step-start",
|
|
32191
|
+
"step-finish",
|
|
32192
|
+
"snapshot",
|
|
32193
|
+
"patch",
|
|
32194
|
+
"agent",
|
|
32195
|
+
"retry",
|
|
32196
|
+
"subtask",
|
|
32197
|
+
"compaction"
|
|
32198
|
+
]);
|
|
32199
|
+
CLEARED_REASONING_TYPES = new Set(["thinking", "reasoning"]);
|
|
32200
|
+
REASONING_IGNORED_PART_TYPES = new Set([
|
|
32201
|
+
"step-start",
|
|
32202
|
+
"step-finish",
|
|
32203
|
+
"snapshot",
|
|
32204
|
+
"patch",
|
|
32205
|
+
"agent",
|
|
32206
|
+
"retry",
|
|
32207
|
+
"subtask",
|
|
32208
|
+
"compaction"
|
|
32209
|
+
]);
|
|
32210
|
+
REASONING_PART_TYPES = new Set(["reasoning", "thinking", "redacted_thinking"]);
|
|
32211
|
+
});
|
|
32212
|
+
|
|
32213
|
+
// ../plugin/src/hooks/magic-context/reasoning-budget.ts
|
|
32214
|
+
var init_reasoning_budget = __esm(async () => {
|
|
32215
|
+
init_merged_reasoning_decisions();
|
|
32216
|
+
init_prompt_surface();
|
|
32217
|
+
init_active_anthropic_turn();
|
|
32218
|
+
init_read_session_formatting();
|
|
32219
|
+
init_sentinel();
|
|
32220
|
+
init_strip_content();
|
|
32221
|
+
await __promiseAll([
|
|
32222
|
+
init_storage_meta_persisted(),
|
|
32223
|
+
init_storage_reasoning_removal(),
|
|
32224
|
+
init_storage_tags()
|
|
32225
|
+
]);
|
|
32226
|
+
});
|
|
32227
|
+
|
|
32228
|
+
// ../plugin/src/hooks/magic-context/opaque-thinking.ts
|
|
32229
|
+
var init_opaque_thinking = __esm(async () => {
|
|
32230
|
+
await init_reasoning_budget();
|
|
32231
|
+
});
|
|
32232
|
+
|
|
32233
|
+
// ../plugin/src/hooks/magic-context/final-wire-token-estimate.ts
|
|
32234
|
+
var wireTextTokens;
|
|
32235
|
+
var init_final_wire_token_estimate = __esm(async () => {
|
|
32236
|
+
init_tool_definition_tokens();
|
|
32237
|
+
init_decision_calibration();
|
|
32238
|
+
init_image_token_estimate();
|
|
32239
|
+
init_read_session_formatting();
|
|
32240
|
+
init_tokenizer_calibration();
|
|
32241
|
+
init_logger();
|
|
32242
|
+
await init_opaque_thinking();
|
|
32243
|
+
wireTextTokens = createTokenCountMemo(1e5, 128 * 1024 * 1024);
|
|
32244
|
+
});
|
|
32245
|
+
|
|
32111
32246
|
// ../plugin/src/hooks/magic-context/tool-input-size.ts
|
|
32112
32247
|
var encoder2;
|
|
32113
32248
|
var init_tool_input_size = __esm(() => {
|
|
@@ -32136,14 +32271,14 @@ function extractToolCallObservation(part) {
|
|
|
32136
32271
|
return null;
|
|
32137
32272
|
}
|
|
32138
32273
|
var IGNORE_PART_TYPES;
|
|
32139
|
-
var init_tool_drop_target = __esm(() => {
|
|
32274
|
+
var init_tool_drop_target = __esm(async () => {
|
|
32140
32275
|
init_user_answer();
|
|
32141
32276
|
init_dropped_input_guard();
|
|
32142
32277
|
init_edit_marker();
|
|
32143
|
-
init_final_wire_token_estimate();
|
|
32144
32278
|
init_sentinel();
|
|
32145
32279
|
init_tag_content_primitives();
|
|
32146
32280
|
init_tool_input_size();
|
|
32281
|
+
await init_final_wire_token_estimate();
|
|
32147
32282
|
IGNORE_PART_TYPES = new Set([
|
|
32148
32283
|
"thinking",
|
|
32149
32284
|
"reasoning",
|
|
@@ -33122,13 +33257,13 @@ var init_read_session_chunk = __esm(async () => {
|
|
|
33122
33257
|
init_read_session_true_raw_tokens();
|
|
33123
33258
|
init_system_injection_stripper();
|
|
33124
33259
|
init_tag_part_guards();
|
|
33125
|
-
init_tool_drop_target();
|
|
33126
33260
|
init_read_session_formatting();
|
|
33127
33261
|
await __promiseAll([
|
|
33128
33262
|
init_storage_tags(),
|
|
33129
33263
|
init_raw_ordinal_warmup(),
|
|
33130
33264
|
init_read_session_db(),
|
|
33131
|
-
init_read_session_raw()
|
|
33265
|
+
init_read_session_raw(),
|
|
33266
|
+
init_tool_drop_target()
|
|
33132
33267
|
]);
|
|
33133
33268
|
blockTokenMemo = new Map;
|
|
33134
33269
|
sessionProviders = new Map;
|
|
@@ -44228,6 +44363,7 @@ function parsePiConfig(rawConfig, recoveredTopLevelKeys = []) {
|
|
|
44228
44363
|
const agentMigrated = migrateLegacyAgentEnabledInMemory(configToMigrate, preMigrationWarnings);
|
|
44229
44364
|
const migratedExperimental = migrateLegacyExperimental(agentMigrated, preMigrationWarnings);
|
|
44230
44365
|
warnDeprecatedMuralModel(migratedExperimental, preMigrationWarnings);
|
|
44366
|
+
warnDeprecatedWindowOverlayPath(migratedExperimental, preMigrationWarnings);
|
|
44231
44367
|
const migrated = migrateDreamerV2(migratedExperimental, preMigrationWarnings);
|
|
44232
44368
|
const parsed = MagicContextConfigSchema.safeParse(migrated);
|
|
44233
44369
|
if (parsed.success) {
|
|
@@ -44470,7 +44606,6 @@ function loadPiConfigDetailed(opts = {}, applyRuntimeGlobals = true) {
|
|
|
44470
44606
|
parsed.config.profile = profileResolution.activeProfile;
|
|
44471
44607
|
if (applyRuntimeGlobals) {
|
|
44472
44608
|
setOutputReserveConfig(parsed.config.output_reserve);
|
|
44473
|
-
setWindowOverlayPath(parsed.config.models?.window_overlay_path);
|
|
44474
44609
|
}
|
|
44475
44610
|
warnings.push(...parsed.warnings.map((warning) => `[merged config] ${warning}`));
|
|
44476
44611
|
const substitutionFailures = loadedFiles.flatMap(bindSubstitutionFailures2);
|
|
@@ -44520,7 +44655,6 @@ var init_config2 = __esm(() => {
|
|
|
44520
44655
|
init_config_diagnostics();
|
|
44521
44656
|
init_jsonc_parser();
|
|
44522
44657
|
init_models_dev_cache();
|
|
44523
|
-
init_window_geometry();
|
|
44524
44658
|
});
|
|
44525
44659
|
|
|
44526
44660
|
// src/lib/database-repair-guidance.ts
|
|
@@ -47017,9 +47151,13 @@ var init_embedding_identity = __esm(() => {
|
|
|
47017
47151
|
init_normalize_hash();
|
|
47018
47152
|
});
|
|
47019
47153
|
|
|
47154
|
+
// ../plugin/src/features/magic-context/memory/onnx-telemetry.ts
|
|
47155
|
+
var init_onnx_telemetry = () => {};
|
|
47156
|
+
|
|
47020
47157
|
// ../plugin/src/features/magic-context/memory/embedding-worker-client.ts
|
|
47021
47158
|
var init_embedding_worker_client = __esm(() => {
|
|
47022
47159
|
init_logger();
|
|
47160
|
+
init_onnx_telemetry();
|
|
47023
47161
|
});
|
|
47024
47162
|
// ../plugin/src/features/magic-context/memory/embedding-local.ts
|
|
47025
47163
|
function currentLocalEmbeddingHost() {
|