@upstash/box-cli 0.1.18 → 0.1.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upstash/box-cli",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "CLI for Upstash Box — REPL-first interface for AI coding agents",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "commander": "^13.0.0",
31
31
  "dotenv": "^17.3.1",
32
- "@upstash/box": "0.1.14"
32
+ "@upstash/box": "0.1.15"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^20.10.0",
@@ -1,12 +0,0 @@
1
- import type { Box } from "@upstash/box";
2
- import type { BoxREPLEvent } from "../types.js";
3
- /**
4
- * Execute inline code (JS, TS, or Python) inside the box.
5
- *
6
- * Usage:
7
- * /code js console.log("hello")
8
- * /code ts const x: number = 42; console.log(x)
9
- * /code python print("hello")
10
- */
11
- export declare function handleCode(box: Box, args: string): AsyncGenerator<BoxREPLEvent>;
12
- //# sourceMappingURL=code.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;GAOG;AACH,wBAAuB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAyCtF"}
@@ -1,45 +0,0 @@
1
- /**
2
- * Execute inline code (JS, TS, or Python) inside the box.
3
- *
4
- * Usage:
5
- * /code js console.log("hello")
6
- * /code ts const x: number = 42; console.log(x)
7
- * /code python print("hello")
8
- */
9
- export async function* handleCode(box, args) {
10
- if (!args) {
11
- yield {
12
- type: "log",
13
- message: "Usage: /code <js|ts|python> <code>\n\nExamples:\n /code js console.log(1 + 2)\n /code ts const x: number = 42; console.log(x)\n /code python print('hello')",
14
- };
15
- return;
16
- }
17
- const spaceIdx = args.indexOf(" ");
18
- if (spaceIdx === -1) {
19
- yield {
20
- type: "log",
21
- message: "Usage: /code <js|ts|python> <code>",
22
- };
23
- return;
24
- }
25
- const language = args.slice(0, spaceIdx).toLowerCase();
26
- const code = args.slice(spaceIdx + 1);
27
- if (language !== "js" && language !== "ts" && language !== "python") {
28
- yield {
29
- type: "error",
30
- message: `Unsupported language "${language}". Supported: js, ts, python`,
31
- };
32
- return;
33
- }
34
- const result = await box.exec.code({ code, lang: language });
35
- if (result.output) {
36
- yield { type: "log", message: result.output };
37
- }
38
- if (result.error) {
39
- yield { type: "error", message: result.error };
40
- }
41
- if (!result.output && !result.error) {
42
- yield { type: "log", message: `(exit code: ${result.exit_code})` };
43
- }
44
- }
45
- //# sourceMappingURL=code.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code.js","sourceRoot":"","sources":["../../../src/repl/commands/code.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,UAAU,CAAC,GAAQ,EAAE,IAAY;IACtD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM;YACJ,IAAI,EAAE,KAAK;YACX,OAAO,EACL,gKAAgK;SACnK,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,QAAQ,KAAK,CAAC,CAAC,EAAE,CAAC;QACpB,MAAM;YACJ,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,oCAAoC;SAC9C,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IACvD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IAEtC,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACpE,MAAM;YACJ,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,yBAAyB,QAAQ,8BAA8B;SACzE,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE7D,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IAChD,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACjD,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;IACrE,CAAC;AACH,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { Box } from "@upstash/box";
2
- import type { BoxREPLEvent } from "../types.js";
3
- /**
4
- * Execute a shell command in the box.
5
- */
6
- export declare function handleCommand(box: Box, command: string): AsyncGenerator<BoxREPLEvent>;
7
- //# sourceMappingURL=command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/repl/commands/command.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,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAQ5F"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Execute a shell command in the box.
3
- */
4
- export async function* handleCommand(box, command) {
5
- if (!command) {
6
- yield { type: "log", message: "Usage: /command <command>" };
7
- return;
8
- }
9
- const run = await box.exec.command(command);
10
- const result = run.result;
11
- if (result)
12
- yield { type: "log", message: result };
13
- }
14
- //# sourceMappingURL=command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/repl/commands/command.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,aAAa,CAAC,GAAQ,EAAE,OAAe;IAC5D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC;QAC5D,OAAO;IACT,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,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 +0,0 @@
1
- import type { Box } from "@upstash/box";
2
- import type { BoxREPLEvent } from "../types.js";
3
- /**
4
- * Execute a shell command in the box.
5
- */
6
- export declare function handleExec(box: Box, command: string): AsyncGenerator<BoxREPLEvent>;
7
- //# sourceMappingURL=exec.d.ts.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- /**
2
- * Execute a shell command in the box.
3
- */
4
- export async function* handleExec(box, command) {
5
- if (!command) {
6
- yield { type: "log", message: "Usage: exec <command>" };
7
- return;
8
- }
9
- const run = await box.exec(command);
10
- const result = run.result;
11
- if (result)
12
- yield { type: "log", message: result };
13
- }
14
- //# sourceMappingURL=exec.js.map
@@ -1 +0,0 @@
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"}