Repository navigation
Expand file tree
/
Copy pathworkspace.ts
More file actions
75 lines (65 loc) · 2.49 KB
/
Copy pathworkspace.ts
File metadata and controls
75 lines (65 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import type { TaskRecord } from './tasks'
import type { SessionLinksSnapshot, UpdateSessionLink } from './sessionBindings'
import type { Issue } from './taskDocuments/common'
import type { CreateWorkspaceTaskRequest, CreateWorkspaceTaskResult, TaskAgentInstructionsRequest, WorkspaceTaskCreationContext } from './taskCreation'
export interface WorkspaceDescriptor {
id: string
name: string
title: string
root: string
}
export interface WorkspaceSnapshot extends WorkspaceDescriptor {
tasks: TaskRecord[]
warnings: string[]
diagnostics?: Array<Omit<Issue, 'code'> & { code: string; line?: number }>
loadedAt: string
}
export interface WorkspaceState {
current: WorkspaceSnapshot | null
recent: WorkspaceDescriptor[]
warning?: string
}
export const workspaceRepositoryNameLimit = 60
export interface CreateWorkspaceRepositoryRequest {
parentPath: string
name: string
}
export interface RepositoryPushRequest {
workspaceId: string
remoteUrl: string
}
export type RepositoryCredentialHelper = 'gcm' | 'configured' | 'none'
export interface WorkspaceRepositoryPushPlan {
workspaceId: string
branch: string
head: string
remoteUrl: string
repositoryUrl: string
shell: 'powershell' | 'posix'
commands: string
}
export interface WorkspaceRepositoryStatus {
workspaceId: string
name: string
branch: string | null
remoteUrl: string | null
credentialHelper: RepositoryCredentialHelper
}
export interface WorkspaceBridge {
getState(): Promise<WorkspaceState>
openFolder(): Promise<WorkspaceState | null>
chooseParentFolder(): Promise<string | null>
createRepository(request: CreateWorkspaceRepositoryRequest): Promise<WorkspaceState>
getTaskCreationContext(workspaceId: string): Promise<WorkspaceTaskCreationContext>
createTask(request: CreateWorkspaceTaskRequest): Promise<CreateWorkspaceTaskResult>
getTaskAgentInstructions(request: TaskAgentInstructionsRequest): Promise<string>
getRepositoryStatus(workspaceId: string): Promise<WorkspaceRepositoryStatus>
openRepositoryCreation(workspaceId: string): Promise<void>
getRepositoryPushPlan(request: RepositoryPushRequest): Promise<WorkspaceRepositoryPushPlan>
verifyRepositoryPublication(request: RepositoryPushRequest): Promise<{ url: string }>
openRecent(id: string): Promise<WorkspaceState>
refresh(): Promise<WorkspaceState>
closeWorkspace(): Promise<WorkspaceState>
getSessionLinks(workspaceId: string): Promise<SessionLinksSnapshot>
updateSessionLink(request: UpdateSessionLink): Promise<SessionLinksSnapshot>
}