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.
Files changed (134) hide show
  1. package/{_executeModel-AVCA2NAV.js → _executeModel-X5PCIZN6.js} +50 -44
  2. package/{action-F5JACQBG.js → action-LT7BRFLK.js} +10 -9
  3. package/{addContentAction-AQXEYRBE.js → addContentAction-PL3KKBDH.js} +9 -8
  4. package/{addDialogAgentAction-EJHHJZWW.js → addDialogAgentAction-FCMSKYAF.js} +8 -7
  5. package/{agentDeleteCommand-QW5PUMDQ.js → agentDeleteCommand-2BZDQV36.js} +32 -29
  6. package/{agentEmailCommands-4ORVLGVQ.js → agentEmailCommands-2QJDGRMB.js} +62 -56
  7. package/{agentListCommands-YWBYRTYC.js → agentListCommands-6VEPTKBI.js} +31 -28
  8. package/{agentMachineCommands-JSQW4FOA.js → agentMachineCommands-NVVHNWYI.js} +30 -27
  9. package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
  10. package/{agentRecordCommands-AASIWOBT.js → agentRecordCommands-4GGRDMD4.js} +57 -51
  11. package/{agentRunCommand-TB5BHXUH.js → agentRunCommand-XOLQNKBZ.js} +63 -54
  12. package/{agentRunControl-6ADXVYMR.js → agentRunControl-Y5AFH5PQ.js} +24 -1
  13. package/{agentRuntimeLocal-QNPNJRVH.js → agentRuntimeLocal-7WYWCGL4.js} +25 -22
  14. package/{agentSlice-RUNXC62Y.js → agentSlice-EAXPGEYV.js} +9 -8
  15. package/appDeleteCommands-77KR2RJ4.js +127 -0
  16. package/appDeployCommands-K7CAHGBI.js +166 -0
  17. package/appDeployStatusCommands-4OEKLTBT.js +147 -0
  18. package/appGetCommands-VM2WDLAZ.js +122 -0
  19. package/appListCommands-GX6BBA6U.js +125 -0
  20. package/{authCommand-YFTR3347.js → authCommand-DY6UUL6O.js} +16 -9
  21. package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
  22. package/{chunk-DPAB4FQ7.js → chunk-23FZYPLC.js} +1608 -212
  23. package/{chunk-LPEUV5RE.js → chunk-34WPV75U.js} +23 -2
  24. package/{chunk-XPC5C7BK.js → chunk-3ND52WIL.js} +2 -2
  25. package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
  26. package/{chunk-3OIRVWXA.js → chunk-3ZX7PERL.js} +10 -1
  27. package/{chunk-KKY4B2Q2.js → chunk-4PWB7JRR.js} +4 -1
  28. package/{chunk-6N4KODMN.js → chunk-4T5F7YZQ.js} +1 -1
  29. package/chunk-7BUYEZ6U.js +671 -0
  30. package/{chunk-AS3ZQ3O2.js → chunk-7OBMZCRD.js} +1 -1
  31. package/{chunk-IGXREZW2.js → chunk-AHCY2S2I.js} +1 -1
  32. package/{chunk-QLUFR47U.js → chunk-AL2V7U3E.js} +1 -1
  33. package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
  34. package/{chunk-AUURUT6L.js → chunk-BV4VEE3W.js} +264 -424
  35. package/{chunk-FRV6A633.js → chunk-CZ6NYQTV.js} +13 -4
  36. package/{chunk-PCTUYVUM.js → chunk-DFCFMCY6.js} +10 -3
  37. package/{chunk-JTMNCCWF.js → chunk-DKZFOK24.js} +16 -87
  38. package/chunk-DL6EPNIK.js +50 -0
  39. package/{chunk-ZQBL7LIC.js → chunk-EDV7EBOI.js} +317 -216
  40. package/{chunk-IWLUTMYX.js → chunk-ELT65PZW.js} +2 -2
  41. package/chunk-FQZZLA3C.js +223 -0
  42. package/{chunk-55NSNCFM.js → chunk-FXUSIQC2.js} +1 -1
  43. package/{chunk-MR6ISAGB.js → chunk-G5U6LDLG.js} +6 -6
  44. package/chunk-GFUIQ4RY.js +136 -0
  45. package/{chunk-NVEWUJVX.js → chunk-HEGV7BH3.js} +1 -1
  46. package/{chunk-BEBNFWDU.js → chunk-HWW2M4SN.js} +3 -3
  47. package/{chunk-4L2OJPCU.js → chunk-I2ZJKTG5.js} +58 -8
  48. package/{chunk-Z5JQNBNY.js → chunk-IYEXFJPC.js} +34 -15
  49. package/{setDialogExtraReferencesAction-LR6MSIXO.js → chunk-JLA4FXYC.js} +2 -17
  50. package/chunk-KFEVY3ST.js +255 -0
  51. package/{chunk-4FX6NVDW.js → chunk-L4F3I4SR.js} +3 -136
  52. package/{chunk-XBS2WYJ2.js → chunk-LLWKHDG4.js} +1 -1
  53. package/{chunk-3WGLLTK4.js → chunk-LSFAWXKC.js} +100 -3
  54. package/{chunk-6EVITP2G.js → chunk-MHSGJW4Z.js} +2 -251
  55. package/{chunk-O6W2O2DA.js → chunk-MKA6QE5E.js} +6 -2
  56. package/{chunk-DGEYDWEZ.js → chunk-MPVYDS7I.js} +3 -3
  57. package/{chunk-KFHN5NGJ.js → chunk-MVQ4TBSD.js} +1 -1
  58. package/{chunk-AVVZUXXC.js → chunk-N54HIJVJ.js} +34 -13
  59. package/{chunk-EHLHSX7R.js → chunk-OK6YSWLH.js} +9 -2
  60. package/{chunk-33BJUVK4.js → chunk-PIZYJVHQ.js} +5 -5
  61. package/{chunk-RLCXU7A5.js → chunk-PJSV3IZ5.js} +1 -1
  62. package/{chunk-7UKFVQ5W.js → chunk-R35XMF6F.js} +126 -41
  63. package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
  64. package/{chunk-S2LXHNHG.js → chunk-REA4JLBH.js} +6 -6
  65. package/chunk-RQN4SEKL.js +107 -0
  66. package/{chunk-EABWT43X.js → chunk-RVOUXDFU.js} +5 -5
  67. package/{chunk-NSCHQQPU.js → chunk-SCTYAHYK.js} +470 -325
  68. package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
  69. package/{chunk-M43KDE25.js → chunk-SWDPIPOY.js} +2 -8
  70. package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
  71. package/{chunk-66X4VSRC.js → chunk-UAIVG4J6.js} +42 -2
  72. package/{chunk-3663CXZN.js → chunk-UBHAWFQ6.js} +143 -31
  73. package/{chunk-YJKXGHJ6.js → chunk-UGUW3FHG.js} +4 -4
  74. package/{chunk-P3RIAYGG.js → chunk-V3ED5AWK.js} +3 -3
  75. package/chunk-V5R4NZP2.js +78 -0
  76. package/{chunk-4IJYA27C.js → chunk-VDXCXCXH.js} +1 -1
  77. package/{chunk-MYMMNKYL.js → chunk-VNAEBGDK.js} +156 -6
  78. package/{chunk-FY233ZFU.js → chunk-VYHDJEQD.js} +110 -192
  79. package/{chunk-W4NVOSFF.js → chunk-WFHXMLHZ.js} +1 -1
  80. package/{chunk-H33743XH.js → chunk-WJRJDX2W.js} +1 -1
  81. package/chunk-X4Q4UZEY.js +26 -0
  82. package/{chunk-RPDGJO4D.js → chunk-XHG22OEX.js} +4 -4
  83. package/{chunk-DVRHHFEA.js → chunk-XMLRJUU5.js} +1 -1
  84. package/{chunk-3S2VOMIF.js → chunk-XRZJGPFI.js} +7 -7
  85. package/{chunk-GSINCD4P.js → chunk-YGW4G5W5.js} +25 -12
  86. package/chunk-ZZ2MH7LE.js +84 -0
  87. package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
  88. package/codingSkills-36KN5NQT.js +48 -0
  89. package/{createAgentAutomationAction-FNHPSKKO.js → createAgentAutomationAction-GNFF524X.js} +20 -19
  90. package/{createDialogAction-TZCVQ3NU.js → createDialogAction-RB55KCLO.js} +22 -21
  91. package/{createPageAction-EIGZ3BKT.js → createPageAction-Y7343GLU.js} +26 -25
  92. package/{db-HCJ5PRB5.js → db-W3O47YGF.js} +38 -12
  93. package/{dbSlice-7KQH6GOU.js → dbSlice-CGSRFJN3.js} +8 -7
  94. package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
  95. package/{dialogCommands-FO77J5DQ.js → dialogCommands-IAZK6YHQ.js} +30 -27
  96. package/{dialogSlice-MM5U4KE2.js → dialogSlice-UQAXF23P.js} +20 -19
  97. package/{docCreateCommands-I3BS3AZI.js → docCreateCommands-I2EWZGCI.js} +33 -28
  98. package/{docDeleteCommands-Q2OPV52P.js → docDeleteCommands-IZ45UZKG.js} +32 -27
  99. package/{docReadCommands-YOOFACYZ.js → docReadCommands-R6Z4QJYU.js} +31 -26
  100. package/{docStore-NGYQ2JTR.js → docStore-5HOJ4D7D.js} +21 -20
  101. package/{docUpdateCommands-2B32ITHN.js → docUpdateCommands-2LRBKQPY.js} +32 -27
  102. package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
  103. package/{getPricing-P4XRJRZB.js → getPricing-G7DLAST6.js} +3 -3
  104. package/{handleSendMessageAction-JRZWWBKP.js → handleSendMessageAction-Q4HY35WX.js} +21 -20
  105. package/index.js +95 -64
  106. package/{localDialogRead-2VRI24F4.js → localDialogRead-4H3QJFLW.js} +2 -2
  107. package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
  108. package/{machineCommands-WRWF2ICZ.js → machineCommands-PKBPQKTY.js} +63 -57
  109. package/{machineWsRunDispatch-ZX7Q3TWZ.js → machineWsRunDispatch-UZAW4OXJ.js} +55 -49
  110. package/{models-WQ5N4OJM.js → models-DJFSJ7SW.js} +2 -2
  111. package/package.json +1 -1
  112. package/queryRunOverlay-O4LOMMPO.js +161 -0
  113. package/{read-CN3TNXIP.js → read-3FMPZPER.js} +3 -3
  114. package/{readDocTool-WF3675ED.js → readDocTool-VSYHKK3V.js} +1 -1
  115. package/{readlineWorkspace-ZTGRGW46.js → readlineWorkspace-Y2RDOFZG.js} +762 -218
  116. package/{removeDialogAgentAction-YDHBFEGI.js → removeDialogAgentAction-OAGA2G3U.js} +10 -9
  117. package/{runAgentClientLoop-JZCOP7LG.js → runAgentClientLoop-NBPIKJ6J.js} +44 -38
  118. package/runOverlayPresentation-ZO4VCWEU.js +11 -0
  119. package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
  120. package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
  121. package/{setPrimaryDialogAgentAction-IIVDCY5C.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +26 -17
  122. package/{settingSlice-O23YDK2O.js → settingSlice-7MNKHZ6R.js} +9 -8
  123. package/{skillDiscovery-6M2BZUFN.js → skillDiscovery-KJWT7JBU.js} +3 -3
  124. package/{spaceCommands-VV4GTPQK.js → spaceCommands-DHCZ7J5I.js} +31 -28
  125. package/{spaceSlice-DRWWZJP7.js → spaceSlice-ZXLLG3CR.js} +20 -19
  126. package/{streamAgentChatTurn-Y6WGATQR.js → streamAgentChatTurn-L3YW6LSB.js} +98 -57
  127. package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
  128. package/{tools-PUNBY3AH.js → tools-ECGXR5QF.js} +33 -28
  129. package/{tuiSummaryLlmCaller-F64WLSAF.js → tuiSummaryLlmCaller-OMSCNHXA.js} +6 -5
  130. package/types-ZSTJ7MPR.js +7 -0
  131. package/{updateDialogTitleAction-YSR4TCMB.js → updateDialogTitleAction-HQ2EUDFT.js} +23 -22
  132. package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
  133. package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
  134. package/{localRuntimeAuthority-TEGCOWX4.js → localRuntimeAuthority-4IXJCHZ7.js} +3 -3
@@ -1,15 +1,12 @@
1
1
  import {
2
2
  getModelConfig
3
- } from "./chunk-66X4VSRC.js";
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: toPlatformCredits(3),
535
- output: toPlatformCredits(15)
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-DPAB4FQ7.js";
4
+ } from "./chunk-23FZYPLC.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-ZQBL7LIC.js";
7
+ } from "./chunk-EDV7EBOI.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-GSINCD4P.js";
10
+ } from "./chunk-YGW4G5W5.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-5CS33IBL.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_AGENT_BASE_POLICY,
3
3
  DEFAULT_USER_PREFERENCE_PROFILE
4
- } from "./chunk-EABWT43X.js";
4
+ } from "./chunk-RVOUXDFU.js";
5
5
 
6
6
  // packages/ai/policy/runtimePolicy.ts
7
7
  var clampLevel = (value, fallback) => {
@@ -2,24 +2,28 @@ import {
2
2
  accumulateToolCallDelta,
3
3
  extractThinkContent,
4
4
  flushThinkParser,
5
+ flushToolCallTextParserIntoCallback,
6
+ processContentChunkWithToolCallStripping,
5
7
  processThinkChunk
6
- } from "./chunk-3WGLLTK4.js";
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-6EVITP2G.js";
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 parsedChunk = processThinkChunk(textChunk, state.thinkState);
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
- if (flushed.content) {
124
- state.content += flushed.content;
125
- state.onTextDelta?.(flushed.content);
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-W4NVOSFF.js";
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-PCTUYVUM.js";
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";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-CWMSB67P.js";
7
7
  import {
8
8
  getModelConfig
9
- } from "./chunk-66X4VSRC.js";
9
+ } from "./chunk-UAIVG4J6.js";
10
10
  import {
11
11
  asOptionalFiniteNumber
12
12
  } from "./chunk-WWC7I6TA.js";