nolo-cli 0.182.0-alpha.1 → 0.184.0-alpha.1
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.
- package/{_executeModel-ZMEMTJMS.js → _executeModel-YYVG3FYU.js} +24 -16
- package/{agentDeleteCommand-VXMMVCHV.js → agentDeleteCommand-WAVA6O3U.js} +18 -16
- package/{agentEmailCommands-G3UR3SVL.js → agentEmailCommands-T5RB2RKP.js} +20 -18
- package/{agentListCommands-V2F7XVZN.js → agentListCommands-QZN5WVJ5.js} +23 -63
- package/{agentMachineCommands-FALEGGEG.js → agentMachineCommands-BBADUZ7U.js} +7 -6
- package/{agentRecordCommands-HN7WNNGT.js → agentRecordCommands-N4YEVYKR.js} +19 -17
- package/{agentRunCommand-N3RD7WQ2.js → agentRunCommand-G7H745CP.js} +20 -18
- package/{agentRuntimeLocal-B2CGM4VH.js → agentRuntimeLocal-ECGPI3CO.js} +6 -5
- package/{agentSlice-NG7VBT4O.js → agentSlice-MS5G7UCC.js} +1 -1
- package/{appDeleteCommands-2GVSRT6R.js → appDeleteCommands-BY2QK4FR.js} +9 -8
- package/{appDeployCommands-UJVGSH4V.js → appDeployCommands-UH2W6LPJ.js} +9 -8
- package/{appDeployStatusCommands-4UJDG7P3.js → appDeployStatusCommands-I5DZQFKA.js} +9 -8
- package/{appGetCommands-D5HZK3DJ.js → appGetCommands-ZBCBTEO3.js} +9 -8
- package/{appListCommands-FAHI4R2I.js → appListCommands-ZA6NXKV3.js} +9 -8
- package/{authCommand-AX23Q2Q5.js → authCommand-RGOCQCQT.js} +2 -2
- package/{chromeOpsCommands-2KFQEE3H.js → chromeOpsCommands-MVGJZUOQ.js} +1 -1
- package/{chunk-EHPJFHFL.js → chunk-2FY2HA4R.js} +4 -4
- package/{chunk-J2EVUNED.js → chunk-3GMGSUU2.js} +1 -1
- package/{chunk-SO3N2323.js → chunk-3PVH6HJG.js} +2 -2
- package/{chunk-JGH3VOCR.js → chunk-5DVM4RIR.js} +2 -2
- package/{chunk-3YMDHQAK.js → chunk-5ROGGWPM.js} +8 -8
- package/{chunk-EUOPEEMO.js → chunk-7AVKDSWD.js} +1 -1
- package/chunk-AMWMV56B.js +73 -0
- package/{chunk-Y2CQS353.js → chunk-B3BTDNEC.js} +3 -3
- package/{chunk-XYRSQHF2.js → chunk-C3BYVRTJ.js} +2 -2
- package/{chunk-7ZGMQZ5D.js → chunk-CSINZLH7.js} +0 -78
- package/{chunk-E54QZNU3.js → chunk-DHMXTEM4.js} +1 -1
- package/{chunk-7HZ23BLI.js → chunk-FAFNPFGS.js} +7 -7
- package/{chunk-G5IZWDSM.js → chunk-FO2BTDKY.js} +11 -9
- package/{chunk-BNEHIKIR.js → chunk-GDQ5KO2J.js} +11 -11
- package/chunk-H57T64RA.js +80 -0
- package/{chunk-JDCX5RWD.js → chunk-HEYJFOL6.js} +1 -1
- package/{chunk-KBVF7LOK.js → chunk-HWJZEUA6.js} +2 -2
- package/{chunk-UU3QSEA5.js → chunk-IR5IH6LH.js} +12 -15
- package/{chunk-53HMDUG6.js → chunk-JJWQ737H.js} +1 -1
- package/{chunk-T5RLIVBZ.js → chunk-JWSHARJM.js} +10 -10
- package/{chunk-PS3GU7YU.js → chunk-LPV7KKTB.js} +38 -1
- package/{chunk-QHFRRM5U.js → chunk-MHC44FKA.js} +3 -3
- package/{chunk-T7HBI3WZ.js → chunk-NSASNKVD.js} +4 -2
- package/{chunk-RHFEDL32.js → chunk-ORYQ2GDN.js} +2 -2
- package/{chunk-ONFC3RLP.js → chunk-PW5CM76N.js} +8 -13
- package/{chunk-G5LNJZJH.js → chunk-PZ7LKLIV.js} +2 -2
- package/{chunk-YO776XHS.js → chunk-QNLRCES2.js} +2 -2
- package/{chunk-HRTEMYBI.js → chunk-R2EDHCTI.js} +1 -1
- package/chunk-TZXPT53C.js +8 -0
- package/{chunk-GQEQYXWV.js → chunk-WGHIT2HH.js} +13 -13
- package/{chunk-ZVVAK3DH.js → chunk-WPWAD6NT.js} +3 -3
- package/{commandRegistry-LFXI3KRG.js → commandRegistry-XDGDMYU6.js} +61 -57
- package/{contentThunks-AH7QDS6H.js → contentThunks-EWOORWBS.js} +7 -5
- package/{cooldownCommands-QFV3ERZX.js → cooldownCommands-5KIQ2FDU.js} +1 -1
- package/{createAgentAutomationAction-FAOPVXNF.js → createAgentAutomationAction-TRIAQUAK.js} +7 -5
- package/{createDialogAction-DBTKPCXV.js → createDialogAction-FXPXXDRR.js} +8 -6
- package/{createPageAction-PZGKZFPS.js → createPageAction-HHFPJKBD.js} +7 -5
- package/{dialogCommands-GQPHQ2U6.js → dialogCommands-2M5NWSY2.js} +9 -6
- package/{dialogSlice-VHGZCHAQ.js → dialogSlice-4W7DJJC2.js} +6 -4
- package/dialogUsageCommand-ZPESQB6W.js +136 -0
- package/{docCreateCommands-CQHPL5IB.js → docCreateCommands-PKUJVJ5N.js} +7 -6
- package/{docDeleteCommands-Z5UPI5PX.js → docDeleteCommands-C3RNBHIH.js} +7 -6
- package/{docReadCommands-2AEKFEFV.js → docReadCommands-JS4W26DI.js} +7 -6
- package/{docStore-XGWH3T7Q.js → docStore-VBINJLRX.js} +1 -1
- package/{docUpdateCommands-FZD4GSGV.js → docUpdateCommands-NZWDQFDD.js} +7 -6
- package/{handleSendMessageAction-XTQQEVD4.js → handleSendMessageAction-FJKTVMCA.js} +11 -9
- package/index.js +7 -7
- package/{localRuntimeAdapter-LXMUSNJ5.js → localRuntimeAdapter-5ANB7V6J.js} +18 -16
- package/{machineCommands-AXD7ISGC.js → machineCommands-A2NAILV6.js} +19 -17
- package/{machineWsRunDispatch-PGB3VJGM.js → machineWsRunDispatch-AWIGTEF6.js} +19 -17
- package/package.json +1 -1
- package/{readlineWorkspace-IO45OJPW.js → readlineWorkspace-GFKEHEXB.js} +23 -21
- package/{runAgentClientLoop-2APY5UZL.js → runAgentClientLoop-KV6R3FSU.js} +15 -13
- package/{secretCommands-XEQLKDB4.js → secretCommands-Q65QRUI2.js} +1 -1
- package/{spaceCommands-LM74S5WK.js → spaceCommands-CIXBPVEY.js} +6 -5
- package/{streamAgentChatTurn-Z3KS7XZL.js → streamAgentChatTurn-RTQ2DU4K.js} +17 -15
- package/{tools-VWAK7F7J.js → tools-R6JLL5PS.js} +11 -9
- package/{tuiSummaryLlmCaller-A6T54UJ3.js → tuiSummaryLlmCaller-5D3XCH2C.js} +4 -3
- package/{updateCommands-KDYX32JR.js → updateCommands-WBGORNRR.js} +3 -3
- package/{updateDialogTitleAction-WBIPSXFL.js → updateDialogTitleAction-2QNU4T4I.js} +7 -5
- package/{windowsSelfUpdate-IYQK4IDS.js → windowsSelfUpdate-EELBE4KH.js} +2 -2
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeTimingMs
|
|
3
|
+
} from "./chunk-H57T64RA.js";
|
|
4
|
+
|
|
5
|
+
// packages/ai/token/observedSpeedResolver.ts
|
|
6
|
+
var DEFAULT_OBSERVED_SPEED_SAMPLE_SIZE = 20;
|
|
7
|
+
var MIN_THROUGHPUT_WINDOW_MS = 200;
|
|
8
|
+
var MAX_PLAUSIBLE_OUTPUT_TPS = 3e3;
|
|
9
|
+
var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
10
|
+
var medianOf = (values) => {
|
|
11
|
+
if (values.length === 0) return void 0;
|
|
12
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
13
|
+
const middle = Math.floor(sorted.length / 2);
|
|
14
|
+
return sorted.length % 2 === 1 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2;
|
|
15
|
+
};
|
|
16
|
+
function resolveObservedSpeed(records, options = {}) {
|
|
17
|
+
const limit = isFiniteNumber(options.limit) ? Math.max(0, Math.floor(options.limit)) : DEFAULT_OBSERVED_SPEED_SAMPLE_SIZE;
|
|
18
|
+
const sample = Array.isArray(records) ? records.slice(0, limit) : [];
|
|
19
|
+
const firstOutputSamples = [];
|
|
20
|
+
const tpsSamples = [];
|
|
21
|
+
const endToEndSamples = [];
|
|
22
|
+
for (const record of sample) {
|
|
23
|
+
if (!record || typeof record !== "object") continue;
|
|
24
|
+
const { firstOutputMs, callDurationMs, output_tokens: outputTokens } = record;
|
|
25
|
+
const firstOutput = normalizeTimingMs(firstOutputMs);
|
|
26
|
+
const callDuration = normalizeTimingMs(callDurationMs);
|
|
27
|
+
if (firstOutput !== void 0) {
|
|
28
|
+
firstOutputSamples.push(firstOutput);
|
|
29
|
+
}
|
|
30
|
+
if (firstOutputMs === void 0 && callDuration !== void 0 && callDuration >= MIN_THROUGHPUT_WINDOW_MS && isFiniteNumber(outputTokens) && outputTokens > 0) {
|
|
31
|
+
const endToEndTps = outputTokens / (callDuration / 1e3);
|
|
32
|
+
if (isFiniteNumber(endToEndTps) && endToEndTps <= MAX_PLAUSIBLE_OUTPUT_TPS) {
|
|
33
|
+
endToEndSamples.push(endToEndTps);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (firstOutput !== void 0 && callDuration !== void 0 && callDuration - firstOutput >= MIN_THROUGHPUT_WINDOW_MS && isFiniteNumber(outputTokens) && outputTokens > 0) {
|
|
37
|
+
const seconds = (callDuration - firstOutput) / 1e3;
|
|
38
|
+
const tokensPerSecond = outputTokens / seconds;
|
|
39
|
+
if (isFiniteNumber(tokensPerSecond) && tokensPerSecond <= MAX_PLAUSIBLE_OUTPUT_TPS) {
|
|
40
|
+
tpsSamples.push(tokensPerSecond);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const medianFirstOutputMs = medianOf(firstOutputSamples);
|
|
45
|
+
const medianTps = medianOf(tpsSamples);
|
|
46
|
+
const throughputGroups = [];
|
|
47
|
+
for (const [basis, samples] of [
|
|
48
|
+
["generation", tpsSamples],
|
|
49
|
+
["end-to-end", endToEndSamples]
|
|
50
|
+
]) {
|
|
51
|
+
const median = medianOf([...samples]);
|
|
52
|
+
if (median === void 0) continue;
|
|
53
|
+
const tps = Math.round(median * 100) / 100;
|
|
54
|
+
throughputGroups.push({
|
|
55
|
+
basis,
|
|
56
|
+
throughputSampleCount: samples.length,
|
|
57
|
+
medianOutputTokensPerSecond: tps,
|
|
58
|
+
...basis === "end-to-end" ? { endToEndTps: tps } : {}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
basis: "generation",
|
|
63
|
+
throughputGroups,
|
|
64
|
+
firstOutputSampleCount: firstOutputSamples.length,
|
|
65
|
+
throughputSampleCount: tpsSamples.length,
|
|
66
|
+
...medianFirstOutputMs !== void 0 ? { medianFirstOutputMs: Math.round(medianFirstOutputMs) } : {},
|
|
67
|
+
...medianTps !== void 0 ? { medianOutputTokensPerSecond: Math.round(medianTps * 100) / 100 } : {}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
resolveObservedSpeed
|
|
73
|
+
};
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-HS7MLR74.js";
|
|
4
4
|
import {
|
|
5
5
|
performServerProxyFetchWithRetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ORYQ2GDN.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchServerSyncedCredential
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MHC44FKA.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillGuidancePromptBlock
|
|
12
12
|
} from "./chunk-TXJZ7QXG.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
resolveReasoningReplayOptions,
|
|
33
33
|
shouldStripReasoningContentForOutbound,
|
|
34
34
|
stablePromptCacheKey
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-HEYJFOL6.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveAgentCallPlan,
|
|
38
38
|
resolveClientWire
|
|
@@ -333,7 +333,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
333
333
|
).unwrap();
|
|
334
334
|
if (dbSpaceId) {
|
|
335
335
|
try {
|
|
336
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
336
|
+
const { updateContentTitle } = await import("./contentThunks-EWOORWBS.js");
|
|
337
337
|
await dispatch(
|
|
338
338
|
updateContentTitle({
|
|
339
339
|
spaceId: dbSpaceId,
|
|
@@ -372,7 +372,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
async function createDocState(args, thunkApi) {
|
|
375
|
-
const { createPageAction } = await import("./createPageAction-
|
|
375
|
+
const { createPageAction } = await import("./createPageAction-HHFPJKBD.js");
|
|
376
376
|
return createPageAction(args, thunkApi);
|
|
377
377
|
}
|
|
378
378
|
function subscribe(listener) {
|
|
@@ -765,76 +765,6 @@ function computeSummarySourceMetadata(messagesWithIds, summarizedBeforeId) {
|
|
|
765
765
|
};
|
|
766
766
|
}
|
|
767
767
|
|
|
768
|
-
// packages/ai/token/providerCallTiming.ts
|
|
769
|
-
var defaultNow = () => {
|
|
770
|
-
const perf = globalThis.performance;
|
|
771
|
-
return typeof perf?.now === "function" ? perf.now() : Date.now();
|
|
772
|
-
};
|
|
773
|
-
var normalizeTimingMs = (value) => {
|
|
774
|
-
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
|
|
775
|
-
return void 0;
|
|
776
|
-
}
|
|
777
|
-
return Math.round(value);
|
|
778
|
-
};
|
|
779
|
-
var createProviderCallTimingTracker = (now = defaultNow) => ({
|
|
780
|
-
startMonotonicMs: now(),
|
|
781
|
-
now
|
|
782
|
-
});
|
|
783
|
-
var observeMeaningfulProviderResponseAt = (tracker, observedAt) => {
|
|
784
|
-
if (!tracker || tracker.firstMeaningfulMonotonicMs !== void 0) return;
|
|
785
|
-
tracker.firstMeaningfulMonotonicMs = observedAt;
|
|
786
|
-
};
|
|
787
|
-
var observeMeaningfulProviderResponse = (tracker) => {
|
|
788
|
-
if (!tracker) return;
|
|
789
|
-
observeMeaningfulProviderResponseAt(tracker, tracker.now());
|
|
790
|
-
};
|
|
791
|
-
var finalizeProviderCallTiming = (tracker) => {
|
|
792
|
-
if (!tracker) return {};
|
|
793
|
-
const callDurationMs = normalizeTimingMs(
|
|
794
|
-
Math.max(0, tracker.now() - tracker.startMonotonicMs)
|
|
795
|
-
);
|
|
796
|
-
const firstOutputMs = tracker.firstMeaningfulMonotonicMs !== void 0 ? normalizeTimingMs(
|
|
797
|
-
Math.max(0, tracker.firstMeaningfulMonotonicMs - tracker.startMonotonicMs)
|
|
798
|
-
) : void 0;
|
|
799
|
-
return {
|
|
800
|
-
...firstOutputMs !== void 0 ? { firstOutputMs } : {},
|
|
801
|
-
...callDurationMs !== void 0 ? { callDurationMs } : {}
|
|
802
|
-
};
|
|
803
|
-
};
|
|
804
|
-
var withProviderCallTimingFields = (usage, timing) => {
|
|
805
|
-
if (!usage || typeof usage !== "object") return usage;
|
|
806
|
-
return {
|
|
807
|
-
...usage,
|
|
808
|
-
...timing.firstOutputMs !== void 0 ? { firstOutputMs: timing.firstOutputMs } : {},
|
|
809
|
-
...timing.callDurationMs !== void 0 ? { callDurationMs: timing.callDurationMs } : {}
|
|
810
|
-
};
|
|
811
|
-
};
|
|
812
|
-
var isMeaningfulChatCompletionOutput = (delta) => {
|
|
813
|
-
if (!delta || typeof delta !== "object") return false;
|
|
814
|
-
const d = delta;
|
|
815
|
-
if (typeof d.content === "string" && d.content) return true;
|
|
816
|
-
if (typeof d.reasoning_content === "string" && d.reasoning_content) return true;
|
|
817
|
-
if (typeof d.reasoning === "string" && d.reasoning) return true;
|
|
818
|
-
return Array.isArray(d.tool_calls) && d.tool_calls.length > 0;
|
|
819
|
-
};
|
|
820
|
-
var isMeaningfulResponsesOutput = (event) => {
|
|
821
|
-
if (!event || typeof event !== "object") return false;
|
|
822
|
-
const e = event;
|
|
823
|
-
const type = typeof e.type === "string" ? e.type : "";
|
|
824
|
-
if (type.startsWith("response.") && type.endsWith(".delta")) {
|
|
825
|
-
const delta = e.delta;
|
|
826
|
-
if (typeof delta === "string" && delta.length > 0) return true;
|
|
827
|
-
if (delta && typeof delta === "object" && typeof delta.text === "string" && delta.text) {
|
|
828
|
-
return true;
|
|
829
|
-
}
|
|
830
|
-
return false;
|
|
831
|
-
}
|
|
832
|
-
if (type === "response.output_item.added" || type === "response.output_item.done") {
|
|
833
|
-
return e.item?.type === "function_call";
|
|
834
|
-
}
|
|
835
|
-
return false;
|
|
836
|
-
};
|
|
837
|
-
|
|
838
768
|
// packages/ai/llm/getModelContextWindow.ts
|
|
839
769
|
var DEFAULT_CONTEXT_WINDOW = 256e3;
|
|
840
770
|
var QWEN_3_6_CONTEXT_WINDOW = 262144;
|
|
@@ -1006,14 +936,6 @@ var getModelInfo = (modelName) => {
|
|
|
1006
936
|
};
|
|
1007
937
|
|
|
1008
938
|
export {
|
|
1009
|
-
normalizeTimingMs,
|
|
1010
|
-
createProviderCallTimingTracker,
|
|
1011
|
-
observeMeaningfulProviderResponseAt,
|
|
1012
|
-
observeMeaningfulProviderResponse,
|
|
1013
|
-
finalizeProviderCallTiming,
|
|
1014
|
-
withProviderCallTimingFields,
|
|
1015
|
-
isMeaningfulChatCompletionOutput,
|
|
1016
|
-
isMeaningfulResponsesOutput,
|
|
1017
939
|
planContextUsage,
|
|
1018
940
|
DEFAULT_CONTEXT_WINDOW,
|
|
1019
941
|
findModelContextWindow,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
mergeReferences,
|
|
8
8
|
resolveReferenceAssets,
|
|
9
9
|
resolveToolsFromKeys
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ORYQ2GDN.js";
|
|
11
11
|
import {
|
|
12
12
|
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
13
13
|
getAllToolRuns,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
selectSpaceContextLevel,
|
|
21
21
|
selectUserTonePreset,
|
|
22
22
|
uiCardFallback
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-HWJZEUA6.js";
|
|
24
24
|
import {
|
|
25
25
|
resolveToolBaseUrl
|
|
26
26
|
} from "./chunk-MYOH447Z.js";
|
|
@@ -32,10 +32,10 @@ import {
|
|
|
32
32
|
} from "./chunk-TDNAAXUQ.js";
|
|
33
33
|
import {
|
|
34
34
|
getDocState
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-C3BYVRTJ.js";
|
|
36
36
|
import {
|
|
37
37
|
getTableState
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-7AVKDSWD.js";
|
|
39
39
|
import {
|
|
40
40
|
getCurrentSpaceIdRaw,
|
|
41
41
|
getViewMode
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
PERSONALIZATION_DIALOG_CATEGORY,
|
|
45
45
|
buildPersonalizationDialogPolicyContext,
|
|
46
46
|
selectAllMsgs
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-WGHIT2HH.js";
|
|
48
48
|
import {
|
|
49
49
|
selectPendingFiles
|
|
50
50
|
} from "./chunk-OWYYDMGJ.js";
|
|
@@ -76,11 +76,11 @@ import {
|
|
|
76
76
|
} from "./chunk-WJZOQR2J.js";
|
|
77
77
|
import {
|
|
78
78
|
extractReferenceKeysFromMessage
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-NSASNKVD.js";
|
|
80
80
|
import {
|
|
81
81
|
getModelContextWindow,
|
|
82
82
|
planContextUsage
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-CSINZLH7.js";
|
|
84
84
|
import {
|
|
85
85
|
asRecordOrEmpty
|
|
86
86
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
flushChatCompletionStream,
|
|
12
12
|
providerHttpFailure,
|
|
13
13
|
throwIfChatCompletionStreamFailed
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QNLRCES2.js";
|
|
15
15
|
import {
|
|
16
16
|
readSseFrames
|
|
17
17
|
} from "./chunk-HNUWUO75.js";
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
toOpenAiCompatibleMessages,
|
|
98
98
|
toResponsesTools,
|
|
99
99
|
transferDowngradedToolTurnOrigin
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-HEYJFOL6.js";
|
|
101
101
|
import {
|
|
102
102
|
TOOL_HAD_IMAGES,
|
|
103
103
|
TOOL_IMAGES,
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
resolveEmptyAssistantFallbackMessage,
|
|
146
146
|
resolveEmptyAssistantOutcome,
|
|
147
147
|
resolveTruncatedReasoningTailLog
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-NSASNKVD.js";
|
|
149
149
|
import {
|
|
150
150
|
COMPACTION_SUMMARY_SCHEMA_VERSION,
|
|
151
151
|
COMPACTION_SUMMARY_SYSTEM_PROMPT,
|
|
@@ -154,21 +154,23 @@ import {
|
|
|
154
154
|
buildCompactionUserContent,
|
|
155
155
|
computeSummaryInputTokenCap,
|
|
156
156
|
computeSummarySourceMetadata,
|
|
157
|
-
createProviderCallTimingTracker,
|
|
158
|
-
finalizeProviderCallTiming,
|
|
159
157
|
formatCompactionMetricsLog,
|
|
160
158
|
formatFileOperationsFromMessages,
|
|
161
159
|
formatMessagesForSummaryWithTruncation,
|
|
162
160
|
getModelContextWindow,
|
|
163
|
-
isMeaningfulResponsesOutput,
|
|
164
|
-
observeMeaningfulProviderResponse,
|
|
165
161
|
planCompression,
|
|
166
162
|
planContextUsage,
|
|
167
163
|
resolveCompressionTriggerRatio,
|
|
168
164
|
sha256Hex,
|
|
169
|
-
truncateToolOutputForContext
|
|
165
|
+
truncateToolOutputForContext
|
|
166
|
+
} from "./chunk-CSINZLH7.js";
|
|
167
|
+
import {
|
|
168
|
+
createProviderCallTimingTracker,
|
|
169
|
+
finalizeProviderCallTiming,
|
|
170
|
+
isMeaningfulResponsesOutput,
|
|
171
|
+
observeMeaningfulProviderResponse,
|
|
170
172
|
withProviderCallTimingFields
|
|
171
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-H57T64RA.js";
|
|
172
174
|
import {
|
|
173
175
|
clipCompactText
|
|
174
176
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
import {
|
|
61
61
|
inlineImageUrlsForCustomProvider,
|
|
62
62
|
prepareTools
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-5DVM4RIR.js";
|
|
64
64
|
import {
|
|
65
65
|
getServerProviderSecret
|
|
66
66
|
} from "./chunk-HS7MLR74.js";
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
resolveCliLocalRuntimeKeyCapability,
|
|
83
83
|
resolveCliLocalSpawnDispatch,
|
|
84
84
|
resolveStartAgentRunCwd
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-5ROGGWPM.js";
|
|
86
86
|
import {
|
|
87
87
|
deriveCredentialGroup,
|
|
88
88
|
deriveCustomProviderCredentialGroup
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
} from "./chunk-KFHREHUQ.js";
|
|
94
94
|
import {
|
|
95
95
|
resolveAgentRequiredPackIds
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-HWJZEUA6.js";
|
|
97
97
|
import {
|
|
98
98
|
getDefaultCliLocalRuntimeDb
|
|
99
99
|
} from "./chunk-FDLDMJTM.js";
|
|
@@ -105,14 +105,14 @@ import {
|
|
|
105
105
|
resolveBuiltinPlatformAgentConfig,
|
|
106
106
|
runKeyed,
|
|
107
107
|
validateAskChoiceInput
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-WGHIT2HH.js";
|
|
109
109
|
import {
|
|
110
110
|
BUILTIN_DIALOG_LLM_CHAT_FALLBACK_MODEL,
|
|
111
111
|
BUILTIN_TITLE_LLM_CONFIG
|
|
112
112
|
} from "./chunk-523DITKR.js";
|
|
113
113
|
import {
|
|
114
114
|
fetchServerSyncedCredential
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-MHC44FKA.js";
|
|
116
116
|
import {
|
|
117
117
|
isTombstoneRecord
|
|
118
118
|
} from "./chunk-D2MDMY2M.js";
|
|
@@ -169,7 +169,7 @@ import {
|
|
|
169
169
|
runExecShellGates,
|
|
170
170
|
validateConfiguredRootExecutionLease,
|
|
171
171
|
verifyOwnerRouteAck
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-FO2BTDKY.js";
|
|
173
173
|
import {
|
|
174
174
|
accumulateGeminiChunks,
|
|
175
175
|
buildGeminiGenerateContentRequest,
|
|
@@ -192,7 +192,7 @@ import {
|
|
|
192
192
|
readPlatformChatSseCompletion,
|
|
193
193
|
resolvePlatformChatProviderConfig,
|
|
194
194
|
shouldUsePlatformChatProvider
|
|
195
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-QNLRCES2.js";
|
|
196
196
|
import {
|
|
197
197
|
readSseDataValues,
|
|
198
198
|
readSseFrames
|
|
@@ -212,7 +212,7 @@ import {
|
|
|
212
212
|
findAgentStatePairingIssues,
|
|
213
213
|
stablePromptCacheKey,
|
|
214
214
|
toResponsesTools
|
|
215
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-HEYJFOL6.js";
|
|
216
216
|
import {
|
|
217
217
|
EMPTY_TOOL_RESULT_TEXT,
|
|
218
218
|
createToolImageBudget,
|
|
@@ -242,7 +242,7 @@ import {
|
|
|
242
242
|
} from "./chunk-2MBTWINN.js";
|
|
243
243
|
import {
|
|
244
244
|
normalizeUsage
|
|
245
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-NSASNKVD.js";
|
|
246
246
|
import {
|
|
247
247
|
isDevinOAuthAgent
|
|
248
248
|
} from "./chunk-5ZUL4CUO.js";
|
|
@@ -252,7 +252,7 @@ import {
|
|
|
252
252
|
observeMeaningfulProviderResponse,
|
|
253
253
|
observeMeaningfulProviderResponseAt,
|
|
254
254
|
withProviderCallTimingFields
|
|
255
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-H57T64RA.js";
|
|
256
256
|
import {
|
|
257
257
|
isOAuthApiKeyRef
|
|
258
258
|
} from "./chunk-UKZX3NHN.js";
|
|
@@ -358,7 +358,7 @@ import {
|
|
|
358
358
|
import {
|
|
359
359
|
agentRunCardLabels,
|
|
360
360
|
t
|
|
361
|
-
} from "./chunk-
|
|
361
|
+
} from "./chunk-LPV7KKTB.js";
|
|
362
362
|
import {
|
|
363
363
|
isAntigravityOAuthAgent
|
|
364
364
|
} from "./chunk-JOUFPRE4.js";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// packages/ai/token/providerCallTiming.ts
|
|
2
|
+
var defaultNow = () => {
|
|
3
|
+
const perf = globalThis.performance;
|
|
4
|
+
return typeof perf?.now === "function" ? perf.now() : Date.now();
|
|
5
|
+
};
|
|
6
|
+
var normalizeTimingMs = (value) => {
|
|
7
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
10
|
+
return Math.round(value);
|
|
11
|
+
};
|
|
12
|
+
var createProviderCallTimingTracker = (now = defaultNow) => ({
|
|
13
|
+
startMonotonicMs: now(),
|
|
14
|
+
now
|
|
15
|
+
});
|
|
16
|
+
var observeMeaningfulProviderResponseAt = (tracker, observedAt) => {
|
|
17
|
+
if (!tracker || tracker.firstMeaningfulMonotonicMs !== void 0) return;
|
|
18
|
+
tracker.firstMeaningfulMonotonicMs = observedAt;
|
|
19
|
+
};
|
|
20
|
+
var observeMeaningfulProviderResponse = (tracker) => {
|
|
21
|
+
if (!tracker) return;
|
|
22
|
+
observeMeaningfulProviderResponseAt(tracker, tracker.now());
|
|
23
|
+
};
|
|
24
|
+
var finalizeProviderCallTiming = (tracker) => {
|
|
25
|
+
if (!tracker) return {};
|
|
26
|
+
const callDurationMs = normalizeTimingMs(
|
|
27
|
+
Math.max(0, tracker.now() - tracker.startMonotonicMs)
|
|
28
|
+
);
|
|
29
|
+
const firstOutputMs = tracker.firstMeaningfulMonotonicMs !== void 0 ? normalizeTimingMs(
|
|
30
|
+
Math.max(0, tracker.firstMeaningfulMonotonicMs - tracker.startMonotonicMs)
|
|
31
|
+
) : void 0;
|
|
32
|
+
return {
|
|
33
|
+
...firstOutputMs !== void 0 ? { firstOutputMs } : {},
|
|
34
|
+
...callDurationMs !== void 0 ? { callDurationMs } : {}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
var withProviderCallTimingFields = (usage, timing) => {
|
|
38
|
+
if (!usage || typeof usage !== "object") return usage;
|
|
39
|
+
return {
|
|
40
|
+
...usage,
|
|
41
|
+
...timing.firstOutputMs !== void 0 ? { firstOutputMs: timing.firstOutputMs } : {},
|
|
42
|
+
...timing.callDurationMs !== void 0 ? { callDurationMs: timing.callDurationMs } : {}
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
var isMeaningfulChatCompletionOutput = (delta) => {
|
|
46
|
+
if (!delta || typeof delta !== "object") return false;
|
|
47
|
+
const d = delta;
|
|
48
|
+
if (typeof d.content === "string" && d.content) return true;
|
|
49
|
+
if (typeof d.reasoning_content === "string" && d.reasoning_content) return true;
|
|
50
|
+
if (typeof d.reasoning === "string" && d.reasoning) return true;
|
|
51
|
+
return Array.isArray(d.tool_calls) && d.tool_calls.length > 0;
|
|
52
|
+
};
|
|
53
|
+
var isMeaningfulResponsesOutput = (event) => {
|
|
54
|
+
if (!event || typeof event !== "object") return false;
|
|
55
|
+
const e = event;
|
|
56
|
+
const type = typeof e.type === "string" ? e.type : "";
|
|
57
|
+
if (type.startsWith("response.") && type.endsWith(".delta")) {
|
|
58
|
+
const delta = e.delta;
|
|
59
|
+
if (typeof delta === "string" && delta.length > 0) return true;
|
|
60
|
+
if (delta && typeof delta === "object" && typeof delta.text === "string" && delta.text) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
if (type === "response.output_item.added" || type === "response.output_item.done") {
|
|
66
|
+
return e.item?.type === "function_call";
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
normalizeTimingMs,
|
|
73
|
+
createProviderCallTimingTracker,
|
|
74
|
+
observeMeaningfulProviderResponseAt,
|
|
75
|
+
observeMeaningfulProviderResponse,
|
|
76
|
+
finalizeProviderCallTiming,
|
|
77
|
+
withProviderCallTimingFields,
|
|
78
|
+
isMeaningfulChatCompletionOutput,
|
|
79
|
+
isMeaningfulResponsesOutput
|
|
80
|
+
};
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-VYNMQ6HW.js";
|
|
9
9
|
import {
|
|
10
10
|
fetchAndCacheTableRows
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7AVKDSWD.js";
|
|
12
12
|
import {
|
|
13
13
|
require_react
|
|
14
14
|
} from "./chunk-YDH3FDFQ.js";
|
|
@@ -521,7 +521,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
521
521
|
if (!executionInput) {
|
|
522
522
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
523
523
|
}
|
|
524
|
-
const { findToolExecutor } = await import("./tools-
|
|
524
|
+
const { findToolExecutor } = await import("./tools-R6JLL5PS.js");
|
|
525
525
|
const { executor } = findToolExecutor(run.toolName);
|
|
526
526
|
toolRunStarted({
|
|
527
527
|
id: run.id,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveRawAgentInput,
|
|
10
10
|
resolveServerUrl,
|
|
11
11
|
writeUsage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DHMXTEM4.js";
|
|
13
13
|
import {
|
|
14
14
|
getReadableCliDb
|
|
15
15
|
} from "./chunk-62TBKWTV.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
resolveFileWriteGateEnabled,
|
|
32
32
|
resolveLocalUserId,
|
|
33
33
|
validateInstaboxWorkspaceSelection
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-GDQ5KO2J.js";
|
|
35
35
|
import {
|
|
36
36
|
clearCredentialAvailability,
|
|
37
37
|
readEffectiveCredentialEntry,
|
|
@@ -72,14 +72,14 @@ import {
|
|
|
72
72
|
} from "./chunk-BMQ2MJUK.js";
|
|
73
73
|
import {
|
|
74
74
|
resolveCliLocalRuntimeKeyCapability
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-5ROGGWPM.js";
|
|
76
76
|
import {
|
|
77
77
|
isTransientFetchError
|
|
78
78
|
} from "./chunk-KFHREHUQ.js";
|
|
79
79
|
import {
|
|
80
80
|
parseUiCard,
|
|
81
81
|
uiCardFallback
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-HWJZEUA6.js";
|
|
83
83
|
import {
|
|
84
84
|
isGatewayHttpStatus
|
|
85
85
|
} from "./chunk-NF64D32W.js";
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
chooseMemoryOwners,
|
|
89
89
|
loadMemoryCandidatesFromDb,
|
|
90
90
|
resolveAgentMemoryPolicy
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-3PVH6HJG.js";
|
|
92
92
|
import {
|
|
93
93
|
getDefaultCliLocalRuntimeDb
|
|
94
94
|
} from "./chunk-FDLDMJTM.js";
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
resolveAgentContextWindow,
|
|
100
100
|
resolveOccupancy,
|
|
101
101
|
resolveOccupancyWindow
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-WGHIT2HH.js";
|
|
103
103
|
import {
|
|
104
104
|
buildSkillDiscoveryContextLayer
|
|
105
105
|
} from "./chunk-AU7AXHUL.js";
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
112
112
|
LOCAL_TURN_ABORTED_CODE,
|
|
113
113
|
readActionGate
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-FO2BTDKY.js";
|
|
115
115
|
import {
|
|
116
116
|
resolveAgentRuntimeConfigFromRecord
|
|
117
117
|
} from "./chunk-CR5WXQX7.js";
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
} from "./chunk-JLR5NWP2.js";
|
|
140
140
|
import {
|
|
141
141
|
normalizeUsage
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-NSASNKVD.js";
|
|
143
143
|
import {
|
|
144
144
|
isOAuthApiKeyRef
|
|
145
145
|
} from "./chunk-UKZX3NHN.js";
|
|
@@ -220,7 +220,7 @@ import {
|
|
|
220
220
|
t,
|
|
221
221
|
toolLabel,
|
|
222
222
|
toolLabelVariants
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-LPV7KKTB.js";
|
|
224
224
|
import {
|
|
225
225
|
isAntigravityOAuthAgent
|
|
226
226
|
} from "./chunk-JOUFPRE4.js";
|
|
@@ -11376,7 +11376,7 @@ function isBalanceExhaustedError(error) {
|
|
|
11376
11376
|
|
|
11377
11377
|
// packages/cli/client/agentRun.ts
|
|
11378
11378
|
async function loadRunLocalAgentTurn() {
|
|
11379
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
11379
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-ECGPI3CO.js");
|
|
11380
11380
|
return runLocalAgentTurn;
|
|
11381
11381
|
}
|
|
11382
11382
|
var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
|
|
@@ -15723,9 +15723,7 @@ async function runAgentRunCommand(args, deps) {
|
|
|
15723
15723
|
const instaboxRuntimeLocal = typeof parsed.runtimeKey === "string" && parsed.runtimeKey.trim() === "instabox";
|
|
15724
15724
|
const hostRuntimeLocal = typeof parsed.runtimeKey === "string" && parsed.runtimeKey.trim() === "local";
|
|
15725
15725
|
if (hostRuntimeLocal && !args.includes("--allow-host-writes")) {
|
|
15726
|
-
output.write(
|
|
15727
|
-
"[nolo] runtimeKey=local \u4F1A\u5728**\u5BBF\u4E3B\u6587\u4EF6\u7CFB\u7EDF**\u4E0A\u6267\u884C\u5E76\u5199\u5165\uFF0C\u5FC5\u987B\u663E\u5F0F\u52A0 --allow-host-writes \u786E\u8BA4\uFF1B\u8981\u9694\u79BB\u6267\u884C\u8BF7\u7701\u7565 --runtime-key\uFF08\u9ED8\u8BA4\u8FDB docker \u6C99\u76D2\uFF09\u3002\n"
|
|
15728
|
-
);
|
|
15726
|
+
output.write(t("agentRun.hostWriteGuard"));
|
|
15729
15727
|
return 1;
|
|
15730
15728
|
}
|
|
15731
15729
|
const isLocalRun = (dockerRuntimeLocal || instaboxRuntimeLocal || hostRuntimeLocal || !parsed.runtimeKey) && (parsed.runtimeMode === "local" || hostRuntimeLocal || !parsed.runtimeMode && (fullstackLocal || explicitLocalCli || args.includes("--dangerously-allow-shell")));
|
|
@@ -15872,8 +15870,7 @@ async function runAgentRunCommand(args, deps) {
|
|
|
15872
15870
|
env
|
|
15873
15871
|
});
|
|
15874
15872
|
} catch (err) {
|
|
15875
|
-
output.write(
|
|
15876
|
-
`);
|
|
15873
|
+
output.write(t("agentRun.instaboxConfigFailed", toErrorMessage(err)));
|
|
15877
15874
|
return 1;
|
|
15878
15875
|
}
|
|
15879
15876
|
}
|