@@ -11,6 +11,7 @@ import type { RelativePath } from "@opencode/schema/schema"
1111import type { Brand } from "effect"
1212import type { Model } from "@opencode/schema/model"
1313import type { DateTime } from "effect"
14+ import type { Permission } from "@opencode/schema/permission"
1415import type { SessionMessage } from "@opencode/schema/session-message"
1516import type { SessionInbox } from "@opencode/schema/session-inbox"
1617import type { PromptInput } from "@opencode/schema/prompt-input"
@@ -26,7 +27,6 @@ import type { Integration } from "@opencode/schema/integration"
2627import type { Form } from "@opencode/schema/form"
2728import type { Mcp } from "@opencode/schema/mcp"
2829import type { Credential } from "@opencode/schema/credential"
29- import type { Permission } from "@opencode/schema/permission"
3030import type { PermissionSaved } from "@opencode/schema/permission-saved"
3131import type { FileSystem } from "@opencode/schema/filesystem"
3232import type { Command } from "@opencode/schema/command"
@@ -209,6 +209,7 @@ export type SessionCreateInput = {
209209 readonly model ?: Model . Ref | undefined
210210 readonly location ?: Location . Ref | undefined
211211 readonly metadata ?: Session . Metadata | undefined
212+ readonly permissions ?: Permission . Ruleset | undefined
212213}
213214export type SessionCreateOutput = Session . Info
214215export type SessionCreateOperation < E = never > = ( input ?: SessionCreateInput ) => Effect . Effect < SessionCreateOutput , E >
@@ -437,6 +438,7 @@ export type SessionLogOutput =
437438 readonly agent ?: Agent . ID | undefined
438439 readonly model ?: Model . Ref | undefined
439440 readonly metadata ?: Session . Metadata | undefined
441+ readonly permissions ?: Permission . Ruleset | undefined
440442 readonly version : string
441443 }
442444 }
@@ -489,6 +491,15 @@ export type SessionLogOutput =
489491 readonly location ?: Location . Ref | undefined
490492 readonly data : { readonly sessionID : Session . ID ; readonly title : string }
491493 }
494+ | {
495+ readonly id : Event . ID
496+ readonly created : number
497+ readonly metadata ?: { readonly [ x : string ] : unknown } | undefined
498+ readonly type : "session.permissions.updated"
499+ readonly durable : { readonly aggregateID : string ; readonly seq : Event . Seq ; readonly version : Event . Version }
500+ readonly location ?: Location . Ref | undefined
501+ readonly data : { readonly sessionID : Session . ID ; readonly permissions : Permission . Ruleset }
502+ }
492503 | {
493504 readonly id : Event . ID
494505 readonly created : number
@@ -1585,13 +1596,20 @@ export type PermissionReplyOperation<E = never> = (
15851596 input : PermissionReplyInput ,
15861597) => Effect . Effect < PermissionReplyOutput , E >
15871598
1599+ export type PermissionRulesInput = { readonly sessionID : Session . ID ; readonly permissions : Permission . Ruleset }
1600+ export type PermissionRulesOutput = void
1601+ export type PermissionRulesOperation < E = never > = (
1602+ input : PermissionRulesInput ,
1603+ ) => Effect . Effect < PermissionRulesOutput , E >
1604+
15881605export interface PermissionApi < E = never > {
15891606 readonly request : { readonly list : PermissionRequestListOperation < E > }
15901607 readonly saved : { readonly list : PermissionSavedListOperation < E > ; readonly remove : PermissionSavedRemoveOperation < E > }
15911608 readonly create : PermissionCreateOperation < E >
15921609 readonly list : PermissionListOperation < E >
15931610 readonly get : PermissionGetOperation < E >
15941611 readonly reply : PermissionReplyOperation < E >
1612+ readonly rules : PermissionRulesOperation < E >
15951613}
15961614
15971615export type FileListInput = {
0 commit comments