@undefineds.co/xpod 0.2.44 → 0.3.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/dist/agents/AgentExecutorFactory.js +12 -13
- package/dist/agents/AgentExecutorFactory.js.map +1 -1
- package/dist/agents/config/agent-meta-schema.d.ts +31 -3
- package/dist/agents/config/agent-meta-schema.js +37 -3
- package/dist/agents/config/agent-meta-schema.js.map +1 -1
- package/dist/agents/config/index.d.ts +5 -5
- package/dist/agents/config/index.js +7 -6
- package/dist/agents/config/index.js.map +1 -1
- package/dist/agents/config/parse-agent-instructions.d.ts +12 -0
- package/dist/agents/config/parse-agent-instructions.js +23 -0
- package/dist/agents/config/parse-agent-instructions.js.map +1 -0
- package/dist/agents/config/resolve.d.ts +7 -12
- package/dist/agents/config/resolve.js +272 -156
- package/dist/agents/config/resolve.js.map +1 -1
- package/dist/agents/config/types.d.ts +33 -36
- package/dist/agents/config/types.js +4 -4
- package/dist/agents/config/types.js.map +1 -1
- package/dist/agents/index.d.ts +2 -7
- package/dist/agents/index.js +4 -14
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/types.d.ts +2 -2
- package/dist/agents/types.js.map +1 -1
- package/dist/ai/service/CredentialReaderImpl.js +9 -14
- package/dist/ai/service/CredentialReaderImpl.js.map +1 -1
- package/dist/api/ApiServer.d.ts +7 -0
- package/dist/api/ApiServer.js +5 -1
- package/dist/api/ApiServer.js.map +1 -1
- package/dist/api/chatkit/default-agent.js +1 -1
- package/dist/api/chatkit/default-agent.js.map +1 -1
- package/dist/api/chatkit/index.d.ts +8 -0
- package/dist/api/chatkit/index.js +15 -1
- package/dist/api/chatkit/index.js.map +1 -1
- package/dist/api/chatkit/pod-store.d.ts +80 -17
- package/dist/api/chatkit/pod-store.js +816 -162
- package/dist/api/chatkit/pod-store.js.map +1 -1
- package/dist/api/chatkit/runtime/AcpAgentRuntime.d.ts +41 -0
- package/dist/api/chatkit/runtime/AcpAgentRuntime.js +573 -0
- package/dist/api/chatkit/runtime/AcpAgentRuntime.js.map +1 -0
- package/dist/api/chatkit/runtime/CodexRuntimeProjector.d.ts +27 -0
- package/dist/api/chatkit/runtime/CodexRuntimeProjector.js +157 -0
- package/dist/api/chatkit/runtime/CodexRuntimeProjector.js.map +1 -0
- package/dist/api/chatkit/schema.d.ts +53 -133
- package/dist/api/chatkit/schema.js +11 -175
- package/dist/api/chatkit/schema.js.map +1 -1
- package/dist/api/chatkit/service.d.ts +15 -9
- package/dist/api/chatkit/service.js +82 -234
- package/dist/api/chatkit/service.js.map +1 -1
- package/dist/api/chatkit/store.d.ts +35 -3
- package/dist/api/chatkit/store.js +157 -3
- package/dist/api/chatkit/store.js.map +1 -1
- package/dist/api/chatkit/types.d.ts +16 -2
- package/dist/api/chatkit/types.js +24 -5
- package/dist/api/chatkit/types.js.map +1 -1
- package/dist/api/container/common.js +59 -2
- package/dist/api/container/common.js.map +1 -1
- package/dist/api/container/index.js +15 -0
- package/dist/api/container/index.js.map +1 -1
- package/dist/api/container/routes.js +11 -0
- package/dist/api/container/routes.js.map +1 -1
- package/dist/api/container/types.d.ts +26 -0
- package/dist/api/container/types.js.map +1 -1
- package/dist/api/handlers/InngestHandler.d.ts +11 -0
- package/dist/api/handlers/InngestHandler.js +19 -0
- package/dist/api/handlers/InngestHandler.js.map +1 -0
- package/dist/api/handlers/RunHandler.d.ts +7 -0
- package/dist/api/handlers/RunHandler.js +169 -0
- package/dist/api/handlers/RunHandler.js.map +1 -0
- package/dist/api/handlers/index.d.ts +1 -0
- package/dist/api/handlers/index.js +1 -0
- package/dist/api/handlers/index.js.map +1 -1
- package/dist/api/models/namespaces.d.ts +2 -2
- package/dist/api/models/namespaces.js +1 -4
- package/dist/api/models/namespaces.js.map +1 -1
- package/dist/api/runs/AgentRuntimeTypes.d.ts +83 -0
- package/dist/api/runs/AgentRuntimeTypes.js +3 -0
- package/dist/api/runs/AgentRuntimeTypes.js.map +1 -0
- package/dist/api/runs/EmbeddedInngestService.d.ts +47 -0
- package/dist/api/runs/EmbeddedInngestService.js +203 -0
- package/dist/api/runs/EmbeddedInngestService.js.map +1 -0
- package/dist/api/runs/InngestRunExecutionBackend.d.ts +416 -0
- package/dist/api/runs/InngestRunExecutionBackend.js +225 -0
- package/dist/api/runs/InngestRunExecutionBackend.js.map +1 -0
- package/dist/api/runs/ManagedRunWorker.d.ts +52 -0
- package/dist/api/runs/ManagedRunWorker.js +452 -0
- package/dist/api/runs/ManagedRunWorker.js.map +1 -0
- package/dist/api/runs/PiAgentRuntimeDriver.d.ts +66 -0
- package/dist/api/runs/PiAgentRuntimeDriver.js +614 -0
- package/dist/api/runs/PiAgentRuntimeDriver.js.map +1 -0
- package/dist/api/runs/PiAgentRuntimeWorker.d.ts +1 -0
- package/dist/api/runs/PiAgentRuntimeWorker.js +33 -0
- package/dist/api/runs/PiAgentRuntimeWorker.js.map +1 -0
- package/dist/api/runs/RunAuthContextRegistry.d.ts +19 -0
- package/dist/api/runs/RunAuthContextRegistry.js +59 -0
- package/dist/api/runs/RunAuthContextRegistry.js.map +1 -0
- package/dist/api/runs/RunExecutionBackend.d.ts +57 -0
- package/dist/api/runs/RunExecutionBackend.js +3 -0
- package/dist/api/runs/RunExecutionBackend.js.map +1 -0
- package/dist/api/runs/RunStateCenter.d.ts +82 -0
- package/dist/api/runs/RunStateCenter.js +665 -0
- package/dist/api/runs/RunStateCenter.js.map +1 -0
- package/dist/api/runs/schema.d.ts +55 -0
- package/dist/api/runs/schema.js +14 -0
- package/dist/api/runs/schema.js.map +1 -0
- package/dist/api/runs/store.d.ts +105 -0
- package/dist/api/runs/store.js +116 -0
- package/dist/api/runs/store.js.map +1 -0
- package/dist/api/runtime.d.ts +2 -0
- package/dist/api/runtime.js +40 -1
- package/dist/api/runtime.js.map +1 -1
- package/dist/api/service/VectorStoreService.d.ts +1 -0
- package/dist/api/service/VectorStoreService.js +27 -34
- package/dist/api/service/VectorStoreService.js.map +1 -1
- package/dist/api/service/provider-registry.d.ts +1 -1
- package/dist/api/service/provider-registry.js +1 -1
- package/dist/api/service/provider-registry.js.map +1 -1
- package/dist/api/tasks/InngestTaskScheduler.d.ts +751 -0
- package/dist/api/tasks/InngestTaskScheduler.js +209 -0
- package/dist/api/tasks/InngestTaskScheduler.js.map +1 -0
- package/dist/api/tasks/TaskAuthBinding.d.ts +68 -0
- package/dist/api/tasks/TaskAuthBinding.js +162 -0
- package/dist/api/tasks/TaskAuthBinding.js.map +1 -0
- package/dist/api/tasks/TaskMaterializer.d.ts +55 -0
- package/dist/api/tasks/TaskMaterializer.js +452 -0
- package/dist/api/tasks/TaskMaterializer.js.map +1 -0
- package/dist/api/tasks/TaskService.d.ts +57 -0
- package/dist/api/tasks/TaskService.js +235 -0
- package/dist/api/tasks/TaskService.js.map +1 -0
- package/dist/api/tasks/index.d.ts +6 -0
- package/dist/api/tasks/index.js +25 -0
- package/dist/api/tasks/index.js.map +1 -0
- package/dist/api/tasks/schema.d.ts +23 -0
- package/dist/api/tasks/schema.js +8 -0
- package/dist/api/tasks/schema.js.map +1 -0
- package/dist/api/tasks/store.d.ts +40 -0
- package/dist/api/tasks/store.js +34 -0
- package/dist/api/tasks/store.js.map +1 -0
- package/dist/api/workspace/types.d.ts +3 -0
- package/dist/api/workspace/types.js +23 -0
- package/dist/api/workspace/types.js.map +1 -0
- package/dist/cli/commands/config.d.ts +8 -7
- package/dist/cli/commands/config.js +72 -48
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/login.d.ts +10 -8
- package/dist/cli/commands/login.js +84 -84
- package/dist/cli/commands/login.js.map +1 -1
- package/dist/cli/index.js +3 -124
- package/dist/cli/index.js.map +1 -1
- package/dist/http/search/SearchHttpHandler.js +13 -18
- package/dist/http/search/SearchHttpHandler.js.map +1 -1
- package/dist/runtime/configure-drizzle-solid.js +52 -0
- package/dist/runtime/configure-drizzle-solid.js.map +1 -1
- package/dist/storage/quint/PgQuintStore.d.ts +6 -0
- package/dist/storage/quint/PgQuintStore.js +83 -5
- package/dist/storage/quint/PgQuintStore.js.map +1 -1
- package/dist/storage/quint/PgQuintStore.jsonld +24 -0
- package/dist/storage/quint/SqliteQuintStore.d.ts +1 -0
- package/dist/storage/quint/SqliteQuintStore.js +52 -0
- package/dist/storage/quint/SqliteQuintStore.js.map +1 -1
- package/dist/storage/quint/SqliteQuintStore.jsonld +4 -0
- package/dist/storage/quint/types.d.ts +6 -0
- package/dist/storage/quint/types.js.map +1 -1
- package/dist/storage/sparql/FilterPushdownExtractor.js +23 -11
- package/dist/storage/sparql/FilterPushdownExtractor.js.map +1 -1
- package/dist/storage/vector/VectorIndexingListener.js +13 -18
- package/dist/storage/vector/VectorIndexingListener.js.map +1 -1
- package/dist/util/identifiers/ClusterIdentifierStrategy.js +29 -1
- package/dist/util/identifiers/ClusterIdentifierStrategy.js.map +1 -1
- package/dist/vocab/index.d.ts +2 -6
- package/dist/vocab/index.js +2 -6
- package/dist/vocab/index.js.map +1 -1
- package/dist/vocab/udfs.d.ts +12 -0
- package/dist/vocab/udfs.js +12 -0
- package/dist/vocab/udfs.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/README.md +52 -24
- package/node_modules/@undefineds.co/drizzle-solid/README.zh-CN.md +30 -24
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/discovery/types.d.ts +6 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/discovery/types.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/ldp-executor.d.ts +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/ldp-executor.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/ldp-executor.js +43 -10
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/ldp-executor.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/ldp-strategy.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/ldp-strategy.js +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/ldp-strategy.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/pod-executor.d.ts +5 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/pod-executor.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/pod-executor.js +44 -13
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/pod-executor.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/sparql-strategy.d.ts +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/sparql-strategy.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/sparql-strategy.js +21 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/sparql-strategy.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/types.d.ts +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/types.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/expressions.d.ts +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/expressions.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-database.d.ts +76 -41
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-database.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-database.js +443 -114
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-database.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-dialect.d.ts +28 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-dialect.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-dialect.js +142 -31
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-dialect.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-session.d.ts +3 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-session.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-session.js +84 -6
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-session.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/insert-query-builder.d.ts +3 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/insert-query-builder.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/insert-query-builder.js +29 -9
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/insert-query-builder.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/select-query-builder.d.ts +2 -8
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/select-query-builder.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/select-query-builder.js +19 -51
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/select-query-builder.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/types.d.ts +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/types.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-conditions.d.ts +2 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-conditions.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-where-policy.js +6 -6
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-where-policy.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-reference.d.ts +4 -4
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-reference.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-reference.js +56 -23
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-reference.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/base-resolver.d.ts +14 -10
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/base-resolver.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/base-resolver.js +55 -23
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/base-resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/document-resolver.d.ts +3 -3
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/document-resolver.js +6 -6
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/document-resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/fragment-resolver.d.ts +3 -3
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/fragment-resolver.js +4 -4
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/resource-resolver/fragment-resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/runtime/pod-runtime.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/runtime/pod-runtime.js +33 -8
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/runtime/pod-runtime.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/defs.d.ts +11 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/defs.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/factories.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/factories.js +3 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/factories.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/pod-table.d.ts +13 -8
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/pod-table.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/pod-table.js +24 -22
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/pod-table.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/solid-schema.d.ts +3 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/solid-schema.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/schema/solid-schema.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/subject/resolver.d.ts +3 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/subject/resolver.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/subject/resolver.js +28 -14
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/subject/resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/triple/handlers/inline.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/triple/handlers/inline.js +3 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/triple/handlers/inline.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/uri/resolver.d.ts +9 -9
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/uri/resolver.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/uri/resolver.js +56 -22
- package/node_modules/@undefineds.co/drizzle-solid/dist/core/uri/resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/driver.d.ts +9 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/driver.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/driver.js +2 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/driver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/discovery/types.d.ts +6 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/discovery/types.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/ldp-executor.d.ts +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/ldp-executor.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/ldp-executor.js +43 -10
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/ldp-executor.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/ldp-strategy.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/ldp-strategy.js +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/ldp-strategy.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/pod-executor.d.ts +5 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/pod-executor.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/pod-executor.js +44 -13
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/pod-executor.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/sparql-strategy.d.ts +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/sparql-strategy.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/sparql-strategy.js +21 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/sparql-strategy.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/types.d.ts +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/types.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/expressions.d.ts +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/expressions.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-database.d.ts +76 -41
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-database.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-database.js +443 -114
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-database.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-dialect.d.ts +28 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-dialect.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-dialect.js +142 -31
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-dialect.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-session.d.ts +3 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-session.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-session.js +84 -6
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-session.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/insert-query-builder.d.ts +3 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/insert-query-builder.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/insert-query-builder.js +29 -9
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/insert-query-builder.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/select-query-builder.d.ts +2 -8
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/select-query-builder.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/select-query-builder.js +19 -51
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/select-query-builder.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/types.d.ts +1 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/types.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-conditions.d.ts +2 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-conditions.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-where-policy.js +6 -6
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-where-policy.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-reference.d.ts +4 -4
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-reference.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-reference.js +56 -23
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-reference.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/base-resolver.d.ts +14 -10
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/base-resolver.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/base-resolver.js +55 -23
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/base-resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/document-resolver.d.ts +3 -3
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/document-resolver.js +6 -6
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/document-resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/fragment-resolver.d.ts +3 -3
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/fragment-resolver.js +4 -4
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/resource-resolver/fragment-resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/runtime/pod-runtime.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/runtime/pod-runtime.js +33 -8
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/runtime/pod-runtime.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/defs.d.ts +11 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/defs.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/factories.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/factories.js +3 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/factories.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/pod-table.d.ts +13 -8
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/pod-table.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/pod-table.js +24 -22
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/pod-table.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/solid-schema.d.ts +3 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/solid-schema.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/schema/solid-schema.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/subject/resolver.d.ts +3 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/subject/resolver.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/subject/resolver.js +28 -14
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/subject/resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/triple/handlers/inline.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/triple/handlers/inline.js +3 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/triple/handlers/inline.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/uri/resolver.d.ts +9 -9
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/uri/resolver.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/uri/resolver.js +56 -22
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/uri/resolver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/driver.d.ts +9 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/driver.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/driver.js +2 -0
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/driver.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/pod.d.ts +16 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/pod.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/utils/find-by-iri.js +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/esm/utils/find-by-iri.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/pod.d.ts +16 -2
- package/node_modules/@undefineds.co/drizzle-solid/dist/pod.d.ts.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/utils/find-by-iri.js +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/dist/utils/find-by-iri.js.map +1 -1
- package/node_modules/@undefineds.co/drizzle-solid/package.json +1 -1
- package/package.json +5 -3
- package/scripts/patch-jose.js +62 -12
- package/dist/agents/AgentManager.d.ts +0 -116
- package/dist/agents/AgentManager.js +0 -290
- package/dist/agents/AgentManager.js.map +0 -1
- package/dist/agents/IndexAgent.d.ts +0 -70
- package/dist/agents/IndexAgent.js +0 -417
- package/dist/agents/IndexAgent.js.map +0 -1
- package/dist/agents/config/parse-agent-md.d.ts +0 -33
- package/dist/agents/config/parse-agent-md.js +0 -75
- package/dist/agents/config/parse-agent-md.js.map +0 -1
- package/dist/agents/schema/agent-config.d.ts +0 -2
- package/dist/agents/schema/agent-config.js +0 -32
- package/dist/agents/schema/agent-config.js.map +0 -1
- package/dist/agents/schema/create-agent-schema.d.ts +0 -25
- package/dist/agents/schema/create-agent-schema.js +0 -35
- package/dist/agents/schema/create-agent-schema.js.map +0 -1
- package/dist/api/chatkit/runtime/PtyThreadRuntime.d.ts +0 -127
- package/dist/api/chatkit/runtime/PtyThreadRuntime.js +0 -791
- package/dist/api/chatkit/runtime/PtyThreadRuntime.js.map +0 -1
- package/dist/cli/lib/agent-session.d.ts +0 -37
- package/dist/cli/lib/agent-session.js +0 -211
- package/dist/cli/lib/agent-session.js.map +0 -1
- package/dist/cli/lib/ensure-ai-credentials.d.ts +0 -13
- package/dist/cli/lib/ensure-ai-credentials.js +0 -40
- package/dist/cli/lib/ensure-ai-credentials.js.map +0 -1
- package/dist/cli/lib/model-manager.d.ts +0 -37
- package/dist/cli/lib/model-manager.js +0 -251
- package/dist/cli/lib/model-manager.js.map +0 -1
- package/dist/cli/lib/oauth-credential-manager.d.ts +0 -37
- package/dist/cli/lib/oauth-credential-manager.js +0 -129
- package/dist/cli/lib/oauth-credential-manager.js.map +0 -1
- package/dist/cli/lib/oauth-providers/codebuddy.d.ts +0 -25
- package/dist/cli/lib/oauth-providers/codebuddy.js +0 -69
- package/dist/cli/lib/oauth-providers/codebuddy.js.map +0 -1
- package/dist/cli/lib/oauth-providers/index.d.ts +0 -12
- package/dist/cli/lib/oauth-providers/index.js +0 -23
- package/dist/cli/lib/oauth-providers/index.js.map +0 -1
- package/dist/cli/lib/pi-optional.d.ts +0 -84
- package/dist/cli/lib/pi-optional.js +0 -35
- package/dist/cli/lib/pi-optional.js.map +0 -1
- package/dist/cli/lib/pod-ai-config.d.ts +0 -26
- package/dist/cli/lib/pod-ai-config.js +0 -99
- package/dist/cli/lib/pod-ai-config.js.map +0 -1
- package/dist/cli/lib/pod-thread-store.d.ts +0 -57
- package/dist/cli/lib/pod-thread-store.js +0 -312
- package/dist/cli/lib/pod-thread-store.js.map +0 -1
- package/dist/cli/lib/secretary-prompt.d.ts +0 -6
- package/dist/cli/lib/secretary-prompt.js +0 -85
- package/dist/cli/lib/secretary-prompt.js.map +0 -1
- package/dist/task/DrizzleTaskQueue.d.ts +0 -56
- package/dist/task/DrizzleTaskQueue.js +0 -171
- package/dist/task/DrizzleTaskQueue.js.map +0 -1
- package/dist/task/TaskExecutor.d.ts +0 -82
- package/dist/task/TaskExecutor.js +0 -198
- package/dist/task/TaskExecutor.js.map +0 -1
- package/dist/task/index.d.ts +0 -10
- package/dist/task/index.js +0 -20
- package/dist/task/index.js.map +0 -1
- package/dist/task/schema.d.ts +0 -53
- package/dist/task/schema.js +0 -71
- package/dist/task/schema.js.map +0 -1
- package/dist/task/types.d.ts +0 -186
- package/dist/task/types.js +0 -12
- package/dist/task/types.js.map +0 -1
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RunStateCenter = void 0;
|
|
4
|
+
const types_1 = require("../chatkit/types");
|
|
5
|
+
const InngestRunExecutionBackend_1 = require("./InngestRunExecutionBackend");
|
|
6
|
+
const types_2 = require("../workspace/types");
|
|
7
|
+
const schema_1 = require("./schema");
|
|
8
|
+
const store_1 = require("./store");
|
|
9
|
+
const RUN_WAITING_STATUSES = new Set([
|
|
10
|
+
schema_1.RunStatus.WAITING_INPUT,
|
|
11
|
+
schema_1.RunStatus.WAITING_RUNNER,
|
|
12
|
+
]);
|
|
13
|
+
/**
|
|
14
|
+
* Run is the xpod-side state center for Agent execution.
|
|
15
|
+
*
|
|
16
|
+
* ChatKit and Task APIs are command surfaces. They hand execution to this
|
|
17
|
+
* center, which persists first-class Run/RunStep facts through the configured
|
|
18
|
+
* RunStore while projecting visible output back to Thread/Message.
|
|
19
|
+
*/
|
|
20
|
+
class RunStateCenter {
|
|
21
|
+
constructor(options) {
|
|
22
|
+
this.store = options.store;
|
|
23
|
+
this.runStore = this.resolveRunStore(options.store);
|
|
24
|
+
this.enableAgentRuntime = options.enableAgentRuntime ?? false;
|
|
25
|
+
this.executionBackend = options.executionBackend ?? new InngestRunExecutionBackend_1.InngestRunExecutionBackend();
|
|
26
|
+
}
|
|
27
|
+
getAgentRuntimeConfig(thread, context) {
|
|
28
|
+
if (!this.enableAgentRuntime) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const runtime = thread.metadata?.runtime;
|
|
32
|
+
if (!runtime) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
if (!runtime.runner) {
|
|
36
|
+
throw new Error('Invalid thread.metadata.runtime: runner is required');
|
|
37
|
+
}
|
|
38
|
+
const runnerType = runtime.runner.type;
|
|
39
|
+
if (!runnerType) {
|
|
40
|
+
throw new Error('Invalid thread.metadata.runtime.runner.type');
|
|
41
|
+
}
|
|
42
|
+
const protocol = this.resolveRunnerProtocol(runtime.runner.protocol);
|
|
43
|
+
const allowCustomArgv = runtime.runner.allowCustomArgv === true;
|
|
44
|
+
const argv = allowCustomArgv ? runtime.runner.argv : undefined;
|
|
45
|
+
const workspace = this.resolveWorkspaceUri(runtime.workspace, thread.workspace);
|
|
46
|
+
if (!workspace) {
|
|
47
|
+
throw new Error('Invalid thread runtime: workspace URI is required');
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
...runtime,
|
|
51
|
+
workspace,
|
|
52
|
+
runner: {
|
|
53
|
+
...runtime.runner,
|
|
54
|
+
argv,
|
|
55
|
+
protocol,
|
|
56
|
+
},
|
|
57
|
+
agentConfig: runtime.agentConfig,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
getDefaultAgentRuntimeConfig(context) {
|
|
61
|
+
if (!this.enableAgentRuntime) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
resolveRunnerProtocol(protocol) {
|
|
67
|
+
if (protocol === 'acp' || protocol === 'pi') {
|
|
68
|
+
return protocol;
|
|
69
|
+
}
|
|
70
|
+
return 'pi';
|
|
71
|
+
}
|
|
72
|
+
resolveWorkspaceUri(runtimeWorkspace, threadWorkspace) {
|
|
73
|
+
if ((0, types_2.isWorkspaceUri)(runtimeWorkspace)) {
|
|
74
|
+
return runtimeWorkspace;
|
|
75
|
+
}
|
|
76
|
+
return (0, types_2.isWorkspaceUri)(threadWorkspace) ? threadWorkspace : undefined;
|
|
77
|
+
}
|
|
78
|
+
async *startAgentRun(input) {
|
|
79
|
+
const { thread, userMessage, context, runtimeConfig } = input;
|
|
80
|
+
const prompt = (0, types_1.extractUserMessageText)(userMessage.content);
|
|
81
|
+
if (!prompt.trim()) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const threadRef = this.threadRefFromThread(thread);
|
|
85
|
+
const assistantItem = await this.createAssistantMessage(thread, context);
|
|
86
|
+
const run = await this.createRun({
|
|
87
|
+
thread,
|
|
88
|
+
userMessage,
|
|
89
|
+
prompt,
|
|
90
|
+
runtimeConfig,
|
|
91
|
+
context,
|
|
92
|
+
});
|
|
93
|
+
await this.store.addThreadItem(threadRef, assistantItem, context);
|
|
94
|
+
yield { type: 'item_added', item: assistantItem };
|
|
95
|
+
await this.markRunStarted(run, context);
|
|
96
|
+
const assistantState = { item: assistantItem, fullText: '' };
|
|
97
|
+
let runtimeError;
|
|
98
|
+
for await (const event of this.executionBackend.start({
|
|
99
|
+
runId: run.id,
|
|
100
|
+
threadId: thread.id,
|
|
101
|
+
prompt,
|
|
102
|
+
conversation: await this.loadConversation(threadRef, userMessage.id, context),
|
|
103
|
+
config: runtimeConfig,
|
|
104
|
+
context: context,
|
|
105
|
+
})) {
|
|
106
|
+
const cancellation = await this.checkCancellation(run, threadRef, assistantState, context);
|
|
107
|
+
if (cancellation) {
|
|
108
|
+
yield { type: 'item_done', item: cancellation };
|
|
109
|
+
yield { type: 'error', code: 'runtime_cancelled', message: 'Run cancellation requested' };
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const result = yield* this.projectRuntimeEvent(event, {
|
|
113
|
+
run,
|
|
114
|
+
thread,
|
|
115
|
+
threadRef,
|
|
116
|
+
assistant: assistantState,
|
|
117
|
+
context,
|
|
118
|
+
});
|
|
119
|
+
if (result.action === 'continue') {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (result.action === 'return') {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
runtimeError = result.message;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
const finalStatus = runtimeError ? 'incomplete' : 'completed';
|
|
129
|
+
const finalItem = this.finalizeAssistantMessage(assistantState.item, assistantState.fullText, finalStatus);
|
|
130
|
+
await this.store.saveItem(threadRef, finalItem, context);
|
|
131
|
+
await this.finishRun(run, runtimeError ? schema_1.RunStatus.FAILED : schema_1.RunStatus.COMPLETED, context, runtimeError);
|
|
132
|
+
yield { type: 'item_done', item: finalItem };
|
|
133
|
+
}
|
|
134
|
+
async *completeClientToolOutput(input) {
|
|
135
|
+
const { threadRef, itemId, output, context } = input;
|
|
136
|
+
const item = await this.store.loadItem(threadRef, itemId, context);
|
|
137
|
+
if (item.type !== 'client_tool_call') {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const updatedItem = {
|
|
141
|
+
...item,
|
|
142
|
+
output,
|
|
143
|
+
status: 'completed',
|
|
144
|
+
};
|
|
145
|
+
await this.store.saveItem(threadRef, updatedItem, context);
|
|
146
|
+
yield { type: 'item_done', item: updatedItem };
|
|
147
|
+
const run = await this.resolveWaitingRunForToolOutput(updatedItem, threadRef, context);
|
|
148
|
+
if (!run) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const now = (0, types_1.nowTimestamp)();
|
|
152
|
+
await this.appendRunStep(run, schema_1.XpodRunStepType.CLIENT_TOOL_OUTPUT, context, {
|
|
153
|
+
message: updatedItem.name,
|
|
154
|
+
data: {
|
|
155
|
+
itemId: updatedItem.id,
|
|
156
|
+
callId: updatedItem.call_id,
|
|
157
|
+
output,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
await this.appendRunStep(run, schema_1.XpodRunStepType.CONTINUE_REQUESTED, context, {
|
|
161
|
+
message: 'Run continuation requested',
|
|
162
|
+
data: {
|
|
163
|
+
kind: 'client_tool_output',
|
|
164
|
+
itemId: updatedItem.id,
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
run.status = schema_1.RunStatus.QUEUED;
|
|
168
|
+
run.leaseOwner = undefined;
|
|
169
|
+
run.leaseExpiresAt = undefined;
|
|
170
|
+
run.completedAt = undefined;
|
|
171
|
+
run.error = undefined;
|
|
172
|
+
run.updatedAt = now;
|
|
173
|
+
run.metadata = {
|
|
174
|
+
...(run.metadata ?? {}),
|
|
175
|
+
continuation: {
|
|
176
|
+
kind: 'client_tool_output',
|
|
177
|
+
itemId: updatedItem.id,
|
|
178
|
+
output,
|
|
179
|
+
queuedAt: now,
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
await this.saveRun(run, context);
|
|
183
|
+
const thread = await this.store.loadThread(threadRef, context);
|
|
184
|
+
const assistantItemId = typeof run.metadata?.assistantItemId === 'string' ? run.metadata.assistantItemId : undefined;
|
|
185
|
+
const assistantItem = assistantItemId
|
|
186
|
+
? await this.store.loadItem(threadRef, assistantItemId, context)
|
|
187
|
+
: await this.createAssistantMessage(thread, context);
|
|
188
|
+
if (!assistantItemId) {
|
|
189
|
+
await this.store.addThreadItem(threadRef, assistantItem, context);
|
|
190
|
+
yield { type: 'item_added', item: assistantItem };
|
|
191
|
+
}
|
|
192
|
+
const assistantState = {
|
|
193
|
+
item: assistantItem,
|
|
194
|
+
fullText: (0, types_1.extractAssistantMessageText)(assistantItem.content),
|
|
195
|
+
};
|
|
196
|
+
await this.markRunStarted(run, context);
|
|
197
|
+
for await (const event of this.executionBackend.start({
|
|
198
|
+
runId: run.id,
|
|
199
|
+
threadId: this.extractThreadIdFromRef(threadRef),
|
|
200
|
+
prompt: this.buildContinuationPrompt(updatedItem),
|
|
201
|
+
conversation: await this.loadConversation(threadRef, String(run.metadata?.userMessageId ?? updatedItem.id), context),
|
|
202
|
+
config: this.resolveRuntimeConfigForContinuation(run),
|
|
203
|
+
continuation: {
|
|
204
|
+
kind: 'client_tool_output',
|
|
205
|
+
itemId: updatedItem.id,
|
|
206
|
+
},
|
|
207
|
+
context: context,
|
|
208
|
+
})) {
|
|
209
|
+
const cancellation = await this.checkCancellation(run, threadRef, assistantState, context);
|
|
210
|
+
if (cancellation) {
|
|
211
|
+
yield { type: 'item_done', item: cancellation };
|
|
212
|
+
yield { type: 'error', code: 'runtime_cancelled', message: 'Run cancellation requested' };
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const result = yield* this.projectRuntimeEvent(event, {
|
|
216
|
+
run,
|
|
217
|
+
thread,
|
|
218
|
+
threadRef,
|
|
219
|
+
assistant: assistantState,
|
|
220
|
+
context,
|
|
221
|
+
});
|
|
222
|
+
if (result.action === 'continue') {
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
if (result.action === 'return') {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const finalItem = this.finalizeAssistantMessage(assistantState.item, assistantState.fullText, 'incomplete');
|
|
229
|
+
await this.store.saveItem(threadRef, finalItem, context);
|
|
230
|
+
await this.finishRun(run, schema_1.RunStatus.FAILED, context, result.message);
|
|
231
|
+
yield { type: 'item_done', item: finalItem };
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const finalItem = this.finalizeAssistantMessage(assistantState.item, assistantState.fullText, 'completed');
|
|
235
|
+
await this.store.saveItem(threadRef, finalItem, context);
|
|
236
|
+
await this.finishRun(run, schema_1.RunStatus.COMPLETED, context);
|
|
237
|
+
yield { type: 'item_done', item: finalItem };
|
|
238
|
+
}
|
|
239
|
+
resolveRunStore(store) {
|
|
240
|
+
if (typeof store.saveRun === 'function'
|
|
241
|
+
&& typeof store.loadRun === 'function'
|
|
242
|
+
&& typeof store.listRuns === 'function'
|
|
243
|
+
&& typeof store.appendRunStep === 'function'
|
|
244
|
+
&& typeof store.loadRunSteps === 'function') {
|
|
245
|
+
return store;
|
|
246
|
+
}
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
async createRun(input) {
|
|
250
|
+
const { thread, userMessage, prompt, runtimeConfig, context } = input;
|
|
251
|
+
const now = (0, types_1.nowTimestamp)();
|
|
252
|
+
const commandKind = thread.metadata?.commandKind === 'task' ? 'task' : 'chat';
|
|
253
|
+
const surfaceId = this.resolveSurfaceId(thread);
|
|
254
|
+
const run = {
|
|
255
|
+
id: (0, store_1.generateRunResourceId)({
|
|
256
|
+
key: (0, types_1.generateId)('run'),
|
|
257
|
+
commandKind,
|
|
258
|
+
surfaceId,
|
|
259
|
+
createdAt: now,
|
|
260
|
+
}),
|
|
261
|
+
thread: this.resolveThreadUri(thread, context),
|
|
262
|
+
workspace: runtimeConfig.workspace,
|
|
263
|
+
commandKind,
|
|
264
|
+
surfaceId,
|
|
265
|
+
status: schema_1.RunStatus.QUEUED,
|
|
266
|
+
runner: `${runtimeConfig.runner.protocol ?? 'pi'}:${runtimeConfig.runner.type}`,
|
|
267
|
+
prompt,
|
|
268
|
+
metadata: {
|
|
269
|
+
threadId: thread.id,
|
|
270
|
+
userMessageId: userMessage.id,
|
|
271
|
+
runtimeConfig,
|
|
272
|
+
surfaceId,
|
|
273
|
+
},
|
|
274
|
+
createdAt: now,
|
|
275
|
+
updatedAt: now,
|
|
276
|
+
};
|
|
277
|
+
await this.saveRun(run, context);
|
|
278
|
+
await this.appendRunStep(run, schema_1.XpodRunStepType.CREATED, context, {
|
|
279
|
+
message: 'Run created',
|
|
280
|
+
data: {
|
|
281
|
+
commandKind: run.commandKind,
|
|
282
|
+
thread: run.thread,
|
|
283
|
+
workspace: run.workspace,
|
|
284
|
+
runner: run.runner,
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
return run;
|
|
288
|
+
}
|
|
289
|
+
async markRunStarted(run, context) {
|
|
290
|
+
const now = (0, types_1.nowTimestamp)();
|
|
291
|
+
run.status = schema_1.RunStatus.RUNNING;
|
|
292
|
+
run.startedAt = now;
|
|
293
|
+
run.updatedAt = now;
|
|
294
|
+
await this.saveRun(run, context);
|
|
295
|
+
await this.appendRunStep(run, schema_1.XpodRunStepType.STARTED, context, {
|
|
296
|
+
message: 'Run started',
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
async finishRun(run, status, context, error) {
|
|
300
|
+
const now = (0, types_1.nowTimestamp)();
|
|
301
|
+
run.status = status;
|
|
302
|
+
run.completedAt = now;
|
|
303
|
+
run.updatedAt = now;
|
|
304
|
+
run.error = error;
|
|
305
|
+
await this.saveRun(run, context);
|
|
306
|
+
await this.appendRunStep(run, this.stepTypeForTerminalStatus(status), context, {
|
|
307
|
+
message: error ?? `Run ${status}`,
|
|
308
|
+
data: { status },
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
async pauseRun(run, status, context, message) {
|
|
312
|
+
const now = (0, types_1.nowTimestamp)();
|
|
313
|
+
run.status = status;
|
|
314
|
+
run.completedAt = undefined;
|
|
315
|
+
run.heartbeatAt = now;
|
|
316
|
+
run.leaseOwner = undefined;
|
|
317
|
+
run.leaseExpiresAt = undefined;
|
|
318
|
+
run.updatedAt = now;
|
|
319
|
+
run.error = message;
|
|
320
|
+
await this.saveRun(run, context);
|
|
321
|
+
}
|
|
322
|
+
async *projectRuntimeEvent(event, input) {
|
|
323
|
+
const { run, thread, threadRef, assistant, context } = input;
|
|
324
|
+
if (event.type === 'text') {
|
|
325
|
+
assistant.fullText += event.text;
|
|
326
|
+
await this.appendRunStep(run, schema_1.XpodRunStepType.TEXT_DELTA, context, {
|
|
327
|
+
message: event.text,
|
|
328
|
+
data: { delta: event.text },
|
|
329
|
+
});
|
|
330
|
+
yield { type: 'item_updated', itemId: assistant.item.id, delta: event.text };
|
|
331
|
+
return { action: 'continue' };
|
|
332
|
+
}
|
|
333
|
+
if (event.type === 'auth_required') {
|
|
334
|
+
await this.appendRunStep(run, schema_1.XpodRunStepType.AUTH_REQUIRED, context, {
|
|
335
|
+
message: event.message,
|
|
336
|
+
data: {
|
|
337
|
+
method: event.method,
|
|
338
|
+
url: event.url,
|
|
339
|
+
options: event.options,
|
|
340
|
+
},
|
|
341
|
+
});
|
|
342
|
+
yield {
|
|
343
|
+
type: 'client_effect',
|
|
344
|
+
effect: {
|
|
345
|
+
effect_type: 'runtime.auth_required',
|
|
346
|
+
data: {
|
|
347
|
+
method: event.method,
|
|
348
|
+
url: event.url,
|
|
349
|
+
message: event.message,
|
|
350
|
+
options: event.options,
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
};
|
|
354
|
+
return { action: 'continue' };
|
|
355
|
+
}
|
|
356
|
+
if (event.type === 'tool_call') {
|
|
357
|
+
await this.appendRunStep(run, schema_1.XpodRunStepType.TOOL_CALL, context, {
|
|
358
|
+
message: event.name,
|
|
359
|
+
data: {
|
|
360
|
+
requestId: event.requestId,
|
|
361
|
+
name: event.name,
|
|
362
|
+
arguments: event.arguments,
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
const toolItem = {
|
|
366
|
+
id: this.store.generateItemId('client_tool_call', thread, context),
|
|
367
|
+
thread_id: thread.id,
|
|
368
|
+
type: 'client_tool_call',
|
|
369
|
+
name: event.name,
|
|
370
|
+
arguments: event.arguments,
|
|
371
|
+
call_id: event.requestId,
|
|
372
|
+
status: 'pending',
|
|
373
|
+
metadata: {
|
|
374
|
+
runId: run.id,
|
|
375
|
+
assistantItemId: assistant.item.id,
|
|
376
|
+
},
|
|
377
|
+
created_at: (0, types_1.nowTimestamp)(),
|
|
378
|
+
};
|
|
379
|
+
await this.store.addThreadItem(threadRef, toolItem, context);
|
|
380
|
+
yield { type: 'item_added', item: toolItem };
|
|
381
|
+
const incomplete = this.finalizeAssistantMessage(assistant.item, assistant.fullText, 'incomplete');
|
|
382
|
+
assistant.item = incomplete;
|
|
383
|
+
await this.store.saveItem(threadRef, incomplete, context);
|
|
384
|
+
yield { type: 'item_done', item: incomplete };
|
|
385
|
+
run.metadata = {
|
|
386
|
+
...(run.metadata ?? {}),
|
|
387
|
+
assistantItemId: assistant.item.id,
|
|
388
|
+
waitingTool: {
|
|
389
|
+
itemId: toolItem.id,
|
|
390
|
+
requestId: event.requestId,
|
|
391
|
+
name: event.name,
|
|
392
|
+
},
|
|
393
|
+
};
|
|
394
|
+
await this.pauseRun(run, schema_1.RunStatus.WAITING_INPUT, context, `Waiting for client tool output: ${event.name}`);
|
|
395
|
+
yield {
|
|
396
|
+
type: 'error',
|
|
397
|
+
code: 'runtime_waiting_input',
|
|
398
|
+
message: `Run is waiting for client tool output: ${event.name}`,
|
|
399
|
+
};
|
|
400
|
+
return { action: 'return' };
|
|
401
|
+
}
|
|
402
|
+
if (event.type === 'waiting_runner') {
|
|
403
|
+
await this.appendRunStep(run, schema_1.XpodRunStepType.WAITING_RUNNER, context, {
|
|
404
|
+
message: event.message,
|
|
405
|
+
data: {
|
|
406
|
+
workspace: event.workspace,
|
|
407
|
+
},
|
|
408
|
+
});
|
|
409
|
+
yield { type: 'error', code: 'waiting_runner', message: event.message };
|
|
410
|
+
await this.finishRun(run, schema_1.RunStatus.WAITING_RUNNER, context, event.message);
|
|
411
|
+
return { action: 'return' };
|
|
412
|
+
}
|
|
413
|
+
await this.appendRunStep(run, schema_1.XpodRunStepType.ERROR, context, {
|
|
414
|
+
message: event.message,
|
|
415
|
+
});
|
|
416
|
+
yield { type: 'error', code: 'runtime_error', message: event.message };
|
|
417
|
+
return { action: 'error', message: event.message };
|
|
418
|
+
}
|
|
419
|
+
async checkCancellation(run, threadRef, assistant, context) {
|
|
420
|
+
if (!this.runStore?.loadRun) {
|
|
421
|
+
return undefined;
|
|
422
|
+
}
|
|
423
|
+
const latest = await this.runStore.loadRun(run.id, context);
|
|
424
|
+
if (!latest.cancelRequestedAt) {
|
|
425
|
+
return undefined;
|
|
426
|
+
}
|
|
427
|
+
run.cancelRequestedAt = latest.cancelRequestedAt;
|
|
428
|
+
const finalItem = this.finalizeAssistantMessage(assistant.item, assistant.fullText, 'incomplete');
|
|
429
|
+
assistant.item = finalItem;
|
|
430
|
+
await this.store.saveItem(threadRef, finalItem, context);
|
|
431
|
+
await this.finishRun(run, schema_1.RunStatus.CANCELLED, context, 'Run cancellation requested');
|
|
432
|
+
return finalItem;
|
|
433
|
+
}
|
|
434
|
+
stepTypeForTerminalStatus(status) {
|
|
435
|
+
if (status === schema_1.RunStatus.COMPLETED) {
|
|
436
|
+
return schema_1.XpodRunStepType.COMPLETED;
|
|
437
|
+
}
|
|
438
|
+
if (status === schema_1.RunStatus.CANCELLED) {
|
|
439
|
+
return schema_1.XpodRunStepType.CANCELLED;
|
|
440
|
+
}
|
|
441
|
+
if (RUN_WAITING_STATUSES.has(status)) {
|
|
442
|
+
return status === schema_1.RunStatus.WAITING_RUNNER ? schema_1.XpodRunStepType.WAITING_RUNNER : schema_1.XpodRunStepType.WAITING_INPUT;
|
|
443
|
+
}
|
|
444
|
+
return schema_1.XpodRunStepType.FAILED;
|
|
445
|
+
}
|
|
446
|
+
async saveRun(run, context) {
|
|
447
|
+
await this.runStore?.saveRun(run, context);
|
|
448
|
+
}
|
|
449
|
+
async appendRunStep(run, type, context, options = {}) {
|
|
450
|
+
const createdAt = (0, types_1.nowTimestamp)();
|
|
451
|
+
await this.runStore?.appendRunStep({
|
|
452
|
+
id: (0, store_1.generateRunStepResourceId)({
|
|
453
|
+
key: (0, types_1.generateId)('run-step'),
|
|
454
|
+
runId: run.id,
|
|
455
|
+
commandKind: run.commandKind,
|
|
456
|
+
surfaceId: run.surfaceId,
|
|
457
|
+
createdAt,
|
|
458
|
+
}),
|
|
459
|
+
commandKind: run.commandKind,
|
|
460
|
+
surfaceId: run.surfaceId,
|
|
461
|
+
runId: run.id,
|
|
462
|
+
run: this.resolveRunUri(run, context),
|
|
463
|
+
type,
|
|
464
|
+
message: options.message,
|
|
465
|
+
data: options.data,
|
|
466
|
+
createdAt,
|
|
467
|
+
}, context);
|
|
468
|
+
}
|
|
469
|
+
resolveThreadUri(thread, context) {
|
|
470
|
+
const threadId = thread.id;
|
|
471
|
+
if (/^https?:\/\//.test(threadId)) {
|
|
472
|
+
return threadId;
|
|
473
|
+
}
|
|
474
|
+
const commandKind = thread.metadata?.commandKind === 'task' ? 'task' : 'chat';
|
|
475
|
+
const surfaceId = this.resolveSurfaceId(thread);
|
|
476
|
+
const podBaseUrl = this.resolvePodBaseUrl(context);
|
|
477
|
+
if (podBaseUrl) {
|
|
478
|
+
if (threadId.includes('#') && !threadId.startsWith('#')) {
|
|
479
|
+
return (0, store_1.resolveDataResourceIri)(podBaseUrl, threadId);
|
|
480
|
+
}
|
|
481
|
+
return `${podBaseUrl}/.data/${commandKind}/${surfaceId}/index.ttl#${threadId}`;
|
|
482
|
+
}
|
|
483
|
+
return `urn:xpod:thread:${commandKind}:${encodeURIComponent(surfaceId)}:${encodeURIComponent(threadId)}`;
|
|
484
|
+
}
|
|
485
|
+
resolveRunUri(run, context) {
|
|
486
|
+
const podBaseUrl = this.resolvePodBaseUrl(context);
|
|
487
|
+
if (podBaseUrl) {
|
|
488
|
+
return (0, store_1.resolveDataResourceIri)(podBaseUrl, run.id);
|
|
489
|
+
}
|
|
490
|
+
return (0, store_1.resolveRunUrn)(run.id);
|
|
491
|
+
}
|
|
492
|
+
async resolveWaitingRunForToolOutput(item, threadRef, context) {
|
|
493
|
+
const metadataRunId = item.metadata?.runId;
|
|
494
|
+
if (typeof metadataRunId === 'string' && this.runStore?.loadRun) {
|
|
495
|
+
const run = await this.runStore.loadRun(metadataRunId, context);
|
|
496
|
+
if (run.status === schema_1.RunStatus.WAITING_INPUT) {
|
|
497
|
+
return run;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
if (!this.runStore?.listRuns) {
|
|
501
|
+
return undefined;
|
|
502
|
+
}
|
|
503
|
+
const threadCandidates = this.threadCandidatesForRunLookup(threadRef, context);
|
|
504
|
+
for (const thread of threadCandidates) {
|
|
505
|
+
const candidates = await this.runStore.listRuns({
|
|
506
|
+
thread,
|
|
507
|
+
status: schema_1.RunStatus.WAITING_INPUT,
|
|
508
|
+
limit: 10,
|
|
509
|
+
}, context);
|
|
510
|
+
const match = candidates.find((run) => {
|
|
511
|
+
const tool = run.metadata?.waitingTool;
|
|
512
|
+
return !tool || typeof tool !== 'object' || tool.itemId === item.id;
|
|
513
|
+
}) ?? candidates[0];
|
|
514
|
+
if (match) {
|
|
515
|
+
return match;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
return undefined;
|
|
519
|
+
}
|
|
520
|
+
extractThreadIdFromRef(threadRef) {
|
|
521
|
+
if ('chat_id' in threadRef) {
|
|
522
|
+
return threadRef.thread_id;
|
|
523
|
+
}
|
|
524
|
+
return threadRef.thread_id;
|
|
525
|
+
}
|
|
526
|
+
threadCandidatesForRunLookup(threadRef, context) {
|
|
527
|
+
const candidates = [];
|
|
528
|
+
const add = (value) => {
|
|
529
|
+
if (value && !candidates.includes(value)) {
|
|
530
|
+
candidates.push(value);
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
const threadId = this.extractThreadIdFromRef(threadRef);
|
|
534
|
+
add(threadId);
|
|
535
|
+
const relative = this.extractBaseRelativeThreadId(threadId);
|
|
536
|
+
add(relative);
|
|
537
|
+
const podBaseUrl = this.resolvePodBaseUrl(context);
|
|
538
|
+
if (podBaseUrl && relative) {
|
|
539
|
+
add((0, store_1.resolveDataResourceIri)(podBaseUrl, relative));
|
|
540
|
+
}
|
|
541
|
+
return candidates;
|
|
542
|
+
}
|
|
543
|
+
extractBaseRelativeThreadId(threadId) {
|
|
544
|
+
if (/^(chat|task)\/[^/]+\/index\.ttl#[^#]+$/.test(threadId)) {
|
|
545
|
+
return threadId;
|
|
546
|
+
}
|
|
547
|
+
if (!/^https?:\/\//.test(threadId)) {
|
|
548
|
+
return undefined;
|
|
549
|
+
}
|
|
550
|
+
try {
|
|
551
|
+
const url = new URL(threadId);
|
|
552
|
+
const marker = '/.data/';
|
|
553
|
+
const index = url.pathname.indexOf(marker);
|
|
554
|
+
if (index >= 0 && url.hash) {
|
|
555
|
+
return `${url.pathname.slice(index + marker.length)}${url.hash}`;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
catch {
|
|
559
|
+
return undefined;
|
|
560
|
+
}
|
|
561
|
+
return undefined;
|
|
562
|
+
}
|
|
563
|
+
buildContinuationPrompt(item) {
|
|
564
|
+
return `Continue the previous run after client tool output.\n\nTool: ${item.name}\nOutput:\n${item.output ?? ''}`;
|
|
565
|
+
}
|
|
566
|
+
resolveRuntimeConfigForContinuation(run) {
|
|
567
|
+
const runtimeConfig = run.metadata?.runtimeConfig;
|
|
568
|
+
if (runtimeConfig && typeof runtimeConfig === 'object') {
|
|
569
|
+
return runtimeConfig;
|
|
570
|
+
}
|
|
571
|
+
if (!(0, types_2.isWorkspaceUri)(run.workspace)) {
|
|
572
|
+
throw new Error('Run workspace URI is required');
|
|
573
|
+
}
|
|
574
|
+
const [protocol, type] = run.runner.split(':');
|
|
575
|
+
return {
|
|
576
|
+
workspace: run.workspace,
|
|
577
|
+
runner: {
|
|
578
|
+
protocol: protocol === 'acp' ? 'acp' : 'pi',
|
|
579
|
+
type: this.isRunnerType(type) ? type : 'pi',
|
|
580
|
+
},
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
isRunnerType(value) {
|
|
584
|
+
return value === 'pi' || value === 'codex' || value === 'claude' || value === 'codebuddy';
|
|
585
|
+
}
|
|
586
|
+
resolveSurfaceId(thread) {
|
|
587
|
+
if (typeof thread.metadata?.surface_id === 'string') {
|
|
588
|
+
return thread.metadata.surface_id;
|
|
589
|
+
}
|
|
590
|
+
if (typeof thread.metadata?.chat_id === 'string') {
|
|
591
|
+
return thread.metadata.chat_id;
|
|
592
|
+
}
|
|
593
|
+
return types_1.DEFAULT_THREAD_CHAT_ID;
|
|
594
|
+
}
|
|
595
|
+
resolvePodBaseUrl(context) {
|
|
596
|
+
const auth = context.auth;
|
|
597
|
+
const webId = typeof auth?.webId === 'string' ? auth.webId : undefined;
|
|
598
|
+
if (!webId) {
|
|
599
|
+
return undefined;
|
|
600
|
+
}
|
|
601
|
+
try {
|
|
602
|
+
const url = new URL(webId);
|
|
603
|
+
url.hash = '';
|
|
604
|
+
url.search = '';
|
|
605
|
+
const normalizedPath = url.pathname.replace(/\/+$/, '');
|
|
606
|
+
if (!normalizedPath.endsWith('/profile/card')) {
|
|
607
|
+
return undefined;
|
|
608
|
+
}
|
|
609
|
+
const podPath = normalizedPath.slice(0, -'/profile/card'.length) || '/';
|
|
610
|
+
url.pathname = podPath;
|
|
611
|
+
return url.toString().replace(/\/$/, '');
|
|
612
|
+
}
|
|
613
|
+
catch {
|
|
614
|
+
return undefined;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
async createAssistantMessage(thread, context) {
|
|
618
|
+
return {
|
|
619
|
+
id: this.store.generateItemId('assistant_message', thread, context),
|
|
620
|
+
thread_id: thread.id,
|
|
621
|
+
type: 'assistant_message',
|
|
622
|
+
content: [{ type: 'output_text', text: '' }],
|
|
623
|
+
status: 'in_progress',
|
|
624
|
+
created_at: (0, types_1.nowTimestamp)(),
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
finalizeAssistantMessage(item, text, status) {
|
|
628
|
+
return {
|
|
629
|
+
...item,
|
|
630
|
+
content: [{ type: 'output_text', text }],
|
|
631
|
+
status,
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
threadRefFromThread(thread) {
|
|
635
|
+
return (0, types_1.toThreadRef)({
|
|
636
|
+
thread_id: thread.id,
|
|
637
|
+
chat_id: typeof thread.metadata?.chat_id === 'string' ? thread.metadata.chat_id : types_1.DEFAULT_THREAD_CHAT_ID,
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
async loadConversation(threadRef, currentUserMessageId, context) {
|
|
641
|
+
const items = await this.store.loadThreadItems(threadRef, undefined, 1000, 'asc', context);
|
|
642
|
+
const conversation = [];
|
|
643
|
+
for (const item of items.data) {
|
|
644
|
+
if (item.id === currentUserMessageId) {
|
|
645
|
+
break;
|
|
646
|
+
}
|
|
647
|
+
if (item.type === 'user_message') {
|
|
648
|
+
const text = (0, types_1.extractUserMessageText)(item.content).trim();
|
|
649
|
+
if (text) {
|
|
650
|
+
conversation.push({ role: 'user', text, createdAt: item.created_at });
|
|
651
|
+
}
|
|
652
|
+
continue;
|
|
653
|
+
}
|
|
654
|
+
if (item.type === 'assistant_message' && item.status !== 'in_progress') {
|
|
655
|
+
const text = (0, types_1.extractAssistantMessageText)(item.content).trim();
|
|
656
|
+
if (text) {
|
|
657
|
+
conversation.push({ role: 'assistant', text, createdAt: item.created_at });
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return conversation;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
exports.RunStateCenter = RunStateCenter;
|
|
665
|
+
//# sourceMappingURL=RunStateCenter.js.map
|