memorix 1.9.12 → 1.10.0

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 (46) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/cli/index.js +549 -101
  3. package/dist/index.d.ts +46 -0
  4. package/dist/index.js +271 -27
  5. package/dist/maintenance-runner.js +143 -3
  6. package/dist/media-audio-runner.js +143 -3
  7. package/dist/media-video-runner.js +143 -3
  8. package/dist/memcode/index.js +124 -8
  9. package/dist/memcode-runtime/CHANGELOG.md +20 -1
  10. package/dist/sdk.js +270 -26
  11. package/dist/vector-backfill-runner.js +143 -3
  12. package/docs/1.2.0-EVALUATION-HARNESS.md +88 -0
  13. package/docs/1.3-MEMORY-ARCHITECTURE.md +31 -0
  14. package/docs/API_REFERENCE.md +19 -0
  15. package/docs/DEVELOPMENT.md +16 -3
  16. package/docs/INTEGRATIONS.md +25 -0
  17. package/docs/PERFORMANCE.md +21 -6
  18. package/docs/README.md +4 -4
  19. package/docs/ROADMAP-1.9.12-2.0.md +92 -7
  20. package/package.json +3 -1
  21. package/plugins/antigravity/memorix/plugin.json +1 -1
  22. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  23. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  24. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  25. package/plugins/copilot/memorix/plugin.json +1 -1
  26. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  27. package/plugins/hermes/memorix/plugin.yaml +1 -1
  28. package/plugins/omp/memorix/package.json +1 -1
  29. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  30. package/plugins/pi/memorix/package.json +1 -1
  31. package/server.json +2 -2
  32. package/src/cli/commands/agent-integrations.ts +164 -7
  33. package/src/cli/commands/memory.ts +1 -1
  34. package/src/cli/commands/serve-http.ts +30 -1
  35. package/src/cli/commands/setup.ts +5 -21
  36. package/src/codegraph/auto-context.ts +5 -0
  37. package/src/codegraph/context-pack.ts +4 -0
  38. package/src/compact/engine.ts +43 -2
  39. package/src/evaluation/context-task-matrix.ts +247 -0
  40. package/src/evaluation/context-task-runner.ts +175 -0
  41. package/src/integrations/registry.ts +191 -4
  42. package/src/knowledge/context-assembly.ts +33 -2
  43. package/src/knowledge/workset.ts +35 -3
  44. package/src/server/request-context.ts +96 -0
  45. package/src/server.ts +16 -4
  46. package/src/store/orama-store.ts +54 -0
@@ -7151,6 +7151,7 @@ __export(orama_store_exports, {
7151
7151
  getActiveSemanticIndexProfile: () => getActiveSemanticIndexProfile,
7152
7152
  getDb: () => getDb,
7153
7153
  getDeferredCachedVectorHydration: () => getDeferredCachedVectorHydration,
7154
+ getLastSearchDiagnostics: () => getLastSearchDiagnostics,
7154
7155
  getLastSearchMode: () => getLastSearchMode,
7155
7156
  getObservationCount: () => getObservationCount,
7156
7157
  getObservationsByIds: () => getObservationsByIds,
@@ -7180,6 +7181,18 @@ function rememberSearchMode(key, value) {
7180
7181
  function getLastSearchMode(projectId) {
7181
7182
  return lastSearchModeByProject.get(projectId ?? SEARCH_MODE_DEFAULT_KEY) ?? "fulltext";
7182
7183
  }
7184
+ function getLastSearchDiagnostics(projectId) {
7185
+ const diagnostics = lastSearchDiagnosticsByProject.get(projectId ?? SEARCH_MODE_DEFAULT_KEY);
7186
+ return diagnostics ? { ...diagnostics } : void 0;
7187
+ }
7188
+ function rememberSearchDiagnostics(key, value) {
7189
+ if (!lastSearchDiagnosticsByProject.has(key) && lastSearchDiagnosticsByProject.size >= MAX_SEARCH_MODE_KEYS) {
7190
+ const oldest = lastSearchDiagnosticsByProject.keys().next().value;
7191
+ if (oldest !== void 0) lastSearchDiagnosticsByProject.delete(oldest);
7192
+ }
7193
+ lastSearchDiagnosticsByProject.delete(key);
7194
+ lastSearchDiagnosticsByProject.set(key, value);
7195
+ }
7183
7196
  function getOptionalObservationStore() {
7184
7197
  try {
7185
7198
  return getObservationStore();
@@ -7462,6 +7475,7 @@ async function resetDb() {
7462
7475
  indexEmbeddingProvider = null;
7463
7476
  deferredCachedVectorHydration = null;
7464
7477
  lastSearchModeByProject.clear();
7478
+ lastSearchDiagnosticsByProject.clear();
7465
7479
  }
7466
7480
  function isEmbeddingEnabled() {
7467
7481
  return embeddingEnabled;
@@ -7679,6 +7693,7 @@ async function removeObservation(oramaId) {
7679
7693
  await remove2(database, oramaId);
7680
7694
  }
7681
7695
  async function searchObservations(options) {
7696
+ const searchStartedAt = Date.now();
7682
7697
  const perf = !!process.env.MEMORIX_PERF;
7683
7698
  const t0 = perf ? performance.now() : 0;
7684
7699
  const mark = (label) => {
@@ -7754,6 +7769,8 @@ async function searchObservations(options) {
7754
7769
  let queryVector = null;
7755
7770
  let embeddingProviderForSearch = null;
7756
7771
  let embeddingUnavailable = false;
7772
+ let fallbackUsed = false;
7773
+ let fallbackReason;
7757
7774
  if (quality !== "fast" && embeddingEnabled && hasQuery && tier !== "fast") {
7758
7775
  try {
7759
7776
  const provider2 = await getEmbeddingProvider();
@@ -7762,6 +7779,8 @@ async function searchObservations(options) {
7762
7779
  const activeVectorDimensions = getVectorDimensions();
7763
7780
  if (activeVectorDimensions !== null && provider2.dimensions !== activeVectorDimensions) {
7764
7781
  embeddingUnavailable = true;
7782
+ fallbackUsed = true;
7783
+ fallbackReason = "embedding dimension mismatch; lexical search used";
7765
7784
  rememberSearchMode(
7766
7785
  modeKey,
7767
7786
  `fulltext (embedding dimension mismatch: provider ${provider2.dimensions}d vs index ${activeVectorDimensions}d)`
@@ -7803,9 +7822,13 @@ async function searchObservations(options) {
7803
7822
  }
7804
7823
  } else {
7805
7824
  embeddingUnavailable = true;
7825
+ fallbackUsed = true;
7826
+ fallbackReason = "embedding provider unavailable; lexical search used";
7806
7827
  }
7807
7828
  } catch (error) {
7808
7829
  embeddingUnavailable = true;
7830
+ fallbackUsed = true;
7831
+ fallbackReason = "embedding failed or timed out; lexical search used";
7809
7832
  rememberSearchMode(modeKey, "fulltext (embedding unavailable)");
7810
7833
  console.error("[memorix] Embedding failed or timed out, falling back to fulltext search");
7811
7834
  }
@@ -7855,6 +7878,8 @@ async function searchObservations(options) {
7855
7878
  similarity: 0.25
7856
7879
  };
7857
7880
  rememberSearchMode(modeKey, "vector-only (hybrid empty fallback)");
7881
+ fallbackUsed = true;
7882
+ fallbackReason = "hybrid search returned no results; vector-only fallback used";
7858
7883
  results = await search(database, vectorOnlyParams);
7859
7884
  } catch {
7860
7885
  }
@@ -8128,6 +8153,7 @@ async function searchObservations(options) {
8128
8153
  mark(`rerank(skipped,tier=${tier})`);
8129
8154
  }
8130
8155
  let entries = intermediate.map(({ rawTime: _, _isCommandLog: _c, ...rest }) => rest);
8156
+ const candidateCount = entries.length;
8131
8157
  for (const hit of results.hits) {
8132
8158
  const doc = hit.document;
8133
8159
  if (canReadObservation(doc, options.reader, projectIds ?? void 0)) rememberObservationDoc(doc);
@@ -8170,9 +8196,22 @@ async function searchObservations(options) {
8170
8196
  }
8171
8197
  }
8172
8198
  }
8199
+ const beforeTokenBudget = entries.length;
8173
8200
  if (options.maxTokens && options.maxTokens > 0) {
8174
8201
  entries = applyTokenBudget(entries, options.maxTokens);
8175
8202
  }
8203
+ rememberSearchDiagnostics(modeKey, {
8204
+ version: "1",
8205
+ mode: getLastSearchMode(options.projectId),
8206
+ rawCandidateCount: results.hits.length,
8207
+ candidateCount,
8208
+ selectedCount: entries.length,
8209
+ omittedCount: Math.max(0, candidateCount - entries.length),
8210
+ omittedByTokenBudget: Math.max(0, beforeTokenBudget - entries.length),
8211
+ fallbackUsed,
8212
+ ...fallbackReason ? { fallbackReason } : {},
8213
+ elapsedMs: Math.max(0, Date.now() - searchStartedAt)
8214
+ });
8176
8215
  if (options.trackAccess !== false) {
8177
8216
  const returnedKeys = new Set(entries.map((entry) => makeEntryKey(entry.projectId, entry.id)));
8178
8217
  const hitDocs = results.hits.map((hit) => ({ id: hit.id, doc: hit.document })).filter(({ doc }) => returnedKeys.has(makeEntryKey(doc.projectId, doc.observationId)));
@@ -8288,7 +8327,7 @@ function formatTime(isoDate) {
8288
8327
  return isoDate;
8289
8328
  }
8290
8329
  }
8291
- var db, dbInitPromise, dbGeneration, embeddingEnabled, embeddingDimensions, indexEmbeddingProvider, deferredCachedVectorHydration, NON_CJK_HYBRID_SIMILARITY, CJK_RUN, lastSearchModeByProject, SEARCH_MODE_DEFAULT_KEY, MAX_SEARCH_MODE_KEYS, COMMAND_LOG_TITLE, COMMAND_STYLE_TITLE, COMMAND_LIKE_QUERY2, COMMAND_INTENT_QUERY, NATURAL_LANGUAGE_MARKERS;
8330
+ var db, dbInitPromise, dbGeneration, embeddingEnabled, embeddingDimensions, indexEmbeddingProvider, deferredCachedVectorHydration, NON_CJK_HYBRID_SIMILARITY, CJK_RUN, lastSearchModeByProject, lastSearchDiagnosticsByProject, SEARCH_MODE_DEFAULT_KEY, MAX_SEARCH_MODE_KEYS, COMMAND_LOG_TITLE, COMMAND_STYLE_TITLE, COMMAND_LIKE_QUERY2, COMMAND_INTENT_QUERY, NATURAL_LANGUAGE_MARKERS;
8292
8331
  var init_orama_store = __esm({
8293
8332
  "src/store/orama-store.ts"() {
8294
8333
  "use strict";
@@ -8314,6 +8353,7 @@ var init_orama_store = __esm({
8314
8353
  NON_CJK_HYBRID_SIMILARITY = 0.45;
8315
8354
  CJK_RUN = /[\u3400-\u4dbf\u4e00-\u9fff\u3040-\u30ff\uac00-\ud7af]+/gu;
8316
8355
  lastSearchModeByProject = /* @__PURE__ */ new Map();
8356
+ lastSearchDiagnosticsByProject = /* @__PURE__ */ new Map();
8317
8357
  SEARCH_MODE_DEFAULT_KEY = "__global__";
8318
8358
  MAX_SEARCH_MODE_KEYS = 4096;
8319
8359
  COMMAND_LOG_TITLE = /^(Ran:|Command:|Executed:)\s/i;
@@ -33661,6 +33701,25 @@ var init_models_generated = __esm({
33661
33701
  }
33662
33702
  },
33663
33703
  "minimax": {
33704
+ "MiniMax-M3.1-Flash": {
33705
+ id: "MiniMax-M3.1-Flash",
33706
+ name: "MiniMax-M3.1-Flash",
33707
+ api: "anthropic-messages",
33708
+ provider: "minimax",
33709
+ baseUrl: "https://api.minimax.io/anthropic",
33710
+ compat: { "forceAdaptiveThinking": true },
33711
+ reasoning: true,
33712
+ thinkingLevelMap: { "off": null, "minimal": null, "low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh" },
33713
+ input: ["text", "image", "video"],
33714
+ cost: {
33715
+ input: 0.15,
33716
+ output: 0.6,
33717
+ cacheRead: 0.015,
33718
+ cacheWrite: 0
33719
+ },
33720
+ contextWindow: 1e6,
33721
+ maxTokens: 524288
33722
+ },
33664
33723
  "MiniMax-M2.7": {
33665
33724
  id: "MiniMax-M2.7",
33666
33725
  name: "MiniMax-M2.7",
@@ -33701,6 +33760,7 @@ var init_models_generated = __esm({
33701
33760
  api: "anthropic-messages",
33702
33761
  provider: "minimax",
33703
33762
  baseUrl: "https://api.minimax.io/anthropic",
33763
+ compat: { "forceAdaptiveThinking": true },
33704
33764
  reasoning: true,
33705
33765
  input: ["text", "image", "video"],
33706
33766
  cost: {
@@ -33710,10 +33770,29 @@ var init_models_generated = __esm({
33710
33770
  cacheWrite: 0
33711
33771
  },
33712
33772
  contextWindow: 1e6,
33713
- maxTokens: 128e3
33773
+ maxTokens: 524288
33714
33774
  }
33715
33775
  },
33716
33776
  "minimax-cn": {
33777
+ "MiniMax-M3.1-Flash": {
33778
+ id: "MiniMax-M3.1-Flash",
33779
+ name: "MiniMax-M3.1-Flash",
33780
+ api: "anthropic-messages",
33781
+ provider: "minimax-cn",
33782
+ baseUrl: "https://api.minimaxi.com/anthropic",
33783
+ compat: { "forceAdaptiveThinking": true },
33784
+ reasoning: true,
33785
+ thinkingLevelMap: { "off": null, "minimal": null, "low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh" },
33786
+ input: ["text", "image", "video"],
33787
+ cost: {
33788
+ input: 0.15,
33789
+ output: 0.6,
33790
+ cacheRead: 0.015,
33791
+ cacheWrite: 0
33792
+ },
33793
+ contextWindow: 1e6,
33794
+ maxTokens: 524288
33795
+ },
33717
33796
  "MiniMax-M2.7": {
33718
33797
  id: "MiniMax-M2.7",
33719
33798
  name: "MiniMax-M2.7",
@@ -33754,6 +33833,7 @@ var init_models_generated = __esm({
33754
33833
  api: "anthropic-messages",
33755
33834
  provider: "minimax-cn",
33756
33835
  baseUrl: "https://api.minimaxi.com/anthropic",
33836
+ compat: { "forceAdaptiveThinking": true },
33757
33837
  reasoning: true,
33758
33838
  input: ["text", "image", "video"],
33759
33839
  cost: {
@@ -33763,7 +33843,7 @@ var init_models_generated = __esm({
33763
33843
  cacheWrite: 0
33764
33844
  },
33765
33845
  contextWindow: 1e6,
33766
- maxTokens: 128e3
33846
+ maxTokens: 524288
33767
33847
  }
33768
33848
  },
33769
33849
  "mistral": {
@@ -36884,6 +36964,24 @@ var init_models_generated = __esm({
36884
36964
  }
36885
36965
  },
36886
36966
  "openrouter": {
36967
+ "minimax/minimax-m3.1-flash:free": {
36968
+ id: "minimax/minimax-m3.1-flash:free",
36969
+ name: "MiniMax: MiniMax M3.1 Flash (free)",
36970
+ api: "openai-completions",
36971
+ provider: "openrouter",
36972
+ baseUrl: "https://openrouter.ai/api/v1",
36973
+ reasoning: true,
36974
+ thinkingLevelMap: { "off": null, "minimal": null, "low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh" },
36975
+ input: ["text", "image"],
36976
+ cost: {
36977
+ input: 0,
36978
+ output: 0,
36979
+ cacheRead: 0,
36980
+ cacheWrite: 0
36981
+ },
36982
+ contextWindow: 1e6,
36983
+ maxTokens: 524288
36984
+ },
36887
36985
  "ai21/jamba-large-1.7": {
36888
36986
  id: "ai21/jamba-large-1.7",
36889
36987
  name: "AI21: Jamba Large 1.7",
@@ -45585,6 +45683,14 @@ var init_models_generated = __esm({
45585
45683
  }
45586
45684
  });
45587
45685
 
45686
+ // packages/ai/dist/minimax-models.js
45687
+ var init_minimax_models = __esm({
45688
+ "packages/ai/dist/minimax-models.js"() {
45689
+ "use strict";
45690
+ init_esm_shims();
45691
+ }
45692
+ });
45693
+
45588
45694
  // packages/ai/dist/models.js
45589
45695
  function calculateCost(model, usage) {
45590
45696
  usage.cost.input = model.cost.input / 1e6 * usage.input;
@@ -45631,6 +45737,8 @@ var init_models2 = __esm({
45631
45737
  "use strict";
45632
45738
  init_esm_shims();
45633
45739
  init_models_generated();
45740
+ init_minimax_models();
45741
+ init_minimax_models();
45634
45742
  modelRegistry = /* @__PURE__ */ new Map();
45635
45743
  for (const [provider2, models] of Object.entries(MODELS)) {
45636
45744
  const providerModels = /* @__PURE__ */ new Map();
@@ -53584,6 +53692,25 @@ function buildParams2(model, context, isOAuthToken2, options) {
53584
53692
  params.tool_choice = options.toolChoice;
53585
53693
  }
53586
53694
  }
53695
+ return normalizeMiniMaxParams(model, params, options);
53696
+ }
53697
+ function normalizeMiniMaxParams(model, params, options) {
53698
+ if (model.provider !== "minimax" && model.provider !== "minimax-cn")
53699
+ return params;
53700
+ if (params.model === "MiniMax-M3.1-Flash") {
53701
+ const effort = params.output_config?.effort ?? options?.effort ?? "max";
53702
+ const normalized = { ...params, thinking: { type: "adaptive" } };
53703
+ normalized.output_config = {
53704
+ ...params.output_config,
53705
+ effort: ["low", "medium", "high", "xhigh", "max"].includes(effort) ? effort : "max"
53706
+ };
53707
+ delete normalized.service_tier;
53708
+ delete normalized.reasoning_split;
53709
+ return normalized;
53710
+ }
53711
+ if (params.model === "MiniMax-M3" && params.thinking) {
53712
+ return { ...params, thinking: { type: params.thinking.type === "disabled" ? "disabled" : "adaptive" } };
53713
+ }
53587
53714
  return params;
53588
53715
  }
53589
53716
  function normalizeToolCallId(id) {
@@ -53890,6 +54017,7 @@ var init_anthropic = __esm({
53890
54017
  if (nextParams !== void 0) {
53891
54018
  params = nextParams;
53892
54019
  }
54020
+ params = normalizeMiniMaxParams(model, params, options);
53893
54021
  const requestOptions = {
53894
54022
  ...options?.signal ? { signal: options.signal } : {},
53895
54023
  ...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
@@ -136660,6 +136788,18 @@ var init_openai_completions = __esm({
136660
136788
  if (nextParams !== void 0) {
136661
136789
  params = nextParams;
136662
136790
  }
136791
+ if (model.provider === "openrouter" && new URL(model.baseUrl).hostname === "openrouter.ai" && params.model === "minimax/minimax-m3.1-flash:free") {
136792
+ const flash = params;
136793
+ const effort = flash.reasoning?.effort ?? "max";
136794
+ flash.reasoning = {
136795
+ ...flash.reasoning,
136796
+ enabled: true,
136797
+ effort: ["low", "medium", "high", "xhigh", "max"].includes(effort) ? effort : "max"
136798
+ };
136799
+ delete flash.reasoning_effort;
136800
+ delete flash.reasoning_split;
136801
+ delete flash.service_tier;
136802
+ }
136663
136803
  const requestOptions = {
136664
136804
  ...options?.signal ? { signal: options.signal } : {},
136665
136805
  ...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
@@ -76066,6 +76066,25 @@ var init_models_generated = __esm({
76066
76066
  }
76067
76067
  },
76068
76068
  "minimax": {
76069
+ "MiniMax-M3.1-Flash": {
76070
+ id: "MiniMax-M3.1-Flash",
76071
+ name: "MiniMax-M3.1-Flash",
76072
+ api: "anthropic-messages",
76073
+ provider: "minimax",
76074
+ baseUrl: "https://api.minimax.io/anthropic",
76075
+ compat: { "forceAdaptiveThinking": true },
76076
+ reasoning: true,
76077
+ thinkingLevelMap: { "off": null, "minimal": null, "low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh" },
76078
+ input: ["text", "image", "video"],
76079
+ cost: {
76080
+ input: 0.15,
76081
+ output: 0.6,
76082
+ cacheRead: 0.015,
76083
+ cacheWrite: 0
76084
+ },
76085
+ contextWindow: 1e6,
76086
+ maxTokens: 524288
76087
+ },
76069
76088
  "MiniMax-M2.7": {
76070
76089
  id: "MiniMax-M2.7",
76071
76090
  name: "MiniMax-M2.7",
@@ -76106,6 +76125,7 @@ var init_models_generated = __esm({
76106
76125
  api: "anthropic-messages",
76107
76126
  provider: "minimax",
76108
76127
  baseUrl: "https://api.minimax.io/anthropic",
76128
+ compat: { "forceAdaptiveThinking": true },
76109
76129
  reasoning: true,
76110
76130
  input: ["text", "image", "video"],
76111
76131
  cost: {
@@ -76115,10 +76135,29 @@ var init_models_generated = __esm({
76115
76135
  cacheWrite: 0
76116
76136
  },
76117
76137
  contextWindow: 1e6,
76118
- maxTokens: 128e3
76138
+ maxTokens: 524288
76119
76139
  }
76120
76140
  },
76121
76141
  "minimax-cn": {
76142
+ "MiniMax-M3.1-Flash": {
76143
+ id: "MiniMax-M3.1-Flash",
76144
+ name: "MiniMax-M3.1-Flash",
76145
+ api: "anthropic-messages",
76146
+ provider: "minimax-cn",
76147
+ baseUrl: "https://api.minimaxi.com/anthropic",
76148
+ compat: { "forceAdaptiveThinking": true },
76149
+ reasoning: true,
76150
+ thinkingLevelMap: { "off": null, "minimal": null, "low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh" },
76151
+ input: ["text", "image", "video"],
76152
+ cost: {
76153
+ input: 0.15,
76154
+ output: 0.6,
76155
+ cacheRead: 0.015,
76156
+ cacheWrite: 0
76157
+ },
76158
+ contextWindow: 1e6,
76159
+ maxTokens: 524288
76160
+ },
76122
76161
  "MiniMax-M2.7": {
76123
76162
  id: "MiniMax-M2.7",
76124
76163
  name: "MiniMax-M2.7",
@@ -76159,6 +76198,7 @@ var init_models_generated = __esm({
76159
76198
  api: "anthropic-messages",
76160
76199
  provider: "minimax-cn",
76161
76200
  baseUrl: "https://api.minimaxi.com/anthropic",
76201
+ compat: { "forceAdaptiveThinking": true },
76162
76202
  reasoning: true,
76163
76203
  input: ["text", "image", "video"],
76164
76204
  cost: {
@@ -76168,7 +76208,7 @@ var init_models_generated = __esm({
76168
76208
  cacheWrite: 0
76169
76209
  },
76170
76210
  contextWindow: 1e6,
76171
- maxTokens: 128e3
76211
+ maxTokens: 524288
76172
76212
  }
76173
76213
  },
76174
76214
  "mistral": {
@@ -79289,6 +79329,24 @@ var init_models_generated = __esm({
79289
79329
  }
79290
79330
  },
79291
79331
  "openrouter": {
79332
+ "minimax/minimax-m3.1-flash:free": {
79333
+ id: "minimax/minimax-m3.1-flash:free",
79334
+ name: "MiniMax: MiniMax M3.1 Flash (free)",
79335
+ api: "openai-completions",
79336
+ provider: "openrouter",
79337
+ baseUrl: "https://openrouter.ai/api/v1",
79338
+ reasoning: true,
79339
+ thinkingLevelMap: { "off": null, "minimal": null, "low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh" },
79340
+ input: ["text", "image"],
79341
+ cost: {
79342
+ input: 0,
79343
+ output: 0,
79344
+ cacheRead: 0,
79345
+ cacheWrite: 0
79346
+ },
79347
+ contextWindow: 1e6,
79348
+ maxTokens: 524288
79349
+ },
79292
79350
  "ai21/jamba-large-1.7": {
79293
79351
  id: "ai21/jamba-large-1.7",
79294
79352
  name: "AI21: Jamba Large 1.7",
@@ -87990,6 +88048,25 @@ var init_models_generated = __esm({
87990
88048
  }
87991
88049
  });
87992
88050
 
88051
+ // packages/ai/dist/minimax-models.js
88052
+ function isLegacyMiniMaxTextModel(model) {
88053
+ let host;
88054
+ try {
88055
+ host = new URL(model.baseUrl).hostname;
88056
+ } catch {
88057
+ return false;
88058
+ }
88059
+ const direct = (model.provider === "minimax" || model.provider === "minimax-cn") && (host === "api.minimax.io" || host === "api.minimaxi.com");
88060
+ const gateway = model.provider === "openrouter" && host === "openrouter.ai" || (model.provider === "opencode" || model.provider === "opencode-go") && host === "opencode.ai";
88061
+ return (direct || gateway) && /^(?:minimax\/)?(?:minimax-(?:01|m[12](?:[.\-][^/:]*)?)|m2-her)(?::[^/]*)?$/i.test(model.id);
88062
+ }
88063
+ var init_minimax_models = __esm({
88064
+ "packages/ai/dist/minimax-models.js"() {
88065
+ "use strict";
88066
+ init_esm_shims();
88067
+ }
88068
+ });
88069
+
87993
88070
  // packages/ai/dist/models.js
87994
88071
  function getModel(provider, modelId) {
87995
88072
  const providerModels = modelRegistry.get(provider);
@@ -87998,9 +88075,13 @@ function getModel(provider, modelId) {
87998
88075
  function getProviders() {
87999
88076
  return Array.from(modelRegistry.keys());
88000
88077
  }
88001
- function getModels(provider) {
88078
+ function getModels(provider, options2 = {}) {
88002
88079
  const models = modelRegistry.get(provider);
88003
- return models ? Array.from(models.values()) : [];
88080
+ const available = (models ? Array.from(models.values()) : []).filter((model) => options2.includeLegacy || !isLegacyMiniMaxTextModel(model));
88081
+ if (provider === "minimax" || provider === "minimax-cn") {
88082
+ available.sort((a, b) => Number(b.id === "MiniMax-M3.1-Flash") - Number(a.id === "MiniMax-M3.1-Flash"));
88083
+ }
88084
+ return available;
88004
88085
  }
88005
88086
  function calculateCost(model, usage) {
88006
88087
  usage.cost.input = model.cost.input / 1e6 * usage.input;
@@ -88052,6 +88133,8 @@ var init_models2 = __esm({
88052
88133
  "use strict";
88053
88134
  init_esm_shims();
88054
88135
  init_models_generated();
88136
+ init_minimax_models();
88137
+ init_minimax_models();
88055
88138
  modelRegistry = /* @__PURE__ */ new Map();
88056
88139
  for (const [provider, models] of Object.entries(MODELS)) {
88057
88140
  const providerModels = /* @__PURE__ */ new Map();
@@ -95998,6 +96081,25 @@ function buildParams2(model, context, isOAuthToken2, options2) {
95998
96081
  params.tool_choice = options2.toolChoice;
95999
96082
  }
96000
96083
  }
96084
+ return normalizeMiniMaxParams(model, params, options2);
96085
+ }
96086
+ function normalizeMiniMaxParams(model, params, options2) {
96087
+ if (model.provider !== "minimax" && model.provider !== "minimax-cn")
96088
+ return params;
96089
+ if (params.model === "MiniMax-M3.1-Flash") {
96090
+ const effort = params.output_config?.effort ?? options2?.effort ?? "max";
96091
+ const normalized = { ...params, thinking: { type: "adaptive" } };
96092
+ normalized.output_config = {
96093
+ ...params.output_config,
96094
+ effort: ["low", "medium", "high", "xhigh", "max"].includes(effort) ? effort : "max"
96095
+ };
96096
+ delete normalized.service_tier;
96097
+ delete normalized.reasoning_split;
96098
+ return normalized;
96099
+ }
96100
+ if (params.model === "MiniMax-M3" && params.thinking) {
96101
+ return { ...params, thinking: { type: params.thinking.type === "disabled" ? "disabled" : "adaptive" } };
96102
+ }
96001
96103
  return params;
96002
96104
  }
96003
96105
  function normalizeToolCallId(id) {
@@ -96304,6 +96406,7 @@ var init_anthropic = __esm({
96304
96406
  if (nextParams !== void 0) {
96305
96407
  params = nextParams;
96306
96408
  }
96409
+ params = normalizeMiniMaxParams(model, params, options2);
96307
96410
  const requestOptions = {
96308
96411
  ...options2?.signal ? { signal: options2.signal } : {},
96309
96412
  ...options2?.timeoutMs !== void 0 ? { timeout: options2.timeoutMs } : {},
@@ -179087,6 +179190,18 @@ var init_openai_completions = __esm({
179087
179190
  if (nextParams !== void 0) {
179088
179191
  params = nextParams;
179089
179192
  }
179193
+ if (model.provider === "openrouter" && new URL(model.baseUrl).hostname === "openrouter.ai" && params.model === "minimax/minimax-m3.1-flash:free") {
179194
+ const flash = params;
179195
+ const effort = flash.reasoning?.effort ?? "max";
179196
+ flash.reasoning = {
179197
+ ...flash.reasoning,
179198
+ enabled: true,
179199
+ effort: ["low", "medium", "high", "xhigh", "max"].includes(effort) ? effort : "max"
179200
+ };
179201
+ delete flash.reasoning_effort;
179202
+ delete flash.reasoning_split;
179203
+ delete flash.service_tier;
179204
+ }
179090
179205
  const requestOptions = {
179091
179206
  ...options2?.signal ? { signal: options2.signal } : {},
179092
179207
  ...options2?.timeoutMs !== void 0 ? { timeout: options2.timeoutMs } : {},
@@ -221057,6 +221172,7 @@ __export(dist_exports, {
221057
221172
  getProviders: () => getProviders,
221058
221173
  getSupportedThinkingLevels: () => getSupportedThinkingLevels,
221059
221174
  isContextOverflow: () => isContextOverflow,
221175
+ isLegacyMiniMaxTextModel: () => isLegacyMiniMaxTextModel,
221060
221176
  modelsAreEqual: () => modelsAreEqual,
221061
221177
  parseJsonWithRepair: () => parseJsonWithRepair,
221062
221178
  parseStreamingJson: () => parseStreamingJson,
@@ -256945,7 +257061,7 @@ var ModelRegistry = class _ModelRegistry {
256945
257061
  /** Load built-in models and apply provider/model overrides */
256946
257062
  loadBuiltInModels(overrides, modelOverrides) {
256947
257063
  return getProviders().flatMap((provider) => {
256948
- const models = getModels(provider);
257064
+ const models = getModels(provider, { includeLegacy: true });
256949
257065
  const providerOverride = overrides.get(provider);
256950
257066
  const perModelOverrides = modelOverrides.get(provider);
256951
257067
  return models.map((m2) => {
@@ -257117,7 +257233,7 @@ File: ${modelsJsonPath}`
257117
257233
  * This is a fast check that doesn't refresh OAuth tokens.
257118
257234
  */
257119
257235
  getAvailable() {
257120
- return this.models.filter((m2) => this.hasConfiguredAuth(m2));
257236
+ return this.models.filter((m2) => !isLegacyMiniMaxTextModel(m2) && this.hasConfiguredAuth(m2));
257121
257237
  }
257122
257238
  /**
257123
257239
  * Find a model by provider and ID.
@@ -274653,8 +274769,8 @@ var defaultModelPerProvider = {
274653
274769
  zai: "glm-5.1",
274654
274770
  "zai-coding-cn": "glm-5.1",
274655
274771
  mistral: "devstral-medium-latest",
274656
- minimax: "MiniMax-M2.7",
274657
- "minimax-cn": "MiniMax-M2.7",
274772
+ minimax: "MiniMax-M3.1-Flash",
274773
+ "minimax-cn": "MiniMax-M3.1-Flash",
274658
274774
  moonshotai: "kimi-k2.6",
274659
274775
  "moonshotai-cn": "kimi-k2.6",
274660
274776
  huggingface: "moonshotai/Kimi-K2.6",
@@ -2,10 +2,29 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## Unreleased (1.9.x)
5
+ ## Unreleased
6
6
 
7
7
  No unreleased changes.
8
8
 
9
+ ## [1.10.0] - 2026-10-23
10
+
11
+ ### Added
12
+ - **Measured context evaluation** -- adds a reproducible 20-case runtime matrix
13
+ covering continuity, retrieval, safety, runtime binding, and integration
14
+ parity, with token, latency, RSS, fallback, degraded, and review-cost metrics.
15
+ - **Large-store release gates** -- records and verifies 40k and 100k local
16
+ capacity baselines across SDK, HTTP MCP, hooks, SQLite persistence, and SDK
17
+ reopen paths.
18
+
19
+ ### Changed
20
+ - **Retrieval receipts** -- compact search, MCP search, and CLI JSON search now
21
+ expose request-level candidate, selected, omitted, token-budget, and fallback
22
+ diagnostics while keeping query text, raw memory content, and local paths out
23
+ of the receipt.
24
+ - **1.10 development contract** -- documents memory ownership, runtime binding,
25
+ adapter parity, and the measured context baseline as maintained acceptance
26
+ surfaces.
27
+
9
28
  ## [1.9.12] - 2026-10-17
10
29
 
11
30
  ### Fixed