nolo-cli 0.228.0-alpha.1 → 0.228.0-alpha.2

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 (81) hide show
  1. package/{_executeModel-WZKT6XEU.js → _executeModel-VYCHHZVT.js} +18 -16
  2. package/{agentDeleteCommand-PZWRHNXY.js → agentDeleteCommand-QWQKT54A.js} +24 -22
  3. package/{agentEmailCommands-QTKMEICX.js → agentEmailCommands-EISMBIRE.js} +24 -22
  4. package/{agentListCommands-GUGMORTK.js → agentListCommands-4WLG32IW.js} +23 -415
  5. package/{agentMachineCommands-7QGICJLM.js → agentMachineCommands-DC6NKWTU.js} +12 -11
  6. package/{agentRecordCommands-SLLADS5C.js → agentRecordCommands-IZYUVHME.js} +24 -22
  7. package/{agentRunCommand-OFQLOF5Y.js → agentRunCommand-QM7ETUTX.js} +25 -23
  8. package/{agentRuntimeLocal-TU4LA353.js → agentRuntimeLocal-HOXKWCYO.js} +9 -8
  9. package/{agentSlice-L4SBGWTB.js → agentSlice-UG76KEBH.js} +1 -1
  10. package/{appDeleteCommands-JWP3XPUA.js → appDeleteCommands-WWCC6WA5.js} +13 -12
  11. package/{appDeployCommands-6E4TQCWI.js → appDeployCommands-AU4IUN33.js} +13 -12
  12. package/{appDeployStatusCommands-ALU4SADG.js → appDeployStatusCommands-STUW7WXL.js} +13 -12
  13. package/{appGetCommands-JEY4L6L4.js → appGetCommands-BGTLIQ4K.js} +13 -12
  14. package/{appListCommands-PCAVHU7M.js → appListCommands-CUCPRUXW.js} +13 -12
  15. package/{authCommand-CGRIIOOV.js → authCommand-OZ2KTP4Z.js} +2 -2
  16. package/{chunk-JUSHVFNF.js → chunk-3QIYD3VM.js} +414 -342
  17. package/{chunk-H6L2NFHY.js → chunk-3VZLEKV2.js} +2 -2
  18. package/{chunk-3P54D2E4.js → chunk-42OKN2LI.js} +1 -1
  19. package/{chunk-EXJK7TQO.js → chunk-45CAVC35.js} +43 -288
  20. package/{chunk-SMJEXX2S.js → chunk-4QYJPWHH.js} +2 -2
  21. package/{chunk-Q3IVPFVO.js → chunk-5YMA6DDZ.js} +1 -1
  22. package/{chunk-R3NEQZ53.js → chunk-7BCG67EI.js} +8 -8
  23. package/{chunk-CYWNWA77.js → chunk-7FEP5USX.js} +6 -3
  24. package/{chunk-GACR7H6T.js → chunk-CNMY2XM6.js} +2 -2
  25. package/{chunk-STJ6LSQE.js → chunk-DLXMMTGM.js} +82 -21
  26. package/{chunk-MDZWUD3R.js → chunk-EGHP7KOY.js} +3 -3
  27. package/{chunk-AGYPUBFW.js → chunk-FPBJM2BW.js} +4 -1
  28. package/{chunk-IXG6YXQM.js → chunk-GAYNXB6T.js} +51 -40
  29. package/{chunk-XJPLSAPJ.js → chunk-HF7BLF3F.js} +2 -2
  30. package/{chunk-GYS5FUYR.js → chunk-HXB4VDGK.js} +1 -1
  31. package/{chunk-BNMPUQW6.js → chunk-JQZRSXS5.js} +23 -23
  32. package/{chunk-VSYTM22R.js → chunk-LYD6C7OU.js} +2 -2
  33. package/{chunk-QBZCGP34.js → chunk-M3OZRQNH.js} +1 -1
  34. package/{chunk-DDC6P6EH.js → chunk-MJI3UAXN.js} +34 -10
  35. package/{chunk-RYOLWYBK.js → chunk-MNEZUL5S.js} +16 -1
  36. package/{chunk-GOCSSER3.js → chunk-MZG5CETE.js} +2 -2
  37. package/{chunk-QCB42576.js → chunk-OJ45MEEI.js} +1 -1
  38. package/{chunk-UE2EVEYS.js → chunk-OTKSESZR.js} +2 -2
  39. package/{chunk-NHY322ZU.js → chunk-RRDRQOEC.js} +508 -2
  40. package/{chunk-2MCB7CD7.js → chunk-TCZ2VJZQ.js} +3 -3
  41. package/{chunk-D6YNCNM6.js → chunk-TQEKUOTI.js} +2 -2
  42. package/{chunk-2NPD3FTX.js → chunk-U2HBB7RS.js} +14 -14
  43. package/{chunk-AUAJTAFM.js → chunk-VQ5N5GSV.js} +1 -1
  44. package/{chunk-K67C2JUC.js → chunk-WCFFRBL5.js} +3 -3
  45. package/{chunk-GPOV42YM.js → chunk-WFDNADFX.js} +1 -1
  46. package/chunk-WFGNWWJI.js +326 -0
  47. package/{chunk-OYU2MA5S.js → chunk-X3E6EHJW.js} +9 -8
  48. package/{chunk-GUXZK7SE.js → chunk-XAG3FWBE.js} +11 -0
  49. package/{chunk-OG6MQOQG.js → chunk-XFXFPUO7.js} +2 -2
  50. package/{chunk-UWAIJOF2.js → chunk-XTJKU3Z4.js} +4 -4
  51. package/{chunk-IAAIUH64.js → chunk-YVFH2MFB.js} +3 -3
  52. package/{chunk-TGNIKIHR.js → chunk-ZEVQHCLM.js} +1 -1
  53. package/{cliLocalAgentRecordReader-M3F76NIP.js → cliLocalAgentRecordReader-H3HYQRRR.js} +11 -10
  54. package/{commandRegistry-ZLWHQVAI.js → commandRegistry-FVYPE2IN.js} +47 -47
  55. package/{contentThunks-4ZX2TO7C.js → contentThunks-GNFPG32S.js} +3 -3
  56. package/{createAgentAutomationAction-L4CYUZJG.js → createAgentAutomationAction-PB4QIFQ4.js} +3 -3
  57. package/{createDialogAction-QTU2R2Q3.js → createDialogAction-EVTOPY7A.js} +4 -4
  58. package/{createPageAction-F3GJTHW2.js → createPageAction-2UYF2IDZ.js} +4 -4
  59. package/{dialogCommands-NRLCOPJR.js → dialogCommands-6SZD4TYP.js} +13 -12
  60. package/{dialogSlice-P2S4LXQD.js → dialogSlice-5EQ2A6LY.js} +2 -2
  61. package/{docCreateCommands-YJRDA3RX.js → docCreateCommands-25E6PGN3.js} +12 -11
  62. package/{docDeleteCommands-A5QIHZNF.js → docDeleteCommands-F7ZVGEHW.js} +13 -12
  63. package/{docReadCommands-CF2LTMYH.js → docReadCommands-JY2E5XEN.js} +12 -11
  64. package/{docStore-6O7NYL6A.js → docStore-OKKIKLT3.js} +1 -1
  65. package/{docUpdateCommands-QRKV4ZXE.js → docUpdateCommands-OZ4CUSIQ.js} +12 -11
  66. package/{handleSendMessageAction-7IHLR37A.js → handleSendMessageAction-LNT7SZND.js} +12 -11
  67. package/{hostCredentialCreate-VNCQUAFT.js → hostCredentialCreate-XUU2CSHI.js} +24 -22
  68. package/index.js +3 -3
  69. package/{localRuntimeAdapter-FOWVNMIK.js → localRuntimeAdapter-IBSTMSX7.js} +23 -21
  70. package/{machineCommands-ZGC3J4JB.js → machineCommands-HSQHDHOT.js} +41 -24
  71. package/{machineWsRunDispatch-KK5U4M3G.js → machineWsRunDispatch-L6H7J66T.js} +24 -22
  72. package/package.json +1 -1
  73. package/{projectArchive-7ZDYBXAX.js → projectArchive-FQO654Z3.js} +4 -4
  74. package/{readlineWorkspace-YHT4SX2C.js → readlineWorkspace-7U272DSA.js} +36 -33
  75. package/{runAgentClientLoop-H4ED5V3K.js → runAgentClientLoop-AF4JQIJ7.js} +16 -14
  76. package/{skillDiscovery-I37M5KJC.js → skillDiscovery-BHHPCUHZ.js} +3 -3
  77. package/{spaceCommands-MEH3HJBC.js → spaceCommands-5VNWMDBE.js} +12 -11
  78. package/{streamAgentChatTurn-ZXPOXU33.js → streamAgentChatTurn-YSPEFY4K.js} +24 -21
  79. package/{tools-2MRWA2PP.js → tools-M35PTIFB.js} +11 -9
  80. package/{updateDialogTitleAction-RZ3KZSGQ.js → updateDialogTitleAction-IMIRJRQQ.js} +3 -3
  81. package/chunk-2WZXXAQD.js +0 -57
@@ -1,15 +1,23 @@
1
+ import {
2
+ resolveObservedSpeed
3
+ } from "./chunk-AMWMV56B.js";
1
4
  import {
2
5
  fnv1a32Hex
3
6
  } from "./chunk-UEILX4EV.js";
4
7
  import {
5
8
  compareAgentSelection,
6
9
  resolveModelTier
7
- } from "./chunk-RYOLWYBK.js";
10
+ } from "./chunk-MNEZUL5S.js";
8
11
  import {
9
12
  DEFAULT_PROVIDER_RETRY_MS,
10
13
  isAgentUnavailableNow,
11
14
  resolveAgentAvailability
12
15
  } from "./chunk-QJTZ76CP.js";
16
+ import {
17
+ LIST_AGENTS_PAGE_BUDGET,
18
+ sanitizeToolOutputText,
19
+ scrubSecrets
20
+ } from "./chunk-WFGNWWJI.js";
13
21
  import {
14
22
  isOAuthApiKeyRef
15
23
  } from "./chunk-UKZX3NHN.js";
@@ -18,6 +26,10 @@ import {
18
26
  ownedAgentKey,
19
27
  publicAgentKey
20
28
  } from "./chunk-M2EJHDJP.js";
29
+ import {
30
+ createKey,
31
+ createTokenKey
32
+ } from "./chunk-SYTHYBMI.js";
21
33
  import {
22
34
  getModelAbility
23
35
  } from "./chunk-62HXNQVV.js";
@@ -888,6 +900,7 @@ function buildAgentDiscoveryResult(options) {
888
900
  ...typeof limit === "number" ? { limit } : {},
889
901
  ...isTruncated ? { truncated: true } : {},
890
902
  unavailableCount,
903
+ availableCount: sortedAgents.length,
891
904
  agents: projectedAgents,
892
905
  planningRecommendation: recommendPlanning(
893
906
  sortedAgents,
@@ -902,6 +915,498 @@ function toDiscoverySafeAgentSummary(record, options) {
902
915
  return toSafeAgentSummary(record, mergedOptions);
903
916
  }
904
917
 
918
+ // packages/ai/agent/speedSampleCache.ts
919
+ var SPEED_SAMPLE_DISK_CACHE_TTL_MS = 10 * 6e4;
920
+ var SPEED_SAMPLE_SCAN_BUDGET_MS = 2500;
921
+ var SPEED_SAMPLE_CACHE_VERSION = 4;
922
+ var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
923
+ var sanitizeSample = (value) => {
924
+ if (!value || typeof value !== "object") return null;
925
+ const sample = value;
926
+ const clean = {};
927
+ if (isFiniteNumber(sample.firstOutputMs)) clean.firstOutputMs = sample.firstOutputMs;
928
+ if (isFiniteNumber(sample.callDurationMs)) clean.callDurationMs = sample.callDurationMs;
929
+ if (isFiniteNumber(sample.output_tokens)) clean.output_tokens = sample.output_tokens;
930
+ if (isFiniteNumber(sample.t)) clean.t = sample.t;
931
+ return clean.firstOutputMs === void 0 && clean.callDurationMs === void 0 ? null : clean;
932
+ };
933
+ var SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS = 7 * 24 * 60 * 6e4;
934
+ async function parseCacheFile(cachePath, userId) {
935
+ try {
936
+ const fs = await import("node:fs/promises");
937
+ const raw = await fs.readFile(cachePath, "utf8");
938
+ const parsed = JSON.parse(raw);
939
+ if (!parsed || typeof parsed !== "object") return null;
940
+ const version = parsed.version;
941
+ if (version !== SPEED_SAMPLE_CACHE_VERSION) {
942
+ return null;
943
+ }
944
+ if (parsed.userId !== userId) return null;
945
+ if (!isFiniteNumber(parsed.at)) return null;
946
+ const source = parsed.samples;
947
+ if (!source || typeof source !== "object") return null;
948
+ const samples = /* @__PURE__ */ new Map();
949
+ for (const [model, list] of Object.entries(source)) {
950
+ if (!model || !Array.isArray(list)) continue;
951
+ const cleaned = [];
952
+ for (const entry of list) {
953
+ const sample = sanitizeSample(entry);
954
+ if (sample) cleaned.push(sample);
955
+ }
956
+ samples.set(model, cleaned);
957
+ }
958
+ const complete = parsed.complete === true;
959
+ const cursor = typeof parsed.cursor === "string" && parsed.cursor.length > 0 ? parsed.cursor : void 0;
960
+ return { samples, at: parsed.at, complete, cursor: complete ? void 0 : cursor };
961
+ } catch {
962
+ return null;
963
+ }
964
+ }
965
+ async function readSpeedSamplesSnapshot(cachePath, options) {
966
+ const maxAgeMs = isFiniteNumber(options.maxAgeMs) ? options.maxAgeMs : SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS;
967
+ const parsed = await parseCacheFile(cachePath, options.userId);
968
+ if (!parsed || !parsed.complete) return null;
969
+ const age = options.now - parsed.at;
970
+ if (age < 0 || age >= maxAgeMs) return null;
971
+ return { samples: parsed.samples, ageMs: age };
972
+ }
973
+ async function readSpeedSamplesProgress(cachePath, userId) {
974
+ const parsed = await parseCacheFile(cachePath, userId);
975
+ if (!parsed) return null;
976
+ return {
977
+ samples: parsed.samples,
978
+ at: parsed.at,
979
+ complete: parsed.complete,
980
+ ...parsed.cursor === void 0 ? {} : { cursor: parsed.cursor }
981
+ };
982
+ }
983
+ function resolveSpeedSamplesProgressPath(cachePath) {
984
+ return `${cachePath}.progress`;
985
+ }
986
+ async function writeSpeedSamplesCache(cachePath, payload) {
987
+ try {
988
+ const fs = await import("node:fs/promises");
989
+ const path = await import("node:path");
990
+ await fs.mkdir(path.dirname(cachePath), { recursive: true });
991
+ const tmpPath = `${cachePath}.tmp-${process.pid}-${Math.random().toString(36).slice(2, 8)}`;
992
+ await fs.writeFile(tmpPath, JSON.stringify(payload), "utf8");
993
+ await fs.rename(tmpPath, cachePath);
994
+ } catch {
995
+ }
996
+ }
997
+
998
+ // packages/ai/agent/candidateSpeedContext.ts
999
+ var OBSERVED_SPEED_WINDOW = 50;
1000
+ var MIN_OBSERVED_FIRST_OUTPUT_SAMPLES = 5;
1001
+ var SPEED_SAMPLES_CACHE_TTL_MS = 5 * 6e4;
1002
+ var SPEED_SAMPLES_CACHE_MAX_ENTRIES = 500;
1003
+ function normalizeSpeedModelName(raw) {
1004
+ const name = raw.trim().toLowerCase();
1005
+ const slash = name.lastIndexOf("/");
1006
+ return slash === -1 ? name : name.slice(slash + 1);
1007
+ }
1008
+ var isFiniteNumber2 = (value) => typeof value === "number" && Number.isFinite(value);
1009
+ var REASONING_EFFORT_SUFFIXES = ["minimal", "low", "medium", "high", "xhigh"];
1010
+ var REASONING_EFFORT_SUFFIX_RE = new RegExp(`-(?:${REASONING_EFFORT_SUFFIXES.join("|")})$`);
1011
+ function stripReasoningEffortSuffix(model) {
1012
+ const base = model.replace(REASONING_EFFORT_SUFFIX_RE, "");
1013
+ return base && base !== model ? base : null;
1014
+ }
1015
+ function resolveOneBare(model, samplesByModel) {
1016
+ const observed = resolveObservedSpeed(samplesByModel.get(model) ?? [], {
1017
+ limit: OBSERVED_SPEED_WINDOW
1018
+ });
1019
+ if (observed.firstOutputSampleCount >= MIN_OBSERVED_FIRST_OUTPUT_SAMPLES && observed.medianFirstOutputMs !== void 0) {
1020
+ return {
1021
+ source: "observed",
1022
+ firstOutputMs: observed.medianFirstOutputMs,
1023
+ ...observed.medianOutputTokensPerSecond !== void 0 ? { outputTps: observed.medianOutputTokensPerSecond } : {},
1024
+ firstOutputSamples: observed.firstOutputSampleCount,
1025
+ tpsSamples: observed.throughputSampleCount
1026
+ };
1027
+ }
1028
+ return null;
1029
+ }
1030
+ function resolveOne(model, samplesByModel) {
1031
+ const direct = resolveOneBare(model, samplesByModel);
1032
+ if (direct) return { model, ...direct };
1033
+ const base = stripReasoningEffortSuffix(model);
1034
+ if (!base) return null;
1035
+ const stripped = resolveOneBare(base, samplesByModel);
1036
+ return stripped ? { model, ...stripped } : null;
1037
+ }
1038
+ function resolveCandidateSpeedFacts(models, samplesByModel) {
1039
+ const unique = [
1040
+ ...new Set(
1041
+ models.filter((model) => typeof model === "string").map(normalizeSpeedModelName).filter(Boolean)
1042
+ )
1043
+ ];
1044
+ return unique.map((model) => resolveOne(model, samplesByModel)).filter((fact) => fact !== null);
1045
+ }
1046
+ var formatSeconds = (ms) => `${(ms / 1e3).toFixed(1)}s`;
1047
+ var formatTps = (tps) => String(Math.round(tps));
1048
+ var SPEED_CONTEXT_HEADER = "speed (observed=\u672C\u7528\u6237\u5B9E\u6D4B\u8C03\u7528\u4E2D\u4F4D\u6570, firstOutput \u542B\u63A8\u7406\u8F93\u51FA; tps=generation\uFF08\u4E0D\u542B\u7AEF\u5230\u7AEF\u53E3\u5F84\uFF09, tps=n/a \u8868\u793A\u65E0\u53EF\u4FE1\u541E\u5410\u6837\u672C\u3002\u672A\u5217\u51FA\u7684 model \u8868\u793A\u6CA1\u6709\u5B9E\u6D4B\u6837\u672C\uFF0C\u4E0D\u4EE3\u8868\u6162):";
1049
+ function formatSnapshotAge(ageMs) {
1050
+ const minutes = Math.floor(ageMs / 6e4);
1051
+ if (minutes < 1) return "<1min";
1052
+ if (minutes < 60) return `${minutes}min`;
1053
+ const hours = Math.floor(minutes / 60);
1054
+ if (hours < 24) return `${hours}h`;
1055
+ return `${Math.floor(hours / 24)}d`;
1056
+ }
1057
+ function formatCandidateSpeedFacts(facts, options = {}) {
1058
+ if (facts.length === 0) return null;
1059
+ const lines = facts.map((fact) => {
1060
+ const tps = fact.outputTps !== void 0 ? formatTps(fact.outputTps) : "n/a";
1061
+ return ` ${fact.model}: firstOutput=${formatSeconds(fact.firstOutputMs ?? 0)} tps=${tps} [observed n=${fact.firstOutputSamples ?? 0} tpsN=${fact.tpsSamples ?? 0}]`;
1062
+ });
1063
+ const age = options.snapshotAgeMs;
1064
+ const note = typeof age === "number" && age > 0 ? ` (snapshot=${formatSnapshotAge(age)}\u524D\u91C7\u96C6\u7684\u5B8C\u6574\u7A97\u53E3, \u975E\u672C\u6B21\u5B9E\u65F6\u626B\u63CF)` : "";
1065
+ return `${SPEED_CONTEXT_HEADER}${note}
1066
+ ${lines.join("\n")}`;
1067
+ }
1068
+ function buildCandidateSpeedContext(models, samplesByModel, options = {}) {
1069
+ return formatCandidateSpeedFacts(resolveCandidateSpeedFacts(models, samplesByModel), options);
1070
+ }
1071
+ var SPEED_SAMPLE_PAGE_SIZE = 2e3;
1072
+ var DISPATCH_ENTRY_PATH = "agent-run";
1073
+ var eventTime = (value) => {
1074
+ if (isFiniteNumber2(value.timestamp)) return value.timestamp;
1075
+ if (isFiniteNumber2(value.createdAt)) return value.createdAt;
1076
+ return 0;
1077
+ };
1078
+ function collectSample(collected, value) {
1079
+ if (typeof value.model !== "string") return;
1080
+ if (!isFiniteNumber2(value.firstOutputMs) && !isFiniteNumber2(value.callDurationMs)) return;
1081
+ const model = normalizeSpeedModelName(value.model);
1082
+ if (!model) return;
1083
+ const list = collected.get(model) ?? [];
1084
+ list.push({
1085
+ t: eventTime(value),
1086
+ firstOutputMs: value.firstOutputMs,
1087
+ callDurationMs: value.callDurationMs,
1088
+ output_tokens: value.output_tokens
1089
+ });
1090
+ collected.set(model, list);
1091
+ }
1092
+ function finalizeSamples(collected, keepTime = false) {
1093
+ const result = /* @__PURE__ */ new Map();
1094
+ for (const [model, list] of collected) {
1095
+ list.sort((a, b) => b.t - a.t);
1096
+ const window = list.slice(0, OBSERVED_SPEED_WINDOW);
1097
+ result.set(
1098
+ model,
1099
+ keepTime ? window : window.map(({ t: _t, ...sample }) => sample)
1100
+ );
1101
+ }
1102
+ return result;
1103
+ }
1104
+ async function collectRecentSpeedSamples(db, userId, options = {}) {
1105
+ const pageSize = isFiniteNumber2(options.pageSize) && options.pageSize > 0 ? Math.floor(options.pageSize) : SPEED_SAMPLE_PAGE_SIZE;
1106
+ const budgetMs = isFiniteNumber2(options.budgetMs) ? options.budgetMs : Number.POSITIVE_INFINITY;
1107
+ const { start, end } = createTokenKey.rangeOfUser(userId);
1108
+ const failedPrefix = createKey("token", userId, "failed-call", "");
1109
+ const dispatchRunCache = /* @__PURE__ */ new Map();
1110
+ const isDispatchSampleRecord = async (record, resolver, cache) => {
1111
+ if (record.entry_path !== DISPATCH_ENTRY_PATH && record.entry_path !== "cli-local") return false;
1112
+ const runId = typeof record.dialogId === "string" ? record.dialogId.trim() : "";
1113
+ if (!runId) return false;
1114
+ const cacheKey = `${record.entry_path}:${runId}`;
1115
+ const cached = cache.get(cacheKey);
1116
+ if (cached !== void 0) return cached;
1117
+ let dispatch = false;
1118
+ if (resolver) {
1119
+ try {
1120
+ dispatch = await resolver(runId, record.entry_path) === true;
1121
+ } catch {
1122
+ dispatch = false;
1123
+ }
1124
+ }
1125
+ cache.set(cacheKey, dispatch);
1126
+ return dispatch;
1127
+ };
1128
+ const collected = /* @__PURE__ */ new Map();
1129
+ const startedAt = Date.now();
1130
+ let lastKey = options.startAfter;
1131
+ let budgetExhausted = false;
1132
+ let scanned = 0;
1133
+ while (true) {
1134
+ if (Date.now() - startedAt >= budgetMs) {
1135
+ budgetExhausted = true;
1136
+ break;
1137
+ }
1138
+ const pageOptions = {
1139
+ ...lastKey === void 0 ? { gte: start } : { gt: lastKey },
1140
+ lte: end,
1141
+ limit: pageSize
1142
+ };
1143
+ let accepted = 0;
1144
+ let newestKey = lastKey;
1145
+ for await (const [key, raw] of db.iterator(pageOptions)) {
1146
+ if (typeof key !== "string") continue;
1147
+ if (lastKey !== void 0 && key <= lastKey) continue;
1148
+ accepted += 1;
1149
+ scanned += 1;
1150
+ newestKey = key;
1151
+ if (key.startsWith(failedPrefix)) continue;
1152
+ if (!raw || typeof raw !== "object") continue;
1153
+ const record = raw;
1154
+ const resolver = options.isDispatchRun ?? db.isDispatchRun;
1155
+ if (!await isDispatchSampleRecord(
1156
+ record,
1157
+ resolver ? (runId, entryPath) => resolver.call(db, runId, entryPath) : void 0,
1158
+ dispatchRunCache
1159
+ ))
1160
+ continue;
1161
+ collectSample(collected, record);
1162
+ }
1163
+ if (accepted === 0 || accepted < pageSize) break;
1164
+ lastKey = newestKey;
1165
+ }
1166
+ return {
1167
+ samples: finalizeSamples(collected, options.keepTime === true),
1168
+ budgetExhausted,
1169
+ scanned,
1170
+ ...budgetExhausted && lastKey !== void 0 ? { nextCursor: lastKey } : {}
1171
+ };
1172
+ }
1173
+ function mergeNewestSamples(into, from) {
1174
+ for (const [model, list] of from) {
1175
+ const merged = [...into.get(model) ?? [], ...list];
1176
+ merged.sort(
1177
+ (a, b) => (b.t ?? 0) - (a.t ?? 0)
1178
+ );
1179
+ into.set(model, merged.slice(0, OBSERVED_SPEED_WINDOW));
1180
+ }
1181
+ }
1182
+ async function loadSpeedSamplesWithDiskCache(db, userId, now, cache) {
1183
+ try {
1184
+ const ttlMs = isFiniteNumber2(cache.ttlMs) ? cache.ttlMs : SPEED_SAMPLE_DISK_CACHE_TTL_MS;
1185
+ const snapshot = await readSpeedSamplesSnapshot(cache.cachePath, { userId, now });
1186
+ if (snapshot && snapshot.ageMs < ttlMs) return { samples: snapshot.samples };
1187
+ const progressPath = resolveSpeedSamplesProgressPath(cache.cachePath);
1188
+ const progress = await readSpeedSamplesProgress(progressPath, userId);
1189
+ const resumable = progress && !progress.complete && progress.cursor ? progress : void 0;
1190
+ const collected = new Map(resumable?.samples ?? []);
1191
+ let step;
1192
+ try {
1193
+ step = await collectRecentSpeedSamples(db, userId, {
1194
+ pageSize: cache.pageSize,
1195
+ budgetMs: isFiniteNumber2(cache.budgetMs) ? cache.budgetMs : SPEED_SAMPLE_SCAN_BUDGET_MS,
1196
+ keepTime: true,
1197
+ ...resumable?.cursor ? { startAfter: resumable.cursor } : {}
1198
+ });
1199
+ } catch {
1200
+ return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
1201
+ }
1202
+ if (!resumable && step.scanned === 0 && !step.budgetExhausted) {
1203
+ return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
1204
+ }
1205
+ mergeNewestSamples(collected, step.samples);
1206
+ if (!step.budgetExhausted) {
1207
+ await writeSpeedSamplesCache(cache.cachePath, {
1208
+ version: SPEED_SAMPLE_CACHE_VERSION,
1209
+ userId,
1210
+ at: now,
1211
+ complete: true,
1212
+ samples: Object.fromEntries(collected)
1213
+ });
1214
+ await writeSpeedSamplesCache(progressPath, {
1215
+ version: SPEED_SAMPLE_CACHE_VERSION,
1216
+ userId,
1217
+ at: now,
1218
+ complete: true,
1219
+ samples: {}
1220
+ });
1221
+ return { samples: collected };
1222
+ }
1223
+ await writeSpeedSamplesCache(progressPath, {
1224
+ version: SPEED_SAMPLE_CACHE_VERSION,
1225
+ userId,
1226
+ // Progress keeps the cycle's collection start so a later stale label stays honest.
1227
+ at: resumable?.at ?? now,
1228
+ complete: false,
1229
+ samples: Object.fromEntries(collected),
1230
+ ...step.nextCursor ? { cursor: step.nextCursor } : {}
1231
+ });
1232
+ return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
1233
+ } catch {
1234
+ return { samples: /* @__PURE__ */ new Map() };
1235
+ }
1236
+ }
1237
+ var samplesCache = /* @__PURE__ */ new Map();
1238
+ function writeSamplesCache(userId, now, samples) {
1239
+ for (const [key, entry] of samplesCache) {
1240
+ if (now - entry.at >= SPEED_SAMPLES_CACHE_TTL_MS) samplesCache.delete(key);
1241
+ }
1242
+ samplesCache.delete(userId);
1243
+ samplesCache.set(userId, { at: now, samples });
1244
+ while (samplesCache.size > SPEED_SAMPLES_CACHE_MAX_ENTRIES) {
1245
+ const oldest = samplesCache.keys().next().value;
1246
+ if (oldest === void 0) break;
1247
+ samplesCache.delete(oldest);
1248
+ }
1249
+ }
1250
+ var SPEED_SAMPLE_REFRESH_BUDGET_MS = 6e4;
1251
+ var snapshotRefreshes = /* @__PURE__ */ new Map();
1252
+ function startSpeedSnapshotRefresh(db, userId, now = Date.now()) {
1253
+ const inFlight = snapshotRefreshes.get(userId);
1254
+ if (inFlight) return inFlight;
1255
+ const job = (async () => {
1256
+ try {
1257
+ const { samples, budgetExhausted } = await collectRecentSpeedSamples(db, userId, {
1258
+ budgetMs: SPEED_SAMPLE_REFRESH_BUDGET_MS
1259
+ });
1260
+ if (!budgetExhausted) writeSamplesCache(userId, now, samples);
1261
+ } catch {
1262
+ }
1263
+ })().finally(() => {
1264
+ snapshotRefreshes.delete(userId);
1265
+ });
1266
+ snapshotRefreshes.set(userId, job);
1267
+ return job;
1268
+ }
1269
+ async function loadCachedSpeedSamples(db, userId, now) {
1270
+ const hit = samplesCache.get(userId);
1271
+ if (hit) {
1272
+ const age = now - hit.at;
1273
+ if (age >= 0 && age < SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS) {
1274
+ if (age >= SPEED_SAMPLES_CACHE_TTL_MS) void startSpeedSnapshotRefresh(db, userId);
1275
+ return age >= SPEED_SAMPLES_CACHE_TTL_MS ? { samples: hit.samples, snapshotAgeMs: age } : { samples: hit.samples };
1276
+ }
1277
+ }
1278
+ void startSpeedSnapshotRefresh(db, userId);
1279
+ return { samples: /* @__PURE__ */ new Map() };
1280
+ }
1281
+ async function injectSpeedContextIntoListAgentsResult(result, options = {}) {
1282
+ try {
1283
+ let parsed;
1284
+ try {
1285
+ parsed = JSON.parse(result);
1286
+ } catch {
1287
+ return result;
1288
+ }
1289
+ if (!parsed || typeof parsed !== "object" || !Array.isArray(parsed.agents)) return result;
1290
+ const models = parsed.agents.map((agent) => agent?.model).filter((model) => typeof model === "string");
1291
+ if (models.length === 0 && !options.compactPage) return result;
1292
+ const now = options.now ?? Date.now();
1293
+ let samples = /* @__PURE__ */ new Map();
1294
+ let snapshotAgeMs;
1295
+ const userId = typeof options.userId === "string" ? options.userId.trim() : "";
1296
+ if (options.db && userId) {
1297
+ try {
1298
+ const loaded = options.diskCache ? await loadSpeedSamplesWithDiskCache(options.db, userId, now, options.diskCache) : await loadCachedSpeedSamples(options.db, userId, now);
1299
+ samples = loaded.samples;
1300
+ snapshotAgeMs = loaded.snapshotAgeMs;
1301
+ } catch {
1302
+ samples = /* @__PURE__ */ new Map();
1303
+ }
1304
+ }
1305
+ if (options.compactPage) {
1306
+ return await serializeCompactAgentPage(parsed, samples, snapshotAgeMs, options);
1307
+ }
1308
+ const speedContext = buildCandidateSpeedContext(models, samples, { snapshotAgeMs });
1309
+ return speedContext ? JSON.stringify({ ...parsed, speedContext }) : result;
1310
+ } catch {
1311
+ return options.compactPage ? JSON.stringify({ success: false, error: "LIST_AGENTS_PAGE_SERIALIZATION_FAILED" }) : result;
1312
+ }
1313
+ }
1314
+ async function serializeCompactAgentPage(parsed, samples, snapshotAgeMs, options) {
1315
+ const maxChars = LIST_AGENTS_PAGE_BUDGET;
1316
+ const maxBytes = LIST_AGENTS_PAGE_BUDGET;
1317
+ const fits = (page) => page.length <= maxChars && new TextEncoder().encode(page).length <= maxBytes;
1318
+ const offset = typeof parsed.offset === "number" ? parsed.offset : 0;
1319
+ const candidates = parsed.agents;
1320
+ const availableCount = typeof parsed.availableCount === "number" ? parsed.availableCount : parsed.total;
1321
+ const groups = Array.isArray(parsed.credentialGroups) ? parsed.credentialGroups : [];
1322
+ if (options.fragmentOffset !== void 0) {
1323
+ const fragmentOffset = Number(options.fragmentOffset);
1324
+ const agentKey2 = candidates[0]?.agentKey;
1325
+ if (typeof options.fragmentOffset !== "number" && (typeof options.fragmentOffset !== "string" || !/^\d+$/.test(options.fragmentOffset)) || !Number.isSafeInteger(fragmentOffset) || fragmentOffset < 0 || typeof agentKey2 !== "string" || agentKey2 !== options.fragmentAgentKey) {
1326
+ return JSON.stringify({ success: false, error: "LIST_AGENTS_FRAGMENT_INVALID", offset });
1327
+ }
1328
+ const agent = candidates[0];
1329
+ const speedContext = buildCandidateSpeedContext(typeof agent.model === "string" ? [agent.model] : [], samples, { snapshotAgeMs });
1330
+ const payload = { agent, credentialGroups: groups.filter((group) => group.credentialGroup === agent.credentialGroup), ...speedContext ? { speedContext } : {} };
1331
+ let keyCollision = false;
1332
+ const cleanText = (value) => scrubSecrets(sanitizeToolOutputText(value)).cleaned;
1333
+ const sanitize = (value) => {
1334
+ if (typeof value === "string") return cleanText(value);
1335
+ if (Array.isArray(value)) return value.map(sanitize);
1336
+ if (value && typeof value === "object") {
1337
+ const entries = [];
1338
+ const keys = /* @__PURE__ */ new Set();
1339
+ for (const [key, item] of Object.entries(value)) {
1340
+ const cleanedKey = cleanText(key);
1341
+ if (keys.has(cleanedKey)) keyCollision = true;
1342
+ keys.add(cleanedKey);
1343
+ entries.push([cleanedKey, sanitize(item)]);
1344
+ }
1345
+ return Object.fromEntries(entries);
1346
+ }
1347
+ return value;
1348
+ };
1349
+ const safePayload = sanitize(payload);
1350
+ if (keyCollision) return JSON.stringify({ success: false, error: "LIST_AGENTS_SANITIZED_KEY_COLLISION", offset });
1351
+ const serialized = JSON.stringify(safePayload);
1352
+ const bytes = new TextEncoder().encode(serialized);
1353
+ const hash = await globalThis.crypto.subtle.digest("SHA-256", bytes);
1354
+ const digest = Array.from(new Uint8Array(hash), (byte) => byte.toString(16).padStart(2, "0")).join("");
1355
+ if (fragmentOffset > 0 && !options.fragmentDigest || options.fragmentDigest && options.fragmentDigest !== digest) {
1356
+ return JSON.stringify({ success: false, error: "LIST_AGENTS_FRAGMENT_CHANGED", offset });
1357
+ }
1358
+ if (fragmentOffset >= serialized.length) return JSON.stringify({ success: false, error: "LIST_AGENTS_FRAGMENT_INVALID", offset });
1359
+ if (fragmentOffset > 0 && /[\uDC00-\uDFFF]/.test(serialized[fragmentOffset]) && /[\uD800-\uDBFF]/.test(serialized[fragmentOffset - 1])) return JSON.stringify({ success: false, error: "LIST_AGENTS_FRAGMENT_INVALID", offset });
1360
+ let end = Math.min(serialized.length, fragmentOffset + 3e3);
1361
+ if (end < serialized.length && /[\uD800-\uDBFF]/.test(serialized[end - 1]) && /[\uDC00-\uDFFF]/.test(serialized[end])) end--;
1362
+ const fragment = serialized.slice(fragmentOffset, end);
1363
+ const result = JSON.stringify({ success: true, agentKey: agentKey2, offset, digest, fragment, fragmentOffset, nextFragmentOffset: end, hasMoreFragments: end < serialized.length, nextOffset: offset + 1 });
1364
+ return fits(result) ? result : JSON.stringify({ success: false, error: "LIST_AGENTS_FRAGMENT_METADATA_TOO_LARGE", offset });
1365
+ }
1366
+ const makePage = (count) => {
1367
+ const agents = candidates.slice(0, count);
1368
+ const groupKeys = new Set(agents.map((agent) => agent.credentialGroup).filter(Boolean));
1369
+ const speedContext = buildCandidateSpeedContext(agents.map((agent) => agent.model).filter((model) => typeof model === "string"), samples, { snapshotAgeMs });
1370
+ const nextOffset = offset + count;
1371
+ const hasMore = nextOffset < availableCount;
1372
+ return JSON.stringify({
1373
+ ...parsed,
1374
+ offset,
1375
+ agents,
1376
+ credentialGroups: groups.filter((group) => groupKeys.has(group.credentialGroup)),
1377
+ hasMore,
1378
+ ...hasMore ? { nextOffset } : {},
1379
+ ...speedContext ? { speedContext } : {}
1380
+ });
1381
+ };
1382
+ if (!candidates.length) {
1383
+ const empty = makePage(0);
1384
+ if (fits(empty)) return empty;
1385
+ } else {
1386
+ let best;
1387
+ for (let count = 1; count <= candidates.length; count++) {
1388
+ const page = makePage(count);
1389
+ if (!fits(page)) break;
1390
+ best = page;
1391
+ }
1392
+ if (best) return best;
1393
+ }
1394
+ const agentKey = typeof candidates[0]?.agentKey === "string" ? candidates[0].agentKey : void 0;
1395
+ const error = {
1396
+ success: false,
1397
+ error: candidates.length ? "LIST_AGENTS_CANDIDATE_TOO_LARGE" : "LIST_AGENTS_PAGE_METADATA_TOO_LARGE",
1398
+ offset,
1399
+ ...agentKey ? { agentKey, recovery: {
1400
+ tool: "listAgents",
1401
+ arguments: { compact: true, offset, fragmentOffset: 0, fragmentAgentKey: agentKey },
1402
+ note: "Repeat with the same filters and returned digest and nextFragmentOffset; concatenate fragments and parse JSON before continuing at nextOffset."
1403
+ } } : {},
1404
+ ...candidates.length ? { nextOffset: offset + 1, truncated: parsed.truncated === true, poolComplete: parsed.planningRecommendation?.poolComplete === true, hasMore: offset + 1 < availableCount } : {}
1405
+ };
1406
+ const encoded = JSON.stringify(error);
1407
+ return fits(encoded) ? encoded : JSON.stringify({ success: false, error: "LIST_AGENTS_RECOVERY_ID_TOO_LARGE", offset });
1408
+ }
1409
+
905
1410
  export {
906
1411
  isGptProModel,
907
1412
  shouldBlockForGptPro,
@@ -913,5 +1418,6 @@ export {
913
1418
  resolvePaginationArgs,
914
1419
  matchesAgentQuery,
915
1420
  buildAgentDiscoveryResult,
916
- toDiscoverySafeAgentSummary
1421
+ toDiscoverySafeAgentSummary,
1422
+ injectSpeedContextIntoListAgentsResult
917
1423
  };
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-S6K5F3KP.js";
8
8
  import {
9
9
  buildLocalAgentLookupKeys
10
- } from "./chunk-QCB42576.js";
10
+ } from "./chunk-OJ45MEEI.js";
11
11
  import {
12
12
  LOCAL_CODEX_AGENT_ID,
13
13
  LOCAL_CODEX_AGENT_KEY
@@ -15,10 +15,10 @@ import {
15
15
  import {
16
16
  localDialogMessageRecordToRuntimeMessage,
17
17
  orderDialogHistory
18
- } from "./chunk-JUSHVFNF.js";
18
+ } from "./chunk-3QIYD3VM.js";
19
19
  import {
20
20
  resolveAgentRuntimeConfigFromRecord
21
- } from "./chunk-GUXZK7SE.js";
21
+ } from "./chunk-XAG3FWBE.js";
22
22
  import {
23
23
  dialogMessagePrefix,
24
24
  dialogMessageRange
@@ -7,14 +7,14 @@ import {
7
7
  import {
8
8
  buildLocalAgentLookupKeys,
9
9
  shouldReadAgentKeyRemotely
10
- } from "./chunk-QCB42576.js";
10
+ } from "./chunk-OJ45MEEI.js";
11
11
  import {
12
12
  resolveCliAgentKeyInput
13
13
  } from "./chunk-BR3GT6MR.js";
14
14
  import {
15
15
  createHostCredentialBrokerChain,
16
16
  createStrictHostCredentialBroker
17
- } from "./chunk-JUSHVFNF.js";
17
+ } from "./chunk-3QIYD3VM.js";
18
18
  import {
19
19
  collectInvalidAgentSkillModes,
20
20
  formatInvalidAgentSkillModeMessage,
@@ -46,16 +46,10 @@ var WIRE_PROFILES = {
46
46
  // 证据确认 3.8 的 wire modelEnum,禁止虚构,先只声明同档输出上限;enum 待
47
47
  // discovery 证据到位后补齐。
48
48
  "gemini-3.8-flash-tiered": { maxOutputTokens: 65536 },
49
- // Gemini 4 Argon:fetchAvailableModels(2026-10 实测)仅返回键 `gemini-4-argon-disabled`
50
- // (MODEL_PLACEHOLDER_M421,maxOutputTokens 65536,disabled=true,提示「仅 Ultra 订阅可用」)。
51
- // 该键名带 -disabled 后缀,不是已验证可调用的 wire id:对 streamGenerateContent 用
52
- // gemini-4-argon / -disabled / -tiered / -low 均返回 404。因此这里以 logical id 作为
53
- // 透传 wire id(开放后若 discovery 给出真实 id,只需改这一行与 resolve 分支),
54
- // enum 取自 discovery 的 M421,不凭空推测 low/medium/high 档位 id。
55
- // 2026-10-13 实测:UA 升到官方 2.23.1 后 discovery 与 2.18.1 完全一致(仍仅 gemini-4-argon-disabled,
56
- // disabled=true,tagTitle "Unavailable",tagDescription "currently available to Ultra plan subscribers"),
57
- // streamGenerateContent 仍 404;loadCodeAssist currentTier=free-tier,账号非 Ultra,故保持占位映射。
58
- "gemini-4-argon": { modelEnum: "MODEL_PLACEHOLDER_M421", maxOutputTokens: 65536 },
49
+ // Discovery (2026-11-16) exposes separate enabled Argon effort variants.
50
+ "gemini-4-argon-low": { modelEnum: "MODEL_PLACEHOLDER_M419", maxOutputTokens: 65536 },
51
+ "gemini-4-argon-medium": { modelEnum: "MODEL_PLACEHOLDER_M418", maxOutputTokens: 65536 },
52
+ "gemini-4-argon-high": { modelEnum: "MODEL_PLACEHOLDER_M417", maxOutputTokens: 65536 },
59
53
  "gemini-3.6-flash-low": { maxOutputTokens: 65536 },
60
54
  "gemini-3.6-flash-medium": { maxOutputTokens: 65536 },
61
55
  "gemini-3.6-flash-high": { maxOutputTokens: 65536 },
@@ -71,7 +65,7 @@ var WIRE_PROFILES = {
71
65
  "gemini-2.5-flash": { maxOutputTokens: 65536 },
72
66
  "gemini-2.5-pro": { maxOutputTokens: 65536 }
73
67
  };
74
- function resolveAntigravityWireModel(logicalModelId) {
68
+ function resolveAntigravityWireModel(logicalModelId, reasoningEffort) {
75
69
  const id = logicalModelId.trim();
76
70
  const lower = id.toLowerCase();
77
71
  if (lower === "gemini-3.5-flash") {
@@ -86,8 +80,11 @@ function resolveAntigravityWireModel(logicalModelId) {
86
80
  const wireModelId = "gemini-3.8-flash-tiered";
87
81
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
88
82
  }
89
- if (lower === "gemini-4-argon" || ["gemini-4-argon-low", "gemini-4-argon-medium", "gemini-4-argon-high"].includes(lower)) {
90
- const wireModelId = "gemini-4-argon";
83
+ const argonVariant = /^gemini-4-argon-(low|medium|high)$/.exec(lower);
84
+ if (lower === "gemini-4-argon" || argonVariant) {
85
+ const effort = reasoningEffort?.trim().toLowerCase();
86
+ const selected = argonVariant?.[1] ?? (effort === "low" || effort === "high" ? effort : "medium");
87
+ const wireModelId = `gemini-4-argon-${selected}`;
91
88
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
92
89
  }
93
90
  if (lower === "gemini-3.6-flash") {
@@ -898,7 +895,10 @@ function buildCloudCodeAssistPayload(args) {
898
895
  );
899
896
  }
900
897
  const logicalModel = asOptionalTrimmedString(args.openAiBody.model) ?? asOptionalTrimmedString(args.agentConfig.model) ?? "gemini-3.1-pro";
901
- const { wireModelId: model, profile } = resolveAntigravityWireModel(logicalModel);
898
+ const { wireModelId: model, profile } = resolveAntigravityWireModel(
899
+ logicalModel,
900
+ asOptionalTrimmedString(args.openAiBody.reasoning_effort) ?? args.agentConfig.reasoning_effort
901
+ );
902
902
  const rawMessages = Array.isArray(args.openAiBody.messages) ? args.openAiBody.messages : [];
903
903
  const quirks = resolveGeminiModelQuirks(model);
904
904
  const isClaude = quirks.isClaudeCrossModel;
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  readDbRecord,
6
6
  writeAgentRecord
7
- } from "./chunk-D6YNCNM6.js";
7
+ } from "./chunk-TQEKUOTI.js";
8
8
  import {
9
9
  createSpaceKey
10
10
  } from "./chunk-UAD2WT54.js";
@@ -458,7 +458,7 @@ var slice = createSliceWithThunks({
458
458
  const overrides = {};
459
459
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
460
460
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
461
- const { _executeModel } = await import("./_executeModel-WZKT6XEU.js");
461
+ const { _executeModel } = await import("./_executeModel-VYCHHZVT.js");
462
462
  return _executeModel(
463
463
  {
464
464
  isStreaming: args.isStreaming ?? false,
@@ -479,7 +479,7 @@ var slice = createSliceWithThunks({
479
479
  * - 循环直到无工具调用或触发其他运行时停止条件
480
480
  */
481
481
  runAgent: create.asyncThunk(async (args, thunkApi) => {
482
- const { runAgentClientLoop } = await import("./runAgentClientLoop-H4ED5V3K.js");
482
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-AF4JQIJ7.js");
483
483
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
484
484
  {
485
485
  agentKey: args.agentKey,
@@ -495,7 +495,7 @@ var slice = createSliceWithThunks({
495
495
  * 聊天轮次流式 Agent 调用
496
496
  */
497
497
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
498
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-ZXPOXU33.js");
498
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-YSPEFY4K.js");
499
499
  return streamAgentChatTurnHandler(args, thunkApi);
500
500
  }),
501
501
  /**