nolo-cli 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-AVCA2NAV.js → _executeModel-X5PCIZN6.js} +50 -44
- package/{action-F5JACQBG.js → action-LT7BRFLK.js} +10 -9
- package/{addContentAction-AQXEYRBE.js → addContentAction-PL3KKBDH.js} +9 -8
- package/{addDialogAgentAction-EJHHJZWW.js → addDialogAgentAction-FCMSKYAF.js} +8 -7
- package/{agentDeleteCommand-QW5PUMDQ.js → agentDeleteCommand-2BZDQV36.js} +32 -29
- package/{agentEmailCommands-4ORVLGVQ.js → agentEmailCommands-2QJDGRMB.js} +62 -56
- package/{agentListCommands-YWBYRTYC.js → agentListCommands-6VEPTKBI.js} +31 -28
- package/{agentMachineCommands-JSQW4FOA.js → agentMachineCommands-NVVHNWYI.js} +30 -27
- package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
- package/{agentRecordCommands-AASIWOBT.js → agentRecordCommands-4GGRDMD4.js} +57 -51
- package/{agentRunCommand-TB5BHXUH.js → agentRunCommand-XOLQNKBZ.js} +63 -54
- package/{agentRunControl-6ADXVYMR.js → agentRunControl-Y5AFH5PQ.js} +24 -1
- package/{agentRuntimeLocal-QNPNJRVH.js → agentRuntimeLocal-7WYWCGL4.js} +25 -22
- package/{agentSlice-RUNXC62Y.js → agentSlice-EAXPGEYV.js} +9 -8
- package/appDeleteCommands-77KR2RJ4.js +127 -0
- package/appDeployCommands-K7CAHGBI.js +166 -0
- package/appDeployStatusCommands-4OEKLTBT.js +147 -0
- package/appGetCommands-VM2WDLAZ.js +122 -0
- package/appListCommands-GX6BBA6U.js +125 -0
- package/{authCommand-YFTR3347.js → authCommand-DY6UUL6O.js} +16 -9
- package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
- package/{chunk-DPAB4FQ7.js → chunk-23FZYPLC.js} +1608 -212
- package/{chunk-LPEUV5RE.js → chunk-34WPV75U.js} +23 -2
- package/{chunk-XPC5C7BK.js → chunk-3ND52WIL.js} +2 -2
- package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
- package/{chunk-3OIRVWXA.js → chunk-3ZX7PERL.js} +10 -1
- package/{chunk-KKY4B2Q2.js → chunk-4PWB7JRR.js} +4 -1
- package/{chunk-6N4KODMN.js → chunk-4T5F7YZQ.js} +1 -1
- package/chunk-7BUYEZ6U.js +671 -0
- package/{chunk-AS3ZQ3O2.js → chunk-7OBMZCRD.js} +1 -1
- package/{chunk-IGXREZW2.js → chunk-AHCY2S2I.js} +1 -1
- package/{chunk-QLUFR47U.js → chunk-AL2V7U3E.js} +1 -1
- package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
- package/{chunk-AUURUT6L.js → chunk-BV4VEE3W.js} +264 -424
- package/{chunk-FRV6A633.js → chunk-CZ6NYQTV.js} +13 -4
- package/{chunk-PCTUYVUM.js → chunk-DFCFMCY6.js} +10 -3
- package/{chunk-JTMNCCWF.js → chunk-DKZFOK24.js} +16 -87
- package/chunk-DL6EPNIK.js +50 -0
- package/{chunk-ZQBL7LIC.js → chunk-EDV7EBOI.js} +317 -216
- package/{chunk-IWLUTMYX.js → chunk-ELT65PZW.js} +2 -2
- package/chunk-FQZZLA3C.js +223 -0
- package/{chunk-55NSNCFM.js → chunk-FXUSIQC2.js} +1 -1
- package/{chunk-MR6ISAGB.js → chunk-G5U6LDLG.js} +6 -6
- package/chunk-GFUIQ4RY.js +136 -0
- package/{chunk-NVEWUJVX.js → chunk-HEGV7BH3.js} +1 -1
- package/{chunk-BEBNFWDU.js → chunk-HWW2M4SN.js} +3 -3
- package/{chunk-4L2OJPCU.js → chunk-I2ZJKTG5.js} +58 -8
- package/{chunk-Z5JQNBNY.js → chunk-IYEXFJPC.js} +34 -15
- package/{setDialogExtraReferencesAction-LR6MSIXO.js → chunk-JLA4FXYC.js} +2 -17
- package/chunk-KFEVY3ST.js +255 -0
- package/{chunk-4FX6NVDW.js → chunk-L4F3I4SR.js} +3 -136
- package/{chunk-XBS2WYJ2.js → chunk-LLWKHDG4.js} +1 -1
- package/{chunk-3WGLLTK4.js → chunk-LSFAWXKC.js} +100 -3
- package/{chunk-6EVITP2G.js → chunk-MHSGJW4Z.js} +2 -251
- package/{chunk-O6W2O2DA.js → chunk-MKA6QE5E.js} +6 -2
- package/{chunk-DGEYDWEZ.js → chunk-MPVYDS7I.js} +3 -3
- package/{chunk-KFHN5NGJ.js → chunk-MVQ4TBSD.js} +1 -1
- package/{chunk-AVVZUXXC.js → chunk-N54HIJVJ.js} +34 -13
- package/{chunk-EHLHSX7R.js → chunk-OK6YSWLH.js} +9 -2
- package/{chunk-33BJUVK4.js → chunk-PIZYJVHQ.js} +5 -5
- package/{chunk-RLCXU7A5.js → chunk-PJSV3IZ5.js} +1 -1
- package/{chunk-7UKFVQ5W.js → chunk-R35XMF6F.js} +126 -41
- package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
- package/{chunk-S2LXHNHG.js → chunk-REA4JLBH.js} +6 -6
- package/chunk-RQN4SEKL.js +107 -0
- package/{chunk-EABWT43X.js → chunk-RVOUXDFU.js} +5 -5
- package/{chunk-NSCHQQPU.js → chunk-SCTYAHYK.js} +470 -325
- package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
- package/{chunk-M43KDE25.js → chunk-SWDPIPOY.js} +2 -8
- package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
- package/{chunk-66X4VSRC.js → chunk-UAIVG4J6.js} +42 -2
- package/{chunk-3663CXZN.js → chunk-UBHAWFQ6.js} +143 -31
- package/{chunk-YJKXGHJ6.js → chunk-UGUW3FHG.js} +4 -4
- package/{chunk-P3RIAYGG.js → chunk-V3ED5AWK.js} +3 -3
- package/chunk-V5R4NZP2.js +78 -0
- package/{chunk-4IJYA27C.js → chunk-VDXCXCXH.js} +1 -1
- package/{chunk-MYMMNKYL.js → chunk-VNAEBGDK.js} +156 -6
- package/{chunk-FY233ZFU.js → chunk-VYHDJEQD.js} +110 -192
- package/{chunk-W4NVOSFF.js → chunk-WFHXMLHZ.js} +1 -1
- package/{chunk-H33743XH.js → chunk-WJRJDX2W.js} +1 -1
- package/chunk-X4Q4UZEY.js +26 -0
- package/{chunk-RPDGJO4D.js → chunk-XHG22OEX.js} +4 -4
- package/{chunk-DVRHHFEA.js → chunk-XMLRJUU5.js} +1 -1
- package/{chunk-3S2VOMIF.js → chunk-XRZJGPFI.js} +7 -7
- package/{chunk-GSINCD4P.js → chunk-YGW4G5W5.js} +25 -12
- package/chunk-ZZ2MH7LE.js +84 -0
- package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
- package/codingSkills-36KN5NQT.js +48 -0
- package/{createAgentAutomationAction-FNHPSKKO.js → createAgentAutomationAction-GNFF524X.js} +20 -19
- package/{createDialogAction-TZCVQ3NU.js → createDialogAction-RB55KCLO.js} +22 -21
- package/{createPageAction-EIGZ3BKT.js → createPageAction-Y7343GLU.js} +26 -25
- package/{db-HCJ5PRB5.js → db-W3O47YGF.js} +38 -12
- package/{dbSlice-7KQH6GOU.js → dbSlice-CGSRFJN3.js} +8 -7
- package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
- package/{dialogCommands-FO77J5DQ.js → dialogCommands-IAZK6YHQ.js} +30 -27
- package/{dialogSlice-MM5U4KE2.js → dialogSlice-UQAXF23P.js} +20 -19
- package/{docCreateCommands-I3BS3AZI.js → docCreateCommands-I2EWZGCI.js} +33 -28
- package/{docDeleteCommands-Q2OPV52P.js → docDeleteCommands-IZ45UZKG.js} +32 -27
- package/{docReadCommands-YOOFACYZ.js → docReadCommands-R6Z4QJYU.js} +31 -26
- package/{docStore-NGYQ2JTR.js → docStore-5HOJ4D7D.js} +21 -20
- package/{docUpdateCommands-2B32ITHN.js → docUpdateCommands-2LRBKQPY.js} +32 -27
- package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
- package/{getPricing-P4XRJRZB.js → getPricing-G7DLAST6.js} +3 -3
- package/{handleSendMessageAction-JRZWWBKP.js → handleSendMessageAction-Q4HY35WX.js} +21 -20
- package/index.js +95 -64
- package/{localDialogRead-2VRI24F4.js → localDialogRead-4H3QJFLW.js} +2 -2
- package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
- package/{machineCommands-WRWF2ICZ.js → machineCommands-PKBPQKTY.js} +63 -57
- package/{machineWsRunDispatch-ZX7Q3TWZ.js → machineWsRunDispatch-UZAW4OXJ.js} +55 -49
- package/{models-WQ5N4OJM.js → models-DJFSJ7SW.js} +2 -2
- package/package.json +1 -1
- package/queryRunOverlay-O4LOMMPO.js +161 -0
- package/{read-CN3TNXIP.js → read-3FMPZPER.js} +3 -3
- package/{readDocTool-WF3675ED.js → readDocTool-VSYHKK3V.js} +1 -1
- package/{readlineWorkspace-ZTGRGW46.js → readlineWorkspace-Y2RDOFZG.js} +762 -218
- package/{removeDialogAgentAction-YDHBFEGI.js → removeDialogAgentAction-OAGA2G3U.js} +10 -9
- package/{runAgentClientLoop-JZCOP7LG.js → runAgentClientLoop-NBPIKJ6J.js} +44 -38
- package/runOverlayPresentation-ZO4VCWEU.js +11 -0
- package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
- package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
- package/{setPrimaryDialogAgentAction-IIVDCY5C.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +26 -17
- package/{settingSlice-O23YDK2O.js → settingSlice-7MNKHZ6R.js} +9 -8
- package/{skillDiscovery-6M2BZUFN.js → skillDiscovery-KJWT7JBU.js} +3 -3
- package/{spaceCommands-VV4GTPQK.js → spaceCommands-DHCZ7J5I.js} +31 -28
- package/{spaceSlice-DRWWZJP7.js → spaceSlice-ZXLLG3CR.js} +20 -19
- package/{streamAgentChatTurn-Y6WGATQR.js → streamAgentChatTurn-L3YW6LSB.js} +98 -57
- package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
- package/{tools-PUNBY3AH.js → tools-ECGXR5QF.js} +33 -28
- package/{tuiSummaryLlmCaller-F64WLSAF.js → tuiSummaryLlmCaller-OMSCNHXA.js} +6 -5
- package/types-ZSTJ7MPR.js +7 -0
- package/{updateDialogTitleAction-YSR4TCMB.js → updateDialogTitleAction-HQ2EUDFT.js} +23 -22
- package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
- package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
- package/{localRuntimeAuthority-TEGCOWX4.js → localRuntimeAuthority-4IXJCHZ7.js} +3 -3
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getModelConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UAIVG4J6.js";
|
|
4
4
|
import {
|
|
5
5
|
asTrimmedLowercaseString
|
|
6
6
|
} from "./chunk-QSJ3HFEF.js";
|
|
7
7
|
import {
|
|
8
8
|
asTrimmedString
|
|
9
9
|
} from "./chunk-3EUW3WEO.js";
|
|
10
|
-
import {
|
|
11
|
-
isRecord
|
|
12
|
-
} from "./chunk-KUG52IAP.js";
|
|
13
10
|
import {
|
|
14
11
|
normalizeServerOrigin
|
|
15
12
|
} from "./chunk-CF7PE763.js";
|
|
@@ -336,242 +333,6 @@ async function buildProviderExecutionPlan(args) {
|
|
|
336
333
|
};
|
|
337
334
|
}
|
|
338
335
|
|
|
339
|
-
// packages/agent-runtime/openAiCompatibleMessages.ts
|
|
340
|
-
function preserveAgentStateFields(source, target, options) {
|
|
341
|
-
const mutableTarget = target;
|
|
342
|
-
if (source.role === "assistant") {
|
|
343
|
-
if (!options?.stripReasoningContent && typeof source.reasoning_content === "string") {
|
|
344
|
-
mutableTarget.reasoning_content = source.reasoning_content;
|
|
345
|
-
}
|
|
346
|
-
if (Array.isArray(source.tool_calls)) {
|
|
347
|
-
mutableTarget.tool_calls = source.tool_calls;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
if (source.role === "tool") {
|
|
351
|
-
const toolCallId = typeof source.tool_call_id === "string" ? source.tool_call_id.trim() : typeof source.toolCallId === "string" ? source.toolCallId.trim() : "";
|
|
352
|
-
if (toolCallId) mutableTarget.tool_call_id = toolCallId;
|
|
353
|
-
}
|
|
354
|
-
return target;
|
|
355
|
-
}
|
|
356
|
-
function toOpenAiCompatibleMessages(messages, options) {
|
|
357
|
-
return messages.map(
|
|
358
|
-
(message) => preserveAgentStateFields(message, {
|
|
359
|
-
role: message.role,
|
|
360
|
-
content: message.content ?? ""
|
|
361
|
-
}, options)
|
|
362
|
-
);
|
|
363
|
-
}
|
|
364
|
-
function shouldStripReasoningContentForOutbound(provider, model) {
|
|
365
|
-
const p = provider?.trim().toLowerCase();
|
|
366
|
-
const m = model?.trim().toLowerCase();
|
|
367
|
-
if (!p || !m) return false;
|
|
368
|
-
if (p === "deepseek" || p === "nolo") return m === "deepseek-v4-flash";
|
|
369
|
-
return false;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
// packages/integrations/openai/responsesHelpers.ts
|
|
373
|
-
var RESPONSES_TOP_LEVEL_SCHEMA_KEYS = ["anyOf", "oneOf", "allOf", "enum", "not"];
|
|
374
|
-
var sanitizeResponsesParameters = (parameters) => {
|
|
375
|
-
if (!isRecord(parameters)) {
|
|
376
|
-
return parameters;
|
|
377
|
-
}
|
|
378
|
-
const next = { ...parameters };
|
|
379
|
-
for (const key of RESPONSES_TOP_LEVEL_SCHEMA_KEYS) {
|
|
380
|
-
delete next[key];
|
|
381
|
-
}
|
|
382
|
-
return next;
|
|
383
|
-
};
|
|
384
|
-
var appendTextPart = (parts, text, role) => {
|
|
385
|
-
if (!text) return;
|
|
386
|
-
const last = parts.at(-1);
|
|
387
|
-
const textType = role === "assistant" ? "output_text" : "input_text";
|
|
388
|
-
if (last?.type === textType) {
|
|
389
|
-
last.text += text;
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
parts.push({ type: textType, text });
|
|
393
|
-
};
|
|
394
|
-
var normalizeMessageParts = (content, role) => {
|
|
395
|
-
if (typeof content === "string") {
|
|
396
|
-
if (!content) return [];
|
|
397
|
-
return [
|
|
398
|
-
{
|
|
399
|
-
type: role === "assistant" ? "output_text" : "input_text",
|
|
400
|
-
text: content
|
|
401
|
-
}
|
|
402
|
-
];
|
|
403
|
-
}
|
|
404
|
-
const parts = [];
|
|
405
|
-
for (const part of content ?? []) {
|
|
406
|
-
const typedPart = part;
|
|
407
|
-
if (typedPart?.type === "text" && typeof typedPart.text === "string") {
|
|
408
|
-
appendTextPart(parts, typedPart.text, role);
|
|
409
|
-
continue;
|
|
410
|
-
}
|
|
411
|
-
if (typedPart?.type === "image_url" && typeof typedPart.image_url?.url === "string" && typedPart.image_url.url) {
|
|
412
|
-
if (role === "assistant") continue;
|
|
413
|
-
parts.push({
|
|
414
|
-
type: "input_image",
|
|
415
|
-
image_url: typedPart.image_url.url,
|
|
416
|
-
detail: typedPart.image_url.detail
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
return parts;
|
|
421
|
-
};
|
|
422
|
-
var normalizeToolOutput = (content) => {
|
|
423
|
-
if (typeof content === "string") return content;
|
|
424
|
-
return JSON.stringify(content ?? "");
|
|
425
|
-
};
|
|
426
|
-
var toResponsesTools = (tools) => {
|
|
427
|
-
if (!Array.isArray(tools) || tools.length === 0) return void 0;
|
|
428
|
-
return tools.map((tool) => {
|
|
429
|
-
const fn = tool?.function;
|
|
430
|
-
if (!fn?.name) return null;
|
|
431
|
-
return {
|
|
432
|
-
type: "function",
|
|
433
|
-
name: fn.name,
|
|
434
|
-
description: fn.description,
|
|
435
|
-
parameters: sanitizeResponsesParameters(fn.parameters),
|
|
436
|
-
strict: fn.strict
|
|
437
|
-
};
|
|
438
|
-
}).filter(Boolean);
|
|
439
|
-
};
|
|
440
|
-
var convertMessagesToResponsesInput = (messages, options) => {
|
|
441
|
-
const input = [];
|
|
442
|
-
for (const message of messages) {
|
|
443
|
-
if (!message?.role) continue;
|
|
444
|
-
if (message.role === "tool") {
|
|
445
|
-
if (!message.tool_call_id) continue;
|
|
446
|
-
input.push({
|
|
447
|
-
type: "function_call_output",
|
|
448
|
-
call_id: message.tool_call_id,
|
|
449
|
-
output: normalizeToolOutput(message.content)
|
|
450
|
-
});
|
|
451
|
-
continue;
|
|
452
|
-
}
|
|
453
|
-
const role = message.role;
|
|
454
|
-
if (role === "assistant" && !options?.stripReasoningContent && typeof message.reasoning_content === "string" && message.reasoning_content) {
|
|
455
|
-
input.push({ type: "reasoning", content: message.reasoning_content });
|
|
456
|
-
}
|
|
457
|
-
const contentParts = normalizeMessageParts(message.content, role);
|
|
458
|
-
if (contentParts.length > 0) {
|
|
459
|
-
input.push({
|
|
460
|
-
type: "message",
|
|
461
|
-
role,
|
|
462
|
-
content: contentParts
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
if (role === "assistant" && Array.isArray(message.content)) {
|
|
466
|
-
const replayImages = message.content.map((part) => part).filter(
|
|
467
|
-
(part) => part?.type === "image_url" && typeof part.image_url?.url === "string" && Boolean(part.image_url.url)
|
|
468
|
-
).map((part) => ({
|
|
469
|
-
type: "input_image",
|
|
470
|
-
image_url: part.image_url.url,
|
|
471
|
-
detail: part.image_url.detail
|
|
472
|
-
}));
|
|
473
|
-
if (replayImages.length > 0) {
|
|
474
|
-
input.push({
|
|
475
|
-
type: "message",
|
|
476
|
-
role: "user",
|
|
477
|
-
content: replayImages
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
if (role === "assistant" && Array.isArray(message.tool_calls)) {
|
|
482
|
-
for (const toolCall of message.tool_calls) {
|
|
483
|
-
if (!toolCall?.id || !toolCall.function?.name) continue;
|
|
484
|
-
input.push({
|
|
485
|
-
type: "function_call",
|
|
486
|
-
call_id: toolCall.id,
|
|
487
|
-
name: toolCall.function.name,
|
|
488
|
-
arguments: typeof toolCall.function.arguments === "string" ? toolCall.function.arguments : JSON.stringify(toolCall.function.arguments ?? {})
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
return input;
|
|
494
|
-
};
|
|
495
|
-
var extractTextFromResponseOutput = (response) => {
|
|
496
|
-
const parts = [];
|
|
497
|
-
for (const item of response?.output ?? []) {
|
|
498
|
-
if (item?.type !== "message") continue;
|
|
499
|
-
for (const content of item.content ?? []) {
|
|
500
|
-
if (content?.type === "output_text" && typeof content.text === "string") {
|
|
501
|
-
parts.push(content.text);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
return parts.join("");
|
|
506
|
-
};
|
|
507
|
-
var toDataUrl = (base64Data, mimeType) => {
|
|
508
|
-
const normalizedMimeType = asOptionalTrimmedString(mimeType) ?? "image/png";
|
|
509
|
-
return `data:${normalizedMimeType};base64,${base64Data}`;
|
|
510
|
-
};
|
|
511
|
-
var extractImagePartsFromResponseOutput = (response) => {
|
|
512
|
-
const images = [];
|
|
513
|
-
for (const item of response?.output ?? []) {
|
|
514
|
-
if (item?.type === "image_generation_call") {
|
|
515
|
-
const result = asOptionalTrimmedString(item.result);
|
|
516
|
-
if (result) {
|
|
517
|
-
const outputFormat = asOptionalTrimmedString(item.output_format);
|
|
518
|
-
images.push({
|
|
519
|
-
type: "image_url",
|
|
520
|
-
image_url: {
|
|
521
|
-
url: toDataUrl(
|
|
522
|
-
result,
|
|
523
|
-
outputFormat ? `image/${outputFormat}` : void 0
|
|
524
|
-
)
|
|
525
|
-
}
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
continue;
|
|
529
|
-
}
|
|
530
|
-
if (item?.type !== "message") continue;
|
|
531
|
-
for (const content of item.content ?? []) {
|
|
532
|
-
const result = asOptionalTrimmedString(content?.result);
|
|
533
|
-
if (content?.type === "output_image" && result) {
|
|
534
|
-
images.push({
|
|
535
|
-
type: "image_url",
|
|
536
|
-
image_url: {
|
|
537
|
-
url: toDataUrl(
|
|
538
|
-
result,
|
|
539
|
-
content.mime_type ?? content.mimeType ?? null
|
|
540
|
-
)
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
return images;
|
|
547
|
-
};
|
|
548
|
-
var extractToolCallsFromResponseOutput = (response) => {
|
|
549
|
-
const calls = [];
|
|
550
|
-
for (const item of response?.output ?? []) {
|
|
551
|
-
if (item?.type !== "function_call") continue;
|
|
552
|
-
if (!item.call_id || !item.name) continue;
|
|
553
|
-
calls.push({
|
|
554
|
-
id: item.call_id,
|
|
555
|
-
type: "function",
|
|
556
|
-
function: {
|
|
557
|
-
name: item.name,
|
|
558
|
-
arguments: typeof item.arguments === "string" ? item.arguments : JSON.stringify(item.arguments ?? {})
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
return calls;
|
|
563
|
-
};
|
|
564
|
-
|
|
565
|
-
// packages/core/chat/imageParts.ts
|
|
566
|
-
function isImageUrlPart(part) {
|
|
567
|
-
return isRecord(part) && part.type === "image_url";
|
|
568
|
-
}
|
|
569
|
-
function hasImageParts(messages) {
|
|
570
|
-
return messages.some(
|
|
571
|
-
(message) => Array.isArray(message.content) && message.content.some(isImageUrlPart)
|
|
572
|
-
);
|
|
573
|
-
}
|
|
574
|
-
|
|
575
336
|
export {
|
|
576
337
|
pickAgentRuntimeInferenceOptions,
|
|
577
338
|
isOpenAiResponsesModel,
|
|
@@ -585,15 +346,5 @@ export {
|
|
|
585
346
|
resolveAgentRuntimeLocation,
|
|
586
347
|
resolveProviderTransportDecision,
|
|
587
348
|
buildProviderAuthHeaders,
|
|
588
|
-
buildProviderExecutionPlan
|
|
589
|
-
isImageUrlPart,
|
|
590
|
-
hasImageParts,
|
|
591
|
-
preserveAgentStateFields,
|
|
592
|
-
toOpenAiCompatibleMessages,
|
|
593
|
-
shouldStripReasoningContentForOutbound,
|
|
594
|
-
toResponsesTools,
|
|
595
|
-
convertMessagesToResponsesInput,
|
|
596
|
-
extractTextFromResponseOutput,
|
|
597
|
-
extractImagePartsFromResponseOutput,
|
|
598
|
-
extractToolCallsFromResponseOutput
|
|
349
|
+
buildProviderExecutionPlan
|
|
599
350
|
};
|
|
@@ -531,8 +531,12 @@ var PLATFORM_HOSTED_KIMI_PRICE = {
|
|
|
531
531
|
output: toPlatformCredits(2.4)
|
|
532
532
|
};
|
|
533
533
|
var PLATFORM_HOSTED_KIMI_K3_PRICE = {
|
|
534
|
-
input:
|
|
535
|
-
|
|
534
|
+
input: 16,
|
|
535
|
+
// crof $2 × 8,特殊价不走通用 0.8×7 换算
|
|
536
|
+
inputCacheHit: 2,
|
|
537
|
+
// crof $0.25 × 8
|
|
538
|
+
output: 64
|
|
539
|
+
// crof $8 × 8
|
|
536
540
|
};
|
|
537
541
|
var PLATFORM_HOSTED_GLM_PRICE = {
|
|
538
542
|
input: toPlatformCredits(1.4),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-23FZYPLC.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EDV7EBOI.js";
|
|
8
8
|
import {
|
|
9
9
|
runLocalAgentTurn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YGW4G5W5.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveLocalRuntimeEnvFromPolicy
|
|
13
13
|
} from "./chunk-5CS33IBL.js";
|
|
@@ -2,24 +2,28 @@ import {
|
|
|
2
2
|
accumulateToolCallDelta,
|
|
3
3
|
extractThinkContent,
|
|
4
4
|
flushThinkParser,
|
|
5
|
+
flushToolCallTextParserIntoCallback,
|
|
6
|
+
processContentChunkWithToolCallStripping,
|
|
5
7
|
processThinkChunk
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LSFAWXKC.js";
|
|
7
9
|
import {
|
|
8
|
-
buildProviderExecutionPlan,
|
|
9
|
-
canUsePlatformChatProvider,
|
|
10
10
|
convertMessagesToResponsesInput,
|
|
11
11
|
extractTextFromResponseOutput,
|
|
12
12
|
extractToolCallsFromResponseOutput,
|
|
13
|
-
hasDirectOpenAiCompatibleProvider,
|
|
14
13
|
hasImageParts,
|
|
15
|
-
resolveAgentRuntimeLocation,
|
|
16
|
-
resolvePlatformAuthToken,
|
|
17
|
-
resolvePlatformServerUrl,
|
|
18
|
-
resolveProviderTransportDecision,
|
|
19
14
|
shouldStripReasoningContentForOutbound,
|
|
20
15
|
toOpenAiCompatibleMessages,
|
|
21
16
|
toResponsesTools
|
|
22
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KFEVY3ST.js";
|
|
18
|
+
import {
|
|
19
|
+
buildProviderExecutionPlan,
|
|
20
|
+
canUsePlatformChatProvider,
|
|
21
|
+
hasDirectOpenAiCompatibleProvider,
|
|
22
|
+
resolveAgentRuntimeLocation,
|
|
23
|
+
resolvePlatformAuthToken,
|
|
24
|
+
resolvePlatformServerUrl,
|
|
25
|
+
resolveProviderTransportDecision
|
|
26
|
+
} from "./chunk-MHSGJW4Z.js";
|
|
23
27
|
import {
|
|
24
28
|
clipCompactText
|
|
25
29
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -104,7 +108,16 @@ function applyChatCompletionDelta(parsed, state) {
|
|
|
104
108
|
}
|
|
105
109
|
const textChunk = typeof delta.content === "string" ? delta.content : "";
|
|
106
110
|
if (textChunk) {
|
|
107
|
-
const
|
|
111
|
+
const { cleanedContent, state: newState } = processContentChunkWithToolCallStripping(
|
|
112
|
+
textChunk,
|
|
113
|
+
state.toolCallTextState,
|
|
114
|
+
(name, arguments_) => accumulateToolCallDelta(state.accumulatedToolCalls, [
|
|
115
|
+
{ index: state.accumulatedToolCalls.slots.length, type: "function", function: { name, arguments: arguments_ } }
|
|
116
|
+
])
|
|
117
|
+
);
|
|
118
|
+
state.toolCallTextState = newState;
|
|
119
|
+
if (!cleanedContent) return true;
|
|
120
|
+
const parsedChunk = processThinkChunk(cleanedContent, state.thinkState);
|
|
108
121
|
state.thinkState = parsedChunk.state;
|
|
109
122
|
if (parsedChunk.content) {
|
|
110
123
|
state.content += parsedChunk.content;
|
|
@@ -118,11 +131,19 @@ function applyChatCompletionDelta(parsed, state) {
|
|
|
118
131
|
return true;
|
|
119
132
|
}
|
|
120
133
|
function flushChatCompletionStream(state) {
|
|
134
|
+
const { residualContent, state: tcState } = flushToolCallTextParserIntoCallback(
|
|
135
|
+
state.toolCallTextState,
|
|
136
|
+
(name, arguments_) => accumulateToolCallDelta(state.accumulatedToolCalls, [
|
|
137
|
+
{ index: state.accumulatedToolCalls.slots.length, type: "function", function: { name, arguments: arguments_ } }
|
|
138
|
+
])
|
|
139
|
+
);
|
|
140
|
+
state.toolCallTextState = tcState;
|
|
121
141
|
const flushed = flushThinkParser(state.thinkState);
|
|
122
142
|
state.thinkState = flushed.state;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
state.
|
|
143
|
+
const combinedContent = residualContent + (flushed.content ?? "");
|
|
144
|
+
if (combinedContent) {
|
|
145
|
+
state.content += combinedContent;
|
|
146
|
+
state.onTextDelta?.(combinedContent);
|
|
126
147
|
}
|
|
127
148
|
if (flushed.reasoning) {
|
|
128
149
|
state.reasoning += flushed.reasoning;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getAntigravityUserAgent
|
|
3
|
+
} from "./chunk-FXUSIQC2.js";
|
|
1
4
|
import {
|
|
2
5
|
writeOAuthCredential
|
|
3
6
|
} from "./chunk-JZPBVBIY.js";
|
|
@@ -167,7 +170,7 @@ var SCOPES = [
|
|
|
167
170
|
var AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
|
|
168
171
|
var TOKEN_URL = "https://oauth2.googleapis.com/token";
|
|
169
172
|
var USERINFO_URL = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json";
|
|
170
|
-
var CLOUD_CODE_ENDPOINT = "https://cloudcode-pa.googleapis.com";
|
|
173
|
+
var CLOUD_CODE_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
|
|
171
174
|
var TIER_LEGACY = "legacy-tier";
|
|
172
175
|
var PROJECT_ONBOARD_MAX_ATTEMPTS = 5;
|
|
173
176
|
var PROJECT_ONBOARD_INTERVAL_MS = 2e3;
|
|
@@ -241,7 +244,11 @@ async function onboardProjectWithRetries(fetchImpl, endpoint, headers, onboardBo
|
|
|
241
244
|
async function discoverProject(fetchImpl, accessToken, onProgress) {
|
|
242
245
|
const headers = {
|
|
243
246
|
Authorization: `Bearer ${accessToken}`,
|
|
244
|
-
"Content-Type": "application/json"
|
|
247
|
+
"Content-Type": "application/json",
|
|
248
|
+
// Google's Cloud Code Assist API validates the Antigravity client
|
|
249
|
+
// User-Agent; requests without it are rejected even with a valid token.
|
|
250
|
+
// (Matches oh-my-pi's google-antigravity.ts discoverProject.)
|
|
251
|
+
"User-Agent": getAntigravityUserAgent()
|
|
245
252
|
};
|
|
246
253
|
onProgress?.("Checking for existing project...");
|
|
247
254
|
const endpoint = CLOUD_CODE_ENDPOINT;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
clearCliLocalRuntimePreparedAgentCache
|
|
3
|
-
} from "./chunk-DPAB4FQ7.js";
|
|
4
1
|
import {
|
|
5
2
|
getReadableCliDb
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WFHXMLHZ.js";
|
|
7
4
|
import {
|
|
8
5
|
buildCreatedAgentRecord,
|
|
9
6
|
buildUpdatedAgentRecord,
|
|
@@ -12,7 +9,10 @@ import {
|
|
|
12
9
|
resolveAgentRecordFromHybridStore,
|
|
13
10
|
sanitizeAgentRecordForCliOutput,
|
|
14
11
|
writeAgentRecord
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DFCFMCY6.js";
|
|
13
|
+
import {
|
|
14
|
+
clearCliLocalRuntimePreparedAgentCache
|
|
15
|
+
} from "./chunk-23FZYPLC.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveCliAgentKeyInput
|
|
18
18
|
} from "./chunk-VHBWHNVT.js";
|