@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.
Files changed (74) hide show
  1. package/README.md +27 -188
  2. package/dist/api/extensions.d.ts +1 -1
  3. package/dist/api/index.d.ts +2 -2
  4. package/dist/api/settings.d.ts +1 -0
  5. package/dist/api/statuses.d.ts +1 -0
  6. package/dist/api/tags.d.ts +1 -0
  7. package/dist/api/tickets.d.ts +3 -0
  8. package/dist/api/workspaces.d.ts +10 -1
  9. package/dist/client/client.d.ts +7 -2
  10. package/dist/client/index.d.ts +5 -3
  11. package/dist/client/index.js +285 -31
  12. package/dist/client/projects.d.ts +0 -11
  13. package/dist/client/request.d.ts +9 -0
  14. package/dist/client/sessions.d.ts +25 -3
  15. package/dist/client/settings.d.ts +7 -0
  16. package/dist/client/sse.d.ts +15 -0
  17. package/dist/client/statuses.d.ts +2 -0
  18. package/dist/client/sync.d.ts +35 -0
  19. package/dist/client/tags.d.ts +2 -0
  20. package/dist/client/tickets.d.ts +6 -1
  21. package/dist/client/workspaces.d.ts +2 -0
  22. package/dist/extensions/define-command.d.ts +1 -1
  23. package/dist/extensions/define-extension.d.ts +50 -7
  24. package/dist/extensions/index.d.ts +3 -2
  25. package/dist/extensions/index.js +151 -11
  26. package/dist/extensions/kernel-slots.d.ts +131 -10
  27. package/dist/extensions/params.d.ts +19 -12
  28. package/dist/extensions/refs.d.ts +3 -3
  29. package/dist/extensions/slots.d.ts +1 -9
  30. package/dist/extensions/types/commands.d.ts +8 -0
  31. package/dist/extensions/types/context.d.ts +225 -18
  32. package/dist/extensions/types/contributions.d.ts +183 -10
  33. package/dist/extensions/types/extension.d.ts +16 -10
  34. package/dist/extensions/types/params.d.ts +43 -29
  35. package/dist/extensions/types/slots.d.ts +1 -1
  36. package/dist/extensions/types/webview-capabilities.d.ts +12 -2
  37. package/dist/extensions/workbench-targets.d.ts +134 -0
  38. package/dist/hooks/attempt.d.ts +2 -0
  39. package/dist/hooks/entities.d.ts +2 -0
  40. package/dist/hooks/ticket.d.ts +3 -0
  41. package/dist/resources/index.d.ts +3 -0
  42. package/dist/resources/index.js +26 -0
  43. package/dist/resources/known-agents.d.ts +12 -0
  44. package/dist/resources/settings.d.ts +1 -0
  45. package/dist/resources/status.d.ts +1 -0
  46. package/dist/resources/tag.d.ts +1 -0
  47. package/dist/resources/ticket.d.ts +1 -0
  48. package/dist/resources/workspace.d.ts +4 -1
  49. package/package.json +2 -6
  50. package/dist/api/actions.d.ts +0 -13
  51. package/dist/client/actions.d.ts +0 -8
  52. package/dist/plugins/define-plugin.d.ts +0 -2
  53. package/dist/plugins/helpers/context.d.ts +0 -24
  54. package/dist/plugins/helpers/create-attempt.d.ts +0 -5
  55. package/dist/plugins/helpers/create-session.d.ts +0 -21
  56. package/dist/plugins/helpers/create-workspace.d.ts +0 -5
  57. package/dist/plugins/helpers/find-ticket-by-ref.d.ts +0 -6
  58. package/dist/plugins/helpers/find-workspace-by-ref.d.ts +0 -5
  59. package/dist/plugins/helpers/followup-session.d.ts +0 -29
  60. package/dist/plugins/helpers/get-attempts-for-ticket.d.ts +0 -17
  61. package/dist/plugins/helpers/index.d.ts +0 -16
  62. package/dist/plugins/helpers/remove-all-worktrees-for-ticket.d.ts +0 -2
  63. package/dist/plugins/helpers/run-command.d.ts +0 -10
  64. package/dist/plugins/helpers/save-ticket.d.ts +0 -14
  65. package/dist/plugins/helpers/set-ticket-status.d.ts +0 -7
  66. package/dist/plugins/helpers/set-workspace-attempt-status.d.ts +0 -7
  67. package/dist/plugins/helpers/ticket-pull.d.ts +0 -18
  68. package/dist/plugins/helpers/update-ticket-when-all-attempts-match.d.ts +0 -7
  69. package/dist/plugins/helpers/workspaces-for-ticket.d.ts +0 -17
  70. package/dist/plugins/helpers/worktree-bootstrap.d.ts +0 -8
  71. package/dist/plugins/hooks.d.ts +0 -42
  72. package/dist/plugins/index.d.ts +0 -5
  73. package/dist/plugins/index.js +0 -739
  74. package/dist/plugins/types.d.ts +0 -112
@@ -1,112 +0,0 @@
1
- import type { PstdioClient } from "../client/client";
2
- import type { Session } from "../resources/session";
3
- import type { TicketListItem } from "../resources/ticket";
4
- import type { WorkspaceListItem } from "../resources/workspace";
5
- import type { PluginHooks } from "./hooks";
6
- export type TargetType = "ticket" | "workspace" | "session";
7
- export type ActionPlacement = "primary" | "secondary" | "overflow";
8
- type ActionParamBase = {
9
- key: string;
10
- label: string;
11
- description?: string;
12
- required?: boolean;
13
- defaultValue?: string;
14
- };
15
- export type TextActionParam = ActionParamBase & {
16
- type: "text";
17
- };
18
- export type LongTextActionParam = ActionParamBase & {
19
- type: "longtext";
20
- };
21
- export type SelectActionParam = ActionParamBase & {
22
- type: "select";
23
- options: {
24
- value: string;
25
- label: string;
26
- }[];
27
- };
28
- export type TemplateSelectActionParam = ActionParamBase & {
29
- type: "template-select";
30
- templateType: string;
31
- };
32
- export type AgentActionParam = ActionParamBase & {
33
- type: "agent";
34
- };
35
- export type RepoActionParam = ActionParamBase & {
36
- type: "repo";
37
- };
38
- export type ActionParamDef = TextActionParam | LongTextActionParam | SelectActionParam | TemplateSelectActionParam | AgentActionParam | RepoActionParam;
39
- export type AgentParamValue = {
40
- agent: string;
41
- model: string;
42
- };
43
- export type RepoParamValue = {
44
- repo: string;
45
- branch: string;
46
- };
47
- export type ActionParamValue = string | AgentParamValue | RepoParamValue;
48
- export type ActionTargetMap = {
49
- ticket: TicketListItem;
50
- workspace: WorkspaceListItem;
51
- session: Session;
52
- };
53
- type ActionTriggerContextBase = {
54
- client: PstdioClient;
55
- projectId: string;
56
- prompts: Record<string, string>;
57
- params: Record<string, ActionParamValue>;
58
- };
59
- export type ActionTriggerContext<TTargetType extends TargetType = TargetType> = ActionTriggerContextBase & (TTargetType extends TargetType ? {
60
- targetType: TTargetType;
61
- targetId: string;
62
- target: ActionTargetMap[TTargetType];
63
- } : never);
64
- export type ActionTriggerResult = {
65
- session_id?: string;
66
- message?: string;
67
- };
68
- type ActionTrigger<TTargetType extends TargetType = TargetType> = ((ctx: ActionTriggerContext<TTargetType>) => void) | ((ctx: ActionTriggerContext<TTargetType>) => ActionTriggerResult) | ((ctx: ActionTriggerContext<TTargetType>) => Promise<ActionTriggerResult | undefined>);
69
- export type ActionInput = {
70
- [K in TargetType]: {
71
- key: string;
72
- label: string;
73
- targetType: K;
74
- placement: ActionPlacement;
75
- params?: ActionParamDef[];
76
- trigger: ActionTrigger<K>;
77
- };
78
- }[TargetType];
79
- export type ActionDescriptor = {
80
- key: string;
81
- label: string;
82
- targetType: TargetType;
83
- placement: ActionPlacement;
84
- params?: ActionParamDef[];
85
- };
86
- export type ActionDefinition = ActionDescriptor & {
87
- trigger: ActionTrigger;
88
- };
89
- export type ScheduledTriggerContext = {
90
- client: PstdioClient;
91
- projectId: string;
92
- trigger: {
93
- type: "schedule";
94
- };
95
- scheduleName: string;
96
- scheduledFor: string;
97
- runId: string;
98
- };
99
- type ScheduleHandler = (ctx: ScheduledTriggerContext) => void | Promise<void>;
100
- export type ScheduleDefinition = {
101
- name: string;
102
- cron: string;
103
- timeoutMs?: number;
104
- handler: ScheduleHandler;
105
- };
106
- export type PluginDefinition = {
107
- key?: string;
108
- actions?: ActionInput[];
109
- hooks?: PluginHooks;
110
- schedules?: ScheduleDefinition[];
111
- };
112
- export {};