The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import type { Actor } from "@bank/domain/Actor"; |
| 2 | import { sessionClient } from "@bank/domain/Session.middleware"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import * as Layer from "effect/Layer"; |
| 5 | import * as Redacted from "effect/Redacted"; |
| 6 | import { SessionKey, signSession } from "../src/Session.ts"; |
| 7 | |
| 8 | /** A fixed key in place of the deployed stage's random one. */ |
| 9 | export const SessionKeyTest = Layer.succeed( |
| 10 | SessionKey, |
| 11 | Effect.succeed(Redacted.make("a-test-session-key-a-test-session-key")), |
| 12 | ); |
| 13 | |
| 14 | /** Client middleware that sends a session signed for `actor`. */ |
| 15 | export const signedInAs = (actor: Actor) => |
| 16 | Layer.unwrap(Effect.map(signSession(actor), sessionClient)); |