nolo-cli 0.103.0-alpha.2 → 0.103.0
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-3UCNJCQA.js → _executeModel-7J7Q3WXY.js} +75 -68
- package/action-C4KMTCJF.js +20 -0
- package/{addContentAction-O7R66HEX.js → addContentAction-7TNIOVZI.js} +12 -11
- package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-O47J3MVW.js} +18 -19
- package/{agentDeleteCommand-2YAHAZFJ.js → agentDeleteCommand-YPJHK7JA.js} +117 -42
- package/{agentEmailCommands-WLYF3JRS.js → agentEmailCommands-AWEXOHWM.js} +98 -88
- package/agentListCommands-2DTLLJZD.js +742 -0
- package/{agentMachineCommands-HNGAR5GI.js → agentMachineCommands-PGEEQ4JJ.js} +48 -43
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-XPJYZSCE.js} +97 -2
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
- package/agentRecordCommands-DZVLCPLJ.js +138 -0
- package/agentRunCommand-AX5CYQ46.js +167 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
- package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-PITRQ2EU.js} +48 -39
- package/{agentSlice-SICQBMCM.js → agentSlice-4TLSG6FB.js} +14 -13
- package/{appDeleteCommands-32MHLR4L.js → appDeleteCommands-UC2JW5FJ.js} +46 -41
- package/{appDeployCommands-WCQOUSOB.js → appDeployCommands-OL2RKVJ3.js} +46 -41
- package/{appDeployStatusCommands-6QKB7DYN.js → appDeployStatusCommands-B3PLC62M.js} +46 -41
- package/{appGetCommands-SFAPP5PB.js → appGetCommands-REESA2XQ.js} +46 -41
- package/{appListCommands-EKUBDRUO.js → appListCommands-UF6XX7HR.js} +46 -41
- package/{authCommand-F4EFRRX6.js → authCommand-NQPMGYHP.js} +118 -24
- package/{authCommands-RGOGCPP6.js → authCommands-LWLOZETU.js} +7 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-GFY77VRN.js} +10 -8
- package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
- package/{chunk-UKZDAFYT.js → chunk-22RVE2PC.js} +6 -10
- package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
- package/{chunk-HVURBGF3.js → chunk-2H6SEVDS.js} +6 -6
- package/{chunk-TOP2VXOR.js → chunk-2K4TM6AW.js} +5 -5
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
- package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
- package/chunk-4A2R7KHG.js +13545 -0
- package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
- package/{chunk-JRQFUXY7.js → chunk-4G4C5SXT.js} +99 -22
- package/{chunk-DHDMC6FO.js → chunk-4HTMUQIZ.js} +14 -9
- package/{chunk-B3TVQ6PI.js → chunk-4IVA6UUE.js} +20 -11
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-H62HCIUP.js → chunk-56HJ2LAA.js} +35 -22
- package/{chunk-V4MJDUSR.js → chunk-5EPHWMP5.js} +2 -2
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- package/{chunk-3WLK2JQ5.js → chunk-5IWONK6X.js} +68 -46
- package/chunk-5J3PYNUP.js +255 -0
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-LW4VFPAY.js → chunk-5ZDLVKNG.js} +873 -228
- package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-AEOE4Z6Q.js → chunk-6UEJDFF7.js} +39 -15
- package/{chunk-JPGCXHNM.js → chunk-7JWCVINR.js} +1 -1
- package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
- package/{chunk-IIVGDG4I.js → chunk-7KWFIKKK.js} +13 -7
- package/chunk-A4SQRTZ6.js +15 -0
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
- package/{chunk-L5UXH3B2.js → chunk-B455PEFD.js} +27 -8
- package/{chunk-XS5SWEDQ.js → chunk-BELZY72F.js} +1 -1
- package/chunk-BMQ2MJUK.js +153 -0
- package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-3BMYXEUW.js → chunk-CUF4MYKI.js} +1 -1
- package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
- package/{chunk-WV42OMV7.js → chunk-D2GQE6AF.js} +8 -8
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/chunk-DZ7R5V3Y.js +164 -0
- package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
- package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
- package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-AGVEIAQA.js → chunk-F442UK5V.js} +29 -78
- package/{chunk-HJUYAD4A.js → chunk-FBTNYNAL.js} +5 -5
- package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
- package/{chunk-ETI2NYVF.js → chunk-GCTKWVLU.js} +4 -4
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
- package/{chunk-6VFARHZW.js → chunk-H7TQORR4.js} +994 -1079
- package/{chunk-5H7KJX7J.js → chunk-HD3S2F7U.js} +5 -5
- package/chunk-HDJRLWTG.js +8002 -0
- package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
- package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
- package/{chunk-4OEFYTWL.js → chunk-IRZTHHNM.js} +67 -48
- package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
- package/{chunk-OZGZPSEG.js → chunk-KGRP4VOK.js} +47 -67
- package/{chunk-DNCEALKX.js → chunk-LB5A6JTU.js} +22 -29
- package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
- package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
- package/{chunk-Z77CRGTW.js → chunk-MSFZ7FMO.js} +1 -1
- package/chunk-NKWIS6G2.js +442 -0
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.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-OCZKATRC.js +129 -0
- package/{chunk-PQFHGD77.js → chunk-OM2RUOEU.js} +161 -14
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-TQBHNYVR.js → chunk-PLRFCQ7C.js} +567 -519
- package/{chunk-6D6VBVEW.js → chunk-Q7O72MF5.js} +80 -14
- package/{chunk-J4MOO56S.js → chunk-RILRSUGC.js} +10 -2
- package/{chunk-RSONHHPE.js → chunk-RNUDNZJW.js} +10 -10
- package/{chunk-3N3W7KBB.js → chunk-RZJAZVCF.js} +11 -9
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/{chunk-GEPUP7OO.js → chunk-TSXNDTXL.js} +3 -3
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
- package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/{chunk-BP4XNZRM.js → chunk-UNAOTLKO.js} +4 -4
- package/{chunk-CUQEXCAU.js → chunk-UQ5P2WHS.js} +29 -9
- package/{chunk-NA35QHCF.js → chunk-V6YASAZR.js} +1 -1
- package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-ZCYXJSTU.js → chunk-VL3H5ZU3.js} +66 -94
- package/{chunk-Q554LLSI.js → chunk-VLGL7FOL.js} +1 -1
- package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
- package/{chunk-4EG4QFTK.js → chunk-WI6TUGLJ.js} +19 -17
- package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
- package/{chunk-OEVAY4J6.js → chunk-XMUZHRSB.js} +18 -20
- package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
- package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
- package/{chunk-7S4YWN7P.js → chunk-YDO5ERB4.js} +4 -4
- package/chunk-YK5MHOWM.js +915 -0
- package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
- package/chunk-YV25TM3R.js +780 -0
- package/{chunk-IONPPCL5.js → chunk-YZZREBID.js} +86 -16
- package/{chunk-DNUUJ45N.js → chunk-Z3WSAK6A.js} +23 -28
- package/chunk-ZRAU6T47.js +56 -0
- package/commandRegistry-VQPFWVDH.js +833 -0
- package/{contentThunks-S4S7QPSO.js → contentThunks-A26ME6OJ.js} +37 -35
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-ODGL2YGP.js → createAgentAutomationAction-BSAMZJ5W.js} +39 -37
- package/createDialogAction-CMCQXYHD.js +69 -0
- package/{createPageAction-FBV3OWX7.js → createPageAction-ANGKJTK2.js} +46 -43
- package/{chunk-F2RNI7ZR.js → cursorProvider-YGGNMVWX.js} +2496 -9897
- package/{dbSlice-XVWBAGYN.js → dbSlice-QOLNF5GN.js} +11 -10
- package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
- package/{dialogCommands-5J56DFWN.js → dialogCommands-AMPAWLX4.js} +49 -45
- package/{dialogSlice-LEO27SQG.js → dialogSlice-DGWDEBYC.js} +41 -34
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-KYI2DC2U.js → docCreateCommands-7NMIYL5D.js} +48 -43
- package/{docDeleteCommands-67REUSRY.js → docDeleteCommands-BD4OM5PV.js} +49 -44
- package/{docReadCommands-HOSVSBDJ.js → docReadCommands-5IOVAKU2.js} +47 -42
- package/{docStore-MNX5MHA5.js → docStore-TP4QDER4.js} +16 -12
- package/{docUpdateCommands-EMGCSMXY.js → docUpdateCommands-ZTKJ6UPC.js} +48 -43
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-5L7OVM5Y.js} +5 -5
- package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
- package/{handleSendMessageAction-YB6KQFJS.js → handleSendMessageAction-N4WKFRSQ.js} +111 -87
- package/index.js +87 -884
- package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-O5A26FDK.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
- package/{machineCommands-7GVQCUAK.js → machineCommands-47WKGY5Z.js} +92 -82
- package/machineWsRunDispatch-CYW5FJ52.js +154 -0
- package/{memberThunks-QGFLFVCI.js → memberThunks-25K6DDRA.js} +20 -18
- package/{models-T3SG6MJ5.js → models-ZPU5EDF4.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-TEBH7FDX.js} +7 -7
- package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
- package/{read-COE3ZYR6.js → read-PJIT2YEJ.js} +7 -6
- package/{readDocTool-5USN4A6V.js → readDocTool-DRSXHGNL.js} +5 -3
- package/{readlineWorkspace-WA7JNI6J.js → readlineWorkspace-CK7GOVOC.js} +2698 -2055
- package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-VIWJL6MX.js} +21 -25
- package/{runAgentClientLoop-JGFQ6KIR.js → runAgentClientLoop-BGHGP5AR.js} +76 -70
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-A7VA3NFM.js} +15 -13
- package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-B4P7YQX2.js} +22 -26
- package/{chunk-AFUORTY4.js → settingThunks-KOYSAT65.js} +226 -940
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-NKJVJCQQ.js → spaceCommands-QJCYG27F.js} +51 -46
- package/{streamAgentChatTurn-XLFZ66UC.js → streamAgentChatTurn-ANE7OTCZ.js} +214 -108
- package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-3VYWHZKH.js} +18 -19
- package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
- package/tools-WPOVVP7M.js +116 -0
- package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-QCHCULPM.js} +25 -22
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-6MBTD4UE.js → updateDialogTitleAction-C4GRCXL4.js} +82 -44
- package/action-YVYQEAAV.js +0 -31
- package/agentListCommands-JP7S7PT2.js +0 -469
- package/agentRecordCommands-SXFPW3DL.js +0 -128
- package/agentRunCommand-JIQ4HY4D.js +0 -155
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-HHMUDNXL.js +0 -186
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/chunk-XVZ22N6C.js +0 -20782
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/createDialogAction-GFKRXTK4.js +0 -65
- package/machineWsRunDispatch-XA7TD7Z7.js +0 -144
- package/settingSlice-ZQZVUPKK.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-NF5AB34X.js +0 -110
- package/{chunk-VMFTFOWF.js → chunk-ODAPITXL.js} +7 -7
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listUserRecordsFromServers,
|
|
3
3
|
readLiveDbRecordAfterTombstoneMerge
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TSXNDTXL.js";
|
|
5
5
|
import {
|
|
6
6
|
agentRecordHasConfiguredCredential
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6UEJDFF7.js";
|
|
8
8
|
import {
|
|
9
|
-
deriveCredentialGroup
|
|
10
|
-
|
|
11
|
-
} from "./chunk-PQFHGD77.js";
|
|
9
|
+
deriveCredentialGroup
|
|
10
|
+
} from "./chunk-OM2RUOEU.js";
|
|
12
11
|
import {
|
|
13
12
|
PUBLIC_AGENT_KEY_PREFIX,
|
|
14
|
-
isOwnedAgentKey,
|
|
15
13
|
ownedAgentKey,
|
|
16
14
|
ownedAgentKeyPrefix,
|
|
17
15
|
parseOwnedAgentId,
|
|
@@ -53,6 +51,9 @@ function normalizeListedAgent(record) {
|
|
|
53
51
|
...typeof record?.handle === "string" && record.handle ? { handle: record.handle } : {},
|
|
54
52
|
...typeof record?.introduction === "string" && record.introduction ? { introduction: record.introduction } : typeof record?.description === "string" && record.description ? { introduction: record.description } : {},
|
|
55
53
|
...typeof record?.provider === "string" && record.provider ? { provider: record.provider } : {},
|
|
54
|
+
// 仅供 resolveBillingSource 判定订阅端点(Step Plan / OpenCode Go 等),
|
|
55
|
+
// safe 投影不输出它。缺了它本地 agent list 会把订阅端点全报成 user_api。
|
|
56
|
+
...typeof record?.customProviderUrl === "string" && record.customProviderUrl ? { customProviderUrl: record.customProviderUrl } : {},
|
|
56
57
|
...typeof record?.inputPrice === "number" && Number.isFinite(record.inputPrice) ? { inputPrice: record.inputPrice } : {},
|
|
57
58
|
...typeof record?.outputPrice === "number" && Number.isFinite(record.outputPrice) ? { outputPrice: record.outputPrice } : {},
|
|
58
59
|
updatedAt: typeof record?.updatedAt === "string" || typeof record?.updatedAt === "number" ? record.updatedAt : typeof record?.createdAt === "string" || typeof record?.createdAt === "number" ? record.createdAt : typeof record?.created === "string" || typeof record?.created === "number" ? record.created : null,
|
|
@@ -71,13 +72,6 @@ function normalizeListedAgent(record) {
|
|
|
71
72
|
...record?.quota && typeof record.quota === "object" && Array.isArray(record.quota.windows) ? { quota: record.quota } : {}
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
|
-
function toSafeListedAgentSummary(agent, options) {
|
|
75
|
-
const summary = toSafeAgentSummary(agent, options);
|
|
76
|
-
if (agent.publicRecordExists === false) {
|
|
77
|
-
delete summary.publicKey;
|
|
78
|
-
}
|
|
79
|
-
return summary;
|
|
80
|
-
}
|
|
81
75
|
function sortListedAgents(agents) {
|
|
82
76
|
agents.sort((a, b) => {
|
|
83
77
|
const ta = a.updatedAt == null ? 0 : new Date(a.updatedAt).getTime();
|
|
@@ -98,6 +92,7 @@ function parseAgentListArgs(args) {
|
|
|
98
92
|
publicOnly: args.includes("--public-only"),
|
|
99
93
|
idsOnly: args.includes("--ids-only"),
|
|
100
94
|
scope: readArgValue(args, "--scope"),
|
|
95
|
+
query: readArgValue(args, "--query"),
|
|
101
96
|
showUnavailable: args.includes("--show-unavailable"),
|
|
102
97
|
// --safe 默认输出精简投影(与 server listAgents 一致,防大列表被截断);
|
|
103
98
|
// --verbose 拿回完整字段集排障。
|
|
@@ -111,7 +106,7 @@ async function listLocalCachedAgents(args) {
|
|
|
111
106
|
for (const prefix of [ownedPrefix, PUBLIC_AGENT_KEY_PREFIX]) {
|
|
112
107
|
for await (const [key, value] of args.db.iterator({ gte: prefix, lte: `${prefix}\uFFFF` })) {
|
|
113
108
|
if (typeof key !== "string" || !value || typeof value !== "object") continue;
|
|
114
|
-
if (
|
|
109
|
+
if (key.startsWith(ownedPrefix)) {
|
|
115
110
|
privateRecords.set(key, { ...value, dbKey: key });
|
|
116
111
|
continue;
|
|
117
112
|
}
|
|
@@ -238,14 +233,89 @@ async function decorateAgentsWithPublicStatusAcrossServers(args) {
|
|
|
238
233
|
return args.agents;
|
|
239
234
|
}
|
|
240
235
|
|
|
236
|
+
// packages/ai/agent/quotaSnapshot.ts
|
|
237
|
+
function findTightestQuotaWindow(quota, now = Date.now()) {
|
|
238
|
+
if (!quota || !Array.isArray(quota.windows) || quota.windows.length === 0) {
|
|
239
|
+
return void 0;
|
|
240
|
+
}
|
|
241
|
+
let best;
|
|
242
|
+
let bestScore = -Infinity;
|
|
243
|
+
for (const w of quota.windows) {
|
|
244
|
+
let score = 0;
|
|
245
|
+
if (typeof w.utilization === "number" && w.utilization >= 0) {
|
|
246
|
+
score = 500 + Math.min(w.utilization, 1) * 500;
|
|
247
|
+
} else if (typeof w.remaining === "number" && typeof w.limit === "number" && w.limit > 0) {
|
|
248
|
+
const util = Math.max(0, 1 - w.remaining / w.limit);
|
|
249
|
+
score = 500 + util * 500;
|
|
250
|
+
} else if (typeof w.resetAt === "number" && w.resetAt > now) {
|
|
251
|
+
score = 200;
|
|
252
|
+
} else if (typeof w.remaining === "number") {
|
|
253
|
+
score = 100;
|
|
254
|
+
}
|
|
255
|
+
if (score > bestScore) {
|
|
256
|
+
bestScore = score;
|
|
257
|
+
best = w;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return best ?? quota.windows[0];
|
|
261
|
+
}
|
|
262
|
+
function formatQuotaSummary(quota, now = Date.now(), options) {
|
|
263
|
+
const compact = options?.compact === true;
|
|
264
|
+
const planText = formatPlanLabel(quota?.plan);
|
|
265
|
+
const planName = typeof quota?.plan?.name === "string" ? quota.plan.name.trim() : "";
|
|
266
|
+
const tightest = findTightestQuotaWindow(quota, now);
|
|
267
|
+
if (!tightest) return compact ? planName || void 0 : planText;
|
|
268
|
+
const parts = [];
|
|
269
|
+
if (typeof tightest.utilization === "number") {
|
|
270
|
+
const pct = Math.round(tightest.utilization * 100);
|
|
271
|
+
parts.push(`${pct}%\u5DF2\u7528`);
|
|
272
|
+
} else if (typeof tightest.remaining === "number") {
|
|
273
|
+
if (typeof tightest.limit === "number") {
|
|
274
|
+
parts.push(`${tightest.remaining}/${tightest.limit}${tightest.unit ? ` ${tightest.unit}` : ""}`);
|
|
275
|
+
} else {
|
|
276
|
+
parts.push(`\u4F59${tightest.remaining}${tightest.unit ? ` ${tightest.unit}` : ""}`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (compact) {
|
|
280
|
+
const head = parts.length > 0 ? parts[0] : void 0;
|
|
281
|
+
return [planName || void 0, head].filter(Boolean).join(" \xB7 ") || void 0;
|
|
282
|
+
}
|
|
283
|
+
if (tightest.scope && tightest.scope !== "user" && tightest.scope !== "project" && tightest.scope !== tightest.unit) {
|
|
284
|
+
parts.push(tightest.scope);
|
|
285
|
+
}
|
|
286
|
+
if (typeof tightest.resetAt === "number" && tightest.resetAt > now) {
|
|
287
|
+
const diffSec = Math.round((tightest.resetAt - now) / 1e3);
|
|
288
|
+
if (diffSec < 60) {
|
|
289
|
+
parts.push(`${diffSec}s\u540E\u91CD\u7F6E`);
|
|
290
|
+
} else if (diffSec < 3600) {
|
|
291
|
+
parts.push(`${Math.round(diffSec / 60)}m\u540E\u91CD\u7F6E`);
|
|
292
|
+
} else if (diffSec < 86400) {
|
|
293
|
+
const hours = (diffSec / 3600).toFixed(1).replace(/\.0$/, "");
|
|
294
|
+
parts.push(`${hours}h\u540E\u91CD\u7F6E`);
|
|
295
|
+
} else {
|
|
296
|
+
const days = (diffSec / 86400).toFixed(1).replace(/\.0$/, "");
|
|
297
|
+
parts.push(`${days}d\u540E\u91CD\u7F6E`);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const onlyScope = parts.length === 0 || parts.length === 1 && parts[0] === tightest.scope;
|
|
301
|
+
if (onlyScope) return planText;
|
|
302
|
+
return [planText, ...parts].filter(Boolean).join(" \xB7 ");
|
|
303
|
+
}
|
|
304
|
+
function formatPlanLabel(plan) {
|
|
305
|
+
const name = typeof plan?.name === "string" ? plan.name.trim() : "";
|
|
306
|
+
if (!name) return void 0;
|
|
307
|
+
const credits = typeof plan?.monthlyCreditsUsd === "number" && Number.isFinite(plan.monthlyCreditsUsd) && plan.monthlyCreditsUsd > 0 ? `\u6708\u5EA6\u989D\u5EA6 $${plan.monthlyCreditsUsd}` : void 0;
|
|
308
|
+
return [`${name} \u5957\u9910`, credits].filter(Boolean).join(" \xB7 ");
|
|
309
|
+
}
|
|
310
|
+
|
|
241
311
|
export {
|
|
242
312
|
normalizeListedAgent,
|
|
243
|
-
toSafeListedAgentSummary,
|
|
244
313
|
parseAgentListArgs,
|
|
245
314
|
listLocalCachedAgents,
|
|
246
315
|
listRemotePublicAgents,
|
|
247
316
|
listRemoteAgents,
|
|
248
317
|
listRemoteAgentsAcrossServers,
|
|
249
318
|
listFavoriteAgentIdsAcrossServers,
|
|
250
|
-
decorateAgentsWithPublicStatusAcrossServers
|
|
319
|
+
decorateAgentsWithPublicStatusAcrossServers,
|
|
320
|
+
formatQuotaSummary
|
|
251
321
|
};
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KGRP4VOK.js";
|
|
4
4
|
import {
|
|
5
|
+
format,
|
|
5
6
|
prepareAndPersistMessage,
|
|
6
7
|
uiAskChoiceFunc,
|
|
7
8
|
uiAskChoiceFunctionSchema
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4A2R7KHG.js";
|
|
9
10
|
import {
|
|
10
|
-
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
formatISO
|
|
12
|
+
} from "./chunk-ZRAU6T47.js";
|
|
12
13
|
import {
|
|
13
14
|
buildBuiltinObjectSkillReference
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import {
|
|
16
|
-
PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
|
|
17
|
-
PLATFORM_HOSTED_KIMI_PROVIDER
|
|
18
|
-
} from "./chunk-Q67DOFOO.js";
|
|
15
|
+
} from "./chunk-4HTMUQIZ.js";
|
|
19
16
|
import {
|
|
20
17
|
read,
|
|
21
18
|
readAndWait,
|
|
22
19
|
removeCachedEntity,
|
|
23
20
|
upsertSSREntity,
|
|
24
21
|
write
|
|
25
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-56HJ2LAA.js";
|
|
23
|
+
import {
|
|
24
|
+
PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
|
|
25
|
+
PLATFORM_HOSTED_KIMI_PROVIDER
|
|
26
|
+
} from "./chunk-Y3PMXGLH.js";
|
|
27
|
+
import {
|
|
28
|
+
extractCustomId
|
|
29
|
+
} from "./chunk-M2EJHDJP.js";
|
|
30
|
+
import {
|
|
31
|
+
isRecord
|
|
32
|
+
} from "./chunk-KUG52IAP.js";
|
|
26
33
|
import {
|
|
27
34
|
createAgentKey,
|
|
28
35
|
createDialogKey,
|
|
@@ -30,34 +37,22 @@ import {
|
|
|
30
37
|
dialogMessageRange,
|
|
31
38
|
memoryOwnerRange,
|
|
32
39
|
memorySubjectKindRange
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
extractCustomId
|
|
36
|
-
} from "./chunk-M2EJHDJP.js";
|
|
40
|
+
} from "./chunk-ODAPITXL.js";
|
|
37
41
|
import {
|
|
38
42
|
isDevelopment
|
|
39
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-HIM3FCLF.js";
|
|
40
44
|
import {
|
|
41
45
|
selectIdentityUserId
|
|
42
46
|
} from "./chunk-SEJ5OS6F.js";
|
|
43
47
|
import {
|
|
44
|
-
|
|
45
|
-
} from "./chunk-
|
|
48
|
+
asOptionalPositiveFiniteNumber
|
|
49
|
+
} from "./chunk-U6VC4MU4.js";
|
|
46
50
|
import {
|
|
47
51
|
asTrimmedString
|
|
48
52
|
} from "./chunk-3EUW3WEO.js";
|
|
49
|
-
import {
|
|
50
|
-
asOptionalPositiveFiniteNumber
|
|
51
|
-
} from "./chunk-U6VC4MU4.js";
|
|
52
53
|
import {
|
|
53
54
|
asOptionalTrimmedString
|
|
54
55
|
} from "./chunk-G3SUCT4W.js";
|
|
55
|
-
import {
|
|
56
|
-
__toESM
|
|
57
|
-
} from "./chunk-4VNS5WPM.js";
|
|
58
|
-
|
|
59
|
-
// packages/chat/dialog/actions/createDialogAction.ts
|
|
60
|
-
var import_date_fns = __toESM(require_date_fns());
|
|
61
56
|
|
|
62
57
|
// packages/chat/dialog/objectAssistantRegistry.ts
|
|
63
58
|
var OBJECT_ASSISTANT_TO_SKILL = {
|
|
@@ -811,7 +806,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
811
806
|
preview: recentRelationshipRecapResolution.recap ?? null
|
|
812
807
|
});
|
|
813
808
|
}
|
|
814
|
-
const time =
|
|
809
|
+
const time = format(/* @__PURE__ */ new Date(), "MM-dd HH:mm");
|
|
815
810
|
const title = titleOverride || (agentMode === "auto" ? "\u65B0\u5BF9\u8BDD" : agentConfig?.name || "Agent") + " " + time;
|
|
816
811
|
const spaceId = explicitSpaceId;
|
|
817
812
|
const dialogPath = createDialogKey(userId);
|
|
@@ -853,7 +848,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
853
848
|
...agentMode === "auto" && autoRoute ? { autoRoute } : {},
|
|
854
849
|
title,
|
|
855
850
|
type: "dialog" /* DIALOG */,
|
|
856
|
-
createdAt:
|
|
851
|
+
createdAt: formatISO(/* @__PURE__ */ new Date()),
|
|
857
852
|
...spaceId && { spaceId },
|
|
858
853
|
category,
|
|
859
854
|
referenceKeys,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addLeadingZeros,
|
|
3
|
+
requiredArgs,
|
|
4
|
+
toDate
|
|
5
|
+
} from "./chunk-4LCOCOR5.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/date-fns/esm/formatISO/index.js
|
|
8
|
+
function formatISO(date, options) {
|
|
9
|
+
var _options$format, _options$representati;
|
|
10
|
+
requiredArgs(1, arguments);
|
|
11
|
+
var originalDate = toDate(date);
|
|
12
|
+
if (isNaN(originalDate.getTime())) {
|
|
13
|
+
throw new RangeError("Invalid time value");
|
|
14
|
+
}
|
|
15
|
+
var format = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : "extended");
|
|
16
|
+
var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : "complete");
|
|
17
|
+
if (format !== "extended" && format !== "basic") {
|
|
18
|
+
throw new RangeError("format must be 'extended' or 'basic'");
|
|
19
|
+
}
|
|
20
|
+
if (representation !== "date" && representation !== "time" && representation !== "complete") {
|
|
21
|
+
throw new RangeError("representation must be 'date', 'time', or 'complete'");
|
|
22
|
+
}
|
|
23
|
+
var result = "";
|
|
24
|
+
var tzOffset = "";
|
|
25
|
+
var dateDelimiter = format === "extended" ? "-" : "";
|
|
26
|
+
var timeDelimiter = format === "extended" ? ":" : "";
|
|
27
|
+
if (representation !== "time") {
|
|
28
|
+
var day = addLeadingZeros(originalDate.getDate(), 2);
|
|
29
|
+
var month = addLeadingZeros(originalDate.getMonth() + 1, 2);
|
|
30
|
+
var year = addLeadingZeros(originalDate.getFullYear(), 4);
|
|
31
|
+
result = "".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);
|
|
32
|
+
}
|
|
33
|
+
if (representation !== "date") {
|
|
34
|
+
var offset = originalDate.getTimezoneOffset();
|
|
35
|
+
if (offset !== 0) {
|
|
36
|
+
var absoluteOffset = Math.abs(offset);
|
|
37
|
+
var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2);
|
|
38
|
+
var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
|
|
39
|
+
var sign = offset < 0 ? "+" : "-";
|
|
40
|
+
tzOffset = "".concat(sign).concat(hourOffset, ":").concat(minuteOffset);
|
|
41
|
+
} else {
|
|
42
|
+
tzOffset = "Z";
|
|
43
|
+
}
|
|
44
|
+
var hour = addLeadingZeros(originalDate.getHours(), 2);
|
|
45
|
+
var minute = addLeadingZeros(originalDate.getMinutes(), 2);
|
|
46
|
+
var second = addLeadingZeros(originalDate.getSeconds(), 2);
|
|
47
|
+
var separator = result === "" ? "" : "T";
|
|
48
|
+
var time = [hour, minute, second].join(timeDelimiter);
|
|
49
|
+
result = "".concat(result).concat(separator).concat(time).concat(tzOffset);
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
formatISO
|
|
56
|
+
};
|