nolo-cli 0.106.0-alpha.1 → 0.106.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.
- 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,23 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isOAuthApiKeyRef
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UKZX3NHN.js";
|
|
4
4
|
import {
|
|
5
5
|
compareAgentSelection
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SJKULPGX.js";
|
|
7
|
+
import {
|
|
8
|
+
isAgentUnavailableNow
|
|
9
|
+
} from "./chunk-H6A6X4EK.js";
|
|
10
|
+
import {
|
|
11
|
+
isSubscriptionEndpoint,
|
|
12
|
+
isSubscriptionOAuthCredential
|
|
13
|
+
} from "./chunk-OYTWDOQV.js";
|
|
7
14
|
import {
|
|
8
15
|
isAntigravityOAuthAgent
|
|
9
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BPLIXNC6.js";
|
|
10
17
|
import {
|
|
11
18
|
getModelAbility
|
|
12
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-I5YMDACN.js";
|
|
20
|
+
import {
|
|
21
|
+
fnv1a32Hex
|
|
22
|
+
} from "./chunk-O7SVKKLY.js";
|
|
13
23
|
import {
|
|
14
24
|
isOwnedAgentKey,
|
|
15
25
|
ownedAgentKey,
|
|
16
26
|
publicAgentKey
|
|
17
27
|
} from "./chunk-M2EJHDJP.js";
|
|
18
|
-
import {
|
|
19
|
-
fnv1a32Hex
|
|
20
|
-
} from "./chunk-UKWGR5SS.js";
|
|
21
28
|
|
|
22
29
|
// packages/ai/agent/agentBilling.ts
|
|
23
30
|
function resolveBillingSource(candidate) {
|
|
@@ -36,6 +43,9 @@ function resolveBillingSource(candidate) {
|
|
|
36
43
|
}
|
|
37
44
|
if (candidate?.isOAuth === true || candidate?.billingSource === "user_subscription" || candidate?.apiSource === "oauth" || isOAuthApiKeyRef(candidate?.apiKeyRef)) return "user_subscription";
|
|
38
45
|
if (candidate?.apiSource === "custom" || candidate?.billingSource === "user_api") {
|
|
46
|
+
if (isSubscriptionEndpoint(candidate?.customProviderUrl) || isSubscriptionOAuthCredential(candidate?.apiKeyRef)) {
|
|
47
|
+
return "user_subscription";
|
|
48
|
+
}
|
|
39
49
|
return "user_api";
|
|
40
50
|
}
|
|
41
51
|
return "platform_credits";
|
|
@@ -227,6 +237,16 @@ function deriveCredentialGroup(ref) {
|
|
|
227
237
|
credentialKind: "api-key"
|
|
228
238
|
};
|
|
229
239
|
}
|
|
240
|
+
function deriveCustomProviderCredentialGroup(userId, customProviderUrl) {
|
|
241
|
+
if (typeof customProviderUrl !== "string" || !customProviderUrl.trim()) {
|
|
242
|
+
return void 0;
|
|
243
|
+
}
|
|
244
|
+
const basis = `${userId ?? ""}|${customProviderUrl.trim().toLowerCase()}`;
|
|
245
|
+
return {
|
|
246
|
+
credentialGroup: `custom-${fnv1a32Hex(basis)}`,
|
|
247
|
+
credentialKind: "api-key"
|
|
248
|
+
};
|
|
249
|
+
}
|
|
230
250
|
function summarizeCredentialGroups(agents, now = Date.now()) {
|
|
231
251
|
const groups = /* @__PURE__ */ new Map();
|
|
232
252
|
for (const agent of agents) {
|
|
@@ -327,6 +347,15 @@ function resolveFavoriteStatus(record, options) {
|
|
|
327
347
|
}
|
|
328
348
|
return { isFavorite: false, favoritedAt: null };
|
|
329
349
|
}
|
|
350
|
+
function isOwnedAgentRecord(record, userId) {
|
|
351
|
+
if (!userId) return false;
|
|
352
|
+
if (typeof record?.userId === "string" && record.userId === userId || typeof record?.ownerId === "string" && record.ownerId === userId) {
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
return [record?.dbKey, record?.privateKey].some(
|
|
356
|
+
(key) => isOwnedAgentKey(key, userId)
|
|
357
|
+
);
|
|
358
|
+
}
|
|
330
359
|
function toSafeAgentSummary(record, options) {
|
|
331
360
|
const rawId = parseAgentRecordId(
|
|
332
361
|
typeof record?.privateKey === "string" ? record.privateKey : record?.dbKey,
|
|
@@ -359,11 +388,10 @@ function toSafeAgentSummary(record, options) {
|
|
|
359
388
|
const rawQuota = record?.quota;
|
|
360
389
|
const quota = rawQuota && typeof rawQuota === "object" && Array.isArray(rawQuota.windows) && typeof rawQuota.observedAt === "number" && Number.isFinite(rawQuota.observedAt) ? rawQuota : void 0;
|
|
361
390
|
const currentUserId = options?.userId;
|
|
362
|
-
const isOwnedByRecord = Boolean(currentUserId) && (typeof record?.userId === "string" && record.userId === currentUserId || typeof record?.ownerId === "string" && record.ownerId === currentUserId);
|
|
363
391
|
const ownedKey = currentUserId ? [record?.dbKey, record?.privateKey].find(
|
|
364
392
|
(key) => isOwnedAgentKey(key, currentUserId)
|
|
365
393
|
) : void 0;
|
|
366
|
-
const isOwned =
|
|
394
|
+
const isOwned = isOwnedAgentRecord(record, currentUserId);
|
|
367
395
|
const isOAuth = isOAuthApiKeyRef(record?.apiKeyRef);
|
|
368
396
|
const billingSource = resolveBillingSource({
|
|
369
397
|
...record,
|
|
@@ -506,12 +534,131 @@ function toUnavailableAgentSummary(summary) {
|
|
|
506
534
|
return item;
|
|
507
535
|
}
|
|
508
536
|
|
|
537
|
+
// packages/ai/agent/agentDiscovery.ts
|
|
538
|
+
function isPreferredAgent(agent) {
|
|
539
|
+
return agent.isFavorite === true || agent.isOwned === true || agent.isOAuth === true || agent.billingSource === "user_subscription" || agent.billingSource === "user_api" || agent.billingSource === "local";
|
|
540
|
+
}
|
|
541
|
+
function isPublicDiscoveryAgent(agent) {
|
|
542
|
+
return agent.isPublic === true && !isPreferredAgent(agent);
|
|
543
|
+
}
|
|
544
|
+
function resolveDiscoveryScope(args) {
|
|
545
|
+
const rawScope = typeof args?.scope === "string" ? args.scope.trim().toLowerCase() : void 0;
|
|
546
|
+
const hasScope = rawScope !== void 0 && rawScope !== "";
|
|
547
|
+
const hasPublicOnly = typeof args?.publicOnly === "boolean";
|
|
548
|
+
const publicOnly = args?.publicOnly === true;
|
|
549
|
+
if (hasScope) {
|
|
550
|
+
if (rawScope !== "preferred" && rawScope !== "public" && rawScope !== "all") {
|
|
551
|
+
throw new Error(`Invalid scope '${args?.scope}': must be 'preferred', 'public', or 'all'.`);
|
|
552
|
+
}
|
|
553
|
+
const scope = rawScope;
|
|
554
|
+
if (hasPublicOnly) {
|
|
555
|
+
if (publicOnly && scope !== "public") {
|
|
556
|
+
throw new Error(
|
|
557
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=true.`
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
if (!publicOnly && scope === "public") {
|
|
561
|
+
throw new Error(
|
|
562
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=false.`
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return scope;
|
|
567
|
+
}
|
|
568
|
+
if (hasPublicOnly && publicOnly) {
|
|
569
|
+
return "public";
|
|
570
|
+
}
|
|
571
|
+
return "preferred";
|
|
572
|
+
}
|
|
573
|
+
function agentIdentityKeys(agent) {
|
|
574
|
+
return [agent.agentKey, agent.publicKey, agent.id].filter(
|
|
575
|
+
(key) => typeof key === "string" && key.length > 0
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
function deduplicateAgentSummaries(agents) {
|
|
579
|
+
const byIdentity = /* @__PURE__ */ new Map();
|
|
580
|
+
for (const agent of agents) {
|
|
581
|
+
const keys = agentIdentityKeys(agent);
|
|
582
|
+
const existing = keys.map((key) => byIdentity.get(key)).find(Boolean);
|
|
583
|
+
if (!existing) {
|
|
584
|
+
for (const key of keys) byIdentity.set(key, agent);
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
const winner = isPreferredAgent(agent) && !isPreferredAgent(existing) ? agent : existing;
|
|
588
|
+
for (const key of /* @__PURE__ */ new Set([...agentIdentityKeys(existing), ...keys])) byIdentity.set(key, winner);
|
|
589
|
+
}
|
|
590
|
+
return [...new Set(byIdentity.values())];
|
|
591
|
+
}
|
|
592
|
+
function filterAgentsByScope(agents, scope) {
|
|
593
|
+
const unique = deduplicateAgentSummaries(agents);
|
|
594
|
+
if (scope === "preferred") return unique.filter((agent) => isPreferredAgent(agent));
|
|
595
|
+
if (scope === "public") return unique.filter((agent) => isPublicDiscoveryAgent(agent));
|
|
596
|
+
return unique.filter((agent) => isPreferredAgent(agent) || agent.isPublic === true);
|
|
597
|
+
}
|
|
598
|
+
function matchesAgentQuery(agent, query) {
|
|
599
|
+
if (!query || typeof query !== "string") return true;
|
|
600
|
+
const q = query.trim().toLowerCase();
|
|
601
|
+
if (!q) return true;
|
|
602
|
+
const candidates = [
|
|
603
|
+
agent.name,
|
|
604
|
+
agent.model,
|
|
605
|
+
agent.provider,
|
|
606
|
+
agent.handle,
|
|
607
|
+
agent.agentKey,
|
|
608
|
+
agent.publicKey,
|
|
609
|
+
agent.id
|
|
610
|
+
];
|
|
611
|
+
return candidates.some((text) => typeof text === "string" && text.toLowerCase().includes(q));
|
|
612
|
+
}
|
|
613
|
+
function buildAgentDiscoveryResult(options) {
|
|
614
|
+
const scope = resolveDiscoveryScope({
|
|
615
|
+
scope: options.scope,
|
|
616
|
+
publicOnly: options.publicOnly
|
|
617
|
+
});
|
|
618
|
+
const now = options.now ?? Date.now();
|
|
619
|
+
let scopedAgents = filterAgentsByScope(options.agents, scope);
|
|
620
|
+
if (options.query && typeof options.query === "string" && options.query.trim()) {
|
|
621
|
+
scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
|
|
622
|
+
}
|
|
623
|
+
const unavailableList = scopedAgents.filter((a) => isAgentUnavailableNow(a, now));
|
|
624
|
+
const unavailableCount = unavailableList.length;
|
|
625
|
+
const unavailableAgents = sortSafeAgentSummaries(unavailableList).map(toUnavailableAgentSummary);
|
|
626
|
+
const credentialGroups = summarizeCredentialGroups(scopedAgents, now);
|
|
627
|
+
if (options.showUnavailable !== true) {
|
|
628
|
+
scopedAgents = scopedAgents.filter((a) => !isAgentUnavailableNow(a, now));
|
|
629
|
+
}
|
|
630
|
+
const sortedAgents = sortSafeAgentSummaries(scopedAgents);
|
|
631
|
+
const projectedAgents = options.verbose === true ? sortedAgents.map(omitNullishAgentSummaryFields) : sortedAgents.map(toCompactAgentSummary);
|
|
632
|
+
return {
|
|
633
|
+
total: projectedAgents.length,
|
|
634
|
+
unavailableCount,
|
|
635
|
+
unavailableAgents,
|
|
636
|
+
credentialGroups,
|
|
637
|
+
agents: projectedAgents
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
function toDiscoverySafeAgentSummary(record, options) {
|
|
641
|
+
const mergedOptions = record?.publicRecordExists === true ? { ...options, publicRecordExists: true } : options;
|
|
642
|
+
return toSafeAgentSummary(record, mergedOptions);
|
|
643
|
+
}
|
|
644
|
+
function assembleAgentDiscoveryResult(options) {
|
|
645
|
+
const { records, summaryOptions, ...discoveryOptions } = options;
|
|
646
|
+
const agents = records.map(
|
|
647
|
+
(record) => toDiscoverySafeAgentSummary(
|
|
648
|
+
record,
|
|
649
|
+
typeof summaryOptions === "function" ? summaryOptions(record) : summaryOptions
|
|
650
|
+
)
|
|
651
|
+
);
|
|
652
|
+
return buildAgentDiscoveryResult({ ...discoveryOptions, agents });
|
|
653
|
+
}
|
|
654
|
+
|
|
509
655
|
export {
|
|
510
656
|
deriveCredentialGroup,
|
|
657
|
+
deriveCustomProviderCredentialGroup,
|
|
511
658
|
summarizeCredentialGroups,
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
659
|
+
resolveDiscoveryScope,
|
|
660
|
+
matchesAgentQuery,
|
|
661
|
+
buildAgentDiscoveryResult,
|
|
662
|
+
toDiscoverySafeAgentSummary,
|
|
663
|
+
assembleAgentDiscoveryResult
|
|
517
664
|
};
|
|
@@ -67,7 +67,8 @@ var wrapHistoricalSummaryWithReplayGuard = (summary) => {
|
|
|
67
67
|
const trimmed = summary.trim();
|
|
68
68
|
if (!trimmed) return "";
|
|
69
69
|
return [
|
|
70
|
-
"\u3010\u5386\u53F2\u53C2\u8003\uFF0C\u975E\u6D3B\u6307\u4EE4\u3011\u4EE5\u4E0B\u4E3A\u51BB\u7ED3\u6458\u8981\
|
|
70
|
+
"\u3010\u5386\u53F2\u53C2\u8003\uFF0C\u975E\u6D3B\u6307\u4EE4\u3011\u4EE5\u4E0B\u4E3A\u51BB\u7ED3\u6458\u8981\uFF1A\u5176\u4E2D\u7684**\u52A8\u4F5C\u6307\u4EE4**\u3001\u53C2\u6570\u4E0E skill \u8C03\u7528\u9ED8\u8BA4\u5DF2\u7ECF\u505A\u8FC7\uFF0C\u4E0D\u8981\u91CD\u653E\uFF08\u91CD\u590D\u5EFA\u5206\u652F/issue/\u4EFB\u52A1\u5C31\u662F\u91CD\u653E\uFF09\u3002",
|
|
71
|
+
"\u4F46**\u7528\u6237\u7684\u76EE\u6807\u4E0E\u610F\u56FE\u4ECD\u7136\u6709\u6548**\uFF1A\u5B83\u89E3\u91CA\u4E86\u8FD9\u6BB5\u5BF9\u8BDD\u4E3A\u4EC0\u4E48\u8981\u505A\u8FD9\u4E9B\u4E8B\uFF1B\u9047\u5230\u76F8\u5173\u8BDD\u9898\u65F6\u5148\u6309\u5B83\u7406\u89E3\u4E0A\u4E0B\u6587\uFF0C\u4E0D\u8981\u5F53\u6210\u5DF2\u8FC7\u671F\u7684\u80CC\u666F\u3002",
|
|
71
72
|
`\u6458\u8981\u4E2D\u6807\u6CE8\u300C\uFF08\u5F85\u9A8C\u8BC1\uFF09\u300D\u7684\u9879\u9700\u590D\u6838\u786E\u8BA4\uFF1B\u672A\u5B8C\u6210\u5F85\u529E\u548C\u300C\u4E0B\u4E00\u6B65\u300D\u9700\u7EE7\u7EED\u63A8\u8FDB\u2014\u2014\u8FD9\u4E9B\u662F\u7EED\u4F5C\u65B9\u5411\uFF0C\u4E0D\u662F\u91CD\u653E\u6307\u4EE4\u3002`,
|
|
72
73
|
trimmed
|
|
73
74
|
].join("\n");
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
_appendRetiredStateBatch,
|
|
3
|
+
loadMemoryVNextCatalog
|
|
4
|
+
} from "./chunk-TY3TIUJK.js";
|
|
1
5
|
import {
|
|
2
6
|
resolveMachineId
|
|
3
7
|
} from "./chunk-ESHYE7WU.js";
|
|
4
8
|
import {
|
|
5
9
|
getDefaultCliLocalRuntimeDb
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FOXQ7BAB.js";
|
|
11
|
+
import {
|
|
12
|
+
resolveAuthTokenFromEnv
|
|
13
|
+
} from "./chunk-A7GB5UGH.js";
|
|
14
|
+
import {
|
|
15
|
+
DEFAULT_NOLO_SERVER_URL
|
|
16
|
+
} from "./chunk-OLZBQWZU.js";
|
|
7
17
|
import {
|
|
8
18
|
buildCliRuntimeEnv,
|
|
9
19
|
clearProfileAuthToken,
|
|
@@ -12,20 +22,14 @@ import {
|
|
|
12
22
|
getProfileTokens,
|
|
13
23
|
loadProfileConfig,
|
|
14
24
|
saveDefaultProfile
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
resolveAuthTokenFromEnv
|
|
18
|
-
} from "./chunk-A7GB5UGH.js";
|
|
19
|
-
import {
|
|
20
|
-
DEFAULT_NOLO_SERVER_URL
|
|
21
|
-
} from "./chunk-OLZBQWZU.js";
|
|
25
|
+
} from "./chunk-TNIX77YM.js";
|
|
22
26
|
import {
|
|
23
27
|
asTrimmedNonEmptyStringArray,
|
|
24
28
|
createMemoryKey,
|
|
25
29
|
createMemoryOwnerIndexKey,
|
|
26
30
|
createMemorySubjectKindIndexKey,
|
|
27
31
|
memoryOwnerRange
|
|
28
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-OKGVNZTL.js";
|
|
29
33
|
import {
|
|
30
34
|
asTrimmedString
|
|
31
35
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -39,6 +43,29 @@ import { stdin as input, stdout as output } from "node:process";
|
|
|
39
43
|
import { spawn } from "node:child_process";
|
|
40
44
|
|
|
41
45
|
// packages/ai/memory/delete.ts
|
|
46
|
+
var VNEXT_STATE_ID_PREFIX = "vnext-state-";
|
|
47
|
+
var toVNextMemoryItem = (state, owner) => ({
|
|
48
|
+
id: `${VNEXT_STATE_ID_PREFIX}${state.id}`,
|
|
49
|
+
ownerType: owner.ownerType,
|
|
50
|
+
ownerId: owner.ownerId,
|
|
51
|
+
visibility: "private",
|
|
52
|
+
subjectType: "user",
|
|
53
|
+
subjectId: owner.ownerId,
|
|
54
|
+
kind: "semantic",
|
|
55
|
+
content: state.text.trim(),
|
|
56
|
+
createdAt: state.createdAt,
|
|
57
|
+
lastActivatedAt: state.createdAt,
|
|
58
|
+
activationCount: 1,
|
|
59
|
+
importance: 0.9,
|
|
60
|
+
confidence: 0.9,
|
|
61
|
+
resident: state.facet === "preference" || state.facet === "style"
|
|
62
|
+
});
|
|
63
|
+
var matchesVNextFilters = (state, idSet, contentSub) => {
|
|
64
|
+
if (!idSet && !contentSub) return false;
|
|
65
|
+
if (idSet && !idSet.has(`${VNEXT_STATE_ID_PREFIX}${state.id}`)) return false;
|
|
66
|
+
if (contentSub && !state.text.toLowerCase().includes(contentSub)) return false;
|
|
67
|
+
return true;
|
|
68
|
+
};
|
|
42
69
|
function hasExplicitDeleteFilters(filters) {
|
|
43
70
|
return Boolean(
|
|
44
71
|
filters.ids && filters.ids.length > 0 || typeof filters.contentSubstring === "string" && filters.contentSubstring.trim().length > 0 || filters.tags && filters.tags.length > 0 || typeof filters.sourceDialogId === "string" && filters.sourceDialogId.trim().length > 0 || typeof filters.patternKeyPrefix === "string" && filters.patternKeyPrefix.trim().length > 0 || filters.facets && filters.facets.length > 0 || typeof filters.subjectId === "string" && filters.subjectId.trim().length > 0
|
|
@@ -127,8 +154,32 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
|
|
|
127
154
|
matchedItems.push(item);
|
|
128
155
|
if (matchedItems.length >= limit) break;
|
|
129
156
|
}
|
|
157
|
+
const idSet = normalizeSet(filters.ids);
|
|
158
|
+
const contentSub = asTrimmedString(filters.contentSubstring).toLowerCase();
|
|
159
|
+
const vnextStateIdsToRetire = [];
|
|
160
|
+
const vnextStatesToRetire = [];
|
|
161
|
+
const vnextMatchedItems = [];
|
|
162
|
+
let vnextPrincipalId = null;
|
|
163
|
+
const hasScopingFilters = Boolean(
|
|
164
|
+
normalizeSet(filters.kinds) || normalizeSet(filters.facets) || normalizeSet(filters.tags) || asTrimmedString(filters.subjectType) || asTrimmedString(filters.subjectId) || asTrimmedString(filters.patternKeyPrefix) || asTrimmedString(filters.sourceDialogId)
|
|
165
|
+
);
|
|
166
|
+
const canMatchVNext = !hasScopingFilters && (contentSub.length > 0 || idSet !== null && [...idSet].some((id) => id.startsWith(VNEXT_STATE_ID_PREFIX)));
|
|
167
|
+
if (canMatchVNext) {
|
|
168
|
+
vnextPrincipalId = `${owner.ownerType}:${encodeURIComponent(owner.ownerId)}`;
|
|
169
|
+
const catalog = await loadMemoryVNextCatalog(db, vnextPrincipalId);
|
|
170
|
+
for (const state of catalog.states) {
|
|
171
|
+
if (matchedItems.length >= limit) break;
|
|
172
|
+
if (state.retiredAt) continue;
|
|
173
|
+
if (!matchesVNextFilters(state, idSet, contentSub)) continue;
|
|
174
|
+
vnextStateIdsToRetire.push(state.id);
|
|
175
|
+
vnextStatesToRetire.push(state);
|
|
176
|
+
const projected = toVNextMemoryItem(state, owner);
|
|
177
|
+
vnextMatchedItems.push(projected);
|
|
178
|
+
matchedItems.push(projected);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
130
181
|
if (matchedItems.length === 0) {
|
|
131
|
-
return { deletedCount: 0, deletedIds: [], matchedItems: [] };
|
|
182
|
+
return { deletedCount: 0, deletedIds: [], retiredIds: [], matchedItems: [] };
|
|
132
183
|
}
|
|
133
184
|
const token = generateMemoryDeletionToken(
|
|
134
185
|
owner.ownerId,
|
|
@@ -138,6 +189,7 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
|
|
|
138
189
|
return {
|
|
139
190
|
deletedCount: 0,
|
|
140
191
|
deletedIds: [],
|
|
192
|
+
retiredIds: [],
|
|
141
193
|
matchedItems,
|
|
142
194
|
deletionToken: token
|
|
143
195
|
};
|
|
@@ -147,14 +199,28 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
|
|
|
147
199
|
"deletionToken mismatch: memory dataset changed since preview; please rerun dry-run preview before confirming."
|
|
148
200
|
);
|
|
149
201
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
202
|
+
const vnextMatchedIdSet = new Set(
|
|
203
|
+
vnextStateIdsToRetire.map((stateId) => `${VNEXT_STATE_ID_PREFIX}${stateId}`)
|
|
204
|
+
);
|
|
205
|
+
const legacyItems = matchedItems.filter((item) => !vnextMatchedIdSet.has(item.id));
|
|
206
|
+
const shouldRetireVNext = vnextStatesToRetire.length > 0;
|
|
207
|
+
if (legacyItems.length > 0 || shouldRetireVNext) {
|
|
208
|
+
const batch = db.batch();
|
|
209
|
+
for (const item of legacyItems) {
|
|
210
|
+
deleteMemoryItemWithIndexesInBatch(batch, item);
|
|
211
|
+
}
|
|
212
|
+
if (shouldRetireVNext) {
|
|
213
|
+
const nowIso = (/* @__PURE__ */ new Date()).toISOString();
|
|
214
|
+
for (const state of vnextStatesToRetire) {
|
|
215
|
+
_appendRetiredStateBatch(batch, { ...state, retiredAt: nowIso });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
await batch.write();
|
|
153
219
|
}
|
|
154
|
-
await batch.write();
|
|
155
220
|
return {
|
|
156
221
|
deletedCount: matchedItems.length,
|
|
157
222
|
deletedIds: matchedItems.map((item) => item.id),
|
|
223
|
+
retiredIds: vnextMatchedItems.map((item) => item.id),
|
|
158
224
|
matchedItems,
|
|
159
225
|
deletionToken: token
|
|
160
226
|
};
|
|
@@ -21,7 +21,7 @@ var BUILTIN_SUMMARY_LLM_CONFIG = {
|
|
|
21
21
|
model: "mimo-v2.6-flash",
|
|
22
22
|
// @deprecated 用 COMPACTION_SUMMARY_SYSTEM_PROMPT(packages/ai/context/compactionShared.ts)。
|
|
23
23
|
// 生产代码已全部迁移;此旧两段式 prompt 仅被 scripts/probes/dialog 探针脚本使用,待探针迁移后删除。
|
|
24
|
-
prompt: "\u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u52A9\u7406\u3002\u8BF7\u57FA\u4E8E\u3010\u73B0\u6709\u8BB0\u5FC6\u3011\u548C\u3010\u65B0\u589E\u5BF9\u8BDD\u3011\uFF0C\u8F93\u51FA\u4E00\u4EFD\u66F4\u65B0\u540E\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u6863\u6848\u3002\u4E25\u683C\u53EA\u8F93\u51FA\u4E0B\u9762\u4E24\u90E8\u5206\uFF0C\u6807\u9898\u5FC5\u987B\u5B8C\u5168\u4E00\u81F4\uFF1A\n\u5173\u952E\u4E8B\u5B9E\u6863\u6848\n- ...\n\u5BF9\u8BDD\u5267\u60C5\u6458\u8981\n- ...\n\u8981\u6C42\uFF1A1) \u4F7F\u7528\u5BF9\u8BDD\u4E3B\u8BED\u8A00\uFF1B\u6DF7\u5408\u8BED\u8A00\u65F6\u4F18\u5148\u8DDF\u968F\u7528\u6237\u4E3B\u8981\u8BED\u8A00\uFF0C\u4E13\u6709\u540D\u8BCD\u4FDD\u7559\u539F\u6587\u30022) \u5173\u952E\u4E8B\u5B9E\u6863\u6848\u53EA\u4FDD\u7559\u4E4B\u540E\u7EE7\u7EED\u5BF9\u8BDD\u4ECD\u6709\u4EF7\u503C\u7684\u4FE1\u606F\uFF0C\u4F8B\u5982\u7528\u6237\u504F\u597D\u3001\u76EE\u6807\u3001\u7EA6\u675F\u3001\u6280\u672F\u6808\u3001\u786E\u5B9A\u7684\u6587\u4EF6\u540D/\u53D8\u91CF\u540D\u3001\u6838\u5FC3\u51B3\u7B56\u3001\u5F85\u529E\u4E8B\u9879\u30023) \u5BF9\u8BDD\u5267\u60C5\u6458\u8981\u5148\u6781\u7B80\u6982\u62EC\u65E7\u4E0A\u4E0B\u6587\uFF0C\u518D\u66F4\u8BE6\u7EC6\u8BB0\u5F55\u6700\u8FD1\u65B0\u589E\u7684\u8FDB\u5C55\u3001\u5206\u6B67\u3001\u7ED3\u8BBA\u548C\u4E0B\u4E00\u6B65\u30024) \u5FFD\u7565\u5BD2\u6684\u3001\u91CD\u590D\u5C1D\u8BD5\
|
|
24
|
+
prompt: "\u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u52A9\u7406\u3002\u8BF7\u57FA\u4E8E\u3010\u73B0\u6709\u8BB0\u5FC6\u3011\u548C\u3010\u65B0\u589E\u5BF9\u8BDD\u3011\uFF0C\u8F93\u51FA\u4E00\u4EFD\u66F4\u65B0\u540E\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u6863\u6848\u3002\u4E25\u683C\u53EA\u8F93\u51FA\u4E0B\u9762\u4E24\u90E8\u5206\uFF0C\u6807\u9898\u5FC5\u987B\u5B8C\u5168\u4E00\u81F4\uFF1A\n\u5173\u952E\u4E8B\u5B9E\u6863\u6848\n- ...\n\u5BF9\u8BDD\u5267\u60C5\u6458\u8981\n- ...\n\u8981\u6C42\uFF1A1) \u4F7F\u7528\u5BF9\u8BDD\u4E3B\u8BED\u8A00\uFF1B\u6DF7\u5408\u8BED\u8A00\u65F6\u4F18\u5148\u8DDF\u968F\u7528\u6237\u4E3B\u8981\u8BED\u8A00\uFF0C\u4E13\u6709\u540D\u8BCD\u4FDD\u7559\u539F\u6587\u30022) \u5173\u952E\u4E8B\u5B9E\u6863\u6848\u53EA\u4FDD\u7559\u4E4B\u540E\u7EE7\u7EED\u5BF9\u8BDD\u4ECD\u6709\u4EF7\u503C\u7684\u4FE1\u606F\uFF0C\u4F8B\u5982\u7528\u6237\u504F\u597D\u3001\u76EE\u6807\u3001\u7EA6\u675F\u3001\u6280\u672F\u6808\u3001\u786E\u5B9A\u7684\u6587\u4EF6\u540D/\u53D8\u91CF\u540D\u3001\u6838\u5FC3\u51B3\u7B56\u3001\u5F85\u529E\u4E8B\u9879\u3002\u5176\u4E2D\u5FC5\u987B\u5148\u5199\u300C\u539F\u59CB\u76EE\u6807\u300D\uFF08\u7528\u6237\u6700\u521D\u4E3A\u4EC0\u4E48\u5F00\u8FD9\u6BB5\u5BF9\u8BDD\uFF0C\u5C3D\u91CF\u4FDD\u7559\u539F\u8BDD\uFF1B\u589E\u91CF\u66F4\u65B0\u65F6\u6CBF\u7528\u5DF2\u6709\u539F\u6587\uFF0C\u4E0D\u8981\u88AB\u65B0\u589E\u5BF9\u8BDD\u6539\u5199\uFF1B\u4EC5\u5F53\u65B0\u5BF9\u8BDD\u660E\u786E\u8868\u660E\u539F\u6587\u6709\u4E8B\u5B9E\u6027\u9519\u8BEF\u65F6\u624D\u4FEE\u6B63\uFF0C\u5E76\u5728\u300C\u76EE\u6807\u6F14\u5316\u300D\u91CC\u6CE8\u660E\uFF09\u4E0E\u300C\u76EE\u6807\u6F14\u5316\u300D\uFF08\u4E2D\u9014\u8F6C\u5411\u4E86\u4EC0\u4E48\u3001\u56E0\u4E3A\u4EC0\u4E48\uFF1B\u6CA1\u6709\u8F6C\u5411\u5C31\u5199\u300C\u65E0\u8F6C\u5411\u300D\u6216\u7701\u7565\uFF09\u2014\u2014\u88AB\u53D6\u4EE3\u7684\u662F\u65B9\u6848\uFF0C\u4E0D\u662F\u7528\u6237\u7684\u521D\u59CB\u610F\u56FE\uFF0C\u521D\u59CB\u610F\u56FE\u4E0D\u5F97\u7701\u7565\u30023) \u5BF9\u8BDD\u5267\u60C5\u6458\u8981\u5148\u6781\u7B80\u6982\u62EC\u65E7\u4E0A\u4E0B\u6587\uFF0C\u518D\u66F4\u8BE6\u7EC6\u8BB0\u5F55\u6700\u8FD1\u65B0\u589E\u7684\u8FDB\u5C55\u3001\u5206\u6B67\u3001\u7ED3\u8BBA\u548C\u4E0B\u4E00\u6B65\u30024) \u5FFD\u7565\u5BD2\u6684\u3001\u91CD\u590D\u5C1D\u8BD5\u548C\u65E0\u4EF7\u503C\u5E9F\u8BDD\uFF1B\u5DF2\u653E\u5F03\u7684\u65B9\u6848/\u5C1D\u8BD5\u53EF\u7701\u7565\uFF0C\u4F46\u7528\u6237\u5F53\u521D\u7684\u610F\u56FE\u4E0E\u7406\u7531\u4E0D\u53EF\u7701\u7565\uFF08\u89C1\u7B2C 2 \u6761\uFF09\u30025) \u4E0D\u8981\u7F16\u9020\u672A\u51FA\u73B0\u7684\u4FE1\u606F\uFF0C\u4E0D\u8981\u8F93\u51FA\u5F00\u573A\u767D\u3001\u7ED3\u675F\u8BED\u3001markdown \u4EE3\u7801\u5757\u6216\u989D\u5916\u7AE0\u8282\u3002"
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getModelConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GU7DC2TD.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlatformHostedDeepseekModel,
|
|
6
6
|
isPlatformHostedOpenAIImageModel,
|
|
7
7
|
resolvePlatformHostedRouting
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IYIXAIEB.js";
|
|
9
9
|
import {
|
|
10
10
|
asTrimmedLowercaseString
|
|
11
11
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -43,18 +43,22 @@ function isOpenAiResponsesModel(args) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
if (provider === "deepseek" || provider === "nolo" || provider === "ollama-cloud") {
|
|
46
|
+
const hostedRoute = resolvePlatformHostedRouting(args.model);
|
|
47
|
+
if (hostedRoute) return hostedRoute.wire === "responses";
|
|
46
48
|
if (isPlatformHostedDeepseekModel(args.model)) return true;
|
|
47
49
|
if (isPlatformHostedOpenAIImageModel(args.model)) return true;
|
|
48
50
|
}
|
|
49
51
|
return false;
|
|
50
52
|
}
|
|
53
|
+
var PLATFORM_HOSTED_RESPONSES_GATEWAY_MARKER = "nolo-platform-gateway://responses";
|
|
54
|
+
var CLOUDFLARE_ACCOUNT_ID_PLACEHOLDER = "{account}";
|
|
51
55
|
function resolvePlatformResponsesEndpoint(provider, model) {
|
|
52
56
|
const normalized = asTrimmedLowercaseString(provider);
|
|
53
57
|
if (normalized === "openai") return OPENAI_RESPONSES_ENDPOINT;
|
|
54
58
|
if (normalized === "deepseek" || normalized === "nolo" || normalized === "ollama-cloud") {
|
|
55
59
|
const route = resolvePlatformHostedRouting(model);
|
|
56
60
|
if (route && route.wire === "responses") {
|
|
57
|
-
return route.endpoint;
|
|
61
|
+
return route.endpoint.includes(CLOUDFLARE_ACCOUNT_ID_PLACEHOLDER) ? PLATFORM_HOSTED_RESPONSES_GATEWAY_MARKER : route.endpoint;
|
|
58
62
|
}
|
|
59
63
|
if (!model || isPlatformHostedDeepseekModel(model)) {
|
|
60
64
|
return DEEPSEEK_RESPONSES_ENDPOINT;
|
|
@@ -72,7 +76,7 @@ function resolvePlatformChatCompletionsEndpoint(provider, model) {
|
|
|
72
76
|
const aliased = PLATFORM_PROVIDER_ENDPOINT_ALIASES[key] ?? key;
|
|
73
77
|
if (aliased === "nolo") {
|
|
74
78
|
const route = resolvePlatformHostedRouting(model);
|
|
75
|
-
if (route && route.wire
|
|
79
|
+
if (route && route.wire === "chat.completions") {
|
|
76
80
|
return route.endpoint;
|
|
77
81
|
}
|
|
78
82
|
return void 0;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compactWhitespace
|
|
3
|
+
} from "./chunk-DWLEOOGR.js";
|
|
4
|
+
|
|
5
|
+
// packages/core/clipCompactText.ts
|
|
6
|
+
function clipCompactText(value, max, ellipsis = "...") {
|
|
7
|
+
const compact = compactWhitespace(value);
|
|
8
|
+
if (compact.length <= max) return compact;
|
|
9
|
+
if (max <= ellipsis.length) return compact.slice(0, max);
|
|
10
|
+
return `${compact.slice(0, max - ellipsis.length)}${ellipsis}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
clipCompactText
|
|
15
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dialogMessageRange
|
|
3
|
-
} from "./chunk-VMFTFOWF.js";
|
|
4
1
|
import {
|
|
5
2
|
isTombstoneRecord
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D2MDMY2M.js";
|
|
7
4
|
import {
|
|
8
5
|
isRecord
|
|
9
6
|
} from "./chunk-KUG52IAP.js";
|
|
7
|
+
import {
|
|
8
|
+
dialogMessageRange
|
|
9
|
+
} from "./chunk-OKGVNZTL.js";
|
|
10
10
|
|
|
11
11
|
// packages/chat/messages/fetchMessages.ts
|
|
12
12
|
function isUnboundedMessageLimit(limit) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
mergeAvailabilityDeadline
|
|
3
|
-
|
|
2
|
+
mergeAvailabilityDeadline,
|
|
3
|
+
resolveCredentialKeyWithFallback
|
|
4
|
+
} from "./chunk-H6A6X4EK.js";
|
|
4
5
|
|
|
5
|
-
// packages/
|
|
6
|
+
// packages/agent-runtime/credentialAvailability.ts
|
|
6
7
|
import { homedir } from "node:os";
|
|
7
8
|
import { join } from "node:path";
|
|
8
9
|
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
@@ -13,36 +14,6 @@ function resolveNoloHome(env = process.env) {
|
|
|
13
14
|
function resolveCredentialAvailabilityPath(env = process.env) {
|
|
14
15
|
return join(resolveNoloHome(env), FILE_NAME);
|
|
15
16
|
}
|
|
16
|
-
function resolveCredentialKey(agent) {
|
|
17
|
-
if (!agent || typeof agent !== "object") return void 0;
|
|
18
|
-
for (const field of ["apiKeyRef", "credentialRef"]) {
|
|
19
|
-
const value = agent[field];
|
|
20
|
-
if (typeof value === "string") {
|
|
21
|
-
const trimmed = value.trim();
|
|
22
|
-
if (trimmed) return trimmed;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return void 0;
|
|
26
|
-
}
|
|
27
|
-
function resolveCredentialKeyWithFallback(agent) {
|
|
28
|
-
const byRef = resolveCredentialKey(agent);
|
|
29
|
-
if (byRef) return byRef;
|
|
30
|
-
if (!agent || typeof agent !== "object") return void 0;
|
|
31
|
-
const endpoint = agent.customProviderUrl;
|
|
32
|
-
if (typeof endpoint === "string") {
|
|
33
|
-
const trimmed = endpoint.trim();
|
|
34
|
-
if (trimmed) {
|
|
35
|
-
try {
|
|
36
|
-
const origin = new URL(trimmed).origin;
|
|
37
|
-
if (origin && origin !== "null") return `custom-endpoint:${origin}`;
|
|
38
|
-
} catch {
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const key = agent.key;
|
|
43
|
-
if (typeof key === "string" && key.trim()) return `custom-agent:${key.trim()}`;
|
|
44
|
-
return void 0;
|
|
45
|
-
}
|
|
46
17
|
function parseFile(raw) {
|
|
47
18
|
const parsed = JSON.parse(raw);
|
|
48
19
|
if (!parsed || typeof parsed !== "object") return { entries: {} };
|
|
@@ -155,7 +126,6 @@ function applyCredentialAvailability(agents, credentialAvailability) {
|
|
|
155
126
|
}
|
|
156
127
|
|
|
157
128
|
export {
|
|
158
|
-
resolveCredentialKeyWithFallback,
|
|
159
129
|
readCredentialAvailability,
|
|
160
130
|
readCredentialEntry,
|
|
161
131
|
markCredentialUnavailable,
|