nolo-cli 0.25.2 → 0.26.2

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 (81) hide show
  1. package/README.md +9 -18
  2. package/{_executeModel-LXNDVFT2.js → _executeModel-ZPNYAEFW.js} +18 -18
  3. package/{agentDeleteCommand-DMAYEVOP.js → agentDeleteCommand-5ZV4433K.js} +12 -12
  4. package/{agentEmailCommands-RVGRDAD6.js → agentEmailCommands-Z7KOYDVQ.js} +23 -23
  5. package/{agentListCommands-SMW3NENV.js → agentListCommands-UQUXJYUN.js} +14 -14
  6. package/{agentMachineCommands-VGE5A52U.js → agentMachineCommands-53O6P6L5.js} +12 -12
  7. package/{agentRecordCommands-UHFL5OLB.js → agentRecordCommands-ZRYNBSSS.js} +22 -22
  8. package/{agentRunCommand-GG4Z735K.js → agentRunCommand-B73MKVOG.js} +22 -22
  9. package/{agentRuntimeLocal-7N2SUWO2.js → agentRuntimeLocal-GVNERRKQ.js} +11 -9
  10. package/{agentSlice-WY7SEYXO.js → agentSlice-OJBHIL34.js} +1 -1
  11. package/{appDeleteCommands-AUC7KDHU.js → appDeleteCommands-23Z3Z6KE.js} +13 -13
  12. package/{appDeployCommands-OVYWXTNP.js → appDeployCommands-3MFAR4Z7.js} +13 -13
  13. package/{appDeployStatusCommands-DNUCH3KK.js → appDeployStatusCommands-JHU6GSN4.js} +13 -13
  14. package/{appGetCommands-4DLM2P37.js → appGetCommands-24J55H2Y.js} +13 -13
  15. package/{appListCommands-CL4VLCZW.js → appListCommands-HE5KP3PH.js} +13 -13
  16. package/{authCommand-W2BDNL4D.js → authCommand-KGRK6MNU.js} +8 -8
  17. package/{authCommands-NYZM2B2I.js → authCommands-JSOG2H4E.js} +2 -2
  18. package/{chunk-OBO5YB35.js → chunk-5DWZ46RJ.js} +1 -1
  19. package/{chunk-E2VQTGUO.js → chunk-5EDKWSQN.js} +8 -8
  20. package/{chunk-B6RCQ4BM.js → chunk-AAWJ5S3G.js} +1 -1
  21. package/{chunk-THN2YFSR.js → chunk-ADE6577S.js} +62 -17
  22. package/{chunk-SDDOGQ6M.js → chunk-AOPOTHFK.js} +1 -1
  23. package/{chunk-OTIS3VY6.js → chunk-AZW5AHMW.js} +1 -1
  24. package/{chunk-7HD7MCCZ.js → chunk-CV6BM7LU.js} +1 -1
  25. package/{chunk-ACBCDO2E.js → chunk-CWTT2NZ6.js} +2 -2
  26. package/{chunk-OHK3HE4G.js → chunk-CZHE6LLV.js} +74 -11
  27. package/{chunk-35RYGII3.js → chunk-FXFGNOT2.js} +67 -1
  28. package/{chunk-T3EOQH72.js → chunk-G36SUBHA.js} +14 -4
  29. package/{chunk-QJZJW65A.js → chunk-GD23ZX7Z.js} +3 -3
  30. package/{chunk-DXJS7VSG.js → chunk-GE6IWA5N.js} +9 -2
  31. package/{chunk-P5AVCQF3.js → chunk-GGB6MPHD.js} +19 -18
  32. package/{chunk-NZXRTSOY.js → chunk-GNGOZMU2.js} +2 -2
  33. package/{chunk-6NUG4BJE.js → chunk-J2WT5CEO.js} +1 -1
  34. package/{chunk-XJBAAOKS.js → chunk-JJ2WUBFN.js} +1 -1
  35. package/{chunk-ONGWRXVA.js → chunk-KURQBS7S.js} +1 -1
  36. package/{chunk-J6MEBHAT.js → chunk-LEHTC2FI.js} +1 -1
  37. package/{chunk-6OMNSBFW.js → chunk-LLDGWLML.js} +8 -8
  38. package/{chunk-MSBHAQVV.js → chunk-MCXQNEJ3.js} +1 -1
  39. package/{chunk-WV3WZRYZ.js → chunk-P3RZ6DHN.js} +74 -15
  40. package/{chunk-5IIJMMC3.js → chunk-PMCKFQYC.js} +1 -1
  41. package/{chunk-UTADKKM7.js → chunk-PTKI7TIN.js} +101 -23
  42. package/{chunk-5UI2CDQG.js → chunk-PXPISYEH.js} +14 -9
  43. package/{chunk-LWHK7TZR.js → chunk-PY7VGC5M.js} +24 -5
  44. package/{chunk-C4JWF4EX.js → chunk-RM464B7I.js} +2 -2
  45. package/{chunk-2KPE5HQM.js → chunk-S7AV3NCK.js} +47 -14
  46. package/{chunk-5TAM6OX3.js → chunk-SIUEKVK4.js} +136 -41
  47. package/{chunk-XR6PNQ3N.js → chunk-TLYHUIWF.js} +3 -3
  48. package/{chunk-RRJD2ZUV.js → chunk-TNM27YZ7.js} +3 -3
  49. package/{chunk-J3HWN4B5.js → chunk-TWA4L7J7.js} +1 -1
  50. package/{chunk-UZH44DWK.js → chunk-WCP5FDTF.js} +13 -20
  51. package/{chunk-4POUK2BV.js → chunk-WSQLK2KR.js} +1 -1
  52. package/{chunk-OMWJXZSZ.js → chunk-XNZJVYFS.js} +1 -1
  53. package/{chunk-KF3VWOQ6.js → chunk-YJY7HODU.js} +1 -1
  54. package/{chunk-DZNONG7L.js → chunk-ZFL3LTU7.js} +2 -2
  55. package/{createAgentAutomationAction-B5G57KMG.js → createAgentAutomationAction-PO62NUR7.js} +6 -6
  56. package/{createDialogAction-SYKO3ACQ.js → createDialogAction-ORFRYI3C.js} +7 -7
  57. package/{createPageAction-UBO6CXTT.js → createPageAction-XWVMNTYH.js} +6 -6
  58. package/{dialogCommands-FQPSK7QE.js → dialogCommands-XTJHROXM.js} +13 -13
  59. package/{dialogSlice-OFGPXYFS.js → dialogSlice-DJXC53YW.js} +6 -6
  60. package/{docCreateCommands-ELKBZBHI.js → docCreateCommands-T2XRVXYS.js} +12 -12
  61. package/{docDeleteCommands-R6X3FKHX.js → docDeleteCommands-L7RXFXY3.js} +13 -13
  62. package/{docReadCommands-QNVUXQNM.js → docReadCommands-M5PYNADQ.js} +12 -12
  63. package/{docStore-WFMCDOGV.js → docStore-6LKLLFDW.js} +7 -7
  64. package/{docUpdateCommands-OOR4CWYI.js → docUpdateCommands-OA5EGPLQ.js} +12 -12
  65. package/{getPricing-ZOASM7TQ.js → getPricing-6C3C47Y4.js} +3 -3
  66. package/{handleSendMessageAction-R3AP5MQY.js → handleSendMessageAction-ILFGZTN5.js} +6 -6
  67. package/index.js +68 -68
  68. package/{machineCommands-FPZ2UVCS.js → machineCommands-AKAQGPAO.js} +21 -21
  69. package/{machineWsRunDispatch-XAVKPZLL.js → machineWsRunDispatch-RSBERM64.js} +21 -21
  70. package/{models-DUNBMXRQ.js → models-ILWKIX2Y.js} +2 -2
  71. package/package.json +1 -1
  72. package/{readlineWorkspace-O3D2LRYG.js → readlineWorkspace-TUH3SFHO.js} +112 -62
  73. package/{runAgentClientLoop-UWNABHIZ.js → runAgentClientLoop-C3QB2EXV.js} +15 -15
  74. package/{spaceCommands-L6R7DD2L.js → spaceCommands-SXYOFGUJ.js} +12 -12
  75. package/{spaceSlice-2UQAI6GT.js → spaceSlice-6BHMRP5O.js} +6 -6
  76. package/{streamAgentChatTurn-SS62OWZZ.js → streamAgentChatTurn-GF5W5OIP.js} +18 -18
  77. package/{tableCommands-HEQYT2KP.js → tableCommands-QSZILI7I.js} +1 -1
  78. package/{tools-NVSLAOK4.js → tools-KBCLJ43G.js} +11 -11
  79. package/{tuiSummaryLlmCaller-A7OO23I4.js → tuiSummaryLlmCaller-ARIMGILF.js} +4 -4
  80. package/{updateCommands-HTCOBXCA.js → updateCommands-AK2RDOFR.js} +8 -2
  81. package/{updateDialogTitleAction-WMWZQ764.js → updateDialogTitleAction-LMHZUY4Q.js} +6 -6
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  deleteServerSyncedCredential,
14
14
  runLlm
15
- } from "./chunk-QJZJW65A.js";
15
+ } from "./chunk-GD23ZX7Z.js";
16
16
  import {
17
17
  isOAuthApiKeyRef
18
18
  } from "./chunk-YYLHWIW6.js";
@@ -42,14 +42,14 @@ import {
42
42
  planCompression,
43
43
  resolveAutoExecutionProfile,
44
44
  serializeMessageContent
45
- } from "./chunk-LWHK7TZR.js";
45
+ } from "./chunk-PY7VGC5M.js";
46
46
  import {
47
47
  createFileCredentialBroker
48
48
  } from "./chunk-5CS33IBL.js";
49
49
  import {
50
50
  findModelConfig,
51
51
  getModelConfig
52
- } from "./chunk-J6MEBHAT.js";
52
+ } from "./chunk-LEHTC2FI.js";
53
53
  import {
54
54
  abortActiveControllers,
55
55
  addPageReferenceToRuntime,
@@ -70,6 +70,10 @@ import {
70
70
  import {
71
71
  toErrorMessage
72
72
  } from "./chunk-HNMXYYJR.js";
73
+ import {
74
+ getPlatformHostedDeepSeekV4Price,
75
+ isPlatformHostedDeepSeekV4Model
76
+ } from "./chunk-CZHE6LLV.js";
73
77
  import {
74
78
  isSystemAdmin,
75
79
  nolotusId,
@@ -4722,7 +4726,8 @@ var createEmptyMessageSessionState = () => ({
4722
4726
  lastStreamTimestamp: 0,
4723
4727
  currentInitMsgsRequestId: void 0,
4724
4728
  currentLoadOlderRequestId: void 0,
4725
- streamingMessageId: null
4729
+ streamingMessageId: null,
4730
+ lastAbortTimestamp: 0
4726
4731
  });
4727
4732
  var activeDialogId = null;
4728
4733
  var sessionByDialogId = {
@@ -4791,6 +4796,12 @@ function markMessageStreamActivity(dialogId) {
4791
4796
  notify();
4792
4797
  return action("messageSession/streamActivity", { dialogId });
4793
4798
  }
4799
+ function markMessageSessionAbort(dialogId) {
4800
+ const session = ensureMessageSession(dialogId);
4801
+ session.lastAbortTimestamp = Date.now();
4802
+ notify();
4803
+ return action("messageSession/abort", { dialogId });
4804
+ }
4794
4805
  function setStreamingMessageId(dialogId, messageId) {
4795
4806
  const session = ensureMessageSession(dialogId);
4796
4807
  if (session.streamingMessageId === messageId) return;
@@ -4967,6 +4978,7 @@ var messageSlice = createSliceWithThunks({
4967
4978
  updateManyMessages(dialogState, updates);
4968
4979
  }
4969
4980
  setStreamingMessageId(dialogId, null);
4981
+ markMessageSessionAbort(dialogId);
4970
4982
  });
4971
4983
  }),
4972
4984
  removeTransientMessage: create.reducer(
@@ -5623,7 +5635,7 @@ var messageSlice = createSliceWithThunks({
5623
5635
  runtimeOptions: args.runtimeOptions
5624
5636
  });
5625
5637
  if (agentKeyToUse) {
5626
- const { streamAgentChatTurn } = await import("./agentSlice-WY7SEYXO.js");
5638
+ const { streamAgentChatTurn } = await import("./agentSlice-OJBHIL34.js");
5627
5639
  await dispatch(
5628
5640
  streamAgentChatTurn({
5629
5641
  agentKey: agentKeyToUse,
@@ -7507,9 +7519,13 @@ var resolveEffectiveModelPrice = ({
7507
7519
  model,
7508
7520
  usage,
7509
7521
  provider,
7510
- billingServiceTier
7522
+ billingServiceTier,
7523
+ nowMs
7511
7524
  }) => {
7512
7525
  const resolvedPrice = resolveModelPrice(model, usage);
7526
+ if ((provider === "nolo" || provider === "deepseek") && isPlatformHostedDeepSeekV4Model(model.name)) {
7527
+ return getPlatformHostedDeepSeekV4Price(model.name, nowMs);
7528
+ }
7513
7529
  if (provider === "google") {
7514
7530
  return resolveGoogleServiceTierPrice(model, resolvedPrice, billingServiceTier);
7515
7531
  }
@@ -7634,7 +7650,7 @@ var resolveOpenAIBuiltInImageSurcharge = (model, usage) => {
7634
7650
  if (imageGenerationCount <= 0 || pricePerImage <= 0) return 0;
7635
7651
  return imageGenerationCount * pricePerImage;
7636
7652
  };
7637
- var calculateBasicCost = (model, usage, provider, externalPrice, billingServiceTier) => {
7653
+ var calculateBasicCost = (model, usage, provider, externalPrice, billingServiceTier, nowMs) => {
7638
7654
  if (!usage || typeof usage.input_tokens !== "number") {
7639
7655
  throw new Error("Invalid usage data");
7640
7656
  }
@@ -7642,7 +7658,8 @@ var calculateBasicCost = (model, usage, provider, externalPrice, billingServiceT
7642
7658
  model,
7643
7659
  usage,
7644
7660
  provider,
7645
- billingServiceTier
7661
+ billingServiceTier,
7662
+ nowMs
7646
7663
  });
7647
7664
  switch (provider) {
7648
7665
  case "deepseek":
@@ -7719,12 +7736,26 @@ var calculatePrice = ({
7719
7736
  // 不设默认值,undefined 表示 custom/未知 provider,走 zeroCostModel 路径
7720
7737
  provider,
7721
7738
  billingServiceTier,
7739
+ nowMs,
7722
7740
  sharingLevel = "default"
7723
7741
  }) => {
7724
7742
  let model;
7725
7743
  try {
7726
7744
  model = getModelConfig(provider, modelName);
7727
7745
  } catch {
7746
+ if ((provider === "nolo" || provider === "deepseek") && isPlatformHostedDeepSeekV4Model(modelName)) {
7747
+ const hostedModel = getModelConfig("nolo", modelName);
7748
+ const costs3 = calculateBasicCost(
7749
+ hostedModel,
7750
+ usage,
7751
+ provider,
7752
+ externalPrice,
7753
+ billingServiceTier,
7754
+ nowMs
7755
+ );
7756
+ const pay3 = calculatePayDistribution(costs3, externalPrice, sharingLevel);
7757
+ return { cost: sanitizeCost(costs3.charge), pay: pay3 };
7758
+ }
7728
7759
  const zeroCostModel = {
7729
7760
  name: modelName,
7730
7761
  hasVision: false,
@@ -7735,7 +7766,8 @@ var calculatePrice = ({
7735
7766
  usage,
7736
7767
  "custom",
7737
7768
  externalPrice,
7738
- billingServiceTier
7769
+ billingServiceTier,
7770
+ nowMs
7739
7771
  );
7740
7772
  const pay2 = calculatePayDistribution(costs2, externalPrice, sharingLevel);
7741
7773
  return { cost: sanitizeCost(costs2.charge), pay: pay2 };
@@ -7745,7 +7777,8 @@ var calculatePrice = ({
7745
7777
  usage,
7746
7778
  provider || "custom",
7747
7779
  externalPrice,
7748
- billingServiceTier
7780
+ billingServiceTier,
7781
+ nowMs
7749
7782
  );
7750
7783
  const openAIImageSurcharge = provider === "openai" ? resolveOpenAIBuiltInImageSurcharge(model, usage) : 0;
7751
7784
  const adjustedCosts = openAIImageSurcharge > 0 ? {
@@ -7791,6 +7824,15 @@ var readFiniteNumberField = (usage, field) => {
7791
7824
  };
7792
7825
  var readCostInUsdTicks = (usage) => readFiniteNumberField(usage, "cost_in_usd_ticks");
7793
7826
  var normalizeUsage = (usage) => {
7827
+ if (!usage || typeof usage !== "object") {
7828
+ return {
7829
+ input_tokens: 0,
7830
+ output_tokens: 0,
7831
+ total_tokens: 0,
7832
+ cache_creation_input_tokens: 0,
7833
+ cache_read_input_tokens: 0
7834
+ };
7835
+ }
7794
7836
  const inputTokens = "input_tokens" in usage ? usage.input_tokens ?? 0 : "prompt_tokens" in usage ? usage.prompt_tokens : 0;
7795
7837
  const outputTokens = "output_tokens" in usage ? usage.output_tokens ?? 0 : "completion_tokens" in usage ? usage.completion_tokens : 0;
7796
7838
  const cacheCreationInputTokens = "cache_creation_input_tokens" in usage ? usage.cache_creation_input_tokens ?? 0 : "prompt_cache_miss_tokens" in usage ? usage.prompt_cache_miss_tokens : 0;
@@ -7916,7 +7958,8 @@ var prepareTokenUsageData = ({
7916
7958
  output: agentConfig.outputPrice ?? 0,
7917
7959
  creatorId: agentConfig.userId ?? (agentConfig.id ? extractUserId(agentConfig.id) : "")
7918
7960
  } : void 0,
7919
- sharingLevel: agentConfig.sharingLevel
7961
+ sharingLevel: agentConfig.sharingLevel,
7962
+ nowMs: timestamp
7920
7963
  });
7921
7964
  const billable = resolveBillable({
7922
7965
  usage,
@@ -8331,7 +8374,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
8331
8374
  }
8332
8375
  if (isCurrentDialog) {
8333
8376
  await thunkApi.dispatch(resetMsgs());
8334
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-OFGPXYFS.js");
8377
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-DJXC53YW.js");
8335
8378
  dispatch(clearPendingAttachments2());
8336
8379
  clearWorkflow();
8337
8380
  }
@@ -8340,15 +8383,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
8340
8383
 
8341
8384
  // packages/chat/dialog/dialogSlice.ts
8342
8385
  var runCreateDialogAction = async (args, thunkApi) => {
8343
- const { createDialogAction } = await import("./createDialogAction-SYKO3ACQ.js");
8386
+ const { createDialogAction } = await import("./createDialogAction-ORFRYI3C.js");
8344
8387
  return createDialogAction(args, thunkApi);
8345
8388
  };
8346
8389
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
8347
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-B5G57KMG.js");
8390
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-PO62NUR7.js");
8348
8391
  return createAgentAutomationAction(args, thunkApi);
8349
8392
  };
8350
8393
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
8351
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-WMWZQ764.js");
8394
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-LMHZUY4Q.js");
8352
8395
  return updateDialogTitleAction(args, thunkApi);
8353
8396
  };
8354
8397
  var runAddDialogAgentAction = async (args, thunkApi) => {
@@ -8372,7 +8415,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
8372
8415
  return setDialogExtraReferencesAction(args, thunkApi);
8373
8416
  };
8374
8417
  var runHandleSendMessageAction = async (args, thunkApi) => {
8375
- const { handleSendMessageAction } = await import("./handleSendMessageAction-R3AP5MQY.js");
8418
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-ILFGZTN5.js");
8376
8419
  return handleSendMessageAction(args, thunkApi);
8377
8420
  };
8378
8421
  function clearDialogState() {
@@ -8385,7 +8428,7 @@ var createPageAndAddReference = createAsyncThunk(
8385
8428
  async (payload, { dispatch, getState, rejectWithValue }) => {
8386
8429
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
8387
8430
  try {
8388
- const { createDocState } = await import("./docStore-WFMCDOGV.js");
8431
+ const { createDocState } = await import("./docStore-6LKLLFDW.js");
8389
8432
  const pageKey = await createDocState(
8390
8433
  { slateData, title },
8391
8434
  { dispatch, getState }
@@ -15419,6 +15462,8 @@ export {
15419
15462
  API_REPORTED_COST_MULTIPLIER,
15420
15463
  normalizeUsage,
15421
15464
  prepareTokenUsageData,
15465
+ applyTokenUsageToDayStats,
15466
+ runKeyed,
15422
15467
  updateTokensAction,
15423
15468
  clearDialogState,
15424
15469
  createPageAndAddReference,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-CWMSB67P.js";
7
7
  import {
8
8
  getModelConfig
9
- } from "./chunk-J6MEBHAT.js";
9
+ } from "./chunk-LEHTC2FI.js";
10
10
  import {
11
11
  asOptionalFiniteNumber
12
12
  } from "./chunk-WWC7I6TA.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildAgentRuntimeAgentLookupKeys,
3
3
  shouldFetchAgentRuntimeRecordRemotely
4
- } from "./chunk-5TAM6OX3.js";
4
+ } from "./chunk-SIUEKVK4.js";
5
5
 
6
6
  // packages/cli/client/localAgentRecords.ts
7
7
  var buildLocalAgentLookupKeys = buildAgentRuntimeAgentLookupKeys;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readDbRecord,
3
3
  writeAgentRecord
4
- } from "./chunk-6NUG4BJE.js";
4
+ } from "./chunk-J2WT5CEO.js";
5
5
  import {
6
6
  buildSkillSummaryMarker
7
7
  } from "./chunk-VF4K2QE6.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  updateContentTitle
3
- } from "./chunk-THN2YFSR.js";
3
+ } from "./chunk-ADE6577S.js";
4
4
  import {
5
5
  require_date_fns
6
6
  } from "./chunk-M76ECQRD.js";
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
367
367
  }
368
368
  }
369
369
  async function createDocState(args, thunkApi) {
370
- const { createPageAction } = await import("./createPageAction-UBO6CXTT.js");
370
+ const { createPageAction } = await import("./createPageAction-XWVMNTYH.js");
371
371
  return createPageAction(args, thunkApi);
372
372
  }
373
373
  function subscribe(listener) {
@@ -485,11 +485,9 @@ var resolveFireworksKimiModel = (model) => {
485
485
  };
486
486
 
487
487
  // packages/ai/llm/platformHosted.ts
488
- var PLATFORM_HOSTED_CLAUDE_HAIKU_4_5_MODEL = "anthropic/claude-haiku-4-5";
489
488
  var PLATFORM_HOSTED_CLAUDE_SONNET_5_MODEL = "anthropic/claude-sonnet-5";
490
489
  var PLATFORM_HOSTED_CLAUDE_OPUS_4_8_MODEL = "anthropic/claude-opus-4-8";
491
490
  var PLATFORM_HOSTED_CLAUDE_MODELS = [
492
- PLATFORM_HOSTED_CLAUDE_HAIKU_4_5_MODEL,
493
491
  PLATFORM_HOSTED_CLAUDE_SONNET_5_MODEL,
494
492
  PLATFORM_HOSTED_CLAUDE_OPUS_4_8_MODEL
495
493
  ];
@@ -517,8 +515,32 @@ var PLATFORM_HOSTED_KIMI_K3_PRICE = {
517
515
  output: 64
518
516
  // crof $8 × 8
519
517
  };
518
+ var PLATFORM_HOSTED_GLM_PRICE = {
519
+ input: toPlatformCredits(1.4),
520
+ inputCacheHit: toPlatformCredits(0.26),
521
+ output: toPlatformCredits(4.4)
522
+ };
523
+ var PLATFORM_HOSTED_GLM_52_MODEL = "glm-5.2";
524
+ var PLATFORM_HOSTED_GEMINI_37_FLASH_MODEL = "gemini-3.7-flash";
525
+ var PLATFORM_HOSTED_GEMINI_37_FLASH_PRICE = {
526
+ input: toPlatformCredits(0.75),
527
+ output: toPlatformCredits(3.75),
528
+ cachingWrite: toPlatformCredits(0.075),
529
+ cachingRead: toPlatformCredits(0.075)
530
+ };
520
531
  var PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL = "deepseek-v4-flash";
521
532
  var PLATFORM_HOSTED_DEEPSEEK_PRO_MODEL = "deepseek-v4-pro";
533
+ var DEEPSEEK_V4_PRICING_EFFECTIVE_AT_MS = Date.UTC(2026, 7, 16, 16);
534
+ var PLATFORM_HOSTED_DEEPSEEK_FLASH_PEAK_PRICE = {
535
+ input: 3,
536
+ inputCacheHit: 0.1,
537
+ output: 9
538
+ };
539
+ var PLATFORM_HOSTED_DEEPSEEK_PRO_PEAK_PRICE = {
540
+ input: 9,
541
+ inputCacheHit: 0.3,
542
+ output: 27
543
+ };
522
544
  var PLATFORM_HOSTED_DEEPSEEK_FLASH_PRICE = {
523
545
  input: 1,
524
546
  inputCacheHit: 0.02,
@@ -529,6 +551,34 @@ var PLATFORM_HOSTED_DEEPSEEK_PRO_PRICE = {
529
551
  inputCacheHit: 0.025,
530
552
  output: 6
531
553
  };
554
+ var PLATFORM_HOSTED_DEEPSEEK_FLASH_OFF_PEAK_PRICE = {
555
+ input: 1.5,
556
+ inputCacheHit: 0.05,
557
+ output: 4.5
558
+ };
559
+ var PLATFORM_HOSTED_DEEPSEEK_PRO_OFF_PEAK_PRICE = {
560
+ input: 4.5,
561
+ inputCacheHit: 0.15,
562
+ output: 13.5
563
+ };
564
+ var getPlatformHostedDeepSeekV4Price = (model, nowMs = Date.now()) => {
565
+ if (nowMs < DEEPSEEK_V4_PRICING_EFFECTIVE_AT_MS) {
566
+ return model === PLATFORM_HOSTED_DEEPSEEK_PRO_MODEL ? PLATFORM_HOSTED_DEEPSEEK_PRO_PRICE : PLATFORM_HOSTED_DEEPSEEK_FLASH_PRICE;
567
+ }
568
+ const hour = Number(
569
+ new Intl.DateTimeFormat("en-US", {
570
+ timeZone: "Asia/Shanghai",
571
+ hour: "numeric",
572
+ hourCycle: "h23"
573
+ }).format(new Date(nowMs))
574
+ );
575
+ const peak = hour >= 9 && hour < 12 || hour >= 14 && hour < 18;
576
+ if (!peak) {
577
+ return model === PLATFORM_HOSTED_DEEPSEEK_PRO_MODEL ? PLATFORM_HOSTED_DEEPSEEK_PRO_OFF_PEAK_PRICE : PLATFORM_HOSTED_DEEPSEEK_FLASH_OFF_PEAK_PRICE;
578
+ }
579
+ return model === PLATFORM_HOSTED_DEEPSEEK_PRO_MODEL ? PLATFORM_HOSTED_DEEPSEEK_PRO_PEAK_PRICE : PLATFORM_HOSTED_DEEPSEEK_FLASH_PEAK_PRICE;
580
+ };
581
+ var isPlatformHostedDeepSeekV4Model = (model) => model === PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL || model === PLATFORM_HOSTED_DEEPSEEK_PRO_MODEL;
532
582
  var PLATFORM_HOSTED_CHAT_COMPLETIONS_URL = "https://ollama.com/v1/chat/completions";
533
583
  var platformHostedModels = [
534
584
  {
@@ -550,6 +600,26 @@ var platformHostedModels = [
550
600
  contextWindow: 262144,
551
601
  supportsTool: true
552
602
  },
603
+ {
604
+ name: PLATFORM_HOSTED_GLM_52_MODEL,
605
+ displayName: "GLM 5.2",
606
+ hasVision: false,
607
+ price: { ...PLATFORM_HOSTED_GLM_PRICE },
608
+ maxOutputTokens: 131072,
609
+ contextWindow: 1e6,
610
+ supportsTool: true,
611
+ supportsReasoningEffort: true
612
+ },
613
+ {
614
+ name: PLATFORM_HOSTED_GEMINI_37_FLASH_MODEL,
615
+ displayName: "Gemini 3.7 Flash",
616
+ hasVision: true,
617
+ price: { ...PLATFORM_HOSTED_GEMINI_37_FLASH_PRICE },
618
+ maxOutputTokens: 65536,
619
+ contextWindow: 1048576,
620
+ supportsTool: true,
621
+ supportsReasoningEffort: true
622
+ },
553
623
  {
554
624
  name: PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
555
625
  displayName: "DeepSeek V4 Flash",
@@ -570,15 +640,6 @@ var platformHostedModels = [
570
640
  supportsTool: true,
571
641
  supportsReasoningEffort: true
572
642
  },
573
- {
574
- name: PLATFORM_HOSTED_CLAUDE_HAIKU_4_5_MODEL,
575
- displayName: "Claude Haiku 4.5",
576
- hasVision: true,
577
- price: { ...DEEPINFRA_CLAUDE_HAIKU_PRICE },
578
- maxOutputTokens: 4092,
579
- contextWindow: 195e3,
580
- supportsTool: false
581
- },
582
643
  {
583
644
  name: PLATFORM_HOSTED_CLAUDE_SONNET_5_MODEL,
584
645
  displayName: "Claude Sonnet 5",
@@ -626,6 +687,8 @@ export {
626
687
  isPlatformHostedGrokModel,
627
688
  PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
628
689
  PLATFORM_HOSTED_DEEPSEEK_FLASH_PRICE,
690
+ getPlatformHostedDeepSeekV4Price,
691
+ isPlatformHostedDeepSeekV4Model,
629
692
  PLATFORM_HOSTED_CHAT_COMPLETIONS_URL,
630
693
  platformHostedModels,
631
694
  getCloudflareWorkersAiChatCompletionsUrl,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadProfileConfig
3
- } from "./chunk-DXJS7VSG.js";
3
+ } from "./chunk-GE6IWA5N.js";
4
4
  import {
5
5
  resolveDefaultSpawn
6
6
  } from "./chunk-IDZTNRP2.js";
@@ -270,6 +270,69 @@ Nolo Agent CLI Installer & Updater
270
270
  }
271
271
  return exitCode;
272
272
  }
273
+ var NOLO_UPDATE_CHECK_KILL_SWITCH = "NOLO_CLI_NO_UPDATE_CHECK";
274
+ function parseCliVersion(raw) {
275
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(raw.trim());
276
+ if (!match) return null;
277
+ return {
278
+ main: [Number(match[1]), Number(match[2]), Number(match[3])],
279
+ pre: match[4] ? match[4].split(".") : []
280
+ };
281
+ }
282
+ function compareCliVersions(a, b) {
283
+ const pa = parseCliVersion(a);
284
+ const pb = parseCliVersion(b);
285
+ if (!pa || !pb) return a.localeCompare(b);
286
+ for (let i = 0; i < 3; i++) {
287
+ if (pa.main[i] !== pb.main[i]) return pa.main[i] < pb.main[i] ? -1 : 1;
288
+ }
289
+ if (pa.pre.length === 0 && pb.pre.length === 0) return 0;
290
+ if (pa.pre.length === 0) return 1;
291
+ if (pb.pre.length === 0) return -1;
292
+ const len = Math.max(pa.pre.length, pb.pre.length);
293
+ for (let i = 0; i < len; i++) {
294
+ const x = pa.pre[i];
295
+ const y = pb.pre[i];
296
+ if (x === void 0) return -1;
297
+ if (y === void 0) return 1;
298
+ if (x === y) continue;
299
+ const xn = /^\d+$/.test(x) ? Number(x) : NaN;
300
+ const yn = /^\d+$/.test(y) ? Number(y) : NaN;
301
+ if (!Number.isNaN(xn) && !Number.isNaN(yn)) return xn < yn ? -1 : 1;
302
+ if (!Number.isNaN(xn)) return -1;
303
+ if (!Number.isNaN(yn)) return 1;
304
+ return x < y ? -1 : 1;
305
+ }
306
+ return 0;
307
+ }
308
+ async function checkForCliUpdate(currentVersion, serverUrl, options = {}) {
309
+ const env = options.env ?? process.env;
310
+ if ((env[NOLO_UPDATE_CHECK_KILL_SWITCH] ?? process.env[NOLO_UPDATE_CHECK_KILL_SWITCH]) === "1") {
311
+ return null;
312
+ }
313
+ if (!currentVersion || !parseCliVersion(currentVersion)) return null;
314
+ const channel = getCliInstallChannel(serverUrl);
315
+ const fetchImpl = options.fetchImpl ?? fetch;
316
+ const timeoutMs = options.timeoutMs ?? 2e3;
317
+ try {
318
+ const res = await fetchImpl(
319
+ `https://registry.npmjs.org/nolo-cli/${channel}`,
320
+ {
321
+ signal: AbortSignal.timeout(timeoutMs),
322
+ headers: { accept: "application/json" }
323
+ }
324
+ );
325
+ if (!res.ok) return null;
326
+ const data = await res.json();
327
+ const latestVersion = data.version;
328
+ if (!latestVersion || !parseCliVersion(latestVersion) || compareCliVersions(latestVersion, currentVersion) <= 0) {
329
+ return null;
330
+ }
331
+ return { latestVersion, channel };
332
+ } catch {
333
+ return null;
334
+ }
335
+ }
273
336
  async function runSelfUpdate(outputOrOptions) {
274
337
  const options = outputOrOptions === void 0 ? {} : isRunSelfUpdateOptions(outputOrOptions) ? outputOrOptions : { output: outputOrOptions };
275
338
  if (isCompiledBinary()) {
@@ -337,5 +400,8 @@ export {
337
400
  resolveSelfUpdateServerUrl,
338
401
  buildCliDoctorText,
339
402
  runStandaloneBundleUpdate,
403
+ NOLO_UPDATE_CHECK_KILL_SWITCH,
404
+ compareCliVersions,
405
+ checkForCliUpdate,
340
406
  runSelfUpdate
341
407
  };
@@ -9,19 +9,29 @@ import {
9
9
  platformHostedModels,
10
10
  xaiModels,
11
11
  zaiModels
12
- } from "./chunk-OHK3HE4G.js";
12
+ } from "./chunk-CZHE6LLV.js";
13
13
 
14
14
  // packages/ai/llm/modelAbility.ts
15
15
  var MODEL_ABILITY_TABLE = {
16
16
  "claude-opus-5": { passAt1: 74, benchmarkScore: 61 },
17
17
  "gpt-5.6-sol": { passAt1: 73, benchmarkScore: 59 },
18
+ "claude-fable-5": { passAt1: 70 },
18
19
  "gpt-5.6-terra": { passAt1: 70, benchmarkScore: 55 },
19
20
  "kimi-k3": { passAt1: 69, benchmarkScore: 57 },
21
+ "gpt-5.5": { passAt1: 67 },
22
+ "gpt-5.6-luna": { passAt1: 67, benchmarkScore: 51 },
23
+ "grok-4.6": { passAt1: 67 },
24
+ "deepseek-v4-pro": { passAt1: 63 },
25
+ "claude-opus-4.8": { passAt1: 59 },
26
+ "qwen3.8-max": { passAt1: 57 },
27
+ "muse-spark-1.2": { passAt1: 55 },
20
28
  "grok-4.5": { passAt1: 54, benchmarkScore: 54 },
21
29
  "claude-sonnet-5": { passAt1: 54, benchmarkScore: 53 },
22
- "gpt-5.6-luna": { passAt1: 67, benchmarkScore: 51 },
23
- "glm-5.2": { passAt1: 44, benchmarkScore: 51 },
24
- "gemini-3.6-flash": { passAt1: 49, benchmarkScore: 50 }
30
+ "deepseek-v4-flash": { passAt1: 53 },
31
+ "muse-spark-1.1": { passAt1: 53 },
32
+ "gpt-5.4": { passAt1: 52 },
33
+ "gemini-3.6-flash": { passAt1: 49, benchmarkScore: 50 },
34
+ "glm-5.2": { passAt1: 44, benchmarkScore: 51 }
25
35
  };
26
36
  var EFFORT_SUFFIXES = ["-extra-low", "-low", "-medium", "-high"];
27
37
  function normalizeModelName(raw) {
@@ -300,7 +300,7 @@ var slice = createSliceWithThunks({
300
300
  const overrides = {};
301
301
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
302
302
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
303
- const { _executeModel } = await import("./_executeModel-LXNDVFT2.js");
303
+ const { _executeModel } = await import("./_executeModel-ZPNYAEFW.js");
304
304
  return _executeModel(
305
305
  {
306
306
  isStreaming: args.isStreaming ?? false,
@@ -321,7 +321,7 @@ var slice = createSliceWithThunks({
321
321
  * - 循环直到无工具调用或触发其他运行时停止条件
322
322
  */
323
323
  runAgent: create.asyncThunk(async (args, thunkApi) => {
324
- const { runAgentClientLoop } = await import("./runAgentClientLoop-UWNABHIZ.js");
324
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-C3QB2EXV.js");
325
325
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
326
326
  {
327
327
  agentKey: args.agentKey,
@@ -337,7 +337,7 @@ var slice = createSliceWithThunks({
337
337
  * 聊天轮次流式 Agent 调用
338
338
  */
339
339
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
340
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-SS62OWZZ.js");
340
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-GF5W5OIP.js");
341
341
  return streamAgentChatTurnHandler(args, thunkApi);
342
342
  }),
343
343
  /**
@@ -119,8 +119,15 @@ function saveProfileAgentSelection(selection, path = getDefaultProfileConfigPath
119
119
  if (!config) return null;
120
120
  const profile = config.profiles[config.currentProfile];
121
121
  if (!profile) return null;
122
- profile.agentKey = selection.agentKey.trim();
123
- profile.agentName = selection.agentName.trim();
122
+ const agentKey = selection.agentKey.trim();
123
+ const agentName = selection.agentName.trim();
124
+ if (!agentKey) {
125
+ delete profile.agentKey;
126
+ delete profile.agentName;
127
+ } else {
128
+ profile.agentKey = agentKey;
129
+ profile.agentName = agentName;
130
+ }
124
131
  mkdirSync(dirname(path), { recursive: true });
125
132
  writeFileSync(path, `${JSON.stringify(config, null, 2)}
126
133
  `, "utf8");