/** * Effect service carrying per-invocation hook context. * * Every hook handler has access to `HookContext.Service` via `yield*` * (or the individual accessor effects). The service is constructed by * the runner from the decoded envelope of the incoming stdin payload, * so handlers never touch the raw JSON. * * @since 0.1.0 */ import * as Context from 'effect/Context'; import * as Effect from 'effect/Effect'; import * as Layer from 'effect/Layer'; import * as Option from 'effect/Option'; import type { HookEnvelope } from './Envelope.js'; export declare namespace HookContext { /** * The shape of the HookContext service — camelCase-normalized envelope * fields plus any future per-invocation metadata. * * @category Service * @since 0.1.0 */ export interface Interface { readonly sessionId: string; readonly transcriptPath: string; readonly cwd: string; readonly permissionMode: Option.Option; readonly hookEventName: string; readonly effort: Option.Option; readonly agentId: Option.Option; readonly agentType: Option.Option; } const Service_base: Context.ServiceClass; /** * The HookContext service tag. * * @category Service * @since 0.1.0 */ export class Service extends Service_base { } /** * Build a `HookContext.Interface` value from a decoded `HookEnvelope`. * * @category Constructors * @since 0.1.0 */ export const fromEnvelope: (env: HookEnvelope) => Interface; /** * Build a Layer that provides `HookContext.Service` from a decoded envelope. * * The runner calls this per-invocation with the parsed stdin envelope. * Tests can call it with a mock envelope built via * `Testing.makeMockHookContext`. * * @category Layers * @since 0.1.0 */ export const layer: (env: HookEnvelope) => Layer.Layer; export {}; } /** * Effectful access to the current session ID. * * @category Accessors * @since 0.1.0 */ export declare const sessionId: Effect.Effect; /** * Effectful access to the path of the conversation transcript file. * * @category Accessors * @since 0.1.0 */ export declare const transcriptPath: Effect.Effect; /** * Effectful access to the working directory in which the hook fired. * * @category Accessors * @since 0.1.0 */ export declare const cwd: Effect.Effect; /** * Effectful access to the active permission mode (if any). * * @category Accessors * @since 0.1.0 */ export declare const permissionMode: Effect.Effect, never, HookContext.Service>; /** * Effectful access to the hook event name (e.g. `"PreToolUse"`). * * @category Accessors * @since 0.1.0 */ export declare const hookEventName: Effect.Effect; /** * Effectful access to the active effort level payload (if any). * * @category Accessors * @since 0.1.0 */ export declare const effort: Effect.Effect, never, HookContext.Service>; /** * Effectful access to the current subagent/session agent id (if any). * * @category Accessors * @since 0.1.0 */ export declare const agentId: Effect.Effect, never, HookContext.Service>; /** * Effectful access to the current subagent/session agent type (if any). * * @category Accessors * @since 0.1.0 */ export declare const agentType: Effect.Effect, never, HookContext.Service>; //# sourceMappingURL=Context.d.ts.map