diff --git a/apps/cli/package.json b/apps/cli/package.json index 583d7523f68..21846a7a05f 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -55,4 +55,4 @@ } }, "prettier": "@vdemedes/prettier-config" -} \ No newline at end of file +} diff --git a/apps/cli/src/types/environment.ts b/apps/cli/src/types/environment.ts new file mode 100644 index 00000000000..72bc66e50bc --- /dev/null +++ b/apps/cli/src/types/environment.ts @@ -0,0 +1,14 @@ +export interface Environment { + id: string; + gitRef: string; +} + +export interface EnvironmentOrchestrator { + get: (id: string) => Promise; + list: () => Promise; + create: (gitRef: string) => Promise; + update: (id: string, environment: Partial) => void; + + // Danger + delete: (id: string) => void; +} diff --git a/apps/cli/src/types/index.ts b/apps/cli/src/types/index.ts index 7f2977a994c..46b1a03be12 100644 --- a/apps/cli/src/types/index.ts +++ b/apps/cli/src/types/index.ts @@ -1,80 +1,3 @@ -export interface Environment { - id: string; - gitRef: string; -} - -export enum WorkspaceType { - LOCAL = "local", - CLOUD = "cloud", -} - -export interface Workspace { - id: string; - type: WorkspaceType; - environmentId: string; -} - -export interface LocalWorkspace extends Workspace { - type: WorkspaceType.LOCAL; - path: string; -} - -export enum ProcessType { - AGENT = "agent", - TERMINAL = "terminal", -} - -export interface Process { - id: string; - type: ProcessType; - workspaceId: string; - - // Metadata - title: string; - createdAt: Date; - updatedAt: Date; - endedAt?: Date; -} - -export interface Terminal extends Process { - // placeholder -} - -export enum AgentType { - CODEX = "codex", - CLAUDE = "claude", -} - -export interface Agent extends Process { - agentType: AgentType; - status: "idle" | "running" | "stopped" | "error"; -} - -export interface WorkspaceOrchestrator { - get: (id: string) => Promise; - list: () => Promise; - - // Note: For cloud, will need more optional params - create: (type: WorkspaceType, path?: string) => Promise; - update: (id: string, workspace: Partial) => void; - - // Danger - delete: (id: string) => void; -} - -export interface ProcessOrchestrator { - get: (id: string) => Promise; - list: () => Promise; - - create: ( - type: ProcessType, - workspace: Workspace, - agentType?: AgentType, - ) => Promise; - update: (id: string, process: Partial) => void; - stop: (id: string) => void; - stopAll: () => void; - - // Danger - delete: (id: string) => void; -} +export * from "./environment"; +export * from "./workspace"; +export * from "./process"; diff --git a/apps/cli/src/types/process.ts b/apps/cli/src/types/process.ts new file mode 100644 index 00000000000..90ba7ae3ac5 --- /dev/null +++ b/apps/cli/src/types/process.ts @@ -0,0 +1,49 @@ +import type { Workspace } from "./workspace"; + +export enum ProcessType { + AGENT = "agent", + TERMINAL = "terminal", +} + +export interface Process { + id: string; + type: ProcessType; + workspaceId: string; + + // Metadata + title: string; + createdAt: Date; + updatedAt: Date; + endedAt?: Date; +} + +export interface Terminal extends Process { + // Placeholder +} + +export enum AgentType { + CODEX = "codex", + CLAUDE = "claude", +} + +export interface Agent extends Process { + agentType: AgentType; + status: "idle" | "running" | "stopped" | "error"; +} + +export interface ProcessOrchestrator { + get: (id: string) => Promise; + list: () => Promise; + + create: ( + type: ProcessType, + workspace: Workspace, + agentType?: AgentType, + ) => Promise; + update: (id: string, process: Partial) => void; + stop: (id: string) => void; + stopAll: () => void; + + // Danger + delete: (id: string) => void; +} diff --git a/apps/cli/src/types/workspace.ts b/apps/cli/src/types/workspace.ts new file mode 100644 index 00000000000..dd6d4caff36 --- /dev/null +++ b/apps/cli/src/types/workspace.ts @@ -0,0 +1,33 @@ +import type { Environment } from "./environment"; + +export enum WorkspaceType { + LOCAL = "local", + CLOUD = "cloud", +} + +export interface Workspace { + id: string; + type: WorkspaceType; + environmentId: string; +} + +export interface LocalWorkspace extends Workspace { + type: WorkspaceType.LOCAL; + path: string; +} + +export interface WorkspaceOrchestrator { + get: (id: string) => Promise; + list: (environmentId?: string) => Promise; + + // Note: For cloud, will need more optional params + create: ( + environmentId: string, + type: WorkspaceType, + path?: string, + ) => Promise; + update: (id: string, workspace: Partial) => void; + + // Danger + delete: (id: string) => void; +} diff --git a/apps/cli/tsconfig.json b/apps/cli/tsconfig.json index 8306839ec6d..caaf595e540 100644 --- a/apps/cli/tsconfig.json +++ b/apps/cli/tsconfig.json @@ -1,11 +1,10 @@ { - "extends": "@sindresorhus/tsconfig", + "extends": "@superset/typescript/react-library.json", "compilerOptions": { "outDir": "dist", - "skipLibCheck": true, + "noEmit": false, + "allowImportingTsExtensions": false, "types": [] }, - "include": [ - "src" - ] -} \ No newline at end of file + "include": ["src"] +}