@langchain/langgraph-sdk 1.8.10 → 1.9.0
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/README.md +90 -43
- package/dist/client/assistants/index.cjs +180 -0
- package/dist/client/assistants/index.cjs.map +1 -0
- package/dist/client/assistants/index.d.cts +155 -0
- package/dist/client/assistants/index.d.cts.map +1 -0
- package/dist/client/assistants/index.d.ts +155 -0
- package/dist/client/assistants/index.d.ts.map +1 -0
- package/dist/client/assistants/index.js +180 -0
- package/dist/client/assistants/index.js.map +1 -0
- package/dist/client/base.cjs +190 -0
- package/dist/client/base.cjs.map +1 -0
- package/dist/client/base.d.cts +84 -0
- package/dist/client/base.d.cts.map +1 -0
- package/dist/client/base.d.ts +84 -0
- package/dist/client/base.d.ts.map +1 -0
- package/dist/client/base.js +188 -0
- package/dist/client/base.js.map +1 -0
- package/dist/client/crons/index.cjs +159 -0
- package/dist/client/crons/index.cjs.map +1 -0
- package/dist/client/crons/index.d.cts +71 -0
- package/dist/client/crons/index.d.cts.map +1 -0
- package/dist/client/crons/index.d.ts +71 -0
- package/dist/client/crons/index.d.ts.map +1 -0
- package/dist/client/crons/index.js +159 -0
- package/dist/client/crons/index.js.map +1 -0
- package/dist/client/index.cjs +84 -0
- package/dist/client/index.cjs.map +1 -0
- package/dist/client/index.d.cts +63 -0
- package/dist/client/index.d.cts.map +1 -0
- package/dist/client/index.d.ts +63 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +83 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/runs/index.cjs +275 -0
- package/dist/client/runs/index.cjs.map +1 -0
- package/dist/client/runs/index.d.cts +123 -0
- package/dist/client/runs/index.d.cts.map +1 -0
- package/dist/client/runs/index.d.ts +123 -0
- package/dist/client/runs/index.d.ts.map +1 -0
- package/dist/client/runs/index.js +275 -0
- package/dist/client/runs/index.js.map +1 -0
- package/dist/client/store/index.cjs +128 -0
- package/dist/client/store/index.cjs.map +1 -0
- package/dist/client/store/index.d.cts +75 -0
- package/dist/client/store/index.d.cts.map +1 -0
- package/dist/client/store/index.d.ts +75 -0
- package/dist/client/store/index.d.ts.map +1 -0
- package/dist/client/store/index.js +128 -0
- package/dist/client/store/index.js.map +1 -0
- package/dist/client/stream/error.cjs +18 -0
- package/dist/client/stream/error.cjs.map +1 -0
- package/dist/client/stream/error.d.cts +14 -0
- package/dist/client/stream/error.d.cts.map +1 -0
- package/dist/client/stream/error.d.ts +14 -0
- package/dist/client/stream/error.d.ts.map +1 -0
- package/dist/client/stream/error.js +18 -0
- package/dist/client/stream/error.js.map +1 -0
- package/dist/client/stream/handles/index.cjs +3 -0
- package/dist/client/stream/handles/index.d.ts +3 -0
- package/dist/client/stream/handles/index.js +4 -0
- package/dist/client/stream/handles/subagents.cjs +263 -0
- package/dist/client/stream/handles/subagents.cjs.map +1 -0
- package/dist/client/stream/handles/subagents.d.cts +45 -0
- package/dist/client/stream/handles/subagents.d.cts.map +1 -0
- package/dist/client/stream/handles/subagents.d.ts +45 -0
- package/dist/client/stream/handles/subagents.d.ts.map +1 -0
- package/dist/client/stream/handles/subagents.js +262 -0
- package/dist/client/stream/handles/subagents.js.map +1 -0
- package/dist/client/stream/handles/subgraphs.cjs +352 -0
- package/dist/client/stream/handles/subgraphs.cjs.map +1 -0
- package/dist/client/stream/handles/subgraphs.d.cts +82 -0
- package/dist/client/stream/handles/subgraphs.d.cts.map +1 -0
- package/dist/client/stream/handles/subgraphs.d.ts +82 -0
- package/dist/client/stream/handles/subgraphs.d.ts.map +1 -0
- package/dist/client/stream/handles/subgraphs.js +351 -0
- package/dist/client/stream/handles/subgraphs.js.map +1 -0
- package/dist/client/stream/handles/tools.cjs +92 -0
- package/dist/client/stream/handles/tools.cjs.map +1 -0
- package/dist/client/stream/handles/tools.d.cts +26 -0
- package/dist/client/stream/handles/tools.d.cts.map +1 -0
- package/dist/client/stream/handles/tools.d.ts +26 -0
- package/dist/client/stream/handles/tools.d.ts.map +1 -0
- package/dist/client/stream/handles/tools.js +92 -0
- package/dist/client/stream/handles/tools.js.map +1 -0
- package/dist/client/stream/index.cjs +1368 -0
- package/dist/client/stream/index.cjs.map +1 -0
- package/dist/client/stream/index.d.cts +238 -0
- package/dist/client/stream/index.d.cts.map +1 -0
- package/dist/client/stream/index.d.ts +238 -0
- package/dist/client/stream/index.d.ts.map +1 -0
- package/dist/client/stream/index.js +1367 -0
- package/dist/client/stream/index.js.map +1 -0
- package/dist/client/stream/media.cjs +506 -0
- package/dist/client/stream/media.cjs.map +1 -0
- package/dist/client/stream/media.d.cts +164 -0
- package/dist/client/stream/media.d.cts.map +1 -0
- package/dist/client/stream/media.d.ts +164 -0
- package/dist/client/stream/media.d.ts.map +1 -0
- package/dist/client/stream/media.js +505 -0
- package/dist/client/stream/media.js.map +1 -0
- package/dist/client/stream/messages.cjs +635 -0
- package/dist/client/stream/messages.cjs.map +1 -0
- package/dist/client/stream/messages.d.cts +139 -0
- package/dist/client/stream/messages.d.cts.map +1 -0
- package/dist/client/stream/messages.d.ts +139 -0
- package/dist/client/stream/messages.d.ts.map +1 -0
- package/dist/client/stream/messages.js +631 -0
- package/dist/client/stream/messages.js.map +1 -0
- package/dist/client/stream/multi-cursor-buffer.cjs +55 -0
- package/dist/client/stream/multi-cursor-buffer.cjs.map +1 -0
- package/dist/client/stream/multi-cursor-buffer.js +55 -0
- package/dist/client/stream/multi-cursor-buffer.js.map +1 -0
- package/dist/client/stream/subscription.cjs +85 -0
- package/dist/client/stream/subscription.cjs.map +1 -0
- package/dist/client/stream/subscription.d.cts +22 -0
- package/dist/client/stream/subscription.d.cts.map +1 -0
- package/dist/client/stream/subscription.d.ts +22 -0
- package/dist/client/stream/subscription.d.ts.map +1 -0
- package/dist/client/stream/subscription.js +84 -0
- package/dist/client/stream/subscription.js.map +1 -0
- package/dist/client/stream/transport/agent-server.cjs +45 -0
- package/dist/client/stream/transport/agent-server.cjs.map +1 -0
- package/dist/client/stream/transport/agent-server.d.cts +39 -0
- package/dist/client/stream/transport/agent-server.d.cts.map +1 -0
- package/dist/client/stream/transport/agent-server.d.ts +39 -0
- package/dist/client/stream/transport/agent-server.d.ts.map +1 -0
- package/dist/client/stream/transport/agent-server.js +45 -0
- package/dist/client/stream/transport/agent-server.js.map +1 -0
- package/dist/client/stream/transport/constants.cjs +10 -0
- package/dist/client/stream/transport/constants.cjs.map +1 -0
- package/dist/client/stream/transport/constants.js +10 -0
- package/dist/client/stream/transport/constants.js.map +1 -0
- package/dist/client/stream/transport/decoder.cjs +115 -0
- package/dist/client/stream/transport/decoder.cjs.map +1 -0
- package/dist/client/stream/transport/decoder.js +114 -0
- package/dist/client/stream/transport/decoder.js.map +1 -0
- package/dist/client/stream/transport/http.cjs +183 -0
- package/dist/client/stream/transport/http.cjs.map +1 -0
- package/dist/client/stream/transport/http.d.cts +45 -0
- package/dist/client/stream/transport/http.d.cts.map +1 -0
- package/dist/client/stream/transport/http.d.ts +45 -0
- package/dist/client/stream/transport/http.d.ts.map +1 -0
- package/dist/client/stream/transport/http.js +183 -0
- package/dist/client/stream/transport/http.js.map +1 -0
- package/dist/client/stream/transport/index.cjs +3 -0
- package/dist/client/stream/transport/index.js +4 -0
- package/dist/client/stream/transport/queue.cjs +55 -0
- package/dist/client/stream/transport/queue.cjs.map +1 -0
- package/dist/client/stream/transport/queue.js +55 -0
- package/dist/client/stream/transport/queue.js.map +1 -0
- package/dist/client/stream/transport/stream.cjs +79 -0
- package/dist/client/stream/transport/stream.cjs.map +1 -0
- package/dist/client/stream/transport/stream.js +79 -0
- package/dist/client/stream/transport/stream.js.map +1 -0
- package/dist/client/stream/transport/types.d.cts +29 -0
- package/dist/client/stream/transport/types.d.cts.map +1 -0
- package/dist/client/stream/transport/types.d.ts +29 -0
- package/dist/client/stream/transport/types.d.ts.map +1 -0
- package/dist/client/stream/transport/utils.cjs +45 -0
- package/dist/client/stream/transport/utils.cjs.map +1 -0
- package/dist/client/stream/transport/utils.js +39 -0
- package/dist/client/stream/transport/utils.js.map +1 -0
- package/dist/client/stream/transport/websocket.cjs +155 -0
- package/dist/client/stream/transport/websocket.cjs.map +1 -0
- package/dist/client/stream/transport/websocket.d.cts +36 -0
- package/dist/client/stream/transport/websocket.d.cts.map +1 -0
- package/dist/client/stream/transport/websocket.d.ts +36 -0
- package/dist/client/stream/transport/websocket.d.ts.map +1 -0
- package/dist/client/stream/transport/websocket.js +155 -0
- package/dist/client/stream/transport/websocket.js.map +1 -0
- package/dist/client/stream/transport.d.cts +104 -0
- package/dist/client/stream/transport.d.cts.map +1 -0
- package/dist/client/stream/transport.d.ts +104 -0
- package/dist/client/stream/transport.d.ts.map +1 -0
- package/dist/client/stream/types.d.cts +208 -0
- package/dist/client/stream/types.d.cts.map +1 -0
- package/dist/client/stream/types.d.ts +208 -0
- package/dist/client/stream/types.d.ts.map +1 -0
- package/dist/client/threads/index.cjs +271 -0
- package/dist/client/threads/index.cjs.map +1 -0
- package/dist/client/threads/index.d.cts +235 -0
- package/dist/client/threads/index.d.cts.map +1 -0
- package/dist/client/threads/index.d.ts +235 -0
- package/dist/client/threads/index.d.ts.map +1 -0
- package/dist/client/threads/index.js +270 -0
- package/dist/client/threads/index.js.map +1 -0
- package/dist/client/ui-internal/index.cjs +29 -0
- package/dist/client/ui-internal/index.cjs.map +1 -0
- package/dist/client/ui-internal/index.d.cts +11 -0
- package/dist/client/ui-internal/index.d.cts.map +1 -0
- package/dist/client/ui-internal/index.d.ts +11 -0
- package/dist/client/ui-internal/index.d.ts.map +1 -0
- package/dist/client/ui-internal/index.js +29 -0
- package/dist/client/ui-internal/index.js.map +1 -0
- package/dist/client.cjs +35 -1308
- package/dist/client.d.cts +19 -857
- package/dist/client.d.ts +19 -857
- package/dist/client.js +16 -1301
- package/dist/index.cjs +25 -4
- package/dist/index.d.cts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +14 -3
- package/dist/react/stream.cjs.map +1 -1
- package/dist/react/stream.custom.cjs +1 -1
- package/dist/react/stream.custom.js +1 -1
- package/dist/react/stream.d.cts +2 -1
- package/dist/react/stream.d.cts.map +1 -1
- package/dist/react/stream.d.ts +2 -1
- package/dist/react/stream.d.ts.map +1 -1
- package/dist/react/stream.js.map +1 -1
- package/dist/react/stream.lgp.cjs +6 -5
- package/dist/react/stream.lgp.cjs.map +1 -1
- package/dist/react/stream.lgp.js +4 -3
- package/dist/react/stream.lgp.js.map +1 -1
- package/dist/react/types.d.cts +1 -1
- package/dist/react/types.d.ts +1 -1
- package/dist/react/types.d.ts.map +1 -1
- package/dist/react-ui/server/server.cjs +1 -1
- package/dist/react-ui/server/server.cjs.map +1 -1
- package/dist/react-ui/server/server.js +1 -1
- package/dist/react-ui/server/server.js.map +1 -1
- package/dist/react-ui/types.cjs.map +1 -1
- package/dist/react-ui/types.d.cts +1 -1
- package/dist/react-ui/types.d.cts.map +1 -1
- package/dist/react-ui/types.d.ts +1 -1
- package/dist/react-ui/types.d.ts.map +1 -1
- package/dist/react-ui/types.js.map +1 -1
- package/dist/stream/assembled-to-message.cjs +121 -0
- package/dist/stream/assembled-to-message.cjs.map +1 -0
- package/dist/stream/assembled-to-message.d.cts +35 -0
- package/dist/stream/assembled-to-message.d.cts.map +1 -0
- package/dist/stream/assembled-to-message.d.ts +35 -0
- package/dist/stream/assembled-to-message.d.ts.map +1 -0
- package/dist/stream/assembled-to-message.js +119 -0
- package/dist/stream/assembled-to-message.js.map +1 -0
- package/dist/stream/channel-registry.cjs +224 -0
- package/dist/stream/channel-registry.cjs.map +1 -0
- package/dist/stream/channel-registry.d.cts +102 -0
- package/dist/stream/channel-registry.d.cts.map +1 -0
- package/dist/stream/channel-registry.d.ts +102 -0
- package/dist/stream/channel-registry.d.ts.map +1 -0
- package/dist/stream/channel-registry.js +224 -0
- package/dist/stream/channel-registry.js.map +1 -0
- package/dist/stream/constants.cjs +11 -0
- package/dist/stream/constants.cjs.map +1 -0
- package/dist/stream/constants.d.cts +10 -0
- package/dist/stream/constants.d.cts.map +1 -0
- package/dist/stream/constants.d.ts +10 -0
- package/dist/stream/constants.d.ts.map +1 -0
- package/dist/stream/constants.js +11 -0
- package/dist/stream/constants.js.map +1 -0
- package/dist/stream/controller.cjs +933 -0
- package/dist/stream/controller.cjs.map +1 -0
- package/dist/stream/controller.d.cts +135 -0
- package/dist/stream/controller.d.cts.map +1 -0
- package/dist/stream/controller.d.ts +135 -0
- package/dist/stream/controller.d.ts.map +1 -0
- package/dist/stream/controller.js +910 -0
- package/dist/stream/controller.js.map +1 -0
- package/dist/stream/discovery/index.d.ts +2 -0
- package/dist/stream/discovery/subagents.cjs +235 -0
- package/dist/stream/discovery/subagents.cjs.map +1 -0
- package/dist/stream/discovery/subagents.d.cts +18 -0
- package/dist/stream/discovery/subagents.d.cts.map +1 -0
- package/dist/stream/discovery/subagents.d.ts +18 -0
- package/dist/stream/discovery/subagents.d.ts.map +1 -0
- package/dist/stream/discovery/subagents.js +235 -0
- package/dist/stream/discovery/subagents.js.map +1 -0
- package/dist/stream/discovery/subgraphs.cjs +153 -0
- package/dist/stream/discovery/subgraphs.cjs.map +1 -0
- package/dist/stream/discovery/subgraphs.d.cts +19 -0
- package/dist/stream/discovery/subgraphs.d.cts.map +1 -0
- package/dist/stream/discovery/subgraphs.d.ts +19 -0
- package/dist/stream/discovery/subgraphs.d.ts.map +1 -0
- package/dist/stream/discovery/subgraphs.js +153 -0
- package/dist/stream/discovery/subgraphs.js.map +1 -0
- package/dist/stream/index.cjs +36 -0
- package/dist/stream/index.d.cts +25 -0
- package/dist/stream/index.d.ts +25 -0
- package/dist/stream/index.js +16 -0
- package/dist/stream/lifecycle-loading-tracker.cjs +83 -0
- package/dist/stream/lifecycle-loading-tracker.cjs.map +1 -0
- package/dist/stream/lifecycle-loading-tracker.js +83 -0
- package/dist/stream/lifecycle-loading-tracker.js.map +1 -0
- package/dist/stream/message-metadata-tracker.cjs +165 -0
- package/dist/stream/message-metadata-tracker.cjs.map +1 -0
- package/dist/stream/message-metadata-tracker.d.cts +24 -0
- package/dist/stream/message-metadata-tracker.d.cts.map +1 -0
- package/dist/stream/message-metadata-tracker.d.ts +24 -0
- package/dist/stream/message-metadata-tracker.d.ts.map +1 -0
- package/dist/stream/message-metadata-tracker.js +165 -0
- package/dist/stream/message-metadata-tracker.js.map +1 -0
- package/dist/stream/message-reconciliation.cjs +118 -0
- package/dist/stream/message-reconciliation.cjs.map +1 -0
- package/dist/stream/message-reconciliation.js +115 -0
- package/dist/stream/message-reconciliation.js.map +1 -0
- package/dist/stream/namespace.cjs +54 -0
- package/dist/stream/namespace.cjs.map +1 -0
- package/dist/stream/namespace.js +49 -0
- package/dist/stream/namespace.js.map +1 -0
- package/dist/stream/projections/channel.cjs +53 -0
- package/dist/stream/projections/channel.cjs.map +1 -0
- package/dist/stream/projections/channel.d.cts +22 -0
- package/dist/stream/projections/channel.d.cts.map +1 -0
- package/dist/stream/projections/channel.d.ts +22 -0
- package/dist/stream/projections/channel.d.ts.map +1 -0
- package/dist/stream/projections/channel.js +53 -0
- package/dist/stream/projections/channel.js.map +1 -0
- package/dist/stream/projections/extension.cjs +29 -0
- package/dist/stream/projections/extension.cjs.map +1 -0
- package/dist/stream/projections/extension.d.cts +7 -0
- package/dist/stream/projections/extension.d.cts.map +1 -0
- package/dist/stream/projections/extension.d.ts +7 -0
- package/dist/stream/projections/extension.d.ts.map +1 -0
- package/dist/stream/projections/extension.js +29 -0
- package/dist/stream/projections/extension.js.map +1 -0
- package/dist/stream/projections/index.cjs +6 -0
- package/dist/stream/projections/index.d.ts +6 -0
- package/dist/stream/projections/index.js +7 -0
- package/dist/stream/projections/media.cjs +81 -0
- package/dist/stream/projections/media.cjs.map +1 -0
- package/dist/stream/projections/media.d.cts +18 -0
- package/dist/stream/projections/media.d.cts.map +1 -0
- package/dist/stream/projections/media.d.ts +18 -0
- package/dist/stream/projections/media.d.ts.map +1 -0
- package/dist/stream/projections/media.js +78 -0
- package/dist/stream/projections/media.js.map +1 -0
- package/dist/stream/projections/messages.cjs +121 -0
- package/dist/stream/projections/messages.cjs.map +1 -0
- package/dist/stream/projections/messages.d.cts +8 -0
- package/dist/stream/projections/messages.d.cts.map +1 -0
- package/dist/stream/projections/messages.d.ts +8 -0
- package/dist/stream/projections/messages.d.ts.map +1 -0
- package/dist/stream/projections/messages.js +121 -0
- package/dist/stream/projections/messages.js.map +1 -0
- package/dist/stream/projections/runtime.cjs +44 -0
- package/dist/stream/projections/runtime.cjs.map +1 -0
- package/dist/stream/projections/runtime.js +44 -0
- package/dist/stream/projections/runtime.js.map +1 -0
- package/dist/stream/projections/tool-calls.cjs +50 -0
- package/dist/stream/projections/tool-calls.cjs.map +1 -0
- package/dist/stream/projections/tool-calls.d.cts +8 -0
- package/dist/stream/projections/tool-calls.d.cts.map +1 -0
- package/dist/stream/projections/tool-calls.d.ts +8 -0
- package/dist/stream/projections/tool-calls.d.ts.map +1 -0
- package/dist/stream/projections/tool-calls.js +50 -0
- package/dist/stream/projections/tool-calls.js.map +1 -0
- package/dist/stream/projections/values.cjs +52 -0
- package/dist/stream/projections/values.cjs.map +1 -0
- package/dist/stream/projections/values.d.cts +7 -0
- package/dist/stream/projections/values.d.cts.map +1 -0
- package/dist/stream/projections/values.d.ts +6 -0
- package/dist/stream/projections/values.d.ts.map +1 -0
- package/dist/stream/projections/values.js +52 -0
- package/dist/stream/projections/values.js.map +1 -0
- package/dist/stream/root-message-projection.cjs +256 -0
- package/dist/stream/root-message-projection.cjs.map +1 -0
- package/dist/stream/root-message-projection.js +256 -0
- package/dist/stream/root-message-projection.js.map +1 -0
- package/dist/stream/store.cjs +32 -0
- package/dist/stream/store.cjs.map +1 -0
- package/dist/stream/store.d.cts +37 -0
- package/dist/stream/store.d.cts.map +1 -0
- package/dist/stream/store.d.ts +37 -0
- package/dist/stream/store.d.ts.map +1 -0
- package/dist/stream/store.js +32 -0
- package/dist/stream/store.js.map +1 -0
- package/dist/stream/submit-coordinator.cjs +399 -0
- package/dist/stream/submit-coordinator.cjs.map +1 -0
- package/dist/stream/submit-coordinator.d.cts +27 -0
- package/dist/stream/submit-coordinator.d.cts.map +1 -0
- package/dist/stream/submit-coordinator.d.ts +27 -0
- package/dist/stream/submit-coordinator.d.ts.map +1 -0
- package/dist/stream/submit-coordinator.js +397 -0
- package/dist/stream/submit-coordinator.js.map +1 -0
- package/dist/stream/tool-calls.cjs +15 -0
- package/dist/stream/tool-calls.cjs.map +1 -0
- package/dist/stream/tool-calls.js +15 -0
- package/dist/stream/tool-calls.js.map +1 -0
- package/dist/stream/types-inference.d.cts +43 -0
- package/dist/stream/types-inference.d.cts.map +1 -0
- package/dist/stream/types-inference.d.ts +43 -0
- package/dist/stream/types-inference.d.ts.map +1 -0
- package/dist/stream/types.d.cts +354 -0
- package/dist/stream/types.d.cts.map +1 -0
- package/dist/stream/types.d.ts +354 -0
- package/dist/stream/types.d.ts.map +1 -0
- package/dist/types.d.cts +2 -1
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +3 -3
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +1 -1
- package/dist/ui/manager.cjs +1 -1
- package/dist/ui/manager.js +1 -1
- package/dist/ui/messages.cjs +50 -7
- package/dist/ui/messages.cjs.map +1 -1
- package/dist/ui/messages.d.cts.map +1 -1
- package/dist/ui/messages.d.ts.map +1 -1
- package/dist/ui/messages.js +51 -9
- package/dist/ui/messages.js.map +1 -1
- package/dist/ui/orchestrator-custom.cjs +1 -1
- package/dist/ui/orchestrator-custom.js +1 -1
- package/dist/ui/orchestrator.cjs +2 -2
- package/dist/ui/orchestrator.d.cts +1 -1
- package/dist/ui/orchestrator.d.ts +1 -1
- package/dist/ui/orchestrator.d.ts.map +1 -1
- package/dist/ui/orchestrator.js +2 -2
- package/dist/ui/stream/agent.d.cts +1 -1
- package/dist/ui/stream/agent.d.cts.map +1 -1
- package/dist/ui/stream/agent.d.ts +1 -1
- package/dist/ui/stream/agent.d.ts.map +1 -1
- package/dist/ui/stream/base.d.cts +7 -6
- package/dist/ui/stream/base.d.cts.map +1 -1
- package/dist/ui/stream/base.d.ts +7 -6
- package/dist/ui/stream/base.d.ts.map +1 -1
- package/dist/ui/stream/deep-agent.d.cts +1 -1
- package/dist/ui/stream/deep-agent.d.cts.map +1 -1
- package/dist/ui/stream/deep-agent.d.ts +1 -1
- package/dist/ui/stream/deep-agent.d.ts.map +1 -1
- package/dist/ui/stream/index.d.cts +4 -4
- package/dist/ui/stream/index.d.cts.map +1 -1
- package/dist/ui/stream/index.d.ts +4 -4
- package/dist/ui/stream/index.d.ts.map +1 -1
- package/dist/ui/types.d.cts +3 -2
- package/dist/ui/types.d.cts.map +1 -1
- package/dist/ui/types.d.ts +2 -1
- package/dist/ui/types.d.ts.map +1 -1
- package/package.json +18 -8
- package/dist/client.cjs.map +0 -1
- package/dist/client.d.cts.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js.map +0 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { Assistant, AssistantGraph, AssistantSelectField, AssistantSortBy, AssistantVersion, AssistantsSearchResponse, Config, GraphSchema, Metadata, SortOrder, Subgraphs } from "../../schema.js";
|
|
2
|
+
import { OnConflictBehavior } from "../../types.js";
|
|
3
|
+
import { BaseClient } from "../base.js";
|
|
4
|
+
|
|
5
|
+
//#region src/client/assistants/index.d.ts
|
|
6
|
+
declare class AssistantsClient extends BaseClient {
|
|
7
|
+
/**
|
|
8
|
+
* Get an assistant by ID.
|
|
9
|
+
*
|
|
10
|
+
* @param assistantId The ID of the assistant.
|
|
11
|
+
* @returns Assistant
|
|
12
|
+
*/
|
|
13
|
+
get(assistantId: string, options?: {
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}): Promise<Assistant>;
|
|
16
|
+
/**
|
|
17
|
+
* Get the JSON representation of the graph assigned to a runnable
|
|
18
|
+
* @param assistantId The ID of the assistant.
|
|
19
|
+
* @param options.xray Whether to include subgraphs in the serialized graph representation. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included.
|
|
20
|
+
* @returns Serialized graph
|
|
21
|
+
*/
|
|
22
|
+
getGraph(assistantId: string, options?: {
|
|
23
|
+
xray?: boolean | number;
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
}): Promise<AssistantGraph>;
|
|
26
|
+
/**
|
|
27
|
+
* Get the state and config schema of the graph assigned to a runnable
|
|
28
|
+
* @param assistantId The ID of the assistant.
|
|
29
|
+
* @returns Graph schema
|
|
30
|
+
*/
|
|
31
|
+
getSchemas(assistantId: string, options?: {
|
|
32
|
+
signal?: AbortSignal;
|
|
33
|
+
}): Promise<GraphSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* Get the schemas of an assistant by ID.
|
|
36
|
+
*
|
|
37
|
+
* @param assistantId The ID of the assistant to get the schema of.
|
|
38
|
+
* @param options Additional options for getting subgraphs, such as namespace or recursion extraction.
|
|
39
|
+
* @returns The subgraphs of the assistant.
|
|
40
|
+
*/
|
|
41
|
+
getSubgraphs(assistantId: string, options?: {
|
|
42
|
+
namespace?: string;
|
|
43
|
+
recurse?: boolean;
|
|
44
|
+
signal?: AbortSignal;
|
|
45
|
+
}): Promise<Subgraphs>;
|
|
46
|
+
/**
|
|
47
|
+
* Create a new assistant.
|
|
48
|
+
* @param payload Payload for creating an assistant.
|
|
49
|
+
* @returns The created assistant.
|
|
50
|
+
*/
|
|
51
|
+
create(payload: {
|
|
52
|
+
graphId: string;
|
|
53
|
+
config?: Config;
|
|
54
|
+
context?: unknown;
|
|
55
|
+
metadata?: Metadata;
|
|
56
|
+
assistantId?: string;
|
|
57
|
+
ifExists?: OnConflictBehavior;
|
|
58
|
+
name?: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
signal?: AbortSignal;
|
|
61
|
+
}): Promise<Assistant>;
|
|
62
|
+
/**
|
|
63
|
+
* Update an assistant.
|
|
64
|
+
* @param assistantId ID of the assistant.
|
|
65
|
+
* @param payload Payload for updating the assistant.
|
|
66
|
+
* @returns The updated assistant.
|
|
67
|
+
*/
|
|
68
|
+
update(assistantId: string, payload: {
|
|
69
|
+
graphId?: string;
|
|
70
|
+
config?: Config;
|
|
71
|
+
context?: unknown;
|
|
72
|
+
metadata?: Metadata;
|
|
73
|
+
name?: string;
|
|
74
|
+
description?: string;
|
|
75
|
+
signal?: AbortSignal;
|
|
76
|
+
}): Promise<Assistant>;
|
|
77
|
+
/**
|
|
78
|
+
* Delete an assistant.
|
|
79
|
+
*
|
|
80
|
+
* @param assistantId ID of the assistant.
|
|
81
|
+
* @param deleteThreads If true, delete all threads with `metadata.assistant_id` equal to `assistantId`. Defaults to false.
|
|
82
|
+
*/
|
|
83
|
+
delete(assistantId: string, options?: {
|
|
84
|
+
signal?: AbortSignal;
|
|
85
|
+
deleteThreads?: boolean;
|
|
86
|
+
}): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* List assistants.
|
|
89
|
+
* @param query Query options.
|
|
90
|
+
* @returns List of assistants or, when includePagination is true, a mapping with the assistants and next cursor.
|
|
91
|
+
*/
|
|
92
|
+
search(query: {
|
|
93
|
+
graphId?: string;
|
|
94
|
+
name?: string;
|
|
95
|
+
metadata?: Metadata;
|
|
96
|
+
limit?: number;
|
|
97
|
+
offset?: number;
|
|
98
|
+
sortBy?: AssistantSortBy;
|
|
99
|
+
sortOrder?: SortOrder;
|
|
100
|
+
select?: AssistantSelectField[];
|
|
101
|
+
includePagination: true;
|
|
102
|
+
signal?: AbortSignal;
|
|
103
|
+
}): Promise<AssistantsSearchResponse>;
|
|
104
|
+
search(query?: {
|
|
105
|
+
graphId?: string;
|
|
106
|
+
name?: string;
|
|
107
|
+
metadata?: Metadata;
|
|
108
|
+
limit?: number;
|
|
109
|
+
offset?: number;
|
|
110
|
+
sortBy?: AssistantSortBy;
|
|
111
|
+
sortOrder?: SortOrder;
|
|
112
|
+
select?: AssistantSelectField[];
|
|
113
|
+
includePagination?: false;
|
|
114
|
+
signal?: AbortSignal;
|
|
115
|
+
}): Promise<Assistant[]>;
|
|
116
|
+
/**
|
|
117
|
+
* Count assistants matching filters.
|
|
118
|
+
*
|
|
119
|
+
* @param query.metadata Metadata to filter by. Exact match for each key/value.
|
|
120
|
+
* @param query.graphId Optional graph id to filter by.
|
|
121
|
+
* @param query.name Optional name to filter by.
|
|
122
|
+
* @returns Number of assistants matching the criteria.
|
|
123
|
+
*/
|
|
124
|
+
count(query?: {
|
|
125
|
+
metadata?: Metadata;
|
|
126
|
+
graphId?: string;
|
|
127
|
+
name?: string;
|
|
128
|
+
signal?: AbortSignal;
|
|
129
|
+
}): Promise<number>;
|
|
130
|
+
/**
|
|
131
|
+
* List all versions of an assistant.
|
|
132
|
+
*
|
|
133
|
+
* @param assistantId ID of the assistant.
|
|
134
|
+
* @returns List of assistant versions.
|
|
135
|
+
*/
|
|
136
|
+
getVersions(assistantId: string, payload?: {
|
|
137
|
+
metadata?: Metadata;
|
|
138
|
+
limit?: number;
|
|
139
|
+
offset?: number;
|
|
140
|
+
signal?: AbortSignal;
|
|
141
|
+
}): Promise<AssistantVersion[]>;
|
|
142
|
+
/**
|
|
143
|
+
* Change the version of an assistant.
|
|
144
|
+
*
|
|
145
|
+
* @param assistantId ID of the assistant.
|
|
146
|
+
* @param version The version to change to.
|
|
147
|
+
* @returns The updated assistant.
|
|
148
|
+
*/
|
|
149
|
+
setLatest(assistantId: string, version: number, options?: {
|
|
150
|
+
signal?: AbortSignal;
|
|
151
|
+
}): Promise<Assistant>;
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
export { AssistantsClient };
|
|
155
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/client/assistants/index.ts"],"mappings":";;;;;cAgBa,gBAAA,SAAyB,UAAA;;AAAtC;;;;;EAOQ,GAAA,CACJ,WAAA,UACA,OAAA;IAAY,MAAA,GAAS,WAAA;EAAA,IACpB,OAAA,CAAQ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,GAAY,SAAA;IACZ,MAAA,GAAS,oBAAA;IACT,iBAAA;IACA,MAAA,GAAS,WAAA;EAAA,IACP,OAAA,CAAQ,SAAA;EAxEC;;;;;;;;EA0HP,KAAA,CAAM,KAAA;IACV,QAAA,GAAW,QAAA;IACX,OAAA;IACA,IAAA;IACA,MAAA,GAAS,WAAA;EAAA,IACP,OAAA;EAjGmB;;;;;;EAmHjB,WAAA,CACJ,WAAA,UACA,OAAA;IACE,QAAA,GAAW,QAAA;IACX,KAAA;IACA,MAAA;IACA,MAAA,GAAS,WAAA;EAAA,IAEV,OAAA,CAAQ,gBAAA;EAnGA;;;;;;;EAyHL,SAAA,CACJ,WAAA,UACA,OAAA,UACA,OAAA;IAAY,MAAA,GAAS,WAAA;EAAA,IACpB,OAAA,CAAQ,SAAA;AAAA"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { BaseClient } from "../base.js";
|
|
2
|
+
//#region src/client/assistants/index.ts
|
|
3
|
+
var AssistantsClient = class extends BaseClient {
|
|
4
|
+
/**
|
|
5
|
+
* Get an assistant by ID.
|
|
6
|
+
*
|
|
7
|
+
* @param assistantId The ID of the assistant.
|
|
8
|
+
* @returns Assistant
|
|
9
|
+
*/
|
|
10
|
+
async get(assistantId, options) {
|
|
11
|
+
return this.fetch(`/assistants/${assistantId}`, { signal: options?.signal });
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get the JSON representation of the graph assigned to a runnable
|
|
15
|
+
* @param assistantId The ID of the assistant.
|
|
16
|
+
* @param options.xray Whether to include subgraphs in the serialized graph representation. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included.
|
|
17
|
+
* @returns Serialized graph
|
|
18
|
+
*/
|
|
19
|
+
async getGraph(assistantId, options) {
|
|
20
|
+
return this.fetch(`/assistants/${assistantId}/graph`, {
|
|
21
|
+
params: { xray: options?.xray },
|
|
22
|
+
signal: options?.signal
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the state and config schema of the graph assigned to a runnable
|
|
27
|
+
* @param assistantId The ID of the assistant.
|
|
28
|
+
* @returns Graph schema
|
|
29
|
+
*/
|
|
30
|
+
async getSchemas(assistantId, options) {
|
|
31
|
+
return this.fetch(`/assistants/${assistantId}/schemas`, { signal: options?.signal });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the schemas of an assistant by ID.
|
|
35
|
+
*
|
|
36
|
+
* @param assistantId The ID of the assistant to get the schema of.
|
|
37
|
+
* @param options Additional options for getting subgraphs, such as namespace or recursion extraction.
|
|
38
|
+
* @returns The subgraphs of the assistant.
|
|
39
|
+
*/
|
|
40
|
+
async getSubgraphs(assistantId, options) {
|
|
41
|
+
if (options?.namespace) return this.fetch(`/assistants/${assistantId}/subgraphs/${options.namespace}`, {
|
|
42
|
+
params: { recurse: options?.recurse },
|
|
43
|
+
signal: options?.signal
|
|
44
|
+
});
|
|
45
|
+
return this.fetch(`/assistants/${assistantId}/subgraphs`, {
|
|
46
|
+
params: { recurse: options?.recurse },
|
|
47
|
+
signal: options?.signal
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Create a new assistant.
|
|
52
|
+
* @param payload Payload for creating an assistant.
|
|
53
|
+
* @returns The created assistant.
|
|
54
|
+
*/
|
|
55
|
+
async create(payload) {
|
|
56
|
+
return this.fetch("/assistants", {
|
|
57
|
+
method: "POST",
|
|
58
|
+
json: {
|
|
59
|
+
graph_id: payload.graphId,
|
|
60
|
+
config: payload.config,
|
|
61
|
+
context: payload.context,
|
|
62
|
+
metadata: payload.metadata,
|
|
63
|
+
assistant_id: payload.assistantId,
|
|
64
|
+
if_exists: payload.ifExists,
|
|
65
|
+
name: payload.name,
|
|
66
|
+
description: payload.description
|
|
67
|
+
},
|
|
68
|
+
signal: payload.signal
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Update an assistant.
|
|
73
|
+
* @param assistantId ID of the assistant.
|
|
74
|
+
* @param payload Payload for updating the assistant.
|
|
75
|
+
* @returns The updated assistant.
|
|
76
|
+
*/
|
|
77
|
+
async update(assistantId, payload) {
|
|
78
|
+
return this.fetch(`/assistants/${assistantId}`, {
|
|
79
|
+
method: "PATCH",
|
|
80
|
+
json: {
|
|
81
|
+
graph_id: payload.graphId,
|
|
82
|
+
config: payload.config,
|
|
83
|
+
context: payload.context,
|
|
84
|
+
metadata: payload.metadata,
|
|
85
|
+
name: payload.name,
|
|
86
|
+
description: payload.description
|
|
87
|
+
},
|
|
88
|
+
signal: payload.signal
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Delete an assistant.
|
|
93
|
+
*
|
|
94
|
+
* @param assistantId ID of the assistant.
|
|
95
|
+
* @param deleteThreads If true, delete all threads with `metadata.assistant_id` equal to `assistantId`. Defaults to false.
|
|
96
|
+
*/
|
|
97
|
+
async delete(assistantId, options) {
|
|
98
|
+
return this.fetch(`/assistants/${assistantId}?delete_threads=${options?.deleteThreads ?? false}`, {
|
|
99
|
+
method: "DELETE",
|
|
100
|
+
signal: options?.signal
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
async search(query) {
|
|
104
|
+
const json = {
|
|
105
|
+
graph_id: query?.graphId ?? void 0,
|
|
106
|
+
name: query?.name ?? void 0,
|
|
107
|
+
metadata: query?.metadata ?? void 0,
|
|
108
|
+
limit: query?.limit ?? 10,
|
|
109
|
+
offset: query?.offset ?? 0,
|
|
110
|
+
sort_by: query?.sortBy ?? void 0,
|
|
111
|
+
sort_order: query?.sortOrder ?? void 0,
|
|
112
|
+
select: query?.select ?? void 0
|
|
113
|
+
};
|
|
114
|
+
const [assistants, response] = await this.fetch("/assistants/search", {
|
|
115
|
+
method: "POST",
|
|
116
|
+
json,
|
|
117
|
+
withResponse: true,
|
|
118
|
+
signal: query?.signal
|
|
119
|
+
});
|
|
120
|
+
if (query?.includePagination) return {
|
|
121
|
+
assistants,
|
|
122
|
+
next: response.headers.get("X-Pagination-Next")
|
|
123
|
+
};
|
|
124
|
+
return assistants;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Count assistants matching filters.
|
|
128
|
+
*
|
|
129
|
+
* @param query.metadata Metadata to filter by. Exact match for each key/value.
|
|
130
|
+
* @param query.graphId Optional graph id to filter by.
|
|
131
|
+
* @param query.name Optional name to filter by.
|
|
132
|
+
* @returns Number of assistants matching the criteria.
|
|
133
|
+
*/
|
|
134
|
+
async count(query) {
|
|
135
|
+
return this.fetch(`/assistants/count`, {
|
|
136
|
+
method: "POST",
|
|
137
|
+
json: {
|
|
138
|
+
metadata: query?.metadata ?? void 0,
|
|
139
|
+
graph_id: query?.graphId ?? void 0,
|
|
140
|
+
name: query?.name ?? void 0
|
|
141
|
+
},
|
|
142
|
+
signal: query?.signal
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* List all versions of an assistant.
|
|
147
|
+
*
|
|
148
|
+
* @param assistantId ID of the assistant.
|
|
149
|
+
* @returns List of assistant versions.
|
|
150
|
+
*/
|
|
151
|
+
async getVersions(assistantId, payload) {
|
|
152
|
+
return this.fetch(`/assistants/${assistantId}/versions`, {
|
|
153
|
+
method: "POST",
|
|
154
|
+
json: {
|
|
155
|
+
metadata: payload?.metadata ?? void 0,
|
|
156
|
+
limit: payload?.limit ?? 10,
|
|
157
|
+
offset: payload?.offset ?? 0
|
|
158
|
+
},
|
|
159
|
+
signal: payload?.signal
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Change the version of an assistant.
|
|
164
|
+
*
|
|
165
|
+
* @param assistantId ID of the assistant.
|
|
166
|
+
* @param version The version to change to.
|
|
167
|
+
* @returns The updated assistant.
|
|
168
|
+
*/
|
|
169
|
+
async setLatest(assistantId, version, options) {
|
|
170
|
+
return this.fetch(`/assistants/${assistantId}/latest`, {
|
|
171
|
+
method: "POST",
|
|
172
|
+
json: { version },
|
|
173
|
+
signal: options?.signal
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
//#endregion
|
|
178
|
+
export { AssistantsClient };
|
|
179
|
+
|
|
180
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/client/assistants/index.ts"],"sourcesContent":["import {\n Assistant,\n AssistantGraph,\n AssistantSortBy,\n AssistantSelectField,\n AssistantVersion,\n AssistantsSearchResponse,\n Config,\n GraphSchema,\n Metadata,\n SortOrder,\n Subgraphs,\n} from \"../../schema.js\";\nimport type { OnConflictBehavior } from \"../../types.js\";\nimport { BaseClient } from \"../base.js\";\n\nexport class AssistantsClient extends BaseClient {\n /**\n * Get an assistant by ID.\n *\n * @param assistantId The ID of the assistant.\n * @returns Assistant\n */\n async get(\n assistantId: string,\n options?: { signal?: AbortSignal }\n ): Promise<Assistant> {\n return this.fetch<Assistant>(`/assistants/${assistantId}`, {\n signal: options?.signal,\n });\n }\n\n /**\n * Get the JSON representation of the graph assigned to a runnable\n * @param assistantId The ID of the assistant.\n * @param options.xray Whether to include subgraphs in the serialized graph representation. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included.\n * @returns Serialized graph\n */\n async getGraph(\n assistantId: string,\n options?: { xray?: boolean | number; signal?: AbortSignal }\n ): Promise<AssistantGraph> {\n return this.fetch<AssistantGraph>(`/assistants/${assistantId}/graph`, {\n params: { xray: options?.xray },\n signal: options?.signal,\n });\n }\n\n /**\n * Get the state and config schema of the graph assigned to a runnable\n * @param assistantId The ID of the assistant.\n * @returns Graph schema\n */\n async getSchemas(\n assistantId: string,\n options?: { signal?: AbortSignal }\n ): Promise<GraphSchema> {\n return this.fetch<GraphSchema>(`/assistants/${assistantId}/schemas`, {\n signal: options?.signal,\n });\n }\n\n /**\n * Get the schemas of an assistant by ID.\n *\n * @param assistantId The ID of the assistant to get the schema of.\n * @param options Additional options for getting subgraphs, such as namespace or recursion extraction.\n * @returns The subgraphs of the assistant.\n */\n async getSubgraphs(\n assistantId: string,\n options?: {\n namespace?: string;\n recurse?: boolean;\n signal?: AbortSignal;\n }\n ): Promise<Subgraphs> {\n if (options?.namespace) {\n return this.fetch<Subgraphs>(\n `/assistants/${assistantId}/subgraphs/${options.namespace}`,\n { params: { recurse: options?.recurse }, signal: options?.signal }\n );\n }\n return this.fetch<Subgraphs>(`/assistants/${assistantId}/subgraphs`, {\n params: { recurse: options?.recurse },\n signal: options?.signal,\n });\n }\n\n /**\n * Create a new assistant.\n * @param payload Payload for creating an assistant.\n * @returns The created assistant.\n */\n async create(payload: {\n graphId: string;\n config?: Config;\n context?: unknown;\n metadata?: Metadata;\n assistantId?: string;\n ifExists?: OnConflictBehavior;\n name?: string;\n description?: string;\n signal?: AbortSignal;\n }): Promise<Assistant> {\n return this.fetch<Assistant>(\"/assistants\", {\n method: \"POST\",\n json: {\n graph_id: payload.graphId,\n config: payload.config,\n context: payload.context,\n metadata: payload.metadata,\n assistant_id: payload.assistantId,\n if_exists: payload.ifExists,\n name: payload.name,\n description: payload.description,\n },\n signal: payload.signal,\n });\n }\n\n /**\n * Update an assistant.\n * @param assistantId ID of the assistant.\n * @param payload Payload for updating the assistant.\n * @returns The updated assistant.\n */\n async update(\n assistantId: string,\n payload: {\n graphId?: string;\n config?: Config;\n context?: unknown;\n metadata?: Metadata;\n name?: string;\n description?: string;\n signal?: AbortSignal;\n }\n ): Promise<Assistant> {\n return this.fetch<Assistant>(`/assistants/${assistantId}`, {\n method: \"PATCH\",\n json: {\n graph_id: payload.graphId,\n config: payload.config,\n context: payload.context,\n metadata: payload.metadata,\n name: payload.name,\n description: payload.description,\n },\n signal: payload.signal,\n });\n }\n\n /**\n * Delete an assistant.\n *\n * @param assistantId ID of the assistant.\n * @param deleteThreads If true, delete all threads with `metadata.assistant_id` equal to `assistantId`. Defaults to false.\n */\n async delete(\n assistantId: string,\n options?: { signal?: AbortSignal; deleteThreads?: boolean }\n ): Promise<void> {\n return this.fetch<void>(\n `/assistants/${assistantId}?delete_threads=${\n options?.deleteThreads ?? false\n }`,\n {\n method: \"DELETE\",\n signal: options?.signal,\n }\n );\n }\n\n /**\n * List assistants.\n * @param query Query options.\n * @returns List of assistants or, when includePagination is true, a mapping with the assistants and next cursor.\n */\n async search(query: {\n graphId?: string;\n name?: string;\n metadata?: Metadata;\n limit?: number;\n offset?: number;\n sortBy?: AssistantSortBy;\n sortOrder?: SortOrder;\n select?: AssistantSelectField[];\n includePagination: true;\n signal?: AbortSignal;\n }): Promise<AssistantsSearchResponse>;\n\n async search(query?: {\n graphId?: string;\n name?: string;\n metadata?: Metadata;\n limit?: number;\n offset?: number;\n sortBy?: AssistantSortBy;\n sortOrder?: SortOrder;\n select?: AssistantSelectField[];\n includePagination?: false;\n signal?: AbortSignal;\n }): Promise<Assistant[]>;\n\n async search(query?: {\n graphId?: string;\n name?: string;\n metadata?: Metadata;\n limit?: number;\n offset?: number;\n sortBy?: AssistantSortBy;\n sortOrder?: SortOrder;\n select?: AssistantSelectField[];\n includePagination?: boolean;\n signal?: AbortSignal;\n }): Promise<Assistant[] | AssistantsSearchResponse> {\n const json = {\n graph_id: query?.graphId ?? undefined,\n name: query?.name ?? undefined,\n metadata: query?.metadata ?? undefined,\n limit: query?.limit ?? 10,\n offset: query?.offset ?? 0,\n sort_by: query?.sortBy ?? undefined,\n sort_order: query?.sortOrder ?? undefined,\n select: query?.select ?? undefined,\n };\n const [assistants, response] = await this.fetch<Assistant[]>(\n \"/assistants/search\",\n {\n method: \"POST\",\n json,\n withResponse: true,\n signal: query?.signal,\n }\n );\n\n if (query?.includePagination) {\n const next = response.headers.get(\"X-Pagination-Next\");\n return { assistants, next };\n }\n\n return assistants;\n }\n\n /**\n * Count assistants matching filters.\n *\n * @param query.metadata Metadata to filter by. Exact match for each key/value.\n * @param query.graphId Optional graph id to filter by.\n * @param query.name Optional name to filter by.\n * @returns Number of assistants matching the criteria.\n */\n async count(query?: {\n metadata?: Metadata;\n graphId?: string;\n name?: string;\n signal?: AbortSignal;\n }): Promise<number> {\n return this.fetch<number>(`/assistants/count`, {\n method: \"POST\",\n json: {\n metadata: query?.metadata ?? undefined,\n graph_id: query?.graphId ?? undefined,\n name: query?.name ?? undefined,\n },\n signal: query?.signal,\n });\n }\n\n /**\n * List all versions of an assistant.\n *\n * @param assistantId ID of the assistant.\n * @returns List of assistant versions.\n */\n async getVersions(\n assistantId: string,\n payload?: {\n metadata?: Metadata;\n limit?: number;\n offset?: number;\n signal?: AbortSignal;\n }\n ): Promise<AssistantVersion[]> {\n return this.fetch<AssistantVersion[]>(\n `/assistants/${assistantId}/versions`,\n {\n method: \"POST\",\n json: {\n metadata: payload?.metadata ?? undefined,\n limit: payload?.limit ?? 10,\n offset: payload?.offset ?? 0,\n },\n signal: payload?.signal,\n }\n );\n }\n\n /**\n * Change the version of an assistant.\n *\n * @param assistantId ID of the assistant.\n * @param version The version to change to.\n * @returns The updated assistant.\n */\n async setLatest(\n assistantId: string,\n version: number,\n options?: { signal?: AbortSignal }\n ): Promise<Assistant> {\n return this.fetch<Assistant>(`/assistants/${assistantId}/latest`, {\n method: \"POST\",\n json: { version },\n signal: options?.signal,\n });\n }\n}\n"],"mappings":";;AAgBA,IAAa,mBAAb,cAAsC,WAAW;;;;;;;CAO/C,MAAM,IACJ,aACA,SACoB;AACpB,SAAO,KAAK,MAAiB,eAAe,eAAe,EACzD,QAAQ,SAAS,QAClB,CAAC;;;;;;;;CASJ,MAAM,SACJ,aACA,SACyB;AACzB,SAAO,KAAK,MAAsB,eAAe,YAAY,SAAS;GACpE,QAAQ,EAAE,MAAM,SAAS,MAAM;GAC/B,QAAQ,SAAS;GAClB,CAAC;;;;;;;CAQJ,MAAM,WACJ,aACA,SACsB;AACtB,SAAO,KAAK,MAAmB,eAAe,YAAY,WAAW,EACnE,QAAQ,SAAS,QAClB,CAAC;;;;;;;;;CAUJ,MAAM,aACJ,aACA,SAKoB;AACpB,MAAI,SAAS,UACX,QAA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sBACA;GACE,QAAQ;GACR;GACA,cAAc;GACd,QAAQ,OAAO;GAChB,CACF;AAED,MAAI,OAAO,kBAET,QAAO;GAAE;GAAY,MADR,SAAS,QAAQ,IAAI,oBAAoB;GAC3B;AAG7B,SAAO;;;;;;;;;;CAWT,MAAM,MAAM,OAKQ;AAClB,SAAO,KAAK,MAAc,qBAAqB;GAC7C,QAAQ;GACR,MAAM;IACJ,UAAU,OAAO,YAAY,KAAA;IAC7B,UAAU,OAAO,WAAW,KAAA;IAC5B,MAAM,OAAO,QAAQ,KAAA;IACtB;GACD,QAAQ,OAAO;GAChB,CAAC;;;;;;;;CASJ,MAAM,YACJ,aACA,SAM6B;AAC7B,SAAO,KAAK,MACV,eAAe,YAAY,YAC3B;GACE,QAAQ;GACR,MAAM;IACJ,UAAU,SAAS,YAAY,KAAA;IAC/B,OAAO,SAAS,SAAS;IACzB,QAAQ,SAAS,UAAU;IAC5B;GACD,QAAQ,SAAS;GAClB,CACF;;;;;;;;;CAUH,MAAM,UACJ,aACA,SACA,SACoB;AACpB,SAAO,KAAK,MAAiB,eAAe,YAAY,UAAU;GAChE,QAAQ;GACR,MAAM,EAAE,SAAS;GACjB,QAAQ,SAAS;GAClB,CAAC"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
const require_async_caller = require("../utils/async_caller.cjs");
|
|
2
|
+
const require_env = require("../utils/env.cjs");
|
|
3
|
+
const require_signals = require("../utils/signals.cjs");
|
|
4
|
+
const require_sse = require("../utils/sse.cjs");
|
|
5
|
+
const require_stream = require("../utils/stream.cjs");
|
|
6
|
+
//#region src/client/base.ts
|
|
7
|
+
function* iterateHeaders(headers) {
|
|
8
|
+
let iter;
|
|
9
|
+
let shouldClear = false;
|
|
10
|
+
if (headers instanceof Headers) {
|
|
11
|
+
const entries = [];
|
|
12
|
+
headers.forEach((value, name) => {
|
|
13
|
+
entries.push([name, value]);
|
|
14
|
+
});
|
|
15
|
+
iter = entries;
|
|
16
|
+
} else if (Array.isArray(headers)) iter = headers;
|
|
17
|
+
else {
|
|
18
|
+
shouldClear = true;
|
|
19
|
+
iter = Object.entries(headers ?? {});
|
|
20
|
+
}
|
|
21
|
+
for (const item of iter) {
|
|
22
|
+
const name = item[0];
|
|
23
|
+
if (typeof name !== "string") throw new TypeError(`Expected header name to be a string, got ${typeof name}`);
|
|
24
|
+
const values = Array.isArray(item[1]) ? item[1] : [item[1]];
|
|
25
|
+
let didClear = false;
|
|
26
|
+
for (const value of values) {
|
|
27
|
+
if (value === void 0) continue;
|
|
28
|
+
if (shouldClear && !didClear) {
|
|
29
|
+
didClear = true;
|
|
30
|
+
yield [name, null];
|
|
31
|
+
}
|
|
32
|
+
yield [name, value];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function mergeHeaders(...headerObjects) {
|
|
37
|
+
const outputHeaders = new Headers();
|
|
38
|
+
for (const headers of headerObjects) {
|
|
39
|
+
if (!headers) continue;
|
|
40
|
+
for (const [name, value] of iterateHeaders(headers)) if (value === null) outputHeaders.delete(name);
|
|
41
|
+
else outputHeaders.append(name, value);
|
|
42
|
+
}
|
|
43
|
+
const headerEntries = [];
|
|
44
|
+
outputHeaders.forEach((value, name) => {
|
|
45
|
+
headerEntries.push([name, value]);
|
|
46
|
+
});
|
|
47
|
+
return Object.fromEntries(headerEntries);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get the API key from the environment.
|
|
51
|
+
* Precedence:
|
|
52
|
+
* 1. explicit argument (if string)
|
|
53
|
+
* 2. LANGGRAPH_API_KEY
|
|
54
|
+
* 3. LANGSMITH_API_KEY
|
|
55
|
+
* 4. LANGCHAIN_API_KEY
|
|
56
|
+
*
|
|
57
|
+
* @param apiKey - API key provided as an argument. If null, skips environment lookup. If undefined, tries environment.
|
|
58
|
+
* @returns The API key if found, otherwise undefined
|
|
59
|
+
*/
|
|
60
|
+
function getApiKey(apiKey) {
|
|
61
|
+
if (apiKey === null) return;
|
|
62
|
+
if (apiKey) return apiKey;
|
|
63
|
+
for (const prefix of [
|
|
64
|
+
"LANGGRAPH",
|
|
65
|
+
"LANGSMITH",
|
|
66
|
+
"LANGCHAIN"
|
|
67
|
+
]) {
|
|
68
|
+
const envKey = require_env.getEnvironmentVariable(`${prefix}_API_KEY`);
|
|
69
|
+
if (envKey) return envKey.trim().replace(/^["']|["']$/g, "");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
var BaseClient = class {
|
|
73
|
+
asyncCaller;
|
|
74
|
+
timeoutMs;
|
|
75
|
+
apiUrl;
|
|
76
|
+
defaultHeaders;
|
|
77
|
+
onRequest;
|
|
78
|
+
streamProtocol;
|
|
79
|
+
constructor(config) {
|
|
80
|
+
const callerOptions = {
|
|
81
|
+
maxRetries: 4,
|
|
82
|
+
maxConcurrency: 4,
|
|
83
|
+
...config?.callerOptions
|
|
84
|
+
};
|
|
85
|
+
let defaultApiUrl = "http://localhost:8123";
|
|
86
|
+
if (!config?.apiUrl && typeof globalThis === "object" && globalThis != null) {
|
|
87
|
+
const fetchSmb = Symbol.for("langgraph_api:fetch");
|
|
88
|
+
const urlSmb = Symbol.for("langgraph_api:url");
|
|
89
|
+
const global = globalThis;
|
|
90
|
+
if (global[fetchSmb]) callerOptions.fetch ??= global[fetchSmb];
|
|
91
|
+
if (global[urlSmb]) defaultApiUrl = global[urlSmb];
|
|
92
|
+
}
|
|
93
|
+
this.asyncCaller = new require_async_caller.AsyncCaller(callerOptions);
|
|
94
|
+
this.timeoutMs = config?.timeoutMs;
|
|
95
|
+
this.apiUrl = config?.apiUrl?.replace(/\/$/, "") || defaultApiUrl;
|
|
96
|
+
this.defaultHeaders = config?.defaultHeaders || {};
|
|
97
|
+
this.onRequest = config?.onRequest;
|
|
98
|
+
this.streamProtocol = config?.streamProtocol ?? "legacy";
|
|
99
|
+
const apiKey = getApiKey(config?.apiKey);
|
|
100
|
+
if (apiKey) this.defaultHeaders["x-api-key"] = apiKey;
|
|
101
|
+
}
|
|
102
|
+
prepareFetchOptions(path, options) {
|
|
103
|
+
const mutatedOptions = {
|
|
104
|
+
...options,
|
|
105
|
+
headers: mergeHeaders(this.defaultHeaders, options?.headers)
|
|
106
|
+
};
|
|
107
|
+
if (mutatedOptions.json) {
|
|
108
|
+
mutatedOptions.body = JSON.stringify(mutatedOptions.json);
|
|
109
|
+
mutatedOptions.headers = mergeHeaders(mutatedOptions.headers, { "content-type": "application/json" });
|
|
110
|
+
delete mutatedOptions.json;
|
|
111
|
+
}
|
|
112
|
+
if (mutatedOptions.withResponse) delete mutatedOptions.withResponse;
|
|
113
|
+
let timeoutSignal = null;
|
|
114
|
+
if (typeof options?.timeoutMs !== "undefined") {
|
|
115
|
+
if (options.timeoutMs != null) timeoutSignal = AbortSignal.timeout(options.timeoutMs);
|
|
116
|
+
} else if (this.timeoutMs != null) timeoutSignal = AbortSignal.timeout(this.timeoutMs);
|
|
117
|
+
mutatedOptions.signal = require_signals.mergeSignals(timeoutSignal, mutatedOptions.signal);
|
|
118
|
+
const targetUrl = new URL(`${this.apiUrl}${path}`);
|
|
119
|
+
if (mutatedOptions.params) {
|
|
120
|
+
for (const [key, value] of Object.entries(mutatedOptions.params)) {
|
|
121
|
+
if (value == null) continue;
|
|
122
|
+
const strValue = typeof value === "string" || typeof value === "number" ? value.toString() : JSON.stringify(value);
|
|
123
|
+
targetUrl.searchParams.append(key, strValue);
|
|
124
|
+
}
|
|
125
|
+
delete mutatedOptions.params;
|
|
126
|
+
}
|
|
127
|
+
return [targetUrl, mutatedOptions];
|
|
128
|
+
}
|
|
129
|
+
async fetch(path, options) {
|
|
130
|
+
const [url, init] = this.prepareFetchOptions(path, options);
|
|
131
|
+
let finalInit = init;
|
|
132
|
+
if (this.onRequest) finalInit = await this.onRequest(url, init);
|
|
133
|
+
const response = await this.asyncCaller.fetch(url.toString(), finalInit);
|
|
134
|
+
const body = (() => {
|
|
135
|
+
if (response.status === 202 || response.status === 204) return;
|
|
136
|
+
return response.json();
|
|
137
|
+
})();
|
|
138
|
+
if (options?.withResponse) return [await body, response];
|
|
139
|
+
return body;
|
|
140
|
+
}
|
|
141
|
+
async *streamWithRetry(config) {
|
|
142
|
+
const makeRequest = async (reconnectParams) => {
|
|
143
|
+
const requestEndpoint = reconnectParams?.reconnectPath || config.endpoint;
|
|
144
|
+
const isReconnect = !!reconnectParams?.reconnectPath;
|
|
145
|
+
const method = isReconnect ? "GET" : config.method || "GET";
|
|
146
|
+
const requestHeaders = isReconnect && reconnectParams?.lastEventId ? {
|
|
147
|
+
...config.headers,
|
|
148
|
+
"Last-Event-ID": reconnectParams.lastEventId
|
|
149
|
+
} : config.headers;
|
|
150
|
+
let [url, init] = this.prepareFetchOptions(requestEndpoint, {
|
|
151
|
+
method,
|
|
152
|
+
timeoutMs: null,
|
|
153
|
+
signal: config.signal,
|
|
154
|
+
headers: requestHeaders,
|
|
155
|
+
params: config.params,
|
|
156
|
+
json: isReconnect ? void 0 : config.json
|
|
157
|
+
});
|
|
158
|
+
if (this.onRequest != null) init = await this.onRequest(url, init);
|
|
159
|
+
const response = await this.asyncCaller.fetch(url.toString(), init);
|
|
160
|
+
if (!response.body) throw new Error("Expected response body from stream endpoint");
|
|
161
|
+
if (!isReconnect && config.onInitialResponse) await config.onInitialResponse(response);
|
|
162
|
+
return {
|
|
163
|
+
response,
|
|
164
|
+
stream: response.body.pipeThrough(require_sse.BytesLineDecoder()).pipeThrough(require_sse.SSEDecoder())
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
yield* require_stream.streamWithRetry(makeRequest, {
|
|
168
|
+
maxRetries: config.maxRetries ?? 5,
|
|
169
|
+
signal: config.signal,
|
|
170
|
+
onReconnect: config.onReconnect
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const REGEX_RUN_METADATA = /(\/threads\/(?<thread_id>.+))?\/runs\/(?<run_id>.+)/;
|
|
175
|
+
function getRunMetadataFromResponse(response) {
|
|
176
|
+
const contentLocation = response.headers.get("Content-Location");
|
|
177
|
+
if (!contentLocation) return void 0;
|
|
178
|
+
const match = REGEX_RUN_METADATA.exec(contentLocation);
|
|
179
|
+
if (!match?.groups?.run_id) return void 0;
|
|
180
|
+
return {
|
|
181
|
+
run_id: match.groups.run_id,
|
|
182
|
+
thread_id: match.groups.thread_id || void 0
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
exports.BaseClient = BaseClient;
|
|
187
|
+
exports.getApiKey = getApiKey;
|
|
188
|
+
exports.getRunMetadataFromResponse = getRunMetadataFromResponse;
|
|
189
|
+
|
|
190
|
+
//# sourceMappingURL=base.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.cjs","names":["getEnvironmentVariable","AsyncCaller","mergeSignals","BytesLineDecoder","SSEDecoder","streamWithRetry"],"sources":["../../src/client/base.ts"],"sourcesContent":["import { AsyncCaller, AsyncCallerParams } from \"../utils/async_caller.js\";\nimport { getEnvironmentVariable } from \"../utils/env.js\";\nimport { mergeSignals } from \"../utils/signals.js\";\nimport { BytesLineDecoder, SSEDecoder } from \"../utils/sse.js\";\nimport { streamWithRetry, StreamRequestParams } from \"../utils/stream.js\";\nimport type { StreamProtocol } from \"../types.js\";\n\nexport type HeaderValue = string | undefined | null;\n\nexport function* iterateHeaders(\n headers: HeadersInit | Record<string, HeaderValue>\n): IterableIterator<[string, string | null]> {\n let iter: Iterable<(HeaderValue | HeaderValue | null[])[]>;\n let shouldClear = false;\n\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (headers instanceof Headers) {\n const entries: [string, string][] = [];\n headers.forEach((value, name) => {\n entries.push([name, value]);\n });\n iter = entries;\n } else if (Array.isArray(headers)) {\n iter = headers;\n } else {\n shouldClear = true;\n iter = Object.entries(headers ?? {});\n }\n\n for (const item of iter) {\n const name = item[0];\n if (typeof name !== \"string\")\n throw new TypeError(\n `Expected header name to be a string, got ${typeof name}`\n );\n const values = Array.isArray(item[1]) ? item[1] : [item[1]];\n let didClear = false;\n\n for (const value of values) {\n if (value === undefined) continue;\n\n if (shouldClear && !didClear) {\n didClear = true;\n yield [name, null];\n }\n yield [name, value];\n }\n }\n}\n\nexport function mergeHeaders(\n ...headerObjects: (\n | HeadersInit\n | Record<string, HeaderValue>\n | undefined\n | null\n )[]\n) {\n const outputHeaders = new Headers();\n for (const headers of headerObjects) {\n if (!headers) continue;\n for (const [name, value] of iterateHeaders(headers)) {\n if (value === null) outputHeaders.delete(name);\n else outputHeaders.append(name, value);\n }\n }\n const headerEntries: [string, string][] = [];\n outputHeaders.forEach((value, name) => {\n headerEntries.push([name, value]);\n });\n return Object.fromEntries(headerEntries);\n}\n\n/**\n * Get the API key from the environment.\n * Precedence:\n * 1. explicit argument (if string)\n * 2. LANGGRAPH_API_KEY\n * 3. LANGSMITH_API_KEY\n * 4. LANGCHAIN_API_KEY\n *\n * @param apiKey - API key provided as an argument. If null, skips environment lookup. If undefined, tries environment.\n * @returns The API key if found, otherwise undefined\n */\nexport function getApiKey(apiKey?: string | null): string | undefined {\n if (apiKey === null) {\n return undefined;\n }\n\n if (apiKey) {\n return apiKey;\n }\n\n const prefixes = [\"LANGGRAPH\", \"LANGSMITH\", \"LANGCHAIN\"];\n\n for (const prefix of prefixes) {\n const envKey = getEnvironmentVariable(`${prefix}_API_KEY`);\n if (envKey) {\n return envKey.trim().replace(/^[\"']|[\"']$/g, \"\");\n }\n }\n\n return undefined;\n}\n\nexport type RequestHook = (\n url: URL,\n init: RequestInit\n) => Promise<RequestInit> | RequestInit;\n\nexport interface ClientConfig {\n apiUrl?: string;\n /**\n * API key for authentication.\n * - If a string is provided, that key will be used\n * - If undefined (default), the key will be auto-loaded from environment variables (LANGGRAPH_API_KEY, LANGSMITH_API_KEY, or LANGCHAIN_API_KEY)\n * - If null, no API key will be set (skips auto-loading)\n */\n apiKey?: string | null;\n callerOptions?: AsyncCallerParams;\n timeoutMs?: number;\n defaultHeaders?: Record<string, HeaderValue>;\n onRequest?: RequestHook;\n streamProtocol?: StreamProtocol;\n}\n\nexport class BaseClient {\n protected asyncCaller: AsyncCaller;\n\n protected timeoutMs: number | undefined;\n\n protected apiUrl: string;\n\n protected defaultHeaders: Record<string, HeaderValue>;\n\n protected onRequest?: RequestHook;\n\n protected streamProtocol: StreamProtocol;\n\n constructor(config?: ClientConfig) {\n const callerOptions = {\n maxRetries: 4,\n maxConcurrency: 4,\n ...config?.callerOptions,\n };\n\n let defaultApiUrl = \"http://localhost:8123\";\n if (\n !config?.apiUrl &&\n typeof globalThis === \"object\" &&\n globalThis != null\n ) {\n const fetchSmb = Symbol.for(\"langgraph_api:fetch\");\n const urlSmb = Symbol.for(\"langgraph_api:url\");\n\n const global = globalThis as unknown as {\n [fetchSmb]?: typeof fetch;\n [urlSmb]?: string;\n };\n\n if (global[fetchSmb]) callerOptions.fetch ??= global[fetchSmb];\n if (global[urlSmb]) defaultApiUrl = global[urlSmb];\n }\n\n this.asyncCaller = new AsyncCaller(callerOptions);\n this.timeoutMs = config?.timeoutMs;\n\n this.apiUrl = config?.apiUrl?.replace(/\\/$/, \"\") || defaultApiUrl;\n this.defaultHeaders = config?.defaultHeaders || {};\n this.onRequest = config?.onRequest;\n this.streamProtocol = config?.streamProtocol ?? \"legacy\";\n const apiKey = getApiKey(config?.apiKey);\n if (apiKey) {\n this.defaultHeaders[\"x-api-key\"] = apiKey;\n }\n }\n\n protected prepareFetchOptions(\n path: string,\n options?: RequestInit & {\n json?: unknown;\n params?: Record<string, unknown>;\n timeoutMs?: number | null;\n withResponse?: boolean;\n }\n ): [url: URL, init: RequestInit] {\n const mutatedOptions = {\n ...options,\n headers: mergeHeaders(this.defaultHeaders, options?.headers),\n };\n\n if (mutatedOptions.json) {\n mutatedOptions.body = JSON.stringify(mutatedOptions.json);\n mutatedOptions.headers = mergeHeaders(mutatedOptions.headers, {\n \"content-type\": \"application/json\",\n });\n delete mutatedOptions.json;\n }\n\n if (mutatedOptions.withResponse) {\n delete mutatedOptions.withResponse;\n }\n\n let timeoutSignal: AbortSignal | null = null;\n if (typeof options?.timeoutMs !== \"undefined\") {\n if (options.timeoutMs != null) {\n timeoutSignal = AbortSignal.timeout(options.timeoutMs);\n }\n } else if (this.timeoutMs != null) {\n timeoutSignal = AbortSignal.timeout(this.timeoutMs);\n }\n\n mutatedOptions.signal = mergeSignals(timeoutSignal, mutatedOptions.signal);\n const targetUrl = new URL(`${this.apiUrl}${path}`);\n\n if (mutatedOptions.params) {\n for (const [key, value] of Object.entries(mutatedOptions.params)) {\n if (value == null) continue;\n\n const strValue =\n typeof value === \"string\" || typeof value === \"number\"\n ? value.toString()\n : JSON.stringify(value);\n\n targetUrl.searchParams.append(key, strValue);\n }\n delete mutatedOptions.params;\n }\n\n return [targetUrl, mutatedOptions];\n }\n\n protected async fetch<T>(\n path: string,\n options: RequestInit & {\n json?: unknown;\n params?: Record<string, unknown>;\n timeoutMs?: number | null;\n signal: AbortSignal | undefined;\n withResponse: true;\n }\n ): Promise<[T, Response]>;\n\n protected async fetch<T>(\n path: string,\n options?: RequestInit & {\n json?: unknown;\n params?: Record<string, unknown>;\n timeoutMs?: number | null;\n signal: AbortSignal | undefined;\n withResponse?: false;\n }\n ): Promise<T>;\n\n protected async fetch<T>(\n path: string,\n options?: RequestInit & {\n json?: unknown;\n params?: Record<string, unknown>;\n timeoutMs?: number | null;\n signal: AbortSignal | undefined;\n withResponse?: boolean;\n }\n ): Promise<T | [T, Response]> {\n const [url, init] = this.prepareFetchOptions(path, options);\n\n let finalInit = init;\n if (this.onRequest) {\n finalInit = await this.onRequest(url, init);\n }\n\n const response = await this.asyncCaller.fetch(url.toString(), finalInit);\n\n const body = (() => {\n if (response.status === 202 || response.status === 204) {\n return undefined as T;\n }\n return response.json() as Promise<T>;\n })();\n\n if (options?.withResponse) {\n return [await body, response];\n }\n\n return body;\n }\n\n protected async *streamWithRetry<\n T extends { id?: string; event: string; data: unknown },\n >(config: {\n endpoint: string;\n method?: string;\n signal?: AbortSignal;\n headers?: Record<string, string>;\n params?: Record<string, unknown>;\n json?: unknown;\n maxRetries?: number;\n onReconnect?: (options: {\n attempt: number;\n lastEventId?: string;\n cause: unknown;\n }) => void;\n onInitialResponse?: (response: Response) => void | Promise<void>;\n }): AsyncGenerator<T> {\n const makeRequest = async (reconnectParams?: StreamRequestParams) => {\n const requestEndpoint = reconnectParams?.reconnectPath || config.endpoint;\n\n const isReconnect = !!reconnectParams?.reconnectPath;\n const method = isReconnect ? \"GET\" : config.method || \"GET\";\n\n const requestHeaders =\n isReconnect && reconnectParams?.lastEventId\n ? { ...config.headers, \"Last-Event-ID\": reconnectParams.lastEventId }\n : config.headers;\n\n // oxlint-disable-next-line prefer-const -- init is reassigned by onRequest hook\n let [url, init] = this.prepareFetchOptions(requestEndpoint, {\n method,\n timeoutMs: null,\n signal: config.signal,\n headers: requestHeaders,\n params: config.params,\n json: isReconnect ? undefined : config.json,\n });\n\n if (this.onRequest != null) {\n init = await this.onRequest(url, init);\n }\n\n const response = await this.asyncCaller.fetch(url.toString(), init);\n if (!response.body) {\n throw new Error(\"Expected response body from stream endpoint\");\n }\n\n if (!isReconnect && config.onInitialResponse) {\n await config.onInitialResponse(response);\n }\n\n const stream: ReadableStream<T> = response.body\n .pipeThrough(BytesLineDecoder())\n .pipeThrough(SSEDecoder()) as ReadableStream<T>;\n\n return { response, stream };\n };\n\n yield* streamWithRetry(makeRequest, {\n maxRetries: config.maxRetries ?? 5,\n signal: config.signal,\n onReconnect: config.onReconnect,\n });\n }\n}\n\nexport const REGEX_RUN_METADATA =\n /(\\/threads\\/(?<thread_id>.+))?\\/runs\\/(?<run_id>.+)/;\n\nexport function getRunMetadataFromResponse(\n response: Response\n): { run_id: string; thread_id?: string } | undefined {\n const contentLocation = response.headers.get(\"Content-Location\");\n if (!contentLocation) return undefined;\n\n const match = REGEX_RUN_METADATA.exec(contentLocation);\n\n if (!match?.groups?.run_id) return undefined;\n return {\n run_id: match.groups.run_id,\n thread_id: match.groups.thread_id || undefined,\n };\n}\n\nexport const isRecord = (value: un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C,KAAK,QAAQ,KAAK,oBAAoB,iBAAiB;IAC1D;IACA,WAAW;IACX,QAAQ,OAAO;IACf,SAAS;IACT,QAAQ,OAAO;IACf,MAAM,cAAc,KAAA,IAAY,OAAO;IACxC,CAAC;AAEF,OAAI,KAAK,aAAa,KACpB,QAAO,MAAM,KAAK,UAAU,KAAK,KAAK;GAGxC,MAAM,WAAW,MAAM,KAAK,YAAY,MAAM,IAAI,UAAU,EAAE,KAAK;AACnE,OAAI,CAAC,SAAS,KACZ,OAAM,IAAI,MAAM,8CAA8C;AAGhE,OAAI,CAAC,eAAe,OAAO,kBACzB,OAAM,OAAO,kBAAkB,SAAS;AAO1C,UAAO;IAAE;IAAU,QAJe,SAAS,KACxC,YAAYC,YAAAA,kBAAkB,CAAC,CAC/B,YAAYC,YAAAA,YAAY,CAAC;IAED;;AAG7B,SAAOC,eAAAA,gBAAgB,aAAa;GAClC,YAAY,OAAO,cAAc;GACjC,QAAQ,OAAO;GACf,aAAa,OAAO;GACrB,CAAC;;;AAIN,MAAa,qBACX;AAEF,SAAgB,2BACd,UACoD;CACpD,MAAM,kBAAkB,SAAS,QAAQ,IAAI,mBAAmB;AAChE,KAAI,CAAC,gBAAiB,QAAO,KAAA;CAE7B,MAAM,QAAQ,mBAAmB,KAAK,gBAAgB;AAEtD,KAAI,CAAC,OAAO,QAAQ,OAAQ,QAAO,KAAA;AACnC,QAAO;EACL,QAAQ,MAAM,OAAO;EACrB,WAAW,MAAM,OAAO,aAAa,KAAA;EACtC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { AsyncCaller, AsyncCallerParams } from "../utils/async_caller.cjs";
|
|
2
|
+
import { StreamProtocol } from "../types.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/client/base.d.ts
|
|
5
|
+
type HeaderValue = string | undefined | null;
|
|
6
|
+
/**
|
|
7
|
+
* Get the API key from the environment.
|
|
8
|
+
* Precedence:
|
|
9
|
+
* 1. explicit argument (if string)
|
|
10
|
+
* 2. LANGGRAPH_API_KEY
|
|
11
|
+
* 3. LANGSMITH_API_KEY
|
|
12
|
+
* 4. LANGCHAIN_API_KEY
|
|
13
|
+
*
|
|
14
|
+
* @param apiKey - API key provided as an argument. If null, skips environment lookup. If undefined, tries environment.
|
|
15
|
+
* @returns The API key if found, otherwise undefined
|
|
16
|
+
*/
|
|
17
|
+
declare function getApiKey(apiKey?: string | null): string | undefined;
|
|
18
|
+
type RequestHook = (url: URL, init: RequestInit) => Promise<RequestInit> | RequestInit;
|
|
19
|
+
interface ClientConfig {
|
|
20
|
+
apiUrl?: string;
|
|
21
|
+
/**
|
|
22
|
+
* API key for authentication.
|
|
23
|
+
* - If a string is provided, that key will be used
|
|
24
|
+
* - If undefined (default), the key will be auto-loaded from environment variables (LANGGRAPH_API_KEY, LANGSMITH_API_KEY, or LANGCHAIN_API_KEY)
|
|
25
|
+
* - If null, no API key will be set (skips auto-loading)
|
|
26
|
+
*/
|
|
27
|
+
apiKey?: string | null;
|
|
28
|
+
callerOptions?: AsyncCallerParams;
|
|
29
|
+
timeoutMs?: number;
|
|
30
|
+
defaultHeaders?: Record<string, HeaderValue>;
|
|
31
|
+
onRequest?: RequestHook;
|
|
32
|
+
streamProtocol?: StreamProtocol;
|
|
33
|
+
}
|
|
34
|
+
declare class BaseClient {
|
|
35
|
+
protected asyncCaller: AsyncCaller;
|
|
36
|
+
protected timeoutMs: number | undefined;
|
|
37
|
+
protected apiUrl: string;
|
|
38
|
+
protected defaultHeaders: Record<string, HeaderValue>;
|
|
39
|
+
protected onRequest?: RequestHook;
|
|
40
|
+
protected streamProtocol: StreamProtocol;
|
|
41
|
+
constructor(config?: ClientConfig);
|
|
42
|
+
protected prepareFetchOptions(path: string, options?: RequestInit & {
|
|
43
|
+
json?: unknown;
|
|
44
|
+
params?: Record<string, unknown>;
|
|
45
|
+
timeoutMs?: number | null;
|
|
46
|
+
withResponse?: boolean;
|
|
47
|
+
}): [url: URL, init: RequestInit];
|
|
48
|
+
protected fetch<T>(path: string, options: RequestInit & {
|
|
49
|
+
json?: unknown;
|
|
50
|
+
params?: Record<string, unknown>;
|
|
51
|
+
timeoutMs?: number | null;
|
|
52
|
+
signal: AbortSignal | undefined;
|
|
53
|
+
withResponse: true;
|
|
54
|
+
}): Promise<[T, Response]>;
|
|
55
|
+
protected fetch<T>(path: string, options?: RequestInit & {
|
|
56
|
+
json?: unknown;
|
|
57
|
+
params?: Record<string, unknown>;
|
|
58
|
+
timeoutMs?: number | null;
|
|
59
|
+
signal: AbortSignal | undefined;
|
|
60
|
+
withResponse?: false;
|
|
61
|
+
}): Promise<T>;
|
|
62
|
+
protected streamWithRetry<T extends {
|
|
63
|
+
id?: string;
|
|
64
|
+
event: string;
|
|
65
|
+
data: unknown;
|
|
66
|
+
}>(config: {
|
|
67
|
+
endpoint: string;
|
|
68
|
+
method?: string;
|
|
69
|
+
signal?: AbortSignal;
|
|
70
|
+
headers?: Record<string, string>;
|
|
71
|
+
params?: Record<string, unknown>;
|
|
72
|
+
json?: unknown;
|
|
73
|
+
maxRetries?: number;
|
|
74
|
+
onReconnect?: (options: {
|
|
75
|
+
attempt: number;
|
|
76
|
+
lastEventId?: string;
|
|
77
|
+
cause: unknown;
|
|
78
|
+
}) => void;
|
|
79
|
+
onInitialResponse?: (response: Response) => void | Promise<void>;
|
|
80
|
+
}): AsyncGenerator<T>;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { BaseClient, ClientConfig, HeaderValue, RequestHook, getApiKey };
|
|
84
|
+
//# sourceMappingURL=base.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.cts","names":[],"sources":["../../src/client/base.ts"],"mappings":";;;;KAOY,WAAA;;;AA6EZ;;;;;AAqBA;;;;iBArBgB,SAAA,CAAU,MAAA;AAAA,KAqBd,WAAA,IACV,GAAA,EAAK,GAAA,EACL,IAAA,EAAM,WAAA,KACH,OAAA,CAAQ,WAAA,IAAe,WAAA;AAAA,UAEX,Y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