@cortexkit/magic-context 0.49.49 → 0.49.51

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 (2) hide show
  1. package/dist/index.js +43 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10457,6 +10457,7 @@ var init_magic_context = __esm(() => {
10457
10457
  query_instruction: union([string2(), literal(false)]).optional().describe("OpenAI-compatible query prefix override. A string is prepended verbatim to search queries; false disables the built-in model-family instruction. Qwen3-Embedding, gte-Qwen instruct, e5 instruct, and Nomic families have built-in recipes. Query-only changes do not re-embed stored content. User-level only; project values are ignored."),
10458
10458
  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."),
10459
10459
  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."),
10460
+ dimensions: number2().int().min(1).max(8192).optional().describe("Optional output width for Matryoshka embedding models (e.g. Qwen3-Embedding-8B accepts 768 | 1024 | 2048 | 4096; OpenAI text-embedding-3-* accept smaller widths than native). Sent as the OpenAI-compatible `dimensions` request field. Omitted from the request when unset, so the endpoint default applies. Changing it changes the produced vectors and folds into the embedding model identity, so switching widths re-embeds rather than mixing vector spaces. Not supported for the local provider, and ignored from project config like the other embedding fields (a repository cannot choose how private text is embedded)."),
10460
10461
  max_input_tokens: number2().int().positive().optional().describe("Optional maximum input tokens for chunk embeddings. Defaults conservatively to 512 when omitted."),
10461
10462
  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."),
10462
10463
  local_dtype: _enum([
@@ -10505,6 +10506,7 @@ var init_magic_context = __esm(() => {
10505
10506
  ...model ? { model } : {},
10506
10507
  ...endpoint ? { endpoint } : {},
10507
10508
  ...apiKey ? { api_key: apiKey } : {},
10509
+ ...data.dimensions ? { dimensions: data.dimensions } : {},
10508
10510
  ...inputType ? { input_type: inputType } : {},
10509
10511
  ...queryInputType ? { query_input_type: queryInputType } : {},
10510
10512
  ...data.query_instruction !== undefined ? { query_instruction: data.query_instruction } : {},
@@ -10531,6 +10533,7 @@ var init_magic_context = __esm(() => {
10531
10533
  provider: "openai-compatible",
10532
10534
  model: data.model?.trim() ?? "",
10533
10535
  endpoint: data.endpoint?.trim() ?? "",
10536
+ ...data.dimensions ? { dimensions: data.dimensions } : {},
10534
10537
  ...apiKey ? { api_key: apiKey } : {},
10535
10538
  ...inputType ? { input_type: inputType } : {},
10536
10539
  ...queryInputType ? { query_input_type: queryInputType } : {},
@@ -11426,7 +11429,8 @@ var init_project_security = __esm(() => {
11426
11429
  "provider",
11427
11430
  "fallback_provider",
11428
11431
  "query_instruction",
11429
- "document_prefix"
11432
+ "document_prefix",
11433
+ "dimensions"
11430
11434
  ];
11431
11435
  PROTECTED_TOKENS_TIER_OVERRIDES = Symbol.for("@cortexkit/magic-context/protected-tokens-tier-overrides");
11432
11436
  PROJECT_COMMAND_STRING_FIELDS = ["description", "agent", "model"];
@@ -37114,7 +37118,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
37114
37118
  return null;
37115
37119
  }
37116
37120
  healWedgedChannel2Claims(db);
37117
- if (!explicitDbPath) {
37121
+ if (!explicitDbPath && scheduleStartupMaintenanceOnOpen) {
37118
37122
  const readsOpenCodeStore = harnessOwnsOpenCodeStore();
37119
37123
  const state = { controller: new AbortController };
37120
37124
  startupBackfills.set(db, state);
@@ -37155,6 +37159,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
37155
37159
  log(`[magic-context] message-index backfill failed (will resume next startup): ${getErrorMessage(error)}`);
37156
37160
  });
37157
37161
  }));
37162
+ state.run = runBackfills;
37158
37163
  state.timer = scheduleAfterBootQuiet(runBackfills);
37159
37164
  }
37160
37165
  setDatabase(db);
@@ -38525,7 +38530,7 @@ function closeDatabase() {
38525
38530
  }
38526
38531
  return Promise.all(pendingDatabaseCloses).then(() => {});
38527
38532
  }
38528
- var databases, pendingAsyncOpens, pendingDatabaseCloses, startupBackfills, persistenceByDatabase, persistenceErrorByDatabase, pathByDatabase, lastSchemaFenceRejection = null, lastMigrationOnOpenRefusal = null, lastUnconfirmedMigrationHolders = null, LATEST_SUPPORTED_VERSION = 95, BOOT_SQLITE_BUSY_TIMEOUT_MS = 5000, RPC_DISCOVERY_PARSE_GRACE_MS, defaultRpcDiscoveryFs, rpcDiscoveryFs, RPC_DISCOVERY_DIR_PRUNE_MIN_AGE_MS = 60000, sqlitePragmaConfig, CHANNEL2_CLAIM_TTL_MS, channel2HealStatements;
38533
+ var databases, pendingAsyncOpens, pendingDatabaseCloses, startupBackfills, scheduleStartupMaintenanceOnOpen = true, persistenceByDatabase, persistenceErrorByDatabase, pathByDatabase, lastSchemaFenceRejection = null, lastMigrationOnOpenRefusal = null, lastUnconfirmedMigrationHolders = null, LATEST_SUPPORTED_VERSION = 95, BOOT_SQLITE_BUSY_TIMEOUT_MS = 5000, RPC_DISCOVERY_PARSE_GRACE_MS, defaultRpcDiscoveryFs, rpcDiscoveryFs, RPC_DISCOVERY_DIR_PRUNE_MIN_AGE_MS = 60000, sqlitePragmaConfig, CHANNEL2_CLAIM_TTL_MS, channel2HealStatements;
38529
38534
  var init_storage_db = __esm(async () => {
38530
38535
  init_data_path();
38531
38536
  init_logger();
@@ -48216,6 +48221,7 @@ var init_issue_log_templates_generated = __esm(() => {
48216
48221
  "rust pass: decision=\x01 reason=\x01 committed=\x01 prefix_bust_permitted=\x01 served_from=\x01 in=\x01 out=\x01 applied=\x01 row_version=\x01 elapsed=\x01 ms module=\x01 ms stages=identity_resolve:\x01 prompt_surface:\x01 mural_resolve:\x01 prefix_guard:\x01 ordinal_resolve:\x01 ordinal_rebuild:\x01 ordinal_rows:\x01 ordinal_mode:\x01 state_sync:\x01 clone:\x01 wire_build:\x01 wire_messages:\x01 transport:\x01 transport_pages:\x01 transport_bytes:\x01 apply:\x01 lkg_snapshot:\x01 mirror_pull:\x01 compartment_mirror:\x01 other:\x01 transport_lane:\x01 transport_route:\x01 transport_encode:\x01 transport_issue:\x01 transport_response_wait_decode:\x01 transport_settle:\x01 transport_wrapper:\x01 preflight:\x01 todo_verdict:\x01 todo_probe:\x01 todo_persist:\x01 todo_probe_required:\x01 todo_probe_reason:\x01 todo_unprobed_bust:\x01 session_directory:\x01 paging:\x01 output_clone:\x01 delivery:\x01 bookkeeping:\x01\x0219p",
48217
48222
  "rust pass: decision=\x01 reason=\x01 scheduler=\x01 prefix_bust_permitted=\x01 served_from=\x01 in=\x01 out=\x01 applied=\x01 row_version=\x01 elapsed=\x01 ms module=\x01 ms stages=identity_resolve:\x01 prompt_surface:\x01 mural_resolve:\x01 prefix_guard:\x01 ordinal_resolve:\x01 ordinal_rebuild:\x01 ordinal_rows:\x01 ordinal_mode:\x01 state_sync:\x01 clone:\x01 wire_build:\x01 wire_messages:\x01 transport:\x01 transport_pages:\x01 transport_bytes:\x01 apply:\x01 lkg_snapshot:\x01 mirror_pull:\x01 compartment_mirror:\x01 other:\x01 transport_lane:\x01 transport_route:\x01 transport_encode:\x01 transport_issue:\x01 transport_response_wait_decode:\x01 transport_settle:\x01 transport_wrapper:\x01 preflight:\x01 todo_verdict:\x01 todo_probe:\x01 todo_persist:\x01 todo_probe_required:\x01 todo_probe_reason:\x01 todo_unprobed_bust:\x01 session_directory:\x01 paging:\x01 output_clone:\x01 delivery:\x01 bookkeeping:\x01\x0219p",
48218
48223
  "rust pass: decision=\x01 reason=\x01 prefix_bust_permitted=\x01 served_from=\x01 in=\x01 out=\x01 applied=\x01 row_version=\x01 elapsed=\x01 ms module=\x01 ms stages=identity_resolve:\x01 prompt_surface:\x01 mural_resolve:\x01 prefix_guard:\x01 ordinal_resolve:\x01 ordinal_rebuild:\x01 ordinal_rows:\x01 ordinal_mode:\x01 state_sync:\x01 clone:\x01 wire_build:\x01 wire_messages:\x01 transport:\x01 transport_pages:\x01 transport_bytes:\x01 apply:\x01 lkg_snapshot:\x01 mirror_pull:\x01 compartment_mirror:\x01 other:\x01 transport_lane:\x01 transport_route:\x01 transport_encode:\x01 transport_issue:\x01 transport_response_wait_decode:\x01 transport_settle:\x01 transport_wrapper:\x01 preflight:\x01 todo_verdict:\x01 todo_probe:\x01 todo_persist:\x01 todo_probe_required:\x01 todo_probe_reason:\x01 todo_unprobed_bust:\x01 session_directory:\x01 paging:\x01 output_clone:\x01 delivery:\x01 bookkeeping:\x01\x0218p",
48224
+ "ERROR dispatch structure refused: row=\x01 firstInjectorRow=\x01 firstInjectorKind=\x01 foreignRule=\x01 foreignReason=\x01 foreignCount=\x01 foreignChars=\x01 foreignGapPrepared=\x01 foreignGapWire=\x01 foreignGapChars=\x01 kinds[text=1,image=2,call=4,result=8,thinking=16,other=32] expectedPrevious role=\x01 parts=\x01 kinds=\x01 chars=\x01 injector=\x01; expectedCurrent role=\x01 parts=\x01 kinds=\x01 chars=\x01 injector=\x01; expectedNext role=\x01 parts=\x01 kinds=\x01 chars=\x01 injector=\x01; actualPrevious role=\x01 parts=\x01 kinds=\x01 chars=\x01 injector=\x01; actualCurrent role=\x01 parts=\x01 kinds=\x01 chars=\x01 injector=\x01; actualNext role=\x01 parts=\x01 kinds=\x01 chars=\x01 injector=\x01",
48219
48225
  "rust module stages: handler=\x01 apply_once=\x01 request_to_handler=\x01 delta_expand=\x01 projection_cache_lookup=\x01 projection=\x01 selection=\x01 build_output=\x01 store_commit=\x01 trigger=\x01 trigger_boundary=\x01 trigger_eval=\x01 projection_cache_store=\x01 native_attach=\x01 retained_size=\x01 snapshot_store=\x01 post_attach=\x01 response_encode=\x01 response_meta_encode=\x01 response_splice=\x01 native_cache_reused=\x01 native_cache_encoded=\x01",
48220
48226
  "[mc-module] runner cannot delete sessions: Broca has no session.delete operation and never deletes a session. Its write-ahead log is append-only, an idle session is moved into an archive byte for byte after 7 days and kept, and engram backs both up. Dreamer memory-pool snapshots sent to the runner therefore stay indefinitely; closing routes does not delete them.",
48221
48227
  "prefix trim: boundary \x01; pass=priced; no in-pass trim applied (Refusing to compact a Magic Context hidden child of a disposed plugin instance: the Magic Context plugin instance that started this hidden run was disposed (OpenCode reloaded the plugin), so the run was cancelled; the work is retried on a later run)",
@@ -48273,6 +48279,7 @@ var init_issue_log_templates_generated = __esm(() => {
48273
48279
  "WARN: Magic Context \x01 config migration refused: \x01. Legacy and CortexKit config paths collapse to one file, but Magic Context will not overwrite or merge them automatically. Please consolidate manually into \x01. Paths: \x01\x022p,3p",
48274
48280
  "history boundary repair: compartment end \x01 is not in the active host branch; re-anchored on the start of history; removed compartments none for the historian to rebuild; the cached prefix is rebuilt on this pass\x020i",
48275
48281
  "history boundary repair: compartment end \x01 is not in the active host branch; re-anchored on the start of history; removed compartments \x01-\x01 (\x01) for the historian to rebuild; the cached prefix is rebuilt on this pass\x020i",
48282
+ "foreign context rows accepted: count=\x01 chars=\x01 beforePreparedRow0=\x01 beforePreparedRow1=\x01 beforePreparedRow2=\x01 beforePreparedRow3=\x01; inserted by another extension after Magic Context's pass, outside managed history",
48276
48283
  "transform stage: stage=rust.state_sync_detail phase=\x01 elapsed=\x01ms collect_ms=\x01 serialize_ms=\x01 page_build_ms=\x01 status_ms=\x01 transport_ms=\x01 module_ack_ms=\x01 compartments=\x01 tags=\x01 bytes=\x01 pages=\x01 raw_reads=\x01 raw_messages=\x01",
48277
48284
  "history boundary repair: compartment end \x01 is not in the host store; re-anchored on the start of history; removed compartments none for the historian to rebuild; the cached prefix is rebuilt on this pass\x020i",
48278
48285
  "history boundary repair: compartment end \x01 is not in the host store; re-anchored on the start of history; removed compartments \x01-\x01 (\x01) for the historian to rebuild; the cached prefix is rebuilt on this pass\x020i",
@@ -48518,6 +48525,7 @@ var init_issue_log_templates_generated = __esm(() => {
48518
48525
  "injecting legacy compartments without visible-prefix trimming because latest stored compartment has no end_message_id",
48519
48526
  "prefix trim: boundary \x01; pass=priced; no in-pass trim applied (Hidden completion accepts text-only calibrated prompts)",
48520
48527
  'Pi subagent "\x01" is dropping unavailable built-in "\x01". This source-inspection task cannot read local files without read.',
48528
+ "v2 usage: ignored server-fallback reply inputTokens=\x01 (invalid server-fallback usage marker); keeping previous reading",
48521
48529
  "auto-search: decision outcome=error reason=\x01 lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48522
48530
  "auto-search: decision outcome=no-candidates lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48523
48531
  "compartment trigger: not firing at \x01% — no eligible head; offset=\x01 protectedStart=\x01 eligibleEnd=\x01 rawTokens=\x01 chunkTokens=\x01",
@@ -48642,6 +48650,7 @@ var init_issue_log_templates_generated = __esm(() => {
48642
48650
  "channel2 ceiling nudge delivery failed after its claim was no longer owned; lease state left unchanged:",
48643
48651
  "compaction-marker drain: CAS-clear failed but no pending blob remains; another drain already cleared it",
48644
48652
  "[\x01] primary (primary) failed validation/prompt: \x01: \x01; \x01 fallback(s) configured, subject to remaining budget",
48653
+ "v2 usage: ignored server-fallback reply inputTokens=\x01 (sum of two server runs); keeping previous reading",
48645
48654
  "caveman cleanup: switched to current rules (language-neutral word rules), rewrote \x01 compressed text tags",
48646
48655
  "[magic-context] sqlite writer site=\x01 db=opencode acquire_ms=\x01 hold_ms=\x01 work_ms=\x01 end_ms=\x01 outcome=committed",
48647
48656
  '[magic-context] partial recomp failed session=\x01 code=\x01 reason="chunk coverage ends at \x01 but chunk end is \x01"\x020s',
@@ -49950,6 +49959,7 @@ var init_issue_log_templates_generated = __esm(() => {
49950
49959
  "[magic-context] failed to backfill memory embeddings: \x01",
49951
49960
  "[magic-context] failed to copy embedding model cache: \x01",
49952
49961
  "[magic-context] host stall profiler: could not start: \x01",
49962
+ "[magic-context] host stall profiler: session-content: \x01",
49953
49963
  "[magic-context] host stall profiler: truncated frame: \x01",
49954
49964
  "[magic-context] maintenance tick (startup) — projects=\x01",
49955
49965
  "[magic-context] sending conflict warning to session \x01: \x01\x020s",
@@ -50030,6 +50040,7 @@ var init_issue_log_templates_generated = __esm(() => {
50030
50040
  "[auto-update-checker] Update available (latest): \x01 → \x01",
50031
50041
  "[dreamer] failed to open OpenCode DB at \x01 (source=\x01): \x01\x020p",
50032
50042
  "[dreamer] storage fatal; skipping maintenance tick: \x01",
50043
+ "[magic-context] host stall profiler: not-text-user: \x01",
50033
50044
  "[magic-context] host stall profiler: unknown frame: \x01",
50034
50045
  "[magic-context] notification transport unavailable: \x01",
50035
50046
  "[magic-context] v2 status dialog failed; using text \x01",
@@ -50052,6 +50063,7 @@ var init_issue_log_templates_generated = __esm(() => {
50052
50063
  "[magic-context] embedding provider dispose failed: \x01",
50053
50064
  "[magic-context] failed to persist transform error: \x01",
50054
50065
  "[magic-context] historian host runner unavailable: \x01",
50066
+ "[magic-context] host stall profiler: prepared-row: \x01",
50055
50067
  "[magic-context] Synapse \x01 failed: \x01 retry_after_ms=\x01: \x01",
50056
50068
  "[magic-context] v2 dream event subscription failed \x01",
50057
50069
  "[magic-context] window report ledger write failed: \x01",
@@ -50200,6 +50212,7 @@ var init_issue_log_templates_generated = __esm(() => {
50200
50212
  "[git-commits] sweep lease renewal errored for \x01: \x01",
50201
50213
  "[magic-context] embedding model dispose failed: \x01",
50202
50214
  "[magic-context] embedding registration skipped: \x01",
50215
+ "[magic-context] host stall profiler: tool-pair: \x01",
50203
50216
  "[magic-context] storage fatal: failed to open \x01: \x01\x020p",
50204
50217
  "could not register the standalone plugin marker \x01",
50205
50218
  "DISCARDED CONTEXT RESULT: queued served capture \x01",
@@ -50257,9 +50270,9 @@ var init_issue_log_templates_generated = __esm(() => {
50257
50270
  "single-store embedding drain failed (ignored):",
50258
50271
  "system prompt meta persist failed (fail-open):",
50259
50272
  "system prompt sticky date record write failed:",
50260
- "[\x01] \x01; skipping primary for this run until reset",
50261
50273
  "[\x01] \x01: model not found, retrying with suggestion",
50262
50274
  "run \x01 left for the lease: this host is stopping",
50275
+ "skipping \x01 until \x01: provider said to retry later\x020m",
50263
50276
  "[dreamer] classify: stage=\x01 nothing to classify",
50264
50277
  "[\x01] primary (\x01/\x01) failed: \x01: \x01; trying \x01 fallback(s)\x021m,2m",
50265
50278
  "[historian] Dropped <facts> category \x01 (\x01 facts)",
@@ -50502,7 +50515,6 @@ var init_issue_log_templates_generated = __esm(() => {
50502
50515
  "promoted fact embedding dispatch failed:",
50503
50516
  "wrapup: compartment lease renewal failed",
50504
50517
  "report for \x01 accepted (publish=immediate)",
50505
- "[\x01] \x01; skipping \x01/\x01 for this run until reset\x022m,3m",
50506
50518
  "[mural] skipped for \x01: no active memories",
50507
50519
  "variant changed (\x01 -> \x01), triggering flush\x020s",
50508
50520
  "variant changed (\x01 -> \x01), triggering flush",
@@ -51157,6 +51169,7 @@ var init_issue_log_templates_generated = __esm(() => {
51157
51169
  "rust.\x01",
51158
51170
  "WARN \x01",
51159
51171
  "full",
51172
+ "type",
51160
51173
  "dir:\x01",
51161
51174
  "git:\x01",
51162
51175
  "gh"
@@ -51171,7 +51184,7 @@ var init_issue_log_templates_generated = __esm(() => {
51171
51184
  }
51172
51185
  return { parts, slots };
51173
51186
  });
51174
- ISSUE_LOG_IDENTIFIERS = "abort,aborted,above_cap,accepted,acquire,adopted,agent,agent-drops-applied,aligned,already-current,already-present,already_ran_this_turn,ambiguous,anchor-missing,anchors-disagree,appended,applied,archive,assistant,attachment,attempt_mismatch,audio,auth_failed,auto_search_hint,backoff,band-crossing,band-deescalation,baseline-reset,baseline-unavailable,baseline-unevaluable,batch,batch-timeout,behind,below-emergency-band,below-threshold,boot_recovery,boundary_repair,busy,bytes,cache_hit,cache_invalid,cached_m1_missing,cadence-growth,cadence-refire,candidate-preparation,candidate_conflict,candidate_loss,candidate_rows_changed,candidates,capture_failed,cas-exhausted,cas-exhaustion,catalog,category,ceiling-threshold-met,changes-request,channel-2-ceiling-nudge,checkpoint,chunk_empty_canonical_text,chunk_fts_mapping_incomplete,chunk_partial_vector_set,chunk_window_contract_mismatch,cleared_reasoning_through_tag,close,closed-book,commit_clusters,committed,compaction,compartment-removed,compartment_render_epoch,compiled-check,compressed,compressor,config-re-read,conflict,content,content-loss,context_boundary,cooldown_active,count,coverage_fold,ctx_search_hint,custom_tool_call,darwin,data,deadline,defer,deferred,deferred_materialization,deferred_publication,definitely-no-cut,degraded,destination-not-empty,diagnostics,directive-shaped-project-rule,directory,disabled,discarded_last,divergent,document,done,drained,dreamer,dreamer-task,drift,drop_seed,duplicate_submission_budget,embed,embedded,empty,empty-session,empty_output,end_block_index,endpoint_unsupported,entry,entry-removed,envelope_unreadable,epoch_change,error,error_content,error_text,evaluate-smart-notes,exact-ordinal-ids,exception,excluded,execute,exited,expired,explicit_flush,failed,fatal,fenced_path,file,file_contains,first_render,fit_retry,flush,fold,force,force_band,force_materialization,found,frozen_slot,fts-rowid-backfill,full,function_call,generation-invalidated,git_commit_after,git_identity_unavailable,git_tag_matching,has-state,heavy_reasoning,historian,historian-editor,historian_editor,hold,home_directory,host,host-checkpoint,host_compaction,host_cut_before_watermark,host_history_change,host_rerender,http_error,identity_paused,image,images,incremental,indexed,intact,invalid-pid,invalid_prompt,invalid_scheme,invocation,io,leaked-id,lease_active,legacy,length,live-geometry,lkg_anthropic_reasoning_run_invalid,lkg_content_mismatch,lkg_invalidated_reshape,lkg_miss,lkg_model_mismatch,lkg_output_mapping_unavailable,lkg_recovery_input_rebuild,lkg_recovery_unproven,lkg_restart_rebuild,lkg_seam_invalid,lkg_system_state_mismatch,lkg_unsafe_seam,m1_delta,magic-context-host-stall,maintain-docs,malformed,management_surface,manual-full-recomp,manual-wrapup-empty,max_mutation_id,memory,memory_hash_guard_rejected,merged-reasoning-strip-exception,merged-reasoning-strip-persistence-failure,message,messages,migrated,migration_guard,migration_required,mismatch,missing,missing-active-same-category-successor,missing_tool_messages,model_change,model_failed,model_or_limit_changed,mtime_after,mutation_drift,native,network_error,newer_schema,no-anchor,no-file,no-output,no-result,no_assistant,no_head,no_originating_cache_bust,no_recent_heavy_reasoning,non-finite-input,non_zero_exit,none,not-a-fork,not-accepted,not-ready,not_a_repo,not_certified,not_found,not_owned,not_tracked,note,note_nudge_anchor,object,ok,omp,opaque,open-tool-arc,openai-codex-responses,openai-responses,opencode,opencode2,orphan_tool_message,other,overflow,oversized,ownership_lost,pair_commit_failed,parent-missing,parse,parse-invalid,parse_failed,partial,partial-message-boundary,partial-recomp,parts,pass,pass-cap,patch,path_exists,pending_agent_drop,pending_materialization,pi,placeholder,polarity-missing-mechanism,populated,post-reduce-band-escalation,post-reduce-baseline-pending,post-reduce-compliance-grace,post-reduce-regrowth-reached,pressure_refold,prewarm,primary,probe_required,proceed,process,processed_image,profile_transition,prohibition-missing-marker,project,project_change,project_memory_epoch,projected_headroom,provider-overflow-abort,provider_error,provider_returned_no_vectors,publication-failed,query,range,ratio-below-ceiling,ratio-below-gentle,raw,read-outstanding,read_error,ready,reason,reasoning,reasoning-removal-persistence-failure,reasoning-removal-read-failure,recent-reduce-refresh,reclaimable-below-floor,recomp,reconnect,recovery-request-over-limit,recovery_prefix_released,recovery_tail_normalized,redacted_reasoning,redacted_thinking,refresh,refusal-grade-final-wire-over-limit,registration_retired_during_embed,release,reminder-strip,renew,repaired,replace,resolved,response,restore,result,retry,retryable-failure,rpc_error,run,scan,scheduler_defer,schema_fence,seam-temporal-strip,search-archive,search-failure,seeded,shifted,size-walk,skip,skipped,snapshot,source,source-revision,source_changed,source_removed,spawn-failed,spawn_failed,stacked,stale,stale-skip,stale_reduce,stale_snapshot,stalled,stalled_no_progress,start,start-failed,start_block_index,steer,step-finish,step-start,step_limit,sticky-turn-floor,stop,stopped,storage,storage-busy,storage_failure,store_not_found,store_schema_unknown,store_unreadable,string,strip,strip_seed,structural,subtask,summary,summary_message,superseded,synthetic-boundary-merged,synthetic-kept-entry,system_hash,system_injected,tag,tag-delta,tag-identity-rebuild-failed,tag-identity-recurring,tag-identity-repair-once,tag-identity-repair-pending,tag-summary,tag_identity_repair,tag_prefix,tail-below-minimum,tail_size,target-superseded,test-legacy,text,thinking,thinking_binding,thinking_hold,timeout,timeout-circuit-breaker,token-budget,token_budget,too-short,tool,tool_call,tool_definitions,tool_provider,tool_result,tool_use,transform,transient,truncated,trusted-final-wire-disarm,ttl_expiry,ttl_idle,turn,type,unanchored,unavailable,unbalanced-parens,uncaptured_replay,uncertain,unknown,unknown_write_rejection,unmatched_tool_call_id,unplaceable,unregistered,unresolved,update,upgrade,upgrade_state,url,user-memories,user-profile-is-not-project-memory,user_flush,user_memory_review,v1,v2,v2-archive-read,v2-archive-ready,v2-archive-result,validated,validation-failed,variant_change,verbose,verified,verify,video,view_error,waiting,waiting-for-entry,weak_lookahead_final_compartment,whole-session-smaller-than-tail,worker-busy,worker-error,worker-failed,wrapup,x64".split(",");
51187
+ ISSUE_LOG_IDENTIFIERS = "abort,aborted,above_cap,accepted,acquire,adopted,agent,agent-drops-applied,aligned,already-current,already-present,already_ran_this_turn,ambiguous,ambiguous-rewrite,anchor-missing,anchors-disagree,anthropic-continue,appended,applied,archive,assistant,attachment,attempt_mismatch,audio,auth_failed,auto_search_hint,backoff,band-crossing,band-deescalation,baseline-reset,baseline-unavailable,baseline-unevaluable,batch,batch-timeout,behind,below-emergency-band,below-threshold,boot_recovery,boundary,boundary_repair,busy,bytes,cache_hit,cache_invalid,cached_m1_missing,cadence-growth,cadence-refire,candidate-preparation,candidate_conflict,candidate_loss,candidate_rows_changed,candidates,capture_failed,cas-exhausted,cas-exhaustion,catalog,category,ceiling-threshold-met,changes-request,channel-2-ceiling-nudge,checkpoint,chunk_empty_canonical_text,chunk_fts_mapping_incomplete,chunk_partial_vector_set,chunk_window_contract_mismatch,cleared_reasoning_through_tag,close,closed-book,commit_clusters,committed,compaction,compartment-removed,compartment_render_epoch,compiled-check,compressed,compressor,config-re-read,conflict,content,content-loss,context_boundary,cooldown_active,count,coverage_fold,ctx_search_hint,custom_tool_call,darwin,data,date-cwd,deadline,defer,deferred,deferred_materialization,deferred_publication,definitely-no-cut,degraded,destination-not-empty,diagnostics,dimensions_mismatch,directive-shaped-project-rule,directory,disabled,discarded_last,divergent,document,done,drained,dreamer,dreamer-task,drift,drop_seed,duplicate_submission_budget,embed,embedded,empty,empty-session,empty_output,end_block_index,endpoint_unsupported,entry,entry-removed,envelope_unreadable,epoch_change,error,error_content,error_text,evaluate-smart-notes,exact-ordinal-ids,exception,excluded,execute,exited,expired,explicit_flush,failed,fallback,fatal,fenced_path,file,file_contains,first_render,fit_retry,flush,fold,force,force_band,force_materialization,found,frozen_slot,fts-rowid-backfill,full,function_call,generation-invalidated,git_commit_after,git_identity_unavailable,git_tag_matching,has-state,heavy_reasoning,historian,historian-editor,historian_editor,hold,home_directory,host,host-checkpoint,host_compaction,host_cut_before_watermark,host_history_change,host_rerender,http_error,identity_paused,image,images,incremental,indexed,injector,input_text,intact,invalid-pid,invalid_prompt,invalid_scheme,invocation,io,leaked-id,lease_active,legacy,length,limit,live-geometry,lkg_anthropic_reasoning_run_invalid,lkg_content_mismatch,lkg_invalidated_reshape,lkg_miss,lkg_model_mismatch,lkg_output_mapping_unavailable,lkg_recovery_input_rebuild,lkg_recovery_unproven,lkg_restart_rebuild,lkg_seam_invalid,lkg_system_state_mismatch,lkg_unsafe_seam,m1_delta,magic-context-host-stall,maintain-docs,malformed,management_surface,manual-full-recomp,manual-wrapup-empty,max_mutation_id,memory,memory_hash_guard_rejected,merged-reasoning-strip-exception,merged-reasoning-strip-persistence-failure,message,messages,migrated,migration_guard,migration_required,mismatch,missing,missing-active-same-category-successor,missing_tool_messages,model_change,model_failed,model_or_limit_changed,mtime_after,mutation_drift,native,network_error,newer_schema,no-anchor,no-file,no-output,no-result,no_assistant,no_head,no_originating_cache_bust,no_recent_heavy_reasoning,non-finite-input,non_zero_exit,none,not-a-fork,not-accepted,not-ready,not-text-user,not_a_repo,not_certified,not_found,not_owned,not_tracked,note,note_nudge_anchor,object,ok,omp,opaque,open-tool-arc,openai-codex-responses,openai-responses,opencode,opencode2,orphan_tool_message,other,output_text,overflow,oversized,ownership_lost,pair_commit_failed,parent-missing,parse,parse-invalid,parse_failed,partial,partial-message-boundary,partial-recomp,parts,pass,pass-cap,patch,path_exists,pending_agent_drop,pending_materialization,pi,placeholder,polarity-missing-mechanism,populated,post-reduce-band-escalation,post-reduce-baseline-pending,post-reduce-compliance-grace,post-reduce-regrowth-reached,prepared-row,pressure_refold,prewarm,primary,probe_required,proceed,process,processed_image,profile_transition,prohibition-missing-marker,project,project_change,project_memory_epoch,projected_headroom,provider-overflow-abort,provider_error,provider_returned_no_vectors,publication-failed,query,range,ratio-below-ceiling,ratio-below-gentle,raw,read-outstanding,read_error,ready,reason,reasoning,reasoning-removal-persistence-failure,reasoning-removal-read-failure,recent-reduce-refresh,reclaimable-below-floor,recomp,reconnect,recovery-request-over-limit,recovery_prefix_released,recovery_tail_normalized,redacted_reasoning,redacted_thinking,refresh,refusal-grade-final-wire-over-limit,registration_retired_during_embed,release,reminder-strip,renew,repaired,replace,resolved,response,restore,result,retry,retryable-failure,rpc_error,run,scan,scheduler_defer,schema_fence,seam-temporal-strip,search-archive,search-failure,search-limit,seeded,server_tool_use,session-content,shifted,size-walk,skip,skipped,snapshot,source,source-revision,source_changed,source_removed,spawn-failed,spawn_failed,stacked,stale,stale-skip,stale_reduce,stale_snapshot,stalled,stalled_no_progress,start,start-failed,start_block_index,steer,step-finish,step-start,step_limit,sticky-turn-floor,stop,stopped,storage,storage-busy,storage_failure,store_not_found,store_schema_unknown,store_unreadable,string,strip,strip_seed,structural,subtask,summary,summary_message,superpowers-bootstrap,superseded,synthetic-boundary-merged,synthetic-kept-entry,system,system_hash,system_injected,tag,tag-delta,tag-identity-rebuild-failed,tag-identity-recurring,tag-identity-repair-once,tag-identity-repair-pending,tag-summary,tag_identity_repair,tag_prefix,tail-below-minimum,tail_size,target-superseded,test-legacy,text,thinking,thinking_binding,thinking_hold,timeout,timeout-circuit-breaker,token-budget,token_budget,too-short,tool,tool-pair,tool-result,tool_call,tool_definitions,tool_provider,tool_result,tool_search_tool_result,tool_use,transform,transient,truncated,trusted-final-wire-disarm,ttl_expiry,ttl_idle,turn,type,unanchored,unavailable,unbalanced-parens,uncaptured_replay,uncertain,unknown,unknown_write_rejection,unmatched_tool_call_id,unplaceable,unreadable-branch,unregistered,unresolved,update,upgrade,upgrade_state,url,usage,user,user-memories,user-profile-is-not-project-memory,user_flush,user_memory_review,v1,v2,v2-archive-read,v2-archive-ready,v2-archive-result,validated,validation-failed,variant_change,verbose,verified,verify,video,view_error,waiting,waiting-for-entry,weak_lookahead_final_compartment,web_search_tool_result,whole-session-smaller-than-tail,worker-busy,worker-error,worker-failed,wrapup,x64".split(",");
51175
51188
  });
51176
51189
 
51177
51190
  // src/lib/log-lines.ts
@@ -52803,11 +52816,13 @@ async function probeEmbeddingEndpoint(options) {
52803
52816
  }
52804
52817
  const inputType = options.inputType?.trim();
52805
52818
  const truncateMode = options.truncate?.trim();
52819
+ const requestedDimensions = typeof options.dimensions === "number" && Number.isInteger(options.dimensions) && options.dimensions > 0 ? options.dimensions : undefined;
52806
52820
  const body = JSON.stringify({
52807
52821
  model: options.model,
52808
52822
  input: "magic-context probe",
52809
52823
  ...inputType ? { input_type: inputType } : {},
52810
- ...truncateMode ? { truncate: truncateMode } : {}
52824
+ ...truncateMode ? { truncate: truncateMode } : {},
52825
+ ...requestedDimensions ? { dimensions: requestedDimensions } : {}
52811
52826
  });
52812
52827
  let response;
52813
52828
  try {
@@ -52845,6 +52860,14 @@ async function probeEmbeddingEndpoint(options) {
52845
52860
  preview: await readPreview(parsed)
52846
52861
  };
52847
52862
  }
52863
+ if (requestedDimensions !== undefined && dimensions !== requestedDimensions) {
52864
+ return {
52865
+ kind: "dimensions_mismatch",
52866
+ status,
52867
+ requested: requestedDimensions,
52868
+ returned: dimensions
52869
+ };
52870
+ }
52848
52871
  return { kind: "ok", status, dimensions };
52849
52872
  }
52850
52873
  const preview = await previewErrorBody(response);
@@ -56245,6 +56268,7 @@ async function checkEmbeddingConfig(magicContextConfigPath, installRoots) {
56245
56268
  const apiKey = typeof embedding?.api_key === "string" ? embedding.api_key : undefined;
56246
56269
  const inputType = typeof embedding?.input_type === "string" ? embedding.input_type.trim() : undefined;
56247
56270
  const truncateMode = typeof embedding?.truncate === "string" ? embedding.truncate.trim() : undefined;
56271
+ const dimensions = typeof embedding?.dimensions === "number" ? embedding.dimensions : undefined;
56248
56272
  let localIssues = 0;
56249
56273
  if (!endpoint) {
56250
56274
  log3.error("Embedding provider is openai-compatible but 'endpoint' is missing");
@@ -56278,6 +56302,7 @@ async function checkEmbeddingConfig(magicContextConfigPath, installRoots) {
56278
56302
  apiKey,
56279
56303
  ...inputType ? { inputType } : {},
56280
56304
  ...truncateMode ? { truncate: truncateMode } : {},
56305
+ ...dimensions !== undefined ? { dimensions } : {},
56281
56306
  timeoutMs: 1e4
56282
56307
  });
56283
56308
  } catch (error) {
@@ -56290,6 +56315,10 @@ async function checkEmbeddingConfig(magicContextConfigPath, installRoots) {
56290
56315
  case "ok":
56291
56316
  log3.success(`Embedding endpoint OK (${outcome.status}, ${outcome.dimensions ?? "?"}-dim vectors)`);
56292
56317
  return { issues: localIssues };
56318
+ case "dimensions_mismatch":
56319
+ log3.error(`Embedding endpoint ignored dimensions=${outcome.requested} and returned ${outcome.returned}-dim vectors (${outcome.status})`);
56320
+ log3.info(" The endpoint or model does not support the dimensions parameter. Remove embedding.dimensions, or use a Matryoshka-capable model/endpoint. Mismatched vectors are rejected at runtime.");
56321
+ return { issues: localIssues + 1 };
56293
56322
  case "auth_failed":
56294
56323
  log3.error(`Embedding endpoint rejected credentials (${outcome.status}) — check api_key / env var`);
56295
56324
  if (outcome.preview)
@@ -58058,6 +58087,11 @@ function classifyEmbeddingOutcome(outcome) {
58058
58087
  status: "pass",
58059
58088
  message: `Embedding endpoint OK (${outcome.status}, ${outcome.dimensions ?? "?"}-dim vectors)`
58060
58089
  };
58090
+ case "dimensions_mismatch":
58091
+ return {
58092
+ status: "fail",
58093
+ message: `Embedding endpoint ignored dimensions=${outcome.requested} and returned ${outcome.returned}-dim vectors (${outcome.status}); remove embedding.dimensions or use a Matryoshka-capable model`
58094
+ };
58061
58095
  case "auth_failed":
58062
58096
  return {
58063
58097
  status: "fail",
@@ -58412,6 +58446,7 @@ ${formatDatabaseRepairGuidance(dbPath)}`);
58412
58446
  const apiKey = typeof mergedEmbedding.api_key === "string" ? mergedEmbedding.api_key : undefined;
58413
58447
  const inputType = typeof mergedEmbedding.input_type === "string" ? mergedEmbedding.input_type.trim() : undefined;
58414
58448
  const truncateMode = typeof mergedEmbedding.truncate === "string" ? mergedEmbedding.truncate.trim() : undefined;
58449
+ const dimensions = typeof mergedEmbedding.dimensions === "number" ? mergedEmbedding.dimensions : undefined;
58415
58450
  if (!endpoint || !model) {
58416
58451
  add2(results, "fail", "Embedding provider is openai-compatible but endpoint/model is missing");
58417
58452
  } else {
@@ -58422,6 +58457,7 @@ ${formatDatabaseRepairGuidance(dbPath)}`);
58422
58457
  apiKey,
58423
58458
  ...inputType ? { inputType } : {},
58424
58459
  ...truncateMode ? { truncate: truncateMode } : {},
58460
+ ...dimensions !== undefined ? { dimensions } : {},
58425
58461
  timeoutMs: 1e4
58426
58462
  });
58427
58463
  const classified = classifyEmbeddingOutcome(outcome);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/magic-context",
3
- "version": "0.49.49",
3
+ "version": "0.49.51",
4
4
  "description": "Unified CLI for Magic Context — setup, doctor, and migration across OpenCode, Pi, and OMP",
5
5
  "keywords": [
6
6
  "opencode",