@rynx-ai/workspace 0.1.9
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/dist/agent-execution.d.ts +290 -0
- package/dist/agent-execution.js +8 -0
- package/dist/agent-options.d.ts +26 -0
- package/dist/agent-options.js +106 -0
- package/dist/agent-scheduler.d.ts +149 -0
- package/dist/agent-scheduler.js +1 -0
- package/dist/device-protocol.d.ts +322 -0
- package/dist/device-protocol.js +326 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/skill-name.d.ts +6 -0
- package/dist/skill-name.js +21 -0
- package/dist/skill-path.d.ts +7 -0
- package/dist/skill-path.js +27 -0
- package/dist/types.d.ts +824 -0
- package/dist/types.js +2 -0
- package/package.json +25 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,824 @@
|
|
|
1
|
+
/** Workspace-plane API wire DTOs and dependency injection contracts. */
|
|
2
|
+
import type { WorkspaceDeviceTaskResult, WorkspaceLeasedDeviceTask, WorkspaceSkillArtifact, WorkspaceTaskFinishDisposition } from "./device-protocol.js";
|
|
3
|
+
import type { WorkspaceAgentRuntimeId } from "./agent-options.js";
|
|
4
|
+
import type { WorkspaceAgentSchedulerPlane } from "./agent-scheduler.js";
|
|
5
|
+
import type { WorkspaceAgentRun, WorkspaceAppendAgentRunTurnInput, WorkspaceAppendAgentRunTurnResult, WorkspaceAgentRunDetail, WorkspaceAgentRunEvent, WorkspaceAgentRunOrigin, WorkspaceAgentRunStatus, WorkspaceAgentRunTurnPage, WorkspaceCreateAgentRunInput, WorkspaceCreateAgentRunResult, WorkspaceResolveBlockedAgentRunInput, WorkspaceResolveBlockedAgentRunResult, WorkspaceResolveAgentInteractionInput, WorkspaceResolveAgentInteractionResult } from "./agent-execution.js";
|
|
6
|
+
export interface WorkspaceAuthUser {
|
|
7
|
+
openId: string;
|
|
8
|
+
unionId?: string;
|
|
9
|
+
userId?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
avatarUrl?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface WorkspaceAuthState {
|
|
15
|
+
provider: "lark";
|
|
16
|
+
authenticated: boolean;
|
|
17
|
+
configured?: boolean;
|
|
18
|
+
user?: WorkspaceAuthUser;
|
|
19
|
+
errorCode?: "workspace_auth_not_configured" | "workspace_auth_unavailable" | "workspace_server_unavailable";
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkspaceAuthSession extends WorkspaceAuthUser {
|
|
23
|
+
id: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
expiresAt: string;
|
|
26
|
+
lastSeenAt?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface WorkspaceAuthSessionStore {
|
|
29
|
+
create(session: WorkspaceAuthSession): void | Promise<void>;
|
|
30
|
+
get(id: string): WorkspaceAuthSession | null | Promise<WorkspaceAuthSession | null>;
|
|
31
|
+
touch(id: string, seenAt: string): void | Promise<void>;
|
|
32
|
+
delete(id: string): void | Promise<void>;
|
|
33
|
+
cleanupExpired?(now: string): void | Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
export interface WorkspaceView {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
kind: "shared" | "personal";
|
|
39
|
+
visibility: "public";
|
|
40
|
+
ownerOpenId?: string;
|
|
41
|
+
ownerName?: string;
|
|
42
|
+
createdByOpenId?: string;
|
|
43
|
+
createdByName?: string;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
updatedAt?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface WorkspaceDeviceCredential {
|
|
48
|
+
id: string;
|
|
49
|
+
serverId: string;
|
|
50
|
+
workspaceId: string;
|
|
51
|
+
audience: string;
|
|
52
|
+
installationId: string;
|
|
53
|
+
publicKey: string;
|
|
54
|
+
generation: number;
|
|
55
|
+
status: "pending" | "active" | "revoked";
|
|
56
|
+
authorizationSource: "lark" | "internal" | "legacy";
|
|
57
|
+
scopes: string[];
|
|
58
|
+
name: string;
|
|
59
|
+
tokenPrefix: string;
|
|
60
|
+
createdByOpenId?: string;
|
|
61
|
+
createdByName?: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
expiresAt?: string;
|
|
64
|
+
lastUsedAt?: string;
|
|
65
|
+
}
|
|
66
|
+
/** Server-scoped authorization used only to discover Workspaces and mint child device credentials. */
|
|
67
|
+
export interface WorkspaceDeviceAccessToken {
|
|
68
|
+
id: string;
|
|
69
|
+
serverId: string;
|
|
70
|
+
audience: string;
|
|
71
|
+
installationId: string;
|
|
72
|
+
publicKey: string;
|
|
73
|
+
generation: number;
|
|
74
|
+
authorizationSource: "session" | "enrollment";
|
|
75
|
+
scopes: string[];
|
|
76
|
+
name: string;
|
|
77
|
+
tokenPrefix: string;
|
|
78
|
+
createdByOpenId: string;
|
|
79
|
+
createdByName?: string;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
lastUsedAt?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface WorkspaceDeviceAccessSummary extends WorkspaceDeviceAccessToken {
|
|
84
|
+
status: "active" | "superseded" | "disabled";
|
|
85
|
+
disabledAt?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface WorkspaceInstallationState {
|
|
88
|
+
installationId: string;
|
|
89
|
+
publicKey: string;
|
|
90
|
+
disabledAt?: string;
|
|
91
|
+
}
|
|
92
|
+
/** @deprecated Use WorkspaceDeviceCredential. Kept as a source-compatible wire alias. */
|
|
93
|
+
export type WorkspaceApiToken = WorkspaceDeviceCredential;
|
|
94
|
+
export interface WorkspaceDevice {
|
|
95
|
+
id: string;
|
|
96
|
+
workspaceId: string;
|
|
97
|
+
installationId: string;
|
|
98
|
+
name: string;
|
|
99
|
+
hostname?: string;
|
|
100
|
+
platform?: string;
|
|
101
|
+
arch?: string;
|
|
102
|
+
registeredByOpenId?: string;
|
|
103
|
+
registeredByName?: string;
|
|
104
|
+
credentialId?: string;
|
|
105
|
+
createdAt: string;
|
|
106
|
+
updatedAt: string;
|
|
107
|
+
lastSeenAt: string;
|
|
108
|
+
connected: boolean;
|
|
109
|
+
runtimes: WorkspaceRuntime[];
|
|
110
|
+
}
|
|
111
|
+
export interface WorkspaceRuntime {
|
|
112
|
+
id: string;
|
|
113
|
+
workspaceId: string;
|
|
114
|
+
deviceId: string;
|
|
115
|
+
runtime: string;
|
|
116
|
+
displayName: string;
|
|
117
|
+
binary?: string;
|
|
118
|
+
version?: string;
|
|
119
|
+
/** Model catalogue reported by this exact device runtime. */
|
|
120
|
+
models: WorkspaceAgentModelOption[];
|
|
121
|
+
status: "online" | "offline";
|
|
122
|
+
createdAt: string;
|
|
123
|
+
updatedAt: string;
|
|
124
|
+
lastSeenAt: string;
|
|
125
|
+
}
|
|
126
|
+
export interface WorkspaceRepository {
|
|
127
|
+
id: string;
|
|
128
|
+
workspaceId: string;
|
|
129
|
+
name: string;
|
|
130
|
+
gitUrl: string;
|
|
131
|
+
defaultBranch?: string;
|
|
132
|
+
kind: "remote" | "device_local" | "hybrid";
|
|
133
|
+
tags: string[];
|
|
134
|
+
locations: WorkspaceRepositoryLocation[];
|
|
135
|
+
createdByOpenId?: string;
|
|
136
|
+
createdByName?: string;
|
|
137
|
+
createdAt: string;
|
|
138
|
+
updatedAt: string;
|
|
139
|
+
}
|
|
140
|
+
export interface WorkspaceRepositoryLocation {
|
|
141
|
+
id: string;
|
|
142
|
+
workspaceId: string;
|
|
143
|
+
repositoryId: string;
|
|
144
|
+
deviceId: string;
|
|
145
|
+
deviceName?: string;
|
|
146
|
+
path: string;
|
|
147
|
+
gitUrl?: string;
|
|
148
|
+
branch?: string;
|
|
149
|
+
headSha?: string;
|
|
150
|
+
isWorktree?: boolean;
|
|
151
|
+
sizeBytes?: number;
|
|
152
|
+
status: "available" | "missing" | "stale";
|
|
153
|
+
lastScannedAt: string;
|
|
154
|
+
createdAt: string;
|
|
155
|
+
updatedAt: string;
|
|
156
|
+
}
|
|
157
|
+
export interface WorkspaceRepositoryCandidate {
|
|
158
|
+
id: string;
|
|
159
|
+
workspaceId: string;
|
|
160
|
+
deviceId: string;
|
|
161
|
+
deviceName?: string;
|
|
162
|
+
path: string;
|
|
163
|
+
name: string;
|
|
164
|
+
gitUrl?: string;
|
|
165
|
+
branch?: string;
|
|
166
|
+
headSha?: string;
|
|
167
|
+
isWorktree?: boolean;
|
|
168
|
+
sizeBytes?: number;
|
|
169
|
+
tags: string[];
|
|
170
|
+
lastScannedAt: string;
|
|
171
|
+
}
|
|
172
|
+
export interface WorkspaceRepositoryPathRequest {
|
|
173
|
+
id: string;
|
|
174
|
+
workspaceId: string;
|
|
175
|
+
deviceId: string;
|
|
176
|
+
deviceName?: string;
|
|
177
|
+
path: string;
|
|
178
|
+
status: "pending" | "running" | "found" | "invalid";
|
|
179
|
+
lastError?: string;
|
|
180
|
+
requestedByOpenId?: string;
|
|
181
|
+
requestedByName?: string;
|
|
182
|
+
createdAt: string;
|
|
183
|
+
updatedAt: string;
|
|
184
|
+
lastCheckedAt?: string;
|
|
185
|
+
}
|
|
186
|
+
export type WorkspaceAgentPlacement = {
|
|
187
|
+
mode: "auto";
|
|
188
|
+
} | {
|
|
189
|
+
mode: "fixed";
|
|
190
|
+
deviceId: string;
|
|
191
|
+
};
|
|
192
|
+
/** An exact immutable Skill revision referenced by an Agent revision. */
|
|
193
|
+
export interface WorkspaceAgentSkillRevisionRef {
|
|
194
|
+
skillId: string;
|
|
195
|
+
skillRevisionId: string;
|
|
196
|
+
revisionNumber: number;
|
|
197
|
+
name: string;
|
|
198
|
+
description?: string;
|
|
199
|
+
contentHash: string;
|
|
200
|
+
fileCount: number;
|
|
201
|
+
}
|
|
202
|
+
export interface WorkspaceAgentRevision {
|
|
203
|
+
id: string;
|
|
204
|
+
workspaceId: string;
|
|
205
|
+
agentId: string;
|
|
206
|
+
revisionNumber: number;
|
|
207
|
+
name: string;
|
|
208
|
+
description?: string;
|
|
209
|
+
instructions: string;
|
|
210
|
+
runtime: WorkspaceAgentRuntimeId;
|
|
211
|
+
placement: WorkspaceAgentPlacement;
|
|
212
|
+
model: string;
|
|
213
|
+
reasoningEffort?: string;
|
|
214
|
+
skillRevisions: WorkspaceAgentSkillRevisionRef[];
|
|
215
|
+
createdByOpenId?: string;
|
|
216
|
+
createdByName?: string;
|
|
217
|
+
createdAt: string;
|
|
218
|
+
}
|
|
219
|
+
/** Stable Agent identity. Editable execution configuration lives in currentRevision. */
|
|
220
|
+
export interface WorkspaceAgent {
|
|
221
|
+
id: string;
|
|
222
|
+
workspaceId: string;
|
|
223
|
+
createdByOpenId?: string;
|
|
224
|
+
createdByName?: string;
|
|
225
|
+
createdAt: string;
|
|
226
|
+
updatedAt: string;
|
|
227
|
+
archivedAt?: string;
|
|
228
|
+
currentRevision: WorkspaceAgentRevision;
|
|
229
|
+
}
|
|
230
|
+
export interface WorkspaceAgentRevisionInput {
|
|
231
|
+
name: string;
|
|
232
|
+
description?: string;
|
|
233
|
+
instructions: string;
|
|
234
|
+
runtime: WorkspaceAgentRuntimeId;
|
|
235
|
+
placement: WorkspaceAgentPlacement;
|
|
236
|
+
model: string;
|
|
237
|
+
reasoningEffort?: string;
|
|
238
|
+
skillRevisionIds: string[];
|
|
239
|
+
}
|
|
240
|
+
export interface WorkspaceCreateAgentInput extends WorkspaceAgentRevisionInput {
|
|
241
|
+
workspaceId: string;
|
|
242
|
+
createdBy?: WorkspaceAuthUser;
|
|
243
|
+
}
|
|
244
|
+
export interface WorkspaceUpdateAgentInput extends WorkspaceAgentRevisionInput {
|
|
245
|
+
workspaceId: string;
|
|
246
|
+
agentId: string;
|
|
247
|
+
expectedRevisionId: string;
|
|
248
|
+
updatedBy?: WorkspaceAuthUser;
|
|
249
|
+
}
|
|
250
|
+
export interface WorkspaceArchiveAgentInput {
|
|
251
|
+
workspaceId: string;
|
|
252
|
+
agentId: string;
|
|
253
|
+
expectedRevisionId: string;
|
|
254
|
+
archivedBy?: WorkspaceAuthUser;
|
|
255
|
+
}
|
|
256
|
+
export type WorkspaceAgentMutationInvalidCode = "invalid_input" | "invalid_runtime" | "invalid_device" | "invalid_skill_revision";
|
|
257
|
+
export type WorkspaceAgentMutationResult = {
|
|
258
|
+
status: "created" | "updated" | "archived";
|
|
259
|
+
agent: WorkspaceAgent;
|
|
260
|
+
} | {
|
|
261
|
+
status: "not_found";
|
|
262
|
+
} | {
|
|
263
|
+
status: "revision_conflict";
|
|
264
|
+
currentRevisionId: string;
|
|
265
|
+
} | {
|
|
266
|
+
status: "invalid";
|
|
267
|
+
code: WorkspaceAgentMutationInvalidCode;
|
|
268
|
+
error: string;
|
|
269
|
+
};
|
|
270
|
+
export type WorkspaceSkillSourceType = "agentbuddy" | "github" | "local-runtime" | "archive" | "manual";
|
|
271
|
+
export type WorkspaceSkillImportConflictMode = "fail" | "overwrite" | "rename" | "skip";
|
|
272
|
+
export type WorkspaceSkillImportStatus = "created" | "updated" | "conflict" | "skipped" | "failed";
|
|
273
|
+
export type WorkspaceSkillRuntimeKind = WorkspaceAgentRuntimeId;
|
|
274
|
+
export interface WorkspaceSkillRevisionFileEntry {
|
|
275
|
+
path: string;
|
|
276
|
+
sizeBytes: number;
|
|
277
|
+
sha256: string;
|
|
278
|
+
}
|
|
279
|
+
/** Stable Skill identity. Skill names and bytes are immutable revision data. */
|
|
280
|
+
export interface WorkspaceSkill {
|
|
281
|
+
id: string;
|
|
282
|
+
workspaceId: string;
|
|
283
|
+
createdByOpenId?: string;
|
|
284
|
+
createdByName?: string;
|
|
285
|
+
createdAt: string;
|
|
286
|
+
updatedAt: string;
|
|
287
|
+
archivedAt?: string;
|
|
288
|
+
}
|
|
289
|
+
export interface WorkspaceSkillRevision {
|
|
290
|
+
id: string;
|
|
291
|
+
workspaceId: string;
|
|
292
|
+
skillId: string;
|
|
293
|
+
revisionNumber: number;
|
|
294
|
+
name: string;
|
|
295
|
+
description?: string;
|
|
296
|
+
sourceType: WorkspaceSkillSourceType;
|
|
297
|
+
sourceUrl?: string;
|
|
298
|
+
sourceRuntime?: WorkspaceSkillRuntimeKind;
|
|
299
|
+
sourceRuntimeId?: string;
|
|
300
|
+
sourceDeviceId?: string;
|
|
301
|
+
sourceDeviceName?: string;
|
|
302
|
+
sourcePath?: string;
|
|
303
|
+
contentHash: string;
|
|
304
|
+
fileCount: number;
|
|
305
|
+
createdByOpenId?: string;
|
|
306
|
+
createdByName?: string;
|
|
307
|
+
createdAt: string;
|
|
308
|
+
}
|
|
309
|
+
export interface WorkspaceSkillRevisionDetail extends WorkspaceSkillRevision {
|
|
310
|
+
files: WorkspaceSkillRevisionFileEntry[];
|
|
311
|
+
}
|
|
312
|
+
export interface WorkspaceSkillSummary extends WorkspaceSkill {
|
|
313
|
+
currentRevision: WorkspaceSkillRevision;
|
|
314
|
+
}
|
|
315
|
+
export interface WorkspaceSkillDetail extends WorkspaceSkill {
|
|
316
|
+
currentRevision: WorkspaceSkillRevisionDetail;
|
|
317
|
+
}
|
|
318
|
+
/** Complete immutable file bytes. contentBase64 is never truncated. */
|
|
319
|
+
export interface WorkspaceSkillRevisionFile extends WorkspaceSkillRevisionFileEntry {
|
|
320
|
+
workspaceId: string;
|
|
321
|
+
skillId: string;
|
|
322
|
+
skillRevisionId: string;
|
|
323
|
+
contentBase64: string;
|
|
324
|
+
}
|
|
325
|
+
export interface WorkspaceSkillRevisionFileInput {
|
|
326
|
+
path: string;
|
|
327
|
+
contentBase64: string;
|
|
328
|
+
}
|
|
329
|
+
export interface WorkspaceSkillRevisionInput {
|
|
330
|
+
name: string;
|
|
331
|
+
description?: string;
|
|
332
|
+
sourceType: WorkspaceSkillSourceType;
|
|
333
|
+
sourceUrl?: string;
|
|
334
|
+
sourceRuntime?: WorkspaceSkillRuntimeKind;
|
|
335
|
+
sourceRuntimeId?: string;
|
|
336
|
+
sourceDeviceId?: string;
|
|
337
|
+
sourceDeviceName?: string;
|
|
338
|
+
sourcePath?: string;
|
|
339
|
+
files: WorkspaceSkillRevisionFileInput[];
|
|
340
|
+
}
|
|
341
|
+
export interface WorkspaceCreateSkillInput extends WorkspaceSkillRevisionInput {
|
|
342
|
+
workspaceId: string;
|
|
343
|
+
createdBy?: WorkspaceAuthUser;
|
|
344
|
+
}
|
|
345
|
+
export interface WorkspaceUpdateSkillInput extends WorkspaceSkillRevisionInput {
|
|
346
|
+
workspaceId: string;
|
|
347
|
+
skillId: string;
|
|
348
|
+
expectedRevisionId: string;
|
|
349
|
+
updatedBy?: WorkspaceAuthUser;
|
|
350
|
+
}
|
|
351
|
+
export interface WorkspaceArchiveSkillInput {
|
|
352
|
+
workspaceId: string;
|
|
353
|
+
skillId: string;
|
|
354
|
+
expectedRevisionId: string;
|
|
355
|
+
archivedBy?: WorkspaceAuthUser;
|
|
356
|
+
}
|
|
357
|
+
export type WorkspaceSkillMutationInvalidCode = "invalid_input" | "invalid_file" | "invalid_source";
|
|
358
|
+
export type WorkspaceSkillMutationResult = {
|
|
359
|
+
status: "created" | "updated" | "archived";
|
|
360
|
+
skill: WorkspaceSkillSummary;
|
|
361
|
+
} | {
|
|
362
|
+
status: "not_found";
|
|
363
|
+
} | {
|
|
364
|
+
status: "revision_conflict";
|
|
365
|
+
currentRevisionId: string;
|
|
366
|
+
} | {
|
|
367
|
+
status: "invalid";
|
|
368
|
+
code: WorkspaceSkillMutationInvalidCode;
|
|
369
|
+
error: string;
|
|
370
|
+
};
|
|
371
|
+
export interface WorkspaceRuntimeSkillCandidate {
|
|
372
|
+
key: string;
|
|
373
|
+
name: string;
|
|
374
|
+
description?: string;
|
|
375
|
+
deviceId?: string;
|
|
376
|
+
deviceName?: string;
|
|
377
|
+
runtimeId?: string;
|
|
378
|
+
runtimeDisplayName?: string;
|
|
379
|
+
sourceRuntime: WorkspaceSkillRuntimeKind;
|
|
380
|
+
sourcePath: string;
|
|
381
|
+
root: "provider" | "universal";
|
|
382
|
+
fileCount: number;
|
|
383
|
+
sizeBytes: number;
|
|
384
|
+
}
|
|
385
|
+
export interface WorkspaceSkillImportResult {
|
|
386
|
+
status: WorkspaceSkillImportStatus;
|
|
387
|
+
name: string;
|
|
388
|
+
skill?: WorkspaceSkillSummary;
|
|
389
|
+
sourceType?: WorkspaceSkillSourceType;
|
|
390
|
+
sourcePath?: string;
|
|
391
|
+
message?: string;
|
|
392
|
+
}
|
|
393
|
+
export interface WorkspaceSkillFilePayload {
|
|
394
|
+
path: string;
|
|
395
|
+
/** UTF-8 text, or base64 when `binary` is true. */
|
|
396
|
+
content: string;
|
|
397
|
+
sizeBytes: number;
|
|
398
|
+
binary?: boolean;
|
|
399
|
+
truncated?: boolean;
|
|
400
|
+
hash?: string;
|
|
401
|
+
}
|
|
402
|
+
export interface WorkspaceSkillImportBundle {
|
|
403
|
+
name: string;
|
|
404
|
+
description?: string;
|
|
405
|
+
sourcePath: string;
|
|
406
|
+
contentHash: string;
|
|
407
|
+
files: WorkspaceSkillFilePayload[];
|
|
408
|
+
}
|
|
409
|
+
export interface WorkspaceSkillRuntimeScanRequest {
|
|
410
|
+
id: string;
|
|
411
|
+
workspaceId: string;
|
|
412
|
+
deviceId: string;
|
|
413
|
+
runtimeId: string;
|
|
414
|
+
runtime: WorkspaceSkillRuntimeKind;
|
|
415
|
+
status: "pending" | "running" | "completed" | "failed";
|
|
416
|
+
candidates: WorkspaceRuntimeSkillCandidate[];
|
|
417
|
+
error?: string;
|
|
418
|
+
createdAt: string;
|
|
419
|
+
updatedAt: string;
|
|
420
|
+
}
|
|
421
|
+
export interface WorkspaceSkillRuntimeImportRequest {
|
|
422
|
+
id: string;
|
|
423
|
+
workspaceId: string;
|
|
424
|
+
deviceId: string;
|
|
425
|
+
runtimeId: string;
|
|
426
|
+
runtime: WorkspaceSkillRuntimeKind;
|
|
427
|
+
status: "pending" | "running" | "completed" | "failed";
|
|
428
|
+
results: WorkspaceSkillImportResult[];
|
|
429
|
+
error?: string;
|
|
430
|
+
createdAt: string;
|
|
431
|
+
updatedAt: string;
|
|
432
|
+
}
|
|
433
|
+
export interface WorkspaceDeviceSkillRuntimeScanTask {
|
|
434
|
+
id: string;
|
|
435
|
+
workspaceId: string;
|
|
436
|
+
deviceId: string;
|
|
437
|
+
runtimeId: string;
|
|
438
|
+
runtime: WorkspaceSkillRuntimeKind;
|
|
439
|
+
}
|
|
440
|
+
export interface WorkspaceDeviceSkillRuntimeImportTask extends WorkspaceDeviceSkillRuntimeScanTask {
|
|
441
|
+
keys: string[];
|
|
442
|
+
}
|
|
443
|
+
export interface WorkspaceDeviceSkillRuntimeScanReport {
|
|
444
|
+
requestId: string;
|
|
445
|
+
runtimeId: string;
|
|
446
|
+
runtime: WorkspaceSkillRuntimeKind;
|
|
447
|
+
candidates?: WorkspaceRuntimeSkillCandidate[];
|
|
448
|
+
error?: string;
|
|
449
|
+
}
|
|
450
|
+
export interface WorkspaceDeviceSkillRuntimeImportReport {
|
|
451
|
+
requestId: string;
|
|
452
|
+
runtimeId: string;
|
|
453
|
+
runtime: WorkspaceSkillRuntimeKind;
|
|
454
|
+
skills?: WorkspaceSkillImportBundle[];
|
|
455
|
+
failures?: WorkspaceSkillImportResult[];
|
|
456
|
+
error?: string;
|
|
457
|
+
}
|
|
458
|
+
export interface WorkspaceDeviceSkillArtifactBundle {
|
|
459
|
+
id: string;
|
|
460
|
+
skillRevisionId: string;
|
|
461
|
+
name: string;
|
|
462
|
+
description?: string;
|
|
463
|
+
contentHash: string;
|
|
464
|
+
files: WorkspaceSkillFilePayload[];
|
|
465
|
+
}
|
|
466
|
+
export interface WorkspaceDeviceSkillArtifactRef {
|
|
467
|
+
id: string;
|
|
468
|
+
skillRevisionId: string;
|
|
469
|
+
name: string;
|
|
470
|
+
description?: string;
|
|
471
|
+
contentHash: string;
|
|
472
|
+
}
|
|
473
|
+
export interface WorkspaceAgentModelOption {
|
|
474
|
+
id: string;
|
|
475
|
+
label: string;
|
|
476
|
+
description?: string;
|
|
477
|
+
isDefault?: boolean;
|
|
478
|
+
supportedReasoningEfforts?: WorkspaceAgentReasoningOption[];
|
|
479
|
+
defaultReasoningEffort?: string;
|
|
480
|
+
}
|
|
481
|
+
export interface WorkspaceAgentReasoningOption {
|
|
482
|
+
value: string;
|
|
483
|
+
label: string;
|
|
484
|
+
description?: string;
|
|
485
|
+
}
|
|
486
|
+
export interface WorkspaceRuntimeRegistration {
|
|
487
|
+
runtime: string;
|
|
488
|
+
displayName?: string;
|
|
489
|
+
binary?: string;
|
|
490
|
+
version?: string;
|
|
491
|
+
models?: WorkspaceAgentModelOption[];
|
|
492
|
+
status?: "online" | "offline";
|
|
493
|
+
}
|
|
494
|
+
export interface WorkspaceRepositoryScanResult {
|
|
495
|
+
path: string;
|
|
496
|
+
name?: string;
|
|
497
|
+
gitUrl?: string;
|
|
498
|
+
branch?: string;
|
|
499
|
+
headSha?: string;
|
|
500
|
+
isWorktree?: boolean;
|
|
501
|
+
sizeBytes?: number;
|
|
502
|
+
tags?: string[];
|
|
503
|
+
}
|
|
504
|
+
export interface WorkspaceDeviceIdentity {
|
|
505
|
+
name: string;
|
|
506
|
+
hostname: string;
|
|
507
|
+
platform: string;
|
|
508
|
+
arch: string;
|
|
509
|
+
}
|
|
510
|
+
export interface WorkspaceDeviceInventory {
|
|
511
|
+
digest: string;
|
|
512
|
+
runtimes: WorkspaceRuntimeRegistration[];
|
|
513
|
+
repositories: WorkspaceRepositoryScanResult[];
|
|
514
|
+
}
|
|
515
|
+
export interface WorkspacePlaneDeps extends WorkspaceAgentSchedulerPlane {
|
|
516
|
+
serverId(): string;
|
|
517
|
+
listWorkspaces(user?: WorkspaceAuthUser): WorkspaceView[];
|
|
518
|
+
createWorkspace(input: {
|
|
519
|
+
name: string;
|
|
520
|
+
createdBy?: WorkspaceAuthUser;
|
|
521
|
+
}): WorkspaceView;
|
|
522
|
+
ensurePersonalWorkspace(user: WorkspaceAuthUser): Promise<WorkspaceView> | WorkspaceView;
|
|
523
|
+
workspaceExists(id: string): boolean;
|
|
524
|
+
workspaceAccessible(input: {
|
|
525
|
+
workspaceId: string;
|
|
526
|
+
user?: WorkspaceAuthUser;
|
|
527
|
+
}): boolean;
|
|
528
|
+
installationState(installationId: string): WorkspaceInstallationState | null;
|
|
529
|
+
completeDeviceAccessToken(input: {
|
|
530
|
+
serverId: string;
|
|
531
|
+
audience: string;
|
|
532
|
+
installationId: string;
|
|
533
|
+
publicKey: string;
|
|
534
|
+
name: string;
|
|
535
|
+
accessToken: string;
|
|
536
|
+
authorizationSource: "session" | "enrollment";
|
|
537
|
+
createdBy: WorkspaceAuthUser;
|
|
538
|
+
}): {
|
|
539
|
+
status: "issued";
|
|
540
|
+
access: WorkspaceDeviceAccessToken;
|
|
541
|
+
revokedCredentialIds: string[];
|
|
542
|
+
} | {
|
|
543
|
+
status: "key_mismatch";
|
|
544
|
+
} | {
|
|
545
|
+
status: "installation_disabled";
|
|
546
|
+
};
|
|
547
|
+
listDeviceAccess(user: WorkspaceAuthUser): WorkspaceDeviceAccessSummary[];
|
|
548
|
+
revokeDeviceAccess(input: {
|
|
549
|
+
installationId: string;
|
|
550
|
+
user: WorkspaceAuthUser;
|
|
551
|
+
}): {
|
|
552
|
+
revoked: boolean;
|
|
553
|
+
revokedCredentialIds: string[];
|
|
554
|
+
};
|
|
555
|
+
authenticateDeviceAccessToken(rawToken: string): WorkspaceDeviceAccessToken | null | Promise<WorkspaceDeviceAccessToken | null>;
|
|
556
|
+
createApiTokenFromDeviceAccess(input: {
|
|
557
|
+
access: WorkspaceDeviceAccessToken;
|
|
558
|
+
workspaceId: string;
|
|
559
|
+
name?: string;
|
|
560
|
+
}): {
|
|
561
|
+
token: WorkspaceApiToken;
|
|
562
|
+
rawToken: string;
|
|
563
|
+
revokedTokenIds: string[];
|
|
564
|
+
} | null;
|
|
565
|
+
listApiTokens(input: {
|
|
566
|
+
workspaceId: string;
|
|
567
|
+
user?: WorkspaceAuthUser;
|
|
568
|
+
}): WorkspaceApiToken[];
|
|
569
|
+
createApiToken(input: {
|
|
570
|
+
serverId: string;
|
|
571
|
+
workspaceId: string;
|
|
572
|
+
audience: string;
|
|
573
|
+
installationId: string;
|
|
574
|
+
publicKey: string;
|
|
575
|
+
name: string;
|
|
576
|
+
createdBy?: WorkspaceAuthUser;
|
|
577
|
+
}): {
|
|
578
|
+
token: WorkspaceApiToken;
|
|
579
|
+
rawToken: string;
|
|
580
|
+
revokedTokenIds: string[];
|
|
581
|
+
};
|
|
582
|
+
revokeApiToken(input: {
|
|
583
|
+
id: string;
|
|
584
|
+
workspaceId: string;
|
|
585
|
+
user?: WorkspaceAuthUser;
|
|
586
|
+
}): boolean;
|
|
587
|
+
authenticateApiToken(rawToken: string): WorkspaceApiToken | null | Promise<WorkspaceApiToken | null>;
|
|
588
|
+
isApiTokenActive(token: WorkspaceApiToken): boolean | Promise<boolean>;
|
|
589
|
+
listDevices(workspaceId: string): WorkspaceDevice[];
|
|
590
|
+
connectDevice(input: {
|
|
591
|
+
installationId: string;
|
|
592
|
+
identity: WorkspaceDeviceIdentity;
|
|
593
|
+
token: WorkspaceApiToken;
|
|
594
|
+
}): {
|
|
595
|
+
device: WorkspaceDevice;
|
|
596
|
+
activatedCredentialId: string;
|
|
597
|
+
revokedCredentialIds: string[];
|
|
598
|
+
} | null | Promise<{
|
|
599
|
+
device: WorkspaceDevice;
|
|
600
|
+
activatedCredentialId: string;
|
|
601
|
+
revokedCredentialIds: string[];
|
|
602
|
+
} | null>;
|
|
603
|
+
updateDeviceInventory(input: {
|
|
604
|
+
workspaceId: string;
|
|
605
|
+
deviceId: string;
|
|
606
|
+
inventory: WorkspaceDeviceInventory;
|
|
607
|
+
}): WorkspaceDevice | null | Promise<WorkspaceDevice | null>;
|
|
608
|
+
setDeviceConnection(input: {
|
|
609
|
+
workspaceId: string;
|
|
610
|
+
deviceId: string;
|
|
611
|
+
instanceId: string;
|
|
612
|
+
connected: boolean;
|
|
613
|
+
}): void | Promise<void>;
|
|
614
|
+
resetDeviceConnections(): void | Promise<void>;
|
|
615
|
+
removeDevice(input: {
|
|
616
|
+
workspaceId: string;
|
|
617
|
+
deviceId: string;
|
|
618
|
+
}): {
|
|
619
|
+
reset: boolean;
|
|
620
|
+
revokedTokenIds: string[];
|
|
621
|
+
};
|
|
622
|
+
listRepositories(workspaceId: string): WorkspaceRepository[];
|
|
623
|
+
listRepositoryCandidates(workspaceId: string): WorkspaceRepositoryCandidate[];
|
|
624
|
+
listRepositoryPathRequests(workspaceId: string): WorkspaceRepositoryPathRequest[];
|
|
625
|
+
requestRepositoryPath(input: {
|
|
626
|
+
workspaceId: string;
|
|
627
|
+
deviceId: string;
|
|
628
|
+
path: string;
|
|
629
|
+
requestedBy?: WorkspaceAuthUser;
|
|
630
|
+
}): WorkspaceRepositoryPathRequest | null;
|
|
631
|
+
registerRepository(input: {
|
|
632
|
+
workspaceId: string;
|
|
633
|
+
gitUrl: string;
|
|
634
|
+
name?: string;
|
|
635
|
+
defaultBranch?: string;
|
|
636
|
+
createdBy?: WorkspaceAuthUser;
|
|
637
|
+
}): WorkspaceRepository;
|
|
638
|
+
registerRepositoryFromCandidate(input: {
|
|
639
|
+
workspaceId: string;
|
|
640
|
+
deviceId: string;
|
|
641
|
+
path: string;
|
|
642
|
+
createdBy?: WorkspaceAuthUser;
|
|
643
|
+
}): WorkspaceRepository | null;
|
|
644
|
+
removeRepository(input: {
|
|
645
|
+
workspaceId: string;
|
|
646
|
+
repositoryId: string;
|
|
647
|
+
}): boolean;
|
|
648
|
+
listAgents(workspaceId: string): WorkspaceAgent[];
|
|
649
|
+
createAgent(input: WorkspaceCreateAgentInput): WorkspaceAgentMutationResult;
|
|
650
|
+
getAgent(input: {
|
|
651
|
+
workspaceId: string;
|
|
652
|
+
agentId: string;
|
|
653
|
+
}): WorkspaceAgent | null;
|
|
654
|
+
listAgentRevisions(input: {
|
|
655
|
+
workspaceId: string;
|
|
656
|
+
agentId: string;
|
|
657
|
+
}): WorkspaceAgentRevision[];
|
|
658
|
+
getAgentRevision(input: {
|
|
659
|
+
workspaceId: string;
|
|
660
|
+
agentId: string;
|
|
661
|
+
revisionId: string;
|
|
662
|
+
}): WorkspaceAgentRevision | null;
|
|
663
|
+
updateAgent(input: WorkspaceUpdateAgentInput): WorkspaceAgentMutationResult;
|
|
664
|
+
archiveAgent(input: WorkspaceArchiveAgentInput): WorkspaceAgentMutationResult;
|
|
665
|
+
createAgentRun(input: WorkspaceCreateAgentRunInput): Promise<WorkspaceCreateAgentRunResult> | WorkspaceCreateAgentRunResult;
|
|
666
|
+
appendAgentRunTurn(input: WorkspaceAppendAgentRunTurnInput): Promise<WorkspaceAppendAgentRunTurnResult> | WorkspaceAppendAgentRunTurnResult;
|
|
667
|
+
listAgentRuns(input: {
|
|
668
|
+
workspaceId: string;
|
|
669
|
+
agentId?: string;
|
|
670
|
+
originType?: WorkspaceAgentRunOrigin["type"];
|
|
671
|
+
status?: WorkspaceAgentRunStatus;
|
|
672
|
+
limit?: number;
|
|
673
|
+
}): Promise<WorkspaceAgentRun[]> | WorkspaceAgentRun[];
|
|
674
|
+
getAgentRunDetail(input: {
|
|
675
|
+
workspaceId: string;
|
|
676
|
+
runId: string;
|
|
677
|
+
}): Promise<WorkspaceAgentRunDetail | null> | WorkspaceAgentRunDetail | null;
|
|
678
|
+
getAgentRunTurnPage(input: {
|
|
679
|
+
workspaceId: string;
|
|
680
|
+
runId: string;
|
|
681
|
+
beforeSequence: number;
|
|
682
|
+
limit?: number;
|
|
683
|
+
}): Promise<WorkspaceAgentRunTurnPage | null> | WorkspaceAgentRunTurnPage | null;
|
|
684
|
+
agentRunExists(input: {
|
|
685
|
+
workspaceId: string;
|
|
686
|
+
runId: string;
|
|
687
|
+
}): Promise<boolean> | boolean;
|
|
688
|
+
listAgentRunEvents(input: {
|
|
689
|
+
workspaceId: string;
|
|
690
|
+
runId: string;
|
|
691
|
+
afterSequence?: number;
|
|
692
|
+
limit?: number;
|
|
693
|
+
}): Promise<WorkspaceAgentRunEvent[]> | WorkspaceAgentRunEvent[];
|
|
694
|
+
cancelAgentRun(input: {
|
|
695
|
+
workspaceId: string;
|
|
696
|
+
runId: string;
|
|
697
|
+
requestId: string;
|
|
698
|
+
}): Promise<{
|
|
699
|
+
status: "cancelled" | "replayed";
|
|
700
|
+
run: WorkspaceAgentRunDetail;
|
|
701
|
+
} | {
|
|
702
|
+
status: "needs_scheduler";
|
|
703
|
+
run: WorkspaceAgentRunDetail;
|
|
704
|
+
} | {
|
|
705
|
+
status: "not_found";
|
|
706
|
+
} | {
|
|
707
|
+
status: "conflict";
|
|
708
|
+
error: string;
|
|
709
|
+
}> | ({
|
|
710
|
+
status: "cancelled" | "replayed";
|
|
711
|
+
run: WorkspaceAgentRunDetail;
|
|
712
|
+
} | {
|
|
713
|
+
status: "needs_scheduler";
|
|
714
|
+
run: WorkspaceAgentRunDetail;
|
|
715
|
+
} | {
|
|
716
|
+
status: "not_found";
|
|
717
|
+
} | {
|
|
718
|
+
status: "conflict";
|
|
719
|
+
error: string;
|
|
720
|
+
});
|
|
721
|
+
resolveBlockedAgentRun(input: WorkspaceResolveBlockedAgentRunInput): Promise<WorkspaceResolveBlockedAgentRunResult> | WorkspaceResolveBlockedAgentRunResult;
|
|
722
|
+
resolveAgentInteraction(input: WorkspaceResolveAgentInteractionInput): Promise<WorkspaceResolveAgentInteractionResult> | WorkspaceResolveAgentInteractionResult;
|
|
723
|
+
leaseDeviceTasks(input: {
|
|
724
|
+
workspaceId: string;
|
|
725
|
+
deviceId: string;
|
|
726
|
+
leaseOwner: string;
|
|
727
|
+
limit: number;
|
|
728
|
+
leaseMs: number;
|
|
729
|
+
}): Promise<WorkspaceLeasedDeviceTask[]> | WorkspaceLeasedDeviceTask[];
|
|
730
|
+
listAcceptedDeviceLeases(input: {
|
|
731
|
+
workspaceId: string;
|
|
732
|
+
deviceId: string;
|
|
733
|
+
leaseOwner: string;
|
|
734
|
+
}): Promise<WorkspaceLeasedDeviceTask[]> | WorkspaceLeasedDeviceTask[];
|
|
735
|
+
renewDeviceTask(input: {
|
|
736
|
+
workspaceId: string;
|
|
737
|
+
deviceId: string;
|
|
738
|
+
taskId: string;
|
|
739
|
+
leaseToken: string;
|
|
740
|
+
leaseOwner: string;
|
|
741
|
+
leaseMs: number;
|
|
742
|
+
}): Promise<string | null> | string | null;
|
|
743
|
+
finishDeviceTask(input: {
|
|
744
|
+
workspaceId: string;
|
|
745
|
+
deviceId: string;
|
|
746
|
+
result: WorkspaceDeviceTaskResult;
|
|
747
|
+
}): Promise<WorkspaceTaskFinishDisposition> | WorkspaceTaskFinishDisposition;
|
|
748
|
+
releaseDeviceTask(input: {
|
|
749
|
+
workspaceId: string;
|
|
750
|
+
deviceId: string;
|
|
751
|
+
taskId: string;
|
|
752
|
+
leaseToken: string;
|
|
753
|
+
}): Promise<boolean> | boolean;
|
|
754
|
+
releaseDeviceLeases(input: {
|
|
755
|
+
workspaceId: string;
|
|
756
|
+
deviceId: string;
|
|
757
|
+
exceptOwner: string;
|
|
758
|
+
}): Promise<number> | number;
|
|
759
|
+
listSkills(workspaceId: string): Promise<WorkspaceSkillSummary[]> | WorkspaceSkillSummary[];
|
|
760
|
+
createSkill(input: WorkspaceCreateSkillInput): Promise<WorkspaceSkillMutationResult> | WorkspaceSkillMutationResult;
|
|
761
|
+
getSkillDetail(input: {
|
|
762
|
+
workspaceId: string;
|
|
763
|
+
skillId: string;
|
|
764
|
+
}): Promise<WorkspaceSkillDetail | null> | WorkspaceSkillDetail | null;
|
|
765
|
+
listSkillRevisions(input: {
|
|
766
|
+
workspaceId: string;
|
|
767
|
+
skillId: string;
|
|
768
|
+
}): Promise<WorkspaceSkillRevision[]> | WorkspaceSkillRevision[];
|
|
769
|
+
getSkillRevision(input: {
|
|
770
|
+
workspaceId: string;
|
|
771
|
+
skillId: string;
|
|
772
|
+
revisionId: string;
|
|
773
|
+
}): Promise<WorkspaceSkillRevisionDetail | null> | WorkspaceSkillRevisionDetail | null;
|
|
774
|
+
readSkillRevisionFile(input: {
|
|
775
|
+
workspaceId: string;
|
|
776
|
+
skillId: string;
|
|
777
|
+
revisionId: string;
|
|
778
|
+
path: string;
|
|
779
|
+
}): Promise<WorkspaceSkillRevisionFile | null> | WorkspaceSkillRevisionFile | null;
|
|
780
|
+
updateSkill(input: WorkspaceUpdateSkillInput): Promise<WorkspaceSkillMutationResult> | WorkspaceSkillMutationResult;
|
|
781
|
+
archiveSkill(input: WorkspaceArchiveSkillInput): Promise<WorkspaceSkillMutationResult> | WorkspaceSkillMutationResult;
|
|
782
|
+
createSkillRuntimeScan(input: {
|
|
783
|
+
workspaceId: string;
|
|
784
|
+
deviceId: string;
|
|
785
|
+
runtimeId: string;
|
|
786
|
+
createdBy?: WorkspaceAuthUser;
|
|
787
|
+
}): Promise<WorkspaceSkillRuntimeScanRequest | null> | WorkspaceSkillRuntimeScanRequest | null;
|
|
788
|
+
getLatestSkillRuntimeScan(input: {
|
|
789
|
+
workspaceId: string;
|
|
790
|
+
deviceId: string;
|
|
791
|
+
runtimeId: string;
|
|
792
|
+
}): Promise<WorkspaceSkillRuntimeScanRequest | null> | WorkspaceSkillRuntimeScanRequest | null;
|
|
793
|
+
getSkillRuntimeScan(input: {
|
|
794
|
+
workspaceId: string;
|
|
795
|
+
requestId: string;
|
|
796
|
+
}): Promise<WorkspaceSkillRuntimeScanRequest | null> | WorkspaceSkillRuntimeScanRequest | null;
|
|
797
|
+
createSkillRuntimeImport(input: {
|
|
798
|
+
workspaceId: string;
|
|
799
|
+
deviceId: string;
|
|
800
|
+
runtimeId: string;
|
|
801
|
+
keys: string[];
|
|
802
|
+
createdBy?: WorkspaceAuthUser;
|
|
803
|
+
}): Promise<WorkspaceSkillRuntimeImportRequest | null> | WorkspaceSkillRuntimeImportRequest | null;
|
|
804
|
+
getSkillRuntimeImport(input: {
|
|
805
|
+
workspaceId: string;
|
|
806
|
+
requestId: string;
|
|
807
|
+
}): Promise<WorkspaceSkillRuntimeImportRequest | null> | WorkspaceSkillRuntimeImportRequest | null;
|
|
808
|
+
getSkillArtifact(input: {
|
|
809
|
+
workspaceId: string;
|
|
810
|
+
skillRevisionId: string;
|
|
811
|
+
}): Promise<WorkspaceSkillArtifact | null> | WorkspaceSkillArtifact | null;
|
|
812
|
+
importSkillsFromUrl(input: {
|
|
813
|
+
workspaceId: string;
|
|
814
|
+
url: string;
|
|
815
|
+
sourceType?: WorkspaceSkillSourceType;
|
|
816
|
+
createdBy?: WorkspaceAuthUser;
|
|
817
|
+
}): Promise<WorkspaceSkillImportResult[]> | WorkspaceSkillImportResult[];
|
|
818
|
+
importSkillsFromArchive(input: {
|
|
819
|
+
workspaceId: string;
|
|
820
|
+
filename: string;
|
|
821
|
+
contentBase64: string;
|
|
822
|
+
createdBy?: WorkspaceAuthUser;
|
|
823
|
+
}): Promise<WorkspaceSkillImportResult[]> | WorkspaceSkillImportResult[];
|
|
824
|
+
}
|