From 0018fd041ffcee51a78f32af8a05ca7c77aaeeeb Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Mon, 7 Sep 2026 15:43:19 -0400 Subject: [PATCH] refactor(mobile): delete the workspace and account contracts nothing imports Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- .../mobile-web-bridge-subscription-client.ts | 5 ---- .../mobile-web-bridge-subscription-setup.ts | 19 ------------- .../mobile-web/account-operation-contract.ts | 3 --- .../workspace-presentation-contract.ts | 27 ------------------- 4 files changed, 54 deletions(-) diff --git a/src/mobile-web/src/mobile-web-bridge-subscription-client.ts b/src/mobile-web/src/mobile-web-bridge-subscription-client.ts index 46acb9facb9..874b2d39ac1 100644 --- a/src/mobile-web/src/mobile-web-bridge-subscription-client.ts +++ b/src/mobile-web/src/mobile-web-bridge-subscription-client.ts @@ -18,7 +18,6 @@ import type { import { MobileWebBridgeClientError } from './mobile-web-bridge-client-error' import { deliverMobileWebSubscriptionEvent } from './mobile-web-bridge-subscription-event-delivery' import { - accountSubscriptionSetup, terminalSubscriptionSetup, browserSubscriptionSetup, speechSubscriptionSetup, @@ -77,10 +76,6 @@ export class MobileWebBridgeSubscriptionClient { return subscribeMobileWebHostWorkspace(this, onEvent, onError) } - subscribeAccount(...args: Parameters) { - return this.subscribeWith(accountSubscriptionSetup(...args)) - } - subscribeTerminal( payload: Extract, onEvent: (event: MobileWebTerminalEvent) => void, diff --git a/src/mobile-web/src/mobile-web-bridge-subscription-setup.ts b/src/mobile-web/src/mobile-web-bridge-subscription-setup.ts index b98cdae14ea..8a9aeaa2359 100644 --- a/src/mobile-web/src/mobile-web-bridge-subscription-setup.ts +++ b/src/mobile-web/src/mobile-web-bridge-subscription-setup.ts @@ -6,11 +6,6 @@ import { } from '../../shared/mobile-web/terminal-stream-contract' import type { z } from 'zod' import type { MobileWebBridgeCapability } from '../../shared/mobile-web/bridge-contract' -import { - MobileWebAccountEventSchema, - MobileWebAccountSubscribePayloadSchema, - type MobileWebAccountEvent -} from '../../shared/mobile-web/account-operation-contract' import type { MobileWebBridgeClientError } from './mobile-web-bridge-client-error' import { MobileWebBrowserEventSchema, @@ -34,20 +29,6 @@ export type MobileWebBridgeSubscriptionSetup = { onError: (error: MobileWebBridgeClientError) => void } -export function accountSubscriptionSetup( - onEvent: (event: MobileWebAccountEvent) => void, - onError: (error: MobileWebBridgeClientError) => void -): MobileWebBridgeSubscriptionSetup { - return { - capability: 'account', - payload: {}, - payloadSchema: MobileWebAccountSubscribePayloadSchema, - eventSchema: MobileWebAccountEventSchema, - onEvent: (value) => onEvent(value as MobileWebAccountEvent), - onError - } -} - export function speechSubscriptionSetup( onEvent: (event: MobileWebSpeechEvent) => void, onError: (error: MobileWebBridgeClientError) => void diff --git a/src/shared/mobile-web/account-operation-contract.ts b/src/shared/mobile-web/account-operation-contract.ts index 375ddd3e038..8fab06e9196 100644 --- a/src/shared/mobile-web/account-operation-contract.ts +++ b/src/shared/mobile-web/account-operation-contract.ts @@ -156,7 +156,6 @@ export const MobileWebCodexResetCreditExpectedScopeSchema = z } }) -export const MobileWebAccountSnapshotPayloadSchema = z.object({}).strict() export const MobileWebAccountSelectPayloadSchema = z .object({ provider: z.enum(['claude', 'codex']), @@ -164,7 +163,6 @@ export const MobileWebAccountSelectPayloadSchema = z codexTarget: MobileWebRateLimitRuntimeTargetSchema.optional() }) .strict() -export const MobileWebAccountSelectResultSchema = z.null() export const MobileWebAccountResetCapabilityPayloadSchema = z.object({}).strict() export const MobileWebAccountResetCapabilityResultSchema = z.boolean() export const MobileWebAccountConsumeResetPayloadSchema = z @@ -204,7 +202,6 @@ export const MobileWebAccountConsumeResetResultSchema = z.union([ MobileWebAccountConsumedResetResultSchema, MobileWebAccountRejectedResetResultSchema ]) -export const MobileWebAccountSubscribePayloadSchema = z.object({}).strict() export const MobileWebAccountEventSchema = z.discriminatedUnion('type', [ z.object({ type: z.enum(['ready', 'snapshot']), diff --git a/src/shared/mobile-web/workspace-presentation-contract.ts b/src/shared/mobile-web/workspace-presentation-contract.ts index 0f10dddef70..5dccaebe3e5 100644 --- a/src/shared/mobile-web/workspace-presentation-contract.ts +++ b/src/shared/mobile-web/workspace-presentation-contract.ts @@ -19,22 +19,6 @@ const MobileWebRepoIconSchema = z.discriminatedUnion('type', [ .strict() ]) -export const MobileWebRepositoryPresentationSchema = z - .object({ - id: MobileWebRepoIdSchema, - displayName: z.string().min(1).max(240), - badgeColor: z.string().max(64).optional(), - repoIcon: MobileWebRepoIconSchema.nullable().optional() - }) - .strict() - -export const MobileWebWorkspaceRepositoriesResultSchema = z - .object({ - repositories: z.array(MobileWebRepositoryPresentationSchema).max(MOBILE_WEB_REPOSITORY_LIMIT), - truncated: z.boolean() - }) - .strict() - const MobileWebHostUpstreamSchema = z .object({ owner: z.string().max(240), @@ -101,13 +85,6 @@ export const MobileWebWorkspaceViewSettingsSchema = z.object({ .catch(undefined) }) -export const MobileWebWorkspaceSettingsSnapshotPayloadSchema = z.object({}).strict() -export const MobileWebWorkspaceSettingsSnapshotResultSchema = z - .object({ settings: MobileWebWorkspaceViewSettingsSchema.nullable() }) - .strict() -export const MobileWebWorkspaceSettingsUpdatePayloadSchema = MobileWebWorkspaceViewSettingsSchema -export const MobileWebWorkspaceSettingsUpdateResultSchema = z.null() - export const MobileWebWorkspaceUpdatePayloadSchema = z.discriminatedUnion('mutation', [ z .object({ @@ -135,16 +112,12 @@ export const MobileWebWorkspaceRemoveResultSchema = z .object({ workspaceId: MobileWebWorkspaceIdSchema, removed: z.literal(true) }) .strict() -export const MobileWebWorkspaceSubscribePayloadSchema = z.object({}).strict() export const MobileWebWorkspaceChangeSchema = z .object({ type: z.enum(['ready', 'end', 'reposChanged', 'worktreesChanged', 'error']) }) .strict() -export type MobileWebWorkspaceRepositoriesResult = z.infer< - typeof MobileWebWorkspaceRepositoriesResultSchema -> export type MobileWebWorkspaceViewSettings = z.infer export type MobileWebWorkspaceUpdatePayload = z.infer export type MobileWebWorkspaceUpdateResult = z.infer