@adcp/client 3.4.0 → 3.5.0

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.
Files changed (80) hide show
  1. package/dist/lib/auth/index.d.ts +1 -7
  2. package/dist/lib/auth/index.d.ts.map +1 -1
  3. package/dist/lib/auth/index.js +2 -33
  4. package/dist/lib/auth/index.js.map +1 -1
  5. package/dist/lib/core/ADCPMultiAgentClient.d.ts +2 -3
  6. package/dist/lib/core/ADCPMultiAgentClient.d.ts.map +1 -1
  7. package/dist/lib/core/ADCPMultiAgentClient.js +3 -4
  8. package/dist/lib/core/ADCPMultiAgentClient.js.map +1 -1
  9. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  10. package/dist/lib/core/ConfigurationManager.d.ts.map +1 -1
  11. package/dist/lib/core/ConfigurationManager.js +5 -14
  12. package/dist/lib/core/ConfigurationManager.js.map +1 -1
  13. package/dist/lib/core/CreativeAgentClient.js +1 -1
  14. package/dist/lib/core/CreativeAgentClient.js.map +1 -1
  15. package/dist/lib/core/SingleAgentClient.js +4 -4
  16. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  17. package/dist/lib/discovery/property-crawler.js +1 -1
  18. package/dist/lib/discovery/property-crawler.js.map +1 -1
  19. package/dist/lib/testing/agent-tester.d.ts +33 -0
  20. package/dist/lib/testing/agent-tester.d.ts.map +1 -0
  21. package/dist/lib/testing/agent-tester.js +211 -0
  22. package/dist/lib/testing/agent-tester.js.map +1 -0
  23. package/dist/lib/testing/client.d.ts +54 -0
  24. package/dist/lib/testing/client.d.ts.map +1 -0
  25. package/dist/lib/testing/client.js +293 -0
  26. package/dist/lib/testing/client.js.map +1 -0
  27. package/dist/lib/testing/formatter.d.ts +17 -0
  28. package/dist/lib/testing/formatter.d.ts.map +1 -0
  29. package/dist/lib/testing/formatter.js +79 -0
  30. package/dist/lib/testing/formatter.js.map +1 -0
  31. package/dist/lib/testing/index.d.ts +1 -0
  32. package/dist/lib/testing/index.d.ts.map +1 -1
  33. package/dist/lib/testing/index.js +26 -1
  34. package/dist/lib/testing/index.js.map +1 -1
  35. package/dist/lib/testing/scenarios/creative.d.ts +24 -0
  36. package/dist/lib/testing/scenarios/creative.d.ts.map +1 -0
  37. package/dist/lib/testing/scenarios/creative.js +224 -0
  38. package/dist/lib/testing/scenarios/creative.js.map +1 -0
  39. package/dist/lib/testing/scenarios/discovery.d.ts +15 -0
  40. package/dist/lib/testing/scenarios/discovery.d.ts.map +1 -0
  41. package/dist/lib/testing/scenarios/discovery.js +66 -0
  42. package/dist/lib/testing/scenarios/discovery.js.map +1 -0
  43. package/dist/lib/testing/scenarios/edge-cases.d.ts +64 -0
  44. package/dist/lib/testing/scenarios/edge-cases.d.ts.map +1 -0
  45. package/dist/lib/testing/scenarios/edge-cases.js +610 -0
  46. package/dist/lib/testing/scenarios/edge-cases.js.map +1 -0
  47. package/dist/lib/testing/scenarios/health.d.ts +12 -0
  48. package/dist/lib/testing/scenarios/health.d.ts.map +1 -0
  49. package/dist/lib/testing/scenarios/health.js +21 -0
  50. package/dist/lib/testing/scenarios/health.js.map +1 -0
  51. package/dist/lib/testing/scenarios/index.d.ts +12 -0
  52. package/dist/lib/testing/scenarios/index.d.ts.map +1 -0
  53. package/dist/lib/testing/scenarios/index.js +38 -0
  54. package/dist/lib/testing/scenarios/index.js.map +1 -0
  55. package/dist/lib/testing/scenarios/media-buy.d.ts +59 -0
  56. package/dist/lib/testing/scenarios/media-buy.d.ts.map +1 -0
  57. package/dist/lib/testing/scenarios/media-buy.js +422 -0
  58. package/dist/lib/testing/scenarios/media-buy.js.map +1 -0
  59. package/dist/lib/testing/scenarios/signals.d.ts +26 -0
  60. package/dist/lib/testing/scenarios/signals.d.ts.map +1 -0
  61. package/dist/lib/testing/scenarios/signals.js +227 -0
  62. package/dist/lib/testing/scenarios/signals.js.map +1 -0
  63. package/dist/lib/testing/test-helpers.d.ts.map +1 -1
  64. package/dist/lib/testing/test-helpers.js +2 -6
  65. package/dist/lib/testing/test-helpers.js.map +1 -1
  66. package/dist/lib/testing/types.d.ts +92 -0
  67. package/dist/lib/testing/types.d.ts.map +1 -0
  68. package/dist/lib/testing/types.js +6 -0
  69. package/dist/lib/testing/types.js.map +1 -0
  70. package/dist/lib/types/adcp.d.ts +1 -4
  71. package/dist/lib/types/adcp.d.ts.map +1 -1
  72. package/dist/lib/types/core.generated.js +2 -2
  73. package/dist/lib/types/schemas.generated.d.ts +3 -4
  74. package/dist/lib/types/schemas.generated.d.ts.map +1 -1
  75. package/dist/lib/types/schemas.generated.js +11 -5
  76. package/dist/lib/types/schemas.generated.js.map +1 -1
  77. package/dist/lib/types/tools.generated.d.ts +57 -30
  78. package/dist/lib/types/tools.generated.d.ts.map +1 -1
  79. package/dist/lib/types/tools.generated.js.map +1 -1
  80. package/package.json +1 -1
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ /**
3
+ * Test result formatting for AdCP Agent E2E Testing
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.formatTestResults = formatTestResults;
7
+ exports.formatTestResultsJSON = formatTestResultsJSON;
8
+ exports.formatTestResultsSummary = formatTestResultsSummary;
9
+ /**
10
+ * Format test results for display in Slack/chat
11
+ */
12
+ function formatTestResults(result) {
13
+ const statusEmoji = result.overall_passed ? '✅' : '❌';
14
+ let output = `## ${statusEmoji} Agent Test Results\n\n`;
15
+ output += `**Agent:** ${result.agent_url}\n`;
16
+ output += `**Scenario:** ${result.scenario}\n`;
17
+ output += `**Duration:** ${result.total_duration_ms}ms\n`;
18
+ output += `**Mode:** ${result.dry_run ? '🧪 Dry Run' : '🔴 Live'}\n`;
19
+ output += `**Result:** ${result.summary}\n\n`;
20
+ // Show agent profile if discovered
21
+ if (result.agent_profile) {
22
+ output += `### Agent Capabilities\n`;
23
+ output += `- **Name:** ${result.agent_profile.name}\n`;
24
+ output += `- **Tools:** ${result.agent_profile.tools.length}\n`;
25
+ if (result.agent_profile.channels?.length) {
26
+ output += `- **Channels:** ${result.agent_profile.channels.join(', ')}\n`;
27
+ }
28
+ if (result.agent_profile.pricing_models?.length) {
29
+ output += `- **Pricing Models:** ${result.agent_profile.pricing_models.join(', ')}\n`;
30
+ }
31
+ if (result.agent_profile.supported_formats?.length) {
32
+ output += `- **Creative Formats:** ${result.agent_profile.supported_formats.length}\n`;
33
+ }
34
+ if (result.agent_profile.supported_signals?.length) {
35
+ output += `- **Signals:** ${result.agent_profile.supported_signals.length}\n`;
36
+ }
37
+ output += '\n';
38
+ }
39
+ output += `### Test Steps\n\n`;
40
+ for (const step of result.steps) {
41
+ const stepEmoji = step.passed ? '✅' : '❌';
42
+ output += `${stepEmoji} **${step.step}**`;
43
+ if (step.task) {
44
+ output += ` (\`${step.task}\`)`;
45
+ }
46
+ output += ` - ${step.duration_ms}ms\n`;
47
+ if (step.details) {
48
+ output += ` ${step.details}\n`;
49
+ }
50
+ if (step.error) {
51
+ output += ` ⚠️ Error: ${step.error}\n`;
52
+ }
53
+ if (step.response_preview && !step.error) {
54
+ output += ` \`\`\`json\n ${step.response_preview.split('\n').join('\n ')}\n \`\`\`\n`;
55
+ }
56
+ output += '\n';
57
+ }
58
+ if (!result.overall_passed) {
59
+ output += `---\n\n`;
60
+ output += `💡 **Need help?** Ask me about specific errors or check the [AdCP documentation](https://adcontextprotocol.org/docs).\n`;
61
+ }
62
+ return output;
63
+ }
64
+ /**
65
+ * Format test results as JSON for programmatic use
66
+ */
67
+ function formatTestResultsJSON(result) {
68
+ return JSON.stringify(result, null, 2);
69
+ }
70
+ /**
71
+ * Format test results as a compact summary
72
+ */
73
+ function formatTestResultsSummary(result) {
74
+ const statusEmoji = result.overall_passed ? '✅' : '❌';
75
+ const passedCount = result.steps.filter(s => s.passed).length;
76
+ const failedCount = result.steps.filter(s => !s.passed).length;
77
+ return `${statusEmoji} ${result.scenario}: ${passedCount}/${result.steps.length} passed (${result.total_duration_ms}ms)${failedCount > 0 ? ` - ${failedCount} failed` : ''}`;
78
+ }
79
+ //# sourceMapping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eAAe,CAAC;QAChG,CAAC;QAED,MAAM,IAAI,IAAI,CAAC;IACjB,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC;QACpB,MAAM,IAAI,yHAAyH,CAAC;IACtI,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAgB,qBAAqB,CAAC,MAAkB;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CAAC,MAAkB;IACzD,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACtD,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;IAC9D,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;IAE/D,OAAO,GAAG,WAAW,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,YAAY,MAAM,CAAC,iBAAiB,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,WAAW,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC/K,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { testAgent, testAgentA2A, testAgentClient, createTestAgent, TEST_AGENT_TOKEN, TEST_AGENT_MCP_CONFIG, TEST_AGENT_A2A_CONFIG, testAgentNoAuth, testAgentNoAuthA2A, TEST_AGENT_NO_AUTH_MCP_CONFIG, TEST_AGENT_NO_AUTH_A2A_CONFIG, creativeAgent, } from './test-helpers';
2
+ export { testAgent as runAgentTests, formatTestResults, formatTestResultsJSON, formatTestResultsSummary, setAgentTesterLogger, getLogger, createTestClient, runStep, testHealthCheck, testDiscovery, testCreateMediaBuy, testFullSalesFlow, testCreativeSync, testCreativeInline, testCreativeFlow, testSignalsFlow, testErrorHandling, testValidation, testPricingEdgeCases, testTemporalValidation, testBehaviorAnalysis, testResponseConsistency, type TestScenario, type TestOptions, type TestResult, type TestStepResult, type AgentProfile, type TaskResult, type Logger, } from './agent-tester';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EAErB,eAAe,EACf,kBAAkB,EAClB,6BAA6B,EAC7B,6BAA6B,EAE7B,aAAa,GACd,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EAErB,eAAe,EACf,kBAAkB,EAClB,6BAA6B,EAC7B,6BAA6B,EAE7B,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,OAAO,EAEP,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EAEvB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,MAAM,GACZ,MAAM,gBAAgB,CAAC"}
@@ -2,7 +2,7 @@
2
2
  // Test helpers for AdCP client library
3
3
  // Provides pre-configured test agents for examples and quick testing
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.creativeAgent = exports.TEST_AGENT_NO_AUTH_A2A_CONFIG = exports.TEST_AGENT_NO_AUTH_MCP_CONFIG = exports.testAgentNoAuthA2A = exports.testAgentNoAuth = exports.TEST_AGENT_A2A_CONFIG = exports.TEST_AGENT_MCP_CONFIG = exports.TEST_AGENT_TOKEN = exports.createTestAgent = exports.testAgentClient = exports.testAgentA2A = exports.testAgent = void 0;
5
+ exports.testResponseConsistency = exports.testBehaviorAnalysis = exports.testTemporalValidation = exports.testPricingEdgeCases = exports.testValidation = exports.testErrorHandling = exports.testSignalsFlow = exports.testCreativeFlow = exports.testCreativeInline = exports.testCreativeSync = exports.testFullSalesFlow = exports.testCreateMediaBuy = exports.testDiscovery = exports.testHealthCheck = exports.runStep = exports.createTestClient = exports.getLogger = exports.setAgentTesterLogger = exports.formatTestResultsSummary = exports.formatTestResultsJSON = exports.formatTestResults = exports.runAgentTests = exports.creativeAgent = exports.TEST_AGENT_NO_AUTH_A2A_CONFIG = exports.TEST_AGENT_NO_AUTH_MCP_CONFIG = exports.testAgentNoAuthA2A = exports.testAgentNoAuth = exports.TEST_AGENT_A2A_CONFIG = exports.TEST_AGENT_MCP_CONFIG = exports.TEST_AGENT_TOKEN = exports.createTestAgent = exports.testAgentClient = exports.testAgentA2A = exports.testAgent = void 0;
6
6
  var test_helpers_1 = require("./test-helpers");
7
7
  // Test agents (with auth)
8
8
  Object.defineProperty(exports, "testAgent", { enumerable: true, get: function () { return test_helpers_1.testAgent; } });
@@ -19,4 +19,29 @@ Object.defineProperty(exports, "TEST_AGENT_NO_AUTH_MCP_CONFIG", { enumerable: tr
19
19
  Object.defineProperty(exports, "TEST_AGENT_NO_AUTH_A2A_CONFIG", { enumerable: true, get: function () { return test_helpers_1.TEST_AGENT_NO_AUTH_A2A_CONFIG; } });
20
20
  // Creative agents (MCP only - A2A not yet supported)
21
21
  Object.defineProperty(exports, "creativeAgent", { enumerable: true, get: function () { return test_helpers_1.creativeAgent; } });
22
+ // E2E Agent Testing Framework
23
+ var agent_tester_1 = require("./agent-tester");
24
+ Object.defineProperty(exports, "runAgentTests", { enumerable: true, get: function () { return agent_tester_1.testAgent; } });
25
+ Object.defineProperty(exports, "formatTestResults", { enumerable: true, get: function () { return agent_tester_1.formatTestResults; } });
26
+ Object.defineProperty(exports, "formatTestResultsJSON", { enumerable: true, get: function () { return agent_tester_1.formatTestResultsJSON; } });
27
+ Object.defineProperty(exports, "formatTestResultsSummary", { enumerable: true, get: function () { return agent_tester_1.formatTestResultsSummary; } });
28
+ Object.defineProperty(exports, "setAgentTesterLogger", { enumerable: true, get: function () { return agent_tester_1.setAgentTesterLogger; } });
29
+ Object.defineProperty(exports, "getLogger", { enumerable: true, get: function () { return agent_tester_1.getLogger; } });
30
+ Object.defineProperty(exports, "createTestClient", { enumerable: true, get: function () { return agent_tester_1.createTestClient; } });
31
+ Object.defineProperty(exports, "runStep", { enumerable: true, get: function () { return agent_tester_1.runStep; } });
32
+ // Individual scenarios
33
+ Object.defineProperty(exports, "testHealthCheck", { enumerable: true, get: function () { return agent_tester_1.testHealthCheck; } });
34
+ Object.defineProperty(exports, "testDiscovery", { enumerable: true, get: function () { return agent_tester_1.testDiscovery; } });
35
+ Object.defineProperty(exports, "testCreateMediaBuy", { enumerable: true, get: function () { return agent_tester_1.testCreateMediaBuy; } });
36
+ Object.defineProperty(exports, "testFullSalesFlow", { enumerable: true, get: function () { return agent_tester_1.testFullSalesFlow; } });
37
+ Object.defineProperty(exports, "testCreativeSync", { enumerable: true, get: function () { return agent_tester_1.testCreativeSync; } });
38
+ Object.defineProperty(exports, "testCreativeInline", { enumerable: true, get: function () { return agent_tester_1.testCreativeInline; } });
39
+ Object.defineProperty(exports, "testCreativeFlow", { enumerable: true, get: function () { return agent_tester_1.testCreativeFlow; } });
40
+ Object.defineProperty(exports, "testSignalsFlow", { enumerable: true, get: function () { return agent_tester_1.testSignalsFlow; } });
41
+ Object.defineProperty(exports, "testErrorHandling", { enumerable: true, get: function () { return agent_tester_1.testErrorHandling; } });
42
+ Object.defineProperty(exports, "testValidation", { enumerable: true, get: function () { return agent_tester_1.testValidation; } });
43
+ Object.defineProperty(exports, "testPricingEdgeCases", { enumerable: true, get: function () { return agent_tester_1.testPricingEdgeCases; } });
44
+ Object.defineProperty(exports, "testTemporalValidation", { enumerable: true, get: function () { return agent_tester_1.testTemporalValidation; } });
45
+ Object.defineProperty(exports, "testBehaviorAnalysis", { enumerable: true, get: function () { return agent_tester_1.testBehaviorAnalysis; } });
46
+ Object.defineProperty(exports, "testResponseConsistency", { enumerable: true, get: function () { return agent_tester_1.testResponseConsistency; } });
22
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/testing/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,qEAAqE;;;AAErE,+CAgBwB;AAftB,0BAA0B;AAC1B,yGAAA,SAAS,OAAA;AACT,4GAAA,YAAY,OAAA;AACZ,+GAAA,eAAe,OAAA;AACf,+GAAA,eAAe,OAAA;AACf,gHAAA,gBAAgB,OAAA;AAChB,qHAAA,qBAAqB,OAAA;AACrB,qHAAA,qBAAqB,OAAA;AACrB,mEAAmE;AACnE,+GAAA,eAAe,OAAA;AACf,kHAAA,kBAAkB,OAAA;AAClB,6HAAA,6BAA6B,OAAA;AAC7B,6HAAA,6BAA6B,OAAA;AAC7B,qDAAqD;AACrD,6GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/testing/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,qEAAqE;;;AAErE,+CAgBwB;AAftB,0BAA0B;AAC1B,yGAAA,SAAS,OAAA;AACT,4GAAA,YAAY,OAAA;AACZ,+GAAA,eAAe,OAAA;AACf,+GAAA,eAAe,OAAA;AACf,gHAAA,gBAAgB,OAAA;AAChB,qHAAA,qBAAqB,OAAA;AACrB,qHAAA,qBAAqB,OAAA;AACrB,mEAAmE;AACnE,+GAAA,eAAe,OAAA;AACf,kHAAA,kBAAkB,OAAA;AAClB,6HAAA,6BAA6B,OAAA;AAC7B,6HAAA,6BAA6B,OAAA;AAC7B,qDAAqD;AACrD,6GAAA,aAAa,OAAA;AAGf,8BAA8B;AAC9B,+CAgCwB;AA/BtB,6GAAA,SAAS,OAAiB;AAC1B,iHAAA,iBAAiB,OAAA;AACjB,qHAAA,qBAAqB,OAAA;AACrB,wHAAA,wBAAwB,OAAA;AACxB,oHAAA,oBAAoB,OAAA;AACpB,yGAAA,SAAS,OAAA;AACT,gHAAA,gBAAgB,OAAA;AAChB,uGAAA,OAAO,OAAA;AACP,uBAAuB;AACvB,+GAAA,eAAe,OAAA;AACf,6GAAA,aAAa,OAAA;AACb,kHAAA,kBAAkB,OAAA;AAClB,iHAAA,iBAAiB,OAAA;AACjB,gHAAA,gBAAgB,OAAA;AAChB,kHAAA,kBAAkB,OAAA;AAClB,gHAAA,gBAAgB,OAAA;AAChB,+GAAA,eAAe,OAAA;AACf,iHAAA,iBAAiB,OAAA;AACjB,8GAAA,cAAc,OAAA;AACd,oHAAA,oBAAoB,OAAA;AACpB,sHAAA,sBAAsB,OAAA;AACtB,oHAAA,oBAAoB,OAAA;AACpB,uHAAA,uBAAuB,OAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Creative Agent Testing Scenarios
3
+ *
4
+ * Tests creative agent capabilities including:
5
+ * - list_creative_formats / list_formats
6
+ * - build_creative
7
+ * - preview_creative
8
+ *
9
+ * Enhanced to:
10
+ * - Test multiple formats from the agent's actual catalog
11
+ * - Test with both required and optional assets
12
+ * - Validate preview renders
13
+ */
14
+ import type { TestOptions, TestStepResult, AgentProfile } from '../types';
15
+ /**
16
+ * Test: Creative Flow (for creative agents)
17
+ *
18
+ * Flow: list_formats -> build_creative (multiple formats) -> preview_creative (with assets)
19
+ */
20
+ export declare function testCreativeFlow(agentUrl: string, options: TestOptions): Promise<{
21
+ steps: TestStepResult[];
22
+ profile?: AgentProfile;
23
+ }>;
24
+ //# sourceMappingURL=creative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"creative.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/scenarios/creative.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AAGtF;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,CAAC,CA2I9D"}
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+ /**
3
+ * Creative Agent Testing Scenarios
4
+ *
5
+ * Tests creative agent capabilities including:
6
+ * - list_creative_formats / list_formats
7
+ * - build_creative
8
+ * - preview_creative
9
+ *
10
+ * Enhanced to:
11
+ * - Test multiple formats from the agent's actual catalog
12
+ * - Test with both required and optional assets
13
+ * - Validate preview renders
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.testCreativeFlow = testCreativeFlow;
17
+ const client_1 = require("../client");
18
+ /**
19
+ * Test: Creative Flow (for creative agents)
20
+ *
21
+ * Flow: list_formats -> build_creative (multiple formats) -> preview_creative (with assets)
22
+ */
23
+ async function testCreativeFlow(agentUrl, options) {
24
+ const steps = [];
25
+ const client = (0, client_1.createTestClient)(agentUrl, options.protocol || 'mcp', options);
26
+ // Discover agent profile
27
+ const { profile, step: profileStep } = await (0, client_1.discoverAgentProfile)(client);
28
+ steps.push(profileStep);
29
+ if (!profileStep.passed) {
30
+ return { steps, profile };
31
+ }
32
+ // Discover creative formats with full details
33
+ const { formats, step: formatStep } = await (0, client_1.discoverCreativeFormats)(client, profile);
34
+ steps.push(formatStep);
35
+ if (!formatStep.passed || !formats || formats.length === 0) {
36
+ return { steps, profile: { ...profile, supported_formats: formats || [] } };
37
+ }
38
+ // Store discovered formats in profile
39
+ profile.supported_formats = formats;
40
+ // Determine which formats to test
41
+ const formatsToTest = selectFormatsToTest(formats || [], options);
42
+ // Build creative for each selected format
43
+ if (profile.tools.includes('build_creative')) {
44
+ for (const format of formatsToTest) {
45
+ const { result, step } = await (0, client_1.runStep)(`Build creative: ${format.name || format.format_id}`, 'build_creative', async () => client.executeTask('build_creative', {
46
+ format_id: format.format_id,
47
+ brand_manifest: options.brand_manifest || getDefaultBrandManifest(),
48
+ prompt: `Create a ${format.type || 'display'} ad for an e-commerce brand promoting summer sale`,
49
+ }));
50
+ if (result?.success && result?.data) {
51
+ const data = result.data;
52
+ step.details = `Built creative for format ${format.format_id}`;
53
+ step.response_preview = JSON.stringify({
54
+ creative_id: data.creative_id || data.creative?.creative_id,
55
+ format_id: data.format_id || data.creative?.format_id,
56
+ has_assets: !!(data.assets?.length || data.creative?.assets?.length),
57
+ }, null, 2);
58
+ step.created_id = data.creative_id || data.creative?.creative_id;
59
+ }
60
+ else if (result && !result.success) {
61
+ step.passed = false;
62
+ step.error = result.error || 'build_creative failed';
63
+ }
64
+ steps.push(step);
65
+ }
66
+ }
67
+ // Preview creative with various asset configurations
68
+ if (profile.tools.includes('preview_creative')) {
69
+ // Test 1: Preview with minimal assets (empty)
70
+ const { step: minimalStep } = await (0, client_1.runStep)('Preview creative: minimal assets', 'preview_creative', async () => client.executeTask('preview_creative', {
71
+ creative: {
72
+ format_id: formatsToTest[0]?.format_id || 'display_300x250',
73
+ name: 'Minimal Test Creative',
74
+ assets: [],
75
+ },
76
+ }));
77
+ steps.push(minimalStep);
78
+ // Test 2: Preview with sample assets
79
+ const sampleFormat = formatsToTest[0];
80
+ if (sampleFormat) {
81
+ const { result, step } = await (0, client_1.runStep)(`Preview creative: with assets (${sampleFormat.format_id})`, 'preview_creative', async () => client.executeTask('preview_creative', {
82
+ creative: {
83
+ format_id: sampleFormat.format_id,
84
+ name: 'Full Test Creative',
85
+ assets: buildTestAssets(sampleFormat),
86
+ },
87
+ }));
88
+ if (result?.success && result?.data) {
89
+ const data = result.data;
90
+ step.details = `Generated preview with ${data.renders?.length || 0} render(s)`;
91
+ step.response_preview = JSON.stringify({
92
+ has_renders: !!(data.renders?.length || data.preview_url),
93
+ render_count: data.renders?.length || (data.preview_url ? 1 : 0),
94
+ preview_url: data.preview_url,
95
+ }, null, 2);
96
+ }
97
+ else if (result && !result.success) {
98
+ step.passed = false;
99
+ step.error = result.error || 'preview_creative failed';
100
+ }
101
+ steps.push(step);
102
+ }
103
+ // Test 3: Preview with invalid format_id (error case)
104
+ const { result: errorResult, step: errorStep } = await (0, client_1.runStep)('Preview creative: invalid format (error expected)', 'preview_creative', async () => client.executeTask('preview_creative', {
105
+ creative: {
106
+ format_id: 'INVALID_FORMAT_ID_12345',
107
+ name: 'Error Test Creative',
108
+ assets: [],
109
+ },
110
+ }));
111
+ // This should fail - if it succeeds with invalid format, that's a bug
112
+ if (errorResult?.success) {
113
+ errorStep.passed = false;
114
+ errorStep.error = 'Expected error for invalid format_id but got success';
115
+ }
116
+ else {
117
+ errorStep.passed = true;
118
+ errorStep.details = 'Correctly rejected invalid format_id';
119
+ }
120
+ steps.push(errorStep);
121
+ }
122
+ return { steps, profile };
123
+ }
124
+ /**
125
+ * Select which formats to test based on options
126
+ */
127
+ function selectFormatsToTest(formats, options) {
128
+ // If specific format_ids provided, use those
129
+ if (options.format_ids?.length) {
130
+ return formats.filter(f => options.format_ids.includes(f.format_id));
131
+ }
132
+ // If test_all_formats, test up to max_formats_to_test
133
+ if (options.test_all_formats) {
134
+ const maxFormats = options.max_formats_to_test || 5;
135
+ return formats.slice(0, maxFormats);
136
+ }
137
+ // Default: test one format of each type (display, video, audio, native, dooh)
138
+ const byType = new Map();
139
+ for (const format of formats) {
140
+ const type = format.type || 'unknown';
141
+ if (!byType.has(type)) {
142
+ byType.set(type, format);
143
+ }
144
+ }
145
+ // Return at least one format, max 3 different types
146
+ const selected = Array.from(byType.values()).slice(0, 3);
147
+ return selected.length > 0 ? selected : formats.slice(0, 1);
148
+ }
149
+ /**
150
+ * Build test assets for a format based on its requirements
151
+ */
152
+ function buildTestAssets(format) {
153
+ const assets = [];
154
+ // Add required assets
155
+ if (format.required_assets?.length) {
156
+ for (const assetName of format.required_assets) {
157
+ assets.push({
158
+ asset_id: assetName,
159
+ asset_type: guessAssetType(assetName),
160
+ url: getTestAssetUrl(assetName),
161
+ });
162
+ }
163
+ }
164
+ // If no required assets, add a default image
165
+ if (assets.length === 0) {
166
+ assets.push({
167
+ asset_id: 'primary_image',
168
+ asset_type: 'image',
169
+ url: 'https://via.placeholder.com/300x250.png?text=Test+Creative',
170
+ });
171
+ }
172
+ return assets;
173
+ }
174
+ /**
175
+ * Guess asset type from asset name
176
+ */
177
+ function guessAssetType(assetName) {
178
+ const lower = assetName.toLowerCase();
179
+ if (lower.includes('video') || lower.includes('clip'))
180
+ return 'video';
181
+ if (lower.includes('audio') || lower.includes('sound'))
182
+ return 'audio';
183
+ if (lower.includes('logo'))
184
+ return 'image';
185
+ if (lower.includes('text') || lower.includes('headline') || lower.includes('copy'))
186
+ return 'text';
187
+ return 'image';
188
+ }
189
+ /**
190
+ * Get a test asset URL for testing
191
+ */
192
+ function getTestAssetUrl(assetName) {
193
+ const type = guessAssetType(assetName);
194
+ switch (type) {
195
+ case 'video':
196
+ return 'https://storage.googleapis.com/webfundamentals-assets/videos/chrome.mp4';
197
+ case 'audio':
198
+ return 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3';
199
+ default:
200
+ return 'https://via.placeholder.com/300x250.png?text=Test+Asset';
201
+ }
202
+ }
203
+ /**
204
+ * Get default brand manifest for testing
205
+ */
206
+ function getDefaultBrandManifest() {
207
+ return {
208
+ name: 'E2E Test Brand',
209
+ url: 'https://test.example.com',
210
+ tagline: 'Testing the future of advertising',
211
+ logos: [
212
+ {
213
+ url: 'https://via.placeholder.com/200x50.png?text=Logo',
214
+ tags: ['primary'],
215
+ },
216
+ ],
217
+ colors: {
218
+ primary: '#0066CC',
219
+ secondary: '#FFFFFF',
220
+ accent: '#FF6600',
221
+ },
222
+ };
223
+ }
224
+ //# sourceMappingURL=creative.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"creative.js","sourceRoot":"","sources":["../../../../src/lib/testing/scenarios/creative.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAUH,4CA8IC;AArJD,sCAAqG;AAErG;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CACpC,QAAgB,EAChB,OAAoB;IAEpB,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,IAAA,yBAAgB,EAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK,EAAE,OAAO,CAAC,CAAC;IAE9E,yBAAyB;IACzB,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,6BAAoB,EAAC,MAAM,CAAC,CAAC;IAC1E,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAExB,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAC5B,CAAC;IAED,8CAA8C;IAC9C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,IAAA,gCAAuB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrF,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAEvB,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,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AC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAC;IACtE,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IACvE,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAC;IAC3C,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAClG,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,SAAiB;IACxC,MAAM,IAAI,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IACvC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,yEAAyE,CAAC;QACnF,KAAK,OAAO;YACV,OAAO,+DAA+D,CAAC;QACzE;YACE,OAAO,yDAAyD,CAAC;IACrE,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,uBAAuB;IAC9B,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,0BAA0B;QAC/B,OAAO,EAAE,mCAAmC;QAC5C,KAAK,EAAE;YACL;gBACE,GAAG,EAAE,kDAAkD;gBACvD,IAAI,EAAE,CAAC,SAAS,CAAC;aAClB;SACF;QACD,MAAM,EAAE;YACN,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,SAAS;SAClB;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Discovery Testing Scenario
3
+ *
4
+ * Tests product discovery, format listing, and property listing.
5
+ */
6
+ import type { TestOptions, TestStepResult, AgentProfile } from '../types';
7
+ /**
8
+ * Test: Discovery
9
+ * Tests product discovery, format listing, and property listing
10
+ */
11
+ export declare function testDiscovery(agentUrl: string, options: TestOptions): Promise<{
12
+ steps: TestStepResult[];
13
+ profile?: AgentProfile;
14
+ }>;
15
+ //# sourceMappingURL=discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/scenarios/discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AAGtF;;;GAGG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,CAAC,CA0E9D"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /**
3
+ * Discovery Testing Scenario
4
+ *
5
+ * Tests product discovery, format listing, and property listing.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.testDiscovery = testDiscovery;
9
+ const client_1 = require("../client");
10
+ /**
11
+ * Test: Discovery
12
+ * Tests product discovery, format listing, and property listing
13
+ */
14
+ async function testDiscovery(agentUrl, options) {
15
+ const steps = [];
16
+ const client = (0, client_1.createTestClient)(agentUrl, options.protocol || 'mcp', options);
17
+ // Discover agent profile
18
+ const { profile, step: profileStep } = await (0, client_1.discoverAgentProfile)(client);
19
+ steps.push(profileStep);
20
+ if (!profileStep.passed) {
21
+ return { steps, profile };
22
+ }
23
+ // Discover capabilities
24
+ const { capabilities, steps: capSteps } = await (0, client_1.discoverAgentCapabilities)(client, profile, options);
25
+ steps.push(...capSteps);
26
+ // Merge capabilities into profile
27
+ Object.assign(profile, capabilities);
28
+ // List creative formats (if available)
29
+ if (profile.tools.includes('list_creative_formats')) {
30
+ const { result, step } = await (0, client_1.runStep)('List creative formats', 'list_creative_formats', async () => client.executeTask('list_creative_formats', {}));
31
+ if (result?.success && result?.data) {
32
+ const data = result.data;
33
+ const formatCount = data.format_ids?.length || data.formats?.length || 0;
34
+ const creativeAgents = data.creative_agents || [];
35
+ step.details = `Found ${formatCount} format(s), ${creativeAgents.length} creative agent(s)`;
36
+ step.response_preview = JSON.stringify({
37
+ format_ids: (data.format_ids || data.formats?.map((f) => f.format_id))?.slice(0, 5),
38
+ creative_agents: creativeAgents.map((a) => a.agent_url || a.url),
39
+ }, null, 2);
40
+ }
41
+ else if (result && !result.success) {
42
+ step.passed = false;
43
+ step.error = result.error || 'list_creative_formats returned unsuccessful result';
44
+ }
45
+ steps.push(step);
46
+ }
47
+ // List authorized properties (if available)
48
+ if (profile.tools.includes('list_authorized_properties')) {
49
+ const { result, step } = await (0, client_1.runStep)('List authorized properties', 'list_authorized_properties', async () => client.executeTask('list_authorized_properties', {}));
50
+ const properties = result?.data?.authorized_properties;
51
+ if (result?.success && properties) {
52
+ step.details = `Found ${properties.length} authorized propert(ies)`;
53
+ step.response_preview = JSON.stringify({
54
+ properties_count: properties.length,
55
+ domains: properties.slice(0, 3).map((p) => p.domain),
56
+ }, null, 2);
57
+ }
58
+ else if (result && !result.success) {
59
+ step.passed = false;
60
+ step.error = result.error || 'list_authorized_properties returned unsuccessful result';
61
+ }
62
+ steps.push(step);
63
+ }
64
+ return { steps, profile };
65
+ }
66
+ //# sourceMappingURL=discovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../../../src/lib/testing/scenarios/discovery.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AASH,sCA6EC;AAnFD,sCAAuG;AAEvG;;;GAGG;AACI,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,OAAoB;IAEpB,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,IAAA,yBAAgB,EAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK,EAAE,OAAO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KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;aAC1D,EACD,IAAI,EACJ,CAAC,CACF,CAAC;QACJ,CAAC;aAAM,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;YACpB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,yDAAyD,CAAC;QACzF,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Edge Case Testing Scenarios
3
+ *
4
+ * Tests various edge cases, error handling, and validation:
5
+ * - Error handling (invalid inputs, non-existent IDs)
6
+ * - Schema validation (negative values, invalid enums)
7
+ * - Pricing edge cases (auction vs fixed, min spend, floor prices)
8
+ * - Behavior analysis
9
+ * - Temporal validation
10
+ * - Response consistency
11
+ *
12
+ * These scenarios are designed to find bugs and ensure agents
13
+ * properly handle edge cases according to the AdCP spec.
14
+ */
15
+ import type { TestOptions, TestStepResult, AgentProfile } from '../types';
16
+ /**
17
+ * Test: Error Handling
18
+ * Verifies the agent returns proper discriminated union error responses
19
+ */
20
+ export declare function testErrorHandling(agentUrl: string, options: TestOptions): Promise<{
21
+ steps: TestStepResult[];
22
+ profile?: AgentProfile;
23
+ }>;
24
+ /**
25
+ * Test: Validation
26
+ * Tests that agents properly validate inputs and reject malformed requests
27
+ */
28
+ export declare function testValidation(agentUrl: string, options: TestOptions): Promise<{
29
+ steps: TestStepResult[];
30
+ profile?: AgentProfile;
31
+ }>;
32
+ /**
33
+ * Test: Pricing Edge Cases
34
+ * Tests auction vs fixed pricing, min spend requirements, bid_price handling
35
+ */
36
+ export declare function testPricingEdgeCases(agentUrl: string, options: TestOptions): Promise<{
37
+ steps: TestStepResult[];
38
+ profile?: AgentProfile;
39
+ }>;
40
+ /**
41
+ * Test: Temporal Validation
42
+ * Tests date/time ordering and format validation
43
+ */
44
+ export declare function testTemporalValidation(agentUrl: string, options: TestOptions): Promise<{
45
+ steps: TestStepResult[];
46
+ profile?: AgentProfile;
47
+ }>;
48
+ /**
49
+ * Test: Behavior Analysis
50
+ * Analyzes agent behavioral characteristics
51
+ */
52
+ export declare function testBehaviorAnalysis(agentUrl: string, options: TestOptions): Promise<{
53
+ steps: TestStepResult[];
54
+ profile?: AgentProfile;
55
+ }>;
56
+ /**
57
+ * Test: Response Consistency
58
+ * Checks for schema errors, pagination bugs, data mismatches
59
+ */
60
+ export declare function testResponseConsistency(agentUrl: string, options: TestOptions): Promise<{
61
+ steps: TestStepResult[];
62
+ profile?: AgentProfile;
63
+ }>;
64
+ //# sourceMappingURL=edge-cases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge-cases.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/scenarios/edge-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AAItF;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,CAAC,CAgJ9D;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,CAAC,CAkJ9D;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MA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