shuvcode 2.3.0-shuv.3 → 2.3.1-shuv.1

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.
@@ -44,6 +44,10 @@ export declare function make(options: ClientOptions): {
44
44
  text: string;
45
45
  }>;
46
46
  image: (input: import("./index.js").ExperimentalGenerateImageInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").GenerateImageResult>;
47
+ video: {
48
+ create: (input: import("./index.js").ExperimentalGenerateVideoCreateInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").GenerateVideoRunning>;
49
+ get: (input: import("./index.js").ExperimentalGenerateVideoGetInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").GenerateVideoCompleted | import("./index.js").GenerateVideoError | import("./index.js").GenerateVideoRunning>;
50
+ };
47
51
  decisions: (input: import("./index.js").ExperimentalGenerateDecisionsInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").GenerateDecisionResult>;
48
52
  };
49
53
  voice: {
@@ -89,13 +93,16 @@ export declare function make(options: ClientOptions): {
89
93
  media: {
90
94
  get: (input: import("./index.js").ExperimentalMediaGetInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").ExperimentalMediaGetOutput>;
91
95
  };
92
- schedule: {
93
- create: (input: import("./index.js").ExperimentalScheduleCreateInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").ScheduleInfo>;
94
- list: (input: import("./index.js").ExperimentalScheduleListInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").ScheduleInfo[]>;
95
- get: (input: import("./index.js").ExperimentalScheduleGetInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").ScheduleInfo>;
96
- pause: (input: import("./index.js").ExperimentalSchedulePauseInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").ScheduleInfo>;
97
- resume: (input: import("./index.js").ExperimentalScheduleResumeInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").ScheduleInfo>;
98
- delete: (input: import("./index.js").ExperimentalScheduleDeleteInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
96
+ blob: {
97
+ get: (input: import("./index.js").ExperimentalBlobGetInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").ExperimentalBlobGetOutput>;
98
+ };
99
+ automation: {
100
+ create: (input: import("./index.js").ExperimentalAutomationCreateInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").AutomationInfo>;
101
+ list: (input?: import("./index.js").ExperimentalAutomationListInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").AutomationInfo[]>;
102
+ get: (input: import("./index.js").ExperimentalAutomationGetInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").AutomationInfo>;
103
+ pause: (input: import("./index.js").ExperimentalAutomationPauseInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").AutomationInfo>;
104
+ resume: (input: import("./index.js").ExperimentalAutomationResumeInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").AutomationInfo>;
105
+ delete: (input: import("./index.js").ExperimentalAutomationDeleteInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
99
106
  };
100
107
  artifacts: {
101
108
  providers: (input?: import("./index.js").ExperimentalArtifactsProvidersInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").ExperimentalArtifactsProvidersOutput>;
@@ -1,4 +1,4 @@
1
- import type { ServerConnectInput, LocationGetInput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginGuiInput, PluginGuiOutput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionCreateInput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionUpdateInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionDiffInput, SessionInboxListInput, SessionInboxCancelInput, SessionInboxUpdateInput, SessionGenerateInput, SessionInterruptInput, SessionBackgroundInput, SessionMessageGetInput, SessionFormListInput, SessionFormCreateInput, SessionFormGetInput, SessionFormReplyInput, SessionFormCancelInput, SessionEnvironmentInput, SessionViewInput, ExperimentalSessionStatsInput, ExperimentalSessionImportInput, ExperimentalSessionExportInput, ExperimentalSessionSkillInput, ExperimentalSessionWaitInput, ExperimentalSessionInstructionsEntryListInput, ExperimentalSessionInstructionsEntryPutInput, ExperimentalSessionInstructionsEntryRemoveInput, ExperimentalSessionLogInput, ExperimentalSessionLogOutput, MessageListInput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, ExperimentalGenerateTextInput, ExperimentalGenerateImageInput, ExperimentalGenerateDecisionsInput, ExperimentalVoiceSessionInput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationConnectKeyInput, IntegrationConnectExternalInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, ExperimentalIntegrationWellknownAddInput, McpListInput, McpListOutput, McpResourceCatalogInput, McpResourceCatalogOutput, ExperimentalMcpAddInput, ExperimentalMcpRemoveInput, ExperimentalMcpConnectInput, ExperimentalMcpDisconnectInput, ExperimentalMcpClientTokenInput, ExperimentalMcpClientTokenOutput, CredentialCreateInput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListInput, ProjectListOutput, ProjectUpdateInput, FormListInput, FormListOutput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedUpdateInput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionListInput, PermissionGetInput, PermissionReplyInput, FileReadInput, FileReadOutput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, ExperimentalFileWriteInput, ExperimentalFileWriteOutput, ExperimentalFileWatchInput, ExperimentalFileUnwatchInput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, EventSubscribeInput, EventSubscribeOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ExperimentalMediaGetInput, ExperimentalMediaGetOutput, ExperimentalScheduleCreateInput, ExperimentalScheduleListInput, ExperimentalScheduleGetInput, ExperimentalSchedulePauseInput, ExperimentalScheduleResumeInput, ExperimentalScheduleDeleteInput, ExperimentalArtifactsProvidersInput, ExperimentalArtifactsProvidersOutput, ExperimentalArtifactsListInput, ExperimentalArtifactsListOutput, ExperimentalArtifactsCreateInput, ExperimentalArtifactsCreateOutput, ExperimentalArtifactsGetInput, ExperimentalArtifactsGetOutput, ExperimentalArtifactsUpdateInput, ExperimentalArtifactsUpdateOutput, ExperimentalArtifactsDeleteInput, ExperimentalArtifactsViewInput, ExperimentalArtifactsViewOutput, ExperimentalJobListInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, VcsInitInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchListInput, VcsBranchListOutput, VcsDiffInput, VcsDiffOutput, DebugHeapDumpInput, DebugHeapDumpOutput, DebugLocationListOutput, DebugLocationEvictInput, ExperimentalMigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ExperimentalUsageLimitsInput, ExperimentalUsageLimitsOutput, ConfigGetInput, ConfigGetOutput, ConfigShellsOutput, ExperimentalConfigUpdateInput } from "./types.js";
1
+ import type { ServerConnectInput, LocationGetInput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginGuiInput, PluginGuiOutput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionCreateInput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionUpdateInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionDiffInput, SessionInboxListInput, SessionInboxCancelInput, SessionInboxUpdateInput, SessionGenerateInput, SessionInterruptInput, SessionBackgroundInput, SessionMessageGetInput, SessionFormListInput, SessionFormCreateInput, SessionFormGetInput, SessionFormReplyInput, SessionFormCancelInput, SessionEnvironmentInput, SessionViewInput, ExperimentalSessionStatsInput, ExperimentalSessionImportInput, ExperimentalSessionExportInput, ExperimentalSessionSkillInput, ExperimentalSessionWaitInput, ExperimentalSessionInstructionsEntryListInput, ExperimentalSessionInstructionsEntryPutInput, ExperimentalSessionInstructionsEntryRemoveInput, ExperimentalSessionLogInput, ExperimentalSessionLogOutput, MessageListInput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, ExperimentalGenerateTextInput, ExperimentalGenerateImageInput, ExperimentalGenerateVideoCreateInput, ExperimentalGenerateVideoGetInput, ExperimentalGenerateDecisionsInput, ExperimentalVoiceSessionInput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationConnectKeyInput, IntegrationConnectExternalInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, ExperimentalIntegrationWellknownAddInput, McpListInput, McpListOutput, McpResourceCatalogInput, McpResourceCatalogOutput, ExperimentalMcpAddInput, ExperimentalMcpRemoveInput, ExperimentalMcpConnectInput, ExperimentalMcpDisconnectInput, ExperimentalMcpClientTokenInput, ExperimentalMcpClientTokenOutput, CredentialCreateInput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListInput, ProjectListOutput, ProjectUpdateInput, FormListInput, FormListOutput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedUpdateInput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionListInput, PermissionGetInput, PermissionReplyInput, FileReadInput, FileReadOutput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, ExperimentalFileWriteInput, ExperimentalFileWriteOutput, ExperimentalFileWatchInput, ExperimentalFileUnwatchInput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, EventSubscribeInput, EventSubscribeOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ExperimentalMediaGetInput, ExperimentalMediaGetOutput, ExperimentalBlobGetInput, ExperimentalBlobGetOutput, ExperimentalAutomationCreateInput, ExperimentalAutomationListInput, ExperimentalAutomationGetInput, ExperimentalAutomationPauseInput, ExperimentalAutomationResumeInput, ExperimentalAutomationDeleteInput, ExperimentalArtifactsProvidersInput, ExperimentalArtifactsProvidersOutput, ExperimentalArtifactsListInput, ExperimentalArtifactsListOutput, ExperimentalArtifactsCreateInput, ExperimentalArtifactsCreateOutput, ExperimentalArtifactsGetInput, ExperimentalArtifactsGetOutput, ExperimentalArtifactsUpdateInput, ExperimentalArtifactsUpdateOutput, ExperimentalArtifactsDeleteInput, ExperimentalArtifactsViewInput, ExperimentalArtifactsViewOutput, ExperimentalJobListInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, VcsInitInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchListInput, VcsBranchListOutput, VcsDiffInput, VcsDiffOutput, DebugHeapDumpInput, DebugHeapDumpOutput, DebugLocationListOutput, DebugLocationEvictInput, ExperimentalMigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ExperimentalUsageLimitsInput, ExperimentalUsageLimitsOutput, ConfigGetInput, ConfigGetOutput, ConfigShellsOutput, ExperimentalConfigUpdateInput } from "./types.js";
2
2
  export interface ClientOptions {
3
3
  readonly baseUrl: string;
4
4
  readonly fetch?: typeof globalThis.fetch;
@@ -51,6 +51,10 @@ export declare function make(options: ClientOptions): {
51
51
  text: string;
52
52
  }>;
53
53
  image: (input: ExperimentalGenerateImageInput, requestOptions?: RequestOptions) => Promise<import("./types.js").GenerateImageResult>;
54
+ video: {
55
+ create: (input: ExperimentalGenerateVideoCreateInput, requestOptions?: RequestOptions) => Promise<import("./types.js").GenerateVideoRunning>;
56
+ get: (input: ExperimentalGenerateVideoGetInput, requestOptions?: RequestOptions) => Promise<import("./types.js").GenerateVideoCompleted | import("./types.js").GenerateVideoError | import("./types.js").GenerateVideoRunning>;
57
+ };
54
58
  decisions: (input: ExperimentalGenerateDecisionsInput, requestOptions?: RequestOptions) => Promise<import("./types.js").GenerateDecisionResult>;
55
59
  };
56
60
  voice: {
@@ -96,13 +100,16 @@ export declare function make(options: ClientOptions): {
96
100
  media: {
97
101
  get: (input: ExperimentalMediaGetInput, requestOptions?: RequestOptions) => Promise<ExperimentalMediaGetOutput>;
98
102
  };
99
- schedule: {
100
- create: (input: ExperimentalScheduleCreateInput, requestOptions?: RequestOptions) => Promise<import("./types.js").ScheduleInfo>;
101
- list: (input: ExperimentalScheduleListInput, requestOptions?: RequestOptions) => Promise<import("./types.js").ScheduleInfo[]>;
102
- get: (input: ExperimentalScheduleGetInput, requestOptions?: RequestOptions) => Promise<import("./types.js").ScheduleInfo>;
103
- pause: (input: ExperimentalSchedulePauseInput, requestOptions?: RequestOptions) => Promise<import("./types.js").ScheduleInfo>;
104
- resume: (input: ExperimentalScheduleResumeInput, requestOptions?: RequestOptions) => Promise<import("./types.js").ScheduleInfo>;
105
- delete: (input: ExperimentalScheduleDeleteInput, requestOptions?: RequestOptions) => Promise<void>;
103
+ blob: {
104
+ get: (input: ExperimentalBlobGetInput, requestOptions?: RequestOptions) => Promise<ExperimentalBlobGetOutput>;
105
+ };
106
+ automation: {
107
+ create: (input: ExperimentalAutomationCreateInput, requestOptions?: RequestOptions) => Promise<import("./types.js").AutomationInfo>;
108
+ list: (input?: ExperimentalAutomationListInput, requestOptions?: RequestOptions) => Promise<import("./types.js").AutomationInfo[]>;
109
+ get: (input: ExperimentalAutomationGetInput, requestOptions?: RequestOptions) => Promise<import("./types.js").AutomationInfo>;
110
+ pause: (input: ExperimentalAutomationPauseInput, requestOptions?: RequestOptions) => Promise<import("./types.js").AutomationInfo>;
111
+ resume: (input: ExperimentalAutomationResumeInput, requestOptions?: RequestOptions) => Promise<import("./types.js").AutomationInfo>;
112
+ delete: (input: ExperimentalAutomationDeleteInput, requestOptions?: RequestOptions) => Promise<void>;
106
113
  };
107
114
  artifacts: {
108
115
  providers: (input?: ExperimentalArtifactsProvidersInput, requestOptions?: RequestOptions) => Promise<ExperimentalArtifactsProvidersOutput>;
@@ -642,6 +642,33 @@ export function make(options) {
642
642
  declaredStatuses: [400, 401, 404, 422, 502, 503],
643
643
  empty: false,
644
644
  }, requestOptions).then((value) => value.data),
645
+ video: {
646
+ create: (input, requestOptions) => request({
647
+ method: "POST",
648
+ path: `/api/experimental/generate/video`,
649
+ body: {
650
+ model: input["model"],
651
+ prompt: input["prompt"],
652
+ start: input["start"],
653
+ end: input["end"],
654
+ references: input["references"],
655
+ duration: input["duration"],
656
+ aspect: input["aspect"],
657
+ resolution: input["resolution"],
658
+ sound: input["sound"],
659
+ },
660
+ successStatus: 200,
661
+ declaredStatuses: [400, 401, 403, 404, 422, 502, 503],
662
+ empty: false,
663
+ }, requestOptions).then((value) => value.data),
664
+ get: (input, requestOptions) => request({
665
+ method: "GET",
666
+ path: `/api/experimental/generate/video/${encodeURIComponent(input.id)}`,
667
+ successStatus: 200,
668
+ declaredStatuses: [400, 401, 403, 404],
669
+ empty: false,
670
+ }, requestOptions).then((value) => value.data),
671
+ },
645
672
  decisions: (input, requestOptions) => request({
646
673
  method: "POST",
647
674
  path: `/api/experimental/generate/decisions`,
@@ -850,18 +877,27 @@ export function make(options) {
850
877
  binary: true,
851
878
  }, requestOptions),
852
879
  },
853
- schedule: {
880
+ blob: {
881
+ get: (input, requestOptions) => request({
882
+ method: "GET",
883
+ path: `/api/experimental/blob/${encodeURIComponent(input.id)}`,
884
+ successStatus: 200,
885
+ declaredStatuses: [400, 401, 404],
886
+ empty: false,
887
+ binary: true,
888
+ }, requestOptions),
889
+ },
890
+ automation: {
854
891
  create: (input, requestOptions) => request({
855
892
  method: "POST",
856
- path: `/api/experimental/schedule`,
893
+ path: `/api/experimental/automation`,
857
894
  body: {
858
895
  sessionID: input["sessionID"],
896
+ directory: input["directory"],
859
897
  name: input["name"],
860
- when: input["when"],
861
- if: input["if"],
862
- until: input["until"],
863
- ends: input["ends"],
864
- prompt: input["prompt"],
898
+ trigger: input["trigger"],
899
+ action: input["action"],
900
+ expires: input["expires"],
865
901
  },
866
902
  successStatus: 200,
867
903
  declaredStatuses: [400, 401, 403, 404],
@@ -869,36 +905,36 @@ export function make(options) {
869
905
  }, requestOptions).then((value) => value.data),
870
906
  list: (input, requestOptions) => request({
871
907
  method: "GET",
872
- path: `/api/experimental/schedule`,
873
- query: { sessionID: input["sessionID"] },
908
+ path: `/api/experimental/automation`,
909
+ query: { sessionID: input?.["sessionID"], directory: input?.["directory"] },
874
910
  successStatus: 200,
875
911
  declaredStatuses: [400, 401, 403, 404],
876
912
  empty: false,
877
913
  }, requestOptions).then((value) => value.data),
878
914
  get: (input, requestOptions) => request({
879
915
  method: "GET",
880
- path: `/api/experimental/schedule/${encodeURIComponent(input.scheduleID)}`,
916
+ path: `/api/experimental/automation/${encodeURIComponent(input.automationID)}`,
881
917
  successStatus: 200,
882
918
  declaredStatuses: [400, 401, 403, 404],
883
919
  empty: false,
884
920
  }, requestOptions).then((value) => value.data),
885
921
  pause: (input, requestOptions) => request({
886
922
  method: "POST",
887
- path: `/api/experimental/schedule/${encodeURIComponent(input.scheduleID)}/pause`,
923
+ path: `/api/experimental/automation/${encodeURIComponent(input.automationID)}/pause`,
888
924
  successStatus: 200,
889
925
  declaredStatuses: [400, 401, 403, 404],
890
926
  empty: false,
891
927
  }, requestOptions).then((value) => value.data),
892
928
  resume: (input, requestOptions) => request({
893
929
  method: "POST",
894
- path: `/api/experimental/schedule/${encodeURIComponent(input.scheduleID)}/resume`,
930
+ path: `/api/experimental/automation/${encodeURIComponent(input.automationID)}/resume`,
895
931
  successStatus: 200,
896
932
  declaredStatuses: [400, 401, 403, 404],
897
933
  empty: false,
898
934
  }, requestOptions).then((value) => value.data),
899
935
  delete: (input, requestOptions) => request({
900
936
  method: "DELETE",
901
- path: `/api/experimental/schedule/${encodeURIComponent(input.scheduleID)}`,
937
+ path: `/api/experimental/automation/${encodeURIComponent(input.automationID)}`,
902
938
  successStatus: 204,
903
939
  declaredStatuses: [400, 401, 403, 404],
904
940
  empty: true,
@@ -240,7 +240,7 @@ export type SessionMessageToolStateRunning1 = {
240
240
  [x: string]: JsonValue;
241
241
  };
242
242
  };
243
- export type ModelType = "chat" | "decision" | "image" | (string & {});
243
+ export type ModelType = "chat" | "decision" | "image" | "video" | (string & {});
244
244
  export type ModelReasoningField = "reasoning" | "reasoning_content" | "reasoning_text" | (string & {});
245
245
  export type ModelMaxTokensField = "max_completion_tokens" | "max_tokens";
246
246
  export type ModelCacheFormat = "anthropic" | "alibaba";
@@ -259,6 +259,9 @@ export type GenerateUsage = {
259
259
  export type GenerateNative = {
260
260
  [x: string]: JsonValue;
261
261
  };
262
+ export type GenerateVideoID = string;
263
+ export type BlobID = string;
264
+ export type GenerateVideoErrorReason = "failed" | "cancelled" | "expired" | "unknown";
262
265
  export type GeneratePredicateAnswer = {
263
266
  type: "predicate";
264
267
  name: string;
@@ -465,35 +468,33 @@ export type PersistentPtyHandoff = {
465
468
  ticket: string;
466
469
  expiresAt: number;
467
470
  };
468
- export type ScheduleID = string;
469
- export type ScheduleDuration = string;
470
- export type ScheduleWhenAt = {
471
+ export type AutomationID = string;
472
+ export type AutomationTriggerAt = {
471
473
  type: "at";
472
474
  at: string;
473
475
  tz?: string;
474
476
  };
475
- export type ScheduleWhenCron = {
477
+ export type AutomationDuration = string;
478
+ export type AutomationTriggerCron = {
476
479
  type: "cron";
477
480
  cron: string;
478
481
  tz?: string;
479
482
  };
480
- export type ScheduleConditionShell = {
481
- type: "shell";
482
- run: string;
483
- is?: string;
484
- matches?: string;
485
- changes?: boolean;
483
+ export type AutomationTriggerEvent = {
484
+ type: "event";
485
+ server: string;
486
+ event: string;
487
+ args?: {
488
+ [x: string]: JsonValue;
489
+ };
486
490
  };
487
- export type ScheduleConditionCode = {
491
+ export type AutomationActionCode = {
488
492
  type: "code";
489
493
  code: string;
494
+ args?: JsonValue;
490
495
  };
491
- export type ScheduleActionPrompt = {
492
- type: "prompt";
493
- prompt: string;
494
- };
495
- export type ScheduleStatus = "active" | "paused" | "done";
496
- export type ScheduleOutcome = "fired" | "late" | "checked" | "expired" | "skipped" | "disabled" | "failed";
496
+ export type AutomationStatus = "active" | "paused" | "done";
497
+ export type AutomationOutcome = "fired" | "late" | "skipped" | "disabled" | "failed" | "expired";
497
498
  export type ArtifactCapability = "static" | "server-code" | "sqlite" | "durable-objects";
498
499
  export type ArtifactID = string;
499
500
  export type ArtifactTime = {
@@ -625,6 +626,13 @@ export type PluginInfo = {
625
626
  features: PluginFeatures;
626
627
  state: PluginState;
627
628
  };
629
+ export type AutomationTarget = {
630
+ session: SessionID;
631
+ subagent?: never;
632
+ } | {
633
+ subagent: AgentID;
634
+ session?: never;
635
+ };
628
636
  export type SessionForkBoundary = {
629
637
  type: "before";
630
638
  messageID: SessionMessageID;
@@ -1027,6 +1035,22 @@ export type ModelCost = {
1027
1035
  write: MoneyUSDPerMillionTokens;
1028
1036
  };
1029
1037
  };
1038
+ export type GenerateVideoRunning = {
1039
+ id: GenerateVideoID;
1040
+ status: "running";
1041
+ };
1042
+ export type BlobInfo = {
1043
+ id: BlobID;
1044
+ mime: string;
1045
+ bytes: number;
1046
+ expiresAt: number;
1047
+ };
1048
+ export type GenerateVideoError = {
1049
+ id: GenerateVideoID;
1050
+ status: "error";
1051
+ error: string;
1052
+ reason: GenerateVideoErrorReason;
1053
+ };
1030
1054
  export type GenerateChoiceAnswer = {
1031
1055
  type: "choice";
1032
1056
  name: string;
@@ -1253,18 +1277,11 @@ export type FormMultiselectField1 = {
1253
1277
  export type FormAnswer1 = {
1254
1278
  [x: string]: FormValue1;
1255
1279
  };
1256
- export type ScheduleWhenIn = {
1257
- type: "in";
1258
- in: ScheduleDuration;
1259
- tz?: string;
1260
- };
1261
- export type ScheduleWhenEvery = {
1280
+ export type AutomationTriggerEvery = {
1262
1281
  type: "every";
1263
- every: ScheduleDuration;
1282
+ every: AutomationDuration;
1264
1283
  tz?: string;
1265
1284
  };
1266
- export type ScheduleCondition = ScheduleConditionShell | ScheduleConditionCode;
1267
- export type ScheduleAction = ScheduleActionPrompt;
1268
1285
  export type ArtifactProvider = {
1269
1286
  id: string;
1270
1287
  name: string;
@@ -1311,6 +1328,14 @@ export type JobImage = {
1311
1328
  path: string;
1312
1329
  model: string;
1313
1330
  };
1331
+ export type JobCodeMode = {
1332
+ kind: "codemode";
1333
+ id: string;
1334
+ sessionID: SessionID;
1335
+ status: JobStatus;
1336
+ title?: string;
1337
+ time: JobTime;
1338
+ };
1314
1339
  export type VcsInfo = {
1315
1340
  provider?: string;
1316
1341
  branch: VcsBranch;
@@ -1462,6 +1487,11 @@ export type ModelVariant = {
1462
1487
  };
1463
1488
  };
1464
1489
  export type PermissionRuleset = Array<PermissionRule>;
1490
+ export type AutomationActionPrompt = {
1491
+ type: "prompt";
1492
+ prompt: string;
1493
+ to: AutomationTarget;
1494
+ };
1465
1495
  export type UsageLimitsBudget = {
1466
1496
  id: string;
1467
1497
  limit: MoneyUSD;
@@ -3077,6 +3107,14 @@ export type SessionMessageToolStateError1 = {
3077
3107
  [x: string]: JsonValue;
3078
3108
  };
3079
3109
  };
3110
+ export type GenerateVideoCreateResponse = {
3111
+ data: GenerateVideoRunning;
3112
+ };
3113
+ export type GenerateVideoCompleted = {
3114
+ id: GenerateVideoID;
3115
+ status: "completed";
3116
+ blobs: Array<BlobInfo>;
3117
+ };
3080
3118
  export type GenerateDecisionAnswer = GeneratePredicateAnswer | GenerateChoiceAnswer | GenerateScoreAnswer | GenerateErrorAnswer;
3081
3119
  export type VoiceModelsResponse = {
3082
3120
  data: {
@@ -3165,14 +3203,14 @@ export type FormReplied = {
3165
3203
  answer: FormAnswer1;
3166
3204
  };
3167
3205
  };
3168
- export type ScheduleWhen = ScheduleWhenIn | ScheduleWhenAt | ScheduleWhenEvery | ScheduleWhenCron;
3206
+ export type AutomationTrigger = AutomationTriggerAt | AutomationTriggerEvery | AutomationTriggerCron | AutomationTriggerEvent;
3169
3207
  export type ArtifactContent = {
3170
3208
  info: ArtifactInfo;
3171
3209
  files: {
3172
3210
  [x: string]: string;
3173
3211
  };
3174
3212
  };
3175
- export type JobInfo = JobShell | JobSubagent | JobImage;
3213
+ export type JobInfo = JobShell | JobSubagent | JobImage | JobCodeMode;
3176
3214
  export type SessionInboxMove = {
3177
3215
  id: SessionMessageID;
3178
3216
  sessionID: SessionID;
@@ -3480,6 +3518,7 @@ export type ConfigEntry = {
3480
3518
  };
3481
3519
  compaction?: {
3482
3520
  auto?: boolean;
3521
+ background?: boolean;
3483
3522
  keep?: {
3484
3523
  tokens?: number;
3485
3524
  };
@@ -3607,12 +3646,14 @@ export type ConfigEntry = {
3607
3646
  codemode_vm?: boolean;
3608
3647
  all_flags?: boolean;
3609
3648
  todo?: boolean;
3610
- background_compaction?: boolean;
3611
3649
  media_blob?: boolean;
3612
- schedules?: boolean;
3650
+ automations?: boolean;
3613
3651
  artifacts?: boolean;
3652
+ video_generate?: boolean;
3614
3653
  console_watches?: boolean;
3615
3654
  mcp_events?: boolean;
3655
+ full_codemode?: boolean;
3656
+ schedules?: boolean;
3616
3657
  part_rows?: boolean;
3617
3658
  image_generate?: boolean | {
3618
3659
  model?: string | {
@@ -3638,6 +3679,7 @@ export type ConfigEntry = {
3638
3679
  type: "directory";
3639
3680
  path: AbsolutePath;
3640
3681
  };
3682
+ export type AutomationAction = AutomationActionPrompt | AutomationActionCode;
3641
3683
  export type UsageLimitsInfo = {
3642
3684
  workspace: {
3643
3685
  id: string;
@@ -3704,6 +3746,7 @@ export type SessionMessageAssistantTool1 = {
3704
3746
  completed?: number;
3705
3747
  };
3706
3748
  };
3749
+ export type GenerateVideoJob = GenerateVideoRunning | GenerateVideoCompleted | GenerateVideoError;
3707
3750
  export type GenerateDecisionResult = {
3708
3751
  answers: Array<GenerateDecisionAnswer>;
3709
3752
  cost?: MoneyUSD;
@@ -3718,28 +3761,6 @@ export type CredentialEntry = {
3718
3761
  value: CredentialValue;
3719
3762
  };
3720
3763
  export type FormFields1 = [FormField1, ...Array<FormField1>];
3721
- export type ScheduleInfo = {
3722
- id: ScheduleID;
3723
- sessionID?: SessionID;
3724
- name?: string;
3725
- when: ScheduleWhen;
3726
- tz: string;
3727
- if?: ScheduleCondition;
3728
- until?: ScheduleCondition;
3729
- action: ScheduleAction;
3730
- status: ScheduleStatus;
3731
- nextDueAt?: number;
3732
- endsAt?: number;
3733
- remainingRuns?: number;
3734
- runCount: number;
3735
- lastFiredAt?: number;
3736
- lastOutcome?: ScheduleOutcome;
3737
- lastOutput?: string;
3738
- time: {
3739
- created: number;
3740
- updated: number;
3741
- };
3742
- };
3743
3764
  export type AgentInfo = {
3744
3765
  id: AgentID;
3745
3766
  name: string;
@@ -3760,6 +3781,28 @@ export type SessionsResponse = {
3760
3781
  next?: SessionsCursor | null;
3761
3782
  };
3762
3783
  };
3784
+ export type AutomationInfo = {
3785
+ id: AutomationID;
3786
+ name: string;
3787
+ projectID: ProjectID;
3788
+ sessionID?: SessionID;
3789
+ directory: string;
3790
+ trigger: AutomationTrigger;
3791
+ tz: string;
3792
+ action: AutomationAction;
3793
+ expires?: number;
3794
+ status: AutomationStatus;
3795
+ nextDueAt?: number;
3796
+ runCount: number;
3797
+ lastRunAt?: number;
3798
+ lastOutcome?: AutomationOutcome;
3799
+ lastOutput?: string;
3800
+ state?: JsonValue;
3801
+ time: {
3802
+ created: number;
3803
+ updated: number;
3804
+ };
3805
+ };
3763
3806
  export type SessionInboxInfo = SessionInboxUser | SessionInboxSynthetic | SessionInboxCompaction | SessionInboxMove;
3764
3807
  export type SessionMessageAssistant = {
3765
3808
  id: SessionMessageID;
@@ -3841,6 +3884,9 @@ export type SessionInboxEnqueued = {
3841
3884
  };
3842
3885
  };
3843
3886
  export type SessionMessageAssistantContentEncoded = SessionMessageAssistantText1 | SessionMessageAssistantReasoning1 | SessionMessageAssistantTool1;
3887
+ export type GenerateVideoGetResponse = {
3888
+ data: GenerateVideoJob;
3889
+ };
3844
3890
  export type GenerateDecisionsResponse = {
3845
3891
  data: GenerateDecisionResult;
3846
3892
  };
@@ -4054,6 +4100,17 @@ export type ProviderRequestError = {
4054
4100
  readonly retryAfterMs?: number | undefined;
4055
4101
  };
4056
4102
  export declare const isProviderRequestError: (value: unknown) => value is ProviderRequestError;
4103
+ export type ForbiddenError = {
4104
+ readonly _tag: "ForbiddenError";
4105
+ readonly message: string;
4106
+ };
4107
+ export declare const isForbiddenError: (value: unknown) => value is ForbiddenError;
4108
+ export type VideoNotFoundError = {
4109
+ readonly _tag: "VideoNotFoundError";
4110
+ readonly videoID: string;
4111
+ readonly message: string;
4112
+ };
4113
+ export declare const isVideoNotFoundError: (value: unknown) => value is VideoNotFoundError;
4057
4114
  export type IntegrationNotFoundError = {
4058
4115
  readonly _tag: "IntegrationNotFoundError";
4059
4116
  readonly integrationID: string;
@@ -4080,11 +4137,6 @@ export type McpServerNotFoundError = {
4080
4137
  readonly message: string;
4081
4138
  };
4082
4139
  export declare const isMcpServerNotFoundError: (value: unknown) => value is McpServerNotFoundError;
4083
- export type ForbiddenError = {
4084
- readonly _tag: "ForbiddenError";
4085
- readonly message: string;
4086
- };
4087
- export declare const isForbiddenError: (value: unknown) => value is ForbiddenError;
4088
4140
  export type ProjectNotFoundError = {
4089
4141
  readonly _tag: "ProjectNotFoundError";
4090
4142
  readonly projectID: string;
@@ -4135,12 +4187,18 @@ export type PtyFeatureUnsupportedError = {
4135
4187
  readonly message: string;
4136
4188
  };
4137
4189
  export declare const isPtyFeatureUnsupportedError: (value: unknown) => value is PtyFeatureUnsupportedError;
4138
- export type ScheduleNotFoundError = {
4139
- readonly _tag: "ScheduleNotFoundError";
4140
- readonly scheduleID: string;
4190
+ export type BlobNotFoundError = {
4191
+ readonly _tag: "BlobNotFoundError";
4192
+ readonly blobID: string;
4193
+ readonly message: string;
4194
+ };
4195
+ export declare const isBlobNotFoundError: (value: unknown) => value is BlobNotFoundError;
4196
+ export type AutomationNotFoundError = {
4197
+ readonly _tag: "AutomationNotFoundError";
4198
+ readonly automationID: string;
4141
4199
  readonly message: string;
4142
4200
  };
4143
- export declare const isScheduleNotFoundError: (value: unknown) => value is ScheduleNotFoundError;
4201
+ export declare const isAutomationNotFoundError: (value: unknown) => value is AutomationNotFoundError;
4144
4202
  export type ArtifactNotFoundError = {
4145
4203
  readonly _tag: "ArtifactNotFoundError";
4146
4204
  readonly artifactID: string;
@@ -4889,7 +4947,7 @@ export type ModelListInput = {
4889
4947
  readonly location?: {
4890
4948
  readonly directory?: string | undefined;
4891
4949
  } | undefined;
4892
- readonly types?: ReadonlyArray<"chat" | "decision" | "image" | (string & {})> | undefined;
4950
+ readonly types?: ReadonlyArray<"chat" | "decision" | "image" | "video" | (string & {})> | undefined;
4893
4951
  };
4894
4952
  export type ModelListOutput = {
4895
4953
  location: LocationPublicRef;
@@ -4930,6 +4988,38 @@ export type ExperimentalGenerateImageInput = {
4930
4988
  readonly resolution?: ("1K" | "2K" | "4K" | (string & {})) | undefined;
4931
4989
  };
4932
4990
  export type ExperimentalGenerateImageOutput = GenerateImageResponse["data"];
4991
+ export type ExperimentalGenerateVideoCreateInput = {
4992
+ readonly model: {
4993
+ readonly id: string;
4994
+ readonly providerID: string;
4995
+ readonly variant?: string;
4996
+ };
4997
+ readonly prompt: string;
4998
+ readonly start?: {
4999
+ readonly data: string;
5000
+ readonly mime: string;
5001
+ readonly name?: string;
5002
+ } | undefined;
5003
+ readonly end?: {
5004
+ readonly data: string;
5005
+ readonly mime: string;
5006
+ readonly name?: string;
5007
+ } | undefined;
5008
+ readonly references?: ReadonlyArray<{
5009
+ readonly data: string;
5010
+ readonly mime: string;
5011
+ readonly name?: string;
5012
+ }> | undefined;
5013
+ readonly duration?: number | undefined;
5014
+ readonly aspect?: (`${number}${":"}${number}` | "auto") | undefined;
5015
+ readonly resolution?: ("480p" | "720p" | "1080p" | "4k" | (string & {})) | undefined;
5016
+ readonly sound?: boolean | undefined;
5017
+ };
5018
+ export type ExperimentalGenerateVideoCreateOutput = GenerateVideoCreateResponse["data"];
5019
+ export type ExperimentalGenerateVideoGetInput = {
5020
+ readonly id: string;
5021
+ };
5022
+ export type ExperimentalGenerateVideoGetOutput = GenerateVideoGetResponse["data"];
4933
5023
  export type ExperimentalGenerateDecisionsInput = {
4934
5024
  readonly model: {
4935
5025
  readonly id: string;
@@ -5599,98 +5689,83 @@ export type ExperimentalMediaGetInput = {
5599
5689
  readonly hash: string;
5600
5690
  };
5601
5691
  export type ExperimentalMediaGetOutput = globalThis.Uint8Array;
5602
- export type ExperimentalScheduleCreateInput = {
5603
- readonly sessionID: string;
5604
- readonly name?: string | undefined;
5605
- readonly when?: ({
5606
- readonly in: string;
5607
- readonly at?: never;
5608
- readonly every?: never;
5609
- readonly cron?: never;
5610
- readonly tz?: string;
5611
- } | {
5692
+ export type ExperimentalBlobGetInput = {
5693
+ readonly id: string;
5694
+ };
5695
+ export type ExperimentalBlobGetOutput = globalThis.Uint8Array;
5696
+ export type ExperimentalAutomationCreateInput = {
5697
+ readonly sessionID?: string | undefined;
5698
+ readonly directory?: string | undefined;
5699
+ readonly name: string;
5700
+ readonly trigger: {
5701
+ readonly type: "at";
5612
5702
  readonly at: string;
5613
- readonly in?: never;
5614
- readonly every?: never;
5615
- readonly cron?: never;
5616
5703
  readonly tz?: string;
5617
5704
  } | {
5705
+ readonly type: "every";
5618
5706
  readonly every: string;
5619
- readonly in?: never;
5620
- readonly at?: never;
5621
- readonly cron?: never;
5622
5707
  readonly tz?: string;
5623
5708
  } | {
5709
+ readonly type: "cron";
5624
5710
  readonly cron: string;
5625
- readonly in?: never;
5626
- readonly at?: never;
5627
- readonly every?: never;
5628
5711
  readonly tz?: string;
5629
- }) | undefined;
5630
- readonly if?: ({
5631
- readonly run: string;
5632
- readonly is?: string;
5633
- readonly matches?: string;
5634
- readonly changes?: boolean;
5635
- readonly code?: never;
5636
5712
  } | {
5637
- readonly code: string;
5638
- readonly run?: never;
5639
- readonly is?: never;
5640
- readonly matches?: never;
5641
- readonly changes?: never;
5642
- }) | undefined;
5643
- readonly until?: ({
5644
- readonly run: string;
5645
- readonly is?: string;
5646
- readonly matches?: string;
5647
- readonly changes?: boolean;
5648
- readonly code?: never;
5713
+ readonly type: "event";
5714
+ readonly server: string;
5715
+ readonly event: string;
5716
+ readonly args?: {
5717
+ readonly [x: string]: JsonValue;
5718
+ };
5719
+ };
5720
+ readonly action: {
5721
+ readonly type: "prompt";
5722
+ readonly prompt: string;
5723
+ readonly to?: {
5724
+ readonly session: string;
5725
+ readonly subagent?: never;
5726
+ } | {
5727
+ readonly subagent: string;
5728
+ readonly session?: never;
5729
+ };
5649
5730
  } | {
5731
+ readonly type: "code";
5650
5732
  readonly code: string;
5651
- readonly run?: never;
5652
- readonly is?: never;
5653
- readonly matches?: never;
5654
- readonly changes?: never;
5655
- }) | undefined;
5656
- readonly ends?: {
5657
- readonly after?: string;
5658
- readonly at?: string;
5659
- readonly times?: number;
5660
- } | undefined;
5661
- readonly prompt: string;
5733
+ readonly args?: JsonValue;
5734
+ };
5735
+ readonly expires?: string | undefined;
5662
5736
  };
5663
- export type ExperimentalScheduleCreateOutput = {
5664
- data: ScheduleInfo;
5737
+ export type ExperimentalAutomationCreateOutput = {
5738
+ data: AutomationInfo;
5665
5739
  }["data"];
5666
- export type ExperimentalScheduleListInput = {
5667
- readonly sessionID: string;
5740
+ export type ExperimentalAutomationListInput = {
5741
+ readonly sessionID?: string | undefined;
5742
+ readonly directory?: string | undefined;
5668
5743
  };
5669
- export type ExperimentalScheduleListOutput = {
5670
- data: Array<ScheduleInfo>;
5744
+ export type ExperimentalAutomationListOutput = {
5745
+ data: Array<AutomationInfo>;
5671
5746
  }["data"];
5672
- export type ExperimentalScheduleGetInput = {
5673
- readonly scheduleID: string;
5747
+ export type ExperimentalAutomationGetInput = {
5748
+ readonly automationID: string;
5674
5749
  };
5675
- export type ExperimentalScheduleGetOutput = {
5676
- data: ScheduleInfo;
5750
+ export type ExperimentalAutomationGetOutput = {
5751
+ data: AutomationInfo;
5677
5752
  }["data"];
5678
- export type ExperimentalSchedulePauseInput = {
5679
- readonly scheduleID: string;
5753
+ export type ExperimentalAutomationPauseInput = {
5754
+ readonly automationID: string;
5680
5755
  };
5681
- export type ExperimentalSchedulePauseOutput = {
5682
- data: ScheduleInfo;
5756
+ export type ExperimentalAutomationPauseOutput = {
5757
+ data: AutomationInfo;
5683
5758
  }["data"];
5684
- export type ExperimentalScheduleResumeInput = {
5685
- readonly scheduleID: string;
5759
+ export type ExperimentalAutomationResumeInput = {
5760
+ readonly automationID: string;
5686
5761
  };
5687
- export type ExperimentalScheduleResumeOutput = {
5688
- data: ScheduleInfo;
5762
+ export type ExperimentalAutomationResumeOutput = {
5763
+ data: AutomationInfo;
5689
5764
  }["data"];
5690
- export type ExperimentalScheduleDeleteInput = {
5691
- readonly scheduleID: string;
5765
+ export type ExperimentalAutomationDeleteInput = {
5766
+ readonly automationID: string;
5692
5767
  };
5693
- export type ExperimentalScheduleDeleteOutput = void;
5768
+ export type ExperimentalAutomationDeleteOutput = void;
5694
5769
  export type ExperimentalArtifactsProvidersInput = {
5695
5770
  readonly location?: {
5696
5771
  readonly directory?: string | undefined;
@@ -5770,7 +5845,7 @@ export type ExperimentalArtifactsViewInput = {
5770
5845
  export type ExperimentalArtifactsViewOutput = globalThis.Uint8Array;
5771
5846
  export type ExperimentalJobListInput = {
5772
5847
  readonly sessionID?: string | undefined;
5773
- readonly kind?: ("shell" | "subagent" | "image") | undefined;
5848
+ readonly kind?: ("shell" | "subagent" | "image" | "codemode") | undefined;
5774
5849
  readonly status?: ("running" | "completed" | "error" | "cancelled") | undefined;
5775
5850
  readonly descendants?: boolean | undefined;
5776
5851
  };
@@ -24,11 +24,12 @@ export const isProviderNotFoundError = (value) => typeof value === "object" && v
24
24
  export const isModelNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ModelNotFoundError";
25
25
  export const isUnsupportedModelError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "UnsupportedModelError";
26
26
  export const isProviderRequestError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ProviderRequestError";
27
+ export const isForbiddenError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ForbiddenError";
28
+ export const isVideoNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "VideoNotFoundError";
27
29
  export const isIntegrationNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "IntegrationNotFoundError";
28
30
  export const isIntegrationAttemptNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "IntegrationAttemptNotFoundError";
29
31
  export const isIntegrationMethodNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "IntegrationMethodNotFoundError";
30
32
  export const isMcpServerNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "McpServerNotFoundError";
31
- export const isForbiddenError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ForbiddenError";
32
33
  export const isProjectNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ProjectNotFoundError";
33
34
  export const isPermissionSavedNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "PermissionSavedNotFoundError";
34
35
  export const isPermissionNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "PermissionNotFoundError";
@@ -37,7 +38,8 @@ export const isRpcError = (value) => typeof value === "object" && value !== null
37
38
  export const isRpcInternalError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "RpcInternalError";
38
39
  export const isPtyNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "PtyNotFoundError";
39
40
  export const isPtyFeatureUnsupportedError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "PtyFeatureUnsupportedError";
40
- export const isScheduleNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ScheduleNotFoundError";
41
+ export const isBlobNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "BlobNotFoundError";
42
+ export const isAutomationNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "AutomationNotFoundError";
41
43
  export const isArtifactNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ArtifactNotFoundError";
42
44
  export const isShellNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ShellNotFoundError";
43
45
  export const isWorktreeError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "WorktreeError";
package/client/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var k=Object.defineProperty;var L=(n)=>n;function F(n,a){this[n]=L.bind(null,a)}var T=(n,a)=>{for(var i in a)k(n,i,{get:a[i],enumerable:!0,configurable:!0,set:F.bind(a,i)})};var h={};T(h,{OpenCode:()=>h,make:()=>_});class m extends Error{reason;name="ClientError";constructor(n,a){let i=a?.detail??(a?.cause instanceof Error?a.cause.message:void 0);super(i?`${n}: ${i}`:n,a);this.reason=n}}var w=16777216;function U(n){let a=n.fetch??globalThis.fetch,i=(e,t)=>{let r=new URL(n.baseUrl);if(!r.pathname.endsWith("/"))r.pathname+="/";let I=new URL(e.path.slice(1),r);for(let[d,u]of Object.entries(e.query??{}))E(I.searchParams,d,u);let x=new Headers(n.headers);for(let[d,u]of Object.entries(e.headers??{}))if(u!==void 0&&u!==null)x.set(d,String(u));for(let[d,u]of new Headers(t?.headers))x.set(d,u);if(e.body!==void 0&&!x.has("content-type"))x.set("content-type",e.binaryBody?"application/octet-stream":"application/json");return{url:I,init:{method:e.method,signal:t?.signal,headers:x,body:e.body===void 0?void 0:e.binaryBody?e.body:JSON.stringify(e.body)}}},y=async(e,t)=>{try{let r=i(e,t);return await a(r.url,r.init)}catch(r){throw new m("Transport",{cause:r})}},c=async(e,t)=>{if(t.declaredStatuses.includes(e.status))throw G(await R(e));try{await e.body?.cancel()}catch{}throw new m("UnexpectedStatus",{cause:{status:e.status},detail:String(e.status)})},o=async(e,t)=>{let r=await y(e,t);if(r.status!==e.successStatus)return c(r,e);if(e.binary)return new Uint8Array(await r.arrayBuffer());if(e.empty){try{await r.body?.cancel()}catch{}return}return await R(r)},l=(e,t)=>({async*[Symbol.asyncIterator](){let r=await y(e,t);if(r.status!==e.successStatus)await c(r,e);if(!O(r,"text/event-stream")){try{await r.body?.cancel()}catch{}throw new m("UnsupportedContentType",{detail:r.headers.get("content-type")})}if(r.body===null)throw new m("MalformedResponse");let I=r.body.getReader(),x=new TextDecoder,d="";try{while(!0){let u;try{u=await I.read()}catch(p){throw new m("Transport",{cause:p})}if(!u.done)t?.onActivity?.();if(d+=x.decode(u.value,{stream:!u.done}),d.length>w)throw new m("SseEventTooLarge");let f=!u.done&&d.endsWith("\r");if(f)d=d.slice(0,-1);if(d=d.replaceAll(`\r
1
+ var k=Object.defineProperty;var L=(n)=>n;function F(n,a){this[n]=L.bind(null,a)}var T=(n,a)=>{for(var i in a)k(n,i,{get:a[i],enumerable:!0,configurable:!0,set:F.bind(a,i)})};var h={};T(h,{OpenCode:()=>h,make:()=>_});class m extends Error{reason;name="ClientError";constructor(n,a){let i=a?.detail??(a?.cause instanceof Error?a.cause.message:void 0);super(i?`${n}: ${i}`:n,a);this.reason=n}}var U=16777216;function w(n){let a=n.fetch??globalThis.fetch,i=(e,t)=>{let r=new URL(n.baseUrl);if(!r.pathname.endsWith("/"))r.pathname+="/";let I=new URL(e.path.slice(1),r);for(let[d,u]of Object.entries(e.query??{}))E(I.searchParams,d,u);let x=new Headers(n.headers);for(let[d,u]of Object.entries(e.headers??{}))if(u!==void 0&&u!==null)x.set(d,String(u));for(let[d,u]of new Headers(t?.headers))x.set(d,u);if(e.body!==void 0&&!x.has("content-type"))x.set("content-type",e.binaryBody?"application/octet-stream":"application/json");return{url:I,init:{method:e.method,signal:t?.signal,headers:x,body:e.body===void 0?void 0:e.binaryBody?e.body:JSON.stringify(e.body)}}},c=async(e,t)=>{try{let r=i(e,t);return await a(r.url,r.init)}catch(r){throw new m("Transport",{cause:r})}},y=async(e,t)=>{if(t.declaredStatuses.includes(e.status))throw G(await R(e));try{await e.body?.cancel()}catch{}throw new m("UnexpectedStatus",{cause:{status:e.status},detail:String(e.status)})},o=async(e,t)=>{let r=await c(e,t);if(r.status!==e.successStatus)return y(r,e);if(e.binary)return new Uint8Array(await r.arrayBuffer());if(e.empty){try{await r.body?.cancel()}catch{}return}return await R(r)},l=(e,t)=>({async*[Symbol.asyncIterator](){let r=await c(e,t);if(r.status!==e.successStatus)await y(r,e);if(!O(r,"text/event-stream")){try{await r.body?.cancel()}catch{}throw new m("UnsupportedContentType",{detail:r.headers.get("content-type")})}if(r.body===null)throw new m("MalformedResponse");let I=r.body.getReader(),x=new TextDecoder,d="";try{while(!0){let u;try{u=await I.read()}catch(p){throw new m("Transport",{cause:p})}if(!u.done)t?.onActivity?.();if(d+=x.decode(u.value,{stream:!u.done}),d.length>U)throw new m("SseEventTooLarge");let f=!u.done&&d.endsWith("\r");if(f)d=d.slice(0,-1);if(d=d.replaceAll(`\r
2
2
  `,`
3
3
  `).replaceAll("\r",`
4
4
  `),f)d+="\r";if(u.done&&d!=="")d+=`
@@ -9,4 +9,4 @@ var k=Object.defineProperty;var L=(n)=>n;function F(n,a){this[n]=L.bind(null,a)}
9
9
  `).flatMap((S)=>S.startsWith("data:")?[S.slice(5).trimStart()]:[]).join(`
10
10
  `);if(g!=="")try{yield JSON.parse(g)}catch(S){throw new m("MalformedResponse",{cause:S})}b=d.indexOf(`
11
11
 
12
- `)}if(u.done)return}}finally{try{await I.cancel()}catch{}I.releaseLock()}}}),s={server:{info:(e)=>o({method:"GET",path:"/api/info",successStatus:200,declaredStatuses:[400,401],empty:!1},e),pair:(e)=>o({method:"POST",path:"/api/pair",successStatus:200,declaredStatuses:[400,401],empty:!1},e),connect:(e,t)=>o({method:"GET",path:`/auth/connect/${encodeURIComponent(e.code)}`,successStatus:200,declaredStatuses:[400,401],empty:!1},t)},location:{get:(e,t)=>o({method:"GET",path:"/api/location",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),reload:(e)=>o({method:"POST",path:"/api/location/reload",successStatus:204,declaredStatuses:[400,401,503],empty:!0},e)},agent:{list:(e,t)=>o({method:"GET",path:"/api/agent",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/agent/${encodeURIComponent(e.agentID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},plugin:{list:(e,t)=>o({method:"GET",path:"/api/plugin",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),gui:(e,t)=>o({method:"GET",path:"/api/plugin/gui",query:{location:e.location,id:e.id},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),check:(e,t)=>o({method:"POST",path:"/api/plugin/check",query:{location:e?.location},body:{target:e?.target},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),update:(e,t)=>o({method:"POST",path:"/api/plugin/update",query:{location:e.location},body:{targets:e.targets},successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t)},session:{list:(e,t)=>o({method:"GET",path:"/api/session",query:{limit:e?.limit,order:e?.order,search:e?.search,parentID:e?.parentID,archived:e?.archived,directory:e?.directory,project:e?.project,subpath:e?.subpath,cursor:e?.cursor},successStatus:200,declaredStatuses:[400,401],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/session",body:{id:e?.id,parentID:e?.parentID,title:e?.title,agent:e?.agent,model:e?.model,location:e?.location,metadata:e?.metadata,permissions:e?.permissions},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),active:(e)=>o({method:"GET",path:"/api/session/active",successStatus:200,declaredStatuses:[400,401],empty:!1},e).then((t)=>t.data),get:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),remove:(e,t)=>o({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),fork:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/fork`,body:{before:e.before},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),switchAgent:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/agent`,body:{agent:e.agent},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),switchModel:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/model`,body:{model:e.model},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),update:(e,t)=>o({method:"PATCH",path:`/api/session/${encodeURIComponent(e.sessionID)}`,body:{title:e.title,metadata:e.metadata,permissions:e.permissions,archived:e.archived},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),move:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/move`,body:{directory:e.directory,delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),prompt:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/prompt`,body:{id:e.id,text:e.text,files:e.files,agents:e.agents,skills:e.skills,metadata:e.metadata,delivery:e.delivery,resume:e.resume},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),command:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/command`,body:{name:e.name,text:e.text,files:e.files,agents:e.agents,skills:e.skills,delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404,500],empty:!0},t),synthetic:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/synthetic`,body:{id:e.id,text:e.text,description:e.description,metadata:e.metadata,delivery:e.delivery,resume:e.resume},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),shell:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/shell`,body:{id:e.id,command:e.command},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),compact:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/compact`,body:{id:e.id,delivery:e.delivery},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),revert:{stage:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/revert/stage`,body:{messageID:e.messageID,files:e.files},successStatus:200,declaredStatuses:[400,401,404,409,500],empty:!1},t).then((r)=>r.data),clear:(e,t)=>o({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}/revert`,successStatus:204,declaredStatuses:[400,401,404,409,500],empty:!0},t),commit:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/revert/commit`,successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},context:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/context`,successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then((r)=>r.data),diff:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/diff`,query:{from:e.from,to:e.to,context:e.context},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then((r)=>r.data),inbox:{list:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),cancel:(e,t)=>o({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox/${encodeURIComponent(e.inboxID)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),update:(e,t)=>o({method:"PATCH",path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox/${encodeURIComponent(e.inboxID)}`,body:{delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},generate:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/generate`,body:{prompt:e.prompt},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then((r)=>r.data),interrupt:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/interrupt`,query:{resume:e.resume},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),background:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/background`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),message:{get:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/message/${encodeURIComponent(e.messageID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data)},form:{list:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/form`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),create:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/form`,body:{id:e.id,title:e.title,metadata:e.metadata,fields:e.fields},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),get:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),reply:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}/reply`,body:{answer:e.answer},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t),cancel:(e,t)=>o({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}`,query:{message:e.message},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},environment:(e,t)=>o({method:"PUT",path:`/api/session/${encodeURIComponent(e.sessionID)}/environment`,body:{variables:e.variables},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),view:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/view`,body:{idle:e.idle},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},experimental:{session:{stats:(e,t)=>o({method:"GET",path:"/api/experimental/session/stats",query:{from:e?.from,to:e?.to,project:e?.project,timezone:e?.timezone,tools:e?.tools},successStatus:200,declaredStatuses:[400,401],empty:!1},t).then((r)=>r.data),import:(e,t)=>o({method:"POST",path:"/api/experimental/session/import",body:{info:e.info,messages:e.messages,location:e.location},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),export:(e,t)=>o({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/export`,query:{sanitize:e.sanitize},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then((r)=>r.data),skill:(e,t)=>o({method:"POST",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/skill`,body:{id:e.id,resume:e.resume},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),wait:(e,t)=>o({method:"POST",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/wait`,successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),instructions:{entry:{list:(e,t)=>o({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),put:(e,t)=>o({method:"PUT",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries/${encodeURIComponent(e.key)}`,body:{value:e.value},successStatus:204,declaredStatuses:[400,401,404,413],empty:!0},t),remove:(e,t)=>o({method:"DELETE",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries/${encodeURIComponent(e.key)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},log:(e,t)=>l({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/log`,query:{after:e.after,follow:e.follow},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},generate:{text:(e,t)=>o({method:"POST",path:"/api/experimental/generate/text",body:{prompt:e.prompt,model:e.model},successStatus:200,declaredStatuses:[400,401,404,422,502,503],empty:!1},t).then((r)=>r.data),image:(e,t)=>o({method:"POST",path:"/api/experimental/generate/image",body:{model:e.model,prompt:e.prompt,images:e.images,n:e.n,aspect:e.aspect,resolution:e.resolution},successStatus:200,declaredStatuses:[400,401,404,422,502,503],empty:!1},t).then((r)=>r.data),decisions:(e,t)=>o({method:"POST",path:"/api/experimental/generate/decisions",body:{model:e.model,input:e.input,questions:e.questions},successStatus:200,declaredStatuses:[400,401,404,422,502,503],empty:!1},t).then((r)=>r.data)},voice:{models:(e)=>o({method:"GET",path:"/api/experimental/voice/models",successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},e).then((t)=>t.data),session:(e,t)=>o({method:"POST",path:"/api/experimental/voice/session",body:{model:e.model,session:e.session,transport:e.transport},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then((r)=>r.data)},integration:{wellknown:{add:(e,t)=>o({method:"POST",path:"/api/experimental/integration/wellknown",query:{location:e.location},body:{url:e.url},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},mcp:{add:(e,t)=>o({method:"PUT",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}`,query:{location:e.location},body:{config:e.config},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),remove:(e,t)=>o({method:"DELETE",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),connect:(e,t)=>o({method:"POST",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}/connect`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),disconnect:(e,t)=>o({method:"POST",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}/disconnect`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),client:{token:(e,t)=>o({method:"POST",path:"/api/experimental/client-mcp/token",query:{location:e.location,name:e.name},headers:{"x-opencode-ticket":e["x-opencode-ticket"]},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t)}},file:{write:(e,t)=>o({method:"POST",path:"/api/experimental/fs/write",query:{location:e.location,path:e.path},body:e.payload,successStatus:200,declaredStatuses:[400,401,404],empty:!1,binaryBody:!0},t),watch:(e,t)=>o({method:"POST",path:"/api/experimental/fs/watch",query:{location:e.location},body:{path:e.path},successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),unwatch:(e,t)=>o({method:"DELETE",path:"/api/experimental/fs/watch",query:{location:e.location},body:{path:e.path},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},persistentPty:{read:(e,t)=>o({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal/read`,query:{lines:e.lines},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then((r)=>r.data),list:(e,t)=>o({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal`,successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then((r)=>r.data),create:(e,t)=>o({method:"POST",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal`,body:{command:e.command,args:e.args,cwd:e.cwd,title:e.title,env:e.env,size:e.size},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then((r)=>r.data),shutdown:(e)=>o({method:"POST",path:"/api/experimental/persistent-pty/shutdown",successStatus:204,declaredStatuses:[400,401,503],empty:!0},e),handoff:(e)=>o({method:"POST",path:"/api/experimental/persistent-pty/handoff",successStatus:200,declaredStatuses:[400,401,503],empty:!1},e),get:(e,t)=>o({method:"GET",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then((r)=>r.data),update:(e,t)=>o({method:"PUT",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,body:{attachmentID:e.attachmentID,size:e.size,title:e.title},successStatus:200,declaredStatuses:[400,401,404,501,503],empty:!1},t).then((r)=>r.data),snapshot:(e,t)=>o({method:"GET",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}/snapshot`,successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then((r)=>r.data),remove:(e,t)=>o({method:"DELETE",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),connectToken:(e,t)=>o({method:"POST",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}/connect-token`,headers:{"x-opencode-ticket":e["x-opencode-ticket"]},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t).then((r)=>r.data)},media:{get:(e,t)=>o({method:"GET",path:`/api/experimental/media/${encodeURIComponent(e.hash)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1,binary:!0},t)},schedule:{create:(e,t)=>o({method:"POST",path:"/api/experimental/schedule",body:{sessionID:e.sessionID,name:e.name,when:e.when,if:e.if,until:e.until,ends:e.ends,prompt:e.prompt},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),list:(e,t)=>o({method:"GET",path:"/api/experimental/schedule",query:{sessionID:e.sessionID},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),get:(e,t)=>o({method:"GET",path:`/api/experimental/schedule/${encodeURIComponent(e.scheduleID)}`,successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),pause:(e,t)=>o({method:"POST",path:`/api/experimental/schedule/${encodeURIComponent(e.scheduleID)}/pause`,successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),resume:(e,t)=>o({method:"POST",path:`/api/experimental/schedule/${encodeURIComponent(e.scheduleID)}/resume`,successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),delete:(e,t)=>o({method:"DELETE",path:`/api/experimental/schedule/${encodeURIComponent(e.scheduleID)}`,successStatus:204,declaredStatuses:[400,401,403,404],empty:!0},t)},artifacts:{providers:(e,t)=>o({method:"GET",path:"/api/experimental/artifacts/providers",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),list:(e,t)=>o({method:"GET",path:"/api/experimental/artifacts",query:{location:e?.location,sessionID:e?.sessionID,provider:e?.provider},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/experimental/artifacts",query:{location:e.location},body:{title:e.title,files:e.files,entry:e.entry,provider:e.provider,sessionID:e.sessionID},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/experimental/artifacts/${encodeURIComponent(e.artifactID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),update:(e,t)=>o({method:"PATCH",path:`/api/experimental/artifacts/${encodeURIComponent(e.artifactID)}`,query:{location:e.location},body:{title:e.title,files:e.files,entry:e.entry,sessionID:e.sessionID},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),delete:(e,t)=>o({method:"DELETE",path:`/api/experimental/artifacts/${encodeURIComponent(e.artifactID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,403,404,503],empty:!0},t),view:(e,t)=>o({method:"GET",path:`/api/experimental/artifacts/${encodeURIComponent(e.artifactID)}/view/${v(e.path)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1,binary:!0},t)},job:{list:(e,t)=>o({method:"GET",path:"/api/experimental/job",query:{sessionID:e?.sessionID,kind:e?.kind,status:e?.status,descendants:e?.descendants},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data)},migration:{v1:{status:(e)=>o({method:"GET",path:"/api/experimental/migration/v1",successStatus:200,declaredStatuses:[400,401],empty:!1},e)}},usage:{limits:(e,t)=>o({method:"GET",path:"/api/experimental/usage/limits",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},config:{update:(e,t)=>o({method:"PATCH",path:"/api/experimental/config",body:{shell:e.shell},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},message:{list:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/message`,query:{limit:e.limit,order:e.order,cursor:e.cursor,type:e.type},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t)},model:{list:(e,t)=>o({method:"GET",path:"/api/model",query:{location:e?.location,types:e?.types},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),default:(e,t)=>o({method:"GET",path:"/api/model/default",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},provider:{list:(e,t)=>o({method:"GET",path:"/api/provider",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/provider/${encodeURIComponent(e.providerID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},integration:{list:(e,t)=>o({method:"GET",path:"/api/integration",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/integration/${encodeURIComponent(e.integrationID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),connect:{key:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/key`,query:{location:e.location},body:{key:e.key,answer:e.answer,label:e.label},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),external:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/external`,query:{location:e.location},body:{methodID:e.methodID,answer:e.answer,label:e.label},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},oauth:{connect:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth`,query:{location:e.location},body:{methodID:e.methodID,answer:e.answer,label:e.label},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),status:(e,t)=>o({method:"GET",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),complete:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}/complete`,query:{location:e.location},body:{code:e.code},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),cancel:(e,t)=>o({method:"DELETE",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},command:{connect:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command`,query:{location:e.location},body:{methodID:e.methodID,label:e.label},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),status:(e,t)=>o({method:"GET",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),cancel:(e,t)=>o({method:"DELETE",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},mcp:{list:(e,t)=>o({method:"GET",path:"/api/mcp",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),resource:{catalog:(e,t)=>o({method:"GET",path:"/api/mcp/resource",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)}},credential:{list:(e)=>o({method:"GET",path:"/api/credential",successStatus:200,declaredStatuses:[400,401],empty:!1},e).then((t)=>t.data),create:(e,t)=>o({method:"POST",path:"/api/credential",body:{id:e.id,integrationID:e.integrationID,label:e.label,value:e.value,activate:e.activate},successStatus:200,declaredStatuses:[400,401,409],empty:!1},t).then((r)=>r.data),update:(e,t)=>o({method:"PATCH",path:`/api/credential/${encodeURIComponent(e.credentialID)}`,body:{label:e.label},successStatus:204,declaredStatuses:[400,401],empty:!0},t),activate:(e,t)=>o({method:"POST",path:`/api/credential/${encodeURIComponent(e.credentialID)}/activate`,successStatus:204,declaredStatuses:[400,401],empty:!0},t),remove:(e,t)=>o({method:"DELETE",path:`/api/credential/${encodeURIComponent(e.credentialID)}`,successStatus:204,declaredStatuses:[400,401],empty:!0},t)},project:{list:(e,t)=>o({method:"GET",path:"/api/project",query:{archived:e?.archived},successStatus:200,declaredStatuses:[400,401],empty:!1},t),update:(e,t)=>o({method:"PATCH",path:`/api/project/${encodeURIComponent(e.projectID)}`,body:{canonical:e.canonical,name:e.name,icon:e.icon,commands:e.commands},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},form:{list:(e,t)=>o({method:"GET",path:"/api/form",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},permission:{request:{list:(e,t)=>o({method:"GET",path:"/api/permission/request",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},saved:{list:(e,t)=>o({method:"GET",path:"/api/permission/saved",query:{projectID:e?.projectID},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),update:(e,t)=>o({method:"PATCH",path:`/api/permission/saved/${encodeURIComponent(e.id)}`,body:{action:e.action,resource:e.resource},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),remove:(e,t)=>o({method:"DELETE",path:`/api/permission/saved/${encodeURIComponent(e.id)}`,successStatus:204,declaredStatuses:[400,401],empty:!0},t)},create:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission`,body:{id:e.id,action:e.action,resources:e.resources,save:e.save,metadata:e.metadata,source:e.source,agent:e.agent},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),list:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),get:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission/${encodeURIComponent(e.requestID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),reply:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission/${encodeURIComponent(e.requestID)}/reply`,body:{decision:e.decision,message:e.message},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},file:{read:(e,t)=>o({method:"GET",path:`/api/fs/read/${v(e.path)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1,binary:!0},t),list:(e,t)=>o({method:"GET",path:"/api/fs/list",query:{location:e?.location,path:e?.path},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),find:(e,t)=>o({method:"GET",path:"/api/fs/find",query:{location:e.location,query:e.query,type:e.type,limit:e.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},command:{list:(e,t)=>o({method:"GET",path:"/api/command",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},skill:{list:(e,t)=>o({method:"GET",path:"/api/skill",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},rpc:{call:(e,t)=>o({method:"POST",path:`/api/rpc/${encodeURIComponent(e.rpcID)}/${encodeURIComponent(e.method)}`,query:{location:e.location},body:{input:e.input},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t)},event:{subscribe:(e,t)=>l({method:"GET",path:"/api/event",query:{types:e?.types},successStatus:200,declaredStatuses:[400,401],empty:!1},t)},pty:{list:(e,t)=>o({method:"GET",path:"/api/pty",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/pty",query:{location:e?.location},body:{command:e?.command,args:e?.args,cwd:e?.cwd,title:e?.title,env:e?.env},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),update:(e,t)=>o({method:"PUT",path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},body:{title:e.title,size:e.size},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>o({method:"DELETE",path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),connect:{token:(e,t)=>o({method:"POST",path:`/api/pty/${encodeURIComponent(e.ptyID)}/connect-token`,query:{location:e.location},headers:{"x-opencode-ticket":e["x-opencode-ticket"]},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t)}},shell:{list:(e,t)=>o({method:"GET",path:"/api/shell",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/shell",query:{location:e.location},body:{command:e.command,cwd:e.cwd,timeout:e.timeout,metadata:e.metadata},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/shell/${encodeURIComponent(e.id)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),output:(e,t)=>o({method:"GET",path:`/api/shell/${encodeURIComponent(e.id)}/output`,query:{location:e.location,cursor:e.cursor,limit:e.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>o({method:"DELETE",path:`/api/shell/${encodeURIComponent(e.id)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},reference:{list:(e,t)=>o({method:"GET",path:"/api/reference",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},worktree:{list:(e,t)=>o({method:"GET",path:"/api/worktree",query:{projectID:e.projectID},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/worktree",body:{projectID:e.projectID,from:e.from,branch:e.branch,directory:e.directory,name:e.name},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>o({method:"DELETE",path:"/api/worktree",body:{projectID:e.projectID,directory:e.directory,force:e.force},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),refresh:(e,t)=>o({method:"POST",path:"/api/worktree/refresh",body:{projectID:e.projectID},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},vcs:{init:(e,t)=>o({method:"POST",path:"/api/vcs/init",query:{location:e?.location,provider:e?.provider},successStatus:204,declaredStatuses:[400,401,404,409,501,503],empty:!0},t),get:(e,t)=>o({method:"GET",path:"/api/vcs",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),base:(e,t)=>o({method:"GET",path:"/api/vcs/base",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),status:(e,t)=>o({method:"GET",path:"/api/vcs/status",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),branch:{list:(e,t)=>o({method:"GET",path:"/api/vcs/branch",query:{location:e?.location,search:e?.search,limit:e?.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},diff:(e,t)=>o({method:"GET",path:"/api/vcs/diff",query:{location:e.location,mode:e.mode,base:e.base,context:e.context,untracked:e.untracked},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},debug:{heapDump:(e,t)=>o({method:"POST",path:"/api/debug/heap-dump",query:{directory:e?.directory},successStatus:200,declaredStatuses:[400,401,500],empty:!1},t),location:{list:(e)=>o({method:"GET",path:"/api/debug/location",successStatus:200,declaredStatuses:[400,401],empty:!1},e),evict:(e,t)=>o({method:"DELETE",path:"/api/debug/location",query:{location:e?.location},successStatus:204,declaredStatuses:[400,401],empty:!0},t)}},websearch:{providers:(e,t)=>o({method:"GET",path:"/api/websearch/provider",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),query:(e,t)=>o({method:"POST",path:"/api/websearch",query:{location:e.location},body:{query:e.query,providerID:e.providerID},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},config:{get:(e,t)=>o({method:"GET",path:"/api/config",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),shells:(e)=>o({method:"GET",path:"/api/config/shell",successStatus:200,declaredStatuses:[400,401,404],empty:!1},e)}};return{...s,session:{...s.session,stats:s.experimental.session.stats,import:s.experimental.session.import,export:s.experimental.session.export,skill:s.experimental.session.skill,wait:s.experimental.session.wait,instructions:{entry:{list:s.experimental.session.instructions.entry.list,put:s.experimental.session.instructions.entry.put,remove:s.experimental.session.instructions.entry.remove}},log:s.experimental.session.log},generate:{text:s.experimental.generate.text,image:s.experimental.generate.image,decisions:s.experimental.generate.decisions},voice:{models:s.experimental.voice.models,session:s.experimental.voice.session},integration:{...s.integration,wellknown:{add:s.experimental.integration.wellknown.add}},mcp:{...s.mcp,add:s.experimental.mcp.add,remove:s.experimental.mcp.remove,connect:s.experimental.mcp.connect,disconnect:s.experimental.mcp.disconnect,client:{token:s.experimental.mcp.client.token}},file:{...s.file,write:s.experimental.file.write,watch:s.experimental.file.watch,unwatch:s.experimental.file.unwatch},migration:{v1:{status:s.experimental.migration.v1.status}},usage:{limits:s.experimental.usage.limits},config:{...s.config,update:s.experimental.config.update}}}function v(n){return n.split("/").map(encodeURIComponent).join("/")}function E(n,a,i){if(i===void 0)return;if(i===null){n.append(a,"null");return}if(Array.isArray(i)){for(let y of i)E(n,a,y);return}if(typeof i==="object"){for(let[y,c]of Object.entries(i))E(n,`${a}[${y}]`,c);return}n.append(a,String(i))}async function R(n){if(!O(n,"application/json")&&!n.headers.get("content-type")?.includes("+json")){try{await n.body?.cancel()}catch{}throw new m("UnsupportedContentType",{detail:n.headers.get("content-type")})}let a;try{a=await n.text()}catch(i){throw new m("Transport",{cause:i})}if(a==="")throw new m("MalformedResponse");try{return JSON.parse(a)}catch(i){throw new m("MalformedResponse",{cause:i})}}function G(n){let a=Object.assign(Error(n.message??n.data?.message),n);if(n._tag)a.name=n._tag;return a}function O(n,a){return n.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase()===a}var Y=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="InvalidRequestError",X=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="UnauthorizedError",Z=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="LocationNotFoundError",ee=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ServiceUnavailableError",te=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="AgentNotFoundError",ne=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PluginNotFoundError",oe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="InvalidCursorError",re=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="SessionNotFoundError",se=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="MessageNotFoundError",ae=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ConflictError",ie=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="CommandNotFoundError",de=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="CommandExecutionError",pe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="SessionBusyError",le=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="UnknownError",ue=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="FormNotFoundError",ce=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="FormInvalidAnswerError",ye=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="FormAlreadySettledError",me=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="SkillNotFoundError",ge=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="InstructionEntryValueTooLargeError",Ie=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ProviderNotFoundError",xe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ModelNotFoundError",Se=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="UnsupportedModelError",fe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ProviderRequestError",be=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="IntegrationNotFoundError",he=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="IntegrationAttemptNotFoundError",Ee=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="IntegrationMethodNotFoundError",De=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="McpServerNotFoundError",ve=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ForbiddenError",Re=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ProjectNotFoundError",Oe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PermissionSavedNotFoundError",Pe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PermissionNotFoundError",Ce=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="FileNotFoundError",C=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="RpcError",A=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="RpcInternalError",Ae=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PtyNotFoundError",Me=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PtyFeatureUnsupportedError",qe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ScheduleNotFoundError",ke=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ArtifactNotFoundError",Le=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ShellNotFoundError",Fe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="WorktreeError",Te=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="VcsInitNotSupportedError";function N(n){let a,i=4096;function y(o){if(o.connected=void 0,o.controller.abort(),a===o)a=void 0}async function c(o){let l,s={};try{if(o.controller.signal.aborted)return;l=n(o.controller.signal,()=>{o.subscribers.forEach((e)=>e.activity?.())})[Symbol.asyncIterator]();while(!o.controller.signal.aborted){let e=await l.next();if(e.done||o.controller.signal.aborted)break;if(e.value.type==="server.connected")o.connected=e.value;o.subscribers.forEach((t)=>t.push(e.value))}}catch(e){s={error:e}}finally{y(o);try{await l?.return?.()}catch(e){if(!("error"in s))s={error:e}}o.subscribers.forEach((e)=>e.finish(s))}}return{subscribe(o){return{[Symbol.asyncIterator](){let l=[],s=[],e=!1,t,r,I=o?.types?.length?new Set(o.types):void 0,x=(p)=>!I||p.type==="server.connected"||I.has(p.type);function d(p,g=!0){if(t=p,g)s.length=0;if(o?.signal?.removeEventListener("abort",u),r?.subscribers.delete(f)&&!r.subscribers.size)y(r);l.splice(0).forEach((S)=>{if("error"in p)S.reject(p.error);else S.resolve({done:!0,value:void 0})})}function u(){d({})}let f={activity:o?.onActivity,finish(p){d(p,!1)},push(p){if(t)return;if(!x(p))return;let g=l.shift();if(g){g.resolve({done:!1,value:p});return}if(s.length===4096){d({error:Error("Event subscriber exceeded its 4096-event capacity")});return}s.push(p)}};function b(){if(t)return;let p=!a;if(r=a??{controller:new AbortController,subscribers:new Set},a=r,r.subscribers.add(f),r.connected)f.push(r.connected);if(p)c(r)}return{next(){let p=s.shift();if(p)return Promise.resolve({done:!1,value:p});if(t){if("error"in t)return Promise.reject(t.error);return Promise.resolve({done:!0,value:void 0})}if(o?.signal?.aborted)return u(),Promise.resolve({done:!0,value:void 0});let g=Promise.withResolvers();if(l.push(g),!e)e=!0,o?.signal?.addEventListener("abort",u,{once:!0}),b();return g.promise},return(){return d({}),Promise.resolve({done:!0,value:void 0})}}}}}}}function q(n,a){return(i)=>{let y=(c,o)=>{if(!Object.hasOwn(i.events,c))throw Error(`Unknown RPC event: ${i.id}.${c}`);let l=V(i,c);return{[Symbol.asyncIterator](){let s=new AbortController,e=o?.signal?AbortSignal.any([s.signal,o.signal]):s.signal,t=async function*(){try{for await(let r of a.subscribe({signal:e})){if(e.aborted)return;if(r.type!==l)continue;yield r}}catch(r){if(!e.aborted)throw r}finally{s.abort()}}();return{next:()=>t.next(),return:()=>(s.abort(),t.return())}}}};return Object.assign(Object.fromEntries(Object.keys(i.methods).map((c)=>[c,async(o,l)=>{try{return(await n.rpc.call({rpcID:i.id,method:c,input:o,location:l?.location},{signal:l?.signal,headers:l?.headers})).output}catch(s){if(!C(s)&&!A(s))throw s;throw s.data===void 0?{type:s.type,message:s.message}:{type:s.type,message:s.message,data:s.data}}}])),{events:{subscribe:y,on:(c,o,l)=>{let s=new AbortController,e=l?.signal?AbortSignal.any([s.signal,l.signal]):s.signal,t=y(c,{signal:e});return(async()=>{for await(let r of t)await o(r)})().catch((r)=>console.error(r)),()=>s.abort()}}})}}function V(n,a){return`rpc.${n.id}.${a}`}function _(n){let a=U(n),i=N((y,c)=>a.event.subscribe(void 0,{signal:y,onActivity:c}));return{...a,rpc:Object.assign(q(a,i),a.rpc),event:i}}function j(n){return n.flatMap((a)=>a.type==="document"?a.experimental?.diagnostics??[]:[])}function W(n){let a=n.line===void 0?"":`:${n.line}:${n.column??1}`;return`${n.source}${a} (${n.path}): ${n.message}`}var J=/^media:([0-9a-f]{64})$/;function B(n){if(!n)return;return J.exec(n)?.[1]}function z(n){return{...n,message:{...n.message,list:(a,i)=>n.message.list(a,D(i))},session:{...n.session,message:{...n.session.message,get:(a,i)=>n.session.message.get(a,D(i))},inbox:{...n.session.inbox,list:(a,i)=>n.session.inbox.list(a,D(i))}}}}function D(n){if(n?.mediaRefs===!1)return n;let a=new Headers(n?.headers);return a.set("X-OpenCode-Capabilities","experimental-media-uri"),{...n,headers:a}}export{m as ClientError,h as OpenCode,j as configDiagnostics,W as formatConfigDiagnostic,te as isAgentNotFoundError,ke as isArtifactNotFoundError,de as isCommandExecutionError,ie as isCommandNotFoundError,ae as isConflictError,Ce as isFileNotFoundError,ve as isForbiddenError,ye as isFormAlreadySettledError,ce as isFormInvalidAnswerError,ue as isFormNotFoundError,ge as isInstructionEntryValueTooLargeError,he as isIntegrationAttemptNotFoundError,Ee as isIntegrationMethodNotFoundError,be as isIntegrationNotFoundError,oe as isInvalidCursorError,Y as isInvalidRequestError,Z as isLocationNotFoundError,De as isMcpServerNotFoundError,se as isMessageNotFoundError,xe as isModelNotFoundError,Pe as isPermissionNotFoundError,Oe as isPermissionSavedNotFoundError,ne as isPluginNotFoundError,Re as isProjectNotFoundError,Ie as isProviderNotFoundError,fe as isProviderRequestError,Me as isPtyFeatureUnsupportedError,Ae as isPtyNotFoundError,C as isRpcError,A as isRpcInternalError,qe as isScheduleNotFoundError,ee as isServiceUnavailableError,pe as isSessionBusyError,re as isSessionNotFoundError,Le as isShellNotFoundError,me as isSkillNotFoundError,X as isUnauthorizedError,le as isUnknownError,Se as isUnsupportedModelError,Te as isVcsInitNotSupportedError,Fe as isWorktreeError,B as mediaHashFromUri,z as withMediaRefs};
12
+ `)}if(u.done)return}}finally{try{await I.cancel()}catch{}I.releaseLock()}}}),s={server:{info:(e)=>o({method:"GET",path:"/api/info",successStatus:200,declaredStatuses:[400,401],empty:!1},e),pair:(e)=>o({method:"POST",path:"/api/pair",successStatus:200,declaredStatuses:[400,401],empty:!1},e),connect:(e,t)=>o({method:"GET",path:`/auth/connect/${encodeURIComponent(e.code)}`,successStatus:200,declaredStatuses:[400,401],empty:!1},t)},location:{get:(e,t)=>o({method:"GET",path:"/api/location",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),reload:(e)=>o({method:"POST",path:"/api/location/reload",successStatus:204,declaredStatuses:[400,401,503],empty:!0},e)},agent:{list:(e,t)=>o({method:"GET",path:"/api/agent",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/agent/${encodeURIComponent(e.agentID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},plugin:{list:(e,t)=>o({method:"GET",path:"/api/plugin",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),gui:(e,t)=>o({method:"GET",path:"/api/plugin/gui",query:{location:e.location,id:e.id},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),check:(e,t)=>o({method:"POST",path:"/api/plugin/check",query:{location:e?.location},body:{target:e?.target},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),update:(e,t)=>o({method:"POST",path:"/api/plugin/update",query:{location:e.location},body:{targets:e.targets},successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t)},session:{list:(e,t)=>o({method:"GET",path:"/api/session",query:{limit:e?.limit,order:e?.order,search:e?.search,parentID:e?.parentID,archived:e?.archived,directory:e?.directory,project:e?.project,subpath:e?.subpath,cursor:e?.cursor},successStatus:200,declaredStatuses:[400,401],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/session",body:{id:e?.id,parentID:e?.parentID,title:e?.title,agent:e?.agent,model:e?.model,location:e?.location,metadata:e?.metadata,permissions:e?.permissions},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),active:(e)=>o({method:"GET",path:"/api/session/active",successStatus:200,declaredStatuses:[400,401],empty:!1},e).then((t)=>t.data),get:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),remove:(e,t)=>o({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),fork:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/fork`,body:{before:e.before},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),switchAgent:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/agent`,body:{agent:e.agent},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),switchModel:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/model`,body:{model:e.model},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),update:(e,t)=>o({method:"PATCH",path:`/api/session/${encodeURIComponent(e.sessionID)}`,body:{title:e.title,metadata:e.metadata,permissions:e.permissions,archived:e.archived},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),move:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/move`,body:{directory:e.directory,delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),prompt:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/prompt`,body:{id:e.id,text:e.text,files:e.files,agents:e.agents,skills:e.skills,metadata:e.metadata,delivery:e.delivery,resume:e.resume},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),command:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/command`,body:{name:e.name,text:e.text,files:e.files,agents:e.agents,skills:e.skills,delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404,500],empty:!0},t),synthetic:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/synthetic`,body:{id:e.id,text:e.text,description:e.description,metadata:e.metadata,delivery:e.delivery,resume:e.resume},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),shell:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/shell`,body:{id:e.id,command:e.command},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),compact:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/compact`,body:{id:e.id,delivery:e.delivery},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),revert:{stage:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/revert/stage`,body:{messageID:e.messageID,files:e.files},successStatus:200,declaredStatuses:[400,401,404,409,500],empty:!1},t).then((r)=>r.data),clear:(e,t)=>o({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}/revert`,successStatus:204,declaredStatuses:[400,401,404,409,500],empty:!0},t),commit:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/revert/commit`,successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},context:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/context`,successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then((r)=>r.data),diff:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/diff`,query:{from:e.from,to:e.to,context:e.context},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then((r)=>r.data),inbox:{list:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),cancel:(e,t)=>o({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox/${encodeURIComponent(e.inboxID)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),update:(e,t)=>o({method:"PATCH",path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox/${encodeURIComponent(e.inboxID)}`,body:{delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},generate:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/generate`,body:{prompt:e.prompt},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then((r)=>r.data),interrupt:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/interrupt`,query:{resume:e.resume},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),background:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/background`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),message:{get:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/message/${encodeURIComponent(e.messageID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data)},form:{list:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/form`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),create:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/form`,body:{id:e.id,title:e.title,metadata:e.metadata,fields:e.fields},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),get:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),reply:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}/reply`,body:{answer:e.answer},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t),cancel:(e,t)=>o({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}`,query:{message:e.message},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},environment:(e,t)=>o({method:"PUT",path:`/api/session/${encodeURIComponent(e.sessionID)}/environment`,body:{variables:e.variables},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),view:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/view`,body:{idle:e.idle},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},experimental:{session:{stats:(e,t)=>o({method:"GET",path:"/api/experimental/session/stats",query:{from:e?.from,to:e?.to,project:e?.project,timezone:e?.timezone,tools:e?.tools},successStatus:200,declaredStatuses:[400,401],empty:!1},t).then((r)=>r.data),import:(e,t)=>o({method:"POST",path:"/api/experimental/session/import",body:{info:e.info,messages:e.messages,location:e.location},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),export:(e,t)=>o({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/export`,query:{sanitize:e.sanitize},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then((r)=>r.data),skill:(e,t)=>o({method:"POST",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/skill`,body:{id:e.id,resume:e.resume},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),wait:(e,t)=>o({method:"POST",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/wait`,successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),instructions:{entry:{list:(e,t)=>o({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),put:(e,t)=>o({method:"PUT",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries/${encodeURIComponent(e.key)}`,body:{value:e.value},successStatus:204,declaredStatuses:[400,401,404,413],empty:!0},t),remove:(e,t)=>o({method:"DELETE",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries/${encodeURIComponent(e.key)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},log:(e,t)=>l({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/log`,query:{after:e.after,follow:e.follow},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},generate:{text:(e,t)=>o({method:"POST",path:"/api/experimental/generate/text",body:{prompt:e.prompt,model:e.model},successStatus:200,declaredStatuses:[400,401,404,422,502,503],empty:!1},t).then((r)=>r.data),image:(e,t)=>o({method:"POST",path:"/api/experimental/generate/image",body:{model:e.model,prompt:e.prompt,images:e.images,n:e.n,aspect:e.aspect,resolution:e.resolution},successStatus:200,declaredStatuses:[400,401,404,422,502,503],empty:!1},t).then((r)=>r.data),video:{create:(e,t)=>o({method:"POST",path:"/api/experimental/generate/video",body:{model:e.model,prompt:e.prompt,start:e.start,end:e.end,references:e.references,duration:e.duration,aspect:e.aspect,resolution:e.resolution,sound:e.sound},successStatus:200,declaredStatuses:[400,401,403,404,422,502,503],empty:!1},t).then((r)=>r.data),get:(e,t)=>o({method:"GET",path:`/api/experimental/generate/video/${encodeURIComponent(e.id)}`,successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data)},decisions:(e,t)=>o({method:"POST",path:"/api/experimental/generate/decisions",body:{model:e.model,input:e.input,questions:e.questions},successStatus:200,declaredStatuses:[400,401,404,422,502,503],empty:!1},t).then((r)=>r.data)},voice:{models:(e)=>o({method:"GET",path:"/api/experimental/voice/models",successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},e).then((t)=>t.data),session:(e,t)=>o({method:"POST",path:"/api/experimental/voice/session",body:{model:e.model,session:e.session,transport:e.transport},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then((r)=>r.data)},integration:{wellknown:{add:(e,t)=>o({method:"POST",path:"/api/experimental/integration/wellknown",query:{location:e.location},body:{url:e.url},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},mcp:{add:(e,t)=>o({method:"PUT",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}`,query:{location:e.location},body:{config:e.config},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),remove:(e,t)=>o({method:"DELETE",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),connect:(e,t)=>o({method:"POST",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}/connect`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),disconnect:(e,t)=>o({method:"POST",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}/disconnect`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),client:{token:(e,t)=>o({method:"POST",path:"/api/experimental/client-mcp/token",query:{location:e.location,name:e.name},headers:{"x-opencode-ticket":e["x-opencode-ticket"]},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t)}},file:{write:(e,t)=>o({method:"POST",path:"/api/experimental/fs/write",query:{location:e.location,path:e.path},body:e.payload,successStatus:200,declaredStatuses:[400,401,404],empty:!1,binaryBody:!0},t),watch:(e,t)=>o({method:"POST",path:"/api/experimental/fs/watch",query:{location:e.location},body:{path:e.path},successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),unwatch:(e,t)=>o({method:"DELETE",path:"/api/experimental/fs/watch",query:{location:e.location},body:{path:e.path},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},persistentPty:{read:(e,t)=>o({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal/read`,query:{lines:e.lines},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then((r)=>r.data),list:(e,t)=>o({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal`,successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then((r)=>r.data),create:(e,t)=>o({method:"POST",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal`,body:{command:e.command,args:e.args,cwd:e.cwd,title:e.title,env:e.env,size:e.size},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then((r)=>r.data),shutdown:(e)=>o({method:"POST",path:"/api/experimental/persistent-pty/shutdown",successStatus:204,declaredStatuses:[400,401,503],empty:!0},e),handoff:(e)=>o({method:"POST",path:"/api/experimental/persistent-pty/handoff",successStatus:200,declaredStatuses:[400,401,503],empty:!1},e),get:(e,t)=>o({method:"GET",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then((r)=>r.data),update:(e,t)=>o({method:"PUT",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,body:{attachmentID:e.attachmentID,size:e.size,title:e.title},successStatus:200,declaredStatuses:[400,401,404,501,503],empty:!1},t).then((r)=>r.data),snapshot:(e,t)=>o({method:"GET",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}/snapshot`,successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then((r)=>r.data),remove:(e,t)=>o({method:"DELETE",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),connectToken:(e,t)=>o({method:"POST",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}/connect-token`,headers:{"x-opencode-ticket":e["x-opencode-ticket"]},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t).then((r)=>r.data)},media:{get:(e,t)=>o({method:"GET",path:`/api/experimental/media/${encodeURIComponent(e.hash)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1,binary:!0},t)},blob:{get:(e,t)=>o({method:"GET",path:`/api/experimental/blob/${encodeURIComponent(e.id)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1,binary:!0},t)},automation:{create:(e,t)=>o({method:"POST",path:"/api/experimental/automation",body:{sessionID:e.sessionID,directory:e.directory,name:e.name,trigger:e.trigger,action:e.action,expires:e.expires},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),list:(e,t)=>o({method:"GET",path:"/api/experimental/automation",query:{sessionID:e?.sessionID,directory:e?.directory},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),get:(e,t)=>o({method:"GET",path:`/api/experimental/automation/${encodeURIComponent(e.automationID)}`,successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),pause:(e,t)=>o({method:"POST",path:`/api/experimental/automation/${encodeURIComponent(e.automationID)}/pause`,successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),resume:(e,t)=>o({method:"POST",path:`/api/experimental/automation/${encodeURIComponent(e.automationID)}/resume`,successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t).then((r)=>r.data),delete:(e,t)=>o({method:"DELETE",path:`/api/experimental/automation/${encodeURIComponent(e.automationID)}`,successStatus:204,declaredStatuses:[400,401,403,404],empty:!0},t)},artifacts:{providers:(e,t)=>o({method:"GET",path:"/api/experimental/artifacts/providers",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),list:(e,t)=>o({method:"GET",path:"/api/experimental/artifacts",query:{location:e?.location,sessionID:e?.sessionID,provider:e?.provider},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/experimental/artifacts",query:{location:e.location},body:{title:e.title,files:e.files,entry:e.entry,provider:e.provider,sessionID:e.sessionID},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/experimental/artifacts/${encodeURIComponent(e.artifactID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),update:(e,t)=>o({method:"PATCH",path:`/api/experimental/artifacts/${encodeURIComponent(e.artifactID)}`,query:{location:e.location},body:{title:e.title,files:e.files,entry:e.entry,sessionID:e.sessionID},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t),delete:(e,t)=>o({method:"DELETE",path:`/api/experimental/artifacts/${encodeURIComponent(e.artifactID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,403,404,503],empty:!0},t),view:(e,t)=>o({method:"GET",path:`/api/experimental/artifacts/${encodeURIComponent(e.artifactID)}/view/${v(e.path)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1,binary:!0},t)},job:{list:(e,t)=>o({method:"GET",path:"/api/experimental/job",query:{sessionID:e?.sessionID,kind:e?.kind,status:e?.status,descendants:e?.descendants},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data)},migration:{v1:{status:(e)=>o({method:"GET",path:"/api/experimental/migration/v1",successStatus:200,declaredStatuses:[400,401],empty:!1},e)}},usage:{limits:(e,t)=>o({method:"GET",path:"/api/experimental/usage/limits",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},config:{update:(e,t)=>o({method:"PATCH",path:"/api/experimental/config",body:{shell:e.shell},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},message:{list:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/message`,query:{limit:e.limit,order:e.order,cursor:e.cursor,type:e.type},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t)},model:{list:(e,t)=>o({method:"GET",path:"/api/model",query:{location:e?.location,types:e?.types},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),default:(e,t)=>o({method:"GET",path:"/api/model/default",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},provider:{list:(e,t)=>o({method:"GET",path:"/api/provider",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/provider/${encodeURIComponent(e.providerID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},integration:{list:(e,t)=>o({method:"GET",path:"/api/integration",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/integration/${encodeURIComponent(e.integrationID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),connect:{key:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/key`,query:{location:e.location},body:{key:e.key,answer:e.answer,label:e.label},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),external:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/external`,query:{location:e.location},body:{methodID:e.methodID,answer:e.answer,label:e.label},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},oauth:{connect:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth`,query:{location:e.location},body:{methodID:e.methodID,answer:e.answer,label:e.label},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),status:(e,t)=>o({method:"GET",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),complete:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}/complete`,query:{location:e.location},body:{code:e.code},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),cancel:(e,t)=>o({method:"DELETE",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},command:{connect:(e,t)=>o({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command`,query:{location:e.location},body:{methodID:e.methodID,label:e.label},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),status:(e,t)=>o({method:"GET",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),cancel:(e,t)=>o({method:"DELETE",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},mcp:{list:(e,t)=>o({method:"GET",path:"/api/mcp",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),resource:{catalog:(e,t)=>o({method:"GET",path:"/api/mcp/resource",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)}},credential:{list:(e)=>o({method:"GET",path:"/api/credential",successStatus:200,declaredStatuses:[400,401],empty:!1},e).then((t)=>t.data),create:(e,t)=>o({method:"POST",path:"/api/credential",body:{id:e.id,integrationID:e.integrationID,label:e.label,value:e.value,activate:e.activate},successStatus:200,declaredStatuses:[400,401,409],empty:!1},t).then((r)=>r.data),update:(e,t)=>o({method:"PATCH",path:`/api/credential/${encodeURIComponent(e.credentialID)}`,body:{label:e.label},successStatus:204,declaredStatuses:[400,401],empty:!0},t),activate:(e,t)=>o({method:"POST",path:`/api/credential/${encodeURIComponent(e.credentialID)}/activate`,successStatus:204,declaredStatuses:[400,401],empty:!0},t),remove:(e,t)=>o({method:"DELETE",path:`/api/credential/${encodeURIComponent(e.credentialID)}`,successStatus:204,declaredStatuses:[400,401],empty:!0},t)},project:{list:(e,t)=>o({method:"GET",path:"/api/project",query:{archived:e?.archived},successStatus:200,declaredStatuses:[400,401],empty:!1},t),update:(e,t)=>o({method:"PATCH",path:`/api/project/${encodeURIComponent(e.projectID)}`,body:{canonical:e.canonical,name:e.name,icon:e.icon,commands:e.commands},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},form:{list:(e,t)=>o({method:"GET",path:"/api/form",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},permission:{request:{list:(e,t)=>o({method:"GET",path:"/api/permission/request",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},saved:{list:(e,t)=>o({method:"GET",path:"/api/permission/saved",query:{projectID:e?.projectID},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),update:(e,t)=>o({method:"PATCH",path:`/api/permission/saved/${encodeURIComponent(e.id)}`,body:{action:e.action,resource:e.resource},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then((r)=>r.data),remove:(e,t)=>o({method:"DELETE",path:`/api/permission/saved/${encodeURIComponent(e.id)}`,successStatus:204,declaredStatuses:[400,401],empty:!0},t)},create:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission`,body:{id:e.id,action:e.action,resources:e.resources,save:e.save,metadata:e.metadata,source:e.source,agent:e.agent},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),list:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),get:(e,t)=>o({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission/${encodeURIComponent(e.requestID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then((r)=>r.data),reply:(e,t)=>o({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission/${encodeURIComponent(e.requestID)}/reply`,body:{decision:e.decision,message:e.message},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},file:{read:(e,t)=>o({method:"GET",path:`/api/fs/read/${v(e.path)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1,binary:!0},t),list:(e,t)=>o({method:"GET",path:"/api/fs/list",query:{location:e?.location,path:e?.path},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),find:(e,t)=>o({method:"GET",path:"/api/fs/find",query:{location:e.location,query:e.query,type:e.type,limit:e.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},command:{list:(e,t)=>o({method:"GET",path:"/api/command",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},skill:{list:(e,t)=>o({method:"GET",path:"/api/skill",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},rpc:{call:(e,t)=>o({method:"POST",path:`/api/rpc/${encodeURIComponent(e.rpcID)}/${encodeURIComponent(e.method)}`,query:{location:e.location},body:{input:e.input},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t)},event:{subscribe:(e,t)=>l({method:"GET",path:"/api/event",query:{types:e?.types},successStatus:200,declaredStatuses:[400,401],empty:!1},t)},pty:{list:(e,t)=>o({method:"GET",path:"/api/pty",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/pty",query:{location:e?.location},body:{command:e?.command,args:e?.args,cwd:e?.cwd,title:e?.title,env:e?.env},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),update:(e,t)=>o({method:"PUT",path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},body:{title:e.title,size:e.size},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>o({method:"DELETE",path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),connect:{token:(e,t)=>o({method:"POST",path:`/api/pty/${encodeURIComponent(e.ptyID)}/connect-token`,query:{location:e.location},headers:{"x-opencode-ticket":e["x-opencode-ticket"]},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t)}},shell:{list:(e,t)=>o({method:"GET",path:"/api/shell",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/shell",query:{location:e.location},body:{command:e.command,cwd:e.cwd,timeout:e.timeout,metadata:e.metadata},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>o({method:"GET",path:`/api/shell/${encodeURIComponent(e.id)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),output:(e,t)=>o({method:"GET",path:`/api/shell/${encodeURIComponent(e.id)}/output`,query:{location:e.location,cursor:e.cursor,limit:e.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>o({method:"DELETE",path:`/api/shell/${encodeURIComponent(e.id)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},reference:{list:(e,t)=>o({method:"GET",path:"/api/reference",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},worktree:{list:(e,t)=>o({method:"GET",path:"/api/worktree",query:{projectID:e.projectID},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>o({method:"POST",path:"/api/worktree",body:{projectID:e.projectID,from:e.from,branch:e.branch,directory:e.directory,name:e.name},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>o({method:"DELETE",path:"/api/worktree",body:{projectID:e.projectID,directory:e.directory,force:e.force},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),refresh:(e,t)=>o({method:"POST",path:"/api/worktree/refresh",body:{projectID:e.projectID},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},vcs:{init:(e,t)=>o({method:"POST",path:"/api/vcs/init",query:{location:e?.location,provider:e?.provider},successStatus:204,declaredStatuses:[400,401,404,409,501,503],empty:!0},t),get:(e,t)=>o({method:"GET",path:"/api/vcs",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),base:(e,t)=>o({method:"GET",path:"/api/vcs/base",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),status:(e,t)=>o({method:"GET",path:"/api/vcs/status",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),branch:{list:(e,t)=>o({method:"GET",path:"/api/vcs/branch",query:{location:e?.location,search:e?.search,limit:e?.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},diff:(e,t)=>o({method:"GET",path:"/api/vcs/diff",query:{location:e.location,mode:e.mode,base:e.base,context:e.context,untracked:e.untracked},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},debug:{heapDump:(e,t)=>o({method:"POST",path:"/api/debug/heap-dump",query:{directory:e?.directory},successStatus:200,declaredStatuses:[400,401,500],empty:!1},t),location:{list:(e)=>o({method:"GET",path:"/api/debug/location",successStatus:200,declaredStatuses:[400,401],empty:!1},e),evict:(e,t)=>o({method:"DELETE",path:"/api/debug/location",query:{location:e?.location},successStatus:204,declaredStatuses:[400,401],empty:!0},t)}},websearch:{providers:(e,t)=>o({method:"GET",path:"/api/websearch/provider",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),query:(e,t)=>o({method:"POST",path:"/api/websearch",query:{location:e.location},body:{query:e.query,providerID:e.providerID},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},config:{get:(e,t)=>o({method:"GET",path:"/api/config",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),shells:(e)=>o({method:"GET",path:"/api/config/shell",successStatus:200,declaredStatuses:[400,401,404],empty:!1},e)}};return{...s,session:{...s.session,stats:s.experimental.session.stats,import:s.experimental.session.import,export:s.experimental.session.export,skill:s.experimental.session.skill,wait:s.experimental.session.wait,instructions:{entry:{list:s.experimental.session.instructions.entry.list,put:s.experimental.session.instructions.entry.put,remove:s.experimental.session.instructions.entry.remove}},log:s.experimental.session.log},generate:{text:s.experimental.generate.text,image:s.experimental.generate.image,decisions:s.experimental.generate.decisions},voice:{models:s.experimental.voice.models,session:s.experimental.voice.session},integration:{...s.integration,wellknown:{add:s.experimental.integration.wellknown.add}},mcp:{...s.mcp,add:s.experimental.mcp.add,remove:s.experimental.mcp.remove,connect:s.experimental.mcp.connect,disconnect:s.experimental.mcp.disconnect,client:{token:s.experimental.mcp.client.token}},file:{...s.file,write:s.experimental.file.write,watch:s.experimental.file.watch,unwatch:s.experimental.file.unwatch},migration:{v1:{status:s.experimental.migration.v1.status}},usage:{limits:s.experimental.usage.limits},config:{...s.config,update:s.experimental.config.update}}}function v(n){return n.split("/").map(encodeURIComponent).join("/")}function E(n,a,i){if(i===void 0)return;if(i===null){n.append(a,"null");return}if(Array.isArray(i)){for(let c of i)E(n,a,c);return}if(typeof i==="object"){for(let[c,y]of Object.entries(i))E(n,`${a}[${c}]`,y);return}n.append(a,String(i))}async function R(n){if(!O(n,"application/json")&&!n.headers.get("content-type")?.includes("+json")){try{await n.body?.cancel()}catch{}throw new m("UnsupportedContentType",{detail:n.headers.get("content-type")})}let a;try{a=await n.text()}catch(i){throw new m("Transport",{cause:i})}if(a==="")throw new m("MalformedResponse");try{return JSON.parse(a)}catch(i){throw new m("MalformedResponse",{cause:i})}}function G(n){let a=Object.assign(Error(n.message??n.data?.message),n);if(n._tag)a.name=n._tag;return a}function O(n,a){return n.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase()===a}var Y=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="InvalidRequestError",X=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="UnauthorizedError",Z=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="LocationNotFoundError",ee=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ServiceUnavailableError",te=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="AgentNotFoundError",ne=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PluginNotFoundError",oe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="InvalidCursorError",re=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="SessionNotFoundError",se=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="MessageNotFoundError",ae=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ConflictError",ie=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="CommandNotFoundError",de=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="CommandExecutionError",pe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="SessionBusyError",le=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="UnknownError",ue=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="FormNotFoundError",ye=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="FormInvalidAnswerError",ce=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="FormAlreadySettledError",me=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="SkillNotFoundError",ge=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="InstructionEntryValueTooLargeError",Ie=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ProviderNotFoundError",xe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ModelNotFoundError",Se=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="UnsupportedModelError",fe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ProviderRequestError",be=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ForbiddenError",he=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="VideoNotFoundError",Ee=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="IntegrationNotFoundError",De=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="IntegrationAttemptNotFoundError",ve=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="IntegrationMethodNotFoundError",Re=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="McpServerNotFoundError",Oe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ProjectNotFoundError",Pe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PermissionSavedNotFoundError",Ce=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PermissionNotFoundError",Ae=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="FileNotFoundError",C=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="RpcError",A=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="RpcInternalError",Me=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PtyNotFoundError",qe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="PtyFeatureUnsupportedError",ke=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="BlobNotFoundError",Le=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="AutomationNotFoundError",Fe=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ArtifactNotFoundError",Te=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="ShellNotFoundError",Ue=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="WorktreeError",we=(n)=>typeof n==="object"&&n!==null&&("_tag"in n)&&n._tag==="VcsInitNotSupportedError";function N(n){let a,i=4096;function c(o){if(o.connected=void 0,o.controller.abort(),a===o)a=void 0}async function y(o){let l,s={};try{if(o.controller.signal.aborted)return;l=n(o.controller.signal,()=>{o.subscribers.forEach((e)=>e.activity?.())})[Symbol.asyncIterator]();while(!o.controller.signal.aborted){let e=await l.next();if(e.done||o.controller.signal.aborted)break;if(e.value.type==="server.connected")o.connected=e.value;o.subscribers.forEach((t)=>t.push(e.value))}}catch(e){s={error:e}}finally{c(o);try{await l?.return?.()}catch(e){if(!("error"in s))s={error:e}}o.subscribers.forEach((e)=>e.finish(s))}}return{subscribe(o){return{[Symbol.asyncIterator](){let l=[],s=[],e=!1,t,r,I=o?.types?.length?new Set(o.types):void 0,x=(p)=>!I||p.type==="server.connected"||I.has(p.type);function d(p,g=!0){if(t=p,g)s.length=0;if(o?.signal?.removeEventListener("abort",u),r?.subscribers.delete(f)&&!r.subscribers.size)c(r);l.splice(0).forEach((S)=>{if("error"in p)S.reject(p.error);else S.resolve({done:!0,value:void 0})})}function u(){d({})}let f={activity:o?.onActivity,finish(p){d(p,!1)},push(p){if(t)return;if(!x(p))return;let g=l.shift();if(g){g.resolve({done:!1,value:p});return}if(s.length===4096){d({error:Error("Event subscriber exceeded its 4096-event capacity")});return}s.push(p)}};function b(){if(t)return;let p=!a;if(r=a??{controller:new AbortController,subscribers:new Set},a=r,r.subscribers.add(f),r.connected)f.push(r.connected);if(p)y(r)}return{next(){let p=s.shift();if(p)return Promise.resolve({done:!1,value:p});if(t){if("error"in t)return Promise.reject(t.error);return Promise.resolve({done:!0,value:void 0})}if(o?.signal?.aborted)return u(),Promise.resolve({done:!0,value:void 0});let g=Promise.withResolvers();if(l.push(g),!e)e=!0,o?.signal?.addEventListener("abort",u,{once:!0}),b();return g.promise},return(){return d({}),Promise.resolve({done:!0,value:void 0})}}}}}}}function q(n,a){return(i)=>{let c=(y,o)=>{if(!Object.hasOwn(i.events,y))throw Error(`Unknown RPC event: ${i.id}.${y}`);let l=V(i,y);return{[Symbol.asyncIterator](){let s=new AbortController,e=o?.signal?AbortSignal.any([s.signal,o.signal]):s.signal,t=async function*(){try{for await(let r of a.subscribe({signal:e})){if(e.aborted)return;if(r.type!==l)continue;yield r}}catch(r){if(!e.aborted)throw r}finally{s.abort()}}();return{next:()=>t.next(),return:()=>(s.abort(),t.return())}}}};return Object.assign(Object.fromEntries(Object.keys(i.methods).map((y)=>[y,async(o,l)=>{try{return(await n.rpc.call({rpcID:i.id,method:y,input:o,location:l?.location},{signal:l?.signal,headers:l?.headers})).output}catch(s){if(!C(s)&&!A(s))throw s;throw s.data===void 0?{type:s.type,message:s.message}:{type:s.type,message:s.message,data:s.data}}}])),{events:{subscribe:c,on:(y,o,l)=>{let s=new AbortController,e=l?.signal?AbortSignal.any([s.signal,l.signal]):s.signal,t=c(y,{signal:e});return(async()=>{for await(let r of t)await o(r)})().catch((r)=>console.error(r)),()=>s.abort()}}})}}function V(n,a){return`rpc.${n.id}.${a}`}function _(n){let a=w(n),i=N((c,y)=>a.event.subscribe(void 0,{signal:c,onActivity:y}));return{...a,rpc:Object.assign(q(a,i),a.rpc),event:i}}function j(n){return n.flatMap((a)=>a.type==="document"?a.experimental?.diagnostics??[]:[])}function W(n){let a=n.line===void 0?"":`:${n.line}:${n.column??1}`;return`${n.source}${a} (${n.path}): ${n.message}`}var J=/^media:([0-9a-f]{64})$/;function B(n){if(!n)return;return J.exec(n)?.[1]}function z(n){return{...n,message:{...n.message,list:(a,i)=>n.message.list(a,D(i))},session:{...n.session,message:{...n.session.message,get:(a,i)=>n.session.message.get(a,D(i))},inbox:{...n.session.inbox,list:(a,i)=>n.session.inbox.list(a,D(i))}}}}function D(n){if(n?.mediaRefs===!1)return n;let a=new Headers(n?.headers);return a.set("X-OpenCode-Capabilities","experimental-media-uri"),{...n,headers:a}}export{m as ClientError,h as OpenCode,j as configDiagnostics,W as formatConfigDiagnostic,te as isAgentNotFoundError,Fe as isArtifactNotFoundError,Le as isAutomationNotFoundError,ke as isBlobNotFoundError,de as isCommandExecutionError,ie as isCommandNotFoundError,ae as isConflictError,Ae as isFileNotFoundError,be as isForbiddenError,ce as isFormAlreadySettledError,ye as isFormInvalidAnswerError,ue as isFormNotFoundError,ge as isInstructionEntryValueTooLargeError,De as isIntegrationAttemptNotFoundError,ve as isIntegrationMethodNotFoundError,Ee as isIntegrationNotFoundError,oe as isInvalidCursorError,Y as isInvalidRequestError,Z as isLocationNotFoundError,Re as isMcpServerNotFoundError,se as isMessageNotFoundError,xe as isModelNotFoundError,Ce as isPermissionNotFoundError,Pe as isPermissionSavedNotFoundError,ne as isPluginNotFoundError,Oe as isProjectNotFoundError,Ie as isProviderNotFoundError,fe as isProviderRequestError,qe as isPtyFeatureUnsupportedError,Me as isPtyNotFoundError,C as isRpcError,A as isRpcInternalError,ee as isServiceUnavailableError,pe as isSessionBusyError,re as isSessionNotFoundError,Te as isShellNotFoundError,me as isSkillNotFoundError,X as isUnauthorizedError,le as isUnknownError,Se as isUnsupportedModelError,we as isVcsInitNotSupportedError,he as isVideoNotFoundError,Ue as isWorktreeError,B as mediaHashFromUri,z as withMediaRefs};
package/client/media.d.ts CHANGED
@@ -54,6 +54,10 @@ export declare function withMediaRefs(api: ReturnType<typeof make>): {
54
54
  text: string;
55
55
  }>;
56
56
  image: (input: import("./index.js").ExperimentalGenerateImageInput, requestOptions?: RequestOptions) => Promise<import("./index.js").GenerateImageResult>;
57
+ video: {
58
+ create: (input: import("./index.js").ExperimentalGenerateVideoCreateInput, requestOptions?: RequestOptions) => Promise<import("./index.js").GenerateVideoRunning>;
59
+ get: (input: import("./index.js").ExperimentalGenerateVideoGetInput, requestOptions?: RequestOptions) => Promise<import("./index.js").GenerateVideoCompleted | import("./index.js").GenerateVideoError | import("./index.js").GenerateVideoRunning>;
60
+ };
57
61
  decisions: (input: import("./index.js").ExperimentalGenerateDecisionsInput, requestOptions?: RequestOptions) => Promise<import("./index.js").GenerateDecisionResult>;
58
62
  };
59
63
  voice: {
@@ -99,13 +103,16 @@ export declare function withMediaRefs(api: ReturnType<typeof make>): {
99
103
  media: {
100
104
  get: (input: import("./index.js").ExperimentalMediaGetInput, requestOptions?: RequestOptions) => Promise<import("./index.js").ExperimentalMediaGetOutput>;
101
105
  };
102
- schedule: {
103
- create: (input: import("./index.js").ExperimentalScheduleCreateInput, requestOptions?: RequestOptions) => Promise<import("./index.js").ScheduleInfo>;
104
- list: (input: import("./index.js").ExperimentalScheduleListInput, requestOptions?: RequestOptions) => Promise<import("./index.js").ScheduleInfo[]>;
105
- get: (input: import("./index.js").ExperimentalScheduleGetInput, requestOptions?: RequestOptions) => Promise<import("./index.js").ScheduleInfo>;
106
- pause: (input: import("./index.js").ExperimentalSchedulePauseInput, requestOptions?: RequestOptions) => Promise<import("./index.js").ScheduleInfo>;
107
- resume: (input: import("./index.js").ExperimentalScheduleResumeInput, requestOptions?: RequestOptions) => Promise<import("./index.js").ScheduleInfo>;
108
- delete: (input: import("./index.js").ExperimentalScheduleDeleteInput, requestOptions?: RequestOptions) => Promise<void>;
106
+ blob: {
107
+ get: (input: import("./index.js").ExperimentalBlobGetInput, requestOptions?: RequestOptions) => Promise<import("./index.js").ExperimentalBlobGetOutput>;
108
+ };
109
+ automation: {
110
+ create: (input: import("./index.js").ExperimentalAutomationCreateInput, requestOptions?: RequestOptions) => Promise<import("./index.js").AutomationInfo>;
111
+ list: (input?: import("./index.js").ExperimentalAutomationListInput, requestOptions?: RequestOptions) => Promise<import("./index.js").AutomationInfo[]>;
112
+ get: (input: import("./index.js").ExperimentalAutomationGetInput, requestOptions?: RequestOptions) => Promise<import("./index.js").AutomationInfo>;
113
+ pause: (input: import("./index.js").ExperimentalAutomationPauseInput, requestOptions?: RequestOptions) => Promise<import("./index.js").AutomationInfo>;
114
+ resume: (input: import("./index.js").ExperimentalAutomationResumeInput, requestOptions?: RequestOptions) => Promise<import("./index.js").AutomationInfo>;
115
+ delete: (input: import("./index.js").ExperimentalAutomationDeleteInput, requestOptions?: RequestOptions) => Promise<void>;
109
116
  };
110
117
  artifacts: {
111
118
  providers: (input?: import("./index.js").ExperimentalArtifactsProvidersInput, requestOptions?: RequestOptions) => Promise<import("./index.js").ExperimentalArtifactsProvidersOutput>;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "import": "./client/index.js"
15
15
  }
16
16
  },
17
- "version": "2.3.0-shuv.3",
17
+ "version": "2.3.1-shuv.1",
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
@@ -30,17 +30,17 @@
30
30
  "x64"
31
31
  ],
32
32
  "optionalDependencies": {
33
- "shuvcode-linux-x64-musl": "2.3.0-shuv.3",
34
- "shuvcode-linux-arm64-musl": "2.3.0-shuv.3",
35
- "shuvcode-darwin-x64": "2.3.0-shuv.3",
36
- "shuvcode-windows-x64-baseline": "2.3.0-shuv.3",
37
- "shuvcode-linux-x64": "2.3.0-shuv.3",
38
- "shuvcode-linux-x64-baseline": "2.3.0-shuv.3",
39
- "shuvcode-linux-x64-baseline-musl": "2.3.0-shuv.3",
40
- "shuvcode-windows-x64": "2.3.0-shuv.3",
41
- "shuvcode-darwin-x64-baseline": "2.3.0-shuv.3",
42
- "shuvcode-windows-arm64": "2.3.0-shuv.3",
43
- "shuvcode-linux-arm64": "2.3.0-shuv.3",
44
- "shuvcode-darwin-arm64": "2.3.0-shuv.3"
33
+ "shuvcode-windows-x64-baseline": "2.3.1-shuv.1",
34
+ "shuvcode-windows-arm64": "2.3.1-shuv.1",
35
+ "shuvcode-linux-x64-baseline-musl": "2.3.1-shuv.1",
36
+ "shuvcode-darwin-arm64": "2.3.1-shuv.1",
37
+ "shuvcode-darwin-x64-baseline": "2.3.1-shuv.1",
38
+ "shuvcode-linux-arm64": "2.3.1-shuv.1",
39
+ "shuvcode-linux-x64-musl": "2.3.1-shuv.1",
40
+ "shuvcode-linux-x64-baseline": "2.3.1-shuv.1",
41
+ "shuvcode-windows-x64": "2.3.1-shuv.1",
42
+ "shuvcode-linux-arm64-musl": "2.3.1-shuv.1",
43
+ "shuvcode-linux-x64": "2.3.1-shuv.1",
44
+ "shuvcode-darwin-x64": "2.3.1-shuv.1"
45
45
  }
46
46
  }