nolo-cli 0.147.0-alpha.2 → 0.148.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 (102) hide show
  1. package/{_executeModel-3OCR5R5P.js → _executeModel-NFJAMAGJ.js} +29 -28
  2. package/{action-3ZOODRBC.js → action-GI44T4DR.js} +6 -6
  3. package/{addContentAction-IJHG2ZV7.js → addContentAction-B2DRF7P6.js} +5 -5
  4. package/{addDialogAgentAction-RLPSTAQ2.js → addDialogAgentAction-2P2FLTLD.js} +4 -4
  5. package/{agentDeleteCommand-6OGADD24.js → agentDeleteCommand-7IDWF6E3.js} +14 -13
  6. package/{agentEmailCommands-OAPYGNYC.js → agentEmailCommands-4KW33JII.js} +31 -30
  7. package/{agentListCommands-FRJZOOEG.js → agentListCommands-IW3GQVUP.js} +16 -15
  8. package/{agentMachineCommands-OWLOV5WO.js → agentMachineCommands-CMQR4RQ4.js} +14 -13
  9. package/{agentProviderCommands-TWB6E5WD.js → agentProviderCommands-YK2BIIXZ.js} +1 -1
  10. package/{agentRecordCommands-BW7HM6VH.js → agentRecordCommands-4YBSYPIY.js} +31 -30
  11. package/{agentRunCommand-O2F3NU2H.js → agentRunCommand-5MU5X5OT.js} +31 -30
  12. package/{agentRuntimeLocal-QQCDFR7B.js → agentRuntimeLocal-AK2QVJHY.js} +12 -11
  13. package/{agentSlice-ZOCKW66S.js → agentSlice-OZ33K224.js} +5 -5
  14. package/{appDeleteCommands-OGKQC2AM.js → appDeleteCommands-N3XEVVYC.js} +15 -14
  15. package/{appDeployCommands-Y2FV4JML.js → appDeployCommands-AWFIXYVW.js} +15 -14
  16. package/{appDeployStatusCommands-FNML5SUV.js → appDeployStatusCommands-CZRON2FO.js} +15 -14
  17. package/{appGetCommands-4FOY7W5E.js → appGetCommands-XQIUY4TD.js} +15 -14
  18. package/{appListCommands-E5SF6SIY.js → appListCommands-NNG4H36Y.js} +15 -14
  19. package/{chatQueueReduxAdapter-DFZ6QB4K.js → chatQueueReduxAdapter-HVHA2HPM.js} +11 -11
  20. package/{chunk-OXGHM2WW.js → chunk-2JMMBU6V.js} +27 -257
  21. package/{chunk-T76D3OYX.js → chunk-3SV7RM24.js} +1 -1
  22. package/{chunk-PZ3HKBET.js → chunk-42Z3EMC4.js} +19 -19
  23. package/{chunk-O7WXJIUI.js → chunk-4H22P2JV.js} +11 -9
  24. package/{chunk-BCJPO6SE.js → chunk-523WHFSL.js} +10 -10
  25. package/{chunk-M2YBIBBS.js → chunk-5TEEECZM.js} +1 -1
  26. package/{chunk-Z7IZQF56.js → chunk-6FGTMQCL.js} +1 -1
  27. package/{chunk-ETZWFV6M.js → chunk-7CHC4W22.js} +1 -1
  28. package/{chunk-ZSPC3ZTC.js → chunk-AKG5W4LG.js} +1 -1
  29. package/{chunk-CCOXTK3I.js → chunk-ALFH24P3.js} +26 -0
  30. package/{chunk-7NANRWL4.js → chunk-ALGORS6Y.js} +1 -1
  31. package/chunk-BKWMNZ2X.js +411 -0
  32. package/{chunk-HNRASX3X.js → chunk-CPUFH46E.js} +1 -1
  33. package/{chunk-GMVELWJG.js → chunk-CU3QB4HW.js} +2 -2
  34. package/{chunk-KRC6GI2Q.js → chunk-DCFPQW22.js} +2 -2
  35. package/{chunk-LQ6P2MFG.js → chunk-DIXLJWCD.js} +14 -14
  36. package/{chunk-2EE5UD3N.js → chunk-DY7ANLKG.js} +1 -1
  37. package/{chunk-36HTQWBD.js → chunk-FWQEKRTD.js} +3 -3
  38. package/{chunk-I44MDY73.js → chunk-GOH6RW6F.js} +3 -3
  39. package/chunk-HUFPWXFW.js +1716 -0
  40. package/{chunk-QALRKMHF.js → chunk-HYZIYH2H.js} +5 -5
  41. package/{chunk-EFZKILX6.js → chunk-IAESIMK7.js} +1 -1
  42. package/{chunk-JQ4LUB5I.js → chunk-IAG4FHOJ.js} +1 -1
  43. package/{chunk-HLUYTEBY.js → chunk-K2CSUCHJ.js} +1 -1
  44. package/{chunk-UC3Q7X3J.js → chunk-LPVCRQMM.js} +5 -5
  45. package/{chunk-QJLEMM2V.js → chunk-O2OWEFII.js} +1 -1
  46. package/{chunk-724HIKHT.js → chunk-OHOVNO7I.js} +4 -127
  47. package/{chunk-NU4DCNMR.js → chunk-P4BX6FFU.js} +4 -571
  48. package/{chunk-P4CRULYJ.js → chunk-PCVVZ2MH.js} +3 -3
  49. package/chunk-PQWU42UQ.js +132 -0
  50. package/{chunk-27VHPPII.js → chunk-QU5A4LYX.js} +6 -6
  51. package/{chunk-QIH323EV.js → chunk-QXGPFY6J.js} +1 -1
  52. package/{chunk-B7ANJQWZ.js → chunk-RSEEDUMS.js} +2 -2
  53. package/{chunk-ELYEQNUI.js → chunk-RYZINGPM.js} +3 -3
  54. package/{chunk-AATZZAZE.js → chunk-SLLGJZDT.js} +1 -1
  55. package/{chunk-3IYMTWYZ.js → chunk-SONWNI3L.js} +2 -2
  56. package/chunk-T767MPHB.js +681 -0
  57. package/{chunk-2B74TU77.js → chunk-T7F46O36.js} +3 -3
  58. package/{chunk-BJUDYFV5.js → chunk-UQNS32WZ.js} +1 -1
  59. package/{chunk-AUXHZ2M5.js → chunk-WIWM4FE3.js} +1 -1
  60. package/{chunk-BFLSOVHN.js → chunk-WRMKCKZ3.js} +16 -14
  61. package/{chunk-YU2THNST.js → chunk-XISEYOGH.js} +1 -1
  62. package/{chunk-JORF7I7F.js → chunk-YUWMM4US.js} +3 -3
  63. package/{chunk-D76D3RTR.js → chunk-Z4CSIXYP.js} +2 -2
  64. package/{commandRegistry-OPVCVVOQ.js → commandRegistry-YOEQUA7T.js} +42 -42
  65. package/{contentThunks-IWXWFN6P.js → contentThunks-AK2F3KNC.js} +12 -12
  66. package/{createAgentAutomationAction-ROWX5ZPK.js → createAgentAutomationAction-5EJL6ROU.js} +12 -12
  67. package/{createDialogAction-WLVAITHA.js → createDialogAction-F5WEWA47.js} +13 -13
  68. package/{createPageAction-DAJL6GES.js → createPageAction-75ELC64R.js} +12 -12
  69. package/{dbSlice-HFPIJT5P.js → dbSlice-DQ32LYTJ.js} +4 -4
  70. package/{deleteFile-UEAD5A5Z.js → deleteFile-NX6QHCWZ.js} +2 -2
  71. package/{dialogCommands-KSPH6QOU.js → dialogCommands-G7YBVAMC.js} +15 -14
  72. package/{dialogSlice-WW75BKLO.js → dialogSlice-KSXPGJB2.js} +11 -11
  73. package/{docCreateCommands-B64BLZVJ.js → docCreateCommands-ZSLGVBZT.js} +14 -13
  74. package/{docDeleteCommands-UX2GXKUT.js → docDeleteCommands-5N4GVZBG.js} +15 -14
  75. package/{docReadCommands-5A6GF3XL.js → docReadCommands-YJSAA7AV.js} +14 -13
  76. package/{docStore-2SADZYLX.js → docStore-AROBVRCR.js} +5 -5
  77. package/{docUpdateCommands-UTBGZPSR.js → docUpdateCommands-WEMLSW6W.js} +14 -13
  78. package/{handleSendMessageAction-2M57WHLO.js → handleSendMessageAction-EGNWHAUB.js} +229 -45
  79. package/index.js +3 -3
  80. package/{machineCommands-7JUTOZP2.js → machineCommands-ARZYKGGE.js} +30 -29
  81. package/{machineWsRunDispatch-6EETR3RV.js → machineWsRunDispatch-I7F4L532.js} +30 -29
  82. package/{memberThunks-SKFZ37VS.js → memberThunks-5ZXPR63F.js} +5 -5
  83. package/package.json +1 -1
  84. package/{providerPresetApply-XTEXOH7X.js → providerPresetApply-DD6NGWW6.js} +1 -1
  85. package/{providerRegistry-ADYDSLKR.js → providerRegistry-XDRLMYGJ.js} +1 -1
  86. package/{read-IEJLLUXY.js → read-EPTJRAEF.js} +2 -2
  87. package/{readDocTool-4SPYCP2Y.js → readDocTool-W4NDXNEX.js} +1 -1
  88. package/{readlineWorkspace-LBLAGNGM.js → readlineWorkspace-3XOFVARF.js} +34 -33
  89. package/{removeDialogAgentAction-R4RTGM2S.js → removeDialogAgentAction-OSYNZRX7.js} +6 -6
  90. package/{runAgentClientLoop-RPEULJFS.js → runAgentClientLoop-UMF7VZYZ.js} +30 -28
  91. package/{setDialogExtraReferencesAction-NU2VZ7JZ.js → setDialogExtraReferencesAction-M32UYNCG.js} +5 -5
  92. package/{setPrimaryDialogAgentAction-VUY2FRVL.js → setPrimaryDialogAgentAction-WZ7KI3YA.js} +6 -6
  93. package/{settingSlice-CNE75ISY.js → settingSlice-Q6EKL7EQ.js} +5 -5
  94. package/{spaceCommands-HZUAGZXH.js → spaceCommands-UJOVU4XI.js} +14 -13
  95. package/{streamAgentChatTurn-D5POCPVX.js → streamAgentChatTurn-GYGMYOSM.js} +71 -1268
  96. package/{switchDialogAgentAction-JC27CP72.js → switchDialogAgentAction-GMR7WN3P.js} +4 -4
  97. package/{tools-I6D2B2G6.js → tools-DU4JXVAV.js} +21 -21
  98. package/{tuiSummaryLlmCaller-RVW6CJSK.js → tuiSummaryLlmCaller-3YFNHCTW.js} +7 -7
  99. package/{updateDialogTitleAction-7YZ7FNAK.js → updateDialogTitleAction-4U5W4AMH.js} +12 -12
  100. package/chunk-BJ3KD73I.js +0 -155
  101. package/chunk-JK5XW3NO.js +0 -108
  102. package/chunk-YYKMFBK7.js +0 -306
@@ -8,13 +8,13 @@ import "./chunk-YDH3FDFQ.js";
8
8
  import {
9
9
  patch,
10
10
  selectById
11
- } from "./chunk-QALRKMHF.js";
12
- import "./chunk-ETZWFV6M.js";
11
+ } from "./chunk-HYZIYH2H.js";
12
+ import "./chunk-7CHC4W22.js";
13
13
  import "./chunk-3AH7LNUB.js";
14
14
  import "./chunk-WWC7I6TA.js";
15
15
  import "./chunk-QSJ3HFEF.js";
16
- import "./chunk-EFZKILX6.js";
17
- import "./chunk-AUXHZ2M5.js";
16
+ import "./chunk-IAESIMK7.js";
17
+ import "./chunk-WIWM4FE3.js";
18
18
  import "./chunk-QOKAKDPE.js";
19
19
  import "./chunk-SEJ5OS6F.js";
20
20
  import "./chunk-OW765XBU.js";
@@ -8,39 +8,39 @@ import {
8
8
  toolQueryFunc,
9
9
  toolQueryFunctionSchema,
10
10
  toolRegistry
11
- } from "./chunk-OXGHM2WW.js";
12
- import "./chunk-2EE5UD3N.js";
11
+ } from "./chunk-2JMMBU6V.js";
12
+ import "./chunk-DY7ANLKG.js";
13
13
  import "./chunk-5UTFL4QJ.js";
14
14
  import "./chunk-KQHGZWSV.js";
15
- import "./chunk-BJ3KD73I.js";
15
+ import "./chunk-BKWMNZ2X.js";
16
16
  import "./chunk-NF64D32W.js";
17
17
  import "./chunk-3L2WKC3W.js";
18
18
  import "./chunk-4JMDLJAD.js";
19
- import "./chunk-P4CRULYJ.js";
20
- import "./chunk-HNRASX3X.js";
19
+ import "./chunk-PCVVZ2MH.js";
20
+ import "./chunk-CPUFH46E.js";
21
21
  import "./chunk-YRRASA5Q.js";
22
22
  import "./chunk-63W5N6P3.js";
23
23
  import "./chunk-VF4K2QE6.js";
24
- import "./chunk-2B74TU77.js";
25
- import "./chunk-Z7IZQF56.js";
24
+ import "./chunk-T7F46O36.js";
25
+ import "./chunk-6FGTMQCL.js";
26
26
  import "./chunk-XPRWFQQK.js";
27
- import "./chunk-BJUDYFV5.js";
27
+ import "./chunk-UQNS32WZ.js";
28
28
  import "./chunk-MEYIRKDN.js";
29
- import "./chunk-27VHPPII.js";
29
+ import "./chunk-QU5A4LYX.js";
30
30
  import "./chunk-ZJ7UHBJS.js";
31
- import "./chunk-PZ3HKBET.js";
31
+ import "./chunk-42Z3EMC4.js";
32
32
  import "./chunk-523DITKR.js";
33
33
  import "./chunk-YYLHWIW6.js";
34
34
  import "./chunk-6O4IK4V2.js";
35
- import "./chunk-UC3Q7X3J.js";
36
- import "./chunk-D76D3RTR.js";
35
+ import "./chunk-LPVCRQMM.js";
36
+ import "./chunk-Z4CSIXYP.js";
37
37
  import "./chunk-5RGU3J7P.js";
38
38
  import "./chunk-M76ECQRD.js";
39
39
  import "./chunk-B6SAMB33.js";
40
40
  import "./chunk-YDH3FDFQ.js";
41
41
  import "./chunk-MX574M24.js";
42
42
  import "./chunk-AGGIDPCZ.js";
43
- import "./chunk-GMVELWJG.js";
43
+ import "./chunk-CU3QB4HW.js";
44
44
  import "./chunk-B2XUQXQX.js";
45
45
  import {
46
46
  TOOL_PACKS,
@@ -53,8 +53,8 @@ import "./chunk-RGNEEJ3Y.js";
53
53
  import "./chunk-H6A6X4EK.js";
54
54
  import "./chunk-S5XGT6GB.js";
55
55
  import "./chunk-27ONFIEY.js";
56
- import "./chunk-ZSPC3ZTC.js";
57
- import "./chunk-ELYEQNUI.js";
56
+ import "./chunk-AKG5W4LG.js";
57
+ import "./chunk-RYZINGPM.js";
58
58
  import "./chunk-PSCNXBYA.js";
59
59
  import "./chunk-L36OWPP3.js";
60
60
  import "./chunk-BYXBJQAS.js";
@@ -63,24 +63,24 @@ import "./chunk-7KVZ5LDQ.js";
63
63
  import "./chunk-HNMXYYJR.js";
64
64
  import "./chunk-3BXNTXYI.js";
65
65
  import "./chunk-W7XHHYWM.js";
66
- import "./chunk-B7ANJQWZ.js";
66
+ import "./chunk-RSEEDUMS.js";
67
67
  import "./chunk-UAD2WT54.js";
68
68
  import "./chunk-ZWQUWF6W.js";
69
69
  import "./chunk-XUWRURDF.js";
70
70
  import "./chunk-5J3PYNUP.js";
71
71
  import "./chunk-CYSYR67N.js";
72
72
  import "./chunk-Y3PMXGLH.js";
73
- import "./chunk-3IYMTWYZ.js";
73
+ import "./chunk-SONWNI3L.js";
74
74
  import "./chunk-Y5GCAMGP.js";
75
75
  import "./chunk-QDSINZM3.js";
76
76
  import "./chunk-KX6YBIHG.js";
77
- import "./chunk-QALRKMHF.js";
78
- import "./chunk-ETZWFV6M.js";
77
+ import "./chunk-HYZIYH2H.js";
78
+ import "./chunk-7CHC4W22.js";
79
79
  import "./chunk-3AH7LNUB.js";
80
80
  import "./chunk-WWC7I6TA.js";
81
81
  import "./chunk-QSJ3HFEF.js";
82
- import "./chunk-EFZKILX6.js";
83
- import "./chunk-AUXHZ2M5.js";
82
+ import "./chunk-IAESIMK7.js";
83
+ import "./chunk-WIWM4FE3.js";
84
84
  import "./chunk-QOKAKDPE.js";
85
85
  import "./chunk-SEJ5OS6F.js";
86
86
  import "./chunk-OW765XBU.js";
@@ -7,7 +7,7 @@ import {
7
7
  canUsePlatformChatProvider,
8
8
  parsePlatformChatCompletionResponse,
9
9
  resolvePlatformChatProviderConfig
10
- } from "./chunk-QIH323EV.js";
10
+ } from "./chunk-QXGPFY6J.js";
11
11
  import "./chunk-GMZLP5DV.js";
12
12
  import "./chunk-CQ3WA2NE.js";
13
13
  import "./chunk-N7J63Q6C.js";
@@ -15,23 +15,23 @@ import "./chunk-PUOC4YRO.js";
15
15
  import "./chunk-27ONFIEY.js";
16
16
  import {
17
17
  COMPACTION_SUMMARY_SYSTEM_PROMPT
18
- } from "./chunk-ELYEQNUI.js";
18
+ } from "./chunk-RYZINGPM.js";
19
19
  import "./chunk-PSCNXBYA.js";
20
20
  import "./chunk-BYXBJQAS.js";
21
21
  import "./chunk-DWLEOOGR.js";
22
22
  import "./chunk-7KVZ5LDQ.js";
23
23
  import "./chunk-3BXNTXYI.js";
24
24
  import "./chunk-W7XHHYWM.js";
25
- import "./chunk-B7ANJQWZ.js";
25
+ import "./chunk-RSEEDUMS.js";
26
26
  import "./chunk-UAD2WT54.js";
27
27
  import "./chunk-Y3PMXGLH.js";
28
- import "./chunk-QALRKMHF.js";
29
- import "./chunk-ETZWFV6M.js";
28
+ import "./chunk-HYZIYH2H.js";
29
+ import "./chunk-7CHC4W22.js";
30
30
  import "./chunk-3AH7LNUB.js";
31
31
  import "./chunk-WWC7I6TA.js";
32
32
  import "./chunk-QSJ3HFEF.js";
33
- import "./chunk-EFZKILX6.js";
34
- import "./chunk-AUXHZ2M5.js";
33
+ import "./chunk-IAESIMK7.js";
34
+ import "./chunk-WIWM4FE3.js";
35
35
  import "./chunk-QOKAKDPE.js";
36
36
  import "./chunk-SEJ5OS6F.js";
37
37
  import "./chunk-OW765XBU.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  updateContentTitle
3
- } from "./chunk-27VHPPII.js";
3
+ } from "./chunk-QU5A4LYX.js";
4
4
  import "./chunk-ZJ7UHBJS.js";
5
5
  import {
6
6
  isAssistantToolStub,
7
7
  selectAllMsgs
8
- } from "./chunk-PZ3HKBET.js";
8
+ } from "./chunk-42Z3EMC4.js";
9
9
  import {
10
10
  BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
11
11
  BUILTIN_TITLE_LLM_CONFIG
@@ -14,8 +14,8 @@ import "./chunk-YYLHWIW6.js";
14
14
  import "./chunk-6O4IK4V2.js";
15
15
  import {
16
16
  runLlm
17
- } from "./chunk-UC3Q7X3J.js";
18
- import "./chunk-D76D3RTR.js";
17
+ } from "./chunk-LPVCRQMM.js";
18
+ import "./chunk-Z4CSIXYP.js";
19
19
  import "./chunk-5RGU3J7P.js";
20
20
  import {
21
21
  require_date_fns
@@ -28,10 +28,10 @@ import {
28
28
  buildDialogFallbackTitleFromMessages,
29
29
  resolveDialogTitle
30
30
  } from "./chunk-2MBTWINN.js";
31
- import "./chunk-ZSPC3ZTC.js";
31
+ import "./chunk-AKG5W4LG.js";
32
32
  import {
33
33
  serializeMessageContent
34
- } from "./chunk-ELYEQNUI.js";
34
+ } from "./chunk-RYZINGPM.js";
35
35
  import "./chunk-PSCNXBYA.js";
36
36
  import "./chunk-L36OWPP3.js";
37
37
  import "./chunk-BYXBJQAS.js";
@@ -40,27 +40,27 @@ import "./chunk-7KVZ5LDQ.js";
40
40
  import "./chunk-HNMXYYJR.js";
41
41
  import "./chunk-3BXNTXYI.js";
42
42
  import "./chunk-W7XHHYWM.js";
43
- import "./chunk-B7ANJQWZ.js";
43
+ import "./chunk-RSEEDUMS.js";
44
44
  import {
45
45
  normalizeSpaceId
46
46
  } from "./chunk-UAD2WT54.js";
47
47
  import "./chunk-ZWQUWF6W.js";
48
48
  import "./chunk-CYSYR67N.js";
49
49
  import "./chunk-Y3PMXGLH.js";
50
- import "./chunk-3IYMTWYZ.js";
50
+ import "./chunk-SONWNI3L.js";
51
51
  import "./chunk-Y5GCAMGP.js";
52
52
  import "./chunk-QDSINZM3.js";
53
53
  import "./chunk-KX6YBIHG.js";
54
54
  import {
55
55
  patch,
56
56
  selectById
57
- } from "./chunk-QALRKMHF.js";
58
- import "./chunk-ETZWFV6M.js";
57
+ } from "./chunk-HYZIYH2H.js";
58
+ import "./chunk-7CHC4W22.js";
59
59
  import "./chunk-3AH7LNUB.js";
60
60
  import "./chunk-WWC7I6TA.js";
61
61
  import "./chunk-QSJ3HFEF.js";
62
- import "./chunk-EFZKILX6.js";
63
- import "./chunk-AUXHZ2M5.js";
62
+ import "./chunk-IAESIMK7.js";
63
+ import "./chunk-WIWM4FE3.js";
64
64
  import "./chunk-QOKAKDPE.js";
65
65
  import {
66
66
  selectIdentityUserId
package/chunk-BJ3KD73I.js DELETED
@@ -1,155 +0,0 @@
1
- import {
2
- resolveBuiltinCapability,
3
- resolveBuiltinSkillEntry
4
- } from "./chunk-B2XUQXQX.js";
5
- import {
6
- asTrimmedNonEmptyStringArray
7
- } from "./chunk-3AH7LNUB.js";
8
-
9
- // packages/core/abortableDelay.ts
10
- function waitForAbortableDelay(ms, signal) {
11
- const delayMs = Number.isFinite(ms) && ms >= 0 ? Math.round(ms) : 0;
12
- if (signal?.aborted) {
13
- return Promise.reject(new DOMException("Aborted", "AbortError"));
14
- }
15
- return new Promise((resolve, reject) => {
16
- const onAbort = () => {
17
- clearTimeout(timeoutId);
18
- signal?.removeEventListener("abort", onAbort);
19
- reject(new DOMException("Aborted", "AbortError"));
20
- };
21
- const timeoutId = setTimeout(() => {
22
- signal?.removeEventListener("abort", onAbort);
23
- resolve();
24
- }, delayMs);
25
- signal?.addEventListener("abort", onAbort, { once: true });
26
- });
27
- }
28
-
29
- // packages/ai/chat/parseMultilineSSE.ts
30
- function createSSEParser() {
31
- let buffer = "";
32
- return function parseSSE(chunk) {
33
- const results = [];
34
- if (!chunk) return results;
35
- buffer += chunk;
36
- const events = buffer.split(/\r?\n\r?\n/);
37
- buffer = events.pop() ?? "";
38
- for (const ev of events) {
39
- if (!ev.trim()) continue;
40
- const lines = ev.split(/\r?\n/);
41
- let accumulator = "";
42
- for (const line of lines) {
43
- const t = line.trim();
44
- if (t === "data: [DONE]") {
45
- if (accumulator.trim()) {
46
- try {
47
- results.push(JSON.parse(accumulator));
48
- } catch (e) {
49
- }
50
- accumulator = "";
51
- }
52
- results.push("[DONE]");
53
- continue;
54
- }
55
- let content = "";
56
- let isDataLine = false;
57
- if (t.startsWith("data:")) {
58
- content = line.substring(line.indexOf("data:") + 5).trim();
59
- isDataLine = true;
60
- } else if (accumulator && t && !t.startsWith("event:") && !t.startsWith("id:") && !t.startsWith("retry:")) {
61
- content = line;
62
- } else {
63
- continue;
64
- }
65
- if (isDataLine && !accumulator) {
66
- try {
67
- const obj = JSON.parse(content);
68
- results.push(obj);
69
- continue;
70
- } catch (e) {
71
- }
72
- }
73
- accumulator += content;
74
- }
75
- if (accumulator.trim()) {
76
- try {
77
- const obj = JSON.parse(accumulator);
78
- results.push(obj);
79
- } catch (e) {
80
- }
81
- }
82
- }
83
- return results;
84
- };
85
- }
86
- var parseMultilineSSE = createSSEParser();
87
-
88
- // packages/ai/tools/agentSkillConfig.ts
89
- var MODES = [
90
- "required",
91
- "recommended",
92
- "disabled"
93
- ];
94
- var DEFAULT_RECOMMENDED_SKILL_SLUGS = [
95
- "worktree-isolation",
96
- "systematic-investigation",
97
- "show-me"
98
- ];
99
- var asMode = (value) => typeof value === "string" && MODES.includes(value) ? value : null;
100
- var resolveAgentSkillConfig = (source) => {
101
- const out = {};
102
- const skills = source?.skills;
103
- if (skills && typeof skills === "object" && !Array.isArray(skills)) {
104
- for (const [rawSlug, rawMode] of Object.entries(skills)) {
105
- const slug = typeof rawSlug === "string" ? rawSlug.trim() : "";
106
- const mode = asMode(rawMode);
107
- if (slug && mode) out[slug] = mode;
108
- }
109
- return out;
110
- }
111
- for (const slug of asTrimmedNonEmptyStringArray(source?.enabledPacks) ?? []) {
112
- out[slug] = "required";
113
- }
114
- return out;
115
- };
116
- var resolveAgentRequiredPackIds = (source) => {
117
- const config = resolveAgentSkillConfig(source);
118
- return Object.keys(config).filter((slug) => config[slug] === "required");
119
- };
120
- var resolveAgentRecommendedSkillNames = (source, lookup) => {
121
- const config = resolveAgentSkillConfig(source);
122
- const resolve = lookup ?? defaultSkillTitleLookup;
123
- const seen = /* @__PURE__ */ new Set();
124
- const out = [];
125
- const push = (slug) => {
126
- const title = resolve(slug)?.title || slug;
127
- if (seen.has(title)) return;
128
- seen.add(title);
129
- out.push(title);
130
- };
131
- for (const slug of Object.keys(config)) {
132
- if (config[slug] !== "recommended") continue;
133
- push(slug);
134
- }
135
- for (const slug of DEFAULT_RECOMMENDED_SKILL_SLUGS) {
136
- if (Object.hasOwn(config, slug)) continue;
137
- push(slug);
138
- }
139
- return out;
140
- };
141
- var defaultSkillTitleLookup = (slug) => {
142
- const cap = resolveBuiltinCapability(slug);
143
- if (cap) return { title: cap.title };
144
- const skill = resolveBuiltinSkillEntry(slug);
145
- return skill ? { title: skill.title } : null;
146
- };
147
- var isAgentSkillDisabled = (source, slug) => resolveAgentSkillConfig(source)[slug] === "disabled";
148
-
149
- export {
150
- resolveAgentRequiredPackIds,
151
- resolveAgentRecommendedSkillNames,
152
- isAgentSkillDisabled,
153
- waitForAbortableDelay,
154
- createSSEParser
155
- };
package/chunk-JK5XW3NO.js DELETED
@@ -1,108 +0,0 @@
1
- import {
2
- waitForAbortableDelay
3
- } from "./chunk-BJ3KD73I.js";
4
- import {
5
- isGatewayHttpStatus
6
- } from "./chunk-NF64D32W.js";
7
- import {
8
- createDrainExhaustedResponse,
9
- isCoreDrainingBody,
10
- normalizeNonNegativeMs,
11
- parseRetryAfterHeaderMs
12
- } from "./chunk-3L2WKC3W.js";
13
- import {
14
- isAbortError
15
- } from "./chunk-QOKAKDPE.js";
16
-
17
- // packages/ai/chat/serverProxyRetry.ts
18
- var DEFAULT_SERVER_PROXY_RETRY_AFTER_MS = 1500;
19
- var MAX_SERVER_PROXY_RETRIES = 2;
20
- var MAX_STATUS_RETRIES = 3;
21
- var MAX_SERVER_DRAIN_STATUS_RETRIES = 30;
22
- var readRetryableResponseBody = async (response) => {
23
- try {
24
- return await response.clone().json();
25
- } catch {
26
- return null;
27
- }
28
- };
29
- var resolveServerProxyRetryAfterMs = (response, body) => parseRetryAfterHeaderMs(response.headers.get("Retry-After")) ?? normalizeNonNegativeMs(
30
- body?.retryAfterMs,
31
- DEFAULT_SERVER_PROXY_RETRY_AFTER_MS
32
- );
33
- var isRetryableServerProxyFetchError = (error) => {
34
- if (!error || isAbortError(error)) return false;
35
- const message = typeof error?.message === "string" ? error.message : String(error);
36
- return /ECONNREFUSED|ECONNRESET|EPIPE|socket hang up|network error|failed to fetch|fetch failed|connection closed|load failed|502|503|504/i.test(
37
- message
38
- );
39
- };
40
- var waitForServerProxyRetry = async (retryAfterMs, signal) => {
41
- const delayMs = normalizeNonNegativeMs(
42
- retryAfterMs,
43
- DEFAULT_SERVER_PROXY_RETRY_AFTER_MS
44
- );
45
- if (delayMs <= 0) return;
46
- await waitForAbortableDelay(delayMs, signal);
47
- };
48
- var performServerProxyFetchWithRetry = async ({
49
- execute,
50
- signal,
51
- logPrefix = "[fetchWithServerProxy]",
52
- onRetry,
53
- retryNetworkErrors = true
54
- }) => {
55
- let networkRetries = 0;
56
- let statusRetries = 0;
57
- while (true) {
58
- try {
59
- const response = await execute();
60
- const responseBody = response.status === 503 ? await readRetryableResponseBody(response) : null;
61
- const isCoreDraining = response.status === 503 && isCoreDrainingBody(responseBody);
62
- const maxStatusRetries = isCoreDraining ? MAX_SERVER_DRAIN_STATUS_RETRIES : MAX_STATUS_RETRIES;
63
- if (statusRetries < maxStatusRetries && isGatewayHttpStatus(response.status)) {
64
- statusRetries += 1;
65
- const retryAfterMs = resolveServerProxyRetryAfterMs(
66
- response,
67
- responseBody
68
- );
69
- console.warn(
70
- `${logPrefix} \u68C0\u6D4B\u5230${response.status}\u72B6\u6001\uFF0C${retryAfterMs}ms\u540E\u91CD\u8BD5...`
71
- );
72
- onRetry?.({
73
- attempt: statusRetries,
74
- maxAttempts: maxStatusRetries,
75
- delayMs: retryAfterMs
76
- });
77
- await waitForServerProxyRetry(retryAfterMs, signal);
78
- continue;
79
- }
80
- if (isCoreDraining) {
81
- console.warn(`${logPrefix} core_draining \u91CD\u8BD5\u8017\u5C3D\uFF0C\u8FD4\u56DE\u53CB\u597D\u63D0\u793A`);
82
- return createDrainExhaustedResponse(response);
83
- }
84
- return response;
85
- } catch (error) {
86
- if (retryNetworkErrors && networkRetries < MAX_SERVER_PROXY_RETRIES && isRetryableServerProxyFetchError(error)) {
87
- networkRetries += 1;
88
- const retryDelay = networkRetries * 1e3;
89
- console.warn(
90
- `${logPrefix} \u68C0\u6D4B\u5230\u7F51\u7EDC\u77AC\u65AD\uFF0C${retryDelay}ms\u540E\u91CD\u8BD5(\u7B2C${networkRetries}\u6B21)...`,
91
- error
92
- );
93
- onRetry?.({
94
- attempt: networkRetries,
95
- maxAttempts: MAX_SERVER_PROXY_RETRIES,
96
- delayMs: retryDelay
97
- });
98
- await waitForServerProxyRetry(retryDelay, signal);
99
- continue;
100
- }
101
- throw error;
102
- }
103
- }
104
- };
105
-
106
- export {
107
- performServerProxyFetchWithRetry
108
- };