From bc072d0f630715ecab929a1a2435fb741d75a74a Mon Sep 17 00:00:00 2001 From: Greg Pstrucha <875316+Gricha@users.noreply.github.com> Date: Tue, 6 Jan 2026 18:48:32 +0000 Subject: [PATCH] Add clone parameter support to startWorkspace in web and mobile clients MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the `--clone` flag was only supported in the CLI's `perry start` command and worked correctly on the backend. However, the web and mobile API clients had type definitions and function signatures for `startWorkspace` that didn't include the `clone` parameter, preventing UI clients from passing repository URLs when starting workspaces. This change updates both web and mobile API clients to: - Add `clone` and `env` optional parameters to the `start` RPC type definition - Update the `startWorkspace` function to accept and pass through these options This aligns the web/mobile clients with the CLI behavior where `perry start --clone ` creates a workspace with a repository if it doesn't exist. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- mobile/src/lib/api.ts | 5 +++-- web/src/lib/api.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mobile/src/lib/api.ts b/mobile/src/lib/api.ts index 42f5b1fc..c3942245 100644 --- a/mobile/src/lib/api.ts +++ b/mobile/src/lib/api.ts @@ -151,7 +151,7 @@ function createClient() { get: (input: { name: string }) => Promise create: (input: CreateWorkspaceRequest) => Promise delete: (input: { name: string }) => Promise<{ success: boolean }> - start: (input: { name: string }) => Promise + start: (input: { name: string; clone?: string; env?: Record }) => Promise stop: (input: { name: string }) => Promise logs: (input: { name: string; tail?: number }) => Promise sync: (input: { name: string }) => Promise<{ success: boolean }> @@ -230,7 +230,8 @@ export const api = { getWorkspace: (name: string) => client.workspaces.get({ name }), createWorkspace: (data: CreateWorkspaceRequest) => client.workspaces.create(data), deleteWorkspace: (name: string) => client.workspaces.delete({ name }), - startWorkspace: (name: string) => client.workspaces.start({ name }), + startWorkspace: (name: string, options?: { clone?: string; env?: Record }) => + client.workspaces.start({ name, clone: options?.clone, env: options?.env }), stopWorkspace: (name: string) => client.workspaces.stop({ name }), getLogs: (name: string, tail = 100) => client.workspaces.logs({ name, tail }), syncWorkspace: (name: string) => client.workspaces.sync({ name }), diff --git a/web/src/lib/api.ts b/web/src/lib/api.ts index 4417f95e..ac8cb52f 100644 --- a/web/src/lib/api.ts +++ b/web/src/lib/api.ts @@ -53,7 +53,7 @@ const client = createORPCClient<{ get: (input: { name: string }) => Promise create: (input: CreateWorkspaceRequest) => Promise delete: (input: { name: string }) => Promise<{ success: boolean }> - start: (input: { name: string }) => Promise + start: (input: { name: string; clone?: string; env?: Record }) => Promise stop: (input: { name: string }) => Promise logs: (input: { name: string; tail?: number }) => Promise sync: (input: { name: string }) => Promise<{ success: boolean }> @@ -107,7 +107,8 @@ export const api = { getWorkspace: (name: string) => client.workspaces.get({ name }), createWorkspace: (data: CreateWorkspaceRequest) => client.workspaces.create(data), deleteWorkspace: (name: string) => client.workspaces.delete({ name }), - startWorkspace: (name: string) => client.workspaces.start({ name }), + startWorkspace: (name: string, options?: { clone?: string; env?: Record }) => + client.workspaces.start({ name, clone: options?.clone, env: options?.env }), stopWorkspace: (name: string) => client.workspaces.stop({ name }), getLogs: (name: string, tail = 100) => client.workspaces.logs({ name, tail }), syncWorkspace: (name: string) => client.workspaces.sync({ name }),