Rename v2 auth service to account (#28260)

This commit is contained in:
Dax
2026-05-20 20:53:27 -04:00
committed by GitHub
parent bd41dac88f
commit 8643c0721e
67 changed files with 2541 additions and 1379 deletions

View File

@@ -1216,7 +1216,7 @@ export const layer = Layer.effect(
const message = yield* createUserMessage(input)
yield* sessions.touch(input.sessionID)
const permissions: Permission.Ruleset = []
const permissions: Permission.Rule[] = []
for (const [t, enabled] of Object.entries(input.tools ?? {})) {
permissions.push({ permission: t, action: enabled ? "allow" : "deny", pattern: "*" })
}

View File

@@ -101,7 +101,7 @@ export function fromRow(row: SessionRow): Info {
},
share,
revert,
permission: row.permission ?? undefined,
permission: row.permission ? [...row.permission] : undefined,
time: {
created: row.time_created,
updated: row.time_updated,
@@ -542,7 +542,7 @@ export const layer: Layer.Layer<
title: input.title ?? createDefaultTitle(!!input.parentID),
agent: input.agent,
model: input.model,
permission: input.permission,
permission: input.permission ? [...input.permission] : undefined,
cost: 0,
tokens: EmptyTokens,
time: {
@@ -734,7 +734,7 @@ export const layer: Layer.Layer<
sessionID: SessionID
permission: Permission.Ruleset
}) {
yield* patch(input.sessionID, { permission: input.permission, time: { updated: Date.now() } })
yield* patch(input.sessionID, { permission: [...input.permission], time: { updated: Date.now() } })
})
const setRevert = Effect.fn("Session.setRevert")(function* (input: {