nolo-cli 0.92.0-alpha.1 → 0.92.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-SKXPDRHT.js → _executeModel-SCZL7EYW.js} +63 -61
- package/{action-5DATYWOM.js → action-3ZOODRBC.js} +11 -11
- package/{addContentAction-5OLTVWIE.js → addContentAction-IJHG2ZV7.js} +9 -9
- package/{addDialogAgentAction-BRGMORV4.js → addDialogAgentAction-IGFS2UBX.js} +11 -11
- package/{agentDeleteCommand-KIJCEDIQ.js → agentDeleteCommand-CTZYXUBY.js} +45 -43
- package/{agentEmailCommands-KVJQBG6I.js → agentEmailCommands-M4RKRMV5.js} +84 -79
- package/{agentGrantCommands-YW6PQAQ2.js → agentGrantCommands-M3XFO6EN.js} +2 -2
- package/{agentListCommands-S2WK34WE.js → agentListCommands-QWBMMYNO.js} +74 -81
- package/{agentMachineCommands-ESEVMWBG.js → agentMachineCommands-CFGNRGKC.js} +39 -37
- package/{agentProviderCommands-I26OTLEQ.js → agentProviderCommands-TWB6E5WD.js} +1 -1
- package/{agentPullCommand-GLOOXJ2E.js → agentPullCommand-HF4A42D4.js} +3 -3
- package/agentRecordCommands-ZTUVMJOZ.js +131 -0
- package/{agentRunCommand-PQ2D3MTU.js → agentRunCommand-NARA7GSD.js} +82 -76
- package/{agentRunControl-XLGD3UZ5.js → agentRunControl-AVJR4JW4.js} +2 -2
- package/{agentRuntimeLocal-ZLZCZO3C.js → agentRuntimeLocal-OKYH7XBH.js} +40 -34
- package/{agentSlice-JF7MQKXG.js → agentSlice-L6BEWT2Q.js} +11 -11
- package/{appDeleteCommands-KHSC6H42.js → appDeleteCommands-2D2R56YU.js} +39 -37
- package/{appDeployCommands-KCCU76AG.js → appDeployCommands-R5PAA5YI.js} +39 -37
- package/{appDeployStatusCommands-UBGX7463.js → appDeployStatusCommands-VHTBTS3W.js} +39 -37
- package/{appGetCommands-CGVGNM5J.js → appGetCommands-G35QG2QG.js} +39 -37
- package/{appListCommands-JUVQUOGH.js → appListCommands-YQ2PKESX.js} +39 -37
- package/{authCommand-ETL233F2.js → authCommand-W6I6GD3F.js} +115 -23
- package/{authCommands-RGOGCPP6.js → authCommands-GBIFZWD3.js} +5 -5
- package/{builtinSkillRegistry-PJU2R6ST.js → builtinSkillRegistry-XG6RUDWO.js} +9 -8
- package/{chatQueueReduxAdapter-NIJ6XFDN.js → chatQueueReduxAdapter-OINFB5SN.js} +29 -29
- package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
- package/{chunk-UYJKSCJ4.js → chunk-27ONFIEY.js} +22 -4
- package/{chunk-2HBFQM4C.js → chunk-2QX2MTNK.js} +25 -6
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-QTV7ZYBE.js → chunk-3BXNTXYI.js} +310 -136
- package/{chunk-6R425QS6.js → chunk-3IYMTWYZ.js} +22 -22
- package/{chunk-NTW5GWDM.js → chunk-3VNWWVKB.js} +2 -0
- package/{chunk-PNBZBDRM.js → chunk-4DPP773Q.js} +2 -2
- package/chunk-5J3PYNUP.js +255 -0
- package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
- package/{chunk-CDS4FQMP.js → chunk-5RUECWE2.js} +165 -15
- package/{chunk-DWUCB2A3.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-ZIK2FIX4.js → chunk-66MWFK6R.js} +9 -9
- package/{chunk-6YTOJY35.js → chunk-6D2JFXLY.js} +35 -0
- package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
- package/{chunk-NNJ4EAEH.js → chunk-6PPDYAMH.js} +7517 -1091
- package/{chunk-I2MX6JST.js → chunk-7KVZ5LDQ.js} +2 -2
- package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
- package/{chunk-UKWGR5SS.js → chunk-AUXHZ2M5.js} +186 -397
- package/{chunk-TLPTMSX3.js → chunk-AVKLJP6J.js} +94 -94
- package/{chunk-5NHGLCPL.js → chunk-AZRHIN5B.js} +1 -1
- package/{chunk-5LRIZC2W.js → chunk-B7ANJQWZ.js} +2 -2
- package/{chunk-3QC3NGWZ.js → chunk-BDHW7EBD.js} +4 -4
- package/{chunk-HNUNYXYB.js → chunk-BJUDYFV5.js} +10 -2
- package/chunk-BMQ2MJUK.js +153 -0
- package/{chunk-3JIXYIXV.js → chunk-BNGW5ASC.js} +12 -2
- package/{chunk-2D6QK26I.js → chunk-BPCPBG2O.js} +16 -16
- package/{chunk-SATOEEL6.js → chunk-BTSYHR7J.js} +4 -4
- package/{chunk-4B3TDK3S.js → chunk-CCOXTK3I.js} +30 -7
- package/{chunk-LS2ZANRJ.js → chunk-CTUQJVQM.js} +1 -1
- package/{chunk-43WRG6QQ.js → chunk-CUBJUVQS.js} +13 -13
- package/chunk-CYSYR67N.js +93 -0
- package/{chunk-PIOIPOSY.js → chunk-D76D3RTR.js} +2 -2
- package/{chunk-HQCSU3DI.js → chunk-DCLMZ5TX.js} +4 -4
- package/{chunk-UT5NALV3.js → chunk-EFZKILX6.js} +4 -4
- package/{chunk-2L3O7RDP.js → chunk-EMBK4B7D.js} +9 -4
- package/{chunk-HVURBGF3.js → chunk-ESRMFY7G.js} +2 -2
- package/{chunk-ABQYVJBJ.js → chunk-ETZWFV6M.js} +1 -1
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-RAYTIPJ5.js → chunk-F64B2W3R.js} +110 -34
- package/{chunk-S6SP3GWJ.js → chunk-FIZ5TAVE.js} +1 -1
- package/{chunk-MOH3ETXO.js → chunk-GA77XY7N.js} +542 -447
- package/{chunk-2WHQZTB7.js → chunk-GMVELWJG.js} +3 -3
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-CJCJF5XB.js → chunk-H6A6X4EK.js} +36 -3
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-46TSVHGZ.js → chunk-HNRASX3X.js} +8 -8
- package/{chunk-CPH3W5A7.js → chunk-I3TQJXQ7.js} +94 -3
- package/{chunk-TZB6Y4OD.js → chunk-IBQ6NJI4.js} +34 -20
- package/{chunk-IP2RNQU3.js → chunk-LNPYTNMG.js} +9 -5
- package/{chunk-TLO2X5C6.js → chunk-LNUOUGIY.js} +1 -1
- package/{chunk-GII32WZW.js → chunk-M2EJHDJP.js} +3 -0
- package/{chunk-G3V74DVM.js → chunk-MV26343G.js} +75 -18
- package/{chunk-7S4YWN7P.js → chunk-MX574M24.js} +1 -1
- package/{chunk-U7HSBX3I.js → chunk-O26PCYLS.js} +80 -13
- package/chunk-OCZKATRC.js +129 -0
- package/{chunk-YNI45YOE.js → chunk-P4U2QMT5.js} +65 -37
- package/chunk-P6GMCCAT.js +870 -0
- package/{chunk-YQPWX5EE.js → chunk-PEXU23PJ.js} +23 -76
- package/{chunk-7GDFU22A.js → chunk-PHINMJJZ.js} +983 -226
- package/{chunk-YC2MP5NP.js → chunk-Q3SKC2TQ.js} +7 -7
- package/{chunk-NU2SOATM.js → chunk-Q7JFHTQT.js} +3 -3
- package/{chunk-YNNVVLMV.js → chunk-QALRKMHF.js} +11 -10
- package/{chunk-T67757YH.js → chunk-QDSINZM3.js} +1 -1
- package/{chunk-TUEPUNFO.js → chunk-QJLEMM2V.js} +1 -1
- package/{chunk-FEAPBZQW.js → chunk-QL32RJFG.js} +98 -22
- package/{chunk-EONDQISD.js → chunk-QMQBSKUP.js} +886 -154
- package/{chunk-BJ7HBUL2.js → chunk-QZYL5UNG.js} +1003 -1041
- package/{chunk-YDEMAQEY.js → chunk-R4SQ3LGW.js} +1 -1
- package/{chunk-TSD5BVVP.js → chunk-RESDFLXS.js} +13 -13
- package/{chunk-ZKYHTHNE.js → chunk-S5XGT6GB.js} +5 -3
- package/{chunk-SAFZABH7.js → chunk-SV5IJK6K.js} +1 -1
- package/{chunk-W6MEYAGX.js → chunk-TC6TTNZW.js} +45 -45
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/{chunk-S46FYEWL.js → chunk-U7ZDIW37.js} +1 -1
- package/chunk-UNYJU5L6.js +780 -0
- package/{chunk-VUHXTHIK.js → chunk-V2AB7ULS.js} +5 -5
- package/{chunk-QFMFJZLO.js → chunk-V7E4PXQD.js} +1 -1
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-6D6VBVEW.js → chunk-VPFEPRME.js} +9 -9
- package/{chunk-EKXNV6EM.js → chunk-X5VY2LEV.js} +2 -2
- package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
- package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
- package/{chunk-IMCXPAQV.js → chunk-YFIUVDQY.js} +6 -83
- package/{chunk-FZGV4FGK.js → chunk-YRRASA5Q.js} +268 -143
- package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
- package/{chunk-2F7RJC6L.js → chunk-ZOVKKMF6.js} +1 -1
- package/commandRegistry-T4PY3XBY.js +833 -0
- package/{contentThunks-N7MGBLZJ.js → contentThunks-7SBK3Y7B.js} +29 -29
- package/{cooldownCommands-BSCH2W7P.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-DNOR2HPB.js → createAgentAutomationAction-NPD23L7Y.js} +29 -29
- package/{createDialogAction-Y5CTGDHJ.js → createDialogAction-2JVPW2WV.js} +33 -32
- package/{createPageAction-HIQCWUNG.js → createPageAction-UUIPRGHK.js} +35 -35
- package/{dbSlice-NP52Y5TF.js → dbSlice-HFPIJT5P.js} +8 -8
- package/{deleteFile-YG6QMJLU.js → deleteFile-UEAD5A5Z.js} +3 -3
- package/{dialogCommands-RDCQ2IFS.js → dialogCommands-7JXIBGPD.js} +42 -40
- package/{dialogSlice-CCADNU4F.js → dialogSlice-Q2QUTMHK.js} +35 -29
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-7BQO7QFJ.js → docCreateCommands-2JDSCRGB.js} +41 -39
- package/{docDeleteCommands-AXWDDTVX.js → docDeleteCommands-Y4XRBWKE.js} +41 -39
- package/{docReadCommands-NMDWZKZW.js → docReadCommands-35FY3PYU.js} +40 -38
- package/{docStore-RSIMI5PS.js → docStore-FWQIXF33.js} +9 -9
- package/{docUpdateCommands-KFIRA6WM.js → docUpdateCommands-MT7YKSP7.js} +41 -39
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-67MEFPZR.js} +2 -2
- package/{getPricing-SLZYHJXY.js → getPricing-NMMFT3YI.js} +3 -3
- package/{handleSendMessageAction-ZIABBL3A.js → handleSendMessageAction-W33QLNXQ.js} +85 -82
- package/index.js +87 -884
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-EBRS242U.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-5W6IJRAD.js} +6 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-3LRMNLCM.js} +1 -1
- package/{machineCommands-H6TGKZYD.js → machineCommands-HLEUUEKS.js} +77 -72
- package/{machineWsRunDispatch-YU4MGUB5.js → machineWsRunDispatch-DWBXW7XY.js} +75 -70
- package/{memberThunks-XJFHFZ5M.js → memberThunks-SKFZ37VS.js} +9 -9
- package/{models-WYXEJZAX.js → models-ZPU5EDF4.js} +2 -2
- package/oauthTokenStore-ITEB663N.js +23 -0
- package/{offlineMarxistsAgentCommand-JEWCIAWM.js → offlineMarxistsAgentCommand-HGXZV4XJ.js} +1 -1
- 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-RWISXOW7.js → providerPresetApply-XTEXOH7X.js} +7 -7
- package/{providerRegistry-5KY7YV6K.js → providerRegistry-ADYDSLKR.js} +7 -7
- package/{read-KFAALANF.js → read-IEJLLUXY.js} +5 -5
- package/{readDocTool-XNMCT64I.js → readDocTool-4SPYCP2Y.js} +5 -3
- package/{readlineWorkspace-JTU5LTZI.js → readlineWorkspace-32ILQXZJ.js} +2398 -2019
- package/{removeDialogAgentAction-X3IS7JNU.js → removeDialogAgentAction-LILXTOQY.js} +14 -14
- package/{runAgentClientLoop-5TPQBYB6.js → runAgentClientLoop-MSCR5Y3E.js} +57 -56
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-3USD722U.js} +3 -3
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-QTV3ZJNH.js → setDialogExtraReferencesAction-LVNHLNT5.js} +10 -10
- package/{setPrimaryDialogAgentAction-EUUISNQ2.js → setPrimaryDialogAgentAction-DCKO5NTW.js} +14 -14
- package/{settingSlice-UMATY3PD.js → settingSlice-CNE75ISY.js} +10 -10
- package/{spaceCommands-PR6QHSEG.js → spaceCommands-UYWX63IP.js} +41 -39
- package/{streamAgentChatTurn-TXMNTXML.js → streamAgentChatTurn-73OAEDOJ.js} +146 -85
- package/{switchDialogAgentAction-HWFDQNY5.js → switchDialogAgentAction-JSYUQ5CG.js} +11 -11
- package/{tableCommands-O6NWHFKV.js → tableCommands-G7RV3RU3.js} +4 -4
- package/{toolApiClient-7PSIFQPJ.js → toolApiClient-INIQCPGY.js} +3 -3
- package/{tools-GEVUKUVY.js → tools-6IUC3EFI.js} +51 -50
- package/{tuiSummaryLlmCaller-PKZYGY3B.js → tuiSummaryLlmCaller-RVWN63CP.js} +16 -15
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-MFR3UGL5.js → updateDialogTitleAction-KCAY2OZF.js} +32 -32
- package/agentRecordCommands-TTYG2GYM.js +0 -126
- package/chunk-DMFLXNFM.js +0 -79
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
|
@@ -19,6 +19,7 @@ ${input}`;
|
|
|
19
19
|
}
|
|
20
20
|
let jsonStr;
|
|
21
21
|
try {
|
|
22
|
+
JSON.stringify(input);
|
|
22
23
|
const serialized = JSON.stringify(input, null, 2);
|
|
23
24
|
if (serialized === void 0) {
|
|
24
25
|
return task;
|
|
@@ -43,6 +44,7 @@ function calculateDelegatedPayloadMetrics(task, input, delegatedContent) {
|
|
|
43
44
|
serializedInputForTokens = input;
|
|
44
45
|
} else {
|
|
45
46
|
try {
|
|
47
|
+
JSON.stringify(input);
|
|
46
48
|
const serialized = JSON.stringify(input, null, 2);
|
|
47
49
|
if (serialized !== void 0) {
|
|
48
50
|
inputChars = serialized.length;
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-AGGIDPCZ.js";
|
|
7
7
|
import {
|
|
8
8
|
getModelConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3BXNTXYI.js";
|
|
10
10
|
import {
|
|
11
11
|
isPlatformHostedImageModel
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Y3PMXGLH.js";
|
|
13
13
|
import {
|
|
14
14
|
asOptionalFiniteNumber
|
|
15
15
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// packages/ai/tools/chromeConnectorTools.ts
|
|
2
|
+
var CHROME_CONNECTOR_TOOL_NAMES = [
|
|
3
|
+
"browser_list_tabs",
|
|
4
|
+
"browser_open_tab",
|
|
5
|
+
"browser_close_tab",
|
|
6
|
+
"browser_read_page",
|
|
7
|
+
"browser_click_element",
|
|
8
|
+
"browser_type",
|
|
9
|
+
"browser_press",
|
|
10
|
+
"browser_scroll",
|
|
11
|
+
"browser_screenshot",
|
|
12
|
+
"browser_read_console",
|
|
13
|
+
"browser_read_network"
|
|
14
|
+
];
|
|
15
|
+
var CHROME_CONNECTOR_LEGACY_TOOL_ALIASES = {
|
|
16
|
+
chrome_list_tabs: "browser_list_tabs",
|
|
17
|
+
chrome_open_tab: "browser_open_tab",
|
|
18
|
+
chrome_close_tab: "browser_close_tab",
|
|
19
|
+
chrome_read_page: "browser_read_page",
|
|
20
|
+
chrome_click: "browser_click_element",
|
|
21
|
+
chrome_type: "browser_type",
|
|
22
|
+
chrome_press: "browser_press",
|
|
23
|
+
chrome_scroll: "browser_scroll",
|
|
24
|
+
chrome_screenshot: "browser_screenshot",
|
|
25
|
+
chrome_read_console: "browser_read_console",
|
|
26
|
+
chrome_read_network: "browser_read_network"
|
|
27
|
+
};
|
|
28
|
+
var CHROME_CONNECTOR_LEGACY_TOOL_NAMES = Object.keys(
|
|
29
|
+
CHROME_CONNECTOR_LEGACY_TOOL_ALIASES
|
|
30
|
+
);
|
|
31
|
+
var CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES = [
|
|
32
|
+
...CHROME_CONNECTOR_TOOL_NAMES,
|
|
33
|
+
...CHROME_CONNECTOR_LEGACY_TOOL_NAMES
|
|
34
|
+
];
|
|
35
|
+
function resolveChromeConnectorToolName(name) {
|
|
36
|
+
if (CHROME_CONNECTOR_TOOL_NAMES.includes(name)) {
|
|
37
|
+
return name;
|
|
38
|
+
}
|
|
39
|
+
return CHROME_CONNECTOR_LEGACY_TOOL_ALIASES[name];
|
|
40
|
+
}
|
|
41
|
+
function canonicalizeChromeConnectorToolNames(toolNames) {
|
|
42
|
+
const out = [];
|
|
43
|
+
for (const name of toolNames ?? []) {
|
|
44
|
+
const resolved = typeof name === "string" ? resolveChromeConnectorToolName(name) : void 0;
|
|
45
|
+
if (resolved && !out.includes(resolved)) out.push(resolved);
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
var CONNECTOR_TARGET_PROPERTY = {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Reserved and ignored for now; future multi-provider targeting."
|
|
52
|
+
};
|
|
53
|
+
var CHROME_CONNECTOR_READ_TOOL_NAMES = [
|
|
54
|
+
"browser_list_tabs",
|
|
55
|
+
"browser_read_page",
|
|
56
|
+
"browser_screenshot",
|
|
57
|
+
"browser_read_console",
|
|
58
|
+
"browser_read_network"
|
|
59
|
+
];
|
|
60
|
+
var getChromeConnectorToolBehavior = (name) => CHROME_CONNECTOR_READ_TOOL_NAMES.includes(resolveChromeConnectorToolName(name)) ? "data" : "action";
|
|
61
|
+
var getChromeConnectorToolDefaultConsent = (name) => CHROME_CONNECTOR_READ_TOOL_NAMES.includes(resolveChromeConnectorToolName(name)) ? "auto" : "ask";
|
|
62
|
+
function baseSchema(name, description, properties, required = []) {
|
|
63
|
+
return {
|
|
64
|
+
name,
|
|
65
|
+
description,
|
|
66
|
+
parameters: {
|
|
67
|
+
type: "object",
|
|
68
|
+
properties: { ...properties, target: CONNECTOR_TARGET_PROPERTY },
|
|
69
|
+
required
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
var tabId = {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "Browser tab id returned by browser_list_tabs or browser_open_tab."
|
|
76
|
+
};
|
|
77
|
+
var elementRef = {
|
|
78
|
+
type: "string",
|
|
79
|
+
description: "Revision-scoped ref like 1a2b3c4d-e2, copied verbatim from browser_read_page; preferred over selector when available."
|
|
80
|
+
};
|
|
81
|
+
var selector = {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "CSS selector for the visible page element to operate on; fallback when no elementRef is available."
|
|
84
|
+
};
|
|
85
|
+
var chromeListTabsFunctionSchema = baseSchema(
|
|
86
|
+
"browser_list_tabs",
|
|
87
|
+
"List controllable browser tabs from the user's browser profile through the Nolo Browser Connector.",
|
|
88
|
+
{}
|
|
89
|
+
);
|
|
90
|
+
var chromeOpenTabFunctionSchema = baseSchema(
|
|
91
|
+
"browser_open_tab",
|
|
92
|
+
"Open a URL in the user's browser (Chrome or Firefox) through the Nolo Browser Connector.",
|
|
93
|
+
{
|
|
94
|
+
url: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "HTTP or HTTPS URL to open in the browser."
|
|
97
|
+
},
|
|
98
|
+
active: {
|
|
99
|
+
type: "boolean",
|
|
100
|
+
description: "Whether to focus the new browser tab. Defaults to true."
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
["url"]
|
|
104
|
+
);
|
|
105
|
+
var chromeCloseTabFunctionSchema = baseSchema(
|
|
106
|
+
"browser_close_tab",
|
|
107
|
+
"Close a browser tab through the Nolo Browser Connector. Prefer closing the tabs your own run opened with browser_open_tab, and ask the user before closing a tab they are using. Pinned tabs are refused (TAB_PINNED); unknown tab ids fail (TAB_NOT_FOUND).",
|
|
108
|
+
{
|
|
109
|
+
tabId
|
|
110
|
+
},
|
|
111
|
+
["tabId"]
|
|
112
|
+
);
|
|
113
|
+
var chromeReadPageFunctionSchema = baseSchema(
|
|
114
|
+
"browser_read_page",
|
|
115
|
+
"Read a compact view of a browser tab: visible text (hard cap 6000 chars) plus short-lived elementRefs (hard cap 35) and a pageRevision. Reuse those refs for browser_click_element and browser_type instead of guessing selectors; use region to focus a big page. Does not read cookies or profile databases.",
|
|
116
|
+
{
|
|
117
|
+
tabId,
|
|
118
|
+
region: {
|
|
119
|
+
type: "string",
|
|
120
|
+
description: "Optional CSS selector limiting the read to part of the page."
|
|
121
|
+
},
|
|
122
|
+
maxChars: {
|
|
123
|
+
type: "number",
|
|
124
|
+
description: "Optional text character budget; the connector clamps it to a hard maximum."
|
|
125
|
+
},
|
|
126
|
+
detail: {
|
|
127
|
+
type: "string",
|
|
128
|
+
enum: ["compact", "full"],
|
|
129
|
+
description: "compact (default) returns budgeted text; full raises the budget and adds capped HTML."
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
["tabId"]
|
|
133
|
+
);
|
|
134
|
+
var chromeClickFunctionSchema = baseSchema(
|
|
135
|
+
"browser_click_element",
|
|
136
|
+
"Click a visible element in a browser tab by elementRef from browser_read_page, or by CSS selector. Controls whose name indicates an irreversible external action (payment, send, delete, publish, permission change) are refused with SENSITIVE_ACTION_REQUIRES_CONFIRMATION: this desktop runtime has no approval channel, so name the control and ask the user to activate it themselves.",
|
|
137
|
+
{
|
|
138
|
+
tabId,
|
|
139
|
+
elementRef,
|
|
140
|
+
selector
|
|
141
|
+
},
|
|
142
|
+
["tabId"]
|
|
143
|
+
);
|
|
144
|
+
var chromeTypeFunctionSchema = baseSchema(
|
|
145
|
+
"browser_type",
|
|
146
|
+
"Type text into a browser page element identified by elementRef from browser_read_page or by CSS selector. Typing into a control whose name indicates an irreversible external action is refused with SENSITIVE_ACTION_REQUIRES_CONFIRMATION, same as clicking it.",
|
|
147
|
+
{
|
|
148
|
+
tabId,
|
|
149
|
+
elementRef,
|
|
150
|
+
selector,
|
|
151
|
+
text: {
|
|
152
|
+
type: "string",
|
|
153
|
+
description: "Text to type into the selected element."
|
|
154
|
+
},
|
|
155
|
+
clearFirst: {
|
|
156
|
+
type: "boolean",
|
|
157
|
+
description: "Whether to clear the field before typing. Defaults to true."
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
["tabId", "text"]
|
|
161
|
+
);
|
|
162
|
+
var chromePressFunctionSchema = baseSchema(
|
|
163
|
+
"browser_press",
|
|
164
|
+
"Send a keyboard key or shortcut to a browser tab. Enter-like keys are refused with SENSITIVE_ACTION_REQUIRES_CONFIRMATION when the focused control is an irreversible action.",
|
|
165
|
+
{
|
|
166
|
+
tabId,
|
|
167
|
+
key: {
|
|
168
|
+
type: "string",
|
|
169
|
+
description: "Key or shortcut, for example Enter, Escape, ArrowDown, or Meta+L."
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
["tabId", "key"]
|
|
173
|
+
);
|
|
174
|
+
var chromeScrollFunctionSchema = baseSchema(
|
|
175
|
+
"browser_scroll",
|
|
176
|
+
"Scroll a browser tab by pixel deltas.",
|
|
177
|
+
{
|
|
178
|
+
tabId,
|
|
179
|
+
deltaX: {
|
|
180
|
+
type: "number",
|
|
181
|
+
description: "Horizontal scroll delta in pixels."
|
|
182
|
+
},
|
|
183
|
+
deltaY: {
|
|
184
|
+
type: "number",
|
|
185
|
+
description: "Vertical scroll delta in pixels."
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
["tabId"]
|
|
189
|
+
);
|
|
190
|
+
var chromeScreenshotFunctionSchema = baseSchema(
|
|
191
|
+
"browser_screenshot",
|
|
192
|
+
"Capture a screenshot from a browser tab through the Nolo Browser Connector.",
|
|
193
|
+
{
|
|
194
|
+
tabId,
|
|
195
|
+
fullPage: {
|
|
196
|
+
type: "boolean",
|
|
197
|
+
description: "Whether to capture the full page. Defaults to false."
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
["tabId"]
|
|
201
|
+
);
|
|
202
|
+
var chromeReadConsoleFunctionSchema = baseSchema(
|
|
203
|
+
"browser_read_console",
|
|
204
|
+
"Read recent console messages from a browser tab using debugger-backed connector state.",
|
|
205
|
+
{
|
|
206
|
+
tabId,
|
|
207
|
+
limit: {
|
|
208
|
+
type: "number",
|
|
209
|
+
description: "Maximum number of recent console messages to return."
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
["tabId"]
|
|
213
|
+
);
|
|
214
|
+
var chromeReadNetworkFunctionSchema = baseSchema(
|
|
215
|
+
"browser_read_network",
|
|
216
|
+
"Read a deduplicated recent network summary from a browser tab using debugger-backed connector state. Static assets are filtered unless includeAssets is set.",
|
|
217
|
+
{
|
|
218
|
+
tabId,
|
|
219
|
+
limit: {
|
|
220
|
+
type: "number",
|
|
221
|
+
description: "Maximum number of recent network entries to return."
|
|
222
|
+
},
|
|
223
|
+
includeAssets: {
|
|
224
|
+
type: "boolean",
|
|
225
|
+
description: "Include images, CSS, fonts and other static assets. Defaults to false."
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
["tabId"]
|
|
229
|
+
);
|
|
230
|
+
var chromeConnectorToolSchemas = [
|
|
231
|
+
chromeListTabsFunctionSchema,
|
|
232
|
+
chromeOpenTabFunctionSchema,
|
|
233
|
+
chromeCloseTabFunctionSchema,
|
|
234
|
+
chromeReadPageFunctionSchema,
|
|
235
|
+
chromeClickFunctionSchema,
|
|
236
|
+
chromeTypeFunctionSchema,
|
|
237
|
+
chromePressFunctionSchema,
|
|
238
|
+
chromeScrollFunctionSchema,
|
|
239
|
+
chromeScreenshotFunctionSchema,
|
|
240
|
+
chromeReadConsoleFunctionSchema,
|
|
241
|
+
chromeReadNetworkFunctionSchema
|
|
242
|
+
];
|
|
243
|
+
async function chromeConnectorUnavailableFunc() {
|
|
244
|
+
throw new Error("Browser connector tools are only executable in the Nolo desktop local runtime.");
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export {
|
|
248
|
+
CHROME_CONNECTOR_LEGACY_TOOL_ALIASES,
|
|
249
|
+
CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
|
|
250
|
+
canonicalizeChromeConnectorToolNames,
|
|
251
|
+
getChromeConnectorToolBehavior,
|
|
252
|
+
getChromeConnectorToolDefaultConsent,
|
|
253
|
+
chromeConnectorToolSchemas,
|
|
254
|
+
chromeConnectorUnavailableFunc
|
|
255
|
+
};
|
|
@@ -3,21 +3,24 @@ import {
|
|
|
3
3
|
} from "./chunk-YYLHWIW6.js";
|
|
4
4
|
import {
|
|
5
5
|
compareAgentSelection
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LNPYTNMG.js";
|
|
7
|
+
import {
|
|
8
|
+
isAgentUnavailableNow
|
|
9
|
+
} from "./chunk-H6A6X4EK.js";
|
|
7
10
|
import {
|
|
8
11
|
isAntigravityOAuthAgent
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-S5XGT6GB.js";
|
|
10
13
|
import {
|
|
11
14
|
getModelAbility
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CYSYR67N.js";
|
|
16
|
+
import {
|
|
17
|
+
fnv1a32Hex
|
|
18
|
+
} from "./chunk-AUXHZ2M5.js";
|
|
13
19
|
import {
|
|
14
20
|
isOwnedAgentKey,
|
|
15
21
|
ownedAgentKey,
|
|
16
22
|
publicAgentKey
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
fnv1a32Hex
|
|
20
|
-
} from "./chunk-UKWGR5SS.js";
|
|
23
|
+
} from "./chunk-M2EJHDJP.js";
|
|
21
24
|
|
|
22
25
|
// packages/ai/agent/agentBilling.ts
|
|
23
26
|
function resolveBillingSource(candidate) {
|
|
@@ -227,6 +230,16 @@ function deriveCredentialGroup(ref) {
|
|
|
227
230
|
credentialKind: "api-key"
|
|
228
231
|
};
|
|
229
232
|
}
|
|
233
|
+
function deriveCustomProviderCredentialGroup(userId, customProviderUrl) {
|
|
234
|
+
if (typeof customProviderUrl !== "string" || !customProviderUrl.trim()) {
|
|
235
|
+
return void 0;
|
|
236
|
+
}
|
|
237
|
+
const basis = `${userId ?? ""}|${customProviderUrl.trim().toLowerCase()}`;
|
|
238
|
+
return {
|
|
239
|
+
credentialGroup: `custom-${fnv1a32Hex(basis)}`,
|
|
240
|
+
credentialKind: "api-key"
|
|
241
|
+
};
|
|
242
|
+
}
|
|
230
243
|
function summarizeCredentialGroups(agents, now = Date.now()) {
|
|
231
244
|
const groups = /* @__PURE__ */ new Map();
|
|
232
245
|
for (const agent of agents) {
|
|
@@ -327,6 +340,15 @@ function resolveFavoriteStatus(record, options) {
|
|
|
327
340
|
}
|
|
328
341
|
return { isFavorite: false, favoritedAt: null };
|
|
329
342
|
}
|
|
343
|
+
function isOwnedAgentRecord(record, userId) {
|
|
344
|
+
if (!userId) return false;
|
|
345
|
+
if (typeof record?.userId === "string" && record.userId === userId || typeof record?.ownerId === "string" && record.ownerId === userId) {
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
return [record?.dbKey, record?.privateKey].some(
|
|
349
|
+
(key) => isOwnedAgentKey(key, userId)
|
|
350
|
+
);
|
|
351
|
+
}
|
|
330
352
|
function toSafeAgentSummary(record, options) {
|
|
331
353
|
const rawId = parseAgentRecordId(
|
|
332
354
|
typeof record?.privateKey === "string" ? record.privateKey : record?.dbKey,
|
|
@@ -356,12 +378,13 @@ function toSafeAgentSummary(record, options) {
|
|
|
356
378
|
const isPublic = record?.isPublic === true || record?.isPublicFlag === true || record?.publicRecordExists === true;
|
|
357
379
|
const updatedAt = safeTimestamp(record?.updatedAt ?? record?.createdAt ?? record?.created);
|
|
358
380
|
const nextAvailableAt = typeof record?.nextAvailableAt === "number" && Number.isFinite(record.nextAvailableAt) ? record.nextAvailableAt : void 0;
|
|
381
|
+
const rawQuota = record?.quota;
|
|
382
|
+
const quota = rawQuota && typeof rawQuota === "object" && Array.isArray(rawQuota.windows) && typeof rawQuota.observedAt === "number" && Number.isFinite(rawQuota.observedAt) ? rawQuota : void 0;
|
|
359
383
|
const currentUserId = options?.userId;
|
|
360
|
-
const isOwnedByRecord = Boolean(currentUserId) && (typeof record?.userId === "string" && record.userId === currentUserId || typeof record?.ownerId === "string" && record.ownerId === currentUserId);
|
|
361
384
|
const ownedKey = currentUserId ? [record?.dbKey, record?.privateKey].find(
|
|
362
385
|
(key) => isOwnedAgentKey(key, currentUserId)
|
|
363
386
|
) : void 0;
|
|
364
|
-
const isOwned =
|
|
387
|
+
const isOwned = isOwnedAgentRecord(record, currentUserId);
|
|
365
388
|
const isOAuth = isOAuthApiKeyRef(record?.apiKeyRef);
|
|
366
389
|
const billingSource = resolveBillingSource({
|
|
367
390
|
...record,
|
|
@@ -418,8 +441,12 @@ function toSafeAgentSummary(record, options) {
|
|
|
418
441
|
isOwned,
|
|
419
442
|
isOAuth,
|
|
420
443
|
...nextAvailableAt !== void 0 ? { nextAvailableAt } : {},
|
|
444
|
+
...quota !== void 0 ? { quota } : {},
|
|
421
445
|
...credentialGroup !== void 0 ? { credentialGroup } : {},
|
|
422
446
|
...credentialKind !== void 0 ? { credentialKind } : {},
|
|
447
|
+
// 「未知 ≠ 独立」:无 credentialGroup 时显式 credentialed:false,调用方
|
|
448
|
+
// 不得把缺失解读成独立凭证(并发扇出守卫依赖这个区分)。
|
|
449
|
+
credentialed: credentialGroup !== void 0,
|
|
423
450
|
updatedAt
|
|
424
451
|
};
|
|
425
452
|
}
|
|
@@ -445,8 +472,11 @@ var COMPACT_AGENT_SUMMARY_FIELDS = [
|
|
|
445
472
|
// 决策信息(CLI --show-unavailable 场景);默认列表已把这类 agent 过滤掉,
|
|
446
473
|
// 所以通常根本不占字节。
|
|
447
474
|
"nextAvailableAt",
|
|
475
|
+
// 额度快照:只有上游真上报过窗口的 agent 才带(通常是小对象)。
|
|
476
|
+
"quota",
|
|
448
477
|
"credentialGroup",
|
|
449
|
-
"credentialKind"
|
|
478
|
+
"credentialKind",
|
|
479
|
+
"credentialed"
|
|
450
480
|
];
|
|
451
481
|
function omitNullishAgentSummaryFields(summary) {
|
|
452
482
|
const result = {};
|
|
@@ -477,6 +507,7 @@ var UNAVAILABLE_AGENT_SUMMARY_FIELDS = [
|
|
|
477
507
|
"isOAuth",
|
|
478
508
|
"isOwned",
|
|
479
509
|
"nextAvailableAt",
|
|
510
|
+
"quota",
|
|
480
511
|
"favoritedAt",
|
|
481
512
|
"updatedAt"
|
|
482
513
|
];
|
|
@@ -496,12 +527,131 @@ function toUnavailableAgentSummary(summary) {
|
|
|
496
527
|
return item;
|
|
497
528
|
}
|
|
498
529
|
|
|
530
|
+
// packages/ai/agent/agentDiscovery.ts
|
|
531
|
+
function isPreferredAgent(agent) {
|
|
532
|
+
return agent.isFavorite === true || agent.isOwned === true || agent.isOAuth === true || agent.billingSource === "user_subscription" || agent.billingSource === "user_api" || agent.billingSource === "local";
|
|
533
|
+
}
|
|
534
|
+
function isPublicDiscoveryAgent(agent) {
|
|
535
|
+
return agent.isPublic === true && !isPreferredAgent(agent);
|
|
536
|
+
}
|
|
537
|
+
function resolveDiscoveryScope(args) {
|
|
538
|
+
const rawScope = typeof args?.scope === "string" ? args.scope.trim().toLowerCase() : void 0;
|
|
539
|
+
const hasScope = rawScope !== void 0 && rawScope !== "";
|
|
540
|
+
const hasPublicOnly = typeof args?.publicOnly === "boolean";
|
|
541
|
+
const publicOnly = args?.publicOnly === true;
|
|
542
|
+
if (hasScope) {
|
|
543
|
+
if (rawScope !== "preferred" && rawScope !== "public" && rawScope !== "all") {
|
|
544
|
+
throw new Error(`Invalid scope '${args?.scope}': must be 'preferred', 'public', or 'all'.`);
|
|
545
|
+
}
|
|
546
|
+
const scope = rawScope;
|
|
547
|
+
if (hasPublicOnly) {
|
|
548
|
+
if (publicOnly && scope !== "public") {
|
|
549
|
+
throw new Error(
|
|
550
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=true.`
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
if (!publicOnly && scope === "public") {
|
|
554
|
+
throw new Error(
|
|
555
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=false.`
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return scope;
|
|
560
|
+
}
|
|
561
|
+
if (hasPublicOnly && publicOnly) {
|
|
562
|
+
return "public";
|
|
563
|
+
}
|
|
564
|
+
return "preferred";
|
|
565
|
+
}
|
|
566
|
+
function agentIdentityKeys(agent) {
|
|
567
|
+
return [agent.agentKey, agent.publicKey, agent.id].filter(
|
|
568
|
+
(key) => typeof key === "string" && key.length > 0
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
function deduplicateAgentSummaries(agents) {
|
|
572
|
+
const byIdentity = /* @__PURE__ */ new Map();
|
|
573
|
+
for (const agent of agents) {
|
|
574
|
+
const keys = agentIdentityKeys(agent);
|
|
575
|
+
const existing = keys.map((key) => byIdentity.get(key)).find(Boolean);
|
|
576
|
+
if (!existing) {
|
|
577
|
+
for (const key of keys) byIdentity.set(key, agent);
|
|
578
|
+
continue;
|
|
579
|
+
}
|
|
580
|
+
const winner = isPreferredAgent(agent) && !isPreferredAgent(existing) ? agent : existing;
|
|
581
|
+
for (const key of /* @__PURE__ */ new Set([...agentIdentityKeys(existing), ...keys])) byIdentity.set(key, winner);
|
|
582
|
+
}
|
|
583
|
+
return [...new Set(byIdentity.values())];
|
|
584
|
+
}
|
|
585
|
+
function filterAgentsByScope(agents, scope) {
|
|
586
|
+
const unique = deduplicateAgentSummaries(agents);
|
|
587
|
+
if (scope === "preferred") return unique.filter((agent) => isPreferredAgent(agent));
|
|
588
|
+
if (scope === "public") return unique.filter((agent) => isPublicDiscoveryAgent(agent));
|
|
589
|
+
return unique.filter((agent) => isPreferredAgent(agent) || agent.isPublic === true);
|
|
590
|
+
}
|
|
591
|
+
function matchesAgentQuery(agent, query) {
|
|
592
|
+
if (!query || typeof query !== "string") return true;
|
|
593
|
+
const q = query.trim().toLowerCase();
|
|
594
|
+
if (!q) return true;
|
|
595
|
+
const candidates = [
|
|
596
|
+
agent.name,
|
|
597
|
+
agent.model,
|
|
598
|
+
agent.provider,
|
|
599
|
+
agent.handle,
|
|
600
|
+
agent.agentKey,
|
|
601
|
+
agent.publicKey,
|
|
602
|
+
agent.id
|
|
603
|
+
];
|
|
604
|
+
return candidates.some((text) => typeof text === "string" && text.toLowerCase().includes(q));
|
|
605
|
+
}
|
|
606
|
+
function buildAgentDiscoveryResult(options) {
|
|
607
|
+
const scope = resolveDiscoveryScope({
|
|
608
|
+
scope: options.scope,
|
|
609
|
+
publicOnly: options.publicOnly
|
|
610
|
+
});
|
|
611
|
+
const now = options.now ?? Date.now();
|
|
612
|
+
let scopedAgents = filterAgentsByScope(options.agents, scope);
|
|
613
|
+
if (options.query && typeof options.query === "string" && options.query.trim()) {
|
|
614
|
+
scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
|
|
615
|
+
}
|
|
616
|
+
const unavailableList = scopedAgents.filter((a) => isAgentUnavailableNow(a, now));
|
|
617
|
+
const unavailableCount = unavailableList.length;
|
|
618
|
+
const unavailableAgents = sortSafeAgentSummaries(unavailableList).map(toUnavailableAgentSummary);
|
|
619
|
+
const credentialGroups = summarizeCredentialGroups(scopedAgents, now);
|
|
620
|
+
if (options.showUnavailable !== true) {
|
|
621
|
+
scopedAgents = scopedAgents.filter((a) => !isAgentUnavailableNow(a, now));
|
|
622
|
+
}
|
|
623
|
+
const sortedAgents = sortSafeAgentSummaries(scopedAgents);
|
|
624
|
+
const projectedAgents = options.verbose === true ? sortedAgents.map(omitNullishAgentSummaryFields) : sortedAgents.map(toCompactAgentSummary);
|
|
625
|
+
return {
|
|
626
|
+
total: projectedAgents.length,
|
|
627
|
+
unavailableCount,
|
|
628
|
+
unavailableAgents,
|
|
629
|
+
credentialGroups,
|
|
630
|
+
agents: projectedAgents
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
function toDiscoverySafeAgentSummary(record, options) {
|
|
634
|
+
const mergedOptions = record?.publicRecordExists === true ? { ...options, publicRecordExists: true } : options;
|
|
635
|
+
return toSafeAgentSummary(record, mergedOptions);
|
|
636
|
+
}
|
|
637
|
+
function assembleAgentDiscoveryResult(options) {
|
|
638
|
+
const { records, summaryOptions, ...discoveryOptions } = options;
|
|
639
|
+
const agents = records.map(
|
|
640
|
+
(record) => toDiscoverySafeAgentSummary(
|
|
641
|
+
record,
|
|
642
|
+
typeof summaryOptions === "function" ? summaryOptions(record) : summaryOptions
|
|
643
|
+
)
|
|
644
|
+
);
|
|
645
|
+
return buildAgentDiscoveryResult({ ...discoveryOptions, agents });
|
|
646
|
+
}
|
|
647
|
+
|
|
499
648
|
export {
|
|
500
649
|
deriveCredentialGroup,
|
|
650
|
+
deriveCustomProviderCredentialGroup,
|
|
501
651
|
summarizeCredentialGroups,
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
652
|
+
resolveDiscoveryScope,
|
|
653
|
+
matchesAgentQuery,
|
|
654
|
+
buildAgentDiscoveryResult,
|
|
655
|
+
toDiscoverySafeAgentSummary,
|
|
656
|
+
assembleAgentDiscoveryResult
|
|
507
657
|
};
|
|
@@ -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,
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BPCPBG2O.js";
|
|
4
4
|
import {
|
|
5
5
|
prepareAndPersistMessage,
|
|
6
6
|
uiAskChoiceFunc,
|
|
7
7
|
uiAskChoiceFunctionSchema
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6PPDYAMH.js";
|
|
9
9
|
import {
|
|
10
10
|
require_date_fns
|
|
11
11
|
} from "./chunk-M76ECQRD.js";
|
|
12
12
|
import {
|
|
13
13
|
buildBuiltinObjectSkillReference
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EMBK4B7D.js";
|
|
15
15
|
import {
|
|
16
16
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
|
|
17
17
|
PLATFORM_HOSTED_KIMI_PROVIDER
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Y3PMXGLH.js";
|
|
19
19
|
import {
|
|
20
20
|
read,
|
|
21
21
|
readAndWait,
|
|
22
22
|
removeCachedEntity,
|
|
23
23
|
upsertSSREntity,
|
|
24
24
|
write
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QALRKMHF.js";
|
|
26
26
|
import {
|
|
27
27
|
createAgentKey,
|
|
28
28
|
createDialogKey,
|
|
@@ -30,10 +30,7 @@ import {
|
|
|
30
30
|
dialogMessageRange,
|
|
31
31
|
memoryOwnerRange,
|
|
32
32
|
memorySubjectKindRange
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
extractCustomId
|
|
36
|
-
} from "./chunk-GII32WZW.js";
|
|
33
|
+
} from "./chunk-3AH7LNUB.js";
|
|
37
34
|
import {
|
|
38
35
|
isDevelopment
|
|
39
36
|
} from "./chunk-QOKAKDPE.js";
|
|
@@ -43,6 +40,9 @@ import {
|
|
|
43
40
|
import {
|
|
44
41
|
isRecord
|
|
45
42
|
} from "./chunk-KUG52IAP.js";
|
|
43
|
+
import {
|
|
44
|
+
extractCustomId
|
|
45
|
+
} from "./chunk-M2EJHDJP.js";
|
|
46
46
|
import {
|
|
47
47
|
asTrimmedString
|
|
48
48
|
} from "./chunk-3EUW3WEO.js";
|