@artinet/sdk 0.5.18 → 0.6.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -617
- package/dist/browser/browser.d.ts +1 -1
- package/dist/browser/browser.js +1 -1
- package/dist/browser/client/a2a-client.d.ts +19 -18
- package/dist/browser/client/a2a-client.js +20 -8
- package/dist/browser/config/index.d.ts +158 -0
- package/dist/browser/config/index.js +155 -0
- package/dist/browser/config/observability.d.ts +119 -0
- package/dist/browser/config/observability.js +35 -0
- package/dist/browser/create/agentcard-builder.d.ts +47 -0
- package/dist/browser/create/agentcard-builder.js +65 -0
- package/dist/browser/create/base.d.ts +4 -0
- package/dist/browser/create/describe.d.ts +8 -0
- package/dist/browser/create/describe.js +8 -0
- package/dist/browser/create/message-builder.d.ts +78 -0
- package/dist/browser/create/message-builder.js +108 -0
- package/dist/browser/create/part-builder.d.ts +60 -0
- package/dist/browser/create/part-builder.js +81 -0
- package/dist/browser/create/task-builder.d.ts +251 -0
- package/dist/browser/create/task-builder.js +379 -0
- package/dist/browser/transport/rpc/parser.d.ts +2 -2
- package/dist/browser/transport/rpc/parser.js +7 -6
- package/dist/browser/transport/rpc/rpc-client.d.ts +5 -5
- package/dist/browser/transport/rpc/rpc-client.js +6 -6
- package/dist/browser/transport/streaming/event-stream.d.ts +3 -3
- package/dist/browser/transport/streaming/event-stream.js +11 -10
- package/dist/browser/types/a2a/a2a.d.ts +382 -0
- package/dist/browser/types/a2a/a2a.js +14 -0
- package/dist/browser/types/a2a/index.d.ts +5 -0
- package/dist/browser/types/a2a/index.js +1 -0
- package/dist/browser/types/{interfaces/client.d.ts → client.d.ts} +25 -27
- package/dist/browser/types/core/core.d.ts +31 -0
- package/dist/browser/types/core/index.d.ts +1 -0
- package/dist/browser/types/core/index.js +1 -0
- package/dist/browser/types/index.d.ts +6 -3
- package/dist/browser/types/index.js +6 -3
- package/dist/browser/types/mcp/index.d.ts +1 -0
- package/dist/browser/types/mcp/index.js +1 -0
- package/dist/{types/interfaces/services/mcp/service.d.ts → browser/types/mcp/mcp.d.ts} +4 -3
- package/dist/browser/types/{interfaces/services/a2a/builder.js → mcp/mcp.js} +1 -1
- package/dist/browser/types/storage.d.ts +21 -0
- package/dist/browser/utils/common/constants.d.ts +2 -7
- package/dist/browser/utils/common/constants.js +5 -32
- package/dist/browser/utils/common/errors.d.ts +74 -18
- package/dist/browser/utils/common/errors.js +81 -28
- package/dist/browser/utils/common/utils.d.ts +23 -0
- package/dist/browser/utils/common/utils.js +32 -0
- package/dist/client/a2a-client.d.ts +19 -18
- package/dist/client/a2a-client.js +20 -8
- package/dist/config/default.d.ts +50 -0
- package/dist/config/default.js +62 -0
- package/dist/config/index.d.ts +158 -0
- package/dist/config/index.js +155 -0
- package/dist/config/observability.d.ts +119 -0
- package/dist/config/observability.js +35 -0
- package/dist/create/agent-builder.d.ts +77 -0
- package/dist/create/agent-builder.js +20 -0
- package/dist/create/agentcard-builder.d.ts +47 -0
- package/dist/create/agentcard-builder.js +66 -0
- package/dist/create/base.d.ts +4 -0
- package/dist/create/base.js +1 -0
- package/dist/create/create.d.ts +762 -0
- package/dist/create/create.js +556 -0
- package/dist/create/describe.d.ts +8 -0
- package/dist/create/describe.js +8 -0
- package/dist/create/index.d.ts +4 -0
- package/dist/create/index.js +4 -0
- package/dist/create/message-builder.d.ts +78 -0
- package/dist/create/message-builder.js +110 -0
- package/dist/create/part-builder.d.ts +60 -0
- package/dist/create/part-builder.js +84 -0
- package/dist/create/status-builder.d.ts +26 -0
- package/dist/create/status-builder.js +46 -0
- package/dist/create/task-builder.d.ts +251 -0
- package/dist/create/task-builder.js +384 -0
- package/dist/create/transform.d.ts +16 -0
- package/dist/create/transform.js +106 -0
- package/dist/extensions/otel.d.ts +98 -0
- package/dist/extensions/otel.js +190 -0
- package/dist/extensions/pino.d.ts +44 -0
- package/dist/extensions/pino.js +107 -0
- package/dist/extensions/winston.d.ts +47 -0
- package/dist/extensions/winston.js +114 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/server/express/errors.js +7 -11
- package/dist/server/express/middeware.d.ts +2 -2
- package/dist/server/express/middeware.js +26 -40
- package/dist/server/express/server.d.ts +14 -56
- package/dist/server/express/server.js +46 -35
- package/dist/services/a2a/execute.d.ts +11 -0
- package/dist/services/a2a/execute.js +32 -0
- package/dist/services/a2a/factory/context.d.ts +15 -128
- package/dist/services/a2a/factory/context.js +30 -136
- package/dist/services/a2a/factory/handler.d.ts +6 -0
- package/dist/services/a2a/factory/handler.js +14 -0
- package/dist/services/a2a/factory/index.d.ts +1 -3
- package/dist/services/a2a/factory/index.js +1 -3
- package/dist/services/a2a/factory/service.d.ts +20 -7
- package/dist/services/a2a/factory/service.js +5 -5
- package/dist/services/a2a/factory/state-machine.d.ts +11 -0
- package/dist/services/a2a/factory/state-machine.js +88 -0
- package/dist/services/a2a/handlers/artifact.d.ts +7 -0
- package/dist/services/a2a/handlers/artifact.js +28 -0
- package/dist/services/a2a/handlers/cancel-task.d.ts +11 -0
- package/dist/services/a2a/handlers/cancel-task.js +35 -0
- package/dist/services/a2a/handlers/get-task.d.ts +11 -0
- package/dist/services/a2a/handlers/get-task.js +13 -0
- package/dist/services/a2a/handlers/resubscribe-task.d.ts +19 -0
- package/dist/services/a2a/handlers/resubscribe-task.js +59 -0
- package/dist/services/a2a/handlers/send-message.d.ts +11 -0
- package/dist/services/a2a/handlers/send-message.js +31 -0
- package/dist/services/a2a/handlers/stream-message.d.ts +19 -0
- package/dist/services/a2a/handlers/stream-message.js +23 -0
- package/dist/services/a2a/handlers/update.d.ts +17 -0
- package/dist/services/a2a/handlers/update.js +119 -0
- package/dist/services/a2a/helpers/content.d.ts +6 -2
- package/dist/services/a2a/helpers/content.js +9 -1
- package/dist/services/a2a/helpers/history.d.ts +6 -2
- package/dist/services/a2a/helpers/history.js +4 -0
- package/dist/services/a2a/helpers/index.d.ts +3 -3
- package/dist/services/a2a/helpers/index.js +3 -3
- package/dist/services/a2a/helpers/part.d.ts +9 -9
- package/dist/services/a2a/helpers/references.d.ts +6 -0
- package/dist/services/a2a/helpers/references.js +22 -0
- package/dist/services/a2a/index.d.ts +9 -5
- package/dist/services/a2a/index.js +8 -5
- package/dist/services/a2a/managers.d.ts +23 -0
- package/dist/services/a2a/managers.js +101 -0
- package/dist/services/a2a/messenger.d.ts +35 -0
- package/dist/services/{core/managers/command.js → a2a/messenger.js} +27 -31
- package/dist/services/a2a/service.d.ts +45 -372
- package/dist/services/a2a/service.js +232 -84
- package/dist/services/a2a/state-machine.d.ts +18 -0
- package/dist/services/a2a/state-machine.js +78 -0
- package/dist/services/a2a/streams.d.ts +22 -0
- package/dist/services/a2a/streams.js +98 -0
- package/dist/services/core/index.d.ts +1 -2
- package/dist/services/core/index.js +1 -2
- package/dist/services/core/manager.d.ts +15 -0
- package/dist/services/core/manager.js +42 -0
- package/dist/services/mcp/service.d.ts +11 -15
- package/dist/services/mcp/service.js +16 -15
- package/dist/transport/index.d.ts +0 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/rpc/parser.d.ts +2 -2
- package/dist/transport/rpc/parser.js +7 -6
- package/dist/transport/rpc/rpc-client.d.ts +5 -5
- package/dist/transport/rpc/rpc-client.js +6 -6
- package/dist/transport/streaming/event-stream.d.ts +3 -3
- package/dist/transport/streaming/event-stream.js +11 -10
- package/dist/transport/trpc/a2a/factory/router.d.ts +479 -871
- package/dist/transport/trpc/a2a/factory/router.js +2 -2
- package/dist/transport/trpc/a2a/routes/info.d.ts +108 -8
- package/dist/transport/trpc/a2a/routes/info.js +6 -2
- package/dist/transport/trpc/a2a/routes/message/route.d.ts +113 -162
- package/dist/transport/trpc/a2a/routes/message/route.js +7 -13
- package/dist/transport/trpc/a2a/routes/tasks/route.d.ts +114 -212
- package/dist/transport/trpc/a2a/routes/tasks/route.js +16 -19
- package/dist/transport/trpc/a2a/trpc.d.ts +9 -253
- package/dist/types/a2a/a2a.d.ts +382 -0
- package/dist/types/a2a/a2a.js +14 -0
- package/dist/types/a2a/index.d.ts +5 -0
- package/dist/types/a2a/index.js +1 -0
- package/dist/types/{interfaces/client.d.ts → client.d.ts} +25 -27
- package/dist/types/core/core.d.ts +31 -0
- package/dist/types/core/core.js +1 -0
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/core/index.js +1 -0
- package/dist/types/index.d.ts +6 -3
- package/dist/types/index.js +6 -3
- package/dist/types/mcp/index.d.ts +1 -0
- package/dist/types/mcp/index.js +1 -0
- package/dist/{browser/types/interfaces/services/mcp/service.d.ts → types/mcp/mcp.d.ts} +4 -3
- package/dist/{browser/types/interfaces/services/a2a/context.js → types/mcp/mcp.js} +1 -1
- package/dist/types/storage.d.ts +21 -0
- package/dist/utils/common/constants.d.ts +2 -7
- package/dist/utils/common/constants.js +5 -32
- package/dist/utils/common/errors.d.ts +74 -18
- package/dist/utils/common/errors.js +81 -28
- package/dist/utils/common/parse.d.ts +7 -0
- package/dist/utils/common/parse.js +14 -0
- package/dist/utils/common/schema-validation.d.ts +2 -2
- package/dist/utils/common/schema-validation.js +7 -7
- package/dist/utils/common/utils.d.ts +23 -0
- package/dist/utils/common/utils.js +32 -0
- package/dist/utils/common/zAsyncIterable-v3.d.ts +1 -1
- package/dist/utils/common/zAsyncIterable-v3.js +2 -1
- package/dist/utils/index.d.ts +2 -3
- package/dist/utils/index.js +2 -3
- package/dist/utils/storage/file.d.ts +8 -17
- package/dist/utils/storage/file.js +44 -73
- package/package.json +76 -13
- package/dist/browser/services/a2a/helpers/message-builder.d.ts +0 -12
- package/dist/browser/services/a2a/helpers/message-builder.js +0 -61
- package/dist/browser/types/ext.d.ts +0 -13
- package/dist/browser/types/ext.js +0 -10
- package/dist/browser/types/interfaces/index.d.ts +0 -3
- package/dist/browser/types/interfaces/index.js +0 -3
- package/dist/browser/types/interfaces/services/a2a/builder.d.ts +0 -37
- package/dist/browser/types/interfaces/services/a2a/context.d.ts +0 -162
- package/dist/browser/types/interfaces/services/a2a/engine.d.ts +0 -7
- package/dist/browser/types/interfaces/services/a2a/engine.js +0 -5
- package/dist/browser/types/interfaces/services/a2a/index.d.ts +0 -5
- package/dist/browser/types/interfaces/services/a2a/index.js +0 -5
- package/dist/browser/types/interfaces/services/a2a/legacy.d.ts +0 -93
- package/dist/browser/types/interfaces/services/a2a/legacy.js +0 -5
- package/dist/browser/types/interfaces/services/a2a/service.d.ts +0 -413
- package/dist/browser/types/interfaces/services/a2a/service.js +0 -5
- package/dist/browser/types/interfaces/services/core/context/command.d.ts +0 -25
- package/dist/browser/types/interfaces/services/core/context/command.js +0 -5
- package/dist/browser/types/interfaces/services/core/context/context.d.ts +0 -207
- package/dist/browser/types/interfaces/services/core/context/context.js +0 -5
- package/dist/browser/types/interfaces/services/core/context/index.d.ts +0 -3
- package/dist/browser/types/interfaces/services/core/context/index.js +0 -3
- package/dist/browser/types/interfaces/services/core/context/types.d.ts +0 -11
- package/dist/browser/types/interfaces/services/core/context/types.js +0 -5
- package/dist/browser/types/interfaces/services/core/execution/engine.d.ts +0 -106
- package/dist/browser/types/interfaces/services/core/execution/engine.js +0 -5
- package/dist/browser/types/interfaces/services/core/execution/environment.d.ts +0 -11
- package/dist/browser/types/interfaces/services/core/execution/environment.js +0 -5
- package/dist/browser/types/interfaces/services/core/execution/execute.d.ts +0 -7
- package/dist/browser/types/interfaces/services/core/execution/execute.js +0 -5
- package/dist/browser/types/interfaces/services/core/execution/index.d.ts +0 -3
- package/dist/browser/types/interfaces/services/core/execution/index.js +0 -3
- package/dist/browser/types/interfaces/services/core/index.d.ts +0 -4
- package/dist/browser/types/interfaces/services/core/index.js +0 -4
- package/dist/browser/types/interfaces/services/core/managers/cancellation.d.ts +0 -9
- package/dist/browser/types/interfaces/services/core/managers/cancellation.js +0 -5
- package/dist/browser/types/interfaces/services/core/managers/connection.d.ts +0 -9
- package/dist/browser/types/interfaces/services/core/managers/connection.js +0 -5
- package/dist/browser/types/interfaces/services/core/managers/context.d.ts +0 -17
- package/dist/browser/types/interfaces/services/core/managers/context.js +0 -5
- package/dist/browser/types/interfaces/services/core/managers/event.d.ts +0 -328
- package/dist/browser/types/interfaces/services/core/managers/event.js +0 -5
- package/dist/browser/types/interfaces/services/core/managers/index.d.ts +0 -6
- package/dist/browser/types/interfaces/services/core/managers/index.js +0 -6
- package/dist/browser/types/interfaces/services/core/managers/stream.d.ts +0 -217
- package/dist/browser/types/interfaces/services/core/managers/stream.js +0 -5
- package/dist/browser/types/interfaces/services/core/managers/task.d.ts +0 -9
- package/dist/browser/types/interfaces/services/core/service.d.ts +0 -115
- package/dist/browser/types/interfaces/services/core/service.js +0 -5
- package/dist/browser/types/interfaces/services/index.d.ts +0 -4
- package/dist/browser/types/interfaces/services/index.js +0 -4
- package/dist/browser/types/interfaces/services/mcp/index.d.ts +0 -1
- package/dist/browser/types/interfaces/services/mcp/index.js +0 -1
- package/dist/browser/types/interfaces/services/mcp/service.js +0 -5
- package/dist/browser/types/interfaces/storage.d.ts +0 -8
- package/dist/browser/types/schemas/a2a/agent.d.ts +0 -2583
- package/dist/browser/types/schemas/a2a/agent.js +0 -323
- package/dist/browser/types/schemas/a2a/auth.d.ts +0 -908
- package/dist/browser/types/schemas/a2a/auth.js +0 -283
- package/dist/browser/types/schemas/a2a/error.d.ts +0 -396
- package/dist/browser/types/schemas/a2a/error.js +0 -163
- package/dist/browser/types/schemas/a2a/index.d.ts +0 -11
- package/dist/browser/types/schemas/a2a/index.js +0 -11
- package/dist/browser/types/schemas/a2a/kind.d.ts +0 -11
- package/dist/browser/types/schemas/a2a/kind.js +0 -20
- package/dist/browser/types/schemas/a2a/message.d.ts +0 -10343
- package/dist/browser/types/schemas/a2a/message.js +0 -130
- package/dist/browser/types/schemas/a2a/notification.d.ts +0 -1517
- package/dist/browser/types/schemas/a2a/notification.js +0 -203
- package/dist/browser/types/schemas/a2a/parameters.d.ts +0 -956
- package/dist/browser/types/schemas/a2a/parameters.js +0 -241
- package/dist/browser/types/schemas/a2a/protocol.d.ts +0 -14363
- package/dist/browser/types/schemas/a2a/protocol.js +0 -59
- package/dist/browser/types/schemas/a2a/rpc.d.ts +0 -182
- package/dist/browser/types/schemas/a2a/rpc.js +0 -126
- package/dist/browser/types/schemas/a2a/task.d.ts +0 -5886
- package/dist/browser/types/schemas/a2a/task.js +0 -134
- package/dist/browser/types/schemas/a2a/transport.d.ts +0 -31
- package/dist/browser/types/schemas/a2a/transport.js +0 -28
- package/dist/browser/types/schemas/index.d.ts +0 -1
- package/dist/browser/types/schemas/index.js +0 -1
- package/dist/browser/utils/logging/index.d.ts +0 -2
- package/dist/browser/utils/logging/index.js +0 -2
- package/dist/browser/utils/logging/log.d.ts +0 -33
- package/dist/browser/utils/logging/log.js +0 -75
- package/dist/browser/utils/logging/logger.d.ts +0 -18
- package/dist/browser/utils/logging/logger.js +0 -18
- package/dist/services/a2a/factory/builder.d.ts +0 -351
- package/dist/services/a2a/factory/builder.js +0 -365
- package/dist/services/a2a/factory/event.d.ts +0 -58
- package/dist/services/a2a/factory/event.js +0 -177
- package/dist/services/a2a/factory/method.d.ts +0 -6
- package/dist/services/a2a/factory/method.js +0 -14
- package/dist/services/a2a/helpers/agentcard-builder.d.ts +0 -7
- package/dist/services/a2a/helpers/agentcard-builder.js +0 -23
- package/dist/services/a2a/helpers/message-builder.d.ts +0 -12
- package/dist/services/a2a/helpers/message-builder.js +0 -61
- package/dist/services/a2a/managers/cancellation.d.ts +0 -11
- package/dist/services/a2a/managers/cancellation.js +0 -16
- package/dist/services/a2a/managers/connection.d.ts +0 -11
- package/dist/services/a2a/managers/connection.js +0 -16
- package/dist/services/a2a/managers/context.d.ts +0 -11
- package/dist/services/a2a/managers/context.js +0 -16
- package/dist/services/a2a/managers/index.d.ts +0 -5
- package/dist/services/a2a/managers/index.js +0 -5
- package/dist/services/a2a/managers/task.d.ts +0 -11
- package/dist/services/a2a/managers/task.js +0 -16
- package/dist/services/a2a/methods/cancel-task.d.ts +0 -7
- package/dist/services/a2a/methods/cancel-task.js +0 -43
- package/dist/services/a2a/methods/get-task.d.ts +0 -112
- package/dist/services/a2a/methods/get-task.js +0 -16
- package/dist/services/a2a/methods/resubscribe-task.d.ts +0 -7
- package/dist/services/a2a/methods/resubscribe-task.js +0 -80
- package/dist/services/a2a/methods/send-message.d.ts +0 -7
- package/dist/services/a2a/methods/send-message.js +0 -36
- package/dist/services/a2a/methods/stream-message.d.ts +0 -8
- package/dist/services/a2a/methods/stream-message.js +0 -21
- package/dist/services/a2a/state/index.d.ts +0 -3
- package/dist/services/a2a/state/index.js +0 -3
- package/dist/services/a2a/state/load.d.ts +0 -14
- package/dist/services/a2a/state/load.js +0 -71
- package/dist/services/a2a/state/process.d.ts +0 -7
- package/dist/services/a2a/state/process.js +0 -13
- package/dist/services/a2a/state/update/artifact.d.ts +0 -10
- package/dist/services/a2a/state/update/artifact.js +0 -39
- package/dist/services/a2a/state/update/index.d.ts +0 -2
- package/dist/services/a2a/state/update/index.js +0 -2
- package/dist/services/a2a/state/update/update.d.ts +0 -23
- package/dist/services/a2a/state/update/update.js +0 -123
- package/dist/services/core/execution/execute.d.ts +0 -6
- package/dist/services/core/execution/execute.js +0 -25
- package/dist/services/core/execution/index.d.ts +0 -1
- package/dist/services/core/execution/index.js +0 -1
- package/dist/services/core/managers/command.d.ts +0 -39
- package/dist/services/core/managers/event.d.ts +0 -18
- package/dist/services/core/managers/event.js +0 -56
- package/dist/services/core/managers/index.d.ts +0 -3
- package/dist/services/core/managers/index.js +0 -3
- package/dist/services/core/managers/stream.d.ts +0 -20
- package/dist/services/core/managers/stream.js +0 -77
- package/dist/types/ext.d.ts +0 -13
- package/dist/types/ext.js +0 -10
- package/dist/types/interfaces/index.d.ts +0 -3
- package/dist/types/interfaces/index.js +0 -3
- package/dist/types/interfaces/services/a2a/builder.d.ts +0 -37
- package/dist/types/interfaces/services/a2a/builder.js +0 -5
- package/dist/types/interfaces/services/a2a/context.d.ts +0 -162
- package/dist/types/interfaces/services/a2a/context.js +0 -5
- package/dist/types/interfaces/services/a2a/engine.d.ts +0 -7
- package/dist/types/interfaces/services/a2a/engine.js +0 -5
- package/dist/types/interfaces/services/a2a/index.d.ts +0 -5
- package/dist/types/interfaces/services/a2a/index.js +0 -5
- package/dist/types/interfaces/services/a2a/legacy.d.ts +0 -93
- package/dist/types/interfaces/services/a2a/legacy.js +0 -5
- package/dist/types/interfaces/services/a2a/service.d.ts +0 -413
- package/dist/types/interfaces/services/a2a/service.js +0 -5
- package/dist/types/interfaces/services/core/context/command.d.ts +0 -25
- package/dist/types/interfaces/services/core/context/command.js +0 -5
- package/dist/types/interfaces/services/core/context/context.d.ts +0 -207
- package/dist/types/interfaces/services/core/context/context.js +0 -5
- package/dist/types/interfaces/services/core/context/index.d.ts +0 -3
- package/dist/types/interfaces/services/core/context/index.js +0 -3
- package/dist/types/interfaces/services/core/context/types.d.ts +0 -11
- package/dist/types/interfaces/services/core/context/types.js +0 -5
- package/dist/types/interfaces/services/core/execution/engine.d.ts +0 -106
- package/dist/types/interfaces/services/core/execution/engine.js +0 -5
- package/dist/types/interfaces/services/core/execution/environment.d.ts +0 -11
- package/dist/types/interfaces/services/core/execution/environment.js +0 -5
- package/dist/types/interfaces/services/core/execution/execute.d.ts +0 -7
- package/dist/types/interfaces/services/core/execution/execute.js +0 -5
- package/dist/types/interfaces/services/core/execution/index.d.ts +0 -3
- package/dist/types/interfaces/services/core/execution/index.js +0 -3
- package/dist/types/interfaces/services/core/index.d.ts +0 -4
- package/dist/types/interfaces/services/core/index.js +0 -4
- package/dist/types/interfaces/services/core/managers/cancellation.d.ts +0 -9
- package/dist/types/interfaces/services/core/managers/cancellation.js +0 -5
- package/dist/types/interfaces/services/core/managers/connection.d.ts +0 -9
- package/dist/types/interfaces/services/core/managers/connection.js +0 -5
- package/dist/types/interfaces/services/core/managers/context.d.ts +0 -17
- package/dist/types/interfaces/services/core/managers/context.js +0 -5
- package/dist/types/interfaces/services/core/managers/event.d.ts +0 -328
- package/dist/types/interfaces/services/core/managers/event.js +0 -5
- package/dist/types/interfaces/services/core/managers/index.d.ts +0 -6
- package/dist/types/interfaces/services/core/managers/index.js +0 -6
- package/dist/types/interfaces/services/core/managers/stream.d.ts +0 -217
- package/dist/types/interfaces/services/core/managers/stream.js +0 -5
- package/dist/types/interfaces/services/core/managers/task.d.ts +0 -9
- package/dist/types/interfaces/services/core/service.d.ts +0 -115
- package/dist/types/interfaces/services/core/service.js +0 -5
- package/dist/types/interfaces/services/index.d.ts +0 -4
- package/dist/types/interfaces/services/index.js +0 -4
- package/dist/types/interfaces/services/mcp/index.d.ts +0 -1
- package/dist/types/interfaces/services/mcp/index.js +0 -1
- package/dist/types/interfaces/services/mcp/service.js +0 -5
- package/dist/types/interfaces/storage.d.ts +0 -8
- package/dist/types/schemas/a2a/agent.d.ts +0 -2583
- package/dist/types/schemas/a2a/agent.js +0 -323
- package/dist/types/schemas/a2a/auth.d.ts +0 -908
- package/dist/types/schemas/a2a/auth.js +0 -283
- package/dist/types/schemas/a2a/error.d.ts +0 -396
- package/dist/types/schemas/a2a/error.js +0 -163
- package/dist/types/schemas/a2a/index.d.ts +0 -11
- package/dist/types/schemas/a2a/index.js +0 -11
- package/dist/types/schemas/a2a/kind.d.ts +0 -11
- package/dist/types/schemas/a2a/kind.js +0 -20
- package/dist/types/schemas/a2a/message.d.ts +0 -10343
- package/dist/types/schemas/a2a/message.js +0 -130
- package/dist/types/schemas/a2a/notification.d.ts +0 -1517
- package/dist/types/schemas/a2a/notification.js +0 -203
- package/dist/types/schemas/a2a/parameters.d.ts +0 -956
- package/dist/types/schemas/a2a/parameters.js +0 -241
- package/dist/types/schemas/a2a/protocol.d.ts +0 -14363
- package/dist/types/schemas/a2a/protocol.js +0 -59
- package/dist/types/schemas/a2a/rpc.d.ts +0 -182
- package/dist/types/schemas/a2a/rpc.js +0 -126
- package/dist/types/schemas/a2a/task.d.ts +0 -5886
- package/dist/types/schemas/a2a/task.js +0 -134
- package/dist/types/schemas/a2a/transport.d.ts +0 -31
- package/dist/types/schemas/a2a/transport.js +0 -28
- package/dist/types/schemas/index.d.ts +0 -1
- package/dist/types/schemas/index.js +0 -1
- package/dist/utils/logging/index.d.ts +0 -2
- package/dist/utils/logging/index.js +0 -2
- package/dist/utils/logging/log.d.ts +0 -33
- package/dist/utils/logging/log.js +0 -75
- package/dist/utils/logging/logger.d.ts +0 -18
- package/dist/utils/logging/logger.js +0 -18
- package/dist/utils/storage/memory.d.ts +0 -25
- package/dist/utils/storage/memory.js +0 -47
- /package/dist/browser/{types/interfaces/services/core/managers/task.js → create/base.js} +0 -0
- /package/dist/browser/types/{interfaces/client.js → client.js} +0 -0
- /package/dist/{types/interfaces/services/core/managers/task.js → browser/types/core/core.js} +0 -0
- /package/dist/browser/types/{interfaces/services/protocol.d.ts → protocol.d.ts} +0 -0
- /package/dist/browser/types/{interfaces/services/protocol.js → protocol.js} +0 -0
- /package/dist/browser/types/{interfaces/storage.js → storage.js} +0 -0
- /package/dist/services/a2a/{methods → handlers}/index.d.ts +0 -0
- /package/dist/services/a2a/{methods → handlers}/index.js +0 -0
- /package/dist/types/{interfaces/client.js → client.js} +0 -0
- /package/dist/types/{interfaces/services/protocol.d.ts → protocol.d.ts} +0 -0
- /package/dist/types/{interfaces/services/protocol.js → protocol.js} +0 -0
- /package/dist/types/{interfaces/storage.js → storage.js} +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { Artifact } from "../../../../types/index.js";
|
|
6
|
-
export declare function updateByIndex(append: boolean, artifacts: Artifact[], index: number, artifactUpdate: Artifact): {
|
|
7
|
-
artifacts: Artifact[];
|
|
8
|
-
replaced: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare function processArtifactUpdate(append: boolean, artifacts: Artifact[], artifactUpdate: Artifact): Artifact[];
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
export function updateByIndex(append, artifacts, index, artifactUpdate) {
|
|
6
|
-
if (append) {
|
|
7
|
-
const existingArtifact = artifacts[index];
|
|
8
|
-
existingArtifact.parts.push(...artifactUpdate.parts);
|
|
9
|
-
if (artifactUpdate.metadata) {
|
|
10
|
-
existingArtifact.metadata = {
|
|
11
|
-
...(existingArtifact.metadata || {}),
|
|
12
|
-
...artifactUpdate.metadata,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
if (artifactUpdate.description) {
|
|
16
|
-
existingArtifact.description = artifactUpdate.description;
|
|
17
|
-
}
|
|
18
|
-
if (artifactUpdate.name) {
|
|
19
|
-
existingArtifact.name = artifactUpdate.name;
|
|
20
|
-
}
|
|
21
|
-
artifacts[index] = existingArtifact;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
artifacts[index] = { ...artifactUpdate };
|
|
25
|
-
}
|
|
26
|
-
return { artifacts, replaced: true };
|
|
27
|
-
}
|
|
28
|
-
export function processArtifactUpdate(append, artifacts, artifactUpdate) {
|
|
29
|
-
const existingIndex = artifacts.findIndex((a) => a.artifactId === artifactUpdate.artifactId);
|
|
30
|
-
let replaced = false;
|
|
31
|
-
let newArtifacts = artifacts;
|
|
32
|
-
if (existingIndex !== -1) {
|
|
33
|
-
({ artifacts: newArtifacts, replaced } = updateByIndex(append, artifacts, existingIndex, artifactUpdate));
|
|
34
|
-
}
|
|
35
|
-
if (!replaced) {
|
|
36
|
-
newArtifacts.push({ ...artifactUpdate });
|
|
37
|
-
}
|
|
38
|
-
return newArtifacts;
|
|
39
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { TaskContext, Message, Task, TaskArtifactUpdateEvent, TaskStatusUpdateEvent, UpdateEvent, TaskAndHistory } from "../../../../types/index.js";
|
|
6
|
-
export declare enum UpdateKind {
|
|
7
|
-
Message = "message",
|
|
8
|
-
Task = "task",
|
|
9
|
-
StatusUpdate = "status-update",
|
|
10
|
-
ArtifactUpdate = "artifact-update"
|
|
11
|
-
}
|
|
12
|
-
export interface UpdateProps<T extends UpdateEvent = UpdateEvent> {
|
|
13
|
-
context: TaskContext;
|
|
14
|
-
current: TaskAndHistory;
|
|
15
|
-
update: T;
|
|
16
|
-
}
|
|
17
|
-
type UpdateFunction<T extends UpdateEvent> = (props: UpdateProps<T>) => Promise<boolean>;
|
|
18
|
-
export declare const updateMessage: UpdateFunction<Message>;
|
|
19
|
-
export declare const updateTask: UpdateFunction<Task>;
|
|
20
|
-
export declare const updateTaskStatusUpdate: UpdateFunction<TaskStatusUpdateEvent>;
|
|
21
|
-
export declare const updateTaskArtifactUpdate: UpdateFunction<TaskArtifactUpdateEvent>;
|
|
22
|
-
export declare const updateState: UpdateFunction<UpdateEvent>;
|
|
23
|
-
export {};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { getCurrentTimestamp } from "../../../../utils/index.js";
|
|
6
|
-
import { logError } from "../../../../utils/logging/index.js";
|
|
7
|
-
import { processArtifactUpdate } from "./artifact.js";
|
|
8
|
-
export var UpdateKind;
|
|
9
|
-
(function (UpdateKind) {
|
|
10
|
-
UpdateKind["Message"] = "message";
|
|
11
|
-
UpdateKind["Task"] = "task";
|
|
12
|
-
UpdateKind["StatusUpdate"] = "status-update";
|
|
13
|
-
UpdateKind["ArtifactUpdate"] = "artifact-update";
|
|
14
|
-
})(UpdateKind || (UpdateKind = {}));
|
|
15
|
-
const isMessageInHistory = (task, message) => {
|
|
16
|
-
return task.history?.find((msg) => msg.messageId === message.messageId);
|
|
17
|
-
};
|
|
18
|
-
const updateHistory = (current, updateMessage) => {
|
|
19
|
-
if (!isMessageInHistory(current.task, updateMessage)) {
|
|
20
|
-
// current.history = [...(current.history ?? []), updateMessage]; deprecating history
|
|
21
|
-
current.task.history = [...(current.task.history ?? []), updateMessage];
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export const updateMessage = async (props) => {
|
|
25
|
-
const { context, update } = props;
|
|
26
|
-
if (!update || update.kind !== UpdateKind.Message) {
|
|
27
|
-
logError("updateMessage", "Invalid update", update);
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
context.latestUserMessage = update;
|
|
31
|
-
return true;
|
|
32
|
-
};
|
|
33
|
-
export const updateTask = async (props) => {
|
|
34
|
-
const { context, current, update } = props;
|
|
35
|
-
if (!update || update.kind !== UpdateKind.Task) {
|
|
36
|
-
logError("updateTask", "Invalid update kind", update);
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
current.task = { ...current.task, ...update };
|
|
40
|
-
if (context.latestUserMessage &&
|
|
41
|
-
!isMessageInHistory(current.task, context.latestUserMessage)) {
|
|
42
|
-
//todo seems that we can use updateHistory here instead (will change after we deprecate history fully & add update specific tests)
|
|
43
|
-
current.task.history = [
|
|
44
|
-
context.latestUserMessage,
|
|
45
|
-
...(current.task.history ?? []),
|
|
46
|
-
];
|
|
47
|
-
// current.history = [context.latestUserMessage, ...(current.history ?? [])]; deprecating history
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
};
|
|
51
|
-
export const updateTaskStatusUpdate = async (props) => {
|
|
52
|
-
const { current, update } = props;
|
|
53
|
-
if (!update || update.kind !== UpdateKind.StatusUpdate) {
|
|
54
|
-
logError("updateTaskStatusUpdate", "Invalid update kind", update);
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
if (current.task.id === update.taskId) {
|
|
58
|
-
current.task.status = update.status;
|
|
59
|
-
current.task.status.timestamp = getCurrentTimestamp();
|
|
60
|
-
if (update.status.message) {
|
|
61
|
-
updateHistory(current, update.status.message);
|
|
62
|
-
}
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
logError("updateTaskStatusUpdate", "Invalid task id", update);
|
|
66
|
-
return false;
|
|
67
|
-
};
|
|
68
|
-
export const updateTaskArtifactUpdate = async (props) => {
|
|
69
|
-
const { current, update } = props;
|
|
70
|
-
if (!update || update.kind !== UpdateKind.ArtifactUpdate) {
|
|
71
|
-
logError("updateTaskArtifactUpdate", "Invalid update kind", update);
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
if (current.task.id === update.taskId) {
|
|
75
|
-
current.task.artifacts = processArtifactUpdate(update.append ?? false, current.task.artifacts ?? [], update.artifact);
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
logError("updateTaskArtifactUpdate", "Invalid task id", update); //we should never get here, but just in case
|
|
79
|
-
return true;
|
|
80
|
-
};
|
|
81
|
-
export const updateState = async (props) => {
|
|
82
|
-
const { context, current, update } = props;
|
|
83
|
-
if (!update || !update.kind) {
|
|
84
|
-
logError("update", "Invalid update", update);
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
if (!current || !current.task || !current.task.id) {
|
|
88
|
-
logError("update", "Invalid current", current);
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
if (!context || !context.contextId) {
|
|
92
|
-
logError("update", "Invalid context", context);
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
switch (update.kind) {
|
|
96
|
-
case UpdateKind.Message:
|
|
97
|
-
return updateMessage({
|
|
98
|
-
context,
|
|
99
|
-
current,
|
|
100
|
-
update: update,
|
|
101
|
-
});
|
|
102
|
-
case UpdateKind.Task:
|
|
103
|
-
return updateTask({
|
|
104
|
-
context,
|
|
105
|
-
current,
|
|
106
|
-
update: update,
|
|
107
|
-
});
|
|
108
|
-
case UpdateKind.StatusUpdate:
|
|
109
|
-
return updateTaskStatusUpdate({
|
|
110
|
-
context,
|
|
111
|
-
current,
|
|
112
|
-
update: update,
|
|
113
|
-
});
|
|
114
|
-
case UpdateKind.ArtifactUpdate:
|
|
115
|
-
return updateTaskArtifactUpdate({
|
|
116
|
-
context,
|
|
117
|
-
current,
|
|
118
|
-
update: update,
|
|
119
|
-
});
|
|
120
|
-
default:
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { ExecutionEngine, CoreState, CoreUpdate, CoreContext, CoreCommand } from "../../../types/index.js";
|
|
6
|
-
export declare const coreExecute: <TCommand extends CoreCommand = CoreCommand, TUpdate extends CoreUpdate = CoreUpdate, TState extends CoreState = CoreState, TContext extends CoreContext<TCommand, TState, TUpdate> = CoreContext<TCommand, TState, TUpdate>>(engine: ExecutionEngine<TCommand, TState, TUpdate>, context: TContext) => Promise<void>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
export const coreExecute = async (engine, context) => {
|
|
6
|
-
try {
|
|
7
|
-
if (context.events.onStart) {
|
|
8
|
-
await context.events.onStart(context);
|
|
9
|
-
}
|
|
10
|
-
for await (const update of engine(context)) {
|
|
11
|
-
if (context.isCancelled() || context.signal.aborted) {
|
|
12
|
-
await context.events.onCancel(update);
|
|
13
|
-
break;
|
|
14
|
-
}
|
|
15
|
-
await context.events.onUpdate(update);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
context.events.onError(error);
|
|
20
|
-
throw error;
|
|
21
|
-
}
|
|
22
|
-
finally {
|
|
23
|
-
context.events.onComplete();
|
|
24
|
-
}
|
|
25
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./execute.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./execute.js";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { CoreCommand, CommandChannelInterface, CommandChannelProxyInterface, CommandChannelMap } from "../../../types/index.js";
|
|
6
|
-
import { EventEmitter } from "events";
|
|
7
|
-
export declare class CommandChannel<TCommand extends CoreCommand = CoreCommand> extends EventEmitter<CommandChannelMap<TCommand>> implements CommandChannelInterface<TCommand> {
|
|
8
|
-
private readonly _command;
|
|
9
|
-
private commands;
|
|
10
|
-
private resolvers;
|
|
11
|
-
private done;
|
|
12
|
-
/**
|
|
13
|
-
* @param command - The initial command to send
|
|
14
|
-
* @note The initial command is tied to the channel and cannot be changed
|
|
15
|
-
*/
|
|
16
|
-
constructor(_command: TCommand);
|
|
17
|
-
/**
|
|
18
|
-
* @returns True if the channel is open
|
|
19
|
-
*/
|
|
20
|
-
get isOpen(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* @returns The list of commands
|
|
23
|
-
*/
|
|
24
|
-
get commandList(): TCommand[];
|
|
25
|
-
/**
|
|
26
|
-
* @returns The current command
|
|
27
|
-
*/
|
|
28
|
-
get command(): TCommand;
|
|
29
|
-
/**
|
|
30
|
-
* @returns The command channel as an async iterable
|
|
31
|
-
*/
|
|
32
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<TCommand, TCommand, TCommand | undefined>;
|
|
33
|
-
valueOf(): TCommand;
|
|
34
|
-
send(command: TCommand): void;
|
|
35
|
-
close(): void;
|
|
36
|
-
next(): Promise<IteratorResult<TCommand>>;
|
|
37
|
-
return(value: TCommand): Promise<IteratorResult<TCommand>>;
|
|
38
|
-
static create<TCommand extends CoreCommand = CoreCommand>(command: TCommand): CommandChannelProxyInterface<TCommand>;
|
|
39
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { EventEmitter } from "events";
|
|
6
|
-
import { EventManagerInterface, EventManagerOptions, CoreCommand, CoreState, CoreUpdate, CoreContext, EventManagerMap } from "../../../types/index.js";
|
|
7
|
-
export declare class EventManager<TCommand extends CoreCommand = CoreCommand, TState extends CoreState = CoreState, TUpdate extends CoreUpdate = CoreUpdate> extends EventEmitter<EventManagerMap<TCommand, TState, TUpdate>> implements EventManagerInterface<TCommand, TState, TUpdate> {
|
|
8
|
-
readonly contextId: string;
|
|
9
|
-
private currentState;
|
|
10
|
-
private options;
|
|
11
|
-
constructor(contextId: string, options?: EventManagerOptions<TCommand, TState, TUpdate>);
|
|
12
|
-
onStart: (context: CoreContext<TCommand, TState, TUpdate>) => Promise<TState>;
|
|
13
|
-
onCancel: (nextState: TUpdate) => Promise<void>;
|
|
14
|
-
onUpdate: (nextState: TUpdate) => Promise<TState>;
|
|
15
|
-
onError: (error: any) => Promise<void>;
|
|
16
|
-
onComplete: () => Promise<void>;
|
|
17
|
-
getState: () => TState;
|
|
18
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { EventEmitter } from "events";
|
|
6
|
-
export class EventManager extends EventEmitter {
|
|
7
|
-
contextId;
|
|
8
|
-
currentState = {};
|
|
9
|
-
options;
|
|
10
|
-
constructor(contextId, options = {}) {
|
|
11
|
-
super();
|
|
12
|
-
this.contextId = contextId;
|
|
13
|
-
this.options = options;
|
|
14
|
-
}
|
|
15
|
-
onStart = async (context) => {
|
|
16
|
-
if (this.options.onStart) {
|
|
17
|
-
this.currentState = await this.options.onStart(context);
|
|
18
|
-
}
|
|
19
|
-
this.emit("start", context.command, this.currentState);
|
|
20
|
-
return this.currentState;
|
|
21
|
-
};
|
|
22
|
-
onCancel = async (nextState) => {
|
|
23
|
-
if (this.options.onCancel) {
|
|
24
|
-
await this.options.onCancel(this.currentState, nextState);
|
|
25
|
-
}
|
|
26
|
-
this.emit("cancel", nextState);
|
|
27
|
-
};
|
|
28
|
-
onUpdate = async (nextState) => {
|
|
29
|
-
if (this.options.onUpdate) {
|
|
30
|
-
this.currentState = await this.options.onUpdate(this.currentState, nextState);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
this.currentState = nextState;
|
|
34
|
-
}
|
|
35
|
-
this.emit("update", this.currentState, nextState);
|
|
36
|
-
return this.currentState;
|
|
37
|
-
};
|
|
38
|
-
onError = async (error) => {
|
|
39
|
-
if (this.options.onError) {
|
|
40
|
-
await this.options.onError(this.currentState, error);
|
|
41
|
-
}
|
|
42
|
-
this.emit("error", error, this.currentState);
|
|
43
|
-
};
|
|
44
|
-
onComplete = async () => {
|
|
45
|
-
if (this.options.onComplete) {
|
|
46
|
-
await this.options.onComplete(this.currentState);
|
|
47
|
-
}
|
|
48
|
-
this.emit("complete", this.currentState);
|
|
49
|
-
};
|
|
50
|
-
getState = () => {
|
|
51
|
-
if (this.options.getState) {
|
|
52
|
-
return this.options.getState();
|
|
53
|
-
}
|
|
54
|
-
return this.currentState;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { StreamManagerInterface, ExecutionEngine, CoreContext, ServiceInterface, CoreCommand, CoreState, CoreUpdate } from "../../../types/index.js";
|
|
6
|
-
export declare class StreamManager<TCommand extends CoreCommand = CoreCommand, TState extends CoreState = CoreState, TUpdate extends CoreUpdate = CoreUpdate> implements StreamManagerInterface<TCommand, TState, TUpdate> {
|
|
7
|
-
private contextId;
|
|
8
|
-
private completed;
|
|
9
|
-
private updates;
|
|
10
|
-
private executionContext;
|
|
11
|
-
constructor(executionContext?: CoreContext<TCommand, TState, TUpdate>);
|
|
12
|
-
getContextId(): string;
|
|
13
|
-
addUpdate(update: TUpdate): void;
|
|
14
|
-
getUpdates(): TUpdate[];
|
|
15
|
-
isCompleted(): boolean;
|
|
16
|
-
setCompleted(): void;
|
|
17
|
-
getExecutionContext(): CoreContext<TCommand, TState, TUpdate>;
|
|
18
|
-
setExecutionContext(executionContext: CoreContext<TCommand, TState, TUpdate>): void;
|
|
19
|
-
stream(engine: ExecutionEngine<TCommand, TState, TUpdate>, service?: ServiceInterface<TCommand, TState, TUpdate>): AsyncGenerator<Awaited<NonNullable<TUpdate>>, void, unknown>;
|
|
20
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { coreExecute } from "../execution/execute.js";
|
|
6
|
-
export class StreamManager {
|
|
7
|
-
contextId = null;
|
|
8
|
-
completed = false;
|
|
9
|
-
updates = [];
|
|
10
|
-
executionContext = null;
|
|
11
|
-
constructor(executionContext) {
|
|
12
|
-
if (executionContext) {
|
|
13
|
-
this.executionContext = executionContext;
|
|
14
|
-
this.contextId = executionContext.events.contextId;
|
|
15
|
-
}
|
|
16
|
-
this.completed = false;
|
|
17
|
-
this.updates = [];
|
|
18
|
-
}
|
|
19
|
-
getContextId() {
|
|
20
|
-
if (!this.contextId) {
|
|
21
|
-
throw new Error("Context id not set");
|
|
22
|
-
}
|
|
23
|
-
return this.contextId;
|
|
24
|
-
}
|
|
25
|
-
addUpdate(update) {
|
|
26
|
-
this.updates.push(update);
|
|
27
|
-
}
|
|
28
|
-
getUpdates() {
|
|
29
|
-
return this.updates;
|
|
30
|
-
}
|
|
31
|
-
isCompleted() {
|
|
32
|
-
return this.completed;
|
|
33
|
-
}
|
|
34
|
-
setCompleted() {
|
|
35
|
-
this.completed = true;
|
|
36
|
-
}
|
|
37
|
-
getExecutionContext() {
|
|
38
|
-
if (!this.executionContext) {
|
|
39
|
-
throw new Error("Execution context not set");
|
|
40
|
-
}
|
|
41
|
-
return this.executionContext;
|
|
42
|
-
}
|
|
43
|
-
setExecutionContext(executionContext) {
|
|
44
|
-
this.executionContext = executionContext;
|
|
45
|
-
this.contextId = executionContext.events.contextId;
|
|
46
|
-
}
|
|
47
|
-
async *stream(engine, service) {
|
|
48
|
-
let executionError = null;
|
|
49
|
-
const context = this.getExecutionContext();
|
|
50
|
-
context.events.on("update", (_, update) => {
|
|
51
|
-
if (!context.isCancelled()) {
|
|
52
|
-
this.addUpdate(update);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
const executePromise = (service ? service.execute(engine, context) : coreExecute(engine, context))
|
|
56
|
-
.catch((error) => {
|
|
57
|
-
executionError = error;
|
|
58
|
-
})
|
|
59
|
-
.finally(() => {
|
|
60
|
-
this.setCompleted();
|
|
61
|
-
});
|
|
62
|
-
while (!this.isCompleted() || this.getUpdates().length > 0) {
|
|
63
|
-
if (executionError) {
|
|
64
|
-
throw executionError;
|
|
65
|
-
}
|
|
66
|
-
if (this.getUpdates().length > 0) {
|
|
67
|
-
yield this.getUpdates().shift();
|
|
68
|
-
}
|
|
69
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
70
|
-
}
|
|
71
|
-
await executePromise;
|
|
72
|
-
this.setCompleted();
|
|
73
|
-
if (executionError) {
|
|
74
|
-
throw executionError;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
package/dist/types/ext.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* For artinet specific conventions
|
|
7
|
-
* AgentInfo will expand to incorporate additional details required from other protocols
|
|
8
|
-
* (e.g. AgentFAQ(NANDA), AgentCard(A2A), etc.)
|
|
9
|
-
*/
|
|
10
|
-
export { AgentCardSchema as AgentInfoSchema } from "./schemas/a2a/index.js";
|
|
11
|
-
export type { AgentCard as AgentInfo } from "./schemas/a2a/index.js";
|
|
12
|
-
export type { A2AEngine as AgentEngine } from "./interfaces/services/a2a/index.js";
|
|
13
|
-
export type { A2AServiceInterface as Agent } from "./interfaces/services/a2a/index.js";
|
package/dist/types/ext.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* For artinet specific conventions
|
|
7
|
-
* AgentInfo will expand to incorporate additional details required from other protocols
|
|
8
|
-
* (e.g. AgentFAQ(NANDA), AgentCard(A2A), etc.)
|
|
9
|
-
*/
|
|
10
|
-
export { AgentCardSchema as AgentInfoSchema } from "./schemas/a2a/index.js";
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 The Artinet Project
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { Context, Command, TextPart, DataPart, FilePart } from "../../../index.js";
|
|
6
|
-
/**
|
|
7
|
-
* Restricting to command for now, but could be extended to other types of commands in the future.
|
|
8
|
-
* When we shift to CoreCommand, move this into core.
|
|
9
|
-
*/
|
|
10
|
-
export interface StepArgs<TCommand extends Command = Command> {
|
|
11
|
-
command: TCommand;
|
|
12
|
-
context: Context;
|
|
13
|
-
}
|
|
14
|
-
export type StepParams<TCommand extends Command = Command, TInboundArgs extends readonly unknown[] = []> = StepArgs<TCommand> & Partial<{
|
|
15
|
-
content: string;
|
|
16
|
-
args: TInboundArgs;
|
|
17
|
-
}>;
|
|
18
|
-
export type StepOutput<TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"]> = {
|
|
19
|
-
parts: Array<TPart> | TPart;
|
|
20
|
-
};
|
|
21
|
-
export type StepOutputWithForwardArgs<TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"], TForwardArgs extends readonly unknown[] = []> = StepOutput<TPart> & {
|
|
22
|
-
args: TForwardArgs;
|
|
23
|
-
};
|
|
24
|
-
export type Step<TCommand extends Command = Command, TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"] = TextPart["text"], TInboundArgs extends readonly unknown[] = [], TForwardArgs extends readonly unknown[] = [], TOutput extends StepOutput<TPart> | StepOutputWithForwardArgs<TPart, TForwardArgs> | Array<TPart> | TPart = StepOutput<TPart>> = (params: StepParams<TCommand, TInboundArgs>) => Promise<TOutput> | TOutput;
|
|
25
|
-
export type StepWithKind<TCommand extends Command = Command, TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"] = TextPart["text"], TInboundArgs extends readonly unknown[] = [], TForwardArgs extends readonly unknown[] = [], TOutput extends StepOutput<TPart> | StepOutputWithForwardArgs<TPart, TForwardArgs> | Array<TPart> | TPart = StepOutput<TPart>, TKind extends "text" | "file" | "data" = "text"> = {
|
|
26
|
-
step: Step<TCommand, TPart, TInboundArgs, TForwardArgs, TOutput>;
|
|
27
|
-
kind: TKind;
|
|
28
|
-
};
|
|
29
|
-
export type OutArgsOf<O> = O extends StepOutputWithForwardArgs<any, infer A> ? A : [];
|
|
30
|
-
export interface StepBuilder<TCommand extends Command = Command, TInboundArgs extends readonly unknown[] = []> {
|
|
31
|
-
/**
|
|
32
|
-
* Add a step to the builder.
|
|
33
|
-
* @param step - The step to add.
|
|
34
|
-
* @returns A new builder with the step added.
|
|
35
|
-
*/
|
|
36
|
-
addStep<TPart extends DataPart["data"] | FilePart["file"] | TextPart["text"] = TextPart["text"], TForwardArgs extends readonly unknown[] = [], TOutput extends StepOutput<TPart> | StepOutputWithForwardArgs<TPart, TForwardArgs> | Array<TPart> | TPart = StepOutput<TPart>, TKind extends "text" | "file" | "data" = "text">(step: StepWithKind<TCommand, TPart, TInboundArgs, TForwardArgs, TOutput, TKind>): StepBuilder<TCommand, OutArgsOf<TOutput>>;
|
|
37
|
-
}
|