@relkit/langchain 0.0.0-stage → 0.7.10
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/LICENSE +21 -0
- package/README.md +48 -2
- package/dist/client-contract-metadata.d.ts +31 -0
- package/dist/client-contract-metadata.d.ts.map +1 -0
- package/dist/client-contract-metadata.js +129 -0
- package/dist/client-contract-metadata.js.map +1 -0
- package/dist/client-contract-metadata.types.d.ts +59 -0
- package/dist/client-contract-metadata.types.d.ts.map +1 -0
- package/dist/client-contract-metadata.types.js +3 -0
- package/dist/client-contract-metadata.types.js.map +1 -0
- package/dist/client-contract-schema.d.ts +66 -0
- package/dist/client-contract-schema.d.ts.map +1 -0
- package/dist/client-contract-schema.js +153 -0
- package/dist/client-contract-schema.js.map +1 -0
- package/dist/continuation-validation.d.ts +9 -0
- package/dist/continuation-validation.d.ts.map +1 -0
- package/dist/continuation-validation.js +9 -0
- package/dist/continuation-validation.js.map +1 -0
- package/dist/deepagent-bucket-backend.d.ts +33 -0
- package/dist/deepagent-bucket-backend.d.ts.map +1 -0
- package/dist/deepagent-bucket-backend.js +47 -0
- package/dist/deepagent-bucket-backend.js.map +1 -0
- package/dist/deepagent-bucket-backend.types.d.ts +6 -0
- package/dist/deepagent-bucket-backend.types.d.ts.map +1 -0
- package/dist/deepagent-bucket-backend.types.js +2 -0
- package/dist/deepagent-bucket-backend.types.js.map +1 -0
- package/dist/deepagent-bucket-client.types.d.ts +25 -0
- package/dist/deepagent-bucket-client.types.d.ts.map +1 -0
- package/dist/deepagent-bucket-client.types.js +3 -0
- package/dist/deepagent-bucket-client.types.js.map +1 -0
- package/dist/deepagent-bucket-delete.d.ts +28 -0
- package/dist/deepagent-bucket-delete.d.ts.map +1 -0
- package/dist/deepagent-bucket-delete.js +64 -0
- package/dist/deepagent-bucket-delete.js.map +1 -0
- package/dist/deepagent-bucket-error.d.ts +17 -0
- package/dist/deepagent-bucket-error.d.ts.map +1 -0
- package/dist/deepagent-bucket-error.js +17 -0
- package/dist/deepagent-bucket-error.js.map +1 -0
- package/dist/deepagent-bucket-file-data.d.ts +40 -0
- package/dist/deepagent-bucket-file-data.d.ts.map +1 -0
- package/dist/deepagent-bucket-file-data.js +115 -0
- package/dist/deepagent-bucket-file-data.js.map +1 -0
- package/dist/deepagent-bucket-file-index.d.ts +34 -0
- package/dist/deepagent-bucket-file-index.d.ts.map +1 -0
- package/dist/deepagent-bucket-file-index.js +82 -0
- package/dist/deepagent-bucket-file-index.js.map +1 -0
- package/dist/deepagent-bucket-files.d.ts +5 -0
- package/dist/deepagent-bucket-files.d.ts.map +1 -0
- package/dist/deepagent-bucket-files.js +4 -0
- package/dist/deepagent-bucket-files.js.map +1 -0
- package/dist/deepagent-bucket-files.types.d.ts +8 -0
- package/dist/deepagent-bucket-files.types.d.ts.map +1 -0
- package/dist/deepagent-bucket-files.types.js +3 -0
- package/dist/deepagent-bucket-files.types.js.map +1 -0
- package/dist/deepagent-bucket-format.d.ts +59 -0
- package/dist/deepagent-bucket-format.d.ts.map +1 -0
- package/dist/deepagent-bucket-format.js +72 -0
- package/dist/deepagent-bucket-format.js.map +1 -0
- package/dist/deepagent-bucket-glob.d.ts +26 -0
- package/dist/deepagent-bucket-glob.d.ts.map +1 -0
- package/dist/deepagent-bucket-glob.js +66 -0
- package/dist/deepagent-bucket-glob.js.map +1 -0
- package/dist/deepagent-bucket-grep.d.ts +32 -0
- package/dist/deepagent-bucket-grep.d.ts.map +1 -0
- package/dist/deepagent-bucket-grep.js +73 -0
- package/dist/deepagent-bucket-grep.js.map +1 -0
- package/dist/deepagent-bucket-path.d.ts +67 -0
- package/dist/deepagent-bucket-path.d.ts.map +1 -0
- package/dist/deepagent-bucket-path.js +121 -0
- package/dist/deepagent-bucket-path.js.map +1 -0
- package/dist/deepagent-bucket-read.d.ts +65 -0
- package/dist/deepagent-bucket-read.d.ts.map +1 -0
- package/dist/deepagent-bucket-read.js +77 -0
- package/dist/deepagent-bucket-read.js.map +1 -0
- package/dist/deepagent-bucket-scope.d.ts +43 -0
- package/dist/deepagent-bucket-scope.d.ts.map +1 -0
- package/dist/deepagent-bucket-scope.js +40 -0
- package/dist/deepagent-bucket-scope.js.map +1 -0
- package/dist/deepagent-bucket-search.d.ts +22 -0
- package/dist/deepagent-bucket-search.d.ts.map +1 -0
- package/dist/deepagent-bucket-search.js +60 -0
- package/dist/deepagent-bucket-search.js.map +1 -0
- package/dist/deepagent-bucket-service.d.ts +17 -0
- package/dist/deepagent-bucket-service.d.ts.map +1 -0
- package/dist/deepagent-bucket-service.js +16 -0
- package/dist/deepagent-bucket-service.js.map +1 -0
- package/dist/deepagent-bucket-transfer.d.ts +52 -0
- package/dist/deepagent-bucket-transfer.d.ts.map +1 -0
- package/dist/deepagent-bucket-transfer.js +73 -0
- package/dist/deepagent-bucket-transfer.js.map +1 -0
- package/dist/deepagent-bucket-write.d.ts +55 -0
- package/dist/deepagent-bucket-write.d.ts.map +1 -0
- package/dist/deepagent-bucket-write.js +88 -0
- package/dist/deepagent-bucket-write.js.map +1 -0
- package/dist/define-agent-build.d.ts +12 -0
- package/dist/define-agent-build.d.ts.map +1 -0
- package/dist/define-agent-build.js +60 -0
- package/dist/define-agent-build.js.map +1 -0
- package/dist/define-agent-deep.d.ts +30 -0
- package/dist/define-agent-deep.d.ts.map +1 -0
- package/dist/define-agent-deep.js +125 -0
- package/dist/define-agent-deep.js.map +1 -0
- package/dist/define-agent-deep.types.d.ts +23 -0
- package/dist/define-agent-deep.types.d.ts.map +1 -0
- package/dist/define-agent-deep.types.js +3 -0
- package/dist/define-agent-deep.types.js.map +1 -0
- package/dist/define-agent-native-middleware.d.ts +34 -0
- package/dist/define-agent-native-middleware.d.ts.map +1 -0
- package/dist/define-agent-native-middleware.js +83 -0
- package/dist/define-agent-native-middleware.js.map +1 -0
- package/dist/define-agent-native-model.d.ts +16 -0
- package/dist/define-agent-native-model.d.ts.map +1 -0
- package/dist/define-agent-native-model.js +23 -0
- package/dist/define-agent-native-model.js.map +1 -0
- package/dist/define-agent-native-tools.d.ts +30 -0
- package/dist/define-agent-native-tools.d.ts.map +1 -0
- package/dist/define-agent-native-tools.js +72 -0
- package/dist/define-agent-native-tools.js.map +1 -0
- package/dist/define-agent-native.d.ts +6 -0
- package/dist/define-agent-native.d.ts.map +1 -0
- package/dist/define-agent-native.js +5 -0
- package/dist/define-agent-native.js.map +1 -0
- package/dist/define-agent-native.types.d.ts +36 -0
- package/dist/define-agent-native.types.d.ts.map +1 -0
- package/dist/define-agent-native.types.js +3 -0
- package/dist/define-agent-native.types.js.map +1 -0
- package/dist/define-agent-validation.d.ts +45 -0
- package/dist/define-agent-validation.d.ts.map +1 -0
- package/dist/define-agent-validation.js +92 -0
- package/dist/define-agent-validation.js.map +1 -0
- package/dist/define-agent.d.ts +41 -0
- package/dist/define-agent.d.ts.map +1 -0
- package/dist/define-agent.js +59 -0
- package/dist/define-agent.js.map +1 -0
- package/dist/define-agent.types.d.ts +54 -0
- package/dist/define-agent.types.d.ts.map +1 -0
- package/dist/define-agent.types.js +3 -0
- package/dist/define-agent.types.js.map +1 -0
- package/dist/define-graph-build.d.ts +12 -0
- package/dist/define-graph-build.d.ts.map +1 -0
- package/dist/define-graph-build.js +86 -0
- package/dist/define-graph-build.js.map +1 -0
- package/dist/define-graph-error.d.ts +17 -0
- package/dist/define-graph-error.d.ts.map +1 -0
- package/dist/define-graph-error.js +17 -0
- package/dist/define-graph-error.js.map +1 -0
- package/dist/define-graph-node.d.ts +42 -0
- package/dist/define-graph-node.d.ts.map +1 -0
- package/dist/define-graph-node.js +97 -0
- package/dist/define-graph-node.js.map +1 -0
- package/dist/define-graph-node.types.d.ts +38 -0
- package/dist/define-graph-node.types.d.ts.map +1 -0
- package/dist/define-graph-node.types.js +3 -0
- package/dist/define-graph-node.types.js.map +1 -0
- package/dist/define-graph.d.ts +44 -0
- package/dist/define-graph.d.ts.map +1 -0
- package/dist/define-graph.js +72 -0
- package/dist/define-graph.js.map +1 -0
- package/dist/define-graph.types.d.ts +69 -0
- package/dist/define-graph.types.d.ts.map +1 -0
- package/dist/define-graph.types.js +3 -0
- package/dist/define-graph.types.js.map +1 -0
- package/dist/define-persistence-guards.d.ts +32 -0
- package/dist/define-persistence-guards.d.ts.map +1 -0
- package/dist/define-persistence-guards.js +55 -0
- package/dist/define-persistence-guards.js.map +1 -0
- package/dist/define-persistence.d.ts +33 -0
- package/dist/define-persistence.d.ts.map +1 -0
- package/dist/define-persistence.js +112 -0
- package/dist/define-persistence.js.map +1 -0
- package/dist/define-persistence.types.d.ts +30 -0
- package/dist/define-persistence.types.d.ts.map +1 -0
- package/dist/define-persistence.types.js +3 -0
- package/dist/define-persistence.types.js.map +1 -0
- package/dist/graph-compile-error.d.ts +17 -0
- package/dist/graph-compile-error.d.ts.map +1 -0
- package/dist/graph-compile-error.js +17 -0
- package/dist/graph-compile-error.js.map +1 -0
- package/dist/graph-compile.d.ts +32 -0
- package/dist/graph-compile.d.ts.map +1 -0
- package/dist/graph-compile.js +94 -0
- package/dist/graph-compile.js.map +1 -0
- package/dist/graph-continuation-error.d.ts +17 -0
- package/dist/graph-continuation-error.d.ts.map +1 -0
- package/dist/graph-continuation-error.js +17 -0
- package/dist/graph-continuation-error.js.map +1 -0
- package/dist/graph-continuation-validation.d.ts +22 -0
- package/dist/graph-continuation-validation.d.ts.map +1 -0
- package/dist/graph-continuation-validation.js +67 -0
- package/dist/graph-continuation-validation.js.map +1 -0
- package/dist/graph-continuation-waiting.d.ts +23 -0
- package/dist/graph-continuation-waiting.d.ts.map +1 -0
- package/dist/graph-continuation-waiting.js +53 -0
- package/dist/graph-continuation-waiting.js.map +1 -0
- package/dist/graph-continuation.d.ts +43 -0
- package/dist/graph-continuation.d.ts.map +1 -0
- package/dist/graph-continuation.js +82 -0
- package/dist/graph-continuation.js.map +1 -0
- package/dist/graph-continuation.types.d.ts +11 -0
- package/dist/graph-continuation.types.d.ts.map +1 -0
- package/dist/graph-continuation.types.js +3 -0
- package/dist/graph-continuation.types.js.map +1 -0
- package/dist/graph-definition.d.ts +36 -0
- package/dist/graph-definition.d.ts.map +1 -0
- package/dist/graph-definition.js +90 -0
- package/dist/graph-definition.js.map +1 -0
- package/dist/graph-edge-destinations.d.ts +42 -0
- package/dist/graph-edge-destinations.d.ts.map +1 -0
- package/dist/graph-edge-destinations.js +100 -0
- package/dist/graph-edge-destinations.js.map +1 -0
- package/dist/graph-edge-mutations.d.ts +19 -0
- package/dist/graph-edge-mutations.d.ts.map +1 -0
- package/dist/graph-edge-mutations.js +62 -0
- package/dist/graph-edge-mutations.js.map +1 -0
- package/dist/graph-edge-mutations.types.d.ts +9 -0
- package/dist/graph-edge-mutations.types.d.ts.map +1 -0
- package/dist/graph-edge-mutations.types.js +2 -0
- package/dist/graph-edge-mutations.types.js.map +1 -0
- package/dist/graph-edges.d.ts +24 -0
- package/dist/graph-edges.d.ts.map +1 -0
- package/dist/graph-edges.js +37 -0
- package/dist/graph-edges.js.map +1 -0
- package/dist/graph-edges.types.d.ts +47 -0
- package/dist/graph-edges.types.d.ts.map +1 -0
- package/dist/graph-edges.types.js +3 -0
- package/dist/graph-edges.types.js.map +1 -0
- package/dist/graph-execution-symbol.d.ts +3 -0
- package/dist/graph-execution-symbol.d.ts.map +1 -0
- package/dist/graph-execution-symbol.js +3 -0
- package/dist/graph-execution-symbol.js.map +1 -0
- package/dist/graph-interruption.d.ts +84 -0
- package/dist/graph-interruption.d.ts.map +1 -0
- package/dist/graph-interruption.js +119 -0
- package/dist/graph-interruption.js.map +1 -0
- package/dist/graph-interruption.types.d.ts +16 -0
- package/dist/graph-interruption.types.d.ts.map +1 -0
- package/dist/graph-interruption.types.js +3 -0
- package/dist/graph-interruption.types.js.map +1 -0
- package/dist/graph-node-schema-validation.d.ts +9 -0
- package/dist/graph-node-schema-validation.d.ts.map +1 -0
- package/dist/graph-node-schema-validation.js +16 -0
- package/dist/graph-node-schema-validation.js.map +1 -0
- package/dist/graph-node-symbol.d.ts +3 -0
- package/dist/graph-node-symbol.d.ts.map +1 -0
- package/dist/graph-node-symbol.js +3 -0
- package/dist/graph-node-symbol.js.map +1 -0
- package/dist/graph-node-validation-error.d.ts +17 -0
- package/dist/graph-node-validation-error.d.ts.map +1 -0
- package/dist/graph-node-validation-error.js +17 -0
- package/dist/graph-node-validation-error.js.map +1 -0
- package/dist/graph-node-validation-value.d.ts +64 -0
- package/dist/graph-node-validation-value.d.ts.map +1 -0
- package/dist/graph-node-validation-value.js +117 -0
- package/dist/graph-node-validation-value.js.map +1 -0
- package/dist/graph-node-validation.d.ts +65 -0
- package/dist/graph-node-validation.d.ts.map +1 -0
- package/dist/graph-node-validation.js +113 -0
- package/dist/graph-node-validation.js.map +1 -0
- package/dist/graph-persistence-release.d.ts +16 -0
- package/dist/graph-persistence-release.d.ts.map +1 -0
- package/dist/graph-persistence-release.js +43 -0
- package/dist/graph-persistence-release.js.map +1 -0
- package/dist/graph-persistence.d.ts +39 -0
- package/dist/graph-persistence.d.ts.map +1 -0
- package/dist/graph-persistence.js +111 -0
- package/dist/graph-persistence.js.map +1 -0
- package/dist/graph-persistence.types.d.ts +21 -0
- package/dist/graph-persistence.types.d.ts.map +1 -0
- package/dist/graph-persistence.types.js +3 -0
- package/dist/graph-persistence.types.js.map +1 -0
- package/dist/graph-runtime-error.d.ts +17 -0
- package/dist/graph-runtime-error.d.ts.map +1 -0
- package/dist/graph-runtime-error.js +17 -0
- package/dist/graph-runtime-error.js.map +1 -0
- package/dist/graph-runtime-execution.d.ts +28 -0
- package/dist/graph-runtime-execution.d.ts.map +1 -0
- package/dist/graph-runtime-execution.js +69 -0
- package/dist/graph-runtime-execution.js.map +1 -0
- package/dist/graph-runtime-identity.d.ts +15 -0
- package/dist/graph-runtime-identity.d.ts.map +1 -0
- package/dist/graph-runtime-identity.js +14 -0
- package/dist/graph-runtime-identity.js.map +1 -0
- package/dist/graph-runtime-identity.types.d.ts +5 -0
- package/dist/graph-runtime-identity.types.d.ts.map +1 -0
- package/dist/graph-runtime-identity.types.js +2 -0
- package/dist/graph-runtime-identity.types.js.map +1 -0
- package/dist/graph-runtime-stream-state.d.ts +8 -0
- package/dist/graph-runtime-stream-state.d.ts.map +1 -0
- package/dist/graph-runtime-stream-state.js +67 -0
- package/dist/graph-runtime-stream-state.js.map +1 -0
- package/dist/graph-runtime-stream.d.ts +16 -0
- package/dist/graph-runtime-stream.d.ts.map +1 -0
- package/dist/graph-runtime-stream.js +49 -0
- package/dist/graph-runtime-stream.js.map +1 -0
- package/dist/graph-runtime-stream.types.d.ts +13 -0
- package/dist/graph-runtime-stream.types.d.ts.map +1 -0
- package/dist/graph-runtime-stream.types.js +2 -0
- package/dist/graph-runtime-stream.types.js.map +1 -0
- package/dist/graph-runtime.d.ts +21 -0
- package/dist/graph-runtime.d.ts.map +1 -0
- package/dist/graph-runtime.js +74 -0
- package/dist/graph-runtime.js.map +1 -0
- package/dist/graph-runtime.types.d.ts +8 -0
- package/dist/graph-runtime.types.d.ts.map +1 -0
- package/dist/graph-runtime.types.js +3 -0
- package/dist/graph-runtime.types.js.map +1 -0
- package/dist/graph-state-schema.d.ts +35 -0
- package/dist/graph-state-schema.d.ts.map +1 -0
- package/dist/graph-state-schema.js +65 -0
- package/dist/graph-state-schema.js.map +1 -0
- package/dist/graph-subgraph-symbol.d.ts +5 -0
- package/dist/graph-subgraph-symbol.d.ts.map +1 -0
- package/dist/graph-subgraph-symbol.js +5 -0
- package/dist/graph-subgraph-symbol.js.map +1 -0
- package/dist/graph-subgraph.d.ts +46 -0
- package/dist/graph-subgraph.d.ts.map +1 -0
- package/dist/graph-subgraph.js +82 -0
- package/dist/graph-subgraph.js.map +1 -0
- package/dist/graph-subgraph.types.d.ts +20 -0
- package/dist/graph-subgraph.types.d.ts.map +1 -0
- package/dist/graph-subgraph.types.js +3 -0
- package/dist/graph-subgraph.types.js.map +1 -0
- package/dist/graph-workflow-error.d.ts +17 -0
- package/dist/graph-workflow-error.d.ts.map +1 -0
- package/dist/graph-workflow-error.js +17 -0
- package/dist/graph-workflow-error.js.map +1 -0
- package/dist/graph-workflow.d.ts +37 -0
- package/dist/graph-workflow.d.ts.map +1 -0
- package/dist/graph-workflow.js +86 -0
- package/dist/graph-workflow.js.map +1 -0
- package/dist/graph-workflow.types.d.ts +41 -0
- package/dist/graph-workflow.types.d.ts.map +1 -0
- package/dist/graph-workflow.types.js +3 -0
- package/dist/graph-workflow.types.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/native-agent-interruption-error.d.ts +17 -0
- package/dist/native-agent-interruption-error.d.ts.map +1 -0
- package/dist/native-agent-interruption-error.js +17 -0
- package/dist/native-agent-interruption-error.js.map +1 -0
- package/dist/native-agent-interruption-schema.d.ts +66 -0
- package/dist/native-agent-interruption-schema.d.ts.map +1 -0
- package/dist/native-agent-interruption-schema.js +141 -0
- package/dist/native-agent-interruption-schema.js.map +1 -0
- package/dist/native-agent-interruption-schema.types.d.ts +16 -0
- package/dist/native-agent-interruption-schema.types.d.ts.map +1 -0
- package/dist/native-agent-interruption-schema.types.js +3 -0
- package/dist/native-agent-interruption-schema.types.js.map +1 -0
- package/dist/native-agent-interruption-validation.d.ts +19 -0
- package/dist/native-agent-interruption-validation.d.ts.map +1 -0
- package/dist/native-agent-interruption-validation.js +107 -0
- package/dist/native-agent-interruption-validation.js.map +1 -0
- package/dist/native-agent-interruption.d.ts +55 -0
- package/dist/native-agent-interruption.d.ts.map +1 -0
- package/dist/native-agent-interruption.js +85 -0
- package/dist/native-agent-interruption.js.map +1 -0
- package/dist/native-agent-interruption.types.d.ts +5 -0
- package/dist/native-agent-interruption.types.d.ts.map +1 -0
- package/dist/native-agent-interruption.types.js +2 -0
- package/dist/native-agent-interruption.types.js.map +1 -0
- package/dist/persistence-error.d.ts +17 -0
- package/dist/persistence-error.d.ts.map +1 -0
- package/dist/persistence-error.js +17 -0
- package/dist/persistence-error.js.map +1 -0
- package/dist/persistence-symbol.d.ts +3 -0
- package/dist/persistence-symbol.d.ts.map +1 -0
- package/dist/persistence-symbol.js +3 -0
- package/dist/persistence-symbol.js.map +1 -0
- package/dist/runtime-approval-decision.d.ts +13 -0
- package/dist/runtime-approval-decision.d.ts.map +1 -0
- package/dist/runtime-approval-decision.js +21 -0
- package/dist/runtime-approval-decision.js.map +1 -0
- package/dist/runtime-dependencies.d.ts +7 -0
- package/dist/runtime-dependencies.d.ts.map +1 -0
- package/dist/runtime-dependencies.js +10 -0
- package/dist/runtime-dependencies.js.map +1 -0
- package/dist/runtime-effect-error.d.ts +18 -0
- package/dist/runtime-effect-error.d.ts.map +1 -0
- package/dist/runtime-effect-error.js +19 -0
- package/dist/runtime-effect-error.js.map +1 -0
- package/dist/runtime-errors.d.ts +11 -0
- package/dist/runtime-errors.d.ts.map +1 -0
- package/dist/runtime-errors.js +15 -0
- package/dist/runtime-errors.js.map +1 -0
- package/dist/runtime-failure-diagnostics.d.ts +10 -0
- package/dist/runtime-failure-diagnostics.d.ts.map +1 -0
- package/dist/runtime-failure-diagnostics.js +61 -0
- package/dist/runtime-failure-diagnostics.js.map +1 -0
- package/dist/runtime-integration.d.ts +10 -0
- package/dist/runtime-integration.d.ts.map +1 -0
- package/dist/runtime-integration.js +9 -0
- package/dist/runtime-integration.js.map +1 -0
- package/dist/runtime-invoke.d.ts +27 -0
- package/dist/runtime-invoke.d.ts.map +1 -0
- package/dist/runtime-invoke.js +77 -0
- package/dist/runtime-invoke.js.map +1 -0
- package/dist/runtime-loop-context.types.d.ts +22 -0
- package/dist/runtime-loop-context.types.d.ts.map +1 -0
- package/dist/runtime-loop-context.types.js +2 -0
- package/dist/runtime-loop-context.types.js.map +1 -0
- package/dist/runtime-loop-execution.d.ts +4 -0
- package/dist/runtime-loop-execution.d.ts.map +1 -0
- package/dist/runtime-loop-execution.js +61 -0
- package/dist/runtime-loop-execution.js.map +1 -0
- package/dist/runtime-loop-state.d.ts +13 -0
- package/dist/runtime-loop-state.d.ts.map +1 -0
- package/dist/runtime-loop-state.js +57 -0
- package/dist/runtime-loop-state.js.map +1 -0
- package/dist/runtime-loop-telemetry.d.ts +5 -0
- package/dist/runtime-loop-telemetry.d.ts.map +1 -0
- package/dist/runtime-loop-telemetry.js +62 -0
- package/dist/runtime-loop-telemetry.js.map +1 -0
- package/dist/runtime-loop-values.d.ts +52 -0
- package/dist/runtime-loop-values.d.ts.map +1 -0
- package/dist/runtime-loop-values.js +85 -0
- package/dist/runtime-loop-values.js.map +1 -0
- package/dist/runtime-loop.d.ts +36 -0
- package/dist/runtime-loop.d.ts.map +1 -0
- package/dist/runtime-loop.js +45 -0
- package/dist/runtime-loop.js.map +1 -0
- package/dist/runtime-loop.types.d.ts +8 -0
- package/dist/runtime-loop.types.d.ts.map +1 -0
- package/dist/runtime-loop.types.js +3 -0
- package/dist/runtime-loop.types.js.map +1 -0
- package/dist/runtime-model-error.d.ts +17 -0
- package/dist/runtime-model-error.d.ts.map +1 -0
- package/dist/runtime-model-error.js +17 -0
- package/dist/runtime-model-error.js.map +1 -0
- package/dist/runtime-model.d.ts +31 -0
- package/dist/runtime-model.d.ts.map +1 -0
- package/dist/runtime-model.js +126 -0
- package/dist/runtime-model.js.map +1 -0
- package/dist/runtime-model.types.d.ts +22 -0
- package/dist/runtime-model.types.d.ts.map +1 -0
- package/dist/runtime-model.types.js +3 -0
- package/dist/runtime-model.types.js.map +1 -0
- package/dist/runtime-native-agent-build.d.ts +40 -0
- package/dist/runtime-native-agent-build.d.ts.map +1 -0
- package/dist/runtime-native-agent-build.js +77 -0
- package/dist/runtime-native-agent-build.js.map +1 -0
- package/dist/runtime-native-agent.d.ts +30 -0
- package/dist/runtime-native-agent.d.ts.map +1 -0
- package/dist/runtime-native-agent.js +84 -0
- package/dist/runtime-native-agent.js.map +1 -0
- package/dist/runtime-native-agent.types.d.ts +21 -0
- package/dist/runtime-native-agent.types.d.ts.map +1 -0
- package/dist/runtime-native-agent.types.js +3 -0
- package/dist/runtime-native-agent.types.js.map +1 -0
- package/dist/runtime-native-event-tools.d.ts +28 -0
- package/dist/runtime-native-event-tools.d.ts.map +1 -0
- package/dist/runtime-native-event-tools.js +88 -0
- package/dist/runtime-native-event-tools.js.map +1 -0
- package/dist/runtime-native-events-helpers.d.ts +30 -0
- package/dist/runtime-native-events-helpers.d.ts.map +1 -0
- package/dist/runtime-native-events-helpers.js +74 -0
- package/dist/runtime-native-events-helpers.js.map +1 -0
- package/dist/runtime-native-events.d.ts +45 -0
- package/dist/runtime-native-events.d.ts.map +1 -0
- package/dist/runtime-native-events.js +89 -0
- package/dist/runtime-native-events.js.map +1 -0
- package/dist/runtime-native-limits.d.ts +18 -0
- package/dist/runtime-native-limits.d.ts.map +1 -0
- package/dist/runtime-native-limits.js +59 -0
- package/dist/runtime-native-limits.js.map +1 -0
- package/dist/runtime-native-messages.d.ts +24 -0
- package/dist/runtime-native-messages.d.ts.map +1 -0
- package/dist/runtime-native-messages.js +83 -0
- package/dist/runtime-native-messages.js.map +1 -0
- package/dist/runtime-native-messages.types.d.ts +7 -0
- package/dist/runtime-native-messages.types.d.ts.map +1 -0
- package/dist/runtime-native-messages.types.js +2 -0
- package/dist/runtime-native-messages.types.js.map +1 -0
- package/dist/runtime-native-public-state.d.ts +22 -0
- package/dist/runtime-native-public-state.d.ts.map +1 -0
- package/dist/runtime-native-public-state.js +44 -0
- package/dist/runtime-native-public-state.js.map +1 -0
- package/dist/runtime-native-public-tools.d.ts +15 -0
- package/dist/runtime-native-public-tools.d.ts.map +1 -0
- package/dist/runtime-native-public-tools.js +39 -0
- package/dist/runtime-native-public-tools.js.map +1 -0
- package/dist/runtime-native-public.d.ts +28 -0
- package/dist/runtime-native-public.d.ts.map +1 -0
- package/dist/runtime-native-public.js +165 -0
- package/dist/runtime-native-public.js.map +1 -0
- package/dist/runtime-native-public.types.d.ts +5 -0
- package/dist/runtime-native-public.types.d.ts.map +1 -0
- package/dist/runtime-native-public.types.js +3 -0
- package/dist/runtime-native-public.types.js.map +1 -0
- package/dist/runtime-native-response-format.d.ts +15 -0
- package/dist/runtime-native-response-format.d.ts.map +1 -0
- package/dist/runtime-native-response-format.js +46 -0
- package/dist/runtime-native-response-format.js.map +1 -0
- package/dist/runtime-native-subagents.d.ts +47 -0
- package/dist/runtime-native-subagents.d.ts.map +1 -0
- package/dist/runtime-native-subagents.js +50 -0
- package/dist/runtime-native-subagents.js.map +1 -0
- package/dist/runtime-native-subagents.types.d.ts +7 -0
- package/dist/runtime-native-subagents.types.d.ts.map +1 -0
- package/dist/runtime-native-subagents.types.js +2 -0
- package/dist/runtime-native-subagents.types.js.map +1 -0
- package/dist/runtime-native-support.d.ts +67 -0
- package/dist/runtime-native-support.d.ts.map +1 -0
- package/dist/runtime-native-support.js +112 -0
- package/dist/runtime-native-support.js.map +1 -0
- package/dist/runtime-native-support.types.d.ts +9 -0
- package/dist/runtime-native-support.types.d.ts.map +1 -0
- package/dist/runtime-native-support.types.js +2 -0
- package/dist/runtime-native-support.types.js.map +1 -0
- package/dist/runtime-native-tool-build.d.ts +12 -0
- package/dist/runtime-native-tool-build.d.ts.map +1 -0
- package/dist/runtime-native-tool-build.js +81 -0
- package/dist/runtime-native-tool-build.js.map +1 -0
- package/dist/runtime-native-tool-build.types.d.ts +14 -0
- package/dist/runtime-native-tool-build.types.d.ts.map +1 -0
- package/dist/runtime-native-tool-build.types.js +2 -0
- package/dist/runtime-native-tool-build.types.js.map +1 -0
- package/dist/runtime-native-tools-identity.d.ts +15 -0
- package/dist/runtime-native-tools-identity.d.ts.map +1 -0
- package/dist/runtime-native-tools-identity.js +14 -0
- package/dist/runtime-native-tools-identity.js.map +1 -0
- package/dist/runtime-native-tools.d.ts +29 -0
- package/dist/runtime-native-tools.d.ts.map +1 -0
- package/dist/runtime-native-tools.js +65 -0
- package/dist/runtime-native-tools.js.map +1 -0
- package/dist/runtime-native-tools.types.d.ts +21 -0
- package/dist/runtime-native-tools.types.d.ts.map +1 -0
- package/dist/runtime-native-tools.types.js +3 -0
- package/dist/runtime-native-tools.types.js.map +1 -0
- package/dist/runtime-service.d.ts +15 -0
- package/dist/runtime-service.d.ts.map +1 -0
- package/dist/runtime-service.js +20 -0
- package/dist/runtime-service.js.map +1 -0
- package/dist/runtime-service.types.d.ts +12 -0
- package/dist/runtime-service.types.d.ts.map +1 -0
- package/dist/runtime-service.types.js +3 -0
- package/dist/runtime-service.types.js.map +1 -0
- package/dist/runtime-state-schemas.d.ts +19 -0
- package/dist/runtime-state-schemas.d.ts.map +1 -0
- package/dist/runtime-state-schemas.js +58 -0
- package/dist/runtime-state-schemas.js.map +1 -0
- package/dist/runtime-strict-response-schema.d.ts +9 -0
- package/dist/runtime-strict-response-schema.d.ts.map +1 -0
- package/dist/runtime-strict-response-schema.js +67 -0
- package/dist/runtime-strict-response-schema.js.map +1 -0
- package/dist/runtime-tool-adapter.d.ts +34 -0
- package/dist/runtime-tool-adapter.d.ts.map +1 -0
- package/dist/runtime-tool-adapter.js +66 -0
- package/dist/runtime-tool-adapter.js.map +1 -0
- package/dist/runtime-tool-dispatcher.d.ts +32 -0
- package/dist/runtime-tool-dispatcher.d.ts.map +1 -0
- package/dist/runtime-tool-dispatcher.js +67 -0
- package/dist/runtime-tool-dispatcher.js.map +1 -0
- package/dist/runtime-tool-events.d.ts +49 -0
- package/dist/runtime-tool-events.d.ts.map +1 -0
- package/dist/runtime-tool-events.js +106 -0
- package/dist/runtime-tool-events.js.map +1 -0
- package/dist/runtime-tool-events.types.d.ts +8 -0
- package/dist/runtime-tool-events.types.d.ts.map +1 -0
- package/dist/runtime-tool-events.types.js +3 -0
- package/dist/runtime-tool-events.types.js.map +1 -0
- package/dist/runtime-tool-invocation.d.ts +19 -0
- package/dist/runtime-tool-invocation.d.ts.map +1 -0
- package/dist/runtime-tool-invocation.js +74 -0
- package/dist/runtime-tool-invocation.js.map +1 -0
- package/dist/runtime-tool-lookup.d.ts +56 -0
- package/dist/runtime-tool-lookup.d.ts.map +1 -0
- package/dist/runtime-tool-lookup.js +71 -0
- package/dist/runtime-tool-lookup.js.map +1 -0
- package/dist/runtime-tools.d.ts +35 -0
- package/dist/runtime-tools.d.ts.map +1 -0
- package/dist/runtime-tools.js +78 -0
- package/dist/runtime-tools.js.map +1 -0
- package/dist/runtime-tools.types.d.ts +7 -0
- package/dist/runtime-tools.types.d.ts.map +1 -0
- package/dist/runtime-tools.types.js +2 -0
- package/dist/runtime-tools.types.js.map +1 -0
- package/dist/runtime-utils.d.ts +56 -0
- package/dist/runtime-utils.d.ts.map +1 -0
- package/dist/runtime-utils.js +106 -0
- package/dist/runtime-utils.js.map +1 -0
- package/dist/runtime.d.ts +47 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +90 -0
- package/dist/runtime.js.map +1 -0
- package/dist/runtime.types.d.ts +77 -0
- package/dist/runtime.types.d.ts.map +1 -0
- package/dist/runtime.types.js +3 -0
- package/dist/runtime.types.js.map +1 -0
- package/dist/signal-deadline.d.ts +12 -0
- package/dist/signal-deadline.d.ts.map +1 -0
- package/dist/signal-deadline.js +21 -0
- package/dist/signal-deadline.js.map +1 -0
- package/dist/signal.d.ts +64 -0
- package/dist/signal.d.ts.map +1 -0
- package/dist/signal.js +136 -0
- package/dist/signal.js.map +1 -0
- package/dist/signal.types.d.ts +35 -0
- package/dist/signal.types.d.ts.map +1 -0
- package/dist/signal.types.js +3 -0
- package/dist/signal.types.js.map +1 -0
- package/dist/testing/agent-approvals.d.ts +8 -0
- package/dist/testing/agent-approvals.d.ts.map +1 -0
- package/dist/testing/agent-approvals.js +98 -0
- package/dist/testing/agent-approvals.js.map +1 -0
- package/dist/testing/agent-approvals.types.d.ts +24 -0
- package/dist/testing/agent-approvals.types.d.ts.map +1 -0
- package/dist/testing/agent-approvals.types.js +3 -0
- package/dist/testing/agent-approvals.types.js.map +1 -0
- package/dist/testing/agent-harness.types.d.ts +25 -0
- package/dist/testing/agent-harness.types.d.ts.map +1 -0
- package/dist/testing/agent-harness.types.js +3 -0
- package/dist/testing/agent-harness.types.js.map +1 -0
- package/dist/testing/agent-state-invocation.d.ts +4 -0
- package/dist/testing/agent-state-invocation.d.ts.map +1 -0
- package/dist/testing/agent-state-invocation.js +41 -0
- package/dist/testing/agent-state-invocation.js.map +1 -0
- package/dist/testing/agent-state-lifecycle.d.ts +6 -0
- package/dist/testing/agent-state-lifecycle.d.ts.map +1 -0
- package/dist/testing/agent-state-lifecycle.js +36 -0
- package/dist/testing/agent-state-lifecycle.js.map +1 -0
- package/dist/testing/agent-state-setup.d.ts +18 -0
- package/dist/testing/agent-state-setup.d.ts.map +1 -0
- package/dist/testing/agent-state-setup.js +52 -0
- package/dist/testing/agent-state-setup.js.map +1 -0
- package/dist/testing/agent-state.d.ts +12 -0
- package/dist/testing/agent-state.d.ts.map +1 -0
- package/dist/testing/agent-state.js +40 -0
- package/dist/testing/agent-state.js.map +1 -0
- package/dist/testing/agents-model-native.d.ts +37 -0
- package/dist/testing/agents-model-native.d.ts.map +1 -0
- package/dist/testing/agents-model-native.js +111 -0
- package/dist/testing/agents-model-native.js.map +1 -0
- package/dist/testing/agents-model-operations.d.ts +28 -0
- package/dist/testing/agents-model-operations.d.ts.map +1 -0
- package/dist/testing/agents-model-operations.js +91 -0
- package/dist/testing/agents-model-operations.js.map +1 -0
- package/dist/testing/agents-model.d.ts +25 -0
- package/dist/testing/agents-model.d.ts.map +1 -0
- package/dist/testing/agents-model.js +72 -0
- package/dist/testing/agents-model.js.map +1 -0
- package/dist/testing/agents-model.types.d.ts +24 -0
- package/dist/testing/agents-model.types.d.ts.map +1 -0
- package/dist/testing/agents-model.types.js +3 -0
- package/dist/testing/agents-model.types.js.map +1 -0
- package/dist/testing/agents-types.d.ts +3 -0
- package/dist/testing/agents-types.d.ts.map +1 -0
- package/dist/testing/agents-types.js +2 -0
- package/dist/testing/agents-types.js.map +1 -0
- package/dist/testing/agents-utils.d.ts +26 -0
- package/dist/testing/agents-utils.d.ts.map +1 -0
- package/dist/testing/agents-utils.js +79 -0
- package/dist/testing/agents-utils.js.map +1 -0
- package/dist/testing/agents.d.ts +26 -0
- package/dist/testing/agents.d.ts.map +1 -0
- package/dist/testing/agents.js +64 -0
- package/dist/testing/agents.js.map +1 -0
- package/dist/testing/agents.types.d.ts +113 -0
- package/dist/testing/agents.types.d.ts.map +1 -0
- package/dist/testing/agents.types.js +3 -0
- package/dist/testing/agents.types.js.map +1 -0
- package/package.json +191 -4
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** Adapts authored state schemas to the native graph state contract and preserves the reducers and validated channel shapes required by compilation. */
|
|
2
|
+
import { StateSchema } from "@langchain/langgraph";
|
|
3
|
+
import { getJsonSchema } from "@relkit/schema";
|
|
4
|
+
import { Effect, Metric, Schema } from "effect";
|
|
5
|
+
import { observeAgent } from "@relkit/agents/internal/agent-telemetry";
|
|
6
|
+
import { AgentRuntimeError } from "./runtime-errors.js";
|
|
7
|
+
const selectionCount = Metric.counter("relkit.agents.graph_state.selection.total");
|
|
8
|
+
const selectionFailures = Metric.counter("relkit.agents.graph_state.selection.failure.total");
|
|
9
|
+
/** Expected graph state projection failure in the Effect error channel. */
|
|
10
|
+
export class GraphStateSelectionError extends Schema.TaggedError()("GraphStateSelectionError", { code: Schema.String, message: Schema.String }) {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Projects a graph state to the fields declared by a client selection schema.
|
|
14
|
+
*
|
|
15
|
+
* @param state - LangGraph state definition to project.
|
|
16
|
+
* @param selection - Standard Schema describing the selected fields.
|
|
17
|
+
* @returns An Effect with the selected StateSchema or GraphStateSelectionError.
|
|
18
|
+
* @throws A defect if LangGraph rejects an otherwise valid StateSchema construction.
|
|
19
|
+
* @example
|
|
20
|
+
* const projected = Effect.runSync(selectGraphStateEffect(state, z.object({ answer: z.string() })));
|
|
21
|
+
*/
|
|
22
|
+
export const selectGraphStateEffect = Effect.fn("Agents.graphState.select")(function* (state, selection) {
|
|
23
|
+
yield* Metric.update(selectionCount, 1);
|
|
24
|
+
const projection = yield* Effect.sync(() => getJsonSchema(selection));
|
|
25
|
+
const properties = projection.ok ? projection.schema.properties : undefined;
|
|
26
|
+
if (!isRecord(properties)) {
|
|
27
|
+
yield* Metric.update(selectionFailures, 1);
|
|
28
|
+
return yield* Effect.fail(new GraphStateSelectionError({
|
|
29
|
+
code: "RELKIT_SCHEMA_UNAVAILABLE",
|
|
30
|
+
message: "Graph state selection is unavailable",
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
const selected = {};
|
|
34
|
+
for (const key of Object.keys(properties)) {
|
|
35
|
+
const field = state.fields[key];
|
|
36
|
+
if (field === undefined) {
|
|
37
|
+
yield* Metric.update(selectionFailures, 1);
|
|
38
|
+
return yield* Effect.fail(new GraphStateSelectionError({
|
|
39
|
+
code: "RELKIT_SCHEMA_UNAVAILABLE",
|
|
40
|
+
message: `Graph state field "${key}" is unavailable`,
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
selected[key] = field;
|
|
44
|
+
}
|
|
45
|
+
return yield* Effect.sync(() => new StateSchema(selected));
|
|
46
|
+
}, (effect) => observeAgent("graph-state.select", effect));
|
|
47
|
+
/**
|
|
48
|
+
* Projects graph state for existing synchronous graph definition callers.
|
|
49
|
+
*
|
|
50
|
+
* @param state - LangGraph state definition to project.
|
|
51
|
+
* @param selection - Schema describing selected fields.
|
|
52
|
+
* @returns A new StateSchema with only those fields.
|
|
53
|
+
* @throws AgentRuntimeError when the selection or one of its fields is unavailable.
|
|
54
|
+
* @example
|
|
55
|
+
* const projected = selectGraphState(state, z.object({ answer: z.string() }));
|
|
56
|
+
*/
|
|
57
|
+
export function selectGraphState(state, selection) {
|
|
58
|
+
return Effect.runSync(selectGraphStateEffect(state, selection).pipe(Effect.catchTag("GraphStateSelectionError", (error) => Effect.sync(() => {
|
|
59
|
+
throw new AgentRuntimeError(error.code, error.message);
|
|
60
|
+
}))));
|
|
61
|
+
}
|
|
62
|
+
function isRecord(value) {
|
|
63
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
64
|
+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CAC3C,MAAM,CAAC,QAAQ,CAAC,0BAA0B,EAAE,CAAC,KAAK,EAAE,EAAE,CACpD,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;QACf,MAAM,IAAI,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC,CAAC,CACH,CACF,CACF,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Marker for a graph embedded as a native node. */
|
|
2
|
+
export declare const RELKIT_SUBGRAPH_NODE: unique symbol;
|
|
3
|
+
/** Hidden reference to the embedded graph descriptor. */
|
|
4
|
+
export declare const RELKIT_SUBGRAPH: unique symbol;
|
|
5
|
+
//# sourceMappingURL=graph-subgraph-symbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-subgraph-symbol.d.ts","sourceRoot":"","sources":["../src/graph-subgraph-symbol.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,eAAO,MAAM,oBAAoB,eAAqC,CAAC;AAEvE,yDAAyD;AACzD,eAAO,MAAM,eAAe,eAAgC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Marker for a graph embedded as a native node. */
|
|
2
|
+
export const RELKIT_SUBGRAPH_NODE = Symbol.for("relkit.subgraph-node");
|
|
3
|
+
/** Hidden reference to the embedded graph descriptor. */
|
|
4
|
+
export const RELKIT_SUBGRAPH = Symbol.for("relkit.subgraph");
|
|
5
|
+
//# sourceMappingURL=graph-subgraph-symbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-subgraph-symbol.js","sourceRoot":"","sources":["../src/graph-subgraph-symbol.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEvE,yDAAyD;AACzD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Creates nested graph descriptors with their native execution metadata so parent compilation can retain subgraph state and interruption semantics. */
|
|
2
|
+
import type { StandardSchemaV1 } from "@relkit/schema";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import type { GraphDescriptor } from "./define-graph.js";
|
|
5
|
+
import type { GraphAsNodeOptions, SubgraphNodeDescriptor } from "./graph-subgraph.types.js";
|
|
6
|
+
export type * from "./graph-subgraph.types.js";
|
|
7
|
+
/** Creates a native node backed by another graph.
|
|
8
|
+
* @param graph - Graph to embed.
|
|
9
|
+
* @param options - Optional node identity and destinations.
|
|
10
|
+
* @returns An Effect with a frozen node or GraphNodeValidationFailure.
|
|
11
|
+
* @example Effect.runSync(createSubgraphNodeEffect(graph, { id: "nested" }));
|
|
12
|
+
*/
|
|
13
|
+
export declare const createSubgraphNodeEffect: <const Id extends string, InputSchema extends StandardSchemaV1, OutputSchema extends StandardSchemaV1>(graph: GraphDescriptor<string, InputSchema, OutputSchema, import("@langchain/langgraph").AnyStateSchema, readonly import("./define-graph.types.js").GraphNodeLike[]>, options?: GraphAsNodeOptions<Id> | undefined) => Effect.Effect<SubgraphNodeDescriptor<Id, InputSchema, OutputSchema>, import("./graph-node-validation-error.js").GraphNodeValidationFailure, never>;
|
|
14
|
+
/** Creates an embedded graph node for existing synchronous callers.
|
|
15
|
+
* @param graph - Graph to embed.
|
|
16
|
+
* @param options - Optional node identity and destinations.
|
|
17
|
+
* @returns A frozen subgraph node.
|
|
18
|
+
* @throws The original invalid options or destination error.
|
|
19
|
+
* @example const node = createSubgraphNode(graph, { id: "nested" });
|
|
20
|
+
*/
|
|
21
|
+
export declare function createSubgraphNode<const Id extends string, InputSchema extends StandardSchemaV1, OutputSchema extends StandardSchemaV1>(graph: GraphDescriptor<string, InputSchema, OutputSchema>, options?: GraphAsNodeOptions<Id>): SubgraphNodeDescriptor<Id, InputSchema, OutputSchema>;
|
|
22
|
+
/** Checks whether a value is an embedded graph node.
|
|
23
|
+
* @param value - Candidate node.
|
|
24
|
+
* @returns An Effect with a boolean and no typed failure.
|
|
25
|
+
* @example Effect.runSync(isSubgraphNodeEffect(value));
|
|
26
|
+
*/
|
|
27
|
+
export declare const isSubgraphNodeEffect: (value: unknown) => Effect.Effect<boolean, never, never>;
|
|
28
|
+
/** Checks embedded graph nodes for existing synchronous callers.
|
|
29
|
+
* @param value - Candidate node.
|
|
30
|
+
* @returns Whether the value is an embedded graph node.
|
|
31
|
+
* @example if (isSubgraphNode(value)) subgraphForNode(value);
|
|
32
|
+
*/
|
|
33
|
+
export declare function isSubgraphNode(value: unknown): value is SubgraphNodeDescriptor;
|
|
34
|
+
/** Reads the source graph from a subgraph node.
|
|
35
|
+
* @param value - Embedded graph node.
|
|
36
|
+
* @returns An Effect with the source descriptor.
|
|
37
|
+
* @example Effect.runSync(subgraphForNodeEffect(node));
|
|
38
|
+
*/
|
|
39
|
+
export declare const subgraphForNodeEffect: (value: SubgraphNodeDescriptor<string, StandardSchemaV1<unknown, unknown>, StandardSchemaV1<unknown, unknown>>) => Effect.Effect<GraphDescriptor<string, StandardSchemaV1<unknown, unknown>, StandardSchemaV1<unknown, unknown>, import("@langchain/langgraph").AnyStateSchema, readonly import("./define-graph.types.js").GraphNodeLike[]>, never, never>;
|
|
40
|
+
/** Reads the source graph for existing synchronous callers.
|
|
41
|
+
* @param value - Embedded graph node.
|
|
42
|
+
* @returns The source graph descriptor.
|
|
43
|
+
* @example const nested = subgraphForNode(node);
|
|
44
|
+
*/
|
|
45
|
+
export declare function subgraphForNode(value: SubgraphNodeDescriptor): GraphDescriptor;
|
|
46
|
+
//# sourceMappingURL=graph-subgraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-subgraph.d.ts","sourceRoot":"","sources":["../src/graph-subgraph.ts"],"names":[],"mappings":"AAAA,wJAAwJ;AAGxJ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAE5F,mBAAmB,2BAA2B,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,SAE3B,EAAE,SAAS,MAAM,EACvB,WAAW,SAAS,gBAAgB,EACpC,YAAY,SAAS,gBAAgB,2WA2BxC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,CAAC,EAAE,SAAS,MAAM,EACvB,WAAW,SAAS,gBAAgB,EACpC,YAAY,SAAS,gBAAgB,EAErC,KAAK,EAAE,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,EACzD,OAAO,GAAE,kBAAkB,CAAC,EAAE,CAAM,GACnC,sBAAsB,CAAC,EAAE,EAAE,WAAW,EAAE,YAAY,CAAC,CAMvD;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,0DAahC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,sBAAsB,CAE9E;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,4VAGjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,GAAG,eAAe,CAE9E"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** Creates nested graph descriptors with their native execution metadata so parent compilation can retain subgraph state and interruption semantics. */
|
|
2
|
+
import { normalizeId } from "@relkit/contracts";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { observeAgent } from "@relkit/agents/internal/agent-telemetry";
|
|
5
|
+
import { isRecordEffect } from "@relkit/agents/internal/agent-validation-value";
|
|
6
|
+
import { graphNodeValidationFailure } from "./graph-node-validation-error.js";
|
|
7
|
+
import { copyGraphNodeEndsEffect } from "./graph-node-validation.js";
|
|
8
|
+
import { RELKIT_SUBGRAPH, RELKIT_SUBGRAPH_NODE } from "./graph-subgraph-symbol.js";
|
|
9
|
+
/** Creates a native node backed by another graph.
|
|
10
|
+
* @param graph - Graph to embed.
|
|
11
|
+
* @param options - Optional node identity and destinations.
|
|
12
|
+
* @returns An Effect with a frozen node or GraphNodeValidationFailure.
|
|
13
|
+
* @example Effect.runSync(createSubgraphNodeEffect(graph, { id: "nested" }));
|
|
14
|
+
*/
|
|
15
|
+
export const createSubgraphNodeEffect = Effect.fn("Agents.graph.subgraphCreate")(function* (graph, options = {}) {
|
|
16
|
+
if (!(yield* isRecordEffect(options))) {
|
|
17
|
+
return yield* Effect.fail(graphNodeValidationFailure(new TypeError("Subgraph node options must be an object")));
|
|
18
|
+
}
|
|
19
|
+
const id = yield* Effect.try({
|
|
20
|
+
try: () => normalizeId(options.id ?? graph.id),
|
|
21
|
+
catch: graphNodeValidationFailure,
|
|
22
|
+
});
|
|
23
|
+
const ends = yield* copyGraphNodeEndsEffect(options.ends);
|
|
24
|
+
const descriptor = {
|
|
25
|
+
[RELKIT_SUBGRAPH_NODE]: true,
|
|
26
|
+
kind: "subgraph-node",
|
|
27
|
+
id,
|
|
28
|
+
input: graph.input,
|
|
29
|
+
output: graph.output,
|
|
30
|
+
ends,
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(descriptor, RELKIT_SUBGRAPH, { value: graph, enumerable: false });
|
|
33
|
+
return Object.freeze(descriptor);
|
|
34
|
+
}, (effect) => observeAgent("graph.subgraph-create", effect));
|
|
35
|
+
/** Creates an embedded graph node for existing synchronous callers.
|
|
36
|
+
* @param graph - Graph to embed.
|
|
37
|
+
* @param options - Optional node identity and destinations.
|
|
38
|
+
* @returns A frozen subgraph node.
|
|
39
|
+
* @throws The original invalid options or destination error.
|
|
40
|
+
* @example const node = createSubgraphNode(graph, { id: "nested" });
|
|
41
|
+
*/
|
|
42
|
+
export function createSubgraphNode(graph, options = {}) {
|
|
43
|
+
return Effect.runSync(createSubgraphNodeEffect(graph, options).pipe(Effect.catchTag("GraphNodeValidationFailure", (failure) => Effect.fail(failure.cause))));
|
|
44
|
+
}
|
|
45
|
+
/** Checks whether a value is an embedded graph node.
|
|
46
|
+
* @param value - Candidate node.
|
|
47
|
+
* @returns An Effect with a boolean and no typed failure.
|
|
48
|
+
* @example Effect.runSync(isSubgraphNodeEffect(value));
|
|
49
|
+
*/
|
|
50
|
+
export const isSubgraphNodeEffect = Effect.fn("Agents.graph.subgraphIsNode")(function* (value) {
|
|
51
|
+
if (!(yield* isRecordEffect(value)))
|
|
52
|
+
return false;
|
|
53
|
+
const record = value;
|
|
54
|
+
return (record[RELKIT_SUBGRAPH_NODE] === true &&
|
|
55
|
+
record.kind === "subgraph-node" &&
|
|
56
|
+
typeof record.id === "string" &&
|
|
57
|
+
Array.isArray(record.ends) &&
|
|
58
|
+
record[RELKIT_SUBGRAPH] !== undefined);
|
|
59
|
+
}, (effect) => observeAgent("graph.subgraph-is-node", effect));
|
|
60
|
+
/** Checks embedded graph nodes for existing synchronous callers.
|
|
61
|
+
* @param value - Candidate node.
|
|
62
|
+
* @returns Whether the value is an embedded graph node.
|
|
63
|
+
* @example if (isSubgraphNode(value)) subgraphForNode(value);
|
|
64
|
+
*/
|
|
65
|
+
export function isSubgraphNode(value) {
|
|
66
|
+
return Effect.runSync(isSubgraphNodeEffect(value));
|
|
67
|
+
}
|
|
68
|
+
/** Reads the source graph from a subgraph node.
|
|
69
|
+
* @param value - Embedded graph node.
|
|
70
|
+
* @returns An Effect with the source descriptor.
|
|
71
|
+
* @example Effect.runSync(subgraphForNodeEffect(node));
|
|
72
|
+
*/
|
|
73
|
+
export const subgraphForNodeEffect = Effect.fn("Agents.graph.subgraphSource")((value) => Effect.sync(() => value[RELKIT_SUBGRAPH]), (effect) => observeAgent("graph.subgraph-source", effect));
|
|
74
|
+
/** Reads the source graph for existing synchronous callers.
|
|
75
|
+
* @param value - Embedded graph node.
|
|
76
|
+
* @returns The source graph descriptor.
|
|
77
|
+
* @example const nested = subgraphForNode(node);
|
|
78
|
+
*/
|
|
79
|
+
export function subgraphForNode(value) {
|
|
80
|
+
return Effect.runSync(subgraphForNodeEffect(value));
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=graph-subgraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-subgraph.js","sourceRoot":"","sources":["../src/graph-subgraph.ts"],"names":[],"mappings":"AAAA,wJAAwJ;AAExJ,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAEhF,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKnF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,EAAE,CAAC,6BAA6B,CAAC,CAC9E,QAAQ,CAAC,EAKP,KAAyD,EACzD,UAAkC,EAAE;IAEpC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACvB,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AAE,CAAC,6BAA6B,CAAC,CAC1E,QAAQ,CAAC,EAAE,KAAc;IACvB,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAClD,MAAM,MAAM,GAAG,KAAqC,CAAC;IACrD,OAAO,CACL,MAAM,CAAC,oBAAoB,CAAC,KAAK,IAAI;QACrC,MAAM,CAAC,IAAI,KAAK,eAAe;QAC/B,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ;QAC7B,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;QAC1B,MAAM,CAAC,eAAe,CAAC,KAAK,SAAS,CACtC,CAAC;AACJ,CAAC,EACD,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAC3D,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,EAAE,CAAC,6BAA6B,CAAC,CAC3E,CAAC,KAA6B,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,EAC5E,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAC1D,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAA6B;IAC3D,OAAO,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Creates nested graph descriptors with their native execution metadata so parent compilation can retain subgraph state and interruption semantics. This companion preserves the native input and output types without starting runtime work. */
|
|
2
|
+
import type { StandardSchemaV1 } from "@relkit/schema";
|
|
3
|
+
import type { GraphDescriptor } from "./define-graph.js";
|
|
4
|
+
import type { RELKIT_SUBGRAPH, RELKIT_SUBGRAPH_NODE } from "./graph-subgraph-symbol.js";
|
|
5
|
+
/** Authoring options for a graph embedded as a node. */
|
|
6
|
+
export interface GraphAsNodeOptions<Id extends string = string> {
|
|
7
|
+
readonly id?: Id;
|
|
8
|
+
readonly ends?: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
/** Native graph node whose action is another graph. */
|
|
11
|
+
export interface SubgraphNodeDescriptor<Id extends string = string, InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {
|
|
12
|
+
readonly [RELKIT_SUBGRAPH_NODE]: true;
|
|
13
|
+
readonly kind: "subgraph-node";
|
|
14
|
+
readonly id: Id;
|
|
15
|
+
readonly input: InputSchema;
|
|
16
|
+
readonly output: OutputSchema;
|
|
17
|
+
readonly ends: readonly string[];
|
|
18
|
+
readonly [RELKIT_SUBGRAPH]: GraphDescriptor;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=graph-subgraph.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-subgraph.types.d.ts","sourceRoot":"","sources":["../src/graph-subgraph.types.ts"],"names":[],"mappings":"AAAA,kPAAkP;AAElP,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAExF,wDAAwD;AACxD,MAAM,WAAW,kBAAkB,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM;IAC5D,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,uDAAuD;AACvD,MAAM,WAAW,sBAAsB,CACrC,EAAE,SAAS,MAAM,GAAG,MAAM,EAC1B,WAAW,SAAS,gBAAgB,GAAG,gBAAgB,EACvD,YAAY,SAAS,gBAAgB,GAAG,gBAAgB;IAExD,QAAQ,CAAC,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;CAC7C"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Creates nested graph descriptors with their native execution metadata so parent compilation can retain subgraph state and interruption semantics. This companion preserves the native input and output types without starting runtime work. */
|
|
2
|
+
export {};
|
|
3
|
+
//# sourceMappingURL=graph-subgraph.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-subgraph.types.js","sourceRoot":"","sources":["../src/graph-subgraph.types.ts"],"names":[],"mappings":"AAAA,kPAAkP"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Defines graph workflow failures at the RELKIT execution boundary, preserving graph identity and the native failure cause. */
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
declare const GraphWorkflowFailure_base: Schema.Class<GraphWorkflowFailure, Schema.TaggedStruct<"GraphWorkflowFailure", {
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
readonly cause: Schema.Unknown;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
/** Tagged graph workflow projection failure. */
|
|
8
|
+
export declare class GraphWorkflowFailure extends GraphWorkflowFailure_base {
|
|
9
|
+
}
|
|
10
|
+
/** Preserves a graph workflow projection error.
|
|
11
|
+
* @param cause - Node, edge, or schema projection failure.
|
|
12
|
+
* @returns A tagged workflow failure.
|
|
13
|
+
* @example graphWorkflowFailure(new TypeError("invalid node"));
|
|
14
|
+
*/
|
|
15
|
+
export declare function graphWorkflowFailure(cause: unknown): GraphWorkflowFailure;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=graph-workflow-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-workflow-error.d.ts","sourceRoot":"","sources":["../src/graph-workflow-error.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAEhI,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;AAEhC,gDAAgD;AAChD,qBAAa,oBAAqB,SAAQ,yBAGzC;CAAG;AAEJ;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CAKzE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Defines graph workflow failures at the RELKIT execution boundary, preserving graph identity and the native failure cause. */
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/** Tagged graph workflow projection failure. */
|
|
4
|
+
export class GraphWorkflowFailure extends Schema.TaggedError()("GraphWorkflowFailure", { message: Schema.String, cause: Schema.Unknown }) {
|
|
5
|
+
}
|
|
6
|
+
/** Preserves a graph workflow projection error.
|
|
7
|
+
* @param cause - Node, edge, or schema projection failure.
|
|
8
|
+
* @returns A tagged workflow failure.
|
|
9
|
+
* @example graphWorkflowFailure(new TypeError("invalid node"));
|
|
10
|
+
*/
|
|
11
|
+
export function graphWorkflowFailure(cause) {
|
|
12
|
+
return new GraphWorkflowFailure({
|
|
13
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
14
|
+
cause,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=graph-workflow-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-workflow-error.js","sourceRoot":"","sources":["../src/graph-workflow-error.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAEhI,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,gDAAgD;AAChD,MAAM,OAAO,oBAAqB,SAAQ,MAAM,CAAC,WAAW,EAAwB,CAClF,sBAAsB,EACtB,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,CAClD;CAAG;AAEJ;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,OAAO,IAAI,oBAAoB,CAAC;QAC9B,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/D,KAAK;KACN,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Adapts native graph execution to the RELKIT workflow contract, carrying invocation context and scoped persistence through completion. */
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { type FunctionGraphNodeDescriptor } from "@relkit/functions";
|
|
4
|
+
import { type StandardSchemaV1 } from "@relkit/schema";
|
|
5
|
+
import type { GraphNodeAny } from "./define-graph-node.js";
|
|
6
|
+
import { type SubgraphNodeDescriptor } from "./graph-subgraph.js";
|
|
7
|
+
import type { GraphEdgeOperation } from "./graph-edges.js";
|
|
8
|
+
import type { GraphWorkflow } from "./graph-workflow.types.js";
|
|
9
|
+
export type * from "./graph-workflow.types.js";
|
|
10
|
+
/** Projects a frozen serializable graph workflow from authoring nodes and edges.
|
|
11
|
+
* @param nodes - Validated graph nodes.
|
|
12
|
+
* @param edges - Validated graph edge operations.
|
|
13
|
+
* @returns An Effect with a workflow or GraphWorkflowFailure.
|
|
14
|
+
* @example Effect.runSync(graphWorkflowEffect(nodes, edges));
|
|
15
|
+
*/
|
|
16
|
+
export declare const graphWorkflowEffect: <Id extends string, State>(nodes: readonly (GraphNodeAny | FunctionGraphNodeDescriptor<string, string, unknown, unknown, readonly import("@relkit/functions").ErrorDescriptorAny[], StandardSchemaV1<unknown, unknown>, StandardSchemaV1<unknown, unknown>, import("@relkit/functions").FunctionDependencies> | SubgraphNodeDescriptor<string, StandardSchemaV1<unknown, unknown>, StandardSchemaV1<unknown, unknown>>)[], edges: readonly GraphEdgeOperation<Id, State>[]) => Effect.Effect<GraphWorkflow, import("./graph-workflow-error.js").GraphWorkflowFailure, never>;
|
|
17
|
+
/** Projects a workflow for existing synchronous graph callers.
|
|
18
|
+
* @param nodes - Validated graph nodes.
|
|
19
|
+
* @param edges - Validated graph edge operations.
|
|
20
|
+
* @returns A frozen serializable workflow.
|
|
21
|
+
* @throws The original node or schema projection error.
|
|
22
|
+
* @example graphWorkflow(nodes, edges);
|
|
23
|
+
*/
|
|
24
|
+
export declare function graphWorkflow<Id extends string, State>(nodes: readonly (GraphNodeAny | FunctionGraphNodeDescriptor | SubgraphNodeDescriptor)[], edges: readonly GraphEdgeOperation<Id, State>[]): GraphWorkflow;
|
|
25
|
+
/** Checks whether any graph node has a resumable continuation.
|
|
26
|
+
* @param workflow - Frozen graph workflow.
|
|
27
|
+
* @returns An Effect with a boolean and no typed failure.
|
|
28
|
+
* @example Effect.runSync(graphWorkflowRequiresPersistenceEffect(workflow));
|
|
29
|
+
*/
|
|
30
|
+
export declare const graphWorkflowRequiresPersistenceEffect: (workflow: GraphWorkflow) => Effect.Effect<boolean, never, never>;
|
|
31
|
+
/** Checks persistence needs for existing synchronous graph callers.
|
|
32
|
+
* @param workflow - Frozen graph workflow.
|
|
33
|
+
* @returns Whether any node has a resumable continuation.
|
|
34
|
+
* @example graphWorkflowRequiresPersistence(workflow);
|
|
35
|
+
*/
|
|
36
|
+
export declare function graphWorkflowRequiresPersistence(workflow: GraphWorkflow): boolean;
|
|
37
|
+
//# sourceMappingURL=graph-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-workflow.d.ts","sourceRoot":"","sources":["../src/graph-workflow.ts"],"names":[],"mappings":"AAAA,4IAA4I;AAI5I,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAuB,KAAK,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAmC,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACnG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EACV,aAAa,EAGd,MAAM,2BAA2B,CAAC;AAEnC,mBAAmB,2BAA2B,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC7B,EAAE,SAAS,MAAM,EAAE,KAAK,mhBAgB1B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,KAAK,EACpD,KAAK,EAAE,SAAS,CAAC,YAAY,GAAG,2BAA2B,GAAG,sBAAsB,CAAC,EAAE,EACvF,KAAK,EAAE,SAAS,kBAAkB,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,GAC9C,aAAa,CAMf;AAED;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,mEAGlD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAEjF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Adapts native graph execution to the RELKIT workflow contract, carrying invocation context and scoped persistence through completion. */
|
|
2
|
+
import { END, START } from "@langchain/langgraph";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { observeAgent } from "@relkit/agents/internal/agent-telemetry";
|
|
5
|
+
import { isFunctionGraphNode } from "@relkit/functions";
|
|
6
|
+
import { getJsonSchema } from "@relkit/schema";
|
|
7
|
+
import { isSubgraphNode, subgraphForNode } from "./graph-subgraph.js";
|
|
8
|
+
import { graphWorkflowFailure } from "./graph-workflow-error.js";
|
|
9
|
+
/** Projects a frozen serializable graph workflow from authoring nodes and edges.
|
|
10
|
+
* @param nodes - Validated graph nodes.
|
|
11
|
+
* @param edges - Validated graph edge operations.
|
|
12
|
+
* @returns An Effect with a workflow or GraphWorkflowFailure.
|
|
13
|
+
* @example Effect.runSync(graphWorkflowEffect(nodes, edges));
|
|
14
|
+
*/
|
|
15
|
+
export const graphWorkflowEffect = Effect.fn("Agents.graph.workflow")((nodes, edges) => Effect.try({
|
|
16
|
+
try: () => Object.freeze({
|
|
17
|
+
version: 1,
|
|
18
|
+
start: START,
|
|
19
|
+
end: END,
|
|
20
|
+
nodes: Object.freeze(nodes.map(workflowNode)),
|
|
21
|
+
edges: Object.freeze(edges.map(workflowEdge)),
|
|
22
|
+
}),
|
|
23
|
+
catch: graphWorkflowFailure,
|
|
24
|
+
}), (effect) => observeAgent("graph.workflow", effect));
|
|
25
|
+
/** Projects a workflow for existing synchronous graph callers.
|
|
26
|
+
* @param nodes - Validated graph nodes.
|
|
27
|
+
* @param edges - Validated graph edge operations.
|
|
28
|
+
* @returns A frozen serializable workflow.
|
|
29
|
+
* @throws The original node or schema projection error.
|
|
30
|
+
* @example graphWorkflow(nodes, edges);
|
|
31
|
+
*/
|
|
32
|
+
export function graphWorkflow(nodes, edges) {
|
|
33
|
+
return Effect.runSync(graphWorkflowEffect(nodes, edges).pipe(Effect.catchTag("GraphWorkflowFailure", (failure) => Effect.fail(failure.cause))));
|
|
34
|
+
}
|
|
35
|
+
/** Checks whether any graph node has a resumable continuation.
|
|
36
|
+
* @param workflow - Frozen graph workflow.
|
|
37
|
+
* @returns An Effect with a boolean and no typed failure.
|
|
38
|
+
* @example Effect.runSync(graphWorkflowRequiresPersistenceEffect(workflow));
|
|
39
|
+
*/
|
|
40
|
+
export const graphWorkflowRequiresPersistenceEffect = Effect.fn("Agents.graph.requiresPersistence")((workflow) => Effect.sync(() => requiresPersistence(workflow)), (effect) => observeAgent("graph.requires-persistence", effect));
|
|
41
|
+
/** Checks persistence needs for existing synchronous graph callers.
|
|
42
|
+
* @param workflow - Frozen graph workflow.
|
|
43
|
+
* @returns Whether any node has a resumable continuation.
|
|
44
|
+
* @example graphWorkflowRequiresPersistence(workflow);
|
|
45
|
+
*/
|
|
46
|
+
export function graphWorkflowRequiresPersistence(workflow) {
|
|
47
|
+
return Effect.runSync(graphWorkflowRequiresPersistenceEffect(workflow));
|
|
48
|
+
}
|
|
49
|
+
function requiresPersistence(workflow) {
|
|
50
|
+
return workflow.nodes.some((node) => node.resume !== undefined ||
|
|
51
|
+
(node.workflow !== undefined && requiresPersistence(node.workflow)));
|
|
52
|
+
}
|
|
53
|
+
function workflowNode(node) {
|
|
54
|
+
const subgraph = isSubgraphNode(node);
|
|
55
|
+
return Object.freeze({
|
|
56
|
+
id: node.id,
|
|
57
|
+
kind: subgraph ? "subgraph" : isFunctionGraphNode(node) ? "function" : "node",
|
|
58
|
+
input: schemaValue(node.input),
|
|
59
|
+
output: schemaValue(node.output),
|
|
60
|
+
...(!isFunctionGraphNode(node) && !subgraph && node.resume !== undefined
|
|
61
|
+
? { resume: schemaValue(node.resume) }
|
|
62
|
+
: {}),
|
|
63
|
+
ends: Object.freeze(isFunctionGraphNode(node) ? [] : [...node.ends]),
|
|
64
|
+
...(isFunctionGraphNode(node) ? { targetFunctionId: node.target.id } : {}),
|
|
65
|
+
...(subgraph ? { workflow: subgraphForNode(node).workflow } : {}),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function workflowEdge(edge) {
|
|
69
|
+
if (edge.kind === "edge") {
|
|
70
|
+
return Object.freeze(Array.isArray(edge.start)
|
|
71
|
+
? { kind: "join", from: Object.freeze([...edge.start]), to: edge.end }
|
|
72
|
+
: { kind: "edge", from: edge.start, to: edge.end });
|
|
73
|
+
}
|
|
74
|
+
const routes = Object.freeze(Object.entries(edge.destinations ?? {}).map(([label, to]) => Object.freeze({ label, to })));
|
|
75
|
+
return Object.freeze({
|
|
76
|
+
kind: "conditional",
|
|
77
|
+
from: edge.source,
|
|
78
|
+
routes,
|
|
79
|
+
dynamic: edge.destinations === undefined,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function schemaValue(schema) {
|
|
83
|
+
const result = getJsonSchema(schema);
|
|
84
|
+
return result.ok ? result.schema : null;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=graph-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-workflow.js","sourceRoot":"","sources":["../src/graph-workflow.ts"],"names":[],"mappings":"AAAA,4IAA4I;AAE5I,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAoC,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,eAAe,EAA+B,MAAM,qBAAqB,CAAC;AAEnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AASjE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAC,uBAAuB,CAAC,CACnE,CACE,KAAuF,EACvF,KAA+C,EAC/C,EAAE,CACF,MAAM,CAAC,GAAG,CAAC;IACT,GAAG,EAAE,GAAkB,EAAE,CACvB,MAAM,CAAC,MAAM,CAAC;QACZ,OAAO,EAAE,CAAU;QACnB,KAAK,EAAE,KAAK;QACZ,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,K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,MAAM,CAAC,MAAM,CAClB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YACvB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YAC/E,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,KAAe,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,CACxE,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAC1B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAC3F,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,aAAsB;QAC5B,IAAI,EAAE,IAAI,CAAC,MAAM;QACjB,MAAM;QACN,OAAO,EAAE,IAAI,CAAC,YAAY,KAAK,SAAS;KACzC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,WAAW,CAAC,MAAwB;IAC3C,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Adapts native graph execution to the RELKIT workflow contract, carrying invocation context and scoped persistence through completion. This companion preserves the native input and output types without starting runtime work. */
|
|
2
|
+
import type { END, START } from "@langchain/langgraph";
|
|
3
|
+
import type { JsonValue } from "@relkit/contracts";
|
|
4
|
+
/** Serializable node entry in an agent graph workflow. */
|
|
5
|
+
export interface GraphWorkflowNode {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly kind: "node" | "function" | "subgraph";
|
|
8
|
+
readonly input: JsonValue;
|
|
9
|
+
readonly output: JsonValue;
|
|
10
|
+
readonly resume?: JsonValue;
|
|
11
|
+
readonly ends: readonly string[];
|
|
12
|
+
readonly targetFunctionId?: string;
|
|
13
|
+
readonly workflow?: GraphWorkflow;
|
|
14
|
+
}
|
|
15
|
+
/** Serializable static, join, or conditional graph edge. */
|
|
16
|
+
export type GraphWorkflowEdge = {
|
|
17
|
+
readonly kind: "edge";
|
|
18
|
+
readonly from: string;
|
|
19
|
+
readonly to: string;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: "join";
|
|
22
|
+
readonly from: readonly string[];
|
|
23
|
+
readonly to: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: "conditional";
|
|
26
|
+
readonly from: string;
|
|
27
|
+
readonly routes: readonly {
|
|
28
|
+
readonly label: string;
|
|
29
|
+
readonly to: string;
|
|
30
|
+
}[];
|
|
31
|
+
readonly dynamic: boolean;
|
|
32
|
+
};
|
|
33
|
+
/** Immutable serializable graph topology for runtime and clients. */
|
|
34
|
+
export interface GraphWorkflow {
|
|
35
|
+
readonly version: 1;
|
|
36
|
+
readonly start: typeof START;
|
|
37
|
+
readonly end: typeof END;
|
|
38
|
+
readonly nodes: readonly GraphWorkflowNode[];
|
|
39
|
+
readonly edges: readonly GraphWorkflowEdge[];
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=graph-workflow.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-workflow.types.d.ts","sourceRoot":"","sources":["../src/graph-workflow.types.ts"],"names":[],"mappings":"AAAA,sOAAsO;AAEtO,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,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,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC9C"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Adapts native graph execution to the RELKIT workflow contract, carrying invocation context and scoped persistence through completion. This companion preserves the native input and output types without starting runtime work. */
|
|
2
|
+
export {};
|
|
3
|
+
//# sourceMappingURL=graph-workflow.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-workflow.types.js","sourceRoot":"","sources":["../src/graph-workflow.types.ts"],"names":[],"mappings":"AAAA,sOAAsO"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Publishes the explicit LangChain integration authoring and execution surface; generic application imports remain owned by the SDK-free agents package. */
|
|
2
|
+
export * from "./define-agent.js";
|
|
3
|
+
export * from "./define-graph-node.js";
|
|
4
|
+
export * from "./define-graph.js";
|
|
5
|
+
export * from "./define-persistence.js";
|
|
6
|
+
export * from "./graph-edges.js";
|
|
7
|
+
export * from "./graph-workflow.js";
|
|
8
|
+
export * from "./graph-runtime.js";
|
|
9
|
+
export { validateGraphResumeInput } from "./graph-continuation.js";
|
|
10
|
+
export { validateNativeAgentResumeInput } from "./native-agent-interruption.js";
|
|
11
|
+
export * from "./graph-persistence.js";
|
|
12
|
+
export * from "./graph-subgraph.js";
|
|
13
|
+
export * from "./graph-interruption.js";
|
|
14
|
+
export * from "@relkit/agents/internal/agent-client";
|
|
15
|
+
export * from "@relkit/agents/internal/client-events";
|
|
16
|
+
export * from "@relkit/agents/internal/approval";
|
|
17
|
+
export * from "@relkit/agents/internal/generated-function";
|
|
18
|
+
export { createGeneratedAgentFunction } from "@relkit/agents/internal/generated-function";
|
|
19
|
+
export * from "./runtime.js";
|
|
20
|
+
export * from "./runtime-service.js";
|
|
21
|
+
export { assertAgentRuntimeDependencies } from "./runtime-dependencies.js";
|
|
22
|
+
export * from "@relkit/agents/internal/runtime-events";
|
|
23
|
+
export * from "@relkit/agents/internal/observability";
|
|
24
|
+
export * from "@relkit/agents/internal/agent-telemetry";
|
|
25
|
+
export * from "@relkit/agents/internal/model-selection";
|
|
26
|
+
export type * from "@relkit/agents/internal/state-control-requests.types";
|
|
27
|
+
export type * from "@relkit/agents/internal/state-provider.types";
|
|
28
|
+
export type * from "@relkit/agents/internal/state-receipts.types";
|
|
29
|
+
export type * from "@relkit/agents/internal/state-thread-requests.types";
|
|
30
|
+
export * from "@relkit/agents/internal/state.types";
|
|
31
|
+
export * from "@relkit/agents/internal/thread-transition";
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6JAA6J;AAE7J,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAChF,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,mBAAmB,sDAAsD,CAAC;AAC1E,mBAAmB,8CAA8C,CAAC;AAClE,mBAAmB,8CAA8C,CAAC;AAClE,mBAAmB,qDAAqD,CAAC;AACzE,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Publishes the explicit LangChain integration authoring and execution surface; generic application imports remain owned by the SDK-free agents package. */
|
|
2
|
+
export * from "./define-agent.js";
|
|
3
|
+
export * from "./define-graph-node.js";
|
|
4
|
+
export * from "./define-graph.js";
|
|
5
|
+
export * from "./define-persistence.js";
|
|
6
|
+
export * from "./graph-edges.js";
|
|
7
|
+
export * from "./graph-workflow.js";
|
|
8
|
+
export * from "./graph-runtime.js";
|
|
9
|
+
export { validateGraphResumeInput } from "./graph-continuation.js";
|
|
10
|
+
export { validateNativeAgentResumeInput } from "./native-agent-interruption.js";
|
|
11
|
+
export * from "./graph-persistence.js";
|
|
12
|
+
export * from "./graph-subgraph.js";
|
|
13
|
+
export * from "./graph-interruption.js";
|
|
14
|
+
export * from "@relkit/agents/internal/agent-client";
|
|
15
|
+
export * from "@relkit/agents/internal/client-events";
|
|
16
|
+
export * from "@relkit/agents/internal/approval";
|
|
17
|
+
export * from "@relkit/agents/internal/generated-function";
|
|
18
|
+
export { createGeneratedAgentFunction } from "@relkit/agents/internal/generated-function";
|
|
19
|
+
export * from "./runtime.js";
|
|
20
|
+
export * from "./runtime-service.js";
|
|
21
|
+
export { assertAgentRuntimeDependencies } from "./runtime-dependencies.js";
|
|
22
|
+
export * from "@relkit/agents/internal/runtime-events";
|
|
23
|
+
export * from "@relkit/agents/internal/observability";
|
|
24
|
+
export * from "@relkit/agents/internal/agent-telemetry";
|
|
25
|
+
export * from "@relkit/agents/internal/model-selection";
|
|
26
|
+
export * from "@relkit/agents/internal/state.types";
|
|
27
|
+
export * from "@relkit/agents/internal/thread-transition";
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6JAA6J;AAE7J,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAChF,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AAKxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Defines failures for native agent interrupt handling so malformed interruption data stays distinct from normal approval suspension. */
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
declare const NativeAgentInterruptionFailure_base: Schema.Class<NativeAgentInterruptionFailure, Schema.TaggedStruct<"NativeAgentInterruptionFailure", {
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
readonly cause: Schema.Unknown;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
/** Tagged native agent continuation or state failure. */
|
|
8
|
+
export declare class NativeAgentInterruptionFailure extends NativeAgentInterruptionFailure_base {
|
|
9
|
+
}
|
|
10
|
+
/** Wraps a native continuation failure for Effect callers.
|
|
11
|
+
* @param cause - Invalid reply or native state provider failure.
|
|
12
|
+
* @returns A tagged native agent interruption failure.
|
|
13
|
+
* @example nativeAgentInterruptionFailure(new TypeError("invalid reply"));
|
|
14
|
+
*/
|
|
15
|
+
export declare function nativeAgentInterruptionFailure(cause: unknown): NativeAgentInterruptionFailure;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=native-agent-interruption-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-agent-interruption-error.d.ts","sourceRoot":"","sources":["../src/native-agent-interruption-error.ts"],"names":[],"mappings":"AAAA,0IAA0I;AAE1I,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;AAEhC,yDAAyD;AACzD,qBAAa,8BAA+B,SAAQ,mCAGnD;CAAG;AAEJ;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,8BAA8B,CAK7F"}
|