@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.
- package/README.md +1 -1
- package/dist/api/index.js +454 -31
- package/dist/api.d.ts +4 -4
- package/dist/client/index.js +203 -24
- package/dist/client.d.ts +2 -2
- package/dist/data.d.ts +1 -1
- package/dist/extensions/index.js +313 -18
- package/dist/extensions.d.ts +2 -2
- package/dist/hooks.d.ts +4 -4
- package/dist/{index-BU8PNmuX.d.ts → index-CBZam0c-.d.ts} +1 -1
- package/dist/index-COPyc9eO.d.ts +644 -0
- package/dist/index-DKb6w-4h.d.ts +15865 -0
- package/dist/resources/index.js +451 -30
- package/dist/resources.d.ts +2 -2
- package/dist/sessions-D3MhZWKe.d.ts +2 -0
- package/dist/skills-D3MhZWKe.d.ts +2 -0
- package/dist/testing/index.js +60 -3
- package/dist/testing.d.ts +15 -4
- package/package.json +1 -1
- package/dist/index-1twOhV2h.d.ts +0 -434
- package/dist/index-Cbt2YiR-.d.ts +0 -8336
- package/dist/sessions-46B897Gi.d.ts +0 -2
- package/dist/skills-46B897Gi.d.ts +0 -2
package/dist/resources.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as WorkspaceListItem, t as Workspace } from "./index-
|
|
1
|
+
import { Fd as SkillFile, Id as SkillWithContent, Pd as Skill, b as FileRecord, ep as AgentAvailabilityType, id as Session, ip as harnessLocalId, m as Settings, np as AgentModel, rp as AgentSkillsLayout, tp as AgentInfo, ud as SessionStatus, v as Project } from "./index-DKb6w-4h.js";
|
|
2
|
+
import { n as WorkspaceListItem, t as Workspace } from "./index-CBZam0c-.js";
|
|
3
3
|
export { type AgentAvailabilityType, type AgentInfo, type AgentModel, type AgentSkillsLayout, type FileRecord, type Project, type Session, type SessionStatus, type Settings, type Skill, type SkillFile, type SkillWithContent, type Workspace, type WorkspaceListItem, harnessLocalId };
|
|
4
4
|
export {};
|
package/dist/testing/index.js
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
|
+
// src/testing/memory-resource-links.ts
|
|
2
|
+
var createMemoryResourceLinks = (input) => {
|
|
3
|
+
const canonical = (ref) => {
|
|
4
|
+
if (ref.projectId && ref.projectId !== input.projectId)
|
|
5
|
+
throw new Error("Resource belongs to another project.");
|
|
6
|
+
return { ...ref, projectId: input.projectId, extensionId: ref.extensionId ?? input.extensionId };
|
|
7
|
+
};
|
|
8
|
+
const identity = (ref) => JSON.stringify([ref.projectId, ref.extensionId, ref.type, ref.id]);
|
|
9
|
+
const pair = (source, target) => JSON.stringify([identity(source), identity(target)]);
|
|
10
|
+
return {
|
|
11
|
+
addAnchors: async (resource, anchors) => {
|
|
12
|
+
const source = canonical(resource);
|
|
13
|
+
const targets = anchors.map((anchor) => ({ ...canonical(anchor), role: anchor.role ?? "context" }));
|
|
14
|
+
for (const target of targets)
|
|
15
|
+
input.edges.set(pair(source, target), { source, target });
|
|
16
|
+
},
|
|
17
|
+
removeAnchors: async (resource, refs) => {
|
|
18
|
+
const source = canonical(resource);
|
|
19
|
+
const targets = refs.map(canonical);
|
|
20
|
+
for (const target of targets)
|
|
21
|
+
input.edges.delete(pair(source, target));
|
|
22
|
+
},
|
|
23
|
+
listAnchors: async (query) => {
|
|
24
|
+
const ref = identity(canonical(query.resource));
|
|
25
|
+
const direction = query.direction ?? "outgoing";
|
|
26
|
+
const limit = query.limit ?? 50;
|
|
27
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
28
|
+
throw new Error("Limit must be between 1 and 100.");
|
|
29
|
+
const rows = [...input.edges.entries()].filter(([key, edge]) => {
|
|
30
|
+
const outgoing = identity(edge.source) === ref && direction !== "incoming";
|
|
31
|
+
const incoming = identity(edge.target) === ref && direction !== "outgoing";
|
|
32
|
+
return (outgoing || incoming) && (!query.role || edge.target.role === query.role) && (!query.cursor || key > query.cursor);
|
|
33
|
+
}).sort(([a], [b]) => {
|
|
34
|
+
if (a === b)
|
|
35
|
+
return 0;
|
|
36
|
+
return a < b ? -1 : 1;
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
items: rows.slice(0, limit).map(([, edge]) => edge),
|
|
40
|
+
...rows.length > limit ? { nextCursor: rows[limit - 1][0] } : {}
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
removed: async (resource) => {
|
|
44
|
+
const ref = identity(canonical(resource));
|
|
45
|
+
for (const [key, edge] of input.edges)
|
|
46
|
+
if (identity(edge.source) === ref || identity(edge.target) === ref)
|
|
47
|
+
input.edges.delete(key);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
1
52
|
// src/testing/memory-resources.ts
|
|
2
|
-
var createMemoryResources = (prefixes, sequences = new Map) => ({
|
|
3
|
-
|
|
53
|
+
var createMemoryResources = (prefixes, sequences = new Map, links = createMemoryResourceLinks({ projectId: "proj-1", extensionId: "test.extension", edges: new Map })) => ({
|
|
54
|
+
...links,
|
|
4
55
|
allocate: async ({ kind }) => {
|
|
5
56
|
const prefix = prefixes[kind];
|
|
6
57
|
if (!prefix)
|
|
@@ -12,6 +63,7 @@ var createMemoryResources = (prefixes, sequences = new Map) => ({
|
|
|
12
63
|
});
|
|
13
64
|
|
|
14
65
|
// src/testing/command-context.ts
|
|
66
|
+
var linksByStorage = new WeakMap;
|
|
15
67
|
var sequencesByStorage = new WeakMap;
|
|
16
68
|
var paramsByContext = new WeakMap;
|
|
17
69
|
var makeCommandContext = (input) => {
|
|
@@ -21,7 +73,12 @@ var makeCommandContext = (input) => {
|
|
|
21
73
|
sequences = new Map;
|
|
22
74
|
sequencesByStorage.set(storage, sequences);
|
|
23
75
|
}
|
|
24
|
-
|
|
76
|
+
let edges = linksByStorage.get(storage);
|
|
77
|
+
if (!edges) {
|
|
78
|
+
edges = new Map;
|
|
79
|
+
linksByStorage.set(storage, edges);
|
|
80
|
+
}
|
|
81
|
+
const resources = createMemoryResources(input.resourcePrefixes ?? {}, sequences, createMemoryResourceLinks({ projectId, extensionId: overrides?.extensionId ?? "test.extension", edges }));
|
|
25
82
|
const context = {
|
|
26
83
|
extensionId: "test.extension",
|
|
27
84
|
name: "test-extension",
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $d as ResourceAnchor, Ai as CommandContext, Sf as JsonValue, Yd as ExtensionResourcesApi, Zi as ExtensionStorageApi, af as ResourceRef, ki as ArtifactMount, nf as ResourceAnchorQuery } from "./index-DKb6w-4h.js";
|
|
2
2
|
//#region src/testing/command-context.d.ts
|
|
3
3
|
type CommandContextOverrides = { [K in keyof CommandContext]?: Partial<CommandContext[K]>; };
|
|
4
4
|
interface CommandContextInput<TParams extends Record<string, unknown>> {
|
|
@@ -8,9 +8,9 @@ interface CommandContextInput<TParams extends Record<string, unknown>> {
|
|
|
8
8
|
resourcePrefixes?: Record<string, string>;
|
|
9
9
|
overrides?: CommandContextOverrides;
|
|
10
10
|
}
|
|
11
|
-
export declare const makeCommandContext: <TParams extends Record<string, unknown>>(input: CommandContextInput<TParams>) => CommandContext<Record<string, unknown
|
|
11
|
+
export declare const makeCommandContext: <TParams extends Record<string, unknown>>(input: CommandContextInput<TParams>) => CommandContext<Record<string, unknown>, JsonValue>;
|
|
12
12
|
export declare const commandParamsFor: <TParams extends Record<string, unknown>>(context: CommandContext) => TParams;
|
|
13
|
-
export declare const makeCommandArgs: <TParams extends Record<string, unknown>>(input: CommandContextInput<TParams>) => readonly [CommandContext<Record<string, unknown
|
|
13
|
+
export declare const makeCommandArgs: <TParams extends Record<string, unknown>>(input: CommandContextInput<TParams>) => readonly [CommandContext<Record<string, unknown>, JsonValue>, TParams];
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/testing/memory-repo-files.d.ts
|
|
16
16
|
export declare const createMemoryRepoFiles: () => ArtifactMount & {
|
|
@@ -18,7 +18,18 @@ export declare const createMemoryRepoFiles: () => ArtifactMount & {
|
|
|
18
18
|
};
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/testing/memory-resources.d.ts
|
|
21
|
-
export declare const createMemoryResources: (prefixes: Record<string, string>, sequences?: Map<string, number
|
|
21
|
+
export declare const createMemoryResources: (prefixes: Record<string, string>, sequences?: Map<string, number>, links?: {
|
|
22
|
+
addAnchors: (resource: ResourceRef, anchors: ResourceAnchor[]) => Promise<void>;
|
|
23
|
+
removeAnchors: (resource: ResourceRef, refs: ResourceRef[]) => Promise<void>;
|
|
24
|
+
listAnchors: (query: ResourceAnchorQuery) => Promise<{
|
|
25
|
+
nextCursor?: string | undefined;
|
|
26
|
+
items: {
|
|
27
|
+
source: ResourceRef;
|
|
28
|
+
target: ResourceAnchor;
|
|
29
|
+
}[];
|
|
30
|
+
}>;
|
|
31
|
+
removed: (resource: ResourceRef) => Promise<void>;
|
|
32
|
+
}) => ExtensionResourcesApi;
|
|
22
33
|
//#endregion
|
|
23
34
|
//#region src/testing/memory-storage.d.ts
|
|
24
35
|
export declare const createMemoryStorage: () => ExtensionStorageApi;
|
package/package.json
CHANGED
package/dist/index-1twOhV2h.d.ts
DELETED
|
@@ -1,434 +0,0 @@
|
|
|
1
|
-
import { $d as ListActivityResponse, $u as CreateNotificationInput, A as EnableInstalledExtensionRequest, B as ConfigureExtensionConnectionInput, Bu as FollowUpInput, Gu as ResolveSessionIdResponse, H as ListExtensionConnectionsResponse, Hu as ListSessionActivityInput, I as UpgradeProjectExtensionResponse, Iu as SkillWithContent, Ku as Session, L as CommandExecuteRequest, Lu as UpdateSkillInput, N as ListProjectExtensionsResponse, Pu as Skill, R as CommandExecuteResponse, Ru as ApprovalInput, Uu as ListSessionActivityResponse, V as ExtensionConnectionRecord, Vu as FollowUpResponse, Wu as ResolveSessionIdInput, X as ListExtensionAppearanceResponse, Xd as AgentModel, Xu as SessionConversationSources, Yd as AgentInfo, Yu as SessionConversationResponse, Z as ListExtensionCommandsResponse, Zu as SessionQueuedMessagesResponse, _ as CreateProjectInput, _t as ListAutomationTokensResponse, a as RemoveWorktreeResponse, at as BoardViewCreate, c as WorkspaceFileContent, cd as NotificationStatus, ct as AutomationRun, ed as ListNotificationsQuery, ef as ListProjectActivityInput, f as WorkspaceProviderDescriptor, gt as ListAutomationRunEventsResponse, h as UpdateSettingsInput, ht as IssueAutomationTokenResponse, i as ListWorkspaceFilesInput, j as EnableInstalledExtensionResponse, l as WorkspaceFileEntry, ld as UpdateNotificationInput, m as Settings, mt as IssueAutomationTokenInput, n as ListWorkspaceActivityInput, nd as Notification, o as RenameWorkspaceInput, ot as BoardViewUpdate, p as WriteWorkspaceFileInput, pt as CreateAutomationRunInput, qu as SessionAttachment, r as ListWorkspaceActivityResponse, t as CreateWorkspaceInput, td as ListNotificationsResponse, u as WorkspaceFilesResponse, v as Project, y as UpdateProjectInput, z as DispatchExtensionEventInput, zu as CreateSessionInput } from "./index-Cbt2YiR-.js";
|
|
2
|
-
import "./skills-46B897Gi.js";
|
|
3
|
-
import { n as WorkspaceListItem, t as Workspace } from "./index-BU8PNmuX.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/board-views.d.ts
|
|
44
|
-
declare const createBoardViewsClient: (request: RequestFn) => {
|
|
45
|
-
board: (projectId: string, boardId: string) => Promise<{
|
|
46
|
-
id: string;
|
|
47
|
-
title: string;
|
|
48
|
-
extensionId: string;
|
|
49
|
-
fields: {
|
|
50
|
-
id: string;
|
|
51
|
-
label: string;
|
|
52
|
-
kind: "string" | "number" | "status" | "date" | "enum" | "enum-multi" | "user";
|
|
53
|
-
filterable: boolean;
|
|
54
|
-
groupable: boolean;
|
|
55
|
-
sortable: boolean;
|
|
56
|
-
displayable: boolean;
|
|
57
|
-
options?: {
|
|
58
|
-
value: string;
|
|
59
|
-
label: string;
|
|
60
|
-
}[] | undefined;
|
|
61
|
-
}[];
|
|
62
|
-
}>;
|
|
63
|
-
get: (projectId: string, id: string) => Promise<{
|
|
64
|
-
id: string;
|
|
65
|
-
boardId: string;
|
|
66
|
-
title: string;
|
|
67
|
-
settings: {
|
|
68
|
-
viewMode: "board" | "list";
|
|
69
|
-
columnGrouping: string;
|
|
70
|
-
rowGrouping: string;
|
|
71
|
-
ordering: {
|
|
72
|
-
attributeId: string;
|
|
73
|
-
direction: "asc" | "desc";
|
|
74
|
-
};
|
|
75
|
-
displayProperties: string[];
|
|
76
|
-
};
|
|
77
|
-
filters: Record<string, string[]>;
|
|
78
|
-
builtIn: boolean;
|
|
79
|
-
}>;
|
|
80
|
-
boards: (projectId: string) => Promise<{
|
|
81
|
-
id: string;
|
|
82
|
-
title: string;
|
|
83
|
-
extensionId: string;
|
|
84
|
-
fields: {
|
|
85
|
-
id: string;
|
|
86
|
-
label: string;
|
|
87
|
-
kind: "string" | "number" | "status" | "date" | "enum" | "enum-multi" | "user";
|
|
88
|
-
filterable: boolean;
|
|
89
|
-
groupable: boolean;
|
|
90
|
-
sortable: boolean;
|
|
91
|
-
displayable: boolean;
|
|
92
|
-
options?: {
|
|
93
|
-
value: string;
|
|
94
|
-
label: string;
|
|
95
|
-
}[] | undefined;
|
|
96
|
-
}[];
|
|
97
|
-
}[]>;
|
|
98
|
-
list: (projectId: string, boardId: string) => Promise<{
|
|
99
|
-
views: {
|
|
100
|
-
id: string;
|
|
101
|
-
boardId: string;
|
|
102
|
-
title: string;
|
|
103
|
-
settings: {
|
|
104
|
-
viewMode: "board" | "list";
|
|
105
|
-
columnGrouping: string;
|
|
106
|
-
rowGrouping: string;
|
|
107
|
-
ordering: {
|
|
108
|
-
attributeId: string;
|
|
109
|
-
direction: "asc" | "desc";
|
|
110
|
-
};
|
|
111
|
-
displayProperties: string[];
|
|
112
|
-
};
|
|
113
|
-
filters: Record<string, string[]>;
|
|
114
|
-
builtIn: boolean;
|
|
115
|
-
}[];
|
|
116
|
-
defaultViewId: string;
|
|
117
|
-
}>;
|
|
118
|
-
orphaned: (projectId: string) => Promise<{
|
|
119
|
-
id: string;
|
|
120
|
-
boardId: string;
|
|
121
|
-
title: string;
|
|
122
|
-
settings: {
|
|
123
|
-
viewMode: "board" | "list";
|
|
124
|
-
columnGrouping: string;
|
|
125
|
-
rowGrouping: string;
|
|
126
|
-
ordering: {
|
|
127
|
-
attributeId: string;
|
|
128
|
-
direction: "asc" | "desc";
|
|
129
|
-
};
|
|
130
|
-
displayProperties: string[];
|
|
131
|
-
};
|
|
132
|
-
filters: Record<string, string[]>;
|
|
133
|
-
builtIn: boolean;
|
|
134
|
-
}[]>;
|
|
135
|
-
create: (projectId: string, boardId: string, input: BoardViewCreate) => Promise<{
|
|
136
|
-
id: string;
|
|
137
|
-
boardId: string;
|
|
138
|
-
title: string;
|
|
139
|
-
settings: {
|
|
140
|
-
viewMode: "board" | "list";
|
|
141
|
-
columnGrouping: string;
|
|
142
|
-
rowGrouping: string;
|
|
143
|
-
ordering: {
|
|
144
|
-
attributeId: string;
|
|
145
|
-
direction: "asc" | "desc";
|
|
146
|
-
};
|
|
147
|
-
displayProperties: string[];
|
|
148
|
-
};
|
|
149
|
-
filters: Record<string, string[]>;
|
|
150
|
-
builtIn: boolean;
|
|
151
|
-
}>;
|
|
152
|
-
update: (projectId: string, id: string, input: BoardViewUpdate) => Promise<{
|
|
153
|
-
id: string;
|
|
154
|
-
boardId: string;
|
|
155
|
-
title: string;
|
|
156
|
-
settings: {
|
|
157
|
-
viewMode: "board" | "list";
|
|
158
|
-
columnGrouping: string;
|
|
159
|
-
rowGrouping: string;
|
|
160
|
-
ordering: {
|
|
161
|
-
attributeId: string;
|
|
162
|
-
direction: "asc" | "desc";
|
|
163
|
-
};
|
|
164
|
-
displayProperties: string[];
|
|
165
|
-
};
|
|
166
|
-
filters: Record<string, string[]>;
|
|
167
|
-
builtIn: boolean;
|
|
168
|
-
}>;
|
|
169
|
-
delete: (projectId: string, id: string) => Promise<{
|
|
170
|
-
deleted: boolean;
|
|
171
|
-
}>;
|
|
172
|
-
reorder: (projectId: string, boardId: string, viewIds: string[]) => Promise<{
|
|
173
|
-
views: {
|
|
174
|
-
id: string;
|
|
175
|
-
boardId: string;
|
|
176
|
-
title: string;
|
|
177
|
-
settings: {
|
|
178
|
-
viewMode: "board" | "list";
|
|
179
|
-
columnGrouping: string;
|
|
180
|
-
rowGrouping: string;
|
|
181
|
-
ordering: {
|
|
182
|
-
attributeId: string;
|
|
183
|
-
direction: "asc" | "desc";
|
|
184
|
-
};
|
|
185
|
-
displayProperties: string[];
|
|
186
|
-
};
|
|
187
|
-
filters: Record<string, string[]>;
|
|
188
|
-
builtIn: boolean;
|
|
189
|
-
}[];
|
|
190
|
-
defaultViewId: string;
|
|
191
|
-
}>;
|
|
192
|
-
setDefault: (projectId: string, boardId: string, viewId: string | null) => Promise<{
|
|
193
|
-
views: {
|
|
194
|
-
id: string;
|
|
195
|
-
boardId: string;
|
|
196
|
-
title: string;
|
|
197
|
-
settings: {
|
|
198
|
-
viewMode: "board" | "list";
|
|
199
|
-
columnGrouping: string;
|
|
200
|
-
rowGrouping: string;
|
|
201
|
-
ordering: {
|
|
202
|
-
attributeId: string;
|
|
203
|
-
direction: "asc" | "desc";
|
|
204
|
-
};
|
|
205
|
-
displayProperties: string[];
|
|
206
|
-
};
|
|
207
|
-
filters: Record<string, string[]>;
|
|
208
|
-
builtIn: boolean;
|
|
209
|
-
}[];
|
|
210
|
-
defaultViewId: string;
|
|
211
|
-
}>;
|
|
212
|
-
};
|
|
213
|
-
type BoardViewsClient = ReturnType<typeof createBoardViewsClient>;
|
|
214
|
-
//#endregion
|
|
215
|
-
//#region src/client/extensions.d.ts
|
|
216
|
-
type ExtensionClient = {
|
|
217
|
-
enableInstalled(projectId: string, installName: string, request: EnableInstalledExtensionRequest): Promise<EnableInstalledExtensionResponse>;
|
|
218
|
-
listAppearance(projectId: string): Promise<ListExtensionAppearanceResponse>;
|
|
219
|
-
listCommands(projectId: string): Promise<ListExtensionCommandsResponse>;
|
|
220
|
-
listProject(projectId: string): Promise<ListProjectExtensionsResponse>;
|
|
221
|
-
upgradeProject(projectId: string, instanceId: string): Promise<UpgradeProjectExtensionResponse>;
|
|
222
|
-
listConnections(projectId: string): Promise<ListExtensionConnectionsResponse>;
|
|
223
|
-
configureConnection(projectId: string, extensionId: string, connectionId: string, input: ConfigureExtensionConnectionInput): Promise<ExtensionConnectionRecord>;
|
|
224
|
-
checkConnection(projectId: string, extensionId: string, connectionId: string): Promise<ExtensionConnectionRecord>;
|
|
225
|
-
deleteConnection(projectId: string, extensionId: string, connectionId: string): Promise<void>;
|
|
226
|
-
execute(commandId: string, request: CommandExecuteRequest): Promise<CommandExecuteResponse>;
|
|
227
|
-
dispatchEvent(projectId: string, input: DispatchExtensionEventInput): Promise<void>;
|
|
228
|
-
};
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region src/client/filesystem.d.ts
|
|
231
|
-
interface DirectoryEntry {
|
|
232
|
-
name: string;
|
|
233
|
-
path: string;
|
|
234
|
-
isDirectory: boolean;
|
|
235
|
-
}
|
|
236
|
-
declare const createFilesystemClient: (request: RequestFn) => {
|
|
237
|
-
list: (path?: string) => Promise<{
|
|
238
|
-
currentPath: string;
|
|
239
|
-
entries: DirectoryEntry[];
|
|
240
|
-
}>;
|
|
241
|
-
createDirectory: (input: {
|
|
242
|
-
parent_path: string;
|
|
243
|
-
name: string;
|
|
244
|
-
}) => Promise<{
|
|
245
|
-
path: string;
|
|
246
|
-
}>;
|
|
247
|
-
};
|
|
248
|
-
type FilesystemClient = ReturnType<typeof createFilesystemClient>;
|
|
249
|
-
//#endregion
|
|
250
|
-
//#region src/client/notifications.d.ts
|
|
251
|
-
type NotificationsClient = {
|
|
252
|
-
list(projectId: string, query?: ListNotificationsQuery): Promise<ListNotificationsResponse>;
|
|
253
|
-
count(projectId: string, query?: Pick<ListNotificationsQuery, "status" | "priority" | "sourceExtensionId">): Promise<{
|
|
254
|
-
count: number;
|
|
255
|
-
}>;
|
|
256
|
-
get(projectId: string, id: string): Promise<Notification>;
|
|
257
|
-
create(input: CreateNotificationInput): Promise<Notification>;
|
|
258
|
-
update(projectId: string, id: string, input: UpdateNotificationInput): Promise<Notification>;
|
|
259
|
-
markRead(projectId: string, id: string): Promise<Notification>;
|
|
260
|
-
dismiss(projectId: string, id: string): Promise<Notification>;
|
|
261
|
-
markDone(projectId: string, id: string): Promise<Notification>;
|
|
262
|
-
snooze(projectId: string, id: string, until: string): Promise<Notification>;
|
|
263
|
-
resolveByDedupeKey(projectId: string, input: {
|
|
264
|
-
dedupeKey: string;
|
|
265
|
-
status?: Extract<NotificationStatus, "done" | "dismissed" | "expired">;
|
|
266
|
-
}): Promise<{
|
|
267
|
-
resolved: number;
|
|
268
|
-
notifications: Notification[];
|
|
269
|
-
}>;
|
|
270
|
-
};
|
|
271
|
-
//#endregion
|
|
272
|
-
//#region src/client/projects.d.ts
|
|
273
|
-
type ProjectClient = {
|
|
274
|
-
list(): Promise<Project[]>;
|
|
275
|
-
get(projectId: string): Promise<Project>;
|
|
276
|
-
create(input: CreateProjectInput): Promise<Project>;
|
|
277
|
-
attachInitialWorkspace(projectId: string, input: CreateProjectInput["initial_workspace"]): Promise<Workspace>;
|
|
278
|
-
retrySetup(projectId: string): Promise<Workspace>;
|
|
279
|
-
update(projectId: string, input: UpdateProjectInput): Promise<Project>;
|
|
280
|
-
delete(projectId: string): Promise<void>;
|
|
281
|
-
listActivity(projectId: string, input?: ListProjectActivityInput): Promise<ListActivityResponse>;
|
|
282
|
-
};
|
|
283
|
-
//#endregion
|
|
284
|
-
//#region src/client/runtime.d.ts
|
|
285
|
-
type RuntimeClient = {
|
|
286
|
-
provisionBrowserSession: () => Promise<void>;
|
|
287
|
-
};
|
|
288
|
-
declare const createRuntimeClient: (request: RequestFn) => RuntimeClient;
|
|
289
|
-
//#endregion
|
|
290
|
-
//#region src/client/sse.d.ts
|
|
291
|
-
type SseEvent = {
|
|
292
|
-
event: string;
|
|
293
|
-
data: string;
|
|
294
|
-
};
|
|
295
|
-
//#endregion
|
|
296
|
-
//#region src/client/sessions.d.ts
|
|
297
|
-
type ListSessionsInput = {
|
|
298
|
-
status?: string;
|
|
299
|
-
agent?: string;
|
|
300
|
-
workspaceId?: string;
|
|
301
|
-
archived?: boolean;
|
|
302
|
-
};
|
|
303
|
-
type SessionClient = {
|
|
304
|
-
list(projectId: string, input?: ListSessionsInput): Promise<Session[]>;
|
|
305
|
-
get(sessionId: string): Promise<Session>;
|
|
306
|
-
uploadAttachment(projectId: string, input: {
|
|
307
|
-
name: string;
|
|
308
|
-
data: Uint8Array | ArrayBuffer;
|
|
309
|
-
mimeType?: string | null;
|
|
310
|
-
}): Promise<SessionAttachment>;
|
|
311
|
-
deleteAttachment(projectId: string, fileId: string): Promise<void>;
|
|
312
|
-
create(input: CreateSessionInput): Promise<Session>;
|
|
313
|
-
archive(sessionId: string): Promise<void>;
|
|
314
|
-
followUp(sessionId: string, input: FollowUpInput): Promise<FollowUpResponse>;
|
|
315
|
-
approve(sessionId: string, input: ApprovalInput): Promise<void>;
|
|
316
|
-
getConversation(sessionId: string, signal?: AbortSignal): Promise<SessionConversationResponse>;
|
|
317
|
-
getConversationSources(sessionId: string, signal?: AbortSignal): Promise<SessionConversationSources>;
|
|
318
|
-
getQueuedMessages(sessionId: string, options?: {
|
|
319
|
-
signal?: AbortSignal;
|
|
320
|
-
}): Promise<SessionQueuedMessagesResponse>;
|
|
321
|
-
resolveSessionId(input: ResolveSessionIdInput): Promise<ResolveSessionIdResponse>;
|
|
322
|
-
updateStatus(sessionId: string, status: string): Promise<Session>;
|
|
323
|
-
listActivity(sessionId: string, input?: ListSessionActivityInput): Promise<ListSessionActivityResponse>;
|
|
324
|
-
stream(sessionId: string, onEvent: (event: SseEvent) => void, options?: {
|
|
325
|
-
signal?: AbortSignal;
|
|
326
|
-
}): Promise<void>;
|
|
327
|
-
connectStream(sessionId: string, handlers: SessionStreamHandlers): SessionStreamConnection;
|
|
328
|
-
};
|
|
329
|
-
type SessionStreamHandlers = {
|
|
330
|
-
onReady?: (data: unknown) => void;
|
|
331
|
-
onPatch?: (data: unknown) => void;
|
|
332
|
-
onApprovalRequest?: (data: unknown) => void;
|
|
333
|
-
onQueuedMessages?: (data: SessionQueuedMessagesResponse | {
|
|
334
|
-
error: string;
|
|
335
|
-
}) => void;
|
|
336
|
-
onEnd?: (data: unknown) => void;
|
|
337
|
-
onError?: (error: unknown) => void;
|
|
338
|
-
};
|
|
339
|
-
type SessionStreamConnection = {
|
|
340
|
-
close: () => void;
|
|
341
|
-
};
|
|
342
|
-
//#endregion
|
|
343
|
-
//#region src/client/settings.d.ts
|
|
344
|
-
type SettingsClient = {
|
|
345
|
-
get(): Promise<Settings>;
|
|
346
|
-
update(input: UpdateSettingsInput): Promise<Settings>;
|
|
347
|
-
};
|
|
348
|
-
//#endregion
|
|
349
|
-
//#region src/client/skills.d.ts
|
|
350
|
-
type SkillClient = {
|
|
351
|
-
list(projectId: string): Promise<Skill[]>;
|
|
352
|
-
get(projectId: string, skillId: string): Promise<SkillWithContent>;
|
|
353
|
-
updatePreferences(projectId: string, skillName: string, input: UpdateSkillInput): Promise<Skill>;
|
|
354
|
-
};
|
|
355
|
-
//#endregion
|
|
356
|
-
//#region src/client/sync.d.ts
|
|
357
|
-
type SyncRow = {
|
|
358
|
-
id: string;
|
|
359
|
-
[key: string]: unknown;
|
|
360
|
-
};
|
|
361
|
-
type SyncWriter = {
|
|
362
|
-
truncateAndWrite: (rows: SyncRow[]) => void;
|
|
363
|
-
upsert: (row: SyncRow) => void;
|
|
364
|
-
remove: (id: string) => void;
|
|
365
|
-
};
|
|
366
|
-
type SyncWriterProvider = {
|
|
367
|
-
getWriter: (table: string) => SyncWriter | undefined;
|
|
368
|
-
};
|
|
369
|
-
type SyncConnection = {
|
|
370
|
-
close: () => void;
|
|
371
|
-
connected: boolean;
|
|
372
|
-
};
|
|
373
|
-
type StartSyncInput = SyncWriterProvider & {
|
|
374
|
-
/** Called after the initial snapshot, or when a cursor-based connection resumes. */
|
|
375
|
-
onConnected?: () => void;
|
|
376
|
-
onDisconnected?: () => void;
|
|
377
|
-
onConnectionLost?: () => void;
|
|
378
|
-
heartbeatIntervalMs?: number;
|
|
379
|
-
heartbeatThreshold?: number;
|
|
380
|
-
reconnectDelayMs?: number;
|
|
381
|
-
};
|
|
382
|
-
type SyncClient = {
|
|
383
|
-
start: (input: StartSyncInput) => SyncConnection;
|
|
384
|
-
};
|
|
385
|
-
declare const parseSyncDeleteEvent: (data: string) => {
|
|
386
|
-
table: string;
|
|
387
|
-
id: string;
|
|
388
|
-
seq: number;
|
|
389
|
-
};
|
|
390
|
-
declare const applySyncEvent: (event: string, data: string, writers: SyncWriterProvider) => number | null;
|
|
391
|
-
//#endregion
|
|
392
|
-
//#region src/client/workspaces.d.ts
|
|
393
|
-
type WorkspaceClient = {
|
|
394
|
-
listProviders(projectId: string): Promise<WorkspaceProviderDescriptor[]>;
|
|
395
|
-
list(projectId: string): Promise<WorkspaceListItem[]>;
|
|
396
|
-
getByShorthand(projectId: string, shorthand: string): Promise<Workspace>;
|
|
397
|
-
create(input: CreateWorkspaceInput): Promise<Workspace>;
|
|
398
|
-
rename(workspaceId: string, input: RenameWorkspaceInput): Promise<Workspace>;
|
|
399
|
-
listActivity(workspaceId: string, input?: ListWorkspaceActivityInput): Promise<ListWorkspaceActivityResponse>;
|
|
400
|
-
listFiles(workspaceId: string, input?: ListWorkspaceFilesInput, options?: {
|
|
401
|
-
signal?: AbortSignal;
|
|
402
|
-
}): Promise<WorkspaceFilesResponse>;
|
|
403
|
-
createDirectory(workspaceId: string, path: string): Promise<WorkspaceFileEntry>;
|
|
404
|
-
createFile(workspaceId: string, path: string, input: WriteWorkspaceFileInput): Promise<WorkspaceFileContent>;
|
|
405
|
-
readFile(workspaceId: string, path: string, options?: {
|
|
406
|
-
signal?: AbortSignal;
|
|
407
|
-
}): Promise<WorkspaceFileContent>;
|
|
408
|
-
writeFile(workspaceId: string, path: string, input: WriteWorkspaceFileInput): Promise<WorkspaceFileContent>;
|
|
409
|
-
moveEntry(workspaceId: string, path: string, destinationPath: string): Promise<void>;
|
|
410
|
-
deleteEntry(workspaceId: string, path: string): Promise<void>;
|
|
411
|
-
removeWorktree(workspaceId: string): Promise<RemoveWorktreeResponse>;
|
|
412
|
-
delete(workspaceId: string): Promise<void>;
|
|
413
|
-
};
|
|
414
|
-
//#endregion
|
|
415
|
-
//#region src/client/client.d.ts
|
|
416
|
-
type PstdioClient = {
|
|
417
|
-
views: BoardViewsClient;
|
|
418
|
-
projects: ProjectClient;
|
|
419
|
-
filesystem: FilesystemClient;
|
|
420
|
-
workspaces: WorkspaceClient;
|
|
421
|
-
sessions: SessionClient;
|
|
422
|
-
skills: SkillClient;
|
|
423
|
-
agents: AgentClient;
|
|
424
|
-
automation: AutomationClient;
|
|
425
|
-
notifications: NotificationsClient;
|
|
426
|
-
extensions: ExtensionClient;
|
|
427
|
-
settings: SettingsClient;
|
|
428
|
-
sync: SyncClient;
|
|
429
|
-
runtime: RuntimeClient;
|
|
430
|
-
};
|
|
431
|
-
declare const createClient: (options?: ClientOptions) => PstdioClient;
|
|
432
|
-
//#endregion
|
|
433
|
-
export { PstdioApiError as A, DirectoryEntry as C, AutomationClient as D, BoardViewsClient as E, RequestOptions as M, createRequest as N, AgentClient 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, RequestFn as j, ClientOptions 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 };
|
|
434
|
-
export {};
|