nolo-cli 0.172.0-alpha.3 → 0.173.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-P7OE5QLM.js → _executeModel-KT7NUYZC.js} +20 -19
- package/{agentDeleteCommand-3CCYENZM.js → agentDeleteCommand-SVGYPFU5.js} +25 -24
- package/{agentEmailCommands-VH6GRZ4S.js → agentEmailCommands-TBZJC37X.js} +27 -26
- package/{agentListCommands-FCSA7YV3.js → agentListCommands-CD7CLGH4.js} +16 -15
- package/{agentMachineCommands-VEBNXOLD.js → agentMachineCommands-DQBUP3I5.js} +14 -13
- package/{agentProviderCommands-TWVILNAN.js → agentProviderCommands-FXEMNSZ2.js} +2 -2
- package/{agentRecordCommands-MGCNHOJ3.js → agentRecordCommands-4PY33TAJ.js} +25 -24
- package/{agentRunCommand-UMVA6KSF.js → agentRunCommand-P7BC5M3Z.js} +26 -25
- package/{agentRuntimeLocal-2JOFHEXA.js → agentRuntimeLocal-XGBQ7JK2.js} +12 -11
- package/{agentSlice-AXI53QZB.js → agentSlice-NL7LRTLO.js} +1 -1
- package/{appDeleteCommands-BNQKVEIA.js → appDeleteCommands-VBH3YLIO.js} +15 -14
- package/{appDeployCommands-V5WQ2ZBR.js → appDeployCommands-3MZXLEKN.js} +15 -14
- package/{appDeployStatusCommands-QA5GFIUU.js → appDeployStatusCommands-FAWWEEOT.js} +15 -14
- package/{appGetCommands-U3SDB4TE.js → appGetCommands-VMMCATHU.js} +15 -14
- package/{appListCommands-DMHPABYC.js → appListCommands-NHM6PAIX.js} +15 -14
- package/{authCommand-BSOLJFPV.js → authCommand-KQ7GWCXK.js} +8 -4
- package/{chunk-U5UZ7IPM.js → chunk-25A6K2YP.js} +3 -3
- package/{chunk-4TTEZGP3.js → chunk-3TAVX6CD.js} +39 -22
- package/{chunk-ZCXK773F.js → chunk-4RYUMDOM.js} +2 -2
- package/{chunk-BIF4B4ON.js → chunk-64MLOS7B.js} +1 -1
- package/{chunk-CDDFEVZ5.js → chunk-73NYJAJS.js} +10 -10
- package/{chunk-I33CJERI.js → chunk-7QQOOHDG.js} +2 -2
- package/{chunk-BKCR2JHG.js → chunk-7ZGMQZ5D.js} +0 -45
- package/{chunk-3RF4DIQW.js → chunk-AFFHPBEU.js} +7 -7
- package/{chunk-EEFX46WP.js → chunk-ASGIXFB6.js} +1 -1
- package/{chunk-CRQGEMKZ.js → chunk-AV67EUU4.js} +13 -13
- package/{chunk-XWEAIAO2.js → chunk-BAXCQF6H.js} +1 -1
- package/{chunk-QPUKYKMH.js → chunk-BGQZLBMJ.js} +4 -101
- package/{chunk-7YN3HYWC.js → chunk-BYNWE72R.js} +15 -13
- package/{chunk-U4C2R3PV.js → chunk-CLY56QIC.js} +3 -3
- package/{chunk-AJ52EA72.js → chunk-D2J22QSE.js} +1 -1
- package/{chunk-2FOT26E6.js → chunk-ENIQIEAF.js} +1 -1
- package/{chunk-RU4KURIK.js → chunk-FJ76E5ZM.js} +2 -2
- package/chunk-FX33MFLW.js +103 -0
- package/{chunk-SIZPFDPU.js → chunk-GXFAZGZ6.js} +2 -2
- package/{chunk-EW6GOYKQ.js → chunk-J33JIJK7.js} +2 -2
- package/{chunk-ZQ545VNM.js → chunk-JDWJ64VG.js} +4 -4
- package/{chunk-OQ3DOBYB.js → chunk-JOUFPRE4.js} +178 -2
- package/{chunk-55HS2GQD.js → chunk-KBGWPSY6.js} +3 -3
- package/{chunk-CK4GWPSD.js → chunk-KPSNHLFI.js} +3 -5
- package/{chunk-3SF6NB4R.js → chunk-N2N63HTQ.js} +2 -2
- package/{chunk-KSCX7GME.js → chunk-O2LB346J.js} +3 -3
- package/{chunk-XWX5ZGWR.js → chunk-O3OJRN5Z.js} +89 -24
- package/{chunk-UVP7VL6F.js → chunk-P34IX26T.js} +1 -1
- package/{chunk-TZ6CCFRL.js → chunk-QWNMFO5E.js} +3 -3
- package/{chunk-TY7GIRX6.js → chunk-RUKAOMXD.js} +1 -1
- package/{chunk-7TBARDLF.js → chunk-T7HBI3WZ.js} +1 -1
- package/{chunk-6KS4TTCI.js → chunk-TLBTPKDD.js} +10 -10
- package/chunk-UKZX3NHN.js +48 -0
- package/{chunk-XKL2RXV6.js → chunk-VETQRONK.js} +13 -11
- package/{chunk-TOLFIE2I.js → chunk-W7S5CUGI.js} +3 -3
- package/{chunk-S4SA4INB.js → chunk-WBA4HAFS.js} +2 -2
- package/{chunk-XBJIESNS.js → chunk-XAFCJN32.js} +2 -2
- package/{chunk-VVMACDVS.js → chunk-Y3BUTWUJ.js} +1 -1
- package/{chunk-KNDA4K34.js → chunk-YBTP3PUM.js} +1 -1
- package/{commandRegistry-FDWLTWIQ.js → commandRegistry-UVXIFHUI.js} +49 -49
- package/{contentThunks-AAGKCQCZ.js → contentThunks-I4HNLTQY.js} +6 -5
- package/{createAgentAutomationAction-2K7M6ACJ.js → createAgentAutomationAction-GS5LQ52L.js} +6 -5
- package/{createDialogAction-RFQJMLEO.js → createDialogAction-5WNACKWC.js} +7 -6
- package/{createPageAction-MBDADKFQ.js → createPageAction-S7MGYSMU.js} +6 -5
- package/{dialogCommands-E5I4ORXJ.js → dialogCommands-OK3L6SAI.js} +15 -14
- package/{dialogSlice-MHZCAC4E.js → dialogSlice-R62QV2OE.js} +5 -4
- package/{docCreateCommands-SMX7DXUS.js → docCreateCommands-NMCMJPQX.js} +14 -13
- package/{docDeleteCommands-MFPBAHFH.js → docDeleteCommands-46FMFRZU.js} +15 -14
- package/{docReadCommands-ZOWLKFAF.js → docReadCommands-6NPY5P67.js} +14 -13
- package/{docStore-IUFAMRVZ.js → docStore-X5P4UGTZ.js} +1 -1
- package/{docUpdateCommands-4THL5VLI.js → docUpdateCommands-UDT4QLPL.js} +14 -13
- package/{handleSendMessageAction-OS6NNC3U.js → handleSendMessageAction-IVQMBROO.js} +13 -13
- package/index.js +4 -4
- package/{localRuntimeAdapter-XQ4PAAIT.js → localRuntimeAdapter-LY5MOJN4.js} +23 -22
- package/{machineCommands-UHGFVPD2.js → machineCommands-KYTNSAIN.js} +24 -23
- package/{machineWsRunDispatch-BAFZOC6Z.js → machineWsRunDispatch-ZR3GCQMH.js} +24 -23
- package/package.json +1 -1
- package/{providerPresetApply-5K4PBX4J.js → providerPresetApply-MBMGCNKZ.js} +1 -2
- package/{providerRegistry-K5MSZ3Y5.js → providerRegistry-P4KYS6SE.js} +1 -2
- package/{readlineWorkspace-ISBZZPR2.js → readlineWorkspace-SNA6I5UK.js} +29 -28
- package/{runAgentClientLoop-H4KCCJOV.js → runAgentClientLoop-6G7JORHJ.js} +18 -17
- package/{spaceCommands-PVEPGFHX.js → spaceCommands-SEWFBY53.js} +14 -13
- package/{streamAgentChatTurn-4PX74Z36.js → streamAgentChatTurn-EJDRXKAQ.js} +24 -22
- package/{tools-546KDFWP.js → tools-K3IZ7U5G.js} +12 -12
- package/{tuiSummaryLlmCaller-LA7NUKUJ.js → tuiSummaryLlmCaller-2MC6SXZT.js} +8 -7
- package/{updateDialogTitleAction-LIS3EPHP.js → updateDialogTitleAction-YO67K72J.js} +6 -5
- package/chunk-TSCI6X6C.js +0 -185
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DEVIN_CONNECT_URL,
|
|
3
3
|
parseSseDataLineJson,
|
|
4
4
|
parseSseDataLineObject
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-O3OJRN5Z.js";
|
|
6
6
|
import {
|
|
7
7
|
applyChatCompletionDelta,
|
|
8
8
|
applyResponsesToolEvent,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
flushChatCompletionStream,
|
|
12
12
|
providerHttpFailure,
|
|
13
13
|
throwIfChatCompletionStreamFailed
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-O2LB346J.js";
|
|
15
15
|
import {
|
|
16
16
|
readSseFrames
|
|
17
17
|
} from "./chunk-HNUWUO75.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
hasImageInRuntimeMessages,
|
|
30
30
|
stripImagePartsFromMessages
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-J33JIJK7.js";
|
|
32
32
|
import {
|
|
33
33
|
clipToolText,
|
|
34
34
|
resolveHistoricalToolContentCap,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./chunk-2WZXXAQD.js";
|
|
37
37
|
import {
|
|
38
38
|
resolveAgentImageInputSupport
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-7QQOOHDG.js";
|
|
40
40
|
import {
|
|
41
41
|
applyShapingCounts,
|
|
42
42
|
attachProjectionFacts,
|
|
@@ -73,18 +73,14 @@ import {
|
|
|
73
73
|
resolveToolGuidedSections
|
|
74
74
|
} from "./chunk-ZEOR6XPJ.js";
|
|
75
75
|
import {
|
|
76
|
-
TOOL_HAD_IMAGES,
|
|
77
|
-
TOOL_IMAGES,
|
|
78
76
|
classifyUnparsableToolArgs,
|
|
79
77
|
collectStablePromptPrefix,
|
|
80
78
|
convertMessagesToResponsesInput,
|
|
81
|
-
createToolImageLedger,
|
|
82
79
|
downgradeUnparsableToolCalls,
|
|
83
80
|
extractReasoningFromResponseOutput,
|
|
84
81
|
extractTextFromResponseOutput,
|
|
85
82
|
extractToolCallsFromResponseOutput,
|
|
86
83
|
getUsageRequestOptions,
|
|
87
|
-
hadToolImages,
|
|
88
84
|
hasParsableObjectArguments,
|
|
89
85
|
markDowngradedToolTurnOrigin,
|
|
90
86
|
normalizeChatCompletionsBodyForProvider,
|
|
@@ -95,14 +91,20 @@ import {
|
|
|
95
91
|
scanTruncation,
|
|
96
92
|
shouldStripReasoningContentForOutbound,
|
|
97
93
|
stablePromptCacheKey,
|
|
98
|
-
stripToolImages,
|
|
99
94
|
toBareImageUrlMessages,
|
|
100
95
|
toOpenAiCompatibleMessages,
|
|
101
96
|
toResponsesTools,
|
|
97
|
+
transferDowngradedToolTurnOrigin
|
|
98
|
+
} from "./chunk-BGQZLBMJ.js";
|
|
99
|
+
import {
|
|
100
|
+
TOOL_HAD_IMAGES,
|
|
101
|
+
TOOL_IMAGES,
|
|
102
|
+
createToolImageLedger,
|
|
103
|
+
hadToolImages,
|
|
104
|
+
stripToolImages,
|
|
102
105
|
toolImages,
|
|
103
|
-
transferDowngradedToolTurnOrigin,
|
|
104
106
|
withoutToolImages
|
|
105
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-FX33MFLW.js";
|
|
106
108
|
import {
|
|
107
109
|
BRIDGE_STREAM_MAX_CHARS,
|
|
108
110
|
CLI_NOLO_WORKSPACE_TOOL_NAMES,
|
|
@@ -137,7 +139,7 @@ import {
|
|
|
137
139
|
resolveEmptyAssistantFallbackMessage,
|
|
138
140
|
resolveEmptyAssistantOutcome,
|
|
139
141
|
resolveTruncatedReasoningTailLog
|
|
140
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-T7HBI3WZ.js";
|
|
141
143
|
import {
|
|
142
144
|
COMPACTION_SUMMARY_SCHEMA_VERSION,
|
|
143
145
|
COMPACTION_SUMMARY_SYSTEM_PROMPT,
|
|
@@ -160,7 +162,7 @@ import {
|
|
|
160
162
|
sha256Hex,
|
|
161
163
|
truncateToolOutputForContext,
|
|
162
164
|
withProviderCallTimingFields
|
|
163
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-7ZGMQZ5D.js";
|
|
164
166
|
import {
|
|
165
167
|
clipCompactText
|
|
166
168
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-62TBKWTV.js";
|
|
7
7
|
import {
|
|
8
8
|
clearCliLocalRuntimePreparedAgentCache
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3TAVX6CD.js";
|
|
10
10
|
import {
|
|
11
11
|
readCredentialAvailability
|
|
12
12
|
} from "./chunk-R4BMKAR5.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveAgentRecordFromHybridStore,
|
|
20
20
|
sanitizeAgentRecordForCliOutput,
|
|
21
21
|
writeAgentRecord
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-P34IX26T.js";
|
|
23
23
|
import {
|
|
24
24
|
resolveCliAgentKeyInput
|
|
25
25
|
} from "./chunk-NBTY7YJF.js";
|
|
@@ -244,7 +244,7 @@ async function runAgentCreateCommand(args, deps = {}) {
|
|
|
244
244
|
let verifyResult;
|
|
245
245
|
if (parsed.verify) {
|
|
246
246
|
try {
|
|
247
|
-
const { verifyCustomProvider } = await import("./agentProviderCommands-
|
|
247
|
+
const { verifyCustomProvider } = await import("./agentProviderCommands-FXEMNSZ2.js");
|
|
248
248
|
const rec = built.nextRecord;
|
|
249
249
|
verifyResult = await verifyCustomProvider({
|
|
250
250
|
providerUrl: rec.customProviderUrl,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
clipMultilineText,
|
|
3
3
|
fetchAndSerializeTable,
|
|
4
4
|
waitForAbortableDelay
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GXFAZGZ6.js";
|
|
6
6
|
import {
|
|
7
7
|
isGatewayHttpStatus
|
|
8
8
|
} from "./chunk-NF64D32W.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-AGIM7IMJ.js";
|
|
22
22
|
import {
|
|
23
23
|
fetchAndCacheMessages
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VETQRONK.js";
|
|
25
25
|
import {
|
|
26
26
|
createSpaceKey
|
|
27
27
|
} from "./chunk-UAD2WT54.js";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// packages/agent-runtime/toolImages.ts
|
|
2
|
+
var EMPTY_TOOL_RESULT_TEXT = "[Tool completed without output]";
|
|
3
|
+
var TOOL_HAD_IMAGES = "toolHadImages";
|
|
4
|
+
function hadToolImages(message) {
|
|
5
|
+
return message.tool_result_metadata?.[TOOL_HAD_IMAGES] === true || toolImages(message).length > 0;
|
|
6
|
+
}
|
|
7
|
+
var TOOL_IMAGES = Symbol("runtime-only-tool-images");
|
|
8
|
+
function toolImages(message) {
|
|
9
|
+
return message[TOOL_IMAGES] ?? [];
|
|
10
|
+
}
|
|
11
|
+
function withoutToolImages(message) {
|
|
12
|
+
if (!(TOOL_IMAGES in message)) return message;
|
|
13
|
+
const { [TOOL_IMAGES]: _images, ...textOnly } = message;
|
|
14
|
+
return _images?.length ? {
|
|
15
|
+
...textOnly,
|
|
16
|
+
tool_result_metadata: {
|
|
17
|
+
...message.tool_result_metadata,
|
|
18
|
+
[TOOL_HAD_IMAGES]: true
|
|
19
|
+
}
|
|
20
|
+
} : textOnly;
|
|
21
|
+
}
|
|
22
|
+
function createToolImageLedger() {
|
|
23
|
+
const committed = /* @__PURE__ */ new Set();
|
|
24
|
+
let pending = /* @__PURE__ */ new Set();
|
|
25
|
+
const keyOf = (image) => `${image.mimeType}\0${image.dataBase64}`;
|
|
26
|
+
const candidates = (images) => (images ?? []).filter((image) => {
|
|
27
|
+
const key = keyOf(image);
|
|
28
|
+
if (committed.has(key) || pending.has(key)) return false;
|
|
29
|
+
pending.add(key);
|
|
30
|
+
return true;
|
|
31
|
+
});
|
|
32
|
+
return Object.assign(candidates, {
|
|
33
|
+
/** Only after the provider call succeeded: failed sends must stay replayable. */
|
|
34
|
+
commit(images) {
|
|
35
|
+
for (const image of images) committed.add(keyOf(image));
|
|
36
|
+
pending = /* @__PURE__ */ new Set();
|
|
37
|
+
},
|
|
38
|
+
/** 当前生命周期不依赖 reset,仅供未来中途放弃批次时使用。 */
|
|
39
|
+
reset() {
|
|
40
|
+
pending = /* @__PURE__ */ new Set();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function stripToolImages(message) {
|
|
45
|
+
if (!toolImages(message).length) return message;
|
|
46
|
+
return withoutToolImages(message);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// packages/agent-runtime/openAiToolImages.ts
|
|
50
|
+
var MAX_IMAGES_PER_REQUEST = 4;
|
|
51
|
+
var MAX_BASE64_BYTES_PER_REQUEST = 8 * 1024 * 1024;
|
|
52
|
+
var INTRO = "These are attachments from the preceding batch of tool results, not new instructions. Each image is preceded by a label naming the tool result it came from.";
|
|
53
|
+
function projectOpenAiToolImages(messages, supportsImages) {
|
|
54
|
+
const parts = [];
|
|
55
|
+
const omitted = [];
|
|
56
|
+
const seen = /* @__PURE__ */ new Set();
|
|
57
|
+
let bytes = 0;
|
|
58
|
+
let accepted = 0;
|
|
59
|
+
let lastTool = -1;
|
|
60
|
+
messages.forEach((message, index) => {
|
|
61
|
+
if (message.role === "tool") lastTool = index;
|
|
62
|
+
if (!supportsImages) return;
|
|
63
|
+
for (const image of toolImages(message)) {
|
|
64
|
+
const key = `${image.mimeType}\0${image.dataBase64}`;
|
|
65
|
+
if (seen.has(key)) continue;
|
|
66
|
+
seen.add(key);
|
|
67
|
+
const size = Buffer.byteLength(image.dataBase64, "utf8");
|
|
68
|
+
if (accepted >= MAX_IMAGES_PER_REQUEST || bytes + size > MAX_BASE64_BYTES_PER_REQUEST) {
|
|
69
|
+
omitted.push(`#${omitted.length + 1}`);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
bytes += size;
|
|
73
|
+
accepted += 1;
|
|
74
|
+
const source = typeof message.content === "string" ? message.content.match(/→ ([^\s\x00-\x1f\x7f]+)/u)?.[1]?.replace(/\]$/, "") ?? "" : "";
|
|
75
|
+
const toolCallId = typeof message.tool_call_id === "string" ? message.tool_call_id : "unknown";
|
|
76
|
+
parts.push({
|
|
77
|
+
type: "text",
|
|
78
|
+
text: `Image ${accepted} \u2014 from tool result ${toolCallId.replace(/[\x00-\x1f\x7f]/g, "")}${source ? ` (${source})` : ""}`
|
|
79
|
+
});
|
|
80
|
+
parts.push({ type: "image_url", image_url: { url: `data:${image.mimeType};base64,${image.dataBase64}` } });
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
if (lastTool < 0) return messages;
|
|
84
|
+
if (!parts.length && !omitted.length) return messages;
|
|
85
|
+
const note = omitted.length ? ` Note: ${omitted.length} image(s) omitted (request budget: ${MAX_IMAGES_PER_REQUEST} images / 8 MiB base64) \u2014 they were NOT delivered, do not guess their content.` : "";
|
|
86
|
+
const attachment = {
|
|
87
|
+
role: "user",
|
|
88
|
+
content: [{ type: "text", text: `${INTRO}${note}` }, ...parts]
|
|
89
|
+
};
|
|
90
|
+
return [...messages.slice(0, lastTool + 1), attachment, ...messages.slice(lastTool + 1)];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
EMPTY_TOOL_RESULT_TEXT,
|
|
95
|
+
TOOL_HAD_IMAGES,
|
|
96
|
+
hadToolImages,
|
|
97
|
+
TOOL_IMAGES,
|
|
98
|
+
toolImages,
|
|
99
|
+
withoutToolImages,
|
|
100
|
+
createToolImageLedger,
|
|
101
|
+
stripToolImages,
|
|
102
|
+
projectOpenAiToolImages
|
|
103
|
+
};
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-VYNMQ6HW.js";
|
|
9
9
|
import {
|
|
10
10
|
fetchAndCacheTableRows
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-64MLOS7B.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-K3IZ7U5G.js");
|
|
525
525
|
const { executor } = findToolExecutor(run.toolName);
|
|
526
526
|
toolRunStarted({
|
|
527
527
|
id: run.id,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveAgentImageInputSupport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7QQOOHDG.js";
|
|
4
4
|
import {
|
|
5
5
|
TOOL_HAD_IMAGES,
|
|
6
6
|
hadToolImages
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FX33MFLW.js";
|
|
8
8
|
import {
|
|
9
9
|
asOptionalFiniteNumber
|
|
10
10
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-HS7MLR74.js";
|
|
4
4
|
import {
|
|
5
5
|
performServerProxyFetchWithRetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FJ76E5ZM.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchServerSyncedCredential
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-W7S5CUGI.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillGuidancePromptBlock
|
|
12
12
|
} from "./chunk-3LNVSFTH.js";
|
|
@@ -32,11 +32,11 @@ import {
|
|
|
32
32
|
resolveReasoningReplayOptions,
|
|
33
33
|
shouldStripReasoningContentForOutbound,
|
|
34
34
|
stablePromptCacheKey
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-BGQZLBMJ.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveAgentCallPlan,
|
|
38
38
|
resolveClientWire
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-XAFCJN32.js";
|
|
40
40
|
import {
|
|
41
41
|
createFileCredentialBroker
|
|
42
42
|
} from "./chunk-76YUTLOT.js";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
asOptionalFiniteNumber
|
|
3
|
+
} from "./chunk-WWC7I6TA.js";
|
|
4
|
+
import {
|
|
5
|
+
trimTrailingSlash
|
|
6
|
+
} from "./chunk-I2QHI2XM.js";
|
|
4
7
|
import {
|
|
5
8
|
commandCodeModels,
|
|
6
9
|
kimiCodeModels,
|
|
@@ -12,6 +15,12 @@ import {
|
|
|
12
15
|
stepfunModels,
|
|
13
16
|
stepfunStepPlanModels
|
|
14
17
|
} from "./chunk-GC64WGMD.js";
|
|
18
|
+
import {
|
|
19
|
+
toErrorMessage
|
|
20
|
+
} from "./chunk-HNMXYYJR.js";
|
|
21
|
+
import {
|
|
22
|
+
asOptionalTrimmedString
|
|
23
|
+
} from "./chunk-G3SUCT4W.js";
|
|
15
24
|
import {
|
|
16
25
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_OFF_PEAK_PRICE,
|
|
17
26
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_PEAK_PRICE,
|
|
@@ -22,6 +31,157 @@ import {
|
|
|
22
31
|
asTrimmedLowercaseString
|
|
23
32
|
} from "./chunk-QSJ3HFEF.js";
|
|
24
33
|
|
|
34
|
+
// packages/agent-runtime/antigravityOAuth.ts
|
|
35
|
+
var decodeBase64 = (s) => typeof Buffer !== "undefined" ? Buffer.from(s, "base64").toString("utf8") : typeof atob === "function" ? atob(s) : s;
|
|
36
|
+
var ANTIGRAVITY_CLIENT_ID = decodeBase64(
|
|
37
|
+
"MTA3MTAwNjA2MDU5MS10bWhzc2luMmgyMWxjcmUyMzV2dG9sb2poNGc0MDNlcC5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbQ=="
|
|
38
|
+
);
|
|
39
|
+
var ANTIGRAVITY_CLIENT_SECRET = decodeBase64(
|
|
40
|
+
"R09DU1BYLUs1OEZXUjQ4NkxkTEoxbUxCOHNYQzR6NnFEQWY="
|
|
41
|
+
);
|
|
42
|
+
var ANTIGRAVITY_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
|
|
43
|
+
var ANTIGRAVITY_TOKEN_URL = "https://oauth2.googleapis.com/token";
|
|
44
|
+
var ANTIGRAVITY_USERINFO_URL = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json";
|
|
45
|
+
var ANTIGRAVITY_CALLBACK_PORT = 51121;
|
|
46
|
+
var ANTIGRAVITY_CALLBACK_PATH = "/oauth-callback";
|
|
47
|
+
var ANTIGRAVITY_CALLBACK_URL = `http://127.0.0.1:${ANTIGRAVITY_CALLBACK_PORT}${ANTIGRAVITY_CALLBACK_PATH}`;
|
|
48
|
+
var ANTIGRAVITY_SCOPES = [
|
|
49
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
|
50
|
+
"https://www.googleapis.com/auth/userinfo.email",
|
|
51
|
+
"https://www.googleapis.com/auth/userinfo.profile",
|
|
52
|
+
"https://www.googleapis.com/auth/cclog",
|
|
53
|
+
"https://www.googleapis.com/auth/experimentsandconfigs"
|
|
54
|
+
];
|
|
55
|
+
var ANTIGRAVITY_ACCESS_TOKEN_CLIENT_SKEW_MS = 5 * 60 * 1e3;
|
|
56
|
+
var ANTIGRAVITY_TOKEN_REQUEST_TIMEOUT_MS = 3e4;
|
|
57
|
+
var ANTIGRAVITY_CLOUD_CODE_BASE_URL = "https://daily-cloudcode-pa.googleapis.com";
|
|
58
|
+
var ANTIGRAVITY_CLOUD_CODE_HOST = "cloudcode-pa.googleapis.com";
|
|
59
|
+
var ANTIGRAVITY_CLOUD_CODE_HOSTS = [
|
|
60
|
+
ANTIGRAVITY_CLOUD_CODE_HOST,
|
|
61
|
+
"daily-cloudcode-pa.googleapis.com"
|
|
62
|
+
];
|
|
63
|
+
function isAntigravityCloudCodeHostname(rawHost) {
|
|
64
|
+
const hostname = asTrimmedLowercaseString(rawHost ?? "").replace(/\.+$/, "");
|
|
65
|
+
if (!hostname) return false;
|
|
66
|
+
return ANTIGRAVITY_CLOUD_CODE_HOSTS.includes(hostname);
|
|
67
|
+
}
|
|
68
|
+
function isAntigravityCloudCodeBaseUrl(raw) {
|
|
69
|
+
const value = typeof raw === "string" ? raw.trim() : "";
|
|
70
|
+
if (!value) return false;
|
|
71
|
+
try {
|
|
72
|
+
return isAntigravityCloudCodeHostname(new URL(value).hostname);
|
|
73
|
+
} catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
var ANTIGRAVITY_LEGACY_GENERIC_BASE_RE = /^https?:\/\/cloudcode-pa\.googleapis\.com$/i;
|
|
78
|
+
function getAntigravityUserAgent() {
|
|
79
|
+
const version = process.env.NOLO_ANTIGRAVITY_VERSION || "2.23.1";
|
|
80
|
+
const os = process.platform === "win32" ? "windows" : process.platform;
|
|
81
|
+
const arch = process.arch === "x64" ? "amd64" : process.arch === "ia32" ? "386" : process.arch;
|
|
82
|
+
return `antigravity/hub/${version} ${os}/${arch}`;
|
|
83
|
+
}
|
|
84
|
+
function resolveAntigravityCloudCodeBaseUrl(customProviderUrl) {
|
|
85
|
+
const raw = (customProviderUrl ?? "").trim();
|
|
86
|
+
if (!raw) return ANTIGRAVITY_CLOUD_CODE_BASE_URL;
|
|
87
|
+
const trimmed = trimTrailingSlash(raw);
|
|
88
|
+
if (isAntigravityCloudCodeBaseUrl(trimmed)) {
|
|
89
|
+
const base = trimmed.replace(/\/v1internal:.*$/i, "").replace(/\/$/, "");
|
|
90
|
+
if (ANTIGRAVITY_LEGACY_GENERIC_BASE_RE.test(base)) {
|
|
91
|
+
return ANTIGRAVITY_CLOUD_CODE_BASE_URL;
|
|
92
|
+
}
|
|
93
|
+
return base;
|
|
94
|
+
}
|
|
95
|
+
return ANTIGRAVITY_CLOUD_CODE_BASE_URL;
|
|
96
|
+
}
|
|
97
|
+
function isAntigravityOAuthAgent(agentConfig) {
|
|
98
|
+
if (!agentConfig) return false;
|
|
99
|
+
const apiKeyRef = asTrimmedLowercaseString(agentConfig.apiKeyRef);
|
|
100
|
+
const provider = asTrimmedLowercaseString(agentConfig.provider);
|
|
101
|
+
const url = asTrimmedLowercaseString(agentConfig.customProviderUrl);
|
|
102
|
+
return apiKeyRef === "antigravity" || provider === "google-antigravity" || // 只看解析后的 hostname(同 resolver):后缀 host / userinfo / path 里的官方串
|
|
103
|
+
// 都不构成 antigravity 身份。
|
|
104
|
+
isAntigravityCloudCodeBaseUrl(url);
|
|
105
|
+
}
|
|
106
|
+
function readAntigravityProjectId(metadata) {
|
|
107
|
+
return asOptionalTrimmedString(metadata?.projectId);
|
|
108
|
+
}
|
|
109
|
+
function normalizeAntigravityTokenPayload(args) {
|
|
110
|
+
const {
|
|
111
|
+
payload,
|
|
112
|
+
baseCredential,
|
|
113
|
+
now = Date.now(),
|
|
114
|
+
clientSkewMs = ANTIGRAVITY_ACCESS_TOKEN_CLIENT_SKEW_MS
|
|
115
|
+
} = args;
|
|
116
|
+
if (typeof payload.access_token !== "string" || !payload.access_token.trim()) {
|
|
117
|
+
throw new Error("Antigravity token response missing access_token");
|
|
118
|
+
}
|
|
119
|
+
const accessToken = payload.access_token.trim();
|
|
120
|
+
const expiresIn = asOptionalFiniteNumber(payload.expires_in);
|
|
121
|
+
const expiresAt = expiresIn !== void 0 ? now + expiresIn * 1e3 - clientSkewMs : baseCredential?.expiresAt;
|
|
122
|
+
const refreshToken = typeof payload.refresh_token === "string" && payload.refresh_token.trim() ? payload.refresh_token.trim() : baseCredential?.refreshToken;
|
|
123
|
+
const scope = typeof payload.scope === "string" && payload.scope.trim() ? payload.scope.trim() : baseCredential?.scope;
|
|
124
|
+
return {
|
|
125
|
+
...baseCredential ?? {},
|
|
126
|
+
provider: baseCredential?.provider ?? "antigravity",
|
|
127
|
+
accessToken,
|
|
128
|
+
...refreshToken ? { refreshToken } : {},
|
|
129
|
+
...expiresAt !== void 0 ? { expiresAt } : {},
|
|
130
|
+
...scope ? { scope } : {},
|
|
131
|
+
obtainedAt: now
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
async function refreshAntigravityToken(credential, deps = {}) {
|
|
135
|
+
if (!credential.refreshToken || !credential.refreshToken.trim()) {
|
|
136
|
+
throw new Error("Antigravity credential has no refresh_token");
|
|
137
|
+
}
|
|
138
|
+
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
139
|
+
let response;
|
|
140
|
+
try {
|
|
141
|
+
response = await fetchImpl(ANTIGRAVITY_TOKEN_URL, {
|
|
142
|
+
method: "POST",
|
|
143
|
+
headers: {
|
|
144
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
145
|
+
Accept: "application/json"
|
|
146
|
+
},
|
|
147
|
+
body: new URLSearchParams({
|
|
148
|
+
client_id: ANTIGRAVITY_CLIENT_ID,
|
|
149
|
+
client_secret: ANTIGRAVITY_CLIENT_SECRET,
|
|
150
|
+
refresh_token: credential.refreshToken.trim(),
|
|
151
|
+
grant_type: "refresh_token"
|
|
152
|
+
}),
|
|
153
|
+
signal: AbortSignal.timeout(ANTIGRAVITY_TOKEN_REQUEST_TIMEOUT_MS)
|
|
154
|
+
});
|
|
155
|
+
} catch (error) {
|
|
156
|
+
throw new Error(
|
|
157
|
+
`Antigravity token refresh failed: ${toErrorMessage(error)}`
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
let rawBodyText = "";
|
|
161
|
+
let payload;
|
|
162
|
+
try {
|
|
163
|
+
rawBodyText = await response.text();
|
|
164
|
+
payload = rawBodyText ? JSON.parse(rawBodyText) : {};
|
|
165
|
+
} catch {
|
|
166
|
+
payload = {};
|
|
167
|
+
}
|
|
168
|
+
if (!response.ok) {
|
|
169
|
+
const errorCode = typeof payload.error === "string" && payload.error.trim() ? payload.error.trim() : void 0;
|
|
170
|
+
const errorDescription = typeof payload.error_description === "string" && payload.error_description.trim() ? payload.error_description.trim() : void 0;
|
|
171
|
+
const detail = (errorCode && errorDescription && errorDescription !== errorCode ? `${errorCode}: ${errorDescription}` : errorCode ?? errorDescription ?? rawBodyText.trim()) || `HTTP ${response.status}`;
|
|
172
|
+
throw new Error(`Antigravity token refresh failed: ${detail}`);
|
|
173
|
+
}
|
|
174
|
+
if (typeof payload.access_token !== "string" || !payload.access_token.trim()) {
|
|
175
|
+
throw new Error("Antigravity token refresh response missing access_token");
|
|
176
|
+
}
|
|
177
|
+
const now = deps.now?.() ?? Date.now();
|
|
178
|
+
return normalizeAntigravityTokenPayload({
|
|
179
|
+
payload,
|
|
180
|
+
baseCredential: credential,
|
|
181
|
+
now
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
25
185
|
// packages/integrations/deepseek/models.ts
|
|
26
186
|
var deepseekModels = [
|
|
27
187
|
// ── 旗舰 ──
|
|
@@ -723,6 +883,22 @@ function isSubscriptionOAuthCredential(apiKeyRef) {
|
|
|
723
883
|
}
|
|
724
884
|
|
|
725
885
|
export {
|
|
886
|
+
ANTIGRAVITY_CLIENT_ID,
|
|
887
|
+
ANTIGRAVITY_CLIENT_SECRET,
|
|
888
|
+
ANTIGRAVITY_AUTH_URL,
|
|
889
|
+
ANTIGRAVITY_TOKEN_URL,
|
|
890
|
+
ANTIGRAVITY_USERINFO_URL,
|
|
891
|
+
ANTIGRAVITY_CALLBACK_PORT,
|
|
892
|
+
ANTIGRAVITY_CALLBACK_PATH,
|
|
893
|
+
ANTIGRAVITY_SCOPES,
|
|
894
|
+
ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
895
|
+
isAntigravityCloudCodeBaseUrl,
|
|
896
|
+
getAntigravityUserAgent,
|
|
897
|
+
resolveAntigravityCloudCodeBaseUrl,
|
|
898
|
+
isAntigravityOAuthAgent,
|
|
899
|
+
readAntigravityProjectId,
|
|
900
|
+
normalizeAntigravityTokenPayload,
|
|
901
|
+
refreshAntigravityToken,
|
|
726
902
|
SUBSCRIPTION_OAUTH_PROVIDERS,
|
|
727
903
|
CUSTOM_API_KEY_TEMPLATES,
|
|
728
904
|
ALL_PROVIDER_REGISTRY,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3TAVX6CD.js";
|
|
5
5
|
import {
|
|
6
6
|
t
|
|
7
7
|
} from "./chunk-TDX2L4W2.js";
|
|
8
8
|
import {
|
|
9
9
|
clipMultilineText
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GXFAZGZ6.js";
|
|
11
11
|
import {
|
|
12
12
|
runLocalAgentTurn
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BYNWE72R.js";
|
|
14
14
|
import {
|
|
15
15
|
applyToolSurfaceConstraints
|
|
16
16
|
} from "./chunk-2GRXE3YJ.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-JLR5NWP2.js";
|
|
12
12
|
import {
|
|
13
13
|
isOAuthApiKeyRef
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UKZX3NHN.js";
|
|
15
15
|
import {
|
|
16
16
|
isOwnedAgentKey,
|
|
17
17
|
ownedAgentKey,
|
|
@@ -21,12 +21,10 @@ import {
|
|
|
21
21
|
getModelAbility
|
|
22
22
|
} from "./chunk-HLAL63BZ.js";
|
|
23
23
|
import {
|
|
24
|
+
isAntigravityOAuthAgent,
|
|
24
25
|
isSubscriptionEndpoint,
|
|
25
26
|
isSubscriptionOAuthCredential
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import {
|
|
28
|
-
isAntigravityOAuthAgent
|
|
29
|
-
} from "./chunk-TSCI6X6C.js";
|
|
27
|
+
} from "./chunk-JOUFPRE4.js";
|
|
30
28
|
|
|
31
29
|
// packages/ai/agent/agentBilling.ts
|
|
32
30
|
function resolveBillingSource(candidate) {
|
|
@@ -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-I4HNLTQY.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-S7MGYSMU.js");
|
|
376
376
|
return createPageAction(args, thunkApi);
|
|
377
377
|
}
|
|
378
378
|
function subscribe(listener) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-HNUWUO75.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveAgentImageInputSupport
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7QQOOHDG.js";
|
|
7
7
|
import {
|
|
8
8
|
accumulateToolCallDelta,
|
|
9
9
|
createThinkParserState,
|
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
stablePromptCacheKey,
|
|
31
31
|
toOpenAiCompatibleMessages,
|
|
32
32
|
toResponsesTools
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-BGQZLBMJ.js";
|
|
34
34
|
import {
|
|
35
35
|
isMeaningfulChatCompletionOutput,
|
|
36
36
|
isMeaningfulResponsesOutput
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-7ZGMQZ5D.js";
|
|
38
38
|
import {
|
|
39
39
|
clipCompactText
|
|
40
40
|
} from "./chunk-5MMAK75Q.js";
|