@artinet/sdk 0.5.4 → 0.5.6
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 +106 -20
- package/README.md +472 -215
- 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 +88 -239
- 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 +2 -1
- package/dist/services/index.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 +2 -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 +4 -0
- package/dist/types/interfaces/services/index.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 +319 -0
- package/dist/types/schemas/a2a/agent.js.map +1 -0
- package/dist/types/schemas/a2a/auth.js +274 -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 +202 -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 +28 -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 +375 -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 +2 -1
- package/dist/types/services/index.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 +33 -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 +4 -0
- package/dist/types/types/interfaces/services/index.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 +509 -0
- package/dist/types/types/schemas/a2a/agent.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/auth.d.ts +285 -0
- package/dist/types/types/schemas/a2a/auth.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/error.d.ts +133 -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 +28 -0
- package/dist/types/types/schemas/a2a/kind.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/message.d.ts +2549 -69
- package/dist/types/types/schemas/a2a/message.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/notification.d.ts +321 -70
- package/dist/types/types/schemas/a2a/notification.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/parameters.d.ts +287 -167
- package/dist/types/types/schemas/a2a/parameters.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/protocol.d.ts +3207 -0
- package/dist/types/types/schemas/a2a/protocol.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/rpc.d.ts +42 -89
- package/dist/types/types/schemas/a2a/rpc.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/task.d.ts +1460 -214
- package/dist/types/types/schemas/a2a/task.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/transport.d.ts +28 -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 +508 -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.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.js +40 -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 +16 -5
- 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/services/mcp/index.js +0 -2
- package/dist/services/mcp/index.js.map +0 -1
- package/dist/services/mcp/service.js +0 -75
- package/dist/services/mcp/service.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/index.d.ts +0 -2
- package/dist/types/services/mcp/index.d.ts.map +0 -1
- package/dist/types/services/mcp/service.d.ts +0 -30
- package/dist/types/services/mcp/service.d.ts.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,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { type Task, type Message, type MessageSendConfiguration } from "../../../schemas/a2a/index.js";
|
|
6
|
+
import { A2AEngine } from "./engine.js";
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Task now has a history property.
|
|
9
|
+
* Represents a task and its associated message history.
|
|
10
|
+
*/
|
|
11
|
+
export interface TaskAndHistory {
|
|
12
|
+
/** The task object */
|
|
13
|
+
task: Task;
|
|
14
|
+
/** The complete message history associated with the task */
|
|
15
|
+
history: Message[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use the Store interface instead.
|
|
19
|
+
* @description Interface for task storage providers.
|
|
20
|
+
* Abstracts the storage mechanism for tasks and their message history.
|
|
21
|
+
*/
|
|
22
|
+
export interface TaskStore {
|
|
23
|
+
/**
|
|
24
|
+
* Saves a task and its associated message history.
|
|
25
|
+
* Overwrites existing data if the task ID exists.
|
|
26
|
+
* @param data An object containing the task and its history.
|
|
27
|
+
* @returns A promise resolving when the save operation is complete.
|
|
28
|
+
*/
|
|
29
|
+
save(data: TaskAndHistory): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Loads a task and its history by task ID.
|
|
32
|
+
* @param taskId The ID of the task to load.
|
|
33
|
+
* @returns A promise resolving to an object containing the Task and its history, or null if not found.
|
|
34
|
+
*/
|
|
35
|
+
load(taskId: string): Promise<TaskAndHistory | null>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated This interface will be removed in the future. Use ExecutionContext instead.
|
|
39
|
+
* Context object provided to the TaskHandler.
|
|
40
|
+
* Contains the information needed for the handler to process the task.
|
|
41
|
+
*/
|
|
42
|
+
export interface TaskContext {
|
|
43
|
+
/**
|
|
44
|
+
* The context ID of the task.
|
|
45
|
+
*/
|
|
46
|
+
contextId: string;
|
|
47
|
+
/**
|
|
48
|
+
* The current state of the task when the handler is invoked or resumed.
|
|
49
|
+
* This is a snapshot - the latest state may need to be reloaded during async operations.
|
|
50
|
+
*/
|
|
51
|
+
task: Task;
|
|
52
|
+
/**
|
|
53
|
+
* The specific user message that triggered this handler invocation or resumption.
|
|
54
|
+
*/
|
|
55
|
+
userMessage: Message;
|
|
56
|
+
/**
|
|
57
|
+
* Function to check if cancellation has been requested for this task.
|
|
58
|
+
* Handlers should check this periodically during long-running operations.
|
|
59
|
+
* @returns True if cancellation has been requested, false otherwise.
|
|
60
|
+
*/
|
|
61
|
+
isCancelled(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The message history associated with the task up to the point the handler is invoked.
|
|
64
|
+
*/
|
|
65
|
+
history: Message[];
|
|
66
|
+
/**
|
|
67
|
+
* @description The latest user message that triggered this handler invocation or resumption.
|
|
68
|
+
* @note It's unclear whether this is necessary as userMessage already exists
|
|
69
|
+
*/
|
|
70
|
+
latestUserMessage?: Message;
|
|
71
|
+
/**
|
|
72
|
+
* The configuration for the task.
|
|
73
|
+
*/
|
|
74
|
+
configuration?: MessageSendConfiguration;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Defines the signature for a task handler function.
|
|
78
|
+
*
|
|
79
|
+
* Handlers are implemented as async generators. They receive context about the
|
|
80
|
+
* task and the triggering message. They perform work and yield status
|
|
81
|
+
* or artifact updates (TaskYieldUpdate). The server consumes these yields,
|
|
82
|
+
* updates the task state in the store, and streams events if applicable.
|
|
83
|
+
*
|
|
84
|
+
* @param context The TaskContext object containing task details and state.
|
|
85
|
+
* @yields Updates to the task's status or artifacts.
|
|
86
|
+
* @returns Optionally returns the final complete Task object (needed for non-streaming 'message/send').
|
|
87
|
+
* If void is returned, the server uses the last known state after processing all yields.
|
|
88
|
+
*/
|
|
89
|
+
export type TaskHandler = A2AEngine;
|
|
90
|
+
//# sourceMappingURL=legacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../../../../../../src/types/interfaces/services/a2a/legacy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,wBAAwB,EAC9B,sCAAqC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,sBAAsB;IACtB,IAAI,EAAE,IAAI,CAAC;IAEX,4DAA4D;IAC5D,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1C;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CACtD;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,WAAW,IAAI,OAAO,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,wBAAwB,CAAC;CAC1C;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview A2A Service Interface Definitions
|
|
7
|
+
*
|
|
8
|
+
* This module defines interfaces for Agent-to-Agent (A2A) service implementations,
|
|
9
|
+
* including factory parameters, method options, and the main service interface.
|
|
10
|
+
* It extends the core service framework with A2A-specific functionality for
|
|
11
|
+
* agent communication, task management, and message handling.
|
|
12
|
+
*
|
|
13
|
+
* @module A2AService
|
|
14
|
+
* @version 1.0.0
|
|
15
|
+
* @since 0.5.6
|
|
16
|
+
* @author The Artinet Project
|
|
17
|
+
*/
|
|
18
|
+
import { ConnectionManagerInterface, CancellationManagerInterface, ContextManagerInterface, ServiceInterface, TaskManagerInterface, EventManagerOptions } from "../core/index.js";
|
|
19
|
+
import { AgentCard, MessageSendParams, SendMessageSuccessResult, Task, TaskIdParams } from "../../../schemas/a2a/index.js";
|
|
20
|
+
import { UpdateEvent, Command, State, Update } from "./context.js";
|
|
21
|
+
import { A2AEngine } from "./engine.js";
|
|
22
|
+
/**
|
|
23
|
+
* Configuration parameters for creating A2A service instances.
|
|
24
|
+
*
|
|
25
|
+
* This interface defines the required and optional components needed to
|
|
26
|
+
* instantiate an A2A service, including the agent identity, execution engine,
|
|
27
|
+
* and various manager interfaces for handling different aspects of A2A operations.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const factoryParams: FactoryParams = {
|
|
32
|
+
* agentCard: {
|
|
33
|
+
* id: 'agent-123',
|
|
34
|
+
* name: 'MyAgent',
|
|
35
|
+
* capabilities: ['messaging', 'task-processing']
|
|
36
|
+
* },
|
|
37
|
+
* engine: createA2AEngine(),
|
|
38
|
+
* contexts: createContextManager(),
|
|
39
|
+
* connections: createConnectionManager(),
|
|
40
|
+
* methods: {
|
|
41
|
+
* sendMessage: customSendMessage,
|
|
42
|
+
* getTask: customGetTask
|
|
43
|
+
* }
|
|
44
|
+
* };
|
|
45
|
+
*
|
|
46
|
+
* const service = createA2AService(factoryParams);
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
* @since 0.5.6
|
|
51
|
+
*/
|
|
52
|
+
export interface FactoryParams {
|
|
53
|
+
/** Agent identity and capabilities information */
|
|
54
|
+
agentCard: AgentCard;
|
|
55
|
+
/** Execution engine for processing A2A commands */
|
|
56
|
+
engine: A2AEngine;
|
|
57
|
+
/** Optional context manager for execution state management */
|
|
58
|
+
contexts?: ContextManagerInterface<Command, State, Update>;
|
|
59
|
+
/** Optional connection manager for agent connections */
|
|
60
|
+
connections?: ConnectionManagerInterface;
|
|
61
|
+
/** Optional cancellation manager for handling operation cancellations */
|
|
62
|
+
cancellations?: CancellationManagerInterface;
|
|
63
|
+
/** Optional task manager for task lifecycle management */
|
|
64
|
+
tasks?: TaskManagerInterface<State>;
|
|
65
|
+
/** Optional custom method implementations */
|
|
66
|
+
methods?: Partial<MethodOptions>;
|
|
67
|
+
/** Optional event manager configuration overrides */
|
|
68
|
+
events?: EventManagerOptions<Command, State, Update>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Parameters passed to A2A method implementations.
|
|
72
|
+
*
|
|
73
|
+
* This interface defines the dependencies and context information that
|
|
74
|
+
* method implementations receive when they are invoked. It provides access
|
|
75
|
+
* to the service instance, execution engine, context management, and
|
|
76
|
+
* cancellation mechanisms.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* const customSendMessage = async (
|
|
81
|
+
* message: MessageSendParams,
|
|
82
|
+
* params: MethodParams
|
|
83
|
+
* ): Promise<SendMessageSuccessResult> => {
|
|
84
|
+
* const { service, engine, contextManager, signal } = params;
|
|
85
|
+
*
|
|
86
|
+
* // Create execution context
|
|
87
|
+
* const context = contextManager.createContext(message);
|
|
88
|
+
*
|
|
89
|
+
* // Check for cancellation
|
|
90
|
+
* if (signal.aborted) {
|
|
91
|
+
* throw new Error('Operation cancelled');
|
|
92
|
+
* }
|
|
93
|
+
*
|
|
94
|
+
* // Execute message sending
|
|
95
|
+
* return await service.execute(engine, context);
|
|
96
|
+
* };
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @public
|
|
100
|
+
* @since 0.5.6
|
|
101
|
+
*/
|
|
102
|
+
export interface MethodParams {
|
|
103
|
+
/** The A2A service instance */
|
|
104
|
+
service: A2AServiceInterface<Command, State, Update>;
|
|
105
|
+
/** The execution engine for processing */
|
|
106
|
+
engine: A2AEngine;
|
|
107
|
+
/** Context manager for execution state */
|
|
108
|
+
contextManager: ContextManagerInterface<Command, State, Update>;
|
|
109
|
+
/** Abort signal for cancellation handling */
|
|
110
|
+
signal: AbortSignal;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Custom method implementation options for A2A services.
|
|
114
|
+
*
|
|
115
|
+
* This interface allows customization of core A2A operations by providing
|
|
116
|
+
* alternative implementations for task management, message handling, and
|
|
117
|
+
* streaming operations. Each method can be individually overridden to
|
|
118
|
+
* provide custom behavior while maintaining the standard interface.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const customMethods: MethodOptions = {
|
|
123
|
+
* sendMessage: async (message, params) => {
|
|
124
|
+
* // Custom message sending logic
|
|
125
|
+
* console.log(`Sending message to: ${message.recipient}`);
|
|
126
|
+
* const result = await defaultSendMessage(message, params);
|
|
127
|
+
* console.log(`Message sent with ID: ${result.messageId}`);
|
|
128
|
+
* return result;
|
|
129
|
+
* },
|
|
130
|
+
*
|
|
131
|
+
* getTask: async (input, params) => {
|
|
132
|
+
* // Custom task retrieval with caching
|
|
133
|
+
* const cached = taskCache.get(input.taskId);
|
|
134
|
+
* if (cached) return cached;
|
|
135
|
+
*
|
|
136
|
+
* const task = await defaultGetTask(input, params);
|
|
137
|
+
* taskCache.set(input.taskId, task);
|
|
138
|
+
* return task;
|
|
139
|
+
* }
|
|
140
|
+
* };
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* @public
|
|
144
|
+
* @since 0.5.6
|
|
145
|
+
*/
|
|
146
|
+
export interface MethodOptions {
|
|
147
|
+
/**
|
|
148
|
+
* Custom task retrieval implementation.
|
|
149
|
+
*
|
|
150
|
+
* @param input - Task identification parameters
|
|
151
|
+
* @param params - Method execution parameters (without engine, contextManager, signal)
|
|
152
|
+
* @returns Promise resolving to the requested task
|
|
153
|
+
*/
|
|
154
|
+
getTask: (input: TaskIdParams, params: Omit<MethodParams, "engine" | "contextManager" | "signal">) => Promise<Task>;
|
|
155
|
+
/**
|
|
156
|
+
* Task cancellation.
|
|
157
|
+
*
|
|
158
|
+
* @param input - Task identification parameters
|
|
159
|
+
* @param params - Method execution parameters (without engine, signal)
|
|
160
|
+
* @returns Promise resolving to the cancelled task
|
|
161
|
+
*/
|
|
162
|
+
cancelTask: (input: TaskIdParams, params: Omit<MethodParams, "engine" | "signal">) => Promise<Task>;
|
|
163
|
+
/**
|
|
164
|
+
* Message sending.
|
|
165
|
+
*
|
|
166
|
+
* @param message - Message parameters to send
|
|
167
|
+
* @param params - Full method execution parameters
|
|
168
|
+
* @returns Promise resolving to send operation result
|
|
169
|
+
*/
|
|
170
|
+
sendMessage: (message: MessageSendParams, params: MethodParams) => Promise<SendMessageSuccessResult>;
|
|
171
|
+
/**
|
|
172
|
+
* Streaming messages.
|
|
173
|
+
*
|
|
174
|
+
* @param message - Message parameters to send
|
|
175
|
+
* @param params - Full method execution parameters
|
|
176
|
+
* @returns AsyncGenerator yielding update events
|
|
177
|
+
*/
|
|
178
|
+
streamMessage: (message: MessageSendParams, params: MethodParams) => AsyncGenerator<UpdateEvent>;
|
|
179
|
+
/**
|
|
180
|
+
* Resubscription.
|
|
181
|
+
*
|
|
182
|
+
* @param input - Task identification parameters
|
|
183
|
+
* @param params - Full method execution parameters
|
|
184
|
+
* @returns AsyncGenerator yielding update events
|
|
185
|
+
*/
|
|
186
|
+
resubscribe: (input: TaskIdParams, params: MethodParams) => AsyncGenerator<UpdateEvent>;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Public interface for A2A service methods.
|
|
190
|
+
*
|
|
191
|
+
* This interface defines the public API that consumers of A2A services
|
|
192
|
+
* can use to interact with agents. It provides simplified method signatures
|
|
193
|
+
* that hide internal complexity while exposing the essential functionality
|
|
194
|
+
* for agent-to-agent communication.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* // Using the methods interface
|
|
199
|
+
* const service: MethodsInterface = createA2AService(params);
|
|
200
|
+
*
|
|
201
|
+
* // Get a task
|
|
202
|
+
* const task = await service.getTask({ taskId: 'task-123' });
|
|
203
|
+
*
|
|
204
|
+
* // Send a message
|
|
205
|
+
* const result = await service.sendMessage({
|
|
206
|
+
* recipient: 'agent-456',
|
|
207
|
+
* content: 'Hello, how are you?'
|
|
208
|
+
* });
|
|
209
|
+
*
|
|
210
|
+
* // Stream messages for real-time updates
|
|
211
|
+
* for await (const update of service.streamMessage({
|
|
212
|
+
* recipient: 'agent-456',
|
|
213
|
+
* content: 'Processing your request...'
|
|
214
|
+
* })) {
|
|
215
|
+
* console.log('Update:', update);
|
|
216
|
+
* }
|
|
217
|
+
* ```
|
|
218
|
+
*
|
|
219
|
+
* @public
|
|
220
|
+
* @since 0.5.6
|
|
221
|
+
*/
|
|
222
|
+
export interface MethodsInterface {
|
|
223
|
+
/**
|
|
224
|
+
* Retrieves a task by its ID.
|
|
225
|
+
*
|
|
226
|
+
* @param input - Task identification parameters
|
|
227
|
+
* @returns Promise resolving to the requested task
|
|
228
|
+
*/
|
|
229
|
+
getTask: (input: TaskIdParams) => Promise<Task>;
|
|
230
|
+
/**
|
|
231
|
+
* Cancels a task by its ID.
|
|
232
|
+
*
|
|
233
|
+
* @param input - Task identification parameters
|
|
234
|
+
* @returns Promise resolving to the cancelled task
|
|
235
|
+
*/
|
|
236
|
+
cancelTask: (input: TaskIdParams) => Promise<Task>;
|
|
237
|
+
/**
|
|
238
|
+
* Sends a message to another agent.
|
|
239
|
+
*
|
|
240
|
+
* @param message - Message parameters to send
|
|
241
|
+
* @param params - Optional execution parameters
|
|
242
|
+
* @returns Promise resolving to send operation result
|
|
243
|
+
*/
|
|
244
|
+
sendMessage: (message: MessageSendParams, params?: Partial<Omit<MethodParams, "service" | "contextManager">>) => Promise<SendMessageSuccessResult>;
|
|
245
|
+
/**
|
|
246
|
+
* Sends a message with streaming updates.
|
|
247
|
+
*
|
|
248
|
+
* @param message - Message parameters to send
|
|
249
|
+
* @param params - Optional execution parameters
|
|
250
|
+
* @returns AsyncGenerator yielding update events
|
|
251
|
+
*/
|
|
252
|
+
streamMessage: (message: MessageSendParams, params?: Partial<Omit<MethodParams, "service" | "contextManager">>) => AsyncGenerator<UpdateEvent>;
|
|
253
|
+
/**
|
|
254
|
+
* Resubscribes to updates for a specific task.
|
|
255
|
+
*
|
|
256
|
+
* @param input - Task identification parameters
|
|
257
|
+
* @param params - Optional execution parameters
|
|
258
|
+
* @returns AsyncGenerator yielding update events
|
|
259
|
+
*/
|
|
260
|
+
resubscribe: (input: TaskIdParams, params?: Partial<Omit<MethodParams, "service" | "contextManager">>) => AsyncGenerator<UpdateEvent>;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Main interface for A2A service implementations.
|
|
264
|
+
*
|
|
265
|
+
* This interface extends the core ServiceInterface and MethodsInterface to provide
|
|
266
|
+
* a complete A2A service implementation. It includes agent identity management,
|
|
267
|
+
* connection tracking, cancellation handling, and state management capabilities
|
|
268
|
+
* specific to agent-to-agent communication scenarios.
|
|
269
|
+
*
|
|
270
|
+
* @template TCommand - The command type, must extend Command
|
|
271
|
+
* @template TState - The state type, must extend State
|
|
272
|
+
* @template TUpdate - The update type, must extend Update
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```typescript
|
|
276
|
+
* class MyA2AService implements A2AServiceInterface {
|
|
277
|
+
* constructor(
|
|
278
|
+
* public agentCard: AgentCard,
|
|
279
|
+
* private engine: A2AEngine
|
|
280
|
+
* ) {}
|
|
281
|
+
*
|
|
282
|
+
* async execute(engine, context) {
|
|
283
|
+
* // Handle execution
|
|
284
|
+
* }
|
|
285
|
+
*
|
|
286
|
+
* async sendMessage(message, params) {
|
|
287
|
+
* // Handle message sending
|
|
288
|
+
* }
|
|
289
|
+
*
|
|
290
|
+
* addConnection(id: string) {
|
|
291
|
+
* this.connections.add(id);
|
|
292
|
+
* console.log(`Added connection: ${id}`);
|
|
293
|
+
* }
|
|
294
|
+
*
|
|
295
|
+
* // ... implement other methods
|
|
296
|
+
* }
|
|
297
|
+
* ```
|
|
298
|
+
*
|
|
299
|
+
* @public
|
|
300
|
+
* @since 0.5.6
|
|
301
|
+
*/
|
|
302
|
+
export interface A2AServiceInterface<TCommand extends Command = Command, TState extends State = State, TUpdate extends Update = Update> extends ServiceInterface<TCommand, TState, TUpdate>, MethodsInterface {
|
|
303
|
+
/**
|
|
304
|
+
* Optional event manager configuration overrides.
|
|
305
|
+
*
|
|
306
|
+
* When present, these overrides customize the default event handling
|
|
307
|
+
* behavior for this service instance.
|
|
308
|
+
*/
|
|
309
|
+
readonly eventOverrides: EventManagerOptions<TCommand, TState, TUpdate> | undefined;
|
|
310
|
+
/**
|
|
311
|
+
* Agent identity and capabilities information.
|
|
312
|
+
*
|
|
313
|
+
* This card identifies the agent and describes its capabilities,
|
|
314
|
+
* which is used for agent discovery and capability matching.
|
|
315
|
+
*/
|
|
316
|
+
agentCard: AgentCard;
|
|
317
|
+
/**
|
|
318
|
+
* Adds a connection to the active connections registry.
|
|
319
|
+
*
|
|
320
|
+
* @param id - Unique identifier for the connection
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```typescript
|
|
324
|
+
* service.addConnection('connection-123');
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
addConnection: (id: string) => void;
|
|
328
|
+
/**
|
|
329
|
+
* Removes a connection from the active connections registry.
|
|
330
|
+
*
|
|
331
|
+
* @param id - Unique identifier for the connection
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```typescript
|
|
335
|
+
* service.removeConnection('connection-123');
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
338
|
+
removeConnection: (id: string) => void;
|
|
339
|
+
/**
|
|
340
|
+
* Checks if a specific execution context has been cancelled.
|
|
341
|
+
*
|
|
342
|
+
* @param id - Context or execution identifier
|
|
343
|
+
* @returns True if cancelled, false otherwise
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```typescript
|
|
347
|
+
* if (service.isCancelled('context-123')) {
|
|
348
|
+
* console.log('Execution was cancelled');
|
|
349
|
+
* return;
|
|
350
|
+
* }
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
isCancelled: (id: string) => boolean;
|
|
354
|
+
/**
|
|
355
|
+
* Adds a cancellation marker for a specific execution context.
|
|
356
|
+
*
|
|
357
|
+
* @param id - Context or execution identifier to cancel
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* ```typescript
|
|
361
|
+
* service.addCancellation('context-123');
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
addCancellation: (id: string) => void;
|
|
365
|
+
/**
|
|
366
|
+
* Removes a cancellation marker for a specific execution context.
|
|
367
|
+
*
|
|
368
|
+
* @param id - Context or execution identifier
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* ```typescript
|
|
372
|
+
* service.removeCancellation('context-123');
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
removeCancellation: (id: string) => void;
|
|
376
|
+
/**
|
|
377
|
+
* Retrieves the current state for a specific Task.
|
|
378
|
+
*
|
|
379
|
+
* @param id - Task identifier
|
|
380
|
+
* @returns Promise resolving to the state, or undefined if not found
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```typescript
|
|
384
|
+
* const state = await service.getState('task-123');
|
|
385
|
+
* if (state) {
|
|
386
|
+
* console.log('Current progress:', state.progress);
|
|
387
|
+
* }
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
getState: (id: string) => Promise<TState | undefined>;
|
|
391
|
+
/**
|
|
392
|
+
* Sets the state for a specific Task.
|
|
393
|
+
*
|
|
394
|
+
* @param id - Task identifier
|
|
395
|
+
* @param data - The state data to store
|
|
396
|
+
* @returns Promise that resolves when state is saved
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```typescript
|
|
400
|
+
* await service.setState('task-123', {
|
|
401
|
+
* progress: 0.75,
|
|
402
|
+
* status: 'processing',
|
|
403
|
+
* data: processedResults
|
|
404
|
+
* });
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
setState: (id: string, data: TState) => Promise<void>;
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../../src/types/interfaces/services/a2a/service.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Artinet Project
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { CoreCommand } from "./types.js";
|
|
6
|
+
import { EventEmitter } from "events";
|
|
7
|
+
export interface CommandChannelMap<TCommand extends CoreCommand = CoreCommand> {
|
|
8
|
+
send: [TCommand];
|
|
9
|
+
close: [];
|
|
10
|
+
}
|
|
11
|
+
export interface SendCommandInterface<TCommand extends CoreCommand = CoreCommand> {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
send(command: TCommand): void;
|
|
14
|
+
}
|
|
15
|
+
export interface ReceiveCommandInterface<TCommand extends CoreCommand = CoreCommand> extends AsyncIterable<TCommand, TCommand, TCommand | undefined>, EventEmitter<CommandChannelMap<TCommand>> {
|
|
16
|
+
command: TCommand;
|
|
17
|
+
commandList: TCommand[];
|
|
18
|
+
close(): void;
|
|
19
|
+
next(): Promise<IteratorResult<TCommand>>;
|
|
20
|
+
return(value: TCommand): Promise<IteratorResult<TCommand>>;
|
|
21
|
+
}
|
|
22
|
+
export type ReceiveCommandProxyInterface<TCommand extends CoreCommand = CoreCommand> = ReceiveCommandInterface<TCommand> & TCommand;
|
|
23
|
+
export interface CommandChannelInterface<TCommand extends CoreCommand = CoreCommand> extends ReceiveCommandInterface<TCommand>, SendCommandInterface<TCommand> {
|
|
24
|
+
}
|
|
25
|
+
export type CommandChannelProxyInterface<TCommand extends CoreCommand = CoreCommand> = CommandChannelInterface<TCommand> & TCommand;
|
|
26
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../../../src/types/interfaces/services/core/context/command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,WAAW,iBAAiB,CAAC,QAAQ,SAAS,WAAW,GAAG,WAAW;IAC3E,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC;IACjB,KAAK,EAAE,EAAE,CAAC;CACX;AAED,MAAM,WAAW,oBAAoB,CACnC,QAAQ,SAAS,WAAW,GAAG,WAAW;IAE1C,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB,CACtC,QAAQ,SAAS,WAAW,GAAG,WAAW,CAC1C,SAAQ,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC,EAC7D,YAAY,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC3C,OAAO,EAAE,QAAQ,CAAC;IAClB,WAAW,EAAE,QAAQ,EAAE,CAAC;IACxB,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC5D;AAED,MAAM,MAAM,4BAA4B,CACtC,QAAQ,SAAS,WAAW,GAAG,WAAW,IACxC,uBAAuB,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AAEjD,MAAM,WAAW,uBAAuB,CACtC,QAAQ,SAAS,WAAW,GAAG,WAAW,CAC1C,SAAQ,uBAAuB,CAAC,QAAQ,CAAC,EACvC,oBAAoB,CAAC,QAAQ,CAAC;CAAG;AAErC,MAAM,MAAM,4BAA4B,CACtC,QAAQ,SAAS,WAAW,GAAG,WAAW,IACxC,uBAAuB,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC"}
|