@geteigen/cli 0.0.0-stage → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +154 -2
- package/dist/agent.d.ts +32 -0
- package/dist/agent.js +246 -0
- package/dist/auth.d.ts +5 -0
- package/dist/auth.js +33 -0
- package/dist/cli/src/agent.d.ts +24 -0
- package/dist/cli/src/agent.js +263 -0
- package/dist/cli/src/agentTools.d.ts +6 -0
- package/dist/cli/src/agentTools.js +104 -0
- package/dist/cli/src/auth.d.ts +5 -0
- package/dist/cli/src/auth.js +33 -0
- package/dist/cli/src/cliEnv.d.ts +6 -0
- package/dist/cli/src/cliEnv.js +26 -0
- package/dist/cli/src/config.d.ts +11 -0
- package/dist/cli/src/config.js +51 -0
- package/dist/cli/src/cursorAuth.d.ts +10 -0
- package/dist/cli/src/cursorAuth.js +92 -0
- package/dist/cli/src/gitAuthEnv.d.ts +5 -0
- package/dist/cli/src/gitAuthEnv.js +35 -0
- package/dist/cli/src/index.d.ts +2 -0
- package/dist/cli/src/index.js +244 -0
- package/dist/cli/src/listModels.d.ts +14 -0
- package/dist/cli/src/listModels.js +196 -0
- package/dist/cli/src/listSessions.d.ts +9 -0
- package/dist/cli/src/listSessions.js +37 -0
- package/dist/cli/src/machineConfig.d.ts +20 -0
- package/dist/cli/src/machineConfig.js +66 -0
- package/dist/cli/src/pickFolder.d.ts +5 -0
- package/dist/cli/src/pickFolder.js +65 -0
- package/dist/cli/src/proc.d.ts +31 -0
- package/dist/cli/src/proc.js +97 -0
- package/dist/cli/src/service.d.ts +17 -0
- package/dist/cli/src/service.js +255 -0
- package/dist/cli/src/workRoots.d.ts +30 -0
- package/dist/cli/src/workRoots.js +228 -0
- package/dist/cli/src/worker.d.ts +8 -0
- package/dist/cli/src/worker.js +51 -0
- package/dist/cli/src/workerCore.d.ts +47 -0
- package/dist/cli/src/workerCore.js +721 -0
- package/dist/cli/src/workspace.d.ts +10 -0
- package/dist/cli/src/workspace.js +329 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.js +51 -0
- package/dist/cursorAuth.d.ts +10 -0
- package/dist/cursorAuth.js +95 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +108 -0
- package/dist/listModels.d.ts +6 -0
- package/dist/listModels.js +62 -0
- package/dist/listSessions.d.ts +9 -0
- package/dist/listSessions.js +37 -0
- package/dist/pickFolder.d.ts +5 -0
- package/dist/pickFolder.js +65 -0
- package/dist/shared/actionDrafts.d.ts +83 -0
- package/dist/shared/actionDrafts.js +169 -0
- package/dist/shared/agentArtifacts.d.ts +49 -0
- package/dist/shared/agentArtifacts.js +169 -0
- package/dist/shared/agentLabel.d.ts +18 -0
- package/dist/shared/agentLabel.js +22 -0
- package/dist/shared/agentMentions.d.ts +38 -0
- package/dist/shared/agentMentions.js +110 -0
- package/dist/shared/agentRepos.d.ts +28 -0
- package/dist/shared/agentRepos.js +60 -0
- package/dist/shared/agentRunStatus.d.ts +12 -0
- package/dist/shared/agentRunStatus.js +17 -0
- package/dist/shared/agentUsage.d.ts +24 -0
- package/dist/shared/agentUsage.js +139 -0
- package/dist/shared/approvals.d.ts +44 -0
- package/dist/shared/approvals.js +97 -0
- package/dist/shared/askEigen.d.ts +190 -0
- package/dist/shared/askEigen.js +76 -0
- package/dist/shared/attribution.d.ts +25 -0
- package/dist/shared/attribution.js +63 -0
- package/dist/shared/automations.d.ts +135 -0
- package/dist/shared/automations.js +553 -0
- package/dist/shared/backends/claudeCode.d.ts +44 -0
- package/dist/shared/backends/claudeCode.js +548 -0
- package/dist/shared/backends/codex.d.ts +15 -0
- package/dist/shared/backends/codex.js +287 -0
- package/dist/shared/backends/cursor.d.ts +111 -0
- package/dist/shared/backends/cursor.js +1216 -0
- package/dist/shared/backends/index.d.ts +18 -0
- package/dist/shared/backends/index.js +58 -0
- package/dist/shared/backends/opencode.d.ts +43 -0
- package/dist/shared/backends/opencode.js +415 -0
- package/dist/shared/backends/types.d.ts +171 -0
- package/dist/shared/backends/types.js +19 -0
- package/dist/shared/backends/usage.d.ts +8 -0
- package/dist/shared/backends/usage.js +71 -0
- package/dist/shared/billingPlans.d.ts +60 -0
- package/dist/shared/billingPlans.js +262 -0
- package/dist/shared/brain.d.ts +353 -0
- package/dist/shared/brain.js +487 -0
- package/dist/shared/clarifyingQuestions.d.ts +13 -0
- package/dist/shared/clarifyingQuestions.js +207 -0
- package/dist/shared/claudeModels.d.ts +10 -0
- package/dist/shared/claudeModels.js +52 -0
- package/dist/shared/cloudBackends.d.ts +21 -0
- package/dist/shared/cloudBackends.js +29 -0
- package/dist/shared/codexModels.d.ts +10 -0
- package/dist/shared/codexModels.js +28 -0
- package/dist/shared/contextWindows.d.ts +2 -0
- package/dist/shared/contextWindows.js +30 -0
- package/dist/shared/cursorMcpConfig.d.ts +14 -0
- package/dist/shared/cursorMcpConfig.js +43 -0
- package/dist/shared/cursorProjectMcp.d.ts +10 -0
- package/dist/shared/cursorProjectMcp.js +42 -0
- package/dist/shared/docs.d.ts +59 -0
- package/dist/shared/docs.js +87 -0
- package/dist/shared/events.d.ts +932 -0
- package/dist/shared/events.js +57 -0
- package/dist/shared/integrations.d.ts +266 -0
- package/dist/shared/integrations.js +449 -0
- package/dist/shared/issueTranscript.d.ts +64 -0
- package/dist/shared/issueTranscript.js +387 -0
- package/dist/shared/issues.d.ts +139 -0
- package/dist/shared/issues.js +217 -0
- package/dist/shared/machines.d.ts +119 -0
- package/dist/shared/machines.js +58 -0
- package/dist/shared/markdownMedia.d.ts +13 -0
- package/dist/shared/markdownMedia.js +41 -0
- package/dist/shared/notificationText.d.ts +6 -0
- package/dist/shared/notificationText.js +38 -0
- package/dist/shared/opencodeModels.d.ts +19 -0
- package/dist/shared/opencodeModels.js +62 -0
- package/dist/shared/opencodeSession.d.ts +7 -0
- package/dist/shared/opencodeSession.js +30 -0
- package/dist/shared/orchestration.d.ts +58 -0
- package/dist/shared/orchestration.js +12 -0
- package/dist/shared/orgs.d.ts +47 -0
- package/dist/shared/orgs.js +49 -0
- package/dist/shared/personalOrg.d.ts +5 -0
- package/dist/shared/personalOrg.js +12 -0
- package/dist/shared/plans.d.ts +3 -0
- package/dist/shared/plans.js +19 -0
- package/dist/shared/providerModels.d.ts +40 -0
- package/dist/shared/providerModels.js +503 -0
- package/dist/shared/roomAttention.d.ts +17 -0
- package/dist/shared/roomAttention.js +36 -0
- package/dist/shared/roomContext.d.ts +120 -0
- package/dist/shared/roomContext.js +133 -0
- package/dist/shared/roomPermissions.d.ts +56 -0
- package/dist/shared/roomPermissions.js +133 -0
- package/dist/shared/sessionSeats.d.ts +29 -0
- package/dist/shared/sessionSeats.js +57 -0
- package/dist/shared/slashCommands.d.ts +39 -0
- package/dist/shared/slashCommands.js +166 -0
- package/dist/shared/space.d.ts +33 -0
- package/dist/shared/space.js +54 -0
- package/dist/shared/spaceFeed.d.ts +78 -0
- package/dist/shared/spaceFeed.js +194 -0
- package/dist/shared/stringifyUnknown.d.ts +1 -0
- package/dist/shared/stringifyUnknown.js +1 -0
- package/dist/shared/swarm.d.ts +320 -0
- package/dist/shared/swarm.js +328 -0
- package/dist/shared/swarmVisual.d.ts +79 -0
- package/dist/shared/swarmVisual.js +212 -0
- package/dist/shared/terminalFilter.d.ts +13 -0
- package/dist/shared/terminalFilter.js +46 -0
- package/dist/shared/toolIntegration.d.ts +56 -0
- package/dist/shared/toolIntegration.js +180 -0
- package/dist/shared/typing.d.ts +9 -0
- package/dist/shared/typing.js +37 -0
- package/dist/shared/uploads.d.ts +31 -0
- package/dist/shared/uploads.js +65 -0
- package/dist/shared/voiceApprovals.d.ts +36 -0
- package/dist/shared/voiceApprovals.js +229 -0
- package/dist/shared/workspace.d.ts +49 -0
- package/dist/shared/workspace.js +53 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +266 -0
- package/package.json +51 -4
|
@@ -0,0 +1,932 @@
|
|
|
1
|
+
import type { ActionDraftInfo } from "./actionDrafts.js";
|
|
2
|
+
import type { DocCardInfo } from "./docs.js";
|
|
3
|
+
import type { MachineAgentTool, MachineClient, MachineDirListing } from "./machines.js";
|
|
4
|
+
import type { AgentBackendKind, RunUsage } from "./backends/types.js";
|
|
5
|
+
import type { WorkspaceGitSnapshot, WorkspacePathMatch, WorkspaceRepoEntry, WorkspaceRepoFile } from "./workspace.js";
|
|
6
|
+
import type { SpaceMessageMeta } from "./space.js";
|
|
7
|
+
import type { ApprovalMode, AgentMode, ApprovalRequestInfo } from "./approvals.js";
|
|
8
|
+
import type { ControlMode, RoomRole, RoomVisibility } from "./roomPermissions.js";
|
|
9
|
+
import type { AgentContextReceiptInfo, AutoMemoryMode, MemoryEntryInfo, RepoMapInfo, RoomContextSnapshot } from "./roomContext.js";
|
|
10
|
+
import type { WorkerPromptAttachment } from "./uploads.js";
|
|
11
|
+
import type { BrainEpochEvent, BrainMemoryEvent, BrainReceiptInfo } from "./brain.js";
|
|
12
|
+
import type { IntegrationConnectionInfo, IntegrationLeaseInfo } from "./integrations.js";
|
|
13
|
+
import type { ToolIntegrationRef } from "./toolIntegration.js";
|
|
14
|
+
import type { CliCommandCatalog } from "./slashCommands.js";
|
|
15
|
+
export type { ControlMode, RoomInviteRole, RoomRole } from "./roomPermissions.js";
|
|
16
|
+
export type { ApprovalMode, AgentMode, ApprovalStatus, ApprovalRequestInfo, } from "./approvals.js";
|
|
17
|
+
export interface Participant {
|
|
18
|
+
socketId: string;
|
|
19
|
+
name: string;
|
|
20
|
+
color: string;
|
|
21
|
+
isDriver: boolean;
|
|
22
|
+
/** Agent ids this participant currently drives. */
|
|
23
|
+
drivingAgentIds?: string[];
|
|
24
|
+
userId?: string;
|
|
25
|
+
isOwner?: boolean;
|
|
26
|
+
/** Effective collaboration role in this room. */
|
|
27
|
+
role?: RoomRole;
|
|
28
|
+
/** Profile picture URL, when the user has one. */
|
|
29
|
+
avatarUrl?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Durable room membership (online or offline). */
|
|
32
|
+
export interface RoomMemberInfo {
|
|
33
|
+
userId: string;
|
|
34
|
+
email: string;
|
|
35
|
+
name: string;
|
|
36
|
+
role: RoomRole;
|
|
37
|
+
online: boolean;
|
|
38
|
+
/** Agent ids currently driven by an online socket for this user. */
|
|
39
|
+
drivingAgentIds?: string[];
|
|
40
|
+
/** Profile picture URL, when the user has one. */
|
|
41
|
+
avatarUrl?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface SteerLogEntry {
|
|
44
|
+
sender: string;
|
|
45
|
+
color: string;
|
|
46
|
+
text: string;
|
|
47
|
+
ts: number;
|
|
48
|
+
}
|
|
49
|
+
export type ChatRole = "user" | "assistant" | "tool" | "system";
|
|
50
|
+
export type ChatStatus = "streaming" | "done" | "error";
|
|
51
|
+
export type AgentRuntime = "local" | "cloud";
|
|
52
|
+
/** cli = the local CLI's own sign-in (Cursor, Claude Code, Codex, or OpenCode). server/byok use API keys. */
|
|
53
|
+
export type AuthMode = "cli" | "server" | "byok";
|
|
54
|
+
export type AgentStatus = "idle" | "running" | "waiting_input" | "stopped" | "error";
|
|
55
|
+
/** feature = normal room agent; integrator = hidden merge agent for Integrate. */
|
|
56
|
+
export type AgentKind = "feature" | "integrator";
|
|
57
|
+
/** Billed token usage for an agent, refreshed after each run. */
|
|
58
|
+
export interface AgentUsageInfo {
|
|
59
|
+
inputTokens: number;
|
|
60
|
+
outputTokens: number;
|
|
61
|
+
cacheReadTokens: number;
|
|
62
|
+
cacheWriteTokens: number;
|
|
63
|
+
totalTokens: number;
|
|
64
|
+
reasoningTokens?: number;
|
|
65
|
+
rawCostCents?: number;
|
|
66
|
+
chargedCents?: number;
|
|
67
|
+
/** Tokens sent in the most recent run (input + cache reads/writes). */
|
|
68
|
+
contextTokens?: number;
|
|
69
|
+
/** Model context window, when known. */
|
|
70
|
+
contextWindowTokens?: number;
|
|
71
|
+
updatedAt: number;
|
|
72
|
+
}
|
|
73
|
+
export interface AgentInfo {
|
|
74
|
+
id: string;
|
|
75
|
+
roomId: string;
|
|
76
|
+
backend: AgentBackendKind;
|
|
77
|
+
label: string;
|
|
78
|
+
/** Local runtime: the machine this agent runs on, and its name. */
|
|
79
|
+
machineId?: string | null;
|
|
80
|
+
machineName?: string | null;
|
|
81
|
+
scopePath?: string;
|
|
82
|
+
sessionId?: string;
|
|
83
|
+
modelId: string;
|
|
84
|
+
status: AgentStatus;
|
|
85
|
+
createdBy?: string;
|
|
86
|
+
createdAt: number;
|
|
87
|
+
sortOrder?: number;
|
|
88
|
+
sdkAgentId?: string;
|
|
89
|
+
branch?: string;
|
|
90
|
+
prUrl?: string;
|
|
91
|
+
/** Plan mode = read-only explore/propose (Cursor --mode plan / Claude permission-mode plan / OpenCode plan agent). */
|
|
92
|
+
planMode?: boolean;
|
|
93
|
+
kind?: AgentKind;
|
|
94
|
+
/** Latest `agent.getUsage()` snapshot, when the runtime reports it. */
|
|
95
|
+
usage?: AgentUsageInfo;
|
|
96
|
+
/** Slash commands the agent's CLI last reported (Claude Code). */
|
|
97
|
+
cliCommands?: CliCommandCatalog;
|
|
98
|
+
/** False for Cursor Cloud agents that skip cloning the repo. */
|
|
99
|
+
hasRepo?: boolean;
|
|
100
|
+
/** Per-agent execution settings. Legacy agents inherit the room values. */
|
|
101
|
+
runtime: AgentRuntime;
|
|
102
|
+
authMode: AuthMode;
|
|
103
|
+
repoPath?: string;
|
|
104
|
+
repoUrl?: string;
|
|
105
|
+
startingRef?: string;
|
|
106
|
+
autoCreatePR?: boolean;
|
|
107
|
+
keyHint?: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Reserved `agentId` for people-to-people chat in the Space. No agent ever
|
|
111
|
+
* has this id, so these messages never reach an agent's prompt or tab.
|
|
112
|
+
*/
|
|
113
|
+
export declare const SPACE_CHANNEL_ID = "space";
|
|
114
|
+
export interface SpaceTypist {
|
|
115
|
+
socketId: string;
|
|
116
|
+
name: string;
|
|
117
|
+
userId?: string;
|
|
118
|
+
/** Set when typing inside a thread. */
|
|
119
|
+
threadId?: string;
|
|
120
|
+
}
|
|
121
|
+
export declare function isSpaceMessage(msg: {
|
|
122
|
+
agentId?: string;
|
|
123
|
+
}): boolean;
|
|
124
|
+
export declare function isIntegratorAgent(agent: {
|
|
125
|
+
kind?: string | null;
|
|
126
|
+
}): boolean;
|
|
127
|
+
export declare function isFeatureAgent(agent: {
|
|
128
|
+
kind?: string | null;
|
|
129
|
+
}): boolean;
|
|
130
|
+
export interface AgentConflict {
|
|
131
|
+
paths: string[];
|
|
132
|
+
agentIds: string[];
|
|
133
|
+
}
|
|
134
|
+
export interface FileLease {
|
|
135
|
+
roomId: string;
|
|
136
|
+
path: string;
|
|
137
|
+
agentId: string;
|
|
138
|
+
callId?: string;
|
|
139
|
+
acquiredAt: number;
|
|
140
|
+
expiresAt: number;
|
|
141
|
+
}
|
|
142
|
+
export interface AgentConflictBlocked {
|
|
143
|
+
agentId: string;
|
|
144
|
+
path: string;
|
|
145
|
+
holderAgentId: string;
|
|
146
|
+
action: "aborted" | "queued";
|
|
147
|
+
}
|
|
148
|
+
/** Structured todo item from TodoWrite / todo tools. */
|
|
149
|
+
export interface AgentTodoItem {
|
|
150
|
+
id: string;
|
|
151
|
+
content: string;
|
|
152
|
+
status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
153
|
+
}
|
|
154
|
+
export type PlanStatus = "pending" | "approved" | "dismissed";
|
|
155
|
+
/** Temporary file/image attached to a user message. */
|
|
156
|
+
export interface ChatAttachment {
|
|
157
|
+
id: string;
|
|
158
|
+
name: string;
|
|
159
|
+
mime: string;
|
|
160
|
+
size: number;
|
|
161
|
+
url: string;
|
|
162
|
+
}
|
|
163
|
+
export interface ClarifyingQuestionOption {
|
|
164
|
+
label: string;
|
|
165
|
+
description?: string;
|
|
166
|
+
}
|
|
167
|
+
export interface ClarifyingQuestion {
|
|
168
|
+
id?: string;
|
|
169
|
+
question: string;
|
|
170
|
+
header?: string;
|
|
171
|
+
options?: ClarifyingQuestionOption[];
|
|
172
|
+
multiSelect?: boolean;
|
|
173
|
+
selectedAnswers?: string[];
|
|
174
|
+
answered?: boolean;
|
|
175
|
+
}
|
|
176
|
+
export interface ChatMessage {
|
|
177
|
+
id: string;
|
|
178
|
+
roomId: string;
|
|
179
|
+
role: ChatRole;
|
|
180
|
+
content: string;
|
|
181
|
+
senderName?: string;
|
|
182
|
+
senderColor?: string;
|
|
183
|
+
/** Durable Clerk/user id of the human who sent this message (for git attribution). */
|
|
184
|
+
senderUserId?: string;
|
|
185
|
+
toolName?: string;
|
|
186
|
+
/** Unified diff when this message is a file edit. */
|
|
187
|
+
diffPatch?: string;
|
|
188
|
+
/** Full todo list when this message is a TodoWrite / todo tool call. */
|
|
189
|
+
todos?: AgentTodoItem[];
|
|
190
|
+
status: ChatStatus;
|
|
191
|
+
ts: number;
|
|
192
|
+
/** Room-level agent that produced or received this message. */
|
|
193
|
+
agentId?: string;
|
|
194
|
+
/** Pending/decided approval gate attached to this tool row (if any). */
|
|
195
|
+
approval?: ApprovalRequestInfo;
|
|
196
|
+
/** Plan-mode document attached to an assistant reply. */
|
|
197
|
+
planStatus?: PlanStatus;
|
|
198
|
+
/** Images / files the user attached to this message. */
|
|
199
|
+
attachments?: ChatAttachment[];
|
|
200
|
+
/** Structured clarifying questions when the LLM asks for user clarification. */
|
|
201
|
+
questions?: ClarifyingQuestion[];
|
|
202
|
+
/** Flag when an edit / tool message has been reverted. */
|
|
203
|
+
reverted?: boolean;
|
|
204
|
+
/** Model the agent was running when it wrote this reply (assistant messages). */
|
|
205
|
+
modelId?: string;
|
|
206
|
+
/** MCP tool rows: the integration that ran (drives the card's logo + label). */
|
|
207
|
+
integration?: ToolIntegrationRef;
|
|
208
|
+
/** Space features: thread, hand-off, people mentions. */
|
|
209
|
+
space?: SpaceMessageMeta;
|
|
210
|
+
/** Model thinking / reasoning shown above the assistant reply. */
|
|
211
|
+
thinking?: string;
|
|
212
|
+
/** Integration writes the agent drafted for people to review and send. */
|
|
213
|
+
actionDrafts?: ActionDraftInfo[];
|
|
214
|
+
/** Docs the agent created or updated, shown as cards. */
|
|
215
|
+
docs?: DocCardInfo[];
|
|
216
|
+
}
|
|
217
|
+
/** Keep thinking (and other defined fields) when a later write omits them. */
|
|
218
|
+
export declare function mergeChatMessage(prev: ChatMessage | undefined, incoming: ChatMessage): ChatMessage;
|
|
219
|
+
export interface IntegrationQueueItem {
|
|
220
|
+
id: string;
|
|
221
|
+
sourceAgentId: string;
|
|
222
|
+
sourceLabel?: string;
|
|
223
|
+
createdAt: number;
|
|
224
|
+
}
|
|
225
|
+
/** One room-wide integration merge at a time; extra clicks queue. */
|
|
226
|
+
export interface IntegrationJobInfo {
|
|
227
|
+
status: "idle" | "running";
|
|
228
|
+
sourceAgentId?: string;
|
|
229
|
+
sourceLabel?: string;
|
|
230
|
+
heldBy?: string;
|
|
231
|
+
expiresAt?: number;
|
|
232
|
+
queue: IntegrationQueueItem[];
|
|
233
|
+
}
|
|
234
|
+
export interface CloudMeta {
|
|
235
|
+
repoUrl?: string;
|
|
236
|
+
startingRef?: string;
|
|
237
|
+
branch?: string;
|
|
238
|
+
prUrl?: string;
|
|
239
|
+
autoCreatePR?: boolean;
|
|
240
|
+
}
|
|
241
|
+
export interface RoomMemberPreview {
|
|
242
|
+
userId: string;
|
|
243
|
+
name: string;
|
|
244
|
+
avatarUrl?: string;
|
|
245
|
+
/** Connected to this session right now. Membership alone does not set this. */
|
|
246
|
+
online?: boolean;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* One feature agent on a session, paired with the person they're with.
|
|
250
|
+
* The sessions list uses this to show who is working with which harness.
|
|
251
|
+
*/
|
|
252
|
+
export interface SessionSeat {
|
|
253
|
+
agentId: string;
|
|
254
|
+
backend: AgentBackendKind;
|
|
255
|
+
agentLabel: string;
|
|
256
|
+
/** True while this agent is mid-run. */
|
|
257
|
+
working: boolean;
|
|
258
|
+
/** Person driving or steering this agent, when known. */
|
|
259
|
+
userId?: string;
|
|
260
|
+
name: string;
|
|
261
|
+
avatarUrl?: string;
|
|
262
|
+
/** One-line live focus the agent set with `update_focus`. */
|
|
263
|
+
focus?: string;
|
|
264
|
+
}
|
|
265
|
+
export interface RoomInfo {
|
|
266
|
+
id: string;
|
|
267
|
+
name: string;
|
|
268
|
+
repoPath: string;
|
|
269
|
+
/** Local runtime: the machine new agents in this session run on. */
|
|
270
|
+
defaultMachineId?: string | null;
|
|
271
|
+
agentCommand: string;
|
|
272
|
+
participantCount: number;
|
|
273
|
+
/** active | stopped | archived */
|
|
274
|
+
status: string;
|
|
275
|
+
createdAt: number;
|
|
276
|
+
/** Dashboard row summary: a few members, the harnesses, and what needs attention. */
|
|
277
|
+
memberPreview?: RoomMemberPreview[];
|
|
278
|
+
memberCount?: number;
|
|
279
|
+
agentBackends?: AgentBackendKind[];
|
|
280
|
+
/**
|
|
281
|
+
* Feature agents paired with the person they're with.
|
|
282
|
+
* Present on session lists so a live room can show who is working with what.
|
|
283
|
+
*/
|
|
284
|
+
seats?: SessionSeat[];
|
|
285
|
+
/** Runtimes in use across this session's agents (empty for an empty session). */
|
|
286
|
+
agentRuntimes?: AgentRuntime[];
|
|
287
|
+
/** Auth modes in use across this session's agents. */
|
|
288
|
+
agentAuthModes?: AuthMode[];
|
|
289
|
+
workingAgents?: number;
|
|
290
|
+
pendingApprovals?: number;
|
|
291
|
+
runtime: AgentRuntime;
|
|
292
|
+
authMode: AuthMode;
|
|
293
|
+
modelId: string;
|
|
294
|
+
/** Who may steer agents in this room. */
|
|
295
|
+
controlMode: ControlMode;
|
|
296
|
+
/** Team-workspace sessions: "private" = owner + invited people only. */
|
|
297
|
+
visibility?: RoomVisibility;
|
|
298
|
+
/**
|
|
299
|
+
* Human approval gates for irreversible / high-blast-radius tools.
|
|
300
|
+
* Separate from file locks and driver control.
|
|
301
|
+
*/
|
|
302
|
+
approvalMode: ApprovalMode;
|
|
303
|
+
/** Silent auto-memory after each successful run. Default extract (on). */
|
|
304
|
+
autoMemory?: AutoMemoryMode;
|
|
305
|
+
repoUrl?: string;
|
|
306
|
+
startingRef?: string;
|
|
307
|
+
prUrl?: string;
|
|
308
|
+
autoCreatePR?: boolean;
|
|
309
|
+
/** Shared integration branch (steer/integration-…) used by Integrate. */
|
|
310
|
+
integrationBranch?: string;
|
|
311
|
+
/** Single PR from the integration branch into startingRef. */
|
|
312
|
+
integrationPrUrl?: string;
|
|
313
|
+
integrationAgentId?: string;
|
|
314
|
+
/** Current integration lock + queue (one merge at a time per room). */
|
|
315
|
+
integrationJob?: IntegrationJobInfo;
|
|
316
|
+
keyHint?: string;
|
|
317
|
+
ownerId?: string;
|
|
318
|
+
/** Organization that owns this session (null/undefined = personal). */
|
|
319
|
+
orgId?: string;
|
|
320
|
+
orgName?: string;
|
|
321
|
+
inviteCode?: string;
|
|
322
|
+
/** Active Cursor CLI chat id for the room's default agent (--resume). */
|
|
323
|
+
cursorSessionId?: string;
|
|
324
|
+
/** Agents in this room (populated when available). */
|
|
325
|
+
agents?: AgentInfo[];
|
|
326
|
+
/** Caller's effective role when requested with auth. */
|
|
327
|
+
myRole?: RoomRole;
|
|
328
|
+
/** Host or org admin — can manage invites, members, agents, settings. */
|
|
329
|
+
myCanManage?: boolean;
|
|
330
|
+
/** Room has a Slack incoming webhook configured (or env fallback available). */
|
|
331
|
+
slackNotifyConfigured?: boolean;
|
|
332
|
+
/** Masked hint for the room webhook — only for managers. */
|
|
333
|
+
slackWebhookHint?: string;
|
|
334
|
+
}
|
|
335
|
+
/** One person's acknowledgement of a review ping. */
|
|
336
|
+
export interface PingAckInfo {
|
|
337
|
+
userId: string;
|
|
338
|
+
name: string;
|
|
339
|
+
ts: number;
|
|
340
|
+
}
|
|
341
|
+
/** In-room + Slack "flag for review" interrupt. */
|
|
342
|
+
export interface PingInfo {
|
|
343
|
+
id: string;
|
|
344
|
+
roomId: string;
|
|
345
|
+
actorUserId: string;
|
|
346
|
+
actorName: string;
|
|
347
|
+
note?: string;
|
|
348
|
+
/** Everyone in the room, or a subset of member user ids. */
|
|
349
|
+
targets: "everyone" | string[];
|
|
350
|
+
status: "open" | "dismissed";
|
|
351
|
+
createdAt: number;
|
|
352
|
+
acks: PingAckInfo[];
|
|
353
|
+
}
|
|
354
|
+
export interface UserInfo {
|
|
355
|
+
id: string;
|
|
356
|
+
email: string;
|
|
357
|
+
name: string;
|
|
358
|
+
}
|
|
359
|
+
export interface WorkerInfo {
|
|
360
|
+
id: string;
|
|
361
|
+
name: string;
|
|
362
|
+
status: "online" | "offline" | "busy";
|
|
363
|
+
lastSeenAt: number;
|
|
364
|
+
}
|
|
365
|
+
export interface ModelInfo {
|
|
366
|
+
id: string;
|
|
367
|
+
displayName: string;
|
|
368
|
+
description?: string;
|
|
369
|
+
/** Zero-cost per-token (badge: "Free") — the OpenCode gateway tier also needs no API key. */
|
|
370
|
+
free?: boolean;
|
|
371
|
+
/** Picker section, e.g. "xAI" / "MiniMax" for OpenCode free models. */
|
|
372
|
+
group?: string;
|
|
373
|
+
}
|
|
374
|
+
/** Cursor CLI chat session stored under ~/.cursor/chats for a workspace. */
|
|
375
|
+
export interface CursorChatSession {
|
|
376
|
+
id: string;
|
|
377
|
+
createdAt: number;
|
|
378
|
+
updatedAt: number;
|
|
379
|
+
hasConversation: boolean;
|
|
380
|
+
}
|
|
381
|
+
export interface RepoInfo {
|
|
382
|
+
url: string;
|
|
383
|
+
}
|
|
384
|
+
export type AgentRunStatus = "idle" | "running" | "error";
|
|
385
|
+
/** Someone drafting a message to a specific agent in the room. */
|
|
386
|
+
export interface TypingUser {
|
|
387
|
+
socketId: string;
|
|
388
|
+
name: string;
|
|
389
|
+
agentId: string;
|
|
390
|
+
}
|
|
391
|
+
export interface ChatHistoryPage {
|
|
392
|
+
messages: ChatMessage[];
|
|
393
|
+
hasMore: boolean;
|
|
394
|
+
agentId?: string;
|
|
395
|
+
}
|
|
396
|
+
export interface RoomJoinSnapshot {
|
|
397
|
+
messages: ChatMessage[];
|
|
398
|
+
hasMoreHistory: boolean;
|
|
399
|
+
hasMoreByAgent?: Record<string, boolean>;
|
|
400
|
+
agents: AgentInfo[];
|
|
401
|
+
pendingApprovals: ApprovalRequestInfo[];
|
|
402
|
+
openPings: PingInfo[];
|
|
403
|
+
cloudMeta: CloudMeta | null;
|
|
404
|
+
members: RoomMemberInfo[];
|
|
405
|
+
}
|
|
406
|
+
/** Lifecycle of a browser terminal attached to a cloud agent's sandbox. */
|
|
407
|
+
export type SandboxTerminalState = "connecting" | "open" | "closed" | "error";
|
|
408
|
+
export interface SandboxTerminalRef {
|
|
409
|
+
agentId: string;
|
|
410
|
+
/** Client-chosen id; also the PTY session id inside the sandbox. */
|
|
411
|
+
terminalId: string;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Per-user alert pushed to `user:{id}` (desktop notifications, Dock badge).
|
|
415
|
+
* Sent to the people who need to act or asked for the run — not the room.
|
|
416
|
+
*/
|
|
417
|
+
export interface UserNotification {
|
|
418
|
+
id: string;
|
|
419
|
+
kind: "approval" | "review" | "run_finished" | "run_failed" | "automation_created" | "automation_finished";
|
|
420
|
+
/** Room it is about; absent for notifications from outside a room (automation runs). */
|
|
421
|
+
roomId?: string;
|
|
422
|
+
/** Where it came from, shown as context: the room name, or the automation name. */
|
|
423
|
+
roomName: string;
|
|
424
|
+
title: string;
|
|
425
|
+
body: string;
|
|
426
|
+
/** Page to open when clicked; defaults to the room. */
|
|
427
|
+
href?: string;
|
|
428
|
+
createdAt: number;
|
|
429
|
+
/** Set once the recipient has seen it in the notification list. */
|
|
430
|
+
readAt?: number | null;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Kinds that belong in the in-app list and toasts. A room agent finishing a
|
|
434
|
+
* turn ("run_finished") is routine and only reaches the desktop app; an
|
|
435
|
+
* automation run finishing ("automation_finished") is shown, since nobody
|
|
436
|
+
* was watching it.
|
|
437
|
+
*/
|
|
438
|
+
export declare function isInboxNotification(kind: UserNotification["kind"]): boolean;
|
|
439
|
+
/** Where a notification opens: its link, else its room. */
|
|
440
|
+
export declare function notificationHref(n: Pick<UserNotification, "href" | "roomId">): string | null;
|
|
441
|
+
export interface ServerToClientEvents {
|
|
442
|
+
"chat-history": (messages: ChatMessage[]) => void;
|
|
443
|
+
"chat-history-page": (page: ChatHistoryPage) => void;
|
|
444
|
+
"room-snapshot": (snapshot: RoomJoinSnapshot) => void;
|
|
445
|
+
"chat-message": (message: ChatMessage) => void;
|
|
446
|
+
/** Who is composing in the Space right now. */
|
|
447
|
+
"space-typing": (typists: SpaceTypist[]) => void;
|
|
448
|
+
"chat-delta": (id: string, content: string, status?: ChatStatus, meta?: {
|
|
449
|
+
append?: boolean;
|
|
450
|
+
thinking?: string;
|
|
451
|
+
}) => void;
|
|
452
|
+
/** @deprecated Prefer agents snapshot + agent-status(agentId, …). Kept for single-agent rooms. */
|
|
453
|
+
"agent-status": (statusOrAgentId: AgentRunStatus | string, detailOrStatus?: string | AgentRunStatus, detail?: string) => void;
|
|
454
|
+
"cloud-meta": (meta: CloudMeta) => void;
|
|
455
|
+
"model-updated": (modelId: string, agentId?: string) => void;
|
|
456
|
+
"cursor-session-updated": (sessionIdOrAgentId: string | null, sessionId?: string | null) => void;
|
|
457
|
+
presence: (participants: Participant[]) => void;
|
|
458
|
+
/** Full-repo or per-agent concatenated patch. Second arg is agentId when multi-agent. */
|
|
459
|
+
"diff-update": (patch: string, agentId?: string) => void;
|
|
460
|
+
"steer-log": (entry: SteerLogEntry) => void;
|
|
461
|
+
"steer-history": (entries: SteerLogEntry[]) => void;
|
|
462
|
+
"drive-requested": (payload: {
|
|
463
|
+
socketId: string;
|
|
464
|
+
name: string;
|
|
465
|
+
agentId?: string;
|
|
466
|
+
}) => void;
|
|
467
|
+
/** Sent to the requester while waiting for host/driver approval. */
|
|
468
|
+
"drive-request-pending": (payload: {
|
|
469
|
+
agentId?: string;
|
|
470
|
+
}) => void;
|
|
471
|
+
"drive-granted": (agentId?: string) => void;
|
|
472
|
+
"drive-released": (agentId?: string) => void;
|
|
473
|
+
agents: (agents: AgentInfo[]) => void;
|
|
474
|
+
/** Peer started / refreshed typing toward an agent. */
|
|
475
|
+
typing: (payload: TypingUser) => void;
|
|
476
|
+
/** Peer stopped typing (omit agentId to clear all agents for that socket). */
|
|
477
|
+
"typing-stop": (payload: {
|
|
478
|
+
socketId: string;
|
|
479
|
+
agentId?: string;
|
|
480
|
+
}) => void;
|
|
481
|
+
kicked: (reason: string) => void;
|
|
482
|
+
/** Host changed room collaboration settings. */
|
|
483
|
+
"control-mode-updated": (mode: ControlMode) => void;
|
|
484
|
+
/** Room membership roster changed (roles / joins / removals). */
|
|
485
|
+
"members-updated": (members: RoomMemberInfo[]) => void;
|
|
486
|
+
/** Agent proposed a high-blast-radius action that needs human sign-off. */
|
|
487
|
+
"tool-approval-requested": (request: ApprovalRequestInfo) => void;
|
|
488
|
+
"user-notification": (notification: UserNotification) => void;
|
|
489
|
+
/** Pending approval was approved/denied/expired. */
|
|
490
|
+
"tool-approval-resolved": (request: ApprovalRequestInfo) => void;
|
|
491
|
+
/** Full snapshot of open approvals for the room (on join / reconnect). */
|
|
492
|
+
"tool-approvals": (requests: ApprovalRequestInfo[]) => void;
|
|
493
|
+
/** Full snapshot of open review pings (on join / reconnect). */
|
|
494
|
+
"room-pings": (pings: PingInfo[]) => void;
|
|
495
|
+
/** Someone flagged the session for human review. */
|
|
496
|
+
"review-flagged": (ping: PingInfo) => void;
|
|
497
|
+
/** Someone acknowledged a review ping. */
|
|
498
|
+
"review-acked": (ping: PingInfo) => void;
|
|
499
|
+
/** A review ping was dismissed. */
|
|
500
|
+
"review-dismissed": (ping: PingInfo) => void;
|
|
501
|
+
"room-context": (snapshot: RoomContextSnapshot) => void;
|
|
502
|
+
/** Supermemory-backed memory created/edited/accepted/archived. */
|
|
503
|
+
"memory-updated": (payload: BrainMemoryEvent) => void;
|
|
504
|
+
/** New proposal awaiting human accept (agent, auto-run, dream, or member). */
|
|
505
|
+
"memory-proposal": (payload: BrainMemoryEvent) => void;
|
|
506
|
+
/** Tag epochs advanced (accept, archive, ingest completion, webhook). */
|
|
507
|
+
"memory-epoch-bumped": (payload: BrainEpochEvent) => void;
|
|
508
|
+
/** Receipt for the memory context an agent run consumed. */
|
|
509
|
+
"memory-receipt": (receipt: BrainReceiptInfo) => void;
|
|
510
|
+
/** Memories in a tag the agent's last run used changed after that run. */
|
|
511
|
+
"memory-context-stale": (payload: {
|
|
512
|
+
agentId: string;
|
|
513
|
+
receiptId: string;
|
|
514
|
+
tags: string[];
|
|
515
|
+
}) => void;
|
|
516
|
+
"integration-status": (payload: {
|
|
517
|
+
orgId: string;
|
|
518
|
+
connection: IntegrationConnectionInfo;
|
|
519
|
+
}) => void;
|
|
520
|
+
"lease-requested": (lease: IntegrationLeaseInfo) => void;
|
|
521
|
+
"lease-updated": (lease: IntegrationLeaseInfo) => void;
|
|
522
|
+
"repo-map-updated": (map: RepoMapInfo) => void;
|
|
523
|
+
"context-receipt": (receipt: AgentContextReceiptInfo) => void;
|
|
524
|
+
"context-stale": (payload: {
|
|
525
|
+
agentId: string;
|
|
526
|
+
usedVersion: number;
|
|
527
|
+
currentVersion: number;
|
|
528
|
+
}) => void;
|
|
529
|
+
"auto-memory-saved": (payload: {
|
|
530
|
+
agentId: string;
|
|
531
|
+
count: number;
|
|
532
|
+
entries: MemoryEntryInfo[];
|
|
533
|
+
}) => void;
|
|
534
|
+
/** Integration branch / PR / lock queue changed after an Integrate click. */
|
|
535
|
+
"integration-updated": (payload: {
|
|
536
|
+
roomId: string;
|
|
537
|
+
branch: string;
|
|
538
|
+
prUrl?: string;
|
|
539
|
+
sourceAgentId: string;
|
|
540
|
+
integratorAgentId: string;
|
|
541
|
+
job?: IntegrationJobInfo;
|
|
542
|
+
}) => void;
|
|
543
|
+
/** File changes were reverted. */
|
|
544
|
+
"changes-reverted": (payload: {
|
|
545
|
+
agentId?: string;
|
|
546
|
+
filePaths: string[];
|
|
547
|
+
messageId?: string;
|
|
548
|
+
}) => void;
|
|
549
|
+
/** Authoritative copies of an agent's recent messages (after a resync request). */
|
|
550
|
+
"chat-resync": (payload: {
|
|
551
|
+
agentId: string;
|
|
552
|
+
messages: ChatMessage[];
|
|
553
|
+
}) => void;
|
|
554
|
+
/** PTY output from a cloud agent's sandbox terminal. */
|
|
555
|
+
"sandbox-terminal-output": (payload: SandboxTerminalRef & {
|
|
556
|
+
data: string;
|
|
557
|
+
}) => void;
|
|
558
|
+
"sandbox-terminal-status": (payload: SandboxTerminalRef & {
|
|
559
|
+
state: SandboxTerminalState;
|
|
560
|
+
message?: string;
|
|
561
|
+
}) => void;
|
|
562
|
+
error: (message: string) => void;
|
|
563
|
+
}
|
|
564
|
+
export interface ClientToServerEvents {
|
|
565
|
+
/** Team chat in the Space — seen by people only, never sent to an agent. */
|
|
566
|
+
"space-message": (text: string, extras?: {
|
|
567
|
+
attachmentIds?: string[];
|
|
568
|
+
space?: SpaceMessageMeta;
|
|
569
|
+
}) => void;
|
|
570
|
+
/** Composing in the Space (or one of its threads). */
|
|
571
|
+
"space-typing": (typing: boolean, threadId?: string) => void;
|
|
572
|
+
"steer-message": (textOrAgentId: string, text?: string, extras?: {
|
|
573
|
+
attachmentIds?: string[];
|
|
574
|
+
/** Per-turn memory composer overrides (exclude entries, scope toggles). */
|
|
575
|
+
memory?: {
|
|
576
|
+
excludeIds?: string[];
|
|
577
|
+
onlyRoom?: boolean;
|
|
578
|
+
includeWorkspace?: boolean;
|
|
579
|
+
includePersonal?: boolean;
|
|
580
|
+
};
|
|
581
|
+
/** Sent from the Space: thread, hand-off, mentions. */
|
|
582
|
+
space?: SpaceMessageMeta;
|
|
583
|
+
/** Also show this user message in another agent's chat, without running that agent. */
|
|
584
|
+
echo?: {
|
|
585
|
+
agentId: string;
|
|
586
|
+
content: string;
|
|
587
|
+
};
|
|
588
|
+
}) => void;
|
|
589
|
+
/** Revert uncommitted file changes made by the LLM (specific files, tool message, or all). */
|
|
590
|
+
"revert-changes": (payload: {
|
|
591
|
+
roomId?: string;
|
|
592
|
+
agentId?: string;
|
|
593
|
+
filePaths?: string[];
|
|
594
|
+
messageId?: string;
|
|
595
|
+
}) => void;
|
|
596
|
+
/** Approve a finished plan and switch the agent to implement it. */
|
|
597
|
+
"approve-plan": (payload: {
|
|
598
|
+
messageId: string;
|
|
599
|
+
agentId?: string;
|
|
600
|
+
}) => void;
|
|
601
|
+
/** Hide the approve card without implementing. */
|
|
602
|
+
"dismiss-plan": (payload: {
|
|
603
|
+
messageId: string;
|
|
604
|
+
}) => void;
|
|
605
|
+
/** Announce that this user is typing to an agent (clients should throttle). */
|
|
606
|
+
typing: (agentId: string) => void;
|
|
607
|
+
/** Stop typing indicator for one agent, or all agents when omitted. */
|
|
608
|
+
"typing-stop": (agentId?: string) => void;
|
|
609
|
+
"request-drive": (agentId?: string) => void;
|
|
610
|
+
"release-drive": (agentId?: string) => void;
|
|
611
|
+
"grant-drive": (toSocketIdOrAgentId: string, toSocketId?: string) => void;
|
|
612
|
+
/**
|
|
613
|
+
* Approve or deny a pending tool-approval request.
|
|
614
|
+
* Any non-driver human in the room may decide (editors+).
|
|
615
|
+
*/
|
|
616
|
+
"tool-approval-decision": (requestId: string, approved: boolean, opts?: {
|
|
617
|
+
alwaysAllow?: boolean;
|
|
618
|
+
}) => void;
|
|
619
|
+
/**
|
|
620
|
+
* Flag the session for review — pings the room + optional Slack webhook.
|
|
621
|
+
* Editors and the host may flag. Empty/omitted targetUserIds = everyone.
|
|
622
|
+
*/
|
|
623
|
+
"flag-review": (payload: {
|
|
624
|
+
note?: string;
|
|
625
|
+
targetUserIds?: string[];
|
|
626
|
+
}) => void;
|
|
627
|
+
/** Acknowledge a review ping (in-room; deep-link uses REST). */
|
|
628
|
+
"ack-review": (pingId: string) => void;
|
|
629
|
+
/** Dismiss an open review ping (actor or host). */
|
|
630
|
+
"dismiss-review": (pingId: string) => void;
|
|
631
|
+
"leave-room": () => void;
|
|
632
|
+
"remove-member": (userId: string) => void;
|
|
633
|
+
/** Older chat messages before the given cursor (join only sent a page). */
|
|
634
|
+
"load-chat-history": (cursor: {
|
|
635
|
+
beforeTs?: number;
|
|
636
|
+
beforeId?: string;
|
|
637
|
+
agentId?: string;
|
|
638
|
+
}) => void;
|
|
639
|
+
/** Ask the server for the latest stored diff (skipped on join). */
|
|
640
|
+
"request-diff": (agentId?: string) => void;
|
|
641
|
+
/**
|
|
642
|
+
* Re-fetch an agent's messages since `sinceTs` — sent when a run ends while
|
|
643
|
+
* a bubble still looks mid-stream (a final delta was missed).
|
|
644
|
+
*/
|
|
645
|
+
"resync-agent-messages": (payload: {
|
|
646
|
+
agentId: string;
|
|
647
|
+
sinceTs: number;
|
|
648
|
+
}) => void;
|
|
649
|
+
/** Attach to (or create) a PTY in a cloud agent's sandbox. */
|
|
650
|
+
"sandbox-terminal-open": (payload: SandboxTerminalRef & {
|
|
651
|
+
cols: number;
|
|
652
|
+
rows: number;
|
|
653
|
+
}) => void;
|
|
654
|
+
"sandbox-terminal-input": (payload: SandboxTerminalRef & {
|
|
655
|
+
data: string;
|
|
656
|
+
}) => void;
|
|
657
|
+
"sandbox-terminal-resize": (payload: SandboxTerminalRef & {
|
|
658
|
+
cols: number;
|
|
659
|
+
rows: number;
|
|
660
|
+
}) => void;
|
|
661
|
+
/** Detach; the shell keeps running in the sandbox. */
|
|
662
|
+
"sandbox-terminal-close": (payload: SandboxTerminalRef) => void;
|
|
663
|
+
}
|
|
664
|
+
/** Worker ↔ Server events (Socket.IO /worker namespace) */
|
|
665
|
+
export interface WorkerToServerEvents {
|
|
666
|
+
"worker:ready": (info: {
|
|
667
|
+
workerId: string;
|
|
668
|
+
machineName: string;
|
|
669
|
+
/** Protocol 8+: what the machine is and which agent CLIs it has. */
|
|
670
|
+
os?: string;
|
|
671
|
+
arch?: string;
|
|
672
|
+
client?: MachineClient;
|
|
673
|
+
agents?: MachineAgentTool[];
|
|
674
|
+
maxConcurrent?: number;
|
|
675
|
+
activeRoomId?: string | null;
|
|
676
|
+
busy?: boolean;
|
|
677
|
+
/** Protocol 2+: concurrent multi-agent support. */
|
|
678
|
+
protocol?: number;
|
|
679
|
+
activeRuns?: Array<{
|
|
680
|
+
roomId: string;
|
|
681
|
+
agentId: string;
|
|
682
|
+
}>;
|
|
683
|
+
}) => void;
|
|
684
|
+
/** Protocol 8+: machine details that changed after connect (detected agent CLIs). */
|
|
685
|
+
"worker:info": (info: {
|
|
686
|
+
agents?: MachineAgentTool[];
|
|
687
|
+
}) => void;
|
|
688
|
+
"worker:agent-event": (data: {
|
|
689
|
+
roomId: string;
|
|
690
|
+
agentId?: string;
|
|
691
|
+
event: AgentStreamEventPayload;
|
|
692
|
+
}) => void;
|
|
693
|
+
"worker:file-diff": (data: {
|
|
694
|
+
roomId: string;
|
|
695
|
+
agentId?: string;
|
|
696
|
+
/** Tool call id — server maps to the chat tool message via toolMsgIds */
|
|
697
|
+
callId: string;
|
|
698
|
+
toolName: string;
|
|
699
|
+
path: string;
|
|
700
|
+
patch: string;
|
|
701
|
+
}) => void;
|
|
702
|
+
"worker:folder-picked": (data: {
|
|
703
|
+
requestId: string;
|
|
704
|
+
path: string | null;
|
|
705
|
+
error?: string;
|
|
706
|
+
}) => void;
|
|
707
|
+
"worker:models-listed": (data: {
|
|
708
|
+
requestId: string;
|
|
709
|
+
models?: Array<{
|
|
710
|
+
id: string;
|
|
711
|
+
displayName: string;
|
|
712
|
+
}>;
|
|
713
|
+
error?: string;
|
|
714
|
+
}) => void;
|
|
715
|
+
"worker:sessions-listed": (data: {
|
|
716
|
+
requestId: string;
|
|
717
|
+
sessions?: CursorChatSession[];
|
|
718
|
+
error?: string;
|
|
719
|
+
}) => void;
|
|
720
|
+
"worker:files-reverted": (data: {
|
|
721
|
+
roomId: string;
|
|
722
|
+
agentId?: string;
|
|
723
|
+
filePaths: string[];
|
|
724
|
+
messageId?: string;
|
|
725
|
+
error?: string;
|
|
726
|
+
}) => void;
|
|
727
|
+
/** Protocol 9+: answer to worker:list-dirs. */
|
|
728
|
+
"worker:dirs-listed": (data: {
|
|
729
|
+
requestId: string;
|
|
730
|
+
listing?: MachineDirListing;
|
|
731
|
+
error?: string;
|
|
732
|
+
}) => void;
|
|
733
|
+
/** Protocol 9+: answer to worker:prepare-repo — the checkout's absolute path. */
|
|
734
|
+
"worker:repo-prepared": (data: {
|
|
735
|
+
requestId: string;
|
|
736
|
+
path?: string;
|
|
737
|
+
error?: string;
|
|
738
|
+
}) => void;
|
|
739
|
+
/** Protocol 9+: answer to worker:finalize-git. */
|
|
740
|
+
"worker:git-finalized": (data: {
|
|
741
|
+
requestId: string;
|
|
742
|
+
/** Something was committed/pushed. */
|
|
743
|
+
pushed?: boolean;
|
|
744
|
+
branch?: string;
|
|
745
|
+
error?: string;
|
|
746
|
+
}) => void;
|
|
747
|
+
/** Protocol 11+: working-tree snapshot for a local agent. */
|
|
748
|
+
"worker:workspace-git-result": (data: {
|
|
749
|
+
requestId: string;
|
|
750
|
+
snapshot?: WorkspaceGitSnapshot;
|
|
751
|
+
error?: string;
|
|
752
|
+
}) => void;
|
|
753
|
+
/** Protocol 12+: commit, push, checkout, create, or discard finished. */
|
|
754
|
+
"worker:workspace-git-action-result": (data: {
|
|
755
|
+
requestId: string;
|
|
756
|
+
ok?: boolean;
|
|
757
|
+
error?: string;
|
|
758
|
+
}) => void;
|
|
759
|
+
/** Protocol 11+: repo folder listing. */
|
|
760
|
+
"worker:workspace-dir-result": (data: {
|
|
761
|
+
requestId: string;
|
|
762
|
+
entries?: WorkspaceRepoEntry[];
|
|
763
|
+
error?: string;
|
|
764
|
+
}) => void;
|
|
765
|
+
/** Protocol 11+: repo file read. */
|
|
766
|
+
"worker:workspace-file-result": (data: {
|
|
767
|
+
requestId: string;
|
|
768
|
+
file?: WorkspaceRepoFile;
|
|
769
|
+
error?: string;
|
|
770
|
+
}) => void;
|
|
771
|
+
/** Protocol 11+: repo path search. */
|
|
772
|
+
"worker:workspace-search-result": (data: {
|
|
773
|
+
requestId: string;
|
|
774
|
+
matches?: WorkspacePathMatch[];
|
|
775
|
+
error?: string;
|
|
776
|
+
}) => void;
|
|
777
|
+
}
|
|
778
|
+
export interface ServerToWorkerEvents {
|
|
779
|
+
"worker:run-prompt": (data: {
|
|
780
|
+
roomId: string;
|
|
781
|
+
agentId?: string;
|
|
782
|
+
prompt: string;
|
|
783
|
+
repoPath: string;
|
|
784
|
+
/** Scope-resolved working directory (defaults to repoPath). */
|
|
785
|
+
cwd?: string;
|
|
786
|
+
modelId: string;
|
|
787
|
+
sessionId?: string | null;
|
|
788
|
+
/** Agent CLI backend — defaults to cursor when omitted. */
|
|
789
|
+
backend?: AgentBackendKind;
|
|
790
|
+
/** Plan vs agent mode for this run. */
|
|
791
|
+
mode?: AgentMode;
|
|
792
|
+
/** Protocol 4+: user images/files to write into the worker cwd. */
|
|
793
|
+
attachments?: WorkerPromptAttachment[];
|
|
794
|
+
/**
|
|
795
|
+
* Protocol 7+: streamable-HTTP MCP servers to attach (room tools +
|
|
796
|
+
* Integrations Hub), same bundle hosted CLI sandboxes get.
|
|
797
|
+
*/
|
|
798
|
+
mcpServers?: Record<string, {
|
|
799
|
+
type: "http";
|
|
800
|
+
url: string;
|
|
801
|
+
headers: Record<string, string>;
|
|
802
|
+
}>;
|
|
803
|
+
/**
|
|
804
|
+
* Protocol 9+: extra environment for this run only (team machines get the
|
|
805
|
+
* workspace's provider keys this way; never persisted on the machine).
|
|
806
|
+
*/
|
|
807
|
+
env?: Record<string, string>;
|
|
808
|
+
}) => void;
|
|
809
|
+
"worker:abort": (data: {
|
|
810
|
+
roomId: string;
|
|
811
|
+
agentId?: string;
|
|
812
|
+
}) => void;
|
|
813
|
+
/** Protocol 9+: list folders (remote folder browser). Omitted path = the roots / home. */
|
|
814
|
+
"worker:list-dirs": (data: {
|
|
815
|
+
requestId: string;
|
|
816
|
+
path?: string;
|
|
817
|
+
}) => void;
|
|
818
|
+
/**
|
|
819
|
+
* Protocol 9+: clone (or update) a repo into `<work root>/<dir>` and check out
|
|
820
|
+
* `branch` (created from `ref` when missing). `token` authenticates private
|
|
821
|
+
* GitHub clones and is kept only in the clone's remote URL.
|
|
822
|
+
*/
|
|
823
|
+
"worker:prepare-repo": (data: {
|
|
824
|
+
requestId: string;
|
|
825
|
+
repoUrl: string;
|
|
826
|
+
ref: string;
|
|
827
|
+
dir: string;
|
|
828
|
+
branch?: string;
|
|
829
|
+
token?: string;
|
|
830
|
+
}) => void;
|
|
831
|
+
/** Protocol 9+: commit everything in `repoPath` and push `branch`. */
|
|
832
|
+
"worker:finalize-git": (data: {
|
|
833
|
+
requestId: string;
|
|
834
|
+
repoPath: string;
|
|
835
|
+
branch: string;
|
|
836
|
+
message: string;
|
|
837
|
+
token?: string;
|
|
838
|
+
}) => void;
|
|
839
|
+
/** Protocol 11+: working-tree snapshot for a local agent. */
|
|
840
|
+
"worker:workspace-git": (data: {
|
|
841
|
+
requestId: string;
|
|
842
|
+
repoPath: string;
|
|
843
|
+
cwd?: string;
|
|
844
|
+
}) => void;
|
|
845
|
+
/** Protocol 12+: commit, push, switch, create, or discard in a local repo. */
|
|
846
|
+
"worker:workspace-git-action": (data: {
|
|
847
|
+
requestId: string;
|
|
848
|
+
repoPath: string;
|
|
849
|
+
action: "commit" | "push" | "checkout" | "create" | "discard";
|
|
850
|
+
message?: string;
|
|
851
|
+
branch?: string;
|
|
852
|
+
path?: string;
|
|
853
|
+
/** GitHub token for push/fetch; worker stores it in the machine credential helper. */
|
|
854
|
+
token?: string;
|
|
855
|
+
}) => void;
|
|
856
|
+
/** Protocol 11+: list a folder inside a local repo. */
|
|
857
|
+
"worker:workspace-dir": (data: {
|
|
858
|
+
requestId: string;
|
|
859
|
+
repoPath: string;
|
|
860
|
+
path: string;
|
|
861
|
+
}) => void;
|
|
862
|
+
/** Protocol 11+: read a file inside a local repo. */
|
|
863
|
+
"worker:workspace-file": (data: {
|
|
864
|
+
requestId: string;
|
|
865
|
+
repoPath: string;
|
|
866
|
+
path: string;
|
|
867
|
+
}) => void;
|
|
868
|
+
/** Protocol 11+: search paths inside a local repo. */
|
|
869
|
+
"worker:workspace-search": (data: {
|
|
870
|
+
requestId: string;
|
|
871
|
+
repoPath: string;
|
|
872
|
+
query: string;
|
|
873
|
+
}) => void;
|
|
874
|
+
/** Protocol 9+: settings managed in the app. The worker refuses work outside `allowedRoots` (when non-empty). */
|
|
875
|
+
"worker:settings": (data: {
|
|
876
|
+
allowedRoots: string[];
|
|
877
|
+
maxConcurrent: number;
|
|
878
|
+
}) => void;
|
|
879
|
+
/** Protocol 9+: this machine was revoked — forget the credential and stop. */
|
|
880
|
+
"worker:revoked": (data: {
|
|
881
|
+
message: string;
|
|
882
|
+
}) => void;
|
|
883
|
+
"worker:pick-folder": (data: {
|
|
884
|
+
requestId: string;
|
|
885
|
+
}) => void;
|
|
886
|
+
"worker:list-models": (data: {
|
|
887
|
+
requestId: string;
|
|
888
|
+
/** Protocol 6+: list models for this CLI backend. Omitted = cursor. */
|
|
889
|
+
backend?: AgentBackendKind;
|
|
890
|
+
}) => void;
|
|
891
|
+
"worker:list-sessions": (data: {
|
|
892
|
+
requestId: string;
|
|
893
|
+
repoPath: string;
|
|
894
|
+
}) => void;
|
|
895
|
+
"worker:error": (message: string) => void;
|
|
896
|
+
"worker:revert-files": (data: {
|
|
897
|
+
roomId: string;
|
|
898
|
+
agentId?: string;
|
|
899
|
+
filePaths: string[];
|
|
900
|
+
messageId?: string;
|
|
901
|
+
repoPath?: string;
|
|
902
|
+
}) => void;
|
|
903
|
+
}
|
|
904
|
+
export interface AgentStreamEventPayload {
|
|
905
|
+
kind: string;
|
|
906
|
+
sessionId?: string;
|
|
907
|
+
text?: string;
|
|
908
|
+
callId?: string;
|
|
909
|
+
name?: string;
|
|
910
|
+
detail?: string;
|
|
911
|
+
path?: string;
|
|
912
|
+
/** Unified diff for edit tools (local git or synthetic from tool args). */
|
|
913
|
+
diffPatch?: string;
|
|
914
|
+
/** Structured todos for TodoWrite / todo tools. */
|
|
915
|
+
todos?: AgentTodoItem[];
|
|
916
|
+
/** Structured clarifying questions when the LLM asks for user clarification. */
|
|
917
|
+
questions?: ClarifyingQuestion[];
|
|
918
|
+
message?: string;
|
|
919
|
+
result?: string;
|
|
920
|
+
parentCallId?: string;
|
|
921
|
+
status?: string;
|
|
922
|
+
/** MCP tool events: the integration that ran. */
|
|
923
|
+
integration?: ToolIntegrationRef;
|
|
924
|
+
/** tool_done: the tool failed or was rejected. */
|
|
925
|
+
isError?: boolean;
|
|
926
|
+
/** cli_commands: what the CLI reported at startup. */
|
|
927
|
+
catalog?: CliCommandCatalog;
|
|
928
|
+
/** done: token usage for this turn (CLI backends). */
|
|
929
|
+
usage?: RunUsage;
|
|
930
|
+
}
|
|
931
|
+
export declare const AVATAR_COLORS: string[];
|
|
932
|
+
export type { AgentBackendKind };
|