@opencode-ai/sdk 1.2.27 → 1.3.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.
@@ -1,5 +1,5 @@
1
1
  import { type Client, type Options as Options2, type TDataShape } from "./client/index.js";
2
- import type { AgentPartInput, AppAgentsResponses, AppLogErrors, AppLogResponses, AppSkillsResponses, Auth as Auth3, AuthRemoveErrors, AuthRemoveResponses, AuthSetErrors, AuthSetResponses, CommandListResponses, Config as Config3, ConfigGetResponses, ConfigProvidersResponses, ConfigUpdateErrors, ConfigUpdateResponses, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalResourceListResponses, ExperimentalSessionListResponses, ExperimentalWorkspaceCreateErrors, ExperimentalWorkspaceCreateResponses, ExperimentalWorkspaceListResponses, ExperimentalWorkspaceRemoveErrors, ExperimentalWorkspaceRemoveResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalConfigGetResponses, GlobalConfigUpdateErrors, GlobalConfigUpdateResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, InstanceDisposeResponses, LspStatusResponses, McpAddErrors, McpAddResponses, McpAuthAuthenticateErrors, McpAuthAuthenticateResponses, McpAuthCallbackErrors, McpAuthCallbackResponses, McpAuthRemoveErrors, McpAuthRemoveResponses, McpAuthStartErrors, McpAuthStartResponses, McpConnectResponses, McpDisconnectResponses, McpLocalConfig, McpRemoteConfig, McpStatusResponses, OutputFormat, Part as Part2, PartDeleteErrors, PartDeleteResponses, PartUpdateErrors, PartUpdateResponses, PathGetResponses, PermissionListResponses, PermissionReplyErrors, PermissionReplyResponses, PermissionRespondErrors, PermissionRespondResponses, PermissionRuleset, ProjectCurrentResponses, ProjectInitGitResponses, ProjectListResponses, ProjectUpdateErrors, ProjectUpdateResponses, ProviderAuthResponses, ProviderListResponses, ProviderOauthAuthorizeErrors, ProviderOauthAuthorizeResponses, ProviderOauthCallbackErrors, ProviderOauthCallbackResponses, PtyConnectErrors, PtyConnectResponses, PtyCreateErrors, PtyCreateResponses, PtyGetErrors, PtyGetResponses, PtyListResponses, PtyRemoveErrors, PtyRemoveResponses, PtyUpdateErrors, PtyUpdateResponses, QuestionAnswer, QuestionListResponses, QuestionRejectErrors, QuestionRejectResponses, QuestionReplyErrors, QuestionReplyResponses, SessionAbortErrors, SessionAbortResponses, SessionChildrenErrors, SessionChildrenResponses, SessionCommandErrors, SessionCommandResponses, SessionCreateErrors, SessionCreateResponses, SessionDeleteErrors, SessionDeleteMessageErrors, SessionDeleteMessageResponses, SessionDeleteResponses, SessionDiffResponses, SessionForkResponses, SessionGetErrors, SessionGetResponses, SessionInitErrors, SessionInitResponses, SessionListResponses, SessionMessageErrors, SessionMessageResponses, SessionMessagesErrors, SessionMessagesResponses, SessionPromptAsyncErrors, SessionPromptAsyncResponses, SessionPromptErrors, SessionPromptResponses, SessionRevertErrors, SessionRevertResponses, SessionShareErrors, SessionShareResponses, SessionShellErrors, SessionShellResponses, SessionStatusErrors, SessionStatusResponses, SessionSummarizeErrors, SessionSummarizeResponses, SessionTodoErrors, SessionTodoResponses, SessionUnrevertErrors, SessionUnrevertResponses, SessionUnshareErrors, SessionUnshareResponses, SessionUpdateErrors, SessionUpdateResponses, SubtaskPartInput, TextPartInput, ToolIdsErrors, ToolIdsResponses, ToolListErrors, ToolListResponses, TuiAppendPromptErrors, TuiAppendPromptResponses, TuiClearPromptResponses, TuiControlNextResponses, TuiControlResponseResponses, TuiExecuteCommandErrors, TuiExecuteCommandResponses, TuiOpenHelpResponses, TuiOpenModelsResponses, TuiOpenSessionsResponses, TuiOpenThemesResponses, TuiPublishErrors, TuiPublishResponses, TuiSelectSessionErrors, TuiSelectSessionResponses, TuiShowToastResponses, TuiSubmitPromptResponses, VcsGetResponses, WorktreeCreateErrors, WorktreeCreateInput, WorktreeCreateResponses, WorktreeListResponses, WorktreeRemoveErrors, WorktreeRemoveInput, WorktreeRemoveResponses, WorktreeResetErrors, WorktreeResetInput, WorktreeResetResponses } from "./types.gen.js";
2
+ import type { AgentPartInput, AppAgentsResponses, AppLogErrors, AppLogResponses, AppSkillsResponses, Auth as Auth3, AuthRemoveErrors, AuthRemoveResponses, AuthSetErrors, AuthSetResponses, CommandListResponses, Config as Config3, ConfigGetResponses, ConfigProvidersResponses, ConfigUpdateErrors, ConfigUpdateResponses, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalResourceListResponses, ExperimentalSessionListResponses, ExperimentalWorkspaceCreateErrors, ExperimentalWorkspaceCreateResponses, ExperimentalWorkspaceListResponses, ExperimentalWorkspaceRemoveErrors, ExperimentalWorkspaceRemoveResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalConfigGetResponses, GlobalConfigUpdateErrors, GlobalConfigUpdateResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, GlobalUpgradeErrors, GlobalUpgradeResponses, InstanceDisposeResponses, LspStatusResponses, McpAddErrors, McpAddResponses, McpAuthAuthenticateErrors, McpAuthAuthenticateResponses, McpAuthCallbackErrors, McpAuthCallbackResponses, McpAuthRemoveErrors, McpAuthRemoveResponses, McpAuthStartErrors, McpAuthStartResponses, McpConnectResponses, McpDisconnectResponses, McpLocalConfig, McpRemoteConfig, McpStatusResponses, OutputFormat, Part as Part2, PartDeleteErrors, PartDeleteResponses, PartUpdateErrors, PartUpdateResponses, PathGetResponses, PermissionListResponses, PermissionReplyErrors, PermissionReplyResponses, PermissionRespondErrors, PermissionRespondResponses, PermissionRuleset, ProjectCurrentResponses, ProjectInitGitResponses, ProjectListResponses, ProjectUpdateErrors, ProjectUpdateResponses, ProviderAuthResponses, ProviderListResponses, ProviderOauthAuthorizeErrors, ProviderOauthAuthorizeResponses, ProviderOauthCallbackErrors, ProviderOauthCallbackResponses, PtyConnectErrors, PtyConnectResponses, PtyCreateErrors, PtyCreateResponses, PtyGetErrors, PtyGetResponses, PtyListResponses, PtyRemoveErrors, PtyRemoveResponses, PtyUpdateErrors, PtyUpdateResponses, QuestionAnswer, QuestionListResponses, QuestionRejectErrors, QuestionRejectResponses, QuestionReplyErrors, QuestionReplyResponses, SessionAbortErrors, SessionAbortResponses, SessionChildrenErrors, SessionChildrenResponses, SessionCommandErrors, SessionCommandResponses, SessionCreateErrors, SessionCreateResponses, SessionDeleteErrors, SessionDeleteMessageErrors, SessionDeleteMessageResponses, SessionDeleteResponses, SessionDiffResponses, SessionForkResponses, SessionGetErrors, SessionGetResponses, SessionInitErrors, SessionInitResponses, SessionListResponses, SessionMessageErrors, SessionMessageResponses, SessionMessagesErrors, SessionMessagesResponses, SessionPromptAsyncErrors, SessionPromptAsyncResponses, SessionPromptErrors, SessionPromptResponses, SessionRevertErrors, SessionRevertResponses, SessionShareErrors, SessionShareResponses, SessionShellErrors, SessionShellResponses, SessionStatusErrors, SessionStatusResponses, SessionSummarizeErrors, SessionSummarizeResponses, SessionTodoErrors, SessionTodoResponses, SessionUnrevertErrors, SessionUnrevertResponses, SessionUnshareErrors, SessionUnshareResponses, SessionUpdateErrors, SessionUpdateResponses, SubtaskPartInput, TextPartInput, ToolIdsErrors, ToolIdsResponses, ToolListErrors, ToolListResponses, TuiAppendPromptErrors, TuiAppendPromptResponses, TuiClearPromptResponses, TuiControlNextResponses, TuiControlResponseResponses, TuiExecuteCommandErrors, TuiExecuteCommandResponses, TuiOpenHelpResponses, TuiOpenModelsResponses, TuiOpenSessionsResponses, TuiOpenThemesResponses, TuiPublishErrors, TuiPublishResponses, TuiSelectSessionErrors, TuiSelectSessionResponses, TuiShowToastResponses, TuiSubmitPromptResponses, VcsGetResponses, WorktreeCreateErrors, WorktreeCreateInput, WorktreeCreateResponses, WorktreeListResponses, WorktreeRemoveErrors, WorktreeRemoveInput, WorktreeRemoveResponses, WorktreeResetErrors, WorktreeResetInput, WorktreeResetResponses } from "./types.gen.js";
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -60,6 +60,14 @@ export declare class Global extends HeyApiClient {
60
60
  * Clean up and dispose all OpenCode instances, releasing all resources.
61
61
  */
62
62
  dispose<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<GlobalDisposeResponses, unknown, ThrowOnError, "fields">;
63
+ /**
64
+ * Upgrade opencode
65
+ *
66
+ * Upgrade opencode to the specified version or latest if not specified.
67
+ */
68
+ upgrade<ThrowOnError extends boolean = false>(parameters?: {
69
+ target?: string;
70
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<GlobalUpgradeResponses, GlobalUpgradeErrors, ThrowOnError, "fields">;
63
71
  private _config?;
64
72
  get config(): Config;
65
73
  }
@@ -784,6 +792,9 @@ export declare class Oauth extends HeyApiClient {
784
792
  directory?: string;
785
793
  workspace?: string;
786
794
  method?: number;
795
+ inputs?: {
796
+ [key: string]: string;
797
+ };
787
798
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderOauthAuthorizeResponses, ProviderOauthAuthorizeErrors, ThrowOnError, "fields">;
788
799
  /**
789
800
  * OAuth callback
@@ -886,6 +897,17 @@ export declare class File extends HeyApiClient {
886
897
  workspace?: string;
887
898
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<FileStatusResponses, unknown, ThrowOnError, "fields">;
888
899
  }
900
+ export declare class Event extends HeyApiClient {
901
+ /**
902
+ * Subscribe to events
903
+ *
904
+ * Get events
905
+ */
906
+ subscribe<ThrowOnError extends boolean = false>(parameters?: {
907
+ directory?: string;
908
+ workspace?: string;
909
+ }, options?: Options<never, ThrowOnError>): Promise<import("./core/serverSentEvents.gen.js").ServerSentEventsResult<EventSubscribeResponses, unknown>>;
910
+ }
889
911
  export declare class Auth2 extends HeyApiClient {
890
912
  /**
891
913
  * Remove MCP OAuth
@@ -1202,17 +1224,6 @@ export declare class Formatter extends HeyApiClient {
1202
1224
  workspace?: string;
1203
1225
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<FormatterStatusResponses, unknown, ThrowOnError, "fields">;
1204
1226
  }
1205
- export declare class Event extends HeyApiClient {
1206
- /**
1207
- * Subscribe to events
1208
- *
1209
- * Get events
1210
- */
1211
- subscribe<ThrowOnError extends boolean = false>(parameters?: {
1212
- directory?: string;
1213
- workspace?: string;
1214
- }, options?: Options<never, ThrowOnError>): Promise<import("./core/serverSentEvents.gen.js").ServerSentEventsResult<EventSubscribeResponses, unknown>>;
1215
- }
1216
1227
  export declare class OpencodeClient extends HeyApiClient {
1217
1228
  static readonly __registry: HeyApiRegistry<OpencodeClient>;
1218
1229
  constructor(args?: {
@@ -1249,6 +1260,8 @@ export declare class OpencodeClient extends HeyApiClient {
1249
1260
  get find(): Find;
1250
1261
  private _file?;
1251
1262
  get file(): File;
1263
+ private _event?;
1264
+ get event(): Event;
1252
1265
  private _mcp?;
1253
1266
  get mcp(): Mcp;
1254
1267
  private _tui?;
@@ -1267,7 +1280,5 @@ export declare class OpencodeClient extends HeyApiClient {
1267
1280
  get lsp(): Lsp;
1268
1281
  private _formatter?;
1269
1282
  get formatter(): Formatter;
1270
- private _event?;
1271
- get event(): Event;
1272
1283
  }
1273
1284
  export {};
@@ -86,6 +86,24 @@ export class Global extends HeyApiClient {
86
86
  ...options,
87
87
  });
88
88
  }
89
+ /**
90
+ * Upgrade opencode
91
+ *
92
+ * Upgrade opencode to the specified version or latest if not specified.
93
+ */
94
+ upgrade(parameters, options) {
95
+ const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "target" }] }]);
96
+ return (options?.client ?? this.client).post({
97
+ url: "/global/upgrade",
98
+ ...options,
99
+ ...params,
100
+ headers: {
101
+ "Content-Type": "application/json",
102
+ ...options?.headers,
103
+ ...params.headers,
104
+ },
105
+ });
106
+ }
89
107
  _config;
90
108
  get config() {
91
109
  return (this._config ??= new Config({ client: this.client }));
@@ -1532,6 +1550,7 @@ export class Oauth extends HeyApiClient {
1532
1550
  { in: "query", key: "directory" },
1533
1551
  { in: "query", key: "workspace" },
1534
1552
  { in: "body", key: "method" },
1553
+ { in: "body", key: "inputs" },
1535
1554
  ],
1536
1555
  },
1537
1556
  ]);
@@ -1753,6 +1772,28 @@ export class File extends HeyApiClient {
1753
1772
  });
1754
1773
  }
1755
1774
  }
1775
+ export class Event extends HeyApiClient {
1776
+ /**
1777
+ * Subscribe to events
1778
+ *
1779
+ * Get events
1780
+ */
1781
+ subscribe(parameters, options) {
1782
+ const params = buildClientParams([parameters], [
1783
+ {
1784
+ args: [
1785
+ { in: "query", key: "directory" },
1786
+ { in: "query", key: "workspace" },
1787
+ ],
1788
+ },
1789
+ ]);
1790
+ return (options?.client ?? this.client).sse.get({
1791
+ url: "/event",
1792
+ ...options,
1793
+ ...params,
1794
+ });
1795
+ }
1796
+ }
1756
1797
  export class Auth2 extends HeyApiClient {
1757
1798
  /**
1758
1799
  * Remove MCP OAuth
@@ -2446,28 +2487,6 @@ export class Formatter extends HeyApiClient {
2446
2487
  });
2447
2488
  }
2448
2489
  }
2449
- export class Event extends HeyApiClient {
2450
- /**
2451
- * Subscribe to events
2452
- *
2453
- * Get events
2454
- */
2455
- subscribe(parameters, options) {
2456
- const params = buildClientParams([parameters], [
2457
- {
2458
- args: [
2459
- { in: "query", key: "directory" },
2460
- { in: "query", key: "workspace" },
2461
- ],
2462
- },
2463
- ]);
2464
- return (options?.client ?? this.client).sse.get({
2465
- url: "/event",
2466
- ...options,
2467
- ...params,
2468
- });
2469
- }
2470
- }
2471
2490
  export class OpencodeClient extends HeyApiClient {
2472
2491
  static __registry = new HeyApiRegistry();
2473
2492
  constructor(args) {
@@ -2534,6 +2553,10 @@ export class OpencodeClient extends HeyApiClient {
2534
2553
  get file() {
2535
2554
  return (this._file ??= new File({ client: this.client }));
2536
2555
  }
2556
+ _event;
2557
+ get event() {
2558
+ return (this._event ??= new Event({ client: this.client }));
2559
+ }
2537
2560
  _mcp;
2538
2561
  get mcp() {
2539
2562
  return (this._mcp ??= new Mcp({ client: this.client }));
@@ -2570,8 +2593,4 @@ export class OpencodeClient extends HeyApiClient {
2570
2593
  get formatter() {
2571
2594
  return (this._formatter ??= new Formatter({ client: this.client }));
2572
2595
  }
2573
- _event;
2574
- get event() {
2575
- return (this._event ??= new Event({ client: this.client }));
2576
- }
2577
2596
  }
@@ -46,96 +46,6 @@ export type EventServerInstanceDisposed = {
46
46
  directory: string;
47
47
  };
48
48
  };
49
- export type PermissionRequest = {
50
- id: string;
51
- sessionID: string;
52
- permission: string;
53
- patterns: Array<string>;
54
- metadata: {
55
- [key: string]: unknown;
56
- };
57
- always: Array<string>;
58
- tool?: {
59
- messageID: string;
60
- callID: string;
61
- };
62
- };
63
- export type EventPermissionAsked = {
64
- type: "permission.asked";
65
- properties: PermissionRequest;
66
- };
67
- export type EventPermissionReplied = {
68
- type: "permission.replied";
69
- properties: {
70
- sessionID: string;
71
- requestID: string;
72
- reply: "once" | "always" | "reject";
73
- };
74
- };
75
- export type QuestionOption = {
76
- /**
77
- * Display text (1-5 words, concise)
78
- */
79
- label: string;
80
- /**
81
- * Explanation of choice
82
- */
83
- description: string;
84
- };
85
- export type QuestionInfo = {
86
- /**
87
- * Complete question
88
- */
89
- question: string;
90
- /**
91
- * Very short label (max 30 chars)
92
- */
93
- header: string;
94
- /**
95
- * Available choices
96
- */
97
- options: Array<QuestionOption>;
98
- /**
99
- * Allow selecting multiple choices
100
- */
101
- multiple?: boolean;
102
- /**
103
- * Allow typing a custom answer (default: true)
104
- */
105
- custom?: boolean;
106
- };
107
- export type QuestionRequest = {
108
- id: string;
109
- sessionID: string;
110
- /**
111
- * Questions to ask
112
- */
113
- questions: Array<QuestionInfo>;
114
- tool?: {
115
- messageID: string;
116
- callID: string;
117
- };
118
- };
119
- export type EventQuestionAsked = {
120
- type: "question.asked";
121
- properties: QuestionRequest;
122
- };
123
- export type QuestionAnswer = Array<string>;
124
- export type EventQuestionReplied = {
125
- type: "question.replied";
126
- properties: {
127
- sessionID: string;
128
- requestID: string;
129
- answers: Array<QuestionAnswer>;
130
- };
131
- };
132
- export type EventQuestionRejected = {
133
- type: "question.rejected";
134
- properties: {
135
- sessionID: string;
136
- requestID: string;
137
- };
138
- };
139
49
  export type EventServerConnected = {
140
50
  type: "server.connected";
141
51
  properties: {
@@ -563,6 +473,32 @@ export type EventMessagePartRemoved = {
563
473
  partID: string;
564
474
  };
565
475
  };
476
+ export type PermissionRequest = {
477
+ id: string;
478
+ sessionID: string;
479
+ permission: string;
480
+ patterns: Array<string>;
481
+ metadata: {
482
+ [key: string]: unknown;
483
+ };
484
+ always: Array<string>;
485
+ tool?: {
486
+ messageID: string;
487
+ callID: string;
488
+ };
489
+ };
490
+ export type EventPermissionAsked = {
491
+ type: "permission.asked";
492
+ properties: PermissionRequest;
493
+ };
494
+ export type EventPermissionReplied = {
495
+ type: "permission.replied";
496
+ properties: {
497
+ sessionID: string;
498
+ requestID: string;
499
+ reply: "once" | "always" | "reject";
500
+ };
501
+ };
566
502
  export type SessionStatus = {
567
503
  type: "idle";
568
504
  } | {
@@ -586,6 +522,70 @@ export type EventSessionIdle = {
586
522
  sessionID: string;
587
523
  };
588
524
  };
525
+ export type QuestionOption = {
526
+ /**
527
+ * Display text (1-5 words, concise)
528
+ */
529
+ label: string;
530
+ /**
531
+ * Explanation of choice
532
+ */
533
+ description: string;
534
+ };
535
+ export type QuestionInfo = {
536
+ /**
537
+ * Complete question
538
+ */
539
+ question: string;
540
+ /**
541
+ * Very short label (max 30 chars)
542
+ */
543
+ header: string;
544
+ /**
545
+ * Available choices
546
+ */
547
+ options: Array<QuestionOption>;
548
+ /**
549
+ * Allow selecting multiple choices
550
+ */
551
+ multiple?: boolean;
552
+ /**
553
+ * Allow typing a custom answer (default: true)
554
+ */
555
+ custom?: boolean;
556
+ };
557
+ export type QuestionRequest = {
558
+ id: string;
559
+ sessionID: string;
560
+ /**
561
+ * Questions to ask
562
+ */
563
+ questions: Array<QuestionInfo>;
564
+ tool?: {
565
+ messageID: string;
566
+ callID: string;
567
+ };
568
+ };
569
+ export type EventQuestionAsked = {
570
+ type: "question.asked";
571
+ properties: QuestionRequest;
572
+ };
573
+ export type QuestionAnswer = Array<string>;
574
+ export type EventQuestionReplied = {
575
+ type: "question.replied";
576
+ properties: {
577
+ sessionID: string;
578
+ requestID: string;
579
+ answers: Array<QuestionAnswer>;
580
+ };
581
+ };
582
+ export type EventQuestionRejected = {
583
+ type: "question.rejected";
584
+ properties: {
585
+ sessionID: string;
586
+ requestID: string;
587
+ };
588
+ };
589
589
  export type EventSessionCompacted = {
590
590
  type: "session.compacted";
591
591
  properties: {
@@ -811,7 +811,7 @@ export type EventWorktreeFailed = {
811
811
  message: string;
812
812
  };
813
813
  };
814
- export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventPermissionAsked | EventPermissionReplied | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventFileEdited | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartDelta | EventMessagePartRemoved | EventSessionStatus | EventSessionIdle | EventSessionCompacted | EventFileWatcherUpdated | EventTodoUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventVcsBranchUpdated | EventWorkspaceReady | EventWorkspaceFailed | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventWorktreeReady | EventWorktreeFailed;
814
+ export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventFileEdited | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartDelta | EventMessagePartRemoved | EventPermissionAsked | EventPermissionReplied | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventFileWatcherUpdated | EventTodoUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventVcsBranchUpdated | EventWorkspaceReady | EventWorkspaceFailed | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventWorktreeReady | EventWorktreeFailed;
815
815
  export type GlobalEvent = {
816
816
  directory: string;
817
817
  payload: Event;
@@ -1114,6 +1114,9 @@ export type Config = {
1114
1114
  ignore?: Array<string>;
1115
1115
  };
1116
1116
  plugin?: Array<string>;
1117
+ /**
1118
+ * Enable or disable snapshot tracking. When false, filesystem snapshots are not recorded and undoing or reverting will not undo/redo file changes. Defaults to true.
1119
+ */
1117
1120
  snapshot?: boolean;
1118
1121
  /**
1119
1122
  * Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing
@@ -1502,6 +1505,31 @@ export type SubtaskPartInput = {
1502
1505
  export type ProviderAuthMethod = {
1503
1506
  type: "oauth" | "api";
1504
1507
  label: string;
1508
+ prompts?: Array<{
1509
+ type: "text";
1510
+ key: string;
1511
+ message: string;
1512
+ placeholder?: string;
1513
+ when?: {
1514
+ key: string;
1515
+ op: "eq" | "neq";
1516
+ value: string;
1517
+ };
1518
+ } | {
1519
+ type: "select";
1520
+ key: string;
1521
+ message: string;
1522
+ options: Array<{
1523
+ label: string;
1524
+ value: string;
1525
+ hint?: string;
1526
+ }>;
1527
+ when?: {
1528
+ key: string;
1529
+ op: "eq" | "neq";
1530
+ value: string;
1531
+ };
1532
+ }>;
1505
1533
  };
1506
1534
  export type ProviderAuthAuthorization = {
1507
1535
  url: string;
@@ -1695,6 +1723,34 @@ export type GlobalDisposeResponses = {
1695
1723
  200: boolean;
1696
1724
  };
1697
1725
  export type GlobalDisposeResponse = GlobalDisposeResponses[keyof GlobalDisposeResponses];
1726
+ export type GlobalUpgradeData = {
1727
+ body?: {
1728
+ target?: string;
1729
+ };
1730
+ path?: never;
1731
+ query?: never;
1732
+ url: "/global/upgrade";
1733
+ };
1734
+ export type GlobalUpgradeErrors = {
1735
+ /**
1736
+ * Bad request
1737
+ */
1738
+ 400: BadRequestError;
1739
+ };
1740
+ export type GlobalUpgradeError = GlobalUpgradeErrors[keyof GlobalUpgradeErrors];
1741
+ export type GlobalUpgradeResponses = {
1742
+ /**
1743
+ * Upgrade result
1744
+ */
1745
+ 200: {
1746
+ success: true;
1747
+ version: string;
1748
+ } | {
1749
+ success: false;
1750
+ error: string;
1751
+ };
1752
+ };
1753
+ export type GlobalUpgradeResponse = GlobalUpgradeResponses[keyof GlobalUpgradeResponses];
1698
1754
  export type AuthRemoveData = {
1699
1755
  body?: never;
1700
1756
  path: {
@@ -3402,6 +3458,12 @@ export type ProviderOauthAuthorizeData = {
3402
3458
  * Auth method index
3403
3459
  */
3404
3460
  method: number;
3461
+ /**
3462
+ * Prompt inputs
3463
+ */
3464
+ inputs?: {
3465
+ [key: string]: string;
3466
+ };
3405
3467
  };
3406
3468
  path: {
3407
3469
  /**
@@ -3586,6 +3648,22 @@ export type FileStatusResponses = {
3586
3648
  200: Array<File>;
3587
3649
  };
3588
3650
  export type FileStatusResponse = FileStatusResponses[keyof FileStatusResponses];
3651
+ export type EventSubscribeData = {
3652
+ body?: never;
3653
+ path?: never;
3654
+ query?: {
3655
+ directory?: string;
3656
+ workspace?: string;
3657
+ };
3658
+ url: "/event";
3659
+ };
3660
+ export type EventSubscribeResponses = {
3661
+ /**
3662
+ * Event stream
3663
+ */
3664
+ 200: Event;
3665
+ };
3666
+ export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses];
3589
3667
  export type McpStatusData = {
3590
3668
  body?: never;
3591
3669
  path?: never;
@@ -4227,19 +4305,3 @@ export type FormatterStatusResponses = {
4227
4305
  200: Array<FormatterStatus>;
4228
4306
  };
4229
4307
  export type FormatterStatusResponse = FormatterStatusResponses[keyof FormatterStatusResponses];
4230
- export type EventSubscribeData = {
4231
- body?: never;
4232
- path?: never;
4233
- query?: {
4234
- directory?: string;
4235
- workspace?: string;
4236
- };
4237
- url: "/event";
4238
- };
4239
- export type EventSubscribeResponses = {
4240
- /**
4241
- * Event stream
4242
- */
4243
- 200: Event;
4244
- };
4245
- export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/sdk",
4
- "version": "1.2.27",
4
+ "version": "1.3.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {