nolo-cli 0.252.0-alpha.3 → 0.253.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/{_executeModel-RXHY2BDR.js → _executeModel-VUXEWLLQ.js} +29 -29
  2. package/{addContentAction-F4XO3VRF.js → addContentAction-MT4BECXT.js} +6 -6
  3. package/{addDialogAgentAction-NSCVHTZJ.js → addDialogAgentAction-ZZTJ5GBD.js} +5 -5
  4. package/{agentDeleteCommand-OKR6IDGK.js → agentDeleteCommand-SU5IKIW3.js} +36 -36
  5. package/{agentEmailCommands-UKPURCCI.js → agentEmailCommands-SHLVY627.js} +36 -36
  6. package/{agentListCommands-CTY7WAMN.js → agentListCommands-3NTMYMVI.js} +16 -16
  7. package/{agentMachineCommands-WTCQHXHZ.js → agentMachineCommands-MYXLAKQF.js} +12 -11
  8. package/{agentRecordCommands-IM2WIFKB.js → agentRecordCommands-EIZTKSWW.js} +36 -36
  9. package/{agentRunCommand-7MCCRUJY.js → agentRunCommand-RB3EIT4I.js} +36 -36
  10. package/{agentRunControl-KNNDEEDI.js → agentRunControl-5ABAIBQT.js} +2 -2
  11. package/{agentRuntimeLocal-EOW6FFXL.js → agentRuntimeLocal-IO3GGTCJ.js} +7 -7
  12. package/{agentSlice-PVFGBJXB.js → agentSlice-TQVS23WV.js} +6 -6
  13. package/{appDeleteCommands-3VCRRWUX.js → appDeleteCommands-ZQ4ZEKTC.js} +13 -12
  14. package/{appDeployCommands-XN6IEMYK.js → appDeployCommands-4XT7PFW5.js} +13 -12
  15. package/{appDeployStatusCommands-ZSJJXMVR.js → appDeployStatusCommands-5RVMRYQW.js} +13 -12
  16. package/{appGetCommands-DJ7YQCEE.js → appGetCommands-VH5W3RFK.js} +13 -12
  17. package/{appListCommands-4KU5CV5H.js → appListCommands-TAHZLAL3.js} +13 -12
  18. package/{builtinSkillRegistry-PQWEXSFW.js → builtinSkillRegistry-66PEOD4Y.js} +1 -1
  19. package/{chunk-25GCVHBZ.js → chunk-25BDZGD7.js} +1 -1
  20. package/{chunk-2HF6DINU.js → chunk-2BJ53346.js} +6 -6
  21. package/{chunk-VZWYP7LD.js → chunk-2RCMFPUZ.js} +2 -2
  22. package/{chunk-OQOXDQLB.js → chunk-2VYX3ZCR.js} +3 -3
  23. package/{chunk-UDQZ5JT7.js → chunk-3SEBCWLD.js} +17394 -17306
  24. package/{chunk-NWZRCUHM.js → chunk-4AFKLWZP.js} +101 -192
  25. package/{chunk-GUFTHWDO.js → chunk-4BQ5QKIG.js} +9 -9
  26. package/{chunk-YWLMUFZ5.js → chunk-4GWNEPY6.js} +1 -1
  27. package/{chunk-GJ4UTSAW.js → chunk-53UOBNTI.js} +4 -4
  28. package/{chunk-V644LXPC.js → chunk-7STRX24O.js} +3 -3
  29. package/chunk-AIHNB5QH.js +1394 -0
  30. package/{chunk-BVCCRSGK.js → chunk-ANQ544EU.js} +5 -5
  31. package/{chunk-4KBKOG2L.js → chunk-CF7U32BX.js} +2 -2
  32. package/{chunk-MOAVLCCM.js → chunk-CMYZT2XN.js} +3 -3
  33. package/{chunk-U3ZK2MXG.js → chunk-CUQNRU4X.js} +3 -3
  34. package/{chunk-EQJK6LSN.js → chunk-D4CUS6NT.js} +3 -3
  35. package/{chunk-SBBSUBY3.js → chunk-DNY33GGQ.js} +1 -1
  36. package/{chunk-RE32BIKY.js → chunk-FZSGYLFV.js} +3 -3
  37. package/{chunk-N2ZAY2DK.js → chunk-GFXPPQZN.js} +1 -1
  38. package/{chunk-BTQU2PRC.js → chunk-GK772DEV.js} +1 -1
  39. package/{chunk-N7UXTVAR.js → chunk-HEQJ5XND.js} +1 -1
  40. package/{chunk-BLBGVSLB.js → chunk-HEUHCHAR.js} +5 -5
  41. package/{chunk-WNIBQBOR.js → chunk-HS4JGZQH.js} +1 -1
  42. package/{chunk-N2MDL5AZ.js → chunk-IRORRPH2.js} +9 -9
  43. package/chunk-JJABK3QO.js +321 -0
  44. package/{chunk-64ACTEAE.js → chunk-JKO32CCL.js} +1 -1
  45. package/{chunk-ZMXO5G3E.js → chunk-K4LLTJUO.js} +4 -2
  46. package/{chunk-MDWHMQON.js → chunk-M7GMJBQJ.js} +1 -1
  47. package/{chunk-FJPVVLP3.js → chunk-MARF3TN2.js} +4 -4
  48. package/{chunk-KO6JNZCF.js → chunk-MPOUZIF4.js} +21 -8
  49. package/{chunk-WJOC3AEM.js → chunk-MRYKRL2V.js} +1 -1
  50. package/{chunk-Z47UZT27.js → chunk-NMGG3NUB.js} +1 -1
  51. package/{chunk-EPBEZKYK.js → chunk-O3WZMJAN.js} +2 -2
  52. package/{chunk-3LL5HRIJ.js → chunk-OLS2J3WE.js} +1 -1
  53. package/{chunk-7XO73H5X.js → chunk-P4JX7YMQ.js} +1 -1
  54. package/{chunk-Q5M27DUE.js → chunk-PR25J652.js} +1 -1
  55. package/{chunk-JX2IG37T.js → chunk-PTY2VZM5.js} +1 -1
  56. package/{chunk-OTNPEE4G.js → chunk-SID2TFMV.js} +87 -63
  57. package/{chunk-26KL6533.js → chunk-TI2JIXK4.js} +18 -18
  58. package/{chunk-RGWYRTSY.js → chunk-TOHMK27J.js} +21 -23
  59. package/{chunk-SE7UURHT.js → chunk-UHTT23PH.js} +12 -12
  60. package/{chunk-IQXMWBI6.js → chunk-UMI4NNZP.js} +2 -2
  61. package/{chunk-CSTCYYCR.js → chunk-VKAITWPC.js} +9 -9
  62. package/{chunk-UGHNYYOE.js → chunk-VPSPVLCM.js} +2 -2
  63. package/{chunk-OTOPQXP5.js → chunk-XWR2YD4L.js} +1 -1
  64. package/{chunk-K7RWY7JH.js → chunk-YQYSQUP3.js} +7 -7
  65. package/{chunk-ZMWDHPNG.js → chunk-Z2ZCKNKX.js} +1 -5
  66. package/{cliLocalAgentRecordReader-OHAC4JTY.js → cliLocalAgentRecordReader-2WBUVRVD.js} +9 -9
  67. package/{commandRegistry-YSV6ZWPO.js → commandRegistry-JDCGWIWD.js} +46 -117
  68. package/{contentThunks-GSMUNWBA.js → contentThunks-B6BY7GS3.js} +11 -11
  69. package/{createAgentAutomationAction-RMADR4LG.js → createAgentAutomationAction-TQ6IA5SV.js} +11 -11
  70. package/{createDialogAction-CM5CBQVH.js → createDialogAction-QKMGD2TS.js} +12 -12
  71. package/{createPageAction-JMGVMCTH.js → createPageAction-7EEVGWGG.js} +12 -12
  72. package/{dbSlice-Q637QR4L.js → dbSlice-HXFRXGI3.js} +5 -5
  73. package/{deleteFile-TP6MKFUX.js → deleteFile-QDSZVTUJ.js} +3 -3
  74. package/{dialogCommands-IZSD4CQM.js → dialogCommands-MEH4CVRL.js} +15 -14
  75. package/{dialogSlice-ARQKXXTD.js → dialogSlice-6WIME53P.js} +9 -9
  76. package/{docCreateCommands-ZJFHCZV4.js → docCreateCommands-MVAYVGQ5.js} +12 -11
  77. package/{docDeleteCommands-LY5MF2BI.js → docDeleteCommands-TKXPRA3O.js} +13 -12
  78. package/{docReadCommands-4X2DHCNZ.js → docReadCommands-MR2YKCZP.js} +12 -11
  79. package/{docStore-QWRVKIRI.js → docStore-VEHQHXRM.js} +6 -6
  80. package/{docUpdateCommands-5TIT7DAJ.js → docUpdateCommands-VJ6A6F7F.js} +12 -11
  81. package/{handleSendMessageAction-TVR55KVT.js → handleSendMessageAction-X5LGNJX5.js} +22 -22
  82. package/{hostCredentialCreate-T33O7WLA.js → hostCredentialCreate-AQYSWUKA.js} +36 -36
  83. package/index.js +4 -4
  84. package/{localRuntimeAdapter-CNFP7ZEP.js → localRuntimeAdapter-FA4OGZGU.js} +35 -35
  85. package/{machineCommands-TGA5EH2G.js → machineCommands-VKU6MAFA.js} +36 -36
  86. package/{machineWsRunDispatch-LMJPGTTZ.js → machineWsRunDispatch-XQQHHOX4.js} +36 -36
  87. package/{memberThunks-IGYRMEQC.js → memberThunks-ZXEUM6DH.js} +7 -7
  88. package/package.json +1 -1
  89. package/{projectArchive-Q46BYZQ6.js → projectArchive-674NJOYI.js} +12 -12
  90. package/{read-MPPXZHAO.js → read-T5WPCAY7.js} +3 -3
  91. package/{readDocTool-PKZ35PCR.js → readDocTool-DW4DCRQG.js} +1 -1
  92. package/{readlineWorkspace-HA6DWK4N.js → readlineWorkspace-HFPEDOHN.js} +46 -64
  93. package/{removeDialogAgentAction-H6S7VLNA.js → removeDialogAgentAction-MXJEB77K.js} +6 -6
  94. package/{runAgentClientLoop-WZJ4HXOH.js → runAgentClientLoop-NU3JNHSH.js} +27 -27
  95. package/{setDialogExtraReferencesAction-CARUTAWS.js → setDialogExtraReferencesAction-BILVMHM7.js} +6 -6
  96. package/{setPrimaryDialogAgentAction-VRV56MLG.js → setPrimaryDialogAgentAction-CUBBWACR.js} +6 -6
  97. package/{settingThunks-4FC4HXGN.js → settingThunks-BRBBAGEK.js} +5 -5
  98. package/{spaceCommands-27Z5JAU3.js → spaceCommands-K4HHG7OO.js} +12 -11
  99. package/{streamAgentChatTurn-JKMBFM2O.js → streamAgentChatTurn-7FDXIRMB.js} +35 -35
  100. package/{switchDialogAgentAction-O236K6HB.js → switchDialogAgentAction-SSI2CSNE.js} +5 -5
  101. package/{tools-4RFLNHUW.js → tools-GC45557U.js} +23 -23
  102. package/{tuiRestart-GF4DGAAN.js → tuiRestart-7IKI6JZK.js} +3 -3
  103. package/{updateDialogTitleAction-F3ONQM3N.js → updateDialogTitleAction-OAC5MWMS.js} +11 -11
  104. package/chunk-CGSIW2KI.js +0 -594
  105. package/chunk-HF4C5WIU.js +0 -980
  106. package/chunk-U5LOKQ2R.js +0 -176
  107. package/{chunk-REINTCQF.js → chunk-4CL6QIQZ.js} +3 -3
  108. package/{chunk-5BRVDQTX.js → chunk-KWARDHBI.js} +7 -7
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  upsertSSREntity,
3
3
  write
4
- } from "./chunk-GJ4UTSAW.js";
4
+ } from "./chunk-53UOBNTI.js";
5
5
  import {
6
6
  getRuntimeServerContext,
7
7
  resolveRecordAuthority
8
- } from "./chunk-REINTCQF.js";
8
+ } from "./chunk-4CL6QIQZ.js";
9
9
  import {
10
10
  TIMEOUT,
11
11
  asyncThunkCreator,
@@ -471,7 +471,7 @@ var slice = createSliceWithThunks({
471
471
  const overrides = {};
472
472
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
473
473
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
474
- const { _executeModel } = await import("./_executeModel-RXHY2BDR.js");
474
+ const { _executeModel } = await import("./_executeModel-VUXEWLLQ.js");
475
475
  return _executeModel(
476
476
  {
477
477
  isStreaming: args.isStreaming ?? false,
@@ -492,7 +492,7 @@ var slice = createSliceWithThunks({
492
492
  * - 循环直到无工具调用或触发其他运行时停止条件
493
493
  */
494
494
  runAgent: create.asyncThunk(async (args, thunkApi) => {
495
- const { runAgentClientLoop } = await import("./runAgentClientLoop-WZJ4HXOH.js");
495
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-NU3JNHSH.js");
496
496
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
497
497
  {
498
498
  agentKey: args.agentKey,
@@ -508,7 +508,7 @@ var slice = createSliceWithThunks({
508
508
  * 聊天轮次流式 Agent 调用
509
509
  */
510
510
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
511
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-JKMBFM2O.js");
511
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-7FDXIRMB.js");
512
512
  return streamAgentChatTurnHandler(args, thunkApi);
513
513
  }),
514
514
  /**
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-ZYPXOQS2.js";
7
7
  import {
8
8
  clearCliLocalRuntimePreparedAgentCache
9
- } from "./chunk-RGWYRTSY.js";
9
+ } from "./chunk-TOHMK27J.js";
10
10
  import {
11
11
  readCredentialAvailability
12
12
  } from "./chunk-GIXWVN2W.js";
@@ -25,7 +25,7 @@ import {
25
25
  resolveAgentRecordFromHybridStore,
26
26
  sanitizeAgentRecordForCliOutput,
27
27
  writeAgentRecord
28
- } from "./chunk-EQJK6LSN.js";
28
+ } from "./chunk-D4CUS6NT.js";
29
29
  import {
30
30
  resolveCliAgentKeyInput
31
31
  } from "./chunk-BR3GT6MR.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-K7RWY7JH.js";
3
+ } from "./chunk-YQYSQUP3.js";
4
4
  import {
5
5
  prepareAndPersistMessage
6
- } from "./chunk-26KL6533.js";
6
+ } from "./chunk-TI2JIXK4.js";
7
7
  import {
8
8
  require_format
9
9
  } from "./chunk-BUDVRYES.js";
@@ -16,7 +16,7 @@ import {
16
16
  removeCachedEntity,
17
17
  upsertSSREntity,
18
18
  write
19
- } from "./chunk-GJ4UTSAW.js";
19
+ } from "./chunk-53UOBNTI.js";
20
20
  import {
21
21
  isDevelopment
22
22
  } from "./chunk-VYRTLHIT.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  patch,
6
6
  readAndWait
7
- } from "./chunk-GJ4UTSAW.js";
7
+ } from "./chunk-53UOBNTI.js";
8
8
  import {
9
9
  require_react
10
10
  } from "./chunk-RD3QLZQV.js";
@@ -335,7 +335,7 @@ async function saveDocState(arg, { dispatch, getState }) {
335
335
  ).unwrap();
336
336
  if (dbSpaceId) {
337
337
  try {
338
- const { updateContentTitle } = await import("./contentThunks-GSMUNWBA.js");
338
+ const { updateContentTitle } = await import("./contentThunks-B6BY7GS3.js");
339
339
  await dispatch(
340
340
  updateContentTitle({
341
341
  spaceId: dbSpaceId,
@@ -378,7 +378,7 @@ async function saveDocState(arg, { dispatch, getState }) {
378
378
  }
379
379
  }
380
380
  async function createDocState(args, thunkApi) {
381
- const { createPageAction } = await import("./createPageAction-JMGVMCTH.js");
381
+ const { createPageAction } = await import("./createPageAction-7EEVGWGG.js");
382
382
  return createPageAction(args, thunkApi);
383
383
  }
384
384
  function subscribe(listener) {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  resolveDefaultReasoningEffort
3
- } from "./chunk-CGSIW2KI.js";
3
+ } from "./chunk-AIHNB5QH.js";
4
4
  import {
5
5
  buildLocalAgentLookupKeys,
6
6
  shouldReadAgentKeyRemotely
7
- } from "./chunk-64ACTEAE.js";
7
+ } from "./chunk-JKO32CCL.js";
8
8
  import {
9
9
  createHostCredentialBrokerChain,
10
10
  createStrictHostCredentialBroker
@@ -14,7 +14,7 @@ import {
14
14
  formatInvalidAgentSkillModeMessage,
15
15
  formatInvalidAgentSkillModesFieldMessage,
16
16
  isAgentSkillModesFieldShapeValid
17
- } from "./chunk-JX2IG37T.js";
17
+ } from "./chunk-PTY2VZM5.js";
18
18
  import {
19
19
  buildAgentApiKeyCredentialRef,
20
20
  migrateAgentSecrets
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-UAD2WT54.js";
4
4
  import {
5
5
  toTimestampMs
6
- } from "./chunk-GJ4UTSAW.js";
6
+ } from "./chunk-53UOBNTI.js";
7
7
  import {
8
8
  require_react
9
9
  } from "./chunk-RD3QLZQV.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-RGWYRTSY.js";
4
+ } from "./chunk-TOHMK27J.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-GUFTHWDO.js";
7
+ } from "./chunk-4BQ5QKIG.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-UDQZ5JT7.js";
10
+ } from "./chunk-3SEBCWLD.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-USGHJSGO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveRunsDir
3
- } from "./chunk-7XO73H5X.js";
3
+ } from "./chunk-P4JX7YMQ.js";
4
4
  import {
5
5
  isLoopbackHostname
6
6
  } from "./chunk-4SN6J65J.js";
@@ -7,7 +7,7 @@ import {
7
7
  scheduleExistingRecordReplication,
8
8
  shouldReplaceLocalWithRemoteRecord,
9
9
  shouldReplicateLocalRecord
10
- } from "./chunk-REINTCQF.js";
10
+ } from "./chunk-4CL6QIQZ.js";
11
11
  import {
12
12
  fetchFromClientDb,
13
13
  fetchFromServer,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getRuntimeServerContext,
3
3
  scheduleDeleteReplication
4
- } from "./chunk-REINTCQF.js";
4
+ } from "./chunk-4CL6QIQZ.js";
5
5
  import {
6
6
  fetchFromClientDb
7
7
  } from "./chunk-VYRTLHIT.js";
@@ -1,13 +1,13 @@
1
- import {
2
- deriveCredentialGroup
3
- } from "./chunk-HF4C5WIU.js";
4
1
  import {
5
2
  listUserRecordsFromServers,
6
3
  readLiveDbRecordAfterTombstoneMerge
7
- } from "./chunk-YWLMUFZ5.js";
4
+ } from "./chunk-4GWNEPY6.js";
8
5
  import {
9
6
  agentRecordHasConfiguredCredential
10
- } from "./chunk-EQJK6LSN.js";
7
+ } from "./chunk-D4CUS6NT.js";
8
+ import {
9
+ deriveCredentialGroup
10
+ } from "./chunk-AIHNB5QH.js";
11
11
  import {
12
12
  isTombstoneRecord
13
13
  } from "./chunk-BV3FLP2L.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isPidGone
3
- } from "./chunk-7XO73H5X.js";
3
+ } from "./chunk-P4JX7YMQ.js";
4
4
 
5
5
  // packages/cli/tui/tuiRestart.ts
6
6
  import { realpathSync } from "node:fs";
@@ -3,29 +3,29 @@ import {
3
3
  mergeReferences,
4
4
  resolveReferenceAssets,
5
5
  resolveToolsFromKeys
6
- } from "./chunk-2HF6DINU.js";
6
+ } from "./chunk-2BJ53346.js";
7
7
  import {
8
8
  UI_CARD_ENVELOPE_MAX_BYTES,
9
9
  getAllToolRuns,
10
10
  parseUiCard,
11
11
  uiCardFallback
12
- } from "./chunk-GUFTHWDO.js";
12
+ } from "./chunk-4BQ5QKIG.js";
13
13
  import {
14
14
  getDocState
15
- } from "./chunk-U3ZK2MXG.js";
15
+ } from "./chunk-CUQNRU4X.js";
16
16
  import {
17
17
  getTableState
18
- } from "./chunk-K7RWY7JH.js";
18
+ } from "./chunk-YQYSQUP3.js";
19
19
  import {
20
20
  selectAllMsgs
21
- } from "./chunk-26KL6533.js";
21
+ } from "./chunk-TI2JIXK4.js";
22
22
  import {
23
23
  getCurrentSpaceIdRaw,
24
24
  getViewMode
25
- } from "./chunk-SBBSUBY3.js";
25
+ } from "./chunk-DNY33GGQ.js";
26
26
  import {
27
27
  selectById
28
- } from "./chunk-GJ4UTSAW.js";
28
+ } from "./chunk-53UOBNTI.js";
29
29
  import {
30
30
  resolveToolBaseUrl
31
31
  } from "./chunk-KQHEGELM.js";
@@ -41,7 +41,7 @@ import {
41
41
  projectToolMessageContent,
42
42
  resolveAgentRecommendedSkillNames,
43
43
  resolveAgentRequiredPackIds
44
- } from "./chunk-JX2IG37T.js";
44
+ } from "./chunk-PTY2VZM5.js";
45
45
  import {
46
46
  attachmentKind,
47
47
  extractReferenceKeysFromMessage,
@@ -63,7 +63,7 @@ import {
63
63
  expandEnabledPackPromptPatches,
64
64
  expandEnabledPacks,
65
65
  resolveEffectiveEnabledPacks
66
- } from "./chunk-ZMWDHPNG.js";
66
+ } from "./chunk-Z2ZCKNKX.js";
67
67
  import {
68
68
  metaKey
69
69
  } from "./chunk-SYTHYBMI.js";
@@ -0,0 +1,321 @@
1
+ import {
2
+ omitNullishAgentSummaryFields,
3
+ promoteSharedCredentialGroupQuota,
4
+ sortSafeAgentSummaries,
5
+ summarizeCredentialGroups,
6
+ toCompactAgentSummary,
7
+ toSafeAgentSummary,
8
+ toUltraCompactAgentSummary
9
+ } from "./chunk-AIHNB5QH.js";
10
+ import {
11
+ DISPATCH_TIER_RANK,
12
+ resolveAgentSelectionPriority,
13
+ resolveModelTier
14
+ } from "./chunk-K4LLTJUO.js";
15
+ import {
16
+ DEFAULT_PROVIDER_RETRY_MS,
17
+ isAgentUnavailableNow,
18
+ isSubscriptionPeriodWindow,
19
+ resolveAgentAvailability
20
+ } from "./chunk-LS5KAVFQ.js";
21
+
22
+ // packages/ai/agent/agentDiscovery.ts
23
+ function isPreferredAgent(agent) {
24
+ return agent.isFavorite === true || agent.isOwned === true || agent.isOAuth === true || agent.billingSource === "user_subscription" || agent.billingSource === "user_api" || agent.billingSource === "local";
25
+ }
26
+ function isPublicDiscoveryAgent(agent) {
27
+ return agent.isPublic === true && !isPreferredAgent(agent);
28
+ }
29
+ function resolveDiscoveryScope(args) {
30
+ const rawScope = typeof args?.scope === "string" ? args.scope.trim().toLowerCase() : void 0;
31
+ const hasScope = rawScope !== void 0 && rawScope !== "";
32
+ const hasPublicOnly = typeof args?.publicOnly === "boolean";
33
+ const publicOnly = args?.publicOnly === true;
34
+ if (hasScope) {
35
+ if (rawScope !== "preferred" && rawScope !== "public" && rawScope !== "all") {
36
+ throw new Error(`Invalid scope '${args?.scope}': must be 'preferred', 'public', or 'all'.`);
37
+ }
38
+ const scope = rawScope;
39
+ if (hasPublicOnly) {
40
+ if (publicOnly && scope !== "public") {
41
+ throw new Error(
42
+ `Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=true.`
43
+ );
44
+ }
45
+ if (!publicOnly && scope === "public") {
46
+ throw new Error(
47
+ `Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=false.`
48
+ );
49
+ }
50
+ }
51
+ return scope;
52
+ }
53
+ if (hasPublicOnly && publicOnly) {
54
+ return "public";
55
+ }
56
+ return "all";
57
+ }
58
+ function agentIdentityKeys(agent) {
59
+ return [agent.agentKey, agent.publicKey, agent.id].filter(
60
+ (key) => typeof key === "string" && key.length > 0
61
+ );
62
+ }
63
+ function deduplicateAgentSummaries(agents) {
64
+ const byIdentity = /* @__PURE__ */ new Map();
65
+ for (const agent of agents) {
66
+ const keys = agentIdentityKeys(agent);
67
+ const existing = keys.map((key) => byIdentity.get(key)).find(Boolean);
68
+ if (!existing) {
69
+ for (const key of keys) byIdentity.set(key, agent);
70
+ continue;
71
+ }
72
+ const winner = isPreferredAgent(agent) && !isPreferredAgent(existing) ? agent : existing;
73
+ for (const key of /* @__PURE__ */ new Set([...agentIdentityKeys(existing), ...keys])) byIdentity.set(key, winner);
74
+ }
75
+ return [...new Set(byIdentity.values())];
76
+ }
77
+ function filterAgentsByScope(agents, scope) {
78
+ const unique = deduplicateAgentSummaries(agents);
79
+ if (scope === "preferred") return unique.filter((agent) => isPreferredAgent(agent));
80
+ if (scope === "public") return unique.filter((agent) => isPublicDiscoveryAgent(agent));
81
+ return unique.filter((agent) => isPreferredAgent(agent) || agent.isPublic === true);
82
+ }
83
+ function recommendPlanning(agents, caller, poolComplete) {
84
+ const callerKey = typeof caller?.agentKey === "string" && caller.agentKey.trim() ? caller.agentKey : void 0;
85
+ const current = callerKey ? agents.find((a) => a.agentKey === callerKey) : void 0;
86
+ const currentTier = callerKey ? resolveModelTier(caller?.effectiveModel ?? current?.model) : "unknown";
87
+ const base = {
88
+ condition: "when_planning_needed_and_candidate_suitable",
89
+ action: "self",
90
+ currentTier,
91
+ poolComplete,
92
+ requiresPaidApproval: false
93
+ };
94
+ if (caller?.runKind === "subtask") return { ...base, reason: "bounded_subtask" };
95
+ if (!callerKey) return { ...base, reason: "caller_unknown" };
96
+ if (currentTier === "unknown") return { ...base, reason: "caller_tier_unknown" };
97
+ if (!poolComplete) return { ...base, reason: "pool_incomplete" };
98
+ const higher = agents.filter((a) => a.agentKey && a.agentKey !== callerKey && a.modelTier !== "unknown" && DISPATCH_TIER_RANK[a.modelTier] > DISPATCH_TIER_RANK[currentTier]);
99
+ const free = higher.filter((a) => a.requiresPaidApproval === false);
100
+ free.sort((a, b) => DISPATCH_TIER_RANK[b.modelTier] - DISPATCH_TIER_RANK[a.modelTier]);
101
+ const best = free[0];
102
+ if (best) return {
103
+ ...base,
104
+ action: "delegate",
105
+ reason: "higher_suitable_agent",
106
+ agentKey: best.agentKey,
107
+ recommendedTier: best.modelTier
108
+ };
109
+ if (higher.length) return { ...base, reason: "paid_approval_required", requiresPaidApproval: true };
110
+ return { ...base, reason: "no_higher_suitable_agent" };
111
+ }
112
+ function resolvePaginationArgs(args) {
113
+ let limit;
114
+ let offset;
115
+ if (args?.limit !== void 0 && args?.limit !== null) {
116
+ const raw = args.limit;
117
+ if (typeof raw === "boolean") {
118
+ throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
119
+ }
120
+ if (typeof raw === "number") {
121
+ if (!Number.isInteger(raw) || raw <= 0) {
122
+ throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
123
+ }
124
+ limit = Math.min(raw, 500);
125
+ } else if (typeof raw === "string") {
126
+ if (raw.trim() !== "") {
127
+ if (!/^\d+$/.test(raw.trim())) {
128
+ throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
129
+ }
130
+ const parsed = Number(raw.trim());
131
+ if (!Number.isInteger(parsed) || parsed <= 0) {
132
+ throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
133
+ }
134
+ limit = Math.min(parsed, 500);
135
+ }
136
+ } else {
137
+ throw new Error(`Invalid limit '${String(raw)}': must be a positive integer.`);
138
+ }
139
+ }
140
+ if (args?.offset !== void 0 && args?.offset !== null) {
141
+ const raw = args.offset;
142
+ if (typeof raw === "boolean") {
143
+ throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
144
+ }
145
+ if (typeof raw === "number") {
146
+ if (!Number.isInteger(raw) || raw < 0) {
147
+ throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
148
+ }
149
+ offset = raw;
150
+ } else if (typeof raw === "string") {
151
+ if (raw.trim() !== "") {
152
+ if (!/^\d+$/.test(raw.trim())) {
153
+ throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
154
+ }
155
+ const parsed = Number(raw.trim());
156
+ if (!Number.isInteger(parsed) || parsed < 0) {
157
+ throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
158
+ }
159
+ offset = parsed;
160
+ }
161
+ } else {
162
+ throw new Error(`Invalid offset '${String(raw)}': must be a non-negative integer.`);
163
+ }
164
+ }
165
+ return { limit, offset };
166
+ }
167
+ function matchesAgentQuery(agent, query) {
168
+ if (!query || typeof query !== "string") return true;
169
+ const q = query.trim().toLowerCase();
170
+ if (!q) return true;
171
+ const candidates = [
172
+ agent.name,
173
+ agent.model,
174
+ agent.provider,
175
+ agent.handle,
176
+ agent.agentKey,
177
+ agent.publicKey,
178
+ agent.id
179
+ ];
180
+ return candidates.some((text) => typeof text === "string" && text.toLowerCase().includes(q));
181
+ }
182
+ function nearestFundedSubscriptionReset(agent, now) {
183
+ let nearest = Infinity;
184
+ if (agent.billingSource !== "user_subscription") return nearest;
185
+ for (const window of agent.quota?.windows ?? []) {
186
+ const { resetAt, remaining, utilization } = window;
187
+ if (typeof resetAt === "number" && resetAt > now && resetAt < nearest && isSubscriptionPeriodWindow(window) && (typeof remaining === "number" && remaining > 0 || typeof utilization === "number" && utilization < 0.95)) {
188
+ nearest = resetAt;
189
+ }
190
+ }
191
+ return nearest;
192
+ }
193
+ function meteredUnitPrice(agent) {
194
+ if (agent.billingSource === "user_subscription" || agent.billingSource === "owner_subscription") return Infinity;
195
+ const input = agent.inputPrice !== null && Number.isFinite(agent.inputPrice) ? agent.inputPrice : 0;
196
+ const output = agent.outputPrice !== null && Number.isFinite(agent.outputPrice) ? agent.outputPrice : 0;
197
+ return input > 0 || output > 0 ? input + output : Infinity;
198
+ }
199
+ function buildAgentDiscoveryResult(options) {
200
+ const scope = resolveDiscoveryScope({
201
+ scope: options.scope,
202
+ publicOnly: options.publicOnly
203
+ });
204
+ const now = options.now ?? Date.now();
205
+ let scopedAgents = filterAgentsByScope(options.agents, scope);
206
+ if (options.query && typeof options.query === "string" && options.query.trim()) {
207
+ scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
208
+ }
209
+ scopedAgents = scopedAgents.map((agent) => {
210
+ const decision = resolveAgentAvailability(agent, now);
211
+ if (decision.status === "quota_exhausted") {
212
+ const resetAt = decision.resetAt ?? now + DEFAULT_PROVIDER_RETRY_MS;
213
+ const nextAvailableAt = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > resetAt ? agent.nextAvailableAt : resetAt;
214
+ return {
215
+ ...agent,
216
+ nextAvailableAt,
217
+ availableAt: nextAvailableAt,
218
+ availabilityStatus: decision.status,
219
+ availabilityReason: decision.reason
220
+ };
221
+ }
222
+ return {
223
+ ...agent,
224
+ availabilityStatus: decision.status,
225
+ availabilityReason: decision.reason
226
+ };
227
+ });
228
+ const unavailableCount = scopedAgents.filter((a) => isAgentUnavailableNow(a, now)).length;
229
+ const credentialGroups = summarizeCredentialGroups(scopedAgents, now);
230
+ const pagination = resolvePaginationArgs({
231
+ limit: options.limit,
232
+ offset: options.offset
233
+ });
234
+ const offset = pagination.offset;
235
+ const limit = pagination.limit;
236
+ const sortedAgents = sortSafeAgentSummaries(scopedAgents);
237
+ const hasQuery = Boolean(options.query && typeof options.query === "string" && options.query.trim());
238
+ const hasFilteredCandidates = sortedAgents.length < options.agents.length;
239
+ let total;
240
+ if (hasQuery) {
241
+ total = sortedAgents.length;
242
+ } else if (hasFilteredCandidates) {
243
+ total = sortedAgents.length;
244
+ } else if (scope === "public") {
245
+ total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
246
+ } else if (scope === "all") {
247
+ const privateOnlyCount = scopedAgents.filter((a) => isPreferredAgent(a) && a.isPublic !== true).length;
248
+ const publicPulledCount = scopedAgents.filter((a) => a.isPublic === true).length;
249
+ const effectivePublicTotal = typeof options.upstreamTotal === "number" && options.upstreamTotal > publicPulledCount ? options.upstreamTotal : publicPulledCount;
250
+ total = options.upstreamTruncated === true ? privateOnlyCount + effectivePublicTotal : sortedAgents.length;
251
+ } else {
252
+ total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
253
+ }
254
+ const isTruncated = options.upstreamTruncated === true || !hasQuery && !hasFilteredCandidates && typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length;
255
+ const pagedAgents = typeof limit === "number" || typeof offset === "number" ? sortedAgents.slice(
256
+ offset ?? 0,
257
+ (offset ?? 0) + (limit ?? sortedAgents.length)
258
+ ) : sortedAgents;
259
+ const projectedAgents = options.verbose === true ? pagedAgents.map(omitNullishAgentSummaryFields) : options.compact === true ? pagedAgents.map(toUltraCompactAgentSummary) : pagedAgents.map(toCompactAgentSummary);
260
+ const compacted = options.compact === true && options.verbose !== true ? promoteSharedCredentialGroupQuota(
261
+ projectedAgents,
262
+ credentialGroups
263
+ ) : { agents: projectedAgents, groups: credentialGroups };
264
+ const tierHints = {};
265
+ const tierHintPreferences = /* @__PURE__ */ new Map();
266
+ for (const agent of sortedAgents) {
267
+ const { agentKey, name, model, modelTier, requiresPaidApproval, availabilityStatus } = agent;
268
+ if (!agentKey || requiresPaidApproval !== false || modelTier === "unknown" || availabilityStatus === "quota_exhausted" || availabilityStatus === "rate_limited") continue;
269
+ const priority = resolveAgentSelectionPriority(agent);
270
+ const current = tierHintPreferences.get(modelTier);
271
+ if (current && current.priority !== priority) continue;
272
+ const resetAt = nearestFundedSubscriptionReset(agent, now);
273
+ const price = resetAt === Infinity ? meteredUnitPrice(agent) : Infinity;
274
+ if (current && (resetAt > current.resetAt || resetAt === current.resetAt && price >= current.price)) continue;
275
+ tierHintPreferences.set(modelTier, { priority, resetAt, price });
276
+ tierHints[modelTier] = { agentKey, name, model };
277
+ }
278
+ return {
279
+ total,
280
+ ...typeof offset === "number" ? { offset } : {},
281
+ ...typeof limit === "number" ? { limit } : {},
282
+ ...isTruncated ? { truncated: true } : {},
283
+ unavailableCount,
284
+ availableCount: sortedAgents.length,
285
+ agents: compacted.agents,
286
+ planningRecommendation: recommendPlanning(
287
+ sortedAgents,
288
+ options.caller,
289
+ !isTruncated && scope === "all" && !hasQuery && !options.poolRestricted
290
+ ),
291
+ ...Object.keys(tierHints).length > 0 ? { tierHints } : {},
292
+ credentialGroups: compacted.groups
293
+ };
294
+ }
295
+ function toDiscoverySafeAgentSummary(record2, options) {
296
+ const mergedOptions = record2?.publicRecordExists === true ? { ...options, publicRecordExists: true } : options;
297
+ return toSafeAgentSummary(record2, mergedOptions);
298
+ }
299
+
300
+ // packages/ai/agent/dispatchSpeedProvenance.ts
301
+ var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
302
+ function isServerDispatchSpeedSource(value, dialogId, userId) {
303
+ const dialog = record(value);
304
+ const proof = record(dialog.dispatchSpeedProvenance);
305
+ return proof.version === 1 && proof.source === "server-startAgentRun" && proof.userId === userId && record(dialog.runtimeBinding).tenantUserId === userId && dialog.id === dialogId;
306
+ }
307
+ function isLocalDispatchSpeedSource(value, dialogId, userId) {
308
+ const run = record(value);
309
+ const proof = record(run.dispatchSpeedProvenance);
310
+ return proof.version === 1 && proof.source === "cli-startAgentRun" && proof.userId === userId && typeof run.runId === "string" && run.runId.length > 0 && run.dialogId === dialogId && run.ephemeral !== true;
311
+ }
312
+
313
+ export {
314
+ resolveDiscoveryScope,
315
+ resolvePaginationArgs,
316
+ matchesAgentQuery,
317
+ buildAgentDiscoveryResult,
318
+ toDiscoverySafeAgentSummary,
319
+ isServerDispatchSpeedSource,
320
+ isLocalDispatchSpeedSource
321
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildAgentRuntimeAgentLookupKeys,
3
3
  shouldFetchAgentRuntimeRecordRemotely
4
- } from "./chunk-ZMXO5G3E.js";
4
+ } from "./chunk-K4LLTJUO.js";
5
5
 
6
6
  // packages/cli/client/localAgentRecords.ts
7
7
  var buildLocalAgentLookupKeys = buildAgentRuntimeAgentLookupKeys;
@@ -795,6 +795,8 @@ var CLOSED_OBJECT_SCHEMA_TOOL_NAMES = /* @__PURE__ */ new Set([
795
795
  function stringToolParam(description) {
796
796
  return { type: "string", description };
797
797
  }
798
+ var READ_DIALOG_TOOL_DESCRIPTION = `Read a persisted dialog (meta + messages) by full dbKey (dialog-<userId>-<id>) or dialog URL; use listDialogs when unclear. A bare id only resolves for the currently logged-in user \u2014 pass user/server. For runs, do not poll a running dialog's full transcript: prefer controlAgentRun, else mode="status" for a compact snapshot; read the transcript only after done/failed/cancelled. Response is budgeted: reasoning_content, tool_calls, tool results and metadata are head-truncated (truncated, messagesTotal/messagesReturned, estimatedOriginalChars/omittedChars). For review or verification, read mode="status" plus the final verdict and take diffs from the worktree instead of pulling the full execution transcript.`;
799
+ var LIST_AGENTS_TOOL_DESCRIPTION = "List agents for delegation. Default scope='all' dedupes the user's own/favorite agents (owned, OAuth, custom-API, local) with the public marketplace; scope='public' discovers shared/marketplace agents only. Public agents may consume platform credits \u2014 check billingSource. Each entry's agentKey is runnable (agent-<userId>-<id> / agent-pub-<id>): Copy the agentKey verbatim; use the runnable agentKey exactly and do not infer it from the display name. Copy `agentKey` verbatim into startAgentRun. Returns planningRecommendation (reason, currentTier, requiresPaidApproval): advice when planning is needed, not authorization. Rate-limited agents are listed too: availabilityStatus/availabilityReason/nextAvailableAt are reference info \u2014 advisory annotations, not dispatch gates; unavailableCount counts them. Fan-out guard limits only same-batch concurrency (sharing a credential alone is not a dependency) unless allowUnknownCredential confirms.";
798
800
  function buildNoloWorkspaceOpenAiTools(args) {
799
801
  const toolNames = new Set(args.toolNames ?? []);
800
802
  const tools = [];
@@ -820,7 +822,7 @@ function buildNoloWorkspaceOpenAiTools(args) {
820
822
  limit: { type: "integer", description: "Maximum dialogs to return." },
821
823
  space: stringToolParam("Optional space id or URL.")
822
824
  });
823
- add("readDialog", `Read one persisted dialog (metadata + messages) by full dbKey (dialog-<userId>-<id>) or URL. Use listDialogs first if target is unclear; a bare id resolves against the current user, pass user for someone else's dialog. Reading an agent run's dialog is fine at any time, but do not poll a still-running one through the full transcript: if controlAgentRun is available prefer it for live runs, otherwise use mode="status" for a compact snapshot, and pull the full transcript once the run is done/failed/cancelled. The response is budgeted: reasoning_content, tool_calls arguments, tool result content and metadata are head-truncated with projection stats (truncated, messagesTotal/messagesReturned, estimatedOriginalChars/omittedChars). For review or verification, read mode="status" plus the final verdict and take diffs from the worktree instead of pulling the full execution transcript.`, {
825
+ add("readDialog", READ_DIALOG_TOOL_DESCRIPTION, {
824
826
  dialog: stringToolParam("Dialog dbKey (dialog-<userId>-<id>), dialog URL, or bare id (resolved against user/current account)."),
825
827
  mode: {
826
828
  type: "string",
@@ -855,7 +857,7 @@ function buildNoloWorkspaceOpenAiTools(args) {
855
857
  description: "Confirmed dialog ids or dbKeys to delete."
856
858
  }
857
859
  }, ["query"]);
858
- add("listAgents", "List agents for delegation. Default scope='all' returns the user's favorites, owned, OAuth, custom API, and local agents plus the public marketplace; scope='public' discovers shared/marketplace agents only. Public agents may consume platform credits. Copy the agentKey verbatim; use the runnable agentKey exactly and do not infer it from the display name. publicOnly is deprecated compatibility for scope='public'. Returns planningRecommendation: conditional advice only when planning is needed and the candidate is suitable; simple questions need no extra planning call. action self/delegate, reason, currentTier, optional agentKey/recommendedTier, poolComplete, requiresPaidApproval. Caller identity/model/runKind are host-owned, not tool arguments. Unknown tiers are not ranked; incomplete pools cannot establish a highest candidate. Bounded subtasks do not delegate planning. Recommendation is not authorization and never starts a run; paid channels require separate approval. All agents in the selected scope are listed; cooldown and quota status are advisory annotations, not dispatch gates.", {
860
+ add("listAgents", LIST_AGENTS_TOOL_DESCRIPTION, {
859
861
  query: stringToolParam("Optional case-insensitive search substring matching agent name, model, provider, handle, or agentKey."),
860
862
  scope: { type: "string", enum: ["all", "public"], description: "Discovery scope; all is the default and includes the public marketplace." },
861
863
  publicOnly: { type: "boolean", description: "Deprecated compatibility alias for scope='public'." },
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SCY2O7CU.js";
4
4
  import {
5
5
  patch
6
- } from "./chunk-GJ4UTSAW.js";
6
+ } from "./chunk-53UOBNTI.js";
7
7
  import {
8
8
  getIsDesktopApp
9
9
  } from "./chunk-VYRTLHIT.js";
@@ -14,16 +14,16 @@ import {
14
14
  import {
15
15
  addContentToSpace,
16
16
  resolveCreationSpaceId
17
- } from "./chunk-K7RWY7JH.js";
17
+ } from "./chunk-YQYSQUP3.js";
18
18
  import {
19
19
  runtime_default
20
- } from "./chunk-26KL6533.js";
20
+ } from "./chunk-TI2JIXK4.js";
21
21
  import {
22
22
  getCurrentSpaceId
23
- } from "./chunk-SBBSUBY3.js";
23
+ } from "./chunk-DNY33GGQ.js";
24
24
  import {
25
25
  write
26
- } from "./chunk-GJ4UTSAW.js";
26
+ } from "./chunk-53UOBNTI.js";
27
27
  import {
28
28
  selectIdentityUserId
29
29
  } from "./chunk-PXYBUFDB.js";