nolo-cli 0.8.0-alpha.21 → 0.8.0-alpha.24

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 (114) hide show
  1. package/{_executeModel-42U3VOVZ.js → _executeModel-2ZAPHFOX.js} +46 -43
  2. package/{action-TLI3V62L.js → action-QM2ONPYZ.js} +9 -9
  3. package/{addContentAction-57RSIIMR.js → addContentAction-UXY3GM53.js} +8 -8
  4. package/{addDialogAgentAction-G3VWEA6E.js → addDialogAgentAction-MUBYOG65.js} +10 -10
  5. package/{agentDeleteCommand-5DD2IM3J.js → agentDeleteCommand-5TFSII4Z.js} +28 -27
  6. package/{agentEmailCommands-6FACJBU4.js → agentEmailCommands-XMXWGUMZ.js} +62 -58
  7. package/{agentListCommands-I6KZYCIG.js → agentListCommands-OWEFQEY4.js} +119 -33
  8. package/{agentMachineCommands-VKLIGMZA.js → agentMachineCommands-DGHYBBFC.js} +27 -26
  9. package/{agentPullCommand-O2MTUAFR.js → agentPullCommand-N6UWRTVL.js} +3 -3
  10. package/{agentRecordCommands-7TZICYDT.js → agentRecordCommands-I433EE5F.js} +53 -49
  11. package/{agentRunCommand-L4OM23KV.js → agentRunCommand-UQSX3IGW.js} +57 -52
  12. package/{agentRunControl-K4VKNEHF.js → agentRunControl-S3G62M6C.js} +3 -3
  13. package/{agentRuntimeLocal-ZYEIPTY4.js → agentRuntimeLocal-73SVOC5U.js} +14 -12
  14. package/{agentSlice-BX7GXSNO.js → agentSlice-JQCS4LR3.js} +9 -9
  15. package/{authCommand-EB5JSOX5.js → authCommand-B6P2XYLN.js} +11 -11
  16. package/{authCommands-XPEHTKSM.js → authCommands-4YKA4GTU.js} +7 -7
  17. package/{chunk-AS4PVWA4.js → chunk-2CVZSC5L.js} +1 -1
  18. package/{chunk-JRKKFRAV.js → chunk-3HPUUWOR.js} +58 -8
  19. package/{chunk-5KLGBAAR.js → chunk-3KGTFX3T.js} +2 -13
  20. package/{chunk-IWX4UW2E.js → chunk-524BDL33.js} +89 -8
  21. package/chunk-6QFNUK2G.js +144 -0
  22. package/{chunk-4QEWT7KD.js → chunk-AISLHYDB.js} +367 -85
  23. package/{chunk-2FTTDCD4.js → chunk-AMJ7LA5D.js} +1 -1
  24. package/{chunk-I6XMPTMR.js → chunk-BFDWXLFF.js} +2 -2
  25. package/{chunk-RL776AGR.js → chunk-BKGNXJAM.js} +1 -1
  26. package/{chunk-RCSJFQPB.js → chunk-BQECZ3Q4.js} +361 -90
  27. package/{chunk-VVX233PH.js → chunk-BT37DVDA.js} +9 -9
  28. package/{chunk-ENOG22KJ.js → chunk-BT57QC5K.js} +18 -20
  29. package/chunk-BYXBJQAS.js +0 -0
  30. package/{chunk-O2ZNTTET.js → chunk-C4DZRHFJ.js} +24 -15
  31. package/{chunk-4XENYTF5.js → chunk-DS3VC4EA.js} +3 -3
  32. package/{chunk-N54XAP77.js → chunk-FVVST32H.js} +1 -1
  33. package/{chunk-P3PKED2I.js → chunk-FZ2G3I4B.js} +11 -13
  34. package/{chunk-AGFH73SK.js → chunk-G7KM6BBZ.js} +1 -1
  35. package/{chunk-2ECQG4YX.js → chunk-GROGNZOA.js} +264 -161
  36. package/chunk-IOQIOZNI.js +42 -0
  37. package/{chunk-AL2KDGR2.js → chunk-IPA2WQGY.js} +201 -98
  38. package/{chunk-7DAJ4AI4.js → chunk-IYMGQ3TN.js} +9 -2
  39. package/{chunk-CKOJQDKR.js → chunk-JEMATI63.js} +1 -1
  40. package/{chunk-7U44LYTR.js → chunk-JTINRTBT.js} +1 -1
  41. package/{chunk-4O3CARJ4.js → chunk-KTHLAJEY.js} +1 -1
  42. package/{chunk-URUUZLPA.js → chunk-L3KWEH3V.js} +8 -8
  43. package/{chunk-XBUBEFNX.js → chunk-L76QNLGU.js} +1 -1
  44. package/{chunk-UB6SN4NJ.js → chunk-LE6JAIXE.js} +6 -6
  45. package/{chunk-2JCXITPK.js → chunk-LRKEOCWY.js} +15 -15
  46. package/{chunk-5EFXE3O7.js → chunk-LTH6AVG7.js} +3 -3
  47. package/{chunk-YPRZSPF3.js → chunk-OCDEWRE2.js} +1 -1
  48. package/{chunk-6KHNO3SK.js → chunk-P2SPC3FT.js} +27 -23
  49. package/{chunk-4IJYA27C.js → chunk-PXZAAB4L.js} +4 -4
  50. package/{chunk-VUW5FBDB.js → chunk-Q7S2ORXX.js} +9 -9
  51. package/{chunk-C3RUNRHT.js → chunk-QWM7YWVT.js} +1 -1
  52. package/{chunk-25LCXTML.js → chunk-RQPZX6KP.js} +2 -2
  53. package/chunk-S3UTETIC.js +4885 -0
  54. package/{chunk-SDJDLO5W.js → chunk-SBVUZC2E.js} +5 -5
  55. package/{chunk-VX3SXJ3N.js → chunk-UBSKX3LP.js} +6 -6
  56. package/{chunk-4ZDM73SD.js → chunk-V2J635L5.js} +1 -1
  57. package/{chunk-DSZUWUYB.js → chunk-VBKJTOAW.js} +1 -1
  58. package/{chunk-FVYY6MCS.js → chunk-VUEXKW6U.js} +17 -17
  59. package/{chunk-7KCUSYT2.js → chunk-WKQGZJVI.js} +7 -7
  60. package/{chunk-GU3PEVGZ.js → chunk-WM7P5OWZ.js} +2639 -1579
  61. package/{chunk-7GNGZRLZ.js → chunk-WTBWWBSF.js} +150 -78
  62. package/{chunk-FSO5B7GH.js → chunk-WVS3GX3B.js} +2 -2
  63. package/chunk-Z3NEXVYE.js +33 -0
  64. package/{createAgentAutomationAction-RJF3N2QY.js → createAgentAutomationAction-GXZNLJZK.js} +26 -24
  65. package/{createDialogAction-DRSPS6CE.js → createDialogAction-KLW42ZGF.js} +26 -24
  66. package/{createPageAction-6B2WMNO3.js → createPageAction-IBJHE6MH.js} +26 -24
  67. package/{dbSlice-Q3TM2FJV.js → dbSlice-R5EJKZBW.js} +7 -7
  68. package/{deleteFile-OW53A6BX.js → deleteFile-WPWVZE4B.js} +5 -5
  69. package/{dialogCommands-4IX4XIZE.js → dialogCommands-7O5PUZRU.js} +23 -22
  70. package/{dialogSlice-3M7KX2TX.js → dialogSlice-GGV7PF53.js} +25 -23
  71. package/{docCreateCommands-SIL3NPGT.js → docCreateCommands-7ZO2NQQF.js} +22 -21
  72. package/{docDeleteCommands-7IOMLUS4.js → docDeleteCommands-YKIXZYBR.js} +23 -22
  73. package/{docReadCommands-FNFXUA5L.js → docReadCommands-5UDONBUL.js} +22 -21
  74. package/{docStore-SV7E34D4.js → docStore-VDWTATFH.js} +25 -23
  75. package/{docUpdateCommands-X2HNDVUC.js → docUpdateCommands-EPZIIQMY.js} +22 -21
  76. package/fetchMessages-KTNM7QAR.js +1 -1
  77. package/{getPricing-3E6UNPKL.js → getPricing-6TOZXPAU.js} +7 -3
  78. package/{handleSendMessageAction-JYETO5RZ.js → handleSendMessageAction-MMATC5V5.js} +30 -28
  79. package/index.js +74 -74
  80. package/{localDialogRead-2VRI24F4.js → localDialogRead-YSKFFRTT.js} +1 -1
  81. package/{machineCommands-RIO3RP5Q.js → machineCommands-PTHPKSIZ.js} +59 -55
  82. package/{machineWsRunDispatch-W7UYLGB5.js → machineWsRunDispatch-M5L2NVWJ.js} +51 -47
  83. package/{memoryCommands-O4MIPIWQ.js → memoryCommands-HG4WKTU7.js} +2 -2
  84. package/{models-4OPOOLFS.js → models-H524GH3U.js} +3 -2
  85. package/package.json +1 -1
  86. package/{read-GW7ZEI23.js → read-5ZMY7FKP.js} +5 -5
  87. package/{readDocTool-HUFU6OCT.js → readDocTool-2NXDK32S.js} +1 -1
  88. package/{readlineWorkspace-27JR7WPW.js → readlineWorkspace-4NXMEOHP.js} +835 -622
  89. package/{removeDialogAgentAction-CXKR4NJI.js → removeDialogAgentAction-KOLQ2R5W.js} +13 -12
  90. package/{runAgentClientLoop-HZFAPJHS.js → runAgentClientLoop-FGUYNGSA.js} +45 -42
  91. package/{runtimeDoctorCommands-LRHLPDRC.js → runtimeDoctorCommands-UWR5UDSM.js} +5 -5
  92. package/{setDialogExtraReferencesAction-6RKUSXHX.js → setDialogExtraReferencesAction-OMTEO7X6.js} +10 -10
  93. package/{setPrimaryDialogAgentAction-T3UTBEFG.js → setPrimaryDialogAgentAction-DOCIS6V4.js} +13 -12
  94. package/{settingSlice-IVKXJXMG.js → settingSlice-UWZJYDOA.js} +8 -8
  95. package/{spaceCommands-E7VOF4LO.js → spaceCommands-S3EB6TOS.js} +29 -28
  96. package/{spaceSlice-TSVROA5U.js → spaceSlice-RG2GSV7K.js} +24 -22
  97. package/{streamAgentChatTurn-3C5RQZJF.js → streamAgentChatTurn-X576C23M.js} +209 -86
  98. package/{tableCommands-O7O2LBEG.js → tableCommands-M3DJUETS.js} +10 -10
  99. package/{toolApiClient-QI3YBNWB.js → toolApiClient-C7P7YSE4.js} +2 -2
  100. package/{tools-EQDEKR6N.js → tools-HURZ2N4O.js} +33 -30
  101. package/{tuiSummaryLlmCaller-RV3THLZF.js → tuiSummaryLlmCaller-DG2LBTBX.js} +8 -6
  102. package/{updateCommands-VOSPKXFF.js → updateCommands-TC5SX42Y.js} +3 -3
  103. package/{updateDialogTitleAction-3XV7VWSZ.js → updateDialogTitleAction-62LVIAUZ.js} +28 -26
  104. package/chunk-BBYVOSU2.js +0 -792
  105. package/chunk-DCOA4QSN.js +0 -105
  106. package/{chunk-DZ3XJVET.js → chunk-3QAF2LTL.js} +3 -3
  107. package/{chunk-EHLHSX7R.js → chunk-5MMZUWSG.js} +3 -3
  108. package/{chunk-ISNCLGUZ.js → chunk-AVMJVOQY.js} +3 -3
  109. package/{chunk-UTLZINAP.js → chunk-DVRHHFEA.js} +10 -10
  110. package/{chunk-4CQLVGRV.js → chunk-ID4G2MAR.js} +3 -3
  111. package/{chunk-5MIDPSSK.js → chunk-JK7VW2FN.js} +3 -3
  112. package/{chunk-TILFE6LV.js → chunk-YOCHZD7D.js} +3 -3
  113. package/{db-HCJ5PRB5.js → db-6QED3ZVO.js} +3 -3
  114. package/{understanding-3CUQQ6SV.js → understanding-ZOESBLF3.js} +3 -3
@@ -18,7 +18,7 @@ import {
18
18
  resolveOpenAiCompatibleProviderConfig,
19
19
  shouldCacheHybridRemoteRecord,
20
20
  shouldFetchAgentRuntimeRecordRemotely
21
- } from "./chunk-O2ZNTTET.js";
21
+ } from "./chunk-C4DZRHFJ.js";
22
22
  import {
23
23
  buildPlatformChatCompletionRequest,
24
24
  canUsePlatformChatProvider,
@@ -27,24 +27,24 @@ import {
27
27
  parsePlatformChatCompletionResponse,
28
28
  resolvePlatformChatProviderConfig,
29
29
  shouldUsePlatformChatProvider
30
- } from "./chunk-5KLGBAAR.js";
30
+ } from "./chunk-3KGTFX3T.js";
31
31
  import "./chunk-ZNFJWEN4.js";
32
32
  import {
33
33
  resolveAgentRuntimeConfigFromRecord
34
- } from "./chunk-TILFE6LV.js";
34
+ } from "./chunk-YOCHZD7D.js";
35
35
  import {
36
36
  runLocalAgentTurn
37
- } from "./chunk-4QEWT7KD.js";
37
+ } from "./chunk-AISLHYDB.js";
38
38
  import "./chunk-OPZYGHUC.js";
39
- import "./chunk-AGFH73SK.js";
39
+ import "./chunk-G7KM6BBZ.js";
40
40
  import {
41
41
  pickAgentRuntimeInferenceOptions
42
- } from "./chunk-JRKKFRAV.js";
42
+ } from "./chunk-3HPUUWOR.js";
43
43
  import {
44
44
  resolveRuntimeToolSurfaceForAgent
45
- } from "./chunk-P3PKED2I.js";
45
+ } from "./chunk-FZ2G3I4B.js";
46
46
  import "./chunk-5MMAK75Q.js";
47
- import "./chunk-BBYVOSU2.js";
47
+ import "./chunk-S3UTETIC.js";
48
48
  import {
49
49
  resolveCurrentRunRuntimeToolPolicy,
50
50
  resolveLocalRuntimeEnvFromPolicy,
@@ -52,19 +52,21 @@ import {
52
52
  resolveRequestedRuntimeToolNames
53
53
  } from "./chunk-5CS33IBL.js";
54
54
  import "./chunk-JZPBVBIY.js";
55
- import "./chunk-IWX4UW2E.js";
56
- import "./chunk-DWLEOOGR.js";
57
- import "./chunk-HNMXYYJR.js";
55
+ import "./chunk-BYXBJQAS.js";
58
56
  import "./chunk-KX6YBIHG.js";
57
+ import "./chunk-524BDL33.js";
59
58
  import "./chunk-O4BU24WZ.js";
60
59
  import "./chunk-I42VC5KR.js";
61
60
  import "./chunk-WWC7I6TA.js";
62
61
  import "./chunk-QSJ3HFEF.js";
62
+ import "./chunk-DWLEOOGR.js";
63
+ import "./chunk-HNMXYYJR.js";
63
64
  import "./chunk-3EUW3WEO.js";
64
65
  import "./chunk-U6VC4MU4.js";
66
+ import "./chunk-KUG52IAP.js";
67
+ import "./chunk-4SN6J65J.js";
65
68
  import "./chunk-CF7PE763.js";
66
69
  import "./chunk-G3SUCT4W.js";
67
- import "./chunk-KUG52IAP.js";
68
70
  import "./chunk-4VNS5WPM.js";
69
71
  export {
70
72
  buildAgentRuntimeAgentLookupKeys,
@@ -7,28 +7,28 @@ import {
7
7
  slice,
8
8
  streamAgentChatTurn,
9
9
  updateAgent
10
- } from "./chunk-VUW5FBDB.js";
10
+ } from "./chunk-Q7S2ORXX.js";
11
+ import "./chunk-L3KWEH3V.js";
12
+ import "./chunk-AZPCASRE.js";
13
+ import "./chunk-JTINRTBT.js";
11
14
  import "./chunk-5CS33IBL.js";
12
15
  import "./chunk-JZPBVBIY.js";
13
- import "./chunk-URUUZLPA.js";
14
- import "./chunk-AZPCASRE.js";
15
- import "./chunk-7U44LYTR.js";
16
16
  import "./chunk-KX6YBIHG.js";
17
17
  import "./chunk-O4BU24WZ.js";
18
18
  import "./chunk-I42VC5KR.js";
19
19
  import "./chunk-WWC7I6TA.js";
20
20
  import "./chunk-QSJ3HFEF.js";
21
- import "./chunk-DSZUWUYB.js";
22
- import "./chunk-UTLZINAP.js";
21
+ import "./chunk-VBKJTOAW.js";
22
+ import "./chunk-DVRHHFEA.js";
23
23
  import "./chunk-OOSFSFMA.js";
24
24
  import "./chunk-GBRG75BQ.js";
25
- import "./chunk-4SN6J65J.js";
26
- import "./chunk-LCBAMY2M.js";
27
25
  import "./chunk-3EUW3WEO.js";
28
26
  import "./chunk-U6VC4MU4.js";
27
+ import "./chunk-KUG52IAP.js";
28
+ import "./chunk-LCBAMY2M.js";
29
+ import "./chunk-4SN6J65J.js";
29
30
  import "./chunk-CF7PE763.js";
30
31
  import "./chunk-G3SUCT4W.js";
31
- import "./chunk-KUG52IAP.js";
32
32
  import "./chunk-4VNS5WPM.js";
33
33
  export {
34
34
  createAgent,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  defaultOpenBrowser
3
- } from "./chunk-VVX233PH.js";
3
+ } from "./chunk-BT37DVDA.js";
4
4
  import "./chunk-6HYVJV7B.js";
5
5
  import {
6
6
  generateCloudflareEmailRoutingToken,
7
7
  parseFlagWithOptionalValue,
8
8
  runCloudflareOAuthLogin,
9
9
  upsertEnvVariable
10
- } from "./chunk-4IJYA27C.js";
10
+ } from "./chunk-PXZAAB4L.js";
11
11
  import {
12
12
  generatePkcePair,
13
13
  runAntigravityOAuthLogin,
@@ -17,32 +17,32 @@ import {
17
17
  runXaiOAuthDeviceCode,
18
18
  runXaiOAuthLogin,
19
19
  startCallbackServer
20
- } from "./chunk-EHLHSX7R.js";
20
+ } from "./chunk-5MMZUWSG.js";
21
21
  import "./chunk-JBTJAPUF.js";
22
22
  import {
23
23
  buildEnvFromProfile,
24
24
  loadProfileConfig
25
25
  } from "./chunk-ROWQEJRP.js";
26
- import "./chunk-ISNCLGUZ.js";
27
- import "./chunk-OLZBQWZU.js";
28
26
  import {
29
27
  createOAuthTokenStore
30
28
  } from "./chunk-JZPBVBIY.js";
29
+ import "./chunk-O4BU24WZ.js";
30
+ import "./chunk-I42VC5KR.js";
31
+ import "./chunk-WWC7I6TA.js";
32
+ import "./chunk-AVMJVOQY.js";
33
+ import "./chunk-OLZBQWZU.js";
31
34
  import {
32
35
  toErrorMessage
33
36
  } from "./chunk-HNMXYYJR.js";
34
37
  import "./chunk-H33743XH.js";
35
38
  import "./chunk-LM6IYQ3F.js";
36
- import "./chunk-O4BU24WZ.js";
37
- import "./chunk-I42VC5KR.js";
38
- import "./chunk-WWC7I6TA.js";
39
- import "./chunk-4SN6J65J.js";
40
- import "./chunk-LCBAMY2M.js";
41
39
  import "./chunk-3EUW3WEO.js";
42
40
  import "./chunk-U6VC4MU4.js";
41
+ import "./chunk-KUG52IAP.js";
42
+ import "./chunk-LCBAMY2M.js";
43
+ import "./chunk-4SN6J65J.js";
43
44
  import "./chunk-CF7PE763.js";
44
45
  import "./chunk-G3SUCT4W.js";
45
- import "./chunk-KUG52IAP.js";
46
46
  import "./chunk-4VNS5WPM.js";
47
47
 
48
48
  // packages/cli/oauth/flows/anthropic.ts
@@ -6,21 +6,21 @@ import {
6
6
  runLoginCommand,
7
7
  runLogoutCommand,
8
8
  runWhoamiCommand
9
- } from "./chunk-VVX233PH.js";
9
+ } from "./chunk-BT37DVDA.js";
10
10
  import "./chunk-6HYVJV7B.js";
11
11
  import "./chunk-JBTJAPUF.js";
12
12
  import "./chunk-ROWQEJRP.js";
13
- import "./chunk-ISNCLGUZ.js";
14
- import "./chunk-OLZBQWZU.js";
15
- import "./chunk-H33743XH.js";
16
- import "./chunk-LM6IYQ3F.js";
17
13
  import "./chunk-O4BU24WZ.js";
18
14
  import "./chunk-I42VC5KR.js";
19
15
  import "./chunk-WWC7I6TA.js";
20
- import "./chunk-4SN6J65J.js";
21
- import "./chunk-LCBAMY2M.js";
16
+ import "./chunk-AVMJVOQY.js";
17
+ import "./chunk-OLZBQWZU.js";
18
+ import "./chunk-H33743XH.js";
19
+ import "./chunk-LM6IYQ3F.js";
22
20
  import "./chunk-3EUW3WEO.js";
23
21
  import "./chunk-U6VC4MU4.js";
22
+ import "./chunk-LCBAMY2M.js";
23
+ import "./chunk-4SN6J65J.js";
24
24
  import "./chunk-CF7PE763.js";
25
25
  import "./chunk-G3SUCT4W.js";
26
26
  import "./chunk-4VNS5WPM.js";
@@ -199,7 +199,7 @@ async function readDocFunc(args, thunkApi) {
199
199
  throw new Error(`\u65E0\u6548\u7684\u9875\u9762 ID: ${id}\u3002\u9875\u9762 ID \u901A\u5E38\u4EE5 "page-" \u5F00\u5934\u3002`);
200
200
  }
201
201
  try {
202
- const { readAction } = await import("./read-GW7ZEI23.js");
202
+ const { readAction } = await import("./read-5ZMY7FKP.js");
203
203
  const pageData = await readAction({ dbKey: id }, thunkApi);
204
204
  if (!pageData) {
205
205
  throw new Error(`\u672A\u627E\u5230 ID \u4E3A ${id} \u7684\u9875\u9762\u3002`);
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  getModelConfig
3
- } from "./chunk-BBYVOSU2.js";
3
+ } from "./chunk-S3UTETIC.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";
10
13
  import {
11
14
  normalizeServerOrigin
12
15
  } from "./chunk-CF7PE763.js";
13
16
  import {
14
17
  asOptionalTrimmedString
15
18
  } from "./chunk-G3SUCT4W.js";
16
- import {
17
- isRecord
18
- } from "./chunk-KUG52IAP.js";
19
19
 
20
20
  // packages/agent-runtime/agentConfigOptions.ts
21
21
  function pickAgentRuntimeInferenceOptions(agentConfig) {
@@ -29,8 +29,35 @@ function pickAgentRuntimeInferenceOptions(agentConfig) {
29
29
  };
30
30
  }
31
31
 
32
+ // packages/agent-runtime/openAiCompatibleMessages.ts
33
+ function preserveAgentStateFields(source, target) {
34
+ const mutableTarget = target;
35
+ if (source.role === "assistant") {
36
+ if (typeof source.reasoning_content === "string") {
37
+ mutableTarget.reasoning_content = source.reasoning_content;
38
+ }
39
+ if (Array.isArray(source.tool_calls)) {
40
+ mutableTarget.tool_calls = source.tool_calls;
41
+ }
42
+ }
43
+ if (source.role === "tool") {
44
+ const toolCallId = typeof source.tool_call_id === "string" ? source.tool_call_id.trim() : typeof source.toolCallId === "string" ? source.toolCallId.trim() : "";
45
+ if (toolCallId) mutableTarget.tool_call_id = toolCallId;
46
+ }
47
+ return target;
48
+ }
49
+ function toOpenAiCompatibleMessages(messages) {
50
+ return messages.map(
51
+ (message) => preserveAgentStateFields(message, {
52
+ role: message.role,
53
+ content: message.content ?? ""
54
+ })
55
+ );
56
+ }
57
+
32
58
  // packages/agent-runtime/platformProviderEndpoints.ts
33
59
  var OPENAI_RESPONSES_ENDPOINT = "https://api.openai.com/v1/responses";
60
+ var DEEPSEEK_RESPONSES_ENDPOINT = "https://api.deepseek.com/v1/responses";
34
61
  var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
35
62
  deepinfra: "https://api.deepinfra.com/v1/openai/chat/completions",
36
63
  deepseek: "https://api.deepseek.com/chat/completions",
@@ -47,7 +74,11 @@ var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
47
74
  nolo: "https://ollama.com/v1/chat/completions"
48
75
  };
49
76
  function isOpenAiResponsesModel(args) {
50
- if (asTrimmedLowercaseString(args.provider) !== "openai") return false;
77
+ const provider = asTrimmedLowercaseString(args.provider);
78
+ if (provider === "deepseek") {
79
+ return asTrimmedLowercaseString(args.model) === "deepseek-v4-flash";
80
+ }
81
+ if (provider !== "openai") return false;
51
82
  if (args.endpointKey === "responses") return true;
52
83
  if (!args.model) return false;
53
84
  try {
@@ -56,10 +87,24 @@ function isOpenAiResponsesModel(args) {
56
87
  return false;
57
88
  }
58
89
  }
90
+ function resolvePlatformResponsesEndpoint(provider) {
91
+ switch (asTrimmedLowercaseString(provider)) {
92
+ case "openai":
93
+ return OPENAI_RESPONSES_ENDPOINT;
94
+ case "deepseek":
95
+ return DEEPSEEK_RESPONSES_ENDPOINT;
96
+ default:
97
+ return void 0;
98
+ }
99
+ }
100
+ var PLATFORM_PROVIDER_ENDPOINT_ALIASES = {
101
+ "ollama-cloud": "nolo"
102
+ };
59
103
  function resolvePlatformChatCompletionsEndpoint(provider) {
60
104
  const key = asTrimmedLowercaseString(provider);
61
105
  if (!key) return void 0;
62
- return PLATFORM_CHAT_COMPLETIONS_ENDPOINTS[key];
106
+ const aliased = PLATFORM_PROVIDER_ENDPOINT_ALIASES[key] ?? key;
107
+ return PLATFORM_CHAT_COMPLETIONS_ENDPOINTS[aliased];
63
108
  }
64
109
 
65
110
  // packages/agent-runtime/providerResolution.ts
@@ -77,7 +122,7 @@ function resolvePlatformProviderEndpoint(agentConfig) {
77
122
  model: agentConfig.model,
78
123
  endpointKey: agentConfig.endpointKey
79
124
  })) {
80
- return OPENAI_RESPONSES_ENDPOINT;
125
+ return resolvePlatformResponsesEndpoint(provider) ?? "";
81
126
  }
82
127
  const endpoint = resolvePlatformChatCompletionsEndpoint(provider);
83
128
  if (!endpoint) {
@@ -407,6 +452,9 @@ var convertMessagesToResponsesInput = (messages) => {
407
452
  continue;
408
453
  }
409
454
  const role = message.role;
455
+ if (role === "assistant" && typeof message.reasoning_content === "string" && message.reasoning_content) {
456
+ input.push({ type: "reasoning", content: message.reasoning_content });
457
+ }
410
458
  const contentParts = normalizeMessageParts(message.content, role);
411
459
  if (contentParts.length > 0) {
412
460
  input.push({
@@ -517,8 +565,10 @@ var extractToolCallsFromResponseOutput = (response) => {
517
565
 
518
566
  export {
519
567
  pickAgentRuntimeInferenceOptions,
520
- OPENAI_RESPONSES_ENDPOINT,
568
+ preserveAgentStateFields,
569
+ toOpenAiCompatibleMessages,
521
570
  isOpenAiResponsesModel,
571
+ resolvePlatformResponsesEndpoint,
522
572
  resolvePlatformChatCompletionsEndpoint,
523
573
  trimTrailingSlash,
524
574
  resolvePlatformServerUrl,
@@ -14,19 +14,9 @@ import {
14
14
  resolvePlatformAuthToken,
15
15
  resolvePlatformServerUrl,
16
16
  resolveProviderTransportDecision,
17
+ toOpenAiCompatibleMessages,
17
18
  toResponsesTools
18
- } from "./chunk-JRKKFRAV.js";
19
-
20
- // packages/agent-runtime/openAiCompatibleMessages.ts
21
- function toOpenAiCompatibleMessages(messages) {
22
- return messages.map((message) => ({
23
- role: message.role,
24
- content: message.content ?? "",
25
- ...message.tool_call_id ? { tool_call_id: message.tool_call_id } : {},
26
- ...Array.isArray(message.tool_calls) ? { tool_calls: message.tool_calls } : {},
27
- ...message.reasoning_content ? { reasoning_content: message.reasoning_content } : {}
28
- }));
29
- }
19
+ } from "./chunk-3HPUUWOR.js";
30
20
 
31
21
  // packages/agent-runtime/toolCallAccumulator.ts
32
22
  function accumulateToolCallDelta(accumulated, deltas) {
@@ -373,7 +363,6 @@ export {
373
363
  throwIfChatCompletionStreamFailed,
374
364
  applyChatCompletionDelta,
375
365
  flushChatCompletionStream,
376
- toOpenAiCompatibleMessages,
377
366
  readSseFrames,
378
367
  readSseDataValues,
379
368
  resolvePlatformChatProviderConfig,
@@ -14,6 +14,7 @@ var deepSeekModels = [
14
14
  fnCall: true,
15
15
  supportsTool: true,
16
16
  supportsReasoningEffort: true,
17
+ endpointKey: "responses",
17
18
  price: {
18
19
  input: 1,
19
20
  inputCacheHit: 0.02,
@@ -499,9 +500,6 @@ var zaiModels = [];
499
500
  var PLATFORM_HOSTED_KIMI_K3_MODEL = "kimi-k3";
500
501
  var PLATFORM_HOSTED_KIMI_K26_MODEL = "kimi-k2.6";
501
502
  var PLATFORM_HOSTED_KIMI_K27_CODE_MODEL = "kimi-k2.7-code";
502
- var OLLAMA_CLOUD_KIMI_K3_MODEL = PLATFORM_HOSTED_KIMI_K3_MODEL;
503
- var OLLAMA_CLOUD_KIMI_K26_MODEL = PLATFORM_HOSTED_KIMI_K26_MODEL;
504
- var OLLAMA_CLOUD_KIMI_K27_CODE_MODEL = PLATFORM_HOSTED_KIMI_K27_CODE_MODEL;
505
503
  var PLATFORM_HOSTED_KIMI_PROVIDER = "nolo";
506
504
  var LEGACY_OLLAMA_CLOUD_PROVIDER = "ollama-cloud";
507
505
  var isNoloHostedProvider = (provider) => {
@@ -521,6 +519,90 @@ var resolveFireworksKimiModel = (model) => {
521
519
  return model ?? "";
522
520
  };
523
521
 
522
+ // packages/ai/llm/platformHosted.ts
523
+ var PLATFORM_CREDITS_PER_USD = 7;
524
+ var EXTERNAL_API_DISCOUNT = 0.8;
525
+ var toPlatformCredits = (usdPerMillion) => Number(
526
+ (usdPerMillion * EXTERNAL_API_DISCOUNT * PLATFORM_CREDITS_PER_USD).toFixed(
527
+ 6
528
+ )
529
+ );
530
+ var PLATFORM_HOSTED_KIMI_PRICE = {
531
+ input: toPlatformCredits(0.6),
532
+ output: toPlatformCredits(2.4)
533
+ };
534
+ var PLATFORM_HOSTED_KIMI_K27_CODE_PRICE = {
535
+ input: toPlatformCredits(1.2),
536
+ output: toPlatformCredits(4.8)
537
+ };
538
+ var PLATFORM_HOSTED_KIMI_K3_PRICE = {
539
+ input: toPlatformCredits(3),
540
+ output: toPlatformCredits(15)
541
+ };
542
+ var PLATFORM_HOSTED_GLM_PRICE = {
543
+ input: toPlatformCredits(1.4),
544
+ inputCacheHit: toPlatformCredits(0.26),
545
+ output: toPlatformCredits(4.4)
546
+ };
547
+ var PLATFORM_HOSTED_GLM_52_MODEL = "glm-5.2";
548
+ var PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL = "deepseek-v4-flash";
549
+ var PLATFORM_HOSTED_DEEPSEEK_FLASH_PRICE = {
550
+ input: 1,
551
+ inputCacheHit: 0.02,
552
+ output: 2
553
+ };
554
+ var PLATFORM_HOSTED_CHAT_COMPLETIONS_URL = "https://ollama.com/v1/chat/completions";
555
+ var platformHostedModels = [
556
+ {
557
+ name: PLATFORM_HOSTED_KIMI_K3_MODEL,
558
+ displayName: "Kimi K3",
559
+ hasVision: true,
560
+ price: { ...PLATFORM_HOSTED_KIMI_K3_PRICE },
561
+ maxOutputTokens: 262144,
562
+ contextWindow: 1e6,
563
+ supportsTool: true,
564
+ supportsReasoningEffort: true
565
+ },
566
+ {
567
+ name: PLATFORM_HOSTED_KIMI_K26_MODEL,
568
+ displayName: "Kimi K2.6",
569
+ hasVision: true,
570
+ price: { ...PLATFORM_HOSTED_KIMI_PRICE },
571
+ maxOutputTokens: 262144,
572
+ contextWindow: 262144,
573
+ supportsTool: true
574
+ },
575
+ {
576
+ name: PLATFORM_HOSTED_KIMI_K27_CODE_MODEL,
577
+ displayName: "Kimi K2.7 Coding",
578
+ hasVision: true,
579
+ price: { ...PLATFORM_HOSTED_KIMI_K27_CODE_PRICE },
580
+ maxOutputTokens: 262144,
581
+ contextWindow: 256e3,
582
+ supportsTool: true
583
+ },
584
+ {
585
+ name: PLATFORM_HOSTED_GLM_52_MODEL,
586
+ displayName: "GLM 5.2",
587
+ hasVision: false,
588
+ price: { ...PLATFORM_HOSTED_GLM_PRICE },
589
+ maxOutputTokens: 131072,
590
+ contextWindow: 1e6,
591
+ supportsTool: true,
592
+ supportsReasoningEffort: true
593
+ },
594
+ {
595
+ name: PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
596
+ displayName: "DeepSeek V4 Flash",
597
+ hasVision: false,
598
+ price: { ...PLATFORM_HOSTED_DEEPSEEK_FLASH_PRICE },
599
+ maxOutputTokens: 384e3,
600
+ contextWindow: 1e6,
601
+ supportsTool: true,
602
+ supportsReasoningEffort: true
603
+ }
604
+ ];
605
+
524
606
  export {
525
607
  deepSeekModels,
526
608
  googleModels,
@@ -529,17 +611,16 @@ export {
529
611
  deepinfraModels,
530
612
  xaiModels,
531
613
  fireworksModels,
532
- PLATFORM_HOSTED_KIMI_K3_MODEL,
533
614
  PLATFORM_HOSTED_KIMI_K26_MODEL,
534
- PLATFORM_HOSTED_KIMI_K27_CODE_MODEL,
535
- OLLAMA_CLOUD_KIMI_K3_MODEL,
536
- OLLAMA_CLOUD_KIMI_K26_MODEL,
537
- OLLAMA_CLOUD_KIMI_K27_CODE_MODEL,
538
615
  PLATFORM_HOSTED_KIMI_PROVIDER,
539
616
  isNoloHostedProvider,
540
617
  isFireworksKimiModel,
541
618
  isDeepInfraKimiModel,
542
619
  resolveFireworksKimiModel,
620
+ PLATFORM_HOSTED_GLM_PRICE,
621
+ PLATFORM_HOSTED_GLM_52_MODEL,
622
+ PLATFORM_HOSTED_CHAT_COMPLETIONS_URL,
623
+ platformHostedModels,
543
624
  getCloudflareWorkersAiChatCompletionsUrl,
544
625
  cloudflareModels,
545
626
  GMI_CHAT_COMPLETIONS_URL,
@@ -0,0 +1,144 @@
1
+ import {
2
+ getModelAbility
3
+ } from "./chunk-Z3NEXVYE.js";
4
+
5
+ // packages/ai/agent/safeAgentSummary.ts
6
+ function parseTimestamp(val) {
7
+ if (typeof val === "number" && Number.isFinite(val)) return val;
8
+ if (typeof val === "string") return Date.parse(val) || 0;
9
+ return 0;
10
+ }
11
+ function safeTimestamp(val) {
12
+ if (typeof val === "number" && Number.isFinite(val)) return val;
13
+ if (typeof val === "string") return val;
14
+ return null;
15
+ }
16
+ function parseAgentRecordId(privateKey, explicitId) {
17
+ if (explicitId && typeof explicitId === "string" && explicitId.trim()) {
18
+ return explicitId.trim();
19
+ }
20
+ if (privateKey && typeof privateKey === "string") {
21
+ const match = privateKey.match(/^agent-[^-]+-(.+)$/i);
22
+ if (match?.[1]) return match[1];
23
+ }
24
+ return null;
25
+ }
26
+ function resolveFavoriteStatus(record, options) {
27
+ if (options?.isFavorite !== void 0) {
28
+ return {
29
+ isFavorite: !!options.isFavorite,
30
+ favoritedAt: safeTimestamp(options.favoritedAt)
31
+ };
32
+ }
33
+ if (record?.isFavorite === true) {
34
+ return {
35
+ isFavorite: true,
36
+ favoritedAt: safeTimestamp(record?.favoritedAt)
37
+ };
38
+ }
39
+ const favoritesMap = options?.favoritesMap;
40
+ if (!favoritesMap) {
41
+ return { isFavorite: false, favoritedAt: null };
42
+ }
43
+ const candidateKeys = [];
44
+ if (typeof record?.dbKey === "string" && record.dbKey) candidateKeys.push(record.dbKey);
45
+ if (typeof record?.privateKey === "string" && record.privateKey) candidateKeys.push(record.privateKey);
46
+ if (typeof record?.publicKey === "string" && record.publicKey) candidateKeys.push(record.publicKey);
47
+ if (typeof record?.id === "string" && record.id) {
48
+ candidateKeys.push(record.id);
49
+ candidateKeys.push(`agent-pub-${record.id}`);
50
+ if (options?.userId) {
51
+ candidateKeys.push(`agent-${options.userId}-${record.id}`);
52
+ }
53
+ }
54
+ let matched = false;
55
+ let highestFavAt = null;
56
+ let highestFavTime = -1;
57
+ for (const key of candidateKeys) {
58
+ const val = favoritesMap instanceof Map ? favoritesMap.get(key) : favoritesMap[key];
59
+ if (val !== void 0 && val !== false && val !== null) {
60
+ const favAt = val === true ? 1 : safeTimestamp(val);
61
+ if (favAt === null) continue;
62
+ matched = true;
63
+ const time = parseTimestamp(favAt);
64
+ if (time > highestFavTime) {
65
+ highestFavTime = time;
66
+ highestFavAt = favAt;
67
+ }
68
+ }
69
+ }
70
+ if (matched) {
71
+ return {
72
+ isFavorite: true,
73
+ favoritedAt: highestFavAt ?? 1
74
+ };
75
+ }
76
+ return { isFavorite: false, favoritedAt: null };
77
+ }
78
+ function toSafeAgentSummary(record, options) {
79
+ const rawId = parseAgentRecordId(
80
+ typeof record?.privateKey === "string" ? record.privateKey : record?.dbKey,
81
+ typeof record?.id === "string" ? record.id : void 0
82
+ );
83
+ const id = rawId ?? (typeof record?.id === "string" ? record.id : null);
84
+ let publicKey = null;
85
+ if (typeof record?.publicKey === "string" && record.publicKey) {
86
+ publicKey = record.publicKey;
87
+ } else if (id) {
88
+ publicKey = `agent-pub-${id}`;
89
+ }
90
+ const name = typeof record?.name === "string" && record.name ? record.name : "(unnamed)";
91
+ const handle = typeof record?.handle === "string" && record.handle ? record.handle : null;
92
+ const introduction = typeof record?.introduction === "string" && record.introduction ? record.introduction : typeof record?.description === "string" && record.description ? record.description : null;
93
+ const model = typeof record?.model === "string" && record.model ? record.model : null;
94
+ const provider = typeof record?.provider === "string" && record.provider ? record.provider : typeof record?.apiSource === "string" && record.apiSource ? record.apiSource : null;
95
+ const apiSource = typeof record?.apiSource === "string" && record.apiSource ? record.apiSource : null;
96
+ const cliProvider = typeof record?.cliProvider === "string" && record.cliProvider ? record.cliProvider : null;
97
+ const tools = Array.isArray(record?.tools) ? record.tools.filter((t) => typeof t === "string") : [];
98
+ const inputPrice = typeof record?.inputPrice === "number" && Number.isFinite(record.inputPrice) ? record.inputPrice : null;
99
+ const outputPrice = typeof record?.outputPrice === "number" && Number.isFinite(record.outputPrice) ? record.outputPrice : null;
100
+ const modelAbility = model ? getModelAbility(model) ?? null : null;
101
+ const favStatus = resolveFavoriteStatus(record, options);
102
+ const isPublic = record?.isPublic === true || record?.isPublicFlag === true || record?.publicRecordExists === true;
103
+ const updatedAt = safeTimestamp(record?.updatedAt ?? record?.createdAt ?? record?.created);
104
+ return {
105
+ id,
106
+ publicKey,
107
+ name,
108
+ handle,
109
+ introduction,
110
+ model,
111
+ provider,
112
+ apiSource,
113
+ cliProvider,
114
+ tools,
115
+ inputPrice,
116
+ outputPrice,
117
+ modelAbility,
118
+ isFavorite: favStatus.isFavorite,
119
+ favoritedAt: favStatus.favoritedAt,
120
+ isPublic,
121
+ updatedAt
122
+ };
123
+ }
124
+ function sortSafeAgentSummaries(agents) {
125
+ return [...agents].sort((left, right) => {
126
+ const leftFav = left.isFavorite === true;
127
+ const rightFav = right.isFavorite === true;
128
+ if (leftFav && !rightFav) return -1;
129
+ if (!leftFav && rightFav) return 1;
130
+ if (leftFav && rightFav) {
131
+ const leftFavAt = parseTimestamp(left.favoritedAt);
132
+ const rightFavAt = parseTimestamp(right.favoritedAt);
133
+ if (leftFavAt !== rightFavAt) return rightFavAt - leftFavAt;
134
+ }
135
+ const leftUpdated = parseTimestamp(left.updatedAt ?? left.createdAt);
136
+ const rightUpdated = parseTimestamp(right.updatedAt ?? right.createdAt);
137
+ return rightUpdated - leftUpdated;
138
+ });
139
+ }
140
+
141
+ export {
142
+ toSafeAgentSummary,
143
+ sortSafeAgentSummaries
144
+ };