@upstash/box-cli 0.1.8 → 0.1.10
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/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +73 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/connect.d.ts.map +1 -1
- package/dist/commands/connect.js +6 -1
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/snapshot.d.ts +7 -0
- package/dist/commands/snapshot.d.ts.map +1 -0
- package/dist/commands/snapshot.js +45 -0
- package/dist/commands/snapshot.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -65
- package/dist/index.js.map +1 -1
- package/dist/repl/client.d.ts +10 -23
- package/dist/repl/client.d.ts.map +1 -1
- package/dist/repl/client.js +76 -86
- package/dist/repl/client.js.map +1 -1
- package/dist/repl/commands/console.d.ts +3 -2
- package/dist/repl/commands/console.d.ts.map +1 -1
- package/dist/repl/commands/console.js +5 -11
- package/dist/repl/commands/console.js.map +1 -1
- package/dist/repl/commands/delete.d.ts +3 -3
- package/dist/repl/commands/delete.d.ts.map +1 -1
- package/dist/repl/commands/delete.js +4 -4
- package/dist/repl/commands/delete.js.map +1 -1
- package/dist/repl/commands/exec.d.ts +2 -2
- package/dist/repl/commands/exec.d.ts.map +1 -1
- package/dist/repl/commands/exec.js +3 -3
- package/dist/repl/commands/exec.js.map +1 -1
- package/dist/repl/commands/files.d.ts +2 -2
- package/dist/repl/commands/files.d.ts.map +1 -1
- package/dist/repl/commands/files.js +10 -10
- package/dist/repl/commands/files.js.map +1 -1
- package/dist/repl/commands/git.d.ts +2 -2
- package/dist/repl/commands/git.d.ts.map +1 -1
- package/dist/repl/commands/git.js +7 -7
- package/dist/repl/commands/git.js.map +1 -1
- package/dist/repl/commands/pause.d.ts +3 -3
- package/dist/repl/commands/pause.d.ts.map +1 -1
- package/dist/repl/commands/pause.js +4 -4
- package/dist/repl/commands/pause.js.map +1 -1
- package/dist/repl/commands/run.d.ts +3 -3
- package/dist/repl/commands/run.d.ts.map +1 -1
- package/dist/repl/commands/run.js +5 -5
- package/dist/repl/commands/run.js.map +1 -1
- package/dist/repl/commands/snapshot.d.ts +2 -2
- package/dist/repl/commands/snapshot.d.ts.map +1 -1
- package/dist/repl/commands/snapshot.js +2 -2
- package/dist/repl/commands/snapshot.js.map +1 -1
- package/dist/repl/terminal.d.ts.map +1 -1
- package/dist/repl/terminal.js +77 -46
- package/dist/repl/terminal.js.map +1 -1
- package/dist/repl/types.d.ts +40 -0
- package/dist/repl/types.d.ts.map +1 -0
- package/dist/repl/types.js +2 -0
- package/dist/repl/types.js.map +1 -0
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Box } from "@upstash/box";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxREPLEvent } from "../types.js";
|
|
3
3
|
/**
|
|
4
|
-
* Delete the box.
|
|
4
|
+
* Delete the box. Yields an exit event to signal the REPL to stop.
|
|
5
5
|
*/
|
|
6
|
-
export declare function handleDelete(box: Box, _args: string
|
|
6
|
+
export declare function handleDelete(box: Box, _args: string): AsyncGenerator<BoxREPLEvent>;
|
|
7
7
|
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,wBAAuB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAIzF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Delete the box.
|
|
2
|
+
* Delete the box. Yields an exit event to signal the REPL to stop.
|
|
3
3
|
*/
|
|
4
|
-
export async function handleDelete(box, _args
|
|
4
|
+
export async function* handleDelete(box, _args) {
|
|
5
5
|
await box.delete();
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
yield { type: "log", message: `Box ${box.id} deleted.` };
|
|
7
|
+
yield { type: "exit", message: `Box ${box.id} deleted.` };
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/repl/commands/delete.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/repl/commands/delete.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,YAAY,CAAC,GAAQ,EAAE,KAAa;IACzD,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC;IACzD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC;AAC5D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Box } from "@upstash/box";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxREPLEvent } from "../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Execute a shell command in the box.
|
|
5
5
|
*/
|
|
6
|
-
export declare function handleExec(box: Box, command: string
|
|
6
|
+
export declare function handleExec(box: Box, command: string): AsyncGenerator<BoxREPLEvent>;
|
|
7
7
|
//# sourceMappingURL=exec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/exec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/exec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,wBAAuB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAQzF"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Execute a shell command in the box.
|
|
3
3
|
*/
|
|
4
|
-
export async function handleExec(box, command
|
|
4
|
+
export async function* handleExec(box, command) {
|
|
5
5
|
if (!command) {
|
|
6
|
-
|
|
6
|
+
yield { type: "log", message: "Usage: exec <command>" };
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
9
|
const run = await box.exec(command);
|
|
10
10
|
const result = run.result;
|
|
11
11
|
if (result)
|
|
12
|
-
|
|
12
|
+
yield { type: "log", message: result };
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=exec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../src/repl/commands/exec.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../src/repl/commands/exec.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,UAAU,CAAC,GAAQ,EAAE,OAAe;IACzD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;QACxD,OAAO;IACT,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,IAAI,MAAM;QAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Box } from "@upstash/box";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxREPLEvent } from "../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Handle file subcommands: read, write, list, upload, download.
|
|
5
5
|
*/
|
|
6
|
-
export declare function handleFiles(box: Box, args: string
|
|
6
|
+
export declare function handleFiles(box: Box, args: string): AsyncGenerator<BoxREPLEvent>;
|
|
7
7
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,wBAAuB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAuDvF"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Handle file subcommands: read, write, list, upload, download.
|
|
3
3
|
*/
|
|
4
|
-
export async function handleFiles(box, args
|
|
4
|
+
export async function* handleFiles(box, args) {
|
|
5
5
|
const parts = args.split(/\s+/);
|
|
6
6
|
const sub = parts[0];
|
|
7
7
|
switch (sub) {
|
|
8
8
|
case "read": {
|
|
9
9
|
const path = parts[1];
|
|
10
10
|
if (!path) {
|
|
11
|
-
|
|
11
|
+
yield { type: "log", message: "Usage: files read <path>" };
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const content = await box.files.read(path);
|
|
15
|
-
|
|
15
|
+
yield { type: "log", message: content };
|
|
16
16
|
break;
|
|
17
17
|
}
|
|
18
18
|
case "write": {
|
|
19
19
|
const path = parts[1];
|
|
20
20
|
const content = parts.slice(2).join(" ");
|
|
21
21
|
if (!path || !content) {
|
|
22
|
-
|
|
22
|
+
yield { type: "log", message: "Usage: files write <path> <content>" };
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
await box.files.write({ path, content });
|
|
26
|
-
|
|
26
|
+
yield { type: "log", message: `Written to ${path}` };
|
|
27
27
|
break;
|
|
28
28
|
}
|
|
29
29
|
case "list": {
|
|
@@ -31,7 +31,7 @@ export async function handleFiles(box, args, hooks) {
|
|
|
31
31
|
const files = await box.files.list(path);
|
|
32
32
|
for (const f of files) {
|
|
33
33
|
const indicator = f.is_dir ? "/" : "";
|
|
34
|
-
|
|
34
|
+
yield { type: "log", message: `${f.name}${indicator}\t${f.size}` };
|
|
35
35
|
}
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
@@ -39,21 +39,21 @@ export async function handleFiles(box, args, hooks) {
|
|
|
39
39
|
const localPath = parts[1];
|
|
40
40
|
const destination = parts[2];
|
|
41
41
|
if (!localPath || !destination) {
|
|
42
|
-
|
|
42
|
+
yield { type: "log", message: "Usage: files upload <local-path> <destination>" };
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
await box.files.upload([{ path: localPath, destination }]);
|
|
46
|
-
|
|
46
|
+
yield { type: "log", message: `Uploaded ${localPath} → ${destination}` };
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
case "download": {
|
|
50
50
|
const path = parts[1];
|
|
51
51
|
await box.files.download(path ? { path } : undefined);
|
|
52
|
-
|
|
52
|
+
yield { type: "log", message: "Downloaded." };
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
default:
|
|
56
|
-
|
|
56
|
+
yield { type: "log", message: "Usage: files <read|write|list|upload|download> [args...]" };
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
//# sourceMappingURL=files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/repl/commands/files.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/repl/commands/files.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,CAAC,GAAQ,EAAE,IAAY;IACvD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAErB,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACtB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;gBAC3D,OAAO;YACT,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,E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AC,WAAW,EAAE,CAAC;gBAC/B,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,gDAAgD,EAAE,CAAC;gBACjF,OAAO;YACT,CAAC;YACD,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;YAC3D,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,SAAS,MAAM,WAAW,EAAE,EAAE,CAAC;YACzE,MAAM;QACR,CAAC;QACD,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACtD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;YAC9C,MAAM;QACR,CAAC;QACD;YACE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,0DAA0D,EAAE,CAAC;IAC/F,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Box } from "@upstash/box";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxREPLEvent } from "../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Handle git subcommands: clone, diff, create-pr.
|
|
5
5
|
*/
|
|
6
|
-
export declare function handleGit(box: Box, args: string
|
|
6
|
+
export declare function handleGit(box: Box, args: string): AsyncGenerator<BoxREPLEvent>;
|
|
7
7
|
//# sourceMappingURL=git.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/git.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/git.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,wBAAuB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAkCrF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Handle git subcommands: clone, diff, create-pr.
|
|
3
3
|
*/
|
|
4
|
-
export async function handleGit(box, args
|
|
4
|
+
export async function* handleGit(box, args) {
|
|
5
5
|
const parts = args.split(/\s+/);
|
|
6
6
|
const sub = parts[0];
|
|
7
7
|
switch (sub) {
|
|
@@ -9,30 +9,30 @@ export async function handleGit(box, args, hooks) {
|
|
|
9
9
|
const repo = parts[1];
|
|
10
10
|
const branch = parts[2];
|
|
11
11
|
if (!repo) {
|
|
12
|
-
|
|
12
|
+
yield { type: "log", message: "Usage: git clone <repo> [branch]" };
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
await box.git.clone({ repo, branch });
|
|
16
|
-
|
|
16
|
+
yield { type: "log", message: `Cloned ${repo}` };
|
|
17
17
|
break;
|
|
18
18
|
}
|
|
19
19
|
case "diff": {
|
|
20
20
|
const diff = await box.git.diff();
|
|
21
|
-
|
|
21
|
+
yield { type: "log", message: diff || "(no changes)" };
|
|
22
22
|
break;
|
|
23
23
|
}
|
|
24
24
|
case "create-pr": {
|
|
25
25
|
const title = parts.slice(1).join(" ");
|
|
26
26
|
if (!title) {
|
|
27
|
-
|
|
27
|
+
yield { type: "log", message: "Usage: git create-pr <title>" };
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
const pr = await box.git.createPR({ title });
|
|
31
|
-
|
|
31
|
+
yield { type: "log", message: `PR #${pr.number}: ${pr.url}` };
|
|
32
32
|
break;
|
|
33
33
|
}
|
|
34
34
|
default:
|
|
35
|
-
|
|
35
|
+
yield { type: "log", message: "Usage: git <clone|diff|create-pr> [args...]" };
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=git.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../src/repl/commands/git.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../src/repl/commands/git.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,SAAS,CAAC,GAAQ,EAAE,IAAY;IACrD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAErB,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC;gBACnE,OAAO;YACT,CAAC;YACD,MAAM,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YACtC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,IAAI,EAAE,EAAE,CAAC;YACjD,MAAM;QACR,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAClC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,IAAI,cAAc,EAAE,CAAC;YACvD,MAAM;QACR,CAAC;QACD,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;gBAC/D,OAAO;YACT,CAAC;YACD,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YAC7C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;YAC9D,MAAM;QACR,CAAC;QACD;YACE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,6CAA6C,EAAE,CAAC;IAClF,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Box } from "@upstash/box";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxREPLEvent } from "../types.js";
|
|
3
3
|
/**
|
|
4
|
-
* Pause the box.
|
|
4
|
+
* Pause the box. Yields an exit event to signal the REPL to stop.
|
|
5
5
|
*/
|
|
6
|
-
export declare function handlePause(box: Box, _args: string
|
|
6
|
+
export declare function handlePause(box: Box, _args: string): AsyncGenerator<BoxREPLEvent>;
|
|
7
7
|
//# sourceMappingURL=pause.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/pause.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/pause.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,wBAAuB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAIxF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pause the box.
|
|
2
|
+
* Pause the box. Yields an exit event to signal the REPL to stop.
|
|
3
3
|
*/
|
|
4
|
-
export async function handlePause(box, _args
|
|
4
|
+
export async function* handlePause(box, _args) {
|
|
5
5
|
await box.pause();
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
yield { type: "log", message: `Box ${box.id} paused.` };
|
|
7
|
+
yield { type: "exit", message: `Box ${box.id} paused.` };
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=pause.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pause.js","sourceRoot":"","sources":["../../../src/repl/commands/pause.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"pause.js","sourceRoot":"","sources":["../../../src/repl/commands/pause.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,CAAC,GAAQ,EAAE,KAAa;IACxD,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;IAClB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,EAAE,UAAU,EAAE,CAAC;IACxD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,EAAE,UAAU,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Box } from "@upstash/box";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxREPLEvent } from "../types.js";
|
|
3
3
|
/**
|
|
4
|
-
* Run the agent with a prompt, streaming output
|
|
4
|
+
* Run the agent with a prompt, streaming output as events.
|
|
5
5
|
*/
|
|
6
|
-
export declare function handleRun(box: Box, prompt: string
|
|
6
|
+
export declare function handleRun(box: Box, prompt: string): AsyncGenerator<BoxREPLEvent>;
|
|
7
7
|
//# sourceMappingURL=run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,wBAAuB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAWvF"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Run the agent with a prompt, streaming output
|
|
2
|
+
* Run the agent with a prompt, streaming output as events.
|
|
3
3
|
*/
|
|
4
|
-
export async function handleRun(box, prompt
|
|
4
|
+
export async function* handleRun(box, prompt) {
|
|
5
5
|
if (!prompt) {
|
|
6
|
-
|
|
6
|
+
yield { type: "log", message: "Usage: run <prompt>" };
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
9
|
for await (const chunk of box.agent.stream({ prompt })) {
|
|
10
10
|
if (chunk.type === "text-delta") {
|
|
11
|
-
|
|
11
|
+
yield { type: "stream", text: chunk.text };
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
yield { type: "stream", text: "\n" };
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/repl/commands/run.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/repl/commands/run.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,SAAS,CAAC,GAAQ,EAAE,MAAc;IACvD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC;QACtD,OAAO;IACT,CAAC;IACD,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QACvD,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAChC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7C,CAAC;IACH,CAAC;IACD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Box } from "@upstash/box";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxREPLEvent } from "../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Create a snapshot of the current box state.
|
|
5
5
|
*/
|
|
6
|
-
export declare function handleSnapshot(box: Box, args: string
|
|
6
|
+
export declare function handleSnapshot(box: Box, args: string): AsyncGenerator<BoxREPLEvent>;
|
|
7
7
|
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,wBAAuB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAI1F"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Create a snapshot of the current box state.
|
|
3
3
|
*/
|
|
4
|
-
export async function handleSnapshot(box, args
|
|
4
|
+
export async function* handleSnapshot(box, args) {
|
|
5
5
|
const name = args.trim() || `snapshot-${Date.now()}`;
|
|
6
6
|
const snapshot = await box.snapshot({ name });
|
|
7
|
-
|
|
7
|
+
yield { type: "log", message: `Snapshot created: ${snapshot.id} (${snapshot.name})` };
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=snapshot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../src/repl/commands/snapshot.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../src/repl/commands/snapshot.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,cAAc,CAAC,GAAQ,EAAE,IAAY;IAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,YAAY,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IACrD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,qBAAqB,QAAQ,CAAC,EAAE,KAAK,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC;AACxF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../src/repl/terminal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../src/repl/terminal.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAiBxC;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAoMvD"}
|
package/dist/repl/terminal.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { exec } from "node:child_process";
|
|
1
2
|
import { createInterface } from "node:readline/promises";
|
|
2
3
|
import { stdin, stdout } from "node:process";
|
|
3
|
-
import { BoxREPLClient
|
|
4
|
+
import { BoxREPLClient } from "./client.js";
|
|
4
5
|
import { startSpinner } from "./spinner.js";
|
|
5
6
|
import { bold, cyan, dim, green, red, yellow, cursorUp, eraseLine, eraseDown, stripAnsi, } from "../utils/ansi.js";
|
|
6
7
|
/**
|
|
@@ -13,6 +14,7 @@ export async function startRepl(box) {
|
|
|
13
14
|
completer: () => [[], ""],
|
|
14
15
|
});
|
|
15
16
|
const prompt = `${bold(cyan(box.id))}${dim(">")} `;
|
|
17
|
+
const client = new BoxREPLClient(box);
|
|
16
18
|
// --- Spinner tracking ---
|
|
17
19
|
let activeSpinnerStop = null;
|
|
18
20
|
function ensureSpinnerStopped() {
|
|
@@ -77,10 +79,10 @@ export async function startRepl(box) {
|
|
|
77
79
|
clearPreview();
|
|
78
80
|
if (line.startsWith("/") && !line.includes(" ")) {
|
|
79
81
|
const partial = line.slice(1);
|
|
80
|
-
const matches =
|
|
82
|
+
const matches = BoxREPLClient.suggestCommands(partial).slice(0, 5);
|
|
81
83
|
if (matches.length > 0) {
|
|
82
84
|
const preview = matches
|
|
83
|
-
.map((c) => ` ${dim(`/${c}`)} ${dim("—")} ${dim(
|
|
85
|
+
.map((c) => ` ${dim(`/${c.name}`)} ${dim("—")} ${dim(c.description)}`)
|
|
84
86
|
.join("\n");
|
|
85
87
|
stdout.write("\n" + preview + cursorUp(matches.length));
|
|
86
88
|
restoreCursorColumn();
|
|
@@ -90,13 +92,66 @@ export async function startRepl(box) {
|
|
|
90
92
|
});
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
/** Map a single event to terminal actions. Returns true if the loop should exit. */
|
|
96
|
+
function processEvent(event) {
|
|
97
|
+
switch (event.type) {
|
|
98
|
+
case "command:start":
|
|
99
|
+
stdout.write("\n");
|
|
100
|
+
activeSpinnerStop = startSpinner();
|
|
101
|
+
break;
|
|
102
|
+
case "log":
|
|
103
|
+
ensureSpinnerStopped();
|
|
104
|
+
clearPreview();
|
|
105
|
+
console.log(event.message);
|
|
106
|
+
break;
|
|
107
|
+
case "error":
|
|
108
|
+
ensureSpinnerStopped();
|
|
109
|
+
clearPreview();
|
|
110
|
+
console.error(red(event.message));
|
|
111
|
+
break;
|
|
112
|
+
case "stream":
|
|
113
|
+
ensureSpinnerStopped();
|
|
114
|
+
process.stdout.write(event.text);
|
|
115
|
+
break;
|
|
116
|
+
case "command:complete": {
|
|
117
|
+
const seconds = (event.durationMs / 1000).toFixed(1);
|
|
118
|
+
console.log(dim(`\n /${event.command} completed in ${seconds}s\n`));
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case "suggestion":
|
|
122
|
+
nextSuggestion = event.text;
|
|
123
|
+
break;
|
|
124
|
+
case "command:not-found":
|
|
125
|
+
console.error(yellow(`\nUnknown command: /${event.typed}`));
|
|
126
|
+
if (event.suggestions.length > 0) {
|
|
127
|
+
console.log(yellow(`Did you mean: ${event.suggestions.map((s) => `/${s}`).join(", ")}?\n`));
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
case "open-url": {
|
|
131
|
+
const openCmd = process.platform === "darwin"
|
|
132
|
+
? "open"
|
|
133
|
+
: process.platform === "win32"
|
|
134
|
+
? "start"
|
|
135
|
+
: "xdg-open";
|
|
136
|
+
exec(`${openCmd} ${event.url}`);
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
case "exit":
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
// --- Welcome message ---
|
|
145
|
+
const allCommands = BoxREPLClient.suggestCommands("");
|
|
146
|
+
console.log(`\nConnected to box ${box.id}`);
|
|
147
|
+
console.log(`Type a prompt to run the agent, or use commands: ${allCommands.map((c) => `/${c.name}`).join(", ")}, /exit\n`);
|
|
148
|
+
// --- Main REPL loop ---
|
|
149
|
+
try {
|
|
150
|
+
while (true) {
|
|
96
151
|
clearPreview();
|
|
97
152
|
const suggestion = nextSuggestion;
|
|
98
153
|
nextSuggestion = null;
|
|
99
|
-
const
|
|
154
|
+
const answer = await rl.question(prompt).then((input) => {
|
|
100
155
|
// Rewrite the prompt line with the input in green
|
|
101
156
|
if (input.trim()) {
|
|
102
157
|
stdout.write(`\x1b[A\r${eraseLine}${prompt}${green(input)}\n`);
|
|
@@ -106,46 +161,22 @@ export async function startRepl(box) {
|
|
|
106
161
|
if (suggestion && stdin.isTTY) {
|
|
107
162
|
setImmediate(() => showGhost(suggestion));
|
|
108
163
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
onError: (message) => {
|
|
118
|
-
ensureSpinnerStopped();
|
|
119
|
-
clearPreview();
|
|
120
|
-
console.error(red(message));
|
|
121
|
-
},
|
|
122
|
-
onStream: (chunk) => {
|
|
123
|
-
ensureSpinnerStopped();
|
|
124
|
-
process.stdout.write(chunk);
|
|
125
|
-
},
|
|
126
|
-
onLoadingStart: () => {
|
|
127
|
-
stdout.write("\n");
|
|
128
|
-
const stop = startSpinner();
|
|
129
|
-
activeSpinnerStop = stop;
|
|
130
|
-
return stop;
|
|
131
|
-
},
|
|
132
|
-
onSuggestion: (text) => {
|
|
133
|
-
nextSuggestion = text;
|
|
134
|
-
},
|
|
135
|
-
onCommandComplete: (command, durationMs) => {
|
|
136
|
-
const seconds = (durationMs / 1000).toFixed(1);
|
|
137
|
-
console.log(dim(`\n /${command} completed in ${seconds}s\n`));
|
|
138
|
-
},
|
|
139
|
-
onCommandNotFound: (typed, suggestions) => {
|
|
140
|
-
console.error(yellow(`\nUnknown command: /${typed}`));
|
|
141
|
-
if (suggestions.length > 0) {
|
|
142
|
-
console.log(yellow(`Did you mean: ${suggestions.map((s) => `/${s}`).join(", ")}?\n`));
|
|
164
|
+
let shouldExit = false;
|
|
165
|
+
try {
|
|
166
|
+
for await (const event of client.handleInput(answer)) {
|
|
167
|
+
if (processEvent(event)) {
|
|
168
|
+
shouldExit = true;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
143
171
|
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
ensureSpinnerStopped();
|
|
175
|
+
console.error(red(`Error: ${err instanceof Error ? err.message : err}`));
|
|
176
|
+
}
|
|
177
|
+
if (shouldExit)
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
149
180
|
}
|
|
150
181
|
finally {
|
|
151
182
|
clearPreview();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../src/repl/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../src/repl/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,KAAK,EACL,GAAG,EACH,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAQ;IACtC,MAAM,EAAE,GAAG,eAAe,CAAC;QACzB,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,GAAuB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;KAC9C,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;IACnD,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;IAEtC,2BAA2B;IAC3B,IAAI,iBAAiB,GAAwB,IAAI,CAAC;IAElD,SAAS,oBAAoB;QAC3B,IAAI,iBAAiB,EAAE,CAAC;YACtB,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,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