@opencode/client 0.0.0-dev-19448 → 0.0.0-dev-19449

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.
@@ -10,6 +10,7 @@ import type { RelativePath } from "@opencode/schema/schema";
10
10
  import type { Brand } from "effect";
11
11
  import type { Model } from "@opencode/schema/model";
12
12
  import type { DateTime } from "effect";
13
+ import type { Permission } from "@opencode/schema/permission";
13
14
  import type { SessionMessage } from "@opencode/schema/session-message";
14
15
  import type { SessionInbox } from "@opencode/schema/session-inbox";
15
16
  import type { PromptInput } from "@opencode/schema/prompt-input";
@@ -25,7 +26,6 @@ import type { Integration } from "@opencode/schema/integration";
25
26
  import type { Form } from "@opencode/schema/form";
26
27
  import type { Mcp } from "@opencode/schema/mcp";
27
28
  import type { Credential } from "@opencode/schema/credential";
28
- import type { Permission } from "@opencode/schema/permission";
29
29
  import type { PermissionSaved } from "@opencode/schema/permission-saved";
30
30
  import type { FileSystem } from "@opencode/schema/filesystem";
31
31
  import type { Command } from "@opencode/schema/command";
@@ -239,6 +239,7 @@ export type SessionCreateInput = {
239
239
  readonly model?: Model.Ref | undefined;
240
240
  readonly location?: Location.Ref | undefined;
241
241
  readonly metadata?: Session.Metadata | undefined;
242
+ readonly permissions?: Permission.Ruleset | undefined;
242
243
  };
243
244
  export type SessionCreateOutput = Session.Info;
244
245
  export type SessionCreateOperation<E = never> = (input?: SessionCreateInput) => Effect.Effect<SessionCreateOutput, E>;
@@ -472,6 +473,7 @@ export type SessionLogOutput = ({
472
473
  readonly agent?: Agent.ID | undefined;
473
474
  readonly model?: Model.Ref | undefined;
474
475
  readonly metadata?: Session.Metadata | undefined;
476
+ readonly permissions?: Permission.Ruleset | undefined;
475
477
  readonly version: string;
476
478
  };
477
479
  } | {
@@ -546,6 +548,23 @@ export type SessionLogOutput = ({
546
548
  readonly sessionID: Session.ID;
547
549
  readonly title: string;
548
550
  };
551
+ } | {
552
+ readonly id: Event.ID;
553
+ readonly created: number;
554
+ readonly metadata?: {
555
+ readonly [x: string]: unknown;
556
+ } | undefined;
557
+ readonly type: "session.permissions.updated";
558
+ readonly durable: {
559
+ readonly aggregateID: string;
560
+ readonly seq: Event.Seq;
561
+ readonly version: Event.Version;
562
+ };
563
+ readonly location?: Location.Ref | undefined;
564
+ readonly data: {
565
+ readonly sessionID: Session.ID;
566
+ readonly permissions: Permission.Ruleset;
567
+ };
549
568
  } | {
550
569
  readonly id: Event.ID;
551
570
  readonly created: number;
@@ -1950,6 +1969,12 @@ export type PermissionReplyInput = {
1950
1969
  };
1951
1970
  export type PermissionReplyOutput = void;
1952
1971
  export type PermissionReplyOperation<E = never> = (input: PermissionReplyInput) => Effect.Effect<PermissionReplyOutput, E>;
1972
+ export type PermissionRulesInput = {
1973
+ readonly sessionID: Session.ID;
1974
+ readonly permissions: Permission.Ruleset;
1975
+ };
1976
+ export type PermissionRulesOutput = void;
1977
+ export type PermissionRulesOperation<E = never> = (input: PermissionRulesInput) => Effect.Effect<PermissionRulesOutput, E>;
1953
1978
  export interface PermissionApi<E = never> {
1954
1979
  readonly request: {
1955
1980
  readonly list: PermissionRequestListOperation<E>;
@@ -1962,6 +1987,7 @@ export interface PermissionApi<E = never> {
1962
1987
  readonly list: PermissionListOperation<E>;
1963
1988
  readonly get: PermissionGetOperation<E>;
1964
1989
  readonly reply: PermissionReplyOperation<E>;
1990
+ readonly rules: PermissionRulesOperation<E>;
1965
1991
  }
1966
1992
  export type FileListInput = {
1967
1993
  readonly location?: {
@@ -458,6 +458,11 @@ export declare const make: (options?: {
458
458
  readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
459
459
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
460
460
  } | undefined;
461
+ readonly permissions?: readonly {
462
+ readonly action: string;
463
+ readonly resource: string;
464
+ readonly effect: "allow" | "deny" | "ask";
465
+ }[] | undefined;
461
466
  readonly agent?: (string & import("effect/Brand").Brand<"Agent.ID">) | undefined;
462
467
  readonly subpath?: (string & import("effect/Brand").Brand<"RelativePath">) | undefined;
463
468
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
@@ -571,6 +576,30 @@ export declare const make: (options?: {
571
576
  readonly metadata?: {
572
577
  readonly [x: string]: unknown;
573
578
  } | undefined;
579
+ } | {
580
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
581
+ readonly data: {
582
+ readonly permissions: readonly {
583
+ readonly action: string;
584
+ readonly resource: string;
585
+ readonly effect: "allow" | "deny" | "ask";
586
+ }[];
587
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
588
+ };
589
+ readonly durable: {
590
+ readonly aggregateID: string;
591
+ readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
592
+ readonly version: number & import("effect/Brand").Brand<"Event.Version">;
593
+ };
594
+ readonly type: "session.permissions.updated";
595
+ readonly created: number;
596
+ readonly location?: {
597
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
598
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
599
+ } | undefined;
600
+ readonly metadata?: {
601
+ readonly [x: string]: unknown;
602
+ } | undefined;
574
603
  } | {
575
604
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
576
605
  readonly data: {
@@ -2347,6 +2376,7 @@ export declare const make: (options?: {
2347
2376
  list: (input: import("./api.js").PermissionListInput) => Effect.Effect<import("./api.js").PermissionListOutput, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").SessionNotFoundError | import("effect/Schema").SchemaError | ClientError | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
2348
2377
  get: (input: import("./api.js").PermissionGetInput) => Effect.Effect<import("@opencode/schema/permission").Request, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").PermissionNotFoundError | import("effect/Schema").SchemaError | ClientError | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
2349
2378
  reply: (input: import("./api.js").PermissionReplyInput) => Effect.Effect<void, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").PermissionNotFoundError | import("effect/Schema").SchemaError | ClientError | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
2379
+ rules: (input: import("./api.js").PermissionRulesInput) => Effect.Effect<void, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").SessionNotFoundError | import("effect/Schema").SchemaError | ClientError | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
2350
2380
  };
2351
2381
  file: {
2352
2382
  list: (input?: import("./api.js").FileListInput) => Effect.Effect<import("./api.js").FileListOutput, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("effect/Schema").SchemaError | ClientError | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
@@ -1,7 +1,7 @@
1
1
  import { Effect, Stream, Schema } from "effect";
2
2
  import { Sse } from "effect/unstable/encoding";
3
3
  import { HttpClientError } from "effect/unstable/http";
4
- import type { HealthGetOutput, ServerGetOutput, LocationGetInput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginAwaitActivationInput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionListOutput, SessionStatsInput, SessionStatsOutput, SessionCreateInput, SessionImportInput, SessionExportInput, SessionExportOutput, SessionActiveOutput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionRenameInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSkillInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionWaitInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionContextOutput, SessionInboxListInput, SessionInboxListOutput, SessionInboxCancelInput, SessionInboxSteerInput, SessionInboxQueueInput, SessionInstructionsEntryListInput, SessionInstructionsEntryListOutput, SessionInstructionsEntryPutInput, SessionInstructionsEntryRemoveInput, SessionGenerateInput, SessionGenerateOutput, SessionLogInput, SessionLogOutput, SessionInterruptInput, SessionInterruptOutput, SessionBackgroundInput, SessionMessageInput, SessionEnvironmentInput, SessionViewInput, MessageListInput, MessageListOutput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, GenerateTextInput, GenerateTextOutput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationConnectKeyInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, McpListInput, McpListOutput, McpAddInput, McpRemoveInput, McpConnectInput, McpDisconnectInput, McpResourceCatalogInput, McpResourceCatalogOutput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListOutput, ProjectUpdateInput, ProjectCurrentInput, FormRequestListInput, FormRequestListOutput, FormListInput, FormListOutput, FormCreateInput, FormGetInput, FormStateInput, FormReplyInput, FormCancelInput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedListOutput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionCreateOutput, PermissionListInput, PermissionListOutput, PermissionGetInput, PermissionReplyInput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, RpcCallOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyReadOutput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyListOutput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyCreateOutput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyGetOutput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtyUpdateOutput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtySnapshotOutput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellTimeoutInput, ShellTimeoutOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, WorkspaceCreateInput, WorkspaceDestroyInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchesInput, VcsBranchesOutput, VcsDiffInput, VcsDiffOutput, DebugLocationListOutput, DebugLocationEvictInput, MigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ConfigGetInput, ConfigGetOutput } from "../api/api.js";
4
+ import type { HealthGetOutput, ServerGetOutput, LocationGetInput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginAwaitActivationInput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionListOutput, SessionStatsInput, SessionStatsOutput, SessionCreateInput, SessionImportInput, SessionExportInput, SessionExportOutput, SessionActiveOutput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionRenameInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSkillInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionWaitInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionContextOutput, SessionInboxListInput, SessionInboxListOutput, SessionInboxCancelInput, SessionInboxSteerInput, SessionInboxQueueInput, SessionInstructionsEntryListInput, SessionInstructionsEntryListOutput, SessionInstructionsEntryPutInput, SessionInstructionsEntryRemoveInput, SessionGenerateInput, SessionGenerateOutput, SessionLogInput, SessionLogOutput, SessionInterruptInput, SessionInterruptOutput, SessionBackgroundInput, SessionMessageInput, SessionEnvironmentInput, SessionViewInput, MessageListInput, MessageListOutput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, GenerateTextInput, GenerateTextOutput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationConnectKeyInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, McpListInput, McpListOutput, McpAddInput, McpRemoveInput, McpConnectInput, McpDisconnectInput, McpResourceCatalogInput, McpResourceCatalogOutput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListOutput, ProjectUpdateInput, ProjectCurrentInput, FormRequestListInput, FormRequestListOutput, FormListInput, FormListOutput, FormCreateInput, FormGetInput, FormStateInput, FormReplyInput, FormCancelInput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedListOutput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionCreateOutput, PermissionListInput, PermissionListOutput, PermissionGetInput, PermissionReplyInput, PermissionRulesInput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, RpcCallOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyReadOutput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyListOutput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyCreateOutput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyGetOutput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtyUpdateOutput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtySnapshotOutput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellTimeoutInput, ShellTimeoutOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, WorkspaceCreateInput, WorkspaceDestroyInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchesInput, VcsBranchesOutput, VcsDiffInput, VcsDiffOutput, DebugLocationListOutput, DebugLocationEvictInput, MigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ConfigGetInput, ConfigGetOutput } from "../api/api.js";
5
5
  import { ClientError } from "./client-error.js";
6
6
  export declare const make: (options?: {
7
7
  readonly baseUrl?: URL | string;
@@ -160,6 +160,7 @@ export declare const make: (options?: {
160
160
  list: (input: PermissionListInput) => Effect.Effect<PermissionListOutput, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").SessionNotFoundError | Schema.SchemaError | ClientError | HttpClientError.HttpClientError, never>;
161
161
  get: (input: PermissionGetInput) => Effect.Effect<import("@opencode/schema/permission").Request, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").PermissionNotFoundError | Schema.SchemaError | ClientError | HttpClientError.HttpClientError, never>;
162
162
  reply: (input: PermissionReplyInput) => Effect.Effect<void, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").PermissionNotFoundError | Schema.SchemaError | ClientError | HttpClientError.HttpClientError, never>;
163
+ rules: (input: PermissionRulesInput) => Effect.Effect<void, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").SessionNotFoundError | Schema.SchemaError | ClientError | HttpClientError.HttpClientError, never>;
163
164
  };
164
165
  file: {
165
166
  list: (input?: FileListInput) => Effect.Effect<FileListOutput, import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | Schema.SchemaError | ClientError | HttpClientError.HttpClientError, never>;
@@ -625,6 +626,11 @@ export declare const make: (options?: {
625
626
  readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
626
627
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
627
628
  } | undefined;
629
+ readonly permissions?: readonly {
630
+ readonly action: string;
631
+ readonly resource: string;
632
+ readonly effect: "allow" | "deny" | "ask";
633
+ }[] | undefined;
628
634
  readonly agent?: (string & import("effect/Brand").Brand<"Agent.ID">) | undefined;
629
635
  readonly subpath?: (string & import("effect/Brand").Brand<"RelativePath">) | undefined;
630
636
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
@@ -738,6 +744,30 @@ export declare const make: (options?: {
738
744
  readonly metadata?: {
739
745
  readonly [x: string]: unknown;
740
746
  } | undefined;
747
+ } | {
748
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
749
+ readonly data: {
750
+ readonly permissions: readonly {
751
+ readonly action: string;
752
+ readonly resource: string;
753
+ readonly effect: "allow" | "deny" | "ask";
754
+ }[];
755
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
756
+ };
757
+ readonly durable: {
758
+ readonly aggregateID: string;
759
+ readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
760
+ readonly version: number & import("effect/Brand").Brand<"Event.Version">;
761
+ };
762
+ readonly type: "session.permissions.updated";
763
+ readonly created: number;
764
+ readonly location?: {
765
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
766
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
767
+ } | undefined;
768
+ readonly metadata?: {
769
+ readonly [x: string]: unknown;
770
+ } | undefined;
741
771
  } | {
742
772
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
743
773
  readonly data: {
@@ -62,6 +62,7 @@ const EndpointSessionCreate = (raw) => (input) => preserveEffect()(raw["session.
62
62
  model: input?.["model"],
63
63
  location: input?.["location"],
64
64
  metadata: input?.["metadata"],
65
+ permissions: input?.["permissions"],
65
66
  },
66
67
  }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
67
68
  const EndpointSessionImport = (raw) => (input) => preserveEffect()(raw["session.import"]({
@@ -376,6 +377,10 @@ const EndpointPermissionReply = (raw) => (input) => preserveEffect()(raw["sessio
376
377
  params: { sessionID: input["sessionID"], requestID: input["requestID"] },
377
378
  payload: { reply: input["reply"], message: input["message"] },
378
379
  }).pipe(Effect.mapError(mapClientError)));
380
+ const EndpointPermissionRules = (raw) => (input) => preserveEffect()(raw["session.permission.rules"]({
381
+ params: { sessionID: input["sessionID"] },
382
+ payload: { permissions: input["permissions"] },
383
+ }).pipe(Effect.mapError(mapClientError)));
379
384
  const adaptGroupPermission = (raw) => ({
380
385
  request: { list: EndpointPermissionRequestList(raw) },
381
386
  saved: { list: EndpointPermissionSavedList(raw), remove: EndpointPermissionSavedRemove(raw) },
@@ -383,6 +388,7 @@ const adaptGroupPermission = (raw) => ({
383
388
  list: EndpointPermissionList(raw),
384
389
  get: EndpointPermissionGet(raw),
385
390
  reply: EndpointPermissionReply(raw),
391
+ rules: EndpointPermissionRules(raw),
386
392
  });
387
393
  const EndpointFileList = (raw) => (input) => preserveEffect()(raw["fs.list"]({ query: { location: input?.["location"], path: input?.["path"] } }).pipe(Effect.mapError(mapClientError)));
388
394
  const EndpointFileFind = (raw) => (input) => preserveEffect()(raw["fs.find"]({
@@ -171,6 +171,7 @@ export declare function make(options: ClientOptions): {
171
171
  list: (input: import("./index.js").PermissionListInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").PermissionRequest[]>;
172
172
  get: (input: import("./index.js").PermissionGetInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").PermissionRequest>;
173
173
  reply: (input: import("./index.js").PermissionReplyInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
174
+ rules: (input: import("./index.js").PermissionRulesInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
174
175
  };
175
176
  file: {
176
177
  read: (input: import("./index.js").FileReadInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").FileReadOutput>;
@@ -1,4 +1,4 @@
1
- import type { ServerGetOutput, LocationGetInput, LocationGetOutput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginAwaitActivationInput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionStatsInput, SessionCreateInput, SessionImportInput, SessionExportInput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionRenameInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSkillInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionWaitInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionInboxListInput, SessionInboxCancelInput, SessionInboxSteerInput, SessionInboxQueueInput, SessionInstructionsEntryListInput, SessionInstructionsEntryPutInput, SessionInstructionsEntryRemoveInput, SessionGenerateInput, SessionLogInput, SessionLogOutput, SessionInterruptInput, SessionBackgroundInput, SessionMessageInput, SessionEnvironmentInput, SessionViewInput, MessageListInput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, GenerateTextInput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationConnectKeyInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, McpListInput, McpListOutput, McpAddInput, McpRemoveInput, McpConnectInput, McpDisconnectInput, McpResourceCatalogInput, McpResourceCatalogOutput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListOutput, ProjectUpdateInput, ProjectCurrentInput, FormRequestListInput, FormRequestListOutput, FormListInput, FormCreateInput, FormGetInput, FormStateInput, FormReplyInput, FormCancelInput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionListInput, PermissionGetInput, PermissionReplyInput, FileReadInput, FileReadOutput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, EventSubscribeOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellTimeoutInput, ShellTimeoutOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, WorkspaceCreateInput, WorkspaceDestroyInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchesInput, VcsBranchesOutput, VcsDiffInput, VcsDiffOutput, DebugLocationListOutput, DebugLocationEvictInput, MigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ConfigGetInput, ConfigGetOutput } from "./types.js";
1
+ import type { ServerGetOutput, LocationGetInput, LocationGetOutput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginAwaitActivationInput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionStatsInput, SessionCreateInput, SessionImportInput, SessionExportInput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionRenameInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSkillInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionWaitInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionInboxListInput, SessionInboxCancelInput, SessionInboxSteerInput, SessionInboxQueueInput, SessionInstructionsEntryListInput, SessionInstructionsEntryPutInput, SessionInstructionsEntryRemoveInput, SessionGenerateInput, SessionLogInput, SessionLogOutput, SessionInterruptInput, SessionBackgroundInput, SessionMessageInput, SessionEnvironmentInput, SessionViewInput, MessageListInput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, GenerateTextInput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationConnectKeyInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, McpListInput, McpListOutput, McpAddInput, McpRemoveInput, McpConnectInput, McpDisconnectInput, McpResourceCatalogInput, McpResourceCatalogOutput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListOutput, ProjectUpdateInput, ProjectCurrentInput, FormRequestListInput, FormRequestListOutput, FormListInput, FormCreateInput, FormGetInput, FormStateInput, FormReplyInput, FormCancelInput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionListInput, PermissionGetInput, PermissionReplyInput, PermissionRulesInput, FileReadInput, FileReadOutput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, EventSubscribeOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellTimeoutInput, ShellTimeoutOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, WorkspaceCreateInput, WorkspaceDestroyInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchesInput, VcsBranchesOutput, VcsDiffInput, VcsDiffOutput, DebugLocationListOutput, DebugLocationEvictInput, MigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ConfigGetInput, ConfigGetOutput } from "./types.js";
2
2
  export interface ClientOptions {
3
3
  readonly baseUrl: string;
4
4
  readonly fetch?: typeof globalThis.fetch;
@@ -172,6 +172,7 @@ export declare function make(options: ClientOptions): {
172
172
  list: (input: PermissionListInput, requestOptions?: RequestOptions) => Promise<import("./types.js").PermissionRequest[]>;
173
173
  get: (input: PermissionGetInput, requestOptions?: RequestOptions) => Promise<import("./types.js").PermissionRequest>;
174
174
  reply: (input: PermissionReplyInput, requestOptions?: RequestOptions) => Promise<void>;
175
+ rules: (input: PermissionRulesInput, requestOptions?: RequestOptions) => Promise<void>;
175
176
  };
176
177
  file: {
177
178
  read: (input: FileReadInput, requestOptions?: RequestOptions) => Promise<FileReadOutput>;
@@ -242,6 +242,7 @@ export function make(options) {
242
242
  model: input?.["model"],
243
243
  location: input?.["location"],
244
244
  metadata: input?.["metadata"],
245
+ permissions: input?.["permissions"],
245
246
  },
246
247
  successStatus: 200,
247
248
  declaredStatuses: [400, 401],
@@ -929,6 +930,14 @@ export function make(options) {
929
930
  declaredStatuses: [400, 401, 404],
930
931
  empty: true,
931
932
  }, requestOptions),
933
+ rules: (input, requestOptions) => request({
934
+ method: "PUT",
935
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/rules`,
936
+ body: { permissions: input["permissions"] },
937
+ successStatus: 204,
938
+ declaredStatuses: [400, 401, 404],
939
+ empty: true,
940
+ }, requestOptions),
932
941
  },
933
942
  file: {
934
943
  read: (input, requestOptions) => request({
@@ -840,33 +840,6 @@ export type InstructionEntrySnapshot = Array<{
840
840
  value: JsonValue;
841
841
  removed: boolean;
842
842
  }>;
843
- export type SessionCreated = {
844
- id: string;
845
- created: number;
846
- metadata?: {
847
- [x: string]: any;
848
- };
849
- type: "session.created";
850
- durable: {
851
- aggregateID: string;
852
- seq: number;
853
- version: 1;
854
- };
855
- location?: LocationRef;
856
- data: {
857
- sessionID: string;
858
- projectID: string;
859
- location: LocationRef;
860
- subpath?: string;
861
- parentID?: string;
862
- slug: string;
863
- title?: string;
864
- agent?: string;
865
- model?: ModelRef;
866
- metadata?: SessionMetadata;
867
- version: string;
868
- };
869
- };
870
843
  export type SessionAgentSelected = {
871
844
  id: string;
872
845
  created: number;
@@ -2365,32 +2338,6 @@ export type SessionInboxMove = {
2365
2338
  payload: SessionInboxMovePayload;
2366
2339
  delivery: SessionInboxDelivery;
2367
2340
  };
2368
- export type SessionInfo = {
2369
- id: string;
2370
- parentID?: string;
2371
- fork?: {
2372
- sessionID: string;
2373
- boundary: SessionForkBoundary;
2374
- };
2375
- projectID: string;
2376
- agent?: string;
2377
- model?: ModelRef;
2378
- cost: MoneyUSD;
2379
- tokens: TokenUsageInfo;
2380
- outcome?: "succeeded" | "failed" | "interrupted";
2381
- time: {
2382
- created: number;
2383
- updated: number;
2384
- idle?: number;
2385
- viewed?: number;
2386
- archived?: number;
2387
- };
2388
- title?: string;
2389
- location: LocationRef;
2390
- subpath?: string;
2391
- metadata?: SessionMetadata;
2392
- revert?: SessionRevert;
2393
- };
2394
2341
  export type SessionRevertStaged = {
2395
2342
  id: string;
2396
2343
  created: number;
@@ -2696,6 +2643,79 @@ export type AgentInfo = {
2696
2643
  steps?: number;
2697
2644
  permissions: PermissionRuleset;
2698
2645
  };
2646
+ export type SessionPermissionsUpdated = {
2647
+ id: string;
2648
+ created: number;
2649
+ metadata?: {
2650
+ [x: string]: any;
2651
+ };
2652
+ type: "session.permissions.updated";
2653
+ durable: {
2654
+ aggregateID: string;
2655
+ seq: number;
2656
+ version: 1;
2657
+ };
2658
+ location?: LocationRef;
2659
+ data: {
2660
+ sessionID: string;
2661
+ permissions: PermissionRuleset;
2662
+ };
2663
+ };
2664
+ export type SessionInfo = {
2665
+ id: string;
2666
+ parentID?: string;
2667
+ fork?: {
2668
+ sessionID: string;
2669
+ boundary: SessionForkBoundary;
2670
+ };
2671
+ projectID: string;
2672
+ agent?: string;
2673
+ model?: ModelRef;
2674
+ cost: MoneyUSD;
2675
+ tokens: TokenUsageInfo;
2676
+ outcome?: "succeeded" | "failed" | "interrupted";
2677
+ time: {
2678
+ created: number;
2679
+ updated: number;
2680
+ idle?: number;
2681
+ viewed?: number;
2682
+ archived?: number;
2683
+ };
2684
+ title?: string;
2685
+ location: LocationRef;
2686
+ subpath?: string;
2687
+ metadata?: SessionMetadata;
2688
+ permissions?: PermissionRuleset;
2689
+ revert?: SessionRevert;
2690
+ };
2691
+ export type SessionCreated = {
2692
+ id: string;
2693
+ created: number;
2694
+ metadata?: {
2695
+ [x: string]: any;
2696
+ };
2697
+ type: "session.created";
2698
+ durable: {
2699
+ aggregateID: string;
2700
+ seq: number;
2701
+ version: 1;
2702
+ };
2703
+ location?: LocationRef;
2704
+ data: {
2705
+ sessionID: string;
2706
+ projectID: string;
2707
+ location: LocationRef;
2708
+ subpath?: string;
2709
+ parentID?: string;
2710
+ slug: string;
2711
+ title?: string;
2712
+ agent?: string;
2713
+ model?: ModelRef;
2714
+ metadata?: SessionMetadata;
2715
+ permissions?: PermissionRuleset;
2716
+ version: string;
2717
+ };
2718
+ };
2699
2719
  export type ConfigEntry = {
2700
2720
  type: "document";
2701
2721
  path?: string;
@@ -2976,13 +2996,6 @@ export type ConfigEntry = {
2976
2996
  type: "claude";
2977
2997
  path: string;
2978
2998
  };
2979
- export type SessionsResponse = {
2980
- data: Array<SessionInfo>;
2981
- cursor: {
2982
- previous?: string | null;
2983
- next?: string | null;
2984
- };
2985
- };
2986
2999
  export type SessionInboxUser = {
2987
3000
  id: string;
2988
3001
  sessionID: string;
@@ -3039,6 +3052,13 @@ export type SessionMessageAssistantTool1 = {
3039
3052
  };
3040
3053
  export type FormFields = [FormField, ...Array<FormField>];
3041
3054
  export type FormFields2 = [FormField1, ...Array<FormField1>];
3055
+ export type SessionsResponse = {
3056
+ data: Array<SessionInfo>;
3057
+ cursor: {
3058
+ previous?: string | null;
3059
+ next?: string | null;
3060
+ };
3061
+ };
3042
3062
  export type SessionInboxInfo = SessionInboxUser | SessionInboxSynthetic | SessionInboxCompaction | SessionInboxMove;
3043
3063
  export type SessionInboxEnqueued = {
3044
3064
  id: string;
@@ -3156,7 +3176,7 @@ export type SessionMessagesResponse = {
3156
3176
  next?: string | null;
3157
3177
  };
3158
3178
  };
3159
- export type SessionEventDurable = SessionCreated | SessionAgentSelected | SessionModelSelected | SessionMoved | SessionRenamed | SessionViewed | SessionDeleted | SessionForked | SessionInboxDelivered | SessionInboxEnqueued | SessionInboxCancelled | SessionInboxDeliveryChanged | SessionExecutionStarted | SessionExecutionSucceeded | SessionExecutionFailed | SessionExecutionInterrupted | SessionInstructionsUpdated | SessionSynthetic | SessionSkillActivated | SessionShellStarted | SessionShellEnded | SessionStepStarted | SessionStepStreamed | SessionStepEnded | SessionStepFailed | SessionTextStarted | SessionTextEnded | SessionReasoningStarted | SessionReasoningEnded | SessionToolInputStarted | SessionToolInputEnded | SessionToolCalled | SessionToolSuccess | SessionToolFailed | SessionRetryScheduled | SessionCompactionStarted | SessionCompactionEnded | SessionCompactionFailed | SessionRevertStaged | SessionRevertCleared | SessionRevertCommitted | SessionUsageRecorded | SessionMessageContentUpdated;
3179
+ export type SessionEventDurable = SessionCreated | SessionAgentSelected | SessionModelSelected | SessionMoved | SessionRenamed | SessionPermissionsUpdated | SessionViewed | SessionDeleted | SessionForked | SessionInboxDelivered | SessionInboxEnqueued | SessionInboxCancelled | SessionInboxDeliveryChanged | SessionExecutionStarted | SessionExecutionSucceeded | SessionExecutionFailed | SessionExecutionInterrupted | SessionInstructionsUpdated | SessionSynthetic | SessionSkillActivated | SessionShellStarted | SessionShellEnded | SessionStepStarted | SessionStepStreamed | SessionStepEnded | SessionStepFailed | SessionTextStarted | SessionTextEnded | SessionReasoningStarted | SessionReasoningEnded | SessionToolInputStarted | SessionToolInputEnded | SessionToolCalled | SessionToolSuccess | SessionToolFailed | SessionRetryScheduled | SessionCompactionStarted | SessionCompactionEnded | SessionCompactionFailed | SessionRevertStaged | SessionRevertCleared | SessionRevertCommitted | SessionUsageRecorded | SessionMessageContentUpdated;
3160
3180
  export type IntegrationInfo = {
3161
3181
  id: string;
3162
3182
  name: string;
@@ -3166,7 +3186,7 @@ export type IntegrationInfo = {
3166
3186
  methods: Array<IntegrationMethod>;
3167
3187
  connections: Array<ConnectionInfo>;
3168
3188
  };
3169
- export type V2Event = ModelsDevRefreshed | CredentialUpdated | CredentialSwitched | IntegrationUpdated | CatalogUpdated | AgentUpdated | SessionCreated | SessionAgentSelected | SessionModelSelected | SessionMoved | SessionRenamed | SessionViewed | SessionUsageUpdated | SessionDeleted | SessionForked | SessionInboxDelivered | SessionInboxEnqueued | SessionInboxCancelled | SessionInboxDeliveryChanged | SessionExecutionStarted | SessionExecutionSucceeded | SessionExecutionFailed | SessionExecutionInterrupted | SessionInstructionsUpdated | SessionSynthetic | SessionSkillActivated | SessionShellStarted | SessionShellEnded | SessionStepStarted | SessionStepStreamed | SessionStepEnded | SessionStepFailed | SessionTextStarted | SessionTextDelta | SessionTextEnded | SessionReasoningStarted | SessionReasoningDelta | SessionReasoningEnded | SessionToolInputStarted | SessionToolInputDelta | SessionToolInputEnded | SessionToolCalled | SessionToolProgress | SessionToolSuccess | SessionToolFailed | SessionRetryScheduled | SessionCompactionStarted | SessionCompactionDelta | SessionCompactionEnded | SessionCompactionFailed | SessionRevertStaged | SessionRevertCleared | SessionRevertCommitted | FilesystemChanged | ReferenceUpdated | PermissionAsked | PermissionReplied | PluginUpdated | ProjectUpdated | WorktreeUpdated | WorktreeResolved | CommandUpdated | ConfigUpdated | SkillUpdated | PtyCreated | PtyUpdated | PtyExited | PtyDeleted | PersistentPtyAdded | PersistentPtyRemoved | ShellCreated | ShellExited | ShellDeleted | FormCreated | FormReplied | FormCancelled | WebsearchUpdated | SessionStatusUpdated | SessionIdle | TuiPromptAppend | TuiCommandExecute | TuiToastShow | TuiSessionSelect | InstallationUpdated | InstallationUpdateAvailable | VcsBranchUpdated | McpStatusChanged | McpResourcesChanged | V2EventRpc | V2EventServerConnected;
3189
+ export type V2Event = ModelsDevRefreshed | CredentialUpdated | CredentialSwitched | IntegrationUpdated | CatalogUpdated | AgentUpdated | SessionCreated | SessionAgentSelected | SessionModelSelected | SessionMoved | SessionRenamed | SessionPermissionsUpdated | SessionViewed | SessionUsageUpdated | SessionDeleted | SessionForked | SessionInboxDelivered | SessionInboxEnqueued | SessionInboxCancelled | SessionInboxDeliveryChanged | SessionExecutionStarted | SessionExecutionSucceeded | SessionExecutionFailed | SessionExecutionInterrupted | SessionInstructionsUpdated | SessionSynthetic | SessionSkillActivated | SessionShellStarted | SessionShellEnded | SessionStepStarted | SessionStepStreamed | SessionStepEnded | SessionStepFailed | SessionTextStarted | SessionTextDelta | SessionTextEnded | SessionReasoningStarted | SessionReasoningDelta | SessionReasoningEnded | SessionToolInputStarted | SessionToolInputDelta | SessionToolInputEnded | SessionToolCalled | SessionToolProgress | SessionToolSuccess | SessionToolFailed | SessionRetryScheduled | SessionCompactionStarted | SessionCompactionDelta | SessionCompactionEnded | SessionCompactionFailed | SessionRevertStaged | SessionRevertCleared | SessionRevertCommitted | FilesystemChanged | ReferenceUpdated | PermissionAsked | PermissionReplied | PluginUpdated | ProjectUpdated | WorktreeUpdated | WorktreeResolved | CommandUpdated | ConfigUpdated | SkillUpdated | PtyCreated | PtyUpdated | PtyExited | PtyDeleted | PersistentPtyAdded | PersistentPtyRemoved | ShellCreated | ShellExited | ShellDeleted | FormCreated | FormReplied | FormCancelled | WebsearchUpdated | SessionStatusUpdated | SessionIdle | TuiPromptAppend | TuiCommandExecute | TuiToastShow | TuiSessionSelect | InstallationUpdated | InstallationUpdateAvailable | VcsBranchUpdated | McpStatusChanged | McpResourcesChanged | V2EventRpc | V2EventServerConnected;
3170
3190
  export type SessionLogItem = SessionEventDurable | EventLogSynced;
3171
3191
  export type InvalidRequestError = {
3172
3192
  readonly _tag: "InvalidRequestError";
@@ -3621,6 +3641,11 @@ export type SessionCreateInput = {
3621
3641
  readonly metadata?: {
3622
3642
  readonly [x: string]: JsonValue;
3623
3643
  } | null;
3644
+ readonly permissions?: ReadonlyArray<{
3645
+ readonly action: string;
3646
+ readonly resource: string;
3647
+ readonly effect: "allow" | "deny" | "ask";
3648
+ }> | null;
3624
3649
  }["id"];
3625
3650
  readonly title?: {
3626
3651
  readonly id?: string | null;
@@ -3638,6 +3663,11 @@ export type SessionCreateInput = {
3638
3663
  readonly metadata?: {
3639
3664
  readonly [x: string]: JsonValue;
3640
3665
  } | null;
3666
+ readonly permissions?: ReadonlyArray<{
3667
+ readonly action: string;
3668
+ readonly resource: string;
3669
+ readonly effect: "allow" | "deny" | "ask";
3670
+ }> | null;
3641
3671
  }["title"];
3642
3672
  readonly agent?: {
3643
3673
  readonly id?: string | null;
@@ -3655,6 +3685,11 @@ export type SessionCreateInput = {
3655
3685
  readonly metadata?: {
3656
3686
  readonly [x: string]: JsonValue;
3657
3687
  } | null;
3688
+ readonly permissions?: ReadonlyArray<{
3689
+ readonly action: string;
3690
+ readonly resource: string;
3691
+ readonly effect: "allow" | "deny" | "ask";
3692
+ }> | null;
3658
3693
  }["agent"];
3659
3694
  readonly model?: {
3660
3695
  readonly id?: string | null;
@@ -3672,6 +3707,11 @@ export type SessionCreateInput = {
3672
3707
  readonly metadata?: {
3673
3708
  readonly [x: string]: JsonValue;
3674
3709
  } | null;
3710
+ readonly permissions?: ReadonlyArray<{
3711
+ readonly action: string;
3712
+ readonly resource: string;
3713
+ readonly effect: "allow" | "deny" | "ask";
3714
+ }> | null;
3675
3715
  }["model"];
3676
3716
  readonly location?: {
3677
3717
  readonly id?: string | null;
@@ -3689,6 +3729,11 @@ export type SessionCreateInput = {
3689
3729
  readonly metadata?: {
3690
3730
  readonly [x: string]: JsonValue;
3691
3731
  } | null;
3732
+ readonly permissions?: ReadonlyArray<{
3733
+ readonly action: string;
3734
+ readonly resource: string;
3735
+ readonly effect: "allow" | "deny" | "ask";
3736
+ }> | null;
3692
3737
  }["location"];
3693
3738
  readonly metadata?: {
3694
3739
  readonly id?: string | null;
@@ -3706,7 +3751,34 @@ export type SessionCreateInput = {
3706
3751
  readonly metadata?: {
3707
3752
  readonly [x: string]: JsonValue;
3708
3753
  } | null;
3754
+ readonly permissions?: ReadonlyArray<{
3755
+ readonly action: string;
3756
+ readonly resource: string;
3757
+ readonly effect: "allow" | "deny" | "ask";
3758
+ }> | null;
3709
3759
  }["metadata"];
3760
+ readonly permissions?: {
3761
+ readonly id?: string | null;
3762
+ readonly title?: string | null;
3763
+ readonly agent?: string | null;
3764
+ readonly model?: {
3765
+ readonly id: string;
3766
+ readonly providerID: string;
3767
+ readonly variant?: string;
3768
+ } | null;
3769
+ readonly location?: {
3770
+ readonly directory: string;
3771
+ readonly workspaceID?: string;
3772
+ } | null;
3773
+ readonly metadata?: {
3774
+ readonly [x: string]: JsonValue;
3775
+ } | null;
3776
+ readonly permissions?: ReadonlyArray<{
3777
+ readonly action: string;
3778
+ readonly resource: string;
3779
+ readonly effect: "allow" | "deny" | "ask";
3780
+ }> | null;
3781
+ }["permissions"];
3710
3782
  };
3711
3783
  export type SessionCreateOutput = {
3712
3784
  data: SessionInfo;
@@ -3760,6 +3832,11 @@ export type SessionImportInput = {
3760
3832
  readonly metadata?: {
3761
3833
  readonly [x: string]: JsonValue;
3762
3834
  };
3835
+ readonly permissions?: ReadonlyArray<{
3836
+ readonly action: string;
3837
+ readonly resource: string;
3838
+ readonly effect: "allow" | "deny" | "ask";
3839
+ }>;
3763
3840
  readonly revert?: {
3764
3841
  readonly messageID: string;
3765
3842
  readonly partID?: string;
@@ -4218,6 +4295,11 @@ export type SessionImportInput = {
4218
4295
  readonly metadata?: {
4219
4296
  readonly [x: string]: JsonValue;
4220
4297
  };
4298
+ readonly permissions?: ReadonlyArray<{
4299
+ readonly action: string;
4300
+ readonly resource: string;
4301
+ readonly effect: "allow" | "deny" | "ask";
4302
+ }>;
4221
4303
  readonly revert?: {
4222
4304
  readonly messageID: string;
4223
4305
  readonly partID?: string;
@@ -4676,6 +4758,11 @@ export type SessionImportInput = {
4676
4758
  readonly metadata?: {
4677
4759
  readonly [x: string]: JsonValue;
4678
4760
  };
4761
+ readonly permissions?: ReadonlyArray<{
4762
+ readonly action: string;
4763
+ readonly resource: string;
4764
+ readonly effect: "allow" | "deny" | "ask";
4765
+ }>;
4679
4766
  readonly revert?: {
4680
4767
  readonly messageID: string;
4681
4768
  readonly partID?: string;
@@ -7651,6 +7738,19 @@ export type PermissionReplyInput = {
7651
7738
  }["message"];
7652
7739
  };
7653
7740
  export type PermissionReplyOutput = void;
7741
+ export type PermissionRulesInput = {
7742
+ readonly sessionID: {
7743
+ readonly sessionID: string;
7744
+ }["sessionID"];
7745
+ readonly permissions: {
7746
+ readonly permissions: ReadonlyArray<{
7747
+ readonly action: string;
7748
+ readonly resource: string;
7749
+ readonly effect: "allow" | "deny" | "ask";
7750
+ }>;
7751
+ }["permissions"];
7752
+ };
7753
+ export type PermissionRulesOutput = void;
7654
7754
  export type FileReadInput = {
7655
7755
  readonly location?: {
7656
7756
  readonly location?: {
@@ -550,6 +550,10 @@ export function createData(config) {
550
550
  });
551
551
  return;
552
552
  }
553
+ case "session.permissions.updated":
554
+ if (store.session.info[event.data.sessionID])
555
+ setStore("session", "info", event.data.sessionID, "permissions", event.data.permissions);
556
+ return;
553
557
  case "session.moved": {
554
558
  const current = store.session.info[event.data.sessionID];
555
559
  if (current) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/client",
4
- "version": "0.0.0-dev-19448",
4
+ "version": "0.0.0-dev-19449",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -57,8 +57,8 @@
57
57
  "typecheck": "tsgo --noEmit"
58
58
  },
59
59
  "dependencies": {
60
- "@opencode/schema": "0.0.0-dev-19448",
61
- "@opencode/protocol": "0.0.0-dev-19448"
60
+ "@opencode/schema": "0.0.0-dev-19449",
61
+ "@opencode/protocol": "0.0.0-dev-19449"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "effect": "4.0.0-rc.112",
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "devDependencies": {
76
76
  "@effect/platform-node": "4.0.0-rc.112",
77
- "@opencode/httpapi-codegen": "0.0.0-dev-19448",
77
+ "@opencode/httpapi-codegen": "0.0.0-dev-19449",
78
78
  "@tsconfig/bun": "1.0.9",
79
79
  "@types/bun": "1.4.0",
80
80
  "@typescript/native-preview": "7.0.0-dev.20251207.1",