nolo-cli 0.72.0-alpha.1 → 0.72.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/{_executeModel-TKD22VDA.js → _executeModel-T3FPYFVF.js} +11 -11
- package/{agentDeleteCommand-FSIMTL4K.js → agentDeleteCommand-UAMLWTPS.js} +6 -6
- package/{agentEmailCommands-G53VVKIL.js → agentEmailCommands-65FRADWQ.js} +15 -14
- package/{agentListCommands-2YWZYH52.js → agentListCommands-63DOSBY7.js} +7 -7
- package/{agentMachineCommands-A7D55KN2.js → agentMachineCommands-HMMAULDF.js} +6 -6
- package/{agentRecordCommands-UVU5UPJB.js → agentRecordCommands-HX5AEFP7.js} +15 -14
- package/{agentRunCommand-PDKUP3L4.js → agentRunCommand-KXPU5X7D.js} +15 -14
- package/{agentRuntimeLocal-O6DZDTK4.js → agentRuntimeLocal-XG3IDNOC.js} +4 -4
- package/{agentSlice-FZBFYKP3.js → agentSlice-EACXUOWW.js} +1 -1
- package/{appDeleteCommands-HIJNWSK7.js → appDeleteCommands-TJXDMOYT.js} +7 -7
- package/{appDeployCommands-XULV2ZN6.js → appDeployCommands-ECZJQAAL.js} +7 -7
- package/{appDeployStatusCommands-ETY4Z7K6.js → appDeployStatusCommands-DZKVFG3Y.js} +7 -7
- package/{appGetCommands-M253LKDA.js → appGetCommands-JIT4OPUD.js} +7 -7
- package/{appListCommands-XYFXJMNP.js → appListCommands-NR2HRMDY.js} +7 -7
- package/{chatQueueReduxAdapter-E2D4NR2W.js → chatQueueReduxAdapter-XEIJO5WR.js} +2 -2
- package/chromeCommands-VOIRNJBL.js +499 -0
- package/chromeOpsCommands-M7DPCX2T.js +258 -0
- package/{chunk-7GCIXOQA.js → chunk-226XC5JW.js} +2 -2
- package/{chunk-SV63E2UZ.js → chunk-4SUTS5DI.js} +91 -6
- package/{chunk-B62OSA77.js → chunk-AFIKMMGC.js} +1 -1
- package/{chunk-Q4OT2DC7.js → chunk-AFIWC5NH.js} +1 -1
- package/{chunk-4NI7LU7J.js → chunk-AI5QKFXK.js} +5580 -349
- package/{chunk-AOKRQAUQ.js → chunk-ALGK6TIE.js} +2 -2
- package/{chunk-JWXTOIGR.js → chunk-CDVGNZDA.js} +2 -2
- package/{chunk-2QDDKFG5.js → chunk-CQ3WA2NE.js} +77 -0
- package/{chunk-CJ23A7U4.js → chunk-CUQ6PG2C.js} +14 -5
- package/{chunk-3LBE76GR.js → chunk-D74EWXL4.js} +87 -47
- package/{chunk-JWO3RQSH.js → chunk-DWPNOYMB.js} +1 -1
- package/{chunk-EDKF7RX4.js → chunk-EOARMOVD.js} +2 -0
- package/{chunk-T7PQFKJU.js → chunk-FSFQ3A7S.js} +1 -1
- package/{chunk-S4IVP3JA.js → chunk-H5I6AJX4.js} +22 -6
- package/{chunk-ZDB5QFH4.js → chunk-H7UKKEIS.js} +1 -1
- package/{chunk-YCDWJX45.js → chunk-KC5FAHVS.js} +1 -1
- package/{chunk-3U3EA3BO.js → chunk-L2Y24GRM.js} +2 -2
- package/{chunk-R5NCDOHB.js → chunk-MEVSATIF.js} +22 -8
- package/{chunk-R4XZMDRV.js → chunk-P7FA2HMM.js} +66 -120
- package/{chunk-AUKZOZFG.js → chunk-QA6YKM3H.js} +1 -1
- package/{chunk-HXAINXPQ.js → chunk-QC5LGHYP.js} +1 -1
- package/chunk-QCZX4FTW.js +242 -0
- package/{chunk-I5O24WHB.js → chunk-QRBAZ5PW.js} +2 -2
- package/{chunk-RVCBKVIR.js → chunk-QUH3XHL5.js} +3 -3
- package/{chunk-U4N7NIN3.js → chunk-U6LKJRJB.js} +4 -4
- package/{chunk-IDZTNRP2.js → chunk-X7HHHIOZ.js} +10 -2
- package/{chunk-S2RB4LMB.js → chunk-X7Z7U4Z6.js} +5 -5
- package/{contentThunks-QLAU2LGJ.js → contentThunks-3SPROFG5.js} +3 -3
- package/{createAgentAutomationAction-JUSLLNYE.js → createAgentAutomationAction-EIP2EG3O.js} +3 -3
- package/{createDialogAction-B52IPGBY.js → createDialogAction-RLUSTN4D.js} +4 -4
- package/{createPageAction-ACAIWRDQ.js → createPageAction-4Y52G7WG.js} +3 -3
- package/{dialogCommands-PE5FEFJ5.js → dialogCommands-CJCAMML3.js} +7 -7
- package/{dialogSlice-RM3EW5AO.js → dialogSlice-THY45JWM.js} +2 -2
- package/{docCreateCommands-IPDFZVPG.js → docCreateCommands-H65RSKT4.js} +6 -6
- package/{docDeleteCommands-VQ4Y66CM.js → docDeleteCommands-PBYGJ6CZ.js} +7 -7
- package/{docReadCommands-PD33VV27.js → docReadCommands-4VRYN5R5.js} +6 -6
- package/{docStore-Q45M4B2I.js → docStore-ZQ3ECOPY.js} +1 -1
- package/{docUpdateCommands-CGUQ2JY3.js → docUpdateCommands-COZG3ZDB.js} +6 -6
- package/{handleSendMessageAction-I6KFXKDM.js → handleSendMessageAction-CE4M5XIE.js} +2 -2
- package/index.js +108 -48
- package/{machineCommands-QEYH5J5E.js → machineCommands-JE4G4JYB.js} +14 -13
- package/{machineWsRunDispatch-MFYQADTQ.js → machineWsRunDispatch-FUQOSWD4.js} +14 -13
- package/package.json +1 -1
- package/{readlineWorkspace-WQZX3WSK.js → readlineWorkspace-Z4V3EB52.js} +45 -26
- package/{runAgentClientLoop-SLKSZWCS.js → runAgentClientLoop-NE5EHXSS.js} +9 -9
- package/{spaceCommands-Y47DDAQD.js → spaceCommands-WGXHETMT.js} +6 -6
- package/{streamAgentChatTurn-FLA6GTFJ.js → streamAgentChatTurn-A6L6O22P.js} +11 -11
- package/{tools-NA2SK5QX.js → tools-JS475NYO.js} +6 -6
- package/{tuiSummaryLlmCaller-J5BEPLW5.js → tuiSummaryLlmCaller-3Z24VUWM.js} +2 -2
- package/{updateCommands-AJYSD73Y.js → updateCommands-Y363MC3L.js} +2 -2
- package/{updateDialogTitleAction-55Q3R6RJ.js → updateDialogTitleAction-GMZUT6RP.js} +3 -3
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toErrorMessage
|
|
3
|
+
} from "./chunk-HNMXYYJR.js";
|
|
4
|
+
import {
|
|
5
|
+
isRecord
|
|
6
|
+
} from "./chunk-KUG52IAP.js";
|
|
7
|
+
|
|
8
|
+
// packages/desktop-chrome-connector/chromeConnector.ts
|
|
9
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
10
|
+
import { resolve } from "node:path";
|
|
11
|
+
var NOLO_CHROME_CONNECTOR_EXTENSION_ID = "ahpdoopadkamnglhlacfjdfnonpjdplg";
|
|
12
|
+
var NOLO_CHROME_CONNECTOR_PROTOCOL_VERSION = "2";
|
|
13
|
+
function defaultTokenPath() {
|
|
14
|
+
return resolve(
|
|
15
|
+
process.env.HOME || "",
|
|
16
|
+
"Library/Application Support/Nolo/ChromeConnector/token"
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function readConnectorToken(tokenPath = defaultTokenPath()) {
|
|
20
|
+
if (process.env.NOLO_CHROME_CONNECTOR_TOKEN) return process.env.NOLO_CHROME_CONNECTOR_TOKEN;
|
|
21
|
+
if (!existsSync(tokenPath)) return "";
|
|
22
|
+
return readFileSync(tokenPath, "utf8").trim();
|
|
23
|
+
}
|
|
24
|
+
var CHROME_TOOL_ACTIONS = {
|
|
25
|
+
chrome_list_tabs: "list_tabs",
|
|
26
|
+
chrome_open_tab: "open_tab",
|
|
27
|
+
chrome_close_tab: "close_tab",
|
|
28
|
+
chrome_read_page: "read_page",
|
|
29
|
+
chrome_click: "click",
|
|
30
|
+
chrome_type: "type",
|
|
31
|
+
chrome_press: "press",
|
|
32
|
+
chrome_scroll: "scroll",
|
|
33
|
+
chrome_screenshot: "screenshot",
|
|
34
|
+
chrome_read_console: "read_console",
|
|
35
|
+
chrome_read_network: "read_network"
|
|
36
|
+
};
|
|
37
|
+
function createConnectorError(code, message, details) {
|
|
38
|
+
const error = new Error(message);
|
|
39
|
+
error.code = code;
|
|
40
|
+
if (details !== void 0) error.details = details;
|
|
41
|
+
return error;
|
|
42
|
+
}
|
|
43
|
+
function parseArguments(raw) {
|
|
44
|
+
try {
|
|
45
|
+
const parsed = JSON.parse(raw || "{}");
|
|
46
|
+
if (!isRecord(parsed)) {
|
|
47
|
+
throw createConnectorError("INVALID_ARGUMENTS", "Chrome connector tool arguments must be a JSON object.");
|
|
48
|
+
}
|
|
49
|
+
return parsed;
|
|
50
|
+
} catch (error) {
|
|
51
|
+
if (error.code) throw error;
|
|
52
|
+
throw createConnectorError("INVALID_ARGUMENTS", "Chrome connector tool arguments must be valid JSON.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function errorPayload(error) {
|
|
56
|
+
return {
|
|
57
|
+
code: error?.code ?? "CHROME_CONNECTOR_ERROR",
|
|
58
|
+
message: toErrorMessage(error),
|
|
59
|
+
...error?.details !== void 0 ? { details: error.details } : {}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var TARGET_REQUIRED_ACTIONS = /* @__PURE__ */ new Set(["click", "type"]);
|
|
63
|
+
var TAB_ID_REQUIRED_ACTIONS = /* @__PURE__ */ new Set(["close_tab", "detach"]);
|
|
64
|
+
function validateChromeConnectorPayload(action, payload) {
|
|
65
|
+
if (TAB_ID_REQUIRED_ACTIONS.has(action)) {
|
|
66
|
+
const raw = payload.tabId;
|
|
67
|
+
const tabId = typeof raw === "string" ? raw.trim() : typeof raw === "number" && Number.isFinite(raw) ? String(raw) : "";
|
|
68
|
+
if (!tabId) {
|
|
69
|
+
throw createConnectorError(
|
|
70
|
+
"TAB_ID_REQUIRED",
|
|
71
|
+
`Provide the tabId from chrome_list_tabs before calling ${action}.`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!TARGET_REQUIRED_ACTIONS.has(action)) return;
|
|
77
|
+
const elementRef = typeof payload.elementRef === "string" ? payload.elementRef.trim() : "";
|
|
78
|
+
const selector = typeof payload.selector === "string" ? payload.selector.trim() : "";
|
|
79
|
+
if (elementRef || selector) return;
|
|
80
|
+
throw createConnectorError(
|
|
81
|
+
"ELEMENT_TARGET_REQUIRED",
|
|
82
|
+
"Provide elementRef from chrome_read_page or a CSS selector."
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function createChromeConnectorClient(args) {
|
|
86
|
+
if (args?.request) return { request: args.request };
|
|
87
|
+
const defaultPort = process.env.NOLO_CHROME_CONNECTOR_PORT || "38947";
|
|
88
|
+
const endpoint = args?.endpoint ?? process.env.NOLO_CHROME_CONNECTOR_RPC_URL ?? `http://127.0.0.1:${defaultPort}/rpc`;
|
|
89
|
+
const fetchImpl = args?.fetchImpl ?? fetch;
|
|
90
|
+
const token = args?.token ?? readConnectorToken(args?.tokenPath);
|
|
91
|
+
return {
|
|
92
|
+
async request(action, payload) {
|
|
93
|
+
let response;
|
|
94
|
+
try {
|
|
95
|
+
response = await fetchImpl(endpoint, {
|
|
96
|
+
method: "POST",
|
|
97
|
+
headers: {
|
|
98
|
+
"Content-Type": "application/json",
|
|
99
|
+
...token ? { "X-Nolo-Chrome-Connector-Token": token } : {}
|
|
100
|
+
},
|
|
101
|
+
body: JSON.stringify({ action, payload })
|
|
102
|
+
});
|
|
103
|
+
} catch (error) {
|
|
104
|
+
throw createConnectorError(
|
|
105
|
+
"CHROME_CONNECTOR_UNAVAILABLE",
|
|
106
|
+
`Chrome connector RPC endpoint is unavailable at ${endpoint}.`,
|
|
107
|
+
{ cause: toErrorMessage(error) }
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
const data = await response.json().catch(() => ({}));
|
|
111
|
+
if (!response.ok || data?.ok === false) {
|
|
112
|
+
throw createConnectorError(
|
|
113
|
+
typeof data?.error?.code === "string" ? data.error.code : "CHROME_CONNECTOR_RPC_ERROR",
|
|
114
|
+
typeof data?.error?.message === "string" ? data.error.message : `Chrome connector RPC failed with HTTP ${response.status}.`,
|
|
115
|
+
data?.error?.details
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
return data?.result;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
var REQUIRED_CHROME_CONNECTOR_FEATURES = {
|
|
123
|
+
list_tabs: ["tabs"],
|
|
124
|
+
open_tab: ["tabs"],
|
|
125
|
+
close_tab: ["tabs"],
|
|
126
|
+
read_page: ["compact_observation_v2"],
|
|
127
|
+
click: ["compact_observation_v2", "action_gate"],
|
|
128
|
+
type: ["compact_observation_v2", "action_gate"],
|
|
129
|
+
press: ["compact_observation_v2", "action_gate"],
|
|
130
|
+
scroll: ["compact_observation_v2"],
|
|
131
|
+
screenshot: ["browser_debug"],
|
|
132
|
+
read_console: ["browser_debug"],
|
|
133
|
+
read_network: ["browser_debug"],
|
|
134
|
+
detach: ["browser_debug"]
|
|
135
|
+
};
|
|
136
|
+
function requiredFeaturesForConnectorAction(action) {
|
|
137
|
+
return [...REQUIRED_CHROME_CONNECTOR_FEATURES[action] ?? []];
|
|
138
|
+
}
|
|
139
|
+
function createVerifiedChromeConnectorClient(args) {
|
|
140
|
+
const client = args?.client ?? createChromeConnectorClient();
|
|
141
|
+
const expectedExtensionId = args?.expectedExtensionId ?? NOLO_CHROME_CONNECTOR_EXTENSION_ID;
|
|
142
|
+
let verified = null;
|
|
143
|
+
let negotiatedFeatures = [];
|
|
144
|
+
const verify = async () => {
|
|
145
|
+
const connectorInfo = await client.request("connector_info", {});
|
|
146
|
+
const receivedExtensionId = connectorInfo?.extensionId;
|
|
147
|
+
if (receivedExtensionId !== expectedExtensionId) {
|
|
148
|
+
throw createConnectorError(
|
|
149
|
+
"CHROME_CONNECTOR_EXTENSION_MISMATCH",
|
|
150
|
+
`Chrome connector extension id mismatch: expected ${expectedExtensionId}, received ${typeof receivedExtensionId === "string" ? receivedExtensionId : "unknown"}.`,
|
|
151
|
+
{ expectedExtensionId, receivedExtensionId }
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
const receivedProtocolVersion = connectorInfo?.protocolVersion;
|
|
155
|
+
if (receivedProtocolVersion !== NOLO_CHROME_CONNECTOR_PROTOCOL_VERSION) {
|
|
156
|
+
throw createConnectorError(
|
|
157
|
+
"CHROME_CONNECTOR_PROTOCOL_MISMATCH",
|
|
158
|
+
`Chrome connector protocol mismatch: expected ${NOLO_CHROME_CONNECTOR_PROTOCOL_VERSION}, received ${typeof receivedProtocolVersion === "string" ? receivedProtocolVersion : "unknown"}. Reload the Nolo Desktop Chrome Connector extension.`,
|
|
159
|
+
{
|
|
160
|
+
expectedProtocolVersion: NOLO_CHROME_CONNECTOR_PROTOCOL_VERSION,
|
|
161
|
+
receivedProtocolVersion
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
const rawFeatures = connectorInfo?.features;
|
|
166
|
+
negotiatedFeatures = Array.isArray(rawFeatures) ? rawFeatures.filter((entry) => typeof entry === "string") : [];
|
|
167
|
+
};
|
|
168
|
+
return {
|
|
169
|
+
async request(action, payload) {
|
|
170
|
+
verified ??= verify().catch((error) => {
|
|
171
|
+
verified = null;
|
|
172
|
+
throw error;
|
|
173
|
+
});
|
|
174
|
+
await verified;
|
|
175
|
+
const missing = requiredFeaturesForConnectorAction(action).filter(
|
|
176
|
+
(feature) => !negotiatedFeatures.includes(feature)
|
|
177
|
+
);
|
|
178
|
+
if (missing.length > 0) {
|
|
179
|
+
throw createConnectorError(
|
|
180
|
+
"CAPABILITY_UNSUPPORTED",
|
|
181
|
+
`The installed Nolo Browser Connector extension does not support ${missing.join(", ")} (needed by ${action}). Reload or update the extension, then try again.`,
|
|
182
|
+
{ action, missingFeatures: missing, requiredFeatures: requiredFeaturesForConnectorAction(action), features: [...negotiatedFeatures] }
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
return client.request(action, payload);
|
|
186
|
+
},
|
|
187
|
+
features() {
|
|
188
|
+
return [...negotiatedFeatures];
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
async function executeChromeConnectorTool(args) {
|
|
193
|
+
const action = CHROME_TOOL_ACTIONS[args.call.name];
|
|
194
|
+
if (!action) {
|
|
195
|
+
return {
|
|
196
|
+
content: JSON.stringify({
|
|
197
|
+
ok: false,
|
|
198
|
+
error: {
|
|
199
|
+
code: "UNKNOWN_CHROME_TOOL",
|
|
200
|
+
message: `Unknown Chrome connector tool: ${args.call.name}`
|
|
201
|
+
}
|
|
202
|
+
}),
|
|
203
|
+
metadata: {
|
|
204
|
+
chromeConnector: true,
|
|
205
|
+
error: true,
|
|
206
|
+
code: "UNKNOWN_CHROME_TOOL"
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
try {
|
|
211
|
+
const payload = parseArguments(args.call.arguments);
|
|
212
|
+
validateChromeConnectorPayload(action, payload);
|
|
213
|
+
const result = await (args.client ?? createChromeConnectorClient()).request(action, payload);
|
|
214
|
+
return {
|
|
215
|
+
content: JSON.stringify({ ok: true, result }),
|
|
216
|
+
metadata: {
|
|
217
|
+
chromeConnector: true,
|
|
218
|
+
action
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
} catch (error) {
|
|
222
|
+
const payload = errorPayload(error);
|
|
223
|
+
return {
|
|
224
|
+
content: JSON.stringify({ ok: false, error: payload }),
|
|
225
|
+
metadata: {
|
|
226
|
+
chromeConnector: true,
|
|
227
|
+
error: true,
|
|
228
|
+
code: payload.code
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
var CHROME_CONNECTOR_TOOL_ACTIONS = { ...CHROME_TOOL_ACTIONS };
|
|
234
|
+
|
|
235
|
+
export {
|
|
236
|
+
NOLO_CHROME_CONNECTOR_EXTENSION_ID,
|
|
237
|
+
NOLO_CHROME_CONNECTOR_PROTOCOL_VERSION,
|
|
238
|
+
createChromeConnectorClient,
|
|
239
|
+
REQUIRED_CHROME_CONNECTOR_FEATURES,
|
|
240
|
+
createVerifiedChromeConnectorClient,
|
|
241
|
+
executeChromeConnectorTool
|
|
242
|
+
};
|
|
@@ -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-3SPROFG5.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-4Y52G7WG.js");
|
|
369
369
|
return createPageAction(args, thunkApi);
|
|
370
370
|
}
|
|
371
371
|
function subscribe(listener) {
|
|
@@ -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-T3FPYFVF.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-NE5EHXSS.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-A6L6O22P.js");
|
|
345
345
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
346
346
|
}),
|
|
347
347
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildResponseGuidelines
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EOARMOVD.js";
|
|
4
4
|
import {
|
|
5
5
|
getLocalProviderSecret
|
|
6
6
|
} from "./chunk-HS7MLR74.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
clipMultilineText,
|
|
9
9
|
fetchAndSerializeTable,
|
|
10
10
|
resolveBuiltinSkillPage
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MEVSATIF.js";
|
|
12
12
|
import {
|
|
13
13
|
isGatewayHttpStatus
|
|
14
14
|
} from "./chunk-NF64D32W.js";
|
|
@@ -29,13 +29,13 @@ import {
|
|
|
29
29
|
} from "./chunk-MEYIRKDN.js";
|
|
30
30
|
import {
|
|
31
31
|
fetchAndCacheMessages
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-D74EWXL4.js";
|
|
33
33
|
import {
|
|
34
34
|
shouldUseServerProxy
|
|
35
35
|
} from "./chunk-YYLHWIW6.js";
|
|
36
36
|
import {
|
|
37
37
|
fetchServerSyncedCredential
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-QUH3XHL5.js";
|
|
39
39
|
import {
|
|
40
40
|
buildSkillGuidancePromptBlock,
|
|
41
41
|
extractRuntimePageCapabilities,
|
|
@@ -24,7 +24,9 @@ function spawnProcess(options) {
|
|
|
24
24
|
exited: Promise.resolve(127),
|
|
25
25
|
stdin: null,
|
|
26
26
|
stdout: null,
|
|
27
|
-
stderr: null
|
|
27
|
+
stderr: null,
|
|
28
|
+
kill: () => {
|
|
29
|
+
}
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
const exited = new Promise((resolve) => {
|
|
@@ -35,7 +37,13 @@ function spawnProcess(options) {
|
|
|
35
37
|
exited,
|
|
36
38
|
stdin: child.stdin,
|
|
37
39
|
stdout: child.stdout,
|
|
38
|
-
stderr: child.stderr
|
|
40
|
+
stderr: child.stderr,
|
|
41
|
+
kill: () => {
|
|
42
|
+
try {
|
|
43
|
+
child.kill("SIGKILL");
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
39
47
|
};
|
|
40
48
|
}
|
|
41
49
|
async function readPipeText(stream) {
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ALGK6TIE.js";
|
|
9
9
|
import {
|
|
10
10
|
INVALID_TOOL_ARGS_REPLACEMENT,
|
|
11
11
|
buildInvalidToolCallSelfHealResult,
|
|
12
12
|
parseToolCallArguments,
|
|
13
13
|
performFetchRequest,
|
|
14
14
|
sanitizeOutboundMessages
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-U6LKJRJB.js";
|
|
16
16
|
import {
|
|
17
17
|
createSSEParser,
|
|
18
18
|
createToolRunId,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
toolRunSetPending,
|
|
24
24
|
toolRunStarted,
|
|
25
25
|
toolRunSucceeded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-MEVSATIF.js";
|
|
27
27
|
import {
|
|
28
28
|
getPublicImageAgentMode
|
|
29
29
|
} from "./chunk-VIDPVFP3.js";
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
messageStreamEnd,
|
|
36
36
|
messageStreaming,
|
|
37
37
|
updateToolMessage
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-D74EWXL4.js";
|
|
39
39
|
import {
|
|
40
40
|
streamAgentChatTurn
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-QUH3XHL5.js";
|
|
42
42
|
import {
|
|
43
43
|
addActiveController,
|
|
44
44
|
removeActiveController,
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
updateContentPinned,
|
|
8
8
|
updateContentTitle,
|
|
9
9
|
uploadAndAddFileToSpace
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-P7FA2HMM.js";
|
|
11
11
|
import "./chunk-ZJ7UHBJS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-D74EWXL4.js";
|
|
13
13
|
import "./chunk-EVBFYPDC.js";
|
|
14
14
|
import "./chunk-HQUORJTM.js";
|
|
15
15
|
import "./chunk-YYLHWIW6.js";
|
|
16
16
|
import "./chunk-AGGIDPCZ.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-QUH3XHL5.js";
|
|
18
18
|
import "./chunk-BJCWNHVU.js";
|
|
19
19
|
import "./chunk-5RGU3J7P.js";
|
|
20
20
|
import "./chunk-6YTOJY35.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P7FA2HMM.js";
|
|
4
4
|
import "./chunk-ZJ7UHBJS.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-D74EWXL4.js";
|
|
6
6
|
import "./chunk-EVBFYPDC.js";
|
|
7
7
|
import "./chunk-HQUORJTM.js";
|
|
8
8
|
import "./chunk-YYLHWIW6.js";
|
|
9
9
|
import "./chunk-AGGIDPCZ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-QUH3XHL5.js";
|
|
11
11
|
import "./chunk-BJCWNHVU.js";
|
|
12
12
|
import "./chunk-5RGU3J7P.js";
|
|
13
13
|
import "./chunk-6YTOJY35.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDialogAction,
|
|
3
3
|
isLocalOwnerDialogAgents
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-CDVGNZDA.js";
|
|
5
|
+
import "./chunk-P7FA2HMM.js";
|
|
6
6
|
import "./chunk-ZJ7UHBJS.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-D74EWXL4.js";
|
|
8
8
|
import "./chunk-EVBFYPDC.js";
|
|
9
9
|
import "./chunk-HQUORJTM.js";
|
|
10
10
|
import "./chunk-YYLHWIW6.js";
|
|
11
11
|
import "./chunk-AGGIDPCZ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QUH3XHL5.js";
|
|
13
13
|
import "./chunk-BJCWNHVU.js";
|
|
14
14
|
import "./chunk-5RGU3J7P.js";
|
|
15
15
|
import "./chunk-6YTOJY35.js";
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
addContentToSpace,
|
|
16
16
|
client_default
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-P7FA2HMM.js";
|
|
18
18
|
import {
|
|
19
19
|
getCurrentSpaceId
|
|
20
20
|
} from "./chunk-ZJ7UHBJS.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-D74EWXL4.js";
|
|
22
22
|
import "./chunk-EVBFYPDC.js";
|
|
23
23
|
import "./chunk-HQUORJTM.js";
|
|
24
24
|
import "./chunk-YYLHWIW6.js";
|
|
25
25
|
import "./chunk-AGGIDPCZ.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-QUH3XHL5.js";
|
|
27
27
|
import "./chunk-BJCWNHVU.js";
|
|
28
28
|
import "./chunk-5RGU3J7P.js";
|
|
29
29
|
import "./chunk-6YTOJY35.js";
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
runDialogReadCommand,
|
|
11
11
|
runDialogStatusCommand,
|
|
12
12
|
sortDialogs
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FSFQ3A7S.js";
|
|
14
14
|
import "./chunk-ID4G2MAR.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-AFIWC5NH.js";
|
|
16
16
|
import "./chunk-EADNWBAZ.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-QA6YKM3H.js";
|
|
18
18
|
import "./chunk-Q6FF2MCK.js";
|
|
19
19
|
import "./chunk-SPAQ4PVV.js";
|
|
20
20
|
import "./chunk-5XTOKQLW.js";
|
|
@@ -23,11 +23,11 @@ import "./chunk-KQHGZWSV.js";
|
|
|
23
23
|
import "./chunk-HQUORJTM.js";
|
|
24
24
|
import "./chunk-URMS4XY2.js";
|
|
25
25
|
import "./chunk-GLKOYSRU.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-HXAINXPQ.js";
|
|
26
|
+
import "./chunk-CUQ6PG2C.js";
|
|
28
27
|
import "./chunk-ZNFJWEN4.js";
|
|
28
|
+
import "./chunk-QC5LGHYP.js";
|
|
29
29
|
import "./chunk-KIS76A2P.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-CQ3WA2NE.js";
|
|
31
31
|
import "./chunk-N7J63Q6C.js";
|
|
32
32
|
import "./chunk-ZLPA7K55.js";
|
|
33
33
|
import "./chunk-PUOC4YRO.js";
|
|
@@ -50,7 +50,7 @@ import "./chunk-HNMXYYJR.js";
|
|
|
50
50
|
import "./chunk-DVINR3PL.js";
|
|
51
51
|
import "./chunk-2GRGFCF6.js";
|
|
52
52
|
import "./chunk-O6OSWFZQ.js";
|
|
53
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-X7HHHIOZ.js";
|
|
54
54
|
import "./chunk-A7GB5UGH.js";
|
|
55
55
|
import "./chunk-OLZBQWZU.js";
|
|
56
56
|
import "./chunk-NG4UT4K4.js";
|
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
switchDialogAgent,
|
|
21
21
|
updateDialogTitle,
|
|
22
22
|
updateTokens
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-D74EWXL4.js";
|
|
24
24
|
import "./chunk-EVBFYPDC.js";
|
|
25
25
|
import "./chunk-HQUORJTM.js";
|
|
26
26
|
import "./chunk-YYLHWIW6.js";
|
|
27
27
|
import "./chunk-AGGIDPCZ.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-QUH3XHL5.js";
|
|
29
29
|
import "./chunk-BJCWNHVU.js";
|
|
30
30
|
import {
|
|
31
31
|
getActiveDialogAgentId
|
|
@@ -17,22 +17,22 @@ import {
|
|
|
17
17
|
resolveDocKind,
|
|
18
18
|
resolveWriteTargets,
|
|
19
19
|
writePageRecord
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-AFIKMMGC.js";
|
|
21
21
|
import {
|
|
22
22
|
findPotentialSecrets,
|
|
23
23
|
formatSecretFindings
|
|
24
24
|
} from "./chunk-S7Z2HMCN.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-QA6YKM3H.js";
|
|
26
26
|
import "./chunk-Q6FF2MCK.js";
|
|
27
27
|
import "./chunk-SPAQ4PVV.js";
|
|
28
28
|
import "./chunk-VF4K2QE6.js";
|
|
29
29
|
import "./chunk-AETZ7AD6.js";
|
|
30
30
|
import "./chunk-KHCLMKZZ.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-HXAINXPQ.js";
|
|
31
|
+
import "./chunk-CUQ6PG2C.js";
|
|
33
32
|
import "./chunk-ZNFJWEN4.js";
|
|
33
|
+
import "./chunk-QC5LGHYP.js";
|
|
34
34
|
import "./chunk-KIS76A2P.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-CQ3WA2NE.js";
|
|
36
36
|
import "./chunk-N7J63Q6C.js";
|
|
37
37
|
import "./chunk-ZLPA7K55.js";
|
|
38
38
|
import "./chunk-PUOC4YRO.js";
|
|
@@ -55,7 +55,7 @@ import "./chunk-HNMXYYJR.js";
|
|
|
55
55
|
import "./chunk-DVINR3PL.js";
|
|
56
56
|
import "./chunk-2GRGFCF6.js";
|
|
57
57
|
import "./chunk-O6OSWFZQ.js";
|
|
58
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-X7HHHIOZ.js";
|
|
59
59
|
import {
|
|
60
60
|
readOption
|
|
61
61
|
} from "./chunk-A7GB5UGH.js";
|
|
@@ -10,22 +10,22 @@ import {
|
|
|
10
10
|
requireTokenUser,
|
|
11
11
|
resolveDocKind,
|
|
12
12
|
resolveWriteTargets
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AFIKMMGC.js";
|
|
14
14
|
import {
|
|
15
15
|
deleteDbRecordOnServers
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-AFIWC5NH.js";
|
|
17
|
+
import "./chunk-QA6YKM3H.js";
|
|
18
18
|
import "./chunk-Q6FF2MCK.js";
|
|
19
19
|
import "./chunk-SPAQ4PVV.js";
|
|
20
20
|
import "./chunk-KQHGZWSV.js";
|
|
21
21
|
import "./chunk-VF4K2QE6.js";
|
|
22
22
|
import "./chunk-AETZ7AD6.js";
|
|
23
23
|
import "./chunk-KHCLMKZZ.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-HXAINXPQ.js";
|
|
24
|
+
import "./chunk-CUQ6PG2C.js";
|
|
26
25
|
import "./chunk-ZNFJWEN4.js";
|
|
26
|
+
import "./chunk-QC5LGHYP.js";
|
|
27
27
|
import "./chunk-KIS76A2P.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-CQ3WA2NE.js";
|
|
29
29
|
import "./chunk-N7J63Q6C.js";
|
|
30
30
|
import "./chunk-ZLPA7K55.js";
|
|
31
31
|
import "./chunk-PUOC4YRO.js";
|
|
@@ -48,7 +48,7 @@ import "./chunk-HNMXYYJR.js";
|
|
|
48
48
|
import "./chunk-DVINR3PL.js";
|
|
49
49
|
import "./chunk-2GRGFCF6.js";
|
|
50
50
|
import "./chunk-O6OSWFZQ.js";
|
|
51
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-X7HHHIOZ.js";
|
|
52
52
|
import {
|
|
53
53
|
readOption
|
|
54
54
|
} from "./chunk-A7GB5UGH.js";
|
|
@@ -9,18 +9,18 @@ import {
|
|
|
9
9
|
requireTokenUser,
|
|
10
10
|
resolveDocKind,
|
|
11
11
|
resolveWriteTargets
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-AFIKMMGC.js";
|
|
13
|
+
import "./chunk-QA6YKM3H.js";
|
|
14
14
|
import "./chunk-Q6FF2MCK.js";
|
|
15
15
|
import "./chunk-SPAQ4PVV.js";
|
|
16
16
|
import "./chunk-VF4K2QE6.js";
|
|
17
17
|
import "./chunk-AETZ7AD6.js";
|
|
18
18
|
import "./chunk-KHCLMKZZ.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-HXAINXPQ.js";
|
|
19
|
+
import "./chunk-CUQ6PG2C.js";
|
|
21
20
|
import "./chunk-ZNFJWEN4.js";
|
|
21
|
+
import "./chunk-QC5LGHYP.js";
|
|
22
22
|
import "./chunk-KIS76A2P.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-CQ3WA2NE.js";
|
|
24
24
|
import "./chunk-N7J63Q6C.js";
|
|
25
25
|
import "./chunk-ZLPA7K55.js";
|
|
26
26
|
import "./chunk-PUOC4YRO.js";
|
|
@@ -43,7 +43,7 @@ import "./chunk-HNMXYYJR.js";
|
|
|
43
43
|
import "./chunk-DVINR3PL.js";
|
|
44
44
|
import "./chunk-2GRGFCF6.js";
|
|
45
45
|
import "./chunk-O6OSWFZQ.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-X7HHHIOZ.js";
|
|
47
47
|
import {
|
|
48
48
|
readOption
|
|
49
49
|
} from "./chunk-A7GB5UGH.js";
|