@langchain/langgraph-sdk 1.5.3 → 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/react/stream.lgp.cjs +2 -1
- package/dist/react/stream.lgp.cjs.map +1 -1
- package/dist/react/stream.lgp.js +3 -2
- package/dist/react/stream.lgp.js.map +1 -1
- package/dist/react/types.d.cts +6 -0
- package/dist/react/types.d.cts.map +1 -1
- package/dist/react/types.d.ts +6 -0
- package/dist/react/types.d.ts.map +1 -1
- package/dist/react-ui/client.cjs +2 -2
- package/dist/react-ui/client.cjs.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/singletons/fetch.cjs +2 -2
- package/dist/singletons/fetch.cjs.map +1 -1
- package/dist/singletons/fetch.js +2 -2
- package/dist/singletons/fetch.js.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.cts.map +1 -1
- package/dist/types.stream.d.ts.map +1 -1
- package/dist/ui/manager.cjs +6 -5
- package/dist/ui/manager.cjs.map +1 -1
- package/dist/ui/manager.js +6 -5
- package/dist/ui/manager.js.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/dist/ui/utils.cjs +8 -0
- package/dist/ui/utils.cjs.map +1 -1
- package/dist/ui/utils.js +8 -1
- package/dist/ui/utils.js.map +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.cjs","names":["React","ReactDOM","module","JsxRuntime"],"sources":["../../src/react-ui/client.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport * as JsxRuntime from \"react/jsx-runtime\";\nimport type { UIMessage } from \"./types.js\";\nimport { useStream } from \"../react/index.js\";\nimport type { UseStream } from \"../react/types.js\";\nimport type { BagTemplate } from \"../types.template.js\";\n\nconst UseStreamContext = React.createContext<{\n stream: ReturnType<typeof useStream>;\n meta: unknown;\n}>(null!);\n\ntype GetMetaType<Bag extends BagTemplate> = Bag extends { MetaType: unknown }\n ? Bag[\"MetaType\"]\n : unknown;\n\ninterface UseStreamContext<\n StateType extends Record<string, unknown> = Record<string, unknown>,\n Bag extends BagTemplate = BagTemplate\n> extends UseStream<StateType, Bag> {\n meta?: GetMetaType<Bag>;\n}\n\nexport function useStreamContext<\n StateType extends Record<string, unknown> = Record<string, unknown>,\n Bag extends BagTemplate = BagTemplate\n>(): UseStreamContext<StateType, Bag> {\n const ctx = React.useContext(UseStreamContext);\n if (!ctx) {\n throw new Error(\n \"useStreamContext must be used within a LoadExternalComponent\"\n );\n }\n\n return new Proxy(ctx, {\n get(target, prop: keyof UseStreamContext<StateType, Bag>) {\n if (prop === \"meta\") return target.meta;\n return target.stream[prop];\n },\n }) as unknown as UseStreamContext<StateType, Bag>;\n}\n\ninterface ComponentTarget {\n comp: React.FunctionComponent | React.ComponentClass;\n target: HTMLElement;\n}\n\nclass ComponentStore {\n private cache: Record<string, ComponentTarget> = {};\n\n private boundCache: Record<\n string,\n {\n subscribe: (onStoreChange: () => void) => () => void;\n getSnapshot: () => ComponentTarget | undefined;\n }\n > = {};\n\n private callbacks: Record<\n string,\n ((\n comp: React.FunctionComponent | React.ComponentClass,\n el: HTMLElement\n ) => void)[]\n > = {};\n\n respond(\n shadowRootId: string,\n comp: React.FunctionComponent | React.ComponentClass,\n targetElement: HTMLElement\n ) {\n this.cache[shadowRootId] = { comp, target: targetElement };\n this.callbacks[shadowRootId]?.forEach((c) => c(comp, targetElement));\n }\n\n getBoundStore(shadowRootId: string) {\n this.boundCache[shadowRootId] ??= {\n subscribe: (onStoreChange: () => void) => {\n this.callbacks[shadowRootId] ??= [];\n this.callbacks[shadowRootId].push(onStoreChange);\n return () => {\n this.callbacks[shadowRootId] = this.callbacks[shadowRootId].filter(\n (c) => c !== onStoreChange\n );\n };\n },\n getSnapshot: () => this.cache[shadowRootId],\n };\n\n return this.boundCache[shadowRootId];\n }\n}\n\nconst COMPONENT_STORE = new ComponentStore();\nconst EXT_STORE_SYMBOL = Symbol.for(\"LGUI_EXT_STORE\");\nconst REQUIRE_SYMBOL = Symbol.for(\"LGUI_REQUIRE\");\nconst REQUIRE_EXTRA_SYMBOL = Symbol.for(\"LGUI_REQUIRE_EXTRA\");\n\ninterface LoadExternalComponentProps\n extends Pick<React.HTMLAttributes<HTMLDivElement>, \"style\" | \"className\"> {\n /** Stream of the assistant */\n stream: ReturnType<typeof useStream>;\n\n /** Namespace of UI components. Defaults to assistant ID. */\n namespace?: string;\n\n /** UI message to be rendered */\n message: UIMessage;\n\n /** Additional context to be passed to the child component */\n meta?: unknown;\n\n /** Fallback to be rendered when the component is loading */\n fallback?: React.ReactNode | Record<string, React.ReactNode>;\n\n /**\n * Map of components that can be rendered directly without fetching the UI code\n * from the server.\n */\n components?: Record<string, React.FunctionComponent | React.ComponentClass>;\n}\n\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n value != null && typeof value === \"object\" && Symbol.iterator in value;\n\nconst isPromise = (value: unknown): value is Promise<unknown> =>\n value != null &&\n typeof value === \"object\" &&\n \"then\" in value &&\n typeof value.then === \"function\";\n\nconst isReactNode = (value: unknown): value is React.ReactNode => {\n if (React.isValidElement(value)) return true;\n if (value == null) return true;\n if (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"bigint\" ||\n typeof value === \"boolean\"\n ) {\n return true;\n }\n\n if (isIterable(value)) return true;\n if (isPromise(value)) return true;\n\n return false;\n};\n\nexport function LoadExternalComponent({\n stream,\n namespace,\n message,\n meta,\n fallback,\n components,\n ...props\n}: LoadExternalComponentProps) {\n const ref = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const shadowRootId = `child-shadow-${id}`;\n\n const store = React.useMemo(\n () => COMPONENT_STORE.getBoundStore(shadowRootId),\n [shadowRootId]\n );\n const state = React.useSyncExternalStore(store.subscribe, store.getSnapshot);\n\n const clientComponent = components?.[message.name];\n const hasClientComponent = clientComponent != null;\n\n let fallbackComponent = null;\n if (isReactNode(fallback)) {\n fallbackComponent = fallback;\n } else if (typeof fallback === \"object\" && fallback != null) {\n fallbackComponent = fallback?.[message.name];\n }\n\n const uiNamespace = namespace ?? stream.assistantId;\n const uiClient = stream.client[\"~ui\"];\n React.useEffect(() => {\n if (hasClientComponent) return;\n void uiClient.getComponent(uiNamespace, message.name).then((html) => {\n const dom = ref.current;\n if (!dom) return;\n const root = dom.shadowRoot ?? dom.attachShadow({ mode: \"open\" });\n const fragment = document\n .createRange()\n .createContextualFragment(\n html.replace(\"{{shadowRootId}}\", shadowRootId)\n );\n root.appendChild(fragment);\n });\n }, [uiClient, uiNamespace, message.name, shadowRootId, hasClientComponent]);\n\n if (hasClientComponent) {\n return (\n <UseStreamContext.Provider value={{ stream, meta }}>\n {React.createElement(clientComponent, message.props)}\n </UseStreamContext.Provider>\n );\n }\n\n return (\n <>\n <div id={shadowRootId} ref={ref} {...props} />\n\n <UseStreamContext.Provider value={{ stream, meta }}>\n {state?.target != null\n ? ReactDOM.createPortal(\n React.createElement(state.comp, message.props),\n state.target\n )\n : fallbackComponent}\n </UseStreamContext.Provider>\n </>\n );\n}\n\ndeclare global {\n interface Window {\n [EXT_STORE_SYMBOL]: ComponentStore;\n [REQUIRE_SYMBOL]: (name: string) => unknown;\n [REQUIRE_EXTRA_SYMBOL]: Record<string, unknown>;\n }\n}\n\nexport function experimental_loadShare(name: string, module: unknown) {\n if (typeof window === \"undefined\") return;\n\n window[REQUIRE_EXTRA_SYMBOL] ??= {};\n window[REQUIRE_EXTRA_SYMBOL][name] = module;\n}\n\nexport function bootstrapUiContext() {\n if (typeof window === \"undefined\") {\n return;\n }\n\n window[EXT_STORE_SYMBOL] = COMPONENT_STORE;\n window[REQUIRE_SYMBOL] = (name: string) => {\n if (name === \"react\") return React;\n if (name === \"react-dom\") return ReactDOM;\n if (name === \"react/jsx-runtime\") return JsxRuntime;\n if (name === \"@langchain/langgraph-sdk/react\") return { useStream };\n if (name === \"@langchain/langgraph-sdk/react-ui\") {\n return {\n useStreamContext,\n LoadExternalComponent: () => {\n throw new Error(\"Nesting LoadExternalComponent is not supported\");\n },\n };\n }\n\n if (\n window[REQUIRE_EXTRA_SYMBOL] != null &&\n typeof window[REQUIRE_EXTRA_SYMBOL] === \"object\" &&\n name in window[REQUIRE_EXTRA_SYMBOL]\n ) {\n return window[REQUIRE_EXTRA_SYMBOL][name];\n }\n\n throw new Error(`Unknown module...: ${name}`);\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,mBAAmBA,MAAM,cAG5B,KAAM;AAaT,SAAgB,mBAGsB;CACpC,MAAM,MAAMA,MAAM,WAAW,iBAAiB;AAC9C,KAAI,CAAC,IACH,OAAM,IAAI,MACR,+DACD;AAGH,QAAO,IAAI,MAAM,KAAK,EACpB,IAAI,QAAQ,MAA8C;AACxD,MAAI,SAAS,OAAQ,QAAO,OAAO;AACnC,SAAO,OAAO,OAAO;IAExB,CAAC;;AAQJ,IAAM,iBAAN,MAAqB;CACnB,AAAQ,QAAyC,EAAE;CAEnD,AAAQ,aAMJ,EAAE;CAEN,AAAQ,YAMJ,EAAE;CAEN,QACE,cACA,MACA,eACA;AACA,OAAK,MAAM,gBAAgB;GAAE;GAAM,QAAQ;GAAe;AAC1D,OAAK,UAAU,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oBAAqB,QAAOE;AACzC,MAAI,SAAS,iCAAkC,QAAO,EAAE,qCAAW;AACnE,MAAI,SAAS,oCACX,QAAO;GACL;GACA,6BAA6B;AAC3B,UAAM,IAAI,MAAM,iDAAiD;;GAEpE;AAGH,MACE,OAAO,yBAAyB,QAChC,OAAO,OAAO,0BAA0B,YACxC,QAAQ,OAAO,sBAEf,QAAO,OAAO,sBAAsB;AAGtC,QAAM,IAAI,MAAM,sBAAsB,OAAO"}
|
|
1
|
+
{"version":3,"file":"client.cjs","names":["React","ReactDOM","JsxRuntime"],"sources":["../../src/react-ui/client.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport * as JsxRuntime from \"react/jsx-runtime\";\nimport type { UIMessage } from \"./types.js\";\nimport { useStream } from \"../react/index.js\";\nimport type { UseStream } from \"../react/types.js\";\nimport type { BagTemplate } from \"../types.template.js\";\n\nconst UseStreamContext = React.createContext<{\n stream: ReturnType<typeof useStream>;\n meta: unknown;\n}>(null!);\n\ntype GetMetaType<Bag extends BagTemplate> = Bag extends { MetaType: unknown }\n ? Bag[\"MetaType\"]\n : unknown;\n\ninterface UseStreamContext<\n StateType extends Record<string, unknown> = Record<string, unknown>,\n Bag extends BagTemplate = BagTemplate\n> extends UseStream<StateType, Bag> {\n meta?: GetMetaType<Bag>;\n}\n\nexport function useStreamContext<\n StateType extends Record<string, unknown> = Record<string, unknown>,\n Bag extends BagTemplate = BagTemplate\n>(): UseStreamContext<StateType, Bag> {\n const ctx = React.useContext(UseStreamContext);\n if (!ctx) {\n throw new Error(\n \"useStreamContext must be used within a LoadExternalComponent\"\n );\n }\n\n return new Proxy(ctx, {\n get(target, prop: keyof UseStreamContext<StateType, Bag>) {\n if (prop === \"meta\") return target.meta;\n return target.stream[prop];\n },\n }) as unknown as UseStreamContext<StateType, Bag>;\n}\n\ninterface ComponentTarget {\n comp: React.FunctionComponent | React.ComponentClass;\n target: HTMLElement;\n}\n\nclass ComponentStore {\n private cache: Record<string, ComponentTarget> = {};\n\n private boundCache: Record<\n string,\n {\n subscribe: (onStoreChange: () => void) => () => void;\n getSnapshot: () => ComponentTarget | undefined;\n }\n > = {};\n\n private callbacks: Record<\n string,\n ((\n comp: React.FunctionComponent | React.ComponentClass,\n el: HTMLElement\n ) => void)[]\n > = {};\n\n respond(\n shadowRootId: string,\n comp: React.FunctionComponent | React.ComponentClass,\n targetElement: HTMLElement\n ) {\n this.cache[shadowRootId] = { comp, target: targetElement };\n this.callbacks[shadowRootId]?.forEach((c) => c(comp, targetElement));\n }\n\n getBoundStore(shadowRootId: string) {\n this.boundCache[shadowRootId] ??= {\n subscribe: (onStoreChange: () => void) => {\n this.callbacks[shadowRootId] ??= [];\n this.callbacks[shadowRootId].push(onStoreChange);\n return () => {\n this.callbacks[shadowRootId] = this.callbacks[shadowRootId].filter(\n (c) => c !== onStoreChange\n );\n };\n },\n getSnapshot: () => this.cache[shadowRootId],\n };\n\n return this.boundCache[shadowRootId];\n }\n}\n\nconst COMPONENT_STORE = new ComponentStore();\nconst EXT_STORE_SYMBOL = Symbol.for(\"LGUI_EXT_STORE\");\nconst REQUIRE_SYMBOL = Symbol.for(\"LGUI_REQUIRE\");\nconst REQUIRE_EXTRA_SYMBOL = Symbol.for(\"LGUI_REQUIRE_EXTRA\");\n\ninterface LoadExternalComponentProps\n extends Pick<React.HTMLAttributes<HTMLDivElement>, \"style\" | \"className\"> {\n /** Stream of the assistant */\n stream: ReturnType<typeof useStream>;\n\n /** Namespace of UI components. Defaults to assistant ID. */\n namespace?: string;\n\n /** UI message to be rendered */\n message: UIMessage;\n\n /** Additional context to be passed to the child component */\n meta?: unknown;\n\n /** Fallback to be rendered when the component is loading */\n fallback?: React.ReactNode | Record<string, React.ReactNode>;\n\n /**\n * Map of components that can be rendered directly without fetching the UI code\n * from the server.\n */\n components?: Record<string, React.FunctionComponent | React.ComponentClass>;\n}\n\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n value != null && typeof value === \"object\" && Symbol.iterator in value;\n\nconst isPromise = (value: unknown): value is Promise<unknown> =>\n value != null &&\n typeof value === \"object\" &&\n \"then\" in value &&\n typeof value.then === \"function\";\n\nconst isReactNode = (value: unknown): value is React.ReactNode => {\n if (React.isValidElement(value)) return true;\n if (value == null) return true;\n if (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"bigint\" ||\n typeof value === \"boolean\"\n ) {\n return true;\n }\n\n if (isIterable(value)) return true;\n if (isPromise(value)) return true;\n\n return false;\n};\n\nexport function LoadExternalComponent({\n stream,\n namespace,\n message,\n meta,\n fallback,\n components,\n ...props\n}: LoadExternalComponentProps) {\n const ref = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const shadowRootId = `child-shadow-${id}`;\n\n const store = React.useMemo(\n () => COMPONENT_STORE.getBoundStore(shadowRootId),\n [shadowRootId]\n );\n const state = React.useSyncExternalStore(store.subscribe, store.getSnapshot);\n\n const clientComponent = components?.[message.name];\n const hasClientComponent = clientComponent != null;\n\n let fallbackComponent = null;\n if (isReactNode(fallback)) {\n fallbackComponent = fallback;\n } else if (typeof fallback === \"object\" && fallback != null) {\n fallbackComponent = fallback?.[message.name];\n }\n\n const uiNamespace = namespace ?? stream.assistantId;\n const uiClient = stream.client[\"~ui\"];\n React.useEffect(() => {\n if (hasClientComponent) return;\n void uiClient.getComponent(uiNamespace, message.name).then((html) => {\n const dom = ref.current;\n if (!dom) return;\n const root = dom.shadowRoot ?? dom.attachShadow({ mode: \"open\" });\n const fragment = document\n .createRange()\n .createContextualFragment(\n html.replace(\"{{shadowRootId}}\", shadowRootId)\n );\n root.appendChild(fragment);\n });\n }, [uiClient, uiNamespace, message.name, shadowRootId, hasClientComponent]);\n\n if (hasClientComponent) {\n return (\n <UseStreamContext.Provider value={{ stream, meta }}>\n {React.createElement(clientComponent, message.props)}\n </UseStreamContext.Provider>\n );\n }\n\n return (\n <>\n <div id={shadowRootId} ref={ref} {...props} />\n\n <UseStreamContext.Provider value={{ stream, meta }}>\n {state?.target != null\n ? ReactDOM.createPortal(\n React.createElement(state.comp, message.props),\n state.target\n )\n : fallbackComponent}\n </UseStreamContext.Provider>\n </>\n );\n}\n\ndeclare global {\n interface Window {\n [EXT_STORE_SYMBOL]: ComponentStore;\n [REQUIRE_SYMBOL]: (name: string) => unknown;\n [REQUIRE_EXTRA_SYMBOL]: Record<string, unknown>;\n }\n}\n\nexport function experimental_loadShare(name: string, module: unknown) {\n if (typeof window === \"undefined\") return;\n\n window[REQUIRE_EXTRA_SYMBOL] ??= {};\n window[REQUIRE_EXTRA_SYMBOL][name] = module;\n}\n\nexport function bootstrapUiContext() {\n if (typeof window === \"undefined\") {\n return;\n }\n\n window[EXT_STORE_SYMBOL] = COMPONENT_STORE;\n window[REQUIRE_SYMBOL] = (name: string) => {\n if (name === \"react\") return React;\n if (name === \"react-dom\") return ReactDOM;\n if (name === \"react/jsx-runtime\") return JsxRuntime;\n if (name === \"@langchain/langgraph-sdk/react\") return { useStream };\n if (name === \"@langchain/langgraph-sdk/react-ui\") {\n return {\n useStreamContext,\n LoadExternalComponent: () => {\n throw new Error(\"Nesting LoadExternalComponent is not supported\");\n },\n };\n }\n\n if (\n window[REQUIRE_EXTRA_SYMBOL] != null &&\n typeof window[REQUIRE_EXTRA_SYMBOL] === \"object\" &&\n name in window[REQUIRE_EXTRA_SYMBOL]\n ) {\n return window[REQUIRE_EXTRA_SYMBOL][name];\n }\n\n throw new Error(`Unknown module...: ${name}`);\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,mBAAmBA,MAAM,cAG5B,KAAM;AAaT,SAAgB,mBAGsB;CACpC,MAAM,MAAMA,MAAM,WAAW,iBAAiB;AAC9C,KAAI,CAAC,IACH,OAAM,IAAI,MACR,+DACD;AAGH,QAAO,IAAI,MAAM,KAAK,EACpB,IAAI,QAAQ,MAA8C;AACxD,MAAI,SAAS,OAAQ,QAAO,OAAO;AACnC,SAAO,OAAO,OAAO;IAExB,CAAC;;AAQ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BAAsB,QAAQ;;AAGvC,SAAgB,qBAAqB;AACnC,KAAI,OAAO,WAAW,YACpB;AAGF,QAAO,oBAAoB;AAC3B,QAAO,mBAAmB,SAAiB;AACzC,MAAI,SAAS,QAAS,QAAOA;AAC7B,MAAI,SAAS,YAAa,QAAOC;AACjC,MAAI,SAAS,oBAAqB,QAAOC;AACzC,MAAI,SAAS,iCAAkC,QAAO,EAAE,qCAAW;AACnE,MAAI,SAAS,oCACX,QAAO;GACL;GACA,6BAA6B;AAC3B,UAAM,IAAI,MAAM,iDAAiD;;GAEpE;AAGH,MACE,OAAO,yBAAyB,QAChC,OAAO,OAAO,0BAA0B,YACxC,QAAQ,OAAO,sBAEf,QAAO,OAAO,sBAAsB;AAGtC,QAAM,IAAI,MAAM,sBAAsB,OAAO"}
|
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,QAA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;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.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\"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 @@ 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;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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;;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,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;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"}
|
|
@@ -8,8 +8,8 @@ const LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for("lg:fetch_implementation")
|
|
|
8
8
|
* other than the default global (e.g. for dealing with proxies).
|
|
9
9
|
* @param fetch The new fetch function to use.
|
|
10
10
|
*/
|
|
11
|
-
const overrideFetchImplementation = (fetch
|
|
12
|
-
globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch
|
|
11
|
+
const overrideFetchImplementation = (fetch) => {
|
|
12
|
+
globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.cjs","names":[
|
|
1
|
+
{"version":3,"file":"fetch.cjs","names":[],"sources":["../../src/singletons/fetch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n// Wrap the default fetch call due to issues with illegal invocations\n// in some environments:\n// https://stackoverflow.com/questions/69876859/why-does-bind-fix-failed-to-execute-fetch-on-window-illegal-invocation-err\n// @ts-expect-error Broad typing to support a range of fetch implementations\nconst DEFAULT_FETCH_IMPLEMENTATION = (...args: any[]) => fetch(...args);\n\nconst LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for(\n \"lg:fetch_implementation\"\n);\n\n/**\n * Overrides the fetch implementation used for LangSmith calls.\n * You should use this if you need to use an implementation of fetch\n * other than the default global (e.g. for dealing with proxies).\n * @param fetch The new fetch function to use.\n */\nexport const overrideFetchImplementation = (fetch: (...args: any[]) => any) => {\n (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;\n};\n\n/**\n * @internal\n */\nexport const _getFetchImplementation: () => (...args: any[]) => any = () => {\n return (\n (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] ??\n DEFAULT_FETCH_IMPLEMENTATION\n );\n};\n"],"mappings":";;AAKA,MAAM,gCAAgC,GAAG,SAAgB,MAAM,GAAG,KAAK;AAEvE,MAAM,qCAAqC,OAAO,IAChD,0BACD;;;;;;;AAQD,MAAa,+BAA+B,UAAmC;AAC7E,CAAC,WAAmB,sCAAsC;;;;;AAM5D,MAAa,gCAA+D;AAC1E,QACG,WAAmB,uCACpB"}
|
package/dist/singletons/fetch.js
CHANGED
|
@@ -7,8 +7,8 @@ const LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for("lg:fetch_implementation")
|
|
|
7
7
|
* other than the default global (e.g. for dealing with proxies).
|
|
8
8
|
* @param fetch The new fetch function to use.
|
|
9
9
|
*/
|
|
10
|
-
const overrideFetchImplementation = (fetch
|
|
11
|
-
globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch
|
|
10
|
+
const overrideFetchImplementation = (fetch) => {
|
|
11
|
+
globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","names":[
|
|
1
|
+
{"version":3,"file":"fetch.js","names":[],"sources":["../../src/singletons/fetch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n// Wrap the default fetch call due to issues with illegal invocations\n// in some environments:\n// https://stackoverflow.com/questions/69876859/why-does-bind-fix-failed-to-execute-fetch-on-window-illegal-invocation-err\n// @ts-expect-error Broad typing to support a range of fetch implementations\nconst DEFAULT_FETCH_IMPLEMENTATION = (...args: any[]) => fetch(...args);\n\nconst LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for(\n \"lg:fetch_implementation\"\n);\n\n/**\n * Overrides the fetch implementation used for LangSmith calls.\n * You should use this if you need to use an implementation of fetch\n * other than the default global (e.g. for dealing with proxies).\n * @param fetch The new fetch function to use.\n */\nexport const overrideFetchImplementation = (fetch: (...args: any[]) => any) => {\n (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;\n};\n\n/**\n * @internal\n */\nexport const _getFetchImplementation: () => (...args: any[]) => any = () => {\n return (\n (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] ??\n DEFAULT_FETCH_IMPLEMENTATION\n );\n};\n"],"mappings":";AAKA,MAAM,gCAAgC,GAAG,SAAgB,MAAM,GAAG,KAAK;AAEvE,MAAM,qCAAqC,OAAO,IAChD,0BACD;;;;;;;AAQD,MAAa,+BAA+B,UAAmC;AAC7E,CAAC,WAAmB,sCAAsC;;;;;AAM5D,MAAa,gCAA+D;AAC1E,QACG,WAAmB,uCACpB"}
|
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,UAAAA,GAFAF,MAAoB,GAAA,OAAA,GAAA,MAAA;AACpBC,KAEAE,WAAAA,GAFc,QAAA,GAAA,UAAA,GAAA,OAAA,GAAA,SAAA,GAAA,QAAA,GAAA,kBAAA,GAAA,mBAAA,GAAA,mBAAA,GAAA,UAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;AACdD,UAEKE,IAAAA,CAFK;EACVD,IAAAA,EAAAA,MAAAA;EACKC,KAAAA,EAAI,OAAA,GAAA,IAAA;AAIrB;AAAwB,UAAPC,OAAAA,CAAO;;;;EAcF,MAAA,CAAA,EAVTC,MAUS,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAAA;EAELC;;;QAQFX,CAAAA,EAAAA,OAAAA;;;;;;MAqDFa,CAAAA,EA/DFL,IA+DEK,GA/DKL,IA+DLK,EAAAA,GAAAA,MAAAA,GAAAA,MAAAA,EAAAA;;AAkBMR,UA/EFM,iBAAAA,CA+EEN;;;;EA2BFS,KAAAA,CAAAA,EAtGLJ,MAsGKI,CAAAA,MAAiB,EAAA,OAAA,CAAA,GAAA,IAAA;EAAA;;;UAIjBC,CAAAA,EAtGFf,QAsGEe;;;;EAgBAE,MAAAA,CAAAA,EAlHJlB,MAkHIkB;EAAiB;;;;SAASN,CAAAA,EAAAA,OAAAA;EAAiB;AAe5D;AAaA;;;;;eAjIiBC,KAAKd;;;;;;;;;;;;;eAaLQ;;;;;;;;;;;;;;;;;;;sBAmBOJ;;;;WAIXW;;;;;;;iBAOMT;;;;;;;;;;;iBAWAC;;;;;;;;;;;;;YAaLI;;;;;;;;;;;;qBAYSZ;;UAENiB,sCAAsCb,aAAaA,+DAA+DU;;;;eAIlHI;;;;oBAIKC;;;;;;;;;;;;UAYLC,iBAAAA,SAA0BN;;;;eAI1BV,aAAaiB,MAAMjB;;;;;;;;;;;UAWnBkB,kBAAAA,SAA2BF;;;;;;;;;;;;;UAa3BG,eAAAA,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,WAAAA,GAFc,QAAA,GAAA,UAAA,GAAA,OAAA,GAAA,SAAA,GAAA,QAAA,GAAA,kBAAA,GAAA,mBAAA,GAAA,mBAAA,GAAA,UAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;AACdD,UAEKE,IAAAA,CAFK;EACVD,IAAAA,EAAAA,MAAAA;EACKC,KAAAA,EAAI,OAAA,GAAA,IAAA;AAIrB;AAAwB,UAAPC,OAAAA,CAAO;;;;EAcF,MAAA,CAAA,EAVTC,MAUS,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAAA;EAELC;;;QAQFX,CAAAA,EAAAA,OAAAA;;;;;;MAqDFa,CAAAA,EA/DFL,IA+DEK,GA/DKL,IA+DLK,EAAAA,GAAAA,MAAAA,GAAAA,MAAAA,EAAAA;;AAkBMR,UA/EFM,iBAAAA,CA+EEN;;;;EA2BFS,KAAAA,CAAAA,EAtGLJ,MAsGKI,CAAAA,MAAiB,EAAA,OAAA,CAAA,GAAA,IAAA;EAAA;;;UAIjBC,CAAAA,EAtGFf,QAsGEe;;;;EAgBAE,MAAAA,CAAAA,EAlHJlB,MAkHIkB;EAAiB;;;;SAASN,CAAAA,EAAAA,OAAAA;EAAiB;AAe5D;AAaA;;;;;eAjIiBC,KAAKd;;;;;;;;;;;;;eAaLQ;;;;;;;;;;;;;;;;;;;sBAmBOJ;;;;WAIXW;;;;;;;iBAOMT;;;;;;;;;;;iBAWAC;;;;;;;;;;;;;YAaLI;;;;;;;;;;;;qBAYSZ;;UAENiB,sCAAsCb,aAAaA,+DAA+DU;;;;eAIlHI;;;;oBAIKC;;;;;;;;;;;;UAYLC,iBAAAA,SAA0BN;;;;eAI1BV,aAAaiB,MAAMjB;;;;;;;;;;;UAWnBkB,kBAAAA,SAA2BF;;;;;;;;;;;;;UAa3BG,eAAAA,SAAwBN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.stream.d.cts","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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AAA,GAAA,CAAA,CAAA,CAAA;IAAA,IAAA,EAAA,MAAA;IAAqB3C,IAAAA,EAAAA,MAAAA,EAAAA;IAAaA,MAAAA,EAAAA,MAAAA;IAA2FsC,QAAAA,EAxC1IJ,MAwC0II,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;IAAoDM,UAAAA,EAAAA,MAAAA,EAAAA;IAAoDH,IAAAA,EAAAA,OAAAA;;;;AAA1BC,KAlC9NP,yBAAAA,GAA4BhC,UAkCkMuC,CAlCvLT,iBAkCuLS,CAAAA;;;;;AAA+EL,KA7B7SD,mBAAAA,GA6B6SC;KAAxHQ,EAAAA,MAAAA;EAAc,KAAA,EAAA,UAAA;;;;;KAtB1MR,qCAAqCrC,aAAaA,kDAAkDsC;UAC7FjC,kBAAkBiC;WACjBzB,mBAAmB0B;UACpBvB,kBAAkBwB;SACnBT;YACGF;oBACQrB;SACXiB,iBAAiBa,YAAYC;eACvBZ,uBAAuBW;UAC5BL;EACVQ,oBAAoBzC,eAAeyC,sBAAsBA,eAAe9B,mBAAmBD,sBAAsB0B;KAC9GM,8CAA8C1C,aAAaA,kDAAkDsC;UACtG/B,0BAA0B+B;WACzBvB,2BAA2BwB;UAC5BrB,0BAA0BsB;SAC3BR;YACGF;oBACQrB;UACV0B;SACDT,yBAAyBY,YAAYC;eAC/BX,+BAA+BU;EAC9CG,oBAAoBzC,eAAeyC,sBAAsBA,eAAe7B,2BAA2BF,sBAAsB0B;KAC/GO,wCAAwC3C,aAAaA,2FAA2FsC,qCAAqCO,eAAeD,0BAA0BF,0BAA0BD,aAAaH,YAAYC,aAAaC,eAAeH,iBAAiBI,aAAaH,YAAYC,aAAaC"}
|
|
1
|
+
{"version":3,"file":"types.stream.d.cts","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, TSt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","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,wBAAAA,GA2CuEM;OAAnBD,EAAAA,UAAAA;MAAX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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,CAAA,GAjCEJ,UAiCF,CAjCaE,iBAiCb,CA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,sBAAsB0B;KAC/GO,wCAAwC3C,aAAaA,2FAA2FsC,qCAAqCO,eAAeD,0BAA0BF,0BAA0BD,aAAaH,YAAYC,aAAaC,eAAeH,iBAAiBI,aAAaH,YAAYC,aAAaC"}
|
package/dist/ui/manager.cjs
CHANGED
|
@@ -76,14 +76,15 @@ var StreamManager = class {
|
|
|
76
76
|
};
|
|
77
77
|
getMutateFn = (kind, historyValues) => {
|
|
78
78
|
return (update) => {
|
|
79
|
+
const stateValues = (this.state.values ?? [null, "stream"])[0];
|
|
79
80
|
const prev = {
|
|
80
81
|
...historyValues,
|
|
81
|
-
...
|
|
82
|
+
...stateValues ?? {}
|
|
82
83
|
};
|
|
83
84
|
const next = typeof update === "function" ? update(prev) : update;
|
|
84
85
|
this.setStreamValues({
|
|
85
86
|
...prev,
|
|
86
|
-
...next
|
|
87
|
+
...next ?? {}
|
|
87
88
|
}, kind);
|
|
88
89
|
};
|
|
89
90
|
};
|
|
@@ -120,8 +121,8 @@ var StreamManager = class {
|
|
|
120
121
|
if (this.matchEventType("checkpoints", event, data)) options.callbacks.onCheckpointEvent?.(data, { namespace });
|
|
121
122
|
if (this.matchEventType("tasks", event, data)) options.callbacks.onTaskEvent?.(data, { namespace });
|
|
122
123
|
if (this.matchEventType("debug", event, data)) options.callbacks.onDebugEvent?.(data, { namespace });
|
|
123
|
-
if (event === "values") if ("__interrupt__" in data) this.setStreamValues((prev) => ({
|
|
124
|
-
...prev,
|
|
124
|
+
if (event === "values") if (data != null && typeof data === "object" && "__interrupt__" in data) this.setStreamValues((prev) => ({
|
|
125
|
+
...prev ?? {},
|
|
125
126
|
...data
|
|
126
127
|
}));
|
|
127
128
|
else this.setStreamValues(data);
|
|
@@ -135,7 +136,7 @@ var StreamManager = class {
|
|
|
135
136
|
this.setStreamValues((streamValues) => {
|
|
136
137
|
const values$1 = {
|
|
137
138
|
...options.initialValues,
|
|
138
|
-
...streamValues
|
|
139
|
+
...streamValues ?? {}
|
|
139
140
|
};
|
|
140
141
|
let messages = options.getMessages(values$1).slice();
|
|
141
142
|
const { chunk, index } = this.messages.get(messageId, messages.length) ?? {};
|