nolo-cli 0.106.0-alpha.1 → 0.106.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/{_executeModel-C5ZUOC7O.js → _executeModel-EP6HAX3W.js} +77 -69
- package/action-GVA5ARSJ.js +20 -0
- package/{addContentAction-O7R66HEX.js → addContentAction-NZZNAVCB.js} +13 -12
- package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-5HVGEIXI.js} +19 -20
- package/{agentDeleteCommand-YB3S2LPY.js → agentDeleteCommand-M25A6UGB.js} +118 -43
- package/{agentEmailCommands-YBCBTG6X.js → agentEmailCommands-RUL4NL64.js} +99 -89
- package/agentListCommands-KSPFKHFO.js +741 -0
- package/{agentMachineCommands-QHYLBTVW.js → agentMachineCommands-IHBB6PHD.js} +48 -44
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-ND4S2Q6Q.js} +97 -2
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
- package/agentRecordCommands-7OKIBN6H.js +138 -0
- package/agentRunCommand-GBKJTQQU.js +167 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
- package/{agentRuntimeLocal-FRUE5P2V.js → agentRuntimeLocal-E5HXZNXZ.js} +44 -40
- package/{agentSlice-7OEXULAY.js → agentSlice-7T3ZLYET.js} +15 -14
- package/{appDeleteCommands-JPWTSFID.js → appDeleteCommands-TTJUYTQN.js} +46 -42
- package/{appDeployCommands-YCVY2UYO.js → appDeployCommands-65WYK2TQ.js} +46 -42
- package/{appDeployStatusCommands-JMCEIKTI.js → appDeployStatusCommands-U4XESYYG.js} +46 -42
- package/{appGetCommands-EXWT3QAE.js → appGetCommands-VNHZZC4D.js} +46 -42
- package/{appListCommands-PKRLSWRE.js → appListCommands-O667ZEU6.js} +46 -42
- package/{authCommand-F4EFRRX6.js → authCommand-SUHHTVHA.js} +118 -24
- package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-PUGT65WS.js} +11 -9
- package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
- package/{chunk-ZNV445LB.js → chunk-2NGKYC3L.js} +29 -9
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
- package/{chunk-XA2FJW4L.js → chunk-3SXZ6SUC.js} +11 -9
- package/{chunk-UKZDAFYT.js → chunk-3VKDWQMJ.js} +6 -10
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
- package/{chunk-PQFHGD77.js → chunk-4VDS344D.js} +161 -14
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-GQBOR3G6.js → chunk-5F7UKMLN.js} +8 -4
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
- package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-YCJN2RA3.js → chunk-6AIURTE7.js} +20 -11
- package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-S4VLC46A.js → chunk-AM4G3LDJ.js} +66 -54
- package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
- package/{chunk-TJGWNDGO.js → chunk-AZB6HR4I.js} +846 -276
- package/{chunk-L5UXH3B2.js → chunk-BIH7KCDJ.js} +58 -9
- package/{chunk-UZGQNTVW.js → chunk-BPLIXNC6.js} +8 -6
- package/chunk-CEQ75WPL.js +915 -0
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/{chunk-GPCZ7UXG.js → chunk-DBKRC5O2.js} +1 -1
- package/chunk-DJ3JABG5.js +7990 -0
- package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
- package/{chunk-UOBDA2JS.js → chunk-DSXRVBTA.js} +118 -90
- package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
- package/{chunk-HJUYAD4A.js → chunk-EBS4FKW4.js} +5 -5
- package/{chunk-LC43IGO4.js → chunk-EHGIEGLI.js} +834 -962
- package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-TOP2VXOR.js → chunk-FJKZSR5P.js} +5 -5
- package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
- package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
- package/{chunk-ZCYXJSTU.js → chunk-GMP3NBAA.js} +65 -95
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-OIVSQH2O.js → chunk-GU7DC2TD.js} +300 -5
- package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
- package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
- package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
- package/{chunk-RJXZDT2P.js → chunk-HNA5KV37.js} +23 -28
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-ACTMNVHM.js → chunk-I5YMDACN.js} +1 -1
- package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
- package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
- package/{chunk-Q67DOFOO.js → chunk-IYIXAIEB.js} +199 -92
- package/{chunk-BP4XNZRM.js → chunk-JIXGJTBU.js} +4 -4
- package/{chunk-OEVAY4J6.js → chunk-JWNBEIME.js} +18 -20
- package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
- package/{chunk-JZL6EHZR.js → chunk-LGWABBTZ.js} +47 -67
- package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
- package/{chunk-GEPUP7OO.js → chunk-LOPP5VT6.js} +3 -3
- package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
- package/chunk-LWLNLZC5.js +265 -0
- package/{chunk-BNGW5ASC.js → chunk-LYLO5U3H.js} +15 -2
- package/{chunk-4OEFYTWL.js → chunk-MJ3CRU77.js} +85 -50
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
- package/{chunk-NA35QHCF.js → chunk-NTNKA5VL.js} +1 -1
- package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
- package/chunk-NWENLDMM.js +42 -0
- package/chunk-O7SVKKLY.js +875 -0
- package/{chunk-FM2YTE6D.js → chunk-OAXBDMT7.js} +1 -1
- package/chunk-OCZKATRC.js +129 -0
- package/{chunk-EYAQT56M.js → chunk-ODTBO4W6.js} +9 -6
- package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
- package/{chunk-EEGDMATE.js → chunk-OQ5IVGCV.js} +86 -81
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-KQ4ONNQD.js → chunk-OYTWDOQV.js} +155 -8
- package/{chunk-JRQFUXY7.js → chunk-OZ2IIIRP.js} +99 -22
- package/{chunk-WV42OMV7.js → chunk-PFLF4R4E.js} +8 -8
- package/{chunk-J4MOO56S.js → chunk-QDH32WF5.js} +10 -2
- package/{chunk-3DII57IT.js → chunk-QVAWUJAJ.js} +1 -1
- package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
- package/{chunk-6OZ36FXI.js → chunk-SJ7CUF65.js} +22 -4
- package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
- package/{chunk-ETI2NYVF.js → chunk-SYEBIZOF.js} +4 -4
- package/{chunk-J3WULTWA.js → chunk-TLKXNTQJ.js} +19 -17
- package/chunk-TLYSGGPG.js +15 -0
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/chunk-UM7TA3K4.js +1008 -0
- package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
- package/chunk-VBQGO5NX.js +164 -0
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
- package/chunk-VYKXIHRP.js +13692 -0
- package/chunk-VZLO4XJD.js +17 -0
- package/{chunk-DNCEALKX.js → chunk-WMWYWYK2.js} +22 -29
- package/{chunk-H56FOERC.js → chunk-XDQ7PHU3.js} +567 -684
- package/{chunk-AEOE4Z6Q.js → chunk-XGOHDYM2.js} +39 -15
- package/{chunk-53HEEOTT.js → chunk-XLWMNFBZ.js} +83 -16
- package/{chunk-V4MJDUSR.js → chunk-YFU5EELM.js} +2 -2
- package/{chunk-IUTWFZOX.js → chunk-YQFLBS6A.js} +68 -46
- package/chunk-YV25TM3R.js +780 -0
- package/chunk-ZRAU6T47.js +56 -0
- package/{chunk-5H7KJX7J.js → chunk-ZVGXD7UJ.js} +5 -5
- package/{chunk-H62HCIUP.js → chunk-ZYM73IHG.js} +36 -22
- package/commandRegistry-6QIAUQDS.js +833 -0
- package/{contentThunks-AZVYDLM4.js → contentThunks-5DDMUQ7B.js} +39 -36
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-V55DNYCE.js → createAgentAutomationAction-NQ6AZM42.js} +40 -37
- package/createDialogAction-QZ6X4A7O.js +70 -0
- package/{createPageAction-I3HH23O3.js → createPageAction-NCGEJBVK.js} +47 -43
- package/{chunk-GDNQO3QR.js → cursorProvider-YGGNMVWX.js} +2751 -10172
- package/{dbSlice-XVWBAGYN.js → dbSlice-RCZ7NRAF.js} +12 -11
- package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
- package/{dialogCommands-YVMHDEOX.js → dialogCommands-OGQLEF63.js} +49 -46
- package/{dialogSlice-LVJ67QWE.js → dialogSlice-GIKNUHNW.js} +57 -37
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-7UTWDYJU.js → docCreateCommands-RW6LNYT6.js} +48 -44
- package/{docDeleteCommands-GG6BJ4PS.js → docDeleteCommands-Z742TRNY.js} +49 -45
- package/{docReadCommands-QHMQVSLP.js → docReadCommands-5DIGA42Y.js} +47 -43
- package/{docStore-UJNL6SBT.js → docStore-6GUOZH52.js} +17 -13
- package/{docUpdateCommands-QPL6IVUK.js → docUpdateCommands-ZFZ2QEVK.js} +48 -44
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
- package/{getPricing-LUSEABA6.js → getPricing-QVSNUFZ6.js} +4 -4
- package/{handleSendMessageAction-CCL7ETCL.js → handleSendMessageAction-B2VXOLMM.js} +109 -42
- package/index.js +87 -884
- package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
- package/{machineCommands-2QNINBNI.js → machineCommands-AI3N7JHQ.js} +93 -83
- package/machineWsRunDispatch-RPF2D6VV.js +154 -0
- package/{memberThunks-QGFLFVCI.js → memberThunks-YICJI4IS.js} +20 -18
- package/{models-T3SG6MJ5.js → models-FTNFVO3D.js} +2 -2
- package/oauthTokenStore-ITEB663N.js +23 -0
- package/package.json +1 -1
- package/pdf-U6KSUEZZ.js +26435 -0
- package/processSpawn-SOAV3FEV.js +11 -0
- package/profileConfig-ZGOFORWV.js +43 -0
- package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-OJJXQ7NM.js} +7 -7
- package/{providerRegistry-757OWH3O.js → providerRegistry-DXFBDCGQ.js} +11 -7
- package/{read-COE3ZYR6.js → read-XMBM52Y4.js} +8 -7
- package/{readDocTool-5USN4A6V.js → readDocTool-LAQHKCVT.js} +5 -3
- package/{readlineWorkspace-4GULS23D.js → readlineWorkspace-EPUCVZ73.js} +2594 -2030
- package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-HDUI2MU3.js} +22 -26
- package/{runAgentClientLoop-MUMLW2SA.js → runAgentClientLoop-OXQMDGAN.js} +78 -71
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-ADBVOP4O.js} +16 -14
- package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-PXVXQJ62.js} +23 -27
- package/{chunk-AFUORTY4.js → settingThunks-G2MJRKUE.js} +226 -940
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-BMXKR7H6.js → spaceCommands-Z662QYY6.js} +51 -47
- package/{streamAgentChatTurn-6EOS5PNG.js → streamAgentChatTurn-YJYEJHP7.js} +214 -114
- package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-Z3RZACGF.js} +19 -20
- package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
- package/tools-GHI3WBEI.js +117 -0
- package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-WTC6GCQC.js} +25 -23
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-4YUVCBDU.js → updateDialogTitleAction-GJCNWTPY.js} +84 -45
- package/action-YVYQEAAV.js +0 -31
- package/agentListCommands-3GWH4E4G.js +0 -410
- package/agentRecordCommands-P76DPWKV.js +0 -128
- package/agentRunCommand-EQPL4F4K.js +0 -156
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-ZBDDI2E5.js +0 -186
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-PUOC4YRO.js +0 -394
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/chunk-WC6UUQ2C.js +0 -20923
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/createDialogAction-H6URYLIZ.js +0 -65
- package/machineWsRunDispatch-S3XXOKR7.js +0 -144
- package/settingSlice-ZQZVUPKK.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-4AJZHAK3.js +0 -110
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
formatISO
|
|
3
|
+
} from "./chunk-ZRAU6T47.js";
|
|
4
4
|
import {
|
|
5
5
|
require_react
|
|
6
6
|
} from "./chunk-YDH3FDFQ.js";
|
|
7
|
-
import {
|
|
8
|
-
toErrorMessage
|
|
9
|
-
} from "./chunk-HNMXYYJR.js";
|
|
10
7
|
import {
|
|
11
8
|
patch,
|
|
12
9
|
readAndWait
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZYM73IHG.js";
|
|
11
|
+
import {
|
|
12
|
+
toErrorMessage
|
|
13
|
+
} from "./chunk-HNMXYYJR.js";
|
|
14
14
|
import {
|
|
15
15
|
asOptionalTrimmedString
|
|
16
16
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
|
|
21
21
|
// packages/render/page/docStore.ts
|
|
22
22
|
var import_react = __toESM(require_react(), 1);
|
|
23
|
-
var import_date_fns = __toESM(require_date_fns(), 1);
|
|
24
23
|
var createInitialState = () => ({
|
|
25
24
|
content: null,
|
|
26
25
|
slateData: null,
|
|
@@ -52,6 +51,7 @@ var createInitialState = () => ({
|
|
|
52
51
|
var listeners = /* @__PURE__ */ new Set();
|
|
53
52
|
var version = 0;
|
|
54
53
|
var state = createInitialState();
|
|
54
|
+
var latestInitRequestKey = null;
|
|
55
55
|
var notify = () => {
|
|
56
56
|
for (const listener of listeners) {
|
|
57
57
|
try {
|
|
@@ -102,6 +102,9 @@ function getDocField(selector) {
|
|
|
102
102
|
function getDocPageKey() {
|
|
103
103
|
return state.pageKey;
|
|
104
104
|
}
|
|
105
|
+
function isDocStateForPage(state2, pageKey) {
|
|
106
|
+
return Boolean(pageKey) && state2.pageKey === pageKey;
|
|
107
|
+
}
|
|
105
108
|
function getDocIsInitialized() {
|
|
106
109
|
return state.isInitialized;
|
|
107
110
|
}
|
|
@@ -143,6 +146,7 @@ function updateDocTags(tags) {
|
|
|
143
146
|
setState((prev) => ({ ...prev, tags }));
|
|
144
147
|
}
|
|
145
148
|
function resetDocState() {
|
|
149
|
+
latestInitRequestKey = null;
|
|
146
150
|
setState(createInitialState());
|
|
147
151
|
}
|
|
148
152
|
function previewDocState(payload) {
|
|
@@ -190,6 +194,7 @@ function applyExternalDocUpdate(payload) {
|
|
|
190
194
|
}
|
|
191
195
|
async function initDocState(args, { dispatch }) {
|
|
192
196
|
const { pageKey, isReadOnly } = args;
|
|
197
|
+
latestInitRequestKey = pageKey;
|
|
193
198
|
setState((prev) => ({
|
|
194
199
|
...createInitialState(),
|
|
195
200
|
isLoading: true,
|
|
@@ -198,6 +203,7 @@ async function initDocState(args, { dispatch }) {
|
|
|
198
203
|
}));
|
|
199
204
|
try {
|
|
200
205
|
const readAction = await dispatch(readAndWait(pageKey));
|
|
206
|
+
if (latestInitRequestKey !== pageKey) return;
|
|
201
207
|
if (readAndWait.fulfilled.match(readAction) && readAction.payload) {
|
|
202
208
|
const data = readAction.payload;
|
|
203
209
|
if (data.type !== "page" /* DOC */) {
|
|
@@ -247,6 +253,7 @@ async function initDocState(args, { dispatch }) {
|
|
|
247
253
|
}));
|
|
248
254
|
}
|
|
249
255
|
} catch (e) {
|
|
256
|
+
if (latestInitRequestKey !== pageKey) return;
|
|
250
257
|
setState((prev) => ({
|
|
251
258
|
...prev,
|
|
252
259
|
isLoading: false,
|
|
@@ -300,7 +307,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
300
307
|
{ slateToRenderMarkdown },
|
|
301
308
|
{ buildSkillSummaryMarker }
|
|
302
309
|
] = await Promise.all([
|
|
303
|
-
import("./slateUtils-
|
|
310
|
+
import("./slateUtils-NGV2NMKM.js"),
|
|
304
311
|
import("./slateToRenderMarkdown-Y5IYN73U.js"),
|
|
305
312
|
import("./skillSummaryMarker-42HKSXYY.js")
|
|
306
313
|
]);
|
|
@@ -309,7 +316,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
309
316
|
const skillSummary = buildSkillSummaryMarker(meta);
|
|
310
317
|
const content = slateToRenderMarkdown(slateData);
|
|
311
318
|
const now = /* @__PURE__ */ new Date();
|
|
312
|
-
const updatedAt =
|
|
319
|
+
const updatedAt = formatISO(now);
|
|
313
320
|
await dispatch(
|
|
314
321
|
patch({
|
|
315
322
|
dbKey: pageKey,
|
|
@@ -326,7 +333,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
326
333
|
).unwrap();
|
|
327
334
|
if (dbSpaceId) {
|
|
328
335
|
try {
|
|
329
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
336
|
+
const { updateContentTitle } = await import("./contentThunks-5DDMUQ7B.js");
|
|
330
337
|
await dispatch(
|
|
331
338
|
updateContentTitle({
|
|
332
339
|
spaceId: dbSpaceId,
|
|
@@ -365,7 +372,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
365
372
|
}
|
|
366
373
|
}
|
|
367
374
|
async function createDocState(args, thunkApi) {
|
|
368
|
-
const { createPageAction } = await import("./createPageAction-
|
|
375
|
+
const { createPageAction } = await import("./createPageAction-NCGEJBVK.js");
|
|
369
376
|
return createPageAction(args, thunkApi);
|
|
370
377
|
}
|
|
371
378
|
function subscribe(listener) {
|
|
@@ -387,6 +394,7 @@ function useDocField(selector) {
|
|
|
387
394
|
}
|
|
388
395
|
function resetDocStoreForTests() {
|
|
389
396
|
state = createInitialState();
|
|
397
|
+
latestInitRequestKey = null;
|
|
390
398
|
bump();
|
|
391
399
|
}
|
|
392
400
|
|
|
@@ -394,6 +402,7 @@ export {
|
|
|
394
402
|
getDocState,
|
|
395
403
|
getDocField,
|
|
396
404
|
getDocPageKey,
|
|
405
|
+
isDocStateForPage,
|
|
397
406
|
getDocIsInitialized,
|
|
398
407
|
getDocIsReadOnly,
|
|
399
408
|
getDocHasPendingChanges,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeMediaConfirmExecutionRevision
|
|
3
|
+
} from "./chunk-VZLO4XJD.js";
|
|
1
4
|
import {
|
|
2
5
|
getActiveDialogKey
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VBG7GWWR.js";
|
|
4
7
|
import {
|
|
5
8
|
compactWhitespace
|
|
6
9
|
} from "./chunk-DWLEOOGR.js";
|
|
@@ -10,12 +13,12 @@ import {
|
|
|
10
13
|
import {
|
|
11
14
|
extractCustomId
|
|
12
15
|
} from "./chunk-M2EJHDJP.js";
|
|
13
|
-
import {
|
|
14
|
-
selectIdentityToken
|
|
15
|
-
} from "./chunk-SEJ5OS6F.js";
|
|
16
16
|
import {
|
|
17
17
|
isRecord
|
|
18
18
|
} from "./chunk-KUG52IAP.js";
|
|
19
|
+
import {
|
|
20
|
+
selectIdentityToken
|
|
21
|
+
} from "./chunk-SEJ5OS6F.js";
|
|
19
22
|
|
|
20
23
|
// packages/ai/tools/toolApiClient.ts
|
|
21
24
|
var MAIN_SERVER = "https://nolo.chat";
|
|
@@ -115,18 +118,31 @@ var ToolApiError = class extends Error {
|
|
|
115
118
|
status;
|
|
116
119
|
code;
|
|
117
120
|
details;
|
|
121
|
+
upperCredits;
|
|
122
|
+
/**
|
|
123
|
+
* 服务端在本次 409 里下发的执行代次(扁平 error.executionRevision,旧形状兼容
|
|
124
|
+
* error.details.executionRevision)。只转述服务端本次的值,绝不另行 GET 补齐。
|
|
125
|
+
* 真值判据复用 normalizeMediaConfirmExecutionRevision(缺失/非法一律缺席,不造值)。
|
|
126
|
+
*/
|
|
127
|
+
executionRevision;
|
|
118
128
|
constructor(message, options) {
|
|
119
129
|
super(message);
|
|
120
130
|
this.name = "ToolApiError";
|
|
121
131
|
this.status = options?.status;
|
|
122
132
|
this.code = options?.code;
|
|
123
133
|
this.details = options?.details;
|
|
134
|
+
this.upperCredits = options?.upperCredits;
|
|
135
|
+
this.executionRevision = normalizeMediaConfirmExecutionRevision(
|
|
136
|
+
options?.executionRevision
|
|
137
|
+
);
|
|
124
138
|
}
|
|
125
139
|
};
|
|
126
140
|
var buildToolRequestHeaders = (thunkApi, options = {}) => {
|
|
127
141
|
const { withAuth = false, agentKey } = options;
|
|
128
142
|
const { token } = getRequestConfig(thunkApi);
|
|
129
|
-
const headers = {
|
|
143
|
+
const headers = {
|
|
144
|
+
"Content-Type": "application/json"
|
|
145
|
+
};
|
|
130
146
|
if (withAuth && token) {
|
|
131
147
|
headers["Authorization"] = `Bearer ${token}`;
|
|
132
148
|
}
|
|
@@ -150,10 +166,12 @@ async function callToolApi(thunkApi, path, body, options = {}) {
|
|
|
150
166
|
if (!baseUrl) throw new Error("\u65E0\u6CD5\u83B7\u53D6\u5DE5\u5177\u670D\u52A1\u5668\u5730\u5740\u3002");
|
|
151
167
|
const url = `${baseUrl}${path}`;
|
|
152
168
|
const headers = buildToolRequestHeaders(thunkApi, options);
|
|
169
|
+
const method = options.method ?? "POST";
|
|
153
170
|
const response = await fetch(url, {
|
|
154
|
-
method
|
|
171
|
+
method,
|
|
155
172
|
headers,
|
|
156
|
-
|
|
173
|
+
...options.signal ? { signal: options.signal } : {},
|
|
174
|
+
...method === "GET" ? {} : { body: JSON.stringify(maybeAttachDialogId(thunkApi, body)) }
|
|
157
175
|
});
|
|
158
176
|
const contentType = response.headers.get("content-type");
|
|
159
177
|
const responseText = await response.text();
|
|
@@ -161,6 +179,8 @@ async function callToolApi(thunkApi, path, body, options = {}) {
|
|
|
161
179
|
let errorMessage = `API \u8BF7\u6C42\u5931\u8D25\uFF0C\u72B6\u6001\u7801: ${response.status}`;
|
|
162
180
|
let errorCode;
|
|
163
181
|
let errorDetails;
|
|
182
|
+
let upperCredits;
|
|
183
|
+
let errorExecutionRevision;
|
|
164
184
|
try {
|
|
165
185
|
const errorData = JSON.parse(responseText);
|
|
166
186
|
const err = errorData?.error;
|
|
@@ -168,6 +188,10 @@ async function callToolApi(thunkApi, path, body, options = {}) {
|
|
|
168
188
|
errorMessage += `: ${err.message ?? JSON.stringify(err)}`;
|
|
169
189
|
errorCode = typeof err.code === "string" ? err.code : void 0;
|
|
170
190
|
errorDetails = err.details;
|
|
191
|
+
if (typeof err.upperCredits === "number") {
|
|
192
|
+
upperCredits = err.upperCredits;
|
|
193
|
+
}
|
|
194
|
+
errorExecutionRevision = err.executionRevision ?? err.details?.executionRevision;
|
|
171
195
|
}
|
|
172
196
|
} catch {
|
|
173
197
|
errorCode = looksLikeHtmlResponse(responseText, contentType) ? "HTML_ERROR_RESPONSE" : "NON_JSON_ERROR_RESPONSE";
|
|
@@ -182,7 +206,9 @@ async function callToolApi(thunkApi, path, body, options = {}) {
|
|
|
182
206
|
throw new ToolApiError(errorMessage, {
|
|
183
207
|
status: response.status,
|
|
184
208
|
code: errorCode,
|
|
185
|
-
details: errorDetails
|
|
209
|
+
details: errorDetails,
|
|
210
|
+
upperCredits,
|
|
211
|
+
executionRevision: errorExecutionRevision
|
|
186
212
|
});
|
|
187
213
|
}
|
|
188
214
|
try {
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// packages/create/editor/utils/slateUtils.ts
|
|
2
|
+
var slateNodeToString = (node) => {
|
|
3
|
+
if (typeof node?.text === "string") return node.text;
|
|
4
|
+
const children = Array.isArray(node?.children) ? node.children : [];
|
|
5
|
+
return children.map(slateNodeToString).join("");
|
|
6
|
+
};
|
|
7
|
+
var createEmptyParagraph = () => ({
|
|
8
|
+
type: "paragraph",
|
|
9
|
+
children: [{ text: "" }]
|
|
10
|
+
});
|
|
11
|
+
var ensureEditorContent = (slateData) => Array.isArray(slateData) && slateData.length > 0 ? slateData : [createEmptyParagraph()];
|
|
12
|
+
var deepEqual = (a, b) => {
|
|
13
|
+
if (a === b) return true;
|
|
14
|
+
if (a == null || b == null) return false;
|
|
15
|
+
if (typeof a !== "object" || typeof b !== "object") return false;
|
|
16
|
+
const isArrayA = Array.isArray(a);
|
|
17
|
+
const isArrayB = Array.isArray(b);
|
|
18
|
+
if (isArrayA || isArrayB) {
|
|
19
|
+
if (!isArrayA || !isArrayB) return false;
|
|
20
|
+
if (a.length !== b.length) return false;
|
|
21
|
+
for (let i = 0; i < a.length; i++) {
|
|
22
|
+
if (!deepEqual(a[i], b[i])) return false;
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
const keysA = Object.keys(a);
|
|
27
|
+
const keysB = Object.keys(b);
|
|
28
|
+
if (keysA.length !== keysB.length) return false;
|
|
29
|
+
for (const key of keysA) {
|
|
30
|
+
if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
|
|
31
|
+
if (!deepEqual(a[key], b[key])) return false;
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
35
|
+
var compareSlateContent = (newContent, oldContent) => {
|
|
36
|
+
if (newContent === oldContent) return false;
|
|
37
|
+
if (!newContent || !oldContent) return true;
|
|
38
|
+
if (newContent.length !== oldContent.length) return true;
|
|
39
|
+
return !deepEqual(newContent, oldContent);
|
|
40
|
+
};
|
|
41
|
+
var extractTitleFromSlate = (slateData) => {
|
|
42
|
+
if (!Array.isArray(slateData) || slateData.length === 0) return "\u65B0\u9875\u9762";
|
|
43
|
+
const titleNode = slateData.find((node) => node.type === "heading-one");
|
|
44
|
+
if (titleNode) {
|
|
45
|
+
const text = slateNodeToString(titleNode).trim();
|
|
46
|
+
if (text) {
|
|
47
|
+
return text;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
for (const node of slateData) {
|
|
51
|
+
const text = slateNodeToString(node).trim();
|
|
52
|
+
if (text) {
|
|
53
|
+
return text.length > 30 ? `${text.substring(0, 30)}...` : text;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return "\u65B0\u9875\u9762";
|
|
57
|
+
};
|
|
58
|
+
var splitSlateTitleAndBody = (slateData, explicitTitle) => {
|
|
59
|
+
const content = ensureEditorContent(slateData);
|
|
60
|
+
const firstNode = content[0];
|
|
61
|
+
const hasExplicitTitle = explicitTitle !== void 0 && explicitTitle !== null;
|
|
62
|
+
const normalizedExplicitTitle = hasExplicitTitle ? explicitTitle.trim() : null;
|
|
63
|
+
const firstNonEmptyText = content.map((node) => slateNodeToString(node).trim()).find(Boolean);
|
|
64
|
+
if (firstNode?.type === "heading-one") {
|
|
65
|
+
const firstText = slateNodeToString(firstNode).trim();
|
|
66
|
+
const shouldTreatAsTitle = !!firstText && (normalizedExplicitTitle == null || normalizedExplicitTitle === firstText);
|
|
67
|
+
if (shouldTreatAsTitle) {
|
|
68
|
+
const body = content.slice(1);
|
|
69
|
+
return {
|
|
70
|
+
title: firstText,
|
|
71
|
+
body: ensureEditorContent(body)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
title: normalizedExplicitTitle ?? (firstNonEmptyText || ""),
|
|
77
|
+
body: content
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
var extractMentionsFromSlate = (slateData) => {
|
|
81
|
+
const tools = /* @__PURE__ */ new Set();
|
|
82
|
+
const traverse = (nodes) => {
|
|
83
|
+
for (const node of nodes) {
|
|
84
|
+
if (node.type === "mention" && node.resourceId) {
|
|
85
|
+
if (node.resourceType === "tool") {
|
|
86
|
+
tools.add(node.resourceId);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (node.children && Array.isArray(node.children)) {
|
|
90
|
+
traverse(node.children);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
if (Array.isArray(slateData)) {
|
|
95
|
+
traverse(slateData);
|
|
96
|
+
}
|
|
97
|
+
return Array.from(tools);
|
|
98
|
+
};
|
|
99
|
+
var extractCategorizedMentions = (slateData) => {
|
|
100
|
+
const result = {
|
|
101
|
+
tools: [],
|
|
102
|
+
pages: [],
|
|
103
|
+
agents: [],
|
|
104
|
+
spaces: []
|
|
105
|
+
};
|
|
106
|
+
const traverse = (nodes) => {
|
|
107
|
+
for (const node of nodes) {
|
|
108
|
+
if (node.type === "mention" && node.resourceId && node.resourceType) {
|
|
109
|
+
switch (node.resourceType) {
|
|
110
|
+
case "tool":
|
|
111
|
+
result.tools.push(node.resourceId);
|
|
112
|
+
break;
|
|
113
|
+
case "page":
|
|
114
|
+
result.pages.push(node.resourceId);
|
|
115
|
+
break;
|
|
116
|
+
case "agent":
|
|
117
|
+
result.agents.push(node.resourceId);
|
|
118
|
+
break;
|
|
119
|
+
case "space":
|
|
120
|
+
result.spaces.push(node.resourceId);
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (node.children && Array.isArray(node.children)) {
|
|
125
|
+
traverse(node.children);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
if (Array.isArray(slateData)) {
|
|
130
|
+
traverse(slateData);
|
|
131
|
+
}
|
|
132
|
+
result.tools = [...new Set(result.tools)];
|
|
133
|
+
result.pages = [...new Set(result.pages)];
|
|
134
|
+
result.agents = [...new Set(result.agents)];
|
|
135
|
+
result.spaces = [...new Set(result.spaces)];
|
|
136
|
+
return result;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export {
|
|
140
|
+
createEmptyParagraph,
|
|
141
|
+
ensureEditorContent,
|
|
142
|
+
compareSlateContent,
|
|
143
|
+
extractTitleFromSlate,
|
|
144
|
+
splitSlateTitleAndBody,
|
|
145
|
+
extractMentionsFromSlate,
|
|
146
|
+
extractCategorizedMentions
|
|
147
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XDQ7PHU3.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
runtime_default
|
|
6
|
+
} from "./chunk-VYKXIHRP.js";
|
|
7
7
|
import {
|
|
8
8
|
canonicalizeToolNames
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IHPDK6UD.js";
|
|
10
10
|
import {
|
|
11
11
|
isNoloHostedProvider
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IYIXAIEB.js";
|
|
13
13
|
import {
|
|
14
14
|
asTrimmedLowercaseString
|
|
15
15
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
} from "./chunk-KUG52IAP.js";
|
|
19
19
|
|
|
20
20
|
// packages/ai/chat/inlineImageUrlsForCustomProvider.ts
|
|
21
|
+
var INLINE_IMAGE_MAX_BYTES = 5 * 1024 * 1024;
|
|
22
|
+
var INLINE_IMAGE_TOTAL_MAX_BYTES = 20 * 1024 * 1024;
|
|
21
23
|
var FILE_CONTENT_PATH = "/api/v1/db/file/content/";
|
|
22
24
|
var shouldInlineImageUrlsForAgent = (agentConfig) => {
|
|
23
25
|
const apiSource = agentConfig?.apiSource?.toLowerCase();
|
|
@@ -29,14 +31,14 @@ var shouldInlineImageUrlsForAgent = (agentConfig) => {
|
|
|
29
31
|
};
|
|
30
32
|
var isInlineCandidate = (url) => /^https?:\/\//i.test(url) && url.includes(FILE_CONTENT_PATH);
|
|
31
33
|
var bytesToBase64 = (bytes) => {
|
|
32
|
-
|
|
33
|
-
for (
|
|
34
|
-
|
|
34
|
+
const chunks = [];
|
|
35
|
+
for (let offset = 0; offset < bytes.length; offset += 32768) {
|
|
36
|
+
chunks.push(String.fromCharCode.apply(null, Array.from(bytes.subarray(offset, offset + 32768))));
|
|
35
37
|
}
|
|
36
|
-
return btoa(
|
|
38
|
+
return btoa(chunks.join(""));
|
|
37
39
|
};
|
|
38
|
-
var defaultFetchImage = async (url) => {
|
|
39
|
-
const response = await fetch(url);
|
|
40
|
+
var defaultFetchImage = async (url, signal, _maxBytes) => {
|
|
41
|
+
const response = await fetch(url, { signal });
|
|
40
42
|
if (!response.ok) {
|
|
41
43
|
return {
|
|
42
44
|
ok: false,
|
|
@@ -50,59 +52,69 @@ var defaultFetchImage = async (url) => {
|
|
|
50
52
|
bytes
|
|
51
53
|
};
|
|
52
54
|
};
|
|
53
|
-
var cloneImagePartWithDataUrl = async (part, fetchImage,
|
|
55
|
+
var cloneImagePartWithDataUrl = async (part, fetchImage, options, usedBytes) => {
|
|
54
56
|
const url = part?.image_url?.url;
|
|
55
|
-
if (typeof url !== "string" || !isInlineCandidate(url) || isAllowedImageUrl && !isAllowedImageUrl(url))
|
|
57
|
+
if (typeof url !== "string" || !isInlineCandidate(url) || options.isAllowedImageUrl && !options.isAllowedImageUrl(url)) return part;
|
|
58
|
+
if (options.signal?.aborted) throw new DOMException("The operation was aborted", "AbortError");
|
|
59
|
+
const remaining = options.maxTotalBytes === void 0 ? void 0 : options.maxTotalBytes - usedBytes.value;
|
|
60
|
+
const fetchLimit = options.maxBytes === void 0 ? remaining : remaining === void 0 ? options.maxBytes : Math.min(options.maxBytes, remaining);
|
|
61
|
+
const result = await fetchImage(url, options.signal, fetchLimit);
|
|
62
|
+
if (options.signal?.aborted) throw new DOMException("The operation was aborted", "AbortError");
|
|
63
|
+
if (result.skippedSize !== void 0) {
|
|
64
|
+
const reason = options.maxBytes !== void 0 && result.skippedSize > options.maxBytes ? "per-image" : "total-budget";
|
|
65
|
+
options.onSkipTooLarge?.(url, result.skippedSize, reason);
|
|
56
66
|
return part;
|
|
57
67
|
}
|
|
58
|
-
const result = await fetchImage(url);
|
|
59
68
|
if (!result.ok || !result.bytes) return part;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
69
|
+
if (options.maxBytes !== void 0 && result.bytes.byteLength > options.maxBytes) {
|
|
70
|
+
options.onSkipTooLarge?.(url, result.bytes.byteLength, "per-image");
|
|
71
|
+
return part;
|
|
72
|
+
}
|
|
73
|
+
if (options.maxTotalBytes !== void 0 && usedBytes.value + result.bytes.byteLength > options.maxTotalBytes) {
|
|
74
|
+
options.onSkipTooLarge?.(url, result.bytes.byteLength, "total-budget");
|
|
75
|
+
return part;
|
|
76
|
+
}
|
|
77
|
+
usedBytes.value += result.bytes.byteLength;
|
|
78
|
+
const mimeType = (result.mimeType || "application/octet-stream").split(";")[0].trim() || "application/octet-stream";
|
|
79
|
+
return { ...part, image_url: { ...part.image_url, url: `data:${mimeType};base64,${bytesToBase64(result.bytes)}` } };
|
|
68
80
|
};
|
|
69
81
|
var inlineImageUrlsForCustomProvider = async (bodyData, options) => {
|
|
70
82
|
if (!options.shouldInline) return bodyData;
|
|
71
83
|
const body = bodyData;
|
|
72
84
|
if (!Array.isArray(body?.messages)) return bodyData;
|
|
73
85
|
const fetchImage = options.fetchImage ?? defaultFetchImage;
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
if (!
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
const fetched = /* @__PURE__ */ new Map();
|
|
87
|
+
const fetchOnce = (url, signal, maxBytes) => {
|
|
88
|
+
let result = fetched.get(url);
|
|
89
|
+
if (!result) {
|
|
90
|
+
result = fetchImage(url, signal, maxBytes);
|
|
91
|
+
fetched.set(url, result);
|
|
80
92
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (
|
|
93
|
+
return result;
|
|
94
|
+
};
|
|
95
|
+
const usedBytes = { value: 0 };
|
|
96
|
+
let changed = false;
|
|
97
|
+
const messages = [...body.messages];
|
|
98
|
+
for (let mi = messages.length - 1; mi >= 0; mi--) {
|
|
99
|
+
const message = messages[mi];
|
|
100
|
+
if (!Array.isArray(message?.content)) continue;
|
|
101
|
+
const content = [...message.content];
|
|
102
|
+
for (let pi = content.length - 1; pi >= 0; pi--) {
|
|
103
|
+
const part = content[pi];
|
|
104
|
+
if (part?.type !== "image_url") continue;
|
|
105
|
+
if (options.maxTotalBytes !== void 0 && usedBytes.value >= options.maxTotalBytes) {
|
|
106
|
+
if (typeof part?.image_url?.url === "string" && isInlineCandidate(part.image_url.url)) options.onSkipTooLarge?.(part.image_url.url, void 0, "total-budget");
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
const cloned = await cloneImagePartWithDataUrl(part, fetchOnce, options, usedBytes);
|
|
110
|
+
if (cloned !== part) {
|
|
111
|
+
content[pi] = cloned;
|
|
94
112
|
changed = true;
|
|
95
|
-
messageChanged = true;
|
|
96
|
-
break;
|
|
97
113
|
}
|
|
98
114
|
}
|
|
99
|
-
|
|
115
|
+
if (content.some((part, index) => part !== message.content[index])) messages[mi] = { ...message, content };
|
|
100
116
|
}
|
|
101
|
-
|
|
102
|
-
return {
|
|
103
|
-
...body,
|
|
104
|
-
messages
|
|
105
|
-
};
|
|
117
|
+
return changed ? { ...body, messages } : bodyData;
|
|
106
118
|
};
|
|
107
119
|
|
|
108
120
|
// packages/ai/tools/toolSchemaCompatibility.ts
|
|
@@ -151,12 +163,12 @@ var PREPARE_TOOLS_CACHE_LIMIT = 128;
|
|
|
151
163
|
var warnedUnknownToolNames = /* @__PURE__ */ new Set();
|
|
152
164
|
function getTranslation(keys, defaultVal) {
|
|
153
165
|
for (const key of keys) {
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
166
|
+
if (runtime_default.exists(key)) {
|
|
167
|
+
return runtime_default.t(key);
|
|
156
168
|
}
|
|
157
169
|
const aiKey = key.startsWith("ai:") ? key : `ai:${key}`;
|
|
158
|
-
if (
|
|
159
|
-
return
|
|
170
|
+
if (runtime_default.exists(aiKey)) {
|
|
171
|
+
return runtime_default.t(aiKey);
|
|
160
172
|
}
|
|
161
173
|
}
|
|
162
174
|
return defaultVal;
|
|
@@ -203,7 +215,7 @@ function translateSchema(schema) {
|
|
|
203
215
|
return nextSchema;
|
|
204
216
|
}
|
|
205
217
|
function currentI18nLanguage() {
|
|
206
|
-
return typeof
|
|
218
|
+
return typeof runtime_default.language === "string" ? runtime_default.language : "";
|
|
207
219
|
}
|
|
208
220
|
function translateSchemaCached(schema) {
|
|
209
221
|
if (!schema || typeof schema !== "object") return schema;
|
|
@@ -11,6 +11,12 @@ import {
|
|
|
11
11
|
isLoopbackHostname
|
|
12
12
|
} from "./chunk-4SN6J65J.js";
|
|
13
13
|
|
|
14
|
+
// packages/core/positiveFiniteNumberOrFallback.ts
|
|
15
|
+
function parsePositiveFiniteNumberOrFallback(value, fallback) {
|
|
16
|
+
const parsed = Number(value);
|
|
17
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
// packages/core/fetchWithTransientRetry.ts
|
|
15
21
|
var TRANSIENT_FETCH_MAX_ATTEMPTS = 3;
|
|
16
22
|
var TRANSIENT_FETCH_RETRY_BASE_DELAY_MS = 250;
|
|
@@ -120,6 +126,7 @@ async function fetchWithTransientRetry(fetchImpl, input, init, options = {}) {
|
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
export {
|
|
129
|
+
parsePositiveFiniteNumberOrFallback,
|
|
123
130
|
isTransientFetchError,
|
|
124
131
|
fetchWithTransientRetry
|
|
125
132
|
};
|