@pstdio/sdk 0.24.1 → 0.35.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,426 +1,4 @@
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
- shorthand: z.ZodOptional<z.ZodString>;
190
- type: z.ZodString;
191
- id: z.ZodString;
192
- projectId: z.ZodOptional<z.ZodString>;
193
- label: z.ZodOptional<z.ZodString>;
194
- icon: z.ZodOptional<z.ZodString>;
195
- extensionId: z.ZodOptional<z.ZodString>;
196
- metadata: z.ZodOptional<z.ZodType<JsonObject, unknown, z.core.$ZodTypeInternals<JsonObject, unknown>>>;
197
- }, z.core.$strip>>;
198
- created_at: z.ZodString;
199
- updated_at: z.ZodString;
200
- }, z.core.$strip>;
201
-
202
- export declare type SessionStatus = z.infer<typeof sessionStatusSchema>;
203
-
204
- declare const sessionStatusSchema: z.ZodEnum<{
205
- completed: "completed";
206
- failed: "failed";
207
- in_progress: "in_progress";
208
- awaiting_input: "awaiting_input";
209
- queued: "queued";
210
- cancelled: "cancelled";
211
- disconnected: "disconnected";
212
- }>;
213
-
214
- export declare type Settings = z.infer<typeof settingsSchema>;
215
-
216
- declare const settingsSchema: z.ZodObject<{
217
- notifications_enabled: z.ZodBoolean;
218
- max_concurrent_sessions: z.ZodNullable<z.ZodNumber>;
219
- }, z.core.$strip>;
220
-
221
- export declare type Skill = z.infer<typeof skillSchema>;
222
-
223
- export declare type SkillFile = z.infer<typeof skillFileSchema>;
224
-
225
- declare const skillFileSchema: z.ZodObject<{
226
- path: z.ZodString;
227
- content: z.ZodString;
228
- encoding: z.ZodLiteral<"utf8">;
229
- }, z.core.$strip>;
230
-
231
- declare const skillSchema: z.ZodObject<{
232
- id: z.ZodString;
233
- project_id: z.ZodString;
234
- name: z.ZodString;
235
- title: z.ZodString;
236
- description: z.ZodString;
237
- source_kind: z.ZodEnum<{
238
- project: "project";
239
- extension: "extension";
240
- }>;
241
- files: z.ZodArray<z.ZodObject<{
242
- path: z.ZodString;
243
- content: z.ZodString;
244
- encoding: z.ZodLiteral<"utf8">;
245
- }, z.core.$strip>>;
246
- editable: z.ZodBoolean;
247
- extension_instance_id: z.ZodOptional<z.ZodString>;
248
- extension_id: z.ZodOptional<z.ZodString>;
249
- installed_extension_id: z.ZodOptional<z.ZodString>;
250
- install_name: z.ZodOptional<z.ZodString>;
251
- key: z.ZodOptional<z.ZodString>;
252
- source: z.ZodOptional<z.ZodObject<{
253
- kind: z.ZodLiteral<"package-asset">;
254
- path: z.ZodString;
255
- baseUrl: z.ZodString;
256
- }, z.core.$strip>>;
257
- enabled: z.ZodOptional<z.ZodBoolean>;
258
- created_at: z.ZodString;
259
- updated_at: z.ZodString;
260
- deleted_at: z.ZodNullable<z.ZodString>;
261
- }, z.core.$strip>;
262
-
263
- export declare type SkillWithContent = z.infer<typeof skillWithContentSchema>;
264
-
265
- declare const skillWithContentSchema: z.ZodObject<{
266
- id: z.ZodString;
267
- project_id: z.ZodString;
268
- name: z.ZodString;
269
- title: z.ZodString;
270
- description: z.ZodString;
271
- source_kind: z.ZodEnum<{
272
- project: "project";
273
- extension: "extension";
274
- }>;
275
- files: z.ZodArray<z.ZodObject<{
276
- path: z.ZodString;
277
- content: z.ZodString;
278
- encoding: z.ZodLiteral<"utf8">;
279
- }, z.core.$strip>>;
280
- editable: z.ZodBoolean;
281
- extension_instance_id: z.ZodOptional<z.ZodString>;
282
- extension_id: z.ZodOptional<z.ZodString>;
283
- installed_extension_id: z.ZodOptional<z.ZodString>;
284
- install_name: z.ZodOptional<z.ZodString>;
285
- key: z.ZodOptional<z.ZodString>;
286
- source: z.ZodOptional<z.ZodObject<{
287
- kind: z.ZodLiteral<"package-asset">;
288
- path: z.ZodString;
289
- baseUrl: z.ZodString;
290
- }, z.core.$strip>>;
291
- enabled: z.ZodOptional<z.ZodBoolean>;
292
- created_at: z.ZodString;
293
- updated_at: z.ZodString;
294
- deleted_at: z.ZodNullable<z.ZodString>;
295
- installed_agents: z.ZodArray<z.ZodString>;
296
- outdated_agents: z.ZodArray<z.ZodString>;
297
- agent_installations: z.ZodArray<z.ZodObject<{
298
- agent_id: z.ZodString;
299
- agent_name: z.ZodString;
300
- installed_version: z.ZodNullable<z.ZodString>;
301
- outdated: z.ZodBoolean;
302
- }, z.core.$strip>>;
303
- }, z.core.$strip>;
304
-
305
- export declare type Workspace = Workspace_2;
306
-
307
- declare type Workspace_2 = z.infer<typeof workspaceSchema>;
308
-
309
- declare interface WorkspaceCapabilities {
310
- files: "none" | "read" | "write";
311
- diff: boolean;
312
- merge: boolean;
313
- rebase: boolean;
314
- archive: boolean;
315
- delete: boolean;
316
- }
317
-
318
- export declare type WorkspaceListItem = WorkspaceListItem_2;
319
-
320
- declare type WorkspaceListItem_2 = z.infer<typeof workspaceListItemSchema>;
321
-
322
- declare const workspaceListItemSchema: z.ZodObject<{
323
- id: z.ZodString;
324
- project_id: z.ZodString;
325
- name: z.ZodString;
326
- branch: z.ZodNullable<z.ZodString>;
327
- worktree_path: z.ZodNullable<z.ZodString>;
328
- provider_id: z.ZodString;
329
- provider_params_json: z.ZodRecord<z.ZodString, z.ZodUnknown>;
330
- provider_ref_json: z.ZodNullable<z.ZodObject<{
331
- version: z.ZodNumber;
332
- data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
333
- }, z.core.$strip>>;
334
- provider_state: z.ZodType<WorkspaceProviderState, unknown, z.core.$ZodTypeInternals<WorkspaceProviderState, unknown>>;
335
- execution_kind: z.ZodEnum<{
336
- local: "local";
337
- remote: "remote";
338
- }>;
339
- provider_operation_id: z.ZodNullable<z.ZodString>;
340
- provider_operation_kind: z.ZodNullable<z.ZodEnum<{
341
- delete: "delete";
342
- cancel: "cancel";
343
- archive: "archive";
344
- create: "create";
345
- }>>;
346
- provider_error_json: z.ZodNullable<z.ZodObject<{
347
- code: z.ZodString;
348
- message: z.ZodString;
349
- retryable: z.ZodBoolean;
350
- occurred_at: z.ZodString;
351
- }, z.core.$strip>>;
352
- provider_capabilities_json: z.ZodType<WorkspaceCapabilities, unknown, z.core.$ZodTypeInternals<WorkspaceCapabilities, unknown>>;
353
- display_path: z.ZodNullable<z.ZodString>;
354
- is_default: z.ZodBoolean;
355
- archived: z.ZodBoolean;
356
- workspace_shorthand: z.ZodString;
357
- startup_log_file_id: z.ZodNullable<z.ZodString>;
358
- anchors_json: z.ZodArray<z.ZodObject<{
359
- shorthand: z.ZodOptional<z.ZodString>;
360
- type: z.ZodString;
361
- id: z.ZodString;
362
- projectId: z.ZodOptional<z.ZodString>;
363
- label: z.ZodOptional<z.ZodString>;
364
- icon: z.ZodOptional<z.ZodString>;
365
- extensionId: z.ZodOptional<z.ZodString>;
366
- metadata: z.ZodOptional<z.ZodType<JsonObject, unknown, z.core.$ZodTypeInternals<JsonObject, unknown>>>;
367
- }, z.core.$strip>>;
368
- created_at: z.ZodString;
369
- updated_at: z.ZodString;
370
- deleted_at: z.ZodNullable<z.ZodString>;
371
- }, z.core.$strip>;
372
-
373
- declare type WorkspaceProviderState = "provisioning" | "ready" | "failed" | "cancelled" | "archiving" | "archived" | "deleting" | "provider_missing";
374
-
375
- declare const workspaceSchema: z.ZodObject<{
376
- id: z.ZodString;
377
- project_id: z.ZodString;
378
- name: z.ZodString;
379
- branch: z.ZodNullable<z.ZodString>;
380
- worktree_path: z.ZodNullable<z.ZodString>;
381
- provider_id: z.ZodString;
382
- provider_params_json: z.ZodRecord<z.ZodString, z.ZodUnknown>;
383
- provider_ref_json: z.ZodNullable<z.ZodObject<{
384
- version: z.ZodNumber;
385
- data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
386
- }, z.core.$strip>>;
387
- provider_state: z.ZodType<WorkspaceProviderState, unknown, z.core.$ZodTypeInternals<WorkspaceProviderState, unknown>>;
388
- execution_kind: z.ZodEnum<{
389
- local: "local";
390
- remote: "remote";
391
- }>;
392
- provider_operation_id: z.ZodNullable<z.ZodString>;
393
- provider_operation_kind: z.ZodNullable<z.ZodEnum<{
394
- delete: "delete";
395
- cancel: "cancel";
396
- archive: "archive";
397
- create: "create";
398
- }>>;
399
- provider_error_json: z.ZodNullable<z.ZodObject<{
400
- code: z.ZodString;
401
- message: z.ZodString;
402
- retryable: z.ZodBoolean;
403
- occurred_at: z.ZodString;
404
- }, z.core.$strip>>;
405
- provider_capabilities_json: z.ZodType<WorkspaceCapabilities, unknown, z.core.$ZodTypeInternals<WorkspaceCapabilities, unknown>>;
406
- display_path: z.ZodNullable<z.ZodString>;
407
- is_default: z.ZodBoolean;
408
- archived: z.ZodBoolean;
409
- workspace_shorthand: z.ZodString;
410
- startup_log_file_id: z.ZodNullable<z.ZodString>;
411
- anchors_json: z.ZodArray<z.ZodObject<{
412
- shorthand: z.ZodOptional<z.ZodString>;
413
- type: z.ZodString;
414
- id: z.ZodString;
415
- projectId: z.ZodOptional<z.ZodString>;
416
- label: z.ZodOptional<z.ZodString>;
417
- icon: z.ZodOptional<z.ZodString>;
418
- extensionId: z.ZodOptional<z.ZodString>;
419
- metadata: z.ZodOptional<z.ZodType<JsonObject, unknown, z.core.$ZodTypeInternals<JsonObject, unknown>>>;
420
- }, z.core.$strip>>;
421
- created_at: z.ZodString;
422
- updated_at: z.ZodString;
423
- deleted_at: z.ZodNullable<z.ZodString>;
424
- }, z.core.$strip>;
425
-
426
- export { }
1
+ import { Bd as AgentModel, Hd as harnessLocalId, Qa as SkillWithContent, Rd as AgentAvailabilityType, Vd as AgentSkillsLayout, Xa as Skill, Za as SkillFile, b as Project, co as Session, ho as SessionStatus, m as Settings, v as Repo, x as FileRecord, zd as AgentInfo } from "./index-x7CdJPRb.js";
2
+ import { n as WorkspaceListItem, t as Workspace } from "./index-iez3LrOK.js";
3
+ export { type AgentAvailabilityType, type AgentInfo, type AgentModel, type AgentSkillsLayout, type FileRecord, type Project, type Repo, type Session, type SessionStatus, type Settings, type Skill, type SkillFile, type SkillWithContent, type Workspace, type WorkspaceListItem, harnessLocalId };
4
+ export {};
@@ -0,0 +1,2 @@
1
+ import "./index-x7CdJPRb.js";
2
+ export {};
@@ -0,0 +1,2 @@
1
+ import "./index-x7CdJPRb.js";
2
+ export {};
@@ -1,5 +1,6 @@
1
1
  // src/testing/memory-resources.ts
2
2
  var createMemoryResources = (prefixes, sequences = new Map) => ({
3
+ removed: async () => {},
3
4
  allocate: async ({ kind }) => {
4
5
  const prefix = prefixes[kind];
5
6
  if (!prefix)
@@ -28,11 +29,25 @@ var makeCommandContext = (input) => {
28
29
  project: { id: projectId, name: "Test Project", shorthand: "T" },
29
30
  storage,
30
31
  resources,
32
+ navigation: { open: () => {} },
31
33
  invocation: { params },
32
34
  events: { emit: async () => ({ delivered: 0 }) },
33
35
  notify: { action: async () => ({}), dismiss: async () => [], resolve: async () => [], toast: async () => {} },
34
- workspaces: { list: async () => [], get: async () => null, getByShorthand: async () => null },
35
- sessions: { list: async () => [], listByWorkspace: async () => [], addAnchors: async () => {} },
36
+ workspaces: {
37
+ addAnchors: async () => {},
38
+ removeAnchors: async () => {},
39
+ listProviders: async () => [],
40
+ getDefault: async () => null,
41
+ list: async () => [],
42
+ get: async () => null,
43
+ getByShorthand: async () => null
44
+ },
45
+ sessions: {
46
+ list: async () => [],
47
+ listByWorkspace: async () => [],
48
+ addAnchors: async () => {},
49
+ removeAnchors: async () => {}
50
+ },
36
51
  ...overrides
37
52
  };
38
53
  paramsByContext.set(context, params);
@@ -57,6 +72,11 @@ var createMemoryRepoFiles = () => {
57
72
  writeText: async (path, value) => {
58
73
  files.set(path, encoder.encode(value));
59
74
  },
75
+ updateText: async (path, value) => {
76
+ if (!files.has(path))
77
+ throw new Error(`File not found: ${path}`);
78
+ files.set(path, encoder.encode(value));
79
+ },
60
80
  readBytes: async (path) => {
61
81
  const value = files.get(path);
62
82
  if (value === undefined)
@@ -170,6 +190,11 @@ var createMemoryStorage = () => {
170
190
  async put(id, value) {
171
191
  store.set(id, value);
172
192
  },
193
+ async update(id, value) {
194
+ if (!store.has(id))
195
+ throw new Error(`Item not found: ${id}`);
196
+ store.set(id, value);
197
+ },
173
198
  async createIfAbsent(id, value) {
174
199
  if (store.has(id))
175
200
  return false;