@sourcegraph/amp 0.0.1749196899-g16ba82 → 0.0.1749211345-g16cdfc
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/dist/amp.js +3 -3
- package/dist/{client-D1Pmx669.js → client-Dd8T5Ydk.js} +2 -2
- package/dist/{client-D1Pmx669.js.map → client-Dd8T5Ydk.js.map} +1 -1
- package/dist/{console-DZmALLuA.js → console-D_ZxbRrA.js} +13 -13
- package/dist/{console-DZmALLuA.js.map → console-D_ZxbRrA.js.map} +1 -1
- package/dist/{create_file.node-CygrebBY.js → create_file.node-D_xwgdhJ.js} +2 -2
- package/dist/{create_file.node-CygrebBY.js.map → create_file.node-D_xwgdhJ.js.map} +1 -1
- package/dist/{edit_file.node-D_cMkiLI.js → edit_file.node-Cv9nC-uR.js} +3 -3
- package/dist/{edit_file.node-D_cMkiLI.js.map → edit_file.node-Cv9nC-uR.js.map} +1 -1
- package/dist/{executable-C8qYZU1W.js → executable-BTpHtmPV.js} +2 -2
- package/dist/{executable-C8qYZU1W.js.map → executable-BTpHtmPV.js.map} +1 -1
- package/dist/{files--h2VjD8F.js → files-CNmw2a6V.js} +2 -2
- package/dist/{files--h2VjD8F.js.map → files-CNmw2a6V.js.map} +1 -1
- package/dist/{glob.node-AB34HaNl.js → glob.node-Dbygwo7q.js} +4 -4
- package/dist/{glob.node-AB34HaNl.js.map → glob.node-Dbygwo7q.js.map} +1 -1
- package/dist/{index-nQBDDlvh.js → index-DGuVA6oK.js} +2 -2
- package/dist/{index-nQBDDlvh.js.map → index-DGuVA6oK.js.map} +1 -1
- package/dist/{list_directory.node-DZamBwOx.js → list_directory.node-DJCJkqLg.js} +2 -2
- package/dist/{list_directory.node-DZamBwOx.js.map → list_directory.node-DJCJkqLg.js.map} +1 -1
- package/dist/{load-profile-DzDzDOIq.js → load-profile-CXHBU_AI.js} +2 -2
- package/dist/{load-profile-DzDzDOIq.js.map → load-profile-CXHBU_AI.js.map} +1 -1
- package/dist/{main-WXbdYG4Z.js → main-CtHA5Ylu.js} +409 -398
- package/dist/{main-WXbdYG4Z.js.map → main-CtHA5Ylu.js.map} +1 -1
- package/dist/{node-CBRPqFin.js → node-BOIz1I5S.js} +374 -320
- package/dist/node-BOIz1I5S.js.map +1 -0
- package/dist/{node-Cs3K2AKs.js → node-C2cKbj9k.js} +3 -3
- package/dist/{node-Cs3K2AKs.js.map → node-C2cKbj9k.js.map} +1 -1
- package/dist/{node-CUCcBUhU.js → node-D9dPV0eu.js} +4 -4
- package/dist/{node-CUCcBUhU.js.map → node-D9dPV0eu.js.map} +1 -1
- package/dist/{node-B9XNCq_w.js → node-DPPbAAw0.js} +2 -2
- package/dist/{node-B9XNCq_w.js.map → node-DPPbAAw0.js.map} +1 -1
- package/dist/{node-SvjAOtkw.js → node-DZCyuAqY.js} +2 -2
- package/dist/{node-SvjAOtkw.js.map → node-DZCyuAqY.js.map} +1 -1
- package/dist/{node-D2Ho0W-v.js → node-DaL4eJRQ.js} +3 -3
- package/dist/{node-D2Ho0W-v.js.map → node-DaL4eJRQ.js.map} +1 -1
- package/dist/{read_file.node-CveQp78z.js → read_file.node-CAD-I3qI.js} +2 -2
- package/dist/{read_file.node-CveQp78z.js.map → read_file.node-CAD-I3qI.js.map} +1 -1
- package/dist/{stdio-CRvROLK4.js → stdio-7mSc8Mj0.js} +3 -3
- package/dist/{stdio-CRvROLK4.js.map → stdio-7mSc8Mj0.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-C3I02TEE.js → undo_edit.node-BYH1ok_y.js} +2 -2
- package/dist/{undo_edit.node-C3I02TEE.js.map → undo_edit.node-BYH1ok_y.js.map} +1 -1
- package/package.json +1 -1
- package/dist/node-CBRPqFin.js.map +0 -1
@@ -1,42 +1,42 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import { O as je, s as
|
3
|
-
import * as
|
4
|
-
import tt, { readdir as
|
2
|
+
import { O as je, s as Dr, c as dh, a as _r, b as Zn, f as We, d as kt, p as Dt, m as Ee, e as Bn, g as br, h as $t, i as sp, j as ph, o as ue, l as be, k as oe, n as re, q as ye, r as Ge, t as Ke, u as He, v as Xn, w as it, x as mh, y as lp, z as ei, A as up, M as Je, B as gh, C as J, N as Fn, D as ri, E as Jr, F as Ss, G as cp, H as fp, I as Es, J as hp, K as vh, L as dp, P as al, Q as Mt, R as pp, S as mp, T as gp, U as vp, V as yp, W as bp, X as wp, Y as _p, Z as Sp, _ as Ep, $ as Pp, a0 as Cp, a1 as Rp, a2 as xp, a3 as Tp, a4 as Op, a5 as Ap, a6 as Lp, a7 as Ip, a8 as Dp, a9 as at, aa as $p, ab as Mp, ac as yh, ad as Et, ae as ts, af as ns, ag as jn, ah as kp, ai as Fp, aj as jp, ak as qp, al as Ps, am as ol, an as Cs, ao as qr, ap as is, aq as Np, ar as Hp, as as sl, at as Up, au as Bp, av as as, aw as bh, ax as wh, ay as zp, az as Vp } from "./console-D_ZxbRrA.js";
|
3
|
+
import * as Wp from "node:fs/promises";
|
4
|
+
import tt, { readdir as _h, stat as Sh, readFile as Or, mkdir as zn, writeFile as Tt, unlink as Gp, readlink as Kp, open as Jp } from "node:fs/promises";
|
5
5
|
import * as Yp from "node:path";
|
6
6
|
import me, { join as ze, dirname as ll } from "node:path";
|
7
|
-
import { i as ul, F as yi, f as wr, a as Qp } from "./client-
|
7
|
+
import { i as ul, F as yi, f as wr, a as Qp } from "./client-Dd8T5Ydk.js";
|
8
8
|
import Rs from "node:events";
|
9
9
|
import * as Zp from "node:child_process";
|
10
|
-
import Xp, { execFile as
|
10
|
+
import Xp, { execFile as Eh, spawn as ti, exec as Nr } from "node:child_process";
|
11
11
|
import ot, { fstatSync as em, readlinkSync as rm, promises as Ye, createWriteStream as tm } from "node:fs";
|
12
12
|
import nm, { stderr as we, stdout as Ie } from "node:process";
|
13
13
|
import { randomBytes as im } from "node:crypto";
|
14
|
-
import Sr, { homedir as
|
14
|
+
import Sr, { homedir as Lr, cpus as am, totalmem as om, freemem as sm, arch as lm, release as um, platform as Vn } from "node:os";
|
15
15
|
import fr, { promisify as Ft, isDeepStrictEqual as cm } from "node:util";
|
16
16
|
import ni from "node:buffer";
|
17
17
|
import fm, { createGzip as hm } from "node:zlib";
|
18
18
|
import dm from "node:string_decoder";
|
19
|
-
import pm, { createServer as
|
19
|
+
import pm, { createServer as Ph } from "node:http";
|
20
20
|
import mm from "node:https";
|
21
|
-
import { r as gm } from "./executable-
|
21
|
+
import { r as gm } from "./executable-BTpHtmPV.js";
|
22
22
|
import { pipeline as vm } from "node:stream/promises";
|
23
23
|
import { lookup as ym } from "node:dns";
|
24
|
-
const
|
24
|
+
const Ir = Symbol.for("@@pendingOperation");
|
25
25
|
function cl(t, e) {
|
26
26
|
return (n) => je.from(n).pipe(
|
27
|
-
|
28
|
-
(i) => i ===
|
27
|
+
Dr(
|
28
|
+
(i) => i === Ir ? je.of(Ir) : t(i).pipe(
|
29
29
|
dh(
|
30
30
|
(r) => je.of(r instanceof Error ? r : new Error(r))
|
31
31
|
),
|
32
|
-
_r(
|
32
|
+
_r(Ir)
|
33
33
|
)
|
34
34
|
),
|
35
35
|
Zn(e)
|
36
36
|
);
|
37
37
|
}
|
38
38
|
function bm() {
|
39
|
-
return (t) => je.from(t).pipe(kt((e) => e !==
|
39
|
+
return (t) => je.from(t).pipe(kt((e) => e !== Ir));
|
40
40
|
}
|
41
41
|
async function wm(t, e) {
|
42
42
|
const n = await We(
|
@@ -47,18 +47,18 @@ async function wm(t, e) {
|
|
47
47
|
throw n;
|
48
48
|
return n;
|
49
49
|
}
|
50
|
-
const _m = new URL("https://ampcode.com/"),
|
50
|
+
const _m = new URL("https://ampcode.com/"), $r = _m.toString(), Sm = new URL("https://api.anthropic.com/");
|
51
51
|
Sm.toString();
|
52
52
|
function Em(t) {
|
53
53
|
const e = typeof t == "string" ? t : t.toString();
|
54
|
-
return e ===
|
54
|
+
return e === $r || e === $r.slice(0, -1);
|
55
55
|
}
|
56
56
|
const Pm = ["apiKey"];
|
57
|
-
function
|
57
|
+
function Ch({
|
58
58
|
storage: t,
|
59
59
|
secretStorage: e,
|
60
60
|
workspaceRoots: n,
|
61
|
-
defaultAmpURL: i =
|
61
|
+
defaultAmpURL: i = $r
|
62
62
|
}) {
|
63
63
|
const r = Dt(async () => {
|
64
64
|
const s = await t.keys();
|
@@ -66,7 +66,7 @@ function Ph({
|
|
66
66
|
await Promise.all(s.map(async (o) => [o, await t.get(o)]))
|
67
67
|
);
|
68
68
|
}).pipe(
|
69
|
-
|
69
|
+
Dr(
|
70
70
|
(s) => ph(
|
71
71
|
je.of(s),
|
72
72
|
t.changes.pipe(
|
@@ -109,7 +109,7 @@ function Ph({
|
|
109
109
|
})
|
110
110
|
)
|
111
111
|
);
|
112
|
-
return
|
112
|
+
return sp(
|
113
113
|
br(r, a).pipe(
|
114
114
|
Ee(
|
115
115
|
([s, u]) => ({
|
@@ -145,11 +145,11 @@ const ii = "2025-03-26", Cm = [
|
|
145
145
|
ii,
|
146
146
|
"2024-11-05",
|
147
147
|
"2024-10-07"
|
148
|
-
], ai = "2.0",
|
148
|
+
], ai = "2.0", Rh = He([re(), Ke().int()]), xh = re(), Rm = ue({
|
149
149
|
/**
|
150
150
|
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
151
151
|
*/
|
152
|
-
progressToken: oe(
|
152
|
+
progressToken: oe(Rh)
|
153
153
|
}).passthrough(), rr = ue({
|
154
154
|
_meta: oe(Rm)
|
155
155
|
}).passthrough(), Qe = ue({
|
@@ -168,21 +168,21 @@ const ii = "2025-03-26", Cm = [
|
|
168
168
|
* This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.
|
169
169
|
*/
|
170
170
|
_meta: oe(ue({}).passthrough())
|
171
|
-
}).passthrough(), oi = He([re(), Ke().int()]),
|
171
|
+
}).passthrough(), oi = He([re(), Ke().int()]), Th = ue({
|
172
172
|
jsonrpc: be(ai),
|
173
173
|
id: oi
|
174
|
-
}).merge(Qe).strict(), xm = (t) =>
|
174
|
+
}).merge(Qe).strict(), xm = (t) => Th.safeParse(t).success, Oh = ue({
|
175
175
|
jsonrpc: be(ai)
|
176
|
-
}).merge(hr).strict(), Tm = (t) =>
|
176
|
+
}).merge(hr).strict(), Tm = (t) => Oh.safeParse(t).success, Ah = ue({
|
177
177
|
jsonrpc: be(ai),
|
178
178
|
id: oi,
|
179
179
|
result: tr
|
180
|
-
}).strict(), fl = (t) =>
|
180
|
+
}).strict(), fl = (t) => Ah.safeParse(t).success;
|
181
181
|
var cr;
|
182
182
|
(function(t) {
|
183
183
|
t[t.ConnectionClosed = -32e3] = "ConnectionClosed", t[t.RequestTimeout = -32001] = "RequestTimeout", t[t.ParseError = -32700] = "ParseError", t[t.InvalidRequest = -32600] = "InvalidRequest", t[t.MethodNotFound = -32601] = "MethodNotFound", t[t.InvalidParams = -32602] = "InvalidParams", t[t.InternalError = -32603] = "InternalError";
|
184
184
|
})(cr || (cr = {}));
|
185
|
-
const
|
185
|
+
const Lh = ue({
|
186
186
|
jsonrpc: be(ai),
|
187
187
|
id: oi,
|
188
188
|
error: ue({
|
@@ -199,11 +199,11 @@ const Ah = ue({
|
|
199
199
|
*/
|
200
200
|
data: oe(Xn())
|
201
201
|
})
|
202
|
-
}).strict(), Om = (t) =>
|
203
|
-
xh,
|
202
|
+
}).strict(), Om = (t) => Lh.safeParse(t).success, Am = He([
|
204
203
|
Th,
|
205
204
|
Oh,
|
206
|
-
Ah
|
205
|
+
Ah,
|
206
|
+
Lh
|
207
207
|
]), Xr = tr.strict(), xs = hr.extend({
|
208
208
|
method: be("notifications/cancelled"),
|
209
209
|
params: jt.extend({
|
@@ -218,7 +218,7 @@ const Ah = ue({
|
|
218
218
|
*/
|
219
219
|
reason: re().optional()
|
220
220
|
})
|
221
|
-
}),
|
221
|
+
}), Ih = ue({
|
222
222
|
name: re(),
|
223
223
|
version: re()
|
224
224
|
}).passthrough(), Lm = ue({
|
@@ -247,7 +247,7 @@ const Ah = ue({
|
|
247
247
|
*/
|
248
248
|
protocolVersion: re(),
|
249
249
|
capabilities: Lm,
|
250
|
-
clientInfo:
|
250
|
+
clientInfo: Ih
|
251
251
|
})
|
252
252
|
}), Dm = ue({
|
253
253
|
/**
|
@@ -293,13 +293,13 @@ const Ah = ue({
|
|
293
293
|
*/
|
294
294
|
listChanged: oe(Ge())
|
295
295
|
}).passthrough())
|
296
|
-
}).passthrough(),
|
296
|
+
}).passthrough(), Dh = tr.extend({
|
297
297
|
/**
|
298
298
|
* The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
|
299
299
|
*/
|
300
300
|
protocolVersion: re(),
|
301
301
|
capabilities: Dm,
|
302
|
-
serverInfo:
|
302
|
+
serverInfo: Ih,
|
303
303
|
/**
|
304
304
|
* Instructions describing how to use the server and its features.
|
305
305
|
*
|
@@ -329,7 +329,7 @@ const Ah = ue({
|
|
329
329
|
/**
|
330
330
|
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
|
331
331
|
*/
|
332
|
-
progressToken:
|
332
|
+
progressToken: Rh
|
333
333
|
})
|
334
334
|
}), si = Qe.extend({
|
335
335
|
params: rr.extend({
|
@@ -337,15 +337,15 @@ const Ah = ue({
|
|
337
337
|
* An opaque token representing the current pagination position.
|
338
338
|
* If provided, the server should return results starting after this cursor.
|
339
339
|
*/
|
340
|
-
cursor: oe(
|
340
|
+
cursor: oe(xh)
|
341
341
|
}).optional()
|
342
342
|
}), li = tr.extend({
|
343
343
|
/**
|
344
344
|
* An opaque token representing the pagination position after the last returned result.
|
345
345
|
* If present, there may be more results available.
|
346
346
|
*/
|
347
|
-
nextCursor: oe(
|
348
|
-
}),
|
347
|
+
nextCursor: oe(xh)
|
348
|
+
}), $h = ue({
|
349
349
|
/**
|
350
350
|
* The URI of this resource.
|
351
351
|
*/
|
@@ -354,12 +354,12 @@ const Ah = ue({
|
|
354
354
|
* The MIME type of this resource, if known.
|
355
355
|
*/
|
356
356
|
mimeType: oe(re())
|
357
|
-
}).passthrough(),
|
357
|
+
}).passthrough(), Mh = $h.extend({
|
358
358
|
/**
|
359
359
|
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
360
360
|
*/
|
361
361
|
text: re()
|
362
|
-
}),
|
362
|
+
}), kh = $h.extend({
|
363
363
|
/**
|
364
364
|
* A base64-encoded string representing the binary data of the item.
|
365
365
|
*/
|
@@ -408,11 +408,11 @@ const Ah = ue({
|
|
408
408
|
mimeType: oe(re())
|
409
409
|
}).passthrough(), jm = si.extend({
|
410
410
|
method: be("resources/list")
|
411
|
-
}),
|
411
|
+
}), Fh = li.extend({
|
412
412
|
resources: ye(km)
|
413
413
|
}), qm = si.extend({
|
414
414
|
method: be("resources/templates/list")
|
415
|
-
}),
|
415
|
+
}), jh = li.extend({
|
416
416
|
resourceTemplates: ye(Fm)
|
417
417
|
}), Nm = Qe.extend({
|
418
418
|
method: be("resources/read"),
|
@@ -422,8 +422,8 @@ const Ah = ue({
|
|
422
422
|
*/
|
423
423
|
uri: re()
|
424
424
|
})
|
425
|
-
}),
|
426
|
-
contents: ye(He([
|
425
|
+
}), qh = tr.extend({
|
426
|
+
contents: ye(He([Mh, kh]))
|
427
427
|
}), Hm = hr.extend({
|
428
428
|
method: be("notifications/resources/list_changed")
|
429
429
|
}), Um = Qe.extend({
|
@@ -478,7 +478,7 @@ const Ah = ue({
|
|
478
478
|
arguments: oe(ye(Vm))
|
479
479
|
}).passthrough(), Gm = si.extend({
|
480
480
|
method: be("prompts/list")
|
481
|
-
}),
|
481
|
+
}), Nh = li.extend({
|
482
482
|
prompts: ye(Wm)
|
483
483
|
}), Km = Qe.extend({
|
484
484
|
method: be("prompts/get"),
|
@@ -518,18 +518,18 @@ const Ah = ue({
|
|
518
518
|
* The MIME type of the audio. Different providers may support different audio types.
|
519
519
|
*/
|
520
520
|
mimeType: re()
|
521
|
-
}).passthrough(),
|
521
|
+
}).passthrough(), Hh = ue({
|
522
522
|
type: be("resource"),
|
523
|
-
resource: He([
|
523
|
+
resource: He([Mh, kh])
|
524
524
|
}).passthrough(), Jm = ue({
|
525
525
|
role: it(["user", "assistant"]),
|
526
526
|
content: He([
|
527
527
|
ui,
|
528
528
|
ci,
|
529
529
|
fi,
|
530
|
-
|
530
|
+
Hh
|
531
531
|
])
|
532
|
-
}).passthrough(),
|
532
|
+
}).passthrough(), Uh = tr.extend({
|
533
533
|
/**
|
534
534
|
* An optional description for the prompt.
|
535
535
|
*/
|
@@ -607,7 +607,7 @@ const Ah = ue({
|
|
607
607
|
annotations: oe(Qm)
|
608
608
|
}).passthrough(), Xm = si.extend({
|
609
609
|
method: be("tools/list")
|
610
|
-
}),
|
610
|
+
}), Bh = li.extend({
|
611
611
|
tools: ye(Zm)
|
612
612
|
}), As = tr.extend({
|
613
613
|
/**
|
@@ -620,7 +620,7 @@ const Ah = ue({
|
|
620
620
|
ui,
|
621
621
|
ci,
|
622
622
|
fi,
|
623
|
-
|
623
|
+
Hh
|
624
624
|
])).default([]),
|
625
625
|
/**
|
626
626
|
* An object containing structured tool output.
|
@@ -653,9 +653,9 @@ const eg = Qe.extend({
|
|
653
653
|
name: re(),
|
654
654
|
arguments: oe(mh(Xn()))
|
655
655
|
})
|
656
|
-
}),
|
656
|
+
}), zh = hr.extend({
|
657
657
|
method: be("notifications/tools/list_changed")
|
658
|
-
}),
|
658
|
+
}), Vh = it([
|
659
659
|
"debug",
|
660
660
|
"info",
|
661
661
|
"notice",
|
@@ -670,7 +670,7 @@ const eg = Qe.extend({
|
|
670
670
|
/**
|
671
671
|
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
|
672
672
|
*/
|
673
|
-
level:
|
673
|
+
level: Vh
|
674
674
|
})
|
675
675
|
}), tg = hr.extend({
|
676
676
|
method: be("notifications/message"),
|
@@ -678,7 +678,7 @@ const eg = Qe.extend({
|
|
678
678
|
/**
|
679
679
|
* The severity of this log message.
|
680
680
|
*/
|
681
|
-
level:
|
681
|
+
level: Vh,
|
682
682
|
/**
|
683
683
|
* An optional name of the logger issuing this message.
|
684
684
|
*/
|
@@ -750,7 +750,7 @@ const eg = Qe.extend({
|
|
750
750
|
*/
|
751
751
|
stopReason: oe(it(["endTurn", "stopSequence", "maxTokens"]).or(re())),
|
752
752
|
role: it(["user", "assistant"]),
|
753
|
-
content:
|
753
|
+
content: lp("type", [
|
754
754
|
ui,
|
755
755
|
ci,
|
756
756
|
fi
|
@@ -785,7 +785,7 @@ const eg = Qe.extend({
|
|
785
785
|
value: re()
|
786
786
|
}).passthrough()
|
787
787
|
})
|
788
|
-
}),
|
788
|
+
}), Wh = tr.extend({
|
789
789
|
completion: ue({
|
790
790
|
/**
|
791
791
|
* An array of completion values. Must not exceed 100 items.
|
@@ -853,20 +853,20 @@ He([
|
|
853
853
|
tg,
|
854
854
|
zm,
|
855
855
|
Hm,
|
856
|
-
|
856
|
+
zh,
|
857
857
|
Ym
|
858
858
|
]);
|
859
859
|
He([
|
860
860
|
Xr,
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
kh,
|
861
|
+
Dh,
|
862
|
+
Wh,
|
863
|
+
Uh,
|
864
|
+
Nh,
|
866
865
|
Fh,
|
867
866
|
jh,
|
867
|
+
qh,
|
868
868
|
As,
|
869
|
-
|
869
|
+
Bh
|
870
870
|
]);
|
871
871
|
class Ar extends Error {
|
872
872
|
constructor(e, n, i) {
|
@@ -1178,7 +1178,7 @@ function bg() {
|
|
1178
1178
|
function c(U) {
|
1179
1179
|
var N = "[A-Za-z]", z = "[0-9]", Q = i(z, "[A-Fa-f]"), Y = r(r("%[EFef]" + Q + "%" + Q + Q + "%" + Q + Q) + "|" + r("%[89A-Fa-f]" + Q + "%" + Q + Q) + "|" + r("%" + Q + Q)), ce = "[\\:\\/\\?\\#\\[\\]\\@]", fe = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", _e = i(ce, fe), Te = U ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", $e = U ? "[\\uE000-\\uF8FF]" : "[]", ve = i(N, z, "[\\-\\.\\_\\~]", Te);
|
1180
1180
|
r(N + i(N, z, "[\\+\\-\\.]") + "*"), r(r(Y + "|" + i(ve, fe, "[\\:]")) + "*");
|
1181
|
-
var Ce = r(r("25[0-5]") + "|" + r("2[0-4]" + z) + "|" + r("1" + z + z) + "|" + r("0?[1-9]" + z) + "|0?0?" + z), Me = r(Ce + "\\." + Ce + "\\." + Ce + "\\." + Ce), pe = r(Q + "{1,4}"), Oe = r(r(pe + "\\:" + pe) + "|" + Me), ke = r(r(pe + "\\:") + "{6}" + Oe), Ae = r("\\:\\:" + r(pe + "\\:") + "{5}" + Oe), Cr = r(r(pe) + "?\\:\\:" + r(pe + "\\:") + "{4}" + Oe), ar = r(r(r(pe + "\\:") + "{0,1}" + pe) + "?\\:\\:" + r(pe + "\\:") + "{3}" + Oe), or = r(r(r(pe + "\\:") + "{0,2}" + pe) + "?\\:\\:" + r(pe + "\\:") + "{2}" + Oe), Vr = r(r(r(pe + "\\:") + "{0,3}" + pe) + "?\\:\\:" + pe + "\\:" + Oe),
|
1181
|
+
var Ce = r(r("25[0-5]") + "|" + r("2[0-4]" + z) + "|" + r("1" + z + z) + "|" + r("0?[1-9]" + z) + "|0?0?" + z), Me = r(Ce + "\\." + Ce + "\\." + Ce + "\\." + Ce), pe = r(Q + "{1,4}"), Oe = r(r(pe + "\\:" + pe) + "|" + Me), ke = r(r(pe + "\\:") + "{6}" + Oe), Ae = r("\\:\\:" + r(pe + "\\:") + "{5}" + Oe), Cr = r(r(pe) + "?\\:\\:" + r(pe + "\\:") + "{4}" + Oe), ar = r(r(r(pe + "\\:") + "{0,1}" + pe) + "?\\:\\:" + r(pe + "\\:") + "{3}" + Oe), or = r(r(r(pe + "\\:") + "{0,2}" + pe) + "?\\:\\:" + r(pe + "\\:") + "{2}" + Oe), Vr = r(r(r(pe + "\\:") + "{0,3}" + pe) + "?\\:\\:" + pe + "\\:" + Oe), Fr = r(r(r(pe + "\\:") + "{0,4}" + pe) + "?\\:\\:" + Oe), Xe = r(r(r(pe + "\\:") + "{0,5}" + pe) + "?\\:\\:" + pe), sr = r(r(r(pe + "\\:") + "{0,6}" + pe) + "?\\:\\:"), jr = r([ke, Ae, Cr, ar, or, Vr, Fr, Xe, sr].join("|")), mr = r(r(ve + "|" + Y) + "+");
|
1182
1182
|
r("[vV]" + Q + "+\\." + i(ve, fe, "[\\:]") + "+"), r(r(Y + "|" + i(ve, fe)) + "*");
|
1183
1183
|
var gt = r(Y + "|" + i(ve, fe, "[\\:\\@]"));
|
1184
1184
|
return r(r(Y + "|" + i(ve, fe, "[\\@]")) + "+"), r(r(gt + "|" + i("[\\/\\?]", $e)) + "*"), {
|
@@ -1194,7 +1194,7 @@ function bg() {
|
|
1194
1194
|
OTHER_CHARS: new RegExp(i("[^\\%]", ve, _e), "g"),
|
1195
1195
|
PCT_ENCODED: new RegExp(Y, "g"),
|
1196
1196
|
IPV4ADDRESS: new RegExp("^(" + Me + ")$"),
|
1197
|
-
IPV6ADDRESS: new RegExp("^\\[?(" +
|
1197
|
+
IPV6ADDRESS: new RegExp("^\\[?(" + jr + ")" + r(r("\\%25|\\%(?!" + Q + "{2})") + "(" + mr + ")") + "?\\]?$")
|
1198
1198
|
//RFC 6874, with relaxed parsing rules
|
1199
1199
|
};
|
1200
1200
|
}
|
@@ -1323,8 +1323,8 @@ function bg() {
|
|
1323
1323
|
var ke = d, Ae = !0, Cr = !1, ar = void 0;
|
1324
1324
|
try {
|
1325
1325
|
for (var or = N[Symbol.iterator](), Vr; !(Ae = (Vr = or.next()).done); Ae = !0) {
|
1326
|
-
var
|
1327
|
-
|
1326
|
+
var Fr = Vr.value;
|
1327
|
+
Fr >= Y && Fr < ke && (ke = Fr);
|
1328
1328
|
}
|
1329
1329
|
} catch (vt) {
|
1330
1330
|
Cr = !0, ar = vt;
|
@@ -1338,7 +1338,7 @@ function bg() {
|
|
1338
1338
|
}
|
1339
1339
|
var Xe = Oe + 1;
|
1340
1340
|
ke - Y > S((d - ce) / Xe) && E("overflow"), ce += (ke - Y) * Xe, Y = ke;
|
1341
|
-
var sr = !0,
|
1341
|
+
var sr = !0, jr = !1, mr = void 0;
|
1342
1342
|
try {
|
1343
1343
|
for (var gt = N[Symbol.iterator](), rl; !(sr = (rl = gt.next()).done); sr = !0) {
|
1344
1344
|
var tl = rl.value;
|
@@ -1359,12 +1359,12 @@ function bg() {
|
|
1359
1359
|
}
|
1360
1360
|
}
|
1361
1361
|
} catch (vt) {
|
1362
|
-
|
1362
|
+
jr = !0, mr = vt;
|
1363
1363
|
} finally {
|
1364
1364
|
try {
|
1365
1365
|
!sr && gt.return && gt.return();
|
1366
1366
|
} finally {
|
1367
|
-
if (
|
1367
|
+
if (jr)
|
1368
1368
|
throw mr;
|
1369
1369
|
}
|
1370
1370
|
}
|
@@ -1450,18 +1450,18 @@ function bg() {
|
|
1450
1450
|
for (var fe = Y.toLowerCase().split("::").reverse(), _e = g(fe, 2), Te = _e[0], $e = _e[1], ve = $e ? $e.split(":").map(L) : [], Ce = Te.split(":").map(L), Me = N.IPV4ADDRESS.test(Ce[Ce.length - 1]), pe = Me ? 7 : 8, Oe = Ce.length - pe, ke = Array(pe), Ae = 0; Ae < pe; ++Ae)
|
1451
1451
|
ke[Ae] = ve[Ae] || Ce[Oe + Ae] || "";
|
1452
1452
|
Me && (ke[pe - 1] = j(ke[pe - 1], N));
|
1453
|
-
var Cr = ke.reduce(function(Xe, sr,
|
1453
|
+
var Cr = ke.reduce(function(Xe, sr, jr) {
|
1454
1454
|
if (!sr || sr === "0") {
|
1455
1455
|
var mr = Xe[Xe.length - 1];
|
1456
|
-
mr && mr.index + mr.length ===
|
1456
|
+
mr && mr.index + mr.length === jr ? mr.length++ : Xe.push({ index: jr, length: 1 });
|
1457
1457
|
}
|
1458
1458
|
return Xe;
|
1459
1459
|
}, []), ar = Cr.sort(function(Xe, sr) {
|
1460
1460
|
return sr.length - Xe.length;
|
1461
1461
|
})[0], or = void 0;
|
1462
1462
|
if (ar && ar.length > 1) {
|
1463
|
-
var Vr = ke.slice(0, ar.index),
|
1464
|
-
or = Vr.join(":") + "::" +
|
1463
|
+
var Vr = ke.slice(0, ar.index), Fr = ke.slice(ar.index + ar.length);
|
1464
|
+
or = Vr.join(":") + "::" + Fr.join(":");
|
1465
1465
|
} else
|
1466
1466
|
or = ke.join(":");
|
1467
1467
|
return ce && (or += "%" + ce), or;
|
@@ -1594,10 +1594,10 @@ function bg() {
|
|
1594
1594
|
domainHost: mt.domainHost,
|
1595
1595
|
parse: mt.parse,
|
1596
1596
|
serialize: mt.serialize
|
1597
|
-
},
|
1597
|
+
}, Yd = {}, Ys = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", ir = "[0-9A-Fa-f]", Qd = r(r("%[EFef]" + ir + "%" + ir + ir + "%" + ir + ir) + "|" + r("%[89A-Fa-f]" + ir + "%" + ir + ir) + "|" + r("%" + ir + ir)), Zd = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", Xd = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", ep = i(Xd, '[\\"\\\\]'), rp = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", tp = new RegExp(Ys, "g"), zr = new RegExp(Qd, "g"), np = new RegExp(i("[^]", Zd, "[\\.]", '[\\"]', ep), "g"), Qs = new RegExp(i("[^]", Ys, rp), "g"), ip = Qs;
|
1598
1598
|
function vi(U) {
|
1599
1599
|
var N = X(U);
|
1600
|
-
return N.match(
|
1600
|
+
return N.match(tp) ? N : U;
|
1601
1601
|
}
|
1602
1602
|
var Zs = {
|
1603
1603
|
scheme: "mailto",
|
@@ -1643,7 +1643,7 @@ function bg() {
|
|
1643
1643
|
var Q = N, Y = u(N.to);
|
1644
1644
|
if (Y) {
|
1645
1645
|
for (var ce = 0, fe = Y.length; ce < fe; ++ce) {
|
1646
|
-
var _e = String(Y[ce]), Te = _e.lastIndexOf("@"), $e = _e.slice(0, Te).replace(zr, vi).replace(zr, s).replace(
|
1646
|
+
var _e = String(Y[ce]), Te = _e.lastIndexOf("@"), $e = _e.slice(0, Te).replace(zr, vi).replace(zr, s).replace(np, B), ve = _e.slice(Te + 1);
|
1647
1647
|
try {
|
1648
1648
|
ve = z.iri ? T.toUnicode(ve) : T.toASCII(pr(ve, z).toLowerCase());
|
1649
1649
|
} catch (Oe) {
|
@@ -1657,13 +1657,13 @@ function bg() {
|
|
1657
1657
|
N.subject && (Ce.subject = N.subject), N.body && (Ce.body = N.body);
|
1658
1658
|
var Me = [];
|
1659
1659
|
for (var pe in Ce)
|
1660
|
-
Ce[pe] !==
|
1660
|
+
Ce[pe] !== Yd[pe] && Me.push(pe.replace(zr, vi).replace(zr, s).replace(Qs, B) + "=" + Ce[pe].replace(zr, vi).replace(zr, s).replace(ip, B));
|
1661
1661
|
return Me.length && (Q.query = Me.join("&")), Q;
|
1662
1662
|
}
|
1663
|
-
},
|
1663
|
+
}, ap = /^([^\:]+)\:(.*)/, Xs = {
|
1664
1664
|
scheme: "urn",
|
1665
1665
|
parse: function(N, z) {
|
1666
|
-
var Q = N.path && N.path.match(
|
1666
|
+
var Q = N.path && N.path.match(ap), Y = N;
|
1667
1667
|
if (Q) {
|
1668
1668
|
var ce = z.scheme || Y.scheme || "urn", fe = Q[1].toLowerCase(), _e = Q[2], Te = ce + ":" + (z.nid || fe), $e = M[Te];
|
1669
1669
|
Y.nid = fe, Y.nss = _e, Y.path = void 0, $e && (Y = $e.parse(Y, z));
|
@@ -1677,11 +1677,11 @@ function bg() {
|
|
1677
1677
|
var _e = N, Te = N.nss;
|
1678
1678
|
return _e.path = (Y || z.nid) + ":" + Te, _e;
|
1679
1679
|
}
|
1680
|
-
},
|
1680
|
+
}, op = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, el = {
|
1681
1681
|
scheme: "urn:uuid",
|
1682
1682
|
parse: function(N, z) {
|
1683
1683
|
var Q = N;
|
1684
|
-
return Q.uuid = Q.nss, Q.nss = void 0, !z.tolerant && (!Q.uuid || !Q.uuid.match(
|
1684
|
+
return Q.uuid = Q.nss, Q.nss = void 0, !z.tolerant && (!Q.uuid || !Q.uuid.match(op)) && (Q.error = Q.error || "UUID is not valid."), Q;
|
1685
1685
|
},
|
1686
1686
|
serialize: function(N, z) {
|
1687
1687
|
var Q = N;
|
@@ -1887,7 +1887,7 @@ function ut() {
|
|
1887
1887
|
return _i;
|
1888
1888
|
}
|
1889
1889
|
var Si, gl;
|
1890
|
-
function
|
1890
|
+
function Gh() {
|
1891
1891
|
if (gl) return Si;
|
1892
1892
|
gl = 1;
|
1893
1893
|
var t = ut();
|
@@ -1972,7 +1972,7 @@ var Pi, yl;
|
|
1972
1972
|
function Is() {
|
1973
1973
|
if (yl) return Pi;
|
1974
1974
|
yl = 1;
|
1975
|
-
var t = bg(), e = Ls(), n = ut(), i =
|
1975
|
+
var t = bg(), e = Ls(), n = ut(), i = Gh(), r = _g();
|
1976
1976
|
Pi = a, a.normalizeId = l, a.fullPath = d, a.url = p, a.ids = b, a.inlineRef = y, a.schema = s;
|
1977
1977
|
function a(w, _, D) {
|
1978
1978
|
var O = this._refs[D];
|
@@ -2140,7 +2140,7 @@ function Ds() {
|
|
2140
2140
|
return Ci;
|
2141
2141
|
}
|
2142
2142
|
var Ri, wl;
|
2143
|
-
function
|
2143
|
+
function Kh() {
|
2144
2144
|
return wl || (wl = 1, Ri = function(t, e) {
|
2145
2145
|
e || (e = {}), typeof e == "function" && (e = { cmp: e });
|
2146
2146
|
var n = typeof e.cycles == "boolean" ? e.cycles : !1, i = e.cmp && /* @__PURE__ */ function(a) {
|
@@ -2177,7 +2177,7 @@ function Gh() {
|
|
2177
2177
|
}), Ri;
|
2178
2178
|
}
|
2179
2179
|
var xi, _l;
|
2180
|
-
function
|
2180
|
+
function Jh() {
|
2181
2181
|
return _l || (_l = 1, xi = function(e, n, i) {
|
2182
2182
|
var r = "", a = e.schema.$async === !0, s = e.util.schemaHasRulesExcept(e.schema, e.RULES.all, "$ref"), u = e.self._getId(e.schema);
|
2183
2183
|
if (e.opts.strictKeywords) {
|
@@ -2330,7 +2330,7 @@ var Ti, Sl;
|
|
2330
2330
|
function Sg() {
|
2331
2331
|
if (Sl) return Ti;
|
2332
2332
|
Sl = 1;
|
2333
|
-
var t = Is(), e = ut(), n = Ds(), i =
|
2333
|
+
var t = Is(), e = ut(), n = Ds(), i = Kh(), r = Jh(), a = e.ucs2length, s = Ls(), u = n.Validation;
|
2334
2334
|
Ti = o;
|
2335
2335
|
function o(l, p, b, w) {
|
2336
2336
|
var _ = this, D = this._opts, O = [void 0], x = {}, C = [], R = {}, P = [], S = {}, $ = [];
|
@@ -3335,7 +3335,7 @@ function zg() {
|
|
3335
3335
|
propertyNames: Hg(),
|
3336
3336
|
required: Ug(),
|
3337
3337
|
uniqueItems: Bg(),
|
3338
|
-
validate:
|
3338
|
+
validate: Jh()
|
3339
3339
|
}), ea;
|
3340
3340
|
}
|
3341
3341
|
var ra, Xl;
|
@@ -3566,7 +3566,7 @@ function Kg() {
|
|
3566
3566
|
return r;
|
3567
3567
|
}), ia;
|
3568
3568
|
}
|
3569
|
-
const Jg = "http://json-schema.org/draft-07/schema#", Yg = "http://json-schema.org/draft-07/schema#", Qg = "Core schema meta-schema", Zg = { schemaArray: { type: "array", minItems: 1, items: { $ref: "#" } }, nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, Xg = ["object", "boolean"], ev = { $id: { type: "string", format: "uri-reference" }, $schema: { type: "string", format: "uri" }, $ref: { type: "string", format: "uri-reference" }, $comment: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: !0, readOnly: { type: "boolean", default: !1 }, examples: { type: "array", items: !0 }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/definitions/nonNegativeInteger" }, minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, additionalItems: { $ref: "#" }, items: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], default: !0 }, maxItems: { $ref: "#/definitions/nonNegativeInteger" }, minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, contains: { $ref: "#" }, maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, required: { $ref: "#/definitions/stringArray" }, additionalProperties: { $ref: "#" }, definitions: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, properties: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $ref: "#" }, propertyNames: { format: "regex" }, default: {} }, dependencies: { type: "object", additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] } }, propertyNames: { $ref: "#" }, const: !0, enum: { type: "array", items: !0, minItems: 1, uniqueItems: !0 }, type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, { type: "array", items: { $ref: "#/definitions/simpleTypes" }, minItems: 1, uniqueItems: !0 }] }, format: { type: "string" }, contentMediaType: { type: "string" }, contentEncoding: { type: "string" }, if: { $ref: "#" }, then: { $ref: "#" }, else: { $ref: "#" }, allOf: { $ref: "#/definitions/schemaArray" }, anyOf: { $ref: "#/definitions/schemaArray" }, oneOf: { $ref: "#/definitions/schemaArray" }, not: { $ref: "#" } },
|
3569
|
+
const Jg = "http://json-schema.org/draft-07/schema#", Yg = "http://json-schema.org/draft-07/schema#", Qg = "Core schema meta-schema", Zg = { schemaArray: { type: "array", minItems: 1, items: { $ref: "#" } }, nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, Xg = ["object", "boolean"], ev = { $id: { type: "string", format: "uri-reference" }, $schema: { type: "string", format: "uri" }, $ref: { type: "string", format: "uri-reference" }, $comment: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: !0, readOnly: { type: "boolean", default: !1 }, examples: { type: "array", items: !0 }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/definitions/nonNegativeInteger" }, minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, additionalItems: { $ref: "#" }, items: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], default: !0 }, maxItems: { $ref: "#/definitions/nonNegativeInteger" }, minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, contains: { $ref: "#" }, maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, required: { $ref: "#/definitions/stringArray" }, additionalProperties: { $ref: "#" }, definitions: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, properties: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $ref: "#" }, propertyNames: { format: "regex" }, default: {} }, dependencies: { type: "object", additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] } }, propertyNames: { $ref: "#" }, const: !0, enum: { type: "array", items: !0, minItems: 1, uniqueItems: !0 }, type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, { type: "array", items: { $ref: "#/definitions/simpleTypes" }, minItems: 1, uniqueItems: !0 }] }, format: { type: "string" }, contentMediaType: { type: "string" }, contentEncoding: { type: "string" }, if: { $ref: "#" }, then: { $ref: "#" }, else: { $ref: "#" }, allOf: { $ref: "#/definitions/schemaArray" }, anyOf: { $ref: "#/definitions/schemaArray" }, oneOf: { $ref: "#/definitions/schemaArray" }, not: { $ref: "#" } }, Yh = {
|
3570
3570
|
$schema: Jg,
|
3571
3571
|
$id: Yg,
|
3572
3572
|
title: Qg,
|
@@ -3579,7 +3579,7 @@ var aa, nu;
|
|
3579
3579
|
function rv() {
|
3580
3580
|
if (nu) return aa;
|
3581
3581
|
nu = 1;
|
3582
|
-
var t =
|
3582
|
+
var t = Yh;
|
3583
3583
|
return aa = {
|
3584
3584
|
$id: "https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",
|
3585
3585
|
definitions: {
|
@@ -3706,7 +3706,7 @@ var sa, au;
|
|
3706
3706
|
function fv() {
|
3707
3707
|
if (au) return sa;
|
3708
3708
|
au = 1;
|
3709
|
-
var t = Sg(), e = Is(), n = Eg(), i =
|
3709
|
+
var t = Sg(), e = Is(), n = Eg(), i = Gh(), r = Kh(), a = Pg(), s = Vg(), u = Wg(), o = ut();
|
3710
3710
|
sa = d, d.prototype.validate = m, d.prototype.compile = v, d.prototype.addSchema = l, d.prototype.addMetaSchema = p, d.prototype.validateSchema = b, d.prototype.getSchema = _, d.prototype.removeSchema = x, d.prototype.addFormat = k, d.prototype.errorsText = A, d.prototype._addSchema = R, d.prototype._compile = P, d.prototype.compileAsync = Gg();
|
3711
3711
|
var c = tv();
|
3712
3712
|
d.prototype.addKeyword = c.add, d.prototype.getKeyword = c.get, d.prototype.removeKeyword = c.remove, d.prototype.validateKeyword = c.validate;
|
@@ -3889,7 +3889,7 @@ function fv() {
|
|
3889
3889
|
function H(T) {
|
3890
3890
|
var M;
|
3891
3891
|
if (T._opts.$data && (M = cv, T.addMetaSchema(M, M.$id, !0)), T._opts.meta !== !1) {
|
3892
|
-
var B =
|
3892
|
+
var B = Yh;
|
3893
3893
|
T._opts.$data && (B = u(B, h)), T.addMetaSchema(B, y, !0), T._refs["http://json-schema.org/schema"] = y;
|
3894
3894
|
}
|
3895
3895
|
}
|
@@ -3969,7 +3969,7 @@ class ou extends gg {
|
|
3969
3969
|
capabilities: this._capabilities,
|
3970
3970
|
clientInfo: this._clientInfo
|
3971
3971
|
}
|
3972
|
-
},
|
3972
|
+
}, Dh, n);
|
3973
3973
|
if (i === void 0)
|
3974
3974
|
throw new Error(`Server sent invalid initialize result: ${i}`);
|
3975
3975
|
if (!Cm.includes(i.protocolVersion))
|
@@ -4057,25 +4057,25 @@ class ou extends gg {
|
|
4057
4057
|
return this.request({ method: "ping" }, Xr, e);
|
4058
4058
|
}
|
4059
4059
|
async complete(e, n) {
|
4060
|
-
return this.request({ method: "completion/complete", params: e },
|
4060
|
+
return this.request({ method: "completion/complete", params: e }, Wh, n);
|
4061
4061
|
}
|
4062
4062
|
async setLoggingLevel(e, n) {
|
4063
4063
|
return this.request({ method: "logging/setLevel", params: { level: e } }, Xr, n);
|
4064
4064
|
}
|
4065
4065
|
async getPrompt(e, n) {
|
4066
|
-
return this.request({ method: "prompts/get", params: e },
|
4066
|
+
return this.request({ method: "prompts/get", params: e }, Uh, n);
|
4067
4067
|
}
|
4068
4068
|
async listPrompts(e, n) {
|
4069
|
-
return this.request({ method: "prompts/list", params: e },
|
4069
|
+
return this.request({ method: "prompts/list", params: e }, Nh, n);
|
4070
4070
|
}
|
4071
4071
|
async listResources(e, n) {
|
4072
|
-
return this.request({ method: "resources/list", params: e },
|
4072
|
+
return this.request({ method: "resources/list", params: e }, Fh, n);
|
4073
4073
|
}
|
4074
4074
|
async listResourceTemplates(e, n) {
|
4075
|
-
return this.request({ method: "resources/templates/list", params: e },
|
4075
|
+
return this.request({ method: "resources/templates/list", params: e }, jh, n);
|
4076
4076
|
}
|
4077
4077
|
async readResource(e, n) {
|
4078
|
-
return this.request({ method: "resources/read", params: e },
|
4078
|
+
return this.request({ method: "resources/read", params: e }, qh, n);
|
4079
4079
|
}
|
4080
4080
|
async subscribeResource(e, n) {
|
4081
4081
|
return this.request({ method: "resources/subscribe", params: e }, Xr, n);
|
@@ -4113,7 +4113,7 @@ class ou extends gg {
|
|
4113
4113
|
return this._cachedToolOutputValidators.get(e);
|
4114
4114
|
}
|
4115
4115
|
async listTools(e, n) {
|
4116
|
-
const i = await this.request({ method: "tools/list", params: e },
|
4116
|
+
const i = await this.request({ method: "tools/list", params: e }, Bh, n);
|
4117
4117
|
return this.cacheToolOutputSchemas(i.tools), i;
|
4118
4118
|
}
|
4119
4119
|
async sendRootsListChanged() {
|
@@ -4271,13 +4271,13 @@ function uu(t) {
|
|
4271
4271
|
timeStamp: t.timeStamp
|
4272
4272
|
};
|
4273
4273
|
}
|
4274
|
-
var
|
4274
|
+
var Qh = (t) => {
|
4275
4275
|
throw TypeError(t);
|
4276
|
-
}, $s = (t, e, n) => e.has(t) ||
|
4276
|
+
}, $s = (t, e, n) => e.has(t) || Qh("Cannot " + n), ge = (t, e, n) => ($s(t, e, "read from private field"), n ? n.call(t) : e.get(t)), Fe = (t, e, n) => e.has(t) ? Qh("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), Le = (t, e, n, i) => ($s(t, e, "write to private field"), e.set(t, n), n), yr = (t, e, n) => ($s(t, e, "access private method"), n), Ve, Hr, Yr, qn, Wn, Ot, et, At, Tr, Qr, nt, Zr, Ct, er, ss, ls, us, cu, cs, fs, Rt, hs, ds;
|
4277
4277
|
class Nn extends EventTarget {
|
4278
4278
|
constructor(e, n) {
|
4279
4279
|
var i, r;
|
4280
|
-
super(), Fe(this, er), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, Fe(this, Ve), Fe(this,
|
4280
|
+
super(), Fe(this, er), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, Fe(this, Ve), Fe(this, Hr), Fe(this, Yr), Fe(this, qn), Fe(this, Wn), Fe(this, Ot), Fe(this, et), Fe(this, At, null), Fe(this, Tr), Fe(this, Qr), Fe(this, nt, null), Fe(this, Zr, null), Fe(this, Ct, null), Fe(this, ls, async (a) => {
|
4281
4281
|
var s;
|
4282
4282
|
ge(this, Qr).reset();
|
4283
4283
|
const { body: u, redirected: o, status: c, headers: f } = a;
|
@@ -4313,7 +4313,7 @@ class Nn extends EventTarget {
|
|
4313
4313
|
typeof a.id == "string" && Le(this, At, a.id);
|
4314
4314
|
const s = new MessageEvent(a.event || "message", {
|
4315
4315
|
data: a.data,
|
4316
|
-
origin: ge(this, Yr) ? ge(this, Yr).origin : ge(this,
|
4316
|
+
origin: ge(this, Yr) ? ge(this, Yr).origin : ge(this, Hr).origin,
|
4317
4317
|
lastEventId: a.id || ""
|
4318
4318
|
});
|
4319
4319
|
ge(this, Zr) && (!a.event || a.event === "message") && ge(this, Zr).call(this, s), this.dispatchEvent(s);
|
@@ -4324,9 +4324,9 @@ class Nn extends EventTarget {
|
|
4324
4324
|
});
|
4325
4325
|
try {
|
4326
4326
|
if (e instanceof URL)
|
4327
|
-
Le(this,
|
4327
|
+
Le(this, Hr, e);
|
4328
4328
|
else if (typeof e == "string")
|
4329
|
-
Le(this,
|
4329
|
+
Le(this, Hr, new URL(e, bv()));
|
4330
4330
|
else
|
4331
4331
|
throw new Error("Invalid URL");
|
4332
4332
|
} catch {
|
@@ -4358,7 +4358,7 @@ class Nn extends EventTarget {
|
|
4358
4358
|
* @public
|
4359
4359
|
*/
|
4360
4360
|
get url() {
|
4361
|
-
return ge(this,
|
4361
|
+
return ge(this, Hr).href;
|
4362
4362
|
}
|
4363
4363
|
/**
|
4364
4364
|
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
@@ -4408,13 +4408,13 @@ class Nn extends EventTarget {
|
|
4408
4408
|
ge(this, et) && clearTimeout(ge(this, et)), ge(this, Ve) !== this.CLOSED && (ge(this, Tr) && ge(this, Tr).abort(), Le(this, Ve, this.CLOSED), Le(this, Tr, void 0));
|
4409
4409
|
}
|
4410
4410
|
}
|
4411
|
-
Ve = /* @__PURE__ */ new WeakMap(),
|
4411
|
+
Ve = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), Yr = /* @__PURE__ */ new WeakMap(), qn = /* @__PURE__ */ new WeakMap(), Wn = /* @__PURE__ */ new WeakMap(), Ot = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakMap(), Qr = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), Zr = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), er = /* @__PURE__ */ new WeakSet(), /**
|
4412
4412
|
* Connect to the given URL and start receiving events
|
4413
4413
|
*
|
4414
4414
|
* @internal
|
4415
4415
|
*/
|
4416
4416
|
ss = function() {
|
4417
|
-
Le(this, Ve, this.CONNECTING), Le(this, Tr, new AbortController()), ge(this, Wn)(ge(this,
|
4417
|
+
Le(this, Ve, this.CONNECTING), Le(this, Tr, new AbortController()), ge(this, Wn)(ge(this, Hr), yr(this, er, cu).call(this)).then(ge(this, ls)).catch(ge(this, us));
|
4418
4418
|
}, ls = /* @__PURE__ */ new WeakMap(), us = /* @__PURE__ */ new WeakMap(), /**
|
4419
4419
|
* Get request options for the `fetch()` request
|
4420
4420
|
*
|
@@ -4544,7 +4544,7 @@ const Cv = ue({
|
|
4544
4544
|
introspection_endpoint_auth_methods_supported: ye(re()).optional(),
|
4545
4545
|
introspection_endpoint_auth_signing_alg_values_supported: ye(re()).optional(),
|
4546
4546
|
code_challenge_methods_supported: ye(re()).optional()
|
4547
|
-
}).passthrough(),
|
4547
|
+
}).passthrough(), Zh = ue({
|
4548
4548
|
access_token: re(),
|
4549
4549
|
token_type: re(),
|
4550
4550
|
expires_in: Ke().optional(),
|
@@ -4569,7 +4569,7 @@ const xv = ue({
|
|
4569
4569
|
tos_uri: re().optional(),
|
4570
4570
|
policy_uri: re().optional(),
|
4571
4571
|
jwks_uri: re().optional(),
|
4572
|
-
jwks:
|
4572
|
+
jwks: up().optional(),
|
4573
4573
|
software_id: re().optional(),
|
4574
4574
|
software_version: re().optional()
|
4575
4575
|
}).strip(), Tv = ue({
|
@@ -4744,7 +4744,7 @@ async function $v(t, { metadata: e, clientInformation: n, authorizationCode: i,
|
|
4744
4744
|
});
|
4745
4745
|
if (!c.ok)
|
4746
4746
|
throw new Error(`Token exchange failed: HTTP ${c.status}`);
|
4747
|
-
return
|
4747
|
+
return Zh.parse(await c.json());
|
4748
4748
|
}
|
4749
4749
|
async function Mv(t, { metadata: e, clientInformation: n, refreshToken: i }) {
|
4750
4750
|
const r = "refresh_token";
|
@@ -4769,7 +4769,7 @@ async function Mv(t, { metadata: e, clientInformation: n, refreshToken: i }) {
|
|
4769
4769
|
});
|
4770
4770
|
if (!u.ok)
|
4771
4771
|
throw new Error(`Token refresh failed: HTTP ${u.status}`);
|
4772
|
-
return
|
4772
|
+
return Zh.parse({ refresh_token: i, ...await u.json() });
|
4773
4773
|
}
|
4774
4774
|
async function kv(t, { metadata: e, clientMetadata: n }) {
|
4775
4775
|
let i;
|
@@ -4929,7 +4929,7 @@ function qv(t, e, n) {
|
|
4929
4929
|
}
|
4930
4930
|
)
|
4931
4931
|
), a = r.subscribe({}), s = r.pipe(
|
4932
|
-
Ee((c) => c === rt ? { type: "disabled" } : c ===
|
4932
|
+
Ee((c) => c === rt ? { type: "disabled" } : c === Ir ? { type: "connecting" } : c instanceof Error ? {
|
4933
4933
|
type: "connection-failed",
|
4934
4934
|
error: {
|
4935
4935
|
message: c.message
|
@@ -4940,12 +4940,12 @@ function qv(t, e, n) {
|
|
4940
4940
|
serverInfo: c.getServerVersion()
|
4941
4941
|
})
|
4942
4942
|
), o = r.pipe(
|
4943
|
-
|
4943
|
+
Dr(
|
4944
4944
|
(c) => {
|
4945
|
-
if (c ===
|
4945
|
+
if (c === Ir || c instanceof Error || c === rt)
|
4946
4946
|
return je.of(c);
|
4947
4947
|
const f = new Je();
|
4948
|
-
return c.setNotificationHandler(
|
4948
|
+
return c.setNotificationHandler(zh, () => {
|
4949
4949
|
f.next();
|
4950
4950
|
}), f.pipe(
|
4951
4951
|
gh({
|
@@ -4991,10 +4991,10 @@ async function Nv(t, e, n) {
|
|
4991
4991
|
if ("url" in t)
|
4992
4992
|
i = new jv(new URL(t.url));
|
4993
4993
|
else {
|
4994
|
-
const { loadProfileEnvironmentVariables: r } = await import("./load-profile-
|
4994
|
+
const { loadProfileEnvironmentVariables: r } = await import("./load-profile-CXHBU_AI.js"), a = n.loadProfile === "never" || !n.workingDirectory ? process.env : await We(
|
4995
4995
|
r(n.workingDirectory, n.loadProfile)
|
4996
4996
|
);
|
4997
|
-
i = await import("./stdio-
|
4997
|
+
i = await import("./stdio-7mSc8Mj0.js").then(
|
4998
4998
|
({ StdioClientTransport: s }) => new s({
|
4999
4999
|
...t,
|
5000
5000
|
stderr: "pipe",
|
@@ -5060,14 +5060,14 @@ function Hv({
|
|
5060
5060
|
return Array.from(r.entries());
|
5061
5061
|
})
|
5062
5062
|
), s = a.subscribe({}), u = a.pipe(
|
5063
|
-
|
5063
|
+
Dr(
|
5064
5064
|
(f) => f.length === 0 ? je.of([]) : br(
|
5065
5065
|
...f.map(
|
5066
5066
|
([y, { spec: g, client: h }]) => h.tools.pipe(
|
5067
5067
|
Ee((d) => ({
|
5068
5068
|
name: y,
|
5069
5069
|
spec: g,
|
5070
|
-
tools: d ===
|
5070
|
+
tools: d === Ir || d instanceof Error || d === rt ? [] : d,
|
5071
5071
|
client: h
|
5072
5072
|
}))
|
5073
5073
|
)
|
@@ -5118,7 +5118,7 @@ function Hv({
|
|
5118
5118
|
);
|
5119
5119
|
return {
|
5120
5120
|
servers: br(Jr, a).pipe(
|
5121
|
-
|
5121
|
+
Dr(
|
5122
5122
|
([f, y]) => y.length === 0 ? je.of([]) : br(
|
5123
5123
|
...y.map(
|
5124
5124
|
([g, { spec: h, client: d }]) => br(d.status, d.tools).pipe(
|
@@ -5127,7 +5127,7 @@ function Hv({
|
|
5127
5127
|
name: g,
|
5128
5128
|
spec: h,
|
5129
5129
|
status: m,
|
5130
|
-
tools: v instanceof Error ? v : v ===
|
5130
|
+
tools: v instanceof Error ? v : v === Ir || v === rt ? [] : v.map(
|
5131
5131
|
(l) => ({
|
5132
5132
|
spec: {
|
5133
5133
|
name: l.name,
|
@@ -5135,7 +5135,7 @@ function Hv({
|
|
5135
5135
|
inputSchema: l.inputSchema,
|
5136
5136
|
source: { mcp: g }
|
5137
5137
|
},
|
5138
|
-
...
|
5138
|
+
...cp(
|
5139
5139
|
{
|
5140
5140
|
name: l.name,
|
5141
5141
|
source: {}
|
@@ -5250,10 +5250,10 @@ const Wv = Vv({
|
|
5250
5250
|
cacheKey: (t) => t.toString()
|
5251
5251
|
});
|
5252
5252
|
async function Gv(t, e) {
|
5253
|
-
const n = e?.workingDirectory?.fsPath === t.fsPath ? " (your working directory)" : "", i = [e?.testing ? "./" : t.fsPath + n], r = await
|
5254
|
-
r.filter((s) => !
|
5253
|
+
const n = e?.workingDirectory?.fsPath === t.fsPath ? " (your working directory)" : "", i = [e?.testing ? "./" : t.fsPath + n], r = await _h(t.fsPath), a = await Promise.all(
|
5254
|
+
r.filter((s) => !fp(s)).map(async (s) => {
|
5255
5255
|
try {
|
5256
|
-
const u = await
|
5256
|
+
const u = await Sh(ze(t.fsPath, s));
|
5257
5257
|
return { name: s, isDirectory: u.isDirectory() };
|
5258
5258
|
} catch {
|
5259
5259
|
return { name: s, isDirectory: !1 };
|
@@ -5323,7 +5323,7 @@ function Jv(t) {
|
|
5323
5323
|
...t.messages.map((e) => e.role === "user" ? e.meta?.sentAt : void 0).filter((e) => e !== void 0)
|
5324
5324
|
);
|
5325
5325
|
}
|
5326
|
-
function
|
5326
|
+
function Xh() {
|
5327
5327
|
return new Promise((t) => setTimeout(t, 0));
|
5328
5328
|
}
|
5329
5329
|
class Yv {
|
@@ -5349,7 +5349,7 @@ class Yv {
|
|
5349
5349
|
/** Periodically flush threads to storage. */
|
5350
5350
|
flusher = this.exclusiveThreadsChanged.pipe(
|
5351
5351
|
Ee(() => Array.from(this.exclusiveThreads.keys())),
|
5352
|
-
|
5352
|
+
Dr(
|
5353
5353
|
(e) => e.length > 0 ? br(
|
5354
5354
|
...e.map((n) => {
|
5355
5355
|
const i = this.exclusiveThreads.get(n);
|
@@ -5380,13 +5380,13 @@ class Yv {
|
|
5380
5380
|
_r(void 0),
|
5381
5381
|
Ee(() => this.exclusiveThreads.has(e)),
|
5382
5382
|
Bn(),
|
5383
|
-
|
5383
|
+
Dr((n) => n ? this.exclusiveThreads.get(e) : Dt(async (i) => {
|
5384
5384
|
let r = await this.storage.get(e);
|
5385
5385
|
return i?.throwIfAborted(), r || (r = fu(e), await this.storage.set(e, r), i?.throwIfAborted()), r;
|
5386
5386
|
})),
|
5387
5387
|
// Throttle to avoid passing very large objects (~1MB+ often) across the RPC boundary,
|
5388
5388
|
// which causes GC pressure.
|
5389
|
-
|
5389
|
+
hp(100)
|
5390
5390
|
);
|
5391
5391
|
}
|
5392
5392
|
/**
|
@@ -5402,7 +5402,7 @@ class Yv {
|
|
5402
5402
|
let n = this.exclusiveThreads.get(e);
|
5403
5403
|
if (!n) {
|
5404
5404
|
let a = await this.storage.get(e);
|
5405
|
-
a || (a = fu(e), await this.storage.set(e, a)), n = new vh(a), this.exclusiveThreads.set(e, n), this.exclusiveThreadsChanged.next(), await
|
5405
|
+
a || (a = fu(e), await this.storage.set(e, a)), n = new vh(a), this.exclusiveThreads.set(e, n), this.exclusiveThreadsChanged.next(), await Xh();
|
5406
5406
|
}
|
5407
5407
|
let i = !1;
|
5408
5408
|
return {
|
@@ -5473,12 +5473,12 @@ function Qv({
|
|
5473
5473
|
isExtensionDevelopment: n = !1
|
5474
5474
|
}) {
|
5475
5475
|
let i = !1;
|
5476
|
-
const r = [], a =
|
5476
|
+
const r = [], a = dp(), s = new vh(/* @__PURE__ */ new Map()), u = async () => {
|
5477
5477
|
if (i || !await We(Qp))
|
5478
5478
|
return !1;
|
5479
5479
|
const m = await We(Jr);
|
5480
5480
|
return n && Em(m.settings.url) ? (J.debug(
|
5481
|
-
`Skipping sync to ${
|
5481
|
+
`Skipping sync to ${$r} in extension development mode to avoid polluting the production server`,
|
5482
5482
|
{ name: "ThreadSyncService" }
|
5483
5483
|
), !1) : !0;
|
5484
5484
|
}, o = async (m) => {
|
@@ -5648,10 +5648,10 @@ function Qv({
|
|
5648
5648
|
), r.push(
|
5649
5649
|
al(
|
5650
5650
|
t.exclusiveThreadsChanges.pipe(
|
5651
|
-
|
5651
|
+
Dr(
|
5652
5652
|
(m) => Mt(
|
5653
5653
|
...Array.from(m.entries()).map(
|
5654
|
-
([, v]) => v.pipe(
|
5654
|
+
([, v]) => v.pipe(pp((l) => a.add(l.id)))
|
5655
5655
|
)
|
5656
5656
|
)
|
5657
5657
|
)
|
@@ -5755,16 +5755,15 @@ IMPORTANT: The result of this tool (if any) should be displayed directly to the
|
|
5755
5755
|
},
|
5756
5756
|
source: "builtin"
|
5757
5757
|
},
|
5758
|
-
fn: import("./node-
|
5758
|
+
fn: import("./node-C2cKbj9k.js").then(({ runRoutine: t }) => t)
|
5759
5759
|
};
|
5760
5760
|
let hu = !1;
|
5761
|
-
async function
|
5761
|
+
async function ed(t, e = !1) {
|
5762
5762
|
return hu ? { dispose() {
|
5763
5763
|
} } : (hu = !0, await ey(t, e));
|
5764
5764
|
}
|
5765
5765
|
async function ey(t, e = !1) {
|
5766
5766
|
const n = [
|
5767
|
-
t.registerTool(pp),
|
5768
5767
|
t.registerTool(mp),
|
5769
5768
|
t.registerTool(gp),
|
5770
5769
|
t.registerTool(vp),
|
@@ -5779,9 +5778,10 @@ async function ey(t, e = !1) {
|
|
5779
5778
|
t.registerTool(Rp),
|
5780
5779
|
t.registerTool(xp),
|
5781
5780
|
t.registerTool(Tp),
|
5782
|
-
t.registerTool(Op)
|
5781
|
+
t.registerTool(Op),
|
5782
|
+
t.registerTool(Ap)
|
5783
5783
|
];
|
5784
|
-
return n.push(t.registerTool(
|
5784
|
+
return n.push(t.registerTool(Lp)), e && n.push(t.registerTool(Xv)), {
|
5785
5785
|
dispose() {
|
5786
5786
|
for (const i of n)
|
5787
5787
|
i.dispose();
|
@@ -5910,7 +5910,7 @@ function ks() {
|
|
5910
5910
|
return Kt.Argument = e, Kt.humanReadableArgName = n, Kt;
|
5911
5911
|
}
|
5912
5912
|
var ca = {}, fa = {}, mu;
|
5913
|
-
function
|
5913
|
+
function rd() {
|
5914
5914
|
if (mu) return fa;
|
5915
5915
|
mu = 1;
|
5916
5916
|
const { humanReadableArgName: t } = ks();
|
@@ -6192,7 +6192,7 @@ function ed() {
|
|
6192
6192
|
return fa.Help = e, fa;
|
6193
6193
|
}
|
6194
6194
|
var bt = {}, gu;
|
6195
|
-
function
|
6195
|
+
function td() {
|
6196
6196
|
if (gu) return bt;
|
6197
6197
|
gu = 1;
|
6198
6198
|
const { InvalidArgumentError: t } = hi();
|
@@ -6443,7 +6443,7 @@ var yu;
|
|
6443
6443
|
function ty() {
|
6444
6444
|
if (yu) return ca;
|
6445
6445
|
yu = 1;
|
6446
|
-
const t = Rs.EventEmitter, e = Xp, n = me, i = ot, r = nm, { Argument: a, humanReadableArgName: s } = ks(), { CommanderError: u } = hi(), { Help: o } =
|
6446
|
+
const t = Rs.EventEmitter, e = Xp, n = me, i = ot, r = nm, { Argument: a, humanReadableArgName: s } = ks(), { CommanderError: u } = hi(), { Help: o } = rd(), { Option: c, splitOptionFlags: f, DualOptions: y } = td(), { suggestSimilar: g } = ry();
|
6447
6447
|
class h extends t {
|
6448
6448
|
/**
|
6449
6449
|
* Initialize a new `Command`.
|
@@ -7775,26 +7775,26 @@ Expecting one of '${b.join("', '")}'`);
|
|
7775
7775
|
var bu;
|
7776
7776
|
function ny() {
|
7777
7777
|
return bu || (bu = 1, function(t, e) {
|
7778
|
-
const { Argument: n } = ks(), { Command: i } = ty(), { CommanderError: r, InvalidArgumentError: a } = hi(), { Help: s } =
|
7778
|
+
const { Argument: n } = ks(), { Command: i } = ty(), { CommanderError: r, InvalidArgumentError: a } = hi(), { Help: s } = rd(), { Option: u } = td();
|
7779
7779
|
e = t.exports = new i(), e.program = e, e.Command = i, e.Option = u, e.Argument = n, e.Help = s, e.CommanderError = r, e.InvalidArgumentError = a, e.InvalidOptionArgumentError = a;
|
7780
7780
|
}(Gt, Gt.exports)), Gt.exports;
|
7781
7781
|
}
|
7782
7782
|
var iy = ny();
|
7783
7783
|
const ay = /* @__PURE__ */ ei(iy), {
|
7784
|
-
program:
|
7785
|
-
createCommand:
|
7786
|
-
createArgument:
|
7787
|
-
createOption:
|
7788
|
-
CommanderError:
|
7789
|
-
InvalidArgumentError:
|
7790
|
-
InvalidOptionArgumentError:
|
7784
|
+
program: __,
|
7785
|
+
createCommand: S_,
|
7786
|
+
createArgument: E_,
|
7787
|
+
createOption: P_,
|
7788
|
+
CommanderError: C_,
|
7789
|
+
InvalidArgumentError: R_,
|
7790
|
+
InvalidOptionArgumentError: x_,
|
7791
7791
|
// deprecated old name
|
7792
7792
|
Command: wu,
|
7793
|
-
Argument:
|
7793
|
+
Argument: T_,
|
7794
7794
|
Option: oy,
|
7795
|
-
Help:
|
7795
|
+
Help: O_
|
7796
7796
|
} = ay;
|
7797
|
-
var
|
7797
|
+
var nd;
|
7798
7798
|
(() => {
|
7799
7799
|
var t = { 975: (P) => {
|
7800
7800
|
function S(I) {
|
@@ -8117,9 +8117,9 @@ var td;
|
|
8117
8117
|
}, P.extname = function(S) {
|
8118
8118
|
return x.extname(S.path);
|
8119
8119
|
};
|
8120
|
-
})(R || (R = {})),
|
8120
|
+
})(R || (R = {})), nd = i;
|
8121
8121
|
})();
|
8122
|
-
const { URI: di, Utils: sy } =
|
8122
|
+
const { URI: di, Utils: sy } = nd;
|
8123
8123
|
class ps extends Error {
|
8124
8124
|
constructor(e, n) {
|
8125
8125
|
super(e), this.cause = n, this.name = "StdinReadError";
|
@@ -8192,18 +8192,18 @@ async function uy() {
|
|
8192
8192
|
throw new ps("Timeout while reading from stdin");
|
8193
8193
|
return t.truncated && J.warn(`Warning: stdin input was truncated at ${t.bytesRead} bytes`), t.content;
|
8194
8194
|
}
|
8195
|
-
const
|
8195
|
+
const Mr = Sr.homedir(), { env: Br } = process, Gn = Br.XDG_DATA_HOME || (Mr ? me.join(Mr, ".local", "share") : void 0), ms = Br.XDG_CONFIG_HOME || (Mr ? me.join(Mr, ".config") : void 0), cy = Br.XDG_STATE_HOME || (Mr ? me.join(Mr, ".local", "state") : void 0), fy = Br.XDG_CACHE_HOME || (Mr ? me.join(Mr, ".cache") : void 0);
|
8196
8196
|
Br.XDG_RUNTIME_DIR;
|
8197
8197
|
const hy = (Br.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":");
|
8198
8198
|
Gn && hy.unshift(Gn);
|
8199
8199
|
const dy = (Br.XDG_CONFIG_DIRS || "/etc/xdg").split(":");
|
8200
8200
|
ms && dy.unshift(ms);
|
8201
|
-
const
|
8202
|
-
ms || me.join(
|
8201
|
+
const id = me.join(Gn || me.join(Lr(), ".local/share"), "amp"), ct = me.join(
|
8202
|
+
ms || me.join(Lr(), ".config"),
|
8203
8203
|
"amp",
|
8204
8204
|
"settings.json"
|
8205
|
-
), gs = "secrets.json", vs = me.join(
|
8206
|
-
function
|
8205
|
+
), gs = "secrets.json", vs = me.join(id, gs);
|
8206
|
+
function ad(t) {
|
8207
8207
|
const e = t?.settingsFile ?? ct, n = new Je();
|
8208
8208
|
let i;
|
8209
8209
|
async function r() {
|
@@ -8267,7 +8267,7 @@ function id(t) {
|
|
8267
8267
|
};
|
8268
8268
|
}
|
8269
8269
|
function Hn(t) {
|
8270
|
-
const e =
|
8270
|
+
const e = id, n = new Je();
|
8271
8271
|
let i;
|
8272
8272
|
async function r() {
|
8273
8273
|
try {
|
@@ -8355,7 +8355,7 @@ class py {
|
|
8355
8355
|
}
|
8356
8356
|
}
|
8357
8357
|
}
|
8358
|
-
const Wr = Ft(
|
8358
|
+
const Wr = Ft(Eh);
|
8359
8359
|
class my {
|
8360
8360
|
/**
|
8361
8361
|
* Collect comprehensive AMP-specific information
|
@@ -8619,21 +8619,21 @@ class my {
|
|
8619
8619
|
* Get AMP settings file path (XDG-compliant)
|
8620
8620
|
*/
|
8621
8621
|
getSettingsPath() {
|
8622
|
-
const e = process.env.XDG_CONFIG_HOME || ze(
|
8622
|
+
const e = process.env.XDG_CONFIG_HOME || ze(Lr(), ".config");
|
8623
8623
|
return ze(e, "amp", "settings.json");
|
8624
8624
|
}
|
8625
8625
|
/**
|
8626
8626
|
* Get AMP secrets file path (XDG-compliant)
|
8627
8627
|
*/
|
8628
8628
|
getSecretsPath() {
|
8629
|
-
const e = process.env.XDG_DATA_HOME || ze(
|
8629
|
+
const e = process.env.XDG_DATA_HOME || ze(Lr(), ".local", "share");
|
8630
8630
|
return ze(e, "amp", "secrets.json");
|
8631
8631
|
}
|
8632
8632
|
/**
|
8633
8633
|
* Get AMP log file path (XDG-compliant)
|
8634
8634
|
*/
|
8635
8635
|
getLogPath() {
|
8636
|
-
const e = process.env.XDG_CACHE_HOME || ze(
|
8636
|
+
const e = process.env.XDG_CACHE_HOME || ze(Lr(), ".cache");
|
8637
8637
|
return ze(e, "amp", "logs", "cli.log");
|
8638
8638
|
}
|
8639
8639
|
}
|
@@ -8757,7 +8757,7 @@ class vy {
|
|
8757
8757
|
return (n || i) && (e.httpProxy = n, e.httpsProxy = i, e.noProxy = r, e.detected = !0), e;
|
8758
8758
|
}
|
8759
8759
|
}
|
8760
|
-
const da = Ft(
|
8760
|
+
const da = Ft(Eh);
|
8761
8761
|
class yy {
|
8762
8762
|
testUrls = ["https://ampcode.com", "https://sourcegraph.com"];
|
8763
8763
|
/**
|
@@ -9011,7 +9011,7 @@ class by {
|
|
9011
9011
|
* Generate a complete support bundle
|
9012
9012
|
*/
|
9013
9013
|
async generate(e = {}) {
|
9014
|
-
const n = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-"), i = e.outputDir || process.cwd(), r = await this.collectData(), a =
|
9014
|
+
const n = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-"), i = e.outputDir || process.cwd(), r = await this.collectData(), a = Ip(r), s = ze(i, `amp-support-bundle-${n}.json.gz`);
|
9015
9015
|
return await this.createBundle(a, s), s;
|
9016
9016
|
}
|
9017
9017
|
/**
|
@@ -9676,7 +9676,7 @@ function Oy() {
|
|
9676
9676
|
}(va)), va.exports;
|
9677
9677
|
}
|
9678
9678
|
var Iu;
|
9679
|
-
function
|
9679
|
+
function od() {
|
9680
9680
|
return Iu || (Iu = 1, function(t) {
|
9681
9681
|
var e = Oy();
|
9682
9682
|
t.exports = e;
|
@@ -9814,7 +9814,7 @@ function Fs() {
|
|
9814
9814
|
}
|
9815
9815
|
return String(g);
|
9816
9816
|
}
|
9817
|
-
var s =
|
9817
|
+
var s = od(), u = De(), o = u.LEVEL, c = u.MESSAGE;
|
9818
9818
|
s.enabled = !0;
|
9819
9819
|
var f = /\s+/, y = /* @__PURE__ */ function() {
|
9820
9820
|
function g() {
|
@@ -9890,7 +9890,7 @@ function My() {
|
|
9890
9890
|
}), Aa;
|
9891
9891
|
}
|
9892
9892
|
var en = { exports: {} }, _t = { exports: {} }, Hu;
|
9893
|
-
function
|
9893
|
+
function sd() {
|
9894
9894
|
if (Hu) return _t.exports;
|
9895
9895
|
Hu = 1;
|
9896
9896
|
function t(l) {
|
@@ -10058,7 +10058,7 @@ function ky() {
|
|
10058
10058
|
}
|
10059
10059
|
return String(d);
|
10060
10060
|
}
|
10061
|
-
var s = Fs(), u = s.Colorizer, o =
|
10061
|
+
var s = Fs(), u = s.Colorizer, o = sd(), c = o.Padder, f = De(), y = f.configs, g = f.MESSAGE, h = /* @__PURE__ */ function() {
|
10062
10062
|
function d() {
|
10063
10063
|
var m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
10064
10064
|
e(this, d), m.levels || (m.levels = y.cli.levels), this.colorizer = new u(m), this.padder = new c(m), this.options = m;
|
@@ -10902,8 +10902,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
10902
10902
|
return new l(p);
|
10903
10903
|
}, Na;
|
10904
10904
|
}
|
10905
|
-
var
|
10906
|
-
function
|
10905
|
+
var ld = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g, xr = "\\d\\d?", Rr = "\\d\\d", Jy = "\\d{3}", Yy = "\\d{4}", Lt = "[^\\s]+", ud = /\[([^]*?)\]/gm;
|
10906
|
+
function cd(t, e) {
|
10907
10907
|
for (var n = [], i = 0, r = t.length; i < r; i++)
|
10908
10908
|
n.push(t[i].substr(0, e));
|
10909
10909
|
return n;
|
@@ -10916,7 +10916,7 @@ var tc = function(t) {
|
|
10916
10916
|
return r > -1 ? r : null;
|
10917
10917
|
};
|
10918
10918
|
};
|
10919
|
-
function
|
10919
|
+
function kr(t) {
|
10920
10920
|
for (var e = [], n = 1; n < arguments.length; n++)
|
10921
10921
|
e[n - 1] = arguments[n];
|
10922
10922
|
for (var i = 0, r = e; i < r.length; i++) {
|
@@ -10926,7 +10926,7 @@ function Mr(t) {
|
|
10926
10926
|
}
|
10927
10927
|
return t;
|
10928
10928
|
}
|
10929
|
-
var
|
10929
|
+
var fd = [
|
10930
10930
|
"Sunday",
|
10931
10931
|
"Monday",
|
10932
10932
|
"Tuesday",
|
@@ -10934,7 +10934,7 @@ var cd = [
|
|
10934
10934
|
"Thursday",
|
10935
10935
|
"Friday",
|
10936
10936
|
"Saturday"
|
10937
|
-
],
|
10937
|
+
], hd = [
|
10938
10938
|
"January",
|
10939
10939
|
"February",
|
10940
10940
|
"March",
|
@@ -10947,17 +10947,17 @@ var cd = [
|
|
10947
10947
|
"October",
|
10948
10948
|
"November",
|
10949
10949
|
"December"
|
10950
|
-
], Qy =
|
10950
|
+
], Qy = cd(hd, 3), Zy = cd(fd, 3), js = {
|
10951
10951
|
dayNamesShort: Zy,
|
10952
|
-
dayNames:
|
10952
|
+
dayNames: fd,
|
10953
10953
|
monthNamesShort: Qy,
|
10954
|
-
monthNames:
|
10954
|
+
monthNames: hd,
|
10955
10955
|
amPm: ["am", "pm"],
|
10956
10956
|
DoFn: function(t) {
|
10957
10957
|
return t + ["th", "st", "nd", "rd"][t % 10 > 3 ? 0 : (t - t % 10 !== 10 ? 1 : 0) * t % 10];
|
10958
10958
|
}
|
10959
|
-
}, Kn =
|
10960
|
-
return Kn =
|
10959
|
+
}, Kn = kr({}, js), dd = function(t) {
|
10960
|
+
return Kn = kr(Kn, t);
|
10961
10961
|
}, nc = function(t) {
|
10962
10962
|
return t.replace(/[|\\{()[^$+*?.-]/g, "\\$&");
|
10963
10963
|
}, Be = function(t, e) {
|
@@ -11124,24 +11124,24 @@ var cd = [
|
|
11124
11124
|
shortTime: "HH:mm",
|
11125
11125
|
mediumTime: "HH:mm:ss",
|
11126
11126
|
longTime: "HH:mm:ss.SSS"
|
11127
|
-
},
|
11128
|
-
return
|
11129
|
-
},
|
11127
|
+
}, pd = function(t) {
|
11128
|
+
return kr(Jn, t);
|
11129
|
+
}, md = function(t, e, n) {
|
11130
11130
|
if (e === void 0 && (e = Jn.default), n === void 0 && (n = {}), typeof t == "number" && (t = new Date(t)), Object.prototype.toString.call(t) !== "[object Date]" || isNaN(t.getTime()))
|
11131
11131
|
throw new Error("Invalid Date pass to format");
|
11132
11132
|
e = Jn[e] || e;
|
11133
11133
|
var i = [];
|
11134
|
-
e = e.replace(
|
11134
|
+
e = e.replace(ud, function(a, s) {
|
11135
11135
|
return i.push(s), "@@@";
|
11136
11136
|
});
|
11137
|
-
var r =
|
11138
|
-
return e = e.replace(
|
11137
|
+
var r = kr(kr({}, Kn), n);
|
11138
|
+
return e = e.replace(ld, function(a) {
|
11139
11139
|
return Xy[a](t, r);
|
11140
11140
|
}), e.replace(/@@@/g, function() {
|
11141
11141
|
return i.shift();
|
11142
11142
|
});
|
11143
11143
|
};
|
11144
|
-
function
|
11144
|
+
function gd(t, e, n) {
|
11145
11145
|
if (n === void 0 && (n = {}), typeof e != "string")
|
11146
11146
|
throw new Error("Invalid format in fecha parse");
|
11147
11147
|
if (e = Jn[e] || e, t.length > 1e3)
|
@@ -11156,10 +11156,10 @@ function md(t, e, n) {
|
|
11156
11156
|
millisecond: 0,
|
11157
11157
|
isPm: null,
|
11158
11158
|
timezoneOffset: null
|
11159
|
-
}, a = [], s = [], u = e.replace(
|
11159
|
+
}, a = [], s = [], u = e.replace(ud, function(w, _) {
|
11160
11160
|
return s.push(nc(_)), "@@@";
|
11161
11161
|
}), o = {}, c = {};
|
11162
|
-
u = nc(u).replace(
|
11162
|
+
u = nc(u).replace(ld, function(w) {
|
11163
11163
|
var _ = e0[w], D = _[0], O = _[1], x = _[3];
|
11164
11164
|
if (o[D])
|
11165
11165
|
throw new Error("Invalid format. " + D + " specified twice in format");
|
@@ -11173,7 +11173,7 @@ function md(t, e, n) {
|
|
11173
11173
|
var f = t.match(new RegExp(u, "i"));
|
11174
11174
|
if (!f)
|
11175
11175
|
return null;
|
11176
|
-
for (var y =
|
11176
|
+
for (var y = kr(kr({}, Kn), n), g = 1; g < f.length; g++) {
|
11177
11177
|
var h = a[g - 1], d = h[0], m = h[2], v = m ? m(f[g], y) : +f[g];
|
11178
11178
|
if (v == null)
|
11179
11179
|
return null;
|
@@ -11197,22 +11197,22 @@ function md(t, e, n) {
|
|
11197
11197
|
return l;
|
11198
11198
|
}
|
11199
11199
|
var r0 = {
|
11200
|
-
format:
|
11201
|
-
parse:
|
11200
|
+
format: md,
|
11201
|
+
parse: gd,
|
11202
11202
|
defaultI18n: js,
|
11203
|
-
setGlobalDateI18n:
|
11204
|
-
setGlobalDateMasks:
|
11203
|
+
setGlobalDateI18n: dd,
|
11204
|
+
setGlobalDateMasks: pd
|
11205
11205
|
};
|
11206
11206
|
const t0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
11207
11207
|
__proto__: null,
|
11208
|
-
assign:
|
11208
|
+
assign: kr,
|
11209
11209
|
default: r0,
|
11210
11210
|
defaultI18n: js,
|
11211
|
-
format:
|
11212
|
-
parse:
|
11213
|
-
setGlobalDateI18n:
|
11214
|
-
setGlobalDateMasks:
|
11215
|
-
}, Symbol.toStringTag, { value: "Module" })), n0 = /* @__PURE__ */
|
11211
|
+
format: md,
|
11212
|
+
parse: gd,
|
11213
|
+
setGlobalDateI18n: dd,
|
11214
|
+
setGlobalDateMasks: pd
|
11215
|
+
}, Symbol.toStringTag, { value: "Module" })), n0 = /* @__PURE__ */ Dp(t0);
|
11216
11216
|
var Ha, uc;
|
11217
11217
|
function i0() {
|
11218
11218
|
if (uc) return Ha;
|
@@ -11227,13 +11227,13 @@ var Ua, cc;
|
|
11227
11227
|
function a0() {
|
11228
11228
|
if (cc) return Ua;
|
11229
11229
|
cc = 1;
|
11230
|
-
var t =
|
11230
|
+
var t = od(), e = Ze(), n = De(), i = n.MESSAGE;
|
11231
11231
|
return Ua = e(function(r, a) {
|
11232
11232
|
return a.level !== !1 && (r.level = t.strip(r.level)), a.message !== !1 && (r.message = t.strip(String(r.message))), a.raw !== !1 && r[i] && (r[i] = t.strip(String(r[i]))), r;
|
11233
11233
|
}), Ua;
|
11234
11234
|
}
|
11235
11235
|
var fc;
|
11236
|
-
function
|
11236
|
+
function vd() {
|
11237
11237
|
if (fc) return Yt;
|
11238
11238
|
fc = 1;
|
11239
11239
|
var t = Yt.format = Ze();
|
@@ -11258,7 +11258,7 @@ function gd() {
|
|
11258
11258
|
}), Object.defineProperty(t, "ms", {
|
11259
11259
|
value: zy()
|
11260
11260
|
}), Object.defineProperty(t, "padLevels", {
|
11261
|
-
value:
|
11261
|
+
value: sd()
|
11262
11262
|
}), Object.defineProperty(t, "prettyPrint", {
|
11263
11263
|
value: Vy()
|
11264
11264
|
}), Object.defineProperty(t, "printf", {
|
@@ -11274,7 +11274,7 @@ function gd() {
|
|
11274
11274
|
}), Yt;
|
11275
11275
|
}
|
11276
11276
|
var Ba = {}, hc;
|
11277
|
-
function
|
11277
|
+
function yd() {
|
11278
11278
|
return hc || (hc = 1, function(t) {
|
11279
11279
|
var e = fr, n = e.format;
|
11280
11280
|
t.warn = {
|
@@ -11339,11 +11339,11 @@ function l0() {
|
|
11339
11339
|
return Wa;
|
11340
11340
|
}
|
11341
11341
|
var Ga, pc;
|
11342
|
-
function
|
11342
|
+
function bd() {
|
11343
11343
|
return pc || (pc = 1, Ga = Rs.EventEmitter), Ga;
|
11344
11344
|
}
|
11345
11345
|
var Ka, mc;
|
11346
|
-
function
|
11346
|
+
function wd() {
|
11347
11347
|
if (mc) return Ka;
|
11348
11348
|
mc = 1;
|
11349
11349
|
function t(s, u) {
|
@@ -11436,7 +11436,7 @@ function ft() {
|
|
11436
11436
|
}, TypeError), n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), Ja.codes = e, Ja;
|
11437
11437
|
}
|
11438
11438
|
var Ya, vc;
|
11439
|
-
function
|
11439
|
+
function _d() {
|
11440
11440
|
if (vc) return Ya;
|
11441
11441
|
vc = 1;
|
11442
11442
|
var t = ft().codes.ERR_INVALID_OPT_VALUE;
|
@@ -12015,14 +12015,14 @@ function h0() {
|
|
12015
12015
|
}), ro;
|
12016
12016
|
}
|
12017
12017
|
var to, Rc;
|
12018
|
-
function
|
12018
|
+
function Sd() {
|
12019
12019
|
if (Rc) return to;
|
12020
12020
|
Rc = 1, to = C;
|
12021
12021
|
var t;
|
12022
12022
|
C.ReadableState = x, Rs.EventEmitter;
|
12023
12023
|
var e = function(j, Z) {
|
12024
12024
|
return j.listeners(Z).length;
|
12025
|
-
}, n =
|
12025
|
+
}, n = bd(), i = ni.Buffer, r = (typeof at < "u" ? at : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
|
12026
12026
|
};
|
12027
12027
|
function a(L) {
|
12028
12028
|
return i.from(L);
|
@@ -12033,7 +12033,7 @@ function _d() {
|
|
12033
12033
|
var u = fr, o;
|
12034
12034
|
u && u.debuglog ? o = u.debuglog("stream") : o = function() {
|
12035
12035
|
};
|
12036
|
-
var c = u0(), f =
|
12036
|
+
var c = u0(), f = wd(), y = _d(), g = y.getHighWaterMark, h = ft().codes, d = h.ERR_INVALID_ARG_TYPE, m = h.ERR_STREAM_PUSH_AFTER_EOF, v = h.ERR_METHOD_NOT_IMPLEMENTED, l = h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, p, b, w;
|
12037
12037
|
Nt()(C, n);
|
12038
12038
|
var _ = f.errorOrDestroy, D = ["error", "close", "destroy", "pause", "resume"];
|
12039
12039
|
function O(L, j, Z) {
|
@@ -12362,7 +12362,7 @@ function st() {
|
|
12362
12362
|
return f;
|
12363
12363
|
};
|
12364
12364
|
no = s;
|
12365
|
-
var e =
|
12365
|
+
var e = Sd(), n = pi();
|
12366
12366
|
Nt()(s, e);
|
12367
12367
|
for (var i = t(n.prototype), r = 0; r < i.length; r++) {
|
12368
12368
|
var a = i[r];
|
@@ -12430,7 +12430,7 @@ function pi() {
|
|
12430
12430
|
x.WritableState = D;
|
12431
12431
|
var n = {
|
12432
12432
|
deprecate: l0()
|
12433
|
-
}, i =
|
12433
|
+
}, i = bd(), r = ni.Buffer, a = (typeof at < "u" ? at : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
|
12434
12434
|
};
|
12435
12435
|
function s(T) {
|
12436
12436
|
return r.from(T);
|
@@ -12438,7 +12438,7 @@ function pi() {
|
|
12438
12438
|
function u(T) {
|
12439
12439
|
return r.isBuffer(T) || T instanceof a;
|
12440
12440
|
}
|
12441
|
-
var o =
|
12441
|
+
var o = wd(), c = _d(), f = c.getHighWaterMark, y = ft().codes, g = y.ERR_INVALID_ARG_TYPE, h = y.ERR_METHOD_NOT_IMPLEMENTED, d = y.ERR_MULTIPLE_CALLBACK, m = y.ERR_STREAM_CANNOT_PIPE, v = y.ERR_STREAM_DESTROYED, l = y.ERR_STREAM_NULL_VALUES, p = y.ERR_STREAM_WRITE_AFTER_END, b = y.ERR_UNKNOWN_ENCODING, w = o.errorOrDestroy;
|
12442
12442
|
Nt()(x, i);
|
12443
12443
|
function _() {
|
12444
12444
|
}
|
@@ -12644,7 +12644,7 @@ function pi() {
|
|
12644
12644
|
}, io;
|
12645
12645
|
}
|
12646
12646
|
var Oc;
|
12647
|
-
function
|
12647
|
+
function Ed() {
|
12648
12648
|
if (Oc) return Va.exports;
|
12649
12649
|
Oc = 1;
|
12650
12650
|
var t = fr, e = pi(), n = De(), i = n.LEVEL, r = Va.exports = function() {
|
@@ -12712,7 +12712,7 @@ var ao = { exports: {} }, Ac;
|
|
12712
12712
|
function d0() {
|
12713
12713
|
if (Ac) return ao.exports;
|
12714
12714
|
Ac = 1;
|
12715
|
-
var t = fr, e = De(), n = e.LEVEL, i =
|
12715
|
+
var t = fr, e = De(), n = e.LEVEL, i = Ed(), r = ao.exports = function() {
|
12716
12716
|
var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
12717
12717
|
if (i.call(this, s), !s.transport || typeof s.transport.log != "function")
|
12718
12718
|
throw new Error("Invalid transport, must be an object with a log method.");
|
@@ -12739,7 +12739,7 @@ function d0() {
|
|
12739
12739
|
}
|
12740
12740
|
var Lc;
|
12741
12741
|
function Ht() {
|
12742
|
-
return Lc || (Lc = 1, nn.exports =
|
12742
|
+
return Lc || (Lc = 1, nn.exports = Ed(), nn.exports.LegacyTransportStream = d0()), nn.exports;
|
12743
12743
|
}
|
12744
12744
|
var oo, Ic;
|
12745
12745
|
function p0() {
|
@@ -13012,7 +13012,7 @@ function y0() {
|
|
13012
13012
|
}(ln, ln.exports)), ln.exports;
|
13013
13013
|
}
|
13014
13014
|
var dn = { exports: {} }, pn = { exports: {} }, mn = { exports: {} }, gn = { exports: {} }, Nc;
|
13015
|
-
function
|
13015
|
+
function Pd() {
|
13016
13016
|
return Nc || (Nc = 1, function(t, e) {
|
13017
13017
|
Object.defineProperty(e, "__esModule", {
|
13018
13018
|
value: !0
|
@@ -13079,7 +13079,7 @@ function w0() {
|
|
13079
13079
|
}(vn, vn.exports)), vn.exports;
|
13080
13080
|
}
|
13081
13081
|
var bn = { exports: {} }, Bc;
|
13082
|
-
function
|
13082
|
+
function Cd() {
|
13083
13083
|
return Bc || (Bc = 1, function(t, e) {
|
13084
13084
|
Object.defineProperty(e, "__esModule", {
|
13085
13085
|
value: !0
|
@@ -13153,7 +13153,7 @@ function S0() {
|
|
13153
13153
|
Object.defineProperty(e, "__esModule", {
|
13154
13154
|
value: !0
|
13155
13155
|
});
|
13156
|
-
var n =
|
13156
|
+
var n = Pd(), i = h(n), r = w0(), a = h(r), s = Cd(), u = h(s), o = ht(), c = _0(), f = h(c), y = Hs(), g = h(y);
|
13157
13157
|
function h(d) {
|
13158
13158
|
return d && d.__esModule ? d : { default: d };
|
13159
13159
|
}
|
@@ -13195,7 +13195,7 @@ function S0() {
|
|
13195
13195
|
}(mn, mn.exports)), mn.exports;
|
13196
13196
|
}
|
13197
13197
|
var Gc;
|
13198
|
-
function
|
13198
|
+
function Rd() {
|
13199
13199
|
return Gc || (Gc = 1, function(t, e) {
|
13200
13200
|
Object.defineProperty(e, "__esModule", {
|
13201
13201
|
value: !0
|
@@ -13216,7 +13216,7 @@ function E0() {
|
|
13216
13216
|
Object.defineProperty(e, "__esModule", {
|
13217
13217
|
value: !0
|
13218
13218
|
});
|
13219
|
-
var n =
|
13219
|
+
var n = Rd(), i = s(n), r = Ut(), a = s(r);
|
13220
13220
|
function s(o) {
|
13221
13221
|
return o && o.__esModule ? o : { default: o };
|
13222
13222
|
}
|
@@ -13243,7 +13243,7 @@ function P0() {
|
|
13243
13243
|
}(sn, sn.exports)), sn.exports;
|
13244
13244
|
}
|
13245
13245
|
var Sn = { exports: {} }, so, Yc;
|
13246
|
-
function
|
13246
|
+
function xd() {
|
13247
13247
|
if (Yc) return so;
|
13248
13248
|
Yc = 1, so = u;
|
13249
13249
|
var t = ft().codes, e = t.ERR_METHOD_NOT_IMPLEMENTED, n = t.ERR_MULTIPLE_CALLBACK, i = t.ERR_TRANSFORM_ALREADY_TRANSFORMING, r = t.ERR_TRANSFORM_WITH_LENGTH_0, a = st();
|
@@ -13305,7 +13305,7 @@ var lo, Qc;
|
|
13305
13305
|
function C0() {
|
13306
13306
|
if (Qc) return lo;
|
13307
13307
|
Qc = 1, lo = e;
|
13308
|
-
var t =
|
13308
|
+
var t = xd();
|
13309
13309
|
Nt()(e, t);
|
13310
13310
|
function e(n) {
|
13311
13311
|
if (!(this instanceof e)) return new e(n);
|
@@ -13382,11 +13382,11 @@ function R0() {
|
|
13382
13382
|
var Xc;
|
13383
13383
|
function dt() {
|
13384
13384
|
return Xc || (Xc = 1, function(t, e) {
|
13385
|
-
e = t.exports =
|
13385
|
+
e = t.exports = Sd(), e.Stream = e, e.Readable = e, e.Writable = pi(), e.Duplex = st(), e.Transform = xd(), e.PassThrough = C0(), e.finished = qs(), e.pipeline = R0();
|
13386
13386
|
}(Sn, Sn.exports)), Sn.exports;
|
13387
13387
|
}
|
13388
13388
|
var En = { exports: {} }, co, ef;
|
13389
|
-
function
|
13389
|
+
function Td() {
|
13390
13390
|
if (ef) return co;
|
13391
13391
|
ef = 1;
|
13392
13392
|
var t = [], e = [], n = function() {
|
@@ -13452,7 +13452,7 @@ var fo, rf;
|
|
13452
13452
|
function x0() {
|
13453
13453
|
if (rf) return fo;
|
13454
13454
|
rf = 1;
|
13455
|
-
var t =
|
13455
|
+
var t = Td(), e = t(function n(i, r) {
|
13456
13456
|
return r = r || {}, r.namespace = i, r.prod = !0, r.dev = !1, r.force || n.force ? n.yep(r) : n.nope(r);
|
13457
13457
|
});
|
13458
13458
|
return fo = e, fo;
|
@@ -13484,7 +13484,7 @@ var af;
|
|
13484
13484
|
function A0() {
|
13485
13485
|
if (af) return ho.exports;
|
13486
13486
|
af = 1;
|
13487
|
-
var t =
|
13487
|
+
var t = $p(), e = O0(), n = Object.hasOwnProperty, i = /* @__PURE__ */ Object.create(null);
|
13488
13488
|
for (var r in t)
|
13489
13489
|
n.call(t, r) && (i[t[r]] = r);
|
13490
13490
|
var a = ho.exports = {
|
@@ -13730,7 +13730,7 @@ function L0() {
|
|
13730
13730
|
}), vo;
|
13731
13731
|
}
|
13732
13732
|
var sf;
|
13733
|
-
function
|
13733
|
+
function Od() {
|
13734
13734
|
if (sf) return go.exports;
|
13735
13735
|
sf = 1;
|
13736
13736
|
var t = L0(), e = {};
|
@@ -14001,7 +14001,7 @@ var yo, lf;
|
|
14001
14001
|
function I0() {
|
14002
14002
|
if (lf) return yo;
|
14003
14003
|
lf = 1;
|
14004
|
-
var t =
|
14004
|
+
var t = Od();
|
14005
14005
|
function e() {
|
14006
14006
|
for (var a = {}, s = Object.keys(t), u = s.length, o = 0; o < u; o++)
|
14007
14007
|
a[s[o]] = {
|
@@ -14043,7 +14043,7 @@ var bo, uf;
|
|
14043
14043
|
function D0() {
|
14044
14044
|
if (uf) return bo;
|
14045
14045
|
uf = 1;
|
14046
|
-
var t =
|
14046
|
+
var t = Od(), e = I0(), n = {}, i = Object.keys(t);
|
14047
14047
|
function r(s) {
|
14048
14048
|
var u = function(o) {
|
14049
14049
|
return o == null ? o : (arguments.length > 1 && (o = Array.prototype.slice.call(arguments)), s(o));
|
@@ -14385,7 +14385,7 @@ function j0() {
|
|
14385
14385
|
}), Po;
|
14386
14386
|
}
|
14387
14387
|
var Co, mf;
|
14388
|
-
function
|
14388
|
+
function Ad() {
|
14389
14389
|
if (mf) return Co;
|
14390
14390
|
mf = 1;
|
14391
14391
|
var t = j0();
|
@@ -14403,7 +14403,7 @@ var Ro, gf;
|
|
14403
14403
|
function q0() {
|
14404
14404
|
if (gf) return Ro;
|
14405
14405
|
gf = 1;
|
14406
|
-
var t =
|
14406
|
+
var t = Ad();
|
14407
14407
|
return Ro = t(function() {
|
14408
14408
|
return localStorage.getItem("debug") || localStorage.getItem("diagnostics");
|
14409
14409
|
}), Ro;
|
@@ -14412,7 +14412,7 @@ var xo, vf;
|
|
14412
14412
|
function N0() {
|
14413
14413
|
if (vf) return xo;
|
14414
14414
|
vf = 1;
|
14415
|
-
var t =
|
14415
|
+
var t = Ad();
|
14416
14416
|
return xo = t(function() {
|
14417
14417
|
return /(debug|diagnostics)=([^&]+)/i.exec(window.location.hash)[2];
|
14418
14418
|
}), xo;
|
@@ -14430,7 +14430,7 @@ var Oo, bf;
|
|
14430
14430
|
function U0() {
|
14431
14431
|
if (bf) return Oo;
|
14432
14432
|
bf = 1;
|
14433
|
-
var t =
|
14433
|
+
var t = Td(), e = t(function n(i, r) {
|
14434
14434
|
return r = r || {}, r.namespace = i, r.prod = !1, r.dev = !0, !n.enabled(i) && !(r.force || n.force) ? n.nope(r) : n.yep(r);
|
14435
14435
|
});
|
14436
14436
|
return e.modify(F0()), e.use(q0()), e.use(N0()), e.set(H0()), Oo = e, Oo;
|
@@ -15223,7 +15223,7 @@ function V0() {
|
|
15223
15223
|
}(w), Io;
|
15224
15224
|
}
|
15225
15225
|
var Do, Pf;
|
15226
|
-
function
|
15226
|
+
function Ld() {
|
15227
15227
|
if (Pf) return Do;
|
15228
15228
|
Pf = 1;
|
15229
15229
|
const t = (e) => e !== null && typeof e == "object" && typeof e.pipe == "function";
|
@@ -15303,7 +15303,7 @@ function W0() {
|
|
15303
15303
|
return w.__proto__ = _, w;
|
15304
15304
|
}, g(p, b);
|
15305
15305
|
}
|
15306
|
-
var h =
|
15306
|
+
var h = Ld(), d = De(), m = d.MESSAGE, v = Sr, l = Ht();
|
15307
15307
|
return $o = /* @__PURE__ */ function(p) {
|
15308
15308
|
function b() {
|
15309
15309
|
var w, _ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
@@ -15360,7 +15360,7 @@ var Gr = {}, xf;
|
|
15360
15360
|
function Us() {
|
15361
15361
|
if (xf) return Gr;
|
15362
15362
|
xf = 1;
|
15363
|
-
var t =
|
15363
|
+
var t = vd(), e = De(), n = e.configs;
|
15364
15364
|
return Gr.cli = t.levels(n.cli), Gr.npm = t.levels(n.npm), Gr.syslog = t.levels(n.syslog), Gr.addColors = t.levels, Gr;
|
15365
15365
|
}
|
15366
15366
|
var Pn = { exports: {} }, Cn = { exports: {} }, Tf;
|
@@ -15369,7 +15369,7 @@ function K0() {
|
|
15369
15369
|
Object.defineProperty(e, "__esModule", {
|
15370
15370
|
value: !0
|
15371
15371
|
});
|
15372
|
-
var n = Ns(), i = v(n), r = Hs(), a = v(r), s =
|
15372
|
+
var n = Ns(), i = v(n), r = Hs(), a = v(r), s = Rd(), u = v(s), o = Pd(), c = v(o), f = Cd(), y = v(f), g = ht(), h = v(g), d = Ut(), m = v(d);
|
15373
15373
|
function v(w) {
|
15374
15374
|
return w && w.__esModule ? w : { default: w };
|
15375
15375
|
}
|
@@ -15437,7 +15437,7 @@ function Y0() {
|
|
15437
15437
|
}, Mo;
|
15438
15438
|
}
|
15439
15439
|
var ko, If;
|
15440
|
-
function
|
15440
|
+
function Id() {
|
15441
15441
|
if (If) return ko;
|
15442
15442
|
If = 1;
|
15443
15443
|
var t = Y0();
|
@@ -15450,7 +15450,7 @@ function Ld() {
|
|
15450
15450
|
}, ko;
|
15451
15451
|
}
|
15452
15452
|
var Fo = {}, Df;
|
15453
|
-
function
|
15453
|
+
function Dd() {
|
15454
15454
|
return Df || (Df = 1, function(t) {
|
15455
15455
|
t.get = function(r) {
|
15456
15456
|
var a = Error.stackTraceLimit;
|
@@ -15632,7 +15632,7 @@ function Q0() {
|
|
15632
15632
|
}(d), jo;
|
15633
15633
|
}
|
15634
15634
|
var qo, Mf;
|
15635
|
-
function
|
15635
|
+
function $d() {
|
15636
15636
|
if (Mf) return qo;
|
15637
15637
|
Mf = 1;
|
15638
15638
|
function t(g) {
|
@@ -15669,7 +15669,7 @@ function Dd() {
|
|
15669
15669
|
}
|
15670
15670
|
return String(g);
|
15671
15671
|
}
|
15672
|
-
var s = Sr, u = Bs(), o = mi()("winston:exception"), c =
|
15672
|
+
var s = Sr, u = Bs(), o = mi()("winston:exception"), c = Id(), f = Dd(), y = Q0();
|
15673
15673
|
return qo = /* @__PURE__ */ function() {
|
15674
15674
|
function g(h) {
|
15675
15675
|
if (e(this, g), !h)
|
@@ -15928,7 +15928,7 @@ function Z0() {
|
|
15928
15928
|
}(d), No;
|
15929
15929
|
}
|
15930
15930
|
var Ho, Ff;
|
15931
|
-
function
|
15931
|
+
function Md() {
|
15932
15932
|
if (Ff) return Ho;
|
15933
15933
|
Ff = 1;
|
15934
15934
|
function t(g) {
|
@@ -15965,7 +15965,7 @@ function $d() {
|
|
15965
15965
|
}
|
15966
15966
|
return String(g);
|
15967
15967
|
}
|
15968
|
-
var s = Sr, u = Bs(), o = mi()("winston:rejection"), c =
|
15968
|
+
var s = Sr, u = Bs(), o = mi()("winston:rejection"), c = Id(), f = Dd(), y = Z0();
|
15969
15969
|
return Ho = /* @__PURE__ */ function() {
|
15970
15970
|
function g(h) {
|
15971
15971
|
if (e(this, g), !h)
|
@@ -16408,7 +16408,7 @@ function zs() {
|
|
16408
16408
|
return H.__proto__ = F, H;
|
16409
16409
|
}, h(A, k);
|
16410
16410
|
}
|
16411
|
-
var d = dt(), m = d.Stream, v = d.Transform, l = Bs(), p = De(), b = p.LEVEL, w = p.SPLAT, _ =
|
16411
|
+
var d = dt(), m = d.Stream, v = d.Transform, l = Bs(), p = De(), b = p.LEVEL, w = p.SPLAT, _ = Ld(), D = $d(), O = Md(), x = eb(), C = rb(), R = yd(), P = R.warn, S = Us(), $ = /%[scdjifoO%]/g, E = /* @__PURE__ */ function(A) {
|
16412
16412
|
function k(H) {
|
16413
16413
|
var F;
|
16414
16414
|
return n(this, k), F = u(this, k, [{
|
@@ -16764,7 +16764,7 @@ function zs() {
|
|
16764
16764
|
}), Go = E, Go;
|
16765
16765
|
}
|
16766
16766
|
var Ko, zf;
|
16767
|
-
function
|
16767
|
+
function kd() {
|
16768
16768
|
if (zf) return Ko;
|
16769
16769
|
zf = 1;
|
16770
16770
|
function t(v) {
|
@@ -16889,7 +16889,7 @@ function ib() {
|
|
16889
16889
|
}
|
16890
16890
|
return String(u);
|
16891
16891
|
}
|
16892
|
-
var s =
|
16892
|
+
var s = kd();
|
16893
16893
|
return Jo = /* @__PURE__ */ function() {
|
16894
16894
|
function u() {
|
16895
16895
|
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
@@ -16981,8 +16981,8 @@ function ib() {
|
|
16981
16981
|
var Wf;
|
16982
16982
|
function ab() {
|
16983
16983
|
return Wf || (Wf = 1, function(t) {
|
16984
|
-
var e =
|
16985
|
-
t.version = s0.version, t.transports = G0(), t.config = Us(), t.addColors = e.levels, t.format = e.format, t.createLogger =
|
16984
|
+
var e = vd(), n = yd(), i = n.warn;
|
16985
|
+
t.version = s0.version, t.transports = G0(), t.config = Us(), t.addColors = e.levels, t.format = e.format, t.createLogger = kd(), t.Logger = zs(), t.ExceptionHandler = $d(), t.RejectionHandler = Md(), t.Container = ib(), t.Transport = Ht(), t.loggers = new t.Container();
|
16986
16986
|
var r = t.createLogger();
|
16987
16987
|
Object.keys(t.config.npm.levels).concat(["log", "query", "stream", "add", "remove", "clear", "profile", "startTimer", "handleExceptions", "unhandleExceptions", "handleRejections", "unhandleRejections", "configure", "child"]).forEach(function(a) {
|
16988
16988
|
return t[a] = function() {
|
@@ -17026,7 +17026,7 @@ function ab() {
|
|
17026
17026
|
var ob = ab();
|
17027
17027
|
const Kr = /* @__PURE__ */ ei(ob), Gf = Object.keys(J);
|
17028
17028
|
function Yn(t) {
|
17029
|
-
const e = me.join(fy || me.join(
|
17029
|
+
const e = me.join(fy || me.join(Lr(), ".cache"), "amp", "logs"), n = t?.logFile || me.join(e, "cli.log"), i = t?.logLevel || "info";
|
17030
17030
|
Gf.includes(i) || console.warn(`Invalid log level: ${i}. Using 'info' instead.`);
|
17031
17031
|
try {
|
17032
17032
|
ot.mkdirSync(me.dirname(n), { recursive: !0 });
|
@@ -17042,7 +17042,7 @@ function Yn(t) {
|
|
17042
17042
|
),
|
17043
17043
|
transports: [new Kr.transports.File({ filename: n })]
|
17044
17044
|
});
|
17045
|
-
|
17045
|
+
Mp({
|
17046
17046
|
error: r.error.bind(r),
|
17047
17047
|
warn: r.warn.bind(r),
|
17048
17048
|
info: r.info.bind(r),
|
@@ -17050,7 +17050,7 @@ function Yn(t) {
|
|
17050
17050
|
audit: (a, ...s) => r.info(a, { audit: !0, ...s[0] })
|
17051
17051
|
});
|
17052
17052
|
}
|
17053
|
-
const
|
17053
|
+
const Fd = {
|
17054
17054
|
url: {
|
17055
17055
|
value: "https://ampcode.com",
|
17056
17056
|
visible: !1,
|
@@ -17172,7 +17172,7 @@ const kd = {
|
|
17172
17172
|
description: "Custom hooks for extending Amp functionality"
|
17173
17173
|
}
|
17174
17174
|
}, sb = Object.fromEntries(
|
17175
|
-
Object.entries(
|
17175
|
+
Object.entries(Fd).filter(([, t]) => t.visible).map(([t, e]) => [`amp.${t}`, e.value])
|
17176
17176
|
), xn = {
|
17177
17177
|
examples: [
|
17178
17178
|
{
|
@@ -17191,7 +17191,7 @@ const kd = {
|
|
17191
17191
|
configuration: {
|
17192
17192
|
description: `Amp can be configured using a JSON settings file located at ${ct}. All settings use the "amp." prefix.`,
|
17193
17193
|
sampleConfig: JSON.stringify(sb, null, 2),
|
17194
|
-
keyDescriptions: Object.entries(
|
17194
|
+
keyDescriptions: Object.entries(Fd).filter(([, t]) => t.visible).map(([t, e]) => ({
|
17195
17195
|
key: `amp.${t}`,
|
17196
17196
|
description: e.description
|
17197
17197
|
}))
|
@@ -17388,9 +17388,9 @@ function cb(t, e) {
|
|
17388
17388
|
}
|
17389
17389
|
};
|
17390
17390
|
}
|
17391
|
-
const Yo = Ft(
|
17391
|
+
const Yo = Ft(Nr);
|
17392
17392
|
let Qn = null;
|
17393
|
-
async function fb(t =
|
17393
|
+
async function fb(t = $r, e) {
|
17394
17394
|
Qn = await hb(35789);
|
17395
17395
|
const n = `${Qn}`;
|
17396
17396
|
return J.info(`Generated callback port: ${n}`), `${t}/auth/cli-login?authToken=${encodeURIComponent(e)}&callbackPort=${encodeURIComponent(n)}`;
|
@@ -17401,7 +17401,7 @@ async function hb(t, e = 10) {
|
|
17401
17401
|
const i = t + n;
|
17402
17402
|
try {
|
17403
17403
|
return await new Promise((r, a) => {
|
17404
|
-
const s =
|
17404
|
+
const s = Ph();
|
17405
17405
|
s.once("error", (u) => {
|
17406
17406
|
u.code === "EADDRINUSE" ? a(new Error(`Port ${i} is in use`)) : a(u);
|
17407
17407
|
}), s.once("listening", () => {
|
@@ -17420,7 +17420,7 @@ async function db(t, e = 5 * 60 * 1e3) {
|
|
17420
17420
|
throw new Error("No port selected. Call generateLoginLink first.");
|
17421
17421
|
const n = Qn;
|
17422
17422
|
return J.info(`Using selected port: ${n}`), new Promise((i, r) => {
|
17423
|
-
const a =
|
17423
|
+
const a = Ph((u, o) => {
|
17424
17424
|
const c = process.env.NODE_ENV === "production" ? "ampcode.com" : "*";
|
17425
17425
|
if (o.setHeader("Access-Control-Allow-Origin", c), o.setHeader("Access-Control-Allow-Methods", "GET"), u.url?.startsWith("/auth/callback")) {
|
17426
17426
|
const f = new URL(u.url, `http://127.0.0.1:${n}`), y = f.searchParams.get("apiKey");
|
@@ -17472,7 +17472,7 @@ async function db(t, e = 5 * 60 * 1e3) {
|
|
17472
17472
|
});
|
17473
17473
|
});
|
17474
17474
|
}
|
17475
|
-
async function pb(t, e =
|
17475
|
+
async function pb(t, e = $r, n) {
|
17476
17476
|
await n.set("apiKey", t, e), J.info("API key stored successfully");
|
17477
17477
|
}
|
17478
17478
|
async function mb(t) {
|
@@ -17499,7 +17499,7 @@ function ys(t, e) {
|
|
17499
17499
|
function ie(t) {
|
17500
17500
|
return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
|
17501
17501
|
}
|
17502
|
-
const gb = Buffer.from([1]), vb = Buffer.from([2]),
|
17502
|
+
const gb = Buffer.from([1]), vb = Buffer.from([2]), jd = Buffer.from([3]), qd = Buffer.from([4]), yb = Buffer.from([5]), bb = Buffer.from([6]), wb = Buffer.from([8]), _b = Buffer.from([11]), Sb = Buffer.from([12]), Eb = Buffer.from([14]), Pb = Buffer.from([16]), Cb = Buffer.from([21]), Rb = Buffer.from([23]), xb = Buffer.from([25]), Tb = Buffer.from([7]), Ob = Buffer.from([15]), Ab = Buffer.from([17]), Lb = Buffer.from([18]), Ib = Buffer.from([19]), Db = Buffer.from([20]), $b = Buffer.from([22]), Mb = Buffer.from([24]), kb = Buffer.from([26]), Nd = Buffer.from([27]), Fb = Buffer.from([13]), jb = Buffer.from([10]), qb = Buffer.from([127]), Nb = Buffer.from([9]), Hb = Buffer.from([27, 91, 90]), Ub = Buffer.from([27, 91, 65]), Bb = Buffer.from([27, 91, 66]), zb = Buffer.from([27, 91, 67]), Vb = Buffer.from([27, 91, 68]), Wb = Buffer.from([27, 91, 49, 59, 50, 65]), Gb = Buffer.from([27, 91, 49, 59, 50, 66]), Kb = Buffer.from([27, 91, 49, 59, 50, 67]), Jb = Buffer.from([27, 91, 49, 59, 50, 68]), Yb = Buffer.from([27, 91, 53, 126]), Qb = Buffer.from([27, 91, 54, 126]), Zb = Buffer.from([27, 91, 72]), Xb = Buffer.from([27, 91, 70]), ew = Buffer.from([27, 91, 49, 126]), rw = Buffer.from([27, 91, 52, 126]), tw = Buffer.from([27, 91, 51, 126]), nw = Buffer.from([27, 102]), iw = Buffer.from([27, 98]), aw = Buffer.from([27, 100]), ow = Buffer.from([27, 127]), sw = Buffer.from([27, 91, 49, 59, 51, 65]), lw = Buffer.from([27, 91, 49, 59, 51, 66]), uw = Buffer.from([27, 91, 50, 55, 59, 50, 59, 49, 51, 126]), Hd = Buffer.from([27, 91, 50, 55, 59, 53, 59, 49, 51, 126]), Ud = Buffer.from([27, 91, 50, 55, 59, 56, 59, 49, 51, 126]), de = {
|
17503
17503
|
ESC: Buffer.from([27, 91, 50, 55, 117]),
|
17504
17504
|
// CSI 27 u (Escape key)
|
17505
17505
|
// Control keys
|
@@ -17589,7 +17589,7 @@ const gb = Buffer.from([1]), vb = Buffer.from([2]), Fd = Buffer.from([3]), jd =
|
|
17589
17589
|
process.stderr.write("\x1B[=0u"), process.stderr.write("\x1B[<u");
|
17590
17590
|
}
|
17591
17591
|
};
|
17592
|
-
async function
|
17592
|
+
async function Ur(t, e, { stdin: n, stdout: i } = { stdin: process.stdin, stdout: process.stdout }) {
|
17593
17593
|
return new Promise((r) => {
|
17594
17594
|
const a = e.map((c, f) => f === 0 ? c.toUpperCase() : c.toLowerCase()).join("/");
|
17595
17595
|
i.write(`${t} (${a}) `);
|
@@ -17633,7 +17633,7 @@ async function Hr(t, e, { stdin: n, stdout: i } = { stdin: process.stdin, stdout
|
|
17633
17633
|
n.on("data", u), n.once("error", o);
|
17634
17634
|
});
|
17635
17635
|
}
|
17636
|
-
const
|
17636
|
+
const Bd = import("./node-DZCyuAqY.js").then(
|
17637
17637
|
({ nodeFileSystem: t }) => t
|
17638
17638
|
), Qo = Ft(Zp.exec);
|
17639
17639
|
async function cw(t) {
|
@@ -17644,7 +17644,7 @@ async function cw(t) {
|
|
17644
17644
|
return e;
|
17645
17645
|
e.fsPath = t.fsPath;
|
17646
17646
|
try {
|
17647
|
-
if (!await
|
17647
|
+
if (!await Wp.access(Yp.join(t.fsPath, ".git")).then(() => !0).catch(() => !1))
|
17648
17648
|
return e;
|
17649
17649
|
const { stdout: i } = await Qo("git remote get-url origin", {
|
17650
17650
|
cwd: t.fsPath
|
@@ -17729,7 +17729,7 @@ function pw() {
|
|
17729
17729
|
clientType: t.type
|
17730
17730
|
};
|
17731
17731
|
}
|
17732
|
-
async function
|
17732
|
+
async function zd() {
|
17733
17733
|
return {
|
17734
17734
|
trees: await Promise.all([process.cwd()].map((t) => cw(di.file(t)))),
|
17735
17735
|
platform: pw(),
|
@@ -17764,10 +17764,10 @@ class mw {
|
|
17764
17764
|
configService: this.dependencies.configService,
|
17765
17765
|
threadService: this.dependencies.threadService,
|
17766
17766
|
toolService: this.dependencies.toolService,
|
17767
|
-
getThreadEnvironment:
|
17767
|
+
getThreadEnvironment: zd,
|
17768
17768
|
systemPromptService: this.dependencies.systemPromptService,
|
17769
17769
|
threadSummaryService: this.dependencies.threadSummaryService,
|
17770
|
-
createFileSystem: await
|
17770
|
+
createFileSystem: await Bd,
|
17771
17771
|
threadHistoryService: this.dependencies.threadHistoryService
|
17772
17772
|
},
|
17773
17773
|
e
|
@@ -17833,8 +17833,8 @@ class mw {
|
|
17833
17833
|
for (const i of n.content)
|
17834
17834
|
if (i.type === "tool_result") {
|
17835
17835
|
const r = jn(e, i.toolUseID);
|
17836
|
-
if (r?.name ===
|
17837
|
-
const a = "progress" in i.run ? i.run.progress : void 0, s =
|
17836
|
+
if (r?.name === kp && (i.run.status === "in-progress" || i.run.status === "done" || i.run.status === "cancelled")) {
|
17837
|
+
const a = "progress" in i.run ? i.run.progress : void 0, s = Fp(a);
|
17838
17838
|
s && this.trackSubthread(
|
17839
17839
|
s,
|
17840
17840
|
r.input?.description,
|
@@ -17863,7 +17863,7 @@ function gw(t) {
|
|
17863
17863
|
}
|
17864
17864
|
const vw = "Out of credits";
|
17865
17865
|
async function yw() {
|
17866
|
-
const t = me.join(process.cwd(),
|
17866
|
+
const t = me.join(process.cwd(), jp), e = me.join(process.cwd(), ".sourcegraph", "memory.md");
|
17867
17867
|
let n = !0, i = !1;
|
17868
17868
|
try {
|
17869
17869
|
await Or(e, "utf-8");
|
@@ -17872,10 +17872,10 @@ async function yw() {
|
|
17872
17872
|
} catch {
|
17873
17873
|
try {
|
17874
17874
|
await zn(me.dirname(t), { recursive: !0 });
|
17875
|
-
const
|
17876
|
-
await Tt(t,
|
17877
|
-
} catch (
|
17878
|
-
J.error("Failed to migrate memory.md to AGENT.md",
|
17875
|
+
const s = await Or(e, "utf-8");
|
17876
|
+
await Tt(t, s, "utf-8"), await Gp(e), n = !1, i = !0;
|
17877
|
+
} catch (s) {
|
17878
|
+
J.error("Failed to migrate memory.md to AGENT.md", s), n = !0;
|
17879
17879
|
}
|
17880
17880
|
}
|
17881
17881
|
} catch {
|
@@ -17885,16 +17885,27 @@ async function yw() {
|
|
17885
17885
|
n = !0;
|
17886
17886
|
}
|
17887
17887
|
}
|
17888
|
+
const r = await bw();
|
17888
17889
|
return {
|
17889
|
-
shouldGenerate: n,
|
17890
|
+
shouldGenerate: n && r,
|
17890
17891
|
migrated: i
|
17891
17892
|
};
|
17892
17893
|
}
|
17893
|
-
async function bw(
|
17894
|
+
async function bw() {
|
17895
|
+
const t = process.cwd(), e = Lr();
|
17896
|
+
if (t === e)
|
17897
|
+
return !1;
|
17898
|
+
try {
|
17899
|
+
return (await _h(t)).length > 0;
|
17900
|
+
} catch {
|
17901
|
+
return !1;
|
17902
|
+
}
|
17903
|
+
}
|
17904
|
+
async function ww(t) {
|
17894
17905
|
await t.handle({
|
17895
17906
|
type: "user:message",
|
17896
17907
|
message: {
|
17897
|
-
content: [{ type: "text", text:
|
17908
|
+
content: [{ type: "text", text: qp }]
|
17898
17909
|
}
|
17899
17910
|
});
|
17900
17911
|
}
|
@@ -17909,7 +17920,7 @@ function Vs(t, e) {
|
|
17909
17920
|
}), r;
|
17910
17921
|
};
|
17911
17922
|
}
|
17912
|
-
async function
|
17923
|
+
async function _w(t) {
|
17913
17924
|
try {
|
17914
17925
|
const e = new AbortController(), n = setTimeout(() => e.abort(), 500), i = await fetch("https://registry.npmjs.org/@sourcegraph/amp/latest", {
|
17915
17926
|
signal: e.signal
|
@@ -17919,7 +17930,7 @@ async function ww(t) {
|
|
17919
17930
|
const a = (await i.json()).version;
|
17920
17931
|
if (a === void 0)
|
17921
17932
|
return { hasUpdate: !1 };
|
17922
|
-
const s =
|
17933
|
+
const s = Sw(t, a), u = s < 0;
|
17923
17934
|
return J.info("Version comparison", {
|
17924
17935
|
currentVersion: t,
|
17925
17936
|
latestVersion: a,
|
@@ -17930,7 +17941,7 @@ async function ww(t) {
|
|
17930
17941
|
return { hasUpdate: !1 };
|
17931
17942
|
}
|
17932
17943
|
}
|
17933
|
-
function
|
17944
|
+
function Sw(t, e) {
|
17934
17945
|
const n = (s) => {
|
17935
17946
|
const [u, o] = s.split("-");
|
17936
17947
|
return { parts: u?.split(".").map(Number) || [], label: o };
|
@@ -17942,7 +17953,7 @@ function _w(t, e) {
|
|
17942
17953
|
}
|
17943
17954
|
return i.label === r.label ? 0 : !i.label && r.label ? 1 : i.label && !r.label ? -1 : i.label && r.label ? i.label < r.label ? -1 : 1 : 0;
|
17944
17955
|
}
|
17945
|
-
async function
|
17956
|
+
async function Ew() {
|
17946
17957
|
try {
|
17947
17958
|
const t = process.argv[1] || "";
|
17948
17959
|
J.debug("Detecting package manager from script path", { currentScript: t });
|
@@ -17973,7 +17984,7 @@ async function Sw() {
|
|
17973
17984
|
for (const { file: a, manager: s } of i)
|
17974
17985
|
try {
|
17975
17986
|
const u = ze(n, a);
|
17976
|
-
return J.debug("Checking for lockfile", { filePath: u }), await
|
17987
|
+
return J.debug("Checking for lockfile", { filePath: u }), await Sh(u), J.debug("Found package manager lockfile", { file: a, manager: s, filePath: u }), s;
|
17977
17988
|
} catch (u) {
|
17978
17989
|
J.debug("Lockfile not found", {
|
17979
17990
|
file: a,
|
@@ -17981,13 +17992,13 @@ async function Sw() {
|
|
17981
17992
|
});
|
17982
17993
|
}
|
17983
17994
|
J.debug("No lockfiles found, falling back to environment-based detection");
|
17984
|
-
const r = await
|
17995
|
+
const r = await Vd();
|
17985
17996
|
return J.debug("Environment-based detection result", { envDetected: r }), r;
|
17986
17997
|
} catch (t) {
|
17987
17998
|
return J.debug("Error detecting installed package manager", { error: t }), null;
|
17988
17999
|
}
|
17989
18000
|
}
|
17990
|
-
async function
|
18001
|
+
async function Vd() {
|
17991
18002
|
const t = process.env.npm_config_user_agent;
|
17992
18003
|
if (t) {
|
17993
18004
|
if (t.includes("pnpm")) return "pnpm";
|
@@ -18025,7 +18036,7 @@ async function Tn(t) {
|
|
18025
18036
|
}
|
18026
18037
|
});
|
18027
18038
|
}
|
18028
|
-
function
|
18039
|
+
function Pw(t, e) {
|
18029
18040
|
const n = e ? `@sourcegraph/amp@${e}` : "@sourcegraph/amp";
|
18030
18041
|
switch (t) {
|
18031
18042
|
case "pnpm":
|
@@ -18039,10 +18050,10 @@ function Ew(t, e) {
|
|
18039
18050
|
return ["npm", ["install", "-g", n]];
|
18040
18051
|
}
|
18041
18052
|
}
|
18042
|
-
async function
|
18043
|
-
let e = await
|
18044
|
-
e || (e = await
|
18045
|
-
const [n, i] =
|
18053
|
+
async function Cw(t) {
|
18054
|
+
let e = await Ew();
|
18055
|
+
e || (e = await Vd()), e || (e = "npm", J.debug("Falling back to npm for update")), J.debug("Using package manager for update", { packageManager: e, targetVersion: t });
|
18056
|
+
const [n, i] = Pw(e, t);
|
18046
18057
|
return new Promise((r, a) => {
|
18047
18058
|
const s = process.env.HOME || process.env.USERPROFILE || "/", u = process.env.SHELL || "/bin/sh", o = `${n} ${i.join(" ")}`, c = `env -i ${u} -l -c 'cd ${s} && ${o}'`;
|
18048
18059
|
J.debug("Running update command", { packageManager: e, command: n, args: i, fullCommand: c });
|
@@ -18070,7 +18081,7 @@ ${d}`)
|
|
18070
18081
|
});
|
18071
18082
|
});
|
18072
18083
|
}
|
18073
|
-
async function
|
18084
|
+
async function Rw({
|
18074
18085
|
threadSyncService: t,
|
18075
18086
|
configService: e,
|
18076
18087
|
threadService: n,
|
@@ -18094,10 +18105,10 @@ async function Cw({
|
|
18094
18105
|
configService: e,
|
18095
18106
|
threadService: n,
|
18096
18107
|
toolService: f,
|
18097
|
-
getThreadEnvironment:
|
18108
|
+
getThreadEnvironment: zd,
|
18098
18109
|
systemPromptService: y,
|
18099
18110
|
threadSummaryService: u,
|
18100
|
-
createFileSystem: await
|
18111
|
+
createFileSystem: await Bd,
|
18101
18112
|
threadHistoryService: i
|
18102
18113
|
},
|
18103
18114
|
h
|
@@ -18725,7 +18736,7 @@ async function Cw({
|
|
18725
18736
|
displayedError: null
|
18726
18737
|
};
|
18727
18738
|
} else if (I.input.confirmation.type === "agent-file-creation" && E.type === "confirming-agent-file-creation")
|
18728
|
-
return I.input.allow ? (
|
18739
|
+
return I.input.allow ? (ww(b).catch((F) => {
|
18729
18740
|
J.error("Agent file generation failed", F);
|
18730
18741
|
}), O.next({
|
18731
18742
|
type: "state",
|
@@ -18770,16 +18781,16 @@ async function Cw({
|
|
18770
18781
|
type: "thread-state",
|
18771
18782
|
thread: E
|
18772
18783
|
}));
|
18773
|
-
}, 0),
|
18784
|
+
}, 0), xw(D).catch((E) => {
|
18774
18785
|
J.debug("Update check startup failed", E);
|
18775
18786
|
}), await We(P);
|
18776
18787
|
}
|
18777
|
-
async function
|
18788
|
+
async function xw(t) {
|
18778
18789
|
try {
|
18779
|
-
const e = await
|
18790
|
+
const e = await _w("0.0.1749211345-g16cdfc");
|
18780
18791
|
e.hasUpdate && e.latestVersion ? (t.next({ type: "update-start-updating" }), setTimeout(async () => {
|
18781
18792
|
try {
|
18782
|
-
await
|
18793
|
+
await Cw(e.latestVersion), t.next({
|
18783
18794
|
type: "update-result",
|
18784
18795
|
success: !0,
|
18785
18796
|
version: e.latestVersion
|
@@ -18801,7 +18812,7 @@ const Xo = {
|
|
18801
18812
|
SEVERE: 0.9,
|
18802
18813
|
CRITICAL: 0.98
|
18803
18814
|
};
|
18804
|
-
function
|
18815
|
+
function Tw(t) {
|
18805
18816
|
const { stdout: e, threadID: n, pipedInput: i } = t;
|
18806
18817
|
function r(a) {
|
18807
18818
|
e.write(JSON.stringify(a) + `
|
@@ -18814,7 +18825,7 @@ function xw(t) {
|
|
18814
18825
|
return J.debug("setting up JSONL UI"), a.pipe(
|
18815
18826
|
gh({
|
18816
18827
|
onSubscribe: () => {
|
18817
|
-
r({ type: "initial", threadID: n }),
|
18828
|
+
r({ type: "initial", threadID: n }), Xh().then(() => {
|
18818
18829
|
s.next({ type: "initialized" });
|
18819
18830
|
});
|
18820
18831
|
},
|
@@ -19044,22 +19055,22 @@ function xw(t) {
|
|
19044
19055
|
}
|
19045
19056
|
function Yf(t = "idle") {
|
19046
19057
|
try {
|
19047
|
-
t === "idle" ? process.platform === "darwin" ?
|
19058
|
+
t === "idle" ? process.platform === "darwin" ? Nr("afplay /System/Library/Sounds/Submarine.aiff") : process.platform === "win32" ? Nr("powershell [console]::beep(800,200)") : process.platform === "linux" && Nr("paplay /usr/share/sounds/freedesktop/stereo/message.oga || beep") : t === "requires-user-input" && (process.platform === "darwin" ? Nr("afplay /System/Library/Sounds/Ping.aiff") : process.platform === "win32" ? Nr("powershell [console]::beep(1000,300)") : process.platform === "linux" && Nr(
|
19048
19059
|
"paplay /usr/share/sounds/freedesktop/stereo/dialog-information.oga || beep -f 1000 -l 100"
|
19049
19060
|
));
|
19050
19061
|
} catch (e) {
|
19051
19062
|
J.error(`Failed to play notification sound (${t}):`, e);
|
19052
19063
|
}
|
19053
19064
|
}
|
19054
|
-
const
|
19055
|
-
class
|
19065
|
+
const Ow = me.join(Gn || me.join(Lr(), ".local/share"), "amp"), Aw = me.join(Ow, "history.jsonl"), Lw = 1e3;
|
19066
|
+
class Iw {
|
19056
19067
|
history = [];
|
19057
19068
|
index = -1;
|
19058
19069
|
loaded = !1;
|
19059
19070
|
historyFile;
|
19060
19071
|
maxSize;
|
19061
19072
|
constructor(e) {
|
19062
|
-
this.historyFile = e?.historyFile ||
|
19073
|
+
this.historyFile = e?.historyFile || Aw, this.maxSize = e?.maxSize || Lw, this.ensureLoaded();
|
19063
19074
|
}
|
19064
19075
|
async ensureLoaded() {
|
19065
19076
|
this.loaded || (this.history = await this.readHistoryFromDisk(), this.loaded = !0);
|
@@ -19189,7 +19200,7 @@ class Lw {
|
|
19189
19200
|
}
|
19190
19201
|
}
|
19191
19202
|
var On = { exports: {} }, Qf;
|
19192
|
-
function
|
19203
|
+
function Dw() {
|
19193
19204
|
if (Qf) return On.exports;
|
19194
19205
|
Qf = 1;
|
19195
19206
|
const t = 55296, e = 56319, n = 56320, i = 127462, r = 127487, a = 127995, s = 127999, u = 65024, o = 65039, c = 8400, f = 8447, y = 8205, g = [
|
@@ -19286,9 +19297,9 @@ function Iw() {
|
|
19286
19297
|
}
|
19287
19298
|
return On.exports = h, On.exports.substr = x, On.exports;
|
19288
19299
|
}
|
19289
|
-
var
|
19290
|
-
const se = /* @__PURE__ */ ei(
|
19291
|
-
class
|
19300
|
+
var $w = Dw();
|
19301
|
+
const se = /* @__PURE__ */ ei($w);
|
19302
|
+
class Mw {
|
19292
19303
|
constructor(e, n, i, r, a = n) {
|
19293
19304
|
this.stdout = e, this.stderr = n, this.printer = i, this.prompt = r, this.writer = a;
|
19294
19305
|
}
|
@@ -19343,7 +19354,7 @@ class $w {
|
|
19343
19354
|
const i = se.substr(n, 0, e.cursorColumn);
|
19344
19355
|
return {
|
19345
19356
|
line: e.cursorLine,
|
19346
|
-
column: this.prompt.length +
|
19357
|
+
column: this.prompt.length + qr(i)
|
19347
19358
|
};
|
19348
19359
|
}
|
19349
19360
|
renderClearScreen(e) {
|
@@ -19414,15 +19425,15 @@ class $w {
|
|
19414
19425
|
const s = e.screenColumns;
|
19415
19426
|
let u = e.status.right;
|
19416
19427
|
if (u && u.length > 0) {
|
19417
|
-
if (
|
19418
|
-
if (
|
19428
|
+
if (qr(a) + qr(u) + 2 > s)
|
19429
|
+
if (qr(u) >= s)
|
19419
19430
|
u = u.slice(0, s - 3) + "...", a = "";
|
19420
19431
|
else {
|
19421
|
-
const y = s -
|
19432
|
+
const y = s - qr(u) - 2;
|
19422
19433
|
y > 3 ? a = a.slice(0, y - 3) + "..." : a = "";
|
19423
19434
|
}
|
19424
19435
|
this.writeText(a);
|
19425
|
-
const c =
|
19436
|
+
const c = qr(u), f = s - c + 1;
|
19426
19437
|
this.moveCursorToAbsoluteColumn(f), this.resetColors(), this.writeText(u);
|
19427
19438
|
} else
|
19428
19439
|
this.writeText(a);
|
@@ -19437,7 +19448,7 @@ class $w {
|
|
19437
19448
|
let u = 0;
|
19438
19449
|
const o = [];
|
19439
19450
|
for (const y of a)
|
19440
|
-
u += s.length +
|
19451
|
+
u += s.length + qr(y), u <= e && o.push(y);
|
19441
19452
|
const [c, ...f] = o;
|
19442
19453
|
return c ? [
|
19443
19454
|
n.print(c, { foreground: "blue" }),
|
@@ -19512,13 +19523,13 @@ class $w {
|
|
19512
19523
|
return e;
|
19513
19524
|
}
|
19514
19525
|
}
|
19515
|
-
function
|
19516
|
-
const a = new
|
19526
|
+
function kw(t, e, n, i, r = "> ") {
|
19527
|
+
const a = new Mw(t, e, i, r);
|
19517
19528
|
n.subscribe((s) => {
|
19518
19529
|
a.render(s);
|
19519
19530
|
});
|
19520
19531
|
}
|
19521
|
-
function
|
19532
|
+
function Fw(t, e, n) {
|
19522
19533
|
return bs(t, e, n, 0);
|
19523
19534
|
}
|
19524
19535
|
function bs(t, e, n, i) {
|
@@ -19616,13 +19627,13 @@ function th(t, e) {
|
|
19616
19627
|
t.deletedText.unshift(i), t.deletedText.length > 10 && t.deletedText.pop(), t.lines[t.cursorLine] = se.substr(n, 0, t.cursorColumn);
|
19617
19628
|
}
|
19618
19629
|
}
|
19619
|
-
function
|
19630
|
+
function Wd(t, e) {
|
19620
19631
|
const i = se.substr(t, 0, e).match(/\S+\s*$/);
|
19621
19632
|
if (!i) return 0;
|
19622
19633
|
const r = se(i[0]).length;
|
19623
19634
|
return e - r;
|
19624
19635
|
}
|
19625
|
-
function
|
19636
|
+
function Gd(t, e) {
|
19626
19637
|
const i = se.substr(t, e).match(/^\s*\S+/);
|
19627
19638
|
if (!i) return se(t).length;
|
19628
19639
|
const r = se(i[0]).length;
|
@@ -19631,7 +19642,7 @@ function Wd(t, e) {
|
|
19631
19642
|
function $n(t, e) {
|
19632
19643
|
const i = t.screenColumns - 2 - 1;
|
19633
19644
|
if (t.cursorColumn > 0) {
|
19634
|
-
const r = t.lines[t.cursorLine] || "", a = se.substr(r, 0, t.cursorColumn), s =
|
19645
|
+
const r = t.lines[t.cursorLine] || "", a = se.substr(r, 0, t.cursorColumn), s = Wd(a, se(a).length), u = se.substr(a, s);
|
19635
19646
|
t.deletedText.unshift(u), t.deletedText.length > 10 && t.deletedText.pop();
|
19636
19647
|
const o = se.substr(r, t.cursorColumn);
|
19637
19648
|
t.lines[t.cursorLine] = se.substr(a, 0, s) + o, t.cursorColumn = s;
|
@@ -19646,7 +19657,7 @@ function $n(t, e) {
|
|
19646
19657
|
function nh(t, e) {
|
19647
19658
|
const n = t.lines[t.cursorLine] || "";
|
19648
19659
|
if (t.cursorColumn < se(n).length) {
|
19649
|
-
const i =
|
19660
|
+
const i = Gd(n, t.cursorColumn), r = se.substr(
|
19650
19661
|
n,
|
19651
19662
|
t.cursorColumn,
|
19652
19663
|
i - t.cursorColumn
|
@@ -19687,14 +19698,14 @@ function It(t, e) {
|
|
19687
19698
|
function ah(t, e) {
|
19688
19699
|
const n = t.lines[t.cursorLine] || "";
|
19689
19700
|
if (t.cursorColumn < se(n).length) {
|
19690
|
-
const i =
|
19701
|
+
const i = Gd(n, t.cursorColumn);
|
19691
19702
|
t.cursorColumn = i;
|
19692
19703
|
} else t.cursorLine < t.lines.length - 1 && (t.cursorLine++, t.cursorColumn = 0);
|
19693
19704
|
}
|
19694
19705
|
function oh(t, e) {
|
19695
19706
|
const n = t.lines[t.cursorLine] || "";
|
19696
19707
|
if (t.cursorColumn > 0) {
|
19697
|
-
const i =
|
19708
|
+
const i = Wd(n, t.cursorColumn);
|
19698
19709
|
t.cursorColumn = i;
|
19699
19710
|
} else t.cursorLine > 0 && (t.cursorLine--, t.cursorColumn = se(t.lines[t.cursorLine] || "").length);
|
19700
19711
|
}
|
@@ -19744,7 +19755,7 @@ function lt(t, e) {
|
|
19744
19755
|
`);
|
19745
19756
|
t.lines = n, t.cursorLine = 0, t.cursorColumn = n.length > 0 ? se(n[0]?.trimEnd() || "").length : 0;
|
19746
19757
|
}
|
19747
|
-
function
|
19758
|
+
function jw(t, e, n) {
|
19748
19759
|
const i = t.lines[t.cursorLine] || "", r = se.substr(i, 0, t.cursorColumn), a = se.substr(i, t.cursorColumn), u = t.screenColumns - 2 - 1, o = r.length + e.length + a.length;
|
19749
19760
|
if (a.length === 0 && r.length === u && e === " ") {
|
19750
19761
|
t.lines.splice(t.cursorLine + 1, 0, ""), t.cursorLine++, t.lines[t.cursorLine] = "", t.cursorColumn = 0, t.lastChar = e;
|
@@ -19761,7 +19772,7 @@ function Fw(t, e, n) {
|
|
19761
19772
|
else {
|
19762
19773
|
const f = t.lines.slice();
|
19763
19774
|
f[t.cursorLine] = r + e + a;
|
19764
|
-
const { lines: y, cursor: g } =
|
19775
|
+
const { lines: y, cursor: g } = Fw(f, u, {
|
19765
19776
|
line: t.cursorLine,
|
19766
19777
|
column: t.cursorColumn
|
19767
19778
|
});
|
@@ -19784,7 +19795,7 @@ function gi(t) {
|
|
19784
19795
|
wordEndPos: f
|
19785
19796
|
};
|
19786
19797
|
}
|
19787
|
-
function
|
19798
|
+
function qw(t, e) {
|
19788
19799
|
gi(t) && t.completions.length > 0 && e({ type: "cycle-completion", direction: "forward" });
|
19789
19800
|
}
|
19790
19801
|
function sh(t, e) {
|
@@ -19809,7 +19820,7 @@ function uh(t, e, n) {
|
|
19809
19820
|
const i = n.next();
|
19810
19821
|
i !== null ? lt(t, i) : t.currentHistoryContent !== null ? (lt(t, t.currentHistoryContent), t.isNavigatingHistory = !1, t.currentHistoryContent = null, n.reset()) : e({ type: "alert" });
|
19811
19822
|
}
|
19812
|
-
function
|
19823
|
+
function Nw({
|
19813
19824
|
state: t,
|
19814
19825
|
trigger: e,
|
19815
19826
|
history: n,
|
@@ -19819,13 +19830,13 @@ function qw({
|
|
19819
19830
|
}, s = (o) => (c, f) => {
|
19820
19831
|
o(c, f, n);
|
19821
19832
|
};
|
19822
|
-
r[ie(Fb)] = s(kn), r[ie(
|
19833
|
+
r[ie(Fb)] = s(kn), r[ie(Hd)] = s(kn), r[ie(de.CTRL_ENTER)] = s(kn), r[ie(Ud)] = s(kn), r[ie(gb)] = Xf, r[ie(de.CTRL_A)] = Xf, r[ie(yb)] = eh, r[ie(de.CTRL_E)] = eh, r[ie(Ub)] = s(An), r[ie(Pb)] = s(An), r[ie(de.CTRL_P)] = s(An), r[ie(Bb)] = s(Ln), r[ie(Eb)] = s(Ln), r[ie(de.CTRL_N)] = s(Ln), r[ie(zb)] = In, r[ie(bb)] = In, r[ie(de.CTRL_F)] = In, r[ie(Vb)] = Dn, r[ie(vb)] = Dn, r[ie(de.CTRL_B)] = Dn, r[ie(qb)] = xt, r[ie(wb)] = xt, r[ie(de.CTRL_H)] = xt, r[ie(de.SHIFT_BACKSPACE)] = xt, r[ie(Cb)] = rh, r[ie(de.CTRL_U)] = rh, r[ie(_b)] = th, r[ie(de.CTRL_K)] = th, r[ie(Rb)] = $n, r[ie(de.CTRL_W)] = $n, r[ie(ow)] = $n, r[ie(de.ALT_BACKSPACE)] = $n, r[ie(xb)] = ih, r[ie(de.CTRL_Y)] = ih, r[ie(Sb)] = Zf, r[ie(de.CTRL_L)] = Zf, r[ie(uw)] = It, r[ie(de.SHIFT_ENTER)] = It, r[ie(jb)] = It, n && (r[ie(Yb)] = s(lh), r[ie(Qb)] = s(uh), r[ie(de.PAGE_UP)] = s(lh), r[ie(de.PAGE_DOWN)] = s(uh)), r[ie(Zb)] = es, r[ie(ew)] = es, r[ie(de.HOME)] = es, r[ie(Xb)] = rs, r[ie(rw)] = rs, r[ie(de.END)] = rs, r[ie(nw)] = ah, r[ie(de.ALT_F)] = ah, r[ie(iw)] = oh, r[ie(de.ALT_B)] = oh, r[ie(qd)] = Mn, r[ie(de.CTRL_D)] = Mn, r[ie(aw)] = nh, r[ie(de.ALT_D)] = nh, r[ie(tw)] = Mn, r[ie(de.DEL)] = Mn, r[ie(Nb)] = qw, r[ie(Hb)] = sh, r[ie(de.SHIFT_TAB)] = sh, r[ie(Tb)] = a, r[ie(de.CTRL_G)] = a, r[ie(Ob)] = a, r[ie(de.CTRL_O)] = a, r[ie(Ab)] = a, r[ie(de.CTRL_Q)] = a, r[ie(Lb)] = a, r[ie(de.CTRL_R)] = a, r[ie(Ib)] = a, r[ie(de.CTRL_S)] = a, r[ie(Db)] = a, r[ie(de.CTRL_T)] = a, r[ie($b)] = a, r[ie(de.CTRL_V)] = a, r[ie(Mb)] = a, r[ie(de.CTRL_X)] = a, r[ie(kb)] = a, r[ie(de.CTRL_Z)] = a, r[ie(Wb)] = An, r[ie(Gb)] = Ln, r[ie(Jb)] = Dn, r[ie(Kb)] = In, r[ie(sw)] = a, r[ie(lw)] = a, r[ie(de.ALT_ARROW_UP)] = a, r[ie(de.ALT_ARROW_DOWN)] = a;
|
19823
19834
|
function u(o) {
|
19824
19835
|
if (o.length === 0) return o;
|
19825
19836
|
for (const [h, d] of Object.entries(r)) {
|
19826
19837
|
const m = Buffer.from(h, "hex");
|
19827
19838
|
if (ys(m, o))
|
19828
|
-
return d(t, e, n), t.state === "message" &&
|
19839
|
+
return d(t, e, n), t.state === "message" && Kd(t, i), t.lastChar = null, Buffer.from(Uint8Array.prototype.slice.call(o, m.length));
|
19829
19840
|
}
|
19830
19841
|
if (o.length >= 3 && o[0] === 27 && o[1] === 91) {
|
19831
19842
|
for (let h = 2; h < o.length; h++)
|
@@ -19836,11 +19847,11 @@ function qw({
|
|
19836
19847
|
const f = o[0];
|
19837
19848
|
(f & 224) === 192 ? c = 2 : (f & 240) === 224 ? c = 3 : (f & 248) === 240 && (c = 4);
|
19838
19849
|
const g = Buffer.from(Uint8Array.prototype.slice.call(o, 0, c)).toString("utf8");
|
19839
|
-
return
|
19850
|
+
return jw(t, g, e), t.status.left = "", Buffer.from(Uint8Array.prototype.slice.call(o, c));
|
19840
19851
|
}
|
19841
19852
|
return { process: u };
|
19842
19853
|
}
|
19843
|
-
function
|
19854
|
+
function Hw(t, e, n, i) {
|
19844
19855
|
const r = e.columns || 80, a = e.rows || 24, s = {
|
19845
19856
|
lines: [""],
|
19846
19857
|
cursorLine: 0,
|
@@ -19870,7 +19881,7 @@ function Nw(t, e, n, i) {
|
|
19870
19881
|
function y(d) {
|
19871
19882
|
s.state = d, f.next({ type: "line-editor-state", state: d });
|
19872
19883
|
}
|
19873
|
-
const g =
|
19884
|
+
const g = Nw({
|
19874
19885
|
state: s,
|
19875
19886
|
trigger: (d) => c.next(d),
|
19876
19887
|
history: i,
|
@@ -19903,18 +19914,18 @@ function Nw(t, e, n, i) {
|
|
19903
19914
|
let m = d.data;
|
19904
19915
|
if (s.state === "off" || s.state === "submitting" || m.length === 0)
|
19905
19916
|
return s;
|
19906
|
-
const v = d.data.length > 1 && !d.data.equals(
|
19917
|
+
const v = d.data.length > 1 && !d.data.equals(Hd) && !d.data.equals(de.CTRL_ENTER) && !d.data.equals(Ud);
|
19907
19918
|
for (s.isProcessingPaste = v; m.length > 0; ) {
|
19908
|
-
if ((m.equals(
|
19919
|
+
if ((m.equals(qd) || m.equals(de.CTRL_D)) && s.lines.length === 1 && s.lines[0] === "")
|
19909
19920
|
return s.lines = [""], s.cursorLine = 0, s.cursorColumn = 0, s.status.left = "", s.lastCompletionQuery = null, y("closed"), f.next({ type: "exit" }), s;
|
19910
|
-
if (m.equals(
|
19921
|
+
if (m.equals(Nd) || m.equals(de.ESC) || m.equals(jd) || m.equals(de.CTRL_C)) {
|
19911
19922
|
s.lines.length === 1 && s.lines[0] === "" ? s.status.left = "Press Ctrl+D to exit" : s.isNavigatingHistory && s.currentHistoryContent !== null ? (s.lines = s.currentHistoryContent.split(`
|
19912
19923
|
`), s.isNavigatingHistory = !1, s.currentHistoryContent = null, i && i.reset()) : (s.lines = [""], s.cursorLine = 0, s.cursorColumn = 0, s.status.left = "", s.lastCompletionQuery = null);
|
19913
19924
|
break;
|
19914
19925
|
}
|
19915
19926
|
m = g.process(m);
|
19916
19927
|
}
|
19917
|
-
return s.isProcessingPaste = !1,
|
19928
|
+
return s.isProcessingPaste = !1, Kd(s, (l) => {
|
19918
19929
|
n(l).then((p) => {
|
19919
19930
|
c.next({ type: "complete", candidates: p });
|
19920
19931
|
}).catch(() => {
|
@@ -19932,18 +19943,18 @@ function Nw(t, e, n, i) {
|
|
19932
19943
|
observable: f
|
19933
19944
|
};
|
19934
19945
|
}
|
19935
|
-
function
|
19946
|
+
function Kd(t, e) {
|
19936
19947
|
const n = gi(t);
|
19937
19948
|
n !== null ? t.lastCompletionQuery !== n.replacement && (t.lastCompletionQuery = n.replacement, e(n.replacement)) : (t.completions = [], t.lastCompletionQuery = null);
|
19938
19949
|
}
|
19939
|
-
function
|
19940
|
-
const e = t.stdin || process.stdin, n = t.stdout || process.stdout, i = t.stderr || process.stderr, r = t.history, a = t.prompt || "> ", s = t.printer, { state$: u, trigger: o, observable: c } =
|
19950
|
+
function Uw(t) {
|
19951
|
+
const e = t.stdin || process.stdin, n = t.stdout || process.stdout, i = t.stderr || process.stderr, r = t.history, a = t.prompt || "> ", s = t.printer, { state$: u, trigger: o, observable: c } = Hw(
|
19941
19952
|
e,
|
19942
19953
|
n,
|
19943
19954
|
t.complete,
|
19944
19955
|
r
|
19945
19956
|
);
|
19946
|
-
|
19957
|
+
kw(n, i, u, s, a);
|
19947
19958
|
let f = null;
|
19948
19959
|
const y = u.subscribe((g) => {
|
19949
19960
|
f = g;
|
@@ -19996,7 +20007,7 @@ function Hw(t) {
|
|
19996
20007
|
})
|
19997
20008
|
};
|
19998
20009
|
}
|
19999
|
-
function
|
20010
|
+
function Bw(t) {
|
20000
20011
|
const { stdout: e, stderr: n, printer: i, threadID: r, interactive: a, ampURL: s, useNotifications: u, pipedInput: o } = t;
|
20001
20012
|
return (c) => {
|
20002
20013
|
const f = new Je();
|
@@ -20013,18 +20024,18 @@ Interrupt the agent with `, { foreground: "gray" })}${i.print("Ctrl+C", { foregr
|
|
20013
20024
|
return J.error("Completion failed", p), [];
|
20014
20025
|
}
|
20015
20026
|
}
|
20016
|
-
const g = a ? new
|
20027
|
+
const g = a ? new Iw() : void 0, h = a ? Uw({
|
20017
20028
|
prompt: "> ",
|
20018
20029
|
complete: y,
|
20019
20030
|
printer: i,
|
20020
20031
|
history: g
|
20021
|
-
}) : null, d = h ? h.observable : je.of(), m =
|
20032
|
+
}) : null, d = h ? h.observable : je.of(), m = Np(200).pipe(
|
20022
20033
|
Ee((l) => ({
|
20023
20034
|
type: "tick",
|
20024
20035
|
number: l
|
20025
20036
|
}))
|
20026
20037
|
), v = is(process.stdin, "data").pipe(
|
20027
|
-
kt((l) => l.equals(
|
20038
|
+
kt((l) => l.equals(Nd) || l.equals(jd) || l.equals(de.CTRL_C)),
|
20028
20039
|
Ee(() => ({ type: "interrupt" }))
|
20029
20040
|
);
|
20030
20041
|
return Mt(c, m, v, d).pipe(
|
@@ -20161,14 +20172,14 @@ Interrupt the agent with `, { foreground: "gray" })}${i.print("Ctrl+C", { foregr
|
|
20161
20172
|
case "initializing":
|
20162
20173
|
return a ? l : (f.next({ type: "initialized" }), { ...l, type: "awaiting-agent" });
|
20163
20174
|
case "awaiting-agent":
|
20164
|
-
return
|
20175
|
+
return zw(
|
20165
20176
|
t,
|
20166
20177
|
p.number,
|
20167
20178
|
l.statusMessage,
|
20168
20179
|
l.tokenUsage ?? void 0
|
20169
20180
|
), l;
|
20170
20181
|
case "accepting-message": {
|
20171
|
-
const b =
|
20182
|
+
const b = Vw(l, i);
|
20172
20183
|
return h?.setRightStatus(b), l;
|
20173
20184
|
}
|
20174
20185
|
default:
|
@@ -20209,7 +20220,7 @@ Interrupt the agent with `, { foreground: "gray" })}${i.print("Ctrl+C", { foregr
|
|
20209
20220
|
`);
|
20210
20221
|
break;
|
20211
20222
|
}
|
20212
|
-
return
|
20223
|
+
return Ur("Retry?", ["y", "n"]).then((b) => {
|
20213
20224
|
e.write(`
|
20214
20225
|
`), f.next({
|
20215
20226
|
type: "retry"
|
@@ -20225,8 +20236,8 @@ Interrupt the agent with `, { foreground: "gray" })}${i.print("Ctrl+C", { foregr
|
|
20225
20236
|
if (vr(t), u && Yf("requires-user-input"), p.confirmation.type === "tool-use")
|
20226
20237
|
for (const { useBlock: b, toAllow: w } of p.confirmation.tools) {
|
20227
20238
|
const _ = w ? ["n", "y", "!"] : ["n", "y"];
|
20228
|
-
|
20229
|
-
|
20239
|
+
Ur(
|
20240
|
+
Hp(i, b),
|
20230
20241
|
_
|
20231
20242
|
).then((D) => {
|
20232
20243
|
e.write(`
|
@@ -20242,7 +20253,7 @@ Interrupt the agent with `, { foreground: "gray" })}${i.print("Ctrl+C", { foregr
|
|
20242
20253
|
});
|
20243
20254
|
}
|
20244
20255
|
else if (p.confirmation.type === "agent-file-creation")
|
20245
|
-
|
20256
|
+
Ur(
|
20246
20257
|
"No AGENT.md file found. Would you like me to create one for this codebase?",
|
20247
20258
|
["y", "n"]
|
20248
20259
|
).then((b) => {
|
@@ -20273,7 +20284,7 @@ Visit ` + i.print(
|
|
20273
20284
|
) + ` to buy more usage and continue using Amp.
|
20274
20285
|
|
20275
20286
|
`
|
20276
|
-
),
|
20287
|
+
), Ur("Retry?", ["y", "n"]).then((b) => {
|
20277
20288
|
e.write(`
|
20278
20289
|
`), b === "y" ? f.next({
|
20279
20290
|
type: "confirmation",
|
@@ -20307,7 +20318,7 @@ Visit ` + i.print(
|
|
20307
20318
|
);
|
20308
20319
|
break;
|
20309
20320
|
}
|
20310
|
-
|
20321
|
+
Ur(b, ["y", "n"]).then((w) => {
|
20311
20322
|
e.write(`
|
20312
20323
|
`), f.next({
|
20313
20324
|
type: "confirmation",
|
@@ -20406,7 +20417,7 @@ The ${i.print(b.name, { foreground: "green" })} tool call is not allowed by defa
|
|
20406
20417
|
function vr({ stderr: t }) {
|
20407
20418
|
t.write("\r\x1B[K");
|
20408
20419
|
}
|
20409
|
-
function
|
20420
|
+
function zw({ printer: t, stderr: e }, n, i, r) {
|
20410
20421
|
const a = "◉◎";
|
20411
20422
|
e.write("\r\x1B[K");
|
20412
20423
|
const s = i ? i.substring(0, 80).replace(/\n/g, " ") : "", u = (a[n % a.length] ?? "") + " " + s + " ";
|
@@ -20417,13 +20428,13 @@ function Bw({ printer: t, stderr: e }, n, i, r) {
|
|
20417
20428
|
}
|
20418
20429
|
function Ws(t, e) {
|
20419
20430
|
const n = t.used / t.maxAvailable, i = Math.round(n * 100), r = Math.max(0, Math.min(i, 100)), a = "▁▂▃▄▅▆▇█", s = Math.floor(r * a.length / 100), u = Math.max(0, Math.min(s, a.length - 1)), o = a[u], c = `${r}% ┃${o}┃`;
|
20420
|
-
return n >=
|
20431
|
+
return n >= Gw ? e.print(c, { foreground: "red" }) : n >= Ww ? e.print(c, { foreground: "yellow" }) : c;
|
20421
20432
|
}
|
20422
|
-
function
|
20433
|
+
function Vw(t, e) {
|
20423
20434
|
const n = [];
|
20424
20435
|
return t.updateState === "updating" ? n.push("⬇ Updating Amp...") : t.updateState === "success" ? n.push(e.print("✓ Amp updated. Restart to apply.", { foreground: "green" })) : t.updateState === "error" && n.push(e.print("✗ Amp update failed.", { foreground: "red" })), t.tokenUsage && n.push(Ws(t.tokenUsage, e)), n.join(" ");
|
20425
20436
|
}
|
20426
|
-
const
|
20437
|
+
const Ww = 0.8, Gw = 0.9, ch = "> ", ws = me.join(
|
20427
20438
|
cy || me.join(process.env.HOME || process.cwd(), ".local", "state"),
|
20428
20439
|
"amp",
|
20429
20440
|
"last-thread-id"
|
@@ -20442,7 +20453,7 @@ async function fh() {
|
|
20442
20453
|
return null;
|
20443
20454
|
}
|
20444
20455
|
}
|
20445
|
-
const
|
20456
|
+
const Kw = [
|
20446
20457
|
{
|
20447
20458
|
name: "notifications",
|
20448
20459
|
long: "notifications",
|
@@ -20484,7 +20495,7 @@ const Gw = [
|
|
20484
20495
|
hidden: !0
|
20485
20496
|
}
|
20486
20497
|
];
|
20487
|
-
function
|
20498
|
+
function Jw(t, e) {
|
20488
20499
|
const n = e.args[0], i = e.commands.map((a) => a.name());
|
20489
20500
|
if (n && !n.includes(" ") && n.length < 30 && !/[./\\]/.test(n)) {
|
20490
20501
|
const a = i.filter(
|
@@ -20502,7 +20513,7 @@ function Kw(t, e) {
|
|
20502
20513
|
), process.exit(1);
|
20503
20514
|
}
|
20504
20515
|
}
|
20505
|
-
class
|
20516
|
+
class Yw {
|
20506
20517
|
async environment() {
|
20507
20518
|
const e = process.cwd(), n = di.file(e), i = await Wv(n, {
|
20508
20519
|
workingDirectory: n
|
@@ -20525,18 +20536,18 @@ async function Un(t, e) {
|
|
20525
20536
|
Yn({
|
20526
20537
|
logLevel: e.logLevel || process.env.AMP_LOG_LEVEL,
|
20527
20538
|
logFile: e.logFile || process.env.AMP_LOG_FILE
|
20528
|
-
}),
|
20539
|
+
}), Vp("0.0.1749211345-g16cdfc");
|
20529
20540
|
const n = e.settingsFile ?? process.env.AMP_SETTINGS_FILE;
|
20530
20541
|
J.info("Using settings file", { settingsFile: n });
|
20531
|
-
const i = Hn(), r =
|
20542
|
+
const i = Hn(), r = ad({ settingsFile: n }), a = process.env.AMP_API_KEY;
|
20532
20543
|
a && await i.set("apiKey", a, t.ampURL);
|
20533
|
-
const s =
|
20544
|
+
const s = Ch({
|
20534
20545
|
storage: r,
|
20535
20546
|
secretStorage: i,
|
20536
20547
|
workspaceRoots: je.of([di.file(process.cwd())]),
|
20537
20548
|
defaultAmpURL: t.ampURL
|
20538
|
-
}), u = new
|
20539
|
-
|
20549
|
+
}), u = new Yw(), o = wh(), c = Hv({ configService: s, toolService: o });
|
20550
|
+
ed(o);
|
20540
20551
|
let f, y;
|
20541
20552
|
if (t.isInteractiveMode) {
|
20542
20553
|
f = new Kf(), await f.start();
|
@@ -20558,8 +20569,8 @@ async function Un(t, e) {
|
|
20558
20569
|
}(), y = { [Symbol.dispose]: () => {
|
20559
20570
|
} };
|
20560
20571
|
await i.get("apiKey", t.ampURL) || (Ie.write(`No API key found. Starting login flow...
|
20561
|
-
`), await
|
20562
|
-
const g = zv(), h = new Yv(g), d = new Kv(g), m = new
|
20572
|
+
`), await Qw(t, i) || process.exit(1));
|
20573
|
+
const g = zv(), h = new Yv(g), d = new Kv(g), m = new zp(h), v = new mw({
|
20563
20574
|
configService: s,
|
20564
20575
|
threadService: h,
|
20565
20576
|
toolService: o,
|
@@ -20589,11 +20600,11 @@ async function Un(t, e) {
|
|
20589
20600
|
subthreadTracker: v
|
20590
20601
|
};
|
20591
20602
|
}
|
20592
|
-
async function
|
20593
|
-
return t.isInteractiveMode && !(await
|
20594
|
-
`), !1) : await
|
20603
|
+
async function Qw(t, e) {
|
20604
|
+
return t.isInteractiveMode && !(await Ur("Would you like to log in to Amp?", ["y", "n"]) == "y") ? (Ie.write(`Login cancelled. Run the command again to retry.
|
20605
|
+
`), !1) : await Jd(t, e);
|
20595
20606
|
}
|
20596
|
-
async function
|
20607
|
+
async function Jd(t, e) {
|
20597
20608
|
const n = im(32).toString("hex"), i = await fb(t.ampURL, n);
|
20598
20609
|
Ie.write(
|
20599
20610
|
`If your browser doesn't open automatically, visit:
|
@@ -20629,11 +20640,11 @@ Login failed: ${r instanceof Error ? r.message : String(r)}
|
|
20629
20640
|
`), !1;
|
20630
20641
|
}
|
20631
20642
|
}
|
20632
|
-
function
|
20643
|
+
function Zw(t) {
|
20633
20644
|
const e = new wu().name("amp").description("AI-powered coding assistant").option("--thread-id [THREAD_ID]", "ID of the thread to continue running", void 0);
|
20634
20645
|
e.option("-V, --version", "output the version number", () => {
|
20635
20646
|
if (t.isTTY) {
|
20636
|
-
const a = "0.0.
|
20647
|
+
const a = "0.0.1749211345-g16cdfc".match(/^(\d+\.\d+)\.(\d+)-(.+)$/);
|
20637
20648
|
if (a) {
|
20638
20649
|
const [, , s] = a;
|
20639
20650
|
try {
|
@@ -20644,21 +20655,21 @@ function Qw(t) {
|
|
20644
20655
|
day: "numeric"
|
20645
20656
|
});
|
20646
20657
|
Ie.write(
|
20647
|
-
`0.0.
|
20658
|
+
`0.0.1749211345-g16cdfc ${t.printer.print(`(released ${o})`, { foreground: "gray" })}
|
20648
20659
|
`
|
20649
20660
|
);
|
20650
20661
|
} else
|
20651
|
-
Ie.write(`0.0.
|
20662
|
+
Ie.write(`0.0.1749211345-g16cdfc
|
20652
20663
|
`);
|
20653
20664
|
} catch {
|
20654
|
-
Ie.write(`0.0.
|
20665
|
+
Ie.write(`0.0.1749211345-g16cdfc
|
20655
20666
|
`);
|
20656
20667
|
}
|
20657
20668
|
} else
|
20658
|
-
Ie.write(`0.0.
|
20669
|
+
Ie.write(`0.0.1749211345-g16cdfc
|
20659
20670
|
`);
|
20660
20671
|
} else
|
20661
|
-
Ie.write(`0.0.
|
20672
|
+
Ie.write(`0.0.1749211345-g16cdfc
|
20662
20673
|
`);
|
20663
20674
|
process.exit(0);
|
20664
20675
|
}), e.addHelpText(
|
@@ -20668,7 +20679,7 @@ function Qw(t) {
|
|
20668
20679
|
a += t.printer.print("Environment variables:", { style: "bold" }) + `
|
20669
20680
|
|
20670
20681
|
`, a += " " + t.printer.print("AMP_API_KEY", { foreground: "green" }) + ` API key for Amp (see https://ampcode.com/settings)
|
20671
|
-
`, a += " " + t.printer.print("AMP_URL", { foreground: "green" }) + " URL for the Amp service (default is " +
|
20682
|
+
`, a += " " + t.printer.print("AMP_URL", { foreground: "green" }) + " URL for the Amp service (default is " + $r + `)
|
20672
20683
|
`, a += " " + t.printer.print("AMP_LOG_LEVEL", { foreground: "green" }) + ` Set log level (can also use --log-level)
|
20673
20684
|
`, a += " " + t.printer.print("AMP_LOG_FILE", { foreground: "green" }) + ` Set log file location (can also use --log-file)
|
20674
20685
|
`, a += " " + t.printer.print("AMP_SETTINGS_FILE", { foreground: "green" }) + " Set settings file path (can also use --settings-file, default: " + ct + `)
|
@@ -20762,9 +20773,9 @@ function Qw(t) {
|
|
20762
20773
|
}), e.command("login").description("Log in to Amp").action(async (a, s) => {
|
20763
20774
|
const u = s.optsWithGlobals(), o = ur(u), c = Hn();
|
20764
20775
|
await c.get("apiKey", o.ampURL) && (Ie.write(`Already logged in.
|
20765
|
-
`), await
|
20776
|
+
`), await Ur("Do you want to log in again?", ["y", "n"]) === "n" && process.exit(0), Ie.write(`
|
20766
20777
|
`));
|
20767
|
-
const y = await
|
20778
|
+
const y = await Jd(o, c);
|
20768
20779
|
process.exit(y ? 0 : 1);
|
20769
20780
|
});
|
20770
20781
|
const n = e.command("threads").description("Thread management commands");
|
@@ -20866,7 +20877,7 @@ Provide a thread ID as an argument or run a thread first.
|
|
20866
20877
|
const p = l.title || "Untitled";
|
20867
20878
|
let b = "Team";
|
20868
20879
|
l.meta.private ? b = "Private" : l.meta.public && (b = "Public");
|
20869
|
-
const w =
|
20880
|
+
const w = e_(new Date(l.updatedAt));
|
20870
20881
|
return [
|
20871
20882
|
p,
|
20872
20883
|
w,
|
@@ -20875,7 +20886,7 @@ Provide a thread ID as an argument or run a thread first.
|
|
20875
20886
|
l.id
|
20876
20887
|
];
|
20877
20888
|
});
|
20878
|
-
|
20889
|
+
r_(m, v, {
|
20879
20890
|
columnFormatters: [
|
20880
20891
|
(l, p) => (l.length > p ? l.substring(0, p - 3) + "..." : l).padEnd(p),
|
20881
20892
|
void 0,
|
@@ -20895,17 +20906,17 @@ Provide a thread ID as an argument or run a thread first.
|
|
20895
20906
|
try {
|
20896
20907
|
const u = s.optsWithGlobals(), o = ur(u);
|
20897
20908
|
Yn({});
|
20898
|
-
const c =
|
20909
|
+
const c = ad({
|
20899
20910
|
settingsFile: u.settingsFile
|
20900
20911
|
}), f = Hn();
|
20901
|
-
|
20912
|
+
Ch({
|
20902
20913
|
storage: c,
|
20903
20914
|
secretStorage: f,
|
20904
20915
|
workspaceRoots: je.of([di.file(process.cwd())]),
|
20905
20916
|
defaultAmpURL: o.ampURL
|
20906
20917
|
});
|
20907
20918
|
const y = wh();
|
20908
|
-
|
20919
|
+
ed(y);
|
20909
20920
|
const g = await We(y.tools);
|
20910
20921
|
we.write(`# ${g.length} tools
|
20911
20922
|
`), we.write(`
|
@@ -20933,7 +20944,7 @@ Provide a thread ID as an argument or run a thread first.
|
|
20933
20944
|
`), process.exit(1);
|
20934
20945
|
}
|
20935
20946
|
});
|
20936
|
-
for (const a of
|
20947
|
+
for (const a of Kw)
|
20937
20948
|
if (a.type === "flag")
|
20938
20949
|
e.option(`--${a.long}`, a.description(!0)), e.option(`--no-${a.long}`, a.description(!1));
|
20939
20950
|
else {
|
@@ -20944,7 +20955,7 @@ Provide a thread ID as an argument or run a thread first.
|
|
20944
20955
|
}
|
20945
20956
|
e.action(async (a, s) => {
|
20946
20957
|
const u = a, o = ur(u);
|
20947
|
-
s.args.length > 0 &&
|
20958
|
+
s.args.length > 0 && Jw(o, s), a.threadId !== void 0 && (we.write(
|
20948
20959
|
o.printer.print("Error: ", { foreground: "red", style: "bold" }) + `The --thread-id option has been deprecated.
|
20949
20960
|
Use ` + o.printer.print("amp threads continue [THREAD_ID]", {
|
20950
20961
|
foreground: "green"
|
@@ -21018,7 +21029,7 @@ async function hh(t, e) {
|
|
21018
21029
|
let s;
|
21019
21030
|
switch (e.format) {
|
21020
21031
|
case "ui":
|
21021
|
-
s =
|
21032
|
+
s = Bw({
|
21022
21033
|
stdout: process.stdout,
|
21023
21034
|
stderr: process.stderr,
|
21024
21035
|
printer: t.printer,
|
@@ -21034,21 +21045,21 @@ async function hh(t, e) {
|
|
21034
21045
|
(t.isInteractiveMode || !n) && (we.write(
|
21035
21046
|
`JSONL UI requires non-interactive mode with a message piped to stdin.
|
21036
21047
|
`
|
21037
|
-
), process.exit(1)), s =
|
21048
|
+
), process.exit(1)), s = Tw({
|
21038
21049
|
threadID: a,
|
21039
21050
|
pipedInput: n,
|
21040
21051
|
stdout: process.stdout
|
21041
21052
|
});
|
21042
21053
|
break;
|
21043
21054
|
}
|
21044
|
-
await
|
21055
|
+
await Rw(r, {
|
21045
21056
|
threadID: a,
|
21046
21057
|
isContinued: !!e.threadId,
|
21047
21058
|
ui: s
|
21048
21059
|
}), process.exit(0);
|
21049
21060
|
}
|
21050
21061
|
function ur(t) {
|
21051
|
-
const e = process.stdin.isTTY || !1, n = typeof process < "u" && process.stdout?.isTTY && process.stderr?.isTTY, i = process.env.AMP_URL ||
|
21062
|
+
const e = process.stdin.isTTY || !1, n = typeof process < "u" && process.stdout?.isTTY && process.stderr?.isTTY, i = process.env.AMP_URL || $r, a = (t?.color !== void 0 ? t.color : n) ? Up : Bp;
|
21052
21063
|
return {
|
21053
21064
|
isInteractiveMode: e,
|
21054
21065
|
isTTY: n,
|
@@ -21056,7 +21067,7 @@ function ur(t) {
|
|
21056
21067
|
ampURL: i
|
21057
21068
|
};
|
21058
21069
|
}
|
21059
|
-
async function
|
21070
|
+
async function Xw() {
|
21060
21071
|
Yn({
|
21061
21072
|
logLevel: process.env.AMP_LOG_LEVEL,
|
21062
21073
|
logFile: process.env.AMP_LOG_FILE
|
@@ -21065,17 +21076,17 @@ async function Zw() {
|
|
21065
21076
|
`
|
21066
21077
|
), process.exit(1));
|
21067
21078
|
const t = ur();
|
21068
|
-
await
|
21079
|
+
await Zw(t).parseAsync(process.argv);
|
21069
21080
|
}
|
21070
|
-
|
21081
|
+
Xw().catch((t) => {
|
21071
21082
|
J.error("Fatal error", t), we.write(`Fatal error: ${t.message}: ${t.stack}
|
21072
21083
|
`), process.exit(1);
|
21073
21084
|
});
|
21074
|
-
function
|
21085
|
+
function e_(t) {
|
21075
21086
|
const n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), i = Math.floor(n / 1e3), r = Math.floor(i / 60), a = Math.floor(r / 60), s = Math.floor(a / 24), u = Math.floor(s / 7), o = Math.floor(s / 30), c = Math.floor(s / 365);
|
21076
21087
|
return i < 60 ? i <= 1 ? "now" : `${i}s ago` : r < 60 ? `${r}m ago` : a < 24 ? `${a}h ago` : s < 7 ? `${s}d ago` : u < 4 ? `${u}w ago` : o < 12 ? `${o}mo ago` : `${c}y ago`;
|
21077
21088
|
}
|
21078
|
-
function
|
21089
|
+
function r_(t, e, n = {}) {
|
21079
21090
|
const { columnFormatters: i = [], minimumTruncatedColumnWidth: r = 20, truncateColumnIndex: a } = n;
|
21080
21091
|
for (let v = 0; v < e.length; v++)
|
21081
21092
|
if (e[v].length !== t.length)
|
@@ -21106,4 +21117,4 @@ export {
|
|
21106
21117
|
Am as J,
|
21107
21118
|
ey as r
|
21108
21119
|
};
|
21109
|
-
//# sourceMappingURL=main-
|
21120
|
+
//# sourceMappingURL=main-CtHA5Ylu.js.map
|