@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.
- package/README.md +56 -0
- package/dist/api/index.js +2409 -896
- package/dist/api.d.ts +15 -3787
- package/dist/client/index.js +27 -9
- package/dist/client.d.ts +3 -1728
- package/dist/data/index.js +4 -4
- package/dist/data.d.ts +27 -49
- package/dist/extensions/index.js +200 -4
- package/dist/extensions-react.d.ts +18 -23
- package/dist/extensions.d.ts +3 -3940
- package/dist/hooks.d.ts +95 -1789
- package/dist/index-CR17_9lz.d.ts +7907 -0
- package/dist/index-DHgymE3o.d.ts +7 -0
- package/dist/index-ec4rxUeY.d.ts +264 -0
- package/dist/prompts.d.ts +4 -3
- package/dist/resources/index.js +2409 -896
- package/dist/resources.d.ts +4 -426
- package/dist/sessions-BfZI6tY0.d.ts +2 -0
- package/dist/skills-BfZI6tY0.d.ts +2 -0
- package/dist/testing/index.js +15 -2
- package/dist/testing.d.ts +27 -921
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { d as WorkspaceListItem$1, s as Workspace$1 } from "./index-CR17_9lz.js";
|
|
2
|
+
//#region src/resources/workspace.d.ts
|
|
3
|
+
type Workspace = Workspace$1;
|
|
4
|
+
type WorkspaceListItem = WorkspaceListItem$1;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { WorkspaceListItem as n, Workspace as t };
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { $a as FollowUpInput, A as EnableInstalledExtensionRequest, B as ConfigureExtensionConnectionInput, Co as UpdateNotificationInput, Fd as AgentModel, H as ListExtensionConnectionsResponse, I as UpgradeProjectExtensionResponse, L as CommandExecuteRequest, N as ListProjectExtensionsResponse, Pd as AgentInfo, Qa as CreateSessionInput, R as CommandExecuteResponse, Rd as ListActivityResponse, So as NotificationStatus, V as ExtensionConnectionRecord, X as ListExtensionAppearanceResponse, Xa as UpdateSkillInput, Ya as SkillWithContent, Z as ListExtensionCommandsResponse, Za as ApprovalInput, _ as CreateProjectInput, a as RemoveWorktreeResponse, ao as Session, c as WorkspaceFileContent, co as SessionConversationResponse, ct as IssueAutomationTokenInput, do as SessionQueuedMessagesResponse, dt as ListAutomationTokensResponse, eo as FollowUpResponse, f as WorkspaceProviderDescriptor, go as Notification, h as UpdateSettingsInput, ho as ListNotificationsResponse, i as ListWorkspaceFilesInput, io as ResolveSessionIdResponse, j as EnableInstalledExtensionResponse, l as WorkspaceFileEntry, lo as SessionConversationSources, lt as IssueAutomationTokenResponse, m as Settings, mo as ListNotificationsQuery, n as ListWorkspaceActivityInput, no as ListSessionActivityResponse, nt as AutomationRun, o as RenameWorkspaceInput, oo as SessionAttachment, p as WriteWorkspaceFileInput, po as CreateNotificationInput, qa as Skill, r as ListWorkspaceActivityResponse, ro as ResolveSessionIdInput, st as CreateAutomationRunInput, t as CreateWorkspaceInput, to as ListSessionActivityInput, u as WorkspaceFilesResponse, uo as SessionHistoryIssue, ut as ListAutomationRunEventsResponse, v as Project, y as UpdateProjectInput, z as DispatchExtensionEventInput, zd as ListProjectActivityInput } from "./index-CR17_9lz.js";
|
|
2
|
+
import "./skills-BfZI6tY0.js";
|
|
3
|
+
import { n as WorkspaceListItem, t as Workspace } from "./index-DHgymE3o.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
|
+
status: number;
|
|
12
|
+
constructor(message: string, status: number);
|
|
13
|
+
}
|
|
14
|
+
type RequestOptions = {
|
|
15
|
+
method?: string;
|
|
16
|
+
body?: unknown;
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
headers?: HeadersInit;
|
|
19
|
+
cache?: RequestCache;
|
|
20
|
+
};
|
|
21
|
+
type RequestFn = <T>(path: string, options?: RequestOptions) => Promise<T>;
|
|
22
|
+
declare const createRequest: (options: ClientOptions) => RequestFn;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/client/agents.d.ts
|
|
25
|
+
type AgentClient = {
|
|
26
|
+
info(params?: {
|
|
27
|
+
project?: string;
|
|
28
|
+
}): Promise<AgentInfo[]>;
|
|
29
|
+
models(agentId: string): Promise<AgentModel[]>;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/client/automation.d.ts
|
|
33
|
+
type AutomationClient = {
|
|
34
|
+
issueToken(input: IssueAutomationTokenInput): Promise<IssueAutomationTokenResponse>;
|
|
35
|
+
listTokens(projectId: string): Promise<ListAutomationTokensResponse>;
|
|
36
|
+
revokeToken(tokenId: string): Promise<void>;
|
|
37
|
+
createRun(projectId: string, idempotencyKey: string, input: CreateAutomationRunInput): Promise<AutomationRun>;
|
|
38
|
+
getRun(projectId: string, runId: string): Promise<AutomationRun>;
|
|
39
|
+
listRunEvents(projectId: string, runId: string, after?: number): Promise<ListAutomationRunEventsResponse>;
|
|
40
|
+
cancelRun(projectId: string, runId: string): Promise<AutomationRun>;
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/client/extensions.d.ts
|
|
44
|
+
type ExtensionClient = {
|
|
45
|
+
enableInstalled(projectId: string, installName: string, request: EnableInstalledExtensionRequest): Promise<EnableInstalledExtensionResponse>;
|
|
46
|
+
listAppearance(projectId: string): Promise<ListExtensionAppearanceResponse>;
|
|
47
|
+
listCommands(projectId: string): Promise<ListExtensionCommandsResponse>;
|
|
48
|
+
listProject(projectId: string): Promise<ListProjectExtensionsResponse>;
|
|
49
|
+
upgradeProject(projectId: string, instanceId: string): Promise<UpgradeProjectExtensionResponse>;
|
|
50
|
+
listConnections(projectId: string): Promise<ListExtensionConnectionsResponse>;
|
|
51
|
+
configureConnection(projectId: string, extensionId: string, connectionId: string, input: ConfigureExtensionConnectionInput): Promise<ExtensionConnectionRecord>;
|
|
52
|
+
checkConnection(projectId: string, extensionId: string, connectionId: string): Promise<ExtensionConnectionRecord>;
|
|
53
|
+
deleteConnection(projectId: string, extensionId: string, connectionId: string): Promise<void>;
|
|
54
|
+
execute(commandId: string, request: CommandExecuteRequest): Promise<CommandExecuteResponse>;
|
|
55
|
+
dispatchEvent(projectId: string, input: DispatchExtensionEventInput): Promise<void>;
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/client/filesystem.d.ts
|
|
59
|
+
interface DirectoryEntry {
|
|
60
|
+
name: string;
|
|
61
|
+
path: string;
|
|
62
|
+
isDirectory: boolean;
|
|
63
|
+
}
|
|
64
|
+
declare const createFilesystemClient: (request: RequestFn) => {
|
|
65
|
+
list: (path?: string) => Promise<{
|
|
66
|
+
currentPath: string;
|
|
67
|
+
entries: DirectoryEntry[];
|
|
68
|
+
}>;
|
|
69
|
+
createDirectory: (input: {
|
|
70
|
+
parent_path: string;
|
|
71
|
+
name: string;
|
|
72
|
+
}) => Promise<{
|
|
73
|
+
path: string;
|
|
74
|
+
}>;
|
|
75
|
+
};
|
|
76
|
+
type FilesystemClient = ReturnType<typeof createFilesystemClient>;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/client/notifications.d.ts
|
|
79
|
+
type NotificationsClient = {
|
|
80
|
+
list(projectId: string, query?: ListNotificationsQuery): Promise<ListNotificationsResponse>;
|
|
81
|
+
count(projectId: string, query?: Pick<ListNotificationsQuery, "status" | "priority" | "sourceExtensionId">): Promise<{
|
|
82
|
+
count: number;
|
|
83
|
+
}>;
|
|
84
|
+
get(projectId: string, id: string): Promise<Notification>;
|
|
85
|
+
create(input: CreateNotificationInput): Promise<Notification>;
|
|
86
|
+
update(projectId: string, id: string, input: UpdateNotificationInput): Promise<Notification>;
|
|
87
|
+
markRead(projectId: string, id: string): Promise<Notification>;
|
|
88
|
+
dismiss(projectId: string, id: string): Promise<Notification>;
|
|
89
|
+
markDone(projectId: string, id: string): Promise<Notification>;
|
|
90
|
+
snooze(projectId: string, id: string, until: string): Promise<Notification>;
|
|
91
|
+
resolveByDedupeKey(projectId: string, input: {
|
|
92
|
+
dedupeKey: string;
|
|
93
|
+
status?: Extract<NotificationStatus, "done" | "dismissed" | "expired">;
|
|
94
|
+
}): Promise<{
|
|
95
|
+
resolved: number;
|
|
96
|
+
notifications: Notification[];
|
|
97
|
+
}>;
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/client/projects.d.ts
|
|
101
|
+
type ProjectClient = {
|
|
102
|
+
list(): Promise<Project[]>;
|
|
103
|
+
get(projectId: string): Promise<Project>;
|
|
104
|
+
create(input: CreateProjectInput): Promise<Project>;
|
|
105
|
+
attachInitialWorkspace(projectId: string, input: CreateProjectInput["initial_workspace"]): Promise<Workspace>;
|
|
106
|
+
retrySetup(projectId: string): Promise<Workspace>;
|
|
107
|
+
update(projectId: string, input: UpdateProjectInput): Promise<Project>;
|
|
108
|
+
delete(projectId: string): Promise<void>;
|
|
109
|
+
listActivity(projectId: string, input?: ListProjectActivityInput): Promise<ListActivityResponse>;
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/client/runtime.d.ts
|
|
113
|
+
type RuntimeClient = {
|
|
114
|
+
provisionBrowserSession: () => Promise<void>;
|
|
115
|
+
};
|
|
116
|
+
declare const createRuntimeClient: (request: RequestFn) => RuntimeClient;
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/client/sse.d.ts
|
|
119
|
+
type SseEvent = {
|
|
120
|
+
event: string;
|
|
121
|
+
data: string;
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/client/sessions.d.ts
|
|
125
|
+
type ListSessionsInput = {
|
|
126
|
+
status?: string;
|
|
127
|
+
agent?: string;
|
|
128
|
+
workspaceId?: string;
|
|
129
|
+
archived?: boolean;
|
|
130
|
+
};
|
|
131
|
+
type SessionClient = {
|
|
132
|
+
list(projectId: string, input?: ListSessionsInput): Promise<Session[]>;
|
|
133
|
+
get(sessionId: string): Promise<Session>;
|
|
134
|
+
uploadAttachment(projectId: string, input: {
|
|
135
|
+
name: string;
|
|
136
|
+
data: Uint8Array | ArrayBuffer;
|
|
137
|
+
mimeType?: string | null;
|
|
138
|
+
}): Promise<SessionAttachment>;
|
|
139
|
+
deleteAttachment(projectId: string, fileId: string): Promise<void>;
|
|
140
|
+
create(input: CreateSessionInput): Promise<Session>;
|
|
141
|
+
archive(sessionId: string): Promise<void>;
|
|
142
|
+
followUp(sessionId: string, input: FollowUpInput): Promise<FollowUpResponse>;
|
|
143
|
+
approve(sessionId: string, input: ApprovalInput): Promise<void>;
|
|
144
|
+
getConversation(sessionId: string, signal?: AbortSignal): Promise<SessionConversationResponse>;
|
|
145
|
+
getConversationSources(sessionId: string, signal?: AbortSignal): Promise<SessionConversationSources>;
|
|
146
|
+
getQueuedMessages(sessionId: string, options?: {
|
|
147
|
+
signal?: AbortSignal;
|
|
148
|
+
}): Promise<SessionQueuedMessagesResponse>;
|
|
149
|
+
resolveSessionId(input: ResolveSessionIdInput): Promise<ResolveSessionIdResponse>;
|
|
150
|
+
updateStatus(sessionId: string, status: string): Promise<Session>;
|
|
151
|
+
listActivity(sessionId: string, input?: ListSessionActivityInput): Promise<ListSessionActivityResponse>;
|
|
152
|
+
stream(sessionId: string, onEvent: (event: SseEvent) => void, options?: {
|
|
153
|
+
signal?: AbortSignal;
|
|
154
|
+
}): Promise<void>;
|
|
155
|
+
connectStream(sessionId: string, handlers: SessionStreamHandlers, options?: {
|
|
156
|
+
attempt?: number;
|
|
157
|
+
}): SessionStreamConnection;
|
|
158
|
+
};
|
|
159
|
+
type SessionStreamHandlers = {
|
|
160
|
+
onReady?: (data: unknown) => void;
|
|
161
|
+
onPatch?: (data: unknown) => void;
|
|
162
|
+
onApprovalRequest?: (data: unknown) => void;
|
|
163
|
+
onHistoryIssue?: (data: SessionHistoryIssue) => void;
|
|
164
|
+
onQueuedMessages?: (data: SessionQueuedMessagesResponse | {
|
|
165
|
+
error: string;
|
|
166
|
+
}) => void;
|
|
167
|
+
onEnd?: (data: unknown) => void;
|
|
168
|
+
onError?: (error: unknown) => void;
|
|
169
|
+
};
|
|
170
|
+
type SessionStreamConnection = {
|
|
171
|
+
close: () => void;
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/client/settings.d.ts
|
|
175
|
+
type SettingsClient = {
|
|
176
|
+
get(): Promise<Settings>;
|
|
177
|
+
update(input: UpdateSettingsInput): Promise<Settings>;
|
|
178
|
+
};
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/client/skills.d.ts
|
|
181
|
+
type SkillClient = {
|
|
182
|
+
list(projectId: string): Promise<Skill[]>;
|
|
183
|
+
get(projectId: string, skillId: string): Promise<SkillWithContent>;
|
|
184
|
+
updatePreferences(projectId: string, skillName: string, input: UpdateSkillInput): Promise<Skill>;
|
|
185
|
+
};
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/client/sync.d.ts
|
|
188
|
+
type SyncRow = {
|
|
189
|
+
id: string;
|
|
190
|
+
[key: string]: unknown;
|
|
191
|
+
};
|
|
192
|
+
type SyncWriter = {
|
|
193
|
+
truncateAndWrite: (rows: SyncRow[]) => void;
|
|
194
|
+
upsert: (row: SyncRow) => void;
|
|
195
|
+
remove: (id: string) => void;
|
|
196
|
+
};
|
|
197
|
+
type SyncWriterProvider = {
|
|
198
|
+
getWriter: (table: string) => SyncWriter | undefined;
|
|
199
|
+
};
|
|
200
|
+
type SyncConnection = {
|
|
201
|
+
close: () => void;
|
|
202
|
+
connected: boolean;
|
|
203
|
+
};
|
|
204
|
+
type StartSyncInput = SyncWriterProvider & {
|
|
205
|
+
/** Called after the initial snapshot, or when a cursor-based connection resumes. */
|
|
206
|
+
onConnected?: () => void;
|
|
207
|
+
onDisconnected?: () => void;
|
|
208
|
+
onConnectionLost?: () => void;
|
|
209
|
+
heartbeatIntervalMs?: number;
|
|
210
|
+
heartbeatThreshold?: number;
|
|
211
|
+
reconnectDelayMs?: number;
|
|
212
|
+
};
|
|
213
|
+
type SyncClient = {
|
|
214
|
+
start: (input: StartSyncInput) => SyncConnection;
|
|
215
|
+
};
|
|
216
|
+
declare const parseSyncDeleteEvent: (data: string) => {
|
|
217
|
+
table: string;
|
|
218
|
+
id: string;
|
|
219
|
+
seq: number;
|
|
220
|
+
};
|
|
221
|
+
declare const applySyncEvent: (event: string, data: string, writers: SyncWriterProvider) => number | null;
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/client/workspaces.d.ts
|
|
224
|
+
type WorkspaceClient = {
|
|
225
|
+
listProviders(projectId: string): Promise<WorkspaceProviderDescriptor[]>;
|
|
226
|
+
list(projectId: string): Promise<WorkspaceListItem[]>;
|
|
227
|
+
getByShorthand(projectId: string, shorthand: string): Promise<Workspace>;
|
|
228
|
+
create(input: CreateWorkspaceInput): Promise<Workspace>;
|
|
229
|
+
rename(workspaceId: string, input: RenameWorkspaceInput): Promise<Workspace>;
|
|
230
|
+
listActivity(workspaceId: string, input?: ListWorkspaceActivityInput): Promise<ListWorkspaceActivityResponse>;
|
|
231
|
+
listFiles(workspaceId: string, input?: ListWorkspaceFilesInput, options?: {
|
|
232
|
+
signal?: AbortSignal;
|
|
233
|
+
}): Promise<WorkspaceFilesResponse>;
|
|
234
|
+
createDirectory(workspaceId: string, path: string): Promise<WorkspaceFileEntry>;
|
|
235
|
+
createFile(workspaceId: string, path: string, input: WriteWorkspaceFileInput): Promise<WorkspaceFileContent>;
|
|
236
|
+
readFile(workspaceId: string, path: string, options?: {
|
|
237
|
+
signal?: AbortSignal;
|
|
238
|
+
}): Promise<WorkspaceFileContent>;
|
|
239
|
+
writeFile(workspaceId: string, path: string, input: WriteWorkspaceFileInput): Promise<WorkspaceFileContent>;
|
|
240
|
+
moveEntry(workspaceId: string, path: string, destinationPath: string): Promise<void>;
|
|
241
|
+
deleteEntry(workspaceId: string, path: string): Promise<void>;
|
|
242
|
+
removeWorktree(workspaceId: string): Promise<RemoveWorktreeResponse>;
|
|
243
|
+
delete(workspaceId: string): Promise<void>;
|
|
244
|
+
};
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/client/client.d.ts
|
|
247
|
+
type PstdioClient = {
|
|
248
|
+
projects: ProjectClient;
|
|
249
|
+
filesystem: FilesystemClient;
|
|
250
|
+
workspaces: WorkspaceClient;
|
|
251
|
+
sessions: SessionClient;
|
|
252
|
+
skills: SkillClient;
|
|
253
|
+
agents: AgentClient;
|
|
254
|
+
automation: AutomationClient;
|
|
255
|
+
notifications: NotificationsClient;
|
|
256
|
+
extensions: ExtensionClient;
|
|
257
|
+
settings: SettingsClient;
|
|
258
|
+
sync: SyncClient;
|
|
259
|
+
runtime: RuntimeClient;
|
|
260
|
+
};
|
|
261
|
+
declare const createClient: (options?: ClientOptions) => PstdioClient;
|
|
262
|
+
//#endregion
|
|
263
|
+
export { RequestFn as A, DirectoryEntry as C, AgentClient as D, AutomationClient as E, createRequest as M, ClientOptions as O, NotificationsClient as S, ExtensionClient 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, RequestOptions as j, PstdioApiError 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, FilesystemClient as w, ProjectClient as x, RuntimeClient as y };
|
|
264
|
+
export {};
|
package/dist/prompts.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/prompts/render-prompt.d.ts
|
|
2
|
+
export declare const renderPrompt: (template: string, data: Record<string, unknown>) => string;
|
|
3
|
+
//#endregion
|
|
4
|
+
export {};
|