From f31d54cb7f7d5d3c98f989a40a5c893699a0c045 Mon Sep 17 00:00:00 2001 From: hbrooks Date: Mon, 27 Jul 2026 14:34:44 -0400 Subject: [PATCH 1/2] variable: call the new /v1/variables routes The API moved variables out of the sandboxes namespace (ellipsis#6002, live in prod), matching where the CLI verb and the dashboard page already put them. The old paths now 404, so this is the client half of the same move. No fallback to the old paths: variables are pre-customer and this CLI is their only client. --- src/commands/variable.ts | 6 +++--- src/lib/api.ts | 17 ++++++----------- test/api.test.ts | 6 +++--- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/commands/variable.ts b/src/commands/variable.ts index a6b35a4..d61f02e 100644 --- a/src/commands/variable.ts +++ b/src/commands/variable.ts @@ -20,7 +20,7 @@ export function registerVariable(program: Command): void { variable.command('list').description('List the variable names (never their values)'), 'ls', ), - 'GET /v1/sandboxes/variables', + 'GET /v1/variables', ) .option('--json', 'output raw JSON') .action(async (opts: { json?: boolean }) => { @@ -34,7 +34,7 @@ export function registerVariable(program: Command): void { variable .command('set [assignments...]') .description('Create or update variables, e.g. `set A=1 B=2`'), - 'PUT /v1/sandboxes/variables', + 'PUT /v1/variables', ) .option('-f, --from-file ', 'load variables from a .env or .json file') .option('--json', 'output raw JSON') @@ -52,7 +52,7 @@ export function registerVariable(program: Command): void { apiRoutes( alsoKnownAs(variable.command('delete ').description('Delete a variable'), 'rm'), - 'DELETE /v1/sandboxes/variables/{name}', + 'DELETE /v1/variables/{name}', ) .option('--json', 'output raw JSON') .action(async (name: string, opts: { json?: boolean }) => { diff --git a/src/lib/api.ts b/src/lib/api.ts index 4ae1582..5e79d61 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -400,33 +400,28 @@ export class ApiClient { return this.request('DELETE', '/v1/defaults', undefined, { repository }) } - // -------------------------- sandbox variables --------------------------- + // ------------------------------- variables -------------------------------- // All three return the full current list (the backend echoes it after every // mutation), so callers can render the resulting state. async listSandboxVariables(): Promise { - const res = await this.request( - 'GET', - '/v1/sandboxes/variables', - ) + const res = await this.request('GET', '/v1/variables') return res.variables } async putSandboxVariables( variables: SandboxVariableInput[], ): Promise { - const res = await this.request( - 'PUT', - '/v1/sandboxes/variables', - { variables }, - ) + const res = await this.request('PUT', '/v1/variables', { + variables, + }) return res.variables } async deleteSandboxVariable(name: string): Promise { const res = await this.request( 'DELETE', - `/v1/sandboxes/variables/${encodeURIComponent(name)}`, + `/v1/variables/${encodeURIComponent(name)}`, ) return res.variables } diff --git a/test/api.test.ts b/test/api.test.ts index 5035351..1741e13 100644 --- a/test/api.test.ts +++ b/test/api.test.ts @@ -160,7 +160,7 @@ describe('ApiClient sandbox variables', () => { const out = await new ApiClient('http://api.test', 't').listSandboxVariables() expect(out).toEqual([{ name: 'A', created_at: '', updated_at: '' }]) - expect(fetchMock.mock.calls[0][0]).toBe('http://api.test/v1/sandboxes/variables') + expect(fetchMock.mock.calls[0][0]).toBe('http://api.test/v1/variables') expect((fetchMock.mock.calls[0][1] as RequestInit).method).toBe('GET') }) @@ -172,7 +172,7 @@ describe('ApiClient sandbox variables', () => { await new ApiClient('http://api.test', 't').putSandboxVariables([{ name: 'TOKEN', value: 'x' }]) const [url, init] = fetchMock.mock.calls[0] - expect(url).toBe('http://api.test/v1/sandboxes/variables') + expect(url).toBe('http://api.test/v1/variables') expect((init as RequestInit).method).toBe('PUT') expect(JSON.parse((init as RequestInit).body as string)).toEqual({ variables: [{ name: 'TOKEN', value: 'x' }], @@ -187,7 +187,7 @@ describe('ApiClient sandbox variables', () => { await new ApiClient('http://api.test', 't').deleteSandboxVariable('MY/VAR') const [url, init] = fetchMock.mock.calls[0] - expect(url).toBe('http://api.test/v1/sandboxes/variables/MY%2FVAR') + expect(url).toBe('http://api.test/v1/variables/MY%2FVAR') expect((init as RequestInit).method).toBe('DELETE') }) }) From 47e1ffcfc631e2460b644af8cf162e807fb2d871 Mon Sep 17 00:00:00 2001 From: hbrooks Date: Mon, 27 Jul 2026 14:38:09 -0400 Subject: [PATCH 2/2] deps: @ellipsis-dev/sdk 0.5.0 Picks up missing_sandbox_variables in AgentSessionExitStatus. Nothing here narrows to that union yet (exit_status is still a plain string), but the CLI should track the published SDK rather than drift a major behind. --- bun.lock | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bun.lock b/bun.lock index 87f0e0b..daaa242 100644 --- a/bun.lock +++ b/bun.lock @@ -5,7 +5,7 @@ "": { "name": "@ellipsis/cli", "dependencies": { - "@ellipsis-dev/sdk": "^0.4.0", + "@ellipsis-dev/sdk": "^0.5.0", "chalk": "^5.6.2", "cli-table3": "^0.6.5", "commander": "^12.1.0", @@ -35,7 +35,7 @@ "@colors/colors": ["@colors/colors@1.5.0", "", {}, "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ=="], - "@ellipsis-dev/sdk": ["@ellipsis-dev/sdk@0.4.0", "", {}, "sha512-9BdMBn7bDOsffJ9i8EyPxchBMnxOqxWwCzTJgIZOQHu6PE6VgIQ4MrBs1FzFx4nrVmLYmpR9hHEmwnsRoX4X4g=="], + "@ellipsis-dev/sdk": ["@ellipsis-dev/sdk@0.5.0", "", {}, "sha512-14g9g9Mrt10hfoPpaqeIqZsr8vsDYkBtIwdkd6Rz/3Izs5pvtVm4zys5znRL9UH8dC+R02B1Ljz2AGKGrtEEsQ=="], "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.27.7", "", { "os": "aix", "cpu": "ppc64" }, "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg=="], diff --git a/package.json b/package.json index 17bb34e..1984a10 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test:watch": "vitest" }, "dependencies": { - "@ellipsis-dev/sdk": "^0.4.0", + "@ellipsis-dev/sdk": "^0.5.0", "chalk": "^5.6.2", "cli-table3": "^0.6.5", "commander": "^12.1.0",