nolo-cli 0.74.0-alpha.2 → 0.75.0-alpha.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/{_executeModel-YEVZAJYX.js → _executeModel-CNEEELFV.js} +10 -10
- package/agentDeleteCommand-WVO3JTH6.js +1 -1
- package/{agentEmailCommands-QYQ2DZUS.js → agentEmailCommands-VX5OYTHG.js} +11 -10
- package/agentListCommands-XWLQZ2ZH.js +1 -1
- package/{agentMachineCommands-BJZUZ2EY.js → agentMachineCommands-IG6KJFNN.js} +2 -2
- package/{agentRecordCommands-O6PYBK2A.js → agentRecordCommands-V5LRQDDX.js} +11 -10
- package/{agentRunCommand-POFC5W46.js → agentRunCommand-RUUOF2DY.js} +11 -10
- package/{agentSlice-RRZS2UII.js → agentSlice-S3JFDTH4.js} +1 -1
- package/appDeleteCommands-426QK2XG.js +1 -1
- package/appDeployCommands-FIGFGXIJ.js +1 -1
- package/appDeployStatusCommands-D3B235FQ.js +1 -1
- package/appGetCommands-U6RZJII4.js +1 -1
- package/appListCommands-732PFEWM.js +1 -1
- package/{chatQueueReduxAdapter-LSBTGZW2.js → chatQueueReduxAdapter-CHJZ2O2P.js} +2 -2
- package/chromeCommands-VOIRNJBL.js +499 -0
- package/chromeOpsCommands-M7DPCX2T.js +258 -0
- package/{chunk-SJTCDYBY.js → chunk-5WUTIRKL.js} +5 -5
- package/{chunk-TI4CCL34.js → chunk-6RUYWJXO.js} +3 -3
- package/{chunk-57VRXRLF.js → chunk-BNLAGFPO.js} +1 -1
- package/{chunk-QBA5KMJI.js → chunk-D42DMWKD.js} +22 -8
- package/{chunk-XGZM6BTX.js → chunk-DDWYTB5N.js} +1 -1
- package/{chunk-AWPU7GXU.js → chunk-ITFKTCHH.js} +2 -2
- package/{chunk-I4UWPYBH.js → chunk-KG7ANYLN.js} +2 -2
- package/{chunk-HSELVGAL.js → chunk-MWV66JTV.js} +1 -1
- package/{chunk-XPQJXIF5.js → chunk-NU6FRRNU.js} +43 -4
- package/{chunk-VOEW2KF3.js → chunk-PEBKIEA5.js} +8 -8
- package/chunk-QCZX4FTW.js +242 -0
- package/{chunk-VE3O45CJ.js → chunk-RUX46F4O.js} +2 -2
- package/{chunk-2JCTE5UN.js → chunk-WD4SMAPR.js} +2 -2
- package/{chunk-DFY6PUV4.js → chunk-ZHIOJU46.js} +5 -5
- package/{chunk-CS36XM4N.js → chunk-ZNZCVXRV.js} +3 -3
- package/{contentThunks-476Y6CFR.js → contentThunks-P73Q4WUM.js} +3 -3
- package/{createAgentAutomationAction-DN4SFTP5.js → createAgentAutomationAction-JLHVMB4X.js} +3 -3
- package/{createDialogAction-2GS4JCMU.js → createDialogAction-6ZKSFM5O.js} +4 -4
- package/{createPageAction-44WTUMZ5.js → createPageAction-MN4VOJYH.js} +3 -3
- package/dialogCommands-7FH6Z2YK.js +1 -1
- package/{dialogSlice-7HEVCJFT.js → dialogSlice-P2G3GRRG.js} +2 -2
- package/docCreateCommands-GN5E5ULM.js +1 -1
- package/docDeleteCommands-OQWPPQME.js +1 -1
- package/docReadCommands-E4QK2223.js +1 -1
- package/{docStore-LJ7KNKFB.js → docStore-GUHCPV37.js} +1 -1
- package/docUpdateCommands-ZDJE4SI7.js +1 -1
- package/{handleSendMessageAction-ETA5QZIN.js → handleSendMessageAction-NLDMT3LZ.js} +2 -2
- package/index.js +75 -15
- package/{machineCommands-SJLMLCCV.js → machineCommands-BCCBSQQR.js} +11 -10
- package/{machineWsRunDispatch-74GHVCNY.js → machineWsRunDispatch-7FMVGMI6.js} +11 -10
- package/package.json +1 -1
- package/{readlineWorkspace-XHS5C5F7.js → readlineWorkspace-S5ZQIVWS.js} +11 -10
- package/{runAgentClientLoop-2PGZSCET.js → runAgentClientLoop-UANNODBO.js} +8 -8
- package/spaceCommands-GSQCO2LI.js +1 -1
- package/{streamAgentChatTurn-I6FUM6RV.js → streamAgentChatTurn-76WFI2YK.js} +9 -9
- package/{tools-KU4X5HGZ.js → tools-XJGU2HAF.js} +6 -6
- package/{updateDialogTitleAction-E3SNB75W.js → updateDialogTitleAction-5BHRK2XV.js} +3 -3
- package/{agentRuntimeLocal-O6DZDTK4.js → agentRuntimeLocal-ZSUEMWRL.js} +1 -1
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createChromeConnectorClient
|
|
3
|
+
} from "./chunk-QCZX4FTW.js";
|
|
4
|
+
import {
|
|
5
|
+
toErrorMessage
|
|
6
|
+
} from "./chunk-HNMXYYJR.js";
|
|
7
|
+
import {
|
|
8
|
+
readOption
|
|
9
|
+
} from "./chunk-A7GB5UGH.js";
|
|
10
|
+
import "./chunk-OLZBQWZU.js";
|
|
11
|
+
import "./chunk-KUG52IAP.js";
|
|
12
|
+
import "./chunk-LCBAMY2M.js";
|
|
13
|
+
import "./chunk-4SN6J65J.js";
|
|
14
|
+
import "./chunk-CF7PE763.js";
|
|
15
|
+
import "./chunk-G3SUCT4W.js";
|
|
16
|
+
import "./chunk-4VNS5WPM.js";
|
|
17
|
+
|
|
18
|
+
// packages/cli/chromeOpsCommands.ts
|
|
19
|
+
import { writeFile } from "node:fs/promises";
|
|
20
|
+
function wantsHelp(args) {
|
|
21
|
+
return args.includes("--help") || args.includes("-h");
|
|
22
|
+
}
|
|
23
|
+
function readTrimmedOption(args, flag) {
|
|
24
|
+
return (readOption(args, flag) ?? "").trim();
|
|
25
|
+
}
|
|
26
|
+
function readIntOption(args, flag, usage) {
|
|
27
|
+
const raw = readOption(args, flag);
|
|
28
|
+
if (raw === void 0) return void 0;
|
|
29
|
+
const value = Number.parseInt(raw, 10);
|
|
30
|
+
if (!Number.isFinite(value)) {
|
|
31
|
+
throw new Error(`Invalid ${flag} <N>. Usage: ${usage}`);
|
|
32
|
+
}
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
function requireTabId(args, usage) {
|
|
36
|
+
const tabId = readTrimmedOption(args, "--tab");
|
|
37
|
+
if (!tabId) {
|
|
38
|
+
throw new Error(`Missing required --tab <id>. Usage: ${usage}`);
|
|
39
|
+
}
|
|
40
|
+
return tabId;
|
|
41
|
+
}
|
|
42
|
+
function requireTarget(args, usage) {
|
|
43
|
+
const elementRef = readTrimmedOption(args, "--ref");
|
|
44
|
+
const selector = readTrimmedOption(args, "--selector");
|
|
45
|
+
if (!elementRef && !selector) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`Provide --ref <elementRef> (from read-page) or --selector <css>. Usage: ${usage}`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
...elementRef ? { elementRef } : {},
|
|
52
|
+
...selector ? { selector } : {}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
var CHROME_OPS_SUBCOMMANDS = {
|
|
56
|
+
"list-tabs": {
|
|
57
|
+
action: "list_tabs",
|
|
58
|
+
usage: "nolo chrome list-tabs",
|
|
59
|
+
payload: () => ({})
|
|
60
|
+
},
|
|
61
|
+
"open-tab": {
|
|
62
|
+
action: "open_tab",
|
|
63
|
+
usage: "nolo chrome open-tab --url <url> [--active]",
|
|
64
|
+
payload: (args, usage) => {
|
|
65
|
+
const url = readTrimmedOption(args, "--url");
|
|
66
|
+
if (!url) {
|
|
67
|
+
throw new Error(`Missing required --url <url>. Usage: ${usage}`);
|
|
68
|
+
}
|
|
69
|
+
return { url, active: args.includes("--active") };
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"close-tab": {
|
|
73
|
+
action: "close_tab",
|
|
74
|
+
usage: "nolo chrome close-tab --tab <id>",
|
|
75
|
+
payload: (args, usage) => ({ tabId: requireTabId(args, usage) })
|
|
76
|
+
},
|
|
77
|
+
"read-page": {
|
|
78
|
+
action: "read_page",
|
|
79
|
+
usage: "nolo chrome read-page --tab <id> [--selector <css>] [--detail compact|full] [--max-elements N]",
|
|
80
|
+
payload: (args, usage) => {
|
|
81
|
+
const payload = { tabId: requireTabId(args, usage) };
|
|
82
|
+
const selector = readTrimmedOption(args, "--selector");
|
|
83
|
+
if (selector) payload.selector = selector;
|
|
84
|
+
const detail = readTrimmedOption(args, "--detail");
|
|
85
|
+
if (detail) payload.detail = detail;
|
|
86
|
+
const maxElements = readIntOption(args, "--max-elements", usage);
|
|
87
|
+
if (maxElements !== void 0) payload.maxElements = maxElements;
|
|
88
|
+
return payload;
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
click: {
|
|
92
|
+
action: "click",
|
|
93
|
+
usage: "nolo chrome click --tab <id> (--ref <elementRef> | --selector <css>)",
|
|
94
|
+
payload: (args, usage) => ({
|
|
95
|
+
tabId: requireTabId(args, usage),
|
|
96
|
+
...requireTarget(args, usage)
|
|
97
|
+
})
|
|
98
|
+
},
|
|
99
|
+
type: {
|
|
100
|
+
action: "type",
|
|
101
|
+
usage: "nolo chrome type --tab <id> (--ref <elementRef> | --selector <css>) --text <text> [--append]",
|
|
102
|
+
payload: (args, usage) => {
|
|
103
|
+
const text = readOption(args, "--text");
|
|
104
|
+
if (text === void 0 || text.startsWith("--")) {
|
|
105
|
+
throw new Error(`Missing required --text <text>. Usage: ${usage}`);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
tabId: requireTabId(args, usage),
|
|
109
|
+
...requireTarget(args, usage),
|
|
110
|
+
text,
|
|
111
|
+
...args.includes("--append") ? { clearFirst: false } : {}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
press: {
|
|
116
|
+
action: "press",
|
|
117
|
+
usage: "nolo chrome press --tab <id> --key <key>",
|
|
118
|
+
payload: (args, usage) => {
|
|
119
|
+
const key = readTrimmedOption(args, "--key");
|
|
120
|
+
if (!key) {
|
|
121
|
+
throw new Error(`Missing required --key <key>. Usage: ${usage}`);
|
|
122
|
+
}
|
|
123
|
+
return { tabId: requireTabId(args, usage), key };
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
scroll: {
|
|
127
|
+
action: "scroll",
|
|
128
|
+
usage: "nolo chrome scroll --tab <id> [--delta-x N] [--delta-y N]",
|
|
129
|
+
payload: (args, usage) => {
|
|
130
|
+
const payload = { tabId: requireTabId(args, usage) };
|
|
131
|
+
const deltaX = readIntOption(args, "--delta-x", usage);
|
|
132
|
+
const deltaY = readIntOption(args, "--delta-y", usage);
|
|
133
|
+
if (deltaX !== void 0) payload.deltaX = deltaX;
|
|
134
|
+
if (deltaY !== void 0) payload.deltaY = deltaY;
|
|
135
|
+
return payload;
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
screenshot: {
|
|
139
|
+
action: "screenshot",
|
|
140
|
+
usage: "nolo chrome screenshot --tab <id> [--out <path>] [--full-page]",
|
|
141
|
+
payload: (args, usage) => ({
|
|
142
|
+
tabId: requireTabId(args, usage),
|
|
143
|
+
...args.includes("--full-page") ? { fullPage: true } : {}
|
|
144
|
+
})
|
|
145
|
+
},
|
|
146
|
+
"read-console": {
|
|
147
|
+
action: "read_console",
|
|
148
|
+
usage: "nolo chrome read-console --tab <id> [--limit N]",
|
|
149
|
+
payload: (args, usage) => {
|
|
150
|
+
const payload = { tabId: requireTabId(args, usage) };
|
|
151
|
+
const limit = readIntOption(args, "--limit", usage);
|
|
152
|
+
if (limit !== void 0) payload.limit = limit;
|
|
153
|
+
return payload;
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"read-network": {
|
|
157
|
+
action: "read_network",
|
|
158
|
+
usage: "nolo chrome read-network --tab <id> [--limit N] [--include-assets]",
|
|
159
|
+
payload: (args, usage) => {
|
|
160
|
+
const payload = { tabId: requireTabId(args, usage) };
|
|
161
|
+
const limit = readIntOption(args, "--limit", usage);
|
|
162
|
+
if (limit !== void 0) payload.limit = limit;
|
|
163
|
+
if (args.includes("--include-assets")) payload.includeAssets = true;
|
|
164
|
+
return payload;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
function renderChromeOpsHelp() {
|
|
169
|
+
const lines = [
|
|
170
|
+
"Operate the user's Chrome through the Nolo Chrome connector (the desktop bridge;",
|
|
171
|
+
"the same RPC the chrome_* agent tools use).",
|
|
172
|
+
"",
|
|
173
|
+
"Usage:",
|
|
174
|
+
" nolo chrome <subcommand> [flags]",
|
|
175
|
+
"",
|
|
176
|
+
"Subcommands:",
|
|
177
|
+
...Object.values(CHROME_OPS_SUBCOMMANDS).map(
|
|
178
|
+
(spec) => ` ${spec.usage.replace(/^nolo chrome /, "")}`
|
|
179
|
+
),
|
|
180
|
+
"",
|
|
181
|
+
"Notes:",
|
|
182
|
+
" --ref takes an elementRef copied from `nolo chrome read-page` (revision-scoped,",
|
|
183
|
+
" preferred over --selector); --selector takes a CSS selector.",
|
|
184
|
+
" Actions the connector classifies as irreversible (Submit / Delete / Pay ...)",
|
|
185
|
+
" are refused with CONFIRMATION_REQUIRED \u2014 ask the user to perform them.",
|
|
186
|
+
" Every subcommand prints the connector's raw JSON result; failures exit 1.",
|
|
187
|
+
" Endpoint: NOLO_CHROME_CONNECTOR_RPC_URL or http://127.0.0.1:38947/rpc."
|
|
188
|
+
];
|
|
189
|
+
return lines.join("\n");
|
|
190
|
+
}
|
|
191
|
+
var CHROME_OPS_HELP_TEXT = renderChromeOpsHelp();
|
|
192
|
+
async function runChromeOpsCommand(subcommand, args, deps = {}) {
|
|
193
|
+
const io = {
|
|
194
|
+
stdout: (text) => console.log(text),
|
|
195
|
+
stderr: (text) => console.error(text),
|
|
196
|
+
...deps.io
|
|
197
|
+
};
|
|
198
|
+
const spec = CHROME_OPS_SUBCOMMANDS[subcommand];
|
|
199
|
+
if (!spec) {
|
|
200
|
+
io.stderr(`Unknown chrome subcommand: ${subcommand}
|
|
201
|
+
|
|
202
|
+
${CHROME_OPS_HELP_TEXT}`);
|
|
203
|
+
return 1;
|
|
204
|
+
}
|
|
205
|
+
if (wantsHelp(args)) {
|
|
206
|
+
io.stdout(CHROME_OPS_HELP_TEXT);
|
|
207
|
+
return 0;
|
|
208
|
+
}
|
|
209
|
+
let payload;
|
|
210
|
+
try {
|
|
211
|
+
payload = spec.payload(args, spec.usage);
|
|
212
|
+
} catch (error) {
|
|
213
|
+
io.stderr(toErrorMessage(error));
|
|
214
|
+
return 1;
|
|
215
|
+
}
|
|
216
|
+
let result;
|
|
217
|
+
try {
|
|
218
|
+
const client = deps.client ?? createChromeConnectorClient();
|
|
219
|
+
result = await client.request(spec.action, payload);
|
|
220
|
+
} catch (error) {
|
|
221
|
+
const code = typeof error?.code === "string" ? error.code : "CHROME_COMMAND_FAILED";
|
|
222
|
+
io.stderr(JSON.stringify({ ok: false, error: { code, message: toErrorMessage(error) } }, null, 2));
|
|
223
|
+
return 1;
|
|
224
|
+
}
|
|
225
|
+
if (subcommand === "screenshot") {
|
|
226
|
+
const out = readTrimmedOption(args, "--out");
|
|
227
|
+
const dataUrl = result?.dataUrl;
|
|
228
|
+
if (out && typeof dataUrl === "string") {
|
|
229
|
+
const base64 = dataUrl.includes(",") ? dataUrl.slice(dataUrl.indexOf(",") + 1) : dataUrl;
|
|
230
|
+
const bytes = Buffer.from(base64, "base64");
|
|
231
|
+
try {
|
|
232
|
+
await writeFile(out, bytes);
|
|
233
|
+
} catch (error) {
|
|
234
|
+
io.stderr(
|
|
235
|
+
JSON.stringify(
|
|
236
|
+
{
|
|
237
|
+
ok: false,
|
|
238
|
+
error: { code: "SCREENSHOT_WRITE_FAILED", message: toErrorMessage(error) }
|
|
239
|
+
},
|
|
240
|
+
null,
|
|
241
|
+
2
|
|
242
|
+
)
|
|
243
|
+
);
|
|
244
|
+
return 1;
|
|
245
|
+
}
|
|
246
|
+
io.stdout(JSON.stringify({ ok: true, result: { savedTo: out, bytes: bytes.byteLength } }, null, 2));
|
|
247
|
+
return 0;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
io.stdout(JSON.stringify({ ok: true, result }, null, 2));
|
|
251
|
+
return 0;
|
|
252
|
+
}
|
|
253
|
+
export {
|
|
254
|
+
CHROME_OPS_HELP_TEXT,
|
|
255
|
+
CHROME_OPS_SUBCOMMANDS,
|
|
256
|
+
renderChromeOpsHelp,
|
|
257
|
+
runChromeOpsCommand
|
|
258
|
+
};
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
resolveLocalUserId,
|
|
28
28
|
t,
|
|
29
29
|
toolLabel
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NU6FRRNU.js";
|
|
31
31
|
import {
|
|
32
32
|
createRunActivityTracker,
|
|
33
33
|
popSingleQueueMessage,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
} from "./chunk-LTRXGFMS.js";
|
|
64
64
|
import {
|
|
65
65
|
formatAgentListCard
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-D42DMWKD.js";
|
|
67
67
|
import {
|
|
68
68
|
isTransientFetchError
|
|
69
69
|
} from "./chunk-5XTOKQLW.js";
|
|
@@ -84,11 +84,11 @@ import {
|
|
|
84
84
|
chooseMemoryOwners,
|
|
85
85
|
loadMemoryCandidatesFromDb,
|
|
86
86
|
resolveAgentMemoryPolicy
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-WD4SMAPR.js";
|
|
88
88
|
import {
|
|
89
89
|
API_REPORTED_COST_MULTIPLIER,
|
|
90
90
|
parseUiAskChoiceContent
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-PEBKIEA5.js";
|
|
92
92
|
import {
|
|
93
93
|
isOAuthApiKeyRef
|
|
94
94
|
} from "./chunk-YYLHWIW6.js";
|
|
@@ -10407,7 +10407,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
10407
10407
|
// packages/cli/client/agentRun.ts
|
|
10408
10408
|
import { ulid } from "ulid";
|
|
10409
10409
|
async function loadRunLocalAgentTurn() {
|
|
10410
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
10410
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-ZSUEMWRL.js");
|
|
10411
10411
|
return runLocalAgentTurn;
|
|
10412
10412
|
}
|
|
10413
10413
|
var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
|
|
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
|
|
|
304
304
|
const overrides = {};
|
|
305
305
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
306
306
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
307
|
-
const { _executeModel } = await import("./_executeModel-
|
|
307
|
+
const { _executeModel } = await import("./_executeModel-CNEEELFV.js");
|
|
308
308
|
return _executeModel(
|
|
309
309
|
{
|
|
310
310
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
|
|
|
325
325
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
326
326
|
*/
|
|
327
327
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
328
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
328
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-UANNODBO.js");
|
|
329
329
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
330
330
|
{
|
|
331
331
|
agentKey: args.agentKey,
|
|
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
|
|
|
341
341
|
* 聊天轮次流式 Agent 调用
|
|
342
342
|
*/
|
|
343
343
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
344
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
344
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-76WFI2YK.js");
|
|
345
345
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
346
346
|
}),
|
|
347
347
|
/**
|
|
@@ -81,14 +81,14 @@ import {
|
|
|
81
81
|
} from "./chunk-VF4K2QE6.js";
|
|
82
82
|
import {
|
|
83
83
|
createDocState
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-ITFKTCHH.js";
|
|
85
85
|
import {
|
|
86
86
|
BUILTIN_OBJECT_SKILL_IDS,
|
|
87
87
|
buildBuiltinObjectSkillConfig,
|
|
88
88
|
buildBuiltinObjectSkillDbKey,
|
|
89
89
|
buildBuiltinObjectSkillPageContent,
|
|
90
90
|
createDialogAction
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-WD4SMAPR.js";
|
|
92
92
|
import {
|
|
93
93
|
DEFAULT_COLLAPSED_CATEGORIES,
|
|
94
94
|
addContentToSpace,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
updateContentCategory,
|
|
107
107
|
updateContentTitle,
|
|
108
108
|
writeStoredCollapsedCategories
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-DDWYTB5N.js";
|
|
110
110
|
import {
|
|
111
111
|
getCurrentSpaceId,
|
|
112
112
|
getCurrentSpaceIdRaw,
|
|
@@ -128,14 +128,14 @@ import {
|
|
|
128
128
|
selectMsgById,
|
|
129
129
|
uiAskChoiceFunc,
|
|
130
130
|
uiAskChoiceFunctionSchema
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-PEBKIEA5.js";
|
|
132
132
|
import {
|
|
133
133
|
createAgent,
|
|
134
134
|
deleteServerSyncedCredential,
|
|
135
135
|
runLlm,
|
|
136
136
|
streamAgentChatTurn,
|
|
137
137
|
updateAgent
|
|
138
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-6RUYWJXO.js";
|
|
139
139
|
import {
|
|
140
140
|
getActiveDialogKey,
|
|
141
141
|
selectCurrentDialogKey,
|
|
@@ -4672,7 +4672,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
4672
4672
|
const deletedDialogIds = [];
|
|
4673
4673
|
const deletedDialogKeys = [];
|
|
4674
4674
|
const failures = [];
|
|
4675
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
4675
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-P2G3GRRG.js");
|
|
4676
4676
|
for (const target of targets) {
|
|
4677
4677
|
try {
|
|
4678
4678
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -9933,6 +9933,19 @@ ${preview}`
|
|
|
9933
9933
|
}
|
|
9934
9934
|
|
|
9935
9935
|
// packages/ai/tools/chromeConnectorTools.ts
|
|
9936
|
+
var CHROME_CONNECTOR_TOOL_NAMES = [
|
|
9937
|
+
"chrome_list_tabs",
|
|
9938
|
+
"chrome_open_tab",
|
|
9939
|
+
"chrome_close_tab",
|
|
9940
|
+
"chrome_read_page",
|
|
9941
|
+
"chrome_click",
|
|
9942
|
+
"chrome_type",
|
|
9943
|
+
"chrome_press",
|
|
9944
|
+
"chrome_scroll",
|
|
9945
|
+
"chrome_screenshot",
|
|
9946
|
+
"chrome_read_console",
|
|
9947
|
+
"chrome_read_network"
|
|
9948
|
+
];
|
|
9936
9949
|
var CHROME_CONNECTOR_READ_TOOL_NAMES = [
|
|
9937
9950
|
"chrome_list_tabs",
|
|
9938
9951
|
"chrome_read_page",
|
|
@@ -15533,7 +15546,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
15533
15546
|
if (!executionInput) {
|
|
15534
15547
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
15535
15548
|
}
|
|
15536
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
15549
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-XJGU2HAF.js");
|
|
15537
15550
|
const { executor } = findToolExecutor2(run.toolName);
|
|
15538
15551
|
toolRunStarted({
|
|
15539
15552
|
id: run.id,
|
|
@@ -18040,7 +18053,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18040
18053
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
18041
18054
|
};
|
|
18042
18055
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
18043
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
18056
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-GUHCPV37.js");
|
|
18044
18057
|
if (getDocState().pageKey === id) {
|
|
18045
18058
|
applyExternalDocUpdate({
|
|
18046
18059
|
slateData: finalSlateData,
|
|
@@ -20343,6 +20356,7 @@ export {
|
|
|
20343
20356
|
readXPostFunc,
|
|
20344
20357
|
readXhsProfileFunctionSchema,
|
|
20345
20358
|
readXhsProfileFunc,
|
|
20359
|
+
CHROME_CONNECTOR_TOOL_NAMES,
|
|
20346
20360
|
rememberMemoryFunctionSchema,
|
|
20347
20361
|
deleteMemoryFunctionSchema,
|
|
20348
20362
|
queryMemoryFunctionSchema,
|
|
@@ -326,7 +326,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
326
326
|
).unwrap();
|
|
327
327
|
if (dbSpaceId) {
|
|
328
328
|
try {
|
|
329
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
329
|
+
const { updateContentTitle } = await import("./contentThunks-P73Q4WUM.js");
|
|
330
330
|
await dispatch(
|
|
331
331
|
updateContentTitle({
|
|
332
332
|
spaceId: dbSpaceId,
|
|
@@ -365,7 +365,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
async function createDocState(args, thunkApi) {
|
|
368
|
-
const { createPageAction } = await import("./createPageAction-
|
|
368
|
+
const { createPageAction } = await import("./createPageAction-MN4VOJYH.js");
|
|
369
369
|
return createPageAction(args, thunkApi);
|
|
370
370
|
}
|
|
371
371
|
function subscribe(listener) {
|
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
refreshOpenAiCodexToken,
|
|
6
6
|
xaiRefresh
|
|
7
7
|
} from "./chunk-GBPZKFYK.js";
|
|
8
|
+
import {
|
|
9
|
+
createChromeConnectorClient,
|
|
10
|
+
createVerifiedChromeConnectorClient,
|
|
11
|
+
executeChromeConnectorTool
|
|
12
|
+
} from "./chunk-QCZX4FTW.js";
|
|
8
13
|
import {
|
|
9
14
|
defaultLoopbackRequest
|
|
10
15
|
} from "./chunk-EADNWBAZ.js";
|
|
@@ -55,11 +60,12 @@ import {
|
|
|
55
60
|
import {
|
|
56
61
|
inlineImageUrlsForCustomProvider,
|
|
57
62
|
prepareTools
|
|
58
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-KG7ANYLN.js";
|
|
59
64
|
import {
|
|
60
65
|
getServerProviderSecret
|
|
61
66
|
} from "./chunk-HS7MLR74.js";
|
|
62
67
|
import {
|
|
68
|
+
CHROME_CONNECTOR_TOOL_NAMES,
|
|
63
69
|
CONTROL_AGENT_RUN_ACTIONS,
|
|
64
70
|
buildControlAgentRunFunctionSchema,
|
|
65
71
|
buildStartAgentRunFunctionSchema,
|
|
@@ -72,7 +78,7 @@ import {
|
|
|
72
78
|
rememberMemoryFunctionSchema,
|
|
73
79
|
resolveAgentRequiredPackIds,
|
|
74
80
|
setTodoListFunc
|
|
75
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-D42DMWKD.js";
|
|
76
82
|
import {
|
|
77
83
|
fetchWithTransientRetry,
|
|
78
84
|
isTransientFetchError
|
|
@@ -95,13 +101,13 @@ import {
|
|
|
95
101
|
prepareTokenUsageData,
|
|
96
102
|
resolveBuiltinPlatformAgentConfig,
|
|
97
103
|
runKeyed
|
|
98
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-PEBKIEA5.js";
|
|
99
105
|
import {
|
|
100
106
|
BUILTIN_TITLE_LLM_CONFIG
|
|
101
107
|
} from "./chunk-EVBFYPDC.js";
|
|
102
108
|
import {
|
|
103
109
|
fetchServerSyncedCredential
|
|
104
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-6RUYWJXO.js";
|
|
105
111
|
import {
|
|
106
112
|
require_date_fns
|
|
107
113
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -1672,6 +1678,17 @@ var LOCAL_SERVER_MEMORY_TOOL_NAME_SET = new Set(
|
|
|
1672
1678
|
);
|
|
1673
1679
|
|
|
1674
1680
|
// packages/cli/client/localRuntimeTools.ts
|
|
1681
|
+
var CLI_CHROME_CONNECTOR_TOOL_NAME_SET = new Set(
|
|
1682
|
+
CHROME_CONNECTOR_TOOL_NAMES
|
|
1683
|
+
);
|
|
1684
|
+
function filterCliChromeConnectorToolNames(toolNames) {
|
|
1685
|
+
return (toolNames ?? []).filter(
|
|
1686
|
+
(name) => CLI_CHROME_CONNECTOR_TOOL_NAME_SET.has(name)
|
|
1687
|
+
);
|
|
1688
|
+
}
|
|
1689
|
+
function buildCliChromeConnectorOpenAiTools(args) {
|
|
1690
|
+
return prepareTools(filterCliChromeConnectorToolNames(args.toolNames));
|
|
1691
|
+
}
|
|
1675
1692
|
function buildOpenAiTools(args) {
|
|
1676
1693
|
const toolset = buildLocalWorkspaceToolsetForEnv(args);
|
|
1677
1694
|
const workspaceToolNames = toolset.toolNames;
|
|
@@ -1719,6 +1736,7 @@ function buildOpenAiTools(args) {
|
|
|
1719
1736
|
toolNames: args.effectiveToolNames ?? workspaceToolNames,
|
|
1720
1737
|
exposeShellTools: toolset.exposeShellTools
|
|
1721
1738
|
}),
|
|
1739
|
+
...buildCliChromeConnectorOpenAiTools({ toolNames: args.toolNames }),
|
|
1722
1740
|
...buildServerPlatformOpenAiTools({ toolNames: args.toolNames }),
|
|
1723
1741
|
...buildNoloWorkspaceOpenAiTools({ toolNames: args.toolNames }),
|
|
1724
1742
|
...buildOrchestrationOpenAiTools({
|
|
@@ -11317,6 +11335,19 @@ function createCliControlAgentRunExecutor(deps = {}) {
|
|
|
11317
11335
|
};
|
|
11318
11336
|
}
|
|
11319
11337
|
|
|
11338
|
+
// packages/cli/client/cliChromeConnectorToolExecutors.ts
|
|
11339
|
+
function buildCliChromeConnectorToolExecutors(args) {
|
|
11340
|
+
const client = createVerifiedChromeConnectorClient({
|
|
11341
|
+
client: args?.client ?? createChromeConnectorClient()
|
|
11342
|
+
});
|
|
11343
|
+
return Object.fromEntries(
|
|
11344
|
+
CHROME_CONNECTOR_TOOL_NAMES.map((toolName) => [
|
|
11345
|
+
toolName,
|
|
11346
|
+
(call) => executeChromeConnectorTool({ client, call })
|
|
11347
|
+
])
|
|
11348
|
+
);
|
|
11349
|
+
}
|
|
11350
|
+
|
|
11320
11351
|
// packages/cli/client/cliLocalToolExecutors.ts
|
|
11321
11352
|
var MAX_PASTED_TEXT_LINES_PER_READ = 200;
|
|
11322
11353
|
var PASTED_TEXT_EXPLICIT_OVERSHOOT_LINES = 20;
|
|
@@ -11603,6 +11634,12 @@ function buildLocalToolExecutors(args) {
|
|
|
11603
11634
|
};
|
|
11604
11635
|
},
|
|
11605
11636
|
...args.pastedTextStore ? { readPastedText: createReadPastedTextExecutor(args.pastedTextStore) } : {},
|
|
11637
|
+
// Nolo Browser Connector: the CLI drives the user's real Chrome through the same verified
|
|
11638
|
+
// client + executor as the desktop runtime (before this, every chrome_* call answered
|
|
11639
|
+
// "only executable in the Nolo desktop local runtime").
|
|
11640
|
+
...buildCliChromeConnectorToolExecutors(
|
|
11641
|
+
args.chromeConnectorClient ? { client: args.chromeConnectorClient } : {}
|
|
11642
|
+
),
|
|
11606
11643
|
...args.localToolExecutors ?? {}
|
|
11607
11644
|
};
|
|
11608
11645
|
}
|
|
@@ -12435,6 +12472,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
12435
12472
|
workspaceRoot,
|
|
12436
12473
|
env: deps.env,
|
|
12437
12474
|
fetchImpl,
|
|
12475
|
+
...deps.chromeConnectorClient ? { chromeConnectorClient: deps.chromeConnectorClient } : {},
|
|
12438
12476
|
localToolExecutors: deps.localToolExecutors,
|
|
12439
12477
|
readXPost: deps.readXPost,
|
|
12440
12478
|
readXhsProfile: deps.readXhsProfile,
|
|
@@ -12511,6 +12549,7 @@ function createCliLocalRuntimeAdapter(deps) {
|
|
|
12511
12549
|
workspaceRoot,
|
|
12512
12550
|
env: deps.env,
|
|
12513
12551
|
fetchImpl,
|
|
12552
|
+
...deps.chromeConnectorClient ? { chromeConnectorClient: deps.chromeConnectorClient } : {},
|
|
12514
12553
|
localToolExecutors: deps.localToolExecutors,
|
|
12515
12554
|
readXPost: deps.readXPost,
|
|
12516
12555
|
readXhsProfile: deps.readXhsProfile,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-AGGIDPCZ.js";
|
|
14
14
|
import {
|
|
15
15
|
runLlm
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6RUYWJXO.js";
|
|
17
17
|
import {
|
|
18
18
|
cleanupCliSessionForDialog
|
|
19
19
|
} from "./chunk-BJCWNHVU.js";
|
|
@@ -17122,7 +17122,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
17122
17122
|
runtimeOptions: args.runtimeOptions
|
|
17123
17123
|
});
|
|
17124
17124
|
if (agentKeyToUse) {
|
|
17125
|
-
const { streamAgentChatTurn } = await import("./agentSlice-
|
|
17125
|
+
const { streamAgentChatTurn } = await import("./agentSlice-S3JFDTH4.js");
|
|
17126
17126
|
await dispatch(
|
|
17127
17127
|
streamAgentChatTurn({
|
|
17128
17128
|
agentKey: agentKeyToUse,
|
|
@@ -18255,7 +18255,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
18255
18255
|
}
|
|
18256
18256
|
if (isCurrentDialog) {
|
|
18257
18257
|
await thunkApi.dispatch(resetMsgs());
|
|
18258
|
-
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-
|
|
18258
|
+
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-P2G3GRRG.js");
|
|
18259
18259
|
dispatch(clearPendingAttachments2());
|
|
18260
18260
|
}
|
|
18261
18261
|
return { dialogKey, isCurrentDialog, attachmentPlan };
|
|
@@ -18263,15 +18263,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
18263
18263
|
|
|
18264
18264
|
// packages/chat/dialog/dialogSlice.ts
|
|
18265
18265
|
var runCreateDialogAction = async (args, thunkApi) => {
|
|
18266
|
-
const { createDialogAction } = await import("./createDialogAction-
|
|
18266
|
+
const { createDialogAction } = await import("./createDialogAction-6ZKSFM5O.js");
|
|
18267
18267
|
return createDialogAction(args, thunkApi);
|
|
18268
18268
|
};
|
|
18269
18269
|
var runCreateAgentAutomationAction = async (args, thunkApi) => {
|
|
18270
|
-
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-
|
|
18270
|
+
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-JLHVMB4X.js");
|
|
18271
18271
|
return createAgentAutomationAction(args, thunkApi);
|
|
18272
18272
|
};
|
|
18273
18273
|
var runUpdateDialogTitleAction = async (args, thunkApi) => {
|
|
18274
|
-
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-
|
|
18274
|
+
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-5BHRK2XV.js");
|
|
18275
18275
|
return updateDialogTitleAction(args, thunkApi);
|
|
18276
18276
|
};
|
|
18277
18277
|
var runAddDialogAgentAction = async (args, thunkApi) => {
|
|
@@ -18295,7 +18295,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
|
|
|
18295
18295
|
return setDialogExtraReferencesAction(args, thunkApi);
|
|
18296
18296
|
};
|
|
18297
18297
|
var runHandleSendMessageAction = async (args, thunkApi) => {
|
|
18298
|
-
const { handleSendMessageAction } = await import("./handleSendMessageAction-
|
|
18298
|
+
const { handleSendMessageAction } = await import("./handleSendMessageAction-NLDMT3LZ.js");
|
|
18299
18299
|
return handleSendMessageAction(args, thunkApi);
|
|
18300
18300
|
};
|
|
18301
18301
|
function clearDialogState() {
|
|
@@ -18308,7 +18308,7 @@ var createPageAndAddReference = createAsyncThunk(
|
|
|
18308
18308
|
async (payload, { dispatch, getState, rejectWithValue }) => {
|
|
18309
18309
|
const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
|
|
18310
18310
|
try {
|
|
18311
|
-
const { createDocState } = await import("./docStore-
|
|
18311
|
+
const { createDocState } = await import("./docStore-GUHCPV37.js");
|
|
18312
18312
|
const pageKey = await createDocState(
|
|
18313
18313
|
{ slateData, title },
|
|
18314
18314
|
{ dispatch, getState }
|