nexus-agents 2.83.1 → 2.85.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 (124) hide show
  1. package/dist/{child-mcp-config-3ZW2UPKZ.js → child-mcp-config-FARMFCA3.js} +3 -3
  2. package/dist/{chunk-DWOSFYI2.js → chunk-25AQZKMN.js} +2 -2
  3. package/dist/{chunk-I2HMWH4R.js → chunk-2WCYG75B.js} +13 -2
  4. package/dist/chunk-2WCYG75B.js.map +1 -0
  5. package/dist/{chunk-A6WC5I7V.js → chunk-4MYJNFYL.js} +4 -4
  6. package/dist/{chunk-W6MLS2UL.js → chunk-4S5GY2MF.js} +2 -2
  7. package/dist/{chunk-7V367KT4.js → chunk-4SU4Q37U.js} +7 -23
  8. package/dist/chunk-4SU4Q37U.js.map +1 -0
  9. package/dist/{chunk-J4ZBKE4B.js → chunk-6KZL5DMU.js} +910 -308
  10. package/dist/chunk-6KZL5DMU.js.map +1 -0
  11. package/dist/{chunk-JA6ON2RP.js → chunk-6QKMUPDP.js} +2 -2
  12. package/dist/{chunk-MATFDJRW.js → chunk-7J7D3LAL.js} +4 -4
  13. package/dist/{chunk-LM2S2QWO.js → chunk-CIW2BVSN.js} +3 -2
  14. package/dist/{chunk-LM2S2QWO.js.map → chunk-CIW2BVSN.js.map} +1 -1
  15. package/dist/{chunk-ZLGU7T6J.js → chunk-EL2KV773.js} +78 -63
  16. package/dist/chunk-EL2KV773.js.map +1 -0
  17. package/dist/{chunk-IM2B3FK2.js → chunk-ELVQORLX.js} +4 -4
  18. package/dist/chunk-ELVQORLX.js.map +1 -0
  19. package/dist/{chunk-VXIHHHLQ.js → chunk-FOG7PMGM.js} +2 -2
  20. package/dist/{chunk-HGPIHDC4.js → chunk-FR3P47J2.js} +4 -4
  21. package/dist/{chunk-ODKIRXN7.js → chunk-IF6TXCSE.js} +683 -227
  22. package/dist/chunk-IF6TXCSE.js.map +1 -0
  23. package/dist/{chunk-TKGVRHEI.js → chunk-J5S27RQ4.js} +2 -2
  24. package/dist/{chunk-UFUR6RBP.js → chunk-LY2KLNXM.js} +2 -2
  25. package/dist/{chunk-5QJPM5CB.js → chunk-NSOB2WRI.js} +3 -3
  26. package/dist/{chunk-4XSCU4B3.js → chunk-OXVOUVKH.js} +8 -8
  27. package/dist/{chunk-6XRNFLPI.js → chunk-POTGGTJD.js} +2 -2
  28. package/dist/{chunk-ZA6AZ7LK.js → chunk-QR4VYHMI.js} +6 -6
  29. package/dist/{chunk-FHY7I736.js → chunk-QR5KHIZG.js} +2 -2
  30. package/dist/{chunk-ELRNVADA.js → chunk-RTAIMK6P.js} +155 -47
  31. package/dist/chunk-RTAIMK6P.js.map +1 -0
  32. package/dist/{chunk-O3XJLOEX.js → chunk-SOKQOPTM.js} +2 -2
  33. package/dist/chunk-TRX7CAD5.js +27 -0
  34. package/dist/chunk-TRX7CAD5.js.map +1 -0
  35. package/dist/{chunk-BICIQYET.js → chunk-XZAWH36N.js} +3 -3
  36. package/dist/{chunk-6UI4NKT4.js → chunk-YLMB5MFQ.js} +27 -4
  37. package/dist/{chunk-6UI4NKT4.js.map → chunk-YLMB5MFQ.js.map} +1 -1
  38. package/dist/{chunk-BUXXAN6V.js → chunk-Z5BAZS6F.js} +2 -2
  39. package/dist/{chunk-SZZS57X7.js → chunk-ZF3MSYLG.js} +7 -7
  40. package/dist/{chunk-XODXYOFN.js → chunk-ZMERLMEP.js} +2 -2
  41. package/dist/{cli-circuit-breaker-LC4NZUGD.js → cli-circuit-breaker-LF22Z3QL.js} +5 -5
  42. package/dist/cli.d.ts +1 -1
  43. package/dist/cli.js +39 -34
  44. package/dist/cli.js.map +1 -1
  45. package/dist/{composite-router-GXQ25DO4.js → composite-router-TEXZI7WJ.js} +3 -3
  46. package/dist/{consensus-vote-MTLP6E72.js → consensus-vote-LPYEXUVC.js} +13 -12
  47. package/dist/{consensus-vote-types-CoGbAEjf.d.ts → consensus-vote-types-COAhHVIp.d.ts} +5 -0
  48. package/dist/{context-retriever-GQRC2MVM.js → context-retriever-3TKV4EEC.js} +7 -6
  49. package/dist/{dist-APHOQ26Z.js → dist-75MXB4R3.js} +917 -822
  50. package/dist/dist-75MXB4R3.js.map +1 -0
  51. package/dist/{doctor-deep-T3UUJX2E.js → doctor-deep-OUAKPLJX.js} +4 -4
  52. package/dist/expert-bridge-22UVN5TB.js +13 -0
  53. package/dist/{factory-OKNCTJO6.js → factory-IGHUOUBS.js} +6 -5
  54. package/dist/factory-JNXETBS4.js +14 -0
  55. package/dist/index.d.ts +137 -10
  56. package/dist/index.js +59 -26
  57. package/dist/index.js.map +1 -1
  58. package/dist/{init-opencode-KDTBKLXS.js → init-opencode-52TLZ2TO.js} +6 -6
  59. package/dist/issue-triage-WUK7L25X.js +15 -0
  60. package/dist/{learning-persistence-NX2KHL5T.js → learning-persistence-5ALG6XRC.js} +2 -2
  61. package/dist/{registry-command-D56ROMFJ.js → registry-command-ZIAJB2J3.js} +3 -3
  62. package/dist/{repo-security-plan-N3CDMW6L.js → repo-security-plan-THHLNGEQ.js} +4 -4
  63. package/dist/{research-helpers-synthesize-36QBOKII.js → research-helpers-synthesize-KNRCAIXK.js} +4 -4
  64. package/dist/{routing-memory-6IEPJ3EP.js → routing-memory-UY6KTGT2.js} +3 -3
  65. package/dist/{session-memory-X6SCDFER.js → session-memory-PUJMR6FE.js} +4 -4
  66. package/dist/{setup-command-5AEO5A4Z.js → setup-command-ZXDAR3GQ.js} +12 -11
  67. package/dist/setup-config-EYY5AYZ3.js +10 -0
  68. package/dist/{setup-custom-api-RBOJT3SS.js → setup-custom-api-5XRNYFOP.js} +5 -5
  69. package/dist/{tool-memory-EEHITQRJ.js → tool-memory-PNAHRFZM.js} +6 -5
  70. package/dist/{weather-report-6BC3JK5H.js → weather-report-RQMZOL7C.js} +3 -3
  71. package/package.json +4 -4
  72. package/dist/chunk-7V367KT4.js.map +0 -1
  73. package/dist/chunk-ELRNVADA.js.map +0 -1
  74. package/dist/chunk-I2HMWH4R.js.map +0 -1
  75. package/dist/chunk-IM2B3FK2.js.map +0 -1
  76. package/dist/chunk-J4ZBKE4B.js.map +0 -1
  77. package/dist/chunk-ODKIRXN7.js.map +0 -1
  78. package/dist/chunk-ZLGU7T6J.js.map +0 -1
  79. package/dist/dist-APHOQ26Z.js.map +0 -1
  80. package/dist/expert-bridge-7LPGCPPR.js +0 -13
  81. package/dist/factory-3XB5CAAA.js +0 -14
  82. package/dist/issue-triage-MURMDN2G.js +0 -15
  83. package/dist/setup-config-RPSVIQJO.js +0 -10
  84. /package/dist/{child-mcp-config-3ZW2UPKZ.js.map → child-mcp-config-FARMFCA3.js.map} +0 -0
  85. /package/dist/{chunk-DWOSFYI2.js.map → chunk-25AQZKMN.js.map} +0 -0
  86. /package/dist/{chunk-A6WC5I7V.js.map → chunk-4MYJNFYL.js.map} +0 -0
  87. /package/dist/{chunk-W6MLS2UL.js.map → chunk-4S5GY2MF.js.map} +0 -0
  88. /package/dist/{chunk-JA6ON2RP.js.map → chunk-6QKMUPDP.js.map} +0 -0
  89. /package/dist/{chunk-MATFDJRW.js.map → chunk-7J7D3LAL.js.map} +0 -0
  90. /package/dist/{chunk-VXIHHHLQ.js.map → chunk-FOG7PMGM.js.map} +0 -0
  91. /package/dist/{chunk-HGPIHDC4.js.map → chunk-FR3P47J2.js.map} +0 -0
  92. /package/dist/{chunk-TKGVRHEI.js.map → chunk-J5S27RQ4.js.map} +0 -0
  93. /package/dist/{chunk-UFUR6RBP.js.map → chunk-LY2KLNXM.js.map} +0 -0
  94. /package/dist/{chunk-5QJPM5CB.js.map → chunk-NSOB2WRI.js.map} +0 -0
  95. /package/dist/{chunk-4XSCU4B3.js.map → chunk-OXVOUVKH.js.map} +0 -0
  96. /package/dist/{chunk-6XRNFLPI.js.map → chunk-POTGGTJD.js.map} +0 -0
  97. /package/dist/{chunk-ZA6AZ7LK.js.map → chunk-QR4VYHMI.js.map} +0 -0
  98. /package/dist/{chunk-FHY7I736.js.map → chunk-QR5KHIZG.js.map} +0 -0
  99. /package/dist/{chunk-O3XJLOEX.js.map → chunk-SOKQOPTM.js.map} +0 -0
  100. /package/dist/{chunk-BICIQYET.js.map → chunk-XZAWH36N.js.map} +0 -0
  101. /package/dist/{chunk-BUXXAN6V.js.map → chunk-Z5BAZS6F.js.map} +0 -0
  102. /package/dist/{chunk-SZZS57X7.js.map → chunk-ZF3MSYLG.js.map} +0 -0
  103. /package/dist/{chunk-XODXYOFN.js.map → chunk-ZMERLMEP.js.map} +0 -0
  104. /package/dist/{cli-circuit-breaker-LC4NZUGD.js.map → cli-circuit-breaker-LF22Z3QL.js.map} +0 -0
  105. /package/dist/{composite-router-GXQ25DO4.js.map → composite-router-TEXZI7WJ.js.map} +0 -0
  106. /package/dist/{consensus-vote-MTLP6E72.js.map → consensus-vote-LPYEXUVC.js.map} +0 -0
  107. /package/dist/{context-retriever-GQRC2MVM.js.map → context-retriever-3TKV4EEC.js.map} +0 -0
  108. /package/dist/{doctor-deep-T3UUJX2E.js.map → doctor-deep-OUAKPLJX.js.map} +0 -0
  109. /package/dist/{expert-bridge-7LPGCPPR.js.map → expert-bridge-22UVN5TB.js.map} +0 -0
  110. /package/dist/{factory-3XB5CAAA.js.map → factory-IGHUOUBS.js.map} +0 -0
  111. /package/dist/{factory-OKNCTJO6.js.map → factory-JNXETBS4.js.map} +0 -0
  112. /package/dist/{init-opencode-KDTBKLXS.js.map → init-opencode-52TLZ2TO.js.map} +0 -0
  113. /package/dist/{issue-triage-MURMDN2G.js.map → issue-triage-WUK7L25X.js.map} +0 -0
  114. /package/dist/{learning-persistence-NX2KHL5T.js.map → learning-persistence-5ALG6XRC.js.map} +0 -0
  115. /package/dist/{registry-command-D56ROMFJ.js.map → registry-command-ZIAJB2J3.js.map} +0 -0
  116. /package/dist/{repo-security-plan-N3CDMW6L.js.map → repo-security-plan-THHLNGEQ.js.map} +0 -0
  117. /package/dist/{research-helpers-synthesize-36QBOKII.js.map → research-helpers-synthesize-KNRCAIXK.js.map} +0 -0
  118. /package/dist/{routing-memory-6IEPJ3EP.js.map → routing-memory-UY6KTGT2.js.map} +0 -0
  119. /package/dist/{session-memory-X6SCDFER.js.map → session-memory-PUJMR6FE.js.map} +0 -0
  120. /package/dist/{setup-command-5AEO5A4Z.js.map → setup-command-ZXDAR3GQ.js.map} +0 -0
  121. /package/dist/{setup-config-RPSVIQJO.js.map → setup-config-EYY5AYZ3.js.map} +0 -0
  122. /package/dist/{setup-custom-api-RBOJT3SS.js.map → setup-custom-api-5XRNYFOP.js.map} +0 -0
  123. /package/dist/{tool-memory-EEHITQRJ.js.map → tool-memory-PNAHRFZM.js.map} +0 -0
  124. /package/dist/{weather-report-6BC3JK5H.js.map → weather-report-RQMZOL7C.js.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  TASK_CATEGORIES,
3
3
  getAdaptiveBonus,
4
4
  getOutcomeStore
5
- } from "./chunk-6UI4NKT4.js";
5
+ } from "./chunk-YLMB5MFQ.js";
6
6
 
7
7
  // src/cli/doctor-deep.ts
8
8
  var CLI_NAMES = ["claude", "gemini", "codex", "opencode"];
@@ -106,4 +106,4 @@ export {
106
106
  runDeepDiagnostics,
107
107
  formatDeepDiagnostics
108
108
  };
109
- //# sourceMappingURL=chunk-O3XJLOEX.js.map
109
+ //# sourceMappingURL=chunk-SOKQOPTM.js.map
@@ -0,0 +1,27 @@
1
+ import {
2
+ getRandomProvider,
3
+ getTimeProvider
4
+ } from "./chunk-YLMB5MFQ.js";
5
+
6
+ // src/utils/id-utils.ts
7
+ import { randomUUID } from "crypto";
8
+ function generateId(prefix, randomLength = 8) {
9
+ const timestamp = getTimeProvider().now().toString(36);
10
+ const random = getRandomProvider().random().toString(36).substring(2, 2 + randomLength);
11
+ return `${prefix}_${timestamp}_${random}`;
12
+ }
13
+ function generateHyphenId(prefix, randomLength = 6) {
14
+ const timestamp = String(getTimeProvider().now());
15
+ const random = getRandomProvider().random().toString(36).slice(2, 2 + randomLength);
16
+ return `${prefix}-${timestamp}-${random}`;
17
+ }
18
+ function generateUUID() {
19
+ return randomUUID();
20
+ }
21
+
22
+ export {
23
+ generateId,
24
+ generateHyphenId,
25
+ generateUUID
26
+ };
27
+ //# sourceMappingURL=chunk-TRX7CAD5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/id-utils.ts"],"sourcesContent":["/**\n * nexus-agents/utils - ID Generation Utilities\n *\n * Shared utility functions for generating unique identifiers.\n * Consolidates duplicate generateId implementations per ADR-0013.\n *\n * Uses getTimeProvider and getRandomProvider for deterministic testing.\n *\n * @module utils/id-utils\n * @see docs/adr/0013-memory-helpers-consolidation.md\n */\n\nimport { randomUUID } from 'node:crypto';\nimport { getTimeProvider, getRandomProvider } from '../core/index.js';\n\n/**\n * Generate a unique ID with prefix using timestamp and random suffix.\n *\n * Format: `${prefix}_${timestamp}_${random}` (underscore-separated)\n *\n * Uses getTimeProvider() and getRandomProvider() for deterministic testing.\n *\n * @param prefix - ID prefix (e.g., 'belief', 'update', 'exec')\n * @param randomLength - Length of random suffix (default: 8)\n * @returns Unique ID string\n *\n * @example\n * ```typescript\n * const beliefId = generateId('belief'); // 'belief_1p5k3x2_a1b2c3d4'\n * const execId = generateId('exec', 6); // 'exec_1p5k3x2_a1b2c3'\n * ```\n */\nexport function generateId(prefix: string, randomLength = 8): string {\n const timestamp = getTimeProvider().now().toString(36);\n const random = getRandomProvider()\n .random()\n .toString(36)\n .substring(2, 2 + randomLength);\n return `${prefix}_${timestamp}_${random}`;\n}\n\n/**\n * Generate a unique ID with hyphen separators.\n *\n * Format: `${prefix}-${timestamp}-${random}` (hyphen-separated)\n *\n * @param prefix - ID prefix\n * @param randomLength - Length of random suffix (default: 6)\n * @returns Unique ID string\n *\n * @example\n * ```typescript\n * const id = generateHyphenId('workflow'); // 'workflow-1769876392192-a1b2c3'\n * ```\n */\nexport function generateHyphenId(prefix: string, randomLength = 6): string {\n const timestamp = String(getTimeProvider().now());\n const random = getRandomProvider()\n .random()\n .toString(36)\n .slice(2, 2 + randomLength);\n return `${prefix}-${timestamp}-${random}`;\n}\n\n/**\n * Generate a short unique ID using randomUUID.\n *\n * Format: `${prefix}-${shortUuid}` where shortUuid is first 8 chars of UUID.\n *\n * @param prefix - ID prefix\n * @returns Short unique ID string\n *\n * @example\n * ```typescript\n * const id = generateShortUuid('workflow'); // 'workflow-a1b2c3d4'\n * ```\n */\nexport function generateShortUuid(prefix: string): string {\n // Use random provider for determinism, generate UUID-like pattern\n const rand1 = getRandomProvider().random().toString(16).substring(2, 6);\n const rand2 = getRandomProvider().random().toString(16).substring(2, 6);\n return `${prefix}-${rand1}${rand2}`;\n}\n\n// ============================================================================\n// UUID Generation (node:crypto)\n// ============================================================================\n\n/**\n * Generates a UUID v4 using node:crypto.randomUUID().\n * This is the canonical UUID generator - use instead of `uuid` package.\n *\n * Note: This uses node:crypto directly for performance. For deterministic\n * testing scenarios, use generateId() or generateShortUuid() instead.\n *\n * @returns A UUID v4 string\n *\n * @example\n * ```typescript\n * const id = generateUUID(); // 'f47ac10b-58cc-4372-a567-0e02b2c3d479'\n * ```\n */\nexport function generateUUID(): string {\n return randomUUID();\n}\n\n/**\n * Generates a short UUID (first 8 characters).\n * Useful for display purposes or step IDs.\n *\n * @param prefix - Optional prefix for the ID\n * @returns A short UUID string, optionally prefixed\n *\n * @example\n * ```typescript\n * const id = generateShortUUIDv4(); // 'f47ac10b'\n * const stepId = generateShortUUIDv4('step'); // 'step-f47ac10b'\n * ```\n */\nexport function generateShortUUIDv4(prefix?: string): string {\n const shortId = randomUUID().slice(0, 8);\n return prefix !== undefined ? `${prefix}-${shortId}` : shortId;\n}\n\n/**\n * Generates a step ID using UUID.\n * Replacement for `step-${uuidv4().slice(0, 8)}` pattern.\n *\n * @param prefix - Prefix for the step ID (default: 'step')\n * @returns A prefixed short UUID\n */\nexport function generateStepId(prefix = 'step'): string {\n return generateShortUUIDv4(prefix);\n}\n"],"mappings":";;;;;;AAYA,SAAS,kBAAkB;AAoBpB,SAAS,WAAW,QAAgB,eAAe,GAAW;AACnE,QAAM,YAAY,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE;AACrD,QAAM,SAAS,kBAAkB,EAC9B,OAAO,EACP,SAAS,EAAE,EACX,UAAU,GAAG,IAAI,YAAY;AAChC,SAAO,GAAG,MAAM,IAAI,SAAS,IAAI,MAAM;AACzC;AAgBO,SAAS,iBAAiB,QAAgB,eAAe,GAAW;AACzE,QAAM,YAAY,OAAO,gBAAgB,EAAE,IAAI,CAAC;AAChD,QAAM,SAAS,kBAAkB,EAC9B,OAAO,EACP,SAAS,EAAE,EACX,MAAM,GAAG,IAAI,YAAY;AAC5B,SAAO,GAAG,MAAM,IAAI,SAAS,IAAI,MAAM;AACzC;AAwCO,SAAS,eAAuB;AACrC,SAAO,WAAW;AACpB;","names":[]}
@@ -2,14 +2,14 @@ import {
2
2
  CircuitBreakerRegistry,
3
3
  CircuitError,
4
4
  mapCliErrorToCategory
5
- } from "./chunk-LM2S2QWO.js";
5
+ } from "./chunk-CIW2BVSN.js";
6
6
  import {
7
7
  createLogger,
8
8
  err,
9
9
  getFallbackChainForCategory,
10
10
  getTimeProvider,
11
11
  ok
12
- } from "./chunk-6UI4NKT4.js";
12
+ } from "./chunk-YLMB5MFQ.js";
13
13
 
14
14
  // src/cli-adapters/cli-circuit-breaker.ts
15
15
  var CATEGORY_TO_FALLBACK = {
@@ -152,4 +152,4 @@ export {
152
152
  CliCircuitBreakerIntegration,
153
153
  createCliCircuitBreakerIntegration
154
154
  };
155
- //# sourceMappingURL=chunk-BICIQYET.js.map
155
+ //# sourceMappingURL=chunk-XZAWH36N.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isPersistenceEnabled,
3
3
  nexusDataPath
4
- } from "./chunk-I2HMWH4R.js";
4
+ } from "./chunk-2WCYG75B.js";
5
5
  import {
6
6
  __require
7
7
  } from "./chunk-PR4QN5HX.js";
@@ -10997,7 +10997,7 @@ var CompositeRouter = class _CompositeRouter {
10997
10997
  */
10998
10998
  async consultUnifiedContext(task) {
10999
10999
  try {
11000
- const { getContextForTask, inferTaskCategory } = await import("./context-retriever-GQRC2MVM.js");
11000
+ const { getContextForTask, inferTaskCategory } = await import("./context-retriever-3TKV4EEC.js");
11001
11001
  const ctx = await getContextForTask({
11002
11002
  task: task.content,
11003
11003
  category: inferTaskCategory(task.content),
@@ -11953,6 +11953,23 @@ var RoutingMemory = class {
11953
11953
  cacheHits = 0;
11954
11954
  cacheMisses = 0;
11955
11955
  recommendationsMade = 0;
11956
+ /**
11957
+ * Per-taskType cache of `getPreferences()` results (#2955 site 4).
11958
+ *
11959
+ * Pre-fix, every `getPreferences()` call did N=`CLI_NAMES.length`
11960
+ * MobiMem profile lookups followed by an in-place sort, on every
11961
+ * CompositeRouter `route()` invocation. With `enableRoutingMemory=true`
11962
+ * (default with persistence on), most calls produced empty results
11963
+ * after the N lookups — pure waste on the routing hot path.
11964
+ *
11965
+ * The cache stores the sorted preference array per taskType and is
11966
+ * invalidated by `storePreference(_, taskType, _)` writes. MobiMem
11967
+ * mutations performed by other RoutingMemory instances or prior
11968
+ * sessions are not detected; the cache is only correct within a
11969
+ * single instance's lifetime, which matches CompositeRouter's
11970
+ * usage pattern (singleton per process).
11971
+ */
11972
+ preferencesCache = /* @__PURE__ */ new Map();
11956
11973
  constructor(config, mobimem) {
11957
11974
  this.config = { ...DEFAULT_ROUTING_MEMORY_CONFIG, ...config };
11958
11975
  this.logger = this.config.logger ?? createLogger({ component: "RoutingMemory" });
@@ -11970,6 +11987,7 @@ var RoutingMemory = class {
11970
11987
  performance: performance2,
11971
11988
  updatedAt: getTimeProvider().nowIso()
11972
11989
  });
11990
+ this.preferencesCache.delete(taskType);
11973
11991
  this.logger.debug("Stored model preference", {
11974
11992
  model,
11975
11993
  taskType,
@@ -11978,6 +11996,8 @@ var RoutingMemory = class {
11978
11996
  });
11979
11997
  }
11980
11998
  getPreferences(taskType) {
11999
+ const cached = this.preferencesCache.get(taskType);
12000
+ if (cached !== void 0) return cached;
11981
12001
  const preferenceKey = `model_preference:${taskType}`;
11982
12002
  const preferences = [];
11983
12003
  for (const model of CLI_NAMES) {
@@ -11993,7 +12013,10 @@ var RoutingMemory = class {
11993
12013
  });
11994
12014
  }
11995
12015
  }
11996
- return preferences.sort((a, b) => b.strength - a.strength);
12016
+ preferences.sort((a, b) => b.strength - a.strength);
12017
+ const result = Object.freeze([...preferences]);
12018
+ this.preferencesCache.set(taskType, result);
12019
+ return result;
11997
12020
  }
11998
12021
  recordExperience(workflow, models, success, metrics2) {
11999
12022
  const contextSignature = models.join("->");
@@ -12295,4 +12318,4 @@ export {
12295
12318
  ParseError,
12296
12319
  OrchestratorError
12297
12320
  };
12298
- //# sourceMappingURL=chunk-6UI4NKT4.js.map
12321
+ //# sourceMappingURL=chunk-YLMB5MFQ.js.map