@artinet/sdk 0.5.5 → 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 +471 -214
- 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
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { processUpdate } from "../../server/lib/state.js";
|
|
2
|
-
import { FAILED_UPDATE, INTERNAL_ERROR } from "../../utils/common/errors.js";
|
|
3
|
-
import { logError } from "../../utils/logging/log.js";
|
|
4
|
-
/**
|
|
5
|
-
* Sets up a Server-Sent Events stream with appropriate headers
|
|
6
|
-
* and initializes tracking for the stream.
|
|
7
|
-
*
|
|
8
|
-
* @param res The Express Response object
|
|
9
|
-
* @param taskId The task ID to associate with this stream
|
|
10
|
-
* @param reqId The request ID for acknowledgment
|
|
11
|
-
* @param initialStatus Optional initial status to send
|
|
12
|
-
* @param addStreamMethod Function to add stream to tracking
|
|
13
|
-
* @param sendSseMethod Function to send SSE events
|
|
14
|
-
*/
|
|
15
|
-
export function setupSseStream(res, taskId, initialStatus, addStreamMethod) {
|
|
16
|
-
// Set up SSE stream headers
|
|
17
|
-
res.setHeader("Content-Type", "text/event-stream");
|
|
18
|
-
res.setHeader("Cache-Control", "no-cache");
|
|
19
|
-
res.setHeader("Connection", "keep-alive");
|
|
20
|
-
// Track this stream for potential cancellation if tracking method provided
|
|
21
|
-
if (addStreamMethod) {
|
|
22
|
-
addStreamMethod(taskId, res);
|
|
23
|
-
}
|
|
24
|
-
// Send initial status if provided
|
|
25
|
-
if (initialStatus) {
|
|
26
|
-
sendSSEEvent(res, taskId, initialStatus);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Sends a Server-Sent Event with task data.
|
|
31
|
-
* @param res The Express Response object
|
|
32
|
-
* @param reqId The request ID
|
|
33
|
-
* @param eventData The event data to send
|
|
34
|
-
*/
|
|
35
|
-
export function sendSSEEvent(res, id, update) {
|
|
36
|
-
if (!res.writable) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const response = {
|
|
40
|
-
jsonrpc: "2.0",
|
|
41
|
-
id: id,
|
|
42
|
-
result: update,
|
|
43
|
-
};
|
|
44
|
-
res.write(`data: ${JSON.stringify(response)}\n\n`);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Sends a Server-Sent Event with error data.
|
|
48
|
-
* @param res The Express Response object
|
|
49
|
-
* @param reqId The request ID
|
|
50
|
-
* @param error The error to send
|
|
51
|
-
*/
|
|
52
|
-
export function sendSSEError(res, error) {
|
|
53
|
-
if (!res.writable) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const response = {
|
|
57
|
-
jsonrpc: "2.0",
|
|
58
|
-
error: error,
|
|
59
|
-
};
|
|
60
|
-
res.write(`data: ${JSON.stringify(response)}\n\n`);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Processes a task stream, handling generator yields and sending SSE events.
|
|
64
|
-
* @param req The request object
|
|
65
|
-
* @param res The response object
|
|
66
|
-
* @param taskId The task ID
|
|
67
|
-
* @param context The task context
|
|
68
|
-
* @param initialData The initial task data
|
|
69
|
-
*/
|
|
70
|
-
export async function processTaskStream(context, taskStore, engine, res, taskId, initialData, onCancel, onEnd, executionContext) {
|
|
71
|
-
let currentData = initialData;
|
|
72
|
-
const generator = engine(executionContext);
|
|
73
|
-
try {
|
|
74
|
-
for await (const yieldValue of generator) {
|
|
75
|
-
if (context.isCancelled()) {
|
|
76
|
-
await onCancel(context, currentData, res);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
currentData = await processUpdate(taskStore, {
|
|
80
|
-
context: context,
|
|
81
|
-
current: currentData,
|
|
82
|
-
update: yieldValue,
|
|
83
|
-
});
|
|
84
|
-
context.task = currentData.task;
|
|
85
|
-
sendSSEEvent(res, taskId, yieldValue);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
try {
|
|
90
|
-
const failedUpdate = FAILED_UPDATE(taskId, context.contextId, "failed-update", error instanceof Error ? error.message : String(error));
|
|
91
|
-
currentData = await processUpdate(taskStore, {
|
|
92
|
-
context: context,
|
|
93
|
-
current: currentData,
|
|
94
|
-
update: failedUpdate,
|
|
95
|
-
});
|
|
96
|
-
sendSSEEvent(res, taskId, failedUpdate);
|
|
97
|
-
}
|
|
98
|
-
catch (saveError) {
|
|
99
|
-
logError("A2AServer", "Failed to save error state for streaming task", saveError, { taskId, originalError: error });
|
|
100
|
-
}
|
|
101
|
-
sendSSEError(res, INTERNAL_ERROR(`Task execution error: ${error instanceof Error ? error.message : String(error)}`));
|
|
102
|
-
}
|
|
103
|
-
finally {
|
|
104
|
-
onEnd(taskId, res);
|
|
105
|
-
if (!res.writableEnded) {
|
|
106
|
-
res.write("event: close\ndata: {}\n\n");
|
|
107
|
-
res.end();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=stream.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../src/transport/streaming/stream.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAQ1D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAMtD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAC5B,GAAa,EACb,MAAc,EACd,aAAwB,EACxB,eAAyD;IAEzD,4BAA4B;IAC5B,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;IACnD,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IAC3C,GAAG,CAAC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAC1C,2EAA2E;IAC3E,IAAI,eAAe,EAAE,CAAC;QACpB,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IACD,kCAAkC;I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AC,KAAK,CAAC,4BAA4B,CAAC,CAAC;YACxC,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/types/client.js
DELETED
package/dist/types/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/types/client.ts"],"names":[],"mappings":""}
|
package/dist/types/express.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"express.js","sourceRoot":"","sources":["../../src/types/express.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains Artinet-specific schema definitions separate from the A2A protocol.
|
|
3
|
-
* These are extensions to the standard A2A protocol defined by Google:
|
|
4
|
-
* @see https://github.com/google/A2A/blob/main/samples/js/src/schema.ts
|
|
5
|
-
*/
|
|
6
|
-
export * from "./schemas/a2a/index.js";
|
|
7
|
-
//# sourceMappingURL=extended-schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extended-schema.js","sourceRoot":"","sources":["../../src/types/extended-schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyNH,cAAc,wBAAwB,CAAC"}
|
package/dist/types/proxy.js
DELETED
package/dist/types/proxy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/types/proxy.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../src/types/schemas/a2a/auth/auth.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/types/schemas/a2a/auth/base.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/schemas/a2a/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../../../src/types/schemas/a2a/auth/oauth.ts"],"names":[],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Represents the possible states of a Task.
|
|
9
|
-
*
|
|
10
|
-
* This interface was referenced by `MySchema`'s JSON-Schema
|
|
11
|
-
* via the `definition` "TaskState".
|
|
12
|
-
*/
|
|
13
|
-
export var TaskState;
|
|
14
|
-
(function (TaskState) {
|
|
15
|
-
TaskState["Submitted"] = "submitted";
|
|
16
|
-
TaskState["Working"] = "working";
|
|
17
|
-
TaskState["InputRequired"] = "input-required";
|
|
18
|
-
TaskState["Completed"] = "completed";
|
|
19
|
-
TaskState["Canceled"] = "canceled";
|
|
20
|
-
TaskState["Failed"] = "failed";
|
|
21
|
-
TaskState["Rejected"] = "rejected";
|
|
22
|
-
TaskState["AuthRequired"] = "auth-required";
|
|
23
|
-
TaskState["Unknown"] = "unknown";
|
|
24
|
-
})(TaskState || (TaskState = {}));
|
|
25
|
-
//# sourceMappingURL=ref.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../../src/types/schemas/a2a/ref.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;GAIG;AAyiEH;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SAUX;AAVD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,gCAAmB,CAAA;IACnB,6CAAgC,CAAA;IAChC,oCAAuB,CAAA;IACvB,kCAAqB,CAAA;IACrB,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,2CAA8B,CAAA;IAC9B,gCAAmB,CAAA;AACrB,CAAC,EAVW,SAAS,KAAT,SAAS,QAUpB"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import express, { Response } from "express";
|
|
2
|
-
import { CorsOptions } from "cors";
|
|
3
|
-
import http from "http";
|
|
4
|
-
import type { AgentCard, Task, Message, SendStreamingMessageRequest, TaskResubscriptionRequest, MessageSendConfiguration } from "../types/index.js";
|
|
5
|
-
import { TaskStore, TaskAndHistory } from "./interfaces/store.js";
|
|
6
|
-
import { TaskHandler, TaskContext } from "../types/index.js";
|
|
7
|
-
import { A2AServerParams, JSONRPCServerType } from "./interfaces/params.js";
|
|
8
|
-
import { Server } from "./interfaces/server.js";
|
|
9
|
-
import { ExpressServer } from "./lib/express-server.js";
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Use ExpressServer instead.
|
|
12
|
-
* Implements an A2A protocol compliant server using Express.
|
|
13
|
-
* Handles task creation, streaming, cancellation and more.
|
|
14
|
-
* Uses Jayson for JSON-RPC handling.
|
|
15
|
-
*/
|
|
16
|
-
export declare class A2AServer implements Server {
|
|
17
|
-
protected expressServer: ExpressServer;
|
|
18
|
-
/**
|
|
19
|
-
* Returns the base path for the server
|
|
20
|
-
*/
|
|
21
|
-
getBasePath(): string;
|
|
22
|
-
/**
|
|
23
|
-
* Returns the CORS options for the server
|
|
24
|
-
*/
|
|
25
|
-
getCorsOptions(): CorsOptions;
|
|
26
|
-
/**
|
|
27
|
-
* Returns the agent card for the server
|
|
28
|
-
*/
|
|
29
|
-
getCard(): AgentCard;
|
|
30
|
-
/**
|
|
31
|
-
* Returns the task store
|
|
32
|
-
*/
|
|
33
|
-
getTaskStore(): TaskStore;
|
|
34
|
-
/**
|
|
35
|
-
* Returns the task handler
|
|
36
|
-
*/
|
|
37
|
-
getTaskHandler(): TaskHandler;
|
|
38
|
-
/**
|
|
39
|
-
* Returns the set of active cancellations
|
|
40
|
-
*/
|
|
41
|
-
getActiveCancellations(): Set<string>;
|
|
42
|
-
/**
|
|
43
|
-
* Returns the map of active streams
|
|
44
|
-
*/
|
|
45
|
-
getActiveStreams(): Map<string, Response[]>;
|
|
46
|
-
/**
|
|
47
|
-
* Returns the port number
|
|
48
|
-
*/
|
|
49
|
-
getPort(): number;
|
|
50
|
-
/**
|
|
51
|
-
* Returns the JSON-RPC server
|
|
52
|
-
*/
|
|
53
|
-
getRpcServer(): JSONRPCServerType;
|
|
54
|
-
/**
|
|
55
|
-
* Returns the server instance
|
|
56
|
-
*/
|
|
57
|
-
getServerInstance(): http.Server | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Returns the Express app
|
|
60
|
-
*/
|
|
61
|
-
getExpressApp(): express.Express;
|
|
62
|
-
/**
|
|
63
|
-
* Returns a task context for the specified task and messages
|
|
64
|
-
*/
|
|
65
|
-
getTaskContext(task: Task, userMessage: Message, history: Message[]): TaskContext;
|
|
66
|
-
/**
|
|
67
|
-
* Returns the default agent card
|
|
68
|
-
*/
|
|
69
|
-
defaultAgentCard(): AgentCard;
|
|
70
|
-
/**
|
|
71
|
-
* Creates a new A2AServer.
|
|
72
|
-
* @param handler The task handler function that will process tasks
|
|
73
|
-
* @param options Options for configuring the server
|
|
74
|
-
*/
|
|
75
|
-
constructor(params: A2AServerParams);
|
|
76
|
-
/**
|
|
77
|
-
* Starts the Express server listening on the specified port.
|
|
78
|
-
* @returns The running Express application instance.
|
|
79
|
-
*/
|
|
80
|
-
start(): express.Express;
|
|
81
|
-
/**
|
|
82
|
-
* Stops the server and closes all connections.
|
|
83
|
-
* @returns A promise that resolves when the server is stopped.
|
|
84
|
-
*/
|
|
85
|
-
stop(): Promise<void>;
|
|
86
|
-
/**
|
|
87
|
-
* Registers the server with the A2A registry.
|
|
88
|
-
* @returns A promise that resolves to the registration ID or an empty string if registration fails.
|
|
89
|
-
*/
|
|
90
|
-
registerServer(): Promise<string>;
|
|
91
|
-
/**
|
|
92
|
-
* Handles task cancellation
|
|
93
|
-
* @param data Task and history data
|
|
94
|
-
* @param res Response object
|
|
95
|
-
*/
|
|
96
|
-
onCancel(context: TaskContext, data: TaskAndHistory, res: Response): Promise<void>;
|
|
97
|
-
/**
|
|
98
|
-
* Handles cleanup when a task stream ends
|
|
99
|
-
* @param taskId The task ID
|
|
100
|
-
* @param res Response object
|
|
101
|
-
*/
|
|
102
|
-
onEnd(taskId: string, res: Response): Promise<void>;
|
|
103
|
-
/**
|
|
104
|
-
* Handles the message/stream method.
|
|
105
|
-
* @param req The SendTaskRequest object
|
|
106
|
-
* @param res The Express Response object
|
|
107
|
-
*/
|
|
108
|
-
handleTaskSendSubscribe(req: SendStreamingMessageRequest, res: Response): Promise<void>;
|
|
109
|
-
/**
|
|
110
|
-
* Handles the tasks/resubscribe method.
|
|
111
|
-
* @param req The TaskResubscriptionRequest object
|
|
112
|
-
* @param res The Express Response object
|
|
113
|
-
*/
|
|
114
|
-
handleTaskResubscribe(req: TaskResubscriptionRequest, res: Response): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Adds a response stream to the tracking map for a task.
|
|
117
|
-
* @param taskId The task ID
|
|
118
|
-
* @param res The response stream
|
|
119
|
-
*/
|
|
120
|
-
addStreamForTask(taskId: string, res: Response): void;
|
|
121
|
-
/**
|
|
122
|
-
* Removes a response stream from the tracking map for a task.
|
|
123
|
-
* @param taskId The task ID
|
|
124
|
-
* @param res The response stream
|
|
125
|
-
*/
|
|
126
|
-
removeStreamForTask(taskId: string, res: Response): void;
|
|
127
|
-
/**
|
|
128
|
-
* Initializes the default agent card
|
|
129
|
-
*/
|
|
130
|
-
static defaultAgentCard(): AgentCard;
|
|
131
|
-
/**
|
|
132
|
-
* Creates a TaskContext object for a task handler.
|
|
133
|
-
* @param task The task
|
|
134
|
-
* @param userMessage The user message
|
|
135
|
-
* @param history The message history
|
|
136
|
-
* @returns A TaskContext object
|
|
137
|
-
*/
|
|
138
|
-
createTaskContext(task: Task, userMessage: Message, history: Message[], configuration?: MessageSendConfiguration): TaskContext;
|
|
139
|
-
/**
|
|
140
|
-
* Closes any active streams for a task.
|
|
141
|
-
* @param taskId The task ID
|
|
142
|
-
*/
|
|
143
|
-
closeStreamsForTask(taskId: string): void;
|
|
144
|
-
}
|
|
145
|
-
//# sourceMappingURL=a2a-server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-server.d.ts","sourceRoot":"","sources":["../../../src/server/a2a-server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,KAAK,EACV,SAAS,EACT,IAAI,EACJ,OAAO,EACP,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD;;;;;GAKG;AACH,qBAAa,SAAU,YAAW,MAAM;IACtC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,cAAc,IAAI,WAAW;IAI7B;;OAEG;IACH,OAAO,IAAI,SAAS;IAIpB;;OAEG;IACH,YAAY,IAAI,SAAS;IAMzB;;OA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AE,GAAG,EAAE,QAAQ,GAAG,IAAI;IAM5D;;;;OAIG;IACI,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI;IAM/D;;OAEG;WACW,gBAAgB,IAAI,SAAS;IAiB3C;;;;;;OAMG;IACI,iBAAiB,CACtB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,OAAO,EAAE,EAClB,aAAa,CAAC,EAAE,wBAAwB,GACvC,WAAW;IAMd;;;OAGG;IACI,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAKjD"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { CorsOptions } from "cors";
|
|
2
|
-
import { A2AResponse, AgentCard, CancelTaskRequest, CancelTaskResponse, GetTaskPushNotificationConfigRequest, GetTaskPushNotificationConfigResponse, GetTaskRequest, GetTaskResponse, Message, SendMessageRequest, SendMessageResponse, SendStreamingMessageRequest, SetTaskPushNotificationConfigRequest, SetTaskPushNotificationConfigResponse, Task, TaskResubscriptionRequest, MessageSendConfiguration, A2ARequest } from "../../types/extended-schema.js";
|
|
3
|
-
import { TaskStore } from "./store.js";
|
|
4
|
-
import { TaskHandler, TaskContext } from "../../types/index.js";
|
|
5
|
-
import jayson from "jayson";
|
|
6
|
-
import { ErrorHandler } from "../../utils/common/errors.js";
|
|
7
|
-
import { JSONRPCError } from "../../types/extended-schema.js";
|
|
8
|
-
import { Response } from "express";
|
|
9
|
-
export type JSONRPCServerType = jayson.Server;
|
|
10
|
-
export declare const JSONRPCServer: jayson.ServerConstructor;
|
|
11
|
-
export type JSONRPCCallback<Res = A2AResponse | Task | null> = (error: JSONRPCError | null, result?: Res) => void;
|
|
12
|
-
/**
|
|
13
|
-
* Function type for creating a JSON-RPC server
|
|
14
|
-
* @param params Parameters required to initialize the server
|
|
15
|
-
* @returns A configured JSON-RPC server instance
|
|
16
|
-
*/
|
|
17
|
-
export type JSONRPCServerFactory = (params: CreateJSONRPCServerParams) => JSONRPCServerType;
|
|
18
|
-
/**
|
|
19
|
-
* Function type for creating a JSON-RPC Method
|
|
20
|
-
* @param params Parameters required to initialize the server
|
|
21
|
-
* @returns A configured JSON-RPC server instance
|
|
22
|
-
*/
|
|
23
|
-
export type JSONRPCMethodHandler<Params, Result> = (requestParams: Params, callback: JSONRPCCallback<Result>) => Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Type for the ActiveCancellations set
|
|
26
|
-
* This can be used by consumers to implement their own server solutions
|
|
27
|
-
*/
|
|
28
|
-
export type ActiveCancellations = Set<string>;
|
|
29
|
-
/**
|
|
30
|
-
* Type for the CloseStreamsForTask function
|
|
31
|
-
* This can be used by consumers to implement their own server solutions
|
|
32
|
-
*/
|
|
33
|
-
export type CloseStreamsForTask = (taskId: string) => void;
|
|
34
|
-
/**
|
|
35
|
-
* Type for the CreateTaskContext function
|
|
36
|
-
* This can be used by consumers to implement their own server solutions
|
|
37
|
-
*/
|
|
38
|
-
export type CreateTaskContext = (task: Task, message: Message, history: Message[], configuration?: MessageSendConfiguration) => TaskContext;
|
|
39
|
-
/**
|
|
40
|
-
* Type for the createJSONRPCServer function
|
|
41
|
-
* This can be used by consumers to implement their own server solutions
|
|
42
|
-
*/
|
|
43
|
-
export type CreateJSONRPCServer = (params: CreateJSONRPCServerParams) => JSONRPCServerType;
|
|
44
|
-
/**
|
|
45
|
-
* Interface for createJSONRPCServer parameters
|
|
46
|
-
* This can be used by consumers to implement their own server solutions
|
|
47
|
-
*/
|
|
48
|
-
export interface CreateJSONRPCServerParams {
|
|
49
|
-
taskStore: TaskStore;
|
|
50
|
-
card: AgentCard;
|
|
51
|
-
taskHandler: TaskHandler;
|
|
52
|
-
activeCancellations: ActiveCancellations;
|
|
53
|
-
createTaskContext: CreateTaskContext;
|
|
54
|
-
closeStreamsForTask: CloseStreamsForTask;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Parameters for creating an A2AServer instance.
|
|
58
|
-
*/
|
|
59
|
-
export type A2AServerParams = {
|
|
60
|
-
handler: TaskHandler;
|
|
61
|
-
corsOptions?: CorsOptions;
|
|
62
|
-
port?: number;
|
|
63
|
-
basePath?: string;
|
|
64
|
-
taskStore?: TaskStore;
|
|
65
|
-
card?: AgentCard;
|
|
66
|
-
createJSONRPCServer?: JSONRPCServerFactory;
|
|
67
|
-
fallbackPath?: string;
|
|
68
|
-
register?: boolean;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Parameters for creating an Express server.
|
|
72
|
-
*/
|
|
73
|
-
export type CreateExpressServerParams = Omit<A2AServerParams, "createJSONRPCServer" | "taskStore" | "handler" | "register"> & Required<Pick<A2AServerParams, "card" | "basePath" | "port" | "corsOptions" | "fallbackPath">> & {
|
|
74
|
-
rpcServer: JSONRPCServerType;
|
|
75
|
-
errorHandler: ErrorHandler;
|
|
76
|
-
onTaskSendSubscribe: (req: SendStreamingMessageRequest, res: Response) => Promise<void>;
|
|
77
|
-
onTaskResubscribe: (req: TaskResubscriptionRequest, res: Response) => Promise<void>;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Type for the A2AMethodHandler function
|
|
81
|
-
* This can be used by consumers to implement their own server solutions
|
|
82
|
-
*/
|
|
83
|
-
export type A2AMethodHandler<RequestParamT extends A2ARequest["params"], Result extends A2AResponse | Message | Task | null> = (deps: CreateJSONRPCServerParams, requestParams: RequestParamT, callback: JSONRPCCallback<Result>) => Promise<void>;
|
|
84
|
-
/**
|
|
85
|
-
* Type for the SendTaskMethod function
|
|
86
|
-
* This can be used by consumers to implement their own server solutions
|
|
87
|
-
*/
|
|
88
|
-
export type SendTaskMethod = A2AMethodHandler<SendMessageRequest["params"], SendMessageResponse | Message | Task | null>;
|
|
89
|
-
/**
|
|
90
|
-
* Type for the GetTaskMethod function
|
|
91
|
-
* This can be used by consumers to implement their own server solutions
|
|
92
|
-
*/
|
|
93
|
-
export type GetTaskMethod = A2AMethodHandler<GetTaskRequest["params"], GetTaskResponse | Task | null>;
|
|
94
|
-
/**
|
|
95
|
-
* Type for the CancelTaskMethod function
|
|
96
|
-
* This can be used by consumers to implement their own server solutions
|
|
97
|
-
*/
|
|
98
|
-
export type CancelTaskMethod = A2AMethodHandler<CancelTaskRequest["params"], CancelTaskResponse | Task | null>;
|
|
99
|
-
/**
|
|
100
|
-
* Type for the SetTaskPushNotificationMethod function
|
|
101
|
-
* This can be used by consumers to implement their own server solutions
|
|
102
|
-
*/
|
|
103
|
-
export type SetTaskPushNotificationMethod = A2AMethodHandler<SetTaskPushNotificationConfigRequest["params"], SetTaskPushNotificationConfigResponse | null>;
|
|
104
|
-
/**
|
|
105
|
-
* Type for the GetTaskPushNotificationMethod function
|
|
106
|
-
* This can be used by consumers to implement their own server solutions
|
|
107
|
-
*/
|
|
108
|
-
export type GetTaskPushNotificationMethod = A2AMethodHandler<GetTaskPushNotificationConfigRequest["params"], GetTaskPushNotificationConfigResponse | null>;
|
|
109
|
-
//# sourceMappingURL=params.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../../../src/server/interfaces/params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EACL,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,oCAAoC,EACpC,qCAAqC,EACrC,cAAc,EACd,eAAe,EACf,OAAO,EACP,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,oCAAoC,EACpC,qCAAqC,EACrC,IAAI,EACJ,yBAAyB,EACzB,wBAAwB,EACxB,UAAU,EACX,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE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AAQ,EAAE,eAAe,CAAC,MAAM,CAAC,KAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAC3C,kBAAkB,CAAC,QAAQ,CAAC,EAC5B,mBAAmB,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAC5C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAC1C,cAAc,CAAC,QAAQ,CAAC,EACxB,eAAe,GAAG,IAAI,GAAG,IAAI,CAC9B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAC7C,iBAAiB,CAAC,QAAQ,CAAC,EAC3B,kBAAkB,GAAG,IAAI,GAAG,IAAI,CACjC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,gBAAgB,CAC1D,oCAAoC,CAAC,QAAQ,CAAC,EAC9C,qCAAqC,GAAG,IAAI,CAC7C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,gBAAgB,CAC1D,oCAAoC,CAAC,QAAQ,CAAC,EAC9C,qCAAqC,GAAG,IAAI,CAC7C,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import express, { Response } from "express";
|
|
2
|
-
import http from "http";
|
|
3
|
-
import { CorsOptions } from "cors";
|
|
4
|
-
import { AgentCard, Message, Task, SendStreamingMessageRequest, TaskResubscriptionRequest } from "../../types/index.js";
|
|
5
|
-
import { TaskStore } from "./store.js";
|
|
6
|
-
import { JSONRPCServerType } from "./params.js";
|
|
7
|
-
import { TaskAndHistory } from "./store.js";
|
|
8
|
-
import { TaskContext, TaskHandler } from "../../types/index.js";
|
|
9
|
-
export interface Server {
|
|
10
|
-
start(): express.Express;
|
|
11
|
-
stop(): Promise<void>;
|
|
12
|
-
registerServer(): Promise<string>;
|
|
13
|
-
getBasePath(): string;
|
|
14
|
-
getCorsOptions(): CorsOptions;
|
|
15
|
-
getCard(): AgentCard;
|
|
16
|
-
getTaskStore(): TaskStore;
|
|
17
|
-
getTaskHandler(): TaskHandler;
|
|
18
|
-
getActiveCancellations(): Set<string>;
|
|
19
|
-
getActiveStreams(): Map<string, Response[]>;
|
|
20
|
-
getPort(): number;
|
|
21
|
-
getRpcServer(): JSONRPCServerType;
|
|
22
|
-
getExpressApp(): express.Express;
|
|
23
|
-
getServerInstance(): http.Server | undefined;
|
|
24
|
-
getTaskContext(task: Task, userMessage: Message, history: Message[]): TaskContext;
|
|
25
|
-
onCancel(context: TaskContext, data: TaskAndHistory, res: Response): Promise<void>;
|
|
26
|
-
onEnd(taskId: string, res: Response): Promise<void>;
|
|
27
|
-
addStreamForTask(taskId: string, res: Response): void;
|
|
28
|
-
removeStreamForTask(taskId: string, res: Response): void;
|
|
29
|
-
closeStreamsForTask(taskId: string): void;
|
|
30
|
-
handleTaskSendSubscribe(req: SendStreamingMessageRequest, res: Response): Promise<void>;
|
|
31
|
-
handleTaskResubscribe(req: TaskResubscriptionRequest, res: Response): Promise<void>;
|
|
32
|
-
defaultAgentCard(): AgentCard;
|
|
33
|
-
createTaskContext(task: Task, userMessage: Message, history: Message[]): TaskContext;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/server/interfaces/server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,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C;IACzD,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,uBAAuB,CACrB,GAAG,EAAE,2BAA2B,EAChC,GAAG,EAAE,QAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,qBAAqB,CACnB,GAAG,EAAE,yBAAyB,EAC9B,GAAG,EAAE,QAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,gBAAgB,IAAI,SAAS,CAAC;IAC9B,iBAAiB,CACf,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,OAAO,EAAE,GACjB,WAAW,CAAC;CAChB"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Task, Message } from "../../types/extended-schema.js";
|
|
2
|
-
/**
|
|
3
|
-
* Represents a task and its associated message history.
|
|
4
|
-
*/
|
|
5
|
-
export interface TaskAndHistory {
|
|
6
|
-
/** The task object */
|
|
7
|
-
task: Task;
|
|
8
|
-
/** The complete message history associated with the task */
|
|
9
|
-
history: Message[];
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use the Store interface instead.
|
|
13
|
-
* @description Interface for task storage providers.
|
|
14
|
-
* Abstracts the storage mechanism for tasks and their message history.
|
|
15
|
-
*/
|
|
16
|
-
export interface TaskStore {
|
|
17
|
-
/**
|
|
18
|
-
* Saves a task and its associated message history.
|
|
19
|
-
* Overwrites existing data if the task ID exists.
|
|
20
|
-
* @param data An object containing the task and its history.
|
|
21
|
-
* @returns A promise resolving when the save operation is complete.
|
|
22
|
-
*/
|
|
23
|
-
save(data: TaskAndHistory): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Loads a task and its history by task ID.
|
|
26
|
-
* @param taskId The ID of the task to load.
|
|
27
|
-
* @returns A promise resolving to an object containing the Task and its history, or null if not found.
|
|
28
|
-
*/
|
|
29
|
-
load(taskId: string): Promise<TaskAndHistory | null>;
|
|
30
|
-
}
|
|
31
|
-
export interface Store<T> {
|
|
32
|
-
set(data: T, id?: string): Promise<void>;
|
|
33
|
-
get(id: string): Promise<T | null>;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/server/interfaces/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;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,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;CACpC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
import { CreateExpressServerParams } from "../interfaces/params.js";
|
|
3
|
-
import { ServiceManager } from "../../services/manager.js";
|
|
4
|
-
import { ExpressServerInterface, ExpressServerOptions } from "../../types/express.js";
|
|
5
|
-
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
6
|
-
import http from "http";
|
|
7
|
-
import { CorsOptions } from "cors";
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Use ExpressServer instead.
|
|
10
|
-
* @description Creates an Express server for the A2A protocol.
|
|
11
|
-
* Handles task creation, streaming, cancellation and more.
|
|
12
|
-
* Uses Jayson for JSON-RPC handling.
|
|
13
|
-
*/
|
|
14
|
-
export declare function createExpressServer(params: CreateExpressServerParams): {
|
|
15
|
-
app: express.Express;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* @description The express server class.
|
|
19
|
-
*/
|
|
20
|
-
export declare class ExpressServer extends ServiceManager implements ExpressServerInterface {
|
|
21
|
-
readonly basePath: string;
|
|
22
|
-
readonly fallbackPath: string;
|
|
23
|
-
private _serverInstance;
|
|
24
|
-
readonly port: number;
|
|
25
|
-
protected app: express.Express;
|
|
26
|
-
readonly register: boolean;
|
|
27
|
-
readonly corsOptions: CorsOptions;
|
|
28
|
-
private initialized;
|
|
29
|
-
/**
|
|
30
|
-
* @description Gets the server instance.
|
|
31
|
-
* @returns {http.Server | undefined} The server instance.
|
|
32
|
-
*/
|
|
33
|
-
get serverInstance(): http.Server | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* @description The constructor.
|
|
36
|
-
* @param {ExpressServerOptions} params The express server options.
|
|
37
|
-
*/
|
|
38
|
-
constructor(params: ExpressServerOptions);
|
|
39
|
-
/**
|
|
40
|
-
* @description Registers the routes.
|
|
41
|
-
* @param {StreamableHTTPServerTransport} transport The mcp transport.
|
|
42
|
-
*/
|
|
43
|
-
registerRoutes(atBasePath?: boolean, transport?: StreamableHTTPServerTransport): void;
|
|
44
|
-
/**
|
|
45
|
-
* @description Gets the app.
|
|
46
|
-
* @returns {express.Express} The app.
|
|
47
|
-
*/
|
|
48
|
-
getApp(): express.Express;
|
|
49
|
-
/**
|
|
50
|
-
* @description Starts the server.
|
|
51
|
-
* @returns {Promise<http.Server>} The server.
|
|
52
|
-
*/
|
|
53
|
-
start(): Promise<http.Server>;
|
|
54
|
-
/**
|
|
55
|
-
* @description Stops the server.
|
|
56
|
-
*/
|
|
57
|
-
stop(): Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=express-server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"express-server.d.ts","sourceRoot":"","sources":["../../../../src/server/lib/express-server.ts"],"names":[],"mappings":"AACA,OAAO,OAA4C,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAGnG,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAKnC;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG;IACtE,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC;CACtB,CAoDA;AAED;;GAEG;AACH,qBAAa,aACX,SAAQ,cACR,YAAW,sBAAsB;IAEjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,eAAe,CAA0B;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,OAAO,CAAC,WAAW,CAAkB;IAErC;;;OAGG;IACH,IAAI,cAAc,IAAI,IAAI,CAAC,MAAM,GAAG,SAAS,CAE5C;IAED;;;OAGG;gBACS,MAAM,EAAE,oBAAoB;IAyCxC;;;OAGG;IACH,cAAc,CACZ,UAAU,GAAE,OAAc,EAC1B,SAAS,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