@pstdio/sdk 0.40.0 → 0.42.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.
@@ -1,4 +1,4 @@
1
- import { d as WorkspaceListItem$1, s as Workspace$1 } from "./index-Cbt2YiR-.js";
1
+ import { d as WorkspaceListItem$1, s as Workspace$1 } from "./index-DKb6w-4h.js";
2
2
  //#region src/resources/workspace.d.ts
3
3
  type Workspace = Workspace$1;
4
4
  type WorkspaceListItem = WorkspaceListItem$1;
@@ -0,0 +1,644 @@
1
+ import { $d as ResourceAnchor, $s as HarnessOperation, $u as FollowUpResponse, A as InstallExtensionRequest, B as UpgradeProjectExtensionResponse, Bd as ListNotificationsResponse, Cd as BoardViewUpdate, F as EnableInstalledExtensionResponse, G as ExtensionConnectionRecord, H as CommandExecuteResponse, Id as SkillWithContent, Jd as UpdateNotificationInput, K as ListExtensionConnectionsResponse, L as ListProjectExtensionsResponse, Ld as UpdateSkillInput, P as EnableInstalledExtensionRequest, Pd as Skill, Qs as HarnessCommandState, Qu as FollowUpInput, Rd as CreateNotificationInput, Sd as BoardViewCreate, Sf as JsonValue, U as DispatchExtensionEventInput, V as CommandExecuteRequest, Vd as Notification, W as ConfigureExtensionConnectionInput, Xu as CreateSessionInput, Ys as DraftHarnessCommandInput, Yu as ApprovalInput, Zu as CreateSessionResponse, _ as CreateProjectInput, _d as UpdateQueuedFollowUpInput, _t as ListAutomationTokensResponse, a as RemoveWorktreeResponse, ad as SessionAttachment, af as ResourceRef, ap as ListActivityResponse, c as WorkspaceFileContent, cd as SessionConversationSources, ct as AutomationRun, dd as CombineQueuedFollowUpsInput, ed as ListSessionActivityInput, f as WorkspaceProviderDescriptor, fd as PendingQueuedFollowUpsResponse, gd as SteerQueuedFollowUpInput, gt as ListAutomationRunEventsResponse, h as UpdateSettingsInput, hd as QueuedSteeringResult, ht as IssueAutomationTokenResponse, i as ListWorkspaceFilesInput, id as Session, j as InstallExtensionResponse, k as ExtensionDiagnosticsResponse, l as WorkspaceFileEntry, ld as SessionQueuedMessagesResponse, m as Settings, md as QueuedFollowUpUpdateResponse, mt as IssueAutomationTokenInput, n as ListWorkspaceActivityInput, nd as ResolveSessionIdInput, nf as ResourceAnchorQuery, np as AgentModel, nt as ListExtensionAppearanceResponse, o as RenameWorkspaceInput, op as ListProjectActivityInput, p as WriteWorkspaceFileInput, pt as CreateAutomationRunInput, qd as NotificationStatus, r as ListWorkspaceActivityResponse, rd as ResolveSessionIdResponse, rt as ListExtensionCommandsResponse, sd as SessionConversationResponse, t as CreateWorkspaceInput, td as ListSessionActivityResponse, tf as ResourceAnchorPage, tp as AgentInfo, u as WorkspaceFilesResponse, v as Project, y as UpdateProjectInput, zd as ListNotificationsQuery } from "./index-DKb6w-4h.js";
2
+ import "./skills-D3MhZWKe.js";
3
+ import { n as WorkspaceListItem, t as Workspace } from "./index-CBZam0c-.js";
4
+ //#region src/client/request.d.ts
5
+ type ClientOptions = {
6
+ baseUrl?: string;
7
+ token?: string;
8
+ fetch?: typeof fetch;
9
+ };
10
+ declare class PstdioApiError extends Error {
11
+ readonly code?: string | undefined;
12
+ status: number;
13
+ constructor(message: string, status: number, code?: string | undefined);
14
+ }
15
+ declare class PstdioConnectionError extends Error {
16
+ constructor(cause: unknown);
17
+ }
18
+ type RequestOptions = {
19
+ method?: string;
20
+ body?: unknown;
21
+ signal?: AbortSignal;
22
+ headers?: HeadersInit;
23
+ cache?: RequestCache;
24
+ };
25
+ type RequestFn = <T>(path: string, options?: RequestOptions) => Promise<T>;
26
+ declare const createRequest: (options: ClientOptions) => RequestFn;
27
+ //#endregion
28
+ //#region src/client/agents.d.ts
29
+ type AgentClient = {
30
+ info(params?: {
31
+ project?: string;
32
+ }): Promise<AgentInfo[]>;
33
+ models(agentId: string): Promise<AgentModel[]>;
34
+ };
35
+ //#endregion
36
+ //#region src/client/automation.d.ts
37
+ type AutomationClient = {
38
+ issueToken(input: IssueAutomationTokenInput): Promise<IssueAutomationTokenResponse>;
39
+ listTokens(projectId: string): Promise<ListAutomationTokensResponse>;
40
+ revokeToken(tokenId: string): Promise<void>;
41
+ createRun(projectId: string, idempotencyKey: string, input: CreateAutomationRunInput): Promise<AutomationRun>;
42
+ getRun(projectId: string, runId: string): Promise<AutomationRun>;
43
+ listRunEvents(projectId: string, runId: string, after?: number): Promise<ListAutomationRunEventsResponse>;
44
+ cancelRun(projectId: string, runId: string): Promise<AutomationRun>;
45
+ };
46
+ //#endregion
47
+ //#region src/client/board-views.d.ts
48
+ declare const createBoardViewsClient: (request: RequestFn) => {
49
+ board: (projectId: string, boardId: string) => Promise<{
50
+ id: string;
51
+ title: string;
52
+ kind: "kanban" | "dataTable";
53
+ extensionId: string | null;
54
+ fields: {
55
+ id: string;
56
+ label: string;
57
+ kind: "string" | "number" | "boolean" | "status" | "date" | "enum" | "enum-multi" | "user";
58
+ conditions: ("contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty")[];
59
+ filterable: boolean;
60
+ groupable: boolean;
61
+ sortable: boolean;
62
+ displayable: boolean;
63
+ legacyValues?: Record<string, boolean> | undefined;
64
+ options?: {
65
+ value: string;
66
+ label: string;
67
+ }[] | undefined;
68
+ }[];
69
+ }>;
70
+ get: (projectId: string, id: string) => Promise<{
71
+ id: string;
72
+ boardId: string;
73
+ title: string;
74
+ settings: {
75
+ viewMode: "board" | "list";
76
+ columnGrouping: string;
77
+ rowGrouping: string;
78
+ displayProperties: string[];
79
+ } | {
80
+ grouping: string;
81
+ rowNumbers: boolean;
82
+ wrapRows: boolean;
83
+ showStats: boolean;
84
+ hiddenColumns: string[];
85
+ columnOrder: string[];
86
+ };
87
+ filter: {
88
+ conjunction: "and" | "or";
89
+ rules: {
90
+ attributeId: string;
91
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
92
+ value?: string | number | boolean | string[] | undefined;
93
+ }[];
94
+ groups?: {
95
+ conjunction: "and" | "or";
96
+ rules: {
97
+ attributeId: string;
98
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
99
+ value?: string | number | boolean | string[] | undefined;
100
+ }[];
101
+ }[] | undefined;
102
+ };
103
+ sorts: {
104
+ attributeId: string;
105
+ direction: "asc" | "desc";
106
+ }[];
107
+ builtIn: boolean;
108
+ }>;
109
+ boards: (projectId: string) => Promise<{
110
+ id: string;
111
+ title: string;
112
+ kind: "kanban" | "dataTable";
113
+ extensionId: string | null;
114
+ fields: {
115
+ id: string;
116
+ label: string;
117
+ kind: "string" | "number" | "boolean" | "status" | "date" | "enum" | "enum-multi" | "user";
118
+ conditions: ("contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty")[];
119
+ filterable: boolean;
120
+ groupable: boolean;
121
+ sortable: boolean;
122
+ displayable: boolean;
123
+ legacyValues?: Record<string, boolean> | undefined;
124
+ options?: {
125
+ value: string;
126
+ label: string;
127
+ }[] | undefined;
128
+ }[];
129
+ }[]>;
130
+ list: (projectId: string, boardId: string) => Promise<{
131
+ views: {
132
+ id: string;
133
+ boardId: string;
134
+ title: string;
135
+ settings: {
136
+ viewMode: "board" | "list";
137
+ columnGrouping: string;
138
+ rowGrouping: string;
139
+ displayProperties: string[];
140
+ } | {
141
+ grouping: string;
142
+ rowNumbers: boolean;
143
+ wrapRows: boolean;
144
+ showStats: boolean;
145
+ hiddenColumns: string[];
146
+ columnOrder: string[];
147
+ };
148
+ filter: {
149
+ conjunction: "and" | "or";
150
+ rules: {
151
+ attributeId: string;
152
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
153
+ value?: string | number | boolean | string[] | undefined;
154
+ }[];
155
+ groups?: {
156
+ conjunction: "and" | "or";
157
+ rules: {
158
+ attributeId: string;
159
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
160
+ value?: string | number | boolean | string[] | undefined;
161
+ }[];
162
+ }[] | undefined;
163
+ };
164
+ sorts: {
165
+ attributeId: string;
166
+ direction: "asc" | "desc";
167
+ }[];
168
+ builtIn: boolean;
169
+ }[];
170
+ defaultViewId: string;
171
+ }>;
172
+ orphaned: (projectId: string) => Promise<{
173
+ id: string;
174
+ boardId: string;
175
+ title: string;
176
+ settings: {
177
+ viewMode: "board" | "list";
178
+ columnGrouping: string;
179
+ rowGrouping: string;
180
+ displayProperties: string[];
181
+ } | {
182
+ grouping: string;
183
+ rowNumbers: boolean;
184
+ wrapRows: boolean;
185
+ showStats: boolean;
186
+ hiddenColumns: string[];
187
+ columnOrder: string[];
188
+ };
189
+ filter: {
190
+ conjunction: "and" | "or";
191
+ rules: {
192
+ attributeId: string;
193
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
194
+ value?: string | number | boolean | string[] | undefined;
195
+ }[];
196
+ groups?: {
197
+ conjunction: "and" | "or";
198
+ rules: {
199
+ attributeId: string;
200
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
201
+ value?: string | number | boolean | string[] | undefined;
202
+ }[];
203
+ }[] | undefined;
204
+ };
205
+ sorts: {
206
+ attributeId: string;
207
+ direction: "asc" | "desc";
208
+ }[];
209
+ builtIn: boolean;
210
+ }[]>;
211
+ create: (projectId: string, boardId: string, input: BoardViewCreate) => Promise<{
212
+ id: string;
213
+ boardId: string;
214
+ title: string;
215
+ settings: {
216
+ viewMode: "board" | "list";
217
+ columnGrouping: string;
218
+ rowGrouping: string;
219
+ displayProperties: string[];
220
+ } | {
221
+ grouping: string;
222
+ rowNumbers: boolean;
223
+ wrapRows: boolean;
224
+ showStats: boolean;
225
+ hiddenColumns: string[];
226
+ columnOrder: string[];
227
+ };
228
+ filter: {
229
+ conjunction: "and" | "or";
230
+ rules: {
231
+ attributeId: string;
232
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
233
+ value?: string | number | boolean | string[] | undefined;
234
+ }[];
235
+ groups?: {
236
+ conjunction: "and" | "or";
237
+ rules: {
238
+ attributeId: string;
239
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
240
+ value?: string | number | boolean | string[] | undefined;
241
+ }[];
242
+ }[] | undefined;
243
+ };
244
+ sorts: {
245
+ attributeId: string;
246
+ direction: "asc" | "desc";
247
+ }[];
248
+ builtIn: boolean;
249
+ }>;
250
+ update: (projectId: string, id: string, input: BoardViewUpdate) => Promise<{
251
+ id: string;
252
+ boardId: string;
253
+ title: string;
254
+ settings: {
255
+ viewMode: "board" | "list";
256
+ columnGrouping: string;
257
+ rowGrouping: string;
258
+ displayProperties: string[];
259
+ } | {
260
+ grouping: string;
261
+ rowNumbers: boolean;
262
+ wrapRows: boolean;
263
+ showStats: boolean;
264
+ hiddenColumns: string[];
265
+ columnOrder: string[];
266
+ };
267
+ filter: {
268
+ conjunction: "and" | "or";
269
+ rules: {
270
+ attributeId: string;
271
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
272
+ value?: string | number | boolean | string[] | undefined;
273
+ }[];
274
+ groups?: {
275
+ conjunction: "and" | "or";
276
+ rules: {
277
+ attributeId: string;
278
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
279
+ value?: string | number | boolean | string[] | undefined;
280
+ }[];
281
+ }[] | undefined;
282
+ };
283
+ sorts: {
284
+ attributeId: string;
285
+ direction: "asc" | "desc";
286
+ }[];
287
+ builtIn: boolean;
288
+ }>;
289
+ delete: (projectId: string, id: string) => Promise<{
290
+ deleted: boolean;
291
+ }>;
292
+ reorder: (projectId: string, boardId: string, viewIds: string[]) => Promise<{
293
+ views: {
294
+ id: string;
295
+ boardId: string;
296
+ title: string;
297
+ settings: {
298
+ viewMode: "board" | "list";
299
+ columnGrouping: string;
300
+ rowGrouping: string;
301
+ displayProperties: string[];
302
+ } | {
303
+ grouping: string;
304
+ rowNumbers: boolean;
305
+ wrapRows: boolean;
306
+ showStats: boolean;
307
+ hiddenColumns: string[];
308
+ columnOrder: string[];
309
+ };
310
+ filter: {
311
+ conjunction: "and" | "or";
312
+ rules: {
313
+ attributeId: string;
314
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
315
+ value?: string | number | boolean | string[] | undefined;
316
+ }[];
317
+ groups?: {
318
+ conjunction: "and" | "or";
319
+ rules: {
320
+ attributeId: string;
321
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
322
+ value?: string | number | boolean | string[] | undefined;
323
+ }[];
324
+ }[] | undefined;
325
+ };
326
+ sorts: {
327
+ attributeId: string;
328
+ direction: "asc" | "desc";
329
+ }[];
330
+ builtIn: boolean;
331
+ }[];
332
+ defaultViewId: string;
333
+ }>;
334
+ setDefault: (projectId: string, boardId: string, viewId: string | null) => Promise<{
335
+ views: {
336
+ id: string;
337
+ boardId: string;
338
+ title: string;
339
+ settings: {
340
+ viewMode: "board" | "list";
341
+ columnGrouping: string;
342
+ rowGrouping: string;
343
+ displayProperties: string[];
344
+ } | {
345
+ grouping: string;
346
+ rowNumbers: boolean;
347
+ wrapRows: boolean;
348
+ showStats: boolean;
349
+ hiddenColumns: string[];
350
+ columnOrder: string[];
351
+ };
352
+ filter: {
353
+ conjunction: "and" | "or";
354
+ rules: {
355
+ attributeId: string;
356
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
357
+ value?: string | number | boolean | string[] | undefined;
358
+ }[];
359
+ groups?: {
360
+ conjunction: "and" | "or";
361
+ rules: {
362
+ attributeId: string;
363
+ condition: "contains" | "does-not-contain" | "is" | "is-not" | "gt" | "gte" | "lt" | "lte" | "is-before" | "is-after" | "is-on-or-before" | "is-on-or-after" | "is-any-of" | "is-none-of" | "has-any-of" | "has-all-of" | "has-none-of" | "is-empty" | "is-not-empty";
364
+ value?: string | number | boolean | string[] | undefined;
365
+ }[];
366
+ }[] | undefined;
367
+ };
368
+ sorts: {
369
+ attributeId: string;
370
+ direction: "asc" | "desc";
371
+ }[];
372
+ builtIn: boolean;
373
+ }[];
374
+ defaultViewId: string;
375
+ }>;
376
+ };
377
+ type BoardViewsClient = ReturnType<typeof createBoardViewsClient>;
378
+ //#endregion
379
+ //#region src/client/extension-stream.d.ts
380
+ type CommandStreamClientEvent = {
381
+ type: "data";
382
+ data: JsonValue;
383
+ } | {
384
+ type: "end";
385
+ response: CommandExecuteResponse;
386
+ };
387
+ //#endregion
388
+ //#region src/client/extensions.d.ts
389
+ type ExtensionClient = {
390
+ install(projectId: string, input: InstallExtensionRequest | {
391
+ upload: FormData;
392
+ }, options?: {
393
+ signal?: AbortSignal;
394
+ }): Promise<InstallExtensionResponse>;
395
+ diagnostics(projectId: string, options?: {
396
+ scope?: "user" | "repo";
397
+ }): Promise<ExtensionDiagnosticsResponse>;
398
+ stream(commandId: string, input: CommandExecuteRequest, options?: {
399
+ signal?: AbortSignal;
400
+ }): AsyncIterable<CommandStreamClientEvent>;
401
+ enableInstalled(projectId: string, installName: string, request: EnableInstalledExtensionRequest): Promise<EnableInstalledExtensionResponse>;
402
+ listAppearance(projectId: string): Promise<ListExtensionAppearanceResponse>;
403
+ listCommands(projectId: string): Promise<ListExtensionCommandsResponse>;
404
+ listProject(projectId: string): Promise<ListProjectExtensionsResponse>;
405
+ upgradeProject(projectId: string, instanceId: string): Promise<UpgradeProjectExtensionResponse>;
406
+ listConnections(projectId: string): Promise<ListExtensionConnectionsResponse>;
407
+ configureConnection(projectId: string, extensionId: string, connectionId: string, input: ConfigureExtensionConnectionInput): Promise<ExtensionConnectionRecord>;
408
+ checkConnection(projectId: string, extensionId: string, connectionId: string): Promise<ExtensionConnectionRecord>;
409
+ deleteConnection(projectId: string, extensionId: string, connectionId: string): Promise<void>;
410
+ execute(commandId: string, request: CommandExecuteRequest): Promise<CommandExecuteResponse>;
411
+ dispatchEvent(projectId: string, input: DispatchExtensionEventInput): Promise<void>;
412
+ };
413
+ //#endregion
414
+ //#region src/client/filesystem.d.ts
415
+ interface DirectoryEntry {
416
+ name: string;
417
+ path: string;
418
+ isDirectory: boolean;
419
+ }
420
+ declare const createFilesystemClient: (request: RequestFn) => {
421
+ list: (path?: string) => Promise<{
422
+ currentPath: string;
423
+ entries: DirectoryEntry[];
424
+ }>;
425
+ createDirectory: (input: {
426
+ parent_path: string;
427
+ name: string;
428
+ }) => Promise<{
429
+ path: string;
430
+ }>;
431
+ };
432
+ type FilesystemClient = ReturnType<typeof createFilesystemClient>;
433
+ //#endregion
434
+ //#region src/client/notifications.d.ts
435
+ type NotificationsClient = {
436
+ list(projectId: string, query?: ListNotificationsQuery): Promise<ListNotificationsResponse>;
437
+ count(projectId: string, query?: Pick<ListNotificationsQuery, "status" | "priority" | "sourceExtensionId">): Promise<{
438
+ count: number;
439
+ }>;
440
+ get(projectId: string, id: string): Promise<Notification>;
441
+ create(input: CreateNotificationInput): Promise<Notification>;
442
+ update(projectId: string, id: string, input: UpdateNotificationInput): Promise<Notification>;
443
+ markRead(projectId: string, id: string): Promise<Notification>;
444
+ dismiss(projectId: string, id: string): Promise<Notification>;
445
+ markDone(projectId: string, id: string): Promise<Notification>;
446
+ snooze(projectId: string, id: string, until: string): Promise<Notification>;
447
+ resolveByDedupeKey(projectId: string, input: {
448
+ dedupeKey: string;
449
+ status?: Extract<NotificationStatus, "done" | "dismissed" | "expired">;
450
+ }): Promise<{
451
+ resolved: number;
452
+ notifications: Notification[];
453
+ }>;
454
+ };
455
+ //#endregion
456
+ //#region src/client/projects.d.ts
457
+ type ProjectClient = {
458
+ list(): Promise<Project[]>;
459
+ get(projectId: string): Promise<Project>;
460
+ create(input: CreateProjectInput): Promise<Project>;
461
+ attachInitialWorkspace(projectId: string, input: CreateProjectInput["initial_workspace"]): Promise<Workspace>;
462
+ retrySetup(projectId: string): Promise<Workspace>;
463
+ update(projectId: string, input: UpdateProjectInput): Promise<Project>;
464
+ delete(projectId: string): Promise<void>;
465
+ listActivity(projectId: string, input?: ListProjectActivityInput): Promise<ListActivityResponse>;
466
+ };
467
+ //#endregion
468
+ //#region src/client/resource-anchors.d.ts
469
+ interface ResourceAnchorsClient {
470
+ addAnchors(projectId: string, resource: ResourceRef, anchors: ResourceAnchor[]): Promise<void>;
471
+ removeAnchors(projectId: string, resource: ResourceRef, refs: ResourceRef[]): Promise<void>;
472
+ listAnchors(projectId: string, input: ResourceAnchorQuery): Promise<ResourceAnchorPage>;
473
+ }
474
+ //#endregion
475
+ //#region src/client/runtime.d.ts
476
+ type RuntimeClient = {
477
+ /** Creates a single-use browser login link. Needs the runtime token. */
478
+ createBrowserLogin: () => Promise<{
479
+ url: string;
480
+ }>;
481
+ };
482
+ declare const createRuntimeClient: (request: RequestFn) => RuntimeClient;
483
+ //#endregion
484
+ //#region src/client/sse.d.ts
485
+ type SseEvent = {
486
+ event: string;
487
+ data: string;
488
+ };
489
+ //#endregion
490
+ //#region src/client/sessions.d.ts
491
+ type ListSessionsInput = {
492
+ status?: string;
493
+ agent?: string;
494
+ workspaceId?: string;
495
+ archived?: boolean;
496
+ };
497
+ type SessionClient = {
498
+ getDraftHarnessCommands(input: DraftHarnessCommandInput, signal?: AbortSignal): Promise<HarnessCommandState & {
499
+ harnessId: string;
500
+ }>;
501
+ list(projectId: string, input?: ListSessionsInput): Promise<Session[]>;
502
+ get(sessionId: string): Promise<Session>;
503
+ getHarnessCommands(sessionId: string, signal?: AbortSignal): Promise<HarnessCommandState & {
504
+ harnessId: string;
505
+ }>;
506
+ invokeHarnessOperation(sessionId: string, operation: HarnessOperation, harnessId?: string): Promise<{
507
+ status: "completed" | "started";
508
+ message?: string;
509
+ }>;
510
+ uploadAttachment(projectId: string, input: {
511
+ name: string;
512
+ data: Uint8Array | ArrayBuffer;
513
+ mimeType?: string | null;
514
+ }): Promise<SessionAttachment>;
515
+ deleteAttachment(projectId: string, fileId: string): Promise<void>;
516
+ create(input: CreateSessionInput): Promise<CreateSessionResponse>;
517
+ archive(sessionId: string): Promise<void>;
518
+ followUp(sessionId: string, input: FollowUpInput): Promise<FollowUpResponse>;
519
+ approve(sessionId: string, input: ApprovalInput): Promise<void>;
520
+ getConversation(sessionId: string, signal?: AbortSignal): Promise<SessionConversationResponse>;
521
+ getConversationSources(sessionId: string, signal?: AbortSignal): Promise<SessionConversationSources>;
522
+ getQueuedMessages(sessionId: string, options?: {
523
+ signal?: AbortSignal;
524
+ }): Promise<SessionQueuedMessagesResponse>;
525
+ steerQueuedFollowUp(sessionId: string, queuePosition: number, input: SteerQueuedFollowUpInput): Promise<QueuedSteeringResult>;
526
+ getQueuedFollowUps(sessionId: string): Promise<PendingQueuedFollowUpsResponse>;
527
+ updateQueuedFollowUp(sessionId: string, queuePosition: number, input: UpdateQueuedFollowUpInput): Promise<QueuedFollowUpUpdateResponse>;
528
+ combineQueuedFollowUps(sessionId: string, queuePosition: number, input: CombineQueuedFollowUpsInput): Promise<QueuedFollowUpUpdateResponse>;
529
+ resolveSessionId(input: ResolveSessionIdInput): Promise<ResolveSessionIdResponse>;
530
+ updateStatus(sessionId: string, status: string): Promise<Session>;
531
+ rename(sessionId: string, title: string): Promise<Session>;
532
+ listActivity(sessionId: string, input?: ListSessionActivityInput): Promise<ListSessionActivityResponse>;
533
+ stream(sessionId: string, onEvent: (event: SseEvent) => void, options?: {
534
+ signal?: AbortSignal;
535
+ }): Promise<void>;
536
+ connectStream(sessionId: string, handlers: SessionStreamHandlers): SessionStreamConnection;
537
+ };
538
+ type SessionStreamHandlers = {
539
+ onReady?: (data: unknown) => void;
540
+ onPatch?: (data: unknown) => void;
541
+ onApprovalRequest?: (data: unknown) => void;
542
+ onQueuedMessages?: (data: SessionQueuedMessagesResponse | {
543
+ error: string;
544
+ }) => void;
545
+ onEnd?: (data: unknown) => void;
546
+ onError?: (error: unknown) => void;
547
+ };
548
+ type SessionStreamConnection = {
549
+ close: () => void;
550
+ };
551
+ //#endregion
552
+ //#region src/client/settings.d.ts
553
+ type SettingsClient = {
554
+ get(): Promise<Settings>;
555
+ update(input: UpdateSettingsInput): Promise<Settings>;
556
+ };
557
+ //#endregion
558
+ //#region src/client/skills.d.ts
559
+ type SkillClient = {
560
+ list(projectId: string): Promise<Skill[]>;
561
+ get(projectId: string, skillId: string): Promise<SkillWithContent>;
562
+ updatePreferences(projectId: string, skillName: string, input: UpdateSkillInput): Promise<Skill>;
563
+ };
564
+ //#endregion
565
+ //#region src/client/sync.d.ts
566
+ type SyncRow = {
567
+ id: string;
568
+ [key: string]: unknown;
569
+ };
570
+ type SyncWriter = {
571
+ truncateAndWrite: (rows: SyncRow[]) => void;
572
+ upsert: (row: SyncRow) => void;
573
+ remove: (id: string) => void;
574
+ };
575
+ type SyncWriterProvider = {
576
+ getWriter: (table: string) => SyncWriter | undefined;
577
+ };
578
+ type SyncConnection = {
579
+ close: () => void;
580
+ connected: boolean;
581
+ };
582
+ type StartSyncInput = SyncWriterProvider & {
583
+ /** Called after the initial snapshot, or when a cursor-based connection resumes. */
584
+ onConnected?: () => void;
585
+ onDisconnected?: () => void;
586
+ onConnectionLost?: () => void;
587
+ heartbeatIntervalMs?: number;
588
+ heartbeatThreshold?: number;
589
+ reconnectDelayMs?: number;
590
+ };
591
+ type SyncClient = {
592
+ start: (input: StartSyncInput) => SyncConnection;
593
+ };
594
+ declare const parseSyncDeleteEvent: (data: string) => {
595
+ table: string;
596
+ id: string;
597
+ seq: number;
598
+ };
599
+ declare const applySyncEvent: (event: string, data: string, writers: SyncWriterProvider) => number | null;
600
+ //#endregion
601
+ //#region src/client/workspaces.d.ts
602
+ type WorkspaceClient = {
603
+ listProviders(projectId: string): Promise<WorkspaceProviderDescriptor[]>;
604
+ list(projectId: string): Promise<WorkspaceListItem[]>;
605
+ getByShorthand(projectId: string, shorthand: string): Promise<Workspace>;
606
+ create(input: CreateWorkspaceInput): Promise<Workspace>;
607
+ rename(workspaceId: string, input: RenameWorkspaceInput): Promise<Workspace>;
608
+ listActivity(workspaceId: string, input?: ListWorkspaceActivityInput): Promise<ListWorkspaceActivityResponse>;
609
+ listFiles(workspaceId: string, input?: ListWorkspaceFilesInput, options?: {
610
+ signal?: AbortSignal;
611
+ }): Promise<WorkspaceFilesResponse>;
612
+ createDirectory(workspaceId: string, path: string): Promise<WorkspaceFileEntry>;
613
+ createFile(workspaceId: string, path: string, input: WriteWorkspaceFileInput): Promise<WorkspaceFileContent>;
614
+ readFile(workspaceId: string, path: string, options?: {
615
+ signal?: AbortSignal;
616
+ }): Promise<WorkspaceFileContent>;
617
+ writeFile(workspaceId: string, path: string, input: WriteWorkspaceFileInput): Promise<WorkspaceFileContent>;
618
+ moveEntry(workspaceId: string, path: string, destinationPath: string): Promise<void>;
619
+ deleteEntry(workspaceId: string, path: string): Promise<void>;
620
+ removeWorktree(workspaceId: string): Promise<RemoveWorktreeResponse>;
621
+ delete(workspaceId: string): Promise<void>;
622
+ };
623
+ //#endregion
624
+ //#region src/client/client.d.ts
625
+ type PstdioClient = {
626
+ resources: ResourceAnchorsClient;
627
+ views: BoardViewsClient;
628
+ projects: ProjectClient;
629
+ filesystem: FilesystemClient;
630
+ workspaces: WorkspaceClient;
631
+ sessions: SessionClient;
632
+ skills: SkillClient;
633
+ agents: AgentClient;
634
+ automation: AutomationClient;
635
+ notifications: NotificationsClient;
636
+ extensions: ExtensionClient;
637
+ settings: SettingsClient;
638
+ sync: SyncClient;
639
+ runtime: RuntimeClient;
640
+ };
641
+ declare const createClient: (options?: ClientOptions) => PstdioClient;
642
+ //#endregion
643
+ export { AgentClient as A, NotificationsClient as C, CommandStreamClientEvent as D, ExtensionClient as E, RequestOptions as F, createRequest as I, PstdioApiError as M, PstdioConnectionError as N, BoardViewsClient as O, RequestFn as P, ProjectClient as S, FilesystemClient as T, SessionStreamHandlers as _, SyncClient as a, createRuntimeClient as b, SyncWriter as c, parseSyncDeleteEvent as d, SkillClient as f, SessionStreamConnection as g, SessionClient as h, StartSyncInput as i, ClientOptions as j, AutomationClient as k, SyncWriterProvider as l, ListSessionsInput as m, createClient as n, SyncConnection as o, SettingsClient as p, WorkspaceClient as r, SyncRow as s, PstdioClient as t, applySyncEvent as u, SseEvent as v, DirectoryEntry as w, ResourceAnchorsClient as x, RuntimeClient as y };
644
+ export {};