voice-page-agent 2.7.4 → 2.7.6
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 +2 -0
- package/dist/index.cjs +268 -668
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +157 -60
- package/dist/{page-agent-H32WE3CG.js → page-agent-ZROQ54L4.js} +105 -580
- package/package.json +1 -1
|
@@ -1,497 +1,22 @@
|
|
|
1
1
|
import { __export, __publicField } from './chunk-MKBO26DX.js';
|
|
2
|
-
import process from 'process';
|
|
3
|
-
import os from 'os';
|
|
4
|
-
import tty from 'tty';
|
|
5
2
|
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
10
|
-
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
11
|
-
var styles = {
|
|
12
|
-
modifier: {
|
|
13
|
-
reset: [0, 0],
|
|
14
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
15
|
-
bold: [1, 22],
|
|
16
|
-
dim: [2, 22],
|
|
17
|
-
italic: [3, 23],
|
|
18
|
-
underline: [4, 24],
|
|
19
|
-
overline: [53, 55],
|
|
20
|
-
inverse: [7, 27],
|
|
21
|
-
hidden: [8, 28],
|
|
22
|
-
strikethrough: [9, 29]
|
|
23
|
-
},
|
|
24
|
-
color: {
|
|
25
|
-
black: [30, 39],
|
|
26
|
-
red: [31, 39],
|
|
27
|
-
green: [32, 39],
|
|
28
|
-
yellow: [33, 39],
|
|
29
|
-
blue: [34, 39],
|
|
30
|
-
magenta: [35, 39],
|
|
31
|
-
cyan: [36, 39],
|
|
32
|
-
white: [37, 39],
|
|
33
|
-
// Bright color
|
|
34
|
-
blackBright: [90, 39],
|
|
35
|
-
gray: [90, 39],
|
|
36
|
-
// Alias of `blackBright`
|
|
37
|
-
grey: [90, 39],
|
|
38
|
-
// Alias of `blackBright`
|
|
39
|
-
redBright: [91, 39],
|
|
40
|
-
greenBright: [92, 39],
|
|
41
|
-
yellowBright: [93, 39],
|
|
42
|
-
blueBright: [94, 39],
|
|
43
|
-
magentaBright: [95, 39],
|
|
44
|
-
cyanBright: [96, 39],
|
|
45
|
-
whiteBright: [97, 39]
|
|
46
|
-
},
|
|
47
|
-
bgColor: {
|
|
48
|
-
bgBlack: [40, 49],
|
|
49
|
-
bgRed: [41, 49],
|
|
50
|
-
bgGreen: [42, 49],
|
|
51
|
-
bgYellow: [43, 49],
|
|
52
|
-
bgBlue: [44, 49],
|
|
53
|
-
bgMagenta: [45, 49],
|
|
54
|
-
bgCyan: [46, 49],
|
|
55
|
-
bgWhite: [47, 49],
|
|
56
|
-
// Bright color
|
|
57
|
-
bgBlackBright: [100, 49],
|
|
58
|
-
bgGray: [100, 49],
|
|
59
|
-
// Alias of `bgBlackBright`
|
|
60
|
-
bgGrey: [100, 49],
|
|
61
|
-
// Alias of `bgBlackBright`
|
|
62
|
-
bgRedBright: [101, 49],
|
|
63
|
-
bgGreenBright: [102, 49],
|
|
64
|
-
bgYellowBright: [103, 49],
|
|
65
|
-
bgBlueBright: [104, 49],
|
|
66
|
-
bgMagentaBright: [105, 49],
|
|
67
|
-
bgCyanBright: [106, 49],
|
|
68
|
-
bgWhiteBright: [107, 49]
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
Object.keys(styles.modifier);
|
|
72
|
-
var foregroundColorNames = Object.keys(styles.color);
|
|
73
|
-
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
74
|
-
[...foregroundColorNames, ...backgroundColorNames];
|
|
75
|
-
function assembleStyles() {
|
|
76
|
-
const codes = /* @__PURE__ */ new Map();
|
|
77
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
78
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
79
|
-
styles[styleName] = {
|
|
80
|
-
open: `\x1B[${style[0]}m`,
|
|
81
|
-
close: `\x1B[${style[1]}m`
|
|
82
|
-
};
|
|
83
|
-
group[styleName] = styles[styleName];
|
|
84
|
-
codes.set(style[0], style[1]);
|
|
85
|
-
}
|
|
86
|
-
Object.defineProperty(styles, groupName, {
|
|
87
|
-
value: group,
|
|
88
|
-
enumerable: false
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
Object.defineProperty(styles, "codes", {
|
|
92
|
-
value: codes,
|
|
93
|
-
enumerable: false
|
|
94
|
-
});
|
|
95
|
-
styles.color.close = "\x1B[39m";
|
|
96
|
-
styles.bgColor.close = "\x1B[49m";
|
|
97
|
-
styles.color.ansi = wrapAnsi16();
|
|
98
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
99
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
100
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
101
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
102
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
103
|
-
Object.defineProperties(styles, {
|
|
104
|
-
rgbToAnsi256: {
|
|
105
|
-
value(red, green, blue) {
|
|
106
|
-
if (red === green && green === blue) {
|
|
107
|
-
if (red < 8) {
|
|
108
|
-
return 16;
|
|
109
|
-
}
|
|
110
|
-
if (red > 248) {
|
|
111
|
-
return 231;
|
|
112
|
-
}
|
|
113
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
114
|
-
}
|
|
115
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
116
|
-
},
|
|
117
|
-
enumerable: false
|
|
118
|
-
},
|
|
119
|
-
hexToRgb: {
|
|
120
|
-
value(hex3) {
|
|
121
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex3.toString(16));
|
|
122
|
-
if (!matches) {
|
|
123
|
-
return [0, 0, 0];
|
|
124
|
-
}
|
|
125
|
-
let [colorString] = matches;
|
|
126
|
-
if (colorString.length === 3) {
|
|
127
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
128
|
-
}
|
|
129
|
-
const integer2 = Number.parseInt(colorString, 16);
|
|
130
|
-
return [
|
|
131
|
-
/* eslint-disable no-bitwise */
|
|
132
|
-
integer2 >> 16 & 255,
|
|
133
|
-
integer2 >> 8 & 255,
|
|
134
|
-
integer2 & 255
|
|
135
|
-
/* eslint-enable no-bitwise */
|
|
136
|
-
];
|
|
137
|
-
},
|
|
138
|
-
enumerable: false
|
|
139
|
-
},
|
|
140
|
-
hexToAnsi256: {
|
|
141
|
-
value: (hex3) => styles.rgbToAnsi256(...styles.hexToRgb(hex3)),
|
|
142
|
-
enumerable: false
|
|
143
|
-
},
|
|
144
|
-
ansi256ToAnsi: {
|
|
145
|
-
value(code) {
|
|
146
|
-
if (code < 8) {
|
|
147
|
-
return 30 + code;
|
|
148
|
-
}
|
|
149
|
-
if (code < 16) {
|
|
150
|
-
return 90 + (code - 8);
|
|
151
|
-
}
|
|
152
|
-
let red;
|
|
153
|
-
let green;
|
|
154
|
-
let blue;
|
|
155
|
-
if (code >= 232) {
|
|
156
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
157
|
-
green = red;
|
|
158
|
-
blue = red;
|
|
159
|
-
} else {
|
|
160
|
-
code -= 16;
|
|
161
|
-
const remainder = code % 36;
|
|
162
|
-
red = Math.floor(code / 36) / 5;
|
|
163
|
-
green = Math.floor(remainder / 6) / 5;
|
|
164
|
-
blue = remainder % 6 / 5;
|
|
165
|
-
}
|
|
166
|
-
const value = Math.max(red, green, blue) * 2;
|
|
167
|
-
if (value === 0) {
|
|
168
|
-
return 30;
|
|
169
|
-
}
|
|
170
|
-
let result2 = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
171
|
-
if (value === 2) {
|
|
172
|
-
result2 += 60;
|
|
173
|
-
}
|
|
174
|
-
return result2;
|
|
175
|
-
},
|
|
176
|
-
enumerable: false
|
|
177
|
-
},
|
|
178
|
-
rgbToAnsi: {
|
|
179
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
180
|
-
enumerable: false
|
|
181
|
-
},
|
|
182
|
-
hexToAnsi: {
|
|
183
|
-
value: (hex3) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex3)),
|
|
184
|
-
enumerable: false
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
return styles;
|
|
188
|
-
}
|
|
189
|
-
var ansiStyles = assembleStyles();
|
|
190
|
-
var ansi_styles_default = ansiStyles;
|
|
191
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
|
|
192
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
193
|
-
const position = argv.indexOf(prefix + flag);
|
|
194
|
-
const terminatorPosition = argv.indexOf("--");
|
|
195
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
196
|
-
}
|
|
197
|
-
var { env } = process;
|
|
198
|
-
var flagForceColor;
|
|
199
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
200
|
-
flagForceColor = 0;
|
|
201
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
202
|
-
flagForceColor = 1;
|
|
203
|
-
}
|
|
204
|
-
function envForceColor() {
|
|
205
|
-
if ("FORCE_COLOR" in env) {
|
|
206
|
-
if (env.FORCE_COLOR === "true") {
|
|
207
|
-
return 1;
|
|
208
|
-
}
|
|
209
|
-
if (env.FORCE_COLOR === "false") {
|
|
210
|
-
return 0;
|
|
211
|
-
}
|
|
212
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
function translateLevel(level) {
|
|
216
|
-
if (level === 0) {
|
|
217
|
-
return false;
|
|
218
|
-
}
|
|
219
|
-
return {
|
|
220
|
-
level,
|
|
221
|
-
hasBasic: true,
|
|
222
|
-
has256: level >= 2,
|
|
223
|
-
has16m: level >= 3
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
227
|
-
const noFlagForceColor = envForceColor();
|
|
228
|
-
if (noFlagForceColor !== void 0) {
|
|
229
|
-
flagForceColor = noFlagForceColor;
|
|
230
|
-
}
|
|
231
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
232
|
-
if (forceColor === 0) {
|
|
233
|
-
return 0;
|
|
234
|
-
}
|
|
235
|
-
if (sniffFlags) {
|
|
236
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
237
|
-
return 3;
|
|
238
|
-
}
|
|
239
|
-
if (hasFlag("color=256")) {
|
|
240
|
-
return 2;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
244
|
-
return 1;
|
|
245
|
-
}
|
|
246
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
247
|
-
return 0;
|
|
248
|
-
}
|
|
249
|
-
const min = forceColor || 0;
|
|
250
|
-
if (env.TERM === "dumb") {
|
|
251
|
-
return min;
|
|
252
|
-
}
|
|
253
|
-
if (process.platform === "win32") {
|
|
254
|
-
const osRelease = os.release().split(".");
|
|
255
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
256
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
257
|
-
}
|
|
258
|
-
return 1;
|
|
259
|
-
}
|
|
260
|
-
if ("CI" in env) {
|
|
261
|
-
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
|
262
|
-
return 3;
|
|
263
|
-
}
|
|
264
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
265
|
-
return 1;
|
|
266
|
-
}
|
|
267
|
-
return min;
|
|
268
|
-
}
|
|
269
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
270
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
271
|
-
}
|
|
272
|
-
if (env.COLORTERM === "truecolor") {
|
|
273
|
-
return 3;
|
|
274
|
-
}
|
|
275
|
-
if (env.TERM === "xterm-kitty") {
|
|
276
|
-
return 3;
|
|
277
|
-
}
|
|
278
|
-
if (env.TERM === "xterm-ghostty") {
|
|
279
|
-
return 3;
|
|
280
|
-
}
|
|
281
|
-
if (env.TERM === "wezterm") {
|
|
282
|
-
return 3;
|
|
283
|
-
}
|
|
284
|
-
if ("TERM_PROGRAM" in env) {
|
|
285
|
-
const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
286
|
-
switch (env.TERM_PROGRAM) {
|
|
287
|
-
case "iTerm.app": {
|
|
288
|
-
return version2 >= 3 ? 3 : 2;
|
|
289
|
-
}
|
|
290
|
-
case "Apple_Terminal": {
|
|
291
|
-
return 2;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
296
|
-
return 2;
|
|
297
|
-
}
|
|
298
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
299
|
-
return 1;
|
|
300
|
-
}
|
|
301
|
-
if ("COLORTERM" in env) {
|
|
302
|
-
return 1;
|
|
303
|
-
}
|
|
304
|
-
return min;
|
|
305
|
-
}
|
|
306
|
-
function createSupportsColor(stream, options = {}) {
|
|
307
|
-
const level = _supportsColor(stream, {
|
|
308
|
-
streamIsTTY: stream && stream.isTTY,
|
|
309
|
-
...options
|
|
310
|
-
});
|
|
311
|
-
return translateLevel(level);
|
|
312
|
-
}
|
|
313
|
-
var supportsColor = {
|
|
314
|
-
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
315
|
-
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
316
|
-
};
|
|
317
|
-
var supports_color_default = supportsColor;
|
|
318
|
-
|
|
319
|
-
// node_modules/chalk/source/utilities.js
|
|
320
|
-
function stringReplaceAll(string4, substring, replacer) {
|
|
321
|
-
let index = string4.indexOf(substring);
|
|
322
|
-
if (index === -1) {
|
|
323
|
-
return string4;
|
|
324
|
-
}
|
|
325
|
-
const substringLength = substring.length;
|
|
326
|
-
let endIndex = 0;
|
|
327
|
-
let returnValue = "";
|
|
328
|
-
do {
|
|
329
|
-
returnValue += string4.slice(endIndex, index) + substring + replacer;
|
|
330
|
-
endIndex = index + substringLength;
|
|
331
|
-
index = string4.indexOf(substring, endIndex);
|
|
332
|
-
} while (index !== -1);
|
|
333
|
-
returnValue += string4.slice(endIndex);
|
|
334
|
-
return returnValue;
|
|
335
|
-
}
|
|
336
|
-
function stringEncaseCRLFWithFirstIndex(string4, prefix, postfix, index) {
|
|
337
|
-
let endIndex = 0;
|
|
338
|
-
let returnValue = "";
|
|
339
|
-
do {
|
|
340
|
-
const gotCR = string4[index - 1] === "\r";
|
|
341
|
-
returnValue += string4.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
342
|
-
endIndex = index + 1;
|
|
343
|
-
index = string4.indexOf("\n", endIndex);
|
|
344
|
-
} while (index !== -1);
|
|
345
|
-
returnValue += string4.slice(endIndex);
|
|
346
|
-
return returnValue;
|
|
3
|
+
// src/shims/chalk.ts
|
|
4
|
+
function joinArgs(args) {
|
|
5
|
+
return args.map((item) => String(item)).join(" ");
|
|
347
6
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
var GENERATOR = /* @__PURE__ */ Symbol("GENERATOR");
|
|
352
|
-
var STYLER = /* @__PURE__ */ Symbol("STYLER");
|
|
353
|
-
var IS_EMPTY = /* @__PURE__ */ Symbol("IS_EMPTY");
|
|
354
|
-
var levelMapping = [
|
|
355
|
-
"ansi",
|
|
356
|
-
"ansi",
|
|
357
|
-
"ansi256",
|
|
358
|
-
"ansi16m"
|
|
359
|
-
];
|
|
360
|
-
var styles2 = /* @__PURE__ */ Object.create(null);
|
|
361
|
-
var applyOptions = (object2, options = {}) => {
|
|
362
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
363
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
364
|
-
}
|
|
365
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
366
|
-
object2.level = options.level === void 0 ? colorLevel : options.level;
|
|
367
|
-
};
|
|
368
|
-
var chalkFactory = (options) => {
|
|
369
|
-
const chalk2 = (...strings) => strings.join(" ");
|
|
370
|
-
applyOptions(chalk2, options);
|
|
371
|
-
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
372
|
-
return chalk2;
|
|
373
|
-
};
|
|
374
|
-
function createChalk(options) {
|
|
375
|
-
return chalkFactory(options);
|
|
376
|
-
}
|
|
377
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
378
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
379
|
-
styles2[styleName] = {
|
|
7
|
+
function createChalk() {
|
|
8
|
+
const base = ((...args) => joinArgs(args));
|
|
9
|
+
return new Proxy(base, {
|
|
380
10
|
get() {
|
|
381
|
-
|
|
382
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
383
|
-
return builder;
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
styles2.visible = {
|
|
388
|
-
get() {
|
|
389
|
-
const builder = createBuilder(this, this[STYLER], true);
|
|
390
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
391
|
-
return builder;
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
395
|
-
if (model === "rgb") {
|
|
396
|
-
if (level === "ansi16m") {
|
|
397
|
-
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
398
|
-
}
|
|
399
|
-
if (level === "ansi256") {
|
|
400
|
-
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
401
|
-
}
|
|
402
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
403
|
-
}
|
|
404
|
-
if (model === "hex") {
|
|
405
|
-
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
406
|
-
}
|
|
407
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
408
|
-
};
|
|
409
|
-
var usedModels = ["rgb", "hex", "ansi256"];
|
|
410
|
-
for (const model of usedModels) {
|
|
411
|
-
styles2[model] = {
|
|
412
|
-
get() {
|
|
413
|
-
const { level } = this;
|
|
414
|
-
return function(...arguments_) {
|
|
415
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
416
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
421
|
-
styles2[bgModel] = {
|
|
422
|
-
get() {
|
|
423
|
-
const { level } = this;
|
|
424
|
-
return function(...arguments_) {
|
|
425
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
426
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
var proto = Object.defineProperties(() => {
|
|
432
|
-
}, {
|
|
433
|
-
...styles2,
|
|
434
|
-
level: {
|
|
435
|
-
enumerable: true,
|
|
436
|
-
get() {
|
|
437
|
-
return this[GENERATOR].level;
|
|
11
|
+
return createChalk();
|
|
438
12
|
},
|
|
439
|
-
|
|
440
|
-
|
|
13
|
+
apply(_, __, args) {
|
|
14
|
+
return joinArgs(args);
|
|
441
15
|
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
var createStyler = (open, close, parent) => {
|
|
445
|
-
let openAll;
|
|
446
|
-
let closeAll;
|
|
447
|
-
if (parent === void 0) {
|
|
448
|
-
openAll = open;
|
|
449
|
-
closeAll = close;
|
|
450
|
-
} else {
|
|
451
|
-
openAll = parent.openAll + open;
|
|
452
|
-
closeAll = close + parent.closeAll;
|
|
453
|
-
}
|
|
454
|
-
return {
|
|
455
|
-
open,
|
|
456
|
-
close,
|
|
457
|
-
openAll,
|
|
458
|
-
closeAll,
|
|
459
|
-
parent
|
|
460
|
-
};
|
|
461
|
-
};
|
|
462
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
463
|
-
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
464
|
-
Object.setPrototypeOf(builder, proto);
|
|
465
|
-
builder[GENERATOR] = self;
|
|
466
|
-
builder[STYLER] = _styler;
|
|
467
|
-
builder[IS_EMPTY] = _isEmpty;
|
|
468
|
-
return builder;
|
|
469
|
-
};
|
|
470
|
-
var applyStyle = (self, string4) => {
|
|
471
|
-
if (self.level <= 0 || !string4) {
|
|
472
|
-
return self[IS_EMPTY] ? "" : string4;
|
|
473
|
-
}
|
|
474
|
-
let styler = self[STYLER];
|
|
475
|
-
if (styler === void 0) {
|
|
476
|
-
return string4;
|
|
477
|
-
}
|
|
478
|
-
const { openAll, closeAll } = styler;
|
|
479
|
-
if (string4.includes("\x1B")) {
|
|
480
|
-
while (styler !== void 0) {
|
|
481
|
-
string4 = stringReplaceAll(string4, styler.close, styler.open);
|
|
482
|
-
styler = styler.parent;
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
const lfIndex = string4.indexOf("\n");
|
|
486
|
-
if (lfIndex !== -1) {
|
|
487
|
-
string4 = stringEncaseCRLFWithFirstIndex(string4, closeAll, openAll, lfIndex);
|
|
488
|
-
}
|
|
489
|
-
return openAll + string4 + closeAll;
|
|
490
|
-
};
|
|
491
|
-
Object.defineProperties(createChalk.prototype, styles2);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
492
18
|
var chalk = createChalk();
|
|
493
|
-
|
|
494
|
-
var source_default = chalk;
|
|
19
|
+
var chalk_default = chalk;
|
|
495
20
|
|
|
496
21
|
// node_modules/zod/v4/classic/external.js
|
|
497
22
|
var external_exports = {};
|
|
@@ -996,7 +521,7 @@ __export(core_exports2, {
|
|
|
996
521
|
parse: () => parse,
|
|
997
522
|
parseAsync: () => parseAsync,
|
|
998
523
|
prettifyError: () => prettifyError,
|
|
999
|
-
process: () =>
|
|
524
|
+
process: () => process,
|
|
1000
525
|
regexes: () => regexes_exports,
|
|
1001
526
|
registry: () => registry,
|
|
1002
527
|
safeDecode: () => safeDecode,
|
|
@@ -1035,12 +560,12 @@ function $constructor(name, initializer3, params) {
|
|
|
1035
560
|
}
|
|
1036
561
|
inst._zod.traits.add(name);
|
|
1037
562
|
initializer3(inst, def);
|
|
1038
|
-
const
|
|
1039
|
-
const keys = Object.keys(
|
|
563
|
+
const proto = _.prototype;
|
|
564
|
+
const keys = Object.keys(proto);
|
|
1040
565
|
for (let i = 0; i < keys.length; i++) {
|
|
1041
566
|
const k = keys[i];
|
|
1042
567
|
if (!(k in inst)) {
|
|
1043
|
-
inst[k] =
|
|
568
|
+
inst[k] = proto[k].bind(inst);
|
|
1044
569
|
}
|
|
1045
570
|
}
|
|
1046
571
|
}
|
|
@@ -11591,7 +11116,7 @@ function initializeContext(params) {
|
|
|
11591
11116
|
external: (_i = params == null ? void 0 : params.external) != null ? _i : void 0
|
|
11592
11117
|
};
|
|
11593
11118
|
}
|
|
11594
|
-
function
|
|
11119
|
+
function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
11595
11120
|
var _a4, _b, _c;
|
|
11596
11121
|
var _a3;
|
|
11597
11122
|
const def = schema._zod.def;
|
|
@@ -11629,7 +11154,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
11629
11154
|
if (parent) {
|
|
11630
11155
|
if (!result2.ref)
|
|
11631
11156
|
result2.ref = parent;
|
|
11632
|
-
|
|
11157
|
+
process(parent, ctx, params);
|
|
11633
11158
|
ctx.seen.get(parent).isParent = true;
|
|
11634
11159
|
}
|
|
11635
11160
|
}
|
|
@@ -11911,14 +11436,14 @@ function isTransforming(_schema, _ctx) {
|
|
|
11911
11436
|
}
|
|
11912
11437
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
11913
11438
|
const ctx = initializeContext({ ...params, processors });
|
|
11914
|
-
|
|
11439
|
+
process(schema, ctx);
|
|
11915
11440
|
extractDefs(ctx, schema);
|
|
11916
11441
|
return finalize(ctx, schema);
|
|
11917
11442
|
};
|
|
11918
11443
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
11919
11444
|
const { libraryOptions, target } = params != null ? params : {};
|
|
11920
11445
|
const ctx = initializeContext({ ...libraryOptions != null ? libraryOptions : {}, target, io, processors });
|
|
11921
|
-
|
|
11446
|
+
process(schema, ctx);
|
|
11922
11447
|
extractDefs(ctx, schema);
|
|
11923
11448
|
return finalize(ctx, schema);
|
|
11924
11449
|
};
|
|
@@ -12174,7 +11699,7 @@ var arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
12174
11699
|
if (typeof maximum === "number")
|
|
12175
11700
|
json2.maxItems = maximum;
|
|
12176
11701
|
json2.type = "array";
|
|
12177
|
-
json2.items =
|
|
11702
|
+
json2.items = process(def.element, ctx, { ...params, path: [...params.path, "items"] });
|
|
12178
11703
|
};
|
|
12179
11704
|
var objectProcessor = (schema, ctx, _json, params) => {
|
|
12180
11705
|
var _a3;
|
|
@@ -12184,7 +11709,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
12184
11709
|
json2.properties = {};
|
|
12185
11710
|
const shape = def.shape;
|
|
12186
11711
|
for (const key in shape) {
|
|
12187
|
-
json2.properties[key] =
|
|
11712
|
+
json2.properties[key] = process(shape[key], ctx, {
|
|
12188
11713
|
...params,
|
|
12189
11714
|
path: [...params.path, "properties", key]
|
|
12190
11715
|
});
|
|
@@ -12207,7 +11732,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
12207
11732
|
if (ctx.io === "output")
|
|
12208
11733
|
json2.additionalProperties = false;
|
|
12209
11734
|
} else if (def.catchall) {
|
|
12210
|
-
json2.additionalProperties =
|
|
11735
|
+
json2.additionalProperties = process(def.catchall, ctx, {
|
|
12211
11736
|
...params,
|
|
12212
11737
|
path: [...params.path, "additionalProperties"]
|
|
12213
11738
|
});
|
|
@@ -12216,7 +11741,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
12216
11741
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
12217
11742
|
const def = schema._zod.def;
|
|
12218
11743
|
const isExclusive = def.inclusive === false;
|
|
12219
|
-
const options = def.options.map((x, i) =>
|
|
11744
|
+
const options = def.options.map((x, i) => process(x, ctx, {
|
|
12220
11745
|
...params,
|
|
12221
11746
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
12222
11747
|
}));
|
|
@@ -12228,11 +11753,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
12228
11753
|
};
|
|
12229
11754
|
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
12230
11755
|
const def = schema._zod.def;
|
|
12231
|
-
const a =
|
|
11756
|
+
const a = process(def.left, ctx, {
|
|
12232
11757
|
...params,
|
|
12233
11758
|
path: [...params.path, "allOf", 0]
|
|
12234
11759
|
});
|
|
12235
|
-
const b =
|
|
11760
|
+
const b = process(def.right, ctx, {
|
|
12236
11761
|
...params,
|
|
12237
11762
|
path: [...params.path, "allOf", 1]
|
|
12238
11763
|
});
|
|
@@ -12249,11 +11774,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
12249
11774
|
json2.type = "array";
|
|
12250
11775
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
12251
11776
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
12252
|
-
const prefixItems = def.items.map((x, i) =>
|
|
11777
|
+
const prefixItems = def.items.map((x, i) => process(x, ctx, {
|
|
12253
11778
|
...params,
|
|
12254
11779
|
path: [...params.path, prefixPath, i]
|
|
12255
11780
|
}));
|
|
12256
|
-
const rest = def.rest ?
|
|
11781
|
+
const rest = def.rest ? process(def.rest, ctx, {
|
|
12257
11782
|
...params,
|
|
12258
11783
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
12259
11784
|
}) : null;
|
|
@@ -12293,7 +11818,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
12293
11818
|
const keyBag = keyType._zod.bag;
|
|
12294
11819
|
const patterns = keyBag == null ? void 0 : keyBag.patterns;
|
|
12295
11820
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
12296
|
-
const valueSchema =
|
|
11821
|
+
const valueSchema = process(def.valueType, ctx, {
|
|
12297
11822
|
...params,
|
|
12298
11823
|
path: [...params.path, "patternProperties", "*"]
|
|
12299
11824
|
});
|
|
@@ -12303,12 +11828,12 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
12303
11828
|
}
|
|
12304
11829
|
} else {
|
|
12305
11830
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
12306
|
-
json2.propertyNames =
|
|
11831
|
+
json2.propertyNames = process(def.keyType, ctx, {
|
|
12307
11832
|
...params,
|
|
12308
11833
|
path: [...params.path, "propertyNames"]
|
|
12309
11834
|
});
|
|
12310
11835
|
}
|
|
12311
|
-
json2.additionalProperties =
|
|
11836
|
+
json2.additionalProperties = process(def.valueType, ctx, {
|
|
12312
11837
|
...params,
|
|
12313
11838
|
path: [...params.path, "additionalProperties"]
|
|
12314
11839
|
});
|
|
@@ -12323,7 +11848,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
12323
11848
|
};
|
|
12324
11849
|
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
12325
11850
|
const def = schema._zod.def;
|
|
12326
|
-
const inner =
|
|
11851
|
+
const inner = process(def.innerType, ctx, params);
|
|
12327
11852
|
const seen = ctx.seen.get(schema);
|
|
12328
11853
|
if (ctx.target === "openapi-3.0") {
|
|
12329
11854
|
seen.ref = def.innerType;
|
|
@@ -12334,20 +11859,20 @@ var nullableProcessor = (schema, ctx, json2, params) => {
|
|
|
12334
11859
|
};
|
|
12335
11860
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
12336
11861
|
const def = schema._zod.def;
|
|
12337
|
-
|
|
11862
|
+
process(def.innerType, ctx, params);
|
|
12338
11863
|
const seen = ctx.seen.get(schema);
|
|
12339
11864
|
seen.ref = def.innerType;
|
|
12340
11865
|
};
|
|
12341
11866
|
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
12342
11867
|
const def = schema._zod.def;
|
|
12343
|
-
|
|
11868
|
+
process(def.innerType, ctx, params);
|
|
12344
11869
|
const seen = ctx.seen.get(schema);
|
|
12345
11870
|
seen.ref = def.innerType;
|
|
12346
11871
|
json2.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
12347
11872
|
};
|
|
12348
11873
|
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
12349
11874
|
const def = schema._zod.def;
|
|
12350
|
-
|
|
11875
|
+
process(def.innerType, ctx, params);
|
|
12351
11876
|
const seen = ctx.seen.get(schema);
|
|
12352
11877
|
seen.ref = def.innerType;
|
|
12353
11878
|
if (ctx.io === "input")
|
|
@@ -12355,7 +11880,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
|
12355
11880
|
};
|
|
12356
11881
|
var catchProcessor = (schema, ctx, json2, params) => {
|
|
12357
11882
|
const def = schema._zod.def;
|
|
12358
|
-
|
|
11883
|
+
process(def.innerType, ctx, params);
|
|
12359
11884
|
const seen = ctx.seen.get(schema);
|
|
12360
11885
|
seen.ref = def.innerType;
|
|
12361
11886
|
let catchValue;
|
|
@@ -12369,32 +11894,32 @@ var catchProcessor = (schema, ctx, json2, params) => {
|
|
|
12369
11894
|
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
12370
11895
|
const def = schema._zod.def;
|
|
12371
11896
|
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
12372
|
-
|
|
11897
|
+
process(innerType, ctx, params);
|
|
12373
11898
|
const seen = ctx.seen.get(schema);
|
|
12374
11899
|
seen.ref = innerType;
|
|
12375
11900
|
};
|
|
12376
11901
|
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
12377
11902
|
const def = schema._zod.def;
|
|
12378
|
-
|
|
11903
|
+
process(def.innerType, ctx, params);
|
|
12379
11904
|
const seen = ctx.seen.get(schema);
|
|
12380
11905
|
seen.ref = def.innerType;
|
|
12381
11906
|
json2.readOnly = true;
|
|
12382
11907
|
};
|
|
12383
11908
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
12384
11909
|
const def = schema._zod.def;
|
|
12385
|
-
|
|
11910
|
+
process(def.innerType, ctx, params);
|
|
12386
11911
|
const seen = ctx.seen.get(schema);
|
|
12387
11912
|
seen.ref = def.innerType;
|
|
12388
11913
|
};
|
|
12389
11914
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
12390
11915
|
const def = schema._zod.def;
|
|
12391
|
-
|
|
11916
|
+
process(def.innerType, ctx, params);
|
|
12392
11917
|
const seen = ctx.seen.get(schema);
|
|
12393
11918
|
seen.ref = def.innerType;
|
|
12394
11919
|
};
|
|
12395
11920
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
12396
11921
|
const innerType = schema._zod.innerType;
|
|
12397
|
-
|
|
11922
|
+
process(innerType, ctx, params);
|
|
12398
11923
|
const seen = ctx.seen.get(schema);
|
|
12399
11924
|
seen.ref = innerType;
|
|
12400
11925
|
};
|
|
@@ -12446,7 +11971,7 @@ function toJSONSchema(input2, params) {
|
|
|
12446
11971
|
const defs = {};
|
|
12447
11972
|
for (const entry of registry2._idmap.entries()) {
|
|
12448
11973
|
const [_, schema] = entry;
|
|
12449
|
-
|
|
11974
|
+
process(schema, ctx2);
|
|
12450
11975
|
}
|
|
12451
11976
|
const schemas = {};
|
|
12452
11977
|
const external = {
|
|
@@ -12469,7 +11994,7 @@ function toJSONSchema(input2, params) {
|
|
|
12469
11994
|
return { schemas };
|
|
12470
11995
|
}
|
|
12471
11996
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
12472
|
-
|
|
11997
|
+
process(input2, ctx);
|
|
12473
11998
|
extractDefs(ctx, input2);
|
|
12474
11999
|
return finalize(ctx, input2);
|
|
12475
12000
|
}
|
|
@@ -12528,7 +12053,7 @@ var JSONSchemaGenerator = class {
|
|
|
12528
12053
|
* This must be called before emit().
|
|
12529
12054
|
*/
|
|
12530
12055
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
12531
|
-
return
|
|
12056
|
+
return process(schema, this.ctx, _params);
|
|
12532
12057
|
}
|
|
12533
12058
|
/**
|
|
12534
12059
|
* Emit the final JSON Schema after processing.
|
|
@@ -14525,7 +14050,7 @@ var _InvokeError = class _InvokeError2 extends Error {
|
|
|
14525
14050
|
__name(_InvokeError, "InvokeError");
|
|
14526
14051
|
var InvokeError = _InvokeError;
|
|
14527
14052
|
function debug(message) {
|
|
14528
|
-
console.debug(
|
|
14053
|
+
console.debug(chalk_default.gray("[LLM]"), message);
|
|
14529
14054
|
}
|
|
14530
14055
|
__name(debug, "debug");
|
|
14531
14056
|
function zodToOpenAITool(name, tool2) {
|
|
@@ -17248,7 +16773,7 @@ function isPageDark() {
|
|
|
17248
16773
|
}
|
|
17249
16774
|
__name2(isPageDark, "isPageDark");
|
|
17250
16775
|
var wrapper = "_wrapper_1oy2s_1";
|
|
17251
|
-
var
|
|
16776
|
+
var styles = {
|
|
17252
16777
|
wrapper
|
|
17253
16778
|
};
|
|
17254
16779
|
var cursor = "_cursor_1vrf3_2";
|
|
@@ -17280,7 +16805,7 @@ var _SimulatorMask = class _SimulatorMask2 {
|
|
|
17280
16805
|
__privateAdd(this, _targetCursorX, 0);
|
|
17281
16806
|
__privateAdd(this, _targetCursorY, 0);
|
|
17282
16807
|
this.wrapper.id = "page-agent-runtime_simulator-mask";
|
|
17283
|
-
this.wrapper.className =
|
|
16808
|
+
this.wrapper.className = styles.wrapper;
|
|
17284
16809
|
this.wrapper.setAttribute("data-browser-use-ignore", "true");
|
|
17285
16810
|
this.wrapper.appendChild(this.motion.element);
|
|
17286
16811
|
this.motion.autoResize(this.wrapper);
|
|
@@ -17968,7 +17493,7 @@ var inputSectionWrapper = "_inputSectionWrapper_1x12x_528";
|
|
|
17968
17493
|
var hidden = "_hidden_1x12x_551";
|
|
17969
17494
|
var inputSection = "_inputSection_1x12x_528";
|
|
17970
17495
|
var taskInput = "_taskInput_1x12x_562";
|
|
17971
|
-
var
|
|
17496
|
+
var styles2 = {
|
|
17972
17497
|
wrapper: wrapper2,
|
|
17973
17498
|
"mask-running": "_mask-running_1x12x_1",
|
|
17974
17499
|
background,
|
|
@@ -18033,13 +17558,13 @@ var _Panel = class _Panel2 {
|
|
|
18033
17558
|
__privateSet2(this, _config, config2);
|
|
18034
17559
|
__privateSet2(this, _i18n, new I18n((_a3 = config2.language) != null ? _a3 : "en-US"));
|
|
18035
17560
|
__privateSet2(this, _wrapper, __privateMethod2(this, _Panel_instances, createWrapper_fn).call(this));
|
|
18036
|
-
__privateSet2(this, _indicator, __privateGet2(this, _wrapper).querySelector(`.${
|
|
18037
|
-
__privateSet2(this, _statusText, __privateGet2(this, _wrapper).querySelector(`.${
|
|
18038
|
-
__privateSet2(this, _historySection, __privateGet2(this, _wrapper).querySelector(`.${
|
|
18039
|
-
__privateSet2(this, _expandButton, __privateGet2(this, _wrapper).querySelector(`.${
|
|
18040
|
-
__privateSet2(this, _stopButton, __privateGet2(this, _wrapper).querySelector(`.${
|
|
18041
|
-
__privateSet2(this, _inputSection, __privateGet2(this, _wrapper).querySelector(`.${
|
|
18042
|
-
__privateSet2(this, _taskInput, __privateGet2(this, _wrapper).querySelector(`.${
|
|
17561
|
+
__privateSet2(this, _indicator, __privateGet2(this, _wrapper).querySelector(`.${styles2.indicator}`));
|
|
17562
|
+
__privateSet2(this, _statusText, __privateGet2(this, _wrapper).querySelector(`.${styles2.statusText}`));
|
|
17563
|
+
__privateSet2(this, _historySection, __privateGet2(this, _wrapper).querySelector(`.${styles2.historySection}`));
|
|
17564
|
+
__privateSet2(this, _expandButton, __privateGet2(this, _wrapper).querySelector(`.${styles2.expandButton}`));
|
|
17565
|
+
__privateSet2(this, _stopButton, __privateGet2(this, _wrapper).querySelector(`.${styles2.stopButton}`));
|
|
17566
|
+
__privateSet2(this, _inputSection, __privateGet2(this, _wrapper).querySelector(`.${styles2.inputSectionWrapper}`));
|
|
17567
|
+
__privateSet2(this, _taskInput, __privateGet2(this, _wrapper).querySelector(`.${styles2.taskInput}`));
|
|
18043
17568
|
__privateMethod2(this, _Panel_instances, setupEventListeners_fn).call(this);
|
|
18044
17569
|
__privateMethod2(this, _Panel_instances, startHeaderUpdateLoop_fn).call(this);
|
|
18045
17570
|
__privateMethod2(this, _Panel_instances, showInputArea_fn).call(this);
|
|
@@ -18260,13 +17785,13 @@ handleUserAnswer_fn = /* @__PURE__ */ __name3(function(input2) {
|
|
|
18260
17785
|
showInputArea_fn = /* @__PURE__ */ __name3(function(placeholder) {
|
|
18261
17786
|
__privateGet2(this, _taskInput).value = "";
|
|
18262
17787
|
__privateGet2(this, _taskInput).placeholder = placeholder || __privateGet2(this, _i18n).t("ui.panel.taskInput");
|
|
18263
|
-
__privateGet2(this, _inputSection).classList.remove(
|
|
17788
|
+
__privateGet2(this, _inputSection).classList.remove(styles2.hidden);
|
|
18264
17789
|
setTimeout(() => {
|
|
18265
17790
|
__privateGet2(this, _taskInput).focus();
|
|
18266
17791
|
}, 100);
|
|
18267
17792
|
}, "#showInputArea");
|
|
18268
17793
|
hideInputArea_fn = /* @__PURE__ */ __name3(function() {
|
|
18269
|
-
__privateGet2(this, _inputSection).classList.add(
|
|
17794
|
+
__privateGet2(this, _inputSection).classList.add(styles2.hidden);
|
|
18270
17795
|
}, "#hideInputArea");
|
|
18271
17796
|
shouldShowInputArea_fn = /* @__PURE__ */ __name3(function() {
|
|
18272
17797
|
var _a3;
|
|
@@ -18285,12 +17810,12 @@ shouldShowInputArea_fn = /* @__PURE__ */ __name3(function() {
|
|
|
18285
17810
|
createWrapper_fn = /* @__PURE__ */ __name3(function() {
|
|
18286
17811
|
const wrapper22 = document.createElement("div");
|
|
18287
17812
|
wrapper22.id = "page-agent-runtime_agent-panel";
|
|
18288
|
-
wrapper22.className =
|
|
17813
|
+
wrapper22.className = styles2.wrapper;
|
|
18289
17814
|
wrapper22.setAttribute("data-browser-use-ignore", "true");
|
|
18290
17815
|
wrapper22.innerHTML = `
|
|
18291
|
-
<div class="${
|
|
18292
|
-
<div class="${
|
|
18293
|
-
<div class="${
|
|
17816
|
+
<div class="${styles2.background}"></div>
|
|
17817
|
+
<div class="${styles2.historySectionWrapper}">
|
|
17818
|
+
<div class="${styles2.historySection}">
|
|
18294
17819
|
${__privateMethod2(this, _Panel_instances, createHistoryItem_fn).call(this, {
|
|
18295
17820
|
id: "placeholder",
|
|
18296
17821
|
stepNumber: 0,
|
|
@@ -18300,25 +17825,25 @@ createWrapper_fn = /* @__PURE__ */ __name3(function() {
|
|
|
18300
17825
|
})}
|
|
18301
17826
|
</div>
|
|
18302
17827
|
</div>
|
|
18303
|
-
<div class="${
|
|
18304
|
-
<div class="${
|
|
18305
|
-
<div class="${
|
|
18306
|
-
<div class="${
|
|
17828
|
+
<div class="${styles2.header}">
|
|
17829
|
+
<div class="${styles2.statusSection}">
|
|
17830
|
+
<div class="${styles2.indicator} ${styles2.thinking}"></div>
|
|
17831
|
+
<div class="${styles2.statusText}">${__privateGet2(this, _i18n).t("ui.panel.ready")}</div>
|
|
18307
17832
|
</div>
|
|
18308
|
-
<div class="${
|
|
18309
|
-
<button class="${
|
|
17833
|
+
<div class="${styles2.controls}">
|
|
17834
|
+
<button class="${styles2.controlButton} ${styles2.expandButton}" title="${__privateGet2(this, _i18n).t("ui.panel.expand")}">
|
|
18310
17835
|
\u25BC
|
|
18311
17836
|
</button>
|
|
18312
|
-
<button class="${
|
|
17837
|
+
<button class="${styles2.controlButton} ${styles2.stopButton}" title="${__privateGet2(this, _i18n).t("ui.panel.stop")}">
|
|
18313
17838
|
X
|
|
18314
17839
|
</button>
|
|
18315
17840
|
</div>
|
|
18316
17841
|
</div>
|
|
18317
|
-
<div class="${
|
|
18318
|
-
<div class="${
|
|
17842
|
+
<div class="${styles2.inputSectionWrapper} ${styles2.hidden}">
|
|
17843
|
+
<div class="${styles2.inputSection}">
|
|
18319
17844
|
<input
|
|
18320
17845
|
type="text"
|
|
18321
|
-
class="${
|
|
17846
|
+
class="${styles2.taskInput}"
|
|
18322
17847
|
maxlength="200"
|
|
18323
17848
|
/>
|
|
18324
17849
|
</div>
|
|
@@ -18328,9 +17853,9 @@ createWrapper_fn = /* @__PURE__ */ __name3(function() {
|
|
|
18328
17853
|
return wrapper22;
|
|
18329
17854
|
}, "#createWrapper");
|
|
18330
17855
|
setupEventListeners_fn = /* @__PURE__ */ __name3(function() {
|
|
18331
|
-
const header2 = this.wrapper.querySelector(`.${
|
|
17856
|
+
const header2 = this.wrapper.querySelector(`.${styles2.header}`);
|
|
18332
17857
|
header2.addEventListener("click", (e) => {
|
|
18333
|
-
if (e.target.closest(`.${
|
|
17858
|
+
if (e.target.closest(`.${styles2.controlButton}`)) {
|
|
18334
17859
|
return;
|
|
18335
17860
|
}
|
|
18336
17861
|
__privateMethod2(this, _Panel_instances, toggle_fn).call(this);
|
|
@@ -18363,12 +17888,12 @@ toggle_fn = /* @__PURE__ */ __name3(function() {
|
|
|
18363
17888
|
}, "#toggle");
|
|
18364
17889
|
expand_fn = /* @__PURE__ */ __name3(function() {
|
|
18365
17890
|
__privateSet2(this, _isExpanded, true);
|
|
18366
|
-
this.wrapper.classList.add(
|
|
17891
|
+
this.wrapper.classList.add(styles2.expanded);
|
|
18367
17892
|
__privateGet2(this, _expandButton).textContent = "\u25B2";
|
|
18368
17893
|
}, "#expand");
|
|
18369
17894
|
collapse_fn = /* @__PURE__ */ __name3(function() {
|
|
18370
17895
|
__privateSet2(this, _isExpanded, false);
|
|
18371
|
-
this.wrapper.classList.remove(
|
|
17896
|
+
this.wrapper.classList.remove(styles2.expanded);
|
|
18372
17897
|
__privateGet2(this, _expandButton).textContent = "\u25BC";
|
|
18373
17898
|
}, "#collapse");
|
|
18374
17899
|
startHeaderUpdateLoop_fn = /* @__PURE__ */ __name3(function() {
|
|
@@ -18396,20 +17921,20 @@ checkAndUpdateHeader_fn = /* @__PURE__ */ __name3(function() {
|
|
|
18396
17921
|
}, "#checkAndUpdateHeader");
|
|
18397
17922
|
animateTextChange_fn = /* @__PURE__ */ __name3(function(newText) {
|
|
18398
17923
|
__privateSet2(this, _isAnimating, true);
|
|
18399
|
-
__privateGet2(this, _statusText).classList.add(
|
|
17924
|
+
__privateGet2(this, _statusText).classList.add(styles2.fadeOut);
|
|
18400
17925
|
setTimeout(() => {
|
|
18401
17926
|
__privateGet2(this, _statusText).textContent = newText;
|
|
18402
|
-
__privateGet2(this, _statusText).classList.remove(
|
|
18403
|
-
__privateGet2(this, _statusText).classList.add(
|
|
17927
|
+
__privateGet2(this, _statusText).classList.remove(styles2.fadeOut);
|
|
17928
|
+
__privateGet2(this, _statusText).classList.add(styles2.fadeIn);
|
|
18404
17929
|
setTimeout(() => {
|
|
18405
|
-
__privateGet2(this, _statusText).classList.remove(
|
|
17930
|
+
__privateGet2(this, _statusText).classList.remove(styles2.fadeIn);
|
|
18406
17931
|
__privateSet2(this, _isAnimating, false);
|
|
18407
17932
|
}, 300);
|
|
18408
17933
|
}, 150);
|
|
18409
17934
|
}, "#animateTextChange");
|
|
18410
17935
|
updateStatusIndicator_fn = /* @__PURE__ */ __name3(function(type) {
|
|
18411
|
-
__privateGet2(this, _indicator).className =
|
|
18412
|
-
__privateGet2(this, _indicator).classList.add(
|
|
17936
|
+
__privateGet2(this, _indicator).className = styles2.indicator;
|
|
17937
|
+
__privateGet2(this, _indicator).classList.add(styles2[type]);
|
|
18413
17938
|
}, "#updateStatusIndicator");
|
|
18414
17939
|
updateHistory_fn = /* @__PURE__ */ __name3(function() {
|
|
18415
17940
|
const steps = __privateGet2(this, _state).getAllSteps();
|
|
@@ -18435,28 +17960,28 @@ createHistoryItem_fn = /* @__PURE__ */ __name3(function(step) {
|
|
|
18435
17960
|
const failureKeyword = __privateGet2(this, _i18n).t("ui.tools.resultFailure");
|
|
18436
17961
|
const errorKeyword = __privateGet2(this, _i18n).t("ui.tools.resultError");
|
|
18437
17962
|
const isSuccess = !step.toolResult || !step.toolResult.includes(failureKeyword) && !step.toolResult.includes(errorKeyword);
|
|
18438
|
-
typeClass = isSuccess ?
|
|
17963
|
+
typeClass = isSuccess ? styles2.doneSuccess : styles2.doneError;
|
|
18439
17964
|
statusIcon2 = isSuccess ? "\u{1F389}" : "\u274C";
|
|
18440
17965
|
} else {
|
|
18441
|
-
typeClass =
|
|
17966
|
+
typeClass = styles2.completed;
|
|
18442
17967
|
statusIcon2 = "\u2705";
|
|
18443
17968
|
}
|
|
18444
17969
|
} else if (step.type === "error") {
|
|
18445
|
-
typeClass =
|
|
17970
|
+
typeClass = styles2.error;
|
|
18446
17971
|
statusIcon2 = "\u274C";
|
|
18447
17972
|
} else if (step.type === "tool_executing") {
|
|
18448
17973
|
statusIcon2 = "\u{1F528}";
|
|
18449
17974
|
} else if (step.type === "output") {
|
|
18450
|
-
typeClass =
|
|
17975
|
+
typeClass = styles2.output;
|
|
18451
17976
|
statusIcon2 = "\u{1F916}";
|
|
18452
17977
|
} else if (step.type === "input") {
|
|
18453
|
-
typeClass =
|
|
17978
|
+
typeClass = styles2.input;
|
|
18454
17979
|
statusIcon2 = "\u{1F3AF}";
|
|
18455
17980
|
} else if (step.type === "retry") {
|
|
18456
|
-
typeClass =
|
|
17981
|
+
typeClass = styles2.retry;
|
|
18457
17982
|
statusIcon2 = "\u{1F504}";
|
|
18458
17983
|
} else if (step.type === "observation") {
|
|
18459
|
-
typeClass =
|
|
17984
|
+
typeClass = styles2.observation;
|
|
18460
17985
|
statusIcon2 = "\u{1F441}\uFE0F";
|
|
18461
17986
|
} else {
|
|
18462
17987
|
statusIcon2 = "\u{1F9E0}";
|
|
@@ -18469,12 +17994,12 @@ createHistoryItem_fn = /* @__PURE__ */ __name3(function(step) {
|
|
|
18469
17994
|
// Explicitly pass empty string to replace template
|
|
18470
17995
|
});
|
|
18471
17996
|
return `
|
|
18472
|
-
<div class="${
|
|
18473
|
-
<div class="${
|
|
18474
|
-
<span class="${
|
|
17997
|
+
<div class="${styles2.historyItem} ${typeClass}">
|
|
17998
|
+
<div class="${styles2.historyContent}">
|
|
17999
|
+
<span class="${styles2.statusIcon}">${statusIcon2}</span>
|
|
18475
18000
|
<span>${escapeHtml(step.displayText)}</span>
|
|
18476
18001
|
</div>
|
|
18477
|
-
<div class="${
|
|
18002
|
+
<div class="${styles2.historyMeta}">
|
|
18478
18003
|
${stepLabel}
|
|
18479
18004
|
</div>
|
|
18480
18005
|
</div>
|
|
@@ -18522,7 +18047,7 @@ function normalizeResponse(response) {
|
|
|
18522
18047
|
if ((_c = toolCall == null ? void 0 : toolCall.function) == null ? void 0 : _c.arguments) {
|
|
18523
18048
|
resolvedArguments = safeJsonParse(toolCall.function.arguments);
|
|
18524
18049
|
if (toolCall.function.name && toolCall.function.name !== "AgentOutput") {
|
|
18525
|
-
console.log(
|
|
18050
|
+
console.log(chalk_default.yellow(`[normalizeResponse] #1: fixing tool_call`));
|
|
18526
18051
|
resolvedArguments = { action: safeJsonParse(resolvedArguments) };
|
|
18527
18052
|
}
|
|
18528
18053
|
} else {
|
|
@@ -18532,15 +18057,15 @@ function normalizeResponse(response) {
|
|
|
18532
18057
|
if (jsonInContent) {
|
|
18533
18058
|
resolvedArguments = safeJsonParse(jsonInContent);
|
|
18534
18059
|
if ((resolvedArguments == null ? void 0 : resolvedArguments.name) === "AgentOutput") {
|
|
18535
|
-
console.log(
|
|
18060
|
+
console.log(chalk_default.yellow(`[normalizeResponse] #2: fixing tool_call`));
|
|
18536
18061
|
resolvedArguments = safeJsonParse(resolvedArguments.arguments);
|
|
18537
18062
|
}
|
|
18538
18063
|
if ((resolvedArguments == null ? void 0 : resolvedArguments.type) === "function") {
|
|
18539
|
-
console.log(
|
|
18064
|
+
console.log(chalk_default.yellow(`[normalizeResponse] #3: fixing tool_call`));
|
|
18540
18065
|
resolvedArguments = safeJsonParse(resolvedArguments.function.arguments);
|
|
18541
18066
|
}
|
|
18542
18067
|
if (!(resolvedArguments == null ? void 0 : resolvedArguments.action) && !(resolvedArguments == null ? void 0 : resolvedArguments.evaluation_previous_goal) && !(resolvedArguments == null ? void 0 : resolvedArguments.memory) && !(resolvedArguments == null ? void 0 : resolvedArguments.next_goal) && !(resolvedArguments == null ? void 0 : resolvedArguments.thinking)) {
|
|
18543
|
-
console.log(
|
|
18068
|
+
console.log(chalk_default.yellow(`[normalizeResponse] #4: fixing tool_call`));
|
|
18544
18069
|
resolvedArguments = { action: safeJsonParse(resolvedArguments) };
|
|
18545
18070
|
}
|
|
18546
18071
|
} else {
|
|
@@ -18555,7 +18080,7 @@ function normalizeResponse(response) {
|
|
|
18555
18080
|
resolvedArguments.action = safeJsonParse(resolvedArguments.action);
|
|
18556
18081
|
}
|
|
18557
18082
|
if (!resolvedArguments.action) {
|
|
18558
|
-
console.log(
|
|
18083
|
+
console.log(chalk_default.yellow(`[normalizeResponse] #5: fixing tool_call`));
|
|
18559
18084
|
resolvedArguments.action = { name: "wait", input: { seconds: 1 } };
|
|
18560
18085
|
}
|
|
18561
18086
|
return {
|
|
@@ -18787,7 +18312,7 @@ tools.set(
|
|
|
18787
18312
|
function assert2(condition, message, silent) {
|
|
18788
18313
|
if (!condition) {
|
|
18789
18314
|
const errorMessage = message != null ? message : "Assertion failed";
|
|
18790
|
-
console.error(
|
|
18315
|
+
console.error(chalk_default.red(`\u274C assert: ${errorMessage}`));
|
|
18791
18316
|
throw new Error(errorMessage);
|
|
18792
18317
|
}
|
|
18793
18318
|
}
|
|
@@ -18903,7 +18428,7 @@ var _PageAgent = class _PageAgent2 extends EventTarget {
|
|
|
18903
18428
|
await onBeforeStep.call(this, step);
|
|
18904
18429
|
console.group(`step: ${step}`);
|
|
18905
18430
|
if (__privateGet3(this, _abortController).signal.aborted) throw new Error("AbortError");
|
|
18906
|
-
console.log(
|
|
18431
|
+
console.log(chalk_default.blue("Thinking..."));
|
|
18907
18432
|
(_d = this.panel) == null ? void 0 : _d.update({ type: "thinking" });
|
|
18908
18433
|
const result2 = await __privateGet3(this, _llm).invoke(
|
|
18909
18434
|
[
|
|
@@ -18943,7 +18468,7 @@ var _PageAgent = class _PageAgent2 extends EventTarget {
|
|
|
18943
18468
|
action,
|
|
18944
18469
|
usage: result2.usage
|
|
18945
18470
|
});
|
|
18946
|
-
console.log(
|
|
18471
|
+
console.log(chalk_default.green("Step finished:"), actionName);
|
|
18947
18472
|
console.groupEnd();
|
|
18948
18473
|
await onAfterStep.call(this, step, this.history);
|
|
18949
18474
|
step++;
|
|
@@ -18960,7 +18485,7 @@ var _PageAgent = class _PageAgent2 extends EventTarget {
|
|
|
18960
18485
|
if (actionName === "done") {
|
|
18961
18486
|
const success2 = (_f = (_e = action.input) == null ? void 0 : _e.success) != null ? _f : false;
|
|
18962
18487
|
const text = ((_g = action.input) == null ? void 0 : _g.text) || "no text provided";
|
|
18963
|
-
console.log(
|
|
18488
|
+
console.log(chalk_default.green.bold("Task completed"), success2, text);
|
|
18964
18489
|
__privateMethod3(this, _PageAgent_instances, onDone_fn).call(this, text, success2);
|
|
18965
18490
|
const result22 = {
|
|
18966
18491
|
success: success2,
|
|
@@ -19033,7 +18558,7 @@ packMacroTool_fn = /* @__PURE__ */ __name4(function() {
|
|
|
19033
18558
|
execute: /* @__PURE__ */ __name4(async (input2) => {
|
|
19034
18559
|
var _a3, _b, _c;
|
|
19035
18560
|
if (__privateGet3(this, _abortController).signal.aborted) throw new Error("AbortError");
|
|
19036
|
-
console.log(
|
|
18561
|
+
console.log(chalk_default.blue.bold("MacroTool execute"), input2);
|
|
19037
18562
|
const action = input2.action;
|
|
19038
18563
|
const toolName = Object.keys(action)[0];
|
|
19039
18564
|
const toolInput = action[toolName];
|
|
@@ -19049,12 +18574,12 @@ packMacroTool_fn = /* @__PURE__ */ __name4(function() {
|
|
|
19049
18574
|
}
|
|
19050
18575
|
const tool2 = tools2.get(toolName);
|
|
19051
18576
|
assert2(tool2, `Tool ${toolName} not found. (@note should have been caught before this!!!)`);
|
|
19052
|
-
console.log(
|
|
18577
|
+
console.log(chalk_default.blue.bold(`Executing tool: ${toolName}`), toolInput);
|
|
19053
18578
|
(_b = this.panel) == null ? void 0 : _b.update({ type: "toolExecuting", toolName, args: toolInput });
|
|
19054
18579
|
const startTime = Date.now();
|
|
19055
18580
|
const result2 = await tool2.execute.bind(this)(toolInput);
|
|
19056
18581
|
const duration3 = Date.now() - startTime;
|
|
19057
|
-
console.log(
|
|
18582
|
+
console.log(chalk_default.green.bold(`Tool (${toolName}) executed for ${duration3}ms`), result2);
|
|
19058
18583
|
if (toolName !== "wait") {
|
|
19059
18584
|
this.states.totalWaitTime = 0;
|
|
19060
18585
|
}
|
|
@@ -19094,7 +18619,7 @@ getInstructions_fn = /* @__PURE__ */ __name4(async function() {
|
|
|
19094
18619
|
pageInstructions = (_b = instructions.getPageInstructions(url2)) == null ? void 0 : _b.trim();
|
|
19095
18620
|
} catch (error49) {
|
|
19096
18621
|
console.error(
|
|
19097
|
-
|
|
18622
|
+
chalk_default.red("[PageAgent] Failed to execute getPageInstructions callback:"),
|
|
19098
18623
|
error49
|
|
19099
18624
|
);
|
|
19100
18625
|
}
|