@artinet/sdk 0.5.5 → 0.5.7
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/CHANGELOG.md +128 -20
- package/README.md +542 -212
- package/dist/client/a2a-client.js +6 -1
- package/dist/client/a2a-client.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/server/express/errors.js +51 -0
- package/dist/server/express/errors.js.map +1 -0
- package/dist/server/express/index.js +4 -0
- package/dist/server/express/index.js.map +1 -0
- package/dist/server/express/middeware.js +116 -0
- package/dist/server/express/middeware.js.map +1 -0
- package/dist/server/express/server.js +80 -0
- package/dist/server/express/server.js.map +1 -0
- package/dist/server/index.js +1 -7
- package/dist/server/index.js.map +1 -1
- package/dist/services/a2a/factory/builder.js +392 -0
- package/dist/services/a2a/factory/builder.js.map +1 -0
- package/dist/services/a2a/factory/context.js +151 -0
- package/dist/services/a2a/factory/context.js.map +1 -0
- package/dist/services/a2a/factory/event.js +182 -0
- package/dist/services/a2a/factory/event.js.map +1 -0
- package/dist/services/a2a/factory/index.js +6 -0
- package/dist/services/a2a/factory/index.js.map +1 -0
- package/dist/services/a2a/factory/method.js +15 -0
- package/dist/services/a2a/factory/method.js.map +1 -0
- package/dist/services/a2a/factory/service.js +12 -0
- package/dist/services/a2a/factory/service.js.map +1 -0
- package/dist/services/a2a/helpers/index.js +2 -0
- package/dist/services/a2a/helpers/index.js.map +1 -0
- package/dist/services/a2a/helpers/part.js +47 -0
- package/dist/services/a2a/helpers/part.js.map +1 -0
- package/dist/services/a2a/index.js +5 -1
- package/dist/services/a2a/index.js.map +1 -1
- package/dist/services/a2a/managers/cancellation.js +17 -0
- package/dist/services/a2a/managers/cancellation.js.map +1 -0
- package/dist/services/a2a/managers/connection.js +17 -0
- package/dist/services/a2a/managers/connection.js.map +1 -0
- package/dist/services/a2a/managers/context.js +17 -0
- package/dist/services/a2a/managers/context.js.map +1 -0
- package/dist/services/a2a/managers/index.js +6 -0
- package/dist/services/a2a/managers/index.js.map +1 -0
- package/dist/services/a2a/managers/task.js +17 -0
- package/dist/services/a2a/managers/task.js.map +1 -0
- package/dist/services/a2a/methods/cancel-task.js +47 -0
- package/dist/services/a2a/methods/cancel-task.js.map +1 -0
- package/dist/services/a2a/methods/get-task.js +15 -0
- package/dist/services/a2a/methods/get-task.js.map +1 -0
- package/dist/services/a2a/methods/index.js +6 -0
- package/dist/services/a2a/methods/index.js.map +1 -0
- package/dist/services/a2a/methods/resubscribe-task.js +77 -0
- package/dist/services/a2a/methods/resubscribe-task.js.map +1 -0
- package/dist/services/a2a/methods/send-message.js +20 -0
- package/dist/services/a2a/methods/send-message.js.map +1 -0
- package/dist/services/a2a/methods/stream-message.js +39 -0
- package/dist/services/a2a/methods/stream-message.js.map +1 -0
- package/dist/services/a2a/service.js +82 -236
- package/dist/services/a2a/service.js.map +1 -1
- package/dist/services/a2a/state/index.js +4 -0
- package/dist/services/a2a/state/index.js.map +1 -0
- package/dist/services/a2a/state/load.js +43 -0
- package/dist/services/a2a/state/load.js.map +1 -0
- package/dist/services/a2a/state/process.js +14 -0
- package/dist/services/a2a/state/process.js.map +1 -0
- package/dist/services/a2a/state/update/artifact.js +40 -0
- package/dist/services/a2a/state/update/artifact.js.map +1 -0
- package/dist/services/a2a/state/update/index.js +3 -0
- package/dist/services/a2a/state/update/index.js.map +1 -0
- package/dist/{server/lib/update/base.js → services/a2a/state/update/update.js} +23 -9
- package/dist/services/a2a/state/update/update.js.map +1 -0
- package/dist/services/core/execution/execute.js +26 -0
- package/dist/services/core/execution/execute.js.map +1 -0
- package/dist/services/core/execution/index.js +2 -0
- package/dist/services/core/execution/index.js.map +1 -0
- package/dist/services/core/index.js +3 -0
- package/dist/services/core/index.js.map +1 -0
- package/dist/services/core/managers/command.js +95 -0
- package/dist/services/core/managers/command.js.map +1 -0
- package/dist/services/core/managers/event.js +57 -0
- package/dist/services/core/managers/event.js.map +1 -0
- package/dist/services/core/managers/index.js +4 -0
- package/dist/services/core/managers/index.js.map +1 -0
- package/dist/services/core/managers/stream.js +78 -0
- package/dist/services/core/managers/stream.js.map +1 -0
- package/dist/services/index.js +3 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/mcp/service.js +114 -66
- package/dist/services/mcp/service.js.map +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/rpc/parser.js +13 -5
- package/dist/transport/rpc/parser.js.map +1 -1
- package/dist/transport/rpc/rpc-client.js +10 -2
- package/dist/transport/rpc/rpc-client.js.map +1 -1
- package/dist/transport/streaming/event-stream.js +5 -1
- package/dist/transport/streaming/event-stream.js.map +1 -1
- package/dist/transport/trpc/a2a/factory/index.js +2 -0
- package/dist/transport/trpc/a2a/factory/index.js.map +1 -0
- package/dist/transport/trpc/a2a/factory/router.js +17 -0
- package/dist/transport/trpc/a2a/factory/router.js.map +1 -0
- package/dist/transport/trpc/a2a/index.js +4 -0
- package/dist/transport/trpc/a2a/index.js.map +1 -0
- package/dist/transport/trpc/a2a/routes/index.js +4 -0
- package/dist/transport/trpc/a2a/routes/index.js.map +1 -0
- package/dist/transport/trpc/a2a/routes/info.js +10 -0
- package/dist/transport/trpc/a2a/routes/info.js.map +1 -0
- package/dist/transport/trpc/a2a/routes/message/index.js +2 -0
- package/dist/transport/trpc/a2a/routes/message/index.js.map +1 -0
- package/dist/transport/trpc/a2a/routes/message/route.js +38 -0
- package/dist/transport/trpc/a2a/routes/message/route.js.map +1 -0
- package/dist/transport/trpc/a2a/routes/tasks/index.js +2 -0
- package/dist/transport/trpc/a2a/routes/tasks/index.js.map +1 -0
- package/dist/transport/trpc/a2a/routes/tasks/route.js +71 -0
- package/dist/transport/trpc/a2a/routes/tasks/route.js.map +1 -0
- package/dist/transport/trpc/a2a/trpc.js +36 -0
- package/dist/transport/trpc/a2a/trpc.js.map +1 -0
- package/dist/transport/trpc/index.js +2 -0
- package/dist/transport/trpc/index.js.map +1 -0
- package/dist/types/client/a2a-client.d.ts +5 -1
- package/dist/types/client/a2a-client.d.ts.map +1 -1
- package/dist/types/ext.js +11 -0
- package/dist/types/ext.js.map +1 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -4
- package/dist/types/index.js.map +1 -1
- package/dist/types/interfaces/client.js +6 -0
- package/dist/types/interfaces/client.js.map +1 -0
- package/dist/types/interfaces/index.js +4 -0
- package/dist/types/interfaces/index.js.map +1 -0
- package/dist/types/interfaces/services/a2a/builder.js +6 -0
- package/dist/types/interfaces/services/a2a/builder.js.map +1 -0
- package/dist/types/interfaces/services/a2a/context.js +6 -0
- package/dist/types/interfaces/services/a2a/context.js.map +1 -0
- package/dist/types/interfaces/services/a2a/engine.js +6 -0
- package/dist/types/interfaces/services/a2a/engine.js.map +1 -0
- package/dist/types/interfaces/services/a2a/index.js +6 -0
- package/dist/types/interfaces/services/a2a/index.js.map +1 -0
- package/dist/types/interfaces/services/a2a/legacy.js +6 -0
- package/dist/types/interfaces/services/a2a/legacy.js.map +1 -0
- package/dist/types/interfaces/services/a2a/service.js +6 -0
- package/dist/types/interfaces/services/a2a/service.js.map +1 -0
- package/dist/types/interfaces/services/core/context/command.js +6 -0
- package/dist/types/interfaces/services/core/context/command.js.map +1 -0
- package/dist/types/interfaces/services/core/context/context.js +6 -0
- package/dist/types/interfaces/services/core/context/context.js.map +1 -0
- package/dist/types/interfaces/services/core/context/index.js +4 -0
- package/dist/types/interfaces/services/core/context/index.js.map +1 -0
- package/dist/types/interfaces/services/core/context/types.js +6 -0
- package/dist/types/interfaces/services/core/context/types.js.map +1 -0
- package/dist/types/interfaces/services/core/execution/engine.js +6 -0
- package/dist/types/interfaces/services/core/execution/engine.js.map +1 -0
- package/dist/types/interfaces/services/core/execution/environment.js +6 -0
- package/dist/types/interfaces/services/core/execution/environment.js.map +1 -0
- package/dist/types/interfaces/services/core/execution/execute.js +6 -0
- package/dist/types/interfaces/services/core/execution/execute.js.map +1 -0
- package/dist/types/interfaces/services/core/execution/index.js +4 -0
- package/dist/types/interfaces/services/core/execution/index.js.map +1 -0
- package/dist/types/interfaces/services/core/index.js +5 -0
- package/dist/types/interfaces/services/core/index.js.map +1 -0
- package/dist/types/interfaces/services/core/managers/cancellation.js +6 -0
- package/dist/types/interfaces/services/core/managers/cancellation.js.map +1 -0
- package/dist/types/interfaces/services/core/managers/connection.js +6 -0
- package/dist/types/interfaces/services/core/managers/connection.js.map +1 -0
- package/dist/types/interfaces/services/core/managers/context.js +6 -0
- package/dist/types/interfaces/services/core/managers/context.js.map +1 -0
- package/dist/types/interfaces/services/core/managers/event.js +6 -0
- package/dist/types/interfaces/services/core/managers/event.js.map +1 -0
- package/dist/types/interfaces/services/core/managers/index.js +7 -0
- package/dist/types/interfaces/services/core/managers/index.js.map +1 -0
- package/dist/types/interfaces/services/core/managers/stream.js +6 -0
- package/dist/types/interfaces/services/core/managers/stream.js.map +1 -0
- package/dist/types/interfaces/services/core/managers/task.js +2 -0
- package/dist/types/interfaces/services/core/managers/task.js.map +1 -0
- package/dist/types/interfaces/services/core/service.js +6 -0
- package/dist/types/interfaces/services/core/service.js.map +1 -0
- package/dist/types/interfaces/services/index.js +5 -0
- package/dist/types/interfaces/services/index.js.map +1 -0
- package/dist/types/interfaces/services/mcp/index.js +2 -0
- package/dist/types/interfaces/services/mcp/index.js.map +1 -0
- package/dist/types/interfaces/services/mcp/service.js +6 -0
- package/dist/types/interfaces/services/mcp/service.js.map +1 -0
- package/dist/types/{services → interfaces/services}/protocol.js +4 -0
- package/dist/types/interfaces/services/protocol.js.map +1 -0
- package/dist/types/interfaces/storage.js +6 -0
- package/dist/types/interfaces/storage.js.map +1 -0
- package/dist/types/schemas/a2a/agent.js +325 -0
- package/dist/types/schemas/a2a/agent.js.map +1 -0
- package/dist/types/schemas/a2a/auth.js +284 -0
- package/dist/types/schemas/a2a/auth.js.map +1 -0
- package/dist/types/schemas/a2a/error.js +119 -0
- package/dist/types/schemas/a2a/error.js.map +1 -1
- package/dist/types/schemas/a2a/index.js +8 -4
- package/dist/types/schemas/a2a/index.js.map +1 -1
- package/dist/types/schemas/a2a/kind.js +21 -0
- package/dist/types/schemas/a2a/kind.js.map +1 -0
- package/dist/types/schemas/a2a/message.js +130 -1
- package/dist/types/schemas/a2a/message.js.map +1 -1
- package/dist/types/schemas/a2a/notification.js +203 -1
- package/dist/types/schemas/a2a/notification.js.map +1 -1
- package/dist/types/schemas/a2a/parameters.js +241 -1
- package/dist/types/schemas/a2a/parameters.js.map +1 -1
- package/dist/types/schemas/a2a/protocol.js +60 -0
- package/dist/types/schemas/a2a/protocol.js.map +1 -0
- package/dist/types/schemas/a2a/rpc.js +126 -1
- package/dist/types/schemas/a2a/rpc.js.map +1 -1
- package/dist/types/schemas/a2a/task.js +131 -12
- package/dist/types/schemas/a2a/task.js.map +1 -1
- package/dist/types/schemas/a2a/transport.js +29 -0
- package/dist/types/schemas/a2a/transport.js.map +1 -0
- package/dist/types/schemas/deployment/index.js +3 -0
- package/dist/types/schemas/deployment/index.js.map +1 -0
- package/dist/types/schemas/deployment/proxy.js +6 -0
- package/dist/types/schemas/deployment/proxy.js.map +1 -0
- package/dist/types/schemas/deployment/request.js +88 -0
- package/dist/types/schemas/deployment/request.js.map +1 -0
- package/dist/types/schemas/index.js +1 -0
- package/dist/types/schemas/index.js.map +1 -1
- package/dist/types/server/express/errors.d.ts +10 -0
- package/dist/types/server/express/errors.d.ts.map +1 -0
- package/dist/types/server/express/index.d.ts +4 -0
- package/dist/types/server/express/index.d.ts.map +1 -0
- package/dist/types/server/express/middeware.d.ts +8 -0
- package/dist/types/server/express/middeware.d.ts.map +1 -0
- package/dist/types/server/express/server.d.ts +71 -0
- package/dist/types/server/express/server.d.ts.map +1 -0
- package/dist/types/server/index.d.ts +1 -7
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/services/a2a/factory/builder.d.ts +352 -0
- package/dist/types/services/a2a/factory/builder.d.ts.map +1 -0
- package/dist/types/services/a2a/factory/context.d.ts +133 -0
- package/dist/types/services/a2a/factory/context.d.ts.map +1 -0
- package/dist/types/services/a2a/factory/event.d.ts +59 -0
- package/dist/types/services/a2a/factory/event.d.ts.map +1 -0
- package/dist/types/services/a2a/factory/index.d.ts +6 -0
- package/dist/types/services/a2a/factory/index.d.ts.map +1 -0
- package/dist/types/services/a2a/factory/method.d.ts +7 -0
- package/dist/types/services/a2a/factory/method.d.ts.map +1 -0
- package/dist/types/services/a2a/factory/service.d.ts +10 -0
- package/dist/types/services/a2a/factory/service.d.ts.map +1 -0
- package/dist/types/services/a2a/helpers/index.d.ts +2 -0
- package/dist/types/services/a2a/helpers/index.d.ts.map +1 -0
- package/dist/types/services/a2a/helpers/part.d.ts +49 -0
- package/dist/types/services/a2a/helpers/part.d.ts.map +1 -0
- package/dist/types/services/a2a/index.d.ts +5 -1
- package/dist/types/services/a2a/index.d.ts.map +1 -1
- package/dist/types/services/a2a/managers/cancellation.d.ts +12 -0
- package/dist/types/services/a2a/managers/cancellation.d.ts.map +1 -0
- package/dist/types/services/a2a/managers/connection.d.ts +12 -0
- package/dist/types/services/a2a/managers/connection.d.ts.map +1 -0
- package/dist/types/services/a2a/managers/context.d.ts +12 -0
- package/dist/types/services/a2a/managers/context.d.ts.map +1 -0
- package/dist/types/services/a2a/managers/index.d.ts +6 -0
- package/dist/types/services/a2a/managers/index.d.ts.map +1 -0
- package/dist/types/services/a2a/managers/task.d.ts +12 -0
- package/dist/types/services/a2a/managers/task.d.ts.map +1 -0
- package/dist/types/services/a2a/methods/cancel-task.d.ts +8 -0
- package/dist/types/services/a2a/methods/cancel-task.d.ts.map +1 -0
- package/dist/types/services/a2a/methods/get-task.d.ts +113 -0
- package/dist/types/services/a2a/methods/get-task.d.ts.map +1 -0
- package/dist/types/services/a2a/methods/index.d.ts +6 -0
- package/dist/types/services/a2a/methods/index.d.ts.map +1 -0
- package/dist/types/services/a2a/methods/resubscribe-task.d.ts +8 -0
- package/dist/types/services/a2a/methods/resubscribe-task.d.ts.map +1 -0
- package/dist/types/services/a2a/methods/send-message.d.ts +8 -0
- package/dist/types/services/a2a/methods/send-message.d.ts.map +1 -0
- package/dist/types/services/a2a/methods/stream-message.d.ts +9 -0
- package/dist/types/services/a2a/methods/stream-message.d.ts.map +1 -0
- package/dist/types/services/a2a/service.d.ts +374 -41
- package/dist/types/services/a2a/service.d.ts.map +1 -1
- package/dist/types/services/a2a/state/index.d.ts +4 -0
- package/dist/types/services/a2a/state/index.d.ts.map +1 -0
- package/dist/types/services/a2a/state/load.d.ts +15 -0
- package/dist/types/services/a2a/state/load.d.ts.map +1 -0
- package/dist/types/services/a2a/state/process.d.ts +8 -0
- package/dist/types/services/a2a/state/process.d.ts.map +1 -0
- package/dist/types/services/a2a/state/update/artifact.d.ts +11 -0
- package/dist/types/services/a2a/state/update/artifact.d.ts.map +1 -0
- package/dist/types/services/a2a/state/update/index.d.ts +3 -0
- package/dist/types/services/a2a/state/update/index.d.ts.map +1 -0
- package/dist/types/services/a2a/state/update/update.d.ts +24 -0
- package/dist/types/services/a2a/state/update/update.d.ts.map +1 -0
- package/dist/types/services/core/execution/execute.d.ts +7 -0
- package/dist/types/services/core/execution/execute.d.ts.map +1 -0
- package/dist/types/services/core/execution/index.d.ts +2 -0
- package/dist/types/services/core/execution/index.d.ts.map +1 -0
- package/dist/types/services/core/index.d.ts +3 -0
- package/dist/types/services/core/index.d.ts.map +1 -0
- package/dist/types/services/core/managers/command.d.ts +40 -0
- package/dist/types/services/core/managers/command.d.ts.map +1 -0
- package/dist/types/services/core/managers/event.d.ts +19 -0
- package/dist/types/services/core/managers/event.d.ts.map +1 -0
- package/dist/types/services/core/managers/index.d.ts +4 -0
- package/dist/types/services/core/managers/index.d.ts.map +1 -0
- package/dist/types/services/core/managers/stream.d.ts +21 -0
- package/dist/types/services/core/managers/stream.d.ts.map +1 -0
- package/dist/types/services/index.d.ts +3 -1
- package/dist/types/services/index.d.ts.map +1 -1
- package/dist/types/services/mcp/service.d.ts +23 -22
- package/dist/types/services/mcp/service.d.ts.map +1 -1
- package/dist/types/transport/index.d.ts +1 -1
- package/dist/types/transport/index.d.ts.map +1 -1
- package/dist/types/transport/rpc/parser.d.ts +5 -1
- package/dist/types/transport/rpc/parser.d.ts.map +1 -1
- package/dist/types/transport/rpc/rpc-client.d.ts +5 -1
- package/dist/types/transport/rpc/rpc-client.d.ts.map +1 -1
- package/dist/types/transport/streaming/event-stream.d.ts +5 -1
- package/dist/types/transport/streaming/event-stream.d.ts.map +1 -1
- package/dist/types/transport/trpc/a2a/factory/index.d.ts +2 -0
- package/dist/types/transport/trpc/a2a/factory/index.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/factory/router.d.ts +2631 -0
- package/dist/types/transport/trpc/a2a/factory/router.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/index.d.ts +4 -0
- package/dist/types/transport/trpc/a2a/index.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/routes/index.d.ts +4 -0
- package/dist/types/transport/trpc/a2a/routes/index.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/routes/info.d.ts +102 -0
- package/dist/types/transport/trpc/a2a/routes/info.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/routes/message/index.d.ts +2 -0
- package/dist/types/transport/trpc/a2a/routes/message/index.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/routes/message/route.d.ts +523 -0
- package/dist/types/transport/trpc/a2a/routes/message/route.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/routes/tasks/index.d.ts +2 -0
- package/dist/types/transport/trpc/a2a/routes/tasks/index.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/routes/tasks/route.d.ts +646 -0
- package/dist/types/transport/trpc/a2a/routes/tasks/route.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/trpc.d.ts +272 -0
- package/dist/types/transport/trpc/a2a/trpc.d.ts.map +1 -0
- package/dist/types/transport/trpc/index.d.ts +2 -0
- package/dist/types/transport/trpc/index.d.ts.map +1 -0
- package/dist/types/types/ext.d.ts +14 -0
- package/dist/types/types/ext.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +3 -4
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/{client.d.ts → interfaces/client.d.ts} +7 -2
- package/dist/types/types/interfaces/client.d.ts.map +1 -0
- package/dist/types/types/interfaces/index.d.ts +4 -0
- package/dist/types/types/interfaces/index.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/a2a/builder.d.ts +37 -0
- package/dist/types/types/interfaces/services/a2a/builder.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/a2a/context.d.ts +163 -0
- package/dist/types/types/interfaces/services/a2a/context.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/a2a/engine.d.ts +8 -0
- package/dist/types/types/interfaces/services/a2a/engine.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/a2a/index.d.ts +6 -0
- package/dist/types/types/interfaces/services/a2a/index.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/a2a/legacy.d.ts +90 -0
- package/dist/types/types/interfaces/services/a2a/legacy.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/a2a/service.d.ts +409 -0
- package/dist/types/types/interfaces/services/a2a/service.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/context/command.d.ts +26 -0
- package/dist/types/types/interfaces/services/core/context/command.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/context/context.d.ts +208 -0
- package/dist/types/types/interfaces/services/core/context/context.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/context/index.d.ts +4 -0
- package/dist/types/types/interfaces/services/core/context/index.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/context/types.d.ts +12 -0
- package/dist/types/types/interfaces/services/core/context/types.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/execution/engine.d.ts +107 -0
- package/dist/types/types/interfaces/services/core/execution/engine.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/execution/environment.d.ts +12 -0
- package/dist/types/types/interfaces/services/core/execution/environment.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/execution/execute.d.ts +8 -0
- package/dist/types/types/interfaces/services/core/execution/execute.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/execution/index.d.ts +4 -0
- package/dist/types/types/interfaces/services/core/execution/index.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/index.d.ts +5 -0
- package/dist/types/types/interfaces/services/core/index.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/managers/cancellation.d.ts +10 -0
- package/dist/types/types/interfaces/services/core/managers/cancellation.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/managers/connection.d.ts +10 -0
- package/dist/types/types/interfaces/services/core/managers/connection.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/managers/context.d.ts +18 -0
- package/dist/types/types/interfaces/services/core/managers/context.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/managers/event.d.ts +329 -0
- package/dist/types/types/interfaces/services/core/managers/event.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/managers/index.d.ts +7 -0
- package/dist/types/types/interfaces/services/core/managers/index.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/managers/stream.d.ts +218 -0
- package/dist/types/types/interfaces/services/core/managers/stream.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/managers/task.d.ts +10 -0
- package/dist/types/types/interfaces/services/core/managers/task.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/core/service.d.ts +116 -0
- package/dist/types/types/interfaces/services/core/service.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/index.d.ts +5 -0
- package/dist/types/types/interfaces/services/index.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/mcp/index.d.ts +2 -0
- package/dist/types/types/interfaces/services/mcp/index.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/mcp/service.d.ts +50 -0
- package/dist/types/types/interfaces/services/mcp/service.d.ts.map +1 -0
- package/dist/types/types/{services → interfaces/services}/protocol.d.ts +4 -0
- package/dist/types/types/interfaces/services/protocol.d.ts.map +1 -0
- package/dist/types/types/interfaces/storage.d.ts +9 -0
- package/dist/types/types/interfaces/storage.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/agent.d.ts +2584 -0
- package/dist/types/types/schemas/a2a/agent.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/auth.d.ts +909 -0
- package/dist/types/types/schemas/a2a/auth.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/error.d.ts +349 -27
- package/dist/types/types/schemas/a2a/error.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/index.d.ts +8 -216
- package/dist/types/types/schemas/a2a/index.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/kind.d.ts +12 -0
- package/dist/types/types/schemas/a2a/kind.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/message.d.ts +10309 -55
- package/dist/types/types/schemas/a2a/message.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/notification.d.ts +1480 -49
- package/dist/types/types/schemas/a2a/notification.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/parameters.d.ts +878 -109
- package/dist/types/types/schemas/a2a/parameters.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/protocol.d.ts +14364 -0
- package/dist/types/types/schemas/a2a/protocol.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/rpc.d.ts +135 -56
- package/dist/types/types/schemas/a2a/rpc.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/task.d.ts +5841 -206
- package/dist/types/types/schemas/a2a/task.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/transport.d.ts +32 -0
- package/dist/types/types/schemas/a2a/transport.d.ts.map +1 -0
- package/dist/types/types/schemas/deployment/index.d.ts +3 -0
- package/dist/types/types/schemas/deployment/index.d.ts.map +1 -0
- package/dist/types/types/{proxy.d.ts → schemas/deployment/proxy.d.ts} +6 -2
- package/dist/types/types/schemas/deployment/proxy.d.ts.map +1 -0
- package/dist/types/types/schemas/deployment/request.d.ts +2848 -0
- package/dist/types/types/schemas/deployment/request.d.ts.map +1 -0
- package/dist/types/types/utils/index.d.ts +2 -0
- package/dist/types/types/utils/index.d.ts.map +1 -0
- package/dist/types/types/{transform.d.ts → utils/transform.d.ts} +4 -0
- package/dist/types/types/utils/transform.d.ts.map +1 -0
- package/dist/types/utils/api/register.d.ts +4 -0
- package/dist/types/utils/api/register.d.ts.map +1 -1
- package/dist/types/utils/common/constants.d.ts +8 -4
- package/dist/types/utils/common/constants.d.ts.map +1 -1
- package/dist/types/utils/common/errors.d.ts +6 -12
- package/dist/types/utils/common/errors.d.ts.map +1 -1
- package/dist/types/utils/common/utils.d.ts +4 -14
- package/dist/types/utils/common/utils.d.ts.map +1 -1
- package/dist/types/utils/common/zAsyncIterable-v3.d.ts +25 -0
- package/dist/types/utils/common/zAsyncIterable-v3.d.ts.map +1 -0
- package/dist/types/utils/common/zAsyncIterable.d.ts +23 -0
- package/dist/types/utils/common/zAsyncIterable.d.ts.map +1 -0
- package/dist/types/utils/deployment/agents.d.ts +5 -1
- package/dist/types/utils/deployment/agents.d.ts.map +1 -1
- package/dist/types/utils/deployment/bundler.d.ts +4 -0
- package/dist/types/utils/deployment/bundler.d.ts.map +1 -1
- package/dist/types/utils/deployment/full-deployment.d.ts +12 -2
- package/dist/types/utils/deployment/full-deployment.d.ts.map +1 -1
- package/dist/types/utils/deployment/index.d.ts +5 -0
- package/dist/types/utils/deployment/index.d.ts.map +1 -0
- package/dist/types/utils/deployment/task-wrapper.d.ts +6 -2
- package/dist/types/utils/deployment/task-wrapper.d.ts.map +1 -1
- package/dist/types/utils/deployment/test-deployment.d.ts +7 -2
- package/dist/types/utils/deployment/test-deployment.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +4 -6
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/index.js +2 -0
- package/dist/types/utils/index.js.map +1 -0
- package/dist/types/utils/logging/index.d.ts +3 -0
- package/dist/types/utils/logging/index.d.ts.map +1 -0
- package/dist/types/utils/logging/log.d.ts +4 -0
- package/dist/types/utils/logging/log.d.ts.map +1 -1
- package/dist/types/utils/logging/logger.d.ts +4 -0
- package/dist/types/utils/logging/logger.d.ts.map +1 -1
- package/dist/types/{server/lib → utils}/storage/file.d.ts +9 -4
- package/dist/types/utils/storage/file.d.ts.map +1 -0
- package/dist/types/{server/lib → utils}/storage/memory.d.ts +9 -4
- package/dist/types/utils/storage/memory.d.ts.map +1 -0
- package/dist/types/{transform.js → utils/transform.js} +2 -1
- package/dist/types/utils/transform.js.map +1 -0
- package/dist/utils/api/register.js +4 -0
- package/dist/utils/api/register.js.map +1 -1
- package/dist/utils/common/constants.js +20 -11
- package/dist/utils/common/constants.js.map +1 -1
- package/dist/utils/common/errors.js +7 -40
- package/dist/utils/common/errors.js.map +1 -1
- package/dist/utils/common/utils.js +4 -46
- package/dist/utils/common/utils.js.map +1 -1
- package/dist/utils/common/zAsyncIterable-v3.js +39 -0
- package/dist/utils/common/zAsyncIterable-v3.js.map +1 -0
- package/dist/utils/common/zAsyncIterable.js +41 -0
- package/dist/utils/common/zAsyncIterable.js.map +1 -0
- package/dist/utils/deployment/agents.js +4 -0
- package/dist/utils/deployment/agents.js.map +1 -1
- package/dist/utils/deployment/bundler.js +4 -0
- package/dist/utils/deployment/bundler.js.map +1 -1
- package/dist/utils/deployment/full-deployment.js +6 -2
- package/dist/utils/deployment/full-deployment.js.map +1 -1
- package/dist/utils/deployment/index.js +5 -0
- package/dist/utils/deployment/index.js.map +1 -0
- package/dist/utils/deployment/task-wrapper.js +4 -0
- package/dist/utils/deployment/task-wrapper.js.map +1 -1
- package/dist/utils/deployment/test-deployment.js +15 -7
- package/dist/utils/deployment/test-deployment.js.map +1 -1
- package/dist/utils/index.js +10 -6
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/logging/index.js +3 -0
- package/dist/utils/logging/index.js.map +1 -0
- package/dist/utils/logging/log.js +4 -0
- package/dist/utils/logging/log.js.map +1 -1
- package/dist/utils/logging/logger.js +13 -0
- package/dist/utils/logging/logger.js.map +1 -1
- package/dist/{server/lib → utils}/storage/file.js +17 -6
- package/dist/utils/storage/file.js.map +1 -0
- package/dist/{server/lib → utils}/storage/memory.js +15 -5
- package/dist/utils/storage/memory.js.map +1 -0
- package/package.json +18 -7
- package/dist/server/a2a-server.js +0 -237
- package/dist/server/a2a-server.js.map +0 -1
- package/dist/server/interfaces/params.js +0 -3
- package/dist/server/interfaces/params.js.map +0 -1
- package/dist/server/interfaces/server.js +0 -2
- package/dist/server/interfaces/server.js.map +0 -1
- package/dist/server/interfaces/store.js +0 -18
- package/dist/server/interfaces/store.js.map +0 -1
- package/dist/server/lib/express-server.js +0 -252
- package/dist/server/lib/express-server.js.map +0 -1
- package/dist/server/lib/json-middleware.js +0 -3
- package/dist/server/lib/json-middleware.js.map +0 -1
- package/dist/server/lib/middleware/a2a-methods.js +0 -140
- package/dist/server/lib/middleware/a2a-methods.js.map +0 -1
- package/dist/server/lib/middleware/factory.js +0 -59
- package/dist/server/lib/middleware/factory.js.map +0 -1
- package/dist/server/lib/state.js +0 -80
- package/dist/server/lib/state.js.map +0 -1
- package/dist/server/lib/storage/file.js.map +0 -1
- package/dist/server/lib/storage/memory.js.map +0 -1
- package/dist/server/lib/update/base.js.map +0 -1
- package/dist/services/a2a/repository.js +0 -160
- package/dist/services/a2a/repository.js.map +0 -1
- package/dist/services/manager.js +0 -61
- package/dist/services/manager.js.map +0 -1
- package/dist/transport/streaming/stream.js +0 -111
- package/dist/transport/streaming/stream.js.map +0 -1
- package/dist/types/client.js +0 -2
- package/dist/types/client.js.map +0 -1
- package/dist/types/express.js +0 -2
- package/dist/types/express.js.map +0 -1
- package/dist/types/extended-schema.js +0 -7
- package/dist/types/extended-schema.js.map +0 -1
- package/dist/types/proxy.js +0 -2
- package/dist/types/proxy.js.map +0 -1
- package/dist/types/schemas/a2a/auth/auth.js +0 -2
- package/dist/types/schemas/a2a/auth/auth.js.map +0 -1
- package/dist/types/schemas/a2a/auth/base.js +0 -2
- package/dist/types/schemas/a2a/auth/base.js.map +0 -1
- package/dist/types/schemas/a2a/auth/index.js +0 -4
- package/dist/types/schemas/a2a/auth/index.js.map +0 -1
- package/dist/types/schemas/a2a/auth/oauth.js +0 -2
- package/dist/types/schemas/a2a/auth/oauth.js.map +0 -1
- package/dist/types/schemas/a2a/ref.js +0 -25
- package/dist/types/schemas/a2a/ref.js.map +0 -1
- package/dist/types/server/a2a-server.d.ts +0 -145
- package/dist/types/server/a2a-server.d.ts.map +0 -1
- package/dist/types/server/interfaces/params.d.ts +0 -109
- package/dist/types/server/interfaces/params.d.ts.map +0 -1
- package/dist/types/server/interfaces/server.d.ts +0 -35
- package/dist/types/server/interfaces/server.d.ts.map +0 -1
- package/dist/types/server/interfaces/store.d.ts +0 -35
- package/dist/types/server/interfaces/store.d.ts.map +0 -1
- package/dist/types/server/lib/express-server.d.ts +0 -59
- package/dist/types/server/lib/express-server.d.ts.map +0 -1
- package/dist/types/server/lib/json-middleware.d.ts +0 -3
- package/dist/types/server/lib/json-middleware.d.ts.map +0 -1
- package/dist/types/server/lib/middleware/a2a-methods.d.ts +0 -7
- package/dist/types/server/lib/middleware/a2a-methods.d.ts.map +0 -1
- package/dist/types/server/lib/middleware/factory.d.ts +0 -12
- package/dist/types/server/lib/middleware/factory.d.ts.map +0 -1
- package/dist/types/server/lib/state.d.ts +0 -20
- package/dist/types/server/lib/state.d.ts.map +0 -1
- package/dist/types/server/lib/storage/file.d.ts.map +0 -1
- package/dist/types/server/lib/storage/memory.d.ts.map +0 -1
- package/dist/types/server/lib/update/base.d.ts +0 -21
- package/dist/types/server/lib/update/base.d.ts.map +0 -1
- package/dist/types/services/a2a/repository.d.ts +0 -77
- package/dist/types/services/a2a/repository.d.ts.map +0 -1
- package/dist/types/services/a2a/repository.js +0 -2
- package/dist/types/services/a2a/repository.js.map +0 -1
- package/dist/types/services/a2a/service.js +0 -2
- package/dist/types/services/a2a/service.js.map +0 -1
- package/dist/types/services/context.js +0 -29
- package/dist/types/services/context.js.map +0 -1
- package/dist/types/services/dispatcher.js +0 -33
- package/dist/types/services/dispatcher.js.map +0 -1
- package/dist/types/services/index.js +0 -9
- package/dist/types/services/index.js.map +0 -1
- package/dist/types/services/manager.d.ts +0 -44
- package/dist/types/services/manager.d.ts.map +0 -1
- package/dist/types/services/manager.js +0 -2
- package/dist/types/services/manager.js.map +0 -1
- package/dist/types/services/mcp/service.js +0 -8
- package/dist/types/services/mcp/service.js.map +0 -1
- package/dist/types/services/protocol.js.map +0 -1
- package/dist/types/services/service.js +0 -2
- package/dist/types/services/service.js.map +0 -1
- package/dist/types/transform.js.map +0 -1
- package/dist/types/transport/streaming/stream.d.ts +0 -42
- package/dist/types/transport/streaming/stream.d.ts.map +0 -1
- package/dist/types/types/client.d.ts.map +0 -1
- package/dist/types/types/express.d.ts +0 -66
- package/dist/types/types/express.d.ts.map +0 -1
- package/dist/types/types/extended-schema.d.ts +0 -174
- package/dist/types/types/extended-schema.d.ts.map +0 -1
- package/dist/types/types/proxy.d.ts.map +0 -1
- package/dist/types/types/schemas/a2a/auth/auth.d.ts +0 -80
- package/dist/types/types/schemas/a2a/auth/auth.d.ts.map +0 -1
- package/dist/types/types/schemas/a2a/auth/base.d.ts +0 -16
- package/dist/types/types/schemas/a2a/auth/base.d.ts.map +0 -1
- package/dist/types/types/schemas/a2a/auth/index.d.ts +0 -4
- package/dist/types/types/schemas/a2a/auth/index.d.ts.map +0 -1
- package/dist/types/types/schemas/a2a/auth/oauth.d.ts +0 -124
- package/dist/types/types/schemas/a2a/auth/oauth.d.ts.map +0 -1
- package/dist/types/types/schemas/a2a/ref.d.ts +0 -2057
- package/dist/types/types/schemas/a2a/ref.d.ts.map +0 -1
- package/dist/types/types/services/a2a/repository.d.ts +0 -85
- package/dist/types/types/services/a2a/repository.d.ts.map +0 -1
- package/dist/types/types/services/a2a/service.d.ts +0 -29
- package/dist/types/types/services/a2a/service.d.ts.map +0 -1
- package/dist/types/types/services/context.d.ts +0 -167
- package/dist/types/types/services/context.d.ts.map +0 -1
- package/dist/types/types/services/dispatcher.d.ts +0 -20
- package/dist/types/types/services/dispatcher.d.ts.map +0 -1
- package/dist/types/types/services/index.d.ts +0 -9
- package/dist/types/types/services/index.d.ts.map +0 -1
- package/dist/types/types/services/manager.d.ts +0 -42
- package/dist/types/types/services/manager.d.ts.map +0 -1
- package/dist/types/types/services/mcp/service.d.ts +0 -57
- package/dist/types/types/services/mcp/service.d.ts.map +0 -1
- package/dist/types/types/services/protocol.d.ts.map +0 -1
- package/dist/types/types/services/service.d.ts +0 -35
- package/dist/types/types/services/service.d.ts.map +0 -1
- package/dist/types/types/transform.d.ts.map +0 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
/**
|
|
7
|
+
* @description Type of a security scheme.
|
|
8
|
+
*/
|
|
9
|
+
export const SecuritySchemeTypeSchema = z
|
|
10
|
+
.enum(["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"])
|
|
11
|
+
.describe("Type of a security scheme.");
|
|
12
|
+
export const SecuritySchemeType = SecuritySchemeTypeSchema.enum;
|
|
13
|
+
/**
|
|
14
|
+
* @description Base properties shared by all security schemes.
|
|
15
|
+
*/
|
|
16
|
+
export const SecuritySchemeBaseSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
/**
|
|
19
|
+
* @required Type of the security scheme.
|
|
20
|
+
*/
|
|
21
|
+
type: SecuritySchemeTypeSchema.describe("Type of the security scheme."),
|
|
22
|
+
/**
|
|
23
|
+
* @optional Description of this security scheme.
|
|
24
|
+
*/
|
|
25
|
+
description: z
|
|
26
|
+
.string()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe("Description of this security scheme."),
|
|
29
|
+
})
|
|
30
|
+
.describe("Base properties shared by all security schemes.");
|
|
31
|
+
/**
|
|
32
|
+
* @description Defines a security scheme using an API key.
|
|
33
|
+
*/
|
|
34
|
+
export const APIKeySecuritySchemeSchema = SecuritySchemeBaseSchema.extend({
|
|
35
|
+
/**
|
|
36
|
+
* @required API Key Type of the security scheme.
|
|
37
|
+
*/
|
|
38
|
+
type: SecuritySchemeTypeSchema.refine((type) => type === "apiKey").describe("API Key Type of the security scheme."),
|
|
39
|
+
/**
|
|
40
|
+
* @required The location of the API key. Valid values are "query", "header", or "cookie".
|
|
41
|
+
*/
|
|
42
|
+
in: z
|
|
43
|
+
.enum(["query", "header", "cookie"])
|
|
44
|
+
.describe("The location of the API key. Valid values are 'query', 'header', or 'cookie'."),
|
|
45
|
+
/**
|
|
46
|
+
* @required The name of the header, query or cookie parameter to be used.
|
|
47
|
+
*/
|
|
48
|
+
name: z
|
|
49
|
+
.string()
|
|
50
|
+
.describe("The name of the header, query or cookie parameter to be used."),
|
|
51
|
+
}).describe("Defines a security scheme using an API key.");
|
|
52
|
+
/**
|
|
53
|
+
* @description HTTP Authentication security scheme.
|
|
54
|
+
*/
|
|
55
|
+
export const HTTPAuthSecuritySchemeSchema = SecuritySchemeBaseSchema.extend({
|
|
56
|
+
/**
|
|
57
|
+
* @required HTTP Type of the security scheme.
|
|
58
|
+
*/
|
|
59
|
+
type: SecuritySchemeTypeSchema.refine((type) => type === "http").describe("HTTP Type of the security scheme."),
|
|
60
|
+
/**
|
|
61
|
+
* @required The name of the HTTP Authentication scheme to be used in the Authorization header as defined
|
|
62
|
+
* in RFC7235. The values used SHOULD be registered in the IANA Authentication Scheme registry.
|
|
63
|
+
* The value is case-insensitive, as defined in RFC7235.
|
|
64
|
+
*/
|
|
65
|
+
scheme: z
|
|
66
|
+
.string()
|
|
67
|
+
.describe("The name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235. The values used SHOULD be registered in the IANA Authentication Scheme registry. The value is case-insensitive, as defined in RFC7235."),
|
|
68
|
+
/**
|
|
69
|
+
* @optional A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually
|
|
70
|
+
* generated by an authorization server, so this information is primarily for documentation
|
|
71
|
+
* purposes.
|
|
72
|
+
*/
|
|
73
|
+
bearerFormat: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes."),
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* @description Configuration details for a supported Authorization Code OAuth Flow
|
|
80
|
+
*/
|
|
81
|
+
export const AuthorizationCodeOAuthFlowSchema = z
|
|
82
|
+
.object({
|
|
83
|
+
/**
|
|
84
|
+
* @required The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2
|
|
85
|
+
* standard requires the use of TLS
|
|
86
|
+
*/
|
|
87
|
+
authorizationUrl: z
|
|
88
|
+
.string()
|
|
89
|
+
.url()
|
|
90
|
+
.describe("The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS"),
|
|
91
|
+
/**
|
|
92
|
+
* @required The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard
|
|
93
|
+
* requires the use of TLS.
|
|
94
|
+
*/
|
|
95
|
+
tokenUrl: z
|
|
96
|
+
.string()
|
|
97
|
+
.url()
|
|
98
|
+
.describe("The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."),
|
|
99
|
+
/**
|
|
100
|
+
* @optional The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2
|
|
101
|
+
* standard requires the use of TLS.
|
|
102
|
+
*/
|
|
103
|
+
refreshUrl: z
|
|
104
|
+
.string()
|
|
105
|
+
.url()
|
|
106
|
+
.optional()
|
|
107
|
+
.describe("The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."),
|
|
108
|
+
/**
|
|
109
|
+
* @required The available scopes for the OAuth2 security scheme. A map between the scope name and a short
|
|
110
|
+
* description for it. The map MAY be empty.
|
|
111
|
+
*/
|
|
112
|
+
scopes: z
|
|
113
|
+
.record(z.string(), z.string())
|
|
114
|
+
.describe("The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty."),
|
|
115
|
+
})
|
|
116
|
+
.describe("Configuration details for a supported Authorization Code OAuth Flow");
|
|
117
|
+
/**
|
|
118
|
+
* @description Configuration details for a supported Client Credentials OAuth Flow
|
|
119
|
+
*/
|
|
120
|
+
export const ClientCredentialsOAuthFlowSchema = z
|
|
121
|
+
.object({
|
|
122
|
+
/**
|
|
123
|
+
* @required The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard
|
|
124
|
+
* requires the use of TLS.
|
|
125
|
+
*/
|
|
126
|
+
tokenUrl: z
|
|
127
|
+
.string()
|
|
128
|
+
.url()
|
|
129
|
+
.describe("The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."),
|
|
130
|
+
/**
|
|
131
|
+
* @optional The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2
|
|
132
|
+
* standard requires the use of TLS.
|
|
133
|
+
*/
|
|
134
|
+
refreshUrl: z
|
|
135
|
+
.string()
|
|
136
|
+
.url()
|
|
137
|
+
.optional()
|
|
138
|
+
.describe("The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."),
|
|
139
|
+
/**
|
|
140
|
+
* @required The available scopes for the OAuth2 security scheme. A map between the scope name and a short
|
|
141
|
+
* description for it. The map MAY be empty.
|
|
142
|
+
*/
|
|
143
|
+
scopes: z
|
|
144
|
+
.record(z.string(), z.string())
|
|
145
|
+
.describe("The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty."),
|
|
146
|
+
})
|
|
147
|
+
.describe("Configuration details for a supported Client Credentials OAuth Flow");
|
|
148
|
+
/**
|
|
149
|
+
* @description Configuration details for a supported Implicit OAuth Flow
|
|
150
|
+
*/
|
|
151
|
+
export const ImplicitOAuthFlowSchema = z
|
|
152
|
+
.object({
|
|
153
|
+
/**
|
|
154
|
+
* @required The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2
|
|
155
|
+
* standard requires the use of TLS
|
|
156
|
+
*/
|
|
157
|
+
authorizationUrl: z
|
|
158
|
+
.string()
|
|
159
|
+
.url()
|
|
160
|
+
.describe("The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS"),
|
|
161
|
+
/**
|
|
162
|
+
* @optional The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2
|
|
163
|
+
* standard requires the use of TLS.
|
|
164
|
+
*/
|
|
165
|
+
refreshUrl: z
|
|
166
|
+
.string()
|
|
167
|
+
.url()
|
|
168
|
+
.optional()
|
|
169
|
+
.describe("The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."),
|
|
170
|
+
/**
|
|
171
|
+
* @required The available scopes for the OAuth2 security scheme. A map between the scope name and a short
|
|
172
|
+
* description for it. The map MAY be empty.
|
|
173
|
+
*/
|
|
174
|
+
scopes: z
|
|
175
|
+
.record(z.string(), z.string())
|
|
176
|
+
.describe("The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty."),
|
|
177
|
+
})
|
|
178
|
+
.describe("Configuration details for a supported Implicit OAuth Flow");
|
|
179
|
+
/**
|
|
180
|
+
* @description Configuration details for a supported Password OAuth Flow
|
|
181
|
+
*/
|
|
182
|
+
export const PasswordOAuthFlowSchema = z
|
|
183
|
+
.object({
|
|
184
|
+
/**
|
|
185
|
+
* @required The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard
|
|
186
|
+
* requires the use of TLS.
|
|
187
|
+
*/
|
|
188
|
+
tokenUrl: z
|
|
189
|
+
.string()
|
|
190
|
+
.url()
|
|
191
|
+
.describe("The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."),
|
|
192
|
+
/**
|
|
193
|
+
* @optional The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2
|
|
194
|
+
* standard requires the use of TLS.
|
|
195
|
+
*/
|
|
196
|
+
refreshUrl: z
|
|
197
|
+
.string()
|
|
198
|
+
.url()
|
|
199
|
+
.optional()
|
|
200
|
+
.describe("The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS."),
|
|
201
|
+
/**
|
|
202
|
+
* @required The available scopes for the OAuth2 security scheme. A map between the scope name and a short
|
|
203
|
+
* description for it. The map MAY be empty.
|
|
204
|
+
*/
|
|
205
|
+
scopes: z
|
|
206
|
+
.record(z.string(), z.string())
|
|
207
|
+
.describe("The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty."),
|
|
208
|
+
})
|
|
209
|
+
.describe("Configuration details for a supported Password OAuth Flow");
|
|
210
|
+
/**
|
|
211
|
+
* @description The configuration of supported OAuth Flows
|
|
212
|
+
*/
|
|
213
|
+
export const OAuthFlowsSchema = z
|
|
214
|
+
.object({
|
|
215
|
+
/**
|
|
216
|
+
* @optional Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.
|
|
217
|
+
*/
|
|
218
|
+
authorizationCode: AuthorizationCodeOAuthFlowSchema.optional().describe("Configuration for the OAuth Authorization Code flow"),
|
|
219
|
+
/**
|
|
220
|
+
* @optional Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0
|
|
221
|
+
*/
|
|
222
|
+
clientCredentials: ClientCredentialsOAuthFlowSchema.optional().describe("Configuration for the OAuth Client Credentials flow"),
|
|
223
|
+
/**
|
|
224
|
+
* @optional Configuration for the OAuth Implicit flow
|
|
225
|
+
*/
|
|
226
|
+
implicit: ImplicitOAuthFlowSchema.optional().describe("Configuration for the OAuth Implicit flow"),
|
|
227
|
+
/**
|
|
228
|
+
* @optional Configuration for the OAuth Resource Owner Password flow
|
|
229
|
+
*/
|
|
230
|
+
password: PasswordOAuthFlowSchema.optional().describe("Configuration for the OAuth Resource Owner Password flow"),
|
|
231
|
+
})
|
|
232
|
+
.describe("The configuration of supported OAuth Flows");
|
|
233
|
+
/**
|
|
234
|
+
* @description OAuth2 security scheme configuration.
|
|
235
|
+
*/
|
|
236
|
+
export const OAuth2SecuritySchemeSchema = SecuritySchemeBaseSchema.extend({
|
|
237
|
+
/**
|
|
238
|
+
* @required OAuth2 Type of the security scheme.
|
|
239
|
+
*/
|
|
240
|
+
type: SecuritySchemeTypeSchema.refine((type) => type === "oauth2").describe("OAuth2 Type of the security scheme."),
|
|
241
|
+
/**
|
|
242
|
+
* @required An object containing configuration information for the flow types supported.
|
|
243
|
+
*/
|
|
244
|
+
flows: OAuthFlowsSchema.describe("An object containing configuration information for the flow types supported."),
|
|
245
|
+
/**
|
|
246
|
+
* @optional URL to the oauth2 authorization server metadata
|
|
247
|
+
* [RFC8414](https://datatracker.ietf.org/doc/html/rfc8414). TLS is required.
|
|
248
|
+
*/
|
|
249
|
+
oauth2MetadataUrl: z
|
|
250
|
+
.string()
|
|
251
|
+
.url()
|
|
252
|
+
.optional()
|
|
253
|
+
.describe("URL to the oauth2 authorization server metadata"),
|
|
254
|
+
}).describe("OAuth2 security scheme configuration.");
|
|
255
|
+
/**
|
|
256
|
+
* @description OpenID Connect security scheme.
|
|
257
|
+
*/
|
|
258
|
+
export const OpenIdConnectSecuritySchemeSchema = SecuritySchemeBaseSchema.extend({
|
|
259
|
+
/**
|
|
260
|
+
* @required Type of the security scheme.
|
|
261
|
+
*/
|
|
262
|
+
type: SecuritySchemeTypeSchema.refine((type) => type === "openIdConnect"),
|
|
263
|
+
/**
|
|
264
|
+
* @required Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata.
|
|
265
|
+
*/
|
|
266
|
+
openIdConnectUrl: z.string().url(),
|
|
267
|
+
});
|
|
268
|
+
/**
|
|
269
|
+
* @description Mutual TLS (mTLS) security scheme.
|
|
270
|
+
*/
|
|
271
|
+
export const MutualTLSSecuritySchemeSchema = SecuritySchemeBaseSchema.extend({
|
|
272
|
+
/**
|
|
273
|
+
* @required Type of the security scheme.
|
|
274
|
+
*/
|
|
275
|
+
type: SecuritySchemeTypeSchema.refine((type) => type === "mutualTLS"),
|
|
276
|
+
});
|
|
277
|
+
export const SecuritySchemeSchema = z.union([
|
|
278
|
+
APIKeySecuritySchemeSchema,
|
|
279
|
+
HTTPAuthSecuritySchemeSchema,
|
|
280
|
+
OAuth2SecuritySchemeSchema,
|
|
281
|
+
OpenIdConnectSecuritySchemeSchema,
|
|
282
|
+
MutualTLSSecuritySchemeSchema,
|
|
283
|
+
]);
|
|
284
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/types/schemas/a2a/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;KAChE,QAAQ,CAAC,4BAA4B,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,IAAI,CAAC;AAGhE;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,MAAM,CAAC;IACN;;OAEG;IACH,IAAI,EAAE,wBAAwB,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAEvE;;OAEG;IACH,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,sCAAsC,CAAC;CACpD,CAAC;KACD,QAAQ,CAAC,iDAAiD,CAAC,CAAC;AAI/D;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,wBAAwB,CAAC,MAAM,CAAC;IACxE;;OAEG;IACH,IAAI,EAAE,wBAAw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B,8EAA8E,CAC/E;IAED;;;OAGG;IACH,iBAAiB,EAAE,CAAC;SACjB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CAAC,iDAAiD,CAAC;CAC/D,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC,CAAC;AAGrD;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAC5C,wBAAwB,CAAC,MAAM,CAAC;IAC9B;;OAEG;IACH,IAAI,EAAE,wBAAwB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,eAAe,CAAC;IAEzE;;OAEG;IACH,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;CACnC,CAAC,CAAC;AAML;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,wBAAwB,CAAC,MAAM,CAAC;IAC3E;;OAEG;IACH,IAAI,EAAE,wBAAwB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC;CACtE,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1C,0BAA0B;IAC1B,4BAA4B;IAC5B,0BAA0B;IAC1B,iCAAiC;IACjC,6BAA6B;CAC9B,CAAC,CAAC"}
|
|
@@ -1,45 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { JSONRPCErrorSchema } from "./rpc.js";
|
|
1
7
|
/**
|
|
2
8
|
* @description Error code for JSON Parse Error (-32700). Invalid JSON was received by the server.
|
|
3
9
|
*/
|
|
4
10
|
export const ErrorCodeParseError = -32700;
|
|
11
|
+
export const JSONParseErrorSchema = JSONRPCErrorSchema.extend({
|
|
12
|
+
code: z.literal(ErrorCodeParseError),
|
|
13
|
+
message: z
|
|
14
|
+
.string()
|
|
15
|
+
.describe("The error message.")
|
|
16
|
+
.default("Invalid JSON payload"),
|
|
17
|
+
}).describe("Represents a JSON-RPC error for a JSON parse error.");
|
|
5
18
|
/**
|
|
6
19
|
* @description Error code for Invalid Request (-32600). The JSON sent is not a valid Request object.
|
|
7
20
|
*/
|
|
8
21
|
export const ErrorCodeInvalidRequest = -32600;
|
|
22
|
+
export const InvalidRequestErrorSchema = JSONRPCErrorSchema.extend({
|
|
23
|
+
code: z.literal(ErrorCodeInvalidRequest),
|
|
24
|
+
message: z
|
|
25
|
+
.string()
|
|
26
|
+
.describe("The error message.")
|
|
27
|
+
.default("Request payload validation error"),
|
|
28
|
+
}).describe("Represents a JSON-RPC error for an invalid request.");
|
|
9
29
|
/**
|
|
10
30
|
* @description Error code for Method Not Found (-32601). The method does not exist / is not available.
|
|
11
31
|
*/
|
|
12
32
|
export const ErrorCodeMethodNotFound = -32601;
|
|
33
|
+
export const MethodNotFoundErrorSchema = JSONRPCErrorSchema.extend({
|
|
34
|
+
code: z.literal(ErrorCodeMethodNotFound),
|
|
35
|
+
message: z
|
|
36
|
+
.string()
|
|
37
|
+
.describe("The error message.")
|
|
38
|
+
.default("Method not found"),
|
|
39
|
+
}).describe("Represents a JSON-RPC error for a method not found.");
|
|
13
40
|
/**
|
|
14
41
|
* @description Error code for Invalid Params (-32602). Invalid method parameter(s).
|
|
15
42
|
*/
|
|
16
43
|
export const ErrorCodeInvalidParams = -32602;
|
|
44
|
+
export const InvalidParamsErrorSchema = JSONRPCErrorSchema.extend({
|
|
45
|
+
code: z.literal(ErrorCodeInvalidParams),
|
|
46
|
+
message: z
|
|
47
|
+
.string()
|
|
48
|
+
.describe("The error message.")
|
|
49
|
+
.default("Invalid parameters"),
|
|
50
|
+
}).describe("Represents a JSON-RPC error for invalid parameters.");
|
|
17
51
|
/**
|
|
18
52
|
* @description Error code for Internal Error (-32603). Internal JSON-RPC error.
|
|
19
53
|
*/
|
|
20
54
|
export const ErrorCodeInternalError = -32603;
|
|
55
|
+
export const InternalErrorSchema = JSONRPCErrorSchema.extend({
|
|
56
|
+
code: z.literal(ErrorCodeInternalError),
|
|
57
|
+
message: z.string().describe("The error message.").default("Internal error"),
|
|
58
|
+
}).describe("Represents a JSON-RPC error for an internal error.");
|
|
21
59
|
/**
|
|
22
60
|
* @description Error code for Task Not Found (-32001). The specified task was not found.
|
|
23
61
|
*/
|
|
24
62
|
export const ErrorCodeTaskNotFound = -32001;
|
|
63
|
+
export const TaskNotFoundErrorSchema = JSONRPCErrorSchema.extend({
|
|
64
|
+
code: z.literal(ErrorCodeTaskNotFound),
|
|
65
|
+
message: z.string().describe("The error message.").default("Task not found"),
|
|
66
|
+
}).describe("Represents a JSON-RPC error for a task not found.");
|
|
25
67
|
/**
|
|
26
68
|
* @description Error code for Task Not Cancelable (-32002). The specified task cannot be canceled.
|
|
27
69
|
*/
|
|
28
70
|
export const ErrorCodeTaskNotCancelable = -32002;
|
|
71
|
+
export const TaskNotCancelableErrorSchema = JSONRPCErrorSchema.extend({
|
|
72
|
+
code: z.literal(ErrorCodeTaskNotCancelable),
|
|
73
|
+
message: z
|
|
74
|
+
.string()
|
|
75
|
+
.describe("The error message.")
|
|
76
|
+
.default("Task cannot be canceled"),
|
|
77
|
+
}).describe("Represents a JSON-RPC error for a task not cancelable.");
|
|
29
78
|
/**
|
|
30
79
|
* @description Error code for Push Notification Not Supported (-32003). Push Notifications are not supported for this operation or agent.
|
|
31
80
|
*/
|
|
32
81
|
export const ErrorCodePushNotificationNotSupported = -32003;
|
|
82
|
+
export const PushNotificationNotSupportedErrorSchema = JSONRPCErrorSchema.extend({
|
|
83
|
+
code: z.literal(ErrorCodePushNotificationNotSupported),
|
|
84
|
+
message: z
|
|
85
|
+
.string()
|
|
86
|
+
.describe("The error message.")
|
|
87
|
+
.default("Push Notifications is not supported"),
|
|
88
|
+
}).describe("Represents a JSON-RPC error for push notifications not supported.");
|
|
33
89
|
/**
|
|
34
90
|
* @description Error code for Unsupported Operation (-32004). The requested operation is not supported by the agent.
|
|
35
91
|
*/
|
|
36
92
|
export const ErrorCodeUnsupportedOperation = -32004;
|
|
93
|
+
export const UnsupportedOperationErrorSchema = JSONRPCErrorSchema.extend({
|
|
94
|
+
code: z.literal(ErrorCodeUnsupportedOperation),
|
|
95
|
+
message: z
|
|
96
|
+
.string()
|
|
97
|
+
.describe("The error message.")
|
|
98
|
+
.default("This operation is not supported"),
|
|
99
|
+
}).describe("Represents a JSON-RPC error for an unsupported operation.");
|
|
37
100
|
/**
|
|
38
101
|
* @description Error code for Content Type Not Supported (-32005). The requested content type is not supported by the agent.
|
|
39
102
|
*/
|
|
40
103
|
export const ErrorCodeContentTypeNotSupported = -32005;
|
|
104
|
+
export const ContentTypeNotSupportedErrorSchema = JSONRPCErrorSchema.extend({
|
|
105
|
+
code: z.literal(ErrorCodeContentTypeNotSupported),
|
|
106
|
+
message: z
|
|
107
|
+
.string()
|
|
108
|
+
.describe("The error message.")
|
|
109
|
+
.default("Incompatible content types"),
|
|
110
|
+
}).describe("Represents a JSON-RPC error for a content type not supported.");
|
|
41
111
|
/**
|
|
42
112
|
* @description Error code for Invalid Agent Response (-32006). The agent returned an invalid response for the current method.
|
|
43
113
|
*/
|
|
44
114
|
export const ErrorCodeInvalidAgentResponse = -32006;
|
|
115
|
+
export const InvalidAgentResponseErrorSchema = JSONRPCErrorSchema.extend({
|
|
116
|
+
code: z.literal(ErrorCodeInvalidAgentResponse),
|
|
117
|
+
message: z
|
|
118
|
+
.string()
|
|
119
|
+
.describe("The error message.")
|
|
120
|
+
.default("Invalid agent response"),
|
|
121
|
+
}).describe("Represents a JSON-RPC error for an invalid agent response. This error is returned when the agent returns an invalid response for the current method.");
|
|
122
|
+
/**
|
|
123
|
+
* An A2A-specific error indicating that the agent does not have an Authenticated Extended Card configured
|
|
124
|
+
*/
|
|
125
|
+
export const ErrorCodeAuthenticatedExtendedCardNotConfigured = -32007;
|
|
126
|
+
export const AuthenticatedExtendedCardNotConfiguredErrorSchema = JSONRPCErrorSchema.extend({
|
|
127
|
+
code: z.literal(ErrorCodeAuthenticatedExtendedCardNotConfigured),
|
|
128
|
+
message: z
|
|
129
|
+
.string()
|
|
130
|
+
.describe("The error message.")
|
|
131
|
+
.default("Authenticated Extended Card is not configured."),
|
|
132
|
+
}).describe("Represents a JSON-RPC error for an authenticated extended card not configured.");
|
|
133
|
+
/**
|
|
134
|
+
* Union of all well-known A2A and standard JSON-RPC error codes defined in this schema.
|
|
135
|
+
*/
|
|
136
|
+
export const KnownErrorCodeSchema = z.union([
|
|
137
|
+
z.literal(ErrorCodeParseError),
|
|
138
|
+
z.literal(ErrorCodeInvalidRequest),
|
|
139
|
+
z.literal(ErrorCodeMethodNotFound),
|
|
140
|
+
z.literal(ErrorCodeInvalidParams),
|
|
141
|
+
z.literal(ErrorCodeInternalError),
|
|
142
|
+
z.literal(ErrorCodeTaskNotFound),
|
|
143
|
+
z.literal(ErrorCodeTaskNotCancelable),
|
|
144
|
+
z.literal(ErrorCodePushNotificationNotSupported),
|
|
145
|
+
z.literal(ErrorCodeUnsupportedOperation),
|
|
146
|
+
z.literal(ErrorCodeContentTypeNotSupported),
|
|
147
|
+
z.literal(ErrorCodeInvalidAgentResponse),
|
|
148
|
+
z.literal(ErrorCodeAuthenticatedExtendedCardNotConfigured),
|
|
149
|
+
]);
|
|
150
|
+
export const A2AErrorSchema = z.union([
|
|
151
|
+
JSONParseErrorSchema,
|
|
152
|
+
InvalidRequestErrorSchema,
|
|
153
|
+
MethodNotFoundErrorSchema,
|
|
154
|
+
InvalidParamsErrorSchema,
|
|
155
|
+
InternalErrorSchema,
|
|
156
|
+
TaskNotFoundErrorSchema,
|
|
157
|
+
TaskNotCancelableErrorSchema,
|
|
158
|
+
PushNotificationNotSupportedErrorSchema,
|
|
159
|
+
UnsupportedOperationErrorSchema,
|
|
160
|
+
ContentTypeNotSupportedErrorSchema,
|
|
161
|
+
InvalidAgentResponseErrorSchema,
|
|
162
|
+
AuthenticatedExtendedCardNotConfiguredErrorSchema,
|
|
163
|
+
]);
|
|
45
164
|
//# sourceMappingURL=error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../src/types/schemas/a2a/error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../src/types/schemas/a2a/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAK,CAAC;AAC1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;IACpC,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CAAC,oBAAoB,CAAC;SAC9B,OAAO,CAAC,sBAAsB,CAAC;CACnC,CAAC,CAAC,QAAQ,CAAC,qDAAqD,CAAC,CAAC;AAGnE;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAK,CAAC;AAC9C,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IACjE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC;IACxC,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CAAC,oBAAoB,CAAC;SAC9B,OAAO,CAAC,kCAAkC,CAAC;CAC/C,CAAC,CAAC,QAAQ,CAAC,qDAAqD,CAAC,CAAC;AAGnE;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAK,CAAC;AAC9C,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAC,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C;IACjC,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IAChC,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC;IACrC,CAAC,CAAC,OAAO,CAAC,qCAAqC,CAAC;IAChD,CAAC,CAAC,OAAO,CAAC,6BAA6B,CAAC;IACxC,CAAC,CAAC,OAAO,CAAC,gCAAgC,CAAC;IAC3C,CAAC,CAAC,OAAO,CAAC,6BAA6B,CAAC;IACxC,CAAC,CAAC,OAAO,CAAC,+CAA+C,CAAC;CAC3D,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC;IACpC,oBAAoB;IACpB,yBAAyB;IACzB,yBAAyB;IACzB,wBAAwB;IACxB,mBAAmB;IACnB,uBAAuB;IACvB,4BAA4B;IAC5B,uCAAuC;IACvC,+BAA+B;IAC/B,kCAAkC;IAClC,+BAA+B;IAC/B,iDAAiD;CAClD,CAAC,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./kind.js";
|
|
2
|
+
export * from "./auth.js";
|
|
3
|
+
export * from "./error.js";
|
|
2
4
|
export * from "./message.js";
|
|
3
|
-
export * from "./parameters.js";
|
|
4
5
|
export * from "./notification.js";
|
|
5
|
-
export * from "./
|
|
6
|
+
export * from "./parameters.js";
|
|
6
7
|
export * from "./rpc.js";
|
|
7
|
-
export * from "./
|
|
8
|
+
export * from "./task.js";
|
|
9
|
+
export * from "./agent.js";
|
|
10
|
+
export * from "./protocol.js";
|
|
11
|
+
export * from "./transport.js";
|
|
8
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/schemas/a2a/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/schemas/a2a/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
/**
|
|
7
|
+
* @description Represents the type of event that occurred in the context of a task.
|
|
8
|
+
*/
|
|
9
|
+
export const KindSchema = z
|
|
10
|
+
.enum([
|
|
11
|
+
"artifact-update",
|
|
12
|
+
"data",
|
|
13
|
+
"file",
|
|
14
|
+
"message",
|
|
15
|
+
"status-update",
|
|
16
|
+
"task",
|
|
17
|
+
"text",
|
|
18
|
+
])
|
|
19
|
+
.describe("Represents the type of event that occurred in the context of a task.");
|
|
20
|
+
export const Kind = KindSchema.enum;
|
|
21
|
+
//# sourceMappingURL=kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kind.js","sourceRoot":"","sources":["../../../../src/types/schemas/a2a/kind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC;KACxB,IAAI,CAAC;IACJ,iBAAiB;IACjB,MAAM;IACN,MAAM;IACN,SAAS;IACT,eAAe;IACf,MAAM;IACN,MAAM;CACP,CAAC;KACD,QAAQ,CACP,sEAAsE,CACvE,CAAC;AACJ,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC"}
|
|
@@ -1,2 +1,131 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { PushNotificationConfigSchema } from "./notification.js";
|
|
7
|
+
import { MessageSchema } from "./parameters.js";
|
|
8
|
+
import { TaskArtifactUpdateEventSchema, TaskSchema, TaskStatusUpdateEventSchema, } from "./task.js";
|
|
9
|
+
import { JSONRPCErrorResponseSchema, JSONRPCRequestSchema, JSONRPCSuccessResponseSchema, } from "./rpc.js";
|
|
10
|
+
/**
|
|
11
|
+
* @description Defines configuration options for a `message/send` or `message/stream` request.
|
|
12
|
+
*/
|
|
13
|
+
export const MessageSendConfigurationSchema = z
|
|
14
|
+
.object({
|
|
15
|
+
/**
|
|
16
|
+
* @optional A list of output MIME types the client is prepared to accept in the response.
|
|
17
|
+
*/
|
|
18
|
+
acceptedOutputModes: z
|
|
19
|
+
.array(z.string())
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("A list of output MIME types the client is prepared to accept in the response."),
|
|
22
|
+
/**
|
|
23
|
+
* @optional The number of most recent messages from the task's history to retrieve in the response.
|
|
24
|
+
*/
|
|
25
|
+
historyLength: z
|
|
26
|
+
.number()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe("The number of most recent messages from the task's history to retrieve in the response."),
|
|
29
|
+
/**
|
|
30
|
+
* @optional Configuration for the agent to send push notifications for updates after the initial response.
|
|
31
|
+
*/
|
|
32
|
+
pushNotificationConfig: PushNotificationConfigSchema.optional().describe("Configuration for the agent to send push notifications for updates after the initial response."),
|
|
33
|
+
/**
|
|
34
|
+
* @optional If true, the client will wait for the task to complete. The server may reject this if the task is long-running.
|
|
35
|
+
*/
|
|
36
|
+
blocking: z
|
|
37
|
+
.boolean()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("If true, the client will wait for the task to complete. The server may reject this if the task is long-running."),
|
|
40
|
+
})
|
|
41
|
+
.describe("Defines configuration options for a `message/send` or `message/stream` request.");
|
|
42
|
+
/**
|
|
43
|
+
* @description Defines the parameters for a request to send a message to an agent. This can be used
|
|
44
|
+
* to create a new task, continue an existing one, or restart a task.
|
|
45
|
+
*/
|
|
46
|
+
export const MessageSendParamsSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
/**
|
|
49
|
+
* @required The message object being sent to the agent.
|
|
50
|
+
*/
|
|
51
|
+
message: MessageSchema.describe("The message object being sent to the agent."),
|
|
52
|
+
/**
|
|
53
|
+
* @optional Configuration options for the message send request.
|
|
54
|
+
*/
|
|
55
|
+
configuration: MessageSendConfigurationSchema.optional().describe("Configuration options for the message send request."),
|
|
56
|
+
/**
|
|
57
|
+
* @optional Additional metadata to be included with the message.
|
|
58
|
+
*/
|
|
59
|
+
metadata: z
|
|
60
|
+
.record(z.string(), z.unknown())
|
|
61
|
+
.optional()
|
|
62
|
+
.describe("Additional metadata to be included with the message."),
|
|
63
|
+
})
|
|
64
|
+
.describe("Defines the parameters for a request to send a message to an agent. This can be used to create a new task, continue an existing one, or restart a task.");
|
|
65
|
+
/**
|
|
66
|
+
* @description Represents a JSON-RPC request for the `message/send` method.
|
|
67
|
+
*/
|
|
68
|
+
export const SendMessageRequestSchema = JSONRPCRequestSchema.extend({
|
|
69
|
+
method: z.literal("message/send"),
|
|
70
|
+
params: MessageSendParamsSchema.describe("Defines the parameters for a request to send a message to an agent. This can be used to create a new task, continue an existing one, or restart a task."),
|
|
71
|
+
}).describe("Represents a JSON-RPC request for the `message/send` method.");
|
|
72
|
+
/**
|
|
73
|
+
* @description The result of a message send request, which can be a Message or the initial Task object.
|
|
74
|
+
*/
|
|
75
|
+
export const SendMessageSuccessResultSchema = z
|
|
76
|
+
.union([MessageSchema, TaskSchema])
|
|
77
|
+
.describe("The result of a message send request, which can be a Message or the initial Task object.");
|
|
78
|
+
/**
|
|
79
|
+
* @description JSON-RPC success response model for the 'message/send' method.
|
|
80
|
+
*/
|
|
81
|
+
export const SendMessageSuccessResponseSchema = JSONRPCSuccessResponseSchema.extend({
|
|
82
|
+
/**
|
|
83
|
+
* @required The result of the request, which can be a direct reply Message or the initial Task object.
|
|
84
|
+
*/
|
|
85
|
+
result: SendMessageSuccessResultSchema.describe("The result of the request, which can be a direct reply Message or the initial Task object."),
|
|
86
|
+
}).describe("JSON-RPC success response model for the 'message/send' method.");
|
|
87
|
+
/**
|
|
88
|
+
* @description JSON-RPC response model for the 'message/send' method.
|
|
89
|
+
*/
|
|
90
|
+
export const SendMessageResponseSchema = z.union([
|
|
91
|
+
SendMessageSuccessResponseSchema,
|
|
92
|
+
JSONRPCErrorResponseSchema,
|
|
93
|
+
]);
|
|
94
|
+
/**
|
|
95
|
+
* @description Request to send a message/initiate a task and subscribe to streaming updates.
|
|
96
|
+
*/
|
|
97
|
+
export const SendStreamingMessageRequestSchema = JSONRPCRequestSchema.extend({
|
|
98
|
+
method: z.literal("message/stream"),
|
|
99
|
+
params: MessageSendParamsSchema.describe("Defines the parameters for a request to send a message to an agent. This can be used to create a new task, continue an existing one, or restart a task."),
|
|
100
|
+
}).describe("Request to send a message/initiate a task and subscribe to streaming updates.");
|
|
101
|
+
/**
|
|
102
|
+
* @description The result of a streaming message request, which can be a Message, Task, or a streaming update/artifact event.
|
|
103
|
+
*/
|
|
104
|
+
export const SendStreamingMessageSuccessResultSchema = z
|
|
105
|
+
.union([
|
|
106
|
+
MessageSchema,
|
|
107
|
+
TaskSchema,
|
|
108
|
+
TaskStatusUpdateEventSchema,
|
|
109
|
+
TaskArtifactUpdateEventSchema,
|
|
110
|
+
])
|
|
111
|
+
.describe("The result of a streaming message request, which can be a Message, Task, or a streaming update/artifact event.");
|
|
112
|
+
/**
|
|
113
|
+
* @description Represents a successful JSON-RPC response for the `message/stream` method.
|
|
114
|
+
* The server may send multiple response objects for a single request.
|
|
115
|
+
*/
|
|
116
|
+
export const SendStreamingMessageSuccessResponseSchema = JSONRPCSuccessResponseSchema.extend({
|
|
117
|
+
/**
|
|
118
|
+
* @required The result, which can be a Message, Task, or a streaming update event.
|
|
119
|
+
*/
|
|
120
|
+
result: SendStreamingMessageSuccessResultSchema.describe("The result of a streaming message request, which can be a Message, Task, or a streaming update/artifact event."),
|
|
121
|
+
}).describe("Represents a successful JSON-RPC response for the `message/stream` method. The server may send multiple response objects for a single request.");
|
|
122
|
+
/**
|
|
123
|
+
* @description Response to a streaming task operation, either through `message/stream` or a subscription.
|
|
124
|
+
*/
|
|
125
|
+
export const SendStreamingMessageResponseSchema = z
|
|
126
|
+
.union([
|
|
127
|
+
SendStreamingMessageSuccessResponseSchema,
|
|
128
|
+
JSONRPCErrorResponseSchema,
|
|
129
|
+
])
|
|
130
|
+
.describe("Response to a streaming task operation, either through `message/stream` or a subscription.");
|
|
2
131
|
//# sourceMappingURL=message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../src/types/schemas/a2a/message.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../src/types/schemas/a2a/message.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,6BAA6B,EAC7B,UAAU,EACV,2BAA2B,GAC5B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,MAAM,CAAC;IACN;;OAEG;IACH,mBAAmB,EAAE,CAAC;SACnB,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,+EAA+E,CAChF;IACH;;OAEG;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