@indigoai-us/hq-cli 5.57.0 → 5.58.1

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.
@@ -19,11 +19,9 @@ describe("SandboxRunnerClient", () => {
19
19
  });
20
20
 
21
21
  const result = await client.startJob("jwt-token", {
22
- skillId: "my-skill",
23
22
  companyUid: "cmp_123",
24
- args: { argv: ["--x"] },
25
- only: ["API_KEY"],
26
- usage: { channel: "sandbox" },
23
+ secretNames: ["API_KEY"],
24
+ command: "node script.js --x",
27
25
  });
28
26
 
29
27
  expect(result).toEqual({ jobId: "job_1", status: "queued" });
@@ -34,11 +32,9 @@ describe("SandboxRunnerClient", () => {
34
32
  "Content-Type": "application/json",
35
33
  },
36
34
  body: JSON.stringify({
37
- skillId: "my-skill",
38
35
  companyUid: "cmp_123",
39
- args: { argv: ["--x"] },
40
- only: ["API_KEY"],
41
- usage: { channel: "sandbox" },
36
+ secretNames: ["API_KEY"],
37
+ command: "node script.js --x",
42
38
  }),
43
39
  });
44
40
  });
@@ -49,7 +45,13 @@ describe("SandboxRunnerClient", () => {
49
45
  .mockResolvedValueOnce(jsonRes({ jobId: "job_1", status: "queued" }))
50
46
  .mockResolvedValueOnce(jsonRes({ jobId: "job_1", status: "running" }))
51
47
  .mockResolvedValueOnce(
52
- jsonRes({ jobId: "job_1", status: "succeeded", stdout: "ok\n" }),
48
+ jsonRes({
49
+ jobId: "job_1",
50
+ status: "succeeded",
51
+ output: "ok\n",
52
+ exitCode: 0,
53
+ success: true,
54
+ }),
53
55
  );
54
56
  const client = new SandboxRunnerClient({
55
57
  baseUrl: "https://runner.example",
@@ -63,11 +65,9 @@ describe("SandboxRunnerClient", () => {
63
65
  expect(result).toEqual({
64
66
  jobId: "job_1",
65
67
  status: "succeeded",
66
- stdout: "ok\n",
67
- stderr: undefined,
68
- logsTail: undefined,
69
- exitCode: undefined,
70
- error: undefined,
68
+ output: "ok\n",
69
+ exitCode: 0,
70
+ success: true,
71
71
  });
72
72
  expect(fetchImpl).toHaveBeenCalledTimes(3);
73
73
  expect(fetchImpl).toHaveBeenNthCalledWith(
@@ -82,9 +82,9 @@ describe("SandboxRunnerClient", () => {
82
82
  jsonRes({
83
83
  jobId: "job_1",
84
84
  status: "failed",
85
- stderr: "boom\n",
85
+ output: "boom\n",
86
86
  exitCode: 2,
87
- error: "command failed",
87
+ success: false,
88
88
  }),
89
89
  );
90
90
  const client = new SandboxRunnerClient({
@@ -97,15 +97,15 @@ describe("SandboxRunnerClient", () => {
97
97
  ).resolves.toMatchObject({
98
98
  jobId: "job_1",
99
99
  status: "failed",
100
- stderr: "boom\n",
100
+ output: "boom\n",
101
101
  exitCode: 2,
102
- error: "command failed",
102
+ success: false,
103
103
  });
104
104
  });
105
105
 
106
106
  it("uses the requested job id when the live status response omits it", async () => {
107
107
  const fetchImpl = vi.fn<typeof fetch>(async () =>
108
- jsonRes({ status: "succeeded", logsTail: "ok\n" }),
108
+ jsonRes({ status: "succeeded", output: "ok\n" }),
109
109
  );
110
110
  const client = new SandboxRunnerClient({
111
111
  baseUrl: "https://runner.example",
@@ -115,11 +115,9 @@ describe("SandboxRunnerClient", () => {
115
115
  await expect(client.getJob("jwt-token", "job_live")).resolves.toEqual({
116
116
  jobId: "job_live",
117
117
  status: "succeeded",
118
- stdout: undefined,
119
- stderr: undefined,
120
- logsTail: "ok\n",
118
+ output: "ok\n",
121
119
  exitCode: undefined,
122
- error: undefined,
120
+ success: undefined,
123
121
  });
124
122
  });
125
123
  });
@@ -1,12 +1,9 @@
1
1
  export type SandboxRunnerState = "queued" | "running" | "succeeded" | "failed";
2
2
 
3
3
  export interface SandboxRunnerStartRequest {
4
- skillId: string;
5
4
  companyUid: string;
6
- args?: Record<string, unknown>;
7
- companySlug?: string;
8
- only?: string[];
9
- usage?: unknown;
5
+ secretNames: string[];
6
+ command: string;
10
7
  }
11
8
 
12
9
  export interface SandboxRunnerStartResponse {
@@ -17,11 +14,9 @@ export interface SandboxRunnerStartResponse {
17
14
  export interface SandboxRunnerJob {
18
15
  jobId: string;
19
16
  status: SandboxRunnerState;
20
- stdout?: string;
21
- stderr?: string;
22
- logsTail?: string;
17
+ output?: string;
23
18
  exitCode?: number;
24
- error?: string;
19
+ success?: boolean;
25
20
  }
26
21
 
27
22
  export interface SandboxRunnerClientOptions {
@@ -70,23 +65,15 @@ function normalizeJob(
70
65
  if (!isSandboxRunnerState(status)) {
71
66
  throw new Error("Sandbox Runner returned an invalid job status.");
72
67
  }
73
- const output =
74
- typeof body.stdout === "string"
75
- ? body.stdout
76
- : typeof body.output === "string"
77
- ? body.output
78
- : undefined;
79
68
  return {
80
69
  jobId:
81
70
  typeof body.jobId === "string" && body.jobId.length > 0
82
71
  ? body.jobId
83
72
  : jobIdFallback ?? requireString(body, "jobId"),
84
73
  status,
85
- stdout: output,
86
- stderr: typeof body.stderr === "string" ? body.stderr : undefined,
87
- logsTail: typeof body.logsTail === "string" ? body.logsTail : undefined,
74
+ output: typeof body.output === "string" ? body.output : undefined,
88
75
  exitCode: typeof body.exitCode === "number" ? body.exitCode : undefined,
89
- error: typeof body.error === "string" ? body.error : undefined,
76
+ success: typeof body.success === "boolean" ? body.success : undefined,
90
77
  };
91
78
  }
92
79