@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
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { AgentCard, Message, Task, AgentExtension, TaskQueryParams, TaskIdParams, MessageSendParams, SendMessageSuccessResult } from "@artinet/types/a2a";
|
|
6
|
+
import { core } from "../core/index.js";
|
|
7
|
+
import { z } from "zod/v4";
|
|
8
|
+
export type AgentCardParams = (Partial<AgentCard> & Required<Pick<AgentCard, "name">>) | string;
|
|
9
|
+
export declare const UpdateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
10
|
+
role: z.ZodEnum<{
|
|
11
|
+
user: "user";
|
|
12
|
+
agent: "agent";
|
|
13
|
+
}>;
|
|
14
|
+
parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
16
|
+
kind: z.ZodLiteral<"text">;
|
|
17
|
+
text: z.ZodString;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
|
+
kind: z.ZodLiteral<"file">;
|
|
21
|
+
file: z.ZodUnion<readonly [z.ZodObject<{
|
|
22
|
+
name: z.ZodOptional<z.ZodString>;
|
|
23
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
24
|
+
bytes: z.ZodString;
|
|
25
|
+
uri: z.ZodOptional<z.ZodNever>;
|
|
26
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
name: z.ZodOptional<z.ZodString>;
|
|
28
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
29
|
+
uri: z.ZodString;
|
|
30
|
+
bytes: z.ZodOptional<z.ZodNever>;
|
|
31
|
+
}, z.core.$strip>]>;
|
|
32
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
34
|
+
kind: z.ZodLiteral<"data">;
|
|
35
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
36
|
+
}, z.core.$strip>]>>;
|
|
37
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
39
|
+
referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
messageId: z.ZodString;
|
|
41
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
42
|
+
contextId: z.ZodOptional<z.ZodString>;
|
|
43
|
+
kind: z.ZodLiteral<"message">;
|
|
44
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
contextId: z.ZodString;
|
|
47
|
+
status: z.ZodObject<{
|
|
48
|
+
state: z.ZodEnum<{
|
|
49
|
+
failed: "failed";
|
|
50
|
+
unknown: "unknown";
|
|
51
|
+
completed: "completed";
|
|
52
|
+
canceled: "canceled";
|
|
53
|
+
rejected: "rejected";
|
|
54
|
+
working: "working";
|
|
55
|
+
submitted: "submitted";
|
|
56
|
+
"input-required": "input-required";
|
|
57
|
+
"auth-required": "auth-required";
|
|
58
|
+
}>;
|
|
59
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
role: z.ZodEnum<{
|
|
61
|
+
user: "user";
|
|
62
|
+
agent: "agent";
|
|
63
|
+
}>;
|
|
64
|
+
parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
65
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
66
|
+
kind: z.ZodLiteral<"text">;
|
|
67
|
+
text: z.ZodString;
|
|
68
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
70
|
+
kind: z.ZodLiteral<"file">;
|
|
71
|
+
file: z.ZodUnion<readonly [z.ZodObject<{
|
|
72
|
+
name: z.ZodOptional<z.ZodString>;
|
|
73
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
74
|
+
bytes: z.ZodString;
|
|
75
|
+
uri: z.ZodOptional<z.ZodNever>;
|
|
76
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
77
|
+
name: z.ZodOptional<z.ZodString>;
|
|
78
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
79
|
+
uri: z.ZodString;
|
|
80
|
+
bytes: z.ZodOptional<z.ZodNever>;
|
|
81
|
+
}, z.core.$strip>]>;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
84
|
+
kind: z.ZodLiteral<"data">;
|
|
85
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
86
|
+
}, z.core.$strip>]>>;
|
|
87
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
88
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
+
referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
+
messageId: z.ZodString;
|
|
91
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
92
|
+
contextId: z.ZodOptional<z.ZodString>;
|
|
93
|
+
kind: z.ZodLiteral<"message">;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
timestamp: z.ZodOptional<z.ZodISODateTime>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
history: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
98
|
+
role: z.ZodEnum<{
|
|
99
|
+
user: "user";
|
|
100
|
+
agent: "agent";
|
|
101
|
+
}>;
|
|
102
|
+
parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
103
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
104
|
+
kind: z.ZodLiteral<"text">;
|
|
105
|
+
text: z.ZodString;
|
|
106
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
107
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
108
|
+
kind: z.ZodLiteral<"file">;
|
|
109
|
+
file: z.ZodUnion<readonly [z.ZodObject<{
|
|
110
|
+
name: z.ZodOptional<z.ZodString>;
|
|
111
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
112
|
+
bytes: z.ZodString;
|
|
113
|
+
uri: z.ZodOptional<z.ZodNever>;
|
|
114
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
+
name: z.ZodOptional<z.ZodString>;
|
|
116
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
117
|
+
uri: z.ZodString;
|
|
118
|
+
bytes: z.ZodOptional<z.ZodNever>;
|
|
119
|
+
}, z.core.$strip>]>;
|
|
120
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
121
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
122
|
+
kind: z.ZodLiteral<"data">;
|
|
123
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
124
|
+
}, z.core.$strip>]>>;
|
|
125
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
126
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
127
|
+
referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
128
|
+
messageId: z.ZodString;
|
|
129
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
130
|
+
contextId: z.ZodOptional<z.ZodString>;
|
|
131
|
+
kind: z.ZodLiteral<"message">;
|
|
132
|
+
}, z.core.$strip>>>;
|
|
133
|
+
artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
134
|
+
artifactId: z.ZodString;
|
|
135
|
+
name: z.ZodOptional<z.ZodString>;
|
|
136
|
+
description: z.ZodOptional<z.ZodString>;
|
|
137
|
+
parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
138
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
139
|
+
kind: z.ZodLiteral<"text">;
|
|
140
|
+
text: z.ZodString;
|
|
141
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
143
|
+
kind: z.ZodLiteral<"file">;
|
|
144
|
+
file: z.ZodUnion<readonly [z.ZodObject<{
|
|
145
|
+
name: z.ZodOptional<z.ZodString>;
|
|
146
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
147
|
+
bytes: z.ZodString;
|
|
148
|
+
uri: z.ZodOptional<z.ZodNever>;
|
|
149
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
150
|
+
name: z.ZodOptional<z.ZodString>;
|
|
151
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
152
|
+
uri: z.ZodString;
|
|
153
|
+
bytes: z.ZodOptional<z.ZodNever>;
|
|
154
|
+
}, z.core.$strip>]>;
|
|
155
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
156
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
157
|
+
kind: z.ZodLiteral<"data">;
|
|
158
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
159
|
+
}, z.core.$strip>]>>;
|
|
160
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
161
|
+
extension: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
162
|
+
}, z.core.$strip>>>;
|
|
163
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
164
|
+
kind: z.ZodLiteral<"task">;
|
|
165
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
166
|
+
taskId: z.ZodString;
|
|
167
|
+
contextId: z.ZodString;
|
|
168
|
+
kind: z.ZodLiteral<"status-update">;
|
|
169
|
+
status: z.ZodObject<{
|
|
170
|
+
state: z.ZodEnum<{
|
|
171
|
+
failed: "failed";
|
|
172
|
+
unknown: "unknown";
|
|
173
|
+
completed: "completed";
|
|
174
|
+
canceled: "canceled";
|
|
175
|
+
rejected: "rejected";
|
|
176
|
+
working: "working";
|
|
177
|
+
submitted: "submitted";
|
|
178
|
+
"input-required": "input-required";
|
|
179
|
+
"auth-required": "auth-required";
|
|
180
|
+
}>;
|
|
181
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
182
|
+
role: z.ZodEnum<{
|
|
183
|
+
user: "user";
|
|
184
|
+
agent: "agent";
|
|
185
|
+
}>;
|
|
186
|
+
parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
187
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
188
|
+
kind: z.ZodLiteral<"text">;
|
|
189
|
+
text: z.ZodString;
|
|
190
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
191
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
192
|
+
kind: z.ZodLiteral<"file">;
|
|
193
|
+
file: z.ZodUnion<readonly [z.ZodObject<{
|
|
194
|
+
name: z.ZodOptional<z.ZodString>;
|
|
195
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
196
|
+
bytes: z.ZodString;
|
|
197
|
+
uri: z.ZodOptional<z.ZodNever>;
|
|
198
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
199
|
+
name: z.ZodOptional<z.ZodString>;
|
|
200
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
201
|
+
uri: z.ZodString;
|
|
202
|
+
bytes: z.ZodOptional<z.ZodNever>;
|
|
203
|
+
}, z.core.$strip>]>;
|
|
204
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
205
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
206
|
+
kind: z.ZodLiteral<"data">;
|
|
207
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
208
|
+
}, z.core.$strip>]>>;
|
|
209
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
210
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
211
|
+
referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
212
|
+
messageId: z.ZodString;
|
|
213
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
214
|
+
contextId: z.ZodOptional<z.ZodString>;
|
|
215
|
+
kind: z.ZodLiteral<"message">;
|
|
216
|
+
}, z.core.$strip>>;
|
|
217
|
+
timestamp: z.ZodOptional<z.ZodISODateTime>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
final: z.ZodBoolean;
|
|
220
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
221
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
222
|
+
taskId: z.ZodString;
|
|
223
|
+
contextId: z.ZodString;
|
|
224
|
+
kind: z.ZodLiteral<"artifact-update">;
|
|
225
|
+
artifact: z.ZodObject<{
|
|
226
|
+
artifactId: z.ZodString;
|
|
227
|
+
name: z.ZodOptional<z.ZodString>;
|
|
228
|
+
description: z.ZodOptional<z.ZodString>;
|
|
229
|
+
parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
230
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
231
|
+
kind: z.ZodLiteral<"text">;
|
|
232
|
+
text: z.ZodString;
|
|
233
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
234
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
235
|
+
kind: z.ZodLiteral<"file">;
|
|
236
|
+
file: z.ZodUnion<readonly [z.ZodObject<{
|
|
237
|
+
name: z.ZodOptional<z.ZodString>;
|
|
238
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
239
|
+
bytes: z.ZodString;
|
|
240
|
+
uri: z.ZodOptional<z.ZodNever>;
|
|
241
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
242
|
+
name: z.ZodOptional<z.ZodString>;
|
|
243
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
244
|
+
uri: z.ZodString;
|
|
245
|
+
bytes: z.ZodOptional<z.ZodNever>;
|
|
246
|
+
}, z.core.$strip>]>;
|
|
247
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
248
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
249
|
+
kind: z.ZodLiteral<"data">;
|
|
250
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
251
|
+
}, z.core.$strip>]>>;
|
|
252
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
253
|
+
extension: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
append: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
lastChunk: z.ZodOptional<z.ZodBoolean>;
|
|
257
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
258
|
+
}, z.core.$strip>]>;
|
|
259
|
+
export type Update = z.output<typeof UpdateSchema>;
|
|
260
|
+
export type Engine = (context: Context) => AsyncGenerator<Update, void, unknown>;
|
|
261
|
+
export interface BaseContext extends core.Context<Task> {
|
|
262
|
+
readonly service: Service;
|
|
263
|
+
/**
|
|
264
|
+
* Considering ommit OnStart & OnComplete from Context consumers.
|
|
265
|
+
* That way the user cannot inadvertently trigger a start/completion out of band.
|
|
266
|
+
*/
|
|
267
|
+
readonly publisher: EventPublisher;
|
|
268
|
+
}
|
|
269
|
+
export interface Context extends BaseContext {
|
|
270
|
+
readonly taskId: string;
|
|
271
|
+
readonly userMessage: Message;
|
|
272
|
+
readonly messages: MessageConsumerProxy;
|
|
273
|
+
extensions?: AgentExtension[];
|
|
274
|
+
references?: Task[];
|
|
275
|
+
getTask: () => Promise<Task>;
|
|
276
|
+
}
|
|
277
|
+
export type ContextParams = Omit<BaseContext, "publisher" | "isCancelled" | "getState" | "abortSignal"> & Omit<Partial<Context>, "userMessage" | "taskId"> & {
|
|
278
|
+
messenger: MessageConsumerProxy;
|
|
279
|
+
task: Task;
|
|
280
|
+
overrides?: Partial<Omit<EventConsumer, "contextId">>;
|
|
281
|
+
abortSignal?: AbortSignal;
|
|
282
|
+
};
|
|
283
|
+
export interface Contexts extends core.Contexts<Context> {
|
|
284
|
+
create: (params: ContextParams) => Promise<Context>;
|
|
285
|
+
list: () => Promise<Context[]>;
|
|
286
|
+
}
|
|
287
|
+
export interface Tasks extends core.Manager<Task> {
|
|
288
|
+
update: (context: Context, update: Update) => Promise<Task>;
|
|
289
|
+
create: (params: Partial<Task>) => Promise<Task>;
|
|
290
|
+
has: (id: string) => Promise<boolean>;
|
|
291
|
+
}
|
|
292
|
+
export interface Cancellations extends Omit<core.Manager<void>, "get"> {
|
|
293
|
+
has: (id: string) => Promise<boolean>;
|
|
294
|
+
}
|
|
295
|
+
export interface Connections extends Omit<core.Manager<void>, "get"> {
|
|
296
|
+
}
|
|
297
|
+
export interface ServiceOptions {
|
|
298
|
+
abortSignal?: AbortSignal;
|
|
299
|
+
}
|
|
300
|
+
export interface RequestHandler {
|
|
301
|
+
getTask: (input: TaskQueryParams, context?: Context, options?: ServiceOptions) => Promise<Task>;
|
|
302
|
+
cancelTask: (input: TaskIdParams, context?: Context, options?: ServiceOptions) => Promise<Task>;
|
|
303
|
+
sendMessage: (message: MessageSendParams, context?: Context, options?: ServiceOptions) => Promise<SendMessageSuccessResult>;
|
|
304
|
+
streamMessage: (message: MessageSendParams, context?: Context, options?: ServiceOptions) => AsyncGenerator<Update>;
|
|
305
|
+
resubscribe: (input: TaskIdParams, context?: Context, options?: ServiceOptions) => AsyncGenerator<Update>;
|
|
306
|
+
getAgentCard: () => Promise<AgentCard>;
|
|
307
|
+
}
|
|
308
|
+
export interface ExtendedHandler extends RequestHandler {
|
|
309
|
+
getAuthenticatedExtendedCard: () => Promise<AgentCard>;
|
|
310
|
+
}
|
|
311
|
+
export interface Stream {
|
|
312
|
+
readonly contextId: string;
|
|
313
|
+
isAlive: boolean;
|
|
314
|
+
kill: () => Promise<void>;
|
|
315
|
+
updates: Update[];
|
|
316
|
+
context: Context;
|
|
317
|
+
run: (params: {
|
|
318
|
+
service: Service;
|
|
319
|
+
}) => AsyncGenerator<Update>;
|
|
320
|
+
subscribe: () => AsyncGenerator<Update>;
|
|
321
|
+
}
|
|
322
|
+
export interface Streams extends Omit<core.Manager<Stream>, "set"> {
|
|
323
|
+
create: (params: core.Optional<Stream> & {
|
|
324
|
+
context: Context;
|
|
325
|
+
}) => Promise<Stream>;
|
|
326
|
+
has: (id: string) => Promise<boolean>;
|
|
327
|
+
}
|
|
328
|
+
export interface Service extends core.Service<{
|
|
329
|
+
engine: Engine;
|
|
330
|
+
context: Context;
|
|
331
|
+
}>, RequestHandler {
|
|
332
|
+
readonly events?: Events;
|
|
333
|
+
readonly connections: Connections;
|
|
334
|
+
readonly cancellations: Cancellations;
|
|
335
|
+
readonly tasks: Tasks;
|
|
336
|
+
readonly contexts: Contexts;
|
|
337
|
+
readonly streams: Streams;
|
|
338
|
+
engine: Engine;
|
|
339
|
+
agentCard: AgentCard;
|
|
340
|
+
}
|
|
341
|
+
export interface MessageProducer {
|
|
342
|
+
isOpen: boolean;
|
|
343
|
+
send: (message: MessageSendParams) => Promise<void>;
|
|
344
|
+
}
|
|
345
|
+
export type MessageMap = {
|
|
346
|
+
message: [MessageSendParams];
|
|
347
|
+
close: [];
|
|
348
|
+
};
|
|
349
|
+
export interface MessageConsumer extends core.Consumer<MessageSendParams, MessageMap> {
|
|
350
|
+
message: MessageSendParams;
|
|
351
|
+
messages: MessageSendParams[];
|
|
352
|
+
close: () => Promise<void>;
|
|
353
|
+
next: () => Promise<IteratorResult<MessageSendParams>>;
|
|
354
|
+
return: (value: MessageSendParams) => Promise<IteratorResult<MessageSendParams>>;
|
|
355
|
+
}
|
|
356
|
+
export type MessageConsumerProxy = MessageConsumer & MessageSendParams;
|
|
357
|
+
export interface EventConsumer {
|
|
358
|
+
readonly contextId: string;
|
|
359
|
+
readonly onStart?: (context: Context) => Promise<Task>;
|
|
360
|
+
readonly onCancel: (update: Update, current: Task) => Promise<void>;
|
|
361
|
+
readonly onUpdate: (update: Update, current: Task) => Promise<Task>;
|
|
362
|
+
readonly onError: (error: any, current: Task) => Promise<void>;
|
|
363
|
+
onComplete: (current: Task) => Promise<void>;
|
|
364
|
+
}
|
|
365
|
+
export type Emissions = {
|
|
366
|
+
start: [MessageSendParams, Task];
|
|
367
|
+
cancel: [Update];
|
|
368
|
+
update: [Task, Update];
|
|
369
|
+
error: [any, Task];
|
|
370
|
+
complete: [Task];
|
|
371
|
+
};
|
|
372
|
+
export interface EventPublisher extends Omit<EventConsumer, "onComplete" | "onCancel" | "onError" | "onUpdate">, core.Publisher<Emissions> {
|
|
373
|
+
readonly onStart?: (context: Context) => Promise<Task>;
|
|
374
|
+
readonly onCancel: (update: Update) => Promise<void>;
|
|
375
|
+
readonly onUpdate: (update: Update) => Promise<Task>;
|
|
376
|
+
readonly onError: (error: any) => Promise<void>;
|
|
377
|
+
onComplete: () => Promise<void>;
|
|
378
|
+
}
|
|
379
|
+
export interface Events extends core.Manager<EventPublisher> {
|
|
380
|
+
create: (params: core.Optional<EventPublisher>) => Promise<EventPublisher>;
|
|
381
|
+
}
|
|
382
|
+
export * from "@artinet/types/a2a";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
//lets stay really granular with the imports
|
|
6
|
+
import { TaskArtifactUpdateEventSchema, MessageSchema, TaskSchema, TaskStatusUpdateEventSchema, } from "@artinet/types/a2a";
|
|
7
|
+
import { z } from "zod/v4";
|
|
8
|
+
export const UpdateSchema = z.discriminatedUnion("kind", [
|
|
9
|
+
MessageSchema,
|
|
10
|
+
TaskSchema,
|
|
11
|
+
TaskStatusUpdateEventSchema,
|
|
12
|
+
TaskArtifactUpdateEventSchema,
|
|
13
|
+
]);
|
|
14
|
+
export * from "@artinet/types/a2a";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as A2A from "./a2a.js";
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* Copyright 2025 The Artinet Project
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import type { AgentCard, TaskQueryParams, MessageSendParams, Message } from "../schemas/a2a/index.js";
|
|
7
|
-
import { UpdateEvent } from "./services/a2a/index.js";
|
|
5
|
+
import { A2A } from "./a2a/index.js";
|
|
8
6
|
/**
|
|
9
7
|
* @interface Client
|
|
10
8
|
* @description Defines the standard contract for an A2A (Agent-to-Agent) client implementation.
|
|
@@ -19,24 +17,24 @@ export interface Client {
|
|
|
19
17
|
* The AgentCard contains essential information about the agent, such as its capabilities and endpoints.
|
|
20
18
|
* @param {string} wellKnownPath The standard path (e.g., "/.well-known/a2a") to look for the AgentCard.
|
|
21
19
|
* @param {string} fallbackPath An alternative path to check if the well-known path fails.
|
|
22
|
-
* @returns {Promise<AgentCard>} A promise that resolves with the AgentCard object.
|
|
20
|
+
* @returns {Promise<A2A.AgentCard>} A promise that resolves with the AgentCard object.
|
|
23
21
|
* @async
|
|
24
22
|
*/
|
|
25
|
-
agentCard(): Promise<AgentCard>;
|
|
23
|
+
agentCard(): Promise<A2A.AgentCard>;
|
|
26
24
|
/**
|
|
27
25
|
* @description Refreshes the cached AgentCard information by re-fetching it from the server.
|
|
28
26
|
* Useful when the agent's capabilities or configuration might have changed.
|
|
29
|
-
* @returns {Promise<AgentCard>} A promise that resolves with the updated AgentCard object.
|
|
27
|
+
* @returns {Promise<A2A.AgentCard>} A promise that resolves with the updated AgentCard object.
|
|
30
28
|
* @async
|
|
31
29
|
*/
|
|
32
|
-
refreshAgentCard(): Promise<AgentCard>;
|
|
30
|
+
refreshAgentCard(): Promise<A2A.AgentCard>;
|
|
33
31
|
/**
|
|
34
32
|
* @description Sends a task request to the agent server.
|
|
35
|
-
* @param {MessageSendParams} params Parameters required to send the task, including the task definition and metadata.
|
|
36
|
-
* @returns {Promise<Task | null>} A promise that resolves with the initial Task object representing the submitted task, or null if the submission failed.
|
|
33
|
+
* @param {A2A.MessageSendParams} params Parameters required to send the task, including the task definition and metadata.
|
|
34
|
+
* @returns {Promise<A2A.Task | null>} A promise that resolves with the initial Task object representing the submitted task, or null if the submission failed.
|
|
37
35
|
* @async
|
|
38
36
|
*/
|
|
39
|
-
sendMessage(params: MessageSendParams): Promise<Message | Task | null>;
|
|
37
|
+
sendMessage(params: A2A.MessageSendParams): Promise<A2A.Message | A2A.Task | null>;
|
|
40
38
|
/**
|
|
41
39
|
* @deprecated Will be removed in v6.Use sendMessage instead.
|
|
42
40
|
* @description Sends a task request to the agent server.
|
|
@@ -44,7 +42,7 @@ export interface Client {
|
|
|
44
42
|
* @returns {Promise<Task | null>} A promise that resolves with the initial Task object representing the submitted task, or null if the submission failed.
|
|
45
43
|
* @async
|
|
46
44
|
*/
|
|
47
|
-
sendTask(params: MessageSendParams): Promise<Message | Task | null>;
|
|
45
|
+
sendTask(params: A2A.MessageSendParams): Promise<A2A.Message | A2A.Task | null>;
|
|
48
46
|
/**
|
|
49
47
|
* @description Sends a task request and subscribes to real-time updates (status changes, artifact updates) for that task.
|
|
50
48
|
* This uses a streaming connection if available.
|
|
@@ -52,7 +50,7 @@ export interface Client {
|
|
|
52
50
|
* @returns {AsyncIterable<UpdateEvent>} An async iterable that yields task status and artifact updates.
|
|
53
51
|
* @async
|
|
54
52
|
*/
|
|
55
|
-
sendStreamingMessage(params: MessageSendParams): AsyncIterable<
|
|
53
|
+
sendStreamingMessage(params: A2A.MessageSendParams): AsyncIterable<A2A.Update>;
|
|
56
54
|
/**
|
|
57
55
|
* @deprecated Will be removed in v6Use sendStreamingMessage instead.
|
|
58
56
|
* @description Sends a task request and subscribes to real-time updates (status changes, artifact updates) for that task.
|
|
@@ -61,45 +59,45 @@ export interface Client {
|
|
|
61
59
|
* @returns {AsyncIterable<UpdateEvent>} An async iterable that yields task status and artifact updates.
|
|
62
60
|
* @async
|
|
63
61
|
*/
|
|
64
|
-
sendTaskSubscribe(params: MessageSendParams): AsyncIterable<
|
|
62
|
+
sendTaskSubscribe(params: A2A.MessageSendParams): AsyncIterable<A2A.Update>;
|
|
65
63
|
/**
|
|
66
64
|
* @description Retrieves the current state of a specific task by its ID.
|
|
67
|
-
* @param {TaskQueryParams} params Parameters containing the task ID to query.
|
|
68
|
-
* @returns {Promise<Task | null>} A promise that resolves with the Task object, or null if the task is not found.
|
|
65
|
+
* @param {A2A.TaskQueryParams} params Parameters containing the task ID to query.
|
|
66
|
+
* @returns {Promise<A2A.Task | null>} A promise that resolves with the Task object, or null if the task is not found.
|
|
69
67
|
* @async
|
|
70
68
|
*/
|
|
71
|
-
getTask(params: TaskQueryParams): Promise<Task | null>;
|
|
69
|
+
getTask(params: A2A.TaskQueryParams): Promise<A2A.Task | null>;
|
|
72
70
|
/**
|
|
73
71
|
* @description Sends a request to cancel an ongoing task.
|
|
74
|
-
* @param {TaskIdParams} params Parameters containing the ID of the task to cancel.
|
|
75
|
-
* @returns {Promise<Task | null>} A promise that resolves with the final state of the cancelled Task object, or null if cancellation failed or the task wasn't found.
|
|
72
|
+
* @param {A2A.TaskIdParams} params Parameters containing the ID of the task to cancel.
|
|
73
|
+
* @returns {Promise<A2A.Task | null>} A promise that resolves with the final state of the cancelled Task object, or null if cancellation failed or the task wasn't found.
|
|
76
74
|
* @async
|
|
77
75
|
*/
|
|
78
|
-
cancelTask(params: TaskIdParams): Promise<Task | null>;
|
|
76
|
+
cancelTask(params: A2A.TaskIdParams): Promise<A2A.Task | null>;
|
|
79
77
|
/**
|
|
80
78
|
* @description Configures push notifications for a specific task. This allows the client
|
|
81
79
|
* to receive updates asynchronously via a specified webhook URL.
|
|
82
80
|
* Requires the agent to support the 'pushNotifications' capability.
|
|
83
|
-
* @param {TaskPushNotificationConfig} params The configuration details for the push notification, including the task ID and webhook URL.
|
|
84
|
-
* @returns {Promise<TaskPushNotificationConfig | null>} A promise that resolves with the applied configuration, or null if the configuration failed.
|
|
81
|
+
* @param {A2A.TaskPushNotificationConfig} params The configuration details for the push notification, including the task ID and webhook URL.
|
|
82
|
+
* @returns {Promise<A2A.TaskPushNotificationConfig | null>} A promise that resolves with the applied configuration, or null if the configuration failed.
|
|
85
83
|
* @async
|
|
86
84
|
*/
|
|
87
|
-
setTaskPushNotification(params: TaskPushNotificationConfig): Promise<TaskPushNotificationConfig | null>;
|
|
85
|
+
setTaskPushNotification(params: A2A.TaskPushNotificationConfig): Promise<A2A.TaskPushNotificationConfig | null>;
|
|
88
86
|
/**
|
|
89
87
|
* @description Retrieves the current push notification configuration for a specific task.
|
|
90
|
-
* @param {TaskIdParams} params Parameters containing the task ID.
|
|
91
|
-
* @returns {Promise<TaskPushNotificationConfig | null>} A promise that resolves with the push notification configuration, or null if not configured or not found.
|
|
88
|
+
* @param {A2A.TaskIdParams} params Parameters containing the task ID.
|
|
89
|
+
* @returns {Promise<A2A.TaskPushNotificationConfig | null>} A promise that resolves with the push notification configuration, or null if not configured or not found.
|
|
92
90
|
* @async
|
|
93
91
|
*/
|
|
94
|
-
getTaskPushNotification(params: TaskIdParams): Promise<TaskPushNotificationConfig | null>;
|
|
92
|
+
getTaskPushNotification(params: A2A.TaskIdParams): Promise<A2A.TaskPushNotificationConfig | null>;
|
|
95
93
|
/**
|
|
96
94
|
* @description Resubscribes to updates for an existing task, potentially after a connection drop or client restart.
|
|
97
95
|
* This allows resuming the stream of status and artifact updates.
|
|
98
|
-
* @param {TaskQueryParams} params Parameters containing the task ID to resubscribe to.
|
|
96
|
+
* @param {A2A.TaskQueryParams} params Parameters containing the task ID to resubscribe to.
|
|
99
97
|
* @returns {AsyncIterable<UpdateEvent>} An async iterable that yields task status and artifact updates.
|
|
100
98
|
* @async
|
|
101
99
|
*/
|
|
102
|
-
resubscribeTask(params: TaskQueryParams): AsyncIterable<
|
|
100
|
+
resubscribeTask(params: A2A.TaskQueryParams): AsyncIterable<A2A.Update>;
|
|
103
101
|
/**
|
|
104
102
|
* @description Checks if the agent server supports a specific capability.
|
|
105
103
|
* @param {"streaming" | "pushNotifications" | "stateTransitionHistory"} capability The capability to check for.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EventEmitter } from "events";
|
|
2
|
+
export interface Service<Params extends object = object, Result extends unknown = void> {
|
|
3
|
+
execute: (params: Params) => Promise<Result>;
|
|
4
|
+
stop: () => Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export interface Context<State extends object = object> {
|
|
7
|
+
readonly contextId: string;
|
|
8
|
+
readonly isCancelled: () => Promise<boolean>;
|
|
9
|
+
readonly abortSignal: AbortSignal;
|
|
10
|
+
readonly messages?: AsyncIterable<unknown>;
|
|
11
|
+
readonly publisher?: Publisher;
|
|
12
|
+
readonly getState: (args?: string) => Promise<State | undefined>;
|
|
13
|
+
metadata?: Record<string, unknown>;
|
|
14
|
+
readonly hooks?: Record<string, (...args: unknown[]) => Promise<unknown>>;
|
|
15
|
+
}
|
|
16
|
+
export interface Manager<T = object> {
|
|
17
|
+
get: (id: string) => Promise<T | undefined>;
|
|
18
|
+
set: (id: string, data?: T) => Promise<void>;
|
|
19
|
+
delete: (id: string) => Promise<void>;
|
|
20
|
+
has?: (id: string) => Promise<boolean>;
|
|
21
|
+
list?: () => Promise<T[]>;
|
|
22
|
+
}
|
|
23
|
+
export type Optional<T extends object = object> = Partial<T> & {
|
|
24
|
+
contextId: string;
|
|
25
|
+
};
|
|
26
|
+
export interface Contexts<T extends Context = Context> extends Manager<T> {
|
|
27
|
+
}
|
|
28
|
+
export interface Publisher<EventMap extends Record<string, any[]> = Record<string, any[]>> extends EventEmitter<EventMap> {
|
|
29
|
+
}
|
|
30
|
+
export interface Consumer<Received extends unknown, EventMap extends Record<string, any[]> = Record<string, any[]>> extends AsyncIterable<Received, Received, Received | undefined>, Publisher<EventMap> {
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as core from "./core.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as core from "./core.js";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
1
|
+
export * from "./a2a/index.js";
|
|
2
|
+
export * from "./core/index.js";
|
|
3
|
+
export * from "./mcp/index.js";
|
|
4
|
+
export * from "./client.js";
|
|
5
|
+
export * from "./protocol.js";
|
|
6
|
+
export * from "./storage.js";
|
|
4
7
|
export * from "./utils/index.js";
|
package/dist/types/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
1
|
+
export * from "./a2a/index.js";
|
|
2
|
+
export * from "./core/index.js";
|
|
3
|
+
export * from "./mcp/index.js";
|
|
4
|
+
export * from "./client.js";
|
|
5
|
+
export * from "./protocol.js";
|
|
6
|
+
export * from "./storage.js";
|
|
4
7
|
export * from "./utils/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as MCP from "./mcp.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as MCP from "./mcp.js";
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
* managing service lifecycle.
|
|
11
11
|
*
|
|
12
12
|
* @module MCPService
|
|
13
|
-
* @version 0.
|
|
13
|
+
* @version 0.6.0-preview
|
|
14
14
|
* @since 0.5.7
|
|
15
15
|
* @author The Artinet Project
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import { core } from "../core/index.js";
|
|
18
18
|
/**
|
|
19
19
|
* Main interface for MCP service implementations.
|
|
20
20
|
*
|
|
@@ -40,10 +40,11 @@ import { ServiceInterface } from "../core/index.js";
|
|
|
40
40
|
* @public
|
|
41
41
|
* @since 0.5.7
|
|
42
42
|
*/
|
|
43
|
-
export interface
|
|
43
|
+
export interface Service extends Omit<core.Service, "execute"> {
|
|
44
44
|
/**
|
|
45
45
|
* Registers tools for the MCP service.
|
|
46
46
|
* @param uri - The URI of the agent card resource.
|
|
47
47
|
*/
|
|
48
48
|
registerTools?: (uri: string) => void;
|
|
49
49
|
}
|
|
50
|
+
export * from "@artinet/types/mcp";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Interface for a store of data.
|
|
7
|
+
* @deprecated Use IStore instead
|
|
8
|
+
* @template T - The type of data to store
|
|
9
|
+
*/
|
|
10
|
+
export interface Store<T> {
|
|
11
|
+
set(data: T, id?: string): Promise<void>;
|
|
12
|
+
get(id: string): Promise<T | undefined>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Interface for a store of data.
|
|
16
|
+
* @template T - The type of data to store
|
|
17
|
+
*/
|
|
18
|
+
export interface IStore<T> {
|
|
19
|
+
set(id: string, data: T): Promise<void>;
|
|
20
|
+
get(id: string): Promise<T | undefined>;
|
|
21
|
+
}
|