Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
}
},
"prettier": "@vdemedes/prettier-config"
}
}
14 changes: 14 additions & 0 deletions apps/cli/src/types/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface Environment {
id: string;
gitRef: string;
}

export interface EnvironmentOrchestrator {
get: (id: string) => Promise<Environment>;
list: () => Promise<Environment[]>;
create: (gitRef: string) => Promise<Environment>;
update: (id: string, environment: Partial<Environment>) => void;

// Danger
delete: (id: string) => void;
}
83 changes: 3 additions & 80 deletions apps/cli/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -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<Workspace>;
list: () => Promise<Workspace[]>;

// Note: For cloud, will need more optional params
create: (type: WorkspaceType, path?: string) => Promise<Workspace>;
update: (id: string, workspace: Partial<Workspace>) => void;

// Danger
delete: (id: string) => void;
}

export interface ProcessOrchestrator {
get: (id: string) => Promise<Process>;
list: () => Promise<Process[]>;

create: (
type: ProcessType,
workspace: Workspace,
agentType?: AgentType,
) => Promise<Process>;
update: (id: string, process: Partial<Process>) => void;
stop: (id: string) => void;
stopAll: () => void;

// Danger
delete: (id: string) => void;
}
export * from "./environment";
export * from "./workspace";
export * from "./process";
49 changes: 49 additions & 0 deletions apps/cli/src/types/process.ts
Original file line number Diff line number Diff line change
@@ -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<Process>;
list: () => Promise<Process[]>;

create: (
type: ProcessType,
workspace: Workspace,
agentType?: AgentType,
) => Promise<Process>;
update: (id: string, process: Partial<Process>) => void;
stop: (id: string) => void;
stopAll: () => void;

// Danger
delete: (id: string) => void;
}
33 changes: 33 additions & 0 deletions apps/cli/src/types/workspace.ts
Original file line number Diff line number Diff line change
@@ -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<Workspace>;
list: (environmentId?: string) => Promise<Workspace[]>;

// Note: For cloud, will need more optional params
create: (
environmentId: string,
type: WorkspaceType,
path?: string,
) => Promise<Workspace>;
update: (id: string, workspace: Partial<Workspace>) => void;

// Danger
delete: (id: string) => void;
}
11 changes: 5 additions & 6 deletions apps/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
"include": ["src"]
}
Loading