@pstdio/sdk 0.25.0 → 0.36.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.
@@ -46,6 +46,12 @@ var createExtensionClient = (request) => ({
46
46
  })
47
47
  });
48
48
 
49
+ // src/client/filesystem.ts
50
+ var createFilesystemClient = (request) => ({
51
+ list: (path) => request(`/v1/filesystem/list${path ? `?path=${encodeURIComponent(path)}` : ""}`),
52
+ createDirectory: (input) => request("/v1/filesystem/directories", { method: "POST", body: input })
53
+ });
54
+
49
55
  // src/client/notifications.ts
50
56
  var appendArrayOrValue = (params, key, value) => {
51
57
  if (value === undefined)
@@ -91,6 +97,9 @@ var createProjectClient = (request) => ({
91
97
  list: () => request("/v1/projects"),
92
98
  get: (projectId) => request(`/v1/projects/${projectId}`),
93
99
  create: (input) => request("/v1/projects", { method: "POST", body: input }),
100
+ attachInitialWorkspace: (projectId, input) => request(`/v1/projects/${encodeURIComponent(projectId)}/initial-workspace`, { method: "POST", body: input }),
101
+ retrySetup: (projectId) => request(`/v1/projects/${projectId}/retry-setup`, { method: "POST" }),
102
+ update: (projectId, input) => request(`/v1/projects/${projectId}`, { method: "PATCH", body: input }),
94
103
  delete: (projectId) => request(`/v1/projects/${projectId}`, { method: "DELETE" }),
95
104
  listActivity: (projectId, input = {}) => {
96
105
  const params = new URLSearchParams;
@@ -108,10 +117,7 @@ var createProjectClient = (request) => ({
108
117
  params.append("limit", String(input.limit));
109
118
  const query = params.toString();
110
119
  return request(`/v1/projects/${projectId}/activity${query ? `?${query}` : ""}`);
111
- },
112
- listRepos: (projectId) => request(`/v1/projects/${projectId}/repos`),
113
- registerRepo: (projectId, input) => request(`/v1/projects/${projectId}/repos`, { method: "POST", body: input }),
114
- removeRepo: (projectId, repoId) => request(`/v1/projects/${projectId}/repos/${repoId}`, { method: "DELETE" })
120
+ }
115
121
  });
116
122
 
117
123
  // src/client/request.ts
@@ -319,6 +325,14 @@ var dispatchSessionStreamEvent = (event, handlers) => {
319
325
  handlers.onApprovalRequest?.(parseEventData(event.data));
320
326
  return;
321
327
  }
328
+ if (event.event === "history_issue") {
329
+ handlers.onHistoryIssue?.(parseEventData(event.data));
330
+ return;
331
+ }
332
+ if (event.event === "queued_messages") {
333
+ handlers.onQueuedMessages?.(parseEventData(event.data));
334
+ return;
335
+ }
322
336
  if (event.event === "end") {
323
337
  handlers.onEnd?.(parseEventData(event.data));
324
338
  }
@@ -356,7 +370,9 @@ var createSessionClient = (request, clientOptions) => ({
356
370
  archive: (sessionId) => request(`/v1/sessions/${sessionId}/archive`, { method: "POST" }),
357
371
  followUp: (sessionId, input) => request(`/v1/sessions/${sessionId}/follow-up`, { method: "POST", body: input }),
358
372
  approve: (sessionId, input) => request(`/v1/sessions/${sessionId}/approve`, { method: "POST", body: input }),
359
- getConversation: (sessionId) => request(`/v1/sessions/${sessionId}/conversation`),
373
+ getConversation: (sessionId, signal) => request(`/v1/sessions/${sessionId}/conversation`, { signal }),
374
+ getConversationSources: (sessionId, signal) => request(`/v1/sessions/${sessionId}/conversation/sources`, { signal }),
375
+ getQueuedMessages: (sessionId, options) => request(`/v1/sessions/${sessionId}/queued-messages`, options),
360
376
  resolveSessionId: (input) => request("/v1/sessions/resolve-session-id", { method: "POST", body: input }),
361
377
  updateStatus: (sessionId, status) => request(`/v1/sessions/${sessionId}/status`, { method: "PATCH", body: { status } }),
362
378
  stream: (sessionId, onEvent, options = {}) => streamSessionEvents(clientOptions, buildSessionStreamPath(sessionId), onEvent, options),
@@ -529,7 +545,8 @@ var createSyncClient = (clientOptions) => ({
529
545
 
530
546
  // src/client/workspaces.ts
531
547
  var createWorkspaceClient = (request) => ({
532
- listFiles: (workspaceId, input = {}) => {
548
+ listProviders: (projectId) => request(`/v1/projects/${encodeURIComponent(projectId)}/workspace-providers`),
549
+ listFiles: (workspaceId, input = {}, options) => {
533
550
  const params = new URLSearchParams;
534
551
  if (input.path !== undefined)
535
552
  params.append("path", input.path);
@@ -538,11 +555,11 @@ var createWorkspaceClient = (request) => ({
538
555
  if (input.limit !== undefined)
539
556
  params.append("limit", String(input.limit));
540
557
  const query = params.toString();
541
- return request(`/v1/workspaces/${encodeURIComponent(workspaceId)}/files${query ? `?${query}` : ""}`);
558
+ return request(`/v1/workspaces/${encodeURIComponent(workspaceId)}/files${query ? `?${query}` : ""}`, options);
542
559
  },
543
- readFile: (workspaceId, path) => {
560
+ readFile: (workspaceId, path, options) => {
544
561
  const params = new URLSearchParams({ path });
545
- return request(`/v1/workspaces/${encodeURIComponent(workspaceId)}/file?${params.toString()}`);
562
+ return request(`/v1/workspaces/${encodeURIComponent(workspaceId)}/file?${params.toString()}`, options);
546
563
  },
547
564
  createDirectory: (workspaceId, path) => {
548
565
  const params = new URLSearchParams({ path });
@@ -606,6 +623,7 @@ var createClient = (options = {}) => {
606
623
  const request = createRequest(options);
607
624
  return {
608
625
  projects: createProjectClient(request),
626
+ filesystem: createFilesystemClient(request),
609
627
  workspaces: createWorkspaceClient(request),
610
628
  sessions: createSessionClient(request, options),
611
629
  skills: createSkillClient(request),