Input
@daydreamsai/core / Input
Type Alias: Input<Schema, TContext, TAgent>
Input<
Schema,TContext,TAgent> =object
Defined in: packages/core/src/types.ts:321
Represents an input handler with validation and subscription capability
Template
Context type for input handling
Type Parameters
Schema
Schema extends z.ZodObject | z.ZodString | z.ZodRawShape = z.ZodObject | z.ZodString | z.ZodRawShape
Zod schema for input parameters
TContext
TContext extends AnyContext = AnyContext
TAgent
TAgent extends AnyAgent = AnyAgent
Properties
context?
optionalcontext:TContext
Defined in: packages/core/src/types.ts:332
description?
optionaldescription:string
Defined in: packages/core/src/types.ts:330
enabled()?
optionalenabled: (state) =>Promise<boolean> |boolean
Defined in: packages/core/src/types.ts:335
Parameters
state
AgentContext<TContext>
Returns
Promise<boolean> | boolean
format()?
optionalformat: (ref) =>string|string[] |XMLElement
Defined in: packages/core/src/types.ts:341
Parameters
ref
InputRef<InferSchemaArguments<Schema>>
Returns
string | string[] | XMLElement
handler()?
optionalhandler: (data,ctx,agent) =>MaybePromise<Pick<InputRef,"params"|"data">>
Defined in: packages/core/src/types.ts:336
Parameters
data
InferSchemaArguments<Schema>
ctx
AgentContext<TContext>
agent
TAgent
Returns
MaybePromise<Pick<InputRef, "params" | "data">>
install()?
optionalinstall: (agent) =>MaybePromise<void>
Defined in: packages/core/src/types.ts:334
Parameters
agent
TAgent
Returns
MaybePromise<void>
schema?
optionalschema:Schema
Defined in: packages/core/src/types.ts:331
subscribe()?
optionalsubscribe: (send,agent) => () =>void|void|Promise<void| () =>void>
Defined in: packages/core/src/types.ts:344
Parameters
send
<TContext>(context, args, data) => MaybePromise<void>
agent
TAgent
Returns
() => void | void | Promise<void | () => void>
type
type:
string
Defined in: packages/core/src/types.ts:329