Skip to content

effect

@fungi.computer/bird-dog


@fungi.computer/bird-dog / effect

BirdDog could not complete one owned store or transport operation.

  • Error

new BirdDogError(message): BirdDogError

string

BirdDogError

Error.constructor

readonly _tag: "BirdDogError"

Stable discriminator for BirdDog-owned effect failures.

EffectBirdDogOptions = Readonly<{ outbox: Readonly<{ put: (key, value) => Effect.Effect<void, BirdDogError>>; read: (key) => Effect.Effect<string | undefined, BirdDogError>>; list: (limit, afterKey?) => Effect.Effect<readonly Readonly<{ key: string; value: string; }>[], BirdDogError>>; delete: (key) => Effect.Effect<void, BirdDogError>>; }>; post: (mail) => Effect.Effect<boolean, BirdDogError>>; scheduleWake: (at) => Effect.Effect<void, BirdDogError>>; now: () => number; }>

Effect host ports for the durable mail room.


BirdDogEffect = Readonly<{ fanOut: (settlement) => Effect.Effect<void, BirdDogError>>; drainOutbox: () => Effect.Effect<void, BirdDogError>>; }>

Effect-native durable reply delivery.

const BirdDogAgentReferenceSchema: Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>

Parser for an ordinary agent Session address.


const BirdDogMailSchema: Struct<{ key: filter<filter<typeof String$>>>>; to: Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>; from: Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>; replyTo: Array$<Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>>; content: typeof String$; createdAt: typeof NonNegative; }>

Parser for addressed agent correspondence.


const BirdDogAgentWorkSchema: Struct<{ jobId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; commandFactId: filter<filter<typeof String$>>>>; recovery: optional<Struct<{ maxRecoveries: filter<typeof Int>>; }>>; }>

Parser for accepted Session work.


const BirdDogAgentJobPayloadSchema: Struct<{ work: Struct<{ sessionId: filter<filter<typeof String$>>>>; commandFactId: filter<filter<typeof String$>>>>; }>; mail: optional<Struct<{ key: filter<filter<typeof String$>>>>; to: Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>; from: Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>; replyTo: Array$<Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>>; content: typeof String$; createdAt: typeof NonNegative; }>>; }>

Parser for the payload that Watchdog stores without interpretation.


const BirdDogAgentJobInputSchema: Struct<{ work: Struct<{ jobId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; commandFactId: filter<filter<typeof String$>>>>; recovery: optional<Struct<{ maxRecoveries: filter<typeof Int>>; }>>; }>; mail: optional<Struct<{ key: filter<filter<typeof String$>>>>; to: Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>; from: Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>; replyTo: Array$<Struct<{ kind: Literal<["agent"]>; agentId: filter<filter<typeof String$>>>>; sessionId: filter<filter<typeof String$>>>>; }>>; content: typeof String$; createdAt: typeof NonNegative; }>>; }>

Parser for accepted work entering BirdDog’s transactional projection.

agentJobFromInput(input): object

Validate and translate agent work into Watchdog’s opaque job grammar.

BirdDogAgentJobInput

object

readonly state: "queued"

readonly jobId: string

readonly queue: string

readonly lane: string

readonly priority: number

readonly payload: unknown

readonly optional recovery?: object

readonly maxRecoveries: number


decodeAgentJob(job): BirdDogAgentJobPayload

Decode the opaque payload at BirdDog’s side of the Watchdog seam.

{ state: "queued"; jobId: string; queue: string; lane: string; priority: number; payload: unknown; recovery?: { maxRecoveries: number; }; } | { state: "running"; jobId: string; queue: string; lane: string; priority: number; payload: unknown; recovery?: { maxRecoveries: number; }; } | { state: "settled"; outcome: "completed" | "failed" | "cancelled" | "outcome_unknown" | "interrupted"; jobId: string; queue: string; lane: string; priority: number; payload: unknown; recovery?: { maxRecoveries: number; }; }

BirdDogAgentJobPayload


make(options): Effect<Readonly<{ fanOut: (settlement) => Effect<void, BirdDogError>>; drainOutbox: () => Effect<void, BirdDogError>>; }>>

Construct BirdDog’s Effect-native durable mail room.

EffectBirdDogOptions

Effect<Readonly<{ fanOut: (settlement) => Effect<void, BirdDogError>; drainOutbox: () => Effect<void, BirdDogError>; }>>