@pstdio/sdk 0.20.0 → 0.22.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.
Files changed (63) hide show
  1. package/README.md +22 -192
  2. package/dist/api/index.js +932 -483
  3. package/dist/api.d.ts +3767 -0
  4. package/dist/client/index.js +21 -14
  5. package/dist/client.d.ts +1714 -0
  6. package/dist/extensions/index.js +262 -140
  7. package/dist/extensions/react/index.js +2 -1
  8. package/dist/{extensions/react/index.d.ts → extensions-react.d.ts} +23 -16
  9. package/dist/extensions.d.ts +3826 -0
  10. package/dist/hooks.d.ts +1775 -0
  11. package/dist/{prompts/render-prompt.d.ts → prompts.d.ts} +3 -1
  12. package/dist/resources/index.js +932 -483
  13. package/dist/resources.d.ts +422 -0
  14. package/package.json +12 -31
  15. package/dist/api/extensions.d.ts +0 -1
  16. package/dist/api/index.d.ts +0 -10
  17. package/dist/api/projects.d.ts +0 -1
  18. package/dist/api/sessions.d.ts +0 -2
  19. package/dist/api/settings.d.ts +0 -1
  20. package/dist/api/skills.d.ts +0 -1
  21. package/dist/api/templates.d.ts +0 -1
  22. package/dist/api/terminal.d.ts +0 -49
  23. package/dist/api/workspaces.d.ts +0 -12
  24. package/dist/client/agents.d.ts +0 -10
  25. package/dist/client/client.d.ts +0 -26
  26. package/dist/client/extensions.d.ts +0 -12
  27. package/dist/client/index.d.ts +0 -14
  28. package/dist/client/notifications.d.ts +0 -23
  29. package/dist/client/projects.d.ts +0 -14
  30. package/dist/client/request.d.ts +0 -25
  31. package/dist/client/runtime.d.ts +0 -5
  32. package/dist/client/sessions.d.ts +0 -45
  33. package/dist/client/settings.d.ts +0 -7
  34. package/dist/client/skills.d.ts +0 -9
  35. package/dist/client/sse.d.ts +0 -15
  36. package/dist/client/sync.d.ts +0 -35
  37. package/dist/client/templates.d.ts +0 -11
  38. package/dist/client/workspaces.d.ts +0 -20
  39. package/dist/extensions/command-outcome.d.ts +0 -5
  40. package/dist/extensions/define-command.d.ts +0 -26
  41. package/dist/extensions/define-extension-view.d.ts +0 -58
  42. package/dist/extensions/define-extension.d.ts +0 -54
  43. package/dist/extensions/index.d.ts +0 -13
  44. package/dist/extensions/params.d.ts +0 -36
  45. package/dist/extensions/refs.d.ts +0 -8
  46. package/dist/extensions/terminal-session-bridge.d.ts +0 -32
  47. package/dist/extensions/webview-client.d.ts +0 -41
  48. package/dist/extensions/when.d.ts +0 -9
  49. package/dist/hooks/base.d.ts +0 -17
  50. package/dist/hooks/entities.d.ts +0 -8
  51. package/dist/hooks/index.d.ts +0 -3
  52. package/dist/hooks/session.d.ts +0 -12
  53. package/dist/hooks/worktree.d.ts +0 -53
  54. package/dist/prompts/index.d.ts +0 -1
  55. package/dist/resources/agent.d.ts +0 -2
  56. package/dist/resources/file.d.ts +0 -1
  57. package/dist/resources/index.d.ts +0 -10
  58. package/dist/resources/project.d.ts +0 -1
  59. package/dist/resources/session.d.ts +0 -1
  60. package/dist/resources/settings.d.ts +0 -1
  61. package/dist/resources/skill.d.ts +0 -1
  62. package/dist/resources/template.d.ts +0 -1
  63. package/dist/resources/workspace.d.ts +0 -3
@@ -0,0 +1,422 @@
1
+ import { z } from 'zod';
2
+
3
+ export declare type AgentAvailabilityType = z.infer<typeof agentAvailabilityTypeSchema>;
4
+
5
+ declare const agentAvailabilityTypeSchema: z.ZodEnum<{
6
+ INSTALLED: "INSTALLED";
7
+ NOT_FOUND: "NOT_FOUND";
8
+ }>;
9
+
10
+ export declare type AgentInfo = z.infer<typeof agentInfoSchema>;
11
+
12
+ declare const agentInfoSchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ name: z.ZodString;
15
+ availability: z.ZodObject<{
16
+ type: z.ZodEnum<{
17
+ INSTALLED: "INSTALLED";
18
+ NOT_FOUND: "NOT_FOUND";
19
+ }>;
20
+ }, z.core.$strip>;
21
+ skills: z.ZodOptional<z.ZodObject<{
22
+ dir: z.ZodString;
23
+ global_dir: z.ZodString;
24
+ }, z.core.$strip>>;
25
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
26
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
27
+ $l10n: z.ZodString;
28
+ default: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>]>>;
30
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
31
+ $l10n: z.ZodString;
32
+ default: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>]>>;
34
+ required: z.ZodOptional<z.ZodBoolean>;
35
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
36
+ type: z.ZodLiteral<"select">;
37
+ defaultValue: z.ZodOptional<z.ZodString>;
38
+ options: z.ZodArray<z.ZodObject<{
39
+ label: z.ZodString;
40
+ value: z.ZodString;
41
+ icon: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>>;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
45
+ $l10n: z.ZodString;
46
+ default: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>]>>;
48
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
49
+ $l10n: z.ZodString;
50
+ default: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>]>>;
52
+ required: z.ZodOptional<z.ZodBoolean>;
53
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
54
+ type: z.ZodLiteral<"boolean">;
55
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
56
+ }, z.core.$strip>]>>>;
57
+ }, z.core.$strip>;
58
+
59
+ export declare type AgentModel = z.infer<typeof agentModelSchema>;
60
+
61
+ declare const agentModelSchema: z.ZodObject<{
62
+ id: z.ZodString;
63
+ label: z.ZodOptional<z.ZodString>;
64
+ description: z.ZodOptional<z.ZodString>;
65
+ isDefault: z.ZodOptional<z.ZodBoolean>;
66
+ paramOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
67
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
68
+ $l10n: z.ZodString;
69
+ default: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>]>>;
71
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
72
+ $l10n: z.ZodString;
73
+ default: z.ZodOptional<z.ZodString>;
74
+ }, z.core.$strip>]>>;
75
+ required: z.ZodOptional<z.ZodBoolean>;
76
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
77
+ type: z.ZodLiteral<"select">;
78
+ defaultValue: z.ZodOptional<z.ZodString>;
79
+ options: z.ZodArray<z.ZodObject<{
80
+ label: z.ZodString;
81
+ value: z.ZodString;
82
+ icon: z.ZodOptional<z.ZodString>;
83
+ }, z.core.$strip>>;
84
+ }, z.core.$strip>, z.ZodObject<{
85
+ label: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
86
+ $l10n: z.ZodString;
87
+ default: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$strip>]>>;
89
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
90
+ $l10n: z.ZodString;
91
+ default: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strip>]>>;
93
+ required: z.ZodOptional<z.ZodBoolean>;
94
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
95
+ type: z.ZodLiteral<"boolean">;
96
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
97
+ }, z.core.$strip>]>>>>;
98
+ }, z.core.$strip>;
99
+
100
+ export declare type AgentSkillsLayout = z.infer<typeof agentSkillsLayoutSchema>;
101
+
102
+ declare const agentSkillsLayoutSchema: z.ZodObject<{
103
+ dir: z.ZodString;
104
+ global_dir: z.ZodString;
105
+ }, z.core.$strip>;
106
+
107
+ export declare type FileRecord = z.infer<typeof fileRecordSchema>;
108
+
109
+ declare const fileRecordSchema: z.ZodObject<{
110
+ id: z.ZodString;
111
+ project_id: z.ZodString;
112
+ file_name: z.ZodString;
113
+ file_kind: z.ZodString;
114
+ storage_path: z.ZodString;
115
+ mime_type: z.ZodNullable<z.ZodString>;
116
+ size_bytes: z.ZodNumber;
117
+ hash: z.ZodNullable<z.ZodString>;
118
+ created_at: z.ZodString;
119
+ updated_at: z.ZodString;
120
+ }, z.core.$strip>;
121
+
122
+ /** Bare provider id of a (possibly namespaced) harness id, e.g. "pstdio.harness-claude-code.harness.claude-code" -> "claude-code". */
123
+ export declare const harnessLocalId: (id: string) => string;
124
+
125
+ declare type JsonObject = {
126
+ [key: string]: JsonValue;
127
+ };
128
+
129
+ declare type JsonPrimitive = string | number | boolean | null;
130
+
131
+ declare type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;
132
+
133
+ export declare type Project = z.infer<typeof projectSchema>;
134
+
135
+ declare const projectSchema: z.ZodObject<{
136
+ id: z.ZodString;
137
+ name: z.ZodString;
138
+ shorthand: z.ZodString;
139
+ default_agent_id: z.ZodNullable<z.ZodString>;
140
+ default_agent_model: z.ZodNullable<z.ZodString>;
141
+ startup_script: z.ZodNullable<z.ZodString>;
142
+ created_at: z.ZodString;
143
+ updated_at: z.ZodString;
144
+ deleted_at: z.ZodNullable<z.ZodString>;
145
+ extension_warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
146
+ code: z.ZodLiteral<"extension_setup_failed">;
147
+ extension: z.ZodString;
148
+ message: z.ZodString;
149
+ }, z.core.$strip>>>;
150
+ }, z.core.$strip>;
151
+
152
+ export declare type Repo = z.infer<typeof repoSchema>;
153
+
154
+ declare const repoSchema: z.ZodObject<{
155
+ id: z.ZodString;
156
+ name: z.ZodString;
157
+ path: z.ZodString;
158
+ display_name: z.ZodNullable<z.ZodString>;
159
+ created_at: z.ZodString;
160
+ updated_at: z.ZodString;
161
+ }, z.core.$strip>;
162
+
163
+ export declare type Session = z.infer<typeof sessionSchema>;
164
+
165
+ declare const sessionSchema: z.ZodObject<{
166
+ id: z.ZodString;
167
+ project_id: z.ZodNullable<z.ZodString>;
168
+ title: z.ZodString;
169
+ status: z.ZodEnum<{
170
+ completed: "completed";
171
+ failed: "failed";
172
+ in_progress: "in_progress";
173
+ awaiting_input: "awaiting_input";
174
+ queued: "queued";
175
+ cancelled: "cancelled";
176
+ disconnected: "disconnected";
177
+ }>;
178
+ archived: z.ZodBoolean;
179
+ last_request_started: z.ZodNullable<z.ZodString>;
180
+ last_request_ended: z.ZodNullable<z.ZodString>;
181
+ agent: z.ZodNullable<z.ZodString>;
182
+ last_selected_model: z.ZodNullable<z.ZodString>;
183
+ agent_session_id: z.ZodNullable<z.ZodString>;
184
+ session_file_id: z.ZodNullable<z.ZodString>;
185
+ original_session_id: z.ZodNullable<z.ZodString>;
186
+ cwd: z.ZodNullable<z.ZodString>;
187
+ params_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
188
+ anchors_json: z.ZodArray<z.ZodObject<{
189
+ type: z.ZodString;
190
+ id: z.ZodString;
191
+ projectId: z.ZodOptional<z.ZodString>;
192
+ label: z.ZodOptional<z.ZodString>;
193
+ icon: z.ZodOptional<z.ZodString>;
194
+ extensionId: z.ZodOptional<z.ZodString>;
195
+ metadata: z.ZodOptional<z.ZodType<JsonObject, unknown, z.core.$ZodTypeInternals<JsonObject, unknown>>>;
196
+ }, z.core.$strip>>;
197
+ created_at: z.ZodString;
198
+ updated_at: z.ZodString;
199
+ }, z.core.$strip>;
200
+
201
+ export declare type SessionStatus = z.infer<typeof sessionStatusSchema>;
202
+
203
+ declare const sessionStatusSchema: z.ZodEnum<{
204
+ completed: "completed";
205
+ failed: "failed";
206
+ in_progress: "in_progress";
207
+ awaiting_input: "awaiting_input";
208
+ queued: "queued";
209
+ cancelled: "cancelled";
210
+ disconnected: "disconnected";
211
+ }>;
212
+
213
+ export declare type Settings = z.infer<typeof settingsSchema>;
214
+
215
+ declare const settingsSchema: z.ZodObject<{
216
+ max_concurrent_sessions: z.ZodNullable<z.ZodNumber>;
217
+ }, z.core.$strip>;
218
+
219
+ export declare type Skill = z.infer<typeof skillSchema>;
220
+
221
+ export declare type SkillFile = z.infer<typeof skillFileSchema>;
222
+
223
+ declare const skillFileSchema: z.ZodObject<{
224
+ path: z.ZodString;
225
+ content: z.ZodString;
226
+ encoding: z.ZodLiteral<"utf8">;
227
+ }, z.core.$strip>;
228
+
229
+ declare const skillSchema: z.ZodObject<{
230
+ id: z.ZodString;
231
+ project_id: z.ZodString;
232
+ name: z.ZodString;
233
+ title: z.ZodString;
234
+ description: z.ZodString;
235
+ source_kind: z.ZodEnum<{
236
+ project: "project";
237
+ extension: "extension";
238
+ }>;
239
+ files: z.ZodArray<z.ZodObject<{
240
+ path: z.ZodString;
241
+ content: z.ZodString;
242
+ encoding: z.ZodLiteral<"utf8">;
243
+ }, z.core.$strip>>;
244
+ editable: z.ZodBoolean;
245
+ extension_instance_id: z.ZodOptional<z.ZodString>;
246
+ extension_id: z.ZodOptional<z.ZodString>;
247
+ installed_extension_id: z.ZodOptional<z.ZodString>;
248
+ install_name: z.ZodOptional<z.ZodString>;
249
+ key: z.ZodOptional<z.ZodString>;
250
+ source: z.ZodOptional<z.ZodObject<{
251
+ kind: z.ZodLiteral<"package-asset">;
252
+ path: z.ZodString;
253
+ baseUrl: z.ZodString;
254
+ }, z.core.$strip>>;
255
+ enabled: z.ZodOptional<z.ZodBoolean>;
256
+ created_at: z.ZodString;
257
+ updated_at: z.ZodString;
258
+ deleted_at: z.ZodNullable<z.ZodString>;
259
+ }, z.core.$strip>;
260
+
261
+ export declare type SkillWithContent = z.infer<typeof skillWithContentSchema>;
262
+
263
+ declare const skillWithContentSchema: z.ZodObject<{
264
+ id: z.ZodString;
265
+ project_id: z.ZodString;
266
+ name: z.ZodString;
267
+ title: z.ZodString;
268
+ description: z.ZodString;
269
+ source_kind: z.ZodEnum<{
270
+ project: "project";
271
+ extension: "extension";
272
+ }>;
273
+ files: z.ZodArray<z.ZodObject<{
274
+ path: z.ZodString;
275
+ content: z.ZodString;
276
+ encoding: z.ZodLiteral<"utf8">;
277
+ }, z.core.$strip>>;
278
+ editable: z.ZodBoolean;
279
+ extension_instance_id: z.ZodOptional<z.ZodString>;
280
+ extension_id: z.ZodOptional<z.ZodString>;
281
+ installed_extension_id: z.ZodOptional<z.ZodString>;
282
+ install_name: z.ZodOptional<z.ZodString>;
283
+ key: z.ZodOptional<z.ZodString>;
284
+ source: z.ZodOptional<z.ZodObject<{
285
+ kind: z.ZodLiteral<"package-asset">;
286
+ path: z.ZodString;
287
+ baseUrl: z.ZodString;
288
+ }, z.core.$strip>>;
289
+ enabled: z.ZodOptional<z.ZodBoolean>;
290
+ created_at: z.ZodString;
291
+ updated_at: z.ZodString;
292
+ deleted_at: z.ZodNullable<z.ZodString>;
293
+ installed_agents: z.ZodArray<z.ZodString>;
294
+ outdated_agents: z.ZodArray<z.ZodString>;
295
+ agent_installations: z.ZodArray<z.ZodObject<{
296
+ agent_id: z.ZodString;
297
+ agent_name: z.ZodString;
298
+ installed_version: z.ZodNullable<z.ZodString>;
299
+ outdated: z.ZodBoolean;
300
+ }, z.core.$strip>>;
301
+ }, z.core.$strip>;
302
+
303
+ export declare type Workspace = Workspace_2;
304
+
305
+ declare type Workspace_2 = z.infer<typeof workspaceSchema>;
306
+
307
+ declare interface WorkspaceCapabilities {
308
+ files: "none" | "read" | "write";
309
+ diff: boolean;
310
+ merge: boolean;
311
+ rebase: boolean;
312
+ archive: boolean;
313
+ delete: boolean;
314
+ }
315
+
316
+ export declare type WorkspaceListItem = WorkspaceListItem_2;
317
+
318
+ declare type WorkspaceListItem_2 = z.infer<typeof workspaceListItemSchema>;
319
+
320
+ declare const workspaceListItemSchema: z.ZodObject<{
321
+ id: z.ZodString;
322
+ project_id: z.ZodString;
323
+ name: z.ZodString;
324
+ branch: z.ZodNullable<z.ZodString>;
325
+ worktree_path: z.ZodNullable<z.ZodString>;
326
+ provider_id: z.ZodString;
327
+ provider_params_json: z.ZodRecord<z.ZodString, z.ZodUnknown>;
328
+ provider_ref_json: z.ZodNullable<z.ZodObject<{
329
+ version: z.ZodNumber;
330
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
331
+ }, z.core.$strip>>;
332
+ provider_state: z.ZodType<WorkspaceProviderState, unknown, z.core.$ZodTypeInternals<WorkspaceProviderState, unknown>>;
333
+ execution_kind: z.ZodEnum<{
334
+ local: "local";
335
+ remote: "remote";
336
+ }>;
337
+ provider_operation_id: z.ZodNullable<z.ZodString>;
338
+ provider_operation_kind: z.ZodNullable<z.ZodEnum<{
339
+ delete: "delete";
340
+ cancel: "cancel";
341
+ archive: "archive";
342
+ create: "create";
343
+ }>>;
344
+ provider_error_json: z.ZodNullable<z.ZodObject<{
345
+ code: z.ZodString;
346
+ message: z.ZodString;
347
+ retryable: z.ZodBoolean;
348
+ occurred_at: z.ZodString;
349
+ }, z.core.$strip>>;
350
+ provider_capabilities_json: z.ZodType<WorkspaceCapabilities, unknown, z.core.$ZodTypeInternals<WorkspaceCapabilities, unknown>>;
351
+ display_path: z.ZodNullable<z.ZodString>;
352
+ is_default: z.ZodBoolean;
353
+ archived: z.ZodBoolean;
354
+ workspace_shorthand: z.ZodString;
355
+ startup_log_file_id: z.ZodNullable<z.ZodString>;
356
+ anchors_json: z.ZodArray<z.ZodObject<{
357
+ type: z.ZodString;
358
+ id: z.ZodString;
359
+ projectId: z.ZodOptional<z.ZodString>;
360
+ label: z.ZodOptional<z.ZodString>;
361
+ icon: z.ZodOptional<z.ZodString>;
362
+ extensionId: z.ZodOptional<z.ZodString>;
363
+ metadata: z.ZodOptional<z.ZodType<JsonObject, unknown, z.core.$ZodTypeInternals<JsonObject, unknown>>>;
364
+ }, z.core.$strip>>;
365
+ created_at: z.ZodString;
366
+ updated_at: z.ZodString;
367
+ deleted_at: z.ZodNullable<z.ZodString>;
368
+ }, z.core.$strip>;
369
+
370
+ declare type WorkspaceProviderState = "provisioning" | "ready" | "failed" | "cancelled" | "archiving" | "archived" | "deleting" | "provider_missing";
371
+
372
+ declare const workspaceSchema: z.ZodObject<{
373
+ id: z.ZodString;
374
+ project_id: z.ZodString;
375
+ name: z.ZodString;
376
+ branch: z.ZodNullable<z.ZodString>;
377
+ worktree_path: z.ZodNullable<z.ZodString>;
378
+ provider_id: z.ZodString;
379
+ provider_params_json: z.ZodRecord<z.ZodString, z.ZodUnknown>;
380
+ provider_ref_json: z.ZodNullable<z.ZodObject<{
381
+ version: z.ZodNumber;
382
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
383
+ }, z.core.$strip>>;
384
+ provider_state: z.ZodType<WorkspaceProviderState, unknown, z.core.$ZodTypeInternals<WorkspaceProviderState, unknown>>;
385
+ execution_kind: z.ZodEnum<{
386
+ local: "local";
387
+ remote: "remote";
388
+ }>;
389
+ provider_operation_id: z.ZodNullable<z.ZodString>;
390
+ provider_operation_kind: z.ZodNullable<z.ZodEnum<{
391
+ delete: "delete";
392
+ cancel: "cancel";
393
+ archive: "archive";
394
+ create: "create";
395
+ }>>;
396
+ provider_error_json: z.ZodNullable<z.ZodObject<{
397
+ code: z.ZodString;
398
+ message: z.ZodString;
399
+ retryable: z.ZodBoolean;
400
+ occurred_at: z.ZodString;
401
+ }, z.core.$strip>>;
402
+ provider_capabilities_json: z.ZodType<WorkspaceCapabilities, unknown, z.core.$ZodTypeInternals<WorkspaceCapabilities, unknown>>;
403
+ display_path: z.ZodNullable<z.ZodString>;
404
+ is_default: z.ZodBoolean;
405
+ archived: z.ZodBoolean;
406
+ workspace_shorthand: z.ZodString;
407
+ startup_log_file_id: z.ZodNullable<z.ZodString>;
408
+ anchors_json: z.ZodArray<z.ZodObject<{
409
+ type: z.ZodString;
410
+ id: z.ZodString;
411
+ projectId: z.ZodOptional<z.ZodString>;
412
+ label: z.ZodOptional<z.ZodString>;
413
+ icon: z.ZodOptional<z.ZodString>;
414
+ extensionId: z.ZodOptional<z.ZodString>;
415
+ metadata: z.ZodOptional<z.ZodType<JsonObject, unknown, z.core.$ZodTypeInternals<JsonObject, unknown>>>;
416
+ }, z.core.$strip>>;
417
+ created_at: z.ZodString;
418
+ updated_at: z.ZodString;
419
+ deleted_at: z.ZodNullable<z.ZodString>;
420
+ }, z.core.$strip>;
421
+
422
+ export { }
package/package.json CHANGED
@@ -1,60 +1,47 @@
1
1
  {
2
2
  "name": "@pstdio/sdk",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/pufflyai/prompt-studio"
7
7
  },
8
- "publishConfig": {
9
- "access": "public"
10
- },
11
8
  "files": [
12
9
  "dist"
13
10
  ],
14
11
  "type": "module",
15
12
  "exports": {
16
13
  "./resources": {
17
- "types": "./dist/resources/index.d.ts",
14
+ "types": "./dist/resources.d.ts",
18
15
  "import": "./dist/resources/index.js"
19
16
  },
20
17
  "./api": {
21
- "types": "./dist/api/index.d.ts",
18
+ "types": "./dist/api.d.ts",
22
19
  "import": "./dist/api/index.js"
23
20
  },
24
21
  "./client": {
25
- "types": "./dist/client/index.d.ts",
22
+ "types": "./dist/client.d.ts",
26
23
  "import": "./dist/client/index.js"
27
24
  },
28
25
  "./extensions": {
29
- "types": "./dist/extensions/index.d.ts",
26
+ "types": "./dist/extensions.d.ts",
30
27
  "import": "./dist/extensions/index.js"
31
28
  },
32
29
  "./extensions/react": {
33
- "types": "./dist/extensions/react/index.d.ts",
30
+ "types": "./dist/extensions-react.d.ts",
34
31
  "import": "./dist/extensions/react/index.js"
35
32
  },
36
33
  "./prompts": {
37
- "types": "./dist/prompts/index.d.ts",
34
+ "types": "./dist/prompts.d.ts",
38
35
  "import": "./dist/prompts/index.js"
39
36
  },
40
37
  "./hooks": {
41
- "types": "./dist/hooks/index.d.ts",
38
+ "types": "./dist/hooks.d.ts",
42
39
  "import": "./dist/hooks/index.js"
43
40
  }
44
41
  },
45
- "scripts": {
46
- "build": "rm -rf ./dist && bun run build:js && bun run build:types",
47
- "build:js": "bun build ./src/api/index.ts ./src/client/index.ts ./src/extensions/index.ts ./src/extensions/react/index.ts ./src/prompts/index.ts ./src/hooks/index.ts ./src/resources/index.ts --outdir ./dist --root ./src --target node --format esm --external mustache --external react --external @tanstack/react-query",
48
- "build:types": "tsc --project ./tsconfig.build.json",
49
- "prepack": "bun run build",
50
- "typecheck": "tsc --noEmit",
51
- "lint": "bun run typecheck && biome check .",
52
- "format": "biome check --write .",
53
- "test": "bun test --silent",
54
- "test:coverage": "bun test --coverage"
55
- },
56
42
  "dependencies": {
57
- "mustache": "^4.2.0"
43
+ "mustache": "^4.2.0",
44
+ "zod": "^4.3.6"
58
45
  },
59
46
  "peerDependencies": {
60
47
  "@tanstack/react-query": "^5.0.0",
@@ -68,13 +55,7 @@
68
55
  "optional": true
69
56
  }
70
57
  },
71
- "devDependencies": {
72
- "@tanstack/react-query": "^5.90.21",
73
- "@types/bun": "1.3.13",
74
- "@types/mustache": "^4.2.6",
75
- "@types/react": "^19.2.0",
76
- "pstdio-api-contracts": "workspace:*",
77
- "react": "^19.0.0",
78
- "typescript": "6.0.2"
58
+ "publishConfig": {
59
+ "access": "public"
79
60
  }
80
61
  }
@@ -1 +0,0 @@
1
- export type { AttemptExtensionFixResponse, CommandExecuteRequest, CommandExecuteResponse, ExtensionCommandPaletteContribution, ExtensionCommandPaletteResourceRecord, ExtensionCommandRecord, ExtensionControlsRendererRecord, ExtensionDataTableRendererRecord, ExtensionDiagnostic, ExtensionKanbanRendererRecord, ExtensionKeybindingRecord, ExtensionMenuContribution, ExtensionModeRecord, ExtensionPanelRecord, ExtensionRecord, ExtensionRouteRecord, ExtensionSettingDefinitionRecord, ExtensionSettingsPanelRecord, ExtensionSettingValueRecord, ExtensionTreeItemContribution, ExtensionTreeRendererRecord, InstallMarketplaceExtensionResponse, ListExtensionAppearanceResponse, ListExtensionCommandsResponse, ListExtensionSettingsResponse, ListProjectExtensionsResponse, LocalizableString, MarketplaceExtension, ProjectExtensionInstance, UpdateExtensionSettingRequest, UpdateInstalledExtensionTemplateInput, UpdateInstalledExtensionTemplateResponse, UpgradeProjectExtensionResponse, WorkbenchExtensionAutomationRecord, WorkbenchExtensionCommandPaletteResourceRecord, WorkbenchExtensionControlsRendererRecord, WorkbenchExtensionDataTableRendererRecord, WorkbenchExtensionHarnessRecord, WorkbenchExtensionKanbanRendererRecord, WorkbenchExtensionMetadata, WorkbenchExtensionPanelRecord, WorkbenchExtensionTreeRendererRecord, WorkbenchExtensionViewRecord, } from "pstdio-api-contracts";
@@ -1,10 +0,0 @@
1
- export type { CreateNotificationInput, ListNotificationsQuery, ListNotificationsResponse, Notification, NotificationAction, NotificationActionResult, NotificationActorType, NotificationKind, NotificationOrigin, NotificationPriority, NotificationStatus, ResourceRef, UpdateNotificationInput, } from "pstdio-api-contracts";
2
- export type { AttemptExtensionFixResponse, CommandExecuteRequest, CommandExecuteResponse, ExtensionCommandPaletteContribution, ExtensionCommandPaletteResourceRecord, ExtensionCommandRecord, ExtensionControlsRendererRecord, ExtensionDataTableRendererRecord, ExtensionDiagnostic, ExtensionKanbanRendererRecord, ExtensionKeybindingRecord, ExtensionMenuContribution, ExtensionModeRecord, ExtensionPanelRecord, ExtensionRecord, ExtensionRouteRecord, ExtensionSettingDefinitionRecord, ExtensionSettingsPanelRecord, ExtensionSettingValueRecord, ExtensionTreeItemContribution, ExtensionTreeRendererRecord, InstallMarketplaceExtensionResponse, ListExtensionAppearanceResponse, ListExtensionCommandsResponse, ListExtensionSettingsResponse, ListProjectExtensionsResponse, LocalizableString, MarketplaceExtension, ProjectExtensionInstance, UpdateExtensionSettingRequest, UpdateInstalledExtensionTemplateInput, UpdateInstalledExtensionTemplateResponse, UpgradeProjectExtensionResponse, WorkbenchExtensionAutomationRecord, WorkbenchExtensionCommandPaletteResourceRecord, WorkbenchExtensionControlsRendererRecord, WorkbenchExtensionDataTableRendererRecord, WorkbenchExtensionHarnessRecord, WorkbenchExtensionKanbanRendererRecord, WorkbenchExtensionMetadata, WorkbenchExtensionPanelRecord, WorkbenchExtensionTreeRendererRecord, WorkbenchExtensionViewRecord, } from "./extensions";
3
- export type { CreateProjectInput, RegisterRepoInput } from "./projects";
4
- export type { ApprovalInput, CreateSessionInput, FollowUpInput, ResolveSessionIdInput, ResolveSessionIdResponse, SessionAttachment, SessionAttachmentRef, SessionConversationResponse, } from "./sessions";
5
- export { sessionAttachmentMimeTypesByExtension } from "./sessions";
6
- export type { Settings, UpdateSettingsInput } from "./settings";
7
- export type { UpdateSkillInput } from "./skills";
8
- export type { CreateTemplateInput, UpdateTemplateInput } from "./templates";
9
- export type { TerminalHostEvent, TerminalSessionOperation, TerminalSessionRequest, TerminalSessionResult, } from "./terminal";
10
- export type { CreateWorkspaceInput, ListWorkspaceFilesInput, RemoveWorktreeResponse, RenameWorkspaceInput, WorkspaceFileContent, WorkspaceFileEntry, WorkspaceFilesResponse, WriteWorkspaceFileInput, } from "./workspaces";
@@ -1 +0,0 @@
1
- export type { CreateProjectInput, RegisterRepoInput } from "pstdio-api-contracts";
@@ -1,2 +0,0 @@
1
- export type { ApprovalInput, CreateSessionInput, FollowUpDecision, FollowUpInput, FollowUpResponse, ListSessionActivityInput, ListSessionActivityResponse, ResolveSessionIdInput, ResolveSessionIdResponse, SessionAttachment, SessionAttachmentRef, SessionConversationResponse, } from "pstdio-api-contracts";
2
- export { sessionAttachmentMimeTypesByExtension } from "pstdio-api-contracts";
@@ -1 +0,0 @@
1
- export type { Settings, UpdateSettingsInput } from "pstdio-api-contracts";
@@ -1 +0,0 @@
1
- export type { UpdateSkillInput } from "pstdio-api-contracts";
@@ -1 +0,0 @@
1
- export type { CreateTemplateInput, UpdateTemplateInput } from "pstdio-api-contracts";
@@ -1,49 +0,0 @@
1
- export interface TerminalSessionRequest {
2
- /** Command + args to run; defaults to the user's login shell when omitted. */
3
- command?: string[];
4
- /** Working directory; falls back to the extension's workspace root. */
5
- cwd?: string;
6
- /** Extra env vars merged over the inherited environment. */
7
- env?: Record<string, string>;
8
- /** Initial column count; the renderer can resize later. */
9
- cols: number;
10
- /** Initial row count; the renderer can resize later. */
11
- rows: number;
12
- }
13
- export type TerminalSessionOperation = {
14
- operation: "open";
15
- request: TerminalSessionRequest;
16
- } | {
17
- operation: "write";
18
- sessionId: string;
19
- data: string | Uint8Array;
20
- } | {
21
- operation: "resize";
22
- sessionId: string;
23
- cols: number;
24
- rows: number;
25
- } | {
26
- operation: "kill";
27
- sessionId: string;
28
- signal?: string;
29
- } | {
30
- operation: "subscribe";
31
- sessionId: string;
32
- };
33
- export type TerminalSessionResult = {
34
- operation: "open";
35
- sessionId: string;
36
- } | {
37
- operation: "write" | "resize" | "kill" | "subscribe";
38
- accepted: true;
39
- };
40
- export type TerminalHostEvent = {
41
- sessionId: string;
42
- kind: "data";
43
- chunk: Uint8Array;
44
- } | {
45
- sessionId: string;
46
- kind: "exit";
47
- code: number | null;
48
- signal: string | null;
49
- };
@@ -1,12 +0,0 @@
1
- import type { CreateWorkspaceInput as ContractCreateWorkspaceInput, ListWorkspaceActivityInput as ContractListWorkspaceActivityInput, ListWorkspaceActivityResponse as ContractListWorkspaceActivityResponse, ListWorkspaceFilesInput as ContractListWorkspaceFilesInput, MoveWorkspaceEntryInput as ContractMoveWorkspaceEntryInput, RemoveWorktreeResponse as ContractRemoveWorktreeResponse, RenameWorkspaceInput as ContractRenameWorkspaceInput, WorkspaceFileContent as ContractWorkspaceFileContent, WorkspaceFileEntry as ContractWorkspaceFileEntry, WorkspaceFilesResponse as ContractWorkspaceFilesResponse, WriteWorkspaceFileInput as ContractWriteWorkspaceFileInput } from "pstdio-api-contracts";
2
- export type CreateWorkspaceInput = ContractCreateWorkspaceInput;
3
- export type ListWorkspaceActivityInput = ContractListWorkspaceActivityInput;
4
- export type ListWorkspaceActivityResponse = ContractListWorkspaceActivityResponse;
5
- export type RemoveWorktreeResponse = ContractRemoveWorktreeResponse;
6
- export type RenameWorkspaceInput = ContractRenameWorkspaceInput;
7
- export type ListWorkspaceFilesInput = ContractListWorkspaceFilesInput;
8
- export type MoveWorkspaceEntryInput = ContractMoveWorkspaceEntryInput;
9
- export type WorkspaceFileContent = ContractWorkspaceFileContent;
10
- export type WorkspaceFileEntry = ContractWorkspaceFileEntry;
11
- export type WorkspaceFilesResponse = ContractWorkspaceFilesResponse;
12
- export type WriteWorkspaceFileInput = ContractWriteWorkspaceFileInput;
@@ -1,10 +0,0 @@
1
- import type { AgentModel } from "pstdio-api-contracts";
2
- import type { AgentInfo } from "../resources";
3
- import type { RequestFn } from "./request";
4
- export type AgentClient = {
5
- info(params?: {
6
- project?: string;
7
- }): Promise<AgentInfo[]>;
8
- models(agentId: string): Promise<AgentModel[]>;
9
- };
10
- export declare const createAgentClient: (request: RequestFn) => AgentClient;
@@ -1,26 +0,0 @@
1
- import { type AgentClient } from "./agents";
2
- import { type ExtensionClient } from "./extensions";
3
- import { type NotificationsClient } from "./notifications";
4
- import { type ProjectClient } from "./projects";
5
- import type { ClientOptions } from "./request";
6
- import { type RuntimeClient } from "./runtime";
7
- import { type SessionClient } from "./sessions";
8
- import { type SettingsClient } from "./settings";
9
- import { type SkillClient } from "./skills";
10
- import { type SyncClient } from "./sync";
11
- import { type TemplateClient } from "./templates";
12
- import { type WorkspaceClient } from "./workspaces";
13
- export type PstdioClient = {
14
- projects: ProjectClient;
15
- workspaces: WorkspaceClient;
16
- sessions: SessionClient;
17
- templates: TemplateClient;
18
- skills: SkillClient;
19
- agents: AgentClient;
20
- notifications: NotificationsClient;
21
- extensions: ExtensionClient;
22
- settings: SettingsClient;
23
- sync: SyncClient;
24
- runtime: RuntimeClient;
25
- };
26
- export declare const createClient: (options?: ClientOptions) => PstdioClient;
@@ -1,12 +0,0 @@
1
- import type { CommandExecuteRequest, CommandExecuteResponse, DispatchExtensionEventInput, EnableInstalledExtensionRequest, EnableInstalledExtensionResponse, ListExtensionAppearanceResponse, ListExtensionCommandsResponse, ListProjectExtensionsResponse, UpdateInstalledExtensionTemplateInput, UpdateInstalledExtensionTemplateResponse } from "pstdio-api-contracts";
2
- import type { RequestFn } from "./request";
3
- export type ExtensionClient = {
4
- enableInstalled(projectId: string, installName: string, request: EnableInstalledExtensionRequest): Promise<EnableInstalledExtensionResponse>;
5
- updateInstalledTemplate(installName: string, templateKey: string, input: UpdateInstalledExtensionTemplateInput): Promise<UpdateInstalledExtensionTemplateResponse>;
6
- listAppearance(projectId: string): Promise<ListExtensionAppearanceResponse>;
7
- listCommands(projectId: string): Promise<ListExtensionCommandsResponse>;
8
- listProject(projectId: string): Promise<ListProjectExtensionsResponse>;
9
- execute(commandId: string, request: CommandExecuteRequest): Promise<CommandExecuteResponse>;
10
- dispatchEvent(projectId: string, input: DispatchExtensionEventInput): Promise<void>;
11
- };
12
- export declare const createExtensionClient: (request: RequestFn) => ExtensionClient;