@langchain/langgraph-sdk 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +3 -3
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +3 -3
- package/dist/client.js.map +1 -1
- package/dist/react/stream.cjs.map +1 -1
- package/dist/react/stream.d.cts +6 -6
- package/dist/react/stream.d.cts.map +1 -1
- package/dist/react/stream.d.ts +6 -6
- package/dist/react/stream.d.ts.map +1 -1
- package/dist/react/stream.js.map +1 -1
- package/dist/schema.d.cts +1 -1
- package/dist/schema.d.cts.map +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.stream.d.ts.map +1 -1
- package/dist/ui/types.d.cts +75 -12
- package/dist/ui/types.d.cts.map +1 -1
- package/dist/ui/types.d.ts +75 -12
- package/dist/ui/types.d.ts.map +1 -1
- package/package.json +5 -4
package/dist/react/stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","names":[],"sources":["../../src/react/stream.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { useStreamLGP } from \"./stream.lgp.js\";\nimport { useStreamCustom } from \"./stream.custom.js\";\nimport type { UseStreamOptions,
|
|
1
|
+
{"version":3,"file":"stream.js","names":[],"sources":["../../src/react/stream.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { useStreamLGP } from \"./stream.lgp.js\";\nimport { useStreamCustom } from \"./stream.custom.js\";\nimport type { UseStreamOptions, InferAgentState } from \"../ui/types.js\";\nimport type { BagTemplate } from \"../types.template.js\";\nimport type {\n UseStream,\n UseStreamCustom,\n UseStreamCustomOptions,\n} from \"./types.js\";\n\nfunction isCustomOptions<\n StateType extends Record<string, unknown> = Record<string, unknown>,\n Bag extends BagTemplate = BagTemplate\n>(\n options:\n | UseStreamOptions<StateType, Bag>\n | UseStreamCustomOptions<StateType, Bag>\n): options is UseStreamCustomOptions<StateType, Bag> {\n return \"transport\" in options;\n}\n\n/**\n * Helper type that infers StateType based on whether T is an agent-like type, a CompiledGraph/Pregel instance, or a state type.\n * - If T has `~agentTypes`, returns the full agent state including:\n * - Base agent state with typed messages based on the agent's tools\n * - The agent's custom state schema\n * - All middleware states\n * - If T has `~RunOutput` (CompiledGraph/CompiledStateGraph), returns the state type\n * - If T has `~OutputType` (Pregel), returns the output type as state\n * - Otherwise, returns T (direct state type)\n */\ntype InferStateType<T> = T extends { \"~agentTypes\": unknown }\n ? InferAgentState<T>\n : T extends { \"~RunOutput\": infer S }\n ? S extends Record<string, unknown>\n ? S\n : Record<string, unknown>\n : T extends { \"~OutputType\": infer O }\n ? O extends Record<string, unknown>\n ? O\n : Record<string, unknown>\n : T extends Record<string, unknown>\n ? T\n : Record<string, unknown>;\n\n/**\n * Helper type that infers Bag based on whether T is an agent-like type.\n * - If T has `~agentTypes`, extracts bag from the agent's tools\n * - Otherwise, returns the default BagTemplate\n */\ntype InferBag<T, B extends BagTemplate = BagTemplate> = T extends {\n \"~agentTypes\": unknown;\n}\n ? BagTemplate\n : B;\n\n/**\n * A React hook that provides seamless integration with LangGraph streaming capabilities.\n *\n * The `useStream` hook handles all the complexities of streaming, state management, and branching logic,\n * letting you focus on building great chat experiences. It provides automatic state management for\n * messages, interrupts, loading states, and errors.\n *\n * ## Usage with ReactAgent (recommended for createAgent users)\n *\n * When using `createAgent` from `@langchain/langgraph`, you can pass `typeof agent` as the\n * type parameter to automatically infer tool call types:\n *\n * @example\n * ```typescript\n * // In your agent file (e.g., agent.ts)\n * import { createAgent, tool } from \"@langchain/langgraph\";\n * import { z } from \"zod\";\n *\n * const getWeather = tool(\n * async ({ location }) => `Weather in ${location}`,\n * { name: \"get_weather\", schema: z.object({ location: z.string() }) }\n * );\n *\n * export const agent = createAgent({\n * model: \"openai:gpt-4o\",\n * tools: [getWeather],\n * });\n *\n * // In your React component\n * import { agent } from \"./agent\";\n *\n * function Chat() {\n * // Tool calls are automatically typed from the agent's tools!\n * const stream = useStream<typeof agent>({\n * assistantId: \"agent\",\n * apiUrl: \"http://localhost:2024\",\n * });\n *\n * // stream.toolCalls[0].call.name is typed as \"get_weather\"\n * // stream.toolCalls[0].call.args is typed as { location: string }\n * }\n * ```\n *\n * ## Usage with StateGraph (for custom LangGraph applications)\n *\n * When building custom graphs with `StateGraph`, embed your tool call types directly\n * in your state's messages property using `Message<MyToolCalls>`:\n *\n * @example\n * ```typescript\n * import { Message } from \"@langchain/langgraph-sdk\";\n *\n * // Define your tool call types as a discriminated union\n * type MyToolCalls =\n * | { name: \"search\"; args: { query: string }; id?: string }\n * | { name: \"calculate\"; args: { expression: string }; id?: string };\n *\n * // Embed tool call types in your state's messages\n * interface MyGraphState {\n * messages: Message<MyToolCalls>[];\n * context?: string;\n * }\n *\n * function Chat() {\n * const stream = useStream<MyGraphState>({\n * assistantId: \"my-graph\",\n * apiUrl: \"http://localhost:2024\",\n * });\n *\n * // stream.values is typed as MyGraphState\n * // stream.toolCalls[0].call.name is typed as \"search\" | \"calculate\"\n * }\n * ```\n *\n * @example\n * ```typescript\n * // With additional type configuration (interrupts, configurable)\n * interface MyGraphState {\n * messages: Message<MyToolCalls>[];\n * }\n *\n * function Chat() {\n * const stream = useStream<MyGraphState, {\n * InterruptType: { question: string };\n * ConfigurableType: { userId: string };\n * }>({\n * assistantId: \"my-graph\",\n * apiUrl: \"http://localhost:2024\",\n * });\n *\n * // stream.interrupt is typed as { question: string } | undefined\n * }\n * ```\n *\n * @template T Either a ReactAgent type (with `~agentTypes`) or a state type (`Record<string, unknown>`)\n * @template Bag Type configuration bag containing:\n * - `ConfigurableType`: Type for the `config.configurable` property\n * - `InterruptType`: Type for interrupt values\n * - `CustomEventType`: Type for custom events\n * - `UpdateType`: Type for the submit function updates\n *\n * @see {@link https://docs.langchain.com/langgraph-platform/use-stream-react | LangGraph React Integration Guide}\n */\nexport function useStream<\n T = Record<string, unknown>,\n Bag extends BagTemplate = BagTemplate\n>(\n options: UseStreamOptions<InferStateType<T>, InferBag<T, Bag>>\n): UseStream<InferStateType<T>, InferBag<T, Bag>>;\n\n/**\n * A React hook that provides seamless integration with LangGraph streaming capabilities.\n *\n * The `useStream` hook handles all the complexities of streaming, state management, and branching logic,\n * letting you focus on building great chat experiences. It provides automatic state management for\n * messages, interrupts, loading states, and errors.\n *\n * @template T Either a ReactAgent type (with `~agentTypes`) or a state type (`Record<string, unknown>`)\n * @template Bag Type configuration bag containing:\n * - `ConfigurableType`: Type for the `config.configurable` property\n * - `InterruptType`: Type for interrupt values\n * - `CustomEventType`: Type for custom events\n * - `UpdateType`: Type for the submit function updates\n *\n * @see {@link https://docs.langchain.com/langgraph-platform/use-stream-react | LangGraph React Integration Guide}\n */\nexport function useStream<\n T = Record<string, unknown>,\n Bag extends BagTemplate = BagTemplate\n>(\n options: UseStreamCustomOptions<InferStateType<T>, InferBag<T, Bag>>\n): UseStreamCustom<InferStateType<T>, InferBag<T, Bag>>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function useStream(options: any): any {\n // Store this in useState to make sure we're not changing the implementation in re-renders\n const [isCustom] = useState(isCustomOptions(options));\n\n if (isCustom) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStreamCustom(options);\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStreamLGP(options);\n}\n"],"mappings":";;;;;AAWA,SAAS,gBAIP,SAGmD;AACnD,QAAO,eAAe;;AA4KxB,SAAgB,UAAU,SAAmB;CAE3C,MAAM,CAAC,YAAY,SAAS,gBAAgB,QAAQ,CAAC;AAErD,KAAI,SAEF,QAAO,gBAAgB,QAAQ;AAIjC,QAAO,aAAa,QAAQ"}
|
package/dist/schema.d.cts
CHANGED
|
@@ -175,7 +175,7 @@ interface Cron {
|
|
|
175
175
|
on_run_completed?: "delete" | "keep";
|
|
176
176
|
/** The end date to stop running the cron. */
|
|
177
177
|
end_time: Optional<string>;
|
|
178
|
-
/** The schedule to run, cron format. */
|
|
178
|
+
/** The schedule to run, cron format. Schedules are interpreted in UTC. */
|
|
179
179
|
schedule: string;
|
|
180
180
|
/** The time the cron was created. */
|
|
181
181
|
created_at: string;
|
package/dist/schema.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.cts","names":["JSONSchema7","Optional","T","RunStatus","ThreadStatus","MultitaskStrategy","CancelAction","Config","GraphSchema","Subgraphs","Record","Metadata","AssistantBase","AssistantVersion","Assistant","AssistantsSearchResponse","AssistantGraph","Array","Interrupt","TValue","Thread","DefaultValues","ValuesType","TInterruptValue","Cron","ThreadValuesFilter","ThreadState","Checkpoint","ThreadTask","Run","ListNamespaceResponse","Item","SearchItem","SearchItemsResponse","CronCreateResponse","CronCreateForThreadResponse","Omit","AssistantSortBy","ThreadSortBy","CronSortBy","SortOrder","AssistantSelectField","ThreadSelectField","RunSelectField","CronSelectField"],"sources":["../src/schema.d.ts"],"sourcesContent":["import type { JSONSchema7 } from \"json-schema\";\ntype Optional<T> = T | null | undefined;\nexport type RunStatus = \"pending\" | \"running\" | \"error\" | \"success\" | \"timeout\" | \"interrupted\";\nexport type ThreadStatus = \"idle\" | \"busy\" | \"interrupted\" | \"error\";\ntype MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type CancelAction = \"interrupt\" | \"rollback\";\nexport type Config = {\n /**\n * Tags for this call and any sub-calls (eg. a Chain calling an LLM).\n * You can use these to filter calls.\n */\n tags?: string[];\n /**\n * Maximum number of times a call can recurse.\n * If not provided, defaults to 25.\n */\n recursion_limit?: number;\n /**\n * Runtime values for attributes previously made configurable on this Runnable.\n */\n configurable?: {\n /**\n * ID of the thread\n */\n thread_id?: Optional<string>;\n /**\n * Timestamp of the state checkpoint\n */\n checkpoint_id?: Optional<string>;\n [key: string]: unknown;\n };\n};\nexport interface GraphSchema {\n /**\n * The ID of the graph.\n */\n graph_id: string;\n /**\n * The schema for the input state.\n * Missing if unable to generate JSON schema from graph.\n */\n input_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the output state.\n * Missing if unable to generate JSON schema from graph.\n */\n output_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph state.\n * Missing if unable to generate JSON schema from graph.\n */\n state_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph config.\n * Missing if unable to generate JSON schema from graph.\n */\n config_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph context.\n * Missing if unable to generate JSON schema from graph.\n */\n context_schema?: JSONSchema7 | null | undefined;\n}\nexport type Subgraphs = Record<string, GraphSchema>;\nexport type Metadata = Optional<{\n source?: \"input\" | \"loop\" | \"update\" | (string & {});\n step?: number;\n writes?: Record<string, unknown> | null;\n parents?: Record<string, string>;\n [key: string]: unknown;\n}>;\nexport interface AssistantBase {\n /** The ID of the assistant. */\n assistant_id: string;\n /** The ID of the graph. */\n graph_id: string;\n /** The assistant config. */\n config: Config;\n /** The assistant context. */\n context: unknown;\n /** The time the assistant was created. */\n created_at: string;\n /** The assistant metadata. */\n metadata: Metadata;\n /** The version of the assistant. */\n version: number;\n /** The name of the assistant */\n name: string;\n /** The description of the assistant */\n description?: string;\n}\nexport interface AssistantVersion extends AssistantBase {\n}\nexport interface Assistant extends AssistantBase {\n /** The last time the assistant was updated. */\n updated_at: string;\n}\nexport interface AssistantsSearchResponse {\n /** The assistants returned for the current search page. */\n assistants: Assistant[];\n /** Pagination cursor from the X-Pagination-Next response header. */\n next: string | null;\n}\nexport interface AssistantGraph {\n nodes: Array<{\n id: string | number;\n name?: string;\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>;\n edges: Array<{\n source: string;\n target: string;\n data?: string;\n conditional?: boolean;\n }>;\n}\n/**\n * An interrupt thrown inside a thread.\n */\nexport interface Interrupt<TValue = unknown> {\n /**\n * The ID of the interrupt.\n */\n id?: string;\n /**\n * The value of the interrupt.\n */\n value?: TValue;\n /**\n * Will be deprecated in the future.\n * @deprecated Will be removed in the future.\n */\n when?: \"during\" | (string & {});\n /**\n * Whether the interrupt can be resumed.\n * @deprecated Will be removed in the future.\n */\n resumable?: boolean;\n /**\n * The namespace of the interrupt.\n * @deprecated Replaced by `interrupt_id`\n */\n ns?: string[];\n}\nexport interface Thread<ValuesType = DefaultValues, TInterruptValue = unknown> {\n /** The ID of the thread. */\n thread_id: string;\n /** The time the thread was created. */\n created_at: string;\n /** The last time the thread was updated. */\n updated_at: string;\n /** The thread metadata. */\n metadata: Metadata;\n /** The status of the thread */\n status: ThreadStatus;\n /** The current state of the thread. */\n values: ValuesType;\n /** Interrupts which were thrown in this thread */\n interrupts: Record<string, Array<Interrupt<TInterruptValue>>>;\n /** The config for the thread */\n config?: Config;\n /** The error for the thread (if status == \"error\") */\n error?: Optional<string | Record<string, unknown>>;\n}\nexport interface Cron {\n /** The ID of the cron */\n cron_id: string;\n /** The ID of the assistant */\n assistant_id: string;\n /** The ID of the thread */\n thread_id: Optional<string>;\n /** What to do with the thread after the run completes. Only applicable for stateless crons. */\n on_run_completed?: \"delete\" | \"keep\";\n /** The end date to stop running the cron. */\n end_time: Optional<string>;\n /** The schedule to run, cron format. */\n schedule: string;\n /** The time the cron was created. */\n created_at: string;\n /** The last time the cron was updated. */\n updated_at: string;\n /** The run payload to use for creating new run. */\n payload: Record<string, unknown>;\n /** The user ID of the cron */\n user_id: Optional<string>;\n /** The next run date of the cron */\n next_run_date: Optional<string>;\n /** The metadata of the cron */\n metadata: Record<string, unknown>;\n}\nexport type DefaultValues = Record<string, unknown>[] | Record<string, unknown>;\nexport type ThreadValuesFilter = Record<string, unknown>;\nexport interface ThreadState<ValuesType = DefaultValues> {\n /** The state values */\n values: ValuesType;\n /** The next nodes to execute. If empty, the thread is done until new input is received */\n next: string[];\n /** Checkpoint of the thread state */\n checkpoint: Checkpoint;\n /** Metadata for this state */\n metadata: Metadata;\n /** Time of state creation */\n created_at: Optional<string>;\n /** The parent checkpoint. If missing, this is the root checkpoint */\n parent_checkpoint: Optional<Checkpoint>;\n /** Tasks to execute in this step. If already attempted, may contain an error */\n tasks: Array<ThreadTask>;\n}\nexport interface ThreadTask<ValuesType = DefaultValues, TInterruptValue = unknown> {\n id: string;\n name: string;\n result?: unknown;\n error: Optional<string>;\n interrupts: Array<Interrupt<TInterruptValue>>;\n checkpoint: Optional<Checkpoint>;\n state: Optional<ThreadState<ValuesType>>;\n}\nexport interface Run {\n /** The ID of the run */\n run_id: string;\n /** The ID of the thread */\n thread_id: string;\n /** The assistant that wwas used for this run */\n assistant_id: string;\n /** The time the run was created */\n created_at: string;\n /** The last time the run was updated */\n updated_at: string;\n /** The status of the run. */\n status: RunStatus;\n /** Run metadata */\n metadata: Metadata;\n /** Strategy to handle concurrent runs on the same thread */\n multitask_strategy: Optional<MultitaskStrategy>;\n}\nexport type Checkpoint = {\n thread_id: string;\n checkpoint_ns: string;\n checkpoint_id: Optional<string>;\n checkpoint_map: Optional<Record<string, unknown>>;\n};\nexport interface ListNamespaceResponse {\n namespaces: string[][];\n}\nexport interface Item {\n namespace: string[];\n key: string;\n value: Record<string, any>;\n createdAt: string;\n updatedAt: string;\n}\nexport interface SearchItem extends Item {\n score?: number;\n}\nexport interface SearchItemsResponse {\n items: SearchItem[];\n}\nexport interface CronCreateResponse {\n cron_id: string;\n assistant_id: string;\n thread_id: string | undefined;\n user_id: string;\n payload: Record<string, unknown>;\n schedule: string;\n next_run_date: string;\n end_time: string | undefined;\n created_at: string;\n updated_at: string;\n metadata: Metadata;\n}\nexport interface CronCreateForThreadResponse extends Omit<CronCreateResponse, \"thread_id\"> {\n thread_id: string;\n}\nexport type AssistantSortBy = \"assistant_id\" | \"graph_id\" | \"name\" | \"created_at\" | \"updated_at\";\nexport type ThreadSortBy = \"thread_id\" | \"status\" | \"created_at\" | \"updated_at\";\nexport type CronSortBy = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"created_at\" | \"updated_at\" | \"next_run_date\";\nexport type SortOrder = \"asc\" | \"desc\";\nexport type AssistantSelectField = \"assistant_id\" | \"graph_id\" | \"name\" | \"description\" | \"config\" | \"context\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"version\";\nexport type ThreadSelectField = \"thread_id\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"config\" | \"context\" | \"status\" | \"values\" | \"interrupts\";\nexport type RunSelectField = \"run_id\" | \"thread_id\" | \"assistant_id\" | \"created_at\" | \"updated_at\" | \"status\" | \"metadata\" | \"kwargs\" | \"multitask_strategy\";\nexport type CronSelectField = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"end_time\" | \"schedule\" | \"created_at\" | \"updated_at\" | \"user_id\" | \"payload\" | \"next_run_date\" | \"metadata\" | \"now\";\nexport {};\n"],"mappings":";;;KACKC,cAAcC;KACPC,SAAAA;AADPF,KAEOG,YAAAA,GAFOF,MAAC,GAAA,MAAA,GAAA,aAAA,GAAA,OAAA;AACpB,KAEKG,iBAAAA,GAFgB,QAAA,GAAA,WAAA,GAAA,UAAA,GAAA,SAAA;AACTD,KAEAE,YAAAA,GAFY,WAAA,GAAA,UAAA;AACnBD,KAEOE,MAAAA,GAFPF;EACOC;AACZ;;;MAsBwBL,CAAAA,EAAAA,MAAAA,EAAAA;EAAQ;AAIhC;;;iBAcoBD,CAAAA,EAAAA,MAAAA;;;;EAeY,YAAA,CAAA,EAAA;IAEpBS;;;IAAYC,SAAAA,CAAAA,EAvCJT,QAuCIS,CAAAA,MAAAA,CAAAA;IAAM;AAC9B;;IAGaA,aAAAA,CAAAA,EAvCWT,QAuCXS,CAAAA,MAAAA,CAAAA;IACCA,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;CAJiB;AAOdE,UAvCAJ,WAAAA,CAuCa;EAAA;;;EAYR,QAAA,EAAA,MAAA;EAQLK;AAEjB;AAIA;AAMA;EAA+B,YAAA,CAAA,EA9DZb,WA8DY,GAAA,I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;SACd1B,SAASyB,YAAYJ;;UAEfO,GAAAA;;;;;;;;;;;;UAYL1B;;YAEEQ;;sBAEUV,SAASI;;KAErBsB,UAAAA;;;iBAGO1B;kBACCA,SAASS;;UAEZoB,qBAAAA;;;UAGAC,IAAAA;;;SAGNrB;;;;UAIMsB,UAAAA,SAAmBD;;;UAGnBE,mBAAAA;SACND;;UAEME,kBAAAA;;;;;WAKJxB;;;;;;YAMCC;;UAEGwB,2BAAAA,SAAoCC,KAAKF;;;KAG9CG,eAAAA;KACAC,YAAAA;KACAC,UAAAA;KACAC,SAAAA;KACAC,oBAAAA;KACAC,iBAAAA;KACAC,cAAAA;KACAC,eAAAA"}
|
|
1
|
+
{"version":3,"file":"schema.d.cts","names":["JSONSchema7","Optional","T","RunStatus","ThreadStatus","MultitaskStrategy","CancelAction","Config","GraphSchema","Subgraphs","Record","Metadata","AssistantBase","AssistantVersion","Assistant","AssistantsSearchResponse","AssistantGraph","Array","Interrupt","TValue","Thread","DefaultValues","ValuesType","TInterruptValue","Cron","ThreadValuesFilter","ThreadState","Checkpoint","ThreadTask","Run","ListNamespaceResponse","Item","SearchItem","SearchItemsResponse","CronCreateResponse","CronCreateForThreadResponse","Omit","AssistantSortBy","ThreadSortBy","CronSortBy","SortOrder","AssistantSelectField","ThreadSelectField","RunSelectField","CronSelectField"],"sources":["../src/schema.d.ts"],"sourcesContent":["import type { JSONSchema7 } from \"json-schema\";\ntype Optional<T> = T | null | undefined;\nexport type RunStatus = \"pending\" | \"running\" | \"error\" | \"success\" | \"timeout\" | \"interrupted\";\nexport type ThreadStatus = \"idle\" | \"busy\" | \"interrupted\" | \"error\";\ntype MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type CancelAction = \"interrupt\" | \"rollback\";\nexport type Config = {\n /**\n * Tags for this call and any sub-calls (eg. a Chain calling an LLM).\n * You can use these to filter calls.\n */\n tags?: string[];\n /**\n * Maximum number of times a call can recurse.\n * If not provided, defaults to 25.\n */\n recursion_limit?: number;\n /**\n * Runtime values for attributes previously made configurable on this Runnable.\n */\n configurable?: {\n /**\n * ID of the thread\n */\n thread_id?: Optional<string>;\n /**\n * Timestamp of the state checkpoint\n */\n checkpoint_id?: Optional<string>;\n [key: string]: unknown;\n };\n};\nexport interface GraphSchema {\n /**\n * The ID of the graph.\n */\n graph_id: string;\n /**\n * The schema for the input state.\n * Missing if unable to generate JSON schema from graph.\n */\n input_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the output state.\n * Missing if unable to generate JSON schema from graph.\n */\n output_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph state.\n * Missing if unable to generate JSON schema from graph.\n */\n state_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph config.\n * Missing if unable to generate JSON schema from graph.\n */\n config_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph context.\n * Missing if unable to generate JSON schema from graph.\n */\n context_schema?: JSONSchema7 | null | undefined;\n}\nexport type Subgraphs = Record<string, GraphSchema>;\nexport type Metadata = Optional<{\n source?: \"input\" | \"loop\" | \"update\" | (string & {});\n step?: number;\n writes?: Record<string, unknown> | null;\n parents?: Record<string, string>;\n [key: string]: unknown;\n}>;\nexport interface AssistantBase {\n /** The ID of the assistant. */\n assistant_id: string;\n /** The ID of the graph. */\n graph_id: string;\n /** The assistant config. */\n config: Config;\n /** The assistant context. */\n context: unknown;\n /** The time the assistant was created. */\n created_at: string;\n /** The assistant metadata. */\n metadata: Metadata;\n /** The version of the assistant. */\n version: number;\n /** The name of the assistant */\n name: string;\n /** The description of the assistant */\n description?: string;\n}\nexport interface AssistantVersion extends AssistantBase {\n}\nexport interface Assistant extends AssistantBase {\n /** The last time the assistant was updated. */\n updated_at: string;\n}\nexport interface AssistantsSearchResponse {\n /** The assistants returned for the current search page. */\n assistants: Assistant[];\n /** Pagination cursor from the X-Pagination-Next response header. */\n next: string | null;\n}\nexport interface AssistantGraph {\n nodes: Array<{\n id: string | number;\n name?: string;\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>;\n edges: Array<{\n source: string;\n target: string;\n data?: string;\n conditional?: boolean;\n }>;\n}\n/**\n * An interrupt thrown inside a thread.\n */\nexport interface Interrupt<TValue = unknown> {\n /**\n * The ID of the interrupt.\n */\n id?: string;\n /**\n * The value of the interrupt.\n */\n value?: TValue;\n /**\n * Will be deprecated in the future.\n * @deprecated Will be removed in the future.\n */\n when?: \"during\" | (string & {});\n /**\n * Whether the interrupt can be resumed.\n * @deprecated Will be removed in the future.\n */\n resumable?: boolean;\n /**\n * The namespace of the interrupt.\n * @deprecated Replaced by `interrupt_id`\n */\n ns?: string[];\n}\nexport interface Thread<ValuesType = DefaultValues, TInterruptValue = unknown> {\n /** The ID of the thread. */\n thread_id: string;\n /** The time the thread was created. */\n created_at: string;\n /** The last time the thread was updated. */\n updated_at: string;\n /** The thread metadata. */\n metadata: Metadata;\n /** The status of the thread */\n status: ThreadStatus;\n /** The current state of the thread. */\n values: ValuesType;\n /** Interrupts which were thrown in this thread */\n interrupts: Record<string, Array<Interrupt<TInterruptValue>>>;\n /** The config for the thread */\n config?: Config;\n /** The error for the thread (if status == \"error\") */\n error?: Optional<string | Record<string, unknown>>;\n}\nexport interface Cron {\n /** The ID of the cron */\n cron_id: string;\n /** The ID of the assistant */\n assistant_id: string;\n /** The ID of the thread */\n thread_id: Optional<string>;\n /** What to do with the thread after the run completes. Only applicable for stateless crons. */\n on_run_completed?: \"delete\" | \"keep\";\n /** The end date to stop running the cron. */\n end_time: Optional<string>;\n /** The schedule to run, cron format. Schedules are interpreted in UTC. */\n schedule: string;\n /** The time the cron was created. */\n created_at: string;\n /** The last time the cron was updated. */\n updated_at: string;\n /** The run payload to use for creating new run. */\n payload: Record<string, unknown>;\n /** The user ID of the cron */\n user_id: Optional<string>;\n /** The next run date of the cron */\n next_run_date: Optional<string>;\n /** The metadata of the cron */\n metadata: Record<string, unknown>;\n}\nexport type DefaultValues = Record<string, unknown>[] | Record<string, unknown>;\nexport type ThreadValuesFilter = Record<string, unknown>;\nexport interface ThreadState<ValuesType = DefaultValues> {\n /** The state values */\n values: ValuesType;\n /** The next nodes to execute. If empty, the thread is done until new input is received */\n next: string[];\n /** Checkpoint of the thread state */\n checkpoint: Checkpoint;\n /** Metadata for this state */\n metadata: Metadata;\n /** Time of state creation */\n created_at: Optional<string>;\n /** The parent checkpoint. If missing, this is the root checkpoint */\n parent_checkpoint: Optional<Checkpoint>;\n /** Tasks to execute in this step. If already attempted, may contain an error */\n tasks: Array<ThreadTask>;\n}\nexport interface ThreadTask<ValuesType = DefaultValues, TInterruptValue = unknown> {\n id: string;\n name: string;\n result?: unknown;\n error: Optional<string>;\n interrupts: Array<Interrupt<TInterruptValue>>;\n checkpoint: Optional<Checkpoint>;\n state: Optional<ThreadState<ValuesType>>;\n}\nexport interface Run {\n /** The ID of the run */\n run_id: string;\n /** The ID of the thread */\n thread_id: string;\n /** The assistant that wwas used for this run */\n assistant_id: string;\n /** The time the run was created */\n created_at: string;\n /** The last time the run was updated */\n updated_at: string;\n /** The status of the run. */\n status: RunStatus;\n /** Run metadata */\n metadata: Metadata;\n /** Strategy to handle concurrent runs on the same thread */\n multitask_strategy: Optional<MultitaskStrategy>;\n}\nexport type Checkpoint = {\n thread_id: string;\n checkpoint_ns: string;\n checkpoint_id: Optional<string>;\n checkpoint_map: Optional<Record<string, unknown>>;\n};\nexport interface ListNamespaceResponse {\n namespaces: string[][];\n}\nexport interface Item {\n namespace: string[];\n key: string;\n value: Record<string, any>;\n createdAt: string;\n updatedAt: string;\n}\nexport interface SearchItem extends Item {\n score?: number;\n}\nexport interface SearchItemsResponse {\n items: SearchItem[];\n}\nexport interface CronCreateResponse {\n cron_id: string;\n assistant_id: string;\n thread_id: string | undefined;\n user_id: string;\n payload: Record<string, unknown>;\n schedule: string;\n next_run_date: string;\n end_time: string | undefined;\n created_at: string;\n updated_at: string;\n metadata: Metadata;\n}\nexport interface CronCreateForThreadResponse extends Omit<CronCreateResponse, \"thread_id\"> {\n thread_id: string;\n}\nexport type AssistantSortBy = \"assistant_id\" | \"graph_id\" | \"name\" | \"created_at\" | \"updated_at\";\nexport type ThreadSortBy = \"thread_id\" | \"status\" | \"created_at\" | \"updated_at\";\nexport type CronSortBy = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"created_at\" | \"updated_at\" | \"next_run_date\";\nexport type SortOrder = \"asc\" | \"desc\";\nexport type AssistantSelectField = \"assistant_id\" | \"graph_id\" | \"name\" | \"description\" | \"config\" | \"context\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"version\";\nexport type ThreadSelectField = \"thread_id\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"config\" | \"context\" | \"status\" | \"values\" | \"interrupts\";\nexport type RunSelectField = \"run_id\" | \"thread_id\" | \"assistant_id\" | \"created_at\" | \"updated_at\" | \"status\" | \"metadata\" | \"kwargs\" | \"multitask_strategy\";\nexport type CronSelectField = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"end_time\" | \"schedule\" | \"created_at\" | \"updated_at\" | \"user_id\" | \"payload\" | \"next_run_date\" | \"metadata\" | \"now\";\nexport {};\n"],"mappings":";;;KACKC,cAAcC;KACPC,SAAAA;AADPF,KAEOG,YAAAA,GAFOF,MAAC,GAAA,MAAA,GAAA,aAAA,GAAA,OAAA;AACpB,KAEKG,iBAAAA,GAFgB,QAAA,GAAA,WAAA,GAAA,UAAA,GAAA,SAAA;AACTD,KAEAE,YAAAA,GAFY,WAAA,GAAA,UAAA;AACnBD,KAEOE,MAAAA,GAFPF;EACOC;AACZ;;;MAsBwBL,CAAAA,EAAAA,MAAAA,EAAAA;EAAQ;AAIhC;;;iBAcoBD,CAAAA,EAAAA,MAAAA;;;;EAeY,YAAA,CAAA,EAAA;IAEpBS;;;IAAYC,SAAAA,CAAAA,EAvCJT,QAuCIS,CAAAA,MAAAA,CAAAA;IAAM;AAC9B;;IAGaA,aAAAA,CAAAA,EAvCWT,QAuCXS,CAAAA,MAAAA,CAAAA;IACCA,CAAA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A;KAC5Ce,kBAAAA,GAAqBf;UAChBgB,yBAAyBL;;UAE9BC;;;;cAIIK;;YAEFhB;;cAEEV;;qBAEOA,SAAS0B;;SAErBV,MAAMW;;UAEAA,wBAAwBP;;;;SAI9BpB;cACKgB,MAAMC,UAAUK;cAChBtB,SAAS0B;SACd1B,SAASyB,YAAYJ;;UAEfO,GAAAA;;;;;;;;;;;;UAYL1B;;YAEEQ;;sBAEUV,SAASI;;KAErBsB,UAAAA;;;iBAGO1B;kBACCA,SAASS;;UAEZoB,qBAAAA;;;UAGAC,IAAAA;;;SAGNrB;;;;UAIMsB,UAAAA,SAAmBD;;;UAGnBE,mBAAAA;SACND;;UAEME,kBAAAA;;;;;WAKJxB;;;;;;YAMCC;;UAEGwB,2BAAAA,SAAoCC,KAAKF;;;KAG9CG,eAAAA;KACAC,YAAAA;KACAC,UAAAA;KACAC,SAAAA;KACAC,oBAAAA;KACAC,iBAAAA;KACAC,cAAAA;KACAC,eAAAA"}
|
package/dist/schema.d.ts
CHANGED
|
@@ -175,7 +175,7 @@ interface Cron {
|
|
|
175
175
|
on_run_completed?: "delete" | "keep";
|
|
176
176
|
/** The end date to stop running the cron. */
|
|
177
177
|
end_time: Optional<string>;
|
|
178
|
-
/** The schedule to run, cron format. */
|
|
178
|
+
/** The schedule to run, cron format. Schedules are interpreted in UTC. */
|
|
179
179
|
schedule: string;
|
|
180
180
|
/** The time the cron was created. */
|
|
181
181
|
created_at: string;
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","names":["JSONSchema7","Optional","T","RunStatus","ThreadStatus","MultitaskStrategy","CancelAction","Config","GraphSchema","Subgraphs","Record","Metadata","AssistantBase","AssistantVersion","Assistant","AssistantsSearchResponse","AssistantGraph","Array","Interrupt","TValue","Thread","DefaultValues","ValuesType","TInterruptValue","Cron","ThreadValuesFilter","ThreadState","Checkpoint","ThreadTask","Run","ListNamespaceResponse","Item","SearchItem","SearchItemsResponse","CronCreateResponse","CronCreateForThreadResponse","Omit","AssistantSortBy","ThreadSortBy","CronSortBy","SortOrder","AssistantSelectField","ThreadSelectField","RunSelectField","CronSelectField"],"sources":["../src/schema.d.ts"],"sourcesContent":["import type { JSONSchema7 } from \"json-schema\";\ntype Optional<T> = T | null | undefined;\nexport type RunStatus = \"pending\" | \"running\" | \"error\" | \"success\" | \"timeout\" | \"interrupted\";\nexport type ThreadStatus = \"idle\" | \"busy\" | \"interrupted\" | \"error\";\ntype MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type CancelAction = \"interrupt\" | \"rollback\";\nexport type Config = {\n /**\n * Tags for this call and any sub-calls (eg. a Chain calling an LLM).\n * You can use these to filter calls.\n */\n tags?: string[];\n /**\n * Maximum number of times a call can recurse.\n * If not provided, defaults to 25.\n */\n recursion_limit?: number;\n /**\n * Runtime values for attributes previously made configurable on this Runnable.\n */\n configurable?: {\n /**\n * ID of the thread\n */\n thread_id?: Optional<string>;\n /**\n * Timestamp of the state checkpoint\n */\n checkpoint_id?: Optional<string>;\n [key: string]: unknown;\n };\n};\nexport interface GraphSchema {\n /**\n * The ID of the graph.\n */\n graph_id: string;\n /**\n * The schema for the input state.\n * Missing if unable to generate JSON schema from graph.\n */\n input_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the output state.\n * Missing if unable to generate JSON schema from graph.\n */\n output_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph state.\n * Missing if unable to generate JSON schema from graph.\n */\n state_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph config.\n * Missing if unable to generate JSON schema from graph.\n */\n config_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph context.\n * Missing if unable to generate JSON schema from graph.\n */\n context_schema?: JSONSchema7 | null | undefined;\n}\nexport type Subgraphs = Record<string, GraphSchema>;\nexport type Metadata = Optional<{\n source?: \"input\" | \"loop\" | \"update\" | (string & {});\n step?: number;\n writes?: Record<string, unknown> | null;\n parents?: Record<string, string>;\n [key: string]: unknown;\n}>;\nexport interface AssistantBase {\n /** The ID of the assistant. */\n assistant_id: string;\n /** The ID of the graph. */\n graph_id: string;\n /** The assistant config. */\n config: Config;\n /** The assistant context. */\n context: unknown;\n /** The time the assistant was created. */\n created_at: string;\n /** The assistant metadata. */\n metadata: Metadata;\n /** The version of the assistant. */\n version: number;\n /** The name of the assistant */\n name: string;\n /** The description of the assistant */\n description?: string;\n}\nexport interface AssistantVersion extends AssistantBase {\n}\nexport interface Assistant extends AssistantBase {\n /** The last time the assistant was updated. */\n updated_at: string;\n}\nexport interface AssistantsSearchResponse {\n /** The assistants returned for the current search page. */\n assistants: Assistant[];\n /** Pagination cursor from the X-Pagination-Next response header. */\n next: string | null;\n}\nexport interface AssistantGraph {\n nodes: Array<{\n id: string | number;\n name?: string;\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>;\n edges: Array<{\n source: string;\n target: string;\n data?: string;\n conditional?: boolean;\n }>;\n}\n/**\n * An interrupt thrown inside a thread.\n */\nexport interface Interrupt<TValue = unknown> {\n /**\n * The ID of the interrupt.\n */\n id?: string;\n /**\n * The value of the interrupt.\n */\n value?: TValue;\n /**\n * Will be deprecated in the future.\n * @deprecated Will be removed in the future.\n */\n when?: \"during\" | (string & {});\n /**\n * Whether the interrupt can be resumed.\n * @deprecated Will be removed in the future.\n */\n resumable?: boolean;\n /**\n * The namespace of the interrupt.\n * @deprecated Replaced by `interrupt_id`\n */\n ns?: string[];\n}\nexport interface Thread<ValuesType = DefaultValues, TInterruptValue = unknown> {\n /** The ID of the thread. */\n thread_id: string;\n /** The time the thread was created. */\n created_at: string;\n /** The last time the thread was updated. */\n updated_at: string;\n /** The thread metadata. */\n metadata: Metadata;\n /** The status of the thread */\n status: ThreadStatus;\n /** The current state of the thread. */\n values: ValuesType;\n /** Interrupts which were thrown in this thread */\n interrupts: Record<string, Array<Interrupt<TInterruptValue>>>;\n /** The config for the thread */\n config?: Config;\n /** The error for the thread (if status == \"error\") */\n error?: Optional<string | Record<string, unknown>>;\n}\nexport interface Cron {\n /** The ID of the cron */\n cron_id: string;\n /** The ID of the assistant */\n assistant_id: string;\n /** The ID of the thread */\n thread_id: Optional<string>;\n /** What to do with the thread after the run completes. Only applicable for stateless crons. */\n on_run_completed?: \"delete\" | \"keep\";\n /** The end date to stop running the cron. */\n end_time: Optional<string>;\n /** The schedule to run, cron format. */\n schedule: string;\n /** The time the cron was created. */\n created_at: string;\n /** The last time the cron was updated. */\n updated_at: string;\n /** The run payload to use for creating new run. */\n payload: Record<string, unknown>;\n /** The user ID of the cron */\n user_id: Optional<string>;\n /** The next run date of the cron */\n next_run_date: Optional<string>;\n /** The metadata of the cron */\n metadata: Record<string, unknown>;\n}\nexport type DefaultValues = Record<string, unknown>[] | Record<string, unknown>;\nexport type ThreadValuesFilter = Record<string, unknown>;\nexport interface ThreadState<ValuesType = DefaultValues> {\n /** The state values */\n values: ValuesType;\n /** The next nodes to execute. If empty, the thread is done until new input is received */\n next: string[];\n /** Checkpoint of the thread state */\n checkpoint: Checkpoint;\n /** Metadata for this state */\n metadata: Metadata;\n /** Time of state creation */\n created_at: Optional<string>;\n /** The parent checkpoint. If missing, this is the root checkpoint */\n parent_checkpoint: Optional<Checkpoint>;\n /** Tasks to execute in this step. If already attempted, may contain an error */\n tasks: Array<ThreadTask>;\n}\nexport interface ThreadTask<ValuesType = DefaultValues, TInterruptValue = unknown> {\n id: string;\n name: string;\n result?: unknown;\n error: Optional<string>;\n interrupts: Array<Interrupt<TInterruptValue>>;\n checkpoint: Optional<Checkpoint>;\n state: Optional<ThreadState<ValuesType>>;\n}\nexport interface Run {\n /** The ID of the run */\n run_id: string;\n /** The ID of the thread */\n thread_id: string;\n /** The assistant that wwas used for this run */\n assistant_id: string;\n /** The time the run was created */\n created_at: string;\n /** The last time the run was updated */\n updated_at: string;\n /** The status of the run. */\n status: RunStatus;\n /** Run metadata */\n metadata: Metadata;\n /** Strategy to handle concurrent runs on the same thread */\n multitask_strategy: Optional<MultitaskStrategy>;\n}\nexport type Checkpoint = {\n thread_id: string;\n checkpoint_ns: string;\n checkpoint_id: Optional<string>;\n checkpoint_map: Optional<Record<string, unknown>>;\n};\nexport interface ListNamespaceResponse {\n namespaces: string[][];\n}\nexport interface Item {\n namespace: string[];\n key: string;\n value: Record<string, any>;\n createdAt: string;\n updatedAt: string;\n}\nexport interface SearchItem extends Item {\n score?: number;\n}\nexport interface SearchItemsResponse {\n items: SearchItem[];\n}\nexport interface CronCreateResponse {\n cron_id: string;\n assistant_id: string;\n thread_id: string | undefined;\n user_id: string;\n payload: Record<string, unknown>;\n schedule: string;\n next_run_date: string;\n end_time: string | undefined;\n created_at: string;\n updated_at: string;\n metadata: Metadata;\n}\nexport interface CronCreateForThreadResponse extends Omit<CronCreateResponse, \"thread_id\"> {\n thread_id: string;\n}\nexport type AssistantSortBy = \"assistant_id\" | \"graph_id\" | \"name\" | \"created_at\" | \"updated_at\";\nexport type ThreadSortBy = \"thread_id\" | \"status\" | \"created_at\" | \"updated_at\";\nexport type CronSortBy = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"created_at\" | \"updated_at\" | \"next_run_date\";\nexport type SortOrder = \"asc\" | \"desc\";\nexport type AssistantSelectField = \"assistant_id\" | \"graph_id\" | \"name\" | \"description\" | \"config\" | \"context\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"version\";\nexport type ThreadSelectField = \"thread_id\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"config\" | \"context\" | \"status\" | \"values\" | \"interrupts\";\nexport type RunSelectField = \"run_id\" | \"thread_id\" | \"assistant_id\" | \"created_at\" | \"updated_at\" | \"status\" | \"metadata\" | \"kwargs\" | \"multitask_strategy\";\nexport type CronSelectField = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"end_time\" | \"schedule\" | \"created_at\" | \"updated_at\" | \"user_id\" | \"payload\" | \"next_run_date\" | \"metadata\" | \"now\";\nexport {};\n"],"mappings":";;;KACKC,cAAcC;KAC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;AAGA;;AAKarB,UA/IIQ,SA+IJR,CAAAA,SAAAA,OAAAA,CAAAA,CAAAA;;;AAQb;EAA4C,EAAA,CAAA,EAAA,MAAA;;;;EAGhC2B,KAAAA,CAAAA,EAlJAlB,MAkJAkB;EACAC;AACZ;AACA;AACA;EACYI,IAAAA,CAAAA,EAAAA,QAAAA,GAAAA,CAAAA,MAAiB,GAAA,CAAA,CAAA,CAAA;EACjBC;AACZ;;;;;;;;;;UAxIiBvB,oBAAoBC;;;;;;;;YAQvBV;;UAEFP;;UAEAkB;;cAEIZ,eAAeO,MAAMC,UAAUK;;WAElChB;;UAEDN,kBAAkBS;;UAEbc,IAAAA;;;;;;aAMFvB;;;;YAIDA;;;;;;;;WAQDS;;WAEAT;;iBAEMA;;YAELS;;KAEFW,aAAAA,GAAgBX,4BAA4BA;KAC5Ce,kBAAAA,GAAqBf;UAChBgB,yBAAyBL;;UAE9BC;;;;cAIIK;;YAEFhB;;cAEEV;;qBAEOA,SAAS0B;;SAErBV,MAAMW;;UAEAA,wBAAwBP;;;;SAI9BpB;cACKgB,MAAMC,UAAUK;cAChBtB,SAAS0B;SACd1B,SAASyB,YAAYJ;;UAEfO,GAAAA;;;;;;;;;;;;UAYL1B;;YAEEQ;;sBAEUV,SAASI;;KAErBsB,UAAAA;;;iBAGO1B;kBACCA,SAASS;;UAEZoB,qBAAAA;;;UAGAC,IAAAA;;;SAGNrB;;;;UAIMsB,UAAAA,SAAmBD;;;UAGnBE,mBAAAA;SACND;;UAEME,kBAAAA;;;;;WAKJxB;;;;;;YAMCC;;UAEGwB,2BAAAA,SAAoCC,KAAKF;;;KAG9CG,eAAAA;KACAC,YAAAA;KACAC,UAAAA;KACAC,SAAAA;KACAC,oBAAAA;KACAC,iBAAAA;KACAC,cAAAA;KACAC,eAAAA"}
|
|
1
|
+
{"version":3,"file":"schema.d.ts","names":["JSONSchema7","Optional","T","RunStatus","ThreadStatus","MultitaskStrategy","CancelAction","Config","GraphSchema","Subgraphs","Record","Metadata","AssistantBase","AssistantVersion","Assistant","AssistantsSearchResponse","AssistantGraph","Array","Interrupt","TValue","Thread","DefaultValues","ValuesType","TInterruptValue","Cron","ThreadValuesFilter","ThreadState","Checkpoint","ThreadTask","Run","ListNamespaceResponse","Item","SearchItem","SearchItemsResponse","CronCreateResponse","CronCreateForThreadResponse","Omit","AssistantSortBy","ThreadSortBy","CronSortBy","SortOrder","AssistantSelectField","ThreadSelectField","RunSelectField","CronSelectField"],"sources":["../src/schema.d.ts"],"sourcesContent":["import type { JSONSchema7 } from \"json-schema\";\ntype Optional<T> = T | null | undefined;\nexport type RunStatus = \"pending\" | \"running\" | \"error\" | \"success\" | \"timeout\" | \"interrupted\";\nexport type ThreadStatus = \"idle\" | \"busy\" | \"interrupted\" | \"error\";\ntype MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type CancelAction = \"interrupt\" | \"rollback\";\nexport type Config = {\n /**\n * Tags for this call and any sub-calls (eg. a Chain calling an LLM).\n * You can use these to filter calls.\n */\n tags?: string[];\n /**\n * Maximum number of times a call can recurse.\n * If not provided, defaults to 25.\n */\n recursion_limit?: number;\n /**\n * Runtime values for attributes previously made configurable on this Runnable.\n */\n configurable?: {\n /**\n * ID of the thread\n */\n thread_id?: Optional<string>;\n /**\n * Timestamp of the state checkpoint\n */\n checkpoint_id?: Optional<string>;\n [key: string]: unknown;\n };\n};\nexport interface GraphSchema {\n /**\n * The ID of the graph.\n */\n graph_id: string;\n /**\n * The schema for the input state.\n * Missing if unable to generate JSON schema from graph.\n */\n input_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the output state.\n * Missing if unable to generate JSON schema from graph.\n */\n output_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph state.\n * Missing if unable to generate JSON schema from graph.\n */\n state_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph config.\n * Missing if unable to generate JSON schema from graph.\n */\n config_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph context.\n * Missing if unable to generate JSON schema from graph.\n */\n context_schema?: JSONSchema7 | null | undefined;\n}\nexport type Subgraphs = Record<string, GraphSchema>;\nexport type Metadata = Optional<{\n source?: \"input\" | \"loop\" | \"update\" | (string & {});\n step?: number;\n writes?: Record<string, unknown> | null;\n parents?: Record<string, string>;\n [key: string]: unknown;\n}>;\nexport interface AssistantBase {\n /** The ID of the assistant. */\n assistant_id: string;\n /** The ID of the graph. */\n graph_id: string;\n /** The assistant config. */\n config: Config;\n /** The assistant context. */\n context: unknown;\n /** The time the assistant was created. */\n created_at: string;\n /** The assistant metadata. */\n metadata: Metadata;\n /** The version of the assistant. */\n version: number;\n /** The name of the assistant */\n name: string;\n /** The description of the assistant */\n description?: string;\n}\nexport interface AssistantVersion extends AssistantBase {\n}\nexport interface Assistant extends AssistantBase {\n /** The last time the assistant was updated. */\n updated_at: string;\n}\nexport interface AssistantsSearchResponse {\n /** The assistants returned for the current search page. */\n assistants: Assistant[];\n /** Pagination cursor from the X-Pagination-Next response header. */\n next: string | null;\n}\nexport interface AssistantGraph {\n nodes: Array<{\n id: string | number;\n name?: string;\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>;\n edges: Array<{\n source: string;\n target: string;\n data?: string;\n conditional?: boolean;\n }>;\n}\n/**\n * An interrupt thrown inside a thread.\n */\nexport interface Interrupt<TValue = unknown> {\n /**\n * The ID of the interrupt.\n */\n id?: string;\n /**\n * The value of the interrupt.\n */\n value?: TValue;\n /**\n * Will be deprecated in the future.\n * @deprecated Will be removed in the future.\n */\n when?: \"during\" | (string & {});\n /**\n * Whether the interrupt can be resumed.\n * @deprecated Will be removed in the future.\n */\n resumable?: boolean;\n /**\n * The namespace of the interrupt.\n * @deprecated Replaced by `interrupt_id`\n */\n ns?: string[];\n}\nexport interface Thread<ValuesType = DefaultValues, TInterruptValue = unknown> {\n /** The ID of the thread. */\n thread_id: string;\n /** The time the thread was created. */\n created_at: string;\n /** The last time the thread was updated. */\n updated_at: string;\n /** The thread metadata. */\n metadata: Metadata;\n /** The status of the thread */\n status: ThreadStatus;\n /** The current state of the thread. */\n values: ValuesType;\n /** Interrupts which were thrown in this thread */\n interrupts: Record<string, Array<Interrupt<TInterruptValue>>>;\n /** The config for the thread */\n config?: Config;\n /** The error for the thread (if status == \"error\") */\n error?: Optional<string | Record<string, unknown>>;\n}\nexport interface Cron {\n /** The ID of the cron */\n cron_id: string;\n /** The ID of the assistant */\n assistant_id: string;\n /** The ID of the thread */\n thread_id: Optional<string>;\n /** What to do with the thread after the run completes. Only applicable for stateless crons. */\n on_run_completed?: \"delete\" | \"keep\";\n /** The end date to stop running the cron. */\n end_time: Optional<string>;\n /** The schedule to run, cron format. Schedules are interpreted in UTC. */\n schedule: string;\n /** The time the cron was created. */\n created_at: string;\n /** The last time the cron was updated. */\n updated_at: string;\n /** The run payload to use for creating new run. */\n payload: Record<string, unknown>;\n /** The user ID of the cron */\n user_id: Optional<string>;\n /** The next run date of the cron */\n next_run_date: Optional<string>;\n /** The metadata of the cron */\n metadata: Record<string, unknown>;\n}\nexport type DefaultValues = Record<string, unknown>[] | Record<string, unknown>;\nexport type ThreadValuesFilter = Record<string, unknown>;\nexport interface ThreadState<ValuesType = DefaultValues> {\n /** The state values */\n values: ValuesType;\n /** The next nodes to execute. If empty, the thread is done until new input is received */\n next: string[];\n /** Checkpoint of the thread state */\n checkpoint: Checkpoint;\n /** Metadata for this state */\n metadata: Metadata;\n /** Time of state creation */\n created_at: Optional<string>;\n /** The parent checkpoint. If missing, this is the root checkpoint */\n parent_checkpoint: Optional<Checkpoint>;\n /** Tasks to execute in this step. If already attempted, may contain an error */\n tasks: Array<ThreadTask>;\n}\nexport interface ThreadTask<ValuesType = DefaultValues, TInterruptValue = unknown> {\n id: string;\n name: string;\n result?: unknown;\n error: Optional<string>;\n interrupts: Array<Interrupt<TInterruptValue>>;\n checkpoint: Optional<Checkpoint>;\n state: Optional<ThreadState<ValuesType>>;\n}\nexport interface Run {\n /** The ID of the run */\n run_id: string;\n /** The ID of the thread */\n thread_id: string;\n /** The assistant that wwas used for this run */\n assistant_id: string;\n /** The time the run was created */\n created_at: string;\n /** The last time the run was updated */\n updated_at: string;\n /** The status of the run. */\n status: RunStatus;\n /** Run metadata */\n metadata: Metadata;\n /** Strategy to handle concurrent runs on the same thread */\n multitask_strategy: Optional<MultitaskStrategy>;\n}\nexport type Checkpoint = {\n thread_id: string;\n checkpoint_ns: string;\n checkpoint_id: Optional<string>;\n checkpoint_map: Optional<Record<string, unknown>>;\n};\nexport interface ListNamespaceResponse {\n namespaces: string[][];\n}\nexport interface Item {\n namespace: string[];\n key: string;\n value: Record<string, any>;\n createdAt: string;\n updatedAt: string;\n}\nexport interface SearchItem extends Item {\n score?: number;\n}\nexport interface SearchItemsResponse {\n items: SearchItem[];\n}\nexport interface CronCreateResponse {\n cron_id: string;\n assistant_id: string;\n thread_id: string | undefined;\n user_id: string;\n payload: Record<string, unknown>;\n schedule: string;\n next_run_date: string;\n end_time: string | undefined;\n created_at: string;\n updated_at: string;\n metadata: Metadata;\n}\nexport interface CronCreateForThreadResponse extends Omit<CronCreateResponse, \"thread_id\"> {\n thread_id: string;\n}\nexport type AssistantSortBy = \"assistant_id\" | \"graph_id\" | \"name\" | \"created_at\" | \"updated_at\";\nexport type ThreadSortBy = \"thread_id\" | \"status\" | \"created_at\" | \"updated_at\";\nexport type CronSortBy = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"created_at\" | \"updated_at\" | \"next_run_date\";\nexport type SortOrder = \"asc\" | \"desc\";\nexport type AssistantSelectField = \"assistant_id\" | \"graph_id\" | \"name\" | \"description\" | \"config\" | \"context\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"version\";\nexport type ThreadSelectField = \"thread_id\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"config\" | \"context\" | \"status\" | \"values\" | \"interrupts\";\nexport type RunSelectField = \"run_id\" | \"thread_id\" | \"assistant_id\" | \"created_at\" | \"updated_at\" | \"status\" | \"metadata\" | \"kwargs\" | \"multitask_strategy\";\nexport type CronSelectField = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"end_time\" | \"schedule\" | \"created_at\" | \"updated_at\" | \"user_id\" | \"payload\" | \"next_run_date\" | \"metadata\" | \"now\";\nexport {};\n"],"mappings":";;;KACKC,cAAcC;KACPC,SAAAA;AADPF,KAEOG,YAAAA,GAFOF,MAAC,GAAA,MAAA,GAAA,aAAA,GAAA,OAAA;AACpB,KAEKG,iBAAAA,GAFgB,QAAA,GAAA,WAAA,GAAA,UAAA,GAAA,SAAA;AACTD,KAEAE,YAAAA,GAFY,WAAA,GAAA,UAAA;AACnBD,KAEOE,MAAAA,GAFPF;EACOC;AACZ;;;MAsBwBL,CAAAA,EAAAA,MAAAA,EAAAA;EAAQ;AAIhC;;;iBAcoBD,CAAAA,EAAAA,MAAAA;;;;EAeY,YAAA,CAAA,EAAA;IAEpBS;;;IAAYC,SAAAA,CAAAA,EAvCJT,QAuCIS,CAAAA,MAAAA,CAAAA;IAAM;AAC9B;;IAGaA,aAAAA,CAAAA,EAvCWT,QAuCXS,CAAAA,MAAAA,CAAAA;IACCA,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;CAJiB;AAOdE,UAvCAJ,WAAAA,CAuCa;EAAA;;;EAYR,QAAA,EAAA,MAAA;EAQLK;AAEjB;AAIA;AAMA;EAA+B,YAAA,CAAA,EA9DZb,WA8DY,GAAA,IAAA,GAAA,SAAA;;;;;EAiBdkB,aAAS,CAAA,EA1ENlB,WAkFRmB,GAAM,IAAA,GAAA,SAAA;EAiBDC;;;;cAULhB,CAAAA,EAxGOJ,WAwGPI,GAAAA,IAAAA,GAAAA,SAAAA;;;;;eAIIM,CAAAA,EAvGIV,WAuGJU,GAAAA,IAAAA,GAAAA,SAAAA;;;;;EAMCc,cAAI,CAAA,EAxGAxB,WAwGA,GAAA,IAAA,GAAA,SAAA;;AAMNC,KA5GHQ,SAAAA,GAAYC,MA4GTT,CAAAA,MAAAA,EA5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AC,SAAAA;KACAC,oBAAAA;KACAC,iBAAAA;KACAC,cAAAA;KACAC,eAAAA"}
|
package/dist/types.d.cts
CHANGED
|
@@ -172,7 +172,7 @@ interface RunsCreatePayload extends RunsInvokePayload {
|
|
|
172
172
|
}
|
|
173
173
|
interface CronsCreatePayload extends RunsCreatePayload {
|
|
174
174
|
/**
|
|
175
|
-
* Schedule for running the Cron Job
|
|
175
|
+
* Schedule for running the Cron Job. Schedules are interpreted in UTC.
|
|
176
176
|
*/
|
|
177
177
|
schedule: string;
|
|
178
178
|
/**
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":["LangChainTracer","Checkpoint","Config","Metadata","StreamMode","MultitaskStrategy","OnConflictBehavior","OnCompletionBehavior","DisconnectMode","Durability","StreamEvent","Send","Command","Record","RunsInvokePayload","Omit","AbortController","RunsStreamPayload","TStreamMode","TSubgraphs","RunsCreatePayload","Array","CronsCreatePayload","RunsWaitPayload"],"sources":["../src/types.d.ts"],"sourcesContent":["import { LangChainTracer } from \"@langchain/core/tracers/tracer_langchain\";\nimport { Checkpoint, Config, Metadata } from \"./schema.js\";\nimport { StreamMode } from \"./types.stream.js\";\nexport type MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type OnConflictBehavior = \"raise\" | \"do_nothing\";\nexport type OnCompletionBehavior = \"complete\" | \"continue\";\nexport type DisconnectMode = \"cancel\" | \"continue\";\nexport type Durability = \"exit\" | \"async\" | \"sync\";\nexport type StreamEvent = \"events\" | \"metadata\" | \"debug\" | \"updates\" | \"values\" | \"messages/partial\" | \"messages/metadata\" | \"messages/complete\" | \"messages\" | (string & {});\nexport interface Send {\n node: string;\n input: unknown | null;\n}\nexport interface Command {\n /**\n * An object to update the thread state with.\n */\n update?: Record<string, unknown> | [string, unknown][] | null;\n /**\n * The value to return from an `interrupt` function call.\n */\n resume?: unknown;\n /**\n * Determine the next node to navigate to. Can be one of the following:\n * - Name(s) of the node names to navigate to next.\n * - `Send` command(s) to execute node(s) with provided input.\n */\n goto?: Send | Send[] | string | string[];\n}\nexport interface RunsInvokePayload {\n /**\n * Input to the run. Pass `null` to resume from the current state of the thread.\n */\n input?: Record<string, unknown> | null;\n /**\n * Metadata for the run.\n */\n metadata?: Metadata;\n /**\n * Additional configuration for the run.\n */\n config?: Config;\n /**\n * Static context to add to the assistant.\n * @remarks Added in LangGraph.js 0.4\n */\n context?: unknown;\n /**\n * Checkpoint ID for when creating a new run.\n */\n checkpointId?: string;\n /**\n * Checkpoint for when creating a new run.\n */\n checkpoint?: Omit<Checkpoint, \"thread_id\">;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * @deprecated Use `durability` instead.\n */\n checkpointDuring?: boolean;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * - `\"async\"`: Save checkpoint asynchronously while the next step executes (default).\n * - `\"sync\"`: Save checkpoint synchronously before the next step starts.\n * - `\"exit\"`: Save checkpoint only when the graph exits.\n * @default \"async\"\n */\n durability?: Durability;\n /**\n * Interrupt execution before entering these nodes.\n */\n interruptBefore?: \"*\" | string[];\n /**\n * Interrupt execution after leaving these nodes.\n */\n interruptAfter?: \"*\" | string[];\n /**\n * Strategy to handle concurrent runs on the same thread. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"reject\": Reject the new run.\n * - \"interrupt\": Interrupt the current run, keeping steps completed until now,\n and start a new one.\n * - \"rollback\": Cancel and delete the existing run, rolling back the thread to\n the state before it had started, then start the new run.\n * - \"enqueue\": Queue up the new run to start after the current run finishes.\n */\n multitaskStrategy?: MultitaskStrategy;\n /**\n * Abort controller signal to cancel the run.\n */\n signal?: AbortController[\"signal\"];\n /**\n * Behavior to handle run completion. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"complete\": Complete the run.\n * - \"continue\": Continue the run.\n */\n onCompletion?: OnCompletionBehavior;\n /**\n * Webhook to call when the run is complete.\n */\n webhook?: string;\n /**\n * Behavior to handle disconnection. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"cancel\": Cancel the run.\n * - \"continue\": Continue the run.\n */\n onDisconnect?: DisconnectMode;\n /**\n * The number of seconds to wait before starting the run.\n * Use to schedule future runs.\n */\n afterSeconds?: number;\n /**\n * Behavior if the specified run doesn't exist. Defaults to \"reject\".\n */\n ifNotExists?: \"create\" | \"reject\";\n /**\n * One or more commands to invoke the graph with.\n */\n command?: Command;\n /**\n * Callback when a run is created.\n */\n onRunCreated?: (params: {\n run_id: string;\n thread_id?: string;\n }) => void;\n /**\n * @internal\n * For LangSmith tracing purposes only. Not part of the public API.\n */\n _langsmithTracer?: LangChainTracer;\n}\nexport interface RunsStreamPayload<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false> extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: TStreamMode;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: TSubgraphs;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n /**\n * Pass one or more feedbackKeys if you want to request short-lived signed URLs\n * for submitting feedback to LangSmith with this key for this run.\n */\n feedbackKeys?: string[];\n}\nexport interface RunsCreatePayload extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: StreamMode | Array<StreamMode>;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: boolean;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n}\nexport interface CronsCreatePayload extends RunsCreatePayload {\n /**\n * Schedule for running the Cron Job
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":["LangChainTracer","Checkpoint","Config","Metadata","StreamMode","MultitaskStrategy","OnConflictBehavior","OnCompletionBehavior","DisconnectMode","Durability","StreamEvent","Send","Command","Record","RunsInvokePayload","Omit","AbortController","RunsStreamPayload","TStreamMode","TSubgraphs","RunsCreatePayload","Array","CronsCreatePayload","RunsWaitPayload"],"sources":["../src/types.d.ts"],"sourcesContent":["import { LangChainTracer } from \"@langchain/core/tracers/tracer_langchain\";\nimport { Checkpoint, Config, Metadata } from \"./schema.js\";\nimport { StreamMode } from \"./types.stream.js\";\nexport type MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type OnConflictBehavior = \"raise\" | \"do_nothing\";\nexport type OnCompletionBehavior = \"complete\" | \"continue\";\nexport type DisconnectMode = \"cancel\" | \"continue\";\nexport type Durability = \"exit\" | \"async\" | \"sync\";\nexport type StreamEvent = \"events\" | \"metadata\" | \"debug\" | \"updates\" | \"values\" | \"messages/partial\" | \"messages/metadata\" | \"messages/complete\" | \"messages\" | (string & {});\nexport interface Send {\n node: string;\n input: unknown | null;\n}\nexport interface Command {\n /**\n * An object to update the thread state with.\n */\n update?: Record<string, unknown> | [string, unknown][] | null;\n /**\n * The value to return from an `interrupt` function call.\n */\n resume?: unknown;\n /**\n * Determine the next node to navigate to. Can be one of the following:\n * - Name(s) of the node names to navigate to next.\n * - `Send` command(s) to execute node(s) with provided input.\n */\n goto?: Send | Send[] | string | string[];\n}\nexport interface RunsInvokePayload {\n /**\n * Input to the run. Pass `null` to resume from the current state of the thread.\n */\n input?: Record<string, unknown> | null;\n /**\n * Metadata for the run.\n */\n metadata?: Metadata;\n /**\n * Additional configuration for the run.\n */\n config?: Config;\n /**\n * Static context to add to the assistant.\n * @remarks Added in LangGraph.js 0.4\n */\n context?: unknown;\n /**\n * Checkpoint ID for when creating a new run.\n */\n checkpointId?: string;\n /**\n * Checkpoint for when creating a new run.\n */\n checkpoint?: Omit<Checkpoint, \"thread_id\">;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * @deprecated Use `durability` instead.\n */\n checkpointDuring?: boolean;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * - `\"async\"`: Save checkpoint asynchronously while the next step executes (default).\n * - `\"sync\"`: Save checkpoint synchronously before the next step starts.\n * - `\"exit\"`: Save checkpoint only when the graph exits.\n * @default \"async\"\n */\n durability?: Durability;\n /**\n * Interrupt execution before entering these nodes.\n */\n interruptBefore?: \"*\" | string[];\n /**\n * Interrupt execution after leaving these nodes.\n */\n interruptAfter?: \"*\" | string[];\n /**\n * Strategy to handle concurrent runs on the same thread. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"reject\": Reject the new run.\n * - \"interrupt\": Interrupt the current run, keeping steps completed until now,\n and start a new one.\n * - \"rollback\": Cancel and delete the existing run, rolling back the thread to\n the state before it had started, then start the new run.\n * - \"enqueue\": Queue up the new run to start after the current run finishes.\n */\n multitaskStrategy?: MultitaskStrategy;\n /**\n * Abort controller signal to cancel the run.\n */\n signal?: AbortController[\"signal\"];\n /**\n * Behavior to handle run completion. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"complete\": Complete the run.\n * - \"continue\": Continue the run.\n */\n onCompletion?: OnCompletionBehavior;\n /**\n * Webhook to call when the run is complete.\n */\n webhook?: string;\n /**\n * Behavior to handle disconnection. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"cancel\": Cancel the run.\n * - \"continue\": Continue the run.\n */\n onDisconnect?: DisconnectMode;\n /**\n * The number of seconds to wait before starting the run.\n * Use to schedule future runs.\n */\n afterSeconds?: number;\n /**\n * Behavior if the specified run doesn't exist. Defaults to \"reject\".\n */\n ifNotExists?: \"create\" | \"reject\";\n /**\n * One or more commands to invoke the graph with.\n */\n command?: Command;\n /**\n * Callback when a run is created.\n */\n onRunCreated?: (params: {\n run_id: string;\n thread_id?: string;\n }) => void;\n /**\n * @internal\n * For LangSmith tracing purposes only. Not part of the public API.\n */\n _langsmithTracer?: LangChainTracer;\n}\nexport interface RunsStreamPayload<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false> extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: TStreamMode;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: TSubgraphs;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n /**\n * Pass one or more feedbackKeys if you want to request short-lived signed URLs\n * for submitting feedback to LangSmith with this key for this run.\n */\n feedbackKeys?: string[];\n}\nexport interface RunsCreatePayload extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: StreamMode | Array<StreamMode>;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: boolean;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n}\nexport interface CronsCreatePayload extends RunsCreatePayload {\n /**\n * Schedule for running the Cron Job. Schedules are interpreted in UTC.\n */\n schedule: string;\n /**\n * What to do with the thread after the run completes.\n * - \"delete\" (default): Automatically deletes the thread after the run completes.\n * - \"keep\": Preserves the thread after the run completes, allowing you to retrieve run results later.\n * You are responsible for cleaning up kept threads.\n */\n onRunCompleted?: \"delete\" | \"keep\";\n}\nexport interface RunsWaitPayload extends RunsStreamPayload {\n /**\n * Raise errors returned by the run. Default is `true`.\n */\n raiseError?: boolean;\n}\n"],"mappings":";;;;;KAGYK,iBAAAA;KACAC,kBAAAA;AADAD,KAEAE,oBAAAA,GAFiB,UAAA,GAAA,UAAA;AACjBD,KAEAE,cAAAA,GAFkB,QAAA,GAAA,UAAA;AAClBD,KAEAE,UA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SAAwBN"}
|
package/dist/types.d.ts
CHANGED
|
@@ -172,7 +172,7 @@ interface RunsCreatePayload extends RunsInvokePayload {
|
|
|
172
172
|
}
|
|
173
173
|
interface CronsCreatePayload extends RunsCreatePayload {
|
|
174
174
|
/**
|
|
175
|
-
* Schedule for running the Cron Job
|
|
175
|
+
* Schedule for running the Cron Job. Schedules are interpreted in UTC.
|
|
176
176
|
*/
|
|
177
177
|
schedule: string;
|
|
178
178
|
/**
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":["LangChainTracer","Checkpoint","Config","Metadata","StreamMode","MultitaskStrategy","OnConflictBehavior","OnCompletionBehavior","DisconnectMode","Durability","StreamEvent","Send","Command","Record","RunsInvokePayload","Omit","AbortController","RunsStreamPayload","TStreamMode","TSubgraphs","RunsCreatePayload","Array","CronsCreatePayload","RunsWaitPayload"],"sources":["../src/types.d.ts"],"sourcesContent":["import { LangChainTracer } from \"@langchain/core/tracers/tracer_langchain\";\nimport { Checkpoint, Config, Metadata } from \"./schema.js\";\nimport { StreamMode } from \"./types.stream.js\";\nexport type MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type OnConflictBehavior = \"raise\" | \"do_nothing\";\nexport type OnCompletionBehavior = \"complete\" | \"continue\";\nexport type DisconnectMode = \"cancel\" | \"continue\";\nexport type Durability = \"exit\" | \"async\" | \"sync\";\nexport type StreamEvent = \"events\" | \"metadata\" | \"debug\" | \"updates\" | \"values\" | \"messages/partial\" | \"messages/metadata\" | \"messages/complete\" | \"messages\" | (string & {});\nexport interface Send {\n node: string;\n input: unknown | null;\n}\nexport interface Command {\n /**\n * An object to update the thread state with.\n */\n update?: Record<string, unknown> | [string, unknown][] | null;\n /**\n * The value to return from an `interrupt` function call.\n */\n resume?: unknown;\n /**\n * Determine the next node to navigate to. Can be one of the following:\n * - Name(s) of the node names to navigate to next.\n * - `Send` command(s) to execute node(s) with provided input.\n */\n goto?: Send | Send[] | string | string[];\n}\nexport interface RunsInvokePayload {\n /**\n * Input to the run. Pass `null` to resume from the current state of the thread.\n */\n input?: Record<string, unknown> | null;\n /**\n * Metadata for the run.\n */\n metadata?: Metadata;\n /**\n * Additional configuration for the run.\n */\n config?: Config;\n /**\n * Static context to add to the assistant.\n * @remarks Added in LangGraph.js 0.4\n */\n context?: unknown;\n /**\n * Checkpoint ID for when creating a new run.\n */\n checkpointId?: string;\n /**\n * Checkpoint for when creating a new run.\n */\n checkpoint?: Omit<Checkpoint, \"thread_id\">;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * @deprecated Use `durability` instead.\n */\n checkpointDuring?: boolean;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * - `\"async\"`: Save checkpoint asynchronously while the next step executes (default).\n * - `\"sync\"`: Save checkpoint synchronously before the next step starts.\n * - `\"exit\"`: Save checkpoint only when the graph exits.\n * @default \"async\"\n */\n durability?: Durability;\n /**\n * Interrupt execution before entering these nodes.\n */\n interruptBefore?: \"*\" | string[];\n /**\n * Interrupt execution after leaving these nodes.\n */\n interruptAfter?: \"*\" | string[];\n /**\n * Strategy to handle concurrent runs on the same thread. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"reject\": Reject the new run.\n * - \"interrupt\": Interrupt the current run, keeping steps completed until now,\n and start a new one.\n * - \"rollback\": Cancel and delete the existing run, rolling back the thread to\n the state before it had started, then start the new run.\n * - \"enqueue\": Queue up the new run to start after the current run finishes.\n */\n multitaskStrategy?: MultitaskStrategy;\n /**\n * Abort controller signal to cancel the run.\n */\n signal?: AbortController[\"signal\"];\n /**\n * Behavior to handle run completion. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"complete\": Complete the run.\n * - \"continue\": Continue the run.\n */\n onCompletion?: OnCompletionBehavior;\n /**\n * Webhook to call when the run is complete.\n */\n webhook?: string;\n /**\n * Behavior to handle disconnection. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"cancel\": Cancel the run.\n * - \"continue\": Continue the run.\n */\n onDisconnect?: DisconnectMode;\n /**\n * The number of seconds to wait before starting the run.\n * Use to schedule future runs.\n */\n afterSeconds?: number;\n /**\n * Behavior if the specified run doesn't exist. Defaults to \"reject\".\n */\n ifNotExists?: \"create\" | \"reject\";\n /**\n * One or more commands to invoke the graph with.\n */\n command?: Command;\n /**\n * Callback when a run is created.\n */\n onRunCreated?: (params: {\n run_id: string;\n thread_id?: string;\n }) => void;\n /**\n * @internal\n * For LangSmith tracing purposes only. Not part of the public API.\n */\n _langsmithTracer?: LangChainTracer;\n}\nexport interface RunsStreamPayload<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false> extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: TStreamMode;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: TSubgraphs;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n /**\n * Pass one or more feedbackKeys if you want to request short-lived signed URLs\n * for submitting feedback to LangSmith with this key for this run.\n */\n feedbackKeys?: string[];\n}\nexport interface RunsCreatePayload extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: StreamMode | Array<StreamMode>;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: boolean;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n}\nexport interface CronsCreatePayload extends RunsCreatePayload {\n /**\n * Schedule for running the Cron Job
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":["LangChainTracer","Checkpoint","Config","Metadata","StreamMode","MultitaskStrategy","OnConflictBehavior","OnCompletionBehavior","DisconnectMode","Durability","StreamEvent","Send","Command","Record","RunsInvokePayload","Omit","AbortController","RunsStreamPayload","TStreamMode","TSubgraphs","RunsCreatePayload","Array","CronsCreatePayload","RunsWaitPayload"],"sources":["../src/types.d.ts"],"sourcesContent":["import { LangChainTracer } from \"@langchain/core/tracers/tracer_langchain\";\nimport { Checkpoint, Config, Metadata } from \"./schema.js\";\nimport { StreamMode } from \"./types.stream.js\";\nexport type MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type OnConflictBehavior = \"raise\" | \"do_nothing\";\nexport type OnCompletionBehavior = \"complete\" | \"continue\";\nexport type DisconnectMode = \"cancel\" | \"continue\";\nexport type Durability = \"exit\" | \"async\" | \"sync\";\nexport type StreamEvent = \"events\" | \"metadata\" | \"debug\" | \"updates\" | \"values\" | \"messages/partial\" | \"messages/metadata\" | \"messages/complete\" | \"messages\" | (string & {});\nexport interface Send {\n node: string;\n input: unknown | null;\n}\nexport interface Command {\n /**\n * An object to update the thread state with.\n */\n update?: Record<string, unknown> | [string, unknown][] | null;\n /**\n * The value to return from an `interrupt` function call.\n */\n resume?: unknown;\n /**\n * Determine the next node to navigate to. Can be one of the following:\n * - Name(s) of the node names to navigate to next.\n * - `Send` command(s) to execute node(s) with provided input.\n */\n goto?: Send | Send[] | string | string[];\n}\nexport interface RunsInvokePayload {\n /**\n * Input to the run. Pass `null` to resume from the current state of the thread.\n */\n input?: Record<string, unknown> | null;\n /**\n * Metadata for the run.\n */\n metadata?: Metadata;\n /**\n * Additional configuration for the run.\n */\n config?: Config;\n /**\n * Static context to add to the assistant.\n * @remarks Added in LangGraph.js 0.4\n */\n context?: unknown;\n /**\n * Checkpoint ID for when creating a new run.\n */\n checkpointId?: string;\n /**\n * Checkpoint for when creating a new run.\n */\n checkpoint?: Omit<Checkpoint, \"thread_id\">;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * @deprecated Use `durability` instead.\n */\n checkpointDuring?: boolean;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * - `\"async\"`: Save checkpoint asynchronously while the next step executes (default).\n * - `\"sync\"`: Save checkpoint synchronously before the next step starts.\n * - `\"exit\"`: Save checkpoint only when the graph exits.\n * @default \"async\"\n */\n durability?: Durability;\n /**\n * Interrupt execution before entering these nodes.\n */\n interruptBefore?: \"*\" | string[];\n /**\n * Interrupt execution after leaving these nodes.\n */\n interruptAfter?: \"*\" | string[];\n /**\n * Strategy to handle concurrent runs on the same thread. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"reject\": Reject the new run.\n * - \"interrupt\": Interrupt the current run, keeping steps completed until now,\n and start a new one.\n * - \"rollback\": Cancel and delete the existing run, rolling back the thread to\n the state before it had started, then start the new run.\n * - \"enqueue\": Queue up the new run to start after the current run finishes.\n */\n multitaskStrategy?: MultitaskStrategy;\n /**\n * Abort controller signal to cancel the run.\n */\n signal?: AbortController[\"signal\"];\n /**\n * Behavior to handle run completion. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"complete\": Complete the run.\n * - \"continue\": Continue the run.\n */\n onCompletion?: OnCompletionBehavior;\n /**\n * Webhook to call when the run is complete.\n */\n webhook?: string;\n /**\n * Behavior to handle disconnection. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"cancel\": Cancel the run.\n * - \"continue\": Continue the run.\n */\n onDisconnect?: DisconnectMode;\n /**\n * The number of seconds to wait before starting the run.\n * Use to schedule future runs.\n */\n afterSeconds?: number;\n /**\n * Behavior if the specified run doesn't exist. Defaults to \"reject\".\n */\n ifNotExists?: \"create\" | \"reject\";\n /**\n * One or more commands to invoke the graph with.\n */\n command?: Command;\n /**\n * Callback when a run is created.\n */\n onRunCreated?: (params: {\n run_id: string;\n thread_id?: string;\n }) => void;\n /**\n * @internal\n * For LangSmith tracing purposes only. Not part of the public API.\n */\n _langsmithTracer?: LangChainTracer;\n}\nexport interface RunsStreamPayload<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false> extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: TStreamMode;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: TSubgraphs;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n /**\n * Pass one or more feedbackKeys if you want to request short-lived signed URLs\n * for submitting feedback to LangSmith with this key for this run.\n */\n feedbackKeys?: string[];\n}\nexport interface RunsCreatePayload extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: StreamMode | Array<StreamMode>;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: boolean;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n}\nexport interface CronsCreatePayload extends RunsCreatePayload {\n /**\n * Schedule for running the Cron Job. Schedules are interpreted in UTC.\n */\n schedule: string;\n /**\n * What to do with the thread after the run completes.\n * - \"delete\" (default): Automatically deletes the thread after the run completes.\n * - \"keep\": Preserves the thread after the run completes, allowing you to retrieve run results later.\n * You are responsible for cleaning up kept threads.\n */\n onRunCompleted?: \"delete\" | \"keep\";\n}\nexport interface RunsWaitPayload extends RunsStreamPayload {\n /**\n * Raise errors returned by the run. Default is `true`.\n */\n raiseError?: boolean;\n}\n"],"mappings":";;;;;KAGYK,iBAAAA;KACAC,kBAAAA;AADAD,KAEAE,oBAAAA,GAFiB,UAAA,GAAA,UAAA;AACjBD,KAEAE,cAAAA,GAFkB,QAAA,GAAA,UAAA;AAClBD,KAEAE,UAAAA,GAFAF,MAAoB,GAAA,OAAA,GAAA,MAAA;AACpBC,KAEAE,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.stream.d.ts","names":["Message","Interrupt","Metadata","Config","ThreadTask","StreamMode","ThreadStreamMode","MessageTupleMetadata","AsSubgraph","TEvent","ValuesStreamEvent","StateType","SubgraphValuesStreamEvent","MessagesTupleStreamEvent","SubgraphMessagesTupleStreamEvent","MetadataStreamEvent","ErrorStreamEvent","SubgraphErrorStreamEvent","UpdatesStreamEvent","UpdateType","SubgraphUpdatesStreamEvent","CustomStreamEvent","T","SubgraphCustomStreamEvent","MessagesMetadataStreamEvent","MessagesCompleteStreamEvent","MessagesPartialStreamEvent","TasksStreamCreateEvent","TasksStreamResultEvent","TasksStreamErrorEvent","TasksStreamEvent","SubgraphTasksStreamEvent","CheckpointsStreamEvent","SubgraphCheckpointsStreamEvent","MessagesStreamEvent","SubgraphMessagesStreamEvent","DebugStreamEvent","SubgraphDebugStreamEvent","EventsStreamEvent","Record","SubgraphEventsStreamEvent","FeedbackStreamEvent","GetStreamModeMap","TStateType","TUpdateType","TCustomType","TStreamMode","GetSubgraphsStreamModeMap","TypedAsyncGenerator","TSubgraphs","AsyncGenerator"],"sources":["../src/types.stream.d.ts"],"sourcesContent":["import type { Message } from \"./types.messages.js\";\nimport type { Interrupt, Metadata, Config, ThreadTask } from \"./schema.js\";\n/**\nimport type { SubgraphCheckpointsStreamEvent } from \"./types.stream.subgraph.js\";\n * Stream modes\n * - \"values\": Stream only the state values.\n * - \"messages\": Stream complete messages.\n * - \"messages-tuple\": Stream (message chunk, metadata) tuples.\n * - \"updates\": Stream updates to the state.\n * - \"events\": Stream events occurring during execution.\n * - \"debug\": Stream detailed debug information.\n * - \"custom\": Stream custom events.\n */\nexport type StreamMode = \"values\" | \"messages\" | \"updates\" | \"events\" | \"debug\" | \"tasks\" | \"checkpoints\" | \"custom\" | \"messages-tuple\";\nexport type ThreadStreamMode = \"run_modes\" | \"lifecycle\" | \"state_update\";\ntype MessageTupleMetadata = {\n tags: string[];\n [key: string]: unknown;\n};\ntype AsSubgraph<TEvent extends {\n id?: string;\n event: string;\n data: unknown;\n}> = {\n id?: TEvent[\"id\"];\n event: TEvent[\"event\"] | `${TEvent[\"event\"]}|${string}`;\n data: TEvent[\"data\"];\n};\n/**\n * Stream event with values after completion of each step.\n */\nexport type ValuesStreamEvent<StateType> = {\n id?: string;\n event: \"values\";\n data: StateType;\n};\n/** @internal */\nexport type SubgraphValuesStreamEvent<StateType> = AsSubgraph<ValuesStreamEvent<StateType>>;\n/**\n * Stream event with message chunks coming from LLM invocations inside nodes.\n */\nexport type MessagesTupleStreamEvent = {\n event: \"messages\";\n data: [message: Message, config: MessageTupleMetadata];\n};\n/** @internal */\nexport type SubgraphMessagesTupleStreamEvent = AsSubgraph<MessagesTupleStreamEvent>;\n/**\n * Metadata stream event with information about the run and thread\n */\nexport type MetadataStreamEvent = {\n id?: string;\n event: \"metadata\";\n data: {\n run_id: string;\n thread_id: string;\n };\n};\n/**\n * Stream event with error information.\n */\nexport type ErrorStreamEvent = {\n id?: string;\n event: \"error\";\n data: {\n error: string;\n message: string;\n };\n};\n/** @internal */\nexport type SubgraphErrorStreamEvent = AsSubgraph<ErrorStreamEvent>;\n/**\n * Stream event with updates to the state after each step.\n * The streamed outputs include the name of the node that\n * produced the update as well as the update.\n */\nexport type UpdatesStreamEvent<UpdateType> = {\n id?: string;\n event: \"updates\";\n data: {\n [node: string]: UpdateType;\n };\n};\n/** @internal */\nexport type SubgraphUpdatesStreamEvent<UpdateType> = AsSubgraph<UpdatesStreamEvent<UpdateType>>;\n/**\n * Streaming custom data from inside the nodes.\n */\nexport type CustomStreamEvent<T> = {\n event: \"custom\";\n data: T;\n};\n/** @internal */\nexport type SubgraphCustomStreamEvent<T> = AsSubgraph<CustomStreamEvent<T>>;\ntype MessagesMetadataStreamEvent = {\n id?: string;\n event: \"messages/metadata\";\n data: {\n [messageId: string]: {\n metadata: unknown;\n };\n };\n};\ntype MessagesCompleteStreamEvent = {\n id?: string;\n event: \"messages/complete\";\n data: Message[];\n};\ntype MessagesPartialStreamEvent = {\n id?: string;\n event: \"messages/partial\";\n data: Message[];\n};\ntype TasksStreamCreateEvent<StateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n input: StateType;\n triggers: string[];\n };\n};\ntype TasksStreamResultEvent<UpdateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n result: [string, UpdateType][];\n };\n};\ntype TasksStreamErrorEvent = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n error: string;\n };\n};\nexport type TasksStreamEvent<StateType, UpdateType> = TasksStreamCreateEvent<StateType> | TasksStreamResultEvent<UpdateType> | TasksStreamErrorEvent;\ntype SubgraphTasksStreamEvent<StateType, UpdateType> = AsSubgraph<TasksStreamCreateEvent<StateType>> | AsSubgraph<TasksStreamResultEvent<UpdateType>> | AsSubgraph<TasksStreamErrorEvent>;\nexport type CheckpointsStreamEvent<StateType> = {\n id?: string;\n event: \"checkpoints\";\n data: {\n values: StateType;\n next: string[];\n config: Config;\n metadata: Metadata;\n tasks: ThreadTask[];\n };\n};\ntype SubgraphCheckpointsStreamEvent<StateType> = AsSubgraph<CheckpointsStreamEvent<StateType>>;\n/**\n * Message stream event specific to LangGraph Server.\n * @deprecated Use `streamMode: \"messages-tuple\"` instead.\n */\nexport type MessagesStreamEvent = MessagesMetadataStreamEvent | MessagesCompleteStreamEvent | MessagesPartialStreamEvent;\n/** @internal */\nexport type SubgraphMessagesStreamEvent = AsSubgraph<MessagesMetadataStreamEvent> | AsSubgraph<MessagesCompleteStreamEvent> | AsSubgraph<MessagesPartialStreamEvent>;\n/**\n * Stream event with detailed debug information.\n */\nexport type DebugStreamEvent = {\n id?: string;\n event: \"debug\";\n data: unknown;\n};\n/** @internal */\nexport type SubgraphDebugStreamEvent = AsSubgraph<DebugStreamEvent>;\n/**\n * Stream event with events occurring during execution.\n */\nexport type EventsStreamEvent = {\n id?: string;\n event: \"events\";\n data: {\n event: `on_${\"chat_model\" | \"llm\" | \"chain\" | \"tool\" | \"retriever\" | \"prompt\"}_${\"start\" | \"stream\" | \"end\"}` | (string & {});\n name: string;\n tags: string[];\n run_id: string;\n metadata: Record<string, unknown>;\n parent_ids: string[];\n data: unknown;\n };\n};\n/** @internal */\nexport type SubgraphEventsStreamEvent = AsSubgraph<EventsStreamEvent>;\n/**\n * Stream event with a feedback key to signed URL map. Set `feedbackKeys` in\n * the `RunsStreamPayload` to receive this event.\n */\nexport type FeedbackStreamEvent = {\n id?: string;\n event: \"feedback\";\n data: {\n [feedbackKey: string]: string;\n };\n};\ntype GetStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: ValuesStreamEvent<TStateType>;\n updates: UpdatesStreamEvent<TUpdateType>;\n custom: CustomStreamEvent<TCustomType>;\n debug: DebugStreamEvent;\n messages: MessagesStreamEvent;\n \"messages-tuple\": MessagesTupleStreamEvent;\n tasks: TasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: CheckpointsStreamEvent<TStateType>;\n events: EventsStreamEvent;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | ErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\ntype GetSubgraphsStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: SubgraphValuesStreamEvent<TStateType>;\n updates: SubgraphUpdatesStreamEvent<TUpdateType>;\n custom: SubgraphCustomStreamEvent<TCustomType>;\n debug: SubgraphDebugStreamEvent;\n messages: SubgraphMessagesStreamEvent;\n \"messages-tuple\": SubgraphMessagesTupleStreamEvent;\n events: SubgraphEventsStreamEvent;\n tasks: SubgraphTasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: SubgraphCheckpointsStreamEvent<TStateType>;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | SubgraphErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\nexport type TypedAsyncGenerator<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false, TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = AsyncGenerator<TSubgraphs extends true ? GetSubgraphsStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType> : GetStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType>>;\nexport {};\n"],"mappings":";;;;;;;AAaA;AACA;AAA0E;AACjD;;;;;;AAWT,KAbJK,UAAAA,GAaI,QAAA,GAAA,UAAA,GAAA,SAAA,GAAA,QAAA,GAAA,OAAA,GAAA,OAAA,GAAA,aAAA,GAAA,QAAA,GAAA,gBAAA;AAKJK,KAjBAJ,gBAAAA,GAiBiB,WAGnBK,GAAAA,WAAS,GAAA,cAAA;AAGnB,KAtBKJ,oBAAAA,GAsBOK;EAAyB,IAAA,EAAA,MAAA,EAAA;MAA2CD,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;KAlB3EH,UAkB8CA,CAAAA,eAAAA;EAAU,EAAA,CAAA,EAAA,MAAA;EAIjDK,KAAAA,EAAAA,MAAAA;EAAwB,IAAA,EAAA,OAAA;;KAECN,EAnB5BE,MAmB4BF,CAAAA,IAAAA,CAAAA;EAAoB,KAAA,EAlB9CE,MAkB8C,CAAA,OAAA,CAAA,GAAA,GAlBzBA,MAkByB,CAAA,OAAA,CAAA,IAAA,MAAA,EAAA;EAG7CK,IAAAA,EApBFL,MAoBEK,CAAAA,MAAAA,CAAAA;CAAgC;;;;AAIhCC,KAnBAL,iBAmBmB,CAAA,SAAA,CAAA,GAAA;EAWnBM,EAAAA,CAAAA,EAAAA,MAAAA;EASAC,KAAAA,EAAAA,QAAAA;EAAwB,IAAA,EApC1BN,SAoC0B;;;AAAa,KAjCrCC,yBAiCqC,CAAA,SAAA,CAAA,GAjCEJ,UAiCF,CAjCaE,iBAiCb,CAjC+BC,SAiC/B,CAAA,CAAA;AAMjD;AAQA;;AAAmFQ,KA3CvEN,wBA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,0BAA0BF,0BAA0BD,aAAaH,YAAYC,aAAaC,eAAeH,iBAAiBI,aAAaH,YAAYC,aAAaC"}
|
|
1
|
+
{"version":3,"file":"types.stream.d.ts","names":["Message","Interrupt","Metadata","Config","ThreadTask","StreamMode","ThreadStreamMode","MessageTupleMetadata","AsSubgraph","TEvent","ValuesStreamEvent","StateType","SubgraphValuesStreamEvent","MessagesTupleStreamEvent","SubgraphMessagesTupleStreamEvent","MetadataStreamEvent","ErrorStreamEvent","SubgraphErrorStreamEvent","UpdatesStreamEvent","UpdateType","SubgraphUpdatesStreamEvent","CustomStreamEvent","T","SubgraphCustomStreamEvent","MessagesMetadataStreamEvent","MessagesCompleteStreamEvent","MessagesPartialStreamEvent","TasksStreamCreateEvent","TasksStreamResultEvent","TasksStreamErrorEvent","TasksStreamEvent","SubgraphTasksStreamEvent","CheckpointsStreamEvent","SubgraphCheckpointsStreamEvent","MessagesStreamEvent","SubgraphMessagesStreamEvent","DebugStreamEvent","SubgraphDebugStreamEvent","EventsStreamEvent","Record","SubgraphEventsStreamEvent","FeedbackStreamEvent","GetStreamModeMap","TStateType","TUpdateType","TCustomType","TStreamMode","GetSubgraphsStreamModeMap","TypedAsyncGenerator","TSubgraphs","AsyncGenerator"],"sources":["../src/types.stream.d.ts"],"sourcesContent":["import type { Message } from \"./types.messages.js\";\nimport type { Interrupt, Metadata, Config, ThreadTask } from \"./schema.js\";\n/**\nimport type { SubgraphCheckpointsStreamEvent } from \"./types.stream.subgraph.js\";\n * Stream modes\n * - \"values\": Stream only the state values.\n * - \"messages\": Stream complete messages.\n * - \"messages-tuple\": Stream (message chunk, metadata) tuples.\n * - \"updates\": Stream updates to the state.\n * - \"events\": Stream events occurring during execution.\n * - \"debug\": Stream detailed debug information.\n * - \"custom\": Stream custom events.\n */\nexport type StreamMode = \"values\" | \"messages\" | \"updates\" | \"events\" | \"debug\" | \"tasks\" | \"checkpoints\" | \"custom\" | \"messages-tuple\";\nexport type ThreadStreamMode = \"run_modes\" | \"lifecycle\" | \"state_update\";\ntype MessageTupleMetadata = {\n tags: string[];\n [key: string]: unknown;\n};\ntype AsSubgraph<TEvent extends {\n id?: string;\n event: string;\n data: unknown;\n}> = {\n id?: TEvent[\"id\"];\n event: TEvent[\"event\"] | `${TEvent[\"event\"]}|${string}`;\n data: TEvent[\"data\"];\n};\n/**\n * Stream event with values after completion of each step.\n */\nexport type ValuesStreamEvent<StateType> = {\n id?: string;\n event: \"values\";\n data: StateType;\n};\n/** @internal */\nexport type SubgraphValuesStreamEvent<StateType> = AsSubgraph<ValuesStreamEvent<StateType>>;\n/**\n * Stream event with message chunks coming from LLM invocations inside nodes.\n */\nexport type MessagesTupleStreamEvent = {\n event: \"messages\";\n data: [message: Message, config: MessageTupleMetadata];\n};\n/** @internal */\nexport type SubgraphMessagesTupleStreamEvent = AsSubgraph<MessagesTupleStreamEvent>;\n/**\n * Metadata stream event with information about the run and thread\n */\nexport type MetadataStreamEvent = {\n id?: string;\n event: \"metadata\";\n data: {\n run_id: string;\n thread_id: string;\n };\n};\n/**\n * Stream event with error information.\n */\nexport type ErrorStreamEvent = {\n id?: string;\n event: \"error\";\n data: {\n error: string;\n message: string;\n };\n};\n/** @internal */\nexport type SubgraphErrorStreamEvent = AsSubgraph<ErrorStreamEvent>;\n/**\n * Stream event with updates to the state after each step.\n * The streamed outputs include the name of the node that\n * produced the update as well as the update.\n */\nexport type UpdatesStreamEvent<UpdateType> = {\n id?: string;\n event: \"updates\";\n data: {\n [node: string]: UpdateType;\n };\n};\n/** @internal */\nexport type SubgraphUpdatesStreamEvent<UpdateType> = AsSubgraph<UpdatesStreamEvent<UpdateType>>;\n/**\n * Streaming custom data from inside the nodes.\n */\nexport type CustomStreamEvent<T> = {\n event: \"custom\";\n data: T;\n};\n/** @internal */\nexport type SubgraphCustomStreamEvent<T> = AsSubgraph<CustomStreamEvent<T>>;\ntype MessagesMetadataStreamEvent = {\n id?: string;\n event: \"messages/metadata\";\n data: {\n [messageId: string]: {\n metadata: unknown;\n };\n };\n};\ntype MessagesCompleteStreamEvent = {\n id?: string;\n event: \"messages/complete\";\n data: Message[];\n};\ntype MessagesPartialStreamEvent = {\n id?: string;\n event: \"messages/partial\";\n data: Message[];\n};\ntype TasksStreamCreateEvent<StateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n input: StateType;\n triggers: string[];\n };\n};\ntype TasksStreamResultEvent<UpdateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n result: [string, UpdateType][];\n };\n};\ntype TasksStreamErrorEvent = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n error: string;\n };\n};\nexport type TasksStreamEvent<StateType, UpdateType> = TasksStreamCreateEvent<StateType> | TasksStreamResultEvent<UpdateType> | TasksStreamErrorEvent;\ntype SubgraphTasksStreamEvent<StateType, UpdateType> = AsSubgraph<TasksStreamCreateEvent<StateType>> | AsSubgraph<TasksStreamResultEvent<UpdateType>> | AsSubgraph<TasksStreamErrorEvent>;\nexport type CheckpointsStreamEvent<StateType> = {\n id?: string;\n event: \"checkpoints\";\n data: {\n values: StateType;\n next: string[];\n config: Config;\n metadata: Metadata;\n tasks: ThreadTask[];\n };\n};\ntype SubgraphCheckpointsStreamEvent<StateType> = AsSubgraph<CheckpointsStreamEvent<StateType>>;\n/**\n * Message stream event specific to LangGraph Server.\n * @deprecated Use `streamMode: \"messages-tuple\"` instead.\n */\nexport type MessagesStreamEvent = MessagesMetadataStreamEvent | MessagesCompleteStreamEvent | MessagesPartialStreamEvent;\n/** @internal */\nexport type SubgraphMessagesStreamEvent = AsSubgraph<MessagesMetadataStreamEvent> | AsSubgraph<MessagesCompleteStreamEvent> | AsSubgraph<MessagesPartialStreamEvent>;\n/**\n * Stream event with detailed debug information.\n */\nexport type DebugStreamEvent = {\n id?: string;\n event: \"debug\";\n data: unknown;\n};\n/** @internal */\nexport type SubgraphDebugStreamEvent = AsSubgraph<DebugStreamEvent>;\n/**\n * Stream event with events occurring during execution.\n */\nexport type EventsStreamEvent = {\n id?: string;\n event: \"events\";\n data: {\n event: `on_${\"chat_model\" | \"llm\" | \"chain\" | \"tool\" | \"retriever\" | \"prompt\"}_${\"start\" | \"stream\" | \"end\"}` | (string & {});\n name: string;\n tags: string[];\n run_id: string;\n metadata: Record<string, unknown>;\n parent_ids: string[];\n data: unknown;\n };\n};\n/** @internal */\nexport type SubgraphEventsStreamEvent = AsSubgraph<EventsStreamEvent>;\n/**\n * Stream event with a feedback key to signed URL map. Set `feedbackKeys` in\n * the `RunsStreamPayload` to receive this event.\n */\nexport type FeedbackStreamEvent = {\n id?: string;\n event: \"feedback\";\n data: {\n [feedbackKey: string]: string;\n };\n};\ntype GetStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: ValuesStreamEvent<TStateType>;\n updates: UpdatesStreamEvent<TUpdateType>;\n custom: CustomStreamEvent<TCustomType>;\n debug: DebugStreamEvent;\n messages: MessagesStreamEvent;\n \"messages-tuple\": MessagesTupleStreamEvent;\n tasks: TasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: CheckpointsStreamEvent<TStateType>;\n events: EventsStreamEvent;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | ErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\ntype GetSubgraphsStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: SubgraphValuesStreamEvent<TStateType>;\n updates: SubgraphUpdatesStreamEvent<TUpdateType>;\n custom: SubgraphCustomStreamEvent<TCustomType>;\n debug: SubgraphDebugStreamEvent;\n messages: SubgraphMessagesStreamEvent;\n \"messages-tuple\": SubgraphMessagesTupleStreamEvent;\n events: SubgraphEventsStreamEvent;\n tasks: SubgraphTasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: SubgraphCheckpointsStreamEvent<TStateType>;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | SubgraphErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\nexport type TypedAsyncGenerator<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false, TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = AsyncGenerator<TSubgraphs extends true ? GetSubgraphsStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType> : GetStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType>>;\nexport {};\n"],"mappings":";;;;;;;AAaA;AACA;AAA0E;AACjD;;;;;;AAWT,KAbJK,UAAAA,GAaI,QAAA,GAAA,UAAA,GAAA,SAAA,GAAA,QAAA,GAAA,OAAA,GAAA,OAAA,GAAA,aAAA,GAAA,QAAA,GAAA,gBAAA;AAKJK,KAjBAJ,gBAAAA,GAiBiB,WAGnBK,GAAS,WAAA,GAAA,cAAA;AAGnB,KAtBKJ,oBAAAA,GAsBOK;EAAyB,IAAA,EAAA,MAAA,EAAA;MAA2CD,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;KAlB3EH,UAkB8CA,CAAAA,eAAAA;EAAU,EAAA,CAAA,EAAA,MAAA;EAIjDK,KAAAA,EAAAA,MAAAA;EAAwB,IAAA,EAAA,OAAA;;KAECN,EAnB5BE,MAmB4BF,CAAAA,IAAAA,CAAAA;EAAoB,KAAA,EAlB9CE,MAkB8C,CAAA,OAAA,CAAA,GAAA,GAlBzBA,MAkByB,CAAA,OAAA,CAAA,IAAA,MAAA,EAAA;EAG7CK,IAAAA,EApBFL,MAoBEK,CAAAA,MAAAA,CAAAA;CAAgC;;;;AAIhCC,KAnBAL,iBAmBmB,CAAA,SAAA,CAAA,GAAA;EAWnBM,EAAAA,CAAAA,EAAAA,MAAAA;EASAC,KAAAA,EAAAA,QAAAA;EAAwB,IAAA,EApC1BN,SAoC0B;;;AAAa,KAjCrCC,yBAiCqC,CAAA,SAAA,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AoBzC,eAAeyC,sBAAsBA,eAAe7B,2BAA2BF,sBAAsB0B;KAC/GO,wCAAwC3C,aAAaA,2FAA2FsC,qCAAqCO,eAAeD,0BAA0BF,0BAA0BD,aAAaH,YAAYC,aAAaC,eAAeH,iBAAiBI,aAAaH,YAAYC,aAAaC"}
|
package/dist/ui/types.d.cts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Checkpoint, Config, Metadata, ThreadState } from "../schema.cjs";
|
|
2
|
-
import { AIMessage, DefaultToolCall } from "../types.messages.cjs";
|
|
2
|
+
import { AIMessage, DefaultToolCall, Message } from "../types.messages.cjs";
|
|
3
3
|
import { CheckpointsStreamEvent, CustomStreamEvent, DebugStreamEvent, EventsStreamEvent, MetadataStreamEvent, StreamMode, TasksStreamEvent, UpdatesStreamEvent } from "../types.stream.cjs";
|
|
4
4
|
import { Command, DisconnectMode, Durability, MultitaskStrategy, OnCompletionBehavior } from "../types.cjs";
|
|
5
5
|
import { Client, ClientConfig } from "../client.cjs";
|
|
6
6
|
import { BagTemplate } from "../types.template.cjs";
|
|
7
|
+
import { InferInteropZodInput } from "@langchain/core/utils/types";
|
|
7
8
|
|
|
8
9
|
//#region src/ui/types.d.ts
|
|
9
10
|
|
|
@@ -39,17 +40,79 @@ type ExtractAgentConfig<T> = T extends {
|
|
|
39
40
|
"~agentTypes": infer Config;
|
|
40
41
|
} ? Config extends AgentTypeConfigLike ? Config : never : never;
|
|
41
42
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
43
|
+
* Minimal interface to structurally match AgentMiddleware from langchain.
|
|
44
|
+
* We can't import AgentMiddleware due to circular dependencies, so we match
|
|
45
|
+
* against its structure to extract type information.
|
|
45
46
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
interface AgentMiddlewareLike<TSchema = unknown, TContextSchema = unknown, TFullContext = unknown, TTools = unknown> {
|
|
48
|
+
name: string;
|
|
49
|
+
stateSchema?: TSchema;
|
|
50
|
+
"~middlewareTypes"?: {
|
|
51
|
+
Schema: TSchema;
|
|
52
|
+
ContextSchema: TContextSchema;
|
|
53
|
+
FullContext: TFullContext;
|
|
54
|
+
Tools: TTools;
|
|
49
55
|
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Helper type to extract state from a single middleware instance.
|
|
59
|
+
* Uses structural matching against AgentMiddleware to extract the state schema
|
|
60
|
+
* type parameter, similar to how langchain's InferMiddlewareState works.
|
|
61
|
+
*/
|
|
62
|
+
type InferMiddlewareState<T> = T extends AgentMiddlewareLike<infer TSchema, unknown, unknown, unknown> ? TSchema extends Record<string, any> ? InferInteropZodInput<TSchema> : {} : T extends {
|
|
63
|
+
stateSchema: infer S;
|
|
64
|
+
} ? InferInteropZodInput<S> : {};
|
|
65
|
+
/**
|
|
66
|
+
* Helper type to detect if a type is `any`.
|
|
67
|
+
* Uses the fact that `any` is both a subtype and supertype of all types.
|
|
68
|
+
*/
|
|
69
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
70
|
+
/**
|
|
71
|
+
* Helper type to extract and merge states from an array of middleware.
|
|
72
|
+
* Recursively processes each middleware and intersects their state types.
|
|
73
|
+
*
|
|
74
|
+
* Handles both readonly and mutable arrays/tuples explicitly.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* type States = InferMiddlewareStatesFromArray<typeof middlewareArray>;
|
|
79
|
+
* // Returns intersection of all middleware state types
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
type InferMiddlewareStatesFromArray<T> = IsAny<T> extends true ? {} : T extends undefined | null ? {} : T extends readonly [] ? {} : T extends [] ? {} : T extends readonly [infer First, ...infer Rest extends readonly unknown[]] ? InferMiddlewareState<First> & InferMiddlewareStatesFromArray<Rest> : T extends [infer First, ...infer Rest extends unknown[]] ? InferMiddlewareState<First> & InferMiddlewareStatesFromArray<Rest> : T extends readonly (infer U)[] ? InferMiddlewareState<U> : T extends (infer U)[] ? InferMiddlewareState<U> : {};
|
|
83
|
+
/**
|
|
84
|
+
* Infer the complete merged state from an agent, including:
|
|
85
|
+
* - The agent's own state schema (via State)
|
|
86
|
+
* - All middleware states (via Middleware)
|
|
87
|
+
*
|
|
88
|
+
* This is the SDK equivalent of langchain's `InferAgentState` type.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* const agent = createAgent({
|
|
93
|
+
* middleware: [todoListMiddleware()],
|
|
94
|
+
* // ...
|
|
95
|
+
* });
|
|
96
|
+
*
|
|
97
|
+
* type State = InferAgentState<typeof agent>;
|
|
98
|
+
* // State includes { todos: Todo[], ... }
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
/**
|
|
102
|
+
* Base agent state that all agents have by default.
|
|
103
|
+
* This includes the messages array which is fundamental to agent operation.
|
|
104
|
+
* The ToolCall type parameter allows proper typing of tool calls in messages.
|
|
105
|
+
*/
|
|
106
|
+
type BaseAgentState<ToolCall = DefaultToolCall> = {
|
|
107
|
+
messages: Message<ToolCall>[];
|
|
108
|
+
};
|
|
109
|
+
type InferAgentState<T> = T extends {
|
|
110
|
+
"~agentTypes": unknown;
|
|
111
|
+
} ? ExtractAgentConfig<T> extends never ? {} : BaseAgentState<InferAgentToolCalls<T>> & (ExtractAgentConfig<T>["State"] extends undefined ? {} : InferInteropZodInput<ExtractAgentConfig<T>["State"]>) & InferMiddlewareStatesFromArray<ExtractAgentConfig<T>["Middleware"]> : T extends {
|
|
112
|
+
"~RunOutput": infer RunOutput;
|
|
113
|
+
} ? RunOutput : T extends {
|
|
114
|
+
messages: unknown;
|
|
115
|
+
} ? T : {};
|
|
53
116
|
/**
|
|
54
117
|
* Helper type to extract the input type from a DynamicStructuredTool's _call method.
|
|
55
118
|
* This is more reliable than trying to infer from the schema directly because
|
|
@@ -59,7 +122,7 @@ type InferToolInput<T> = T extends {
|
|
|
59
122
|
_call: (arg: infer Args, ...rest: any[]) => any;
|
|
60
123
|
} ? Args : T extends {
|
|
61
124
|
schema: infer S;
|
|
62
|
-
} ?
|
|
125
|
+
} ? InferInteropZodInput<S> : never;
|
|
63
126
|
/**
|
|
64
127
|
* Extract a tool call type from a single tool.
|
|
65
128
|
* Works with tools created via `tool()` from `@langchain/core/tools`.
|
|
@@ -416,5 +479,5 @@ type UseStreamCustomOptions<StateType extends Record<string, unknown> = Record<s
|
|
|
416
479
|
};
|
|
417
480
|
type CustomSubmitOptions<StateType extends Record<string, unknown> = Record<string, unknown>, ConfigurableType extends Record<string, unknown> = Record<string, unknown>> = Pick<SubmitOptions<StateType, ConfigurableType>, "optimisticValues" | "context" | "command" | "config">;
|
|
418
481
|
//#endregion
|
|
419
|
-
export { AgentTypeConfigLike, CustomSubmitOptions, ExtractAgentConfig, GetConfigurableType, GetInterruptType, GetToolCallsType, GetUpdateType, InferAgentToolCalls, IsAgentLike, MessageMetadata, RunCallbackMeta, SubmitOptions, UseStreamCustomOptions, UseStreamOptions, UseStreamThread, UseStreamTransport };
|
|
482
|
+
export { AgentTypeConfigLike, CustomSubmitOptions, ExtractAgentConfig, GetConfigurableType, GetInterruptType, GetToolCallsType, GetUpdateType, InferAgentState, InferAgentToolCalls, IsAgentLike, MessageMetadata, RunCallbackMeta, SubmitOptions, UseStreamCustomOptions, UseStreamOptions, UseStreamThread, UseStreamTransport };
|
|
420
483
|
//# sourceMappingURL=types.d.cts.map
|