@pstdio/sdk 0.8.0 → 0.10.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.
Files changed (66) hide show
  1. package/README.md +37 -184
  2. package/dist/api/extensions.d.ts +1 -1
  3. package/dist/api/index.d.ts +1 -2
  4. package/dist/api/statuses.d.ts +1 -0
  5. package/dist/api/tags.d.ts +1 -0
  6. package/dist/api/tickets.d.ts +3 -0
  7. package/dist/api/workspaces.d.ts +10 -1
  8. package/dist/client/client.d.ts +3 -2
  9. package/dist/client/index.d.ts +0 -1
  10. package/dist/client/index.js +0 -12
  11. package/dist/client/projects.d.ts +0 -11
  12. package/dist/client/statuses.d.ts +2 -0
  13. package/dist/client/tags.d.ts +2 -0
  14. package/dist/client/tickets.d.ts +2 -0
  15. package/dist/client/workspaces.d.ts +2 -0
  16. package/dist/extensions/define-command.d.ts +1 -1
  17. package/dist/extensions/define-extension.d.ts +50 -7
  18. package/dist/extensions/index.d.ts +3 -2
  19. package/dist/extensions/index.js +120 -11
  20. package/dist/extensions/kernel-slots.d.ts +36 -35
  21. package/dist/extensions/params.d.ts +19 -12
  22. package/dist/extensions/refs.d.ts +3 -3
  23. package/dist/extensions/slots.d.ts +1 -9
  24. package/dist/extensions/types/commands.d.ts +8 -0
  25. package/dist/extensions/types/context.d.ts +191 -12
  26. package/dist/extensions/types/contributions.d.ts +183 -10
  27. package/dist/extensions/types/extension.d.ts +16 -10
  28. package/dist/extensions/types/params.d.ts +43 -29
  29. package/dist/extensions/types/slots.d.ts +1 -1
  30. package/dist/extensions/types/webview-capabilities.d.ts +12 -2
  31. package/dist/extensions/workbench-targets.d.ts +134 -0
  32. package/dist/hooks/attempt.d.ts +2 -0
  33. package/dist/hooks/entities.d.ts +2 -0
  34. package/dist/hooks/index.d.ts +1 -1
  35. package/dist/hooks/ticket.d.ts +3 -0
  36. package/dist/resources/index.js +2 -2
  37. package/dist/resources/status.d.ts +1 -0
  38. package/dist/resources/tag.d.ts +1 -0
  39. package/dist/resources/ticket.d.ts +1 -0
  40. package/dist/resources/workspace.d.ts +4 -1
  41. package/package.json +2 -6
  42. package/dist/api/actions.d.ts +0 -13
  43. package/dist/client/actions.d.ts +0 -8
  44. package/dist/plugins/define-plugin.d.ts +0 -2
  45. package/dist/plugins/helpers/context.d.ts +0 -24
  46. package/dist/plugins/helpers/create-attempt.d.ts +0 -5
  47. package/dist/plugins/helpers/create-session.d.ts +0 -21
  48. package/dist/plugins/helpers/create-workspace.d.ts +0 -5
  49. package/dist/plugins/helpers/find-ticket-by-ref.d.ts +0 -6
  50. package/dist/plugins/helpers/find-workspace-by-ref.d.ts +0 -5
  51. package/dist/plugins/helpers/followup-session.d.ts +0 -29
  52. package/dist/plugins/helpers/get-attempts-for-ticket.d.ts +0 -17
  53. package/dist/plugins/helpers/index.d.ts +0 -16
  54. package/dist/plugins/helpers/remove-all-worktrees-for-ticket.d.ts +0 -2
  55. package/dist/plugins/helpers/run-command.d.ts +0 -10
  56. package/dist/plugins/helpers/save-ticket.d.ts +0 -14
  57. package/dist/plugins/helpers/set-ticket-status.d.ts +0 -7
  58. package/dist/plugins/helpers/set-workspace-attempt-status.d.ts +0 -7
  59. package/dist/plugins/helpers/ticket-pull.d.ts +0 -18
  60. package/dist/plugins/helpers/update-ticket-when-all-attempts-match.d.ts +0 -7
  61. package/dist/plugins/helpers/workspaces-for-ticket.d.ts +0 -17
  62. package/dist/plugins/helpers/worktree-bootstrap.d.ts +0 -8
  63. package/dist/plugins/hooks.d.ts +0 -42
  64. package/dist/plugins/index.d.ts +0 -5
  65. package/dist/plugins/index.js +0 -739
  66. 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
- interface ParamBase<TValue> {
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 interface TextParam extends ParamBase<string> {
16
+ } & ParamRequired<TRequired>;
17
+ export type TextParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
12
18
  type: "text";
13
- }
14
- export interface LongTextParam extends ParamBase<string> {
19
+ };
20
+ export type LongTextParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<string, TRequired> & {
15
21
  type: "longtext";
16
- }
17
- export interface NumberParam extends ParamBase<number> {
22
+ };
23
+ export type NumberParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<number, TRequired> & {
18
24
  type: "number";
19
- }
20
- export interface BooleanParam extends ParamBase<boolean> {
25
+ };
26
+ export type BooleanParam<TRequired extends boolean | undefined = boolean | undefined> = ParamBase<boolean, TRequired> & {
21
27
  type: "boolean";
22
- }
23
- export interface SelectParam extends ParamBase<string> {
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 interface MultiSelectParam extends ParamBase<string[]> {
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 interface RepoParam extends ParamBase<{
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 interface HarnessParam extends ParamBase<{
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 interface TemplateParam extends ParamBase<string> {
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 interface ResourceParam extends ParamBase<ResourceRef> {
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 interface JsonParam<T = unknown> extends ParamBase<T> {
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 keyof TSchema]: ParamValue<TSchema[K]>;
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" | "navigation" | "view" | "settings" | "renderer";
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.nav.actions", "workbench.nav.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.secondary"];
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.secondary"];
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.nav.actions";
25
+ readonly allowedKinds: readonly ["menu"];
26
+ readonly granularity: "surface";
27
+ readonly rationale: "Primary command surface in the host-owned nav (top) workbench chrome.";
28
+ }, {
29
+ readonly id: "workbench.nav.overflow";
30
+ readonly allowedKinds: readonly ["menu"];
31
+ readonly granularity: "surface";
32
+ readonly rationale: "Secondary command surface in the host-owned nav (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.secondary";
70
+ readonly allowedKinds: readonly ["view"];
71
+ readonly granularity: "area";
72
+ readonly rationale: "Direct extension view placement in the secondary 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.nav.actions";
81
+ readonly allowedKinds: readonly ["menu"];
82
+ readonly granularity: "surface";
83
+ readonly rationale: "Primary command surface in the host-owned nav (top) workbench chrome.";
84
+ } | {
85
+ readonly id: "workbench.nav.overflow";
86
+ readonly allowedKinds: readonly ["menu"];
87
+ readonly granularity: "surface";
88
+ readonly rationale: "Secondary command surface in the host-owned nav (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.secondary";
126
+ readonly allowedKinds: readonly ["view"];
127
+ readonly granularity: "area";
128
+ readonly rationale: "Direct extension view placement in the secondary 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;
@@ -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;
@@ -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
  };
@@ -2,4 +2,4 @@ export type { AttemptStatusChangeContext } from "./attempt";
2
2
  export type { BaseHookContext, HookClient, HookPayload, SessionFollowupInput } from "./base";
3
3
  export type { SessionHookContext } from "./session";
4
4
  export type { TicketContext, TicketCreationContext, TicketStatusChangeContext } from "./ticket";
5
- export type { WorktreeContext, WorktreeCreateContext } from "./worktree";
5
+ export type { CommitContext, ConflictContext, MergeContext, RebaseContext, WorktreeContext, WorktreeCreateContext, WorktreeRemoveContext, } from "./worktree";
@@ -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;
@@ -11,8 +11,8 @@ var KNOWN_AGENTS = [
11
11
  id: "opencode",
12
12
  name: "OpenCode",
13
13
  binary: "opencode",
14
- skillsDir: ".opencode/skills",
15
- globalSkillsDir: ".opencode/skills"
14
+ skillsDir: ".agents/skills",
15
+ globalSkillsDir: ".agents/skills"
16
16
  }
17
17
  ];
18
18
  var KNOWN_AGENT_IDS = KNOWN_AGENTS.map((agent) => agent.id);
@@ -1 +1,2 @@
1
+ /** @deprecated Legacy core ticket status resources. Ticket statuses are owned by the pstdio tickets extension. */
1
2
  export type { AttemptStatus, Status } from "pstdio-api-contracts";
@@ -1 +1,2 @@
1
+ /** @deprecated Legacy core ticket tag resources. Ticket tags are owned by the pstdio tickets extension. */
1
2
  export type { Tag, TagOption } from "pstdio-api-contracts";
@@ -1 +1,2 @@
1
+ /** @deprecated Legacy core ticket resources. Ticket data is owned by the pstdio tickets extension. */
1
2
  export type { FileRecord as TicketFile, Ticket, TicketDetail, TicketListItem } from "pstdio-api-contracts";
@@ -1 +1,4 @@
1
- export type { Workspace, WorkspaceListItem } from "pstdio-api-contracts";
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.8.0",
3
+ "version": "0.10.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/plugins/index.ts ./src/prompts/index.ts ./src/hooks/index.ts ./src/resources/index.ts --outdir ./dist --root ./src --target node --format esm --packages external",
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",
@@ -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
- };
@@ -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,2 +0,0 @@
1
- import type { PluginDefinition } from "./types";
2
- export declare const definePlugin: (plugin: PluginDefinition) => PluginDefinition;
@@ -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,5 +0,0 @@
1
- import { type PluginHelperContext, type WorkspaceRef } from "./context";
2
- export declare const findWorkspaceByRef: (ctx: PluginHelperContext, input: WorkspaceRef) => Promise<{
3
- id: string;
4
- workspace_shorthand: string;
5
- } | 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,2 +0,0 @@
1
- import type { PluginHelperContext, TicketRef } from "./context";
2
- export declare const removeAllWorktreesForTicket: (ctx: PluginHelperContext, input: TicketRef) => Promise<number>;
@@ -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 {};
@@ -1,14 +0,0 @@
1
- import type { PluginHelperContext } from "./context";
2
- type SaveTicketInput = {
3
- rootPath: string;
4
- ticketId?: string;
5
- status?: string;
6
- tags?: string[];
7
- log?: (message: string) => void;
8
- };
9
- type SaveTicketResult = {
10
- ticketShorthand: string;
11
- uploadedFileCount: number;
12
- };
13
- export declare const saveTicket: (ctx: PluginHelperContext, input: SaveTicketInput) => Promise<SaveTicketResult>;
14
- export type { SaveTicketInput, SaveTicketResult };
@@ -1,7 +0,0 @@
1
- import type { PluginHelperContext } from "./context";
2
- type TicketStatusUpdateInput = {
3
- ticket: string;
4
- status: string;
5
- };
6
- export declare const setTicketStatus: (ctx: PluginHelperContext, input: TicketStatusUpdateInput) => Promise<boolean>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import type { PluginHelperContext, WorkspaceRef } from "./context";
2
- type WorkspaceAttemptStatusInput = WorkspaceRef & {
3
- statusName: string;
4
- sessionId?: string;
5
- };
6
- export declare const setWorkspaceAttemptStatus: (ctx: PluginHelperContext, input: WorkspaceAttemptStatusInput) => Promise<boolean>;
7
- export {};