@pstdio/sdk 0.7.0 → 0.9.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 +27 -188
- package/dist/api/extensions.d.ts +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/settings.d.ts +1 -0
- package/dist/api/statuses.d.ts +1 -0
- package/dist/api/tags.d.ts +1 -0
- package/dist/api/tickets.d.ts +3 -0
- package/dist/api/workspaces.d.ts +10 -1
- package/dist/client/client.d.ts +7 -2
- package/dist/client/index.d.ts +5 -3
- package/dist/client/index.js +285 -31
- package/dist/client/projects.d.ts +0 -11
- package/dist/client/request.d.ts +9 -0
- package/dist/client/sessions.d.ts +25 -3
- package/dist/client/settings.d.ts +7 -0
- package/dist/client/sse.d.ts +15 -0
- package/dist/client/statuses.d.ts +2 -0
- package/dist/client/sync.d.ts +35 -0
- package/dist/client/tags.d.ts +2 -0
- package/dist/client/tickets.d.ts +6 -1
- package/dist/client/workspaces.d.ts +2 -0
- package/dist/extensions/define-command.d.ts +1 -1
- package/dist/extensions/define-extension.d.ts +50 -7
- package/dist/extensions/index.d.ts +3 -2
- package/dist/extensions/index.js +151 -11
- package/dist/extensions/kernel-slots.d.ts +131 -10
- package/dist/extensions/params.d.ts +19 -12
- package/dist/extensions/refs.d.ts +3 -3
- package/dist/extensions/slots.d.ts +1 -9
- package/dist/extensions/types/commands.d.ts +8 -0
- package/dist/extensions/types/context.d.ts +225 -18
- package/dist/extensions/types/contributions.d.ts +183 -10
- package/dist/extensions/types/extension.d.ts +16 -10
- package/dist/extensions/types/params.d.ts +43 -29
- package/dist/extensions/types/slots.d.ts +1 -1
- package/dist/extensions/types/webview-capabilities.d.ts +12 -2
- package/dist/extensions/workbench-targets.d.ts +134 -0
- package/dist/hooks/attempt.d.ts +2 -0
- package/dist/hooks/entities.d.ts +2 -0
- package/dist/hooks/ticket.d.ts +3 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.js +26 -0
- package/dist/resources/known-agents.d.ts +12 -0
- package/dist/resources/settings.d.ts +1 -0
- package/dist/resources/status.d.ts +1 -0
- package/dist/resources/tag.d.ts +1 -0
- package/dist/resources/ticket.d.ts +1 -0
- package/dist/resources/workspace.d.ts +4 -1
- package/package.json +2 -6
- package/dist/api/actions.d.ts +0 -13
- package/dist/client/actions.d.ts +0 -8
- package/dist/plugins/define-plugin.d.ts +0 -2
- package/dist/plugins/helpers/context.d.ts +0 -24
- package/dist/plugins/helpers/create-attempt.d.ts +0 -5
- package/dist/plugins/helpers/create-session.d.ts +0 -21
- package/dist/plugins/helpers/create-workspace.d.ts +0 -5
- package/dist/plugins/helpers/find-ticket-by-ref.d.ts +0 -6
- package/dist/plugins/helpers/find-workspace-by-ref.d.ts +0 -5
- package/dist/plugins/helpers/followup-session.d.ts +0 -29
- package/dist/plugins/helpers/get-attempts-for-ticket.d.ts +0 -17
- package/dist/plugins/helpers/index.d.ts +0 -16
- package/dist/plugins/helpers/remove-all-worktrees-for-ticket.d.ts +0 -2
- package/dist/plugins/helpers/run-command.d.ts +0 -10
- package/dist/plugins/helpers/save-ticket.d.ts +0 -14
- package/dist/plugins/helpers/set-ticket-status.d.ts +0 -7
- package/dist/plugins/helpers/set-workspace-attempt-status.d.ts +0 -7
- package/dist/plugins/helpers/ticket-pull.d.ts +0 -18
- package/dist/plugins/helpers/update-ticket-when-all-attempts-match.d.ts +0 -7
- package/dist/plugins/helpers/workspaces-for-ticket.d.ts +0 -17
- package/dist/plugins/helpers/worktree-bootstrap.d.ts +0 -8
- package/dist/plugins/hooks.d.ts +0 -42
- package/dist/plugins/index.d.ts +0 -5
- package/dist/plugins/index.js +0 -739
- package/dist/plugins/types.d.ts +0 -112
|
@@ -1,66 +1,80 @@
|
|
|
1
1
|
import type { JsonObject } from "./json";
|
|
2
2
|
import type { ResourceRef } from "./resources";
|
|
3
3
|
export type ParamType = "text" | "longtext" | "number" | "boolean" | "select" | "multi-select" | "repo" | "harness" | "template" | "resource" | "json";
|
|
4
|
-
|
|
4
|
+
type ParamRequired<TRequired extends boolean | undefined> = TRequired extends true ? {
|
|
5
|
+
required: true;
|
|
6
|
+
} : TRequired extends false ? {
|
|
7
|
+
required: false;
|
|
8
|
+
} : {
|
|
9
|
+
required?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type ParamBase<TValue, TRequired extends boolean | undefined = boolean | undefined> = {
|
|
5
12
|
label?: string;
|
|
6
13
|
description?: string;
|
|
7
|
-
required?: boolean;
|
|
8
14
|
defaultValue?: TValue;
|
|
9
15
|
metadata?: JsonObject;
|
|
10
|
-
}
|
|
11
|
-
export
|
|
16
|
+
} & ParamRequired<TRequired>;
|
|
17
|
+
export type TextParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
|
|
12
18
|
type: "text";
|
|
13
|
-
}
|
|
14
|
-
export
|
|
19
|
+
};
|
|
20
|
+
export type LongTextParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
|
|
15
21
|
type: "longtext";
|
|
16
|
-
}
|
|
17
|
-
export
|
|
22
|
+
};
|
|
23
|
+
export type NumberParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<number, TRequired> & {
|
|
18
24
|
type: "number";
|
|
19
|
-
}
|
|
20
|
-
export
|
|
25
|
+
};
|
|
26
|
+
export type BooleanParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<boolean, TRequired> & {
|
|
21
27
|
type: "boolean";
|
|
22
|
-
}
|
|
23
|
-
export
|
|
28
|
+
};
|
|
29
|
+
export type SelectParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
|
|
24
30
|
type: "select";
|
|
25
31
|
options: Array<{
|
|
26
32
|
label: string;
|
|
27
33
|
value: string;
|
|
28
34
|
}>;
|
|
29
|
-
}
|
|
30
|
-
export
|
|
35
|
+
};
|
|
36
|
+
export type MultiSelectParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string[], TRequired> & {
|
|
31
37
|
type: "multi-select";
|
|
32
38
|
options: Array<{
|
|
33
39
|
label: string;
|
|
34
40
|
value: string;
|
|
35
41
|
}>;
|
|
36
|
-
}
|
|
37
|
-
export
|
|
42
|
+
};
|
|
43
|
+
export type RepoParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<{
|
|
38
44
|
repoId: string;
|
|
39
45
|
branch?: string;
|
|
40
|
-
}> {
|
|
46
|
+
}, TRequired> & {
|
|
41
47
|
type: "repo";
|
|
42
|
-
}
|
|
43
|
-
export
|
|
48
|
+
};
|
|
49
|
+
export type HarnessParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<{
|
|
44
50
|
harnessId: string;
|
|
45
51
|
model?: string;
|
|
46
|
-
}> {
|
|
52
|
+
}, TRequired> & {
|
|
47
53
|
type: "harness";
|
|
48
|
-
}
|
|
49
|
-
export
|
|
54
|
+
};
|
|
55
|
+
export type TemplateParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
|
|
50
56
|
type: "template";
|
|
51
57
|
templateType: string;
|
|
52
|
-
}
|
|
53
|
-
export
|
|
58
|
+
};
|
|
59
|
+
export type ResourceParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<ResourceRef, TRequired> & {
|
|
54
60
|
type: "resource";
|
|
55
61
|
resourceType: string;
|
|
56
|
-
}
|
|
57
|
-
export
|
|
62
|
+
};
|
|
63
|
+
export type JsonParam<T = unknown, TRequired extends boolean | undefined = boolean | undefined> = ParamBase<T, TRequired> & {
|
|
58
64
|
type: "json";
|
|
59
|
-
}
|
|
60
|
-
export type ParamDescriptor<TValue = unknown> = TextParam | LongTextParam | NumberParam | BooleanParam | SelectParam | MultiSelectParam | RepoParam | HarnessParam | TemplateParam | ResourceParam | JsonParam<TValue>;
|
|
65
|
+
};
|
|
66
|
+
export type ParamDescriptor<TValue = unknown, TRequired extends boolean | undefined = boolean | undefined> = TextParam<TRequired> | LongTextParam<TRequired> | NumberParam<TRequired> | BooleanParam<TRequired> | SelectParam<TRequired> | MultiSelectParam<TRequired> | RepoParam<TRequired> | HarnessParam<TRequired> | TemplateParam<TRequired> | ResourceParam<TRequired> | JsonParam<TValue, TRequired>;
|
|
61
67
|
export type ParamObjectSchema = Record<string, ParamDescriptor>;
|
|
62
68
|
export type ParamValue<TDescriptor extends ParamDescriptor> = TDescriptor extends ParamDescriptor<infer V> ? V : never;
|
|
69
|
+
type RequiredParamKeys<TSchema extends ParamObjectSchema> = {
|
|
70
|
+
[K in keyof TSchema]: TSchema[K] extends {
|
|
71
|
+
required: true;
|
|
72
|
+
} ? K : never;
|
|
73
|
+
}[keyof TSchema];
|
|
74
|
+
type OptionalParamKeys<TSchema extends ParamObjectSchema> = Exclude<keyof TSchema, RequiredParamKeys<TSchema>>;
|
|
63
75
|
export type ParamsOf<TSchema extends ParamObjectSchema> = {
|
|
64
|
-
[K in
|
|
76
|
+
[K in RequiredParamKeys<TSchema>]: ParamValue<TSchema[K]>;
|
|
77
|
+
} & {
|
|
78
|
+
[K in OptionalParamKeys<TSchema>]?: ParamValue<TSchema[K]>;
|
|
65
79
|
};
|
|
66
80
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JsonObject, Struct } from "./json";
|
|
2
|
-
export type UiSlotKind = "menu" | "
|
|
2
|
+
export type UiSlotKind = "menu" | "view" | "settings" | "renderer" | "dataRenderer";
|
|
3
3
|
export interface SlotOptions<TKind extends UiSlotKind = UiSlotKind> {
|
|
4
4
|
kind: TKind;
|
|
5
5
|
label?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { JsonObject } from "./json";
|
|
2
2
|
import type { RepoContext, ResourceRef } from "./resources";
|
|
3
3
|
export declare const WEBVIEW_HOST_CAPABILITY_VERSION = 1;
|
|
4
|
-
export declare const WEBVIEW_DECLARABLE_CAPABILITIES: readonly ["commands.execute", "resource.open", "notification.show", "preferences.get", "preferences.set"];
|
|
4
|
+
export declare const WEBVIEW_DECLARABLE_CAPABILITIES: readonly ["commands.execute", "resource.open", "notification.show", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete"];
|
|
5
5
|
export declare const ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES: readonly ["host.dispatchKeyboardEvent"];
|
|
6
|
-
export declare const WEBVIEW_HOST_CAPABILITIES: readonly ["commands.execute", "resource.open", "notification.show", "preferences.get", "preferences.set", "host.dispatchKeyboardEvent"];
|
|
6
|
+
export declare const WEBVIEW_HOST_CAPABILITIES: readonly ["commands.execute", "resource.open", "notification.show", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete", "host.dispatchKeyboardEvent"];
|
|
7
7
|
export type WebviewHostCapability = (typeof WEBVIEW_HOST_CAPABILITIES)[number];
|
|
8
8
|
export type WebviewDeclarableCapability = (typeof WEBVIEW_DECLARABLE_CAPABILITIES)[number];
|
|
9
9
|
export type WebviewCapabilityDeclaration = WebviewDeclarableCapability | `${WebviewDeclarableCapability}@${typeof WEBVIEW_HOST_CAPABILITY_VERSION}`;
|
|
@@ -36,6 +36,12 @@ export interface WebviewPreferencesGetParams {
|
|
|
36
36
|
export interface WebviewPreferencesSetParams extends WebviewPreferencesGetParams {
|
|
37
37
|
value: boolean | number | string | string[] | number[] | boolean[] | Record<string, unknown>;
|
|
38
38
|
}
|
|
39
|
+
export interface WebviewExtensionSettingKeyParams {
|
|
40
|
+
key: string;
|
|
41
|
+
}
|
|
42
|
+
export interface WebviewExtensionSettingSetParams extends WebviewExtensionSettingKeyParams {
|
|
43
|
+
value: unknown;
|
|
44
|
+
}
|
|
39
45
|
export interface WebviewKeyboardEventParams {
|
|
40
46
|
key?: string;
|
|
41
47
|
code?: string;
|
|
@@ -51,5 +57,9 @@ export interface WebviewHostCapabilityParams {
|
|
|
51
57
|
"notification.show": WebviewNotificationShowParams;
|
|
52
58
|
"preferences.get": WebviewPreferencesGetParams;
|
|
53
59
|
"preferences.set": WebviewPreferencesSetParams;
|
|
60
|
+
"extension.settings.all": Record<string, never>;
|
|
61
|
+
"extension.settings.get": WebviewExtensionSettingKeyParams;
|
|
62
|
+
"extension.settings.set": WebviewExtensionSettingSetParams;
|
|
63
|
+
"extension.settings.delete": WebviewExtensionSettingKeyParams;
|
|
54
64
|
"host.dispatchKeyboardEvent": WebviewKeyboardEventParams;
|
|
55
65
|
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export declare const workbenchMenuTargets: readonly ["workbench.top.actions", "workbench.top.overflow", "workbench.commandPalette"];
|
|
2
|
+
export declare const workbenchTreeTargets: readonly ["workbench.left.tree", "workbench.main.left.tree", "workbench.main.right.tree"];
|
|
3
|
+
export declare const workbenchViewTargets: readonly ["workbench.main", "workbench.main.left", "workbench.main.right", "workbench.main.bottom"];
|
|
4
|
+
export declare const workbenchSettingsTargets: readonly ["workbench.settings"];
|
|
5
|
+
export declare const workbenchSettingsScopes: readonly ["project", "global"];
|
|
6
|
+
export declare const workbenchModeLayoutTargets: readonly ["workbench.left", "workbench.main.left", "workbench.main", "workbench.main.right", "workbench.main.bottom"];
|
|
7
|
+
export type WorkbenchMenuTarget = (typeof workbenchMenuTargets)[number];
|
|
8
|
+
export type WorkbenchTreeTarget = (typeof workbenchTreeTargets)[number];
|
|
9
|
+
export type WorkbenchViewTarget = (typeof workbenchViewTargets)[number];
|
|
10
|
+
export type WorkbenchSettingsTarget = (typeof workbenchSettingsTargets)[number];
|
|
11
|
+
export type WorkbenchSettingsScope = (typeof workbenchSettingsScopes)[number];
|
|
12
|
+
export type WorkbenchModeLayoutTarget = (typeof workbenchModeLayoutTargets)[number];
|
|
13
|
+
export type WorkbenchLayoutTarget = WorkbenchModeLayoutTarget;
|
|
14
|
+
export type WorkbenchAttachmentTarget = WorkbenchMenuTarget | WorkbenchTreeTarget | WorkbenchViewTarget | WorkbenchSettingsTarget;
|
|
15
|
+
export type WorkbenchContributionKind = "menu" | "treeItem" | "view" | "settings";
|
|
16
|
+
export type WorkbenchTargetGranularity = "surface" | "area" | "areaTree";
|
|
17
|
+
export interface WorkbenchTargetDefinition {
|
|
18
|
+
id: WorkbenchAttachmentTarget;
|
|
19
|
+
allowedKinds: readonly WorkbenchContributionKind[];
|
|
20
|
+
granularity: WorkbenchTargetGranularity;
|
|
21
|
+
rationale: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const workbenchTargets: readonly [{
|
|
24
|
+
readonly id: "workbench.top.actions";
|
|
25
|
+
readonly allowedKinds: readonly ["menu"];
|
|
26
|
+
readonly granularity: "surface";
|
|
27
|
+
readonly rationale: "Primary command surface in the host-owned top workbench chrome.";
|
|
28
|
+
}, {
|
|
29
|
+
readonly id: "workbench.top.overflow";
|
|
30
|
+
readonly allowedKinds: readonly ["menu"];
|
|
31
|
+
readonly granularity: "surface";
|
|
32
|
+
readonly rationale: "Secondary command surface in the host-owned top workbench chrome.";
|
|
33
|
+
}, {
|
|
34
|
+
readonly id: "workbench.commandPalette";
|
|
35
|
+
readonly allowedKinds: readonly ["menu"];
|
|
36
|
+
readonly granularity: "surface";
|
|
37
|
+
readonly rationale: "Global command discovery surface owned by the workbench.";
|
|
38
|
+
}, {
|
|
39
|
+
readonly id: "workbench.left.tree";
|
|
40
|
+
readonly allowedKinds: readonly ["treeItem"];
|
|
41
|
+
readonly granularity: "areaTree";
|
|
42
|
+
readonly rationale: "Tree entries for the active tree renderer mounted in the left area.";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "workbench.main.left.tree";
|
|
45
|
+
readonly allowedKinds: readonly ["treeItem"];
|
|
46
|
+
readonly granularity: "areaTree";
|
|
47
|
+
readonly rationale: "Tree entries for the active tree renderer mounted in the main-left area.";
|
|
48
|
+
}, {
|
|
49
|
+
readonly id: "workbench.main.right.tree";
|
|
50
|
+
readonly allowedKinds: readonly ["treeItem"];
|
|
51
|
+
readonly granularity: "areaTree";
|
|
52
|
+
readonly rationale: "Tree entries for the active tree renderer mounted in the main-right area.";
|
|
53
|
+
}, {
|
|
54
|
+
readonly id: "workbench.main";
|
|
55
|
+
readonly allowedKinds: readonly ["view"];
|
|
56
|
+
readonly granularity: "area";
|
|
57
|
+
readonly rationale: "Direct extension view placement in the main area.";
|
|
58
|
+
}, {
|
|
59
|
+
readonly id: "workbench.main.left";
|
|
60
|
+
readonly allowedKinds: readonly ["view"];
|
|
61
|
+
readonly granularity: "area";
|
|
62
|
+
readonly rationale: "Direct extension view placement in the main-left area.";
|
|
63
|
+
}, {
|
|
64
|
+
readonly id: "workbench.main.right";
|
|
65
|
+
readonly allowedKinds: readonly ["view"];
|
|
66
|
+
readonly granularity: "area";
|
|
67
|
+
readonly rationale: "Direct extension view placement in the main-right area.";
|
|
68
|
+
}, {
|
|
69
|
+
readonly id: "workbench.main.bottom";
|
|
70
|
+
readonly allowedKinds: readonly ["view"];
|
|
71
|
+
readonly granularity: "area";
|
|
72
|
+
readonly rationale: "Direct extension view placement in the main-bottom area.";
|
|
73
|
+
}, {
|
|
74
|
+
readonly id: "workbench.settings";
|
|
75
|
+
readonly allowedKinds: readonly ["settings"];
|
|
76
|
+
readonly granularity: "surface";
|
|
77
|
+
readonly rationale: "Settings panel placement in host-owned settings navigation.";
|
|
78
|
+
}];
|
|
79
|
+
export declare const getWorkbenchTargetDefinition: (id: string) => {
|
|
80
|
+
readonly id: "workbench.top.actions";
|
|
81
|
+
readonly allowedKinds: readonly ["menu"];
|
|
82
|
+
readonly granularity: "surface";
|
|
83
|
+
readonly rationale: "Primary command surface in the host-owned top workbench chrome.";
|
|
84
|
+
} | {
|
|
85
|
+
readonly id: "workbench.top.overflow";
|
|
86
|
+
readonly allowedKinds: readonly ["menu"];
|
|
87
|
+
readonly granularity: "surface";
|
|
88
|
+
readonly rationale: "Secondary command surface in the host-owned top workbench chrome.";
|
|
89
|
+
} | {
|
|
90
|
+
readonly id: "workbench.commandPalette";
|
|
91
|
+
readonly allowedKinds: readonly ["menu"];
|
|
92
|
+
readonly granularity: "surface";
|
|
93
|
+
readonly rationale: "Global command discovery surface owned by the workbench.";
|
|
94
|
+
} | {
|
|
95
|
+
readonly id: "workbench.left.tree";
|
|
96
|
+
readonly allowedKinds: readonly ["treeItem"];
|
|
97
|
+
readonly granularity: "areaTree";
|
|
98
|
+
readonly rationale: "Tree entries for the active tree renderer mounted in the left area.";
|
|
99
|
+
} | {
|
|
100
|
+
readonly id: "workbench.main.left.tree";
|
|
101
|
+
readonly allowedKinds: readonly ["treeItem"];
|
|
102
|
+
readonly granularity: "areaTree";
|
|
103
|
+
readonly rationale: "Tree entries for the active tree renderer mounted in the main-left area.";
|
|
104
|
+
} | {
|
|
105
|
+
readonly id: "workbench.main.right.tree";
|
|
106
|
+
readonly allowedKinds: readonly ["treeItem"];
|
|
107
|
+
readonly granularity: "areaTree";
|
|
108
|
+
readonly rationale: "Tree entries for the active tree renderer mounted in the main-right area.";
|
|
109
|
+
} | {
|
|
110
|
+
readonly id: "workbench.main";
|
|
111
|
+
readonly allowedKinds: readonly ["view"];
|
|
112
|
+
readonly granularity: "area";
|
|
113
|
+
readonly rationale: "Direct extension view placement in the main area.";
|
|
114
|
+
} | {
|
|
115
|
+
readonly id: "workbench.main.left";
|
|
116
|
+
readonly allowedKinds: readonly ["view"];
|
|
117
|
+
readonly granularity: "area";
|
|
118
|
+
readonly rationale: "Direct extension view placement in the main-left area.";
|
|
119
|
+
} | {
|
|
120
|
+
readonly id: "workbench.main.right";
|
|
121
|
+
readonly allowedKinds: readonly ["view"];
|
|
122
|
+
readonly granularity: "area";
|
|
123
|
+
readonly rationale: "Direct extension view placement in the main-right area.";
|
|
124
|
+
} | {
|
|
125
|
+
readonly id: "workbench.main.bottom";
|
|
126
|
+
readonly allowedKinds: readonly ["view"];
|
|
127
|
+
readonly granularity: "area";
|
|
128
|
+
readonly rationale: "Direct extension view placement in the main-bottom area.";
|
|
129
|
+
} | {
|
|
130
|
+
readonly id: "workbench.settings";
|
|
131
|
+
readonly allowedKinds: readonly ["settings"];
|
|
132
|
+
readonly granularity: "surface";
|
|
133
|
+
readonly rationale: "Settings panel placement in host-owned settings navigation.";
|
|
134
|
+
} | undefined;
|
package/dist/hooks/attempt.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { BaseHookContext } from "./base";
|
|
2
2
|
import type { HookTicket, HookWorkspace } from "./entities";
|
|
3
|
+
/** @deprecated Legacy ticket attempt hook context. Workspace status automation is extension-owned. */
|
|
3
4
|
export type AttemptStatusChangeContext = BaseHookContext & {
|
|
4
5
|
workspace: HookWorkspace;
|
|
5
6
|
workspaceId: string;
|
|
6
7
|
prompts: Record<string, string>;
|
|
8
|
+
/** @deprecated Legacy ticket linkage. Ticket data is owned by the pstdio tickets extension. */
|
|
7
9
|
ticket?: HookTicket;
|
|
8
10
|
worktreePath?: string;
|
|
9
11
|
branch?: string;
|
package/dist/hooks/entities.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Ticket, Workspace } from "../resources";
|
|
2
|
+
/** @deprecated Legacy core ticket hook entity. Ticket data is owned by the pstdio tickets extension. */
|
|
2
3
|
export type HookTicket = Ticket & {
|
|
3
4
|
status_name: string | null;
|
|
4
5
|
};
|
|
5
6
|
export type HookWorkspace = Workspace & {
|
|
7
|
+
/** @deprecated Legacy ticket-workspace linkage. Ticket data is owned by the pstdio tickets extension. */
|
|
6
8
|
ticket_shorthand: string;
|
|
7
9
|
attempt_status_name: string | null;
|
|
8
10
|
};
|
package/dist/hooks/ticket.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BaseHookContext } from "./base";
|
|
2
|
+
/** @deprecated Legacy core ticket hook context. Ticket lifecycle is owned by the pstdio tickets extension. */
|
|
2
3
|
export type TicketContext = BaseHookContext & {
|
|
3
4
|
id: string;
|
|
4
5
|
shorthand: string;
|
|
@@ -12,11 +13,13 @@ export type TicketContext = BaseHookContext & {
|
|
|
12
13
|
tagNames: string[];
|
|
13
14
|
fileIds: string[];
|
|
14
15
|
};
|
|
16
|
+
/** @deprecated Legacy core ticket hook context. Ticket lifecycle is owned by the pstdio tickets extension. */
|
|
15
17
|
export type TicketCreationContext = Omit<TicketContext, "id" | "shorthand"> & {
|
|
16
18
|
id: null;
|
|
17
19
|
shorthand: null;
|
|
18
20
|
content: string | null;
|
|
19
21
|
};
|
|
22
|
+
/** @deprecated Legacy core ticket hook context. Ticket lifecycle is owned by the pstdio tickets extension. */
|
|
20
23
|
export type TicketStatusChangeContext = TicketContext & {
|
|
21
24
|
fromStatus: string | null;
|
|
22
25
|
toStatus: string | null;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export type { Repo } from "pstdio-api-contracts";
|
|
2
2
|
export type { AgentAvailabilityType, AgentConfig, AgentInfo, AgentModel } from "./agent";
|
|
3
3
|
export type { FileRecord } from "./file";
|
|
4
|
+
export type { KnownAgent, KnownAgentId } from "./known-agents";
|
|
5
|
+
export { findAgent, isKnownAgentId, KNOWN_AGENT_IDS, KNOWN_AGENTS } from "./known-agents";
|
|
4
6
|
export type { Project } from "./project";
|
|
5
7
|
export type { Session, SessionStatus } from "./session";
|
|
8
|
+
export type { Settings } from "./settings";
|
|
6
9
|
export type { Skill, SkillFile, SkillWithContent } from "./skill";
|
|
7
10
|
export type { AttemptStatus, Status } from "./status";
|
|
8
11
|
export type { Tag, TagOption } from "./tag";
|
package/dist/resources/index.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/resources/known-agents.ts
|
|
2
|
+
var KNOWN_AGENTS = [
|
|
3
|
+
{
|
|
4
|
+
id: "claude-code",
|
|
5
|
+
name: "Claude Code",
|
|
6
|
+
binary: "claude",
|
|
7
|
+
skillsDir: ".claude/skills",
|
|
8
|
+
globalSkillsDir: ".claude/skills"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: "opencode",
|
|
12
|
+
name: "OpenCode",
|
|
13
|
+
binary: "opencode",
|
|
14
|
+
skillsDir: ".agents/skills",
|
|
15
|
+
globalSkillsDir: ".agents/skills"
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
var KNOWN_AGENT_IDS = KNOWN_AGENTS.map((agent) => agent.id);
|
|
19
|
+
var findAgent = (id) => KNOWN_AGENTS.find((agent) => agent.id === id) ?? null;
|
|
20
|
+
var isKnownAgentId = (id) => KNOWN_AGENT_IDS.includes(id);
|
|
21
|
+
export {
|
|
22
|
+
isKnownAgentId,
|
|
23
|
+
findAgent,
|
|
24
|
+
KNOWN_AGENT_IDS,
|
|
25
|
+
KNOWN_AGENTS
|
|
26
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type KnownAgentId = "claude-code" | "opencode" | "fake";
|
|
2
|
+
export type KnownAgent = {
|
|
3
|
+
id: KnownAgentId;
|
|
4
|
+
name: string;
|
|
5
|
+
binary: string;
|
|
6
|
+
skillsDir: string;
|
|
7
|
+
globalSkillsDir: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const KNOWN_AGENTS: KnownAgent[];
|
|
10
|
+
export declare const KNOWN_AGENT_IDS: KnownAgentId[];
|
|
11
|
+
export declare const findAgent: (id: string) => KnownAgent | null;
|
|
12
|
+
export declare const isKnownAgentId: (id: string) => id is KnownAgentId;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Settings } from "pstdio-api-contracts";
|
package/dist/resources/tag.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Workspace as ContractWorkspace, WorkspaceListItem as ContractWorkspaceListItem } from "pstdio-api-contracts";
|
|
2
|
+
export type Workspace = ContractWorkspace;
|
|
3
|
+
/** @deprecated Includes legacy ticket-workspace linkage. Ticket ownership is moving to the pstdio tickets extension. */
|
|
4
|
+
export type WorkspaceListItem = ContractWorkspaceListItem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pstdio/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/pufflyai/prompt-studio"
|
|
@@ -29,10 +29,6 @@
|
|
|
29
29
|
"types": "./dist/extensions/index.d.ts",
|
|
30
30
|
"import": "./dist/extensions/index.js"
|
|
31
31
|
},
|
|
32
|
-
"./plugins": {
|
|
33
|
-
"types": "./dist/plugins/index.d.ts",
|
|
34
|
-
"import": "./dist/plugins/index.js"
|
|
35
|
-
},
|
|
36
32
|
"./prompts": {
|
|
37
33
|
"types": "./dist/prompts/index.d.ts",
|
|
38
34
|
"import": "./dist/prompts/index.js"
|
|
@@ -44,7 +40,7 @@
|
|
|
44
40
|
},
|
|
45
41
|
"scripts": {
|
|
46
42
|
"build": "rm -rf ./dist && bun run build:js && bun run build:types",
|
|
47
|
-
"build:js": "bun build ./src/api/index.ts ./src/client/index.ts ./src/extensions/index.ts ./src/
|
|
43
|
+
"build:js": "bun build ./src/api/index.ts ./src/client/index.ts ./src/extensions/index.ts ./src/prompts/index.ts ./src/hooks/index.ts ./src/resources/index.ts --outdir ./dist --root ./src --target node --format esm --packages external",
|
|
48
44
|
"build:types": "tsc --project ./tsconfig.build.json",
|
|
49
45
|
"prepack": "bun run build",
|
|
50
46
|
"typecheck": "tsc --noEmit",
|
package/dist/api/actions.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TargetType } from "../plugins/types";
|
|
2
|
-
export type ExecuteActionInput = {
|
|
3
|
-
target_type: TargetType;
|
|
4
|
-
target_id: string;
|
|
5
|
-
};
|
|
6
|
-
export type ActionResult = {
|
|
7
|
-
status: "success";
|
|
8
|
-
session_id?: string;
|
|
9
|
-
message?: string;
|
|
10
|
-
} | {
|
|
11
|
-
status: "error";
|
|
12
|
-
message: string;
|
|
13
|
-
};
|
package/dist/client/actions.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ActionResult, ExecuteActionInput } from "../api/actions";
|
|
2
|
-
import type { ActionDescriptor, TargetType } from "../plugins/types";
|
|
3
|
-
import type { RequestFn } from "./request";
|
|
4
|
-
export type ActionClient = {
|
|
5
|
-
list(projectId: string, targetType?: TargetType): Promise<ActionDescriptor[]>;
|
|
6
|
-
execute(projectId: string, actionKey: string, input: ExecuteActionInput): Promise<ActionResult>;
|
|
7
|
-
};
|
|
8
|
-
export declare const createActionClient: (request: RequestFn) => ActionClient;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { BaseHookContext } from "../../hooks/base";
|
|
2
|
-
import type { ActionTriggerContext } from "../types";
|
|
3
|
-
export type PluginHelperContext = Pick<BaseHookContext, "client" | "projectId"> | ActionTriggerContext;
|
|
4
|
-
export type TicketRef = {
|
|
5
|
-
ticketId?: string;
|
|
6
|
-
};
|
|
7
|
-
export type WorkspaceRef = {
|
|
8
|
-
workspaceId?: string;
|
|
9
|
-
};
|
|
10
|
-
type TicketLike = {
|
|
11
|
-
id: string;
|
|
12
|
-
shorthand: string;
|
|
13
|
-
};
|
|
14
|
-
type WorkspaceLike = {
|
|
15
|
-
id: string;
|
|
16
|
-
workspace_shorthand: string;
|
|
17
|
-
};
|
|
18
|
-
export declare const firstMatch: <T extends {
|
|
19
|
-
id: string;
|
|
20
|
-
}>(values: T[], ref: string | undefined, readName: (value: T) => string) => T | null;
|
|
21
|
-
export declare const readTicketFromContext: (ctx: PluginHelperContext, ref: string | undefined) => TicketLike | null;
|
|
22
|
-
export declare const readWorkspaceFromContext: (ctx: PluginHelperContext, ref: string | undefined) => WorkspaceLike | null;
|
|
23
|
-
export declare const resolveSessionIdFromContext: (ctx: PluginHelperContext) => string | null;
|
|
24
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { CreateTicketAttemptInput } from "../../api/tickets";
|
|
2
|
-
import type { PluginHelperContext, TicketRef } from "./context";
|
|
3
|
-
type CreateAttemptHelperInput = TicketRef & Omit<CreateTicketAttemptInput, "start_session">;
|
|
4
|
-
export declare const createAttempt: (ctx: PluginHelperContext, input: CreateAttemptHelperInput) => Promise<import("../../api").TicketAttemptResponse | null>;
|
|
5
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { CreateSessionInput } from "../../api/sessions";
|
|
2
|
-
import type { PluginHelperContext } from "./context";
|
|
3
|
-
type CreateSessionHelperInput = Omit<CreateSessionInput, "project_id">;
|
|
4
|
-
export declare const createSession: (ctx: PluginHelperContext, input: CreateSessionHelperInput) => Promise<{
|
|
5
|
-
id: string;
|
|
6
|
-
project_id: string | null;
|
|
7
|
-
title: string;
|
|
8
|
-
status: "in_progress" | "awaiting_input" | "queued" | "completed" | "failed" | "cancelled" | "disconnected";
|
|
9
|
-
archived: boolean;
|
|
10
|
-
last_request_started: string | null;
|
|
11
|
-
last_request_ended: string | null;
|
|
12
|
-
agent: string | null;
|
|
13
|
-
last_selected_model: string | null;
|
|
14
|
-
agent_session_id: string | null;
|
|
15
|
-
session_file_id: string | null;
|
|
16
|
-
original_session_id: string | null;
|
|
17
|
-
cwd: string | null;
|
|
18
|
-
created_at: string;
|
|
19
|
-
updated_at: string;
|
|
20
|
-
}>;
|
|
21
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { CreateTicketAttemptInput } from "../../api/tickets";
|
|
2
|
-
import type { PluginHelperContext, TicketRef } from "./context";
|
|
3
|
-
type CreateWorkspaceHelperInput = TicketRef & Omit<CreateTicketAttemptInput, "agent" | "model" | "prompt" | "start_session">;
|
|
4
|
-
export declare const createWorkspace: (ctx: PluginHelperContext, input: CreateWorkspaceHelperInput) => Promise<import("../../api").TicketAttemptResponse | null>;
|
|
5
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type PluginHelperContext, type TicketRef } from "./context";
|
|
2
|
-
export declare const findTicketByRef: (ctx: PluginHelperContext, input: TicketRef) => Promise<{
|
|
3
|
-
id: string;
|
|
4
|
-
shorthand: string;
|
|
5
|
-
} | null>;
|
|
6
|
-
export declare const resolveTicketShorthand: (ctx: PluginHelperContext, input: TicketRef) => Promise<string | null>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { FollowUpInput } from "../../api/sessions";
|
|
2
|
-
import { type PluginHelperContext } from "./context";
|
|
3
|
-
type FollowupSessionHelperInput = FollowUpInput & {
|
|
4
|
-
sessionId?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const followupSession: (ctx: PluginHelperContext, input: FollowupSessionHelperInput) => Promise<{
|
|
7
|
-
id: string;
|
|
8
|
-
project_id: string | null;
|
|
9
|
-
title: string;
|
|
10
|
-
status: "in_progress" | "awaiting_input" | "queued" | "completed" | "failed" | "cancelled" | "disconnected";
|
|
11
|
-
archived: boolean;
|
|
12
|
-
last_request_started: string | null;
|
|
13
|
-
last_request_ended: string | null;
|
|
14
|
-
agent: string | null;
|
|
15
|
-
last_selected_model: string | null;
|
|
16
|
-
agent_session_id: string | null;
|
|
17
|
-
session_file_id: string | null;
|
|
18
|
-
original_session_id: string | null;
|
|
19
|
-
cwd: string | null;
|
|
20
|
-
created_at: string;
|
|
21
|
-
updated_at: string;
|
|
22
|
-
follow_up: {
|
|
23
|
-
status: "dispatched";
|
|
24
|
-
} | {
|
|
25
|
-
status: "queued";
|
|
26
|
-
queue_position: number;
|
|
27
|
-
};
|
|
28
|
-
}>;
|
|
29
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { PluginHelperContext, TicketRef } from "./context";
|
|
2
|
-
export declare const getAttemptsForTicket: (ctx: PluginHelperContext, input: TicketRef) => Promise<{
|
|
3
|
-
id: string;
|
|
4
|
-
project_id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
branch: string | null;
|
|
7
|
-
worktree_path: string | null;
|
|
8
|
-
attempt_status_id: string | null;
|
|
9
|
-
archived: boolean;
|
|
10
|
-
workspace_shorthand: string;
|
|
11
|
-
startup_log_file_id: string | null;
|
|
12
|
-
created_at: string;
|
|
13
|
-
updated_at: string;
|
|
14
|
-
deleted_at: string | null;
|
|
15
|
-
ticket_shorthand: string;
|
|
16
|
-
attempt_status_name: string | null;
|
|
17
|
-
}[]>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { createAttempt } from "./create-attempt";
|
|
2
|
-
export { createSession } from "./create-session";
|
|
3
|
-
export { createWorkspace } from "./create-workspace";
|
|
4
|
-
export { findTicketByRef } from "./find-ticket-by-ref";
|
|
5
|
-
export { findWorkspaceByRef } from "./find-workspace-by-ref";
|
|
6
|
-
export { followupSession } from "./followup-session";
|
|
7
|
-
export { getAttemptsForTicket } from "./get-attempts-for-ticket";
|
|
8
|
-
export { removeAllWorktreesForTicket } from "./remove-all-worktrees-for-ticket";
|
|
9
|
-
export { runCommand } from "./run-command";
|
|
10
|
-
export { type SaveTicketInput, type SaveTicketResult, saveTicket } from "./save-ticket";
|
|
11
|
-
export { setTicketStatus } from "./set-ticket-status";
|
|
12
|
-
export { setWorkspaceAttemptStatus } from "./set-workspace-attempt-status";
|
|
13
|
-
export { type PullTicketsInput, type PullTicketsResult, pullTickets } from "./ticket-pull";
|
|
14
|
-
export { updateTicketWhenAllAttemptsMatch } from "./update-ticket-when-all-attempts-match";
|
|
15
|
-
export { workspacesForTicket } from "./workspaces-for-ticket";
|
|
16
|
-
export { bootstrapWorktree } from "./worktree-bootstrap";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type CommandOutputOptions = {
|
|
2
|
-
env?: NodeJS.ProcessEnv;
|
|
3
|
-
quiet?: boolean;
|
|
4
|
-
};
|
|
5
|
-
export declare const runCommand: (cwd: string, command: string[], options?: CommandOutputOptions) => Promise<{
|
|
6
|
-
exitCode: number;
|
|
7
|
-
stdout: string;
|
|
8
|
-
stderr: string;
|
|
9
|
-
}>;
|
|
10
|
-
export {};
|