nolo-cli 0.33.0-alpha.3 → 0.33.0-alpha.31

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 (157) hide show
  1. package/{_executeModel-RWPVI3YV.js → _executeModel-BTZJ6QKO.js} +56 -58
  2. package/{action-SMLG6OTB.js → action-LKQAGKHH.js} +11 -11
  3. package/{addContentAction-SFO244QN.js → addContentAction-IP2B6UUB.js} +9 -9
  4. package/{addDialogAgentAction-W44ZCEHB.js → addDialogAgentAction-JNIAUFE6.js} +8 -8
  5. package/{agentDeleteCommand-KU2RXQPP.js → agentDeleteCommand-WG6T4OTP.js} +48 -44
  6. package/{agentEmailCommands-MPCMDENS.js → agentEmailCommands-4CEZD4JW.js} +83 -80
  7. package/{agentListCommands-EPD4N6FX.js → agentListCommands-2YHWZHLD.js} +56 -43
  8. package/{agentMachineCommands-AF7C3YRT.js → agentMachineCommands-LKCUIDHA.js} +46 -42
  9. package/agentProviderCommands-65ZC2WB4.js +122 -0
  10. package/{agentPullCommand-YH5GEBK4.js → agentPullCommand-NYHSK6EW.js} +3 -3
  11. package/{agentRecordCommands-EYE6MZZG.js → agentRecordCommands-VSBYJUBN.js} +74 -71
  12. package/{agentRunCommand-LL22SGTN.js → agentRunCommand-LAD7TRWT.js} +80 -76
  13. package/{agentRuntimeLocal-JX34G47Z.js → agentRuntimeLocal-TEJECMTH.js} +34 -31
  14. package/{agentSlice-TNMFQQOV.js → agentSlice-3U3H657P.js} +11 -11
  15. package/{appDeleteCommands-43K5VXQB.js → appDeleteCommands-5QCUYGTX.js} +41 -37
  16. package/{appDeployCommands-FEEJSVDZ.js → appDeployCommands-GMIAIMDB.js} +41 -37
  17. package/{appDeployStatusCommands-H76CG45R.js → appDeployStatusCommands-ZTJ6APB6.js} +41 -37
  18. package/{appGetCommands-MDZYFTYZ.js → appGetCommands-PI4NTPKT.js} +41 -37
  19. package/{appListCommands-TUJJXPWG.js → appListCommands-QMRCLRJ6.js} +41 -37
  20. package/{authCommand-T7UK4CWS.js → authCommand-4ICNA46V.js} +21 -20
  21. package/{authCommands-EAPFGNHN.js → authCommands-W74NRPA6.js} +6 -6
  22. package/{chatQueueReduxAdapter-LVQXC4ZY.js → chatQueueReduxAdapter-5GNVXJ5T.js} +25 -24
  23. package/{chunk-JZ5AMMXU.js → chunk-244YJUYS.js} +4 -4
  24. package/{chunk-2UECQ7RE.js → chunk-3AOLVADY.js} +1 -1
  25. package/{chunk-AFV4FOT2.js → chunk-3GDKZAPT.js} +4 -91
  26. package/{chunk-M4NC7NF6.js → chunk-3H3FPUCI.js} +2 -2
  27. package/chunk-3Z32AD6X.js +22 -0
  28. package/{chunk-B2BSG6QQ.js → chunk-4EXK5Q2M.js} +18 -18
  29. package/{chunk-UK5JGQVU.js → chunk-52DHSNJC.js} +14 -20
  30. package/{chunk-LOD75GOS.js → chunk-6PI2635O.js} +3884 -1562
  31. package/{chunk-HDKRSRYU.js → chunk-7CH6ONWB.js} +636 -210
  32. package/{chunk-FMEVI5TG.js → chunk-7CH6U3FL.js} +1 -1
  33. package/{chunk-FSSX3XRY.js → chunk-7URTEFXJ.js} +1 -1
  34. package/{chunk-JTSGWTYZ.js → chunk-ASA3CJSG.js} +2 -2
  35. package/{chunk-6SXC35F4.js → chunk-AXCXE35O.js} +13 -13
  36. package/{chunk-2QTEYCR7.js → chunk-C2UKEL7P.js} +17 -7
  37. package/{chunk-I6N2UVVY.js → chunk-CBYBNR2K.js} +1 -1
  38. package/{chunk-WHD6BG7M.js → chunk-DMOWI2S7.js} +48 -44
  39. package/{chunk-3GZXL6FM.js → chunk-DZPK4YQY.js} +1 -1
  40. package/{chunk-6HYVJV7B.js → chunk-ESHYE7WU.js} +2 -1
  41. package/{chunk-TFPUAELY.js → chunk-ET4UZQN3.js} +3 -3
  42. package/{chunk-3WXRAHCG.js → chunk-EU7POTD4.js} +3 -3
  43. package/{chunk-DPMBNHOJ.js → chunk-FAMAQ3A7.js} +1 -1
  44. package/{chunk-JZPBVBIY.js → chunk-FD36SCCD.js} +19 -8
  45. package/{chunk-57QJXIB6.js → chunk-FEDK54U6.js} +10 -10
  46. package/{chunk-MPZJVZDC.js → chunk-FL3KRU3X.js} +41 -2674
  47. package/{chunk-ZURFOV5J.js → chunk-FS5VNMPF.js} +3 -3
  48. package/{chunk-2H3XIBY4.js → chunk-FSOCQPX7.js} +4 -82
  49. package/{chunk-M2YMQOLC.js → chunk-G34SHBSK.js} +11 -11
  50. package/{chunk-U4TRT5V4.js → chunk-GEPHJJW4.js} +1 -1
  51. package/{chunk-OIQPORYI.js → chunk-GN6ENM54.js} +178 -2
  52. package/{chunk-X664KVEV.js → chunk-HHBXCRJS.js} +204 -123
  53. package/chunk-HJ23CUHW.js +109 -0
  54. package/{chunk-RAZOLMJR.js → chunk-HXV5GJFC.js} +15 -8
  55. package/{chunk-OR2HNLVO.js → chunk-HYQSSY7V.js} +71 -79
  56. package/{chunk-WLH5BAKX.js → chunk-IIOHYLIG.js} +9 -4
  57. package/{chunk-2IVEXF7P.js → chunk-ISQZFROX.js} +2 -9
  58. package/{chunk-IHEC7VBF.js → chunk-J36P3SH5.js} +1 -1
  59. package/{chunk-PREQU5QV.js → chunk-J5STUEYU.js} +1 -1
  60. package/{chunk-O6GEBMIY.js → chunk-JE4J3T7A.js} +5296 -4981
  61. package/{chunk-VH2F7ZB6.js → chunk-JG43PNFR.js} +1 -1
  62. package/{chunk-GTYM4HKV.js → chunk-JZ6JDSWD.js} +5 -5
  63. package/{chunk-X2DAEZ3X.js → chunk-KWPXU3W5.js} +1 -1
  64. package/{chunk-WJSW43QZ.js → chunk-L3JWI7WX.js} +0 -1
  65. package/{chunk-NNWHHCVP.js → chunk-LI6SNQF6.js} +2 -3
  66. package/{chunk-GM6PU7B6.js → chunk-MEYIRKDN.js} +0 -1
  67. package/{chunk-Q5ITEGIN.js → chunk-N4XRDM26.js} +1 -1
  68. package/{chunk-7E72JMBB.js → chunk-N543Q3VR.js} +57 -16
  69. package/{chunk-YDTYDA5W.js → chunk-NBIS3WYT.js} +8 -6
  70. package/{chunk-JMPYDFHY.js → chunk-NI72ISCU.js} +21 -8
  71. package/{chunk-5CS33IBL.js → chunk-NQ4N4IGO.js} +11 -12
  72. package/chunk-OH4Q4VVA.js +38 -0
  73. package/{chunk-CLP2K7U4.js → chunk-OS63QEVB.js} +7 -7
  74. package/{chunk-DFUPZE6V.js → chunk-P35OZHD4.js} +3 -16
  75. package/{chunk-GMXWYXAF.js → chunk-PJT3CCBL.js} +4 -4
  76. package/{chunk-3VAQHAXT.js → chunk-PYLC3472.js} +27 -27
  77. package/{chunk-ADLYMQB6.js → chunk-QUK7UZW7.js} +137 -0
  78. package/{chunk-37V5LNEQ.js → chunk-RRYRKT7X.js} +1 -1
  79. package/{chunk-AAGCMVFT.js → chunk-S6QP3AK4.js} +895 -175
  80. package/{chunk-73GINUCW.js → chunk-SQPMYIR5.js} +135 -56
  81. package/{chunk-XCCGU6QB.js → chunk-SSK4QDFL.js} +1 -1
  82. package/{chunk-IL545V3E.js → chunk-TACRGJZO.js} +7 -7
  83. package/chunk-TVXJEOU2.js +78 -0
  84. package/{chunk-NUO3QFWD.js → chunk-UNHKVD2N.js} +1 -1
  85. package/{chunk-GE6IWA5N.js → chunk-UNZDCI3O.js} +126 -1
  86. package/chunk-UOLENXLQ.js +1132 -0
  87. package/{chunk-5SBK2MTI.js → chunk-UOVE5ZHK.js} +24 -71
  88. package/{chunk-ZJMME4DS.js → chunk-VBJVODPE.js} +6 -6
  89. package/{chunk-FXFGNOT2.js → chunk-VFVCYIRQ.js} +1 -1
  90. package/{chunk-AOXVOC6D.js → chunk-W2DNU6FK.js} +3 -3
  91. package/chunk-X6WFECZY.js +97 -0
  92. package/{chunk-RY57GLGW.js → chunk-YPREESF4.js} +42 -5
  93. package/{chunk-HUCT7HID.js → chunk-YXB5JR6N.js} +1 -1
  94. package/{chunk-BQXOGBFN.js → chunk-YZ2WE6CW.js} +2 -2
  95. package/{cliExecutor-DW3PHGEL.js → cliExecutor-BBUVQU4L.js} +2 -2
  96. package/{codingSkills-DY5MINPG.js → codingSkills-FXKII4C6.js} +3 -3
  97. package/{createAgentAutomationAction-INQT23LX.js → createAgentAutomationAction-CMOMDO6G.js} +25 -26
  98. package/{createDialogAction-LDCPDI73.js → createDialogAction-QG7DKUA7.js} +28 -29
  99. package/{createPageAction-5YXOG2M4.js → createPageAction-JCMCNMTK.js} +30 -31
  100. package/{dbSlice-3SD5L5H2.js → dbSlice-ZNHRC4BK.js} +8 -8
  101. package/{deleteFile-XQXPBFFB.js → deleteFile-NPZ64DFN.js} +5 -5
  102. package/{dialogCommands-CHJO47AX.js → dialogCommands-T43TTFWR.js} +40 -36
  103. package/{dialogSlice-DOWKOILN.js → dialogSlice-5VZFBHCA.js} +24 -23
  104. package/{docCreateCommands-OVZARUFX.js → docCreateCommands-DQBKKPOC.js} +42 -38
  105. package/{docDeleteCommands-E2XJ62LD.js → docDeleteCommands-ULM4MTP3.js} +43 -39
  106. package/{docReadCommands-I7OSREPJ.js → docReadCommands-3FXTVWVJ.js} +42 -38
  107. package/{docStore-UAWSKZ2Y.js → docStore-LTAGA6XZ.js} +26 -27
  108. package/{docUpdateCommands-X4Z26VJM.js → docUpdateCommands-ZE6B3SLE.js} +44 -40
  109. package/emscripten-module-EDQBMDVK.js +576 -0
  110. package/emscripten-module-LCBQ7VWY.js +1506 -0
  111. package/emscripten-module-OFHQ7EL3.js +482 -0
  112. package/emscripten-module-XM7NDJQA.js +4536 -0
  113. package/fetchMessages-7QRCCRYK.js +1 -1
  114. package/ffi-6ZSX3QJ4.js +80 -0
  115. package/ffi-742Y76PE.js +92 -0
  116. package/ffi-AEYWSYLM.js +80 -0
  117. package/ffi-KQC27OUM.js +92 -0
  118. package/{getPricing-L2ENXWHV.js → getPricing-5R7P4JLI.js} +4 -4
  119. package/{handleSendMessageAction-C3TSDWKH.js → handleSendMessageAction-7GF5IU4J.js} +26 -25
  120. package/index.js +78 -76
  121. package/{localRuntimeAuthority-E3R24J4T.js → localRuntimeAuthority-S77B5QVB.js} +6 -2
  122. package/{localRuntimeDb-DDZCJFQZ.js → localRuntimeDb-N3H3HQ7G.js} +1 -1
  123. package/{machineCommands-BUOIYJAD.js → machineCommands-57UG5TRO.js} +84 -81
  124. package/{machineInfo-M6KB6HZN.js → machineInfo-66ZFUMLE.js} +1 -1
  125. package/{machineWsRunDispatch-7CRWAA6O.js → machineWsRunDispatch-L3GQ7ASL.js} +72 -69
  126. package/{models-OX2S5C6Q.js → models-CQOLEOPZ.js} +2 -2
  127. package/module-ES6BEMUI-AFCVSBMS.js +14 -0
  128. package/module-asyncify-2EFITU5U-DEP2F2QP.js +9 -0
  129. package/package.json +1 -1
  130. package/{read-6G73BMEY.js → read-QOLSHOT5.js} +6 -6
  131. package/{readDocTool-DK4EI2GA.js → readDocTool-X7HLXXBW.js} +1 -1
  132. package/{readlineWorkspace-ZDWEASJV.js → readlineWorkspace-SFUQOD4C.js} +3746 -3155
  133. package/{removeDialogAgentAction-E7H557UO.js → removeDialogAgentAction-UBYX7RVR.js} +12 -12
  134. package/{runAgentClientLoop-U7HYA3O5.js → runAgentClientLoop-VCTFHJVP.js} +53 -54
  135. package/{runtimeDoctorCommands-KIKM6BIO.js → runtimeDoctorCommands-HT4O2PXL.js} +6 -6
  136. package/{setDialogExtraReferencesAction-RMMGBR5F.js → setDialogExtraReferencesAction-GMXZTTQA.js} +9 -9
  137. package/{setPrimaryDialogAgentAction-FWBKKLVA.js → setPrimaryDialogAgentAction-JKVEILI3.js} +12 -12
  138. package/{settingSlice-73PV4KG4.js → settingSlice-EQKEXSTU.js} +10 -10
  139. package/{skillDiscovery-KLLKXPUO.js → skillDiscovery-6YSTRCQ7.js} +3 -3
  140. package/{slateUtils-VO2FU36K.js → slateUtils-RIZES3PV.js} +1 -1
  141. package/{spaceCommands-GEWZXGHM.js → spaceCommands-3PVSEEGH.js} +235 -46
  142. package/{spaceSlice-B6MOVY4N.js → spaceSlice-OEBVDZGG.js} +25 -26
  143. package/{streamAgentChatTurn-T527EQTT.js → streamAgentChatTurn-YLUPK5CI.js} +107 -120
  144. package/{switchDialogAgentAction-US6QNL3N.js → switchDialogAgentAction-DSC2T3JW.js} +8 -8
  145. package/{chunk-IDAU4UFS.js → syncMapping-N6RGXGBW.js} +11 -11
  146. package/{tableCommands-QE47K72R.js → tableCommands-SQSOF2XK.js} +9 -9
  147. package/{tools-XMWCVMPM.js → tools-IZUS4UM5.js} +41 -42
  148. package/{tuiSummaryLlmCaller-NCAJSVSD.js → tuiSummaryLlmCaller-ZFPTFGXJ.js} +17 -16
  149. package/{updateCommands-AK2RDOFR.js → updateCommands-MNDUIKN7.js} +2 -2
  150. package/{updateDialogTitleAction-XPJZRJEL.js → updateDialogTitleAction-BB53DOCT.js} +31 -32
  151. package/chunk-6PO2SYCS.js +0 -1800
  152. package/chunk-M3JEW6N6.js +0 -193
  153. package/syncMapping-RK2MANUX.js +0 -43
  154. package/{agentGrantCommands-2LEZDADN.js → agentGrantCommands-OPIGFRDO.js} +2 -2
  155. package/{chunk-ZHYK3N56.js → chunk-G7HTVVFL.js} +3 -3
  156. package/{chunk-SAQQLJZ5.js → chunk-JDSUTNYY.js} +3 -3
  157. package/{offlineMarxistsAgentCommand-GEH6SNNA.js → offlineMarxistsAgentCommand-HDIQVGKN.js} +3 -3
@@ -2,16 +2,16 @@ import {
2
2
  getAllServers,
3
3
  getIsDesktopApp,
4
4
  isAbortError
5
- } from "./chunk-WJSW43QZ.js";
5
+ } from "./chunk-L3JWI7WX.js";
6
+ import {
7
+ isRecord
8
+ } from "./chunk-KUG52IAP.js";
6
9
  import {
7
10
  asTrimmedString
8
11
  } from "./chunk-3EUW3WEO.js";
9
12
  import {
10
13
  asOptionalPositiveFiniteNumber
11
14
  } from "./chunk-U6VC4MU4.js";
12
- import {
13
- isRecord
14
- } from "./chunk-KUG52IAP.js";
15
15
  import {
16
16
  API_ENDPOINTS,
17
17
  SERVERS,
@@ -28,104 +28,27 @@ import {
28
28
  } from "./chunk-G3SUCT4W.js";
29
29
 
30
30
  // node_modules/reselect/dist/reselect.mjs
31
- var runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {
32
- if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {
33
- let isInputSameAsOutput = false;
34
- try {
35
- const emptyObject = {};
36
- if (resultFunc(emptyObject) === emptyObject) isInputSameAsOutput = true;
37
- } catch {
38
- }
39
- if (isInputSameAsOutput) {
40
- let stack = void 0;
41
- try {
42
- throw new Error();
43
- } catch (e) {
44
- ;
45
- ({ stack } = e);
46
- }
47
- console.warn(
48
- "The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",
49
- { stack }
50
- );
51
- }
52
- }
53
- };
54
- var runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {
55
- const { memoize, memoizeOptions } = options;
56
- const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;
57
- const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);
58
- const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);
59
- if (!areInputSelectorResultsEqual) {
60
- let stack = void 0;
61
- try {
62
- throw new Error();
63
- } catch (e) {
64
- ;
65
- ({ stack } = e);
66
- }
67
- console.warn(
68
- "An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",
69
- {
70
- arguments: inputSelectorArgs,
71
- firstInputs: inputSelectorResults,
72
- secondInputs: inputSelectorResultsCopy,
73
- stack
74
- }
75
- );
76
- }
31
+ var CACHE_SIZE_CHECK_THRESHOLD = 1e3;
32
+ var runCacheSizeCheck = (cacheSize, funcName) => {
33
+ let stack = void 0;
34
+ try {
35
+ throw new Error();
36
+ } catch (e) {
37
+ ;
38
+ ({ stack } = e);
39
+ }
40
+ console.warn(
41
+ `A function memoized with weakMapMemoize${funcName ? ` (\`${funcName}\`)` : ""} has seen over ${cacheSize} distinct values for the same primitive argument position.
42
+ Results keyed by primitive arguments are held strongly and are only released by \`clearCache()\`, so this cache will keep growing for as long as the function keeps seeing new values.
43
+ If it is called with ever-changing primitives (ids, offsets, timestamps), pass the \`maxSize\` option to bound the cache, switch to \`lruMemoize\`, or call \`.clearCache()\` at a suitable point.
44
+ See https://reselect.js.org/api/development-only-checks#cachesizecheck for details.`,
45
+ { stack }
46
+ );
77
47
  };
78
48
  var globalDevModeChecks = {
79
49
  inputStabilityCheck: "once",
80
- identityFunctionCheck: "once"
81
- };
82
- function assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {
83
- if (typeof func !== "function") {
84
- throw new TypeError(errorMessage);
85
- }
86
- }
87
- function assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {
88
- if (!array.every((item) => typeof item === "function")) {
89
- const itemTypes = array.map(
90
- (item) => typeof item === "function" ? `function ${item.name || "unnamed"}()` : typeof item
91
- ).join(", ");
92
- throw new TypeError(`${errorMessage}[${itemTypes}]`);
93
- }
94
- }
95
- var ensureIsArray = (item) => {
96
- return Array.isArray(item) ? item : [item];
97
- };
98
- function getDependencies(createSelectorArgs) {
99
- const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;
100
- assertIsArrayOfFunctions(
101
- dependencies,
102
- `createSelector expects all input-selectors to be functions, but received the following types: `
103
- );
104
- return dependencies;
105
- }
106
- function collectInputSelectorResults(dependencies, inputSelectorArgs) {
107
- const inputSelectorResults = [];
108
- const { length } = dependencies;
109
- for (let i = 0; i < length; i++) {
110
- inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));
111
- }
112
- return inputSelectorResults;
113
- }
114
- var getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {
115
- const { identityFunctionCheck, inputStabilityCheck } = {
116
- ...globalDevModeChecks,
117
- ...devModeChecks
118
- };
119
- return {
120
- identityFunctionCheck: {
121
- shouldRun: identityFunctionCheck === "always" || identityFunctionCheck === "once" && firstRun,
122
- run: runIdentityFunctionCheck
123
- },
124
- inputStabilityCheck: {
125
- shouldRun: inputStabilityCheck === "always" || inputStabilityCheck === "once" && firstRun,
126
- run: runInputStabilityCheck
127
- }
128
- };
50
+ identityFunctionCheck: "once",
51
+ cacheSizeCheck: "once"
129
52
  };
130
53
  var StrongRef = class {
131
54
  constructor(value) {
@@ -155,9 +78,25 @@ function maybeDeref(r) {
155
78
  }
156
79
  function weakMapMemoize(func, options = {}) {
157
80
  let fnNode = createCacheNode();
158
- const { resultEqualityCheck } = options;
81
+ const { resultEqualityCheck, maxSize } = options;
82
+ const useGenerations = maxSize !== void 0;
83
+ if (useGenerations && (!Number.isInteger(maxSize) || maxSize < 1)) {
84
+ throw new TypeError(
85
+ `maxSize must be a positive integer, received: ${maxSize}`
86
+ );
87
+ }
88
+ let prevNode = null;
89
+ let insertionCount = 0;
159
90
  let lastResult;
160
91
  let resultsCount = 0;
92
+ let hasWarnedAboutCacheSize = false;
93
+ function maybeFlipGenerations() {
94
+ if (insertionCount >= maxSize) {
95
+ prevNode = fnNode;
96
+ fnNode = createCacheNode();
97
+ insertionCount = 0;
98
+ }
99
+ }
161
100
  function memoized() {
162
101
  let cacheNode = fnNode;
163
102
  const { length } = arguments;
@@ -184,35 +123,77 @@ function weakMapMemoize(func, options = {}) {
184
123
  if (primitiveNode === void 0) {
185
124
  cacheNode = createCacheNode();
186
125
  primitiveCache.set(arg, cacheNode);
126
+ insertionCount++;
127
+ if (process.env.NODE_ENV !== "production") {
128
+ if (primitiveCache.size > CACHE_SIZE_CHECK_THRESHOLD) {
129
+ const { cacheSizeCheck } = globalDevModeChecks;
130
+ if (cacheSizeCheck === "always" || cacheSizeCheck === "once" && !hasWarnedAboutCacheSize) {
131
+ hasWarnedAboutCacheSize = true;
132
+ runCacheSizeCheck(primitiveCache.size, func.name);
133
+ }
134
+ }
135
+ }
187
136
  } else {
188
137
  cacheNode = primitiveNode;
189
138
  }
190
139
  }
191
140
  }
192
- const terminatedNode = cacheNode;
193
- let result;
194
141
  if (cacheNode.s === TERMINATED) {
195
- result = cacheNode.v;
196
- } else {
197
- result = func.apply(null, arguments);
198
- resultsCount++;
199
- if (resultEqualityCheck) {
200
- const lastResultValue = maybeDeref(lastResult);
201
- if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {
202
- result = lastResultValue;
203
- resultsCount !== 0 && resultsCount--;
142
+ return cacheNode.v;
143
+ }
144
+ if (prevNode !== null) {
145
+ let prevCacheNode = prevNode;
146
+ for (let i = 0, l = length; i < l; i++) {
147
+ const arg = arguments[i];
148
+ let next;
149
+ if (typeof arg === "function" || typeof arg === "object" && arg !== null) {
150
+ const prevObjectCache = prevCacheNode.o;
151
+ next = prevObjectCache !== null ? prevObjectCache.get(arg) : void 0;
152
+ } else {
153
+ const prevPrimitiveCache = prevCacheNode.p;
154
+ next = prevPrimitiveCache !== null ? prevPrimitiveCache.get(arg) : void 0;
155
+ }
156
+ if (next === void 0) {
157
+ prevCacheNode = null;
158
+ break;
204
159
  }
205
- const needsWeakRef = typeof result === "object" && result !== null || typeof result === "function";
206
- lastResult = needsWeakRef ? /* @__PURE__ */ new Ref(result) : result;
160
+ prevCacheNode = next;
161
+ }
162
+ if (prevCacheNode !== null && prevCacheNode.s === TERMINATED) {
163
+ const promotedNode = cacheNode;
164
+ promotedNode.s = TERMINATED;
165
+ promotedNode.v = prevCacheNode.v;
166
+ maybeFlipGenerations();
167
+ return prevCacheNode.v;
207
168
  }
208
169
  }
170
+ const terminatedNode = cacheNode;
171
+ let result = func.apply(null, arguments);
172
+ resultsCount++;
173
+ if (resultEqualityCheck) {
174
+ const lastResultValue = maybeDeref(lastResult);
175
+ if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {
176
+ result = lastResultValue;
177
+ resultsCount !== 0 && resultsCount--;
178
+ }
179
+ const needsWeakRef = typeof result === "object" && result !== null || typeof result === "function";
180
+ lastResult = needsWeakRef ? /* @__PURE__ */ new Ref(result) : result;
181
+ }
209
182
  terminatedNode.s = TERMINATED;
210
183
  terminatedNode.v = result;
184
+ if (useGenerations) {
185
+ maybeFlipGenerations();
186
+ }
211
187
  return result;
212
188
  }
213
189
  memoized.clearCache = () => {
214
190
  fnNode = createCacheNode();
191
+ prevNode = null;
192
+ insertionCount = 0;
215
193
  memoized.resetResultsCount();
194
+ if (process.env.NODE_ENV !== "production") {
195
+ hasWarnedAboutCacheSize = false;
196
+ }
216
197
  };
217
198
  memoized.resultsCount = () => resultsCount;
218
199
  memoized.resetResultsCount = () => {
@@ -220,6 +201,98 @@ function weakMapMemoize(func, options = {}) {
220
201
  };
221
202
  return memoized;
222
203
  }
204
+ var runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {
205
+ if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {
206
+ let isInputSameAsOutput = false;
207
+ try {
208
+ const emptyObject = {};
209
+ if (resultFunc(emptyObject) === emptyObject) isInputSameAsOutput = true;
210
+ } catch {
211
+ }
212
+ if (isInputSameAsOutput) {
213
+ let stack = void 0;
214
+ try {
215
+ throw new Error();
216
+ } catch (e) {
217
+ ;
218
+ ({ stack } = e);
219
+ }
220
+ console.warn(
221
+ "The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",
222
+ { stack }
223
+ );
224
+ }
225
+ }
226
+ };
227
+ var withoutResultEqualityCheck = (option) => {
228
+ if (option === null || typeof option !== "object" || !("resultEqualityCheck" in option)) {
229
+ return option;
230
+ }
231
+ const optionCopy = { ...option };
232
+ delete optionCopy.resultEqualityCheck;
233
+ return optionCopy;
234
+ };
235
+ var runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {
236
+ const { memoize, memoizeOptions } = options;
237
+ const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;
238
+ const probeMemoizeOptions = [];
239
+ const { length } = memoizeOptions;
240
+ for (let i = 0; i < length; i++) {
241
+ probeMemoizeOptions.push(withoutResultEqualityCheck(memoizeOptions[i]));
242
+ }
243
+ const createAnEmptyObject = memoize(() => ({}), ...probeMemoizeOptions);
244
+ const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);
245
+ if (!areInputSelectorResultsEqual) {
246
+ let stack = void 0;
247
+ try {
248
+ throw new Error();
249
+ } catch (e) {
250
+ ;
251
+ ({ stack } = e);
252
+ }
253
+ console.warn(
254
+ "An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",
255
+ {
256
+ arguments: inputSelectorArgs,
257
+ firstInputs: inputSelectorResults,
258
+ secondInputs: inputSelectorResultsCopy,
259
+ stack
260
+ }
261
+ );
262
+ }
263
+ };
264
+ function assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {
265
+ if (typeof func !== "function") {
266
+ throw new TypeError(errorMessage);
267
+ }
268
+ }
269
+ function assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {
270
+ if (!array.every((item) => typeof item === "function")) {
271
+ const itemTypes = array.map(
272
+ (item) => typeof item === "function" ? `function ${item.name || "unnamed"}()` : typeof item
273
+ ).join(", ");
274
+ throw new TypeError(`${errorMessage}[${itemTypes}]`);
275
+ }
276
+ }
277
+ var ensureIsArray = (item) => {
278
+ return Array.isArray(item) ? item : [item];
279
+ };
280
+ function getDependencies(createSelectorArgs) {
281
+ const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;
282
+ assertIsArrayOfFunctions(
283
+ dependencies,
284
+ `createSelector expects all input-selectors to be functions, but received the following types: `
285
+ );
286
+ return dependencies;
287
+ }
288
+ function collectInputSelectorResults(dependencies, inputSelectorArgs) {
289
+ const inputSelectorResults = [];
290
+ const { length } = dependencies;
291
+ for (let i = 0; i < length; i++) {
292
+ inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));
293
+ }
294
+ return inputSelectorResults;
295
+ }
223
296
  function createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {
224
297
  const createSelectorCreatorOptions = typeof memoizeOrOptions === "function" ? {
225
298
  memoize: memoizeOrOptions,
@@ -262,27 +335,35 @@ function createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {
262
335
  let firstRun = true;
263
336
  const selector = argsMemoize(function dependenciesChecker() {
264
337
  dependencyRecomputations++;
265
- const inputSelectorResults = collectInputSelectorResults(
266
- dependencies,
267
- arguments
268
- );
338
+ const { length } = dependencies;
339
+ const inputSelectorResults = new Array(length);
340
+ for (let i = 0; i < length; i++) {
341
+ inputSelectorResults[i] = dependencies[i].apply(null, arguments);
342
+ }
269
343
  lastResult = memoizedResultFunc.apply(null, inputSelectorResults);
270
344
  if (process.env.NODE_ENV !== "production") {
271
- const { devModeChecks = {} } = combinedOptions;
272
- const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);
273
- if (identityFunctionCheck.shouldRun) {
274
- identityFunctionCheck.run(
345
+ const { devModeChecks } = combinedOptions;
346
+ const identityFunctionCheck = devModeChecks !== void 0 && Object.prototype.hasOwnProperty.call(
347
+ devModeChecks,
348
+ "identityFunctionCheck"
349
+ ) ? devModeChecks.identityFunctionCheck : globalDevModeChecks.identityFunctionCheck;
350
+ const inputStabilityCheck = devModeChecks !== void 0 && Object.prototype.hasOwnProperty.call(
351
+ devModeChecks,
352
+ "inputStabilityCheck"
353
+ ) ? devModeChecks.inputStabilityCheck : globalDevModeChecks.inputStabilityCheck;
354
+ if (identityFunctionCheck === "always" || identityFunctionCheck === "once" && firstRun) {
355
+ runIdentityFunctionCheck(
275
356
  resultFunc,
276
357
  inputSelectorResults,
277
358
  lastResult
278
359
  );
279
360
  }
280
- if (inputStabilityCheck.shouldRun) {
361
+ if (inputStabilityCheck === "always" || inputStabilityCheck === "once" && firstRun) {
281
362
  const inputSelectorResultsCopy = collectInputSelectorResults(
282
363
  dependencies,
283
364
  arguments
284
365
  );
285
- inputStabilityCheck.run(
366
+ runInputStabilityCheck(
286
367
  { inputSelectorResults, inputSelectorResultsCopy },
287
368
  { memoize, memoizeOptions: finalMemoizeOptions },
288
369
  arguments
@@ -0,0 +1,109 @@
1
+ import {
2
+ mergeAvailabilityDeadline
3
+ } from "./chunk-QUK7UZW7.js";
4
+
5
+ // packages/cli/credentialAvailability.ts
6
+ import { homedir } from "node:os";
7
+ import { join } from "node:path";
8
+ import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
9
+ var FILE_NAME = "credential-availability.json";
10
+ function resolveNoloHome(env = process.env) {
11
+ return env.NOLO_HOME?.trim() || join(homedir(), ".nolo");
12
+ }
13
+ function resolveCredentialAvailabilityPath(env = process.env) {
14
+ return join(resolveNoloHome(env), FILE_NAME);
15
+ }
16
+ function resolveCredentialKey(agent) {
17
+ if (!agent || typeof agent !== "object") return void 0;
18
+ for (const field of ["apiKeyRef", "credentialRef"]) {
19
+ const value = agent[field];
20
+ if (typeof value === "string") {
21
+ const trimmed = value.trim();
22
+ if (trimmed) return trimmed;
23
+ }
24
+ }
25
+ return void 0;
26
+ }
27
+ function parseFile(raw) {
28
+ const parsed = JSON.parse(raw);
29
+ if (!parsed || typeof parsed !== "object") return { entries: {} };
30
+ const entries = parsed.entries;
31
+ if (!entries || typeof entries !== "object") return { entries: {} };
32
+ return { entries };
33
+ }
34
+ async function readCredentialAvailability(env = process.env, now = Date.now()) {
35
+ const path = resolveCredentialAvailabilityPath(env);
36
+ let raw;
37
+ try {
38
+ raw = await readFile(path, "utf8");
39
+ } catch {
40
+ return {};
41
+ }
42
+ let file;
43
+ try {
44
+ file = parseFile(raw);
45
+ } catch {
46
+ return {};
47
+ }
48
+ const live = {};
49
+ for (const [key, entry] of Object.entries(file.entries)) {
50
+ const at = entry?.nextAvailableAt;
51
+ if (typeof at === "number" && Number.isFinite(at) && at > now) {
52
+ live[key] = at;
53
+ }
54
+ }
55
+ return live;
56
+ }
57
+ async function writeCredentialAvailability(live, env = process.env) {
58
+ const path = resolveCredentialAvailabilityPath(env);
59
+ await mkdir(resolveNoloHome(env), { recursive: true }).catch(() => void 0);
60
+ const file = {
61
+ entries: Object.fromEntries(
62
+ Object.entries(live).map(([key, at]) => [key, { nextAvailableAt: at }])
63
+ )
64
+ };
65
+ const tmp = `${path}.tmp-${process.pid}-${Date.now()}`;
66
+ await writeFile(tmp, `${JSON.stringify(file, null, 2)}
67
+ `, "utf8");
68
+ await rename(tmp, path);
69
+ }
70
+ async function markCredentialUnavailable(credentialKey, nextAvailableAt, env = process.env, now = Date.now()) {
71
+ if (!credentialKey) return;
72
+ const live = await readCredentialAvailability(env, now);
73
+ const merged = mergeAvailabilityDeadline(live[credentialKey], nextAvailableAt);
74
+ if (typeof merged !== "number" || !Number.isFinite(merged)) return;
75
+ live[credentialKey] = merged;
76
+ await writeCredentialAvailability(live, env);
77
+ }
78
+ async function clearCredentialAvailability(credentialKey, env = process.env, now = Date.now()) {
79
+ if (!credentialKey) return;
80
+ const live = await readCredentialAvailability(env, now);
81
+ if (!(credentialKey in live)) return;
82
+ delete live[credentialKey];
83
+ await writeCredentialAvailability(live, env);
84
+ }
85
+ function applyCredentialAvailability(agents, credentialAvailability) {
86
+ if (Object.keys(credentialAvailability).length === 0) return agents;
87
+ return agents.map((agent) => {
88
+ const key = resolveCredentialKey(agent);
89
+ if (!key) return agent;
90
+ const at = credentialAvailability[key];
91
+ if (typeof at !== "number") return agent;
92
+ const merged = mergeAvailabilityDeadline(
93
+ agent.nextAvailableAt,
94
+ at
95
+ );
96
+ if (typeof merged !== "number" || merged === agent.nextAvailableAt) {
97
+ return agent;
98
+ }
99
+ return { ...agent, nextAvailableAt: merged };
100
+ });
101
+ }
102
+
103
+ export {
104
+ resolveCredentialKey,
105
+ readCredentialAvailability,
106
+ markCredentialUnavailable,
107
+ clearCredentialAvailability,
108
+ applyCredentialAvailability
109
+ };
@@ -23,7 +23,7 @@ import {
23
23
  shouldStripReasoningContentForOutbound,
24
24
  toOpenAiCompatibleMessages,
25
25
  toResponsesTools
26
- } from "./chunk-NNWHHCVP.js";
26
+ } from "./chunk-LI6SNQF6.js";
27
27
  import {
28
28
  buildProviderExecutionPlan,
29
29
  canUsePlatformChatProvider,
@@ -32,10 +32,10 @@ import {
32
32
  resolvePlatformAuthToken,
33
33
  resolvePlatformServerUrl,
34
34
  resolveProviderTransportDecision
35
- } from "./chunk-AFV4FOT2.js";
35
+ } from "./chunk-3GDKZAPT.js";
36
36
  import {
37
37
  clipCompactText
38
- } from "./chunk-AOXVOC6D.js";
38
+ } from "./chunk-W2DNU6FK.js";
39
39
  import {
40
40
  isRecord
41
41
  } from "./chunk-KUG52IAP.js";
@@ -339,15 +339,22 @@ async function* readSseFrames(response) {
339
339
  const { done, value } = await reader.read();
340
340
  if (done) break;
341
341
  buffer += decoder.decode(value, { stream: true });
342
- let boundary = buffer.indexOf("\n\n");
343
- while (boundary !== -1) {
344
- yield buffer.slice(0, boundary);
345
- buffer = buffer.slice(boundary + 2);
346
- boundary = buffer.indexOf("\n\n");
342
+ let boundary = findSseFrameBoundary(buffer);
343
+ while (boundary) {
344
+ yield buffer.slice(0, boundary.index);
345
+ buffer = buffer.slice(boundary.index + boundary.separatorLength);
346
+ boundary = findSseFrameBoundary(buffer);
347
347
  }
348
348
  }
349
349
  if (buffer.trim()) yield buffer;
350
350
  }
351
+ function findSseFrameBoundary(buffer) {
352
+ const lfLf = buffer.indexOf("\n\n");
353
+ const crLfCrLf = buffer.indexOf("\r\n\r\n");
354
+ if (lfLf === -1 && crLfCrLf === -1) return null;
355
+ const useLf = lfLf !== -1 && (crLfCrLf === -1 || lfLf < crLfCrLf);
356
+ return useLf ? { index: lfLf, separatorLength: 2 } : { index: crLfCrLf, separatorLength: 4 };
357
+ }
351
358
  async function* streamSseDataValues(response, parse) {
352
359
  const reader = response.body?.getReader();
353
360
  if (!reader) return;