@pstdio/sdk 0.10.0 → 0.12.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 -4
- package/dist/api/extensions.d.ts +1 -1
- package/dist/api/index.d.ts +2 -6
- package/dist/api/workspaces.d.ts +2 -6
- package/dist/client/agents.d.ts +2 -7
- package/dist/client/client.d.ts +0 -9
- package/dist/client/index.d.ts +0 -3
- package/dist/client/index.js +17 -116
- package/dist/client/projects.d.ts +2 -2
- package/dist/client/workspaces.d.ts +2 -4
- package/dist/extensions/command-outcome.d.ts +5 -0
- package/dist/extensions/define-command.d.ts +1 -3
- package/dist/extensions/define-extension-view.d.ts +25 -0
- package/dist/extensions/define-extension.d.ts +1 -4
- package/dist/extensions/index.d.ts +6 -8
- package/dist/extensions/index.js +145 -89
- package/dist/extensions/params.d.ts +2 -1
- package/dist/extensions/refs.d.ts +2 -14
- package/dist/extensions/when.d.ts +9 -0
- package/dist/hooks/entities.d.ts +7 -9
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/session.d.ts +2 -3
- package/dist/hooks/worktree.d.ts +4 -3
- package/dist/resources/agent.d.ts +1 -1
- package/dist/resources/index.d.ts +2 -5
- package/dist/resources/index.js +3 -1
- package/dist/resources/known-agents.d.ts +2 -0
- package/dist/resources/workspace.d.ts +0 -1
- package/package.json +2 -2
- package/dist/api/agents.d.ts +0 -1
- package/dist/api/statuses.d.ts +0 -2
- package/dist/api/tags.d.ts +0 -2
- package/dist/api/tickets.d.ts +0 -26
- package/dist/client/statuses.d.ts +0 -24
- package/dist/client/tags.d.ts +0 -15
- package/dist/client/tickets.d.ts +0 -24
- package/dist/extensions/kernel-slots.d.ts +0 -168
- package/dist/extensions/package-asset.d.ts +0 -10
- package/dist/extensions/slots.d.ts +0 -6
- package/dist/extensions/types/commands.d.ts +0 -125
- package/dist/extensions/types/context.d.ts +0 -396
- package/dist/extensions/types/contributions.d.ts +0 -275
- package/dist/extensions/types/events.d.ts +0 -10
- package/dist/extensions/types/extension.d.ts +0 -174
- package/dist/extensions/types/index.d.ts +0 -10
- package/dist/extensions/types/json.d.ts +0 -7
- package/dist/extensions/types/params.d.ts +0 -80
- package/dist/extensions/types/resources.d.ts +0 -25
- package/dist/extensions/types/slots.d.ts +0 -22
- package/dist/extensions/types/webview-capabilities.d.ts +0 -65
- package/dist/extensions/workbench-targets.d.ts +0 -134
- package/dist/hooks/attempt.d.ts +0 -16
- package/dist/hooks/ticket.d.ts +0 -26
- package/dist/resources/status.d.ts +0 -2
- package/dist/resources/tag.d.ts +0 -2
- package/dist/resources/ticket.d.ts +0 -2
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import type { ExtensionTicket, ExtensionWorkspace, SetAttemptStatusInput, SetAttemptStatusResult } from "./types/context";
|
|
2
|
-
import type { ResourceAnchor } from "./types/resources";
|
|
3
|
-
/** @deprecated Legacy core ticket event payload. Ticket events are owned by the pstdio tickets extension. */
|
|
4
|
-
export interface TicketArchivedEventPayload {
|
|
5
|
-
projectId: string;
|
|
6
|
-
ticket: ExtensionTicket;
|
|
7
|
-
}
|
|
8
|
-
export interface WorktreeCreatedEventPayload {
|
|
9
|
-
projectId: string;
|
|
10
|
-
repoPath: string;
|
|
11
|
-
worktreePath: string;
|
|
12
|
-
branch: string;
|
|
13
|
-
workspace: string;
|
|
14
|
-
workspaceId: string;
|
|
15
|
-
/** @deprecated Legacy ticket worktree linkage. Ticket worktree setup is owned by the pstdio tickets extension. */
|
|
16
|
-
ticket: string;
|
|
17
|
-
}
|
|
18
|
-
/** @deprecated Legacy core ticket event payload. Ticket events are owned by the pstdio tickets extension. */
|
|
19
|
-
export interface TicketLifecyclePayload {
|
|
20
|
-
projectId: string;
|
|
21
|
-
ticket: ExtensionTicket;
|
|
22
|
-
}
|
|
23
|
-
/** @deprecated Legacy core ticket event payload. Ticket events are owned by the pstdio tickets extension. */
|
|
24
|
-
export interface TicketStatusChangePayload {
|
|
25
|
-
projectId: string;
|
|
26
|
-
ticket: ExtensionTicket;
|
|
27
|
-
fromStatus: string | null;
|
|
28
|
-
toStatus: string | null;
|
|
29
|
-
}
|
|
30
|
-
export interface AttemptStatusChangePayload {
|
|
31
|
-
projectId: string;
|
|
32
|
-
workspaceId: string;
|
|
33
|
-
/** @deprecated Legacy ticket attempt linkage. Ticket data is owned by the pstdio tickets extension. */
|
|
34
|
-
ticket: ExtensionTicket | null;
|
|
35
|
-
fromStatus: string | null;
|
|
36
|
-
toStatus: string;
|
|
37
|
-
statusChangeId?: string;
|
|
38
|
-
sessionId: string | null;
|
|
39
|
-
originalSessionId: string | null;
|
|
40
|
-
worktreePath: string | null;
|
|
41
|
-
workspace: ExtensionWorkspace;
|
|
42
|
-
}
|
|
43
|
-
export interface SessionLifecyclePayload {
|
|
44
|
-
projectId: string;
|
|
45
|
-
sessionId: string;
|
|
46
|
-
sessionStatus?: string;
|
|
47
|
-
originalSessionId?: string;
|
|
48
|
-
workspace?: ExtensionWorkspace;
|
|
49
|
-
workspaceId?: string;
|
|
50
|
-
worktreePath?: string;
|
|
51
|
-
branch?: string;
|
|
52
|
-
/** @deprecated Legacy ticket session linkage. Ticket data is owned by the pstdio tickets extension. */
|
|
53
|
-
ticket?: ExtensionTicket;
|
|
54
|
-
attemptStatus?: string;
|
|
55
|
-
}
|
|
56
|
-
export interface WorktreeRemovedPayload {
|
|
57
|
-
projectId: string;
|
|
58
|
-
repoPath?: string;
|
|
59
|
-
worktreePath: string;
|
|
60
|
-
workspace?: ExtensionWorkspace;
|
|
61
|
-
workspaceId?: string;
|
|
62
|
-
/** @deprecated Legacy ticket worktree linkage. Ticket data is owned by the pstdio tickets extension. */
|
|
63
|
-
ticket?: ExtensionTicket | string;
|
|
64
|
-
}
|
|
65
|
-
export interface CommitPayload {
|
|
66
|
-
projectId: string;
|
|
67
|
-
repoPath?: string;
|
|
68
|
-
worktreePath?: string;
|
|
69
|
-
branch?: string;
|
|
70
|
-
commitSha?: string;
|
|
71
|
-
workspace?: ExtensionWorkspace;
|
|
72
|
-
/** @deprecated Legacy ticket git linkage. Ticket data is owned by the pstdio tickets extension. */
|
|
73
|
-
ticket?: ExtensionTicket | string;
|
|
74
|
-
}
|
|
75
|
-
export interface RebasePayload {
|
|
76
|
-
projectId: string;
|
|
77
|
-
repoPath?: string;
|
|
78
|
-
worktreePath?: string;
|
|
79
|
-
branch?: string;
|
|
80
|
-
workspace?: ExtensionWorkspace;
|
|
81
|
-
ticket?: ExtensionTicket | string;
|
|
82
|
-
}
|
|
83
|
-
export interface MergePayload extends CommitPayload {
|
|
84
|
-
}
|
|
85
|
-
export interface ConflictPayload {
|
|
86
|
-
projectId: string;
|
|
87
|
-
operation: "rebase" | "merge";
|
|
88
|
-
repoPath?: string;
|
|
89
|
-
worktreePath?: string;
|
|
90
|
-
branch?: string;
|
|
91
|
-
workspace?: ExtensionWorkspace;
|
|
92
|
-
/** @deprecated Legacy ticket git linkage. Ticket data is owned by the pstdio tickets extension. */
|
|
93
|
-
ticket?: ExtensionTicket | string;
|
|
94
|
-
}
|
|
95
|
-
export declare const projectSlots: {
|
|
96
|
-
sidebar: import("./types").SlotRef<object, "view">;
|
|
97
|
-
headerPrimary: import("./types").SlotRef<object, "menu">;
|
|
98
|
-
headerOverflow: import("./types").SlotRef<object, "menu">;
|
|
99
|
-
commandPanel: import("./types").SlotRef<object, "menu">;
|
|
100
|
-
settingsPanels: import("./types").SlotRef<object, "settings">;
|
|
101
|
-
};
|
|
102
|
-
export declare const sessionSlots: {
|
|
103
|
-
headerPrimary: import("./types").SlotRef<object, "menu">;
|
|
104
|
-
headerOverflow: import("./types").SlotRef<object, "menu">;
|
|
105
|
-
transcriptActions: import("./types").SlotRef<object, "menu">;
|
|
106
|
-
};
|
|
107
|
-
/** @deprecated Legacy core ticket slots. Ticket UI contributions are owned by the pstdio tickets extension. */
|
|
108
|
-
export declare const ticketSlots: {
|
|
109
|
-
headerPrimary: import("./types").SlotRef<object, "menu">;
|
|
110
|
-
headerOverflow: import("./types").SlotRef<object, "menu">;
|
|
111
|
-
};
|
|
112
|
-
export declare const workspaceSlots: {
|
|
113
|
-
headerPrimary: import("./types").SlotRef<object, "menu">;
|
|
114
|
-
headerOverflow: import("./types").SlotRef<object, "menu">;
|
|
115
|
-
sidebar: import("./types").SlotRef<object, "view">;
|
|
116
|
-
};
|
|
117
|
-
export declare const projectEvents: {
|
|
118
|
-
opened: import("./types").EventRef<{
|
|
119
|
-
projectId: string;
|
|
120
|
-
}>;
|
|
121
|
-
};
|
|
122
|
-
export declare const sessionEvents: {
|
|
123
|
-
started: import("./types").EventRef<SessionLifecyclePayload & {
|
|
124
|
-
anchors?: ResourceAnchor[];
|
|
125
|
-
}>;
|
|
126
|
-
resumed: import("./types").EventRef<SessionLifecyclePayload>;
|
|
127
|
-
awaitingInput: import("./types").EventRef<SessionLifecyclePayload>;
|
|
128
|
-
succeeded: import("./types").EventRef<SessionLifecyclePayload>;
|
|
129
|
-
failed: import("./types").EventRef<SessionLifecyclePayload>;
|
|
130
|
-
completed: import("./types").EventRef<SessionLifecyclePayload & {
|
|
131
|
-
anchors?: ResourceAnchor[];
|
|
132
|
-
}>;
|
|
133
|
-
};
|
|
134
|
-
/** @deprecated Legacy core ticket events. Ticket events are owned by the pstdio tickets extension. */
|
|
135
|
-
export declare const ticketEvents: {
|
|
136
|
-
created: import("./types").EventRef<TicketLifecyclePayload>;
|
|
137
|
-
statusChanged: import("./types").EventRef<TicketStatusChangePayload>;
|
|
138
|
-
archived: import("./types").EventRef<TicketArchivedEventPayload>;
|
|
139
|
-
deleted: import("./types").EventRef<TicketLifecyclePayload>;
|
|
140
|
-
};
|
|
141
|
-
export declare const workspaceEvents: {
|
|
142
|
-
created: import("./types").EventRef<{
|
|
143
|
-
workspace: ExtensionWorkspace;
|
|
144
|
-
}>;
|
|
145
|
-
archived: import("./types").EventRef<{
|
|
146
|
-
workspace: ExtensionWorkspace;
|
|
147
|
-
}>;
|
|
148
|
-
deleted: import("./types").EventRef<{
|
|
149
|
-
workspace: ExtensionWorkspace;
|
|
150
|
-
}>;
|
|
151
|
-
};
|
|
152
|
-
export declare const worktreeEvents: {
|
|
153
|
-
created: import("./types").EventRef<WorktreeCreatedEventPayload>;
|
|
154
|
-
removed: import("./types").EventRef<WorktreeRemovedPayload>;
|
|
155
|
-
};
|
|
156
|
-
export declare const gitEvents: {
|
|
157
|
-
committed: import("./types").EventRef<CommitPayload>;
|
|
158
|
-
rebased: import("./types").EventRef<RebasePayload>;
|
|
159
|
-
merged: import("./types").EventRef<MergePayload>;
|
|
160
|
-
conflicted: import("./types").EventRef<ConflictPayload>;
|
|
161
|
-
};
|
|
162
|
-
/** @deprecated Legacy ticket attempt status events. Workspace status automation is extension-owned. */
|
|
163
|
-
export declare const attemptStatusEvents: {
|
|
164
|
-
changed: import("./types").EventRef<AttemptStatusChangePayload>;
|
|
165
|
-
};
|
|
166
|
-
export declare const workspaceCommands: {
|
|
167
|
-
setAttemptStatus: import("./types").CommandRef<SetAttemptStatusInput, SetAttemptStatusResult>;
|
|
168
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PackageAssetDescriptor } from "./types/resources";
|
|
2
|
-
/**
|
|
3
|
-
* Reference an asset shipped alongside the extension's compiled output. `path` is
|
|
4
|
-
* resolved relative to `baseUrl`; in practice authors always pass `import.meta.url`
|
|
5
|
-
* so the runtime can locate the file no matter where the extension is installed.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* webview: { entry: packageAsset("./src/page.tsx", import.meta.url) }
|
|
9
|
-
*/
|
|
10
|
-
export declare const packageAsset: (path: string, baseUrl: string) => PackageAssetDescriptor;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Struct } from "./types/json";
|
|
2
|
-
import type { SlotOptions, SlotRef, UiSlotKind } from "./types/slots";
|
|
3
|
-
/**
|
|
4
|
-
* Define a host-owned UI slot that extension contributions can target.
|
|
5
|
-
*/
|
|
6
|
-
export declare const defineSlot: <TContext extends Struct = Struct, TKind extends UiSlotKind = UiSlotKind>(id: string, options: SlotOptions<TKind>) => SlotRef<TContext, TKind>;
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import type { WorkbenchAttachmentTarget } from "../workbench-targets";
|
|
2
|
-
import type { JsonObject, JsonValue, Struct } from "./json";
|
|
3
|
-
import type { RepoContext, ResourceRef } from "./resources";
|
|
4
|
-
import type { SlotInvocationContext } from "./slots";
|
|
5
|
-
export type CommandSource = "cli" | "dashboard" | "api" | "schedule" | "event" | "automation" | "command-panel";
|
|
6
|
-
export interface CommandRef<TParams extends Struct = Struct, TResult = unknown> {
|
|
7
|
-
id: string;
|
|
8
|
-
params?: TParams;
|
|
9
|
-
result?: TResult;
|
|
10
|
-
}
|
|
11
|
-
export interface SerializedError {
|
|
12
|
-
name?: string;
|
|
13
|
-
message: string;
|
|
14
|
-
stack?: string;
|
|
15
|
-
cause?: JsonValue;
|
|
16
|
-
}
|
|
17
|
-
export interface WorkbenchAttachmentInvocationContext {
|
|
18
|
-
target: WorkbenchAttachmentTarget;
|
|
19
|
-
mode?: string;
|
|
20
|
-
projectId?: string;
|
|
21
|
-
resource?: ResourceRef;
|
|
22
|
-
}
|
|
23
|
-
export interface CommandInvocation<TParams extends Struct = Struct> {
|
|
24
|
-
params: TParams;
|
|
25
|
-
resource?: ResourceRef;
|
|
26
|
-
repoId?: string;
|
|
27
|
-
repoPath?: string;
|
|
28
|
-
attachment?: WorkbenchAttachmentInvocationContext;
|
|
29
|
-
slot?: SlotInvocationContext;
|
|
30
|
-
metadata?: JsonObject;
|
|
31
|
-
}
|
|
32
|
-
export interface CommandContinue {
|
|
33
|
-
type: "continue";
|
|
34
|
-
}
|
|
35
|
-
export interface CommandPatchParams<TParams extends Struct = Struct> {
|
|
36
|
-
type: "patchParams";
|
|
37
|
-
params: Partial<TParams>;
|
|
38
|
-
}
|
|
39
|
-
export interface CommandReplaceParams<TParams extends Struct = Struct> {
|
|
40
|
-
type: "replaceParams";
|
|
41
|
-
params: TParams;
|
|
42
|
-
}
|
|
43
|
-
export interface CommandReplaceInvocation<TParams extends Struct = Struct> {
|
|
44
|
-
type: "replaceInvocation";
|
|
45
|
-
invocation: CommandInvocation<TParams>;
|
|
46
|
-
}
|
|
47
|
-
export interface CommandReject {
|
|
48
|
-
type: "reject";
|
|
49
|
-
code?: string;
|
|
50
|
-
reason: string;
|
|
51
|
-
data?: JsonObject;
|
|
52
|
-
}
|
|
53
|
-
export type CommandMiddlewareResult<TParams extends Struct = Struct> = void | CommandContinue | CommandPatchParams<TParams> | CommandReplaceParams<TParams> | CommandReplaceInvocation<TParams> | CommandReject;
|
|
54
|
-
export interface CommandNotice {
|
|
55
|
-
type: "info" | "success" | "warning" | "error";
|
|
56
|
-
title?: string;
|
|
57
|
-
message: string;
|
|
58
|
-
metadata?: JsonObject;
|
|
59
|
-
}
|
|
60
|
-
export interface CommandDiagnostic {
|
|
61
|
-
code: string;
|
|
62
|
-
message: string;
|
|
63
|
-
severity: "info" | "warning" | "error";
|
|
64
|
-
extensionId?: string;
|
|
65
|
-
commandId?: string;
|
|
66
|
-
metadata?: JsonObject;
|
|
67
|
-
}
|
|
68
|
-
export type CommandOutcome<TResult = unknown> = {
|
|
69
|
-
ok: true;
|
|
70
|
-
status: "success";
|
|
71
|
-
value: TResult;
|
|
72
|
-
notices?: CommandNotice[];
|
|
73
|
-
diagnostics?: CommandDiagnostic[];
|
|
74
|
-
} | {
|
|
75
|
-
ok: false;
|
|
76
|
-
status: "rejected";
|
|
77
|
-
code?: string;
|
|
78
|
-
reason: string;
|
|
79
|
-
data?: JsonObject;
|
|
80
|
-
notices?: CommandNotice[];
|
|
81
|
-
diagnostics?: CommandDiagnostic[];
|
|
82
|
-
} | {
|
|
83
|
-
ok: false;
|
|
84
|
-
status: "error";
|
|
85
|
-
code?: string;
|
|
86
|
-
reason: string;
|
|
87
|
-
error?: SerializedError;
|
|
88
|
-
notices?: CommandNotice[];
|
|
89
|
-
diagnostics?: CommandDiagnostic[];
|
|
90
|
-
};
|
|
91
|
-
export interface CommandHelpersApi {
|
|
92
|
-
execute<TParams extends Struct = Struct, TResult = unknown>(command: CommandRef<TParams, TResult> | string, invocation: CommandInvocation<TParams>): Promise<CommandOutcome<TResult>>;
|
|
93
|
-
continue(): CommandContinue;
|
|
94
|
-
patchParams<TParams extends Struct = Struct>(params: Partial<TParams>): CommandPatchParams<TParams>;
|
|
95
|
-
replaceParams<TParams extends Struct = Struct>(params: TParams): CommandReplaceParams<TParams>;
|
|
96
|
-
replaceInvocation<TParams extends Struct = Struct>(invocation: CommandInvocation<TParams>): CommandReplaceInvocation<TParams>;
|
|
97
|
-
reject(input: Omit<CommandReject, "type">): CommandReject;
|
|
98
|
-
}
|
|
99
|
-
export interface CommandRequestedEvent<TParams extends Struct = Struct> {
|
|
100
|
-
commandId: string;
|
|
101
|
-
invocationId: string;
|
|
102
|
-
source?: CommandSource;
|
|
103
|
-
params: TParams;
|
|
104
|
-
resource?: ResourceRef;
|
|
105
|
-
repo?: RepoContext;
|
|
106
|
-
}
|
|
107
|
-
export interface CommandStartedEvent<TParams extends Struct = Struct> extends CommandRequestedEvent<TParams> {
|
|
108
|
-
}
|
|
109
|
-
export interface CommandCompletedEvent<TParams extends Struct = Struct, TResult = unknown> extends CommandStartedEvent<TParams> {
|
|
110
|
-
result: TResult;
|
|
111
|
-
elapsedMs: number;
|
|
112
|
-
}
|
|
113
|
-
export interface CommandRejectedEvent<TParams extends Struct = Struct> extends CommandRequestedEvent<TParams> {
|
|
114
|
-
code?: string;
|
|
115
|
-
reason: string;
|
|
116
|
-
data?: JsonObject;
|
|
117
|
-
}
|
|
118
|
-
export interface CommandFailedEvent<TParams extends Struct = Struct> extends CommandRequestedEvent<TParams> {
|
|
119
|
-
code?: string;
|
|
120
|
-
reason: string;
|
|
121
|
-
error?: SerializedError;
|
|
122
|
-
elapsedMs: number;
|
|
123
|
-
}
|
|
124
|
-
export type CommandLifecyclePhase = "requested" | "started" | "completed" | "rejected" | "failed";
|
|
125
|
-
export type CommandLifecycleEventPayload<TPhase extends CommandLifecyclePhase, TParams extends Struct = Struct, TResult = unknown> = TPhase extends "requested" ? CommandRequestedEvent<TParams> : TPhase extends "started" ? CommandStartedEvent<TParams> : TPhase extends "completed" ? CommandCompletedEvent<TParams, TResult> : TPhase extends "rejected" ? CommandRejectedEvent<TParams> : CommandFailedEvent<TParams>;
|