nolo-cli 0.92.0-alpha.1 → 0.92.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-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
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOLO_CHROME_CONNECTOR_EXTENSION_ID,
|
|
3
3
|
NOLO_CHROME_CONNECTOR_PROTOCOL_VERSION,
|
|
4
|
+
NOLO_CONNECTOR_EXTENSION_IDS,
|
|
5
|
+
NOLO_FIREFOX_CONNECTOR_EXTENSION_ID,
|
|
4
6
|
REQUIRED_CHROME_CONNECTOR_FEATURES,
|
|
5
7
|
createChromeConnectorClient
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YUNJN43V.js";
|
|
7
9
|
import {
|
|
8
10
|
toErrorMessage
|
|
9
11
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -21,6 +23,7 @@ import { dirname, resolve } from "node:path";
|
|
|
21
23
|
import { execFileSync } from "node:child_process";
|
|
22
24
|
import { fileURLToPath } from "node:url";
|
|
23
25
|
var DEFAULT_CONNECTOR_ROOT = dirname(fileURLToPath(import.meta.url));
|
|
26
|
+
var FIREFOX_EXTENSION_ID = "nolo-browser-connector@nolo.chat";
|
|
24
27
|
function extensionIdFromPublicKey(publicKeyBase64) {
|
|
25
28
|
const digest = createHash("sha256").update(Buffer.from(publicKeyBase64, "base64")).digest();
|
|
26
29
|
return Array.from(
|
|
@@ -40,8 +43,23 @@ function resolveNodePath() {
|
|
|
40
43
|
}
|
|
41
44
|
function nativeMessagingHostsDir({
|
|
42
45
|
home = process.env.HOME || "",
|
|
43
|
-
platform = process.platform
|
|
46
|
+
platform = process.platform,
|
|
47
|
+
browser = "chrome"
|
|
44
48
|
} = {}) {
|
|
49
|
+
if (browser === "firefox") {
|
|
50
|
+
if (platform === "darwin") {
|
|
51
|
+
return resolve(home, "Library/Application Support/Mozilla/NativeMessagingHosts");
|
|
52
|
+
}
|
|
53
|
+
if (platform === "linux") {
|
|
54
|
+
return resolve(home, ".mozilla/native-messaging-hosts");
|
|
55
|
+
}
|
|
56
|
+
throw new Error(
|
|
57
|
+
`Firefox native host installation is not implemented for platform "${platform}". Windows needs a registry value under HKCU\\Software\\Mozilla\\NativeMessagingHosts pointing at the manifest file.`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
if (browser !== "chrome") {
|
|
61
|
+
throw new Error(`Unknown native messaging browser target: "${browser}".`);
|
|
62
|
+
}
|
|
45
63
|
if (platform === "darwin") {
|
|
46
64
|
return resolve(home, "Library/Application Support/Google/Chrome/NativeMessagingHosts");
|
|
47
65
|
}
|
|
@@ -55,16 +73,18 @@ function nativeMessagingHostsDir({
|
|
|
55
73
|
function resolveNativeHostInstallPaths({
|
|
56
74
|
home = process.env.HOME || "",
|
|
57
75
|
connectorRoot = DEFAULT_CONNECTOR_ROOT,
|
|
58
|
-
platform = process.platform
|
|
76
|
+
platform = process.platform,
|
|
77
|
+
browser = "chrome"
|
|
59
78
|
} = {}) {
|
|
60
79
|
const supportDir = resolve(home, "Library/Application Support/Nolo/ChromeConnector");
|
|
61
80
|
return {
|
|
62
81
|
connectorRoot,
|
|
82
|
+
browser,
|
|
63
83
|
extensionManifestPath: resolve(connectorRoot, "extension", "manifest.json"),
|
|
64
84
|
hostPath: resolve(connectorRoot, "native-host", "nolo-chrome-native-host.mjs"),
|
|
65
85
|
templatePath: resolve(connectorRoot, "native-host", "com.nolo.chrome_connector.json"),
|
|
66
86
|
nativeManifestPath: resolve(
|
|
67
|
-
nativeMessagingHostsDir({ home, platform }),
|
|
87
|
+
nativeMessagingHostsDir({ home, platform, browser }),
|
|
68
88
|
"com.nolo.chrome_connector.json"
|
|
69
89
|
),
|
|
70
90
|
supportDir,
|
|
@@ -77,12 +97,13 @@ function installNativeHostManifest({
|
|
|
77
97
|
connectorRoot = DEFAULT_CONNECTOR_ROOT,
|
|
78
98
|
platform = process.platform,
|
|
79
99
|
extensionId,
|
|
80
|
-
nodePath
|
|
100
|
+
nodePath,
|
|
101
|
+
browser = "chrome"
|
|
81
102
|
} = {}) {
|
|
82
|
-
const paths = resolveNativeHostInstallPaths({ home, connectorRoot, platform });
|
|
103
|
+
const paths = resolveNativeHostInstallPaths({ home, connectorRoot, platform, browser });
|
|
83
104
|
const manifest = JSON.parse(readFileSync(paths.templatePath, "utf8"));
|
|
84
105
|
const extensionManifest = JSON.parse(readFileSync(paths.extensionManifestPath, "utf8"));
|
|
85
|
-
const resolvedExtensionId = extensionId || extensionIdFromPublicKey(extensionManifest.key);
|
|
106
|
+
const resolvedExtensionId = extensionId || (browser === "firefox" ? FIREFOX_EXTENSION_ID : extensionIdFromPublicKey(extensionManifest.key));
|
|
86
107
|
const resolvedNodePath = nodePath || resolveNodePath();
|
|
87
108
|
mkdirSync(paths.supportDir, { recursive: true });
|
|
88
109
|
const existingToken = existsSync(paths.tokenPath) ? readFileSync(paths.tokenPath, "utf8").trim() : "";
|
|
@@ -97,12 +118,18 @@ NOLO_CHROME_CONNECTOR_TOKEN=${JSON.stringify(token)} exec ${JSON.stringify(resol
|
|
|
97
118
|
);
|
|
98
119
|
chmodSync(paths.wrapperPath, 493);
|
|
99
120
|
manifest.path = paths.wrapperPath;
|
|
100
|
-
|
|
121
|
+
if (browser === "firefox") {
|
|
122
|
+
delete manifest.allowed_origins;
|
|
123
|
+
manifest.allowed_extensions = [FIREFOX_EXTENSION_ID];
|
|
124
|
+
} else {
|
|
125
|
+
manifest.allowed_origins = [`chrome-extension://${resolvedExtensionId}/`];
|
|
126
|
+
}
|
|
101
127
|
mkdirSync(dirname(paths.nativeManifestPath), { recursive: true });
|
|
102
128
|
writeFileSync(paths.nativeManifestPath, `${JSON.stringify(manifest, null, 2)}
|
|
103
129
|
`);
|
|
104
130
|
return {
|
|
105
131
|
extensionId: resolvedExtensionId,
|
|
132
|
+
browser,
|
|
106
133
|
nodePath: resolvedNodePath,
|
|
107
134
|
tokenPath: paths.tokenPath,
|
|
108
135
|
...paths
|
|
@@ -119,6 +146,21 @@ var CLI_CONNECTOR_ROOT_CANDIDATES = [
|
|
|
119
146
|
var FULL_SUPPORT_CHROME_FEATURES = [
|
|
120
147
|
...new Set(Object.values(REQUIRED_CHROME_CONNECTOR_FEATURES).flat())
|
|
121
148
|
].sort();
|
|
149
|
+
var FIREFOX_UNAVAILABLE_FEATURES = ["browser_debug", "file_upload"];
|
|
150
|
+
function resolveConnectorBrowser(extensionId) {
|
|
151
|
+
if (!extensionId) return null;
|
|
152
|
+
if (extensionId === NOLO_FIREFOX_CONNECTOR_EXTENSION_ID) return "firefox";
|
|
153
|
+
if (NOLO_CONNECTOR_EXTENSION_IDS.includes(extensionId)) return "chrome";
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
function expectedFeaturesForBrowser(browser) {
|
|
157
|
+
return browser === "firefox" ? FULL_SUPPORT_CHROME_FEATURES.filter(
|
|
158
|
+
(feature) => !FIREFOX_UNAVAILABLE_FEATURES.includes(feature)
|
|
159
|
+
) : FULL_SUPPORT_CHROME_FEATURES;
|
|
160
|
+
}
|
|
161
|
+
function browserLabel(browser) {
|
|
162
|
+
return browser === "firefox" ? "Firefox" : browser === "chrome" ? "Chrome" : "browser";
|
|
163
|
+
}
|
|
122
164
|
function pickCliConnectorRoot(candidates) {
|
|
123
165
|
for (const candidate of candidates) {
|
|
124
166
|
if (existsSync2(resolve2(candidate, "extension", "manifest.json"))) return candidate;
|
|
@@ -233,9 +275,13 @@ async function probeConnectorRpc(requestChrome) {
|
|
|
233
275
|
}
|
|
234
276
|
}
|
|
235
277
|
function resolveStatusNextStep(report) {
|
|
278
|
+
const targetBrowser = report.rpc.browser ?? report.nativeHost.browser;
|
|
279
|
+
const installCmd = targetBrowser === "firefox" ? "nolo chrome install --browser firefox" : "nolo chrome install";
|
|
280
|
+
const connectedLabel = browserLabel(targetBrowser);
|
|
281
|
+
const browserText = connectedLabel === "browser" ? "the browser" : connectedLabel;
|
|
236
282
|
if (!report.connectorRoot) {
|
|
237
283
|
if (report.rpc.online && report.rpc.protocolVersion === report.rpc.expectedProtocolVersion) {
|
|
238
|
-
return "
|
|
284
|
+
return "The Nolo Browser Connector is online, but this CLI cannot see a connector checkout, so `nolo chrome install` / manifest checks are unavailable here. Set NOLO_CHROME_CONNECTOR_ROOT (or run the CLI from a repo checkout) to enable them.";
|
|
239
285
|
}
|
|
240
286
|
return "Run the CLI from a repo checkout that contains packages/desktop-chrome-connector, or set NOLO_CHROME_CONNECTOR_ROOT to one, then rerun `nolo chrome status`.";
|
|
241
287
|
}
|
|
@@ -243,20 +289,20 @@ function resolveStatusNextStep(report) {
|
|
|
243
289
|
return `This platform has no supported native messaging host install (Chrome looks the host up through a registry value on Windows), so non-interactive install is not available: ${report.nativeHost.platformError ?? "unsupported platform"}`;
|
|
244
290
|
}
|
|
245
291
|
if (!report.nativeHost.installed || !report.token.present) {
|
|
246
|
-
return
|
|
292
|
+
return installCmd;
|
|
247
293
|
}
|
|
248
294
|
if (!report.nativeHost.wrapperPathMatches || !report.nativeHost.allowedOriginMatches) {
|
|
249
295
|
const installedWrapperPath = report.nativeHost.installedWrapperPath;
|
|
250
296
|
if (!report.nativeHost.wrapperPathMatches && installedWrapperPath && installedWrapperPath !== report.nativeHost.wrapperPath && existsSync2(installedWrapperPath)) {
|
|
251
|
-
return `Native host is installed for a different checkout (${installedWrapperPath}); this CLI is looking at ${report.connectorRoot}. Run \`nolo chrome status\` from the checkout that installed it, or run \`
|
|
297
|
+
return `Native host is installed for a different checkout (${installedWrapperPath}); this CLI is looking at ${report.connectorRoot}. Run \`nolo chrome status\` from the checkout that installed it, or run \`${installCmd}\` from here only if ${browserText} should switch to this one.`;
|
|
252
298
|
}
|
|
253
|
-
return
|
|
299
|
+
return `${installCmd} (the installed manifest does not point at this checkout's wrapper / extension id, which ${browserText} silently ignores)`;
|
|
254
300
|
}
|
|
255
301
|
if (!report.rpc.online) {
|
|
256
|
-
return `Load the unpacked extension from ${report.extension.path} in chrome://extensions (
|
|
302
|
+
return `Load the unpacked extension from ${report.extension.path} in chrome://extensions (Chrome) or about:debugging#/runtime/this-firefox (Firefox), or install the Nolo Browser Connector from https://nolo.chat/downloads, then rerun \`nolo chrome status\`.`;
|
|
257
303
|
}
|
|
258
|
-
if (report.rpc.extensionId && report.rpc.
|
|
259
|
-
return `The connected extension (${report.rpc.extensionId}) is not
|
|
304
|
+
if (report.rpc.extensionId && report.rpc.browser === null) {
|
|
305
|
+
return `The connected extension (${report.rpc.extensionId}) is not a recognized Nolo Browser Connector build; reload it (\`nolo chrome reload\`) or remove the other copy, then rerun \`nolo chrome status\`.`;
|
|
260
306
|
}
|
|
261
307
|
if (report.rpc.protocolVersion !== report.rpc.expectedProtocolVersion) {
|
|
262
308
|
return `nolo chrome reload (the running extension does not speak protocol ${report.rpc.expectedProtocolVersion}; a reload restarts the worker with the files on disk)`;
|
|
@@ -264,7 +310,7 @@ function resolveStatusNextStep(report) {
|
|
|
264
310
|
if (report.rpc.missingFeatures.length > 0) {
|
|
265
311
|
return `nolo chrome reload (the running extension is missing ${report.rpc.missingFeatures.join(", ")}); if that persists, the checkout's extension is older than the CLI expects.`;
|
|
266
312
|
}
|
|
267
|
-
return
|
|
313
|
+
return `The Nolo Browser Connector is online (${connectedLabel}): connector tools execute against this ${connectedLabel} profile.`;
|
|
268
314
|
}
|
|
269
315
|
async function buildChromeConnectorStatus(args = {}) {
|
|
270
316
|
const env = args.env ?? process.env;
|
|
@@ -295,7 +341,8 @@ async function buildChromeConnectorStatus(args = {}) {
|
|
|
295
341
|
wrapperPath: null,
|
|
296
342
|
installedWrapperPath: null,
|
|
297
343
|
wrapperPathMatches: false,
|
|
298
|
-
allowedOriginMatches: false
|
|
344
|
+
allowedOriginMatches: false,
|
|
345
|
+
browser: null
|
|
299
346
|
},
|
|
300
347
|
token: { path: null, present: false },
|
|
301
348
|
rpc: {
|
|
@@ -303,6 +350,7 @@ async function buildChromeConnectorStatus(args = {}) {
|
|
|
303
350
|
extensionId: null,
|
|
304
351
|
protocolVersion: null,
|
|
305
352
|
features: [],
|
|
353
|
+
browser: null,
|
|
306
354
|
missingFeatures: [...FULL_SUPPORT_CHROME_FEATURES],
|
|
307
355
|
expectedProtocolVersion: NOLO_CHROME_CONNECTOR_PROTOCOL_VERSION
|
|
308
356
|
},
|
|
@@ -314,19 +362,48 @@ async function buildChromeConnectorStatus(args = {}) {
|
|
|
314
362
|
report.rpc.extensionId = probe.extensionId;
|
|
315
363
|
report.rpc.protocolVersion = probe.protocolVersion;
|
|
316
364
|
report.rpc.features = probe.features;
|
|
317
|
-
report.rpc.
|
|
365
|
+
report.rpc.browser = probe.online ? resolveConnectorBrowser(probe.extensionId) ?? (probe.extensionId === expectedId ? "chrome" : null) : null;
|
|
366
|
+
report.rpc.missingFeatures = expectedFeaturesForBrowser(report.rpc.browser).filter(
|
|
318
367
|
(feature) => !probe.features.includes(feature)
|
|
319
368
|
);
|
|
320
369
|
if (!probe.online) report.rpc.error = probe.error;
|
|
321
370
|
if (!connectorRoot) {
|
|
322
371
|
if (rootError) report.connectorRootError = rootError;
|
|
323
|
-
report.
|
|
372
|
+
report.nativeHost.browser = report.rpc.browser;
|
|
373
|
+
report.ok = report.rpc.online && report.rpc.browser !== null && probe.protocolVersion === NOLO_CHROME_CONNECTOR_PROTOCOL_VERSION && report.rpc.missingFeatures.length === 0;
|
|
324
374
|
report.nextStep = resolveStatusNextStep(report);
|
|
325
375
|
return report;
|
|
326
376
|
}
|
|
377
|
+
let manifestBrowser = report.rpc.browser === "firefox" ? "firefox" : "chrome";
|
|
378
|
+
if (!report.rpc.browser) {
|
|
379
|
+
try {
|
|
380
|
+
const chromeManifestPath = resolveNativeHostInstallPaths({
|
|
381
|
+
home,
|
|
382
|
+
connectorRoot,
|
|
383
|
+
platform,
|
|
384
|
+
browser: "chrome"
|
|
385
|
+
}).nativeManifestPath;
|
|
386
|
+
const firefoxManifestPath = resolveNativeHostInstallPaths({
|
|
387
|
+
home,
|
|
388
|
+
connectorRoot,
|
|
389
|
+
platform,
|
|
390
|
+
browser: "firefox"
|
|
391
|
+
}).nativeManifestPath;
|
|
392
|
+
if (!existsSync2(chromeManifestPath) && existsSync2(firefoxManifestPath)) {
|
|
393
|
+
manifestBrowser = "firefox";
|
|
394
|
+
}
|
|
395
|
+
} catch {
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
report.nativeHost.browser = manifestBrowser;
|
|
327
399
|
let paths = null;
|
|
328
400
|
try {
|
|
329
|
-
paths = resolveNativeHostInstallPaths({
|
|
401
|
+
paths = resolveNativeHostInstallPaths({
|
|
402
|
+
home,
|
|
403
|
+
connectorRoot,
|
|
404
|
+
platform,
|
|
405
|
+
browser: manifestBrowser
|
|
406
|
+
});
|
|
330
407
|
} catch (error) {
|
|
331
408
|
report.nativeHost.supported = false;
|
|
332
409
|
report.nativeHost.platformError = toErrorMessage(error);
|
|
@@ -340,8 +417,7 @@ async function buildChromeConnectorStatus(args = {}) {
|
|
|
340
417
|
report.nativeHost.installed = installedManifest !== null;
|
|
341
418
|
report.nativeHost.installedWrapperPath = typeof installedManifest?.path === "string" ? installedManifest.path : null;
|
|
342
419
|
report.nativeHost.wrapperPathMatches = report.nativeHost.installedWrapperPath === paths.wrapperPath;
|
|
343
|
-
|
|
344
|
-
report.nativeHost.allowedOriginMatches = Array.isArray(installedManifest?.allowed_origins) && installedManifest.allowed_origins.includes(expectedOrigin);
|
|
420
|
+
report.nativeHost.allowedOriginMatches = manifestBrowser === "firefox" ? Array.isArray(installedManifest?.allowed_extensions) && installedManifest.allowed_extensions.includes(NOLO_FIREFOX_CONNECTOR_EXTENSION_ID) : Array.isArray(installedManifest?.allowed_origins) && installedManifest.allowed_origins.includes(`chrome-extension://${expectedId}/`);
|
|
345
421
|
if (existsSync2(paths.tokenPath)) {
|
|
346
422
|
try {
|
|
347
423
|
report.token.present = readFileSync2(paths.tokenPath, "utf8").trim().length > 0;
|
|
@@ -349,7 +425,7 @@ async function buildChromeConnectorStatus(args = {}) {
|
|
|
349
425
|
report.token.present = false;
|
|
350
426
|
}
|
|
351
427
|
}
|
|
352
|
-
report.ok = report.nativeHost.supported && report.nativeHost.installed && report.nativeHost.wrapperPathMatches && report.nativeHost.allowedOriginMatches && report.token.present && probe.online &&
|
|
428
|
+
report.ok = report.nativeHost.supported && report.nativeHost.installed && report.nativeHost.wrapperPathMatches && report.nativeHost.allowedOriginMatches && report.token.present && probe.online && report.rpc.browser !== null && probe.protocolVersion === NOLO_CHROME_CONNECTOR_PROTOCOL_VERSION && report.rpc.missingFeatures.length === 0;
|
|
353
429
|
report.nextStep = resolveStatusNextStep(report);
|
|
354
430
|
return report;
|
|
355
431
|
}
|
|
@@ -357,7 +433,7 @@ function yesNo(value) {
|
|
|
357
433
|
return value ? "ok" : "mismatch";
|
|
358
434
|
}
|
|
359
435
|
function formatChromeConnectorStatus(report) {
|
|
360
|
-
const lines = ["Nolo
|
|
436
|
+
const lines = ["Nolo Browser Connector"];
|
|
361
437
|
lines.push(
|
|
362
438
|
` connector source : ${report.connectorRoot ?? "(not found)"}`
|
|
363
439
|
);
|
|
@@ -377,7 +453,7 @@ function formatChromeConnectorStatus(report) {
|
|
|
377
453
|
const rpc = report.rpc;
|
|
378
454
|
if (rpc.online) {
|
|
379
455
|
lines.push(
|
|
380
|
-
` RPC : online extension ${rpc.extensionId ?? "unknown"} protocolVersion ${rpc.protocolVersion ?? "unknown"} features ${rpc.features.length > 0 ? rpc.features.join(", ") : "(none)"}`
|
|
456
|
+
` RPC : online browser ${rpc.browser ?? "unrecognized"} extension ${rpc.extensionId ?? "unknown"} protocolVersion ${rpc.protocolVersion ?? "unknown"} features ${rpc.features.length > 0 ? rpc.features.join(", ") : "(none)"}`
|
|
381
457
|
);
|
|
382
458
|
} else {
|
|
383
459
|
lines.push(
|
|
@@ -406,9 +482,25 @@ async function runChromeStatusCommand(args, deps = {}) {
|
|
|
406
482
|
}
|
|
407
483
|
return report.ok ? 0 : 1;
|
|
408
484
|
}
|
|
485
|
+
function readBrowserOption(args) {
|
|
486
|
+
const equalsForm = args.find((arg) => arg.startsWith("--browser="));
|
|
487
|
+
const index = args.indexOf("--browser");
|
|
488
|
+
const raw = equalsForm !== void 0 ? equalsForm.slice("--browser=".length) : index >= 0 ? args[index + 1] : void 0;
|
|
489
|
+
if (raw === void 0) return "chrome";
|
|
490
|
+
const value = raw.trim();
|
|
491
|
+
if (value === "chrome" || value === "firefox") return value;
|
|
492
|
+
return null;
|
|
493
|
+
}
|
|
409
494
|
async function runChromeInstallCommand(args, deps = {}) {
|
|
410
495
|
const env = deps.env ?? process.env;
|
|
411
496
|
const output = deps.output ?? process.stdout;
|
|
497
|
+
const browser = readBrowserOption(args);
|
|
498
|
+
if (browser === null) {
|
|
499
|
+
output.write(
|
|
500
|
+
'[nolo] Chrome native host install failed: --browser must be "chrome" or "firefox".\n'
|
|
501
|
+
);
|
|
502
|
+
return 1;
|
|
503
|
+
}
|
|
412
504
|
const install = deps.installNativeHost ?? installNativeHostManifest;
|
|
413
505
|
let connectorRoot;
|
|
414
506
|
try {
|
|
@@ -432,6 +524,7 @@ async function runChromeInstallCommand(args, deps = {}) {
|
|
|
432
524
|
result = install({
|
|
433
525
|
home: deps.home ?? env.HOME ?? "",
|
|
434
526
|
connectorRoot,
|
|
527
|
+
browser,
|
|
435
528
|
...deps.platform ? { platform: deps.platform } : {},
|
|
436
529
|
...deps.nodePath ? { nodePath: deps.nodePath } : {}
|
|
437
530
|
});
|
|
@@ -446,12 +539,12 @@ async function runChromeInstallCommand(args, deps = {}) {
|
|
|
446
539
|
} else {
|
|
447
540
|
output.write(
|
|
448
541
|
[
|
|
449
|
-
|
|
542
|
+
`Nolo Browser Connector native host installed (${browser}).`,
|
|
450
543
|
` manifest : ${result.nativeManifestPath}`,
|
|
451
544
|
` wrapper : ${result.wrapperPath} -> ${result.nodePath}`,
|
|
452
545
|
` token : ${result.tokenPath} (an existing token is kept, so reruns are idempotent)`,
|
|
453
546
|
` extension: ${result.extensionId}`,
|
|
454
|
-
`Next step: load the unpacked extension from ${resolve2(connectorRoot, "extension")} in chrome://extensions (Developer mode) or install
|
|
547
|
+
`Next step: load the unpacked extension from ${resolve2(connectorRoot, "extension")} in ` + (browser === "firefox" ? "about:debugging#/runtime/this-firefox, or install the signed Nolo Browser Connector add-on from https://nolo.chat/downloads, then run `nolo chrome status`." : "chrome://extensions (Developer mode), or install the Nolo Browser Connector from https://nolo.chat/downloads (Chrome or Firefox), then run `nolo chrome status`."),
|
|
455
548
|
""
|
|
456
549
|
].join("\n")
|
|
457
550
|
);
|
|
@@ -480,7 +573,7 @@ The connector service worker restarts within ~1s; verify with \`nolo chrome stat
|
|
|
480
573
|
`);
|
|
481
574
|
if (code === "CHROME_CONNECTOR_UNAVAILABLE") {
|
|
482
575
|
output.write(
|
|
483
|
-
"The native host is not reachable: load the unpacked connector extension in chrome://extensions
|
|
576
|
+
"The native host is not reachable: open Chrome or Firefox with the Nolo Browser Connector extension enabled, or install it from https://nolo.chat/downloads (or load the unpacked connector extension in chrome://extensions), then rerun `nolo chrome reload`.\n"
|
|
484
577
|
);
|
|
485
578
|
}
|
|
486
579
|
return 1;
|
|
@@ -488,11 +581,14 @@ The connector service worker restarts within ~1s; verify with \`nolo chrome stat
|
|
|
488
581
|
}
|
|
489
582
|
export {
|
|
490
583
|
CLI_CONNECTOR_ROOT_CANDIDATES,
|
|
584
|
+
FIREFOX_UNAVAILABLE_FEATURES,
|
|
491
585
|
FULL_SUPPORT_CHROME_FEATURES,
|
|
492
586
|
buildChromeConnectorStatus,
|
|
493
587
|
detectWorktreeCheckout,
|
|
588
|
+
expectedFeaturesForBrowser,
|
|
494
589
|
formatChromeConnectorStatus,
|
|
495
590
|
resolveCliConnectorRoot,
|
|
591
|
+
resolveConnectorBrowser,
|
|
496
592
|
runChromeInstallCommand,
|
|
497
593
|
runChromeReloadCommand,
|
|
498
594
|
runChromeStatusCommand
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createChromeConnectorClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YUNJN43V.js";
|
|
4
4
|
import {
|
|
5
5
|
toErrorMessage
|
|
6
6
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -197,8 +197,8 @@ var CHROME_OPS_SUBCOMMANDS = {
|
|
|
197
197
|
};
|
|
198
198
|
function renderChromeOpsHelp() {
|
|
199
199
|
const lines = [
|
|
200
|
-
"Operate the user's Chrome through the Nolo
|
|
201
|
-
"the same RPC the
|
|
200
|
+
"Operate the user's browser (Chrome or Firefox) through the Nolo Browser Connector",
|
|
201
|
+
"(the desktop bridge; the same RPC the browser_* agent tools use \u2014 legacy `chrome_*` names still work).",
|
|
202
202
|
"",
|
|
203
203
|
"Usage:",
|
|
204
204
|
" nolo chrome <subcommand> [flags]",
|
|
@@ -213,6 +213,7 @@ function renderChromeOpsHelp() {
|
|
|
213
213
|
" preferred over --selector); --selector takes a CSS selector.",
|
|
214
214
|
" Actions the connector classifies as irreversible (Submit / Delete / Pay ...)",
|
|
215
215
|
" are refused with CONFIRMATION_REQUIRED \u2014 ask the user to perform them.",
|
|
216
|
+
" read-console / read-network / upload work on Chrome only (Firefox lacks chrome.debugger).",
|
|
216
217
|
" Every subcommand prints the connector's raw JSON result; failures exit 1.",
|
|
217
218
|
" Endpoint: NOLO_CHROME_CONNECTOR_RPC_URL or http://127.0.0.1:38947/rpc."
|
|
218
219
|
];
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
resolvePlatformChatCompletionsEndpoint,
|
|
4
4
|
resolvePlatformHostedCredentialProvider,
|
|
5
5
|
resolvePlatformResponsesEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7KVZ5LDQ.js";
|
|
7
7
|
import {
|
|
8
8
|
CLI_PROVIDER_VALUES
|
|
9
9
|
} from "./chunk-W7XHHYWM.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
CLIENT_VERSION_TOO_OLD_CODE,
|
|
12
12
|
buildClientVersionGateErrorDetail,
|
|
13
13
|
evaluatePlatformHostedClientVersionGate
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-Y3PMXGLH.js";
|
|
15
15
|
import {
|
|
16
16
|
asTrimmedLowercaseString
|
|
17
17
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -164,10 +164,28 @@ function resolveProviderAuthHeaderName(args) {
|
|
|
164
164
|
if (/xiaomimimo\.com/i.test(args.endpoint)) return "api-key";
|
|
165
165
|
return "Authorization";
|
|
166
166
|
}
|
|
167
|
+
var OPENCODE_GO_ENDPOINT_RE = /^https?:\/\/opencode\.ai\/zen\/go\//i;
|
|
168
|
+
var OPENCODE_SESSION_HEADER = "x-opencode-session";
|
|
169
|
+
var OPENCODE_USER_AGENT = "nolo-agent/1.0";
|
|
170
|
+
var PROCESS_FALLBACK_SESSION_ID = `nolo-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
|
|
171
|
+
function isOpenCodeGoEndpoint(endpoint) {
|
|
172
|
+
return typeof endpoint === "string" && OPENCODE_GO_ENDPOINT_RE.test(endpoint.trim());
|
|
173
|
+
}
|
|
174
|
+
function buildProviderSessionHeaders(args) {
|
|
175
|
+
if (!isOpenCodeGoEndpoint(args.endpoint)) return {};
|
|
176
|
+
return {
|
|
177
|
+
[OPENCODE_SESSION_HEADER]: args.sessionId?.trim() || PROCESS_FALLBACK_SESSION_ID,
|
|
178
|
+
"User-Agent": OPENCODE_USER_AGENT
|
|
179
|
+
};
|
|
180
|
+
}
|
|
167
181
|
function buildProviderAuthHeaders(args) {
|
|
168
|
-
|
|
182
|
+
const sessionHeaders = buildProviderSessionHeaders(args);
|
|
183
|
+
if (!args.apiKey) return sessionHeaders;
|
|
169
184
|
const headerName = resolveProviderAuthHeaderName(args);
|
|
170
|
-
return
|
|
185
|
+
return {
|
|
186
|
+
...sessionHeaders,
|
|
187
|
+
...headerName.toLowerCase() === "authorization" ? { Authorization: `Bearer ${args.apiKey}` } : { [headerName]: args.apiKey }
|
|
188
|
+
};
|
|
171
189
|
}
|
|
172
190
|
async function buildProviderExecutionPlan(args) {
|
|
173
191
|
const { agentConfig, env } = args;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearCliLocalRuntimePreparedAgentCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PHINMJJZ.js";
|
|
4
4
|
import {
|
|
5
5
|
getReadableCliDb
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CTUQJVQM.js";
|
|
7
7
|
import {
|
|
8
8
|
buildCreatedAgentRecord,
|
|
9
9
|
buildUpdatedAgentRecord,
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
resolveAgentRecordFromHybridStore,
|
|
13
13
|
sanitizeAgentRecordForCliOutput,
|
|
14
14
|
writeAgentRecord
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IBQ6NJI4.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveCliAgentKeyInput
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SV5IJK6K.js";
|
|
19
19
|
import {
|
|
20
20
|
toErrorMessage
|
|
21
21
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -212,7 +212,7 @@ async function runAgentCreateCommand(args, deps = {}) {
|
|
|
212
212
|
clearCliLocalRuntimePreparedAgentCache();
|
|
213
213
|
let verifyResult;
|
|
214
214
|
if (parsed.verify) {
|
|
215
|
-
const { verifyCustomProvider } = await import("./agentProviderCommands-
|
|
215
|
+
const { verifyCustomProvider } = await import("./agentProviderCommands-TWB6E5WD.js");
|
|
216
216
|
const rec = built.nextRecord;
|
|
217
217
|
verifyResult = await verifyCustomProvider({
|
|
218
218
|
providerUrl: rec.customProviderUrl,
|
|
@@ -222,15 +222,34 @@ async function runAgentCreateCommand(args, deps = {}) {
|
|
|
222
222
|
fetchImpl
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
|
+
const apiKeyRef = String(built.updates?.apiKeyRef || "").trim();
|
|
226
|
+
let authHint;
|
|
227
|
+
const OAUTH_REFS = /* @__PURE__ */ new Set(["claude", "chatgpt", "xai", "antigravity", "cloudflare"]);
|
|
228
|
+
if (apiKeyRef && OAUTH_REFS.has(apiKeyRef)) {
|
|
229
|
+
try {
|
|
230
|
+
const { createOAuthTokenStore } = await import("./oauthTokenStore-ITEB663N.js");
|
|
231
|
+
const store = createOAuthTokenStore();
|
|
232
|
+
if (!store.read(apiKeyRef)) {
|
|
233
|
+
authHint = `Subscription "${apiKeyRef}" is not authorized yet. Run \`nolo auth ${apiKeyRef}\` to log in.`;
|
|
234
|
+
}
|
|
235
|
+
} catch {
|
|
236
|
+
}
|
|
237
|
+
}
|
|
225
238
|
output.write(JSON.stringify({
|
|
226
239
|
ok: true,
|
|
227
240
|
agentKey: built.agentKey,
|
|
228
241
|
baseUrl: built.serverUrl,
|
|
229
242
|
updates: sanitizeAgentRecordForCliOutput(built.updates),
|
|
230
243
|
record: sanitizeAgentRecordForCliOutput(built.nextRecord),
|
|
231
|
-
...verifyResult ? { verify: verifyResult } : {}
|
|
244
|
+
...verifyResult ? { verify: verifyResult } : {},
|
|
245
|
+
...authHint ? { hint: authHint } : {}
|
|
232
246
|
}, null, 2));
|
|
233
247
|
output.write("\n");
|
|
248
|
+
if (authHint) {
|
|
249
|
+
const errorOutput = deps.error ?? process.stderr;
|
|
250
|
+
errorOutput.write(`[nolo] Hint: ${authHint}
|
|
251
|
+
`);
|
|
252
|
+
}
|
|
234
253
|
return 0;
|
|
235
254
|
} catch (error) {
|
|
236
255
|
output.write(
|