@adcp/sdk 17.0.0-beta.0 → 17.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/adapters/keyed-account-store.js +1 -1
- package/dist/lib/adapters/keyed-account-store.mjs +1 -1
- package/dist/lib/adapters/version/3.0/brand-fields.d.mts +7 -1
- package/dist/lib/adapters/version/3.0/brand-fields.d.ts +7 -1
- package/dist/lib/adapters/version/3.0/brand-fields.js +139 -3
- package/dist/lib/adapters/version/3.0/brand-fields.mjs +136 -2
- package/dist/lib/adapters/version/3.0/index.js +6 -0
- package/dist/lib/adapters/version/3.0/index.mjs +7 -1
- package/dist/lib/adapters/version/3.1/bidding.js +1 -1
- package/dist/lib/adapters/version/3.1/bidding.mjs +1 -1
- package/dist/lib/adapters/version/types.d.mts +5 -0
- package/dist/lib/adapters/version/types.d.ts +5 -0
- package/dist/lib/canonical-references/index.js +2 -0
- package/dist/lib/canonical-references/index.mjs +2 -0
- package/dist/lib/client/account-changes.d.mts +3 -1
- package/dist/lib/client/account-changes.d.ts +3 -1
- package/dist/lib/client/account-changes.js +22 -2
- package/dist/lib/client/account-changes.mjs +22 -2
- package/dist/lib/conformance/oracle.js +3 -2
- package/dist/lib/conformance/oracle.mjs +3 -2
- package/dist/lib/core/AgentClient.d.mts +165 -1
- package/dist/lib/core/AgentClient.d.ts +165 -1
- package/dist/lib/core/AgentClient.js +446 -8
- package/dist/lib/core/AgentClient.mjs +446 -8
- package/dist/lib/core/ConversationTypes.d.mts +8 -0
- package/dist/lib/core/ConversationTypes.d.ts +8 -0
- package/dist/lib/core/ProtocolResponseParser.d.mts +1 -1
- package/dist/lib/core/ProtocolResponseParser.d.ts +1 -1
- package/dist/lib/core/ProtocolResponseParser.js +28 -18
- package/dist/lib/core/ProtocolResponseParser.mjs +11 -1
- package/dist/lib/core/ResponseValidator.js +1 -1
- package/dist/lib/core/ResponseValidator.mjs +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +122 -7
- package/dist/lib/core/SingleAgentClient.d.ts +122 -7
- package/dist/lib/core/SingleAgentClient.js +601 -96
- package/dist/lib/core/SingleAgentClient.mjs +590 -84
- package/dist/lib/core/TaskExecutor.d.mts +7 -0
- package/dist/lib/core/TaskExecutor.d.ts +7 -0
- package/dist/lib/core/TaskExecutor.js +23 -8
- package/dist/lib/core/TaskExecutor.mjs +23 -8
- package/dist/lib/core/task-status.d.mts +2 -0
- package/dist/lib/core/task-status.d.ts +2 -0
- package/dist/lib/core/task-status.js +11 -2
- package/dist/lib/core/task-status.mjs +9 -1
- package/dist/lib/errors/index.d.mts +22 -0
- package/dist/lib/errors/index.d.ts +22 -0
- package/dist/lib/errors/index.js +43 -0
- package/dist/lib/errors/index.mjs +42 -0
- package/dist/lib/identity-3.3/trust.d.mts +1 -4
- package/dist/lib/identity-3.3/trust.d.ts +1 -4
- package/dist/lib/identity-3.3/trust.js +34 -21
- package/dist/lib/identity-3.3/trust.mjs +34 -21
- package/dist/lib/identity-3.3/validation.js +5 -3
- package/dist/lib/identity-3.3/validation.mjs +6 -4
- package/dist/lib/index.d.mts +7 -53
- package/dist/lib/index.d.ts +7 -53
- package/dist/lib/index.js +13 -0
- package/dist/lib/index.mjs +9 -0
- package/dist/lib/media-buy/compatibility.js +6 -1
- package/dist/lib/media-buy/compatibility.mjs +6 -1
- package/dist/lib/protocols/mcp-modern.d.mts +2 -0
- package/dist/lib/protocols/mcp-modern.d.ts +2 -0
- package/dist/lib/protocols/mcp-modern.js +31 -5
- package/dist/lib/protocols/mcp-modern.mjs +31 -5
- package/dist/lib/protocols/mcp-scope.d.mts +6 -1
- package/dist/lib/protocols/mcp-scope.d.ts +6 -1
- package/dist/lib/protocols/mcp-scope.js +25 -3
- package/dist/lib/protocols/mcp-scope.mjs +24 -3
- package/dist/lib/protocols/mcp.js +12 -6
- package/dist/lib/protocols/mcp.mjs +13 -6
- package/dist/lib/reporting/inspection.js +1 -0
- package/dist/lib/reporting/inspection.mjs +1 -0
- package/dist/lib/reporting/ledger/coverage.d.mts +5 -0
- package/dist/lib/reporting/ledger/coverage.d.ts +5 -0
- package/dist/lib/reporting/ledger/coverage.js +37 -3
- package/dist/lib/reporting/ledger/coverage.mjs +36 -3
- package/dist/lib/reporting/ledger/handler.js +7 -4
- package/dist/lib/reporting/ledger/handler.mjs +7 -4
- package/dist/lib/reporting/ledger/producer.js +215 -69
- package/dist/lib/reporting/ledger/producer.mjs +217 -70
- package/dist/lib/reporting/ledger/schedule.d.mts +2 -2
- package/dist/lib/reporting/ledger/schedule.d.ts +2 -2
- package/dist/lib/reporting/ledger/schedule.js +8 -5
- package/dist/lib/reporting/ledger/schedule.mjs +8 -5
- package/dist/lib/reporting/ledger/status-ingest.d.mts +1 -1
- package/dist/lib/reporting/ledger/status-ingest.d.ts +1 -1
- package/dist/lib/reporting/ledger/status-ingest.js +4 -3
- package/dist/lib/reporting/ledger/status-ingest.mjs +4 -3
- package/dist/lib/reporting/ledger/types.d.mts +36 -1
- package/dist/lib/reporting/ledger/types.d.ts +36 -1
- package/dist/lib/reporting/service/index.d.mts +14 -1
- package/dist/lib/reporting/service/index.d.ts +14 -1
- package/dist/lib/reporting/service/index.js +24 -12
- package/dist/lib/reporting/service/index.mjs +24 -12
- package/dist/lib/schemas/browser.d.mts +2 -0
- package/dist/lib/schemas/browser.d.ts +2 -0
- package/dist/lib/schemas/browser.js +3 -0
- package/dist/lib/schemas/browser.mjs +2 -0
- package/dist/lib/schemas/index.d.mts +5 -3
- package/dist/lib/schemas/index.d.ts +5 -3
- package/dist/lib/schemas/index.js +5 -0
- package/dist/lib/schemas/index.mjs +4 -0
- package/dist/lib/server/account-response-identity.d.mts +17 -0
- package/dist/lib/server/account-response-identity.d.ts +17 -0
- package/dist/lib/server/account-response-identity.js +52 -0
- package/dist/lib/server/account-response-identity.mjs +28 -0
- package/dist/lib/server/account-sync-contract.js +2 -2
- package/dist/lib/server/account-sync-contract.mjs +2 -2
- package/dist/lib/server/create-adcp-server.js +33 -20
- package/dist/lib/server/create-adcp-server.mjs +36 -12
- package/dist/lib/server/decisioning/account.d.mts +36 -10
- package/dist/lib/server/decisioning/account.d.ts +36 -10
- package/dist/lib/server/decisioning/account.js +33 -14
- package/dist/lib/server/decisioning/account.mjs +33 -14
- package/dist/lib/server/decisioning/runtime/from-platform.d.mts +5 -5
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +5 -5
- package/dist/lib/server/decisioning/runtime/from-platform.js +4 -4
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +4 -4
- package/dist/lib/server/media-buy-store.d.mts +26 -12
- package/dist/lib/server/media-buy-store.d.ts +26 -12
- package/dist/lib/server/media-buy-store.js +69 -21
- package/dist/lib/server/media-buy-store.mjs +69 -21
- package/dist/lib/server/notification-subscriptions/runtime.d.mts +1 -1
- package/dist/lib/server/notification-subscriptions/runtime.d.ts +1 -1
- package/dist/lib/server/notification-subscriptions/runtime.js +4 -0
- package/dist/lib/server/notification-subscriptions/runtime.mjs +4 -0
- package/dist/lib/server/responses.js +9 -1
- package/dist/lib/server/responses.mjs +9 -1
- package/dist/lib/signing/agent-fetch.d.mts +1 -1
- package/dist/lib/signing/agent-fetch.d.ts +1 -1
- package/dist/lib/signing/agent-fetch.js +3 -3
- package/dist/lib/signing/agent-fetch.mjs +3 -3
- package/dist/lib/testing/client.d.mts +1 -0
- package/dist/lib/testing/client.d.ts +1 -0
- package/dist/lib/testing/client.js +6 -5
- package/dist/lib/testing/client.mjs +6 -5
- package/dist/lib/testing/storyboard/agent-routing.d.mts +5 -2
- package/dist/lib/testing/storyboard/agent-routing.d.ts +5 -2
- package/dist/lib/testing/storyboard/agent-routing.js +11 -4
- package/dist/lib/testing/storyboard/agent-routing.mjs +11 -4
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.js +60 -14
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.mjs +60 -14
- package/dist/lib/testing/storyboard/compliance.d.mts +2 -5
- package/dist/lib/testing/storyboard/compliance.d.ts +2 -5
- package/dist/lib/testing/storyboard/compliance.js +62 -13
- package/dist/lib/testing/storyboard/compliance.mjs +63 -14
- package/dist/lib/testing/storyboard/context.d.mts +13 -3
- package/dist/lib/testing/storyboard/context.d.ts +13 -3
- package/dist/lib/testing/storyboard/context.js +15 -10
- package/dist/lib/testing/storyboard/context.mjs +15 -10
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.mts +2 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.ts +2 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +11 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +10 -0
- package/dist/lib/testing/storyboard/runner.js +141 -13
- package/dist/lib/testing/storyboard/runner.mjs +141 -13
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/testing/storyboard/validations.js +4 -1
- package/dist/lib/testing/storyboard/validations.mjs +4 -1
- package/dist/lib/testing/test-controller.js +3 -0
- package/dist/lib/testing/test-controller.mjs +3 -0
- package/dist/lib/types/accept-proposal.d.ts +20 -28
- package/dist/lib/types/asset-instances.d.mts +1 -1
- package/dist/lib/types/asset-instances.d.ts +1 -1
- package/dist/lib/types/buy-products.d.ts +20 -28
- package/dist/lib/types/check-governance.d.ts +20 -28
- package/dist/lib/types/comply-test-controller.d.ts +20 -28
- package/dist/lib/types/control-media-buy.d.ts +20 -28
- package/dist/lib/types/core.generated.d.mts +273 -184
- package/dist/lib/types/core.generated.d.ts +273 -184
- package/dist/lib/types/create-media-buy.d.ts +20 -28
- package/dist/lib/types/get-media-buys.d.ts +20 -28
- package/dist/lib/types/get-products.d.ts +20 -28
- package/dist/lib/types/index.d.mts +6 -1
- package/dist/lib/types/index.d.ts +6 -1
- package/dist/lib/types/index.js +6 -1
- package/dist/lib/types/index.mjs +4 -1
- package/dist/lib/types/inline-enums.generated.d.mts +30 -4
- package/dist/lib/types/inline-enums.generated.d.ts +30 -4
- package/dist/lib/types/inline-enums.generated.js +41 -2
- package/dist/lib/types/inline-enums.generated.mjs +28 -2
- package/dist/lib/types/list-products.d.ts +20 -28
- package/dist/lib/types/list-proposals.d.ts +20 -28
- package/dist/lib/types/media-buy-delivery-report.d.mts +6 -0
- package/dist/lib/types/media-buy-delivery-report.d.ts +6 -0
- package/dist/lib/types/media-buy-delivery-report.js +16 -0
- package/dist/lib/types/media-buy-delivery-report.mjs +0 -0
- package/dist/lib/types/refine-proposals.d.ts +20 -28
- package/dist/lib/types/request-proposals.d.ts +20 -28
- package/dist/lib/types/schemas.generated.d.ts +63113 -127273
- package/dist/lib/types/schemas.generated.js +759 -770
- package/dist/lib/types/schemas.generated.mjs +759 -770
- package/dist/lib/types/targeting-keys.generated.d.mts +4 -0
- package/dist/lib/types/targeting-keys.generated.d.ts +4 -0
- package/dist/lib/types/targeting-keys.generated.js +109 -0
- package/dist/lib/types/targeting-keys.generated.mjs +84 -0
- package/dist/lib/types/tools.generated.d.mts +2 -68
- package/dist/lib/types/tools.generated.d.ts +2 -68
- package/dist/lib/types/update-media-buy.d.ts +20 -28
- package/dist/lib/utils/adcp-version-config.js +5 -2
- package/dist/lib/utils/adcp-version-config.mjs +5 -2
- package/dist/lib/utils/envelope-status-compat.d.mts +18 -1
- package/dist/lib/utils/envelope-status-compat.d.ts +18 -1
- package/dist/lib/utils/envelope-status-compat.js +11 -5
- package/dist/lib/utils/envelope-status-compat.mjs +11 -5
- package/dist/lib/utils/response-unwrapper.js +18 -10
- package/dist/lib/utils/response-unwrapper.mjs +18 -10
- package/dist/lib/v2/format-schema/resolver.js +1 -1
- package/dist/lib/v2/format-schema/resolver.mjs +1 -1
- package/dist/lib/v2/projection/creative-delivery.js +159 -39
- package/dist/lib/v2/projection/creative-delivery.mjs +163 -39
- package/dist/lib/v2/projection/index.d.mts +1 -0
- package/dist/lib/v2/projection/index.d.ts +1 -0
- package/dist/lib/v2/projection/index.js +3 -0
- package/dist/lib/v2/projection/index.mjs +2 -0
- package/dist/lib/v2/projection/legacy-metadata.d.mts +19 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +19 -0
- package/dist/lib/v2/projection/legacy-metadata.js +91 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs +86 -0
- package/dist/lib/v2/projection/v1-to-v2.d.mts +1 -1
- package/dist/lib/v2/projection/v1-to-v2.d.ts +1 -1
- package/dist/lib/v2/projection/v1-to-v2.js +12 -9
- package/dist/lib/v2/projection/v1-to-v2.mjs +12 -9
- package/dist/lib/validation/budget-allocation.d.mts +3 -3
- package/dist/lib/validation/budget-allocation.d.ts +3 -3
- package/dist/lib/validation/compact-schema.d.mts +27 -0
- package/dist/lib/validation/compact-schema.d.ts +27 -0
- package/dist/lib/validation/compact-schema.js +276 -0
- package/dist/lib/validation/compact-schema.mjs +250 -0
- package/dist/lib/validation/media-buy-delivery-report.d.mts +8 -0
- package/dist/lib/validation/media-buy-delivery-report.d.ts +8 -0
- package/dist/lib/validation/media-buy-delivery-report.js +31 -0
- package/dist/lib/validation/media-buy-delivery-report.mjs +7 -0
- package/dist/lib/validation/nonempty-array.d.mts +15 -0
- package/dist/lib/validation/nonempty-array.d.ts +15 -0
- package/dist/lib/validation/nonempty-array.js +41 -0
- package/dist/lib/validation/nonempty-array.mjs +7 -0
- package/dist/lib/validation/schema-diagnostic-origins.d.mts +21 -0
- package/dist/lib/validation/schema-diagnostic-origins.d.ts +21 -0
- package/dist/lib/validation/schema-diagnostic-origins.js +193 -0
- package/dist/lib/validation/schema-diagnostic-origins.mjs +169 -0
- package/dist/lib/validation/schema-loader.js +86 -16
- package/dist/lib/validation/schema-loader.mjs +82 -16
- package/dist/lib/validation/schema-validator.d.mts +10 -19
- package/dist/lib/validation/schema-validator.d.ts +10 -19
- package/dist/lib/validation/schema-validator.js +136 -43
- package/dist/lib/validation/schema-validator.mjs +140 -44
- package/dist/lib/validation/sync-creatives.d.mts +22 -22
- package/dist/lib/validation/sync-creatives.d.ts +22 -22
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/webhooks/index.d.mts +3 -0
- package/dist/lib/webhooks/index.d.ts +3 -0
- package/dist/lib/webhooks/index.js +3 -0
- package/dist/lib/webhooks/index.mjs +2 -0
- package/dist/lib/webhooks/media-buy-delivery.d.mts +43 -0
- package/dist/lib/webhooks/media-buy-delivery.d.ts +43 -0
- package/dist/lib/webhooks/media-buy-delivery.js +119 -0
- package/dist/lib/webhooks/media-buy-delivery.mjs +94 -0
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/COLLECTION-FIXTURE-FOUNDATION.md +11 -0
- package/docs/guides/DELIVERY-WEBHOOK-PARSING.md +142 -0
- package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +27 -1
- package/docs/guides/REPORTING-LEDGER.md +93 -0
- package/docs/guides/REPORTING-STABILITY.md +1 -1
- package/docs/guides/TYPED-CLIENT-TOOLS.md +49 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-16-to-17.md +202 -2
- package/docs/migration-6.6-to-6.7.md +14 -0
- package/docs/migration-account-change-feed.md +15 -0
- package/docs/migration-reporting-storage-package.md +1 -1
- package/docs/recipes/verifying-inbound-webhooks.md +18 -2
- package/package.json +2 -2
|
@@ -93,9 +93,21 @@ class AgentClient {
|
|
|
93
93
|
get executor() {
|
|
94
94
|
return this.client.executor;
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
getTaskStatus(taskIdOrParams, transportOrHandler, signalOrOptions, wireOptions) {
|
|
97
|
+
if (typeof taskIdOrParams !== "string") {
|
|
98
|
+
return this.executeTask(
|
|
99
|
+
"get_task_status",
|
|
100
|
+
taskIdOrParams,
|
|
101
|
+
transportOrHandler,
|
|
102
|
+
signalOrOptions
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return this.client.getTaskStatus(
|
|
106
|
+
taskIdOrParams,
|
|
107
|
+
transportOrHandler,
|
|
108
|
+
signalOrOptions,
|
|
109
|
+
wireOptions
|
|
110
|
+
);
|
|
99
111
|
}
|
|
100
112
|
/** Register restart/replica callback recovery for a compatibility coordinator. @internal */
|
|
101
113
|
registerDurableSettlementRecovery(recoverer) {
|
|
@@ -918,6 +930,429 @@ class AgentClient {
|
|
|
918
930
|
this.retainSession(result);
|
|
919
931
|
return result;
|
|
920
932
|
}
|
|
933
|
+
/** Execute the AdCP acquire_rights tool. */
|
|
934
|
+
async acquireRights(params, inputHandler, options) {
|
|
935
|
+
const result = await this.client.executeTask(
|
|
936
|
+
"acquire_rights",
|
|
937
|
+
params,
|
|
938
|
+
inputHandler,
|
|
939
|
+
this.withSession("acquire_rights", options)
|
|
940
|
+
);
|
|
941
|
+
this.retainSession(result);
|
|
942
|
+
return result;
|
|
943
|
+
}
|
|
944
|
+
/** Generate, transform, refine, retrieve, or adapt creative manifests for advertised creative capabilities. */
|
|
945
|
+
async buildCreative(params, inputHandler, options) {
|
|
946
|
+
const result = await this.client.executeTask(
|
|
947
|
+
"build_creative",
|
|
948
|
+
params,
|
|
949
|
+
inputHandler,
|
|
950
|
+
this.withSession("build_creative", options)
|
|
951
|
+
);
|
|
952
|
+
this.retainSession(result);
|
|
953
|
+
return result;
|
|
954
|
+
}
|
|
955
|
+
/** Execute the AdCP calibrate_content tool. */
|
|
956
|
+
async calibrateContent(params, inputHandler, options) {
|
|
957
|
+
const result = await this.client.executeTask(
|
|
958
|
+
"calibrate_content",
|
|
959
|
+
params,
|
|
960
|
+
inputHandler,
|
|
961
|
+
this.withSession("calibrate_content", options)
|
|
962
|
+
);
|
|
963
|
+
this.retainSession(result);
|
|
964
|
+
return result;
|
|
965
|
+
}
|
|
966
|
+
/** Execute the AdCP check_governance tool. */
|
|
967
|
+
async checkGovernance(params, inputHandler, options) {
|
|
968
|
+
const result = await this.client.executeTask(
|
|
969
|
+
"check_governance",
|
|
970
|
+
params,
|
|
971
|
+
inputHandler,
|
|
972
|
+
this.withSession("check_governance", options)
|
|
973
|
+
);
|
|
974
|
+
this.retainSession(result);
|
|
975
|
+
return result;
|
|
976
|
+
}
|
|
977
|
+
/** Control a seller compliance scenario. Intended for conformance testing. */
|
|
978
|
+
async complyTestController(params, inputHandler, options) {
|
|
979
|
+
const result = await this.client.executeTask(
|
|
980
|
+
"comply_test_controller",
|
|
981
|
+
params,
|
|
982
|
+
inputHandler,
|
|
983
|
+
this.withSession("comply_test_controller", options)
|
|
984
|
+
);
|
|
985
|
+
this.retainSession(result);
|
|
986
|
+
return result;
|
|
987
|
+
}
|
|
988
|
+
/** Execute the AdCP create_collection_list tool. */
|
|
989
|
+
async createCollectionList(params, inputHandler, options) {
|
|
990
|
+
const result = await this.client.executeTask(
|
|
991
|
+
"create_collection_list",
|
|
992
|
+
params,
|
|
993
|
+
inputHandler,
|
|
994
|
+
this.withSession("create_collection_list", options)
|
|
995
|
+
);
|
|
996
|
+
this.retainSession(result);
|
|
997
|
+
return result;
|
|
998
|
+
}
|
|
999
|
+
/** Execute the AdCP create_content_standards tool. */
|
|
1000
|
+
async createContentStandards(params, inputHandler, options) {
|
|
1001
|
+
const result = await this.client.executeTask(
|
|
1002
|
+
"create_content_standards",
|
|
1003
|
+
params,
|
|
1004
|
+
inputHandler,
|
|
1005
|
+
this.withSession("create_content_standards", options)
|
|
1006
|
+
);
|
|
1007
|
+
this.retainSession(result);
|
|
1008
|
+
return result;
|
|
1009
|
+
}
|
|
1010
|
+
/** Execute the AdCP delete_collection_list tool. */
|
|
1011
|
+
async deleteCollectionList(params, inputHandler, options) {
|
|
1012
|
+
const result = await this.client.executeTask(
|
|
1013
|
+
"delete_collection_list",
|
|
1014
|
+
params,
|
|
1015
|
+
inputHandler,
|
|
1016
|
+
this.withSession("delete_collection_list", options)
|
|
1017
|
+
);
|
|
1018
|
+
this.retainSession(result);
|
|
1019
|
+
return result;
|
|
1020
|
+
}
|
|
1021
|
+
/** Retrieve spend, credit or balance status, and invoice history for an operator-billed account. */
|
|
1022
|
+
async getAccountFinancials(params, inputHandler, options) {
|
|
1023
|
+
const result = await this.client.executeTask(
|
|
1024
|
+
"get_account_financials",
|
|
1025
|
+
params,
|
|
1026
|
+
inputHandler,
|
|
1027
|
+
this.withSession("get_account_financials", options)
|
|
1028
|
+
);
|
|
1029
|
+
this.retainSession(result);
|
|
1030
|
+
return result;
|
|
1031
|
+
}
|
|
1032
|
+
/** Execute the AdCP get_brand_identity tool. */
|
|
1033
|
+
async getBrandIdentity(params, inputHandler, options) {
|
|
1034
|
+
const result = await this.client.executeTask(
|
|
1035
|
+
"get_brand_identity",
|
|
1036
|
+
params,
|
|
1037
|
+
inputHandler,
|
|
1038
|
+
this.withSession("get_brand_identity", options)
|
|
1039
|
+
);
|
|
1040
|
+
this.retainSession(result);
|
|
1041
|
+
return result;
|
|
1042
|
+
}
|
|
1043
|
+
/** Execute the AdCP get_collection_list tool. */
|
|
1044
|
+
async getCollectionList(params, inputHandler, options) {
|
|
1045
|
+
const result = await this.client.executeTask(
|
|
1046
|
+
"get_collection_list",
|
|
1047
|
+
params,
|
|
1048
|
+
inputHandler,
|
|
1049
|
+
this.withSession("get_collection_list", options)
|
|
1050
|
+
);
|
|
1051
|
+
this.retainSession(result);
|
|
1052
|
+
return result;
|
|
1053
|
+
}
|
|
1054
|
+
/** Execute the AdCP get_content_standards tool. */
|
|
1055
|
+
async getContentStandards(params, inputHandler, options) {
|
|
1056
|
+
const result = await this.client.executeTask(
|
|
1057
|
+
"get_content_standards",
|
|
1058
|
+
params,
|
|
1059
|
+
inputHandler,
|
|
1060
|
+
this.withSession("get_content_standards", options)
|
|
1061
|
+
);
|
|
1062
|
+
this.retainSession(result);
|
|
1063
|
+
return result;
|
|
1064
|
+
}
|
|
1065
|
+
/** Evaluate a creative manifest and return scored safety, content, quality, and governance features. */
|
|
1066
|
+
async getCreativeFeatures(params, inputHandler, options) {
|
|
1067
|
+
const result = await this.client.executeTask(
|
|
1068
|
+
"get_creative_features",
|
|
1069
|
+
params,
|
|
1070
|
+
inputHandler,
|
|
1071
|
+
this.withSession("get_creative_features", options)
|
|
1072
|
+
);
|
|
1073
|
+
this.retainSession(result);
|
|
1074
|
+
return result;
|
|
1075
|
+
}
|
|
1076
|
+
/** Execute the AdCP get_media_buy_artifacts tool. */
|
|
1077
|
+
async getMediaBuyArtifacts(params, inputHandler, options) {
|
|
1078
|
+
const result = await this.client.executeTask(
|
|
1079
|
+
"get_media_buy_artifacts",
|
|
1080
|
+
params,
|
|
1081
|
+
inputHandler,
|
|
1082
|
+
this.withSession("get_media_buy_artifacts", options)
|
|
1083
|
+
);
|
|
1084
|
+
this.retainSession(result);
|
|
1085
|
+
return result;
|
|
1086
|
+
}
|
|
1087
|
+
/** Execute the AdCP get_plan_audit_logs tool. */
|
|
1088
|
+
async getPlanAuditLogs(params, inputHandler, options) {
|
|
1089
|
+
const result = await this.client.getPlanAuditLogs(
|
|
1090
|
+
params,
|
|
1091
|
+
inputHandler,
|
|
1092
|
+
this.withSession("get_plan_audit_logs", options)
|
|
1093
|
+
);
|
|
1094
|
+
this.retainSession(result);
|
|
1095
|
+
return result;
|
|
1096
|
+
}
|
|
1097
|
+
/** Check reporting health, enumerate expected periods and all retained revisions, or resolve one exact reporting revision. */
|
|
1098
|
+
async getReportingStatus(params, inputHandler, options) {
|
|
1099
|
+
const result = await this.client.executeTask(
|
|
1100
|
+
"get_reporting_status",
|
|
1101
|
+
params,
|
|
1102
|
+
inputHandler,
|
|
1103
|
+
this.withSession("get_reporting_status", options)
|
|
1104
|
+
);
|
|
1105
|
+
this.retainSession(result);
|
|
1106
|
+
return result;
|
|
1107
|
+
}
|
|
1108
|
+
/** Execute the AdCP get_rights tool. */
|
|
1109
|
+
async getRights(params, inputHandler, options) {
|
|
1110
|
+
const result = await this.client.executeTask(
|
|
1111
|
+
"get_rights",
|
|
1112
|
+
params,
|
|
1113
|
+
inputHandler,
|
|
1114
|
+
this.withSession("get_rights", options)
|
|
1115
|
+
);
|
|
1116
|
+
this.retainSession(result);
|
|
1117
|
+
return result;
|
|
1118
|
+
}
|
|
1119
|
+
/** Execute the AdCP list_collection_lists tool. */
|
|
1120
|
+
async listCollectionLists(params, inputHandler, options) {
|
|
1121
|
+
const result = await this.client.executeTask(
|
|
1122
|
+
"list_collection_lists",
|
|
1123
|
+
params,
|
|
1124
|
+
inputHandler,
|
|
1125
|
+
this.withSession("list_collection_lists", options)
|
|
1126
|
+
);
|
|
1127
|
+
this.retainSession(result);
|
|
1128
|
+
return result;
|
|
1129
|
+
}
|
|
1130
|
+
/** Execute the AdCP list_content_standards tool. */
|
|
1131
|
+
async listContentStandards(params, inputHandler, options) {
|
|
1132
|
+
const result = await this.client.executeTask(
|
|
1133
|
+
"list_content_standards",
|
|
1134
|
+
params,
|
|
1135
|
+
inputHandler,
|
|
1136
|
+
this.withSession("list_content_standards", options)
|
|
1137
|
+
);
|
|
1138
|
+
this.retainSession(result);
|
|
1139
|
+
return result;
|
|
1140
|
+
}
|
|
1141
|
+
/** Execute the AdCP list_creative_formats tool. */
|
|
1142
|
+
async listCreativeFormats(params, inputHandler, options) {
|
|
1143
|
+
const result = await this.client.executeTask(
|
|
1144
|
+
"list_creative_formats",
|
|
1145
|
+
params,
|
|
1146
|
+
inputHandler,
|
|
1147
|
+
this.withSession("list_creative_formats", options)
|
|
1148
|
+
);
|
|
1149
|
+
this.retainSession(result);
|
|
1150
|
+
return result;
|
|
1151
|
+
}
|
|
1152
|
+
/** Discover account-scoped creative transformers and their selectable configuration options. */
|
|
1153
|
+
async listTransformers(params, inputHandler, options) {
|
|
1154
|
+
const result = await this.client.executeTask(
|
|
1155
|
+
"list_transformers",
|
|
1156
|
+
params,
|
|
1157
|
+
inputHandler,
|
|
1158
|
+
this.withSession("list_transformers", options)
|
|
1159
|
+
);
|
|
1160
|
+
this.retainSession(result);
|
|
1161
|
+
return result;
|
|
1162
|
+
}
|
|
1163
|
+
/** Log batches of marketing events against a configured event source for measurement and attribution. */
|
|
1164
|
+
async logEvent(params, inputHandler, options) {
|
|
1165
|
+
const result = await this.client.executeTask(
|
|
1166
|
+
"log_event",
|
|
1167
|
+
params,
|
|
1168
|
+
inputHandler,
|
|
1169
|
+
this.withSession("log_event", options)
|
|
1170
|
+
);
|
|
1171
|
+
this.retainSession(result);
|
|
1172
|
+
return result;
|
|
1173
|
+
}
|
|
1174
|
+
/** Execute the AdCP report_plan_outcome tool. */
|
|
1175
|
+
async reportPlanOutcome(params, inputHandler, options) {
|
|
1176
|
+
const result = await this.client.executeTask(
|
|
1177
|
+
"report_plan_outcome",
|
|
1178
|
+
params,
|
|
1179
|
+
inputHandler,
|
|
1180
|
+
this.withSession("report_plan_outcome", options)
|
|
1181
|
+
);
|
|
1182
|
+
this.retainSession(result);
|
|
1183
|
+
return result;
|
|
1184
|
+
}
|
|
1185
|
+
/** Report vendor-service consumption and final measurements for revenue tracking and billing reconciliation. */
|
|
1186
|
+
async reportUsage(params, inputHandler, options) {
|
|
1187
|
+
const result = await this.client.executeTask(
|
|
1188
|
+
"report_usage",
|
|
1189
|
+
params,
|
|
1190
|
+
inputHandler,
|
|
1191
|
+
this.withSession("report_usage", options)
|
|
1192
|
+
);
|
|
1193
|
+
this.retainSession(result);
|
|
1194
|
+
return result;
|
|
1195
|
+
}
|
|
1196
|
+
/** Execute the AdCP search_brands tool. */
|
|
1197
|
+
async searchBrands(params, inputHandler, options) {
|
|
1198
|
+
const result = await this.client.executeTask(
|
|
1199
|
+
"search_brands",
|
|
1200
|
+
params,
|
|
1201
|
+
inputHandler,
|
|
1202
|
+
this.withSession("search_brands", options)
|
|
1203
|
+
);
|
|
1204
|
+
this.retainSession(result);
|
|
1205
|
+
return result;
|
|
1206
|
+
}
|
|
1207
|
+
/** List or synchronize buyer-managed account catalog feeds, suppress or restore specific items, and read current availability state. */
|
|
1208
|
+
async syncCatalogs(params, inputHandler, options) {
|
|
1209
|
+
const result = await this.client.executeTask(
|
|
1210
|
+
"sync_catalogs",
|
|
1211
|
+
params,
|
|
1212
|
+
inputHandler,
|
|
1213
|
+
this.withSession("sync_catalogs", options)
|
|
1214
|
+
);
|
|
1215
|
+
this.retainSession(result);
|
|
1216
|
+
return result;
|
|
1217
|
+
}
|
|
1218
|
+
/** List or synchronize account event sources with upsert and optional replacement semantics. */
|
|
1219
|
+
async syncEventSources(params, inputHandler, options) {
|
|
1220
|
+
const result = await this.client.executeTask(
|
|
1221
|
+
"sync_event_sources",
|
|
1222
|
+
params,
|
|
1223
|
+
inputHandler,
|
|
1224
|
+
this.withSession("sync_event_sources", options)
|
|
1225
|
+
);
|
|
1226
|
+
this.retainSession(result);
|
|
1227
|
+
return result;
|
|
1228
|
+
}
|
|
1229
|
+
/** Bind or replace the governance agent used for approval across specific advertiser accounts. */
|
|
1230
|
+
async syncGovernance(params, inputHandler, options) {
|
|
1231
|
+
const result = await this.client.executeTask(
|
|
1232
|
+
"sync_governance",
|
|
1233
|
+
params,
|
|
1234
|
+
inputHandler,
|
|
1235
|
+
this.withSession("sync_governance", options)
|
|
1236
|
+
);
|
|
1237
|
+
this.retainSession(result);
|
|
1238
|
+
return result;
|
|
1239
|
+
}
|
|
1240
|
+
/** Execute the AdCP sync_plans tool. */
|
|
1241
|
+
async syncPlans(params, inputHandler, options) {
|
|
1242
|
+
const result = await this.client.syncPlans(params, inputHandler, this.withSession("sync_plans", options));
|
|
1243
|
+
this.retainSession(result);
|
|
1244
|
+
return result;
|
|
1245
|
+
}
|
|
1246
|
+
/** Record a consumer's independently verified reporting totals and destination evidence in the seller ledger. */
|
|
1247
|
+
async syncReportingReceipts(params, inputHandler, options) {
|
|
1248
|
+
const result = await this.client.executeTask(
|
|
1249
|
+
"sync_reporting_receipts",
|
|
1250
|
+
params,
|
|
1251
|
+
inputHandler,
|
|
1252
|
+
this.withSession("sync_reporting_receipts", options)
|
|
1253
|
+
);
|
|
1254
|
+
this.retainSession(result);
|
|
1255
|
+
return result;
|
|
1256
|
+
}
|
|
1257
|
+
/** Tell a seller whether expected reporting was received, omitted, missing, unreadable, or contradictory. */
|
|
1258
|
+
async syncReportingStatus(params, inputHandler, options) {
|
|
1259
|
+
const result = await this.client.executeTask(
|
|
1260
|
+
"sync_reporting_status",
|
|
1261
|
+
params,
|
|
1262
|
+
inputHandler,
|
|
1263
|
+
this.withSession("sync_reporting_status", options)
|
|
1264
|
+
);
|
|
1265
|
+
this.retainSession(result);
|
|
1266
|
+
return result;
|
|
1267
|
+
}
|
|
1268
|
+
/** Execute the AdCP update_collection_list tool. */
|
|
1269
|
+
async updateCollectionList(params, inputHandler, options) {
|
|
1270
|
+
const result = await this.client.executeTask(
|
|
1271
|
+
"update_collection_list",
|
|
1272
|
+
params,
|
|
1273
|
+
inputHandler,
|
|
1274
|
+
this.withSession("update_collection_list", options)
|
|
1275
|
+
);
|
|
1276
|
+
this.retainSession(result);
|
|
1277
|
+
return result;
|
|
1278
|
+
}
|
|
1279
|
+
/** Execute the AdCP update_content_standards tool. */
|
|
1280
|
+
async updateContentStandards(params, inputHandler, options) {
|
|
1281
|
+
const result = await this.client.executeTask(
|
|
1282
|
+
"update_content_standards",
|
|
1283
|
+
params,
|
|
1284
|
+
inputHandler,
|
|
1285
|
+
this.withSession("update_content_standards", options)
|
|
1286
|
+
);
|
|
1287
|
+
this.retainSession(result);
|
|
1288
|
+
return result;
|
|
1289
|
+
}
|
|
1290
|
+
/** Execute the AdCP update_rights tool. */
|
|
1291
|
+
async updateRights(params, inputHandler, options) {
|
|
1292
|
+
const result = await this.client.executeTask(
|
|
1293
|
+
"update_rights",
|
|
1294
|
+
params,
|
|
1295
|
+
inputHandler,
|
|
1296
|
+
this.withSession("update_rights", options)
|
|
1297
|
+
);
|
|
1298
|
+
this.retainSession(result);
|
|
1299
|
+
return result;
|
|
1300
|
+
}
|
|
1301
|
+
/** Execute the AdCP validate_content_delivery tool. */
|
|
1302
|
+
async validateContentDelivery(params, inputHandler, options) {
|
|
1303
|
+
const result = await this.client.executeTask(
|
|
1304
|
+
"validate_content_delivery",
|
|
1305
|
+
params,
|
|
1306
|
+
inputHandler,
|
|
1307
|
+
this.withSession("validate_content_delivery", options)
|
|
1308
|
+
);
|
|
1309
|
+
this.retainSession(result);
|
|
1310
|
+
return result;
|
|
1311
|
+
}
|
|
1312
|
+
/** Preflight a creative manifest against canonical formats, products, third-party formats, or agent capabilities. */
|
|
1313
|
+
async validateInput(params, inputHandler, options) {
|
|
1314
|
+
const result = await this.client.executeTask(
|
|
1315
|
+
"validate_input",
|
|
1316
|
+
params,
|
|
1317
|
+
inputHandler,
|
|
1318
|
+
this.withSession("validate_input", options)
|
|
1319
|
+
);
|
|
1320
|
+
this.retainSession(result);
|
|
1321
|
+
return result;
|
|
1322
|
+
}
|
|
1323
|
+
/** Execute the AdCP validate_property_delivery tool. */
|
|
1324
|
+
async validatePropertyDelivery(params, inputHandler, options) {
|
|
1325
|
+
const result = await this.client.executeTask(
|
|
1326
|
+
"validate_property_delivery",
|
|
1327
|
+
params,
|
|
1328
|
+
inputHandler,
|
|
1329
|
+
this.withSession("validate_property_delivery", options)
|
|
1330
|
+
);
|
|
1331
|
+
this.retainSession(result);
|
|
1332
|
+
return result;
|
|
1333
|
+
}
|
|
1334
|
+
/** Execute the AdCP verify_brand_claim tool. */
|
|
1335
|
+
async verifyBrandClaim(params, inputHandler, options) {
|
|
1336
|
+
const result = await this.client.executeTask(
|
|
1337
|
+
"verify_brand_claim",
|
|
1338
|
+
params,
|
|
1339
|
+
inputHandler,
|
|
1340
|
+
this.withSession("verify_brand_claim", options)
|
|
1341
|
+
);
|
|
1342
|
+
this.retainSession(result);
|
|
1343
|
+
return result;
|
|
1344
|
+
}
|
|
1345
|
+
/** Execute the AdCP verify_brand_claims tool. */
|
|
1346
|
+
async verifyBrandClaims(params, inputHandler, options) {
|
|
1347
|
+
const result = await this.client.executeTask(
|
|
1348
|
+
"verify_brand_claims",
|
|
1349
|
+
params,
|
|
1350
|
+
inputHandler,
|
|
1351
|
+
this.withSession("verify_brand_claims", options)
|
|
1352
|
+
);
|
|
1353
|
+
this.retainSession(result);
|
|
1354
|
+
return result;
|
|
1355
|
+
}
|
|
921
1356
|
// ====== GOVERNANCE TASKS ======
|
|
922
1357
|
/**
|
|
923
1358
|
* Create a property list
|
|
@@ -1312,6 +1747,12 @@ class AgentClient {
|
|
|
1312
1747
|
return this.getMediaBuyDelivery(params, inputHandler, options);
|
|
1313
1748
|
case "get_creative_delivery":
|
|
1314
1749
|
return this.getCreativeDelivery(params, inputHandler, options);
|
|
1750
|
+
case "preview_creative":
|
|
1751
|
+
return this.previewCreative(params, inputHandler, options);
|
|
1752
|
+
case "sync_plans":
|
|
1753
|
+
return this.syncPlans(params, inputHandler, options);
|
|
1754
|
+
case "get_plan_audit_logs":
|
|
1755
|
+
return this.getPlanAuditLogs(params, inputHandler, options);
|
|
1315
1756
|
case "get_principal":
|
|
1316
1757
|
return this.getPrincipal(params, inputHandler, options);
|
|
1317
1758
|
case "sync_principal":
|
|
@@ -1342,11 +1783,8 @@ class AgentClient {
|
|
|
1342
1783
|
this.retainSession(result);
|
|
1343
1784
|
return result;
|
|
1344
1785
|
}
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
* List all tasks for this agent
|
|
1348
|
-
*/
|
|
1349
|
-
async listTasks() {
|
|
1786
|
+
async listTasks(params, inputHandler, options) {
|
|
1787
|
+
if (params !== void 0) return this.executeTask("list_tasks", params, inputHandler, options);
|
|
1350
1788
|
return (await this.client.listTasks()).map(assertNativeRequestProposalsTask);
|
|
1351
1789
|
}
|
|
1352
1790
|
/**
|
|
@@ -210,6 +210,8 @@ export interface TaskOptions {
|
|
|
210
210
|
* Internal task state for tracking execution
|
|
211
211
|
*/
|
|
212
212
|
export interface TaskState {
|
|
213
|
+
/** Trusted selected release retained when request options are released. */
|
|
214
|
+
wireAdcpVersion?: string;
|
|
213
215
|
/** Unique task identifier */
|
|
214
216
|
taskId: string;
|
|
215
217
|
/** Seller work handle, distinct from the local operation id. */
|
|
@@ -510,6 +512,12 @@ export interface TaskResultMetadata {
|
|
|
510
512
|
* field the conversion removed or moved).
|
|
511
513
|
*/
|
|
512
514
|
negotiatedAdcpVersion?: string;
|
|
515
|
+
/**
|
|
516
|
+
* Trusted SDK-selected wire release, when negotiation or an explicit wire
|
|
517
|
+
* override established it. Unlike adcpVersion, this is not a seller echo.
|
|
518
|
+
* Present even when negotiation selects the client's current release.
|
|
519
|
+
*/
|
|
520
|
+
wireAdcpVersion?: string;
|
|
513
521
|
/** Seller wire generation used for this request after capability discovery. */
|
|
514
522
|
serverVersion?: 'v2' | 'v3';
|
|
515
523
|
/** True when {@link serverVersion} came from the SDK's synthetic fallback. */
|
|
@@ -210,6 +210,8 @@ export interface TaskOptions {
|
|
|
210
210
|
* Internal task state for tracking execution
|
|
211
211
|
*/
|
|
212
212
|
export interface TaskState {
|
|
213
|
+
/** Trusted selected release retained when request options are released. */
|
|
214
|
+
wireAdcpVersion?: string;
|
|
213
215
|
/** Unique task identifier */
|
|
214
216
|
taskId: string;
|
|
215
217
|
/** Seller work handle, distinct from the local operation id. */
|
|
@@ -510,6 +512,12 @@ export interface TaskResultMetadata {
|
|
|
510
512
|
* field the conversion removed or moved).
|
|
511
513
|
*/
|
|
512
514
|
negotiatedAdcpVersion?: string;
|
|
515
|
+
/**
|
|
516
|
+
* Trusted SDK-selected wire release, when negotiation or an explicit wire
|
|
517
|
+
* override established it. Unlike adcpVersion, this is not a seller echo.
|
|
518
|
+
* Present even when negotiation selects the client's current release.
|
|
519
|
+
*/
|
|
520
|
+
wireAdcpVersion?: string;
|
|
513
521
|
/** Seller wire generation used for this request after capability discovery. */
|
|
514
522
|
serverVersion?: 'v2' | 'v3';
|
|
515
523
|
/** True when {@link serverVersion} came from the SDK's synthetic fallback. */
|
|
@@ -20,7 +20,7 @@ export declare class ProtocolResponseParser {
|
|
|
20
20
|
/**
|
|
21
21
|
* Get ADCP status from response
|
|
22
22
|
*/
|
|
23
|
-
getStatus(response: any): ADCPStatus | null;
|
|
23
|
+
getStatus(response: any, toolName?: string): ADCPStatus | null;
|
|
24
24
|
/**
|
|
25
25
|
* Extract the `replayed` field from a protocol response envelope.
|
|
26
26
|
*
|
|
@@ -20,7 +20,7 @@ export declare class ProtocolResponseParser {
|
|
|
20
20
|
/**
|
|
21
21
|
* Get ADCP status from response
|
|
22
22
|
*/
|
|
23
|
-
getStatus(response: any): ADCPStatus | null;
|
|
23
|
+
getStatus(response: any, toolName?: string): ADCPStatus | null;
|
|
24
24
|
/**
|
|
25
25
|
* Extract the `replayed` field from a protocol response envelope.
|
|
26
26
|
*
|
|
@@ -18,15 +18,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var ProtocolResponseParser_exports = {};
|
|
20
20
|
__export(ProtocolResponseParser_exports, {
|
|
21
|
-
ADCP_STATUS: () =>
|
|
21
|
+
ADCP_STATUS: () => import_task_status3.ADCP_STATUS,
|
|
22
22
|
ProtocolResponseParser: () => ProtocolResponseParser,
|
|
23
23
|
responseParser: () => responseParser
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(ProtocolResponseParser_exports);
|
|
26
|
-
var import_a2a_artifacts = require('../utils/a2a-artifacts.js');
|
|
27
26
|
var import_task_status = require('./task-status.js');
|
|
27
|
+
var import_a2a_artifacts = require('../utils/a2a-artifacts.js');
|
|
28
28
|
var import_task_status2 = require('./task-status.js');
|
|
29
|
-
|
|
29
|
+
var import_task_status3 = require('./task-status.js');
|
|
30
|
+
const NESTED_TASK_ENVELOPE_FIELDS = /* @__PURE__ */ new Set([...import_task_status2.TASK_ENVELOPE_FIELDS, "taskId", "adcp_error"]);
|
|
30
31
|
const SESSION_ID_MAX_LENGTH = 256;
|
|
31
32
|
const SESSION_ID_PATTERN = /^[\x20-\x7E]+$/;
|
|
32
33
|
function isSafeSessionId(v) {
|
|
@@ -78,7 +79,7 @@ function getAdcpVersionFromPayload(payload) {
|
|
|
78
79
|
if (nested != null && typeof nested === "object" && !Array.isArray(nested)) {
|
|
79
80
|
const envelope = nested;
|
|
80
81
|
const status = typeof envelope.status === "string" ? envelope.status : void 0;
|
|
81
|
-
const isAdcpStatus2 = status !== void 0 && Object.values(
|
|
82
|
+
const isAdcpStatus2 = status !== void 0 && Object.values(import_task_status2.ADCP_STATUS).includes(status);
|
|
82
83
|
const hasOnlyEnvelopeFields = Object.keys(envelope).every((key) => NESTED_TASK_ENVELOPE_FIELDS.has(key));
|
|
83
84
|
const looksLikeEnvelope = typeof envelope.task_id === "string" || typeof envelope.taskId === "string" || Array.isArray(envelope.errors) || envelope.adcp_error != null && typeof envelope.adcp_error === "object" || isAdcpStatus2 && hasOnlyEnvelopeFields;
|
|
84
85
|
if (looksLikeEnvelope && typeof envelope.adcp_version === "string") {
|
|
@@ -131,10 +132,10 @@ class ProtocolResponseParser {
|
|
|
131
132
|
* Check if response indicates input is needed per ADCP spec
|
|
132
133
|
*/
|
|
133
134
|
isInputRequest(response) {
|
|
134
|
-
if (response?.result?.status?.state ===
|
|
135
|
+
if (response?.result?.status?.state === import_task_status2.ADCP_STATUS.INPUT_REQUIRED || response?.result?.status?.state === import_task_status2.ADCP_STATUS.AUTH_REQUIRED) {
|
|
135
136
|
return true;
|
|
136
137
|
}
|
|
137
|
-
if (response?.status ===
|
|
138
|
+
if (response?.status === import_task_status2.ADCP_STATUS.INPUT_REQUIRED || response?.status === import_task_status2.ADCP_STATUS.AUTH_REQUIRED) {
|
|
138
139
|
return true;
|
|
139
140
|
}
|
|
140
141
|
return response?.type === "input_request" || response?.question !== void 0 || response?.input_required === true || response?.needs_clarification === true;
|
|
@@ -162,33 +163,42 @@ class ProtocolResponseParser {
|
|
|
162
163
|
/**
|
|
163
164
|
* Get ADCP status from response
|
|
164
165
|
*/
|
|
165
|
-
getStatus(response) {
|
|
166
|
+
getStatus(response, toolName) {
|
|
167
|
+
if (toolName === "get_task_status" && response?.isError === true) return import_task_status2.ADCP_STATUS.FAILED;
|
|
166
168
|
const a2aTaskState = response?.result?.kind === "task" ? response.result.status?.state : void 0;
|
|
167
|
-
if (a2aTaskState ===
|
|
169
|
+
if (a2aTaskState === import_task_status2.ADCP_STATUS.INPUT_REQUIRED || a2aTaskState === import_task_status2.ADCP_STATUS.AUTH_REQUIRED) {
|
|
168
170
|
return a2aTaskState;
|
|
169
171
|
}
|
|
170
|
-
|
|
172
|
+
if (toolName === "get_task_status" && [import_task_status2.ADCP_STATUS.FAILED, import_task_status2.ADCP_STATUS.CANCELED, import_task_status2.ADCP_STATUS.REJECTED].includes(a2aTaskState)) {
|
|
173
|
+
return a2aTaskState;
|
|
174
|
+
}
|
|
175
|
+
if (response?.isError !== true && [response, response?.structuredContent, (0, import_a2a_artifacts.getLatestA2ADataPartFromTask)(response?.result)?.data].some(
|
|
176
|
+
(value) => (0, import_task_status.isTaskStatusResponse)(value, toolName)
|
|
177
|
+
)) {
|
|
178
|
+
return import_task_status2.ADCP_STATUS.COMPLETED;
|
|
179
|
+
}
|
|
180
|
+
const adcpStatusFromArtifact = (0, import_task_status2.extractAdcpStatusFromA2aTaskResult)(response?.result);
|
|
171
181
|
if (adcpStatusFromArtifact) return adcpStatusFromArtifact;
|
|
172
|
-
if ((0,
|
|
182
|
+
if ((0, import_task_status2.isAdcpStatus)(response?.result?.status?.state)) {
|
|
173
183
|
return response.result.status.state;
|
|
174
184
|
}
|
|
175
185
|
const hasOfficialPayload = response?.structuredContent !== void 0 || response?.content !== void 0 || response?.result !== void 0;
|
|
176
186
|
const data = hasOfficialPayload ? void 0 : response?.data;
|
|
177
|
-
const dataTaskStatus = data != null && typeof data === "object" && !Array.isArray(data) ? (0,
|
|
187
|
+
const dataTaskStatus = data != null && typeof data === "object" && !Array.isArray(data) ? (0, import_task_status2.extractAdcpTaskStatusFromPayload)(data) : void 0;
|
|
178
188
|
if (dataTaskStatus) return dataTaskStatus;
|
|
179
|
-
if ((0,
|
|
189
|
+
if ((0, import_task_status2.isAdcpStatus)(response?.status)) {
|
|
180
190
|
return response.status;
|
|
181
191
|
}
|
|
182
192
|
const sc = response?.structuredContent;
|
|
183
|
-
if (sc?.status && (0,
|
|
184
|
-
const taskStatus = (0,
|
|
193
|
+
if (sc?.status && (0, import_task_status2.isAdcpStatus)(sc.status)) {
|
|
194
|
+
const taskStatus = (0, import_task_status2.extractAdcpTaskStatusFromPayload)(sc);
|
|
185
195
|
if (taskStatus) return taskStatus;
|
|
186
196
|
}
|
|
187
197
|
if (response?.isError === true) {
|
|
188
|
-
return
|
|
198
|
+
return import_task_status2.ADCP_STATUS.FAILED;
|
|
189
199
|
}
|
|
190
200
|
if (response?.structuredContent || response?.content && !response?.isError) {
|
|
191
|
-
return
|
|
201
|
+
return import_task_status2.ADCP_STATUS.COMPLETED;
|
|
192
202
|
}
|
|
193
203
|
return null;
|
|
194
204
|
}
|
|
@@ -324,7 +334,7 @@ class ProtocolResponseParser {
|
|
|
324
334
|
return void 0;
|
|
325
335
|
}
|
|
326
336
|
const state = result.status?.state;
|
|
327
|
-
if (state !==
|
|
337
|
+
if (state !== import_task_status2.ADCP_STATUS.INPUT_REQUIRED && state !== import_task_status2.ADCP_STATUS.AUTH_REQUIRED) return void 0;
|
|
328
338
|
return firstSafeSessionId(result.id);
|
|
329
339
|
}
|
|
330
340
|
/** Return a live, non-terminal A2A transport Task.id for session threading. */
|
|
@@ -334,7 +344,7 @@ class ProtocolResponseParser {
|
|
|
334
344
|
return void 0;
|
|
335
345
|
}
|
|
336
346
|
const state = result.status?.state;
|
|
337
|
-
if (state !==
|
|
347
|
+
if (state !== import_task_status2.ADCP_STATUS.SUBMITTED && state !== import_task_status2.ADCP_STATUS.WORKING && state !== import_task_status2.ADCP_STATUS.INPUT_REQUIRED && state !== import_task_status2.ADCP_STATUS.AUTH_REQUIRED) {
|
|
338
348
|
return void 0;
|
|
339
349
|
}
|
|
340
350
|
return firstSafeSessionId(result.id);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isTaskStatusResponse } from "./task-status.mjs";
|
|
1
2
|
import { getLatestA2ADataPartFromTask } from "../utils/a2a-artifacts.mjs";
|
|
2
3
|
import {
|
|
3
4
|
ADCP_STATUS,
|
|
@@ -143,11 +144,20 @@ class ProtocolResponseParser {
|
|
|
143
144
|
/**
|
|
144
145
|
* Get ADCP status from response
|
|
145
146
|
*/
|
|
146
|
-
getStatus(response) {
|
|
147
|
+
getStatus(response, toolName) {
|
|
148
|
+
if (toolName === "get_task_status" && response?.isError === true) return ADCP_STATUS.FAILED;
|
|
147
149
|
const a2aTaskState = response?.result?.kind === "task" ? response.result.status?.state : void 0;
|
|
148
150
|
if (a2aTaskState === ADCP_STATUS.INPUT_REQUIRED || a2aTaskState === ADCP_STATUS.AUTH_REQUIRED) {
|
|
149
151
|
return a2aTaskState;
|
|
150
152
|
}
|
|
153
|
+
if (toolName === "get_task_status" && [ADCP_STATUS.FAILED, ADCP_STATUS.CANCELED, ADCP_STATUS.REJECTED].includes(a2aTaskState)) {
|
|
154
|
+
return a2aTaskState;
|
|
155
|
+
}
|
|
156
|
+
if (response?.isError !== true && [response, response?.structuredContent, getLatestA2ADataPartFromTask(response?.result)?.data].some(
|
|
157
|
+
(value) => isTaskStatusResponse(value, toolName)
|
|
158
|
+
)) {
|
|
159
|
+
return ADCP_STATUS.COMPLETED;
|
|
160
|
+
}
|
|
151
161
|
const adcpStatusFromArtifact = extractAdcpStatusFromA2aTaskResult(response?.result);
|
|
152
162
|
if (adcpStatusFromArtifact) return adcpStatusFromArtifact;
|
|
153
163
|
if (isAdcpStatus(response?.result?.status?.state)) {
|