mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-25 11:53:35 +00:00
chore: generate
This commit is contained in:
parent
9b815bcbd2
commit
8dc2ffd48f
11 changed files with 945 additions and 455 deletions
|
|
@ -38,7 +38,11 @@ interface State {
|
|||
approved: PermissionLegacy.Rule[]
|
||||
}
|
||||
|
||||
export function evaluate(permission: string, pattern: string, ...rulesets: PermissionLegacy.Ruleset[]): PermissionLegacy.Rule {
|
||||
export function evaluate(
|
||||
permission: string,
|
||||
pattern: string,
|
||||
...rulesets: PermissionLegacy.Ruleset[]
|
||||
): PermissionLegacy.Rule {
|
||||
return (
|
||||
rulesets
|
||||
.flat()
|
||||
|
|
@ -134,7 +138,9 @@ export const layer = Layer.effect(
|
|||
if (input.reply === "reject") {
|
||||
yield* Deferred.fail(
|
||||
existing.deferred,
|
||||
input.message ? new PermissionLegacy.CorrectedError({ feedback: input.message }) : new PermissionLegacy.RejectedError(),
|
||||
input.message
|
||||
? new PermissionLegacy.CorrectedError({ feedback: input.message })
|
||||
: new PermissionLegacy.RejectedError(),
|
||||
)
|
||||
|
||||
for (const [id, item] of pending.entries()) {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@ export const SessionPermissionGroup = HttpApiGroup.make("v2.session.permission")
|
|||
}),
|
||||
),
|
||||
)
|
||||
.annotateMerge(OpenApi.annotations({ title: "v2 session permissions", description: "Experimental v2 session permission routes." }))
|
||||
.annotateMerge(
|
||||
OpenApi.annotations({ title: "v2 session permissions", description: "Experimental v2 session permission routes." }),
|
||||
)
|
||||
.middleware(V2Authorization)
|
||||
|
||||
export const PermissionSavedGroup = HttpApiGroup.make("v2.permission.saved")
|
||||
|
|
@ -86,5 +88,7 @@ export const PermissionSavedGroup = HttpApiGroup.make("v2.permission.saved")
|
|||
}),
|
||||
),
|
||||
)
|
||||
.annotateMerge(OpenApi.annotations({ title: "v2 saved permissions", description: "Experimental v2 saved permission routes." }))
|
||||
.annotateMerge(
|
||||
OpenApi.annotations({ title: "v2 saved permissions", description: "Experimental v2 saved permission routes." }),
|
||||
)
|
||||
.middleware(V2Authorization)
|
||||
|
|
|
|||
|
|
@ -917,7 +917,11 @@ it.instance(
|
|||
() =>
|
||||
Effect.gen(function* () {
|
||||
const events = yield* EventV2Bridge.Service
|
||||
const seen = yield* Deferred.make<{ sessionID: SessionID; requestID: PermissionLegacy.ID; reply: PermissionLegacy.Reply }>()
|
||||
const seen = yield* Deferred.make<{
|
||||
sessionID: SessionID
|
||||
requestID: PermissionLegacy.ID
|
||||
reply: PermissionLegacy.Reply
|
||||
}>()
|
||||
|
||||
const fiber = yield* ask({
|
||||
id: PermissionLegacy.ID.make("per_test7"),
|
||||
|
|
@ -935,7 +939,9 @@ it.instance(
|
|||
if (event.type === Permission.Event.Replied.type)
|
||||
Deferred.doneUnsafe(
|
||||
seen,
|
||||
Effect.succeed(event.data as { sessionID: SessionID; requestID: PermissionLegacy.ID; reply: PermissionLegacy.Reply }),
|
||||
Effect.succeed(
|
||||
event.data as { sessionID: SessionID; requestID: PermissionLegacy.ID; reply: PermissionLegacy.Reply },
|
||||
),
|
||||
)
|
||||
return Effect.void
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue