@pstdio/sdk 0.37.0 → 0.39.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 +7 -5
- package/dist/api/index.js +62 -7
- package/dist/api.d.ts +4 -4
- package/dist/client/index.js +179 -83
- package/dist/client.d.ts +2 -2
- package/dist/data.d.ts +1 -1
- package/dist/extensions/index.js +6 -8
- package/dist/extensions.d.ts +2 -2
- package/dist/hooks.d.ts +4 -4
- package/dist/{index-DZSUI5-9.d.ts → index-CF8VtORE.d.ts} +178 -7
- package/dist/{index-B0-v8E14.d.ts → index-Cq80VGQo.d.ts} +1 -1
- package/dist/{index-CnOTGr_I.d.ts → index-Dd4tqVV7.d.ts} +2288 -1936
- package/dist/resources/index.js +62 -7
- package/dist/resources.d.ts +2 -2
- package/dist/sessions-C-D1oPr0.d.ts +2 -0
- package/dist/skills-C-D1oPr0.d.ts +2 -0
- package/dist/testing.d.ts +1 -1
- package/package.json +1 -1
- package/dist/sessions-CkEvTavd.d.ts +0 -2
- package/dist/skills-CkEvTavd.d.ts +0 -2
package/README.md
CHANGED
|
@@ -105,6 +105,8 @@ readiness and file capabilities. Remote workspaces never fall back to local file
|
|
|
105
105
|
`ctx.workspaces.listProviders()` returns available providers, their optional `icon`, and their parameters.
|
|
106
106
|
Render these declared parameters after the user selects a workspace type. The Git
|
|
107
107
|
provider supplies a **Base branch** selection; cloud providers supply their own fields.
|
|
108
|
+
A command that creates a workspace can declare `params.workspace({ providers })`. The
|
|
109
|
+
dashboard then renders this same form, and the command receives `{ providerId, params }`.
|
|
108
110
|
Local setup failures reject creation with the saved workspace ID and setup error.
|
|
109
111
|
The workspace remains available for diagnosis and retry.
|
|
110
112
|
Workspace context records expose `root_path` for a local directory. Remote workspaces have no local root.
|
|
@@ -116,8 +118,8 @@ Directory creation accepts one child name under an existing parent.
|
|
|
116
118
|
Webviews can set `workspaceId` in `createWebviewClient(host, { workspaceId })`
|
|
117
119
|
to run commands in that workspace. The host validates project ownership.
|
|
118
120
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
`EXTENSION_API_VERSION` is the current host API version, such as `0.1.0`. Declare a caret
|
|
122
|
+
range in `engines.pstdio`, such as `^0.1.0`, so the extension keeps loading across additive
|
|
123
|
+
host releases. Raise the minimum only when the extension uses a newer API. On `0.x`, a new
|
|
124
|
+
minor is a breaking release. See
|
|
125
|
+
[API versioning](../../documentation/references/extensions/0014-api-versioning.md).
|
package/dist/api/index.js
CHANGED
|
@@ -6781,6 +6781,7 @@ var controlParamSchema = discriminatedUnion("type", [
|
|
|
6781
6781
|
...base,
|
|
6782
6782
|
...selection,
|
|
6783
6783
|
type: literal("selection"),
|
|
6784
|
+
allowCustomValues: boolean2().optional(),
|
|
6784
6785
|
defaultValue: selectionValue,
|
|
6785
6786
|
options: array(selectionOption),
|
|
6786
6787
|
multiSelect: boolean2().optional(),
|
|
@@ -6929,6 +6930,20 @@ var extensionControlsRendererRecordSchema = extensionRendererRecordBaseSchema.ex
|
|
|
6929
6930
|
defaultValues: controlValuesSchema.optional()
|
|
6930
6931
|
});
|
|
6931
6932
|
|
|
6933
|
+
// ../pstdio-api-contracts/src/extensions/view-toolbar-action.ts
|
|
6934
|
+
var viewToolbarActionSchema = object({
|
|
6935
|
+
id: string2(),
|
|
6936
|
+
label: localizableStringSchema,
|
|
6937
|
+
icon: string2().optional(),
|
|
6938
|
+
presentation: _enum(["primary", "secondary"]).optional(),
|
|
6939
|
+
params: jsonObjectSchema.optional(),
|
|
6940
|
+
input: extensionParamObjectSchema.optional(),
|
|
6941
|
+
submitLabel: string2().optional(),
|
|
6942
|
+
when: string2().optional(),
|
|
6943
|
+
disabled: boolean2().optional()
|
|
6944
|
+
});
|
|
6945
|
+
var viewToolbarActionRecordSchema = viewToolbarActionSchema.extend({ commandId: string2() });
|
|
6946
|
+
|
|
6932
6947
|
// ../pstdio-api-contracts/src/extensions/data-table-renderer.ts
|
|
6933
6948
|
var themeColorSchema = object({
|
|
6934
6949
|
light: string2(),
|
|
@@ -6975,6 +6990,7 @@ var selectionActionSchema = object({
|
|
|
6975
6990
|
commandId: string2()
|
|
6976
6991
|
});
|
|
6977
6992
|
var extensionDataTableRendererRecordSchema = extensionRendererRecordBaseSchema.extend({
|
|
6993
|
+
toolbarActions: array(viewToolbarActionRecordSchema).optional(),
|
|
6978
6994
|
columns: array(dataTableRendererColumnSchema).optional(),
|
|
6979
6995
|
queryHandlerId: string2(),
|
|
6980
6996
|
selectionMode: _enum(["none", "multiple"]).optional(),
|
|
@@ -7067,6 +7083,7 @@ var extensionKanbanRendererRowActionSchema = object({
|
|
|
7067
7083
|
destructive: boolean2().optional()
|
|
7068
7084
|
});
|
|
7069
7085
|
var extensionKanbanRendererRecordSchema = extensionRendererRecordBaseSchema.extend({
|
|
7086
|
+
toolbarActions: array(viewToolbarActionRecordSchema).optional(),
|
|
7070
7087
|
extensionInstanceId: string2().optional(),
|
|
7071
7088
|
attributes: array(kanbanRendererAttributeSchema).optional(),
|
|
7072
7089
|
queryHandlerId: string2(),
|
|
@@ -7275,15 +7292,17 @@ var webviewBodySchema = object({ kind: literal("webview"), webview: workbenchExt
|
|
|
7275
7292
|
var treeBodySchema = extensionTreeRendererRecordSchema.omit(rendererBaseOmissions).extend({ kind: literal("tree") });
|
|
7276
7293
|
var fileBodySchema = extensionFileRendererRecordSchema.omit(rendererBaseOmissions).extend({ kind: literal("file") });
|
|
7277
7294
|
var controlsBodySchema = extensionControlsRendererRecordSchema.omit(rendererBaseOmissions).extend({ kind: literal("controls") });
|
|
7278
|
-
var kanbanBodySchema = extensionKanbanRendererRecordSchema.omit({ ...rendererBaseOmissions, createRow: true, rowActions: true }).extend({
|
|
7295
|
+
var kanbanBodySchema = extensionKanbanRendererRecordSchema.omit({ ...rendererBaseOmissions, createRow: true, rowActions: true, toolbarActions: true }).extend({
|
|
7279
7296
|
kind: literal("kanban"),
|
|
7280
7297
|
createRow: kanbanCreateRowSchema.optional(),
|
|
7281
|
-
rowActions: array(commandActionSchema).optional()
|
|
7298
|
+
rowActions: array(commandActionSchema).optional(),
|
|
7299
|
+
toolbarActions: array(viewToolbarActionSchema.extend({ command: commandRefSchema })).optional()
|
|
7282
7300
|
});
|
|
7283
|
-
var dataTableBodySchema = extensionDataTableRendererRecordSchema.omit({ ...rendererBaseOmissions, selectionActions: true, rowActions: true }).extend({
|
|
7301
|
+
var dataTableBodySchema = extensionDataTableRendererRecordSchema.omit({ ...rendererBaseOmissions, selectionActions: true, rowActions: true, toolbarActions: true }).extend({
|
|
7284
7302
|
kind: literal("dataTable"),
|
|
7285
7303
|
selectionActions: array(commandActionSchema).optional(),
|
|
7286
|
-
rowActions: array(commandActionSchema).optional()
|
|
7304
|
+
rowActions: array(commandActionSchema).optional(),
|
|
7305
|
+
toolbarActions: array(viewToolbarActionSchema.extend({ command: commandRefSchema })).optional()
|
|
7287
7306
|
});
|
|
7288
7307
|
var workbenchExtensionViewBodySchema = discriminatedUnion("kind", [
|
|
7289
7308
|
webviewBodySchema,
|
|
@@ -7359,6 +7378,7 @@ var workbenchExtensionResourceKindRecordSchema = object({
|
|
|
7359
7378
|
extensionId: string2(),
|
|
7360
7379
|
label: localizableStringSchema.optional(),
|
|
7361
7380
|
icon: string2().optional(),
|
|
7381
|
+
resolveCommand: string2().optional(),
|
|
7362
7382
|
menuSlots: array(object({
|
|
7363
7383
|
id: string2(),
|
|
7364
7384
|
placement: _enum(["header-primary", "header-overflow", "context-menu"]),
|
|
@@ -7659,10 +7679,45 @@ var automationRunEventSchema = object({
|
|
|
7659
7679
|
createdAt: string2()
|
|
7660
7680
|
});
|
|
7661
7681
|
var listAutomationRunEventsResponseSchema = object({ events: array(automationRunEventSchema) });
|
|
7682
|
+
// ../pstdio-api-contracts/src/board-views.ts
|
|
7683
|
+
var boardFieldSchema = object({
|
|
7684
|
+
id: string2(),
|
|
7685
|
+
label: string2(),
|
|
7686
|
+
kind: _enum(["enum", "enum-multi", "status", "string", "date", "number", "user"]),
|
|
7687
|
+
filterable: boolean2(),
|
|
7688
|
+
groupable: boolean2(),
|
|
7689
|
+
sortable: boolean2(),
|
|
7690
|
+
displayable: boolean2(),
|
|
7691
|
+
options: array(object({ value: string2(), label: string2() })).optional()
|
|
7692
|
+
});
|
|
7693
|
+
var boardSummarySchema = object({
|
|
7694
|
+
id: string2(),
|
|
7695
|
+
title: string2(),
|
|
7696
|
+
extensionId: string2(),
|
|
7697
|
+
fields: array(boardFieldSchema)
|
|
7698
|
+
});
|
|
7699
|
+
var boardFiltersSchema = record(string2(), array(string2()));
|
|
7700
|
+
var boardViewSchema = object({
|
|
7701
|
+
id: string2(),
|
|
7702
|
+
boardId: string2(),
|
|
7703
|
+
title: string2(),
|
|
7704
|
+
settings: kanbanRendererSettingsSchema,
|
|
7705
|
+
filters: boardFiltersSchema,
|
|
7706
|
+
builtIn: boolean2()
|
|
7707
|
+
});
|
|
7708
|
+
var boardViewsSchema = object({ views: array(boardViewSchema), defaultViewId: string2() });
|
|
7709
|
+
var boardViewUpdateSchema = object({
|
|
7710
|
+
title: string2().trim().min(1).optional(),
|
|
7711
|
+
settings: kanbanRendererSettingsSchema.partial().optional(),
|
|
7712
|
+
filters: boardFiltersSchema.optional()
|
|
7713
|
+
}).strict();
|
|
7714
|
+
var boardViewCreateSchema = boardViewUpdateSchema.extend({
|
|
7715
|
+
title: string2().trim().min(1),
|
|
7716
|
+
copyFrom: string2().optional()
|
|
7717
|
+
});
|
|
7662
7718
|
// ../pstdio-api-contracts/src/extension-kernel/api-versions.ts
|
|
7663
7719
|
var numericIdentifier = "(?:0|[1-9]\\d*)";
|
|
7664
|
-
var
|
|
7665
|
-
var exactVersion = new RegExp(`^${numericIdentifier}\\.${numericIdentifier}\\.${numericIdentifier}(?:-${prereleaseIdentifier}(?:\\.${prereleaseIdentifier})*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$`);
|
|
7720
|
+
var caretTerm = new RegExp(`^\\^(${numericIdentifier}\\.${numericIdentifier}\\.${numericIdentifier})$`);
|
|
7666
7721
|
// ../pstdio-api-contracts/src/extension-kernel/builtin-refs.ts
|
|
7667
7722
|
var hostRef = (kind, id) => ({ extensionId: "pstdio", kind, id });
|
|
7668
7723
|
var workbenchModes = {
|
|
@@ -7916,7 +7971,7 @@ var packageAsset = (path, baseUrl) => ({
|
|
|
7916
7971
|
baseUrl
|
|
7917
7972
|
});
|
|
7918
7973
|
// ../pstdio-api-contracts/src/extension-kernel/types/extension.ts
|
|
7919
|
-
var EXTENSION_API_VERSION = "1.0
|
|
7974
|
+
var EXTENSION_API_VERSION = "0.1.0";
|
|
7920
7975
|
// ../pstdio-api-contracts/src/extension-kernel/types/webview-capabilities.ts
|
|
7921
7976
|
var WEBVIEW_HOST_CAPABILITY_VERSION = 1;
|
|
7922
7977
|
var WEBVIEW_DECLARABLE_CAPABILITIES = [
|
package/dist/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as WorkbenchExtensionMetadata, $
|
|
2
|
-
import "./sessions-
|
|
3
|
-
import "./skills-
|
|
1
|
+
import { $ as WorkbenchExtensionMetadata, $u as NotificationActorType, B as ConfigureExtensionConnectionInput, Bu as ResolveSessionIdResponse, C as ExtensionSettingsPanelRecord, D as ExtensionCommandPaletteResourceRecord, E as ExtensionKeybindingRecord, F as ProjectExtensionInstance, Fu as FollowUpInput, G as LocalizableString, Gu as SessionConversationSources, H as ListExtensionConnectionsResponse, Hu as SessionAttachment, I as UpgradeProjectExtensionResponse, It as TerminalHostEvent, J as ExtensionMenuContribution, Ju as CreateNotificationInput, K as ExtensionCommandPaletteContribution, Ku as SessionQueuedMessagesResponse, L as CommandExecuteRequest, Lt as TerminalSessionOperation, M as InstallMarketplaceExtensionResponse, Mu as UpdateSkillInput, N as ListProjectExtensionsResponse, Nu as ApprovalInput, O as WorkbenchExtensionCommandPaletteResourceRecord, P as MarketplaceExtension, Pu as CreateSessionInput, Q as WorkbenchExtensionHarnessRecord, Qu as NotificationAction, R as CommandExecuteResponse, Rt as TerminalSessionRequest, S as ExtensionSettingValueRecord, T as UpdateExtensionSettingRequest, U as ExtensionDiagnostic, Uu as SessionAttachmentRef, V as ExtensionConnectionRecord, W as ExtensionRecord, Wu as SessionConversationResponse, X as ListExtensionAppearanceResponse, Xu as ListNotificationsResponse, Y as WorkbenchExtensionAutomationRecord, Yu as ListNotificationsQuery, Z as ListExtensionCommandsResponse, Zu as Notification, _ as CreateProjectInput, _t as ListAutomationTokensResponse, a as RemoveWorktreeResponse$1, at as BoardViewCreate, c as WorkspaceFileContent$1, ct as AutomationRun, dt as AutomationRunStatus, ed as NotificationKind, et as WorkbenchExtensionViewBody, f as WorkspaceProviderDescriptor, ft as AutomationTokenRecord, g as sessionAttachmentMimeTypesByExtension, gt as ListAutomationRunEventsResponse, h as UpdateSettingsInput, ht as IssueAutomationTokenResponse, i as ListWorkspaceFilesInput$1, id as UpdateNotificationInput, it as BoardView, k as AddLocalExtensionFolderResponse, l as WorkspaceFileEntry$1, lt as AutomationRunError, m as Settings, mt as IssueAutomationTokenInput, nd as NotificationPriority, nt as BoardField, o as RenameWorkspaceInput$1, ot as BoardViewUpdate, p as WriteWorkspaceFileInput$1, pt as CreateAutomationRunInput, q as ExtensionCommandRecord, rd as NotificationStatus, rt as BoardSummary, st as BoardViews, t as CreateWorkspaceInput$1, td as NotificationOrigin, tt as WorkbenchExtensionViewRecord, u as WorkspaceFilesResponse$1, ud as ResourceRef, ut as AutomationRunEvent, w as ListExtensionSettingsResponse, x as ExtensionSettingDefinitionRecord, y as UpdateProjectInput, zt as TerminalSessionResult, zu as ResolveSessionIdInput } from "./index-Dd4tqVV7.js";
|
|
2
|
+
import "./sessions-C-D1oPr0.js";
|
|
3
|
+
import "./skills-C-D1oPr0.js";
|
|
4
4
|
//#region src/api/workspaces.d.ts
|
|
5
5
|
type CreateWorkspaceInput = CreateWorkspaceInput$1;
|
|
6
6
|
type RemoveWorktreeResponse = RemoveWorktreeResponse$1;
|
|
@@ -11,5 +11,5 @@ type WorkspaceFileEntry = WorkspaceFileEntry$1;
|
|
|
11
11
|
type WorkspaceFilesResponse = WorkspaceFilesResponse$1;
|
|
12
12
|
type WriteWorkspaceFileInput = WriteWorkspaceFileInput$1;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { type AddLocalExtensionFolderResponse, type ApprovalInput, type AutomationRun, type AutomationRunError, type AutomationRunEvent, type AutomationRunStatus, type AutomationTokenRecord, type CommandExecuteRequest, type CommandExecuteResponse, type ConfigureExtensionConnectionInput, type CreateAutomationRunInput, type CreateNotificationInput, type CreateProjectInput, type CreateSessionInput, type CreateWorkspaceInput, type ExtensionCommandPaletteContribution, type ExtensionCommandPaletteResourceRecord, type ExtensionCommandRecord, type ExtensionConnectionRecord, type ExtensionDiagnostic, type ExtensionKeybindingRecord, type ExtensionMenuContribution, type ExtensionRecord, type ExtensionSettingDefinitionRecord, type ExtensionSettingValueRecord, type ExtensionSettingsPanelRecord, type FollowUpInput, type InstallMarketplaceExtensionResponse, type IssueAutomationTokenInput, type IssueAutomationTokenResponse, type ListAutomationRunEventsResponse, type ListAutomationTokensResponse, type ListExtensionAppearanceResponse, type ListExtensionCommandsResponse, type ListExtensionConnectionsResponse, type ListExtensionSettingsResponse, type ListNotificationsQuery, type ListNotificationsResponse, type ListProjectExtensionsResponse, type ListWorkspaceFilesInput, type LocalizableString, type MarketplaceExtension, type Notification, type NotificationAction, type NotificationActorType, type NotificationKind, type NotificationOrigin, type NotificationPriority, type NotificationStatus, type ProjectExtensionInstance, type RemoveWorktreeResponse, type RenameWorkspaceInput, type ResolveSessionIdInput, type ResolveSessionIdResponse, type ResourceRef, type SessionAttachment, type SessionAttachmentRef, type SessionConversationResponse, type SessionConversationSources, type SessionQueuedMessagesResponse, type Settings, type TerminalHostEvent, type TerminalSessionOperation, type TerminalSessionRequest, type TerminalSessionResult, type UpdateExtensionSettingRequest, type UpdateNotificationInput, type UpdateProjectInput, type UpdateSettingsInput, type UpdateSkillInput, type UpgradeProjectExtensionResponse, type WorkbenchExtensionAutomationRecord, type WorkbenchExtensionCommandPaletteResourceRecord, type WorkbenchExtensionHarnessRecord, type WorkbenchExtensionMetadata, type WorkbenchExtensionViewBody, type WorkbenchExtensionViewRecord, type WorkspaceFileContent, type WorkspaceFileEntry, type WorkspaceFilesResponse, type WorkspaceProviderDescriptor, type WriteWorkspaceFileInput, sessionAttachmentMimeTypesByExtension };
|
|
14
|
+
export { type AddLocalExtensionFolderResponse, type ApprovalInput, type AutomationRun, type AutomationRunError, type AutomationRunEvent, type AutomationRunStatus, type AutomationTokenRecord, type BoardField, type BoardSummary, type BoardView, type BoardViewCreate, type BoardViewUpdate, type BoardViews, type CommandExecuteRequest, type CommandExecuteResponse, type ConfigureExtensionConnectionInput, type CreateAutomationRunInput, type CreateNotificationInput, type CreateProjectInput, type CreateSessionInput, type CreateWorkspaceInput, type ExtensionCommandPaletteContribution, type ExtensionCommandPaletteResourceRecord, type ExtensionCommandRecord, type ExtensionConnectionRecord, type ExtensionDiagnostic, type ExtensionKeybindingRecord, type ExtensionMenuContribution, type ExtensionRecord, type ExtensionSettingDefinitionRecord, type ExtensionSettingValueRecord, type ExtensionSettingsPanelRecord, type FollowUpInput, type InstallMarketplaceExtensionResponse, type IssueAutomationTokenInput, type IssueAutomationTokenResponse, type ListAutomationRunEventsResponse, type ListAutomationTokensResponse, type ListExtensionAppearanceResponse, type ListExtensionCommandsResponse, type ListExtensionConnectionsResponse, type ListExtensionSettingsResponse, type ListNotificationsQuery, type ListNotificationsResponse, type ListProjectExtensionsResponse, type ListWorkspaceFilesInput, type LocalizableString, type MarketplaceExtension, type Notification, type NotificationAction, type NotificationActorType, type NotificationKind, type NotificationOrigin, type NotificationPriority, type NotificationStatus, type ProjectExtensionInstance, type RemoveWorktreeResponse, type RenameWorkspaceInput, type ResolveSessionIdInput, type ResolveSessionIdResponse, type ResourceRef, type SessionAttachment, type SessionAttachmentRef, type SessionConversationResponse, type SessionConversationSources, type SessionQueuedMessagesResponse, type Settings, type TerminalHostEvent, type TerminalSessionOperation, type TerminalSessionRequest, type TerminalSessionResult, type UpdateExtensionSettingRequest, type UpdateNotificationInput, type UpdateProjectInput, type UpdateSettingsInput, type UpdateSkillInput, type UpgradeProjectExtensionResponse, type WorkbenchExtensionAutomationRecord, type WorkbenchExtensionCommandPaletteResourceRecord, type WorkbenchExtensionHarnessRecord, type WorkbenchExtensionMetadata, type WorkbenchExtensionViewBody, type WorkbenchExtensionViewRecord, type WorkspaceFileContent, type WorkspaceFileEntry, type WorkspaceFilesResponse, type WorkspaceProviderDescriptor, type WriteWorkspaceFileInput, sessionAttachmentMimeTypesByExtension };
|
|
15
15
|
export {};
|
package/dist/client/index.js
CHANGED
|
@@ -19,6 +19,23 @@ var createAutomationClient = (request) => ({
|
|
|
19
19
|
cancelRun: (projectId, runId) => request(`/v1/projects/${projectId}/automation-runs/${encodeURIComponent(runId)}/cancel`, { method: "POST" })
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
+
// src/client/board-views.ts
|
|
23
|
+
var projectPath = (id) => `/v1/projects/${encodeURIComponent(id)}`;
|
|
24
|
+
var boardPath = (projectId, boardId) => `${projectPath(projectId)}/boards/${encodeURIComponent(boardId)}/views`;
|
|
25
|
+
var viewPath = (projectId, id) => `${projectPath(projectId)}/board-views/${encodeURIComponent(id)}`;
|
|
26
|
+
var createBoardViewsClient = (request) => ({
|
|
27
|
+
board: (projectId, boardId) => request(`${projectPath(projectId)}/boards/${encodeURIComponent(boardId)}`),
|
|
28
|
+
get: (projectId, id) => request(viewPath(projectId, id)),
|
|
29
|
+
boards: (projectId) => request(`${projectPath(projectId)}/boards`),
|
|
30
|
+
list: (projectId, boardId) => request(boardPath(projectId, boardId)),
|
|
31
|
+
orphaned: (projectId) => request(`${projectPath(projectId)}/board-views?orphaned=true`),
|
|
32
|
+
create: (projectId, boardId, input) => request(boardPath(projectId, boardId), { method: "POST", body: input }),
|
|
33
|
+
update: (projectId, id, input) => request(viewPath(projectId, id), { method: "PATCH", body: input }),
|
|
34
|
+
delete: (projectId, id) => request(viewPath(projectId, id), { method: "DELETE" }),
|
|
35
|
+
reorder: (projectId, boardId, viewIds) => request(`${boardPath(projectId, boardId)}/order`, { method: "PUT", body: { viewIds } }),
|
|
36
|
+
setDefault: (projectId, boardId, viewId) => request(`${boardPath(projectId, boardId)}/default`, { method: "PUT", body: { viewId } })
|
|
37
|
+
});
|
|
38
|
+
|
|
22
39
|
// src/client/extensions.ts
|
|
23
40
|
var createExtensionClient = (request) => ({
|
|
24
41
|
enableInstalled: (projectId, installName, body) => request(`/v1/projects/${projectId}/extensions/installed/${encodeURIComponent(installName)}/enable`, {
|
|
@@ -281,6 +298,97 @@ var readSseStream = async (body, onEvent, options = {}) => {
|
|
|
281
298
|
}
|
|
282
299
|
};
|
|
283
300
|
|
|
301
|
+
// src/client/session-stream.ts
|
|
302
|
+
var createSessionStreamTransport = (request, clientOptions) => {
|
|
303
|
+
const subscriptions = new Map;
|
|
304
|
+
let connection;
|
|
305
|
+
const subscribe = (connectionId, id, subscription) => {
|
|
306
|
+
subscription.started = request(`/v1/session-stream/${connectionId}/subscriptions`, {
|
|
307
|
+
method: "POST",
|
|
308
|
+
body: { subscription_id: id, session_id: subscription.sessionId }
|
|
309
|
+
}).then(() => {}, (error) => {
|
|
310
|
+
if (subscriptions.get(id) !== subscription)
|
|
311
|
+
return;
|
|
312
|
+
release(id, false);
|
|
313
|
+
subscription.onError(error);
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
const release = (id, notifyServer) => {
|
|
317
|
+
const started = subscriptions.get(id)?.started;
|
|
318
|
+
subscriptions.delete(id);
|
|
319
|
+
if (!connection)
|
|
320
|
+
return;
|
|
321
|
+
if (subscriptions.size === 0) {
|
|
322
|
+
connection.controller.abort();
|
|
323
|
+
connection = undefined;
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
if (!notifyServer || !started)
|
|
327
|
+
return;
|
|
328
|
+
const path = `/v1/session-stream/${connection.id}/subscriptions/${id}`;
|
|
329
|
+
started.then(() => request(path, { method: "DELETE" })).catch(() => {});
|
|
330
|
+
};
|
|
331
|
+
const dispatch = (current, event, payload) => {
|
|
332
|
+
if (event === "connected") {
|
|
333
|
+
current.id = payload.connection_id;
|
|
334
|
+
for (const [id, subscription] of subscriptions)
|
|
335
|
+
subscribe(current.id, id, subscription);
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
const subscription = subscriptions.get(payload.subscription_id ?? "");
|
|
339
|
+
if (!subscription)
|
|
340
|
+
return;
|
|
341
|
+
if (event === "end" || event === "error")
|
|
342
|
+
release(payload.subscription_id, false);
|
|
343
|
+
if (event === "error")
|
|
344
|
+
subscription.onError(new Error(payload.data.message));
|
|
345
|
+
else
|
|
346
|
+
subscription.onEvent(event, payload.data);
|
|
347
|
+
};
|
|
348
|
+
const fail = (current, error) => {
|
|
349
|
+
if (connection !== current)
|
|
350
|
+
return;
|
|
351
|
+
connection = undefined;
|
|
352
|
+
const failed = [...subscriptions.values()];
|
|
353
|
+
subscriptions.clear();
|
|
354
|
+
for (const subscription of failed)
|
|
355
|
+
subscription.onError(error);
|
|
356
|
+
};
|
|
357
|
+
const open = () => {
|
|
358
|
+
const current = { controller: new AbortController };
|
|
359
|
+
const { signal } = current.controller;
|
|
360
|
+
connection = current;
|
|
361
|
+
const read = async () => {
|
|
362
|
+
const response = await resolveFetch(clientOptions)(resolveClientUrl(resolveBaseUrl(clientOptions), "/v1/session-stream"), { headers: Object.fromEntries(createRequestHeaders(clientOptions).entries()), signal });
|
|
363
|
+
if (!response.ok || !response.body)
|
|
364
|
+
throw new Error(`Connection failed: ${response.status}`);
|
|
365
|
+
await readSseStream(response.body, ({ event, data }) => dispatch(current, event, JSON.parse(data)), { signal });
|
|
366
|
+
throw new Error("Session stream closed");
|
|
367
|
+
};
|
|
368
|
+
read().catch((error) => {
|
|
369
|
+
if (!signal.aborted)
|
|
370
|
+
fail(current, error);
|
|
371
|
+
});
|
|
372
|
+
return current;
|
|
373
|
+
};
|
|
374
|
+
return {
|
|
375
|
+
subscribe(sessionId, listener) {
|
|
376
|
+
const id = crypto.randomUUID();
|
|
377
|
+
const subscription = { ...listener, sessionId };
|
|
378
|
+
subscriptions.set(id, subscription);
|
|
379
|
+
const current = connection ?? open();
|
|
380
|
+
if (current.id)
|
|
381
|
+
subscribe(current.id, id, subscription);
|
|
382
|
+
return {
|
|
383
|
+
close: () => {
|
|
384
|
+
if (subscriptions.get(id) === subscription)
|
|
385
|
+
release(id, true);
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
|
|
284
392
|
// src/client/sessions.ts
|
|
285
393
|
var buildSessionsQuery = (projectId, input = {}) => {
|
|
286
394
|
const params = new URLSearchParams({ project_id: projectId });
|
|
@@ -294,100 +402,87 @@ var buildSessionsQuery = (projectId, input = {}) => {
|
|
|
294
402
|
params.append("archived", "true");
|
|
295
403
|
return params.toString();
|
|
296
404
|
};
|
|
297
|
-
var
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
};
|
|
301
|
-
var parseEventData = (data) => {
|
|
302
|
-
if (data.length === 0)
|
|
303
|
-
return null;
|
|
304
|
-
return JSON.parse(data);
|
|
305
|
-
};
|
|
306
|
-
var streamSessionEvents = async (clientOptions, path, onEvent, options = {}) => {
|
|
307
|
-
const response = await resolveFetch(clientOptions)(resolveClientUrl(resolveBaseUrl(clientOptions), path), {
|
|
308
|
-
headers: Object.fromEntries(createRequestHeaders(clientOptions).entries()),
|
|
309
|
-
signal: options.signal
|
|
310
|
-
});
|
|
311
|
-
if (!response.ok || !response.body)
|
|
312
|
-
throw new Error(`Connection failed: ${response.status}`);
|
|
313
|
-
await readSseStream(response.body, onEvent, { signal: options.signal });
|
|
314
|
-
};
|
|
315
|
-
var dispatchSessionStreamEvent = (event, handlers) => {
|
|
316
|
-
if (event.event === "ready") {
|
|
317
|
-
handlers.onReady?.(parseEventData(event.data));
|
|
405
|
+
var dispatchSessionStreamEvent = (event, data, handlers) => {
|
|
406
|
+
if (event === "ready") {
|
|
407
|
+
handlers.onReady?.(data);
|
|
318
408
|
return;
|
|
319
409
|
}
|
|
320
|
-
if (event
|
|
321
|
-
handlers.onPatch?.(
|
|
410
|
+
if (event === "patch") {
|
|
411
|
+
handlers.onPatch?.(data);
|
|
322
412
|
return;
|
|
323
413
|
}
|
|
324
|
-
if (event
|
|
325
|
-
handlers.onApprovalRequest?.(
|
|
414
|
+
if (event === "approval_request") {
|
|
415
|
+
handlers.onApprovalRequest?.(data);
|
|
326
416
|
return;
|
|
327
417
|
}
|
|
328
|
-
if (event
|
|
329
|
-
handlers.onQueuedMessages?.(
|
|
418
|
+
if (event === "queued_messages") {
|
|
419
|
+
handlers.onQueuedMessages?.(data);
|
|
330
420
|
return;
|
|
331
421
|
}
|
|
332
|
-
if (event
|
|
333
|
-
handlers.onEnd?.(
|
|
422
|
+
if (event === "end") {
|
|
423
|
+
handlers.onEnd?.(data);
|
|
334
424
|
}
|
|
335
425
|
};
|
|
336
|
-
var createSessionClient = (request, clientOptions) =>
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
params
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
deleteAttachment: (projectId, fileId) => request(`/v1/projects/${encodeURIComponent(projectId)}/session-attachments/${encodeURIComponent(fileId)}`, {
|
|
363
|
-
method: "DELETE"
|
|
364
|
-
}),
|
|
365
|
-
create: (input) => request("/v1/sessions", { method: "POST", body: input }),
|
|
366
|
-
archive: (sessionId) => request(`/v1/sessions/${sessionId}/archive`, { method: "POST" }),
|
|
367
|
-
followUp: (sessionId, input) => request(`/v1/sessions/${sessionId}/follow-up`, { method: "POST", body: input }),
|
|
368
|
-
approve: (sessionId, input) => request(`/v1/sessions/${sessionId}/approve`, { method: "POST", body: input }),
|
|
369
|
-
getConversation: (sessionId, signal) => request(`/v1/sessions/${sessionId}/conversation`, { signal }),
|
|
370
|
-
getConversationSources: (sessionId, signal) => request(`/v1/sessions/${sessionId}/conversation/sources`, { signal }),
|
|
371
|
-
getQueuedMessages: (sessionId, options) => request(`/v1/sessions/${sessionId}/queued-messages`, options),
|
|
372
|
-
resolveSessionId: (input) => request("/v1/sessions/resolve-session-id", { method: "POST", body: input }),
|
|
373
|
-
updateStatus: (sessionId, status) => request(`/v1/sessions/${sessionId}/status`, { method: "PATCH", body: { status } }),
|
|
374
|
-
stream: (sessionId, onEvent, options = {}) => streamSessionEvents(clientOptions, buildSessionStreamPath(sessionId), onEvent, options),
|
|
375
|
-
connectStream: (sessionId, handlers, options = {}) => {
|
|
376
|
-
const abortController = new AbortController;
|
|
377
|
-
let closed = false;
|
|
378
|
-
streamSessionEvents(clientOptions, buildSessionStreamPath(sessionId, options.attempt), (event) => dispatchSessionStreamEvent(event, handlers), { signal: abortController.signal }).catch((error) => {
|
|
379
|
-
if (closed || error.name === "AbortError")
|
|
380
|
-
return;
|
|
381
|
-
handlers.onError?.(error);
|
|
382
|
-
});
|
|
383
|
-
return {
|
|
384
|
-
close: () => {
|
|
385
|
-
closed = true;
|
|
386
|
-
abortController.abort();
|
|
426
|
+
var createSessionClient = (request, clientOptions) => {
|
|
427
|
+
const streams = createSessionStreamTransport(request, clientOptions);
|
|
428
|
+
return {
|
|
429
|
+
listActivity: (sessionId, input = {}) => {
|
|
430
|
+
const params = new URLSearchParams;
|
|
431
|
+
if (input.event_type)
|
|
432
|
+
params.append("event_type", input.event_type);
|
|
433
|
+
if (input.from)
|
|
434
|
+
params.append("from", input.from);
|
|
435
|
+
if (input.to)
|
|
436
|
+
params.append("to", input.to);
|
|
437
|
+
if (input.cursor)
|
|
438
|
+
params.append("cursor", input.cursor);
|
|
439
|
+
if (input.limit !== undefined)
|
|
440
|
+
params.append("limit", String(input.limit));
|
|
441
|
+
const query = params.toString();
|
|
442
|
+
return request(`/v1/sessions/${sessionId}/activity${query ? `?${query}` : ""}`);
|
|
443
|
+
},
|
|
444
|
+
list: (projectId, input) => request(`/v1/sessions?${buildSessionsQuery(projectId, input)}`),
|
|
445
|
+
get: (sessionId) => request(`/v1/sessions/${sessionId}`),
|
|
446
|
+
uploadAttachment: (projectId, input) => request(`/v1/projects/${encodeURIComponent(projectId)}/session-attachments`, {
|
|
447
|
+
method: "POST",
|
|
448
|
+
body: input.data,
|
|
449
|
+
headers: {
|
|
450
|
+
"content-type": input.mimeType || "application/octet-stream",
|
|
451
|
+
"x-file-name": encodeURIComponent(input.name)
|
|
387
452
|
}
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
453
|
+
}),
|
|
454
|
+
deleteAttachment: (projectId, fileId) => request(`/v1/projects/${encodeURIComponent(projectId)}/session-attachments/${encodeURIComponent(fileId)}`, {
|
|
455
|
+
method: "DELETE"
|
|
456
|
+
}),
|
|
457
|
+
create: (input) => request("/v1/sessions", { method: "POST", body: input }),
|
|
458
|
+
archive: (sessionId) => request(`/v1/sessions/${sessionId}/archive`, { method: "POST" }),
|
|
459
|
+
followUp: (sessionId, input) => request(`/v1/sessions/${sessionId}/follow-up`, { method: "POST", body: input }),
|
|
460
|
+
approve: (sessionId, input) => request(`/v1/sessions/${sessionId}/approve`, { method: "POST", body: input }),
|
|
461
|
+
getConversation: (sessionId, signal) => request(`/v1/sessions/${sessionId}/conversation`, { signal }),
|
|
462
|
+
getConversationSources: (sessionId, signal) => request(`/v1/sessions/${sessionId}/conversation/sources`, { signal }),
|
|
463
|
+
getQueuedMessages: (sessionId, options) => request(`/v1/sessions/${sessionId}/queued-messages`, options),
|
|
464
|
+
resolveSessionId: (input) => request("/v1/sessions/resolve-session-id", { method: "POST", body: input }),
|
|
465
|
+
updateStatus: (sessionId, status) => request(`/v1/sessions/${sessionId}/status`, { method: "PATCH", body: { status } }),
|
|
466
|
+
stream: (sessionId, onEvent, options = {}) => new Promise((resolve, reject) => {
|
|
467
|
+
const subscription = streams.subscribe(sessionId, {
|
|
468
|
+
onEvent: (event, data) => {
|
|
469
|
+
onEvent({ event, data: JSON.stringify(data) });
|
|
470
|
+
if (event === "end")
|
|
471
|
+
resolve();
|
|
472
|
+
},
|
|
473
|
+
onError: reject
|
|
474
|
+
});
|
|
475
|
+
options.signal?.addEventListener("abort", () => {
|
|
476
|
+
subscription.close();
|
|
477
|
+
resolve();
|
|
478
|
+
}, { once: true });
|
|
479
|
+
}),
|
|
480
|
+
connectStream: (sessionId, handlers) => streams.subscribe(sessionId, {
|
|
481
|
+
onEvent: (event, data) => dispatchSessionStreamEvent(event, data, handlers),
|
|
482
|
+
onError: (error) => handlers.onError?.(error)
|
|
483
|
+
})
|
|
484
|
+
};
|
|
485
|
+
};
|
|
391
486
|
|
|
392
487
|
// src/client/settings.ts
|
|
393
488
|
var createSettingsClient = (request) => ({
|
|
@@ -618,6 +713,7 @@ var createWorkspaceClient = (request) => ({
|
|
|
618
713
|
var createClient = (options = {}) => {
|
|
619
714
|
const request = createRequest(options);
|
|
620
715
|
return {
|
|
716
|
+
views: createBoardViewsClient(request),
|
|
621
717
|
projects: createProjectClient(request),
|
|
622
718
|
filesystem: createFilesystemClient(request),
|
|
623
719
|
workspaces: createWorkspaceClient(request),
|
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { type AgentClient, type AutomationClient, type ClientOptions, type DirectoryEntry, type ExtensionClient, type FilesystemClient, type ListSessionsInput, type NotificationsClient, type ProjectClient, PstdioApiError, type PstdioClient, type RequestFn, type RequestOptions, type RuntimeClient, type SessionClient, type SessionStreamConnection, type SessionStreamHandlers, type SettingsClient, type SkillClient, type SseEvent, type StartSyncInput, type SyncClient, type SyncConnection, type SyncRow, type SyncWriter, type SyncWriterProvider, type WorkspaceClient, applySyncEvent, createClient, createRequest, createRuntimeClient, parseSyncDeleteEvent };
|
|
1
|
+
import { A as PstdioApiError, C as DirectoryEntry, D as AutomationClient, E as BoardViewsClient, M as RequestOptions, N as createRequest, O as AgentClient, S as NotificationsClient, T as ExtensionClient, _ as SessionStreamHandlers, a as SyncClient, b as createRuntimeClient, c as SyncWriter, d as parseSyncDeleteEvent, f as SkillClient, g as SessionStreamConnection, h as SessionClient, i as StartSyncInput, j as RequestFn, k as ClientOptions, l as SyncWriterProvider, m as ListSessionsInput, n as createClient, o as SyncConnection, p as SettingsClient, r as WorkspaceClient, s as SyncRow, t as PstdioClient, u as applySyncEvent, v as SseEvent, w as FilesystemClient, x as ProjectClient, y as RuntimeClient } from "./index-CF8VtORE.js";
|
|
2
|
+
export { type AgentClient, type AutomationClient, type BoardViewsClient, type ClientOptions, type DirectoryEntry, type ExtensionClient, type FilesystemClient, type ListSessionsInput, type NotificationsClient, type ProjectClient, PstdioApiError, type PstdioClient, type RequestFn, type RequestOptions, type RuntimeClient, type SessionClient, type SessionStreamConnection, type SessionStreamHandlers, type SettingsClient, type SkillClient, type SseEvent, type StartSyncInput, type SyncClient, type SyncConnection, type SyncRow, type SyncWriter, type SyncWriterProvider, type WorkspaceClient, applySyncEvent, createClient, createRequest, createRuntimeClient, parseSyncDeleteEvent };
|
|
3
3
|
export {};
|
package/dist/data.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ti as ArtifactMount } from "./index-Dd4tqVV7.js";
|
|
2
2
|
//#region src/data/draft-layout.d.ts
|
|
3
3
|
export declare const assertSafePathSegment: (value: string) => void;
|
|
4
4
|
export declare const requireRepoFiles: (projectFiles: ArtifactMount | undefined) => ArtifactMount;
|
package/dist/extensions/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// ../pstdio-api-contracts/src/extension-kernel/api-versions.ts
|
|
2
2
|
var numericIdentifier = "(?:0|[1-9]\\d*)";
|
|
3
|
-
var
|
|
4
|
-
var exactVersion = new RegExp(`^${numericIdentifier}\\.${numericIdentifier}\\.${numericIdentifier}(?:-${prereleaseIdentifier}(?:\\.${prereleaseIdentifier})*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$`);
|
|
3
|
+
var caretTerm = new RegExp(`^\\^(${numericIdentifier}\\.${numericIdentifier}\\.${numericIdentifier})$`);
|
|
5
4
|
// ../pstdio-api-contracts/src/extension-kernel/types/composition.ts
|
|
6
5
|
var dockedWorkbenchRegions = ["sidenav", "main", "secondary", "side"];
|
|
7
6
|
var extensionPanelRegions = ["main", "secondary", "side"];
|
|
@@ -271,7 +270,7 @@ var packageAsset = (path, baseUrl) => ({
|
|
|
271
270
|
baseUrl
|
|
272
271
|
});
|
|
273
272
|
// ../pstdio-api-contracts/src/extension-kernel/types/extension.ts
|
|
274
|
-
var EXTENSION_API_VERSION = "1.0
|
|
273
|
+
var EXTENSION_API_VERSION = "0.1.0";
|
|
275
274
|
// ../pstdio-api-contracts/src/extension-kernel/types/webview-capabilities.ts
|
|
276
275
|
var WEBVIEW_HOST_CAPABILITY_VERSION = 1;
|
|
277
276
|
var WEBVIEW_DECLARABLE_CAPABILITIES = [
|
|
@@ -524,7 +523,7 @@ var reconcileMessageHistory = (input, projection = {}) => {
|
|
|
524
523
|
}
|
|
525
524
|
};
|
|
526
525
|
// package.json
|
|
527
|
-
var version = "0.
|
|
526
|
+
var version = "0.39.0";
|
|
528
527
|
|
|
529
528
|
// src/version.ts
|
|
530
529
|
var SDK_VERSION = version;
|
|
@@ -830,6 +829,7 @@ var parsePageUrl = (input) => {
|
|
|
830
829
|
};
|
|
831
830
|
// src/extensions/params.ts
|
|
832
831
|
var params = {
|
|
832
|
+
valueOf: (key) => ({ kind: "param-value", key }),
|
|
833
833
|
text: (options) => ({ type: "text", ...options }),
|
|
834
834
|
longText: (options) => ({ type: "longtext", ...options }),
|
|
835
835
|
markdown: (options) => ({ type: "markdown", ...options }),
|
|
@@ -837,11 +837,9 @@ var params = {
|
|
|
837
837
|
number: (options) => ({ type: "number", ...options }),
|
|
838
838
|
boolean: (options) => ({ type: "boolean", ...options }),
|
|
839
839
|
select: (options) => ({ type: "select", ...options }),
|
|
840
|
-
multiSelect: (options) => ({
|
|
841
|
-
type: "multi-select",
|
|
842
|
-
...options
|
|
843
|
-
}),
|
|
840
|
+
multiSelect: (options) => ({ type: "multi-select", ...options }),
|
|
844
841
|
harness: (options) => ({ type: "harness", ...options }),
|
|
842
|
+
workspace: (options) => ({ type: "workspace", ...options }),
|
|
845
843
|
template: (options) => {
|
|
846
844
|
const { type: templateType, ...rest } = options;
|
|
847
845
|
return { type: "template", templateType, ...rest };
|