nolo-cli 0.252.0-alpha.3 → 0.254.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-OMDET3E2.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-5WXEECFH.js} +36 -36
  5. package/{agentEmailCommands-UKPURCCI.js → agentEmailCommands-3QWBB2JL.js} +36 -36
  6. package/{agentListCommands-CTY7WAMN.js → agentListCommands-WTEF5RKJ.js} +16 -16
  7. package/{agentMachineCommands-WTCQHXHZ.js → agentMachineCommands-DP44GKA6.js} +12 -11
  8. package/{agentRecordCommands-IM2WIFKB.js → agentRecordCommands-4I7P34GJ.js} +36 -36
  9. package/{agentRunCommand-7MCCRUJY.js → agentRunCommand-VAKWFXJV.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-5ZSVWJHV.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-2G3XMM3O.js +336 -0
  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-YWLMUFZ5.js → chunk-4GWNEPY6.js} +1 -1
  25. package/{chunk-SE7UURHT.js → chunk-4Z7Q4QZF.js} +12 -12
  26. package/{chunk-GJ4UTSAW.js → chunk-53UOBNTI.js} +4 -4
  27. package/{chunk-RGWYRTSY.js → chunk-6WI4PFPP.js} +21 -23
  28. package/{chunk-V644LXPC.js → chunk-7STRX24O.js} +3 -3
  29. package/chunk-AIHNB5QH.js +1394 -0
  30. package/{chunk-FJPVVLP3.js → chunk-AX63ZU2W.js} +4 -4
  31. package/{chunk-EQJK6LSN.js → chunk-D4CUS6NT.js} +3 -3
  32. package/{chunk-SBBSUBY3.js → chunk-DNY33GGQ.js} +1 -1
  33. package/{chunk-N2ZAY2DK.js → chunk-GFXPPQZN.js} +1 -1
  34. package/{chunk-GUFTHWDO.js → chunk-GJKEOBCV.js} +9 -9
  35. package/{chunk-BTQU2PRC.js → chunk-GK772DEV.js} +1 -1
  36. package/{chunk-N7UXTVAR.js → chunk-HEQJ5XND.js} +1 -1
  37. package/{chunk-BLBGVSLB.js → chunk-HEUHCHAR.js} +5 -5
  38. package/{chunk-MOAVLCCM.js → chunk-HKPIFK7F.js} +3 -3
  39. package/{chunk-WNIBQBOR.js → chunk-HS4JGZQH.js} +1 -1
  40. package/{chunk-BVCCRSGK.js → chunk-IDCGMZLC.js} +5 -5
  41. package/{chunk-KO6JNZCF.js → chunk-IGK4OXAO.js} +21 -8
  42. package/{chunk-64ACTEAE.js → chunk-JKO32CCL.js} +1 -1
  43. package/{chunk-ZMXO5G3E.js → chunk-K4LLTJUO.js} +4 -2
  44. package/{chunk-CSTCYYCR.js → chunk-KR4W72OK.js} +9 -9
  45. package/{chunk-MDWHMQON.js → chunk-M7GMJBQJ.js} +1 -1
  46. package/{chunk-EPBEZKYK.js → chunk-MCQXBKC6.js} +2 -2
  47. package/{chunk-26KL6533.js → chunk-MICGEDCN.js} +18 -18
  48. package/{chunk-RE32BIKY.js → chunk-MR72IIX5.js} +3 -3
  49. package/{chunk-WJOC3AEM.js → chunk-MRYKRL2V.js} +1 -1
  50. package/{chunk-2HF6DINU.js → chunk-MW3XUUYS.js} +6 -6
  51. package/{chunk-4KBKOG2L.js → chunk-NEDBPW44.js} +2 -2
  52. package/{chunk-Z47UZT27.js → chunk-NMGG3NUB.js} +1 -1
  53. package/{chunk-N2MDL5AZ.js → chunk-NXNHG3QT.js} +9 -9
  54. package/{chunk-3LL5HRIJ.js → chunk-OLS2J3WE.js} +1 -1
  55. package/{chunk-7XO73H5X.js → chunk-P4JX7YMQ.js} +1 -1
  56. package/{chunk-Q5M27DUE.js → chunk-PR25J652.js} +1 -1
  57. package/{chunk-JX2IG37T.js → chunk-PTY2VZM5.js} +1 -1
  58. package/{chunk-OTNPEE4G.js → chunk-SID2TFMV.js} +87 -63
  59. package/{chunk-NWZRCUHM.js → chunk-TA2JQUWA.js} +101 -192
  60. package/{chunk-UGHNYYOE.js → chunk-VPSPVLCM.js} +2 -2
  61. package/{chunk-OTOPQXP5.js → chunk-XWR2YD4L.js} +1 -1
  62. package/{chunk-K7RWY7JH.js → chunk-YW5L3XOO.js} +7 -7
  63. package/{chunk-IQXMWBI6.js → chunk-YYHWEVBI.js} +2 -2
  64. package/{chunk-ZMWDHPNG.js → chunk-Z2ZCKNKX.js} +1 -5
  65. package/{chunk-U3ZK2MXG.js → chunk-ZAKWT4XQ.js} +3 -3
  66. package/{cliLocalAgentRecordReader-OHAC4JTY.js → cliLocalAgentRecordReader-2WBUVRVD.js} +9 -9
  67. package/{commandRegistry-YSV6ZWPO.js → commandRegistry-DONNI3FW.js} +46 -117
  68. package/{contentThunks-GSMUNWBA.js → contentThunks-THSXC6WQ.js} +11 -11
  69. package/{createAgentAutomationAction-RMADR4LG.js → createAgentAutomationAction-WNQOJ4DG.js} +11 -11
  70. package/{createDialogAction-CM5CBQVH.js → createDialogAction-YORDQFFC.js} +12 -12
  71. package/{createPageAction-JMGVMCTH.js → createPageAction-2S7V5OCW.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-JOICDGQU.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-NKVLWCXX.js} +6 -6
  80. package/{docUpdateCommands-5TIT7DAJ.js → docUpdateCommands-VJ6A6F7F.js} +12 -11
  81. package/{handleSendMessageAction-TVR55KVT.js → handleSendMessageAction-SNNYOQ4P.js} +22 -22
  82. package/{hostCredentialCreate-T33O7WLA.js → hostCredentialCreate-SDQUFL23.js} +36 -36
  83. package/index.js +4 -4
  84. package/{localRuntimeAdapter-CNFP7ZEP.js → localRuntimeAdapter-JHYH5ZIR.js} +35 -35
  85. package/{machineCommands-TGA5EH2G.js → machineCommands-BXSBRM7L.js} +36 -36
  86. package/{machineWsRunDispatch-LMJPGTTZ.js → machineWsRunDispatch-KEXSHGSD.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-FDYE7VNC.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-ME2C64XI.js} +46 -64
  93. package/{removeDialogAgentAction-H6S7VLNA.js → removeDialogAgentAction-MXJEB77K.js} +6 -6
  94. package/{runAgentClientLoop-WZJ4HXOH.js → runAgentClientLoop-UAGXVYW5.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-RZUB6JTH.js} +35 -35
  100. package/{switchDialogAgentAction-O236K6HB.js → switchDialogAgentAction-SSI2CSNE.js} +5 -5
  101. package/{tools-4RFLNHUW.js → tools-23F5EEVM.js} +23 -23
  102. package/{tuiRestart-GF4DGAAN.js → tuiRestart-7IKI6JZK.js} +3 -3
  103. package/{updateDialogTitleAction-F3ONQM3N.js → updateDialogTitleAction-TJWT4LXL.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
@@ -4,19 +4,20 @@ import {
4
4
  outputResult,
5
5
  printCliError,
6
6
  resolveCliContext
7
- } from "./chunk-25GCVHBZ.js";
7
+ } from "./chunk-25BDZGD7.js";
8
8
  import {
9
9
  hasFlag,
10
10
  hasHelpArg
11
- } from "./chunk-Q5M27DUE.js";
11
+ } from "./chunk-PR25J652.js";
12
12
  import "./chunk-VF4K2QE6.js";
13
13
  import "./chunk-UAD2WT54.js";
14
14
  import "./chunk-LKZPX6YH.js";
15
- import "./chunk-EQJK6LSN.js";
16
- import "./chunk-CGSIW2KI.js";
15
+ import "./chunk-D4CUS6NT.js";
16
+ import "./chunk-AIHNB5QH.js";
17
17
  import "./chunk-AMWMV56B.js";
18
- import "./chunk-64ACTEAE.js";
19
- import "./chunk-UDQZ5JT7.js";
18
+ import "./chunk-UEILX4EV.js";
19
+ import "./chunk-JKO32CCL.js";
20
+ import "./chunk-3SEBCWLD.js";
20
21
  import "./chunk-ZNFJWEN4.js";
21
22
  import "./chunk-LHCGKAFO.js";
22
23
  import "./chunk-OOV5JN25.js";
@@ -26,18 +27,18 @@ import "./chunk-CHOZJMJS.js";
26
27
  import "./chunk-PIVTQRX6.js";
27
28
  import "./chunk-HNUWUO75.js";
28
29
  import "./chunk-DMPZMYH4.js";
29
- import "./chunk-OTOPQXP5.js";
30
+ import "./chunk-XWR2YD4L.js";
30
31
  import "./chunk-BYXBJQAS.js";
31
32
  import "./chunk-BZLGPM5B.js";
32
33
  import "./chunk-WLHUANWZ.js";
33
34
  import "./chunk-56GBUMO5.js";
34
- import "./chunk-OTNPEE4G.js";
35
- import "./chunk-ZMXO5G3E.js";
35
+ import "./chunk-SID2TFMV.js";
36
+ import "./chunk-K4LLTJUO.js";
36
37
  import "./chunk-LS5KAVFQ.js";
37
38
  import "./chunk-FXEPZKNJ.js";
38
39
  import "./chunk-X4O7FJF5.js";
39
40
  import "./chunk-TLE77UJ5.js";
40
- import "./chunk-JX2IG37T.js";
41
+ import "./chunk-PTY2VZM5.js";
41
42
  import "./chunk-KXOPLLFP.js";
42
43
  import "./chunk-DNNPARJK.js";
43
44
  import "./chunk-2MBTWINN.js";
@@ -51,7 +52,7 @@ import "./chunk-SR4FE5VD.js";
51
52
  import "./chunk-USGHJSGO.js";
52
53
  import "./chunk-KX6YBIHG.js";
53
54
  import "./chunk-E6A5NHDH.js";
54
- import "./chunk-5BRVDQTX.js";
55
+ import "./chunk-KWARDHBI.js";
55
56
  import "./chunk-EWQ3HGNZ.js";
56
57
  import "./chunk-PSCNXBYA.js";
57
58
  import "./chunk-IVK2KT3H.js";
@@ -65,7 +66,7 @@ import "./chunk-G7Y4GXTY.js";
65
66
  import "./chunk-6UBGXX2W.js";
66
67
  import "./chunk-BV3FLP2L.js";
67
68
  import "./chunk-4ZCTKB27.js";
68
- import "./chunk-ZMWDHPNG.js";
69
+ import "./chunk-Z2ZCKNKX.js";
69
70
  import "./chunk-EUGTFFO6.js";
70
71
  import "./chunk-AETZ7AD6.js";
71
72
  import "./chunk-CO6E7YK6.js";
@@ -5,19 +5,20 @@ import {
5
5
  pickDefined,
6
6
  printCliError,
7
7
  resolveCliContext
8
- } from "./chunk-25GCVHBZ.js";
8
+ } from "./chunk-25BDZGD7.js";
9
9
  import {
10
10
  hasFlag,
11
11
  hasHelpArg
12
- } from "./chunk-Q5M27DUE.js";
12
+ } from "./chunk-PR25J652.js";
13
13
  import "./chunk-VF4K2QE6.js";
14
14
  import "./chunk-UAD2WT54.js";
15
15
  import "./chunk-LKZPX6YH.js";
16
- import "./chunk-EQJK6LSN.js";
17
- import "./chunk-CGSIW2KI.js";
16
+ import "./chunk-D4CUS6NT.js";
17
+ import "./chunk-AIHNB5QH.js";
18
18
  import "./chunk-AMWMV56B.js";
19
- import "./chunk-64ACTEAE.js";
20
- import "./chunk-UDQZ5JT7.js";
19
+ import "./chunk-UEILX4EV.js";
20
+ import "./chunk-JKO32CCL.js";
21
+ import "./chunk-3SEBCWLD.js";
21
22
  import "./chunk-ZNFJWEN4.js";
22
23
  import "./chunk-LHCGKAFO.js";
23
24
  import "./chunk-OOV5JN25.js";
@@ -27,18 +28,18 @@ import "./chunk-CHOZJMJS.js";
27
28
  import "./chunk-PIVTQRX6.js";
28
29
  import "./chunk-HNUWUO75.js";
29
30
  import "./chunk-DMPZMYH4.js";
30
- import "./chunk-OTOPQXP5.js";
31
+ import "./chunk-XWR2YD4L.js";
31
32
  import "./chunk-BYXBJQAS.js";
32
33
  import "./chunk-BZLGPM5B.js";
33
34
  import "./chunk-WLHUANWZ.js";
34
35
  import "./chunk-56GBUMO5.js";
35
- import "./chunk-OTNPEE4G.js";
36
- import "./chunk-ZMXO5G3E.js";
36
+ import "./chunk-SID2TFMV.js";
37
+ import "./chunk-K4LLTJUO.js";
37
38
  import "./chunk-LS5KAVFQ.js";
38
39
  import "./chunk-FXEPZKNJ.js";
39
40
  import "./chunk-X4O7FJF5.js";
40
41
  import "./chunk-TLE77UJ5.js";
41
- import "./chunk-JX2IG37T.js";
42
+ import "./chunk-PTY2VZM5.js";
42
43
  import "./chunk-KXOPLLFP.js";
43
44
  import "./chunk-DNNPARJK.js";
44
45
  import "./chunk-2MBTWINN.js";
@@ -52,7 +53,7 @@ import "./chunk-SR4FE5VD.js";
52
53
  import "./chunk-USGHJSGO.js";
53
54
  import "./chunk-KX6YBIHG.js";
54
55
  import "./chunk-E6A5NHDH.js";
55
- import "./chunk-5BRVDQTX.js";
56
+ import "./chunk-KWARDHBI.js";
56
57
  import "./chunk-EWQ3HGNZ.js";
57
58
  import "./chunk-PSCNXBYA.js";
58
59
  import "./chunk-IVK2KT3H.js";
@@ -66,7 +67,7 @@ import "./chunk-G7Y4GXTY.js";
66
67
  import "./chunk-6UBGXX2W.js";
67
68
  import "./chunk-BV3FLP2L.js";
68
69
  import "./chunk-4ZCTKB27.js";
69
- import "./chunk-ZMWDHPNG.js";
70
+ import "./chunk-Z2ZCKNKX.js";
70
71
  import "./chunk-EUGTFFO6.js";
71
72
  import "./chunk-AETZ7AD6.js";
72
73
  import "./chunk-CO6E7YK6.js";
@@ -5,19 +5,20 @@ import {
5
5
  pickDefined,
6
6
  printCliError,
7
7
  resolveCliContext
8
- } from "./chunk-25GCVHBZ.js";
8
+ } from "./chunk-25BDZGD7.js";
9
9
  import {
10
10
  hasFlag,
11
11
  hasHelpArg
12
- } from "./chunk-Q5M27DUE.js";
12
+ } from "./chunk-PR25J652.js";
13
13
  import "./chunk-VF4K2QE6.js";
14
14
  import "./chunk-UAD2WT54.js";
15
15
  import "./chunk-LKZPX6YH.js";
16
- import "./chunk-EQJK6LSN.js";
17
- import "./chunk-CGSIW2KI.js";
16
+ import "./chunk-D4CUS6NT.js";
17
+ import "./chunk-AIHNB5QH.js";
18
18
  import "./chunk-AMWMV56B.js";
19
- import "./chunk-64ACTEAE.js";
20
- import "./chunk-UDQZ5JT7.js";
19
+ import "./chunk-UEILX4EV.js";
20
+ import "./chunk-JKO32CCL.js";
21
+ import "./chunk-3SEBCWLD.js";
21
22
  import "./chunk-ZNFJWEN4.js";
22
23
  import "./chunk-LHCGKAFO.js";
23
24
  import "./chunk-OOV5JN25.js";
@@ -27,18 +28,18 @@ import "./chunk-CHOZJMJS.js";
27
28
  import "./chunk-PIVTQRX6.js";
28
29
  import "./chunk-HNUWUO75.js";
29
30
  import "./chunk-DMPZMYH4.js";
30
- import "./chunk-OTOPQXP5.js";
31
+ import "./chunk-XWR2YD4L.js";
31
32
  import "./chunk-BYXBJQAS.js";
32
33
  import "./chunk-BZLGPM5B.js";
33
34
  import "./chunk-WLHUANWZ.js";
34
35
  import "./chunk-56GBUMO5.js";
35
- import "./chunk-OTNPEE4G.js";
36
- import "./chunk-ZMXO5G3E.js";
36
+ import "./chunk-SID2TFMV.js";
37
+ import "./chunk-K4LLTJUO.js";
37
38
  import "./chunk-LS5KAVFQ.js";
38
39
  import "./chunk-FXEPZKNJ.js";
39
40
  import "./chunk-X4O7FJF5.js";
40
41
  import "./chunk-TLE77UJ5.js";
41
- import "./chunk-JX2IG37T.js";
42
+ import "./chunk-PTY2VZM5.js";
42
43
  import "./chunk-KXOPLLFP.js";
43
44
  import "./chunk-DNNPARJK.js";
44
45
  import "./chunk-2MBTWINN.js";
@@ -52,7 +53,7 @@ import "./chunk-SR4FE5VD.js";
52
53
  import "./chunk-USGHJSGO.js";
53
54
  import "./chunk-KX6YBIHG.js";
54
55
  import "./chunk-E6A5NHDH.js";
55
- import "./chunk-5BRVDQTX.js";
56
+ import "./chunk-KWARDHBI.js";
56
57
  import "./chunk-EWQ3HGNZ.js";
57
58
  import "./chunk-PSCNXBYA.js";
58
59
  import "./chunk-IVK2KT3H.js";
@@ -66,7 +67,7 @@ import "./chunk-G7Y4GXTY.js";
66
67
  import "./chunk-6UBGXX2W.js";
67
68
  import "./chunk-BV3FLP2L.js";
68
69
  import "./chunk-4ZCTKB27.js";
69
- import "./chunk-ZMWDHPNG.js";
70
+ import "./chunk-Z2ZCKNKX.js";
70
71
  import "./chunk-EUGTFFO6.js";
71
72
  import "./chunk-AETZ7AD6.js";
72
73
  import "./chunk-CO6E7YK6.js";
@@ -7,7 +7,7 @@ import {
7
7
  resolveBuiltinSkillEntry,
8
8
  resolveBuiltinSkillPage,
9
9
  resolveBuiltinSkillSlug
10
- } from "./chunk-ZMWDHPNG.js";
10
+ } from "./chunk-Z2ZCKNKX.js";
11
11
  import "./chunk-EUGTFFO6.js";
12
12
  import "./chunk-AETZ7AD6.js";
13
13
  import "./chunk-CO6E7YK6.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  requireTokenUser
3
- } from "./chunk-Q5M27DUE.js";
3
+ } from "./chunk-PR25J652.js";
4
4
  import {
5
5
  resolveServerUrl
6
6
  } from "./chunk-BIDSIRTS.js";
@@ -0,0 +1,336 @@
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 resolveCallerCredentialGroup(agents, caller) {
84
+ const explicit = caller?.credentialGroup;
85
+ if (typeof explicit === "string" && explicit.trim()) return explicit.trim();
86
+ const callerKey = typeof caller?.agentKey === "string" && caller.agentKey.trim() ? caller.agentKey : void 0;
87
+ if (!callerKey) return void 0;
88
+ const own = agents.find((agent) => agent.agentKey === callerKey);
89
+ const group = own?.credentialGroup;
90
+ return typeof group === "string" && group.length > 0 ? group : void 0;
91
+ }
92
+ function recommendPlanning(agents, caller, poolComplete) {
93
+ const callerKey = typeof caller?.agentKey === "string" && caller.agentKey.trim() ? caller.agentKey : void 0;
94
+ const current = callerKey ? agents.find((a) => a.agentKey === callerKey) : void 0;
95
+ const currentTier = callerKey ? resolveModelTier(caller?.effectiveModel ?? current?.model) : "unknown";
96
+ const base = {
97
+ condition: "when_planning_needed_and_candidate_suitable",
98
+ action: "self",
99
+ currentTier,
100
+ poolComplete,
101
+ requiresPaidApproval: false
102
+ };
103
+ if (caller?.runKind === "subtask") return { ...base, reason: "bounded_subtask" };
104
+ if (!callerKey) return { ...base, reason: "caller_unknown" };
105
+ if (currentTier === "unknown") return { ...base, reason: "caller_tier_unknown" };
106
+ if (!poolComplete) return { ...base, reason: "pool_incomplete" };
107
+ const higher = agents.filter((a) => a.agentKey && a.agentKey !== callerKey && a.modelTier !== "unknown" && DISPATCH_TIER_RANK[a.modelTier] > DISPATCH_TIER_RANK[currentTier]);
108
+ const free = higher.filter((a) => a.requiresPaidApproval === false);
109
+ free.sort((a, b) => DISPATCH_TIER_RANK[b.modelTier] - DISPATCH_TIER_RANK[a.modelTier]);
110
+ const best = free[0];
111
+ if (best) return {
112
+ ...base,
113
+ action: "delegate",
114
+ reason: "higher_suitable_agent",
115
+ agentKey: best.agentKey,
116
+ recommendedTier: best.modelTier
117
+ };
118
+ if (higher.length) return { ...base, reason: "paid_approval_required", requiresPaidApproval: true };
119
+ return { ...base, reason: "no_higher_suitable_agent" };
120
+ }
121
+ function resolvePaginationArgs(args) {
122
+ let limit;
123
+ let offset;
124
+ if (args?.limit !== void 0 && args?.limit !== null) {
125
+ const raw = args.limit;
126
+ if (typeof raw === "boolean") {
127
+ throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
128
+ }
129
+ if (typeof raw === "number") {
130
+ if (!Number.isInteger(raw) || raw <= 0) {
131
+ throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
132
+ }
133
+ limit = Math.min(raw, 500);
134
+ } else if (typeof raw === "string") {
135
+ if (raw.trim() !== "") {
136
+ if (!/^\d+$/.test(raw.trim())) {
137
+ throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
138
+ }
139
+ const parsed = Number(raw.trim());
140
+ if (!Number.isInteger(parsed) || parsed <= 0) {
141
+ throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
142
+ }
143
+ limit = Math.min(parsed, 500);
144
+ }
145
+ } else {
146
+ throw new Error(`Invalid limit '${String(raw)}': must be a positive integer.`);
147
+ }
148
+ }
149
+ if (args?.offset !== void 0 && args?.offset !== null) {
150
+ const raw = args.offset;
151
+ if (typeof raw === "boolean") {
152
+ throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
153
+ }
154
+ if (typeof raw === "number") {
155
+ if (!Number.isInteger(raw) || raw < 0) {
156
+ throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
157
+ }
158
+ offset = raw;
159
+ } else if (typeof raw === "string") {
160
+ if (raw.trim() !== "") {
161
+ if (!/^\d+$/.test(raw.trim())) {
162
+ throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
163
+ }
164
+ const parsed = Number(raw.trim());
165
+ if (!Number.isInteger(parsed) || parsed < 0) {
166
+ throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
167
+ }
168
+ offset = parsed;
169
+ }
170
+ } else {
171
+ throw new Error(`Invalid offset '${String(raw)}': must be a non-negative integer.`);
172
+ }
173
+ }
174
+ return { limit, offset };
175
+ }
176
+ function matchesAgentQuery(agent, query) {
177
+ if (!query || typeof query !== "string") return true;
178
+ const q = query.trim().toLowerCase();
179
+ if (!q) return true;
180
+ const candidates = [
181
+ agent.name,
182
+ agent.model,
183
+ agent.provider,
184
+ agent.handle,
185
+ agent.agentKey,
186
+ agent.publicKey,
187
+ agent.id
188
+ ];
189
+ return candidates.some((text) => typeof text === "string" && text.toLowerCase().includes(q));
190
+ }
191
+ function nearestFundedSubscriptionReset(agent, now) {
192
+ let nearest = Infinity;
193
+ if (agent.billingSource !== "user_subscription") return nearest;
194
+ for (const window of agent.quota?.windows ?? []) {
195
+ const { resetAt, remaining, utilization } = window;
196
+ if (typeof resetAt === "number" && resetAt > now && resetAt < nearest && isSubscriptionPeriodWindow(window) && (typeof remaining === "number" && remaining > 0 || typeof utilization === "number" && utilization < 0.95)) {
197
+ nearest = resetAt;
198
+ }
199
+ }
200
+ return nearest;
201
+ }
202
+ function meteredUnitPrice(agent) {
203
+ if (agent.billingSource === "user_subscription" || agent.billingSource === "owner_subscription") return Infinity;
204
+ const input = agent.inputPrice !== null && Number.isFinite(agent.inputPrice) ? agent.inputPrice : 0;
205
+ const output = agent.outputPrice !== null && Number.isFinite(agent.outputPrice) ? agent.outputPrice : 0;
206
+ return input > 0 || output > 0 ? input + output : Infinity;
207
+ }
208
+ function buildAgentDiscoveryResult(options) {
209
+ const scope = resolveDiscoveryScope({
210
+ scope: options.scope,
211
+ publicOnly: options.publicOnly
212
+ });
213
+ const now = options.now ?? Date.now();
214
+ let scopedAgents = filterAgentsByScope(options.agents, scope);
215
+ if (options.query && typeof options.query === "string" && options.query.trim()) {
216
+ scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
217
+ }
218
+ scopedAgents = scopedAgents.map((agent) => {
219
+ const decision = resolveAgentAvailability(agent, now);
220
+ if (decision.status === "quota_exhausted") {
221
+ const resetAt = decision.resetAt ?? now + DEFAULT_PROVIDER_RETRY_MS;
222
+ const nextAvailableAt = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > resetAt ? agent.nextAvailableAt : resetAt;
223
+ return {
224
+ ...agent,
225
+ nextAvailableAt,
226
+ availableAt: nextAvailableAt,
227
+ availabilityStatus: decision.status,
228
+ availabilityReason: decision.reason
229
+ };
230
+ }
231
+ return {
232
+ ...agent,
233
+ availabilityStatus: decision.status,
234
+ availabilityReason: decision.reason
235
+ };
236
+ });
237
+ const unavailableCount = scopedAgents.filter((a) => isAgentUnavailableNow(a, now)).length;
238
+ const credentialGroups = summarizeCredentialGroups(scopedAgents, now);
239
+ const pagination = resolvePaginationArgs({
240
+ limit: options.limit,
241
+ offset: options.offset
242
+ });
243
+ const offset = pagination.offset;
244
+ const limit = pagination.limit;
245
+ const sortedAgents = sortSafeAgentSummaries(scopedAgents);
246
+ const hasQuery = Boolean(options.query && typeof options.query === "string" && options.query.trim());
247
+ const hasFilteredCandidates = sortedAgents.length < options.agents.length;
248
+ let total;
249
+ if (hasQuery) {
250
+ total = sortedAgents.length;
251
+ } else if (hasFilteredCandidates) {
252
+ total = sortedAgents.length;
253
+ } else if (scope === "public") {
254
+ total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
255
+ } else if (scope === "all") {
256
+ const privateOnlyCount = scopedAgents.filter((a) => isPreferredAgent(a) && a.isPublic !== true).length;
257
+ const publicPulledCount = scopedAgents.filter((a) => a.isPublic === true).length;
258
+ const effectivePublicTotal = typeof options.upstreamTotal === "number" && options.upstreamTotal > publicPulledCount ? options.upstreamTotal : publicPulledCount;
259
+ total = options.upstreamTruncated === true ? privateOnlyCount + effectivePublicTotal : sortedAgents.length;
260
+ } else {
261
+ total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
262
+ }
263
+ const isTruncated = options.upstreamTruncated === true || !hasQuery && !hasFilteredCandidates && typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length;
264
+ const pagedAgents = typeof limit === "number" || typeof offset === "number" ? sortedAgents.slice(
265
+ offset ?? 0,
266
+ (offset ?? 0) + (limit ?? sortedAgents.length)
267
+ ) : sortedAgents;
268
+ const projectedAgents = options.verbose === true ? pagedAgents.map(omitNullishAgentSummaryFields) : options.compact === true ? pagedAgents.map(toUltraCompactAgentSummary) : pagedAgents.map(toCompactAgentSummary);
269
+ const compacted = options.compact === true && options.verbose !== true ? promoteSharedCredentialGroupQuota(
270
+ projectedAgents,
271
+ credentialGroups
272
+ ) : { agents: projectedAgents, groups: credentialGroups };
273
+ const tierHints = {};
274
+ const tierHintPreferences = /* @__PURE__ */ new Map();
275
+ const callerCredentialGroup = resolveCallerCredentialGroup(sortedAgents, options.caller);
276
+ for (const agent of sortedAgents) {
277
+ const { agentKey, name, model, modelTier, requiresPaidApproval, availabilityStatus } = agent;
278
+ if (!agentKey || requiresPaidApproval !== false || modelTier === "unknown" || availabilityStatus === "quota_exhausted" || availabilityStatus === "rate_limited") continue;
279
+ const priority = resolveAgentSelectionPriority(agent);
280
+ const current = tierHintPreferences.get(modelTier);
281
+ if (current && current.priority !== priority) continue;
282
+ const differentGroup = callerCredentialGroup !== void 0 && Boolean(agent.credentialGroup) && agent.credentialGroup !== callerCredentialGroup;
283
+ const resetAt = nearestFundedSubscriptionReset(agent, now);
284
+ const price = resetAt === Infinity ? meteredUnitPrice(agent) : Infinity;
285
+ if (current && current.differentGroup !== differentGroup) {
286
+ if (current.differentGroup) continue;
287
+ } else if (current && (resetAt > current.resetAt || resetAt === current.resetAt && price >= current.price)) {
288
+ continue;
289
+ }
290
+ tierHintPreferences.set(modelTier, { priority, differentGroup, resetAt, price });
291
+ tierHints[modelTier] = { agentKey, name, model };
292
+ }
293
+ return {
294
+ total,
295
+ ...typeof offset === "number" ? { offset } : {},
296
+ ...typeof limit === "number" ? { limit } : {},
297
+ ...isTruncated ? { truncated: true } : {},
298
+ unavailableCount,
299
+ availableCount: sortedAgents.length,
300
+ agents: compacted.agents,
301
+ planningRecommendation: recommendPlanning(
302
+ sortedAgents,
303
+ options.caller,
304
+ !isTruncated && scope === "all" && !hasQuery && !options.poolRestricted
305
+ ),
306
+ ...Object.keys(tierHints).length > 0 ? { tierHints } : {},
307
+ credentialGroups: compacted.groups
308
+ };
309
+ }
310
+ function toDiscoverySafeAgentSummary(record2, options) {
311
+ const mergedOptions = record2?.publicRecordExists === true ? { ...options, publicRecordExists: true } : options;
312
+ return toSafeAgentSummary(record2, mergedOptions);
313
+ }
314
+
315
+ // packages/ai/agent/dispatchSpeedProvenance.ts
316
+ var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
317
+ function isServerDispatchSpeedSource(value, dialogId, userId) {
318
+ const dialog = record(value);
319
+ const proof = record(dialog.dispatchSpeedProvenance);
320
+ return proof.version === 1 && proof.source === "server-startAgentRun" && proof.userId === userId && record(dialog.runtimeBinding).tenantUserId === userId && dialog.id === dialogId;
321
+ }
322
+ function isLocalDispatchSpeedSource(value, dialogId, userId) {
323
+ const run = record(value);
324
+ const proof = record(run.dispatchSpeedProvenance);
325
+ 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;
326
+ }
327
+
328
+ export {
329
+ resolveDiscoveryScope,
330
+ resolvePaginationArgs,
331
+ matchesAgentQuery,
332
+ buildAgentDiscoveryResult,
333
+ toDiscoverySafeAgentSummary,
334
+ isServerDispatchSpeedSource,
335
+ isLocalDispatchSpeedSource
336
+ };
@@ -5,11 +5,11 @@ import {
5
5
  import {
6
6
  patch,
7
7
  read
8
- } from "./chunk-GJ4UTSAW.js";
8
+ } from "./chunk-53UOBNTI.js";
9
9
  import {
10
10
  DEVICE_LOCAL_OWNER_ID,
11
11
  isDeviceLocalSpaceBody
12
- } from "./chunk-REINTCQF.js";
12
+ } from "./chunk-4CL6QIQZ.js";
13
13
  import {
14
14
  selectIdentityUserId
15
15
  } from "./chunk-PXYBUFDB.js";
@@ -7,14 +7,14 @@ import {
7
7
  } from "./chunk-JP2BH4NC.js";
8
8
  import {
9
9
  buildLocalAgentLookupKeys
10
- } from "./chunk-64ACTEAE.js";
10
+ } from "./chunk-JKO32CCL.js";
11
11
  import {
12
12
  localDialogMessageRecordToRuntimeMessage,
13
13
  orderDialogHistory
14
- } from "./chunk-UDQZ5JT7.js";
14
+ } from "./chunk-3SEBCWLD.js";
15
15
  import {
16
16
  resolveAgentRuntimeConfigFromRecord
17
- } from "./chunk-OTOPQXP5.js";
17
+ } from "./chunk-XWR2YD4L.js";
18
18
  import {
19
19
  dialogMessagePrefix,
20
20
  dialogMessageRange