@treasuredata/tdx 0.16.12 → 0.16.13

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 (167) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/anthropic-adapter.js +1 -1
  65. package/dist/proxy/claude-usage-tracker.js +1 -1
  66. package/dist/proxy/context-signature.js +1 -1
  67. package/dist/proxy/conversation-utils.js +1 -1
  68. package/dist/proxy/passthrough-server.js +1 -1
  69. package/dist/proxy/server.js +1 -1
  70. package/dist/proxy/session-cache.js +1 -1
  71. package/dist/proxy/sse-usage-parser.js +1 -1
  72. package/dist/sdk/agent/agent-config.js +1 -1
  73. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  74. package/dist/sdk/agent/agent-yaml.js +1 -1
  75. package/dist/sdk/agent/test/evaluator.js +1 -1
  76. package/dist/sdk/agent/test/executor.js +1 -1
  77. package/dist/sdk/agent/test/index.js +1 -1
  78. package/dist/sdk/agent/test/output.js +1 -1
  79. package/dist/sdk/agent/test/parser.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/endpoints.js +1 -1
  83. package/dist/sdk/client/engage-api-client.js +1 -1
  84. package/dist/sdk/client/http-client.js +1 -1
  85. package/dist/sdk/client/llm-api-client.js +1 -1
  86. package/dist/sdk/client/rate-limiter.js +1 -1
  87. package/dist/sdk/client/td-api-client.js +1 -1
  88. package/dist/sdk/client/trino-api-client.js +1 -1
  89. package/dist/sdk/client/workflow-client.js +1 -1
  90. package/dist/sdk/connection-validator.js +1 -1
  91. package/dist/sdk/connection.js +1 -1
  92. package/dist/sdk/engage.js +1 -1
  93. package/dist/sdk/errors.js +1 -1
  94. package/dist/sdk/index.js +1 -1
  95. package/dist/sdk/io/index.js +1 -1
  96. package/dist/sdk/io/node-filesystem.js +1 -1
  97. package/dist/sdk/job.js +1 -1
  98. package/dist/sdk/journey.js +1 -1
  99. package/dist/sdk/llm/chat-cache.js +1 -1
  100. package/dist/sdk/llm/index.js +1 -1
  101. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  102. package/dist/sdk/llm/model-aliases.js +1 -1
  103. package/dist/sdk/llm/model-factors.js +1 -1
  104. package/dist/sdk/query/index.js +1 -1
  105. package/dist/sdk/query/sql-parser.js +1 -1
  106. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  107. package/dist/sdk/segment/fields-display.js +1 -1
  108. package/dist/sdk/segment/file-discovery.js +1 -1
  109. package/dist/sdk/segment/journey-utils.js +1 -1
  110. package/dist/sdk/segment/journey-yaml.js +1 -1
  111. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  112. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  113. package/dist/sdk/segment/pull-workflow.js +1 -1
  114. package/dist/sdk/segment/push-workflow.js +1 -1
  115. package/dist/sdk/segment/resolution-context.js +1 -1
  116. package/dist/sdk/segment/segment-path-parser.js +1 -1
  117. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  118. package/dist/sdk/segment/target-resolution.js +1 -1
  119. package/dist/sdk/segment/tdx-config.js +1 -1
  120. package/dist/sdk/segment/validate-files.js +1 -1
  121. package/dist/sdk/segment/yaml-validator.js +1 -1
  122. package/dist/sdk/segment.js +1 -1
  123. package/dist/sdk/types/index.js +1 -1
  124. package/dist/sdk/types/progress.js +1 -1
  125. package/dist/sdk/user.js +1 -1
  126. package/dist/sdk/util/format-detector.js +1 -1
  127. package/dist/sdk/util/formatters.js +1 -1
  128. package/dist/sdk/util/index.js +1 -1
  129. package/dist/sdk/util/tree-formatter.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.js +1 -1
  148. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  149. package/dist/utils/logger/formatters/index.js +1 -1
  150. package/dist/utils/logger/handlers/console-handler.js +1 -1
  151. package/dist/utils/logger/handlers/file-handler.js +1 -1
  152. package/dist/utils/logger/handlers/index.js +1 -1
  153. package/dist/utils/logger/handlers/null-handler.js +1 -1
  154. package/dist/utils/logger/index.js +1 -1
  155. package/dist/utils/logger/logger.js +1 -1
  156. package/dist/utils/logger/types.js +1 -1
  157. package/dist/utils/option-validation.js +1 -1
  158. package/dist/utils/port.js +1 -1
  159. package/dist/utils/process.js +1 -1
  160. package/dist/utils/prompt.js +1 -1
  161. package/dist/utils/spinner.js +1 -1
  162. package/dist/utils/sse-parser.js +1 -1
  163. package/dist/utils/string-utils.js +1 -1
  164. package/dist/utils/table-ref-parser.js +1 -1
  165. package/dist/utils/tdx-logger.js +1 -1
  166. package/dist/utils/version-check.js +1 -1
  167. package/package.json +1 -1
@@ -1 +1 @@
1
- const a73_0x117626=a73_0x3ee5;(function(_0x46dd7f,_0xd758ba){const _0x20d6ab=a73_0x3ee5,_0x50d75a=_0x46dd7f();while(!![]){try{const _0x44a7b5=-parseInt(_0x20d6ab(0x10e))/0x1*(parseInt(_0x20d6ab(0x100))/0x2)+-parseInt(_0x20d6ab(0xed))/0x3*(parseInt(_0x20d6ab(0x113))/0x4)+parseInt(_0x20d6ab(0x10d))/0x5+-parseInt(_0x20d6ab(0x111))/0x6*(-parseInt(_0x20d6ab(0x11a))/0x7)+parseInt(_0x20d6ab(0x11c))/0x8*(parseInt(_0x20d6ab(0xfd))/0x9)+parseInt(_0x20d6ab(0x129))/0xa+-parseInt(_0x20d6ab(0x106))/0xb;if(_0x44a7b5===_0xd758ba)break;else _0x50d75a['push'](_0x50d75a['shift']());}catch(_0x417105){_0x50d75a['push'](_0x50d75a['shift']());}}}(a73_0x43a8,0x23db4));import a73_0x3e9357 from'chalk';import{SDKError,ErrorCode}from'../../errors.js';const EVALUATION_RESULT_SCHEMA=JSON['stringify']({'type':a73_0x117626(0x124),'properties':{'plan':{'type':a73_0x117626(0x125),'description':'Brief\x20evaluation\x20strategy'},'thinking':{'type':a73_0x117626(0x125),'description':a73_0x117626(0x10a)},'pass':{'type':a73_0x117626(0x12a),'description':'Whether\x20the\x20agent\x20passed\x20the\x20evaluation'},'reason':{'type':'string','description':a73_0x117626(0x12e)}},'required':[a73_0x117626(0x128),'thinking',a73_0x117626(0xf8),a73_0x117626(0xfe)],'additionalProperties':![]});export const DEFAULT_EVALUATOR_CONFIG={'name':'tdx-agent-evaluator','model':a73_0x117626(0x118),'systemPrompt':a73_0x117626(0x101),'temperature':0.1,'outputs':[{'name':a73_0x117626(0xee),'functionName':a73_0x117626(0x107),'functionDescription':'Submit\x20the\x20evaluation\x20result\x20for\x20the\x20agent\x20conversation','jsonSchema':EVALUATION_RESULT_SCHEMA}]};function outputsMatch(_0x3d7326,_0x59ff30){const _0x1c1d25=a73_0x117626,_0x3089ec=_0x3d7326||[],_0x11fc22=_0x59ff30||[];if(_0x3089ec['length']!==_0x11fc22['length'])return![];for(let _0xddc20f=0x0;_0xddc20f<_0x11fc22[_0x1c1d25(0x12d)];_0xddc20f++){const _0x382e64=_0x11fc22[_0xddc20f],_0x122f48=_0x3089ec[_0xddc20f];if(_0x122f48[_0x1c1d25(0xef)]!==_0x382e64[_0x1c1d25(0xef)]||_0x122f48[_0x1c1d25(0x104)]!==_0x382e64['functionName']||_0x122f48[_0x1c1d25(0xf4)]!==_0x382e64[_0x1c1d25(0xf4)]||_0x122f48[_0x1c1d25(0x127)]!==_0x382e64[_0x1c1d25(0x127)])return![];}return!![];}function configMatches(_0x422d7f,_0x16d68e,_0x123356){const _0x55b432=a73_0x117626,_0x3bba1b=_0x422d7f[_0x55b432(0x119)],_0x2152d4=[];return _0x3bba1b[_0x55b432(0x11e)]!==_0x16d68e[_0x55b432(0xec)]&&_0x2152d4[_0x55b432(0xff)]('model:\x20'+_0x3bba1b[_0x55b432(0x11e)]+_0x55b432(0x12c)+_0x16d68e['model']),(_0x3bba1b['systemPrompt']||'')[_0x55b432(0x10f)]()!==_0x16d68e['systemPrompt'][_0x55b432(0x10f)]()&&_0x2152d4[_0x55b432(0xff)]('systemPrompt:\x20(changed)'),_0x3bba1b[_0x55b432(0xf5)]!==_0x16d68e['temperature']&&_0x2152d4[_0x55b432(0xff)](_0x55b432(0xf6)+_0x3bba1b[_0x55b432(0xf5)]+_0x55b432(0x12c)+_0x16d68e['temperature']),!outputsMatch(_0x3bba1b[_0x55b432(0x115)],_0x16d68e['outputs'])&&_0x2152d4['push'](_0x55b432(0x121)),_0x2152d4['length']>0x0&&_0x123356&&(console[_0x55b432(0xf7)](a73_0x3e9357['yellow'](_0x55b432(0xeb))),_0x2152d4['forEach'](_0xbb0eaf=>console[_0x55b432(0xf7)](a73_0x3e9357[_0x55b432(0x103)]('\x20\x20'+_0xbb0eaf)))),_0x2152d4[_0x55b432(0x12d)]===0x0;}function a73_0x43a8(){const _0x1d8013=['functionName','chat','1838133PYIWRj','submit_evaluation','Failed\x20to\x20parse\x20evaluation\x20result\x20JSON','thinking','Detailed\x20analysis\x20of\x20the\x20conversation','agentsFull','Expected\x20ChatOutputEvent\x20with\x20evaluation\x20result','481630wrZcrR','16878oDkHBa','trim','Content:\x20','1608dQASNa','agentResponse','4kWxdMB','substring','outputs','getOrCreateDefaultProject','stringify','claude-4.5-sonnet','attributes','1099GiOuyC','data','120iEiytk','Evaluator\x20agent\x20ready','modelType','cyan','userInput','outputs:\x20(changed)','\x0a</agent_response>\x0a\x0a<criteria>\x0a','find','object','string','AGENT_EVALUATION_ERROR','jsonSchema','plan','2825970DEnSEx','boolean','output','\x20→\x20','length','Concise\x20explanation\x20of\x20pass/fail\x20decision\x20(1-2\x20sentences)','Evaluator\x20config\x20changes\x20detected:','model','536229fZeeCN','evaluation_result','name','Expected\x20{plan:\x20string,\x20thinking:\x20string,\x20pass:\x20boolean,\x20reason:\x20string}\x0a','event','\x0a</user_input>\x0a\x0a<agent_response>\x0a','Updating\x20evaluator\x20agent...','functionDescription','temperature','temperature:\x20','log','pass','deleteAgent','systemPrompt','criteria','Evaluate\x20the\x20agent\x27s\x20response\x20against\x20the\x20criteria.\x0a\x0a<user_input>\x0a','144297lWoHGX','reason','push','20eNdlew','You\x20are\x20an\x20AI\x20agent\x20evaluation\x20system.\x20Your\x20job\x20is\x20to\x20judge\x20whether\x20an\x20AI\x20agent\x27s\x20conversation\x20meets\x20specified\x20criteria.\x0a\x0aYou\x20will\x20be\x20given:\x0a1.\x20A\x20conversation\x20history\x20showing\x20the\x20full\x20interaction\x20between\x20a\x20user\x20and\x20an\x20AI\x20agent\x0a2.\x20Evaluation\x20criteria\x20that\x20describe\x20what\x20the\x20agent\x20should\x20have\x20accomplished\x0a\x0aYour\x20task\x20is\x20to\x20evaluate\x20whether\x20the\x20agent\x27s\x20responses\x20meet\x20the\x20criteria\x20and\x20submit\x20a\x20structured\x20evaluation\x20result\x20using\x20submit_evaluation\x20function.\x0a','Evaluator\x20agent\x20did\x20not\x20return\x20structured\x20output','yellow'];a73_0x43a8=function(){return _0x1d8013;};return a73_0x43a8();}export async function setupEvaluatorAgent(_0x9431b5,_0x357c1e=![]){const _0x17c8ed=a73_0x117626,_0x35475f=DEFAULT_EVALUATOR_CONFIG,_0x2438ee=await _0x9431b5[_0x17c8ed(0x116)](),_0x205a0b=_0x2438ee['id'],_0x17142f=await _0x9431b5[_0x17c8ed(0x10b)](_0x205a0b),_0x350824=_0x17142f[_0x17c8ed(0x123)](_0x129603=>_0x129603[_0x17c8ed(0x119)][_0x17c8ed(0xef)]===_0x35475f['name']);if(_0x350824){if(configMatches(_0x350824,_0x35475f,_0x357c1e))return _0x350824['id'];console[_0x17c8ed(0xf7)](a73_0x3e9357[_0x17c8ed(0x11f)](_0x17c8ed(0xf3))),await _0x9431b5[_0x17c8ed(0xf9)](_0x350824['id']);}else console[_0x17c8ed(0xf7)](a73_0x3e9357[_0x17c8ed(0x11f)]('Setting\x20up\x20evaluator\x20agent...'));const _0x56bd04=await _0x9431b5['createAgent']({'name':_0x35475f[_0x17c8ed(0xef)],'projectId':_0x205a0b,'modelType':_0x35475f['model'],'systemPrompt':_0x35475f[_0x17c8ed(0xfa)],'temperature':_0x35475f[_0x17c8ed(0xf5)],'outputs':_0x35475f[_0x17c8ed(0x115)]});return console[_0x17c8ed(0xf7)](a73_0x3e9357['green'](_0x17c8ed(0x11d))),_0x56bd04['id'];}export const getOrCreateEvaluatorAgent=setupEvaluatorAgent;function a73_0x3ee5(_0x37b83a,_0x53309c){_0x37b83a=_0x37b83a-0xeb;const _0x43a8ab=a73_0x43a8();let _0x3ee54e=_0x43a8ab[_0x37b83a];return _0x3ee54e;}export async function evaluateRound(_0x596456,_0x289c9f,_0x43bd16){const _0x461eee=a73_0x117626,_0x17f9fa=_0x461eee(0xfc)+_0x43bd16[_0x461eee(0x120)]+_0x461eee(0xf2)+_0x43bd16[_0x461eee(0x112)]+_0x461eee(0x122)+_0x43bd16[_0x461eee(0xfb)]+'\x0a</criteria>';let _0x497ccd='';const _0x4be68e=_0x596456[_0x461eee(0x105)](_0x17f9fa,{'agentId':_0x289c9f});for await(const _0x1e0963 of _0x4be68e){if(_0x1e0963['type']===_0x461eee(0xf1)){const _0x3ac565=_0x1e0963[_0x461eee(0x11b)];_0x461eee(0x12b)in _0x3ac565&&_0x3ac565[_0x461eee(0x12b)]&&(_0x497ccd=_0x3ac565[_0x461eee(0x12b)]['content']);}}if(!_0x497ccd)throw new SDKError(ErrorCode[_0x461eee(0x126)],_0x461eee(0x102),undefined,{'helpText':_0x461eee(0x10c)});return parseEvaluationResult(_0x497ccd);}function isValidEvaluationResult(_0x437542){const _0x4830e2=a73_0x117626;if(!_0x437542||typeof _0x437542!==_0x4830e2(0x124))return![];const _0x26cd25=_0x437542;return typeof _0x26cd25['plan']===_0x4830e2(0x125)&&typeof _0x26cd25[_0x4830e2(0x109)]===_0x4830e2(0x125)&&typeof _0x26cd25[_0x4830e2(0xf8)]===_0x4830e2(0x12a)&&typeof _0x26cd25[_0x4830e2(0xfe)]===_0x4830e2(0x125);}function parseEvaluationResult(_0x24c48d){const _0x55dbda=a73_0x117626;let _0x3c122b;try{_0x3c122b=JSON['parse'](_0x24c48d);}catch(_0x4a8a3f){throw new SDKError(ErrorCode['AGENT_EVALUATION_ERROR'],_0x55dbda(0x108),_0x4a8a3f,{'helpText':_0x55dbda(0x110)+_0x24c48d[_0x55dbda(0x114)](0x0,0xc8)});}if(!isValidEvaluationResult(_0x3c122b))throw new SDKError(ErrorCode[_0x55dbda(0x126)],'Invalid\x20evaluation\x20result\x20structure',undefined,{'helpText':_0x55dbda(0xf0)+('Got:\x20'+JSON[_0x55dbda(0x117)](_0x3c122b)[_0x55dbda(0x114)](0x0,0xc8))});return _0x3c122b;}
1
+ const a73_0x17c3a0=a73_0x4e9a;(function(_0x36318a,_0x364fb2){const _0x683746=a73_0x4e9a,_0x488326=_0x36318a();while(!![]){try{const _0xc3abbc=-parseInt(_0x683746(0x125))/0x1*(-parseInt(_0x683746(0x12e))/0x2)+parseInt(_0x683746(0x163))/0x3+-parseInt(_0x683746(0x137))/0x4*(parseInt(_0x683746(0x162))/0x5)+parseInt(_0x683746(0x12b))/0x6+parseInt(_0x683746(0x139))/0x7*(-parseInt(_0x683746(0x14a))/0x8)+parseInt(_0x683746(0x15c))/0x9+-parseInt(_0x683746(0x14f))/0xa;if(_0xc3abbc===_0x364fb2)break;else _0x488326['push'](_0x488326['shift']());}catch(_0x1d7289){_0x488326['push'](_0x488326['shift']());}}}(a73_0x5c3d,0xdbb9f));import a73_0x2dbad2 from'chalk';import{SDKError,ErrorCode}from'../../errors.js';const EVALUATION_RESULT_SCHEMA=JSON[a73_0x17c3a0(0x122)]({'type':a73_0x17c3a0(0x164),'properties':{'plan':{'type':a73_0x17c3a0(0x13e),'description':a73_0x17c3a0(0x121)},'thinking':{'type':'string','description':a73_0x17c3a0(0x136)},'pass':{'type':a73_0x17c3a0(0x12d),'description':a73_0x17c3a0(0x159)},'reason':{'type':a73_0x17c3a0(0x13e),'description':a73_0x17c3a0(0x131)}},'required':['plan',a73_0x17c3a0(0x123),a73_0x17c3a0(0x129),a73_0x17c3a0(0x161)],'additionalProperties':![]});function a73_0x5c3d(){const _0x11403a=['Content:\x20','event','outputs','length','262968xVzzUa','trim','attributes','log','jsonSchema','9008670LCAhGw','agentsFull','Updating\x20evaluator\x20agent...','model:\x20','claude-4.5-sonnet','green','AGENT_EVALUATION_ERROR','\x20→\x20','model','agentResponse','Whether\x20the\x20agent\x20passed\x20the\x20evaluation','chat','output','206982ANdaAq','Expected\x20{plan:\x20string,\x20thinking:\x20string,\x20pass:\x20boolean,\x20reason:\x20string}\x0a','Evaluator\x20agent\x20ready','Evaluator\x20agent\x20did\x20not\x20return\x20structured\x20output','Got:\x20','reason','45335ELSwWQ','2371425rAnLnt','object','cyan','parse','Brief\x20evaluation\x20strategy','stringify','thinking','substring','1inGQVx','content','evaluation_result','type','pass','systemPrompt','7830714untLvQ','push','boolean','2771492SSnmkH','Failed\x20to\x20parse\x20evaluation\x20result\x20JSON','\x0a</agent_response>\x0a\x0a<criteria>\x0a','Concise\x20explanation\x20of\x20pass/fail\x20decision\x20(1-2\x20sentences)','Evaluator\x20config\x20changes\x20detected:','outputs:\x20(changed)','criteria','modelType','Detailed\x20analysis\x20of\x20the\x20conversation','708UfNplf','forEach','21BRFgCj','find','You\x20are\x20an\x20AI\x20agent\x20evaluation\x20system.\x20Your\x20job\x20is\x20to\x20judge\x20whether\x20an\x20AI\x20agent\x27s\x20conversation\x20meets\x20specified\x20criteria.\x0a\x0aYou\x20will\x20be\x20given:\x0a1.\x20A\x20conversation\x20history\x20showing\x20the\x20full\x20interaction\x20between\x20a\x20user\x20and\x20an\x20AI\x20agent\x0a2.\x20Evaluation\x20criteria\x20that\x20describe\x20what\x20the\x20agent\x20should\x20have\x20accomplished\x0a\x0aYour\x20task\x20is\x20to\x20evaluate\x20whether\x20the\x20agent\x27s\x20responses\x20meet\x20the\x20criteria\x20and\x20submit\x20a\x20structured\x20evaluation\x20result\x20using\x20submit_evaluation\x20function.\x0a','systemPrompt:\x20(changed)','plan','string','tdx-agent-evaluator','\x0a</criteria>','functionName','temperature','name','Expected\x20ChatOutputEvent\x20with\x20evaluation\x20result','functionDescription'];a73_0x5c3d=function(){return _0x11403a;};return a73_0x5c3d();}export const DEFAULT_EVALUATOR_CONFIG={'name':a73_0x17c3a0(0x13f),'model':a73_0x17c3a0(0x153),'systemPrompt':a73_0x17c3a0(0x13b),'temperature':0.1,'outputs':[{'name':a73_0x17c3a0(0x127),'functionName':'submit_evaluation','functionDescription':'Submit\x20the\x20evaluation\x20result\x20for\x20the\x20agent\x20conversation','jsonSchema':EVALUATION_RESULT_SCHEMA}]};function a73_0x4e9a(_0x151bf5,_0x33e85d){_0x151bf5=_0x151bf5-0x11f;const _0x5c3d1b=a73_0x5c3d();let _0x4e9a4d=_0x5c3d1b[_0x151bf5];return _0x4e9a4d;}function outputsMatch(_0x5dc38e,_0x29cf5f){const _0xb69232=a73_0x17c3a0,_0x43d73c=_0x5dc38e||[],_0x487f01=_0x29cf5f||[];if(_0x43d73c[_0xb69232(0x149)]!==_0x487f01[_0xb69232(0x149)])return![];for(let _0x18004a=0x0;_0x18004a<_0x487f01[_0xb69232(0x149)];_0x18004a++){const _0x53f4b7=_0x487f01[_0x18004a],_0xc27d00=_0x43d73c[_0x18004a];if(_0xc27d00[_0xb69232(0x143)]!==_0x53f4b7['name']||_0xc27d00[_0xb69232(0x141)]!==_0x53f4b7[_0xb69232(0x141)]||_0xc27d00[_0xb69232(0x145)]!==_0x53f4b7[_0xb69232(0x145)]||_0xc27d00[_0xb69232(0x14e)]!==_0x53f4b7[_0xb69232(0x14e)])return![];}return!![];}function configMatches(_0xaf1c64,_0x588477,_0x34445e){const _0x3ec486=a73_0x17c3a0,_0x5943ae=_0xaf1c64[_0x3ec486(0x14c)],_0x42fa1b=[];return _0x5943ae[_0x3ec486(0x135)]!==_0x588477['model']&&_0x42fa1b[_0x3ec486(0x12c)](_0x3ec486(0x152)+_0x5943ae[_0x3ec486(0x135)]+_0x3ec486(0x156)+_0x588477[_0x3ec486(0x157)]),(_0x5943ae[_0x3ec486(0x12a)]||'')[_0x3ec486(0x14b)]()!==_0x588477[_0x3ec486(0x12a)][_0x3ec486(0x14b)]()&&_0x42fa1b['push'](_0x3ec486(0x13c)),_0x5943ae[_0x3ec486(0x142)]!==_0x588477[_0x3ec486(0x142)]&&_0x42fa1b[_0x3ec486(0x12c)]('temperature:\x20'+_0x5943ae[_0x3ec486(0x142)]+_0x3ec486(0x156)+_0x588477[_0x3ec486(0x142)]),!outputsMatch(_0x5943ae[_0x3ec486(0x148)],_0x588477['outputs'])&&_0x42fa1b['push'](_0x3ec486(0x133)),_0x42fa1b[_0x3ec486(0x149)]>0x0&&_0x34445e&&(console[_0x3ec486(0x14d)](a73_0x2dbad2['yellow'](_0x3ec486(0x132))),_0x42fa1b[_0x3ec486(0x138)](_0x2ee35b=>console['log'](a73_0x2dbad2['yellow']('\x20\x20'+_0x2ee35b)))),_0x42fa1b['length']===0x0;}export async function setupEvaluatorAgent(_0x20515f,_0x4ac3a0=![]){const _0xa0a73d=a73_0x17c3a0,_0x5a3bcc=DEFAULT_EVALUATOR_CONFIG,_0x1d5b9d=await _0x20515f['getOrCreateDefaultProject'](),_0x227ae3=_0x1d5b9d['id'],_0x29cc16=await _0x20515f[_0xa0a73d(0x150)](_0x227ae3),_0x4d943e=_0x29cc16[_0xa0a73d(0x13a)](_0x43b033=>_0x43b033[_0xa0a73d(0x14c)][_0xa0a73d(0x143)]===_0x5a3bcc[_0xa0a73d(0x143)]);if(_0x4d943e){if(configMatches(_0x4d943e,_0x5a3bcc,_0x4ac3a0))return _0x4d943e['id'];console[_0xa0a73d(0x14d)](a73_0x2dbad2['cyan'](_0xa0a73d(0x151))),await _0x20515f['deleteAgent'](_0x4d943e['id']);}else console[_0xa0a73d(0x14d)](a73_0x2dbad2[_0xa0a73d(0x11f)]('Setting\x20up\x20evaluator\x20agent...'));const _0x24d777=await _0x20515f['createAgent']({'name':_0x5a3bcc[_0xa0a73d(0x143)],'projectId':_0x227ae3,'modelType':_0x5a3bcc[_0xa0a73d(0x157)],'systemPrompt':_0x5a3bcc['systemPrompt'],'temperature':_0x5a3bcc[_0xa0a73d(0x142)],'outputs':_0x5a3bcc['outputs']});return console['log'](a73_0x2dbad2[_0xa0a73d(0x154)](_0xa0a73d(0x15e))),_0x24d777['id'];}export const getOrCreateEvaluatorAgent=setupEvaluatorAgent;export async function evaluateRound(_0x11f0cf,_0x345f55,_0xa0c77f){const _0x5844a8=a73_0x17c3a0,_0x37871a='Evaluate\x20the\x20agent\x27s\x20response\x20against\x20the\x20criteria.\x0a\x0a<user_input>\x0a'+_0xa0c77f['userInput']+'\x0a</user_input>\x0a\x0a<agent_response>\x0a'+_0xa0c77f[_0x5844a8(0x158)]+_0x5844a8(0x130)+_0xa0c77f[_0x5844a8(0x134)]+_0x5844a8(0x140);let _0x18eabf='';const _0x28c9e2=_0x11f0cf[_0x5844a8(0x15a)](_0x37871a,{'agentId':_0x345f55});for await(const _0x3002bf of _0x28c9e2){if(_0x3002bf[_0x5844a8(0x128)]===_0x5844a8(0x147)){const _0x14a2f2=_0x3002bf['data'];_0x5844a8(0x15b)in _0x14a2f2&&_0x14a2f2[_0x5844a8(0x15b)]&&(_0x18eabf=_0x14a2f2[_0x5844a8(0x15b)][_0x5844a8(0x126)]);}}if(!_0x18eabf)throw new SDKError(ErrorCode[_0x5844a8(0x155)],_0x5844a8(0x15f),undefined,{'helpText':_0x5844a8(0x144)});return parseEvaluationResult(_0x18eabf);}function isValidEvaluationResult(_0x383e8a){const _0x3153c5=a73_0x17c3a0;if(!_0x383e8a||typeof _0x383e8a!==_0x3153c5(0x164))return![];const _0x2eb084=_0x383e8a;return typeof _0x2eb084[_0x3153c5(0x13d)]===_0x3153c5(0x13e)&&typeof _0x2eb084[_0x3153c5(0x123)]==='string'&&typeof _0x2eb084[_0x3153c5(0x129)]==='boolean'&&typeof _0x2eb084['reason']==='string';}function parseEvaluationResult(_0x4609c6){const _0x840a57=a73_0x17c3a0;let _0x1bdb7a;try{_0x1bdb7a=JSON[_0x840a57(0x120)](_0x4609c6);}catch(_0x56ece4){throw new SDKError(ErrorCode[_0x840a57(0x155)],_0x840a57(0x12f),_0x56ece4,{'helpText':_0x840a57(0x146)+_0x4609c6['substring'](0x0,0xc8)});}if(!isValidEvaluationResult(_0x1bdb7a))throw new SDKError(ErrorCode[_0x840a57(0x155)],'Invalid\x20evaluation\x20result\x20structure',undefined,{'helpText':_0x840a57(0x15d)+(_0x840a57(0x160)+JSON[_0x840a57(0x122)](_0x1bdb7a)[_0x840a57(0x124)](0x0,0xc8))});return _0x1bdb7a;}
@@ -1 +1 @@
1
- const a74_0x55edc8=a74_0x253f;(function(_0x269bda,_0x4c4954){const _0xda39f0=a74_0x253f,_0x1291b6=_0x269bda();while(!![]){try{const _0x360736=-parseInt(_0xda39f0(0x109))/0x1+parseInt(_0xda39f0(0x104))/0x2+-parseInt(_0xda39f0(0xf4))/0x3*(-parseInt(_0xda39f0(0xed))/0x4)+-parseInt(_0xda39f0(0x115))/0x5*(parseInt(_0xda39f0(0xf8))/0x6)+-parseInt(_0xda39f0(0xd9))/0x7*(-parseInt(_0xda39f0(0xe7))/0x8)+parseInt(_0xda39f0(0xf1))/0x9*(-parseInt(_0xda39f0(0xfb))/0xa)+-parseInt(_0xda39f0(0xe1))/0xb*(-parseInt(_0xda39f0(0x106))/0xc);if(_0x360736===_0x4c4954)break;else _0x1291b6['push'](_0x1291b6['shift']());}catch(_0x136afa){_0x1291b6['push'](_0x1291b6['shift']());}}}(a74_0x3c5d,0xe1d84));import{getLLMConversationUrl}from'../../client/endpoints.js';function a74_0x3c5d(){const _0x542504=['data','chat','message','15967798lScQwW','onEvaluationStart','projectName','agentResponse','PASS','user_input','856JOcCtL','agent_response','push','last_agent_test_run.json',',\x20test\x20has\x20','write','532AcxQzU','map','site','slice','9mkdCti','testName','rounds','3993VNswaU','\x22\x20not\x20found\x20in\x20cached\x20run','agent','success','156VlCDZp','length','reason','2900090kjrMZi','now','evaluatorId\x20is\x20required\x20when\x20noEval\x20is\x20false','projectId','chatId','pass','input','tests','name','59560kCPSFL','ERROR','24cngjaT','FAIL','type','1682890plPAPg','criteria','agentName','path','Conversation\x20completed\x20successfully\x20(evaluation\x20skipped)','history','duration_ms','agentId','Round\x20count\x20mismatch:\x20cached\x20has\x20','exists','Conversation\x20failed','conversations','72185dFIuzu','Evaluation\x20failed:\x20','duration','userInput','error','10682DeHesZ','toISOString','Test\x20\x22','onEvaluationComplete','metadata'];a74_0x3c5d=function(){return _0x542504;};return a74_0x3c5d();}function a74_0x253f(_0x2e775a,_0x303d65){_0x2e775a=_0x2e775a-0xd7;const _0x3c5d6e=a74_0x3c5d();let _0x253fcb=_0x3c5d6e[_0x2e775a];return _0x253fcb;}import{evaluateRound}from'./evaluator.js';import{createCache}from'../../../utils/local-cache.js';const testRunCache=createCache(a74_0x55edc8(0xea),'agent/test');export function saveLastTestRun(_0x237795){const _0x4d42c4=a74_0x55edc8;testRunCache[_0x4d42c4(0xec)](_0x237795);}export function loadLastTestRun(){return testRunCache['read']();}export function hasLastTestRun(){const _0x5ab5cf=a74_0x55edc8;return testRunCache[_0x5ab5cf(0x112)]();}export function getTestRunCachePath(){const _0x38b0d0=a74_0x55edc8;return testRunCache[_0x38b0d0(0x10c)]();}export function buildCachedTestRun(_0x4a8521,_0x487ec4){const _0x3bb488=a74_0x55edc8,_0x2774f0=_0x4a8521['map'](_0x1a3120=>({'testName':_0x1a3120['name'],'chatId':_0x1a3120[_0x3bb488(0xff)],'rounds':_0x1a3120[_0x3bb488(0xf3)][_0x3bb488(0xee)](_0x1a44db=>({'user_input':_0x1a44db[_0x3bb488(0xd7)],'criteria':_0x1a44db['criteria'],'agent_response':_0x1a44db[_0x3bb488(0xe4)]}))}));return{'version':0x1,'timestamp':new Date()[_0x3bb488(0xda)](),'site':_0x487ec4[_0x3bb488(0xef)],'agent':{'projectId':_0x487ec4['projectId'],'projectName':_0x487ec4[_0x3bb488(0xe3)],'agentId':_0x487ec4['agentId'],'agentName':_0x487ec4[_0x3bb488(0x10b)]},'testYmlPath':_0x487ec4['testYmlPath'],'conversations':_0x2774f0};}export async function runConversation(_0x4d758d,_0x501d02,_0x2607da){const _0x50ded0=a74_0x55edc8,{agentId:_0xb6076f,projectId:_0x4834e3,onRoundStart:_0x35b5fe,onRoundComplete:_0x2cc370}=_0x2607da,_0x52c3fe=Date['now'](),_0x2e693a=[];let _0x3184e4,_0x574435=![],_0x3e3fe6;try{for(let _0x400849=0x0;_0x400849<_0x501d02[_0x50ded0(0xf3)][_0x50ded0(0xf9)];_0x400849++){const _0x1c9bd4=_0x501d02[_0x50ded0(0xf3)][_0x400849];_0x35b5fe?.(_0x400849,_0x501d02[_0x50ded0(0xf3)]['length']);const _0x3ed6a3=Date[_0x50ded0(0xfc)]();try{const _0x47b7fe=await sendRound(_0x4d758d,{'userInput':_0x1c9bd4[_0x50ded0(0xe6)],'agentId':_0xb6076f,'chatId':_0x3184e4});!_0x3184e4&&(_0x3184e4=_0x47b7fe);const _0x3b6122=Date[_0x50ded0(0xfc)]()-_0x3ed6a3;_0x2e693a[_0x50ded0(0xe9)]({'startTime':_0x3ed6a3,'duration':_0x3b6122,'success':!![]}),_0x2cc370?.(_0x400849,_0x3b6122,!![]);}catch(_0x5debe5){const _0x1b3cb4=Date[_0x50ded0(0xfc)]()-_0x3ed6a3,_0x193e9c=_0x5debe5 instanceof Error?_0x5debe5[_0x50ded0(0xe0)]:String(_0x5debe5);_0x2e693a['push']({'startTime':_0x3ed6a3,'duration':_0x1b3cb4,'success':![],'error':_0x193e9c}),_0x574435=!![],_0x3e3fe6=_0x193e9c,_0x2cc370?.(_0x400849,_0x1b3cb4,![]);break;}}}catch(_0x12074e){_0x574435=!![],_0x3e3fe6=_0x12074e instanceof Error?_0x12074e['message']:String(_0x12074e);}const _0x4d926b=[];if(_0x3184e4){const _0x320333=await _0x4d758d[_0x50ded0(0x10e)](_0x3184e4),_0x3427a9=_0x320333[_0x50ded0(0xde)];for(let _0x5c0cf5=0x0;_0x5c0cf5<_0x501d02[_0x50ded0(0xf3)][_0x50ded0(0xf9)];_0x5c0cf5++){const _0x1c1d08=_0x501d02[_0x50ded0(0xf3)][_0x5c0cf5],_0x52cf8f=_0x2e693a[_0x5c0cf5];if(!_0x52cf8f)break;_0x4d926b['push']({'index':_0x5c0cf5,'userInput':_0x1c1d08[_0x50ded0(0xe6)],'agentResponse':findAgentResponseForInput(_0x3427a9,_0x1c1d08[_0x50ded0(0xe6)]),'criteria':_0x1c1d08[_0x50ded0(0x10a)],'duration_ms':_0x52cf8f[_0x50ded0(0x117)],'success':_0x52cf8f[_0x50ded0(0xf7)],'error':_0x52cf8f[_0x50ded0(0xd8)]});}}const _0x5c8dff=Date[_0x50ded0(0xfc)]()-_0x52c3fe;return{'name':_0x501d02[_0x50ded0(0x103)],'chatId':_0x3184e4||'','agentId':_0xb6076f,'projectId':_0x4834e3,'rounds':_0x4d926b,'duration_ms':_0x5c8dff,'success':!_0x574435,'error':_0x3e3fe6};}async function sendRound(_0x4f1eda,_0x5f0ea1){const _0x31f69a=a74_0x55edc8,{userInput:_0x176262,agentId:_0x3ecd22,chatId:_0x58d23a}=_0x5f0ea1;let _0x26fde1=_0x58d23a;const _0x184212=_0x4f1eda[_0x31f69a(0xdf)](_0x176262,{'agentId':_0x3ecd22,'chatId':_0x26fde1});for await(const _0x3cb38f of _0x184212){_0x3cb38f[_0x31f69a(0x108)]===_0x31f69a(0xdd)&&(_0x26fde1=_0x3cb38f[_0x31f69a(0xde)][_0x31f69a(0xff)]);}if(!_0x26fde1)throw new Error('Failed\x20to\x20get\x20chat\x20ID\x20from\x20conversation');return _0x26fde1;}function findAgentResponseForInput(_0x196daf,_0x58443a){const _0x19ff55=a74_0x55edc8;let _0x3207a4=-0x1;for(let _0x53f166=0x0;_0x53f166<_0x196daf[_0x19ff55(0xf9)];_0x53f166++){const _0x2355d0=_0x196daf[_0x53f166];if(_0x19ff55(0x101)in _0x2355d0&&_0x2355d0[_0x19ff55(0x101)]===_0x58443a){_0x3207a4=_0x53f166;break;}}if(_0x3207a4===-0x1)return'';let _0xde1152=_0x196daf[_0x19ff55(0xf9)];for(let _0x108e8d=_0x3207a4+0x1;_0x108e8d<_0x196daf[_0x19ff55(0xf9)];_0x108e8d++){if(_0x19ff55(0x101)in _0x196daf[_0x108e8d]){_0xde1152=_0x108e8d;break;}}const _0x3d9252=_0x196daf[_0x19ff55(0xf0)](_0x3207a4+0x1,_0xde1152);return JSON['stringify'](_0x3d9252);}export function getConversationUrl(_0x2f01e0,_0x291b5f){const _0x18f49c=a74_0x55edc8;return getLLMConversationUrl(_0x291b5f,_0x2f01e0[_0x18f49c(0xfe)],_0x2f01e0[_0x18f49c(0x110)],_0x2f01e0[_0x18f49c(0xff)]);}export async function runTest(_0x5700d6,_0x4c73fe,_0x1c8469){const _0xdcf071=a74_0x55edc8,{site:_0x203014,noEval:noEval=![]}=_0x1c8469,_0x278620=Date['now'](),_0x237a5c=await runConversation(_0x5700d6,_0x4c73fe,_0x1c8469);if(!_0x237a5c['success'])return{'result':{'name':_0x4c73fe[_0xdcf071(0x103)],'status':_0xdcf071(0x105),'reason':_0x237a5c[_0xdcf071(0xd8)]||_0xdcf071(0x113),'conversation_url':_0x237a5c[_0xdcf071(0xff)]?getConversationUrl(_0x237a5c,_0x203014):undefined,'timestamp':new Date(_0x278620)[_0xdcf071(0xda)](),'duration_ms':_0x237a5c[_0xdcf071(0x10f)]},'conversation':_0x237a5c};if(noEval)return{'result':{'name':_0x4c73fe[_0xdcf071(0x103)],'status':_0xdcf071(0xe5),'reason':_0xdcf071(0x10d),'conversation_url':getConversationUrl(_0x237a5c,_0x203014),'timestamp':new Date(_0x278620)[_0xdcf071(0xda)](),'duration_ms':_0x237a5c[_0xdcf071(0x10f)]},'conversation':_0x237a5c};_0x1c8469[_0xdcf071(0xe2)]?.();const _0x21bfaa=Date['now']();if(!_0x1c8469['evaluatorId'])throw new Error(_0xdcf071(0xfd));try{const _0x3b2cd4=[];let _0x817b4e=!![],_0x309288='';for(const _0x3f517f of _0x237a5c['rounds']){const _0x4f788a=await evaluateRound(_0x5700d6,_0x1c8469['evaluatorId'],_0x3f517f);_0x3b2cd4['push'](_0x4f788a);if(!_0x4f788a['pass']){_0x817b4e=![],_0x309288=_0x4f788a[_0xdcf071(0xfa)];break;}}const _0x4f43ec=Date[_0xdcf071(0xfc)]()-_0x21bfaa;_0x1c8469['onEvaluationComplete']?.(_0x4f43ec);const _0x9cd3db=_0x3b2cd4[_0x3b2cd4[_0xdcf071(0xf9)]-0x1];return{'result':{'name':_0x4c73fe['name'],'status':_0x817b4e?_0xdcf071(0xe5):_0xdcf071(0x107),'reason':_0x817b4e?_0x9cd3db[_0xdcf071(0xfa)]:_0x309288,'conversation_url':getConversationUrl(_0x237a5c,_0x203014),'timestamp':new Date(_0x278620)[_0xdcf071(0xda)](),'duration_ms':Date[_0xdcf071(0xfc)]()-_0x278620,'evaluation':_0x9cd3db},'conversation':_0x237a5c};}catch(_0x184fb5){const _0x1e1d5e=Date['now']()-_0x21bfaa;_0x1c8469[_0xdcf071(0xdc)]?.(_0x1e1d5e);const _0x13c469=_0x184fb5 instanceof Error?_0x184fb5[_0xdcf071(0xe0)]:String(_0x184fb5);return{'result':{'name':_0x4c73fe[_0xdcf071(0x103)],'status':_0xdcf071(0x105),'reason':'Evaluation\x20failed:\x20'+_0x13c469,'conversation_url':getConversationUrl(_0x237a5c,_0x203014),'timestamp':new Date(_0x278620)['toISOString'](),'duration_ms':Date['now']()-_0x278620},'conversation':_0x237a5c};}}export async function reevaluateFromCache(_0x47f92d,_0x8bc85a,_0x570e7c,_0x2118ca){const _0xb6bb9e=a74_0x55edc8,{evaluatorId:_0xaac212,onTestStart:_0x5e5b40,onTestComplete:_0x24e740,onTestSkipped:_0x42b1f1}=_0x2118ca,_0x278aaa=[],_0x5892af=new Map(_0x8bc85a[_0xb6bb9e(0x114)][_0xb6bb9e(0xee)](_0x3a9874=>[_0x3a9874[_0xb6bb9e(0xf2)],_0x3a9874]));for(let _0xd064a=0x0;_0xd064a<_0x570e7c[_0xb6bb9e(0x102)][_0xb6bb9e(0xf9)];_0xd064a++){const _0x1a2a1e=_0x570e7c[_0xb6bb9e(0x102)][_0xd064a],_0x589e0d=_0x5892af['get'](_0x1a2a1e[_0xb6bb9e(0x103)]);_0x5e5b40?.(_0x1a2a1e[_0xb6bb9e(0x103)],_0xd064a,_0x570e7c['tests'][_0xb6bb9e(0xf9)]);if(!_0x589e0d){const _0x100315=_0xb6bb9e(0xdb)+_0x1a2a1e[_0xb6bb9e(0x103)]+_0xb6bb9e(0xf5);_0x42b1f1?.(_0x1a2a1e['name'],_0x100315);continue;}if(_0x589e0d['rounds']['length']!==_0x1a2a1e[_0xb6bb9e(0xf3)]['length']){const _0x43cfef=_0xb6bb9e(0x111)+_0x589e0d['rounds']['length']+_0xb6bb9e(0xeb)+_0x1a2a1e[_0xb6bb9e(0xf3)][_0xb6bb9e(0xf9)];_0x42b1f1?.(_0x1a2a1e['name'],_0x43cfef),_0x278aaa['push']({'name':_0x1a2a1e[_0xb6bb9e(0x103)],'status':_0xb6bb9e(0x105),'reason':_0x43cfef,'timestamp':new Date()[_0xb6bb9e(0xda)](),'duration_ms':0x0});continue;}const _0x3d6c20=Date[_0xb6bb9e(0xfc)]();try{let _0x3e5cd1=!![],_0x38258e='',_0x217335;for(let _0x3fcea1=0x0;_0x3fcea1<_0x1a2a1e['rounds'][_0xb6bb9e(0xf9)];_0x3fcea1++){const _0x5493e4=_0x1a2a1e[_0xb6bb9e(0xf3)][_0x3fcea1],_0x42f9bc=_0x589e0d[_0xb6bb9e(0xf3)][_0x3fcea1],_0x269ad9={'index':_0x3fcea1,'userInput':_0x42f9bc[_0xb6bb9e(0xe6)],'agentResponse':_0x42f9bc[_0xb6bb9e(0xe8)],'criteria':_0x5493e4[_0xb6bb9e(0x10a)],'duration_ms':0x0,'success':!![]},_0x4c1483=await evaluateRound(_0x47f92d,_0xaac212,_0x269ad9);_0x217335=_0x4c1483;if(!_0x4c1483[_0xb6bb9e(0x100)]){_0x3e5cd1=![],_0x38258e=_0x4c1483['reason'];break;}}const _0x348a81=Date[_0xb6bb9e(0xfc)]()-_0x3d6c20,_0x21c939=getLLMConversationUrl(_0x8bc85a[_0xb6bb9e(0xef)],_0x8bc85a[_0xb6bb9e(0xf6)][_0xb6bb9e(0xfe)],_0x8bc85a[_0xb6bb9e(0xf6)][_0xb6bb9e(0x110)],_0x589e0d[_0xb6bb9e(0xff)]),_0xc70b1e={'name':_0x1a2a1e[_0xb6bb9e(0x103)],'status':_0x3e5cd1?_0xb6bb9e(0xe5):'FAIL','reason':_0x3e5cd1?_0x217335?.[_0xb6bb9e(0xfa)]||'All\x20criteria\x20met':_0x38258e,'conversation_url':_0x21c939,'timestamp':new Date()[_0xb6bb9e(0xda)](),'duration_ms':_0x348a81,'evaluation':_0x217335};_0x278aaa['push'](_0xc70b1e),_0x24e740?.(_0x1a2a1e[_0xb6bb9e(0x103)],_0xc70b1e);}catch(_0x2a5f1f){const _0x2de2f1=Date['now']()-_0x3d6c20,_0x415e4a=_0x2a5f1f instanceof Error?_0x2a5f1f[_0xb6bb9e(0xe0)]:String(_0x2a5f1f),_0x21806e={'name':_0x1a2a1e[_0xb6bb9e(0x103)],'status':_0xb6bb9e(0x105),'reason':_0xb6bb9e(0x116)+_0x415e4a,'timestamp':new Date()['toISOString'](),'duration_ms':_0x2de2f1};_0x278aaa[_0xb6bb9e(0xe9)](_0x21806e),_0x24e740?.(_0x1a2a1e[_0xb6bb9e(0x103)],_0x21806e);}}return _0x278aaa;}
1
+ const a74_0x5771f1=a74_0x478e;(function(_0x42427f,_0x577516){const _0x5f12c7=a74_0x478e,_0x21f454=_0x42427f();while(!![]){try{const _0x484aff=parseInt(_0x5f12c7(0x8b))/0x1+parseInt(_0x5f12c7(0x8c))/0x2+-parseInt(_0x5f12c7(0x9b))/0x3*(-parseInt(_0x5f12c7(0xa2))/0x4)+parseInt(_0x5f12c7(0x9f))/0x5+-parseInt(_0x5f12c7(0xb3))/0x6*(-parseInt(_0x5f12c7(0x92))/0x7)+-parseInt(_0x5f12c7(0xa5))/0x8*(parseInt(_0x5f12c7(0xb0))/0x9)+-parseInt(_0x5f12c7(0xa9))/0xa;if(_0x484aff===_0x577516)break;else _0x21f454['push'](_0x21f454['shift']());}catch(_0x175915){_0x21f454['push'](_0x21f454['shift']());}}}(a74_0x1f4e,0xc1245));import{getLLMConversationUrl}from'../../client/endpoints.js';import{evaluateRound}from'./evaluator.js';function a74_0x478e(_0x53d4ca,_0x3772dd){_0x53d4ca=_0x53d4ca-0x8b;const _0x1f4e68=a74_0x1f4e();let _0x478e84=_0x1f4e68[_0x53d4ca];return _0x478e84;}import{createCache}from'../../../utils/local-cache.js';const testRunCache=createCache(a74_0x5771f1(0xa1),a74_0x5771f1(0xc1));export function saveLastTestRun(_0x4fc472){const _0x4a416d=a74_0x5771f1;testRunCache[_0x4a416d(0x9c)](_0x4fc472);}export function loadLastTestRun(){const _0x246707=a74_0x5771f1;return testRunCache[_0x246707(0xc5)]();}export function hasLastTestRun(){const _0x47329e=a74_0x5771f1;return testRunCache[_0x47329e(0xa3)]();}export function getTestRunCachePath(){const _0x54f875=a74_0x5771f1;return testRunCache[_0x54f875(0xbd)]();}export function buildCachedTestRun(_0x26e511,_0x4ec95b){const _0x3cf505=a74_0x5771f1,_0x5ce9a8=_0x26e511[_0x3cf505(0xbb)](_0x3bb516=>({'testName':_0x3bb516[_0x3cf505(0xa6)],'chatId':_0x3bb516[_0x3cf505(0xb9)],'rounds':_0x3bb516['rounds']['map'](_0x24229d=>({'user_input':_0x24229d['userInput'],'criteria':_0x24229d[_0x3cf505(0xbf)],'agent_response':_0x24229d[_0x3cf505(0x96)]}))}));return{'version':0x1,'timestamp':new Date()[_0x3cf505(0xbc)](),'site':_0x4ec95b[_0x3cf505(0xb4)],'agent':{'projectId':_0x4ec95b[_0x3cf505(0xb7)],'projectName':_0x4ec95b[_0x3cf505(0xa7)],'agentId':_0x4ec95b[_0x3cf505(0xaf)],'agentName':_0x4ec95b[_0x3cf505(0x99)]},'testYmlPath':_0x4ec95b['testYmlPath'],'conversations':_0x5ce9a8};}export async function runConversation(_0x59e830,_0x2f68a0,_0xa4a73f){const _0x1c0388=a74_0x5771f1,{agentId:_0x376d3d,projectId:_0x43f760,onRoundStart:_0x1522ef,onRoundComplete:_0x56fdc9}=_0xa4a73f,_0x525669=Date[_0x1c0388(0xaa)](),_0x2ca38a=[];let _0x109faf,_0x531dde=![],_0x275148;try{for(let _0x3938b0=0x0;_0x3938b0<_0x2f68a0[_0x1c0388(0xa4)][_0x1c0388(0x94)];_0x3938b0++){const _0x338ad1=_0x2f68a0[_0x1c0388(0xa4)][_0x3938b0];_0x1522ef?.(_0x3938b0,_0x2f68a0[_0x1c0388(0xa4)]['length']);const _0xdd1096=Date[_0x1c0388(0xaa)]();try{const _0x81e542=await sendRound(_0x59e830,{'userInput':_0x338ad1[_0x1c0388(0x93)],'agentId':_0x376d3d,'chatId':_0x109faf});!_0x109faf&&(_0x109faf=_0x81e542);const _0x4e7ed1=Date['now']()-_0xdd1096;_0x2ca38a[_0x1c0388(0xae)]({'startTime':_0xdd1096,'duration':_0x4e7ed1,'success':!![]}),_0x56fdc9?.(_0x3938b0,_0x4e7ed1,!![]);}catch(_0x269ffa){const _0x1c3e0f=Date[_0x1c0388(0xaa)]()-_0xdd1096,_0x557f69=_0x269ffa instanceof Error?_0x269ffa[_0x1c0388(0xc7)]:String(_0x269ffa);_0x2ca38a[_0x1c0388(0xae)]({'startTime':_0xdd1096,'duration':_0x1c3e0f,'success':![],'error':_0x557f69}),_0x531dde=!![],_0x275148=_0x557f69,_0x56fdc9?.(_0x3938b0,_0x1c3e0f,![]);break;}}}catch(_0x10a575){_0x531dde=!![],_0x275148=_0x10a575 instanceof Error?_0x10a575[_0x1c0388(0xc7)]:String(_0x10a575);}const _0x2a885f=[];if(_0x109faf){const _0x49ea74=await _0x59e830[_0x1c0388(0xba)](_0x109faf),_0x12f036=_0x49ea74[_0x1c0388(0x8d)];for(let _0xb915de=0x0;_0xb915de<_0x2f68a0[_0x1c0388(0xa4)]['length'];_0xb915de++){const _0x17a759=_0x2f68a0[_0x1c0388(0xa4)][_0xb915de],_0x50efbf=_0x2ca38a[_0xb915de];if(!_0x50efbf)break;_0x2a885f['push']({'index':_0xb915de,'userInput':_0x17a759[_0x1c0388(0x93)],'agentResponse':findAgentResponseForInput(_0x12f036,_0x17a759[_0x1c0388(0x93)]),'criteria':_0x17a759[_0x1c0388(0xbf)],'duration_ms':_0x50efbf[_0x1c0388(0xb5)],'success':_0x50efbf['success'],'error':_0x50efbf[_0x1c0388(0x9d)]});}}const _0x5f3643=Date['now']()-_0x525669;return{'name':_0x2f68a0[_0x1c0388(0xa6)],'chatId':_0x109faf||'','agentId':_0x376d3d,'projectId':_0x43f760,'rounds':_0x2a885f,'duration_ms':_0x5f3643,'success':!_0x531dde,'error':_0x275148};}async function sendRound(_0x3d6575,_0x12865f){const _0x5d257d=a74_0x5771f1,{userInput:_0x5b0a45,agentId:_0x3f0e42,chatId:_0x2a4418}=_0x12865f;let _0x293765=_0x2a4418;const _0x56623a=_0x3d6575[_0x5d257d(0xc4)](_0x5b0a45,{'agentId':_0x3f0e42,'chatId':_0x293765});for await(const _0x5bfa0f of _0x56623a){_0x5bfa0f[_0x5d257d(0x90)]===_0x5d257d(0xbe)&&(_0x293765=_0x5bfa0f[_0x5d257d(0x8d)]['chatId']);}if(!_0x293765)throw new Error(_0x5d257d(0xca));return _0x293765;}function findAgentResponseForInput(_0x38ea7c,_0x24b904){const _0x46d293=a74_0x5771f1;let _0x5ca23e=-0x1;for(let _0x5482a7=0x0;_0x5482a7<_0x38ea7c[_0x46d293(0x94)];_0x5482a7++){const _0x2d8cf8=_0x38ea7c[_0x5482a7];if(_0x46d293(0x97)in _0x2d8cf8&&_0x2d8cf8[_0x46d293(0x97)]===_0x24b904){_0x5ca23e=_0x5482a7;break;}}if(_0x5ca23e===-0x1)return'';let _0x13a21d=_0x38ea7c[_0x46d293(0x94)];for(let _0x1e9093=_0x5ca23e+0x1;_0x1e9093<_0x38ea7c[_0x46d293(0x94)];_0x1e9093++){if('input'in _0x38ea7c[_0x1e9093]){_0x13a21d=_0x1e9093;break;}}const _0x34894a=_0x38ea7c['slice'](_0x5ca23e+0x1,_0x13a21d);return JSON[_0x46d293(0xa8)](_0x34894a);}function a74_0x1f4e(){const _0x244150=['get','151629GmtjkW','write','error','reason','4825175vHBIaI',',\x20test\x20has\x20','last_agent_test_run.json','56GELgLZ','exists','rounds','12219360IBtNRx','name','projectName','stringify','24013500QQokEq','now','Conversation\x20completed\x20successfully\x20(evaluation\x20skipped)','evaluatorId\x20is\x20required\x20when\x20noEval\x20is\x20false','Conversation\x20failed','push','agentId','9pBTihY','FAIL','onEvaluationStart','6BDVWzJ','site','duration','ERROR','projectId','testName','chatId','history','map','toISOString','path','metadata','criteria','agent','agent/test','Test\x20\x22','conversations','chat','read','Evaluation\x20failed:\x20','message','\x22\x20not\x20found\x20in\x20cached\x20run','duration_ms','Failed\x20to\x20get\x20chat\x20ID\x20from\x20conversation','onEvaluationComplete','962489Hsfxsh','1974030JtHeyh','data','evaluatorId','pass','type','PASS','7684166eejEGm','user_input','length','tests','agentResponse','input','agent_response','agentName'];a74_0x1f4e=function(){return _0x244150;};return a74_0x1f4e();}export function getConversationUrl(_0x78f907,_0x3722bd){const _0x213cd3=a74_0x5771f1;return getLLMConversationUrl(_0x3722bd,_0x78f907[_0x213cd3(0xb7)],_0x78f907[_0x213cd3(0xaf)],_0x78f907[_0x213cd3(0xb9)]);}export async function runTest(_0x32b709,_0x19635e,_0x55b4e0){const _0x4a8ff5=a74_0x5771f1,{site:_0x2e2176,noEval:noEval=![]}=_0x55b4e0,_0x3f5b42=Date[_0x4a8ff5(0xaa)](),_0x220d9f=await runConversation(_0x32b709,_0x19635e,_0x55b4e0);if(!_0x220d9f['success'])return{'result':{'name':_0x19635e[_0x4a8ff5(0xa6)],'status':'ERROR','reason':_0x220d9f[_0x4a8ff5(0x9d)]||_0x4a8ff5(0xad),'conversation_url':_0x220d9f['chatId']?getConversationUrl(_0x220d9f,_0x2e2176):undefined,'timestamp':new Date(_0x3f5b42)['toISOString'](),'duration_ms':_0x220d9f['duration_ms']},'conversation':_0x220d9f};if(noEval)return{'result':{'name':_0x19635e['name'],'status':_0x4a8ff5(0x91),'reason':_0x4a8ff5(0xab),'conversation_url':getConversationUrl(_0x220d9f,_0x2e2176),'timestamp':new Date(_0x3f5b42)[_0x4a8ff5(0xbc)](),'duration_ms':_0x220d9f[_0x4a8ff5(0xc9)]},'conversation':_0x220d9f};_0x55b4e0[_0x4a8ff5(0xb2)]?.();const _0x17ebfe=Date[_0x4a8ff5(0xaa)]();if(!_0x55b4e0['evaluatorId'])throw new Error(_0x4a8ff5(0xac));try{const _0x55cea7=[];let _0x31b389=!![],_0xd2193d='';for(const _0x4de7a8 of _0x220d9f['rounds']){const _0xc037d0=await evaluateRound(_0x32b709,_0x55b4e0[_0x4a8ff5(0x8e)],_0x4de7a8);_0x55cea7[_0x4a8ff5(0xae)](_0xc037d0);if(!_0xc037d0[_0x4a8ff5(0x8f)]){_0x31b389=![],_0xd2193d=_0xc037d0[_0x4a8ff5(0x9e)];break;}}const _0x5cb490=Date[_0x4a8ff5(0xaa)]()-_0x17ebfe;_0x55b4e0[_0x4a8ff5(0xcb)]?.(_0x5cb490);const _0x286cf4=_0x55cea7[_0x55cea7[_0x4a8ff5(0x94)]-0x1];return{'result':{'name':_0x19635e[_0x4a8ff5(0xa6)],'status':_0x31b389?_0x4a8ff5(0x91):'FAIL','reason':_0x31b389?_0x286cf4['reason']:_0xd2193d,'conversation_url':getConversationUrl(_0x220d9f,_0x2e2176),'timestamp':new Date(_0x3f5b42)[_0x4a8ff5(0xbc)](),'duration_ms':Date[_0x4a8ff5(0xaa)]()-_0x3f5b42,'evaluation':_0x286cf4},'conversation':_0x220d9f};}catch(_0x4cc5a0){const _0x5d1b9d=Date[_0x4a8ff5(0xaa)]()-_0x17ebfe;_0x55b4e0[_0x4a8ff5(0xcb)]?.(_0x5d1b9d);const _0x153424=_0x4cc5a0 instanceof Error?_0x4cc5a0[_0x4a8ff5(0xc7)]:String(_0x4cc5a0);return{'result':{'name':_0x19635e[_0x4a8ff5(0xa6)],'status':_0x4a8ff5(0xb6),'reason':_0x4a8ff5(0xc6)+_0x153424,'conversation_url':getConversationUrl(_0x220d9f,_0x2e2176),'timestamp':new Date(_0x3f5b42)[_0x4a8ff5(0xbc)](),'duration_ms':Date[_0x4a8ff5(0xaa)]()-_0x3f5b42},'conversation':_0x220d9f};}}export async function reevaluateFromCache(_0x41d273,_0x3a711a,_0x49af18,_0x28cae3){const _0x3bc74b=a74_0x5771f1,{evaluatorId:_0x3682ef,onTestStart:_0xec52aa,onTestComplete:_0x33d0cc,onTestSkipped:_0x4132c9}=_0x28cae3,_0x43402b=[],_0x54812c=new Map(_0x3a711a[_0x3bc74b(0xc3)][_0x3bc74b(0xbb)](_0x5bba27=>[_0x5bba27[_0x3bc74b(0xb8)],_0x5bba27]));for(let _0x2c72db=0x0;_0x2c72db<_0x49af18[_0x3bc74b(0x95)][_0x3bc74b(0x94)];_0x2c72db++){const _0x135412=_0x49af18['tests'][_0x2c72db],_0x557681=_0x54812c[_0x3bc74b(0x9a)](_0x135412['name']);_0xec52aa?.(_0x135412[_0x3bc74b(0xa6)],_0x2c72db,_0x49af18[_0x3bc74b(0x95)][_0x3bc74b(0x94)]);if(!_0x557681){const _0x3e512d=_0x3bc74b(0xc2)+_0x135412[_0x3bc74b(0xa6)]+_0x3bc74b(0xc8);_0x4132c9?.(_0x135412[_0x3bc74b(0xa6)],_0x3e512d);continue;}if(_0x557681[_0x3bc74b(0xa4)][_0x3bc74b(0x94)]!==_0x135412[_0x3bc74b(0xa4)]['length']){const _0x384428='Round\x20count\x20mismatch:\x20cached\x20has\x20'+_0x557681[_0x3bc74b(0xa4)][_0x3bc74b(0x94)]+_0x3bc74b(0xa0)+_0x135412['rounds'][_0x3bc74b(0x94)];_0x4132c9?.(_0x135412['name'],_0x384428),_0x43402b[_0x3bc74b(0xae)]({'name':_0x135412[_0x3bc74b(0xa6)],'status':_0x3bc74b(0xb6),'reason':_0x384428,'timestamp':new Date()[_0x3bc74b(0xbc)](),'duration_ms':0x0});continue;}const _0xcc48d=Date[_0x3bc74b(0xaa)]();try{let _0x13b90a=!![],_0x24069d='',_0x46eb49;for(let _0x55ba21=0x0;_0x55ba21<_0x135412['rounds'][_0x3bc74b(0x94)];_0x55ba21++){const _0x5e04aa=_0x135412[_0x3bc74b(0xa4)][_0x55ba21],_0x4d7e3d=_0x557681['rounds'][_0x55ba21],_0x57e0ef={'index':_0x55ba21,'userInput':_0x4d7e3d[_0x3bc74b(0x93)],'agentResponse':_0x4d7e3d[_0x3bc74b(0x98)],'criteria':_0x5e04aa[_0x3bc74b(0xbf)],'duration_ms':0x0,'success':!![]},_0x55644c=await evaluateRound(_0x41d273,_0x3682ef,_0x57e0ef);_0x46eb49=_0x55644c;if(!_0x55644c['pass']){_0x13b90a=![],_0x24069d=_0x55644c['reason'];break;}}const _0x5b7b46=Date[_0x3bc74b(0xaa)]()-_0xcc48d,_0xdcd93d=getLLMConversationUrl(_0x3a711a[_0x3bc74b(0xb4)],_0x3a711a['agent'][_0x3bc74b(0xb7)],_0x3a711a[_0x3bc74b(0xc0)][_0x3bc74b(0xaf)],_0x557681[_0x3bc74b(0xb9)]),_0xd8735d={'name':_0x135412[_0x3bc74b(0xa6)],'status':_0x13b90a?_0x3bc74b(0x91):_0x3bc74b(0xb1),'reason':_0x13b90a?_0x46eb49?.[_0x3bc74b(0x9e)]||'All\x20criteria\x20met':_0x24069d,'conversation_url':_0xdcd93d,'timestamp':new Date()['toISOString'](),'duration_ms':_0x5b7b46,'evaluation':_0x46eb49};_0x43402b['push'](_0xd8735d),_0x33d0cc?.(_0x135412[_0x3bc74b(0xa6)],_0xd8735d);}catch(_0x4315fe){const _0xe167de=Date['now']()-_0xcc48d,_0x2558ee=_0x4315fe instanceof Error?_0x4315fe[_0x3bc74b(0xc7)]:String(_0x4315fe),_0x530d9d={'name':_0x135412[_0x3bc74b(0xa6)],'status':_0x3bc74b(0xb6),'reason':_0x3bc74b(0xc6)+_0x2558ee,'timestamp':new Date()[_0x3bc74b(0xbc)](),'duration_ms':_0xe167de};_0x43402b[_0x3bc74b(0xae)](_0x530d9d),_0x33d0cc?.(_0x135412[_0x3bc74b(0xa6)],_0x530d9d);}}return _0x43402b;}
@@ -1 +1 @@
1
- function a75_0x33e1(_0x24af82,_0x31f39f){_0x24af82=_0x24af82-0x16e;var _0x4b2b88=a75_0x4b2b();var _0x33e188=_0x4b2b88[_0x24af82];return _0x33e188;}(function(_0x2a1ba1,_0x58ff20){var _0x1d1e67=a75_0x33e1,_0x8e8fa7=_0x2a1ba1();while(!![]){try{var _0x765d88=parseInt(_0x1d1e67(0x175))/0x1*(parseInt(_0x1d1e67(0x171))/0x2)+parseInt(_0x1d1e67(0x16f))/0x3*(-parseInt(_0x1d1e67(0x173))/0x4)+-parseInt(_0x1d1e67(0x176))/0x5*(parseInt(_0x1d1e67(0x177))/0x6)+-parseInt(_0x1d1e67(0x172))/0x7+parseInt(_0x1d1e67(0x170))/0x8+-parseInt(_0x1d1e67(0x16e))/0x9+parseInt(_0x1d1e67(0x174))/0xa;if(_0x765d88===_0x58ff20)break;else _0x8e8fa7['push'](_0x8e8fa7['shift']());}catch(_0x1b4ec7){_0x8e8fa7['push'](_0x8e8fa7['shift']());}}}(a75_0x4b2b,0xda13c));function a75_0x4b2b(){var _0x5a6373=['5857146NLhsRz','3oTyOIb','12456256oVIIVD','1295486hpGuxV','6672281btjvjG','1690660juitNC','21527740PnVZcY','1GjOsfd','7188315wYlpHA','6hRFCzn'];a75_0x4b2b=function(){return _0x5a6373;};return a75_0x4b2b();}export{resolveTestPath,parseTestDefinition,resolveAgentInfo,parseTestFile}from'./parser.js';export{runConversation,runTest,getConversationUrl,saveLastTestRun,loadLastTestRun,hasLastTestRun,getTestRunCachePath,buildCachedTestRun,reevaluateFromCache}from'./executor.js';export{setupEvaluatorAgent,getOrCreateEvaluatorAgent,evaluateRound,DEFAULT_EVALUATOR_CONFIG}from'./evaluator.js';export{formatResults}from'./output.js';
1
+ (function(_0x374543,_0x4b8037){var _0x642854=a75_0x24c3,_0x3783b1=_0x374543();while(!![]){try{var _0x2d0ad7=parseInt(_0x642854(0x11e))/0x1*(-parseInt(_0x642854(0x125))/0x2)+-parseInt(_0x642854(0x120))/0x3*(-parseInt(_0x642854(0x123))/0x4)+-parseInt(_0x642854(0x11d))/0x5*(-parseInt(_0x642854(0x122))/0x6)+-parseInt(_0x642854(0x128))/0x7+parseInt(_0x642854(0x126))/0x8*(parseInt(_0x642854(0x11f))/0x9)+-parseInt(_0x642854(0x127))/0xa*(parseInt(_0x642854(0x121))/0xb)+-parseInt(_0x642854(0x124))/0xc;if(_0x2d0ad7===_0x4b8037)break;else _0x3783b1['push'](_0x3783b1['shift']());}catch(_0x4e10ea){_0x3783b1['push'](_0x3783b1['shift']());}}}(a75_0x3f69,0xd3e5c));export{resolveTestPath,parseTestDefinition,resolveAgentInfo,parseTestFile}from'./parser.js';function a75_0x3f69(){var _0x168767=['7235604ypEVBU','2hQsqbS','953624mWornQ','60140ulMsWN','9044686kjJnJV','20hkVmGO','104287lEkSJm','36uRmsxN','81JWIiWC','869vEkdPe','2045514cWdVcf','222504LUWCZE'];a75_0x3f69=function(){return _0x168767;};return a75_0x3f69();}function a75_0x24c3(_0x1d36e4,_0x4c12b1){_0x1d36e4=_0x1d36e4-0x11d;var _0x3f6971=a75_0x3f69();var _0x24c3ca=_0x3f6971[_0x1d36e4];return _0x24c3ca;}export{runConversation,runTest,getConversationUrl,saveLastTestRun,loadLastTestRun,hasLastTestRun,getTestRunCachePath,buildCachedTestRun,reevaluateFromCache}from'./executor.js';export{setupEvaluatorAgent,getOrCreateEvaluatorAgent,evaluateRound,DEFAULT_EVALUATOR_CONFIG}from'./evaluator.js';export{formatResults}from'./output.js';
@@ -1 +1 @@
1
- function a76_0x167e(_0x445d92,_0x3be91d){_0x445d92=_0x445d92-0xf5;const _0x3301d2=a76_0x3301();let _0x167e02=_0x3301d2[_0x445d92];return _0x167e02;}(function(_0x4c3145,_0x2eeee2){const _0x451b3f=a76_0x167e,_0xdbbf1c=_0x4c3145();while(!![]){try{const _0x4dd1d3=parseInt(_0x451b3f(0x10e))/0x1*(-parseInt(_0x451b3f(0x120))/0x2)+parseInt(_0x451b3f(0x10d))/0x3*(-parseInt(_0x451b3f(0x108))/0x4)+-parseInt(_0x451b3f(0xf8))/0x5*(parseInt(_0x451b3f(0x112))/0x6)+-parseInt(_0x451b3f(0x10c))/0x7+-parseInt(_0x451b3f(0x103))/0x8+-parseInt(_0x451b3f(0x11e))/0x9+-parseInt(_0x451b3f(0x10b))/0xa*(-parseInt(_0x451b3f(0x11c))/0xb);if(_0x4dd1d3===_0x2eeee2)break;else _0xdbbf1c['push'](_0xdbbf1c['shift']());}catch(_0x24fd23){_0xdbbf1c['push'](_0xdbbf1c['shift']());}}}(a76_0x3301,0xf03b5));function a76_0x3301(){const _0xb83ee=['1210384cbIibH','conversation_url','stringify','58407610zVpAUS','5171208wSCTEp','3vwnDlx','1TVTSGn','\x20\x20Reason:\x20','timestamp','Failed:\x20\x20\x20','2133222qGEBzZ','toFixed','Duration\x20(s)','push','tests','\x20\x20URL:\x20','duration_ms','\x20\x20Evaluation:','Name','evaluation','11zOrTyi','map','15454107nsVYwx','Reason','2721694YAxbfK','Unknown\x20output\x20format:\x20','Conversation\x20URL','tsv',']\x20(','summary','plan','errors','jsonl','5lrjLIR','json','name','Timestamp','Total:\x20\x20\x20\x20','repeat','total','PASS','Errors:\x20\x20\x20','\x20\x20\x20\x20Plan:\x20','table','3055400eATYoN','status','Status','join','Duration:\x20'];a76_0x3301=function(){return _0xb83ee;};return a76_0x3301();}export function formatResults(_0x11ce6e,_0x434764){const _0x1a3482=a76_0x167e;switch(_0x434764){case _0x1a3482(0xf9):return formatJson(_0x11ce6e);case _0x1a3482(0xf7):return formatJsonl(_0x11ce6e);case _0x1a3482(0x123):return formatTsv(_0x11ce6e);case _0x1a3482(0x102):return formatTable(_0x11ce6e);default:throw new Error(_0x1a3482(0x121)+_0x434764);}}function formatJson(_0x24f885){const _0x13281b=a76_0x167e;return JSON[_0x13281b(0x10a)](_0x24f885,null,0x2);}function formatJsonl(_0x5cdb8c){const _0x2a2bf4=a76_0x167e;return _0x5cdb8c[_0x2a2bf4(0x116)][_0x2a2bf4(0x11d)](_0x3e94e1=>JSON[_0x2a2bf4(0x10a)](_0x3e94e1))[_0x2a2bf4(0x106)]('\x0a');}function formatTsv(_0x4b8583){const _0x4435ea=a76_0x167e,_0x844573=[_0x4435ea(0x11a),_0x4435ea(0x105),_0x4435ea(0x11f),_0x4435ea(0x114),_0x4435ea(0xfb),_0x4435ea(0x122)],_0x4d1e6b=_0x4b8583[_0x4435ea(0x116)][_0x4435ea(0x11d)](_0x1b5b27=>{const _0x37e253=_0x4435ea,_0x497246=(_0x1b5b27[_0x37e253(0x118)]/0x3e8)[_0x37e253(0x113)](0x2),_0x1ee657=_0x1b5b27['conversation_url']||'';return[_0x1b5b27[_0x37e253(0xfa)],_0x1b5b27['status'],_0x1b5b27['reason'],_0x497246,_0x1b5b27[_0x37e253(0x110)],_0x1ee657][_0x37e253(0x106)]('\x09');});return[_0x844573[_0x4435ea(0x106)]('\x09'),..._0x4d1e6b][_0x4435ea(0x106)]('\x0a');}function formatTable(_0x1b3eba){const _0x34f6d4=a76_0x167e,_0x132453=[];_0x132453[_0x34f6d4(0x115)]('━'['repeat'](0x50)),_0x132453[_0x34f6d4(0x115)]('Test\x20Results'),_0x132453['push']('━'[_0x34f6d4(0xfd)](0x50)),_0x132453[_0x34f6d4(0x115)](_0x34f6d4(0xfc)+_0x1b3eba['summary'][_0x34f6d4(0xfe)]),_0x132453[_0x34f6d4(0x115)]('Passed:\x20\x20\x20'+_0x1b3eba[_0x34f6d4(0x125)]['passed']),_0x132453[_0x34f6d4(0x115)](_0x34f6d4(0x111)+_0x1b3eba[_0x34f6d4(0x125)]['failed']);_0x1b3eba[_0x34f6d4(0x125)][_0x34f6d4(0xf6)]&&_0x1b3eba['summary']['errors']>0x0&&_0x132453[_0x34f6d4(0x115)](_0x34f6d4(0x100)+_0x1b3eba[_0x34f6d4(0x125)][_0x34f6d4(0xf6)]);const _0x4db736=(_0x1b3eba[_0x34f6d4(0x125)][_0x34f6d4(0x118)]/0x3e8)[_0x34f6d4(0x113)](0x2);_0x132453[_0x34f6d4(0x115)](_0x34f6d4(0x107)+_0x4db736+'s'),_0x132453[_0x34f6d4(0x115)]('━'[_0x34f6d4(0xfd)](0x50)),_0x132453[_0x34f6d4(0x115)]('');for(const _0x584d42 of _0x1b3eba['tests']){const _0xe942e4=_0x584d42[_0x34f6d4(0x104)]===_0x34f6d4(0xff)?'✓':'✗',_0x525896=(_0x584d42[_0x34f6d4(0x118)]/0x3e8)['toFixed'](0x2);_0x132453[_0x34f6d4(0x115)](_0xe942e4+'\x20'+_0x584d42['name']+'\x20['+_0x584d42['status']+_0x34f6d4(0x124)+_0x525896+'s)'),_0x132453[_0x34f6d4(0x115)](_0x34f6d4(0x10f)+_0x584d42['reason']),_0x584d42[_0x34f6d4(0x109)]&&_0x132453['push'](_0x34f6d4(0x117)+_0x584d42['conversation_url']),_0x584d42[_0x34f6d4(0x11b)]&&(_0x132453[_0x34f6d4(0x115)](_0x34f6d4(0x119)),_0x132453[_0x34f6d4(0x115)](_0x34f6d4(0x101)+_0x584d42[_0x34f6d4(0x11b)][_0x34f6d4(0xf5)]),_0x132453[_0x34f6d4(0x115)]('\x20\x20\x20\x20Thinking:\x20'+_0x584d42[_0x34f6d4(0x11b)]['thinking'])),_0x132453['push']('');}return _0x132453['join']('\x0a');}
1
+ (function(_0x3001b9,_0xd06846){const _0x1bae21=a76_0x3439,_0x4f5d62=_0x3001b9();while(!![]){try{const _0xc7263c=parseInt(_0x1bae21(0x1e4))/0x1*(-parseInt(_0x1bae21(0x203))/0x2)+-parseInt(_0x1bae21(0x1f4))/0x3*(-parseInt(_0x1bae21(0x20e))/0x4)+parseInt(_0x1bae21(0x1f5))/0x5+parseInt(_0x1bae21(0x202))/0x6+-parseInt(_0x1bae21(0x1e3))/0x7+-parseInt(_0x1bae21(0x209))/0x8*(-parseInt(_0x1bae21(0x200))/0x9)+-parseInt(_0x1bae21(0x20d))/0xa;if(_0xc7263c===_0xd06846)break;else _0x4f5d62['push'](_0x4f5d62['shift']());}catch(_0x70693a){_0x4f5d62['push'](_0x4f5d62['shift']());}}}(a76_0x183e,0x70f3a));function a76_0x3439(_0x512219,_0x13b75e){_0x512219=_0x512219-0x1e3;const _0x183ef9=a76_0x183e();let _0x34393d=_0x183ef9[_0x512219];return _0x34393d;}function a76_0x183e(){const _0x1df1c8=['Test\x20Results','Reason','conversation_url','PASS','Unknown\x20output\x20format:\x20','reason','stringify','duration_ms','189927snVHyw','3533210vRUREe','map','summary','Failed:\x20\x20\x20','tests','table','thinking','plan','\x20\x20\x20\x20Thinking:\x20','name','total','831618tspYnY','errors','1819110JYEjIt','178rUZWDw','Status','join','Name','status','\x20\x20\x20\x20Plan:\x20','80JqFuFt','\x20\x20Reason:\x20','repeat','evaluation','953980XcogVm','4rhSuet','push','Timestamp','5666654bbIOKi','7074KIsCbq','jsonl','Duration:\x20','\x20\x20URL:\x20','Passed:\x20\x20\x20','json','toFixed','Duration\x20(s)'];a76_0x183e=function(){return _0x1df1c8;};return a76_0x183e();}export function formatResults(_0x1177a6,_0x438037){const _0x38bb0c=a76_0x3439;switch(_0x438037){case _0x38bb0c(0x1e9):return formatJson(_0x1177a6);case _0x38bb0c(0x1e5):return formatJsonl(_0x1177a6);case'tsv':return formatTsv(_0x1177a6);case _0x38bb0c(0x1fa):return formatTable(_0x1177a6);default:throw new Error(_0x38bb0c(0x1f0)+_0x438037);}}function formatJson(_0x19995a){const _0x2d101b=a76_0x3439;return JSON[_0x2d101b(0x1f2)](_0x19995a,null,0x2);}function formatJsonl(_0x48f0ab){const _0x59b38a=a76_0x3439;return _0x48f0ab[_0x59b38a(0x1f9)][_0x59b38a(0x1f6)](_0x5378c9=>JSON[_0x59b38a(0x1f2)](_0x5378c9))['join']('\x0a');}function formatTsv(_0x15acdd){const _0x42c900=a76_0x3439,_0x3353ed=[_0x42c900(0x206),_0x42c900(0x204),_0x42c900(0x1ed),_0x42c900(0x1eb),_0x42c900(0x210),'Conversation\x20URL'],_0x465a80=_0x15acdd[_0x42c900(0x1f9)][_0x42c900(0x1f6)](_0x330716=>{const _0x274eec=_0x42c900,_0x5b017a=(_0x330716[_0x274eec(0x1f3)]/0x3e8)['toFixed'](0x2),_0xb9c37a=_0x330716[_0x274eec(0x1ee)]||'';return[_0x330716[_0x274eec(0x1fe)],_0x330716[_0x274eec(0x207)],_0x330716['reason'],_0x5b017a,_0x330716['timestamp'],_0xb9c37a][_0x274eec(0x205)]('\x09');});return[_0x3353ed['join']('\x09'),..._0x465a80][_0x42c900(0x205)]('\x0a');}function formatTable(_0x7e688e){const _0x2d7b47=a76_0x3439,_0x385e47=[];_0x385e47[_0x2d7b47(0x20f)]('━'[_0x2d7b47(0x20b)](0x50)),_0x385e47[_0x2d7b47(0x20f)](_0x2d7b47(0x1ec)),_0x385e47[_0x2d7b47(0x20f)]('━'[_0x2d7b47(0x20b)](0x50)),_0x385e47[_0x2d7b47(0x20f)]('Total:\x20\x20\x20\x20'+_0x7e688e[_0x2d7b47(0x1f7)][_0x2d7b47(0x1ff)]),_0x385e47[_0x2d7b47(0x20f)](_0x2d7b47(0x1e8)+_0x7e688e[_0x2d7b47(0x1f7)]['passed']),_0x385e47[_0x2d7b47(0x20f)](_0x2d7b47(0x1f8)+_0x7e688e['summary']['failed']);_0x7e688e[_0x2d7b47(0x1f7)]['errors']&&_0x7e688e[_0x2d7b47(0x1f7)][_0x2d7b47(0x201)]>0x0&&_0x385e47[_0x2d7b47(0x20f)]('Errors:\x20\x20\x20'+_0x7e688e[_0x2d7b47(0x1f7)][_0x2d7b47(0x201)]);const _0x1533c5=(_0x7e688e['summary'][_0x2d7b47(0x1f3)]/0x3e8)[_0x2d7b47(0x1ea)](0x2);_0x385e47[_0x2d7b47(0x20f)](_0x2d7b47(0x1e6)+_0x1533c5+'s'),_0x385e47[_0x2d7b47(0x20f)]('━'[_0x2d7b47(0x20b)](0x50)),_0x385e47[_0x2d7b47(0x20f)]('');for(const _0x417e3d of _0x7e688e[_0x2d7b47(0x1f9)]){const _0x545524=_0x417e3d['status']===_0x2d7b47(0x1ef)?'✓':'✗',_0x237686=(_0x417e3d[_0x2d7b47(0x1f3)]/0x3e8)[_0x2d7b47(0x1ea)](0x2);_0x385e47[_0x2d7b47(0x20f)](_0x545524+'\x20'+_0x417e3d[_0x2d7b47(0x1fe)]+'\x20['+_0x417e3d['status']+']\x20('+_0x237686+'s)'),_0x385e47[_0x2d7b47(0x20f)](_0x2d7b47(0x20a)+_0x417e3d[_0x2d7b47(0x1f1)]),_0x417e3d[_0x2d7b47(0x1ee)]&&_0x385e47['push'](_0x2d7b47(0x1e7)+_0x417e3d['conversation_url']),_0x417e3d['evaluation']&&(_0x385e47[_0x2d7b47(0x20f)]('\x20\x20Evaluation:'),_0x385e47[_0x2d7b47(0x20f)](_0x2d7b47(0x208)+_0x417e3d['evaluation'][_0x2d7b47(0x1fc)]),_0x385e47[_0x2d7b47(0x20f)](_0x2d7b47(0x1fd)+_0x417e3d[_0x2d7b47(0x20c)][_0x2d7b47(0x1fb)])),_0x385e47['push']('');}return _0x385e47[_0x2d7b47(0x205)]('\x0a');}
@@ -1 +1 @@
1
- const a77_0x25344f=a77_0x5398;(function(_0x4f7da0,_0x334232){const _0x54c99e=a77_0x5398,_0x15764b=_0x4f7da0();while(!![]){try{const _0x26543f=-parseInt(_0x54c99e(0x173))/0x1+parseInt(_0x54c99e(0x13b))/0x2+parseInt(_0x54c99e(0x135))/0x3+parseInt(_0x54c99e(0x159))/0x4+parseInt(_0x54c99e(0x129))/0x5*(parseInt(_0x54c99e(0x175))/0x6)+parseInt(_0x54c99e(0x131))/0x7*(-parseInt(_0x54c99e(0x128))/0x8)+parseInt(_0x54c99e(0x149))/0x9*(-parseInt(_0x54c99e(0x16d))/0xa);if(_0x26543f===_0x334232)break;else _0x15764b['push'](_0x15764b['shift']());}catch(_0x59f0ad){_0x15764b['push'](_0x15764b['shift']());}}}(a77_0x2ca5,0x8d963));import*as a77_0x33616e from'node:fs';import*as a77_0x44c9e4 from'node:path';function a77_0x2ca5(){const _0x59621c=['\x20\x20\x20\x20criteria:\x20...\x0a','Check\x20your\x20YAML\x20syntax.','Missing\x20\x27tests\x27\x20field','3692644oejcSQ','length','isFile','Each\x20test\x20must\x20have\x20either:\x0a','Path\x20not\x20found:\x20','isArray','\x20in\x20','Must\x20have\x20a\x20string\x20\x22user_input\x22\x20field.','Cannot\x20use\x20both\x20flat\x20format\x20(user_input/criteria)\x20and\x20rounds\x20array','object','Must\x20have\x20a\x20string\x20\x22criteria\x22\x20field.','\x20(test[','utf-8','\x20\x20\x20\x20\x20\x20-\x20user_input:\x20...\x0a','Create\x20a\x20test.yml\x20file\x20in\x20','push','string','\x20with\x20your\x20test\x20definitions.','test.yml','\x20\x20\x20\x20└──\x20test.yml','153130LcOpWJ','join','AGENT_SYNTAX_ERROR','\x27\x20field','or\x20ensure\x20tdx.json\x20exists\x20in\x20the\x20project\x20directory.','tests','670665NpWMKr','\x20\x20\x20\x20\x20\x20\x20\x20criteria:\x20...','24pxSRls','Invalid\x20tag\x20at\x20index\x20','criteria','\x27rounds\x27\x20array\x20is\x20empty','-\x20user_input\x20and\x20criteria\x20(flat\x20format\x20for\x20single-round)\x0a','add','.yml','user_input','Ensure\x20the\x20directory\x20contains\x20a\x20test.yml\x20file.','Expected\x20structure:\x0a','parse','resolve','\x20\x20agents/project/my-agent/\x0a','Cannot\x20read\x20test\x20file:\x20','dirname','endsWith','Missing\x20or\x20invalid\x20\x27','Add\x20at\x20least\x20one\x20round\x20to\x20the\x20test.','\x27tests\x27\x20array\x20is\x20empty','agent.yml','map','640952GpjuMK','1106390fYzwtS','Empty\x20tag\x20at\x20index\x20','test.yml\x20must\x20be\x20in\x20the\x20same\x20directory\x20as\x20agent.yml.\x0a','Use\x20either\x20flat\x20format\x20for\x20single-round\x20tests:\x0a','Each\x20test\x20must\x20have\x20a\x20string\x20\x22name\x22\x20field.','Tags\x20must\x20be\x20non-empty\x20strings.','No\x20test.yml\x20found\x20in\x20directory:\x20','Missing\x20test\x20content','35vydiOS','\x20\x20\x20\x20├──\x20agent.yml\x0a','Run\x20\x22tdx\x20agent\x20pull\x20<project>\x22\x20first\x20to\x20create\x20the\x20folder\x20structure,\x0a','Test\x20definition\x20must\x20have\x20a\x20\x22tests\x22\x20array.','2373354CkpRat','Invalid\x20test\x20definition:\x20expected\x20object','\x20\x20\x20\x20user_input:\x20...\x0a','NOT_FOUND','Cannot\x20read\x20agent.yml:\x20','No\x20agent.yml\x20found\x20alongside\x20test.yml\x20in:\x20','523070HNLCOx','Invalid\x20test\x20case:\x20expected\x20object','has','\x20\x20-\x20name:\x20test\x0a','Provide\x20a\x20valid\x20path\x20to\x20test.yml\x20or\x20an\x20agent\x20directory.','No\x20tdx.json\x20found\x20for\x20agent\x20directory:\x20','\x27rounds\x27\x20must\x20be\x20an\x20array','Duplicate\x20test\x20name\x20\x27','-\x20rounds\x20array\x20(for\x20multi-round\x20tests)','Invalid\x20YAML\x20in\x20test\x20file:\x20','Expected\x20a\x20YAML\x20file,\x20got:\x20','.yaml','Provide\x20a\x20path\x20to\x20test.yml\x20or\x20an\x20agent\x20directory\x20containing\x20test.yml.','\x27tags\x27\x20must\x20be\x20an\x20array\x20of\x20strings','711pxloEO','\x20(round[','\x27tests\x27\x20must\x20be\x20an\x20array','existsSync','No\x20test.yml\x20found\x20in\x20agent\x20directory:\x20','Ensure\x20the\x20file\x20exists\x20and\x20is\x20readable.','trim','statSync','Or\x20rounds\x20array\x20for\x20multi-round\x20tests:\x0a','rounds','llm_project','name','tags'];a77_0x2ca5=function(){return _0x59621c;};return a77_0x2ca5();}import*as a77_0x55418b from'yaml';import{SDKError,ErrorCode}from'../../errors.js';import{findAgentConfig,findAgentConfigPath,isAgentDir}from'../agent-config.js';import{parseAgentYaml}from'../agent-yaml.js';function a77_0x5398(_0x2280a1,_0x41a2c9){_0x2280a1=_0x2280a1-0x11c;const _0x2ca512=a77_0x2ca5();let _0x53985a=_0x2ca512[_0x2280a1];return _0x53985a;}const TEST_FILE_NAME=a77_0x25344f(0x16b),AGENT_FILE_NAME=a77_0x25344f(0x126);function validateRequiredString(_0x87dd29,_0x541e59,_0xbe109f,_0xd3e7c8){const _0x5c2748=a77_0x25344f;if(!_0x87dd29[_0x541e59]||typeof _0x87dd29[_0x541e59]!==_0x5c2748(0x169))throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x5c2748(0x123)+_0x541e59+_0x5c2748(0x170)+_0xbe109f,undefined,{'helpText':_0xd3e7c8});const _0x1801ef=_0x87dd29[_0x541e59][_0x5c2748(0x14f)]();if(_0x1801ef[_0x5c2748(0x15a)]===0x0)throw new SDKError(ErrorCode[_0x5c2748(0x16f)],'\x27'+_0x541e59+'\x27\x20cannot\x20be\x20empty'+_0xbe109f);return _0x1801ef;}export function resolveTestPath(_0x92faac){const _0xc31dff=a77_0x25344f,_0x282a4a=a77_0x44c9e4[_0xc31dff(0x11e)](_0x92faac);if(a77_0x33616e[_0xc31dff(0x14c)](_0x282a4a)&&a77_0x33616e[_0xc31dff(0x150)](_0x282a4a)[_0xc31dff(0x15b)]()){if(!_0x282a4a[_0xc31dff(0x122)](_0xc31dff(0x17b))&&!_0x282a4a['endsWith'](_0xc31dff(0x146)))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xc31dff(0x145)+_0x92faac,undefined,{'helpText':_0xc31dff(0x147)});return _0x282a4a;}if(a77_0x33616e[_0xc31dff(0x14c)](_0x282a4a)&&a77_0x33616e['statSync'](_0x282a4a)['isDirectory']()){const _0x54da82=a77_0x44c9e4[_0xc31dff(0x16e)](_0x282a4a,TEST_FILE_NAME);if(a77_0x33616e[_0xc31dff(0x14c)](_0x54da82))return _0x54da82;if(isAgentDir(_0x282a4a))throw new SDKError(ErrorCode['NOT_FOUND'],_0xc31dff(0x14d)+_0x92faac,undefined,{'helpText':_0xc31dff(0x167)+_0x92faac+_0xc31dff(0x16a)});throw new SDKError(ErrorCode['NOT_FOUND'],_0xc31dff(0x12f)+_0x92faac,undefined,{'helpText':_0xc31dff(0x17d)});}throw new SDKError(ErrorCode[_0xc31dff(0x138)],_0xc31dff(0x15d)+_0x92faac,undefined,{'helpText':_0xc31dff(0x13f)});}export function parseTestDefinition(_0x3d9416){const _0x42fbb9=a77_0x25344f;let _0x421ae7;try{_0x421ae7=a77_0x33616e['readFileSync'](_0x3d9416,_0x42fbb9(0x165));}catch(_0x72f6e4){throw new SDKError(ErrorCode[_0x42fbb9(0x138)],_0x42fbb9(0x120)+_0x3d9416,_0x72f6e4,{'helpText':_0x42fbb9(0x14e)});}let _0x1d08d7;try{_0x1d08d7=a77_0x55418b[_0x42fbb9(0x11d)](_0x421ae7);}catch(_0x466514){throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x42fbb9(0x144)+_0x3d9416,_0x466514,{'helpText':_0x42fbb9(0x157)});}return validateTestDefinition(_0x1d08d7,_0x3d9416);}function validateTestDefinition(_0x3071c2,_0x88ea8a){const _0x5ee3a9=a77_0x25344f,_0x2fd6f5=_0x5ee3a9(0x15f)+_0x88ea8a;if(!_0x3071c2||typeof _0x3071c2!==_0x5ee3a9(0x162))throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x5ee3a9(0x136)+_0x2fd6f5);const _0x3ec680=_0x3071c2;if(!_0x3ec680[_0x5ee3a9(0x172)])throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x5ee3a9(0x158)+_0x2fd6f5,undefined,{'helpText':_0x5ee3a9(0x134)});if(!Array['isArray'](_0x3ec680[_0x5ee3a9(0x172)]))throw new SDKError(ErrorCode[_0x5ee3a9(0x16f)],_0x5ee3a9(0x14b)+_0x2fd6f5);if(_0x3ec680['tests'][_0x5ee3a9(0x15a)]===0x0)throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x5ee3a9(0x125)+_0x2fd6f5,undefined,{'helpText':'Add\x20at\x20least\x20one\x20test\x20case\x20to\x20the\x20tests\x20array.'});const _0x20bb4b=[],_0x52698c=new Set();for(let _0x3f8527=0x0;_0x3f8527<_0x3ec680[_0x5ee3a9(0x172)][_0x5ee3a9(0x15a)];_0x3f8527++){const _0x126d81=validateTestCase(_0x3ec680[_0x5ee3a9(0x172)][_0x3f8527],_0x3f8527,_0x2fd6f5);if(_0x52698c[_0x5ee3a9(0x13d)](_0x126d81[_0x5ee3a9(0x154)]))throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x5ee3a9(0x142)+_0x126d81[_0x5ee3a9(0x154)]+'\x27'+_0x2fd6f5,undefined,{'helpText':'Each\x20test\x20must\x20have\x20a\x20unique\x20name.'});_0x52698c[_0x5ee3a9(0x17a)](_0x126d81[_0x5ee3a9(0x154)]),_0x20bb4b[_0x5ee3a9(0x168)](_0x126d81);}return{'tests':_0x20bb4b};}function validateTestCase(_0x32cd91,_0x3e9905,_0x3780e5){const _0x518c24=a77_0x25344f,_0x11a20e=_0x518c24(0x164)+_0x3e9905+'])'+_0x3780e5;if(!_0x32cd91||typeof _0x32cd91!==_0x518c24(0x162))throw new SDKError(ErrorCode[_0x518c24(0x16f)],_0x518c24(0x13c)+_0x11a20e);const _0x2f143c=_0x32cd91,_0x2be166=validateRequiredString(_0x2f143c,'name',_0x11a20e,_0x518c24(0x12d)),_0x275bc1=_0x518c24(0x17c)in _0x2f143c||_0x518c24(0x177)in _0x2f143c,_0x333501=_0x518c24(0x152)in _0x2f143c;if(_0x275bc1&&_0x333501)throw new SDKError(ErrorCode[_0x518c24(0x16f)],_0x518c24(0x161)+_0x11a20e,undefined,{'helpText':_0x518c24(0x12c)+_0x518c24(0x13e)+_0x518c24(0x137)+_0x518c24(0x156)+_0x518c24(0x151)+_0x518c24(0x13e)+'\x20\x20\x20\x20rounds:\x0a'+_0x518c24(0x166)+_0x518c24(0x174)});if(!_0x275bc1&&!_0x333501)throw new SDKError(ErrorCode[_0x518c24(0x16f)],_0x518c24(0x130)+_0x11a20e,undefined,{'helpText':_0x518c24(0x15c)+_0x518c24(0x179)+_0x518c24(0x143)});const _0x2d4520=validateOptionalTags(_0x2f143c[_0x518c24(0x155)],_0x11a20e);if(_0x275bc1)return{'name':_0x2be166,'rounds':[validateRound(_0x2f143c,_0x11a20e)],'tags':_0x2d4520};return{'name':_0x2be166,'rounds':validateRoundsArray(_0x2f143c['rounds'],_0x11a20e),'tags':_0x2d4520};}function validateRound(_0x40cd12,_0x2f7cfc){const _0x5e46f9=a77_0x25344f;if(!_0x40cd12||typeof _0x40cd12!=='object')throw new SDKError(ErrorCode[_0x5e46f9(0x16f)],'Invalid\x20round:\x20expected\x20object'+_0x2f7cfc);const _0x15411c=_0x40cd12;return{'user_input':validateRequiredString(_0x15411c,'user_input',_0x2f7cfc,_0x5e46f9(0x160)),'criteria':validateRequiredString(_0x15411c,_0x5e46f9(0x177),_0x2f7cfc,_0x5e46f9(0x163))};}function validateRoundsArray(_0xb0967f,_0x2dc4b5){const _0x203ce2=a77_0x25344f;if(!Array['isArray'](_0xb0967f))throw new SDKError(ErrorCode[_0x203ce2(0x16f)],_0x203ce2(0x141)+_0x2dc4b5);if(_0xb0967f[_0x203ce2(0x15a)]===0x0)throw new SDKError(ErrorCode[_0x203ce2(0x16f)],_0x203ce2(0x178)+_0x2dc4b5,undefined,{'helpText':_0x203ce2(0x124)});return _0xb0967f[_0x203ce2(0x127)]((_0x49dc7e,_0x753d84)=>validateRound(_0x49dc7e,_0x203ce2(0x14a)+_0x753d84+'])'+_0x2dc4b5));}function validateOptionalTags(_0x3f2fda,_0x272866){const _0x5da3ca=a77_0x25344f;if(_0x3f2fda===undefined||_0x3f2fda===null)return undefined;if(!Array[_0x5da3ca(0x15e)](_0x3f2fda))throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x5da3ca(0x148)+_0x272866);const _0x205109=[];for(let _0x9991d=0x0;_0x9991d<_0x3f2fda[_0x5da3ca(0x15a)];_0x9991d++){const _0x5b2531=_0x3f2fda[_0x9991d];if(typeof _0x5b2531!==_0x5da3ca(0x169))throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x5da3ca(0x176)+_0x9991d+':\x20expected\x20string'+_0x272866);const _0x213bf2=_0x5b2531['trim']();if(_0x213bf2[_0x5da3ca(0x15a)]===0x0)throw new SDKError(ErrorCode[_0x5da3ca(0x16f)],_0x5da3ca(0x12a)+_0x9991d+_0x272866,undefined,{'helpText':_0x5da3ca(0x12e)});_0x205109[_0x5da3ca(0x168)](_0x213bf2);}return _0x205109[_0x5da3ca(0x15a)]>0x0?_0x205109:undefined;}export function resolveAgentInfo(_0x23cd7f){const _0x1b5e8f=a77_0x25344f,_0x23009b=a77_0x44c9e4[_0x1b5e8f(0x121)](_0x23cd7f),_0x204f48=a77_0x44c9e4['join'](_0x23009b,AGENT_FILE_NAME);if(!a77_0x33616e[_0x1b5e8f(0x14c)](_0x204f48))throw new SDKError(ErrorCode[_0x1b5e8f(0x138)],_0x1b5e8f(0x13a)+_0x23009b,undefined,{'helpText':_0x1b5e8f(0x12b)+_0x1b5e8f(0x11c)+_0x1b5e8f(0x11f)+_0x1b5e8f(0x132)+_0x1b5e8f(0x16c)});const _0x2bc33b=findAgentConfigPath(_0x23009b);if(!_0x2bc33b)throw new SDKError(ErrorCode[_0x1b5e8f(0x138)],_0x1b5e8f(0x140)+_0x23009b,undefined,{'helpText':_0x1b5e8f(0x133)+_0x1b5e8f(0x171)});const {config:_0x24cfce}=findAgentConfig(_0x23009b),_0x362661=_0x24cfce[_0x1b5e8f(0x153)];let _0x36dc17;try{_0x36dc17=a77_0x33616e['readFileSync'](_0x204f48,'utf-8');}catch(_0x20d320){throw new SDKError(ErrorCode['NOT_FOUND'],_0x1b5e8f(0x139)+_0x204f48,_0x20d320);}const _0x77b85a=parseAgentYaml(_0x36dc17,_0x204f48),_0x13dd99=_0x77b85a[_0x1b5e8f(0x154)];return{'projectName':_0x362661,'agentName':_0x13dd99,'agentDir':_0x23009b,'agentYmlPath':_0x204f48,'testYmlPath':_0x23cd7f};}export function parseTestFile(_0x140fdb){const _0x5d5ab6=resolveTestPath(_0x140fdb),_0x37b8ba=parseTestDefinition(_0x5d5ab6),_0x4cce9e=resolveAgentInfo(_0x5d5ab6);return{'definition':_0x37b8ba,'agentInfo':_0x4cce9e};}
1
+ const a77_0x2d253d=a77_0x2d08;(function(_0x4acc05,_0x4b2d23){const _0x132a8d=a77_0x2d08,_0x4326f2=_0x4acc05();while(!![]){try{const _0x55df90=parseInt(_0x132a8d(0x22d))/0x1+parseInt(_0x132a8d(0x203))/0x2+-parseInt(_0x132a8d(0x21e))/0x3+parseInt(_0x132a8d(0x21c))/0x4*(-parseInt(_0x132a8d(0x208))/0x5)+-parseInt(_0x132a8d(0x232))/0x6+parseInt(_0x132a8d(0x237))/0x7+parseInt(_0x132a8d(0x20e))/0x8;if(_0x55df90===_0x4b2d23)break;else _0x4326f2['push'](_0x4326f2['shift']());}catch(_0x4c442a){_0x4326f2['push'](_0x4326f2['shift']());}}}(a77_0x2de1,0xcbb1e));import*as a77_0xf5c3f2 from'node:fs';import*as a77_0xd87fc6 from'node:path';import*as a77_0x562f31 from'yaml';import{SDKError,ErrorCode}from'../../errors.js';import{findAgentConfig,findAgentConfigPath,isAgentDir}from'../agent-config.js';import{parseAgentYaml}from'../agent-yaml.js';const TEST_FILE_NAME='test.yml',AGENT_FILE_NAME=a77_0x2d253d(0x230);function validateRequiredString(_0x885376,_0x34e5e2,_0x332402,_0x3f7647){const _0x1ffb09=a77_0x2d253d;if(!_0x885376[_0x34e5e2]||typeof _0x885376[_0x34e5e2]!==_0x1ffb09(0x225))throw new SDKError(ErrorCode[_0x1ffb09(0x231)],_0x1ffb09(0x1ff)+_0x34e5e2+_0x1ffb09(0x21d)+_0x332402,undefined,{'helpText':_0x3f7647});const _0x402fee=_0x885376[_0x34e5e2][_0x1ffb09(0x235)]();if(_0x402fee[_0x1ffb09(0x1fc)]===0x0)throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],'\x27'+_0x34e5e2+_0x1ffb09(0x224)+_0x332402);return _0x402fee;}export function resolveTestPath(_0x117920){const _0x1b0341=a77_0x2d253d,_0x3475a2=a77_0xd87fc6['resolve'](_0x117920);if(a77_0xf5c3f2[_0x1b0341(0x218)](_0x3475a2)&&a77_0xf5c3f2['statSync'](_0x3475a2)[_0x1b0341(0x221)]()){if(!_0x3475a2[_0x1b0341(0x1f1)](_0x1b0341(0x21b))&&!_0x3475a2[_0x1b0341(0x1f1)](_0x1b0341(0x23a)))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Expected\x20a\x20YAML\x20file,\x20got:\x20'+_0x117920,undefined,{'helpText':_0x1b0341(0x1f6)});return _0x3475a2;}if(a77_0xf5c3f2[_0x1b0341(0x218)](_0x3475a2)&&a77_0xf5c3f2[_0x1b0341(0x1fe)](_0x3475a2)[_0x1b0341(0x1f2)]()){const _0x240acb=a77_0xd87fc6[_0x1b0341(0x206)](_0x3475a2,TEST_FILE_NAME);if(a77_0xf5c3f2['existsSync'](_0x240acb))return _0x240acb;if(isAgentDir(_0x3475a2))throw new SDKError(ErrorCode[_0x1b0341(0x1f4)],_0x1b0341(0x20d)+_0x117920,undefined,{'helpText':_0x1b0341(0x210)+_0x117920+_0x1b0341(0x1f9)});throw new SDKError(ErrorCode[_0x1b0341(0x1f4)],_0x1b0341(0x207)+_0x117920,undefined,{'helpText':_0x1b0341(0x223)});}throw new SDKError(ErrorCode[_0x1b0341(0x1f4)],'Path\x20not\x20found:\x20'+_0x117920,undefined,{'helpText':_0x1b0341(0x239)});}export function parseTestDefinition(_0x3ef924){const _0x13ac65=a77_0x2d253d;let _0x1b7c5e;try{_0x1b7c5e=a77_0xf5c3f2[_0x13ac65(0x213)](_0x3ef924,'utf-8');}catch(_0x4b7c6e){throw new SDKError(ErrorCode[_0x13ac65(0x1f4)],'Cannot\x20read\x20test\x20file:\x20'+_0x3ef924,_0x4b7c6e,{'helpText':_0x13ac65(0x212)});}let _0x82f893;try{_0x82f893=a77_0x562f31[_0x13ac65(0x22e)](_0x1b7c5e);}catch(_0x4175ca){throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],'Invalid\x20YAML\x20in\x20test\x20file:\x20'+_0x3ef924,_0x4175ca,{'helpText':_0x13ac65(0x22c)});}return validateTestDefinition(_0x82f893,_0x3ef924);}function validateTestDefinition(_0x11c86f,_0x2848e7){const _0x5ee249=a77_0x2d253d,_0x231ef3=_0x5ee249(0x202)+_0x2848e7;if(!_0x11c86f||typeof _0x11c86f!==_0x5ee249(0x1f0))throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x5ee249(0x1f7)+_0x231ef3);const _0x5a449d=_0x11c86f;if(!_0x5a449d[_0x5ee249(0x209)])throw new SDKError(ErrorCode[_0x5ee249(0x231)],'Missing\x20\x27tests\x27\x20field'+_0x231ef3,undefined,{'helpText':'Test\x20definition\x20must\x20have\x20a\x20\x22tests\x22\x20array.'});if(!Array[_0x5ee249(0x227)](_0x5a449d[_0x5ee249(0x209)]))throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],'\x27tests\x27\x20must\x20be\x20an\x20array'+_0x231ef3);if(_0x5a449d['tests'][_0x5ee249(0x1fc)]===0x0)throw new SDKError(ErrorCode[_0x5ee249(0x231)],_0x5ee249(0x217)+_0x231ef3,undefined,{'helpText':_0x5ee249(0x1fd)});const _0x220c20=[],_0x5c0609=new Set();for(let _0xea8ce=0x0;_0xea8ce<_0x5a449d[_0x5ee249(0x209)][_0x5ee249(0x1fc)];_0xea8ce++){const _0x538b3a=validateTestCase(_0x5a449d[_0x5ee249(0x209)][_0xea8ce],_0xea8ce,_0x231ef3);if(_0x5c0609[_0x5ee249(0x236)](_0x538b3a[_0x5ee249(0x23c)]))throw new SDKError(ErrorCode[_0x5ee249(0x231)],_0x5ee249(0x1f8)+_0x538b3a['name']+'\x27'+_0x231ef3,undefined,{'helpText':_0x5ee249(0x228)});_0x5c0609[_0x5ee249(0x238)](_0x538b3a[_0x5ee249(0x23c)]),_0x220c20[_0x5ee249(0x1ed)](_0x538b3a);}return{'tests':_0x220c20};}function validateTestCase(_0x45ed7c,_0x1e52b5,_0xb6e0ca){const _0x2005a9=a77_0x2d253d,_0x1f0e7f='\x20(test['+_0x1e52b5+'])'+_0xb6e0ca;if(!_0x45ed7c||typeof _0x45ed7c!==_0x2005a9(0x1f0))throw new SDKError(ErrorCode[_0x2005a9(0x231)],_0x2005a9(0x226)+_0x1f0e7f);const _0x321ca9=_0x45ed7c,_0x867af0=validateRequiredString(_0x321ca9,_0x2005a9(0x23c),_0x1f0e7f,_0x2005a9(0x1fa)),_0x22edeb=_0x2005a9(0x1f3)in _0x321ca9||_0x2005a9(0x1ee)in _0x321ca9,_0xd42d61=_0x2005a9(0x220)in _0x321ca9;if(_0x22edeb&&_0xd42d61)throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x2005a9(0x205)+_0x1f0e7f,undefined,{'helpText':_0x2005a9(0x1ef)+_0x2005a9(0x22f)+_0x2005a9(0x200)+_0x2005a9(0x234)+'Or\x20rounds\x20array\x20for\x20multi-round\x20tests:\x0a'+_0x2005a9(0x22f)+_0x2005a9(0x214)+'\x20\x20\x20\x20\x20\x20-\x20user_input:\x20...\x0a'+_0x2005a9(0x20f)});if(!_0x22edeb&&!_0xd42d61)throw new SDKError(ErrorCode[_0x2005a9(0x231)],_0x2005a9(0x229)+_0x1f0e7f,undefined,{'helpText':'Each\x20test\x20must\x20have\x20either:\x0a'+_0x2005a9(0x204)+_0x2005a9(0x20a)});const _0x642fe5=validateOptionalTags(_0x321ca9['tags'],_0x1f0e7f);if(_0x22edeb)return{'name':_0x867af0,'rounds':[validateRound(_0x321ca9,_0x1f0e7f)],'tags':_0x642fe5};return{'name':_0x867af0,'rounds':validateRoundsArray(_0x321ca9[_0x2005a9(0x220)],_0x1f0e7f),'tags':_0x642fe5};}function a77_0x2d08(_0x3bf0c1,_0x54e956){_0x3bf0c1=_0x3bf0c1-0x1ed;const _0x2de170=a77_0x2de1();let _0x2d0825=_0x2de170[_0x3bf0c1];return _0x2d0825;}function validateRound(_0x445bc7,_0x444604){const _0x3bd9da=a77_0x2d253d;if(!_0x445bc7||typeof _0x445bc7!==_0x3bd9da(0x1f0))throw new SDKError(ErrorCode[_0x3bd9da(0x231)],_0x3bd9da(0x233)+_0x444604);const _0x1245b4=_0x445bc7;return{'user_input':validateRequiredString(_0x1245b4,_0x3bd9da(0x1f3),_0x444604,'Must\x20have\x20a\x20string\x20\x22user_input\x22\x20field.'),'criteria':validateRequiredString(_0x1245b4,_0x3bd9da(0x1ee),_0x444604,_0x3bd9da(0x201))};}function validateRoundsArray(_0x4fedd8,_0xe62cec){const _0x411921=a77_0x2d253d;if(!Array['isArray'](_0x4fedd8))throw new SDKError(ErrorCode[_0x411921(0x231)],_0x411921(0x21f)+_0xe62cec);if(_0x4fedd8['length']===0x0)throw new SDKError(ErrorCode['AGENT_SYNTAX_ERROR'],_0x411921(0x23e)+_0xe62cec,undefined,{'helpText':_0x411921(0x21a)});return _0x4fedd8[_0x411921(0x215)]((_0x58257a,_0x36e5d3)=>validateRound(_0x58257a,'\x20(round['+_0x36e5d3+'])'+_0xe62cec));}function validateOptionalTags(_0x18470b,_0x1e980f){const _0x1427bb=a77_0x2d253d;if(_0x18470b===undefined||_0x18470b===null)return undefined;if(!Array[_0x1427bb(0x227)](_0x18470b))throw new SDKError(ErrorCode[_0x1427bb(0x231)],'\x27tags\x27\x20must\x20be\x20an\x20array\x20of\x20strings'+_0x1e980f);const _0x3d23fb=[];for(let _0x16a3ee=0x0;_0x16a3ee<_0x18470b[_0x1427bb(0x1fc)];_0x16a3ee++){const _0x5730cc=_0x18470b[_0x16a3ee];if(typeof _0x5730cc!=='string')throw new SDKError(ErrorCode[_0x1427bb(0x231)],_0x1427bb(0x211)+_0x16a3ee+_0x1427bb(0x216)+_0x1e980f);const _0x27b278=_0x5730cc['trim']();if(_0x27b278[_0x1427bb(0x1fc)]===0x0)throw new SDKError(ErrorCode[_0x1427bb(0x231)],_0x1427bb(0x20c)+_0x16a3ee+_0x1e980f,undefined,{'helpText':_0x1427bb(0x1f5)});_0x3d23fb[_0x1427bb(0x1ed)](_0x27b278);}return _0x3d23fb[_0x1427bb(0x1fc)]>0x0?_0x3d23fb:undefined;}export function resolveAgentInfo(_0x3c973e){const _0x22c1b0=a77_0x2d253d,_0xda44c0=a77_0xd87fc6[_0x22c1b0(0x20b)](_0x3c973e),_0x448d6b=a77_0xd87fc6[_0x22c1b0(0x206)](_0xda44c0,AGENT_FILE_NAME);if(!a77_0xf5c3f2[_0x22c1b0(0x218)](_0x448d6b))throw new SDKError(ErrorCode[_0x22c1b0(0x1f4)],'No\x20agent.yml\x20found\x20alongside\x20test.yml\x20in:\x20'+_0xda44c0,undefined,{'helpText':_0x22c1b0(0x22b)+_0x22c1b0(0x23b)+_0x22c1b0(0x1fb)+_0x22c1b0(0x23d)+_0x22c1b0(0x222)});const _0x34df52=findAgentConfigPath(_0xda44c0);if(!_0x34df52)throw new SDKError(ErrorCode[_0x22c1b0(0x1f4)],'No\x20tdx.json\x20found\x20for\x20agent\x20directory:\x20'+_0xda44c0,undefined,{'helpText':_0x22c1b0(0x219)+_0x22c1b0(0x22a)});const {config:_0x4ce3b9}=findAgentConfig(_0xda44c0),_0x4d1faa=_0x4ce3b9['llm_project'];let _0x5cc0f1;try{_0x5cc0f1=a77_0xf5c3f2['readFileSync'](_0x448d6b,'utf-8');}catch(_0x265d01){throw new SDKError(ErrorCode[_0x22c1b0(0x1f4)],'Cannot\x20read\x20agent.yml:\x20'+_0x448d6b,_0x265d01);}const _0x170b7f=parseAgentYaml(_0x5cc0f1,_0x448d6b),_0x1b2c70=_0x170b7f[_0x22c1b0(0x23c)];return{'projectName':_0x4d1faa,'agentName':_0x1b2c70,'agentDir':_0xda44c0,'agentYmlPath':_0x448d6b,'testYmlPath':_0x3c973e};}export function parseTestFile(_0x51746a){const _0x1f2586=resolveTestPath(_0x51746a),_0x21dbcc=parseTestDefinition(_0x1f2586),_0x59278f=resolveAgentInfo(_0x1f2586);return{'definition':_0x21dbcc,'agentInfo':_0x59278f};}function a77_0x2de1(){const _0x5385b6=['name','\x20\x20\x20\x20├──\x20agent.yml\x0a','\x27rounds\x27\x20array\x20is\x20empty','push','criteria','Use\x20either\x20flat\x20format\x20for\x20single-round\x20tests:\x0a','object','endsWith','isDirectory','user_input','NOT_FOUND','Tags\x20must\x20be\x20non-empty\x20strings.','Provide\x20a\x20path\x20to\x20test.yml\x20or\x20an\x20agent\x20directory\x20containing\x20test.yml.','Invalid\x20test\x20definition:\x20expected\x20object','Duplicate\x20test\x20name\x20\x27','\x20with\x20your\x20test\x20definitions.','Each\x20test\x20must\x20have\x20a\x20string\x20\x22name\x22\x20field.','\x20\x20agents/project/my-agent/\x0a','length','Add\x20at\x20least\x20one\x20test\x20case\x20to\x20the\x20tests\x20array.','statSync','Missing\x20or\x20invalid\x20\x27','\x20\x20\x20\x20user_input:\x20...\x0a','Must\x20have\x20a\x20string\x20\x22criteria\x22\x20field.','\x20in\x20','553050qwMEUJ','-\x20user_input\x20and\x20criteria\x20(flat\x20format\x20for\x20single-round)\x0a','Cannot\x20use\x20both\x20flat\x20format\x20(user_input/criteria)\x20and\x20rounds\x20array','join','No\x20test.yml\x20found\x20in\x20directory:\x20','2785260ZFdAnx','tests','-\x20rounds\x20array\x20(for\x20multi-round\x20tests)','dirname','Empty\x20tag\x20at\x20index\x20','No\x20test.yml\x20found\x20in\x20agent\x20directory:\x20','6815744ehDGQx','\x20\x20\x20\x20\x20\x20\x20\x20criteria:\x20...','Create\x20a\x20test.yml\x20file\x20in\x20','Invalid\x20tag\x20at\x20index\x20','Ensure\x20the\x20file\x20exists\x20and\x20is\x20readable.','readFileSync','\x20\x20\x20\x20rounds:\x0a','map',':\x20expected\x20string','\x27tests\x27\x20array\x20is\x20empty','existsSync','Run\x20\x22tdx\x20agent\x20pull\x20<project>\x22\x20first\x20to\x20create\x20the\x20folder\x20structure,\x0a','Add\x20at\x20least\x20one\x20round\x20to\x20the\x20test.','.yml','4EVQzeu','\x27\x20field','3776472LrVmnk','\x27rounds\x27\x20must\x20be\x20an\x20array','rounds','isFile','\x20\x20\x20\x20└──\x20test.yml','Ensure\x20the\x20directory\x20contains\x20a\x20test.yml\x20file.','\x27\x20cannot\x20be\x20empty','string','Invalid\x20test\x20case:\x20expected\x20object','isArray','Each\x20test\x20must\x20have\x20a\x20unique\x20name.','Missing\x20test\x20content','or\x20ensure\x20tdx.json\x20exists\x20in\x20the\x20project\x20directory.','test.yml\x20must\x20be\x20in\x20the\x20same\x20directory\x20as\x20agent.yml.\x0a','Check\x20your\x20YAML\x20syntax.','535485zIPkUB','parse','\x20\x20-\x20name:\x20test\x0a','agent.yml','AGENT_SYNTAX_ERROR','1509384fHcGXv','Invalid\x20round:\x20expected\x20object','\x20\x20\x20\x20criteria:\x20...\x0a','trim','has','8664572SSEBwc','add','Provide\x20a\x20valid\x20path\x20to\x20test.yml\x20or\x20an\x20agent\x20directory.','.yaml','Expected\x20structure:\x0a'];a77_0x2de1=function(){return _0x5385b6;};return a77_0x2de1();}
package/dist/sdk/api.js CHANGED
@@ -1 +1 @@
1
- function a80_0x3a87(_0x459886,_0x12281b){_0x459886=_0x459886-0x120;const _0x2116cf=a80_0x2116();let _0x3a87c0=_0x2116cf[_0x459886];return _0x3a87c0;}const a80_0x377098=a80_0x3a87;function a80_0x2116(){const _0x46d364=['site','9iKMbUT','status','2694140KtZbAa','trino','22vhTLmd','38128TxqTlx','GET','33256704ZwyDSk','message','Error:\x20','2698472VbuShu','Content-Type','readBodyFromFile','607204kztlFf','stringify','1791JpIKki','context','6BLDnQX','1021936XdGiym','apiKey','Failed\x20to\x20read\x20request\x20body\x20from\x20file:\x20','4940570IcBtJE','headers','1TXesPE','startsWith','Endpoint\x20must\x20start\x20with\x20/:\x20'];a80_0x2116=function(){return _0x46d364;};return a80_0x2116();}(function(_0x983fc3,_0x4fcc22){const _0x2408d1=a80_0x3a87,_0x57412c=_0x983fc3();while(!![]){try{const _0x4e7c41=parseInt(_0x2408d1(0x137))/0x1*(-parseInt(_0x2408d1(0x12d))/0x2)+parseInt(_0x2408d1(0x120))/0x3*(parseInt(_0x2408d1(0x132))/0x4)+parseInt(_0x2408d1(0x122))/0x5+-parseInt(_0x2408d1(0x131))/0x6*(-parseInt(_0x2408d1(0x12a))/0x7)+parseInt(_0x2408d1(0x125))/0x8*(parseInt(_0x2408d1(0x12f))/0x9)+-parseInt(_0x2408d1(0x135))/0xa*(-parseInt(_0x2408d1(0x124))/0xb)+-parseInt(_0x2408d1(0x127))/0xc;if(_0x4e7c41===_0x4fcc22)break;else _0x57412c['push'](_0x57412c['shift']());}catch(_0x230b36){_0x57412c['push'](_0x57412c['shift']());}}}(a80_0x2116,0x86d8a));import{HTTPClient}from'./client/http-client.js';import{getEndpoint}from'./types/index.js';import{getAuthHeaders,getTrinoHeaders,toHeaderRecord}from'../core/auth.js';import{readFileSync}from'fs';export class RawAPI{[a80_0x377098(0x130)];constructor(_0x37d90a){const _0x539d41=a80_0x377098;this[_0x539d41(0x130)]=_0x37d90a;}async['request'](_0x54bf1d,_0x55d3f0={}){const _0x289ab2=a80_0x377098,{method:method=_0x289ab2(0x126),body:_0x1caa08,headers:_0x5bdfc6={},apiType:apiType='td',includeHeaders:includeHeaders=![]}=_0x55d3f0;if(!_0x54bf1d[_0x289ab2(0x138)]('/'))throw new Error(_0x289ab2(0x139)+_0x54bf1d);const _0x26657f=getEndpoint(this[_0x289ab2(0x130)]['site'],apiType);let _0x3abb98;if(apiType===_0x289ab2(0x123)){const _0x33444e=getTrinoHeaders(this[_0x289ab2(0x130)]['site'],this[_0x289ab2(0x130)][_0x289ab2(0x133)]);_0x3abb98={..._0x33444e,..._0x5bdfc6};}else{const _0x2cc57a=getAuthHeaders(this[_0x289ab2(0x130)][_0x289ab2(0x13a)],this[_0x289ab2(0x130)][_0x289ab2(0x133)]);_0x3abb98={...toHeaderRecord(_0x2cc57a),..._0x5bdfc6};}const _0x3d3372=_0x3abb98;let _0x501457;_0x1caa08!==undefined&&(_0x501457=typeof _0x1caa08==='string'?_0x1caa08:JSON[_0x289ab2(0x12e)](_0x1caa08),!_0x3d3372[_0x289ab2(0x12b)]&&(_0x3d3372[_0x289ab2(0x12b)]='application/json'));const _0x694139=new HTTPClient(_0x26657f,_0x3d3372),_0x2aed9b=await _0x694139['request'](method,_0x54bf1d,{'body':_0x501457,'includeHeaders':!![]});return includeHeaders?{'data':_0x2aed9b['data'],'status':_0x2aed9b[_0x289ab2(0x121)],'headers':_0x2aed9b[_0x289ab2(0x136)]}:{'data':_0x2aed9b['data'],'status':_0x2aed9b[_0x289ab2(0x121)]};}static[a80_0x377098(0x12c)](_0x340142){const _0x57e028=a80_0x377098;try{return readFileSync(_0x340142,'utf-8');}catch(_0x4b0996){throw new Error(_0x57e028(0x134)+_0x340142+'.\x20'+(_0x57e028(0x129)+(_0x4b0996 instanceof Error?_0x4b0996[_0x57e028(0x128)]:String(_0x4b0996))));}}}
1
+ const a80_0x3286ab=a80_0x374f;function a80_0x374f(_0x282866,_0xbc4987){_0x282866=_0x282866-0x121;const _0x828a97=a80_0x828a();let _0x374f22=_0x828a97[_0x282866];return _0x374f22;}(function(_0x23552d,_0x38600d){const _0x5eee2b=a80_0x374f,_0x19012e=_0x23552d();while(!![]){try{const _0x29dbc9=parseInt(_0x5eee2b(0x13a))/0x1*(-parseInt(_0x5eee2b(0x125))/0x2)+-parseInt(_0x5eee2b(0x134))/0x3+-parseInt(_0x5eee2b(0x136))/0x4+-parseInt(_0x5eee2b(0x13b))/0x5*(-parseInt(_0x5eee2b(0x121))/0x6)+parseInt(_0x5eee2b(0x130))/0x7+-parseInt(_0x5eee2b(0x122))/0x8+parseInt(_0x5eee2b(0x12a))/0x9*(parseInt(_0x5eee2b(0x12c))/0xa);if(_0x29dbc9===_0x38600d)break;else _0x19012e['push'](_0x19012e['shift']());}catch(_0x393159){_0x19012e['push'](_0x19012e['shift']());}}}(a80_0x828a,0x35c11));function a80_0x828a(){const _0x10b864=['1722370QyDbhL','stringify','startsWith','utf-8','2990211ZsxWeT','headers','Endpoint\x20must\x20start\x20with\x20/:\x20','request','1077678AEFAsG','Content-Type','1669092bxxqXO','site','application/json','string','37377ElHjUl','370ZdOeLa','23988mYzGfQ','150384kMApiv','Error:\x20','context','12iGFyGY','data','GET','readBodyFromFile','apiKey','27EhYoWr','status'];a80_0x828a=function(){return _0x10b864;};return a80_0x828a();}import{HTTPClient}from'./client/http-client.js';import{getEndpoint}from'./types/index.js';import{getAuthHeaders,getTrinoHeaders,toHeaderRecord}from'../core/auth.js';import{readFileSync}from'fs';export class RawAPI{[a80_0x3286ab(0x124)];constructor(_0x2d31ab){const _0x415ccd=a80_0x3286ab;this[_0x415ccd(0x124)]=_0x2d31ab;}async['request'](_0x26feb0,_0x1217b2={}){const _0x2883ee=a80_0x3286ab,{method:method=_0x2883ee(0x127),body:_0xe91e2e,headers:_0x1382b8={},apiType:apiType='td',includeHeaders:includeHeaders=![]}=_0x1217b2;if(!_0x26feb0[_0x2883ee(0x12e)]('/'))throw new Error(_0x2883ee(0x132)+_0x26feb0);const _0x5403a2=getEndpoint(this[_0x2883ee(0x124)]['site'],apiType);let _0x2798b6;if(apiType==='trino'){const _0x75b678=getTrinoHeaders(this[_0x2883ee(0x124)][_0x2883ee(0x137)],this[_0x2883ee(0x124)][_0x2883ee(0x129)]);_0x2798b6={..._0x75b678,..._0x1382b8};}else{const _0x49f139=getAuthHeaders(this[_0x2883ee(0x124)][_0x2883ee(0x137)],this['context']['apiKey']);_0x2798b6={...toHeaderRecord(_0x49f139),..._0x1382b8};}const _0x252cc2=_0x2798b6;let _0x470c4e;_0xe91e2e!==undefined&&(_0x470c4e=typeof _0xe91e2e===_0x2883ee(0x139)?_0xe91e2e:JSON[_0x2883ee(0x12d)](_0xe91e2e),!_0x252cc2[_0x2883ee(0x135)]&&(_0x252cc2['Content-Type']=_0x2883ee(0x138)));const _0xe5dfcb=new HTTPClient(_0x5403a2,_0x252cc2),_0x357a75=await _0xe5dfcb[_0x2883ee(0x133)](method,_0x26feb0,{'body':_0x470c4e,'includeHeaders':!![]});return includeHeaders?{'data':_0x357a75[_0x2883ee(0x126)],'status':_0x357a75[_0x2883ee(0x12b)],'headers':_0x357a75[_0x2883ee(0x131)]}:{'data':_0x357a75[_0x2883ee(0x126)],'status':_0x357a75[_0x2883ee(0x12b)]};}static[a80_0x3286ab(0x128)](_0x22329a){const _0x3b6066=a80_0x3286ab;try{return readFileSync(_0x22329a,_0x3b6066(0x12f));}catch(_0x27d670){throw new Error('Failed\x20to\x20read\x20request\x20body\x20from\x20file:\x20'+_0x22329a+'.\x20'+(_0x3b6066(0x123)+(_0x27d670 instanceof Error?_0x27d670['message']:String(_0x27d670))));}}}
@@ -1 +1 @@
1
- const a81_0x181f40=a81_0x3ece;(function(_0x12a029,_0x29ce05){const _0x162f6a=a81_0x3ece,_0x4e1d44=_0x12a029();while(!![]){try{const _0x3a4907=-parseInt(_0x162f6a(0x121))/0x1+-parseInt(_0x162f6a(0xe7))/0x2*(parseInt(_0x162f6a(0x135))/0x3)+parseInt(_0x162f6a(0x112))/0x4*(parseInt(_0x162f6a(0x128))/0x5)+parseInt(_0x162f6a(0x10a))/0x6*(-parseInt(_0x162f6a(0x113))/0x7)+parseInt(_0x162f6a(0x137))/0x8+parseInt(_0x162f6a(0x11f))/0x9+parseInt(_0x162f6a(0xf0))/0xa;if(_0x3a4907===_0x29ce05)break;else _0x4e1d44['push'](_0x4e1d44['shift']());}catch(_0x2e6dde){_0x4e1d44['push'](_0x4e1d44['shift']());}}}(a81_0x33d1,0x2c019));function a81_0x3ece(_0x24f2c1,_0x2a3c2e){_0x24f2c1=_0x24f2c1-0xd7;const _0x33d140=a81_0x33d1();let _0x3ece4a=_0x33d140[_0x24f2c1];return _0x3ece4a;}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{[a81_0x181f40(0x134)];[a81_0x181f40(0x12d)];constructor(_0x1ecd21){const _0x3e286c=a81_0x181f40,_0x5e0079=getEndpoint(_0x1ecd21[_0x3e286c(0x124)],_0x3e286c(0x10d));this['authHeaders']=toHeaderRecord(getAuthHeaders(_0x1ecd21['site'],_0x1ecd21[_0x3e286c(0xea)])),this[_0x3e286c(0x134)]=new HTTPClient(_0x5e0079,{...this['authHeaders'],'Accept':_0x3e286c(0xf1),'Content-Type':'application/json'});}async['listParentSegments'](){const _0xa88e6e=a81_0x181f40,_0x393183=_0xa88e6e(0xe6),_0x29d04d=await this[_0xa88e6e(0x134)][_0xa88e6e(0x118)](_0xa88e6e(0x123),_0x393183);return Array[_0xa88e6e(0x114)](_0x29d04d)?_0x29d04d:_0x29d04d[_0xa88e6e(0xdf)];}async[a81_0x181f40(0xef)](_0xa6bd07){const _0x1a82a3=a81_0x181f40,_0x307353=_0x1a82a3(0x12e)+_0xa6bd07,_0x3c8f44=await this['httpClient']['request'](_0x1a82a3(0x123),_0x307353);return'data'in _0x3c8f44?_0x3c8f44[_0x1a82a3(0xdf)]:_0x3c8f44;}async[a81_0x181f40(0xe1)](_0x324cec){const _0x125b41=a81_0x181f40,_0x811a47='/audiences/'+_0x324cec+'/segments',_0x330bad=await this[_0x125b41(0x134)][_0x125b41(0x118)](_0x125b41(0x123),_0x811a47);return Array[_0x125b41(0x114)](_0x330bad)?_0x330bad:_0x330bad[_0x125b41(0xdf)];}async[a81_0x181f40(0xf4)](_0x3e2f5d,_0x103fee){const _0x28bab9=a81_0x181f40,_0x58e0d0='/audiences/'+_0x3e2f5d+_0x28bab9(0xf9)+_0x103fee,_0x52e710=await this['httpClient'][_0x28bab9(0x118)](_0x28bab9(0x123),_0x58e0d0);return _0x28bab9(0xdf)in _0x52e710?_0x52e710['data']:_0x52e710;}async[a81_0x181f40(0x109)](_0x3d0020){const _0x335e23=a81_0x181f40,_0x489b1b=_0x335e23(0xdd)+_0x3d0020+'/folders',_0x21f429=await this['httpClient'][_0x335e23(0x118)](_0x335e23(0x123),_0x489b1b);return Array[_0x335e23(0x114)](_0x21f429)?_0x21f429:_0x21f429[_0x335e23(0xdf)];}async['getSegmentFolder'](_0x12476f){const _0x5d2be5=a81_0x181f40,_0x450dee=_0x5d2be5(0x126)+_0x12476f,_0x3d0a93=await this[_0x5d2be5(0x134)][_0x5d2be5(0x118)](_0x5d2be5(0x123),_0x450dee);return _0x5d2be5(0xdf)in _0x3d0a93?_0x3d0a93[_0x5d2be5(0xdf)]:_0x3d0a93;}async[a81_0x181f40(0x12b)](_0x3baa4c,_0x2a3cdc=0x20,_0x253d03=![]){const _0xb0df41=a81_0x181f40,_0x14a20d='/entities/by-folder/'+_0x3baa4c+_0xb0df41(0x133)+_0x2a3cdc+_0xb0df41(0x10f)+_0x253d03;return await this[_0xb0df41(0x134)][_0xb0df41(0x118)](_0xb0df41(0x123),_0x14a20d);}async['listActivations'](_0x4e7965,_0x4ba780){const _0x568925=a81_0x181f40,_0x3b5fb4=_0x568925(0xdd)+_0x4e7965+_0x568925(0xf9)+_0x4ba780+'/syndications',_0x2f9c80=await this[_0x568925(0x134)][_0x568925(0x118)](_0x568925(0x123),_0x3b5fb4);return Array[_0x568925(0x114)](_0x2f9c80)?_0x2f9c80:_0x2f9c80['data'];}async[a81_0x181f40(0x11e)](_0x45a187,_0x2fcf09,_0x18f878){const _0x11e84b=a81_0x181f40,_0x585b65=_0x11e84b(0xdd)+_0x45a187+'/segments/'+_0x2fcf09+_0x11e84b(0xee)+_0x18f878,_0x239fb2=await this[_0x11e84b(0x134)]['request']('GET',_0x585b65);return _0x11e84b(0xdf)in _0x239fb2?_0x239fb2[_0x11e84b(0xdf)]:_0x239fb2;}async[a81_0x181f40(0x11a)](_0x24b9de,_0x529cf1,_0x6aa9bb){const _0x16c4bc=a81_0x181f40,_0x33ed29=_0x16c4bc(0xdd)+_0x24b9de+'/segments/'+_0x529cf1+_0x16c4bc(0xe0),_0x13f036=await this[_0x16c4bc(0x134)][_0x16c4bc(0x118)](_0x16c4bc(0x107),_0x33ed29,{'body':_0x6aa9bb});return _0x13f036;}async[a81_0x181f40(0x131)](_0x441850,_0x354c29,_0x41f8aa,_0x26d070){const _0x52e842=a81_0x181f40,_0x59ceb6='/audiences/'+_0x441850+'/segments/'+_0x354c29+_0x52e842(0xee)+_0x41f8aa,_0x25e806=await this[_0x52e842(0x134)][_0x52e842(0x118)](_0x52e842(0x11b),_0x59ceb6,{'body':_0x26d070});return _0x25e806;}async[a81_0x181f40(0x13a)](_0x952c49,_0x3c3233,_0x3df576){const _0x3e8183=a81_0x181f40,_0x4fa1d5=_0x3e8183(0xdd)+_0x952c49+_0x3e8183(0xf9)+_0x3c3233+_0x3e8183(0xee)+_0x3df576;await this['httpClient'][_0x3e8183(0x118)](_0x3e8183(0x11d),_0x4fa1d5);}async['getParentSegmentSQL'](_0x436b5d){const _0x151896=a81_0x181f40,_0x103e6c=_0x151896(0xdd)+_0x436b5d+_0x151896(0x116),_0x1d994b=await this[_0x151896(0x134)][_0x151896(0x118)](_0x151896(0x107),_0x103e6c,{'body':{'format':_0x151896(0x106)}});return _0x1d994b['sql']||_0x1d994b[_0x151896(0x10b)]||'';}async[a81_0x181f40(0xed)](_0x404356,_0x510ed5){const _0x309c49=a81_0x181f40,_0x3076c0=await this[_0x309c49(0xf4)](_0x404356,_0x510ed5),_0x2244cd={'format':_0x309c49(0x106)};_0x309c49(0xd9)in _0x3076c0&&_0x3076c0[_0x309c49(0xd9)]&&(_0x2244cd['rule']=_0x3076c0[_0x309c49(0xd9)]);const _0x56763b='/audiences/'+_0x404356+_0x309c49(0x116),_0x1d7567=await this[_0x309c49(0x134)][_0x309c49(0x118)](_0x309c49(0x107),_0x56763b,{'body':_0x2244cd});return _0x1d7567[_0x309c49(0x106)]||_0x1d7567[_0x309c49(0x10b)]||'';}async[a81_0x181f40(0x105)](_0x507a80){const _0xc486c3=a81_0x181f40,_0x24dcfa=_0xc486c3(0x119),_0x561fe4=await this[_0xc486c3(0x134)][_0xc486c3(0x118)](_0xc486c3(0x107),_0x24dcfa,{'body':_0x507a80,'headers':{'Content-Type':_0xc486c3(0xf1)}});return _0x561fe4;}async[a81_0x181f40(0x138)](_0x381efd,_0x354aab){const _0x155f80=a81_0x181f40,_0x1fd5b5=_0x155f80(0xdd)+_0x381efd,_0x4f3bfd=await this[_0x155f80(0x134)][_0x155f80(0x118)](_0x155f80(0x11b),_0x1fd5b5,{'body':_0x354aab,'headers':{'Content-Type':_0x155f80(0xf1)}});return _0x4f3bfd;}async[a81_0x181f40(0xe3)](_0x1c2cdf){const _0x429f80=a81_0x181f40,_0x4710ff=_0x429f80(0xdd)+_0x1c2cdf,_0x66207b=await this[_0x429f80(0x134)][_0x429f80(0x118)](_0x429f80(0x123),_0x4710ff,{'headers':{'Accept':'application/vnd.treasuredata.v1+json'}});return _0x66207b;}async[a81_0x181f40(0x111)](_0xb6ea7e){const _0x44ad5d=a81_0x181f40,_0x24e41f='/audiences/'+_0xb6ea7e+_0x44ad5d(0xd7),_0x192de7=await this[_0x44ad5d(0x134)]['request'](_0x44ad5d(0x123),_0x24e41f);return _0x192de7;}async['getAudienceBehaviors'](_0x1bbcf0,_0x381e7a){const _0x50bde4=a81_0x181f40;let _0x5b4069=_0x50bde4(0xdd)+_0x1bbcf0+_0x50bde4(0xdc);_0x381e7a!==undefined&&(_0x5b4069+='?realtime='+_0x381e7a);const _0x4b7dc6=await this[_0x50bde4(0x134)][_0x50bde4(0x118)](_0x50bde4(0x123),_0x5b4069);return _0x4b7dc6;}async[a81_0x181f40(0xfa)](_0x2ddcc8,_0x309f75){const _0x1a2cd5=a81_0x181f40,_0x289370=_0x1a2cd5(0xdd)+_0x2ddcc8+'/segments',_0xfee775=await this['httpClient'][_0x1a2cd5(0x118)]('POST',_0x289370,{'body':_0x309f75});return _0xfee775;}async['createJourneySegment'](_0x5a9035){const _0x467a2=a81_0x181f40,_0x248f70=_0x467a2(0xf2),_0x3167f4={'type':'segment-journey','attributes':{'name':_0x5a9035[_0x467a2(0xe8)],'description':_0x5a9035['description']||'','journeyId':_0x5a9035[_0x467a2(0xfd)],'rule':_0x5a9035['rule'],'countPopulation':_0x5a9035[_0x467a2(0xff)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x5a9035[_0x467a2(0x12a)],'type':'folder-segment'}}}},_0xc0f72a=await this[_0x467a2(0x134)]['request'](_0x467a2(0x107),_0x248f70,{'body':_0x3167f4,'headers':{'Content-Type':_0x467a2(0xf1)}});return _0xc0f72a[_0x467a2(0xdf)]['id'];}async[a81_0x181f40(0x100)](_0x43770b,_0x40e4a6,_0x2baa83){const _0x4bc559=a81_0x181f40,_0x338f22=_0x4bc559(0xdd)+_0x43770b+_0x4bc559(0xf9)+_0x40e4a6,_0x2f13d2=await this[_0x4bc559(0x134)][_0x4bc559(0x118)](_0x4bc559(0x11b),_0x338f22,{'body':_0x2baa83});return _0x2f13d2;}async[a81_0x181f40(0xdb)](_0x3e3013){const _0x58708d=a81_0x181f40,_0x14acd0='/entities/segments/'+_0x3e3013;await this[_0x58708d(0x134)][_0x58708d(0x118)](_0x58708d(0x11d),_0x14acd0);}async[a81_0x181f40(0xec)](_0x47ce1e,_0x15bf14){const _0x3e824e=a81_0x181f40,_0x3c2e8a=_0x3e824e(0xdd)+_0x47ce1e+_0x3e824e(0x130),_0x51fa1c=await this[_0x3e824e(0x134)][_0x3e824e(0x118)](_0x3e824e(0x107),_0x3c2e8a,{'body':_0x15bf14});if(_0x3e824e(0xdf)in _0x51fa1c&&_0x51fa1c[_0x3e824e(0xdf)]){const _0x54e612=_0x51fa1c[_0x3e824e(0xdf)];return{'id':_0x54e612['id'],'name':_0x54e612[_0x3e824e(0xe8)],'description':_0x54e612[_0x3e824e(0xe4)],'audienceId':_0x54e612[_0x3e824e(0x129)]||String(_0x47ce1e),'parentFolderId':_0x54e612['parentFolderId'],'createdAt':_0x54e612[_0x3e824e(0xd8)],'updatedAt':_0x54e612[_0x3e824e(0xfe)]};}return _0x51fa1c;}async[a81_0x181f40(0x12c)](_0x3cb686){const _0x38f19c=a81_0x181f40,_0x4af6db=_0x38f19c(0xdd)+_0x3cb686+'/run',_0x226016=await this[_0x38f19c(0x134)]['request']('POST',_0x4af6db);return _0x226016;}async[a81_0x181f40(0x102)](_0x58bac2){const _0x28233=a81_0x181f40,_0x23f098=_0x28233(0x132)+_0x58bac2,_0x306c13=await this[_0x28233(0x134)][_0x28233(0x118)](_0x28233(0x123),_0x23f098);return _0x306c13[_0x28233(0xdf)][_0x28233(0xf6)](_0x4f69ab=>({'id':_0x4f69ab['id'],'name':_0x4f69ab['attributes'][_0x28233(0xe8)],'journeyBundleName':_0x4f69ab[_0x28233(0xda)]['journeyBundleName'],'journeyBundleId':_0x4f69ab['attributes']['journeyBundleId'],'versionNumber':_0x4f69ab[_0x28233(0xda)][_0x28233(0x13b)],'description':_0x4f69ab[_0x28233(0xda)][_0x28233(0xe4)],'state':_0x4f69ab['attributes'][_0x28233(0x115)],'paused':_0x4f69ab[_0x28233(0xda)][_0x28233(0xf8)],'audienceId':_0x4f69ab[_0x28233(0xda)][_0x28233(0x129)],'folderId':_0x4f69ab[_0x28233(0x110)]?.[_0x28233(0x127)]?.[_0x28233(0xdf)]?.['id'],'createdAt':_0x4f69ab['attributes'][_0x28233(0xd8)],'updatedAt':_0x4f69ab[_0x28233(0xda)][_0x28233(0xfe)]}));}async[a81_0x181f40(0x139)](_0x5e9d1f){const _0x27a918=a81_0x181f40,_0x14f846=_0x27a918(0x132)+_0x5e9d1f,_0x56bebf=await this[_0x27a918(0x134)][_0x27a918(0x118)]('GET',_0x14f846),_0x16cdda=new Map();if(_0x56bebf[_0x27a918(0xe9)])for(const _0x58385d of _0x56bebf[_0x27a918(0xe9)]){_0x58385d['type']===_0x27a918(0x10e)&&_0x16cdda['set'](_0x58385d['id'],_0x58385d);}return{'journeys':_0x56bebf['data'],'activationStepsById':_0x16cdda};}async[a81_0x181f40(0xf3)](_0x1fd622){const _0x1b2cae=a81_0x181f40,_0x3cf186=_0x1b2cae(0x120)+_0x1fd622,_0x4d9f60=await this['httpClient']['request'](_0x1b2cae(0x123),_0x3cf186);return _0x1b2cae(0xdf)in _0x4d9f60?_0x4d9f60['data']:_0x4d9f60;}async[a81_0x181f40(0xde)](_0x44a573){const _0x3e6656=a81_0x181f40,_0x509edb=_0x3e6656(0x136),_0x31669d=await this[_0x3e6656(0x134)][_0x3e6656(0x118)](_0x3e6656(0x107),_0x509edb,{'body':_0x44a573,'headers':{'Content-Type':_0x3e6656(0xf1)}});return _0x3e6656(0xdf)in _0x31669d?_0x31669d[_0x3e6656(0xdf)]:_0x31669d;}async[a81_0x181f40(0x122)](_0x156861,_0x14c1c4){const _0x38662f=a81_0x181f40,_0x9302ee=_0x38662f(0x120)+_0x156861,_0x2250c6=await this[_0x38662f(0x134)]['request'](_0x38662f(0x125),_0x9302ee,{'body':_0x14c1c4,'headers':{'Content-Type':_0x38662f(0xf1)}});return _0x38662f(0xdf)in _0x2250c6?_0x2250c6['data']:_0x2250c6;}async[a81_0x181f40(0x117)](_0x310e3e,_0x1f0f93){const _0x14c2f6=a81_0x181f40,_0xf6e8fa=_0x14c2f6(0x120)+_0x310e3e+'/detail',_0x51e7ab=await this[_0x14c2f6(0x134)][_0x14c2f6(0x118)](_0x14c2f6(0x107),_0xf6e8fa,{'body':_0x1f0f93,'headers':{'Content-Type':_0x14c2f6(0xf1)}});return'data'in _0x51e7ab?_0x51e7ab[_0x14c2f6(0xdf)]:_0x51e7ab;}async[a81_0x181f40(0x10c)](_0x39c6b1){const _0x1ea22a=a81_0x181f40,_0x16ff4d='/entities/journeys/'+_0x39c6b1+_0x1ea22a(0xfc),_0x38cc1c=await this[_0x1ea22a(0x134)]['request'](_0x1ea22a(0x123),_0x16ff4d);return _0x1ea22a(0xdf)in _0x38cc1c?_0x38cc1c['data']:_0x38cc1c;}async['pauseJourney'](_0x3974f1){const _0xe39295=a81_0x181f40,_0x4caf14=_0xe39295(0x120)+_0x3974f1+_0xe39295(0xf5),_0xa26387=await this[_0xe39295(0x134)][_0xe39295(0x118)](_0xe39295(0x125),_0x4caf14);return _0xe39295(0xdf)in _0xa26387?_0xa26387[_0xe39295(0xdf)]:_0xa26387;}async[a81_0x181f40(0x12f)](_0x49b774){const _0x1ca61b=a81_0x181f40,_0x29a7f7=_0x1ca61b(0x120)+_0x49b774+_0x1ca61b(0x13c),_0x45d231=await this[_0x1ca61b(0x134)]['request'](_0x1ca61b(0x125),_0x29a7f7);return _0x1ca61b(0xdf)in _0x45d231?_0x45d231['data']:_0x45d231;}async[a81_0x181f40(0xe2)](_0x3192f7,_0x50b7a0){const _0x5d88ef=a81_0x181f40,_0x5509d5=_0x5d88ef(0x120)+_0x3192f7+'/activations/'+_0x50b7a0,_0x16a544=await this[_0x5d88ef(0x134)][_0x5d88ef(0x118)](_0x5d88ef(0x123),_0x5509d5);return _0x5d88ef(0xdf)in _0x16a544?_0x16a544[_0x5d88ef(0xdf)]:_0x16a544;}async[a81_0x181f40(0x101)](_0x1ba703){const _0x60345a=a81_0x181f40,_0x45e477=_0x60345a(0x120)+_0x1ba703+_0x60345a(0x103),_0x563bf2=await this[_0x60345a(0x134)][_0x60345a(0x118)](_0x60345a(0x123),_0x45e477);return _0x60345a(0xdf)in _0x563bf2?_0x563bf2[_0x60345a(0xdf)]:_0x563bf2;}async[a81_0x181f40(0xf7)](_0x34977e,_0xcfe065){const _0x173c93=a81_0x181f40,_0x451da0=_0x173c93(0x120)+_0x34977e+_0x173c93(0x103),_0x2623ad={'name':_0xcfe065['name'],'scheduleType':_0xcfe065[_0x173c93(0xfb)]||'none','connectionId':String(_0xcfe065['connectionId']),'columns':_0xcfe065['columns']??[],'notifyOn':_0xcfe065['notifyOn']??[],..._0xcfe065[_0x173c93(0xe4)]!==undefined&&{'description':_0xcfe065['description']},..._0xcfe065[_0x173c93(0x11c)]!==undefined&&{'allColumns':_0xcfe065['allColumns']},..._0xcfe065['timezone']!==undefined&&{'timezone':_0xcfe065[_0x173c93(0x108)]},..._0xcfe065['connectorConfig']!==undefined&&{'connectorConfig':_0xcfe065[_0x173c93(0x104)]},..._0xcfe065['emailRecipients']!==undefined&&{'emailRecipients':_0xcfe065['emailRecipients']},..._0xcfe065[_0x173c93(0xe5)]!==undefined&&{'activationTemplateId':_0xcfe065[_0x173c93(0xe5)]},..._0xcfe065[_0x173c93(0xeb)]!==undefined&&{'syndicationBehavior':_0xcfe065[_0x173c93(0xeb)]}},_0x138a76=await this[_0x173c93(0x134)][_0x173c93(0x118)]('POST',_0x451da0,{'body':{'type':_0x173c93(0x10e),'attributes':{'activationParams':_0x2623ad}},'headers':{'Content-Type':_0x173c93(0xf1)}});return'data'in _0x138a76?_0x138a76[_0x173c93(0xdf)]:_0x138a76;}}function a81_0x33d1(){const _0xcb1f8d=['createJourneyActivation','paused','/segments/','createSegment','scheduleType','/statistics','journeyId','updatedAt','countPopulation','updateSegment','listJourneyActivations','listJourneys','/activations','connectorConfig','createParentSegment','sql','POST','timezone','listSegmentFolders','1842462UayzzM','query','getJourneyStatistics','cdp','journeyActivationStep','&with_rule=','relationships','getAudienceAttributes','500JlMIgD','7dKvwVH','isArray','state','/segments/query','updateJourneyDetail','request','/audiences','createActivation','PUT','allColumns','DELETE','getActivation','2201400WMdAvv','/entities/journeys/','250196XcfUBb','updateJourney','GET','site','PATCH','/entities/folders/','parentFolder','7825nReLDh','audienceId','parentFolderId','listEntitiesByFolder','runParentSegment','authHeaders','/entities/parent_segments/','resumeJourney','/folders','updateActivation','/entities/journeys?folder_id=','?depth=','httpClient','996JtOOkZ','/entities/journeys','279024HEgTjB','updateParentSegment','listJourneysWithDetails','deleteActivation','versionNumber','/resume','/attributes','createdAt','rule','attributes','deleteSegment','/behaviors','/audiences/','createJourney','data','/syndications','listSegments','getJourneyActivation','getParentSegmentFull','description','activationTemplateId','/entities/parent_segments','1268vbihap','name','included','apiKey','syndicationBehavior','createSegmentFolder','getSegmentSQL','/syndications/','getParentSegment','4729070NfOfpG','application/vnd.treasuredata.v1+json','/entities/segments','getJourney','getSegment','/pause','map'];a81_0x33d1=function(){return _0xcb1f8d;};return a81_0x33d1();}
1
+ const a81_0x3b04df=a81_0x3edb;(function(_0x232d6d,_0x5f6086){const _0x6405ec=a81_0x3edb,_0x3b8fa1=_0x232d6d();while(!![]){try{const _0x293eeb=-parseInt(_0x6405ec(0xd2))/0x1+parseInt(_0x6405ec(0xdc))/0x2*(-parseInt(_0x6405ec(0xd1))/0x3)+-parseInt(_0x6405ec(0x100))/0x4+-parseInt(_0x6405ec(0xe8))/0x5+parseInt(_0x6405ec(0xc2))/0x6+-parseInt(_0x6405ec(0x107))/0x7+parseInt(_0x6405ec(0x10b))/0x8*(parseInt(_0x6405ec(0xe1))/0x9);if(_0x293eeb===_0x5f6086)break;else _0x3b8fa1['push'](_0x3b8fa1['shift']());}catch(_0x3a1dfc){_0x3b8fa1['push'](_0x3b8fa1['shift']());}}}(a81_0x11d6,0x27e8a));import{HTTPClient}from'./http-client.js';function a81_0x3edb(_0x13437a,_0x261ca2){_0x13437a=_0x13437a-0xaf;const _0x11d64a=a81_0x11d6();let _0x3edb8f=_0x11d64a[_0x13437a];return _0x3edb8f;}import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{['httpClient'];['authHeaders'];constructor(_0x146840){const _0x586d7d=a81_0x3edb,_0x1a8ba6=getEndpoint(_0x146840[_0x586d7d(0xc5)],_0x586d7d(0xb3));this[_0x586d7d(0xe5)]=toHeaderRecord(getAuthHeaders(_0x146840[_0x586d7d(0xc5)],_0x146840[_0x586d7d(0x112)])),this['httpClient']=new HTTPClient(_0x1a8ba6,{...this[_0x586d7d(0xe5)],'Accept':'application/vnd.treasuredata.v1+json','Content-Type':_0x586d7d(0xf9)});}async[a81_0x3b04df(0x113)](){const _0x3dccf5=a81_0x3b04df,_0x134325=_0x3dccf5(0xec),_0x3385f4=await this[_0x3dccf5(0x10f)]['request']('GET',_0x134325);return Array[_0x3dccf5(0xbe)](_0x3385f4)?_0x3385f4:_0x3385f4[_0x3dccf5(0x10c)];}async['getParentSegment'](_0x353974){const _0x160629=a81_0x3b04df,_0x3ddc27=_0x160629(0xb6)+_0x353974,_0x9a46a4=await this['httpClient'][_0x160629(0xff)](_0x160629(0xfa),_0x3ddc27);return'data'in _0x9a46a4?_0x9a46a4['data']:_0x9a46a4;}async[a81_0x3b04df(0x104)](_0x32c43f){const _0x3687ac=a81_0x3b04df,_0x13a604='/audiences/'+_0x32c43f+_0x3687ac(0x108),_0x1baaf=await this[_0x3687ac(0x10f)][_0x3687ac(0xff)]('GET',_0x13a604);return Array[_0x3687ac(0xbe)](_0x1baaf)?_0x1baaf:_0x1baaf['data'];}async[a81_0x3b04df(0xf3)](_0x297e45,_0x53d43e){const _0x2c8621=a81_0x3b04df,_0x16ad4c=_0x2c8621(0xd3)+_0x297e45+'/segments/'+_0x53d43e,_0x4a365e=await this[_0x2c8621(0x10f)]['request'](_0x2c8621(0xfa),_0x16ad4c);return _0x2c8621(0x10c)in _0x4a365e?_0x4a365e[_0x2c8621(0x10c)]:_0x4a365e;}async['listSegmentFolders'](_0x2a54f8){const _0x1d4c05=a81_0x3b04df,_0x42ed65=_0x1d4c05(0xd3)+_0x2a54f8+_0x1d4c05(0xf8),_0x3ba0d8=await this['httpClient'][_0x1d4c05(0xff)](_0x1d4c05(0xfa),_0x42ed65);return Array[_0x1d4c05(0xbe)](_0x3ba0d8)?_0x3ba0d8:_0x3ba0d8[_0x1d4c05(0x10c)];}async[a81_0x3b04df(0xdb)](_0x2567d0){const _0x1cb8f4=a81_0x3b04df,_0x4f257f=_0x1cb8f4(0x116)+_0x2567d0,_0xea0dfe=await this[_0x1cb8f4(0x10f)]['request'](_0x1cb8f4(0xfa),_0x4f257f);return _0x1cb8f4(0x10c)in _0xea0dfe?_0xea0dfe[_0x1cb8f4(0x10c)]:_0xea0dfe;}async[a81_0x3b04df(0xcb)](_0x522cf9,_0x31ef3d=0x20,_0x24aa93=![]){const _0x3cfba1=a81_0x3b04df,_0x449719=_0x3cfba1(0xdf)+_0x522cf9+_0x3cfba1(0xce)+_0x31ef3d+_0x3cfba1(0xcc)+_0x24aa93;return await this['httpClient'][_0x3cfba1(0xff)](_0x3cfba1(0xfa),_0x449719);}async[a81_0x3b04df(0x102)](_0x274627,_0x33d6ec){const _0x3100e9=a81_0x3b04df,_0x31abed=_0x3100e9(0xd3)+_0x274627+'/segments/'+_0x33d6ec+_0x3100e9(0xe3),_0x25412c=await this[_0x3100e9(0x10f)][_0x3100e9(0xff)](_0x3100e9(0xfa),_0x31abed);return Array['isArray'](_0x25412c)?_0x25412c:_0x25412c[_0x3100e9(0x10c)];}async['getActivation'](_0x577e4e,_0x5cdbfa,_0x3d9d85){const _0x1feca0=a81_0x3b04df,_0x35fd43=_0x1feca0(0xd3)+_0x577e4e+_0x1feca0(0xf1)+_0x5cdbfa+'/syndications/'+_0x3d9d85,_0x1fd31b=await this[_0x1feca0(0x10f)][_0x1feca0(0xff)](_0x1feca0(0xfa),_0x35fd43);return _0x1feca0(0x10c)in _0x1fd31b?_0x1fd31b[_0x1feca0(0x10c)]:_0x1fd31b;}async['createActivation'](_0x4d55af,_0x417b49,_0x425370){const _0x5a95af=a81_0x3b04df,_0x2a7891='/audiences/'+_0x4d55af+_0x5a95af(0xf1)+_0x417b49+_0x5a95af(0xe3),_0x60816=await this[_0x5a95af(0x10f)][_0x5a95af(0xff)]('POST',_0x2a7891,{'body':_0x425370});return _0x60816;}async['updateActivation'](_0x5114bb,_0x1ed3b8,_0x221cf2,_0xe2c15c){const _0x558e3f=a81_0x3b04df,_0x401a59=_0x558e3f(0xd3)+_0x5114bb+'/segments/'+_0x1ed3b8+'/syndications/'+_0x221cf2,_0x83ceb0=await this[_0x558e3f(0x10f)]['request'](_0x558e3f(0xe2),_0x401a59,{'body':_0xe2c15c});return _0x83ceb0;}async[a81_0x3b04df(0xe4)](_0x2e7758,_0x23cfe9,_0x28739b){const _0x10cdf8=a81_0x3b04df,_0x595170='/audiences/'+_0x2e7758+_0x10cdf8(0xf1)+_0x23cfe9+'/syndications/'+_0x28739b;await this[_0x10cdf8(0x10f)][_0x10cdf8(0xff)](_0x10cdf8(0xc9),_0x595170);}async[a81_0x3b04df(0xb2)](_0x16d284){const _0x49e5c7=a81_0x3b04df,_0x4e58cd=_0x49e5c7(0xd3)+_0x16d284+_0x49e5c7(0xea),_0x524254=await this[_0x49e5c7(0x10f)][_0x49e5c7(0xff)](_0x49e5c7(0xd5),_0x4e58cd,{'body':{'format':_0x49e5c7(0xeb)}});return _0x524254[_0x49e5c7(0xeb)]||_0x524254[_0x49e5c7(0x115)]||'';}async[a81_0x3b04df(0xb5)](_0x414eaf,_0xeee881){const _0x4a425b=a81_0x3b04df,_0x154d11=await this[_0x4a425b(0xf3)](_0x414eaf,_0xeee881),_0x596c5d={'format':_0x4a425b(0xeb)};_0x4a425b(0xda)in _0x154d11&&_0x154d11[_0x4a425b(0xda)]&&(_0x596c5d[_0x4a425b(0xda)]=_0x154d11[_0x4a425b(0xda)]);const _0x459452=_0x4a425b(0xd3)+_0x414eaf+_0x4a425b(0xea),_0x2dc9cc=await this['httpClient'][_0x4a425b(0xff)](_0x4a425b(0xd5),_0x459452,{'body':_0x596c5d});return _0x2dc9cc['sql']||_0x2dc9cc[_0x4a425b(0x115)]||'';}async[a81_0x3b04df(0x111)](_0x15890f){const _0xdcae9d=a81_0x3b04df,_0x2a1c0b=_0xdcae9d(0xd6),_0x43fb02=await this[_0xdcae9d(0x10f)][_0xdcae9d(0xff)](_0xdcae9d(0xd5),_0x2a1c0b,{'body':_0x15890f,'headers':{'Content-Type':_0xdcae9d(0x110)}});return _0x43fb02;}async[a81_0x3b04df(0xb7)](_0x574eb8,_0x5b8d00){const _0x31723c=a81_0x3b04df,_0x50c9de=_0x31723c(0xd3)+_0x574eb8,_0x4e6f5c=await this[_0x31723c(0x10f)][_0x31723c(0xff)](_0x31723c(0xe2),_0x50c9de,{'body':_0x5b8d00,'headers':{'Content-Type':_0x31723c(0x110)}});return _0x4e6f5c;}async[a81_0x3b04df(0xb0)](_0x44a921){const _0x283950=a81_0x3b04df,_0x1d323d=_0x283950(0xd3)+_0x44a921,_0x288c20=await this[_0x283950(0x10f)][_0x283950(0xff)](_0x283950(0xfa),_0x1d323d,{'headers':{'Accept':'application/vnd.treasuredata.v1+json'}});return _0x288c20;}async['getAudienceAttributes'](_0x497806){const _0x597bae=a81_0x3b04df,_0x2fd661=_0x597bae(0xd3)+_0x497806+_0x597bae(0xde),_0x4c6d1f=await this[_0x597bae(0x10f)][_0x597bae(0xff)](_0x597bae(0xfa),_0x2fd661);return _0x4c6d1f;}async['getAudienceBehaviors'](_0x4b2724,_0x294915){const _0x58f096=a81_0x3b04df;let _0x39019b=_0x58f096(0xd3)+_0x4b2724+_0x58f096(0xfb);_0x294915!==undefined&&(_0x39019b+=_0x58f096(0xfe)+_0x294915);const _0x1fd27d=await this['httpClient'][_0x58f096(0xff)](_0x58f096(0xfa),_0x39019b);return _0x1fd27d;}async[a81_0x3b04df(0x101)](_0x34a948,_0x1e77a7){const _0xe158d9=a81_0x3b04df,_0x387257=_0xe158d9(0xd3)+_0x34a948+_0xe158d9(0x108),_0x3e06e0=await this['httpClient']['request'](_0xe158d9(0xd5),_0x387257,{'body':_0x1e77a7});return _0x3e06e0;}async[a81_0x3b04df(0xfd)](_0x332e82){const _0x40f670=a81_0x3b04df,_0x1cd75e=_0x40f670(0xaf),_0x131178={'type':_0x40f670(0xf2),'attributes':{'name':_0x332e82['name'],'description':_0x332e82[_0x40f670(0xef)]||'','journeyId':_0x332e82[_0x40f670(0xbf)],'rule':_0x332e82[_0x40f670(0xda)],'countPopulation':_0x332e82['countPopulation']??!![]},'relationships':{'parentFolder':{'data':{'id':_0x332e82[_0x40f670(0xed)],'type':_0x40f670(0xf4)}}}},_0x2790f6=await this[_0x40f670(0x10f)][_0x40f670(0xff)](_0x40f670(0xd5),_0x1cd75e,{'body':_0x131178,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x2790f6[_0x40f670(0x10c)]['id'];}async[a81_0x3b04df(0xf0)](_0x2d8516,_0x32d692,_0x25feb8){const _0x32f360=a81_0x3b04df,_0x475f5e=_0x32f360(0xd3)+_0x2d8516+_0x32f360(0xf1)+_0x32d692,_0x5f277c=await this[_0x32f360(0x10f)]['request'](_0x32f360(0xe2),_0x475f5e,{'body':_0x25feb8});return _0x5f277c;}async['deleteSegment'](_0x5e1860){const _0xa89dfe=a81_0x3b04df,_0x3cdd6f='/entities/segments/'+_0x5e1860;await this['httpClient'][_0xa89dfe(0xff)]('DELETE',_0x3cdd6f);}async['createSegmentFolder'](_0xedc9d0,_0x135fa5){const _0x49c024=a81_0x3b04df,_0xf53305=_0x49c024(0xd3)+_0xedc9d0+_0x49c024(0xf8),_0x16355e=await this[_0x49c024(0x10f)][_0x49c024(0xff)](_0x49c024(0xd5),_0xf53305,{'body':_0x135fa5});if(_0x49c024(0x10c)in _0x16355e&&_0x16355e['data']){const _0x5d0d49=_0x16355e[_0x49c024(0x10c)];return{'id':_0x5d0d49['id'],'name':_0x5d0d49[_0x49c024(0xd9)],'description':_0x5d0d49[_0x49c024(0xef)],'audienceId':_0x5d0d49['audienceId']||String(_0xedc9d0),'parentFolderId':_0x5d0d49[_0x49c024(0xed)],'createdAt':_0x5d0d49[_0x49c024(0xc6)],'updatedAt':_0x5d0d49['updatedAt']};}return _0x16355e;}async['runParentSegment'](_0x5d8378){const _0x494a62=a81_0x3b04df,_0x5d2616=_0x494a62(0xd3)+_0x5d8378+'/run',_0x342e81=await this[_0x494a62(0x10f)][_0x494a62(0xff)]('POST',_0x5d2616);return _0x342e81;}async['listJourneys'](_0x3d9754){const _0x100de8=a81_0x3b04df,_0x2dbbcd='/entities/journeys?folder_id='+_0x3d9754,_0x458712=await this[_0x100de8(0x10f)]['request'](_0x100de8(0xfa),_0x2dbbcd);return _0x458712[_0x100de8(0x10c)][_0x100de8(0xb9)](_0x28c819=>({'id':_0x28c819['id'],'name':_0x28c819[_0x100de8(0xf6)][_0x100de8(0xd9)],'journeyBundleName':_0x28c819['attributes'][_0x100de8(0xcf)],'journeyBundleId':_0x28c819[_0x100de8(0xf6)][_0x100de8(0x105)],'versionNumber':_0x28c819['attributes'][_0x100de8(0xc1)],'description':_0x28c819[_0x100de8(0xf6)][_0x100de8(0xef)],'state':_0x28c819[_0x100de8(0xf6)][_0x100de8(0xca)],'paused':_0x28c819['attributes']['paused'],'audienceId':_0x28c819[_0x100de8(0xf6)][_0x100de8(0x106)],'folderId':_0x28c819['relationships']?.[_0x100de8(0xee)]?.['data']?.['id'],'createdAt':_0x28c819[_0x100de8(0xf6)]['createdAt'],'updatedAt':_0x28c819['attributes'][_0x100de8(0xcd)]}));}async[a81_0x3b04df(0xc3)](_0xaffb84){const _0x443a0f=a81_0x3b04df,_0x331172=_0x443a0f(0x10e)+_0xaffb84,_0x2242d0=await this[_0x443a0f(0x10f)][_0x443a0f(0xff)](_0x443a0f(0xfa),_0x331172),_0x3de4b9=new Map();if(_0x2242d0['included'])for(const _0x162ef8 of _0x2242d0[_0x443a0f(0xdd)]){_0x162ef8['type']===_0x443a0f(0xc0)&&_0x3de4b9[_0x443a0f(0x10d)](_0x162ef8['id'],_0x162ef8);}return{'journeys':_0x2242d0[_0x443a0f(0x10c)],'activationStepsById':_0x3de4b9};}async[a81_0x3b04df(0xb4)](_0x3b5adb){const _0x1d9a52=a81_0x3b04df,_0x5876b3='/entities/journeys/'+_0x3b5adb,_0x103fb8=await this[_0x1d9a52(0x10f)][_0x1d9a52(0xff)](_0x1d9a52(0xfa),_0x5876b3);return _0x1d9a52(0x10c)in _0x103fb8?_0x103fb8[_0x1d9a52(0x10c)]:_0x103fb8;}async['createJourney'](_0x3194a4){const _0x5681a6=a81_0x3b04df,_0x38b842=_0x5681a6(0xc4),_0x135a9f=await this[_0x5681a6(0x10f)][_0x5681a6(0xff)](_0x5681a6(0xd5),_0x38b842,{'body':_0x3194a4,'headers':{'Content-Type':_0x5681a6(0x110)}});return _0x5681a6(0x10c)in _0x135a9f?_0x135a9f[_0x5681a6(0x10c)]:_0x135a9f;}async[a81_0x3b04df(0x103)](_0x2003f8,_0xf289ef){const _0x2ee03a=a81_0x3b04df,_0x3588cc=_0x2ee03a(0xb8)+_0x2003f8,_0x195ed3=await this['httpClient'][_0x2ee03a(0xff)]('PATCH',_0x3588cc,{'body':_0xf289ef,'headers':{'Content-Type':_0x2ee03a(0x110)}});return'data'in _0x195ed3?_0x195ed3[_0x2ee03a(0x10c)]:_0x195ed3;}async['updateJourneyDetail'](_0x510811,_0x4f07c1){const _0x493357=a81_0x3b04df,_0x14ffc0=_0x493357(0xb8)+_0x510811+_0x493357(0xd7),_0x1a0c11=await this[_0x493357(0x10f)][_0x493357(0xff)](_0x493357(0xd5),_0x14ffc0,{'body':_0x4f07c1,'headers':{'Content-Type':_0x493357(0x110)}});return _0x493357(0x10c)in _0x1a0c11?_0x1a0c11[_0x493357(0x10c)]:_0x1a0c11;}async['getJourneyStatistics'](_0xdc1fbc){const _0x36d449=a81_0x3b04df,_0x39b3ad=_0x36d449(0xb8)+_0xdc1fbc+_0x36d449(0xe6),_0x4b954f=await this[_0x36d449(0x10f)][_0x36d449(0xff)](_0x36d449(0xfa),_0x39b3ad);return'data'in _0x4b954f?_0x4b954f[_0x36d449(0x10c)]:_0x4b954f;}async[a81_0x3b04df(0xc8)](_0x470c83){const _0x54a3cb=a81_0x3b04df,_0x33856d=_0x54a3cb(0xb8)+_0x470c83+_0x54a3cb(0xc7),_0x2fc319=await this[_0x54a3cb(0x10f)]['request'](_0x54a3cb(0x117),_0x33856d);return _0x54a3cb(0x10c)in _0x2fc319?_0x2fc319[_0x54a3cb(0x10c)]:_0x2fc319;}async['resumeJourney'](_0x47b8e2){const _0xbc6a9b=a81_0x3b04df,_0x41ed26='/entities/journeys/'+_0x47b8e2+_0xbc6a9b(0xd0),_0x441750=await this[_0xbc6a9b(0x10f)][_0xbc6a9b(0xff)](_0xbc6a9b(0x117),_0x41ed26);return _0xbc6a9b(0x10c)in _0x441750?_0x441750['data']:_0x441750;}async[a81_0x3b04df(0xf7)](_0x52c867,_0x54eb9a){const _0x1fef5f=a81_0x3b04df,_0x2b346d=_0x1fef5f(0xb8)+_0x52c867+_0x1fef5f(0xe0)+_0x54eb9a,_0x2e4c63=await this[_0x1fef5f(0x10f)][_0x1fef5f(0xff)]('GET',_0x2b346d);return _0x1fef5f(0x10c)in _0x2e4c63?_0x2e4c63[_0x1fef5f(0x10c)]:_0x2e4c63;}async[a81_0x3b04df(0x114)](_0x29daa6){const _0x4455e8=a81_0x3b04df,_0x167d89=_0x4455e8(0xb8)+_0x29daa6+_0x4455e8(0xbb),_0x358f85=await this[_0x4455e8(0x10f)][_0x4455e8(0xff)]('GET',_0x167d89);return'data'in _0x358f85?_0x358f85[_0x4455e8(0x10c)]:_0x358f85;}async[a81_0x3b04df(0xb1)](_0x4536b1,_0x5b2df3){const _0x4f80c7=a81_0x3b04df,_0x3ee1a3=_0x4f80c7(0xb8)+_0x4536b1+_0x4f80c7(0xbb),_0x21aa17={'name':_0x5b2df3[_0x4f80c7(0xd9)],'scheduleType':_0x5b2df3[_0x4f80c7(0xd8)]||_0x4f80c7(0xfc),'connectionId':String(_0x5b2df3[_0x4f80c7(0x109)]),'columns':_0x5b2df3[_0x4f80c7(0xbc)]??[],'notifyOn':_0x5b2df3[_0x4f80c7(0xf5)]??[],..._0x5b2df3[_0x4f80c7(0xef)]!==undefined&&{'description':_0x5b2df3[_0x4f80c7(0xef)]},..._0x5b2df3[_0x4f80c7(0xe7)]!==undefined&&{'allColumns':_0x5b2df3[_0x4f80c7(0xe7)]},..._0x5b2df3[_0x4f80c7(0xd4)]!==undefined&&{'timezone':_0x5b2df3[_0x4f80c7(0xd4)]},..._0x5b2df3[_0x4f80c7(0xba)]!==undefined&&{'connectorConfig':_0x5b2df3['connectorConfig']},..._0x5b2df3['emailRecipients']!==undefined&&{'emailRecipients':_0x5b2df3[_0x4f80c7(0xe9)]},..._0x5b2df3[_0x4f80c7(0x10a)]!==undefined&&{'activationTemplateId':_0x5b2df3[_0x4f80c7(0x10a)]},..._0x5b2df3[_0x4f80c7(0xbd)]!==undefined&&{'syndicationBehavior':_0x5b2df3[_0x4f80c7(0xbd)]}},_0x73569a=await this[_0x4f80c7(0x10f)][_0x4f80c7(0xff)](_0x4f80c7(0xd5),_0x3ee1a3,{'body':{'type':'journeyActivationStep','attributes':{'activationParams':_0x21aa17}},'headers':{'Content-Type':_0x4f80c7(0x110)}});return _0x4f80c7(0x10c)in _0x73569a?_0x73569a[_0x4f80c7(0x10c)]:_0x73569a;}}function a81_0x11d6(){const _0x7bc72a=['/entities/by-folder/','/activations/','9tLBgln','PUT','/syndications','deleteActivation','authHeaders','/statistics','allColumns','1211260mlwcJY','emailRecipients','/segments/query','sql','/entities/parent_segments','parentFolderId','parentFolder','description','updateSegment','/segments/','segment-journey','getSegment','folder-segment','notifyOn','attributes','getJourneyActivation','/folders','application/json','GET','/behaviors','none','createJourneySegment','?realtime=','request','762520NhoGHa','createSegment','listActivations','updateJourney','listSegments','journeyBundleId','audienceId','1521625SBHguq','/segments','connectionId','activationTemplateId','8691208RGbZmV','data','set','/entities/journeys?folder_id=','httpClient','application/vnd.treasuredata.v1+json','createParentSegment','apiKey','listParentSegments','listJourneyActivations','query','/entities/folders/','PATCH','/entities/segments','getParentSegmentFull','createJourneyActivation','getParentSegmentSQL','cdp','getJourney','getSegmentSQL','/entities/parent_segments/','updateParentSegment','/entities/journeys/','map','connectorConfig','/activations','columns','syndicationBehavior','isArray','journeyId','journeyActivationStep','versionNumber','382182XGSeAn','listJourneysWithDetails','/entities/journeys','site','createdAt','/pause','pauseJourney','DELETE','state','listEntitiesByFolder','&with_rule=','updatedAt','?depth=','journeyBundleName','/resume','33342OAfbdk','125209FpoDDX','/audiences/','timezone','POST','/audiences','/detail','scheduleType','name','rule','getSegmentFolder','38tbWqZm','included','/attributes'];a81_0x11d6=function(){return _0x7bc72a;};return a81_0x11d6();}
@@ -1 +1 @@
1
- const a82_0x45a4a5=a82_0x25be;(function(_0x191bbe,_0x5ef57f){const _0x3c7db9=a82_0x25be,_0x7c96a5=_0x191bbe();while(!![]){try{const _0x2b6947=-parseInt(_0x3c7db9(0x18b))/0x1+-parseInt(_0x3c7db9(0x197))/0x2+-parseInt(_0x3c7db9(0x194))/0x3+parseInt(_0x3c7db9(0x1aa))/0x4*(-parseInt(_0x3c7db9(0x191))/0x5)+-parseInt(_0x3c7db9(0x1be))/0x6*(-parseInt(_0x3c7db9(0x1d1))/0x7)+parseInt(_0x3c7db9(0x196))/0x8+-parseInt(_0x3c7db9(0x1dd))/0x9*(-parseInt(_0x3c7db9(0x1a5))/0xa);if(_0x2b6947===_0x5ef57f)break;else _0x7c96a5['push'](_0x7c96a5['shift']());}catch(_0x417da2){_0x7c96a5['push'](_0x7c96a5['shift']());}}}(a82_0x61d4,0xd56a5));export const TD_ENDPOINTS={'us01':a82_0x45a4a5(0x1c9),'jp01':'https://api.treasuredata.co.jp','eu01':'https://api.eu01.treasuredata.com','ap02':'https://api.ap02.treasuredata.com','ap03':a82_0x45a4a5(0x1df),'dev-us01':'https://api-development.treasuredata.com','dev-eu01':a82_0x45a4a5(0x19b),'stg-us01':'https://api-staging.treasuredata.com','stg-jp01':'https://api-staging.treasuredata.co.jp','stg-ap03':a82_0x45a4a5(0x1d4)};export const CDP_ENDPOINTS={'us01':a82_0x45a4a5(0x18e),'jp01':a82_0x45a4a5(0x1b2),'eu01':a82_0x45a4a5(0x1c7),'ap02':a82_0x45a4a5(0x193),'ap03':'https://api-cdp.ap03.treasuredata.com','dev-us01':'https://api-development-cdp.us01.treasuredata.com','dev-eu01':a82_0x45a4a5(0x1a2),'stg-us01':a82_0x45a4a5(0x1bd),'stg-jp01':a82_0x45a4a5(0x19a),'stg-ap03':a82_0x45a4a5(0x1cf)};export const WORKFLOW_ENDPOINTS={'us01':'https://api-workflow.treasuredata.com','jp01':'https://api-workflow.treasuredata.co.jp','eu01':a82_0x45a4a5(0x1bc),'ap02':a82_0x45a4a5(0x18f),'ap03':a82_0x45a4a5(0x1a6),'dev-us01':a82_0x45a4a5(0x1c4),'dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':'https://api-staging-workflow.us01.treasuredata.com','stg-jp01':a82_0x45a4a5(0x1bf),'stg-ap03':a82_0x45a4a5(0x1b3)};export const TRINO_ENDPOINTS={'us01':a82_0x45a4a5(0x1ca),'jp01':a82_0x45a4a5(0x19d),'eu01':a82_0x45a4a5(0x1da),'ap02':a82_0x45a4a5(0x1b7),'ap03':a82_0x45a4a5(0x1d0),'dev-us01':a82_0x45a4a5(0x192),'dev-eu01':a82_0x45a4a5(0x199),'stg-us01':a82_0x45a4a5(0x1a9),'stg-jp01':a82_0x45a4a5(0x1c8),'stg-ap03':a82_0x45a4a5(0x1bb)};export const LLM_ENDPOINTS={'us01':a82_0x45a4a5(0x1a3),'jp01':a82_0x45a4a5(0x18d),'eu01':a82_0x45a4a5(0x18c),'ap02':a82_0x45a4a5(0x188),'ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':'https://llm-api-development.us01.treasuredata.com','dev-eu01':'https://llm-api-development.eu01.treasuredata.com','stg-us01':a82_0x45a4a5(0x1c0),'stg-jp01':'https://llm-api-staging.treasuredata.co.jp','stg-ap03':a82_0x45a4a5(0x1d7)};export const LLM_PROXY_ENDPOINTS={'us01':'https://llm-proxy.us01.treasuredata.com','jp01':a82_0x45a4a5(0x1d2),'eu01':a82_0x45a4a5(0x1af),'ap02':a82_0x45a4a5(0x19e),'ap03':'https://llm-proxy.ap03.treasuredata.com','dev-us01':a82_0x45a4a5(0x190),'dev-eu01':a82_0x45a4a5(0x1a7),'stg-us01':a82_0x45a4a5(0x1c2),'stg-jp01':'https://llm-proxy-staging.treasuredata.co.jp','stg-ap03':a82_0x45a4a5(0x1a8)};export const ENGAGE_ENDPOINTS={'us01':a82_0x45a4a5(0x1b9),'jp01':a82_0x45a4a5(0x1ab),'eu01':a82_0x45a4a5(0x19c),'ap02':a82_0x45a4a5(0x1b5),'ap03':'https://engage-api.ap03.treasuredata.com','dev-us01':a82_0x45a4a5(0x1c3),'dev-eu01':a82_0x45a4a5(0x1a0),'stg-us01':a82_0x45a4a5(0x1a4),'stg-jp01':a82_0x45a4a5(0x19f),'stg-ap03':'https://engage-api-staging.ap03.treasuredata.com'};export const CONSOLE_ENDPOINTS={'us01':'https://console.treasuredata.com','jp01':a82_0x45a4a5(0x1b1),'eu01':a82_0x45a4a5(0x1ce),'ap02':'https://console.ap02.treasuredata.com','ap03':'https://console.ap03.treasuredata.com','dev-us01':a82_0x45a4a5(0x189),'dev-eu01':'https://console-development.eu01.treasuredata.com','stg-us01':a82_0x45a4a5(0x1ad),'stg-jp01':a82_0x45a4a5(0x1b0),'stg-ap03':a82_0x45a4a5(0x1dc)};export const CONSOLE_NEXT_ENDPOINTS={'us01':a82_0x45a4a5(0x1d9),'jp01':a82_0x45a4a5(0x1de),'eu01':'https://console-next.eu01.treasuredata.com','ap02':a82_0x45a4a5(0x1d8),'ap03':a82_0x45a4a5(0x1cc),'dev-us01':a82_0x45a4a5(0x1d5),'dev-eu01':a82_0x45a4a5(0x195),'stg-us01':a82_0x45a4a5(0x1cd),'stg-jp01':a82_0x45a4a5(0x1d6),'stg-ap03':a82_0x45a4a5(0x1db)};export function getConsoleUrl(_0x3726b5,_0x54bd91){const _0xd9df3e=a82_0x45a4a5,_0x2fa5ad=CONSOLE_ENDPOINTS[_0x3726b5]||_0xd9df3e(0x18a)+_0x3726b5+_0xd9df3e(0x1b4);return _0x54bd91?''+_0x2fa5ad+_0x54bd91:_0x2fa5ad;}export function getConsoleNextUrl(_0x262027,_0x392537){const _0x44a865=a82_0x45a4a5,_0x440a69=CONSOLE_NEXT_ENDPOINTS[_0x262027]||_0x44a865(0x1c5)+_0x262027+_0x44a865(0x1b4);return _0x392537?''+_0x440a69+_0x392537:_0x440a69;}export function getLLMProjectUrl(_0x8ee1d0,_0x239505){const _0x41774a=a82_0x45a4a5;return getConsoleNextUrl(_0x8ee1d0,_0x41774a(0x1a1)+_0x239505+_0x41774a(0x1b6));}export function getLLMAgentChatUrl(_0xe91df1,_0x34f3f1,_0x280a4b){const _0x21a5d2=a82_0x45a4a5;return getConsoleNextUrl(_0xe91df1,_0x21a5d2(0x1a1)+_0x34f3f1+_0x21a5d2(0x1b8)+_0x280a4b+_0x21a5d2(0x1ba));}export function getLLMConversationUrl(_0x32ac5c,_0x2f391d,_0x17e526,_0x549200){const _0x245421=a82_0x45a4a5;return getConsoleNextUrl(_0x32ac5c,'/app/af/'+_0x2f391d+'/ag/'+_0x17e526+_0x245421(0x1cb)+_0x549200);}export function getWorkflowUrl(_0x980cd1,_0x1d5df3){const _0x1e3af9=a82_0x45a4a5;return getConsoleUrl(_0x980cd1,_0x1e3af9(0x1c6)+_0x1d5df3+_0x1e3af9(0x1ae));}export function getWorkflowSessionUrl(_0x11b963,_0x1205c6,_0x3f0f46){const _0xdd4825=a82_0x45a4a5;return getConsoleUrl(_0x11b963,_0xdd4825(0x1c6)+_0x1205c6+_0xdd4825(0x1d3)+_0x3f0f46);}export function getWorkflowAttemptUrl(_0xd3d3b7,_0x2d7d44,_0x5a482f,_0x1f999a){const _0x338fcc=a82_0x45a4a5;return getConsoleUrl(_0xd3d3b7,_0x338fcc(0x1c6)+_0x2d7d44+_0x338fcc(0x1d3)+_0x5a482f+_0x338fcc(0x1ac)+_0x1f999a);}function a82_0x25be(_0x57fb64,_0x1a05e9){_0x57fb64=_0x57fb64-0x188;const _0x61d410=a82_0x61d4();let _0x25be10=_0x61d410[_0x57fb64];return _0x25be10;}function a82_0x61d4(){const _0x38ac39=['https://console-development-next.us01.treasuredata.com','https://console-staging-next.treasuredata.co.jp','https://llm-api-staging.ap03.treasuredata.com','https://console-next.ap02.treasuredata.com','https://console-next.us01.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://console-staging-next.ap03.treasuredata.com','https://console-staging.ap03.treasuredata.com','712161bKCmcs','https://console-next.treasuredata.co.jp','https://api.ap03.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://console-development.treasuredata.com','https://console.','799900SziLQW','https://llm-api.eu01.treasuredata.com','https://llm-api.treasuredata.co.jp','https://api-cdp.treasuredata.com','https://api-workflow.ap02.treasuredata.com','https://llm-proxy-development.us01.treasuredata.com','185aSHGng','https://api-development-presto.treasuredata.com','https://api-cdp.ap02.treasuredata.com','4276308kcPCll','https://console-development-next.eu01.treasuredata.com','286520GuINMV','3300490DNeMWu','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','https://api-development-presto.eu01.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://api-development.eu01.treasuredata.com','https://engage-api.eu01.treasuredata.com','https://api-presto.treasuredata.co.jp','https://llm-proxy.ap02.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','https://engage-api-development.eu01.treasuredata.com','/app/af/','https://api-development-cdp.eu01.treasuredata.com','https://llm-api.treasuredata.com','https://engage-api-staging.us01.treasuredata.com','710BAxqYI','https://api-workflow.ap03.treasuredata.com','https://llm-proxy-development.eu01.treasuredata.com','https://llm-proxy-staging.ap03.treasuredata.com','https://api-staging-presto.treasuredata.com','174400bAikbC','https://engage-api.treasuredata.co.jp','/attempt/','https://console-staging.us01.treasuredata.com','/info','https://llm-proxy.eu01.treasuredata.com','https://console-staging.treasuredata.co.jp','https://console.treasuredata.co.jp','https://api-cdp.treasuredata.co.jp','https://api-staging-workflow.ap03.treasuredata.com','.treasuredata.com','https://engage-api.ap02.treasuredata.com','/ag','https://api-presto.ap02.treasuredata.com','/ag/','https://engage-api.treasuredata.com','/tc','https://api-staging-presto.ap03.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','12WZsoMb','https://api-staging-workflow.treasuredata.co.jp','https://llm-api-staging.us01.treasuredata.com','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://llm-proxy-staging.us01.treasuredata.com','https://engage-api-development.us01.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','https://console-next.','/app/workflows/','https://api-cdp.eu01.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://api.treasuredata.com','https://api-presto.treasuredata.com','/tc/','https://console-next.ap03.treasuredata.com','https://console-staging-next.us01.treasuredata.com','https://console.eu01.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','https://api-presto.ap03.treasuredata.com','2481346UUWOlp','https://llm-proxy.treasuredata.co.jp','/sessions/','https://api-staging.ap03.treasuredata.com'];a82_0x61d4=function(){return _0x38ac39;};return a82_0x61d4();}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS,'llm-proxy':LLM_PROXY_ENDPOINTS};export function getLLMProxyEndpoint(_0x5d0b13){const _0x5cf334=a82_0x45a4a5,_0x2c7be0=LLM_PROXY_ENDPOINTS[_0x5d0b13];if(!_0x2c7be0)throw new Error(_0x5cf334(0x1c1)+_0x5d0b13);return _0x2c7be0;}export function getEndpoint(_0xcc275,_0x1b7f11='td'){const _0x2df259=a82_0x45a4a5,_0x5950a3=API_ENDPOINTS[_0x1b7f11]?.[_0xcc275];if(!_0x5950a3)throw new Error(_0x2df259(0x198)+_0x1b7f11+'\x27\x20and\x20site\x20\x27'+_0xcc275+'\x27');return _0x5950a3;}
1
+ const a82_0x4256ce=a82_0x46b8;function a82_0x46b8(_0x3623c9,_0x10964d){_0x3623c9=_0x3623c9-0x199;const _0x1abc15=a82_0x1abc();let _0x46b89a=_0x1abc15[_0x3623c9];return _0x46b89a;}(function(_0x5f20b8,_0xd902c){const _0x40f1e1=a82_0x46b8,_0x3aa937=_0x5f20b8();while(!![]){try{const _0x209f34=parseInt(_0x40f1e1(0x1d5))/0x1*(parseInt(_0x40f1e1(0x1b7))/0x2)+-parseInt(_0x40f1e1(0x1de))/0x3*(parseInt(_0x40f1e1(0x1b3))/0x4)+-parseInt(_0x40f1e1(0x1be))/0x5+parseInt(_0x40f1e1(0x1e0))/0x6+parseInt(_0x40f1e1(0x1ac))/0x7*(parseInt(_0x40f1e1(0x1c4))/0x8)+-parseInt(_0x40f1e1(0x1c1))/0x9+parseInt(_0x40f1e1(0x1e8))/0xa*(parseInt(_0x40f1e1(0x1bd))/0xb);if(_0x209f34===_0xd902c)break;else _0x3aa937['push'](_0x3aa937['shift']());}catch(_0x261fd2){_0x3aa937['push'](_0x3aa937['shift']());}}}(a82_0x1abc,0xa092c));export const TD_ENDPOINTS={'us01':'https://api.treasuredata.com','jp01':a82_0x4256ce(0x1a4),'eu01':'https://api.eu01.treasuredata.com','ap02':a82_0x4256ce(0x1cc),'ap03':a82_0x4256ce(0x1e4),'dev-us01':'https://api-development.treasuredata.com','dev-eu01':a82_0x4256ce(0x19c),'stg-us01':a82_0x4256ce(0x1d1),'stg-jp01':'https://api-staging.treasuredata.co.jp','stg-ap03':a82_0x4256ce(0x19b)};export const CDP_ENDPOINTS={'us01':a82_0x4256ce(0x1f3),'jp01':a82_0x4256ce(0x1db),'eu01':'https://api-cdp.eu01.treasuredata.com','ap02':a82_0x4256ce(0x1cf),'ap03':'https://api-cdp.ap03.treasuredata.com','dev-us01':a82_0x4256ce(0x1f5),'dev-eu01':a82_0x4256ce(0x1a8),'stg-us01':a82_0x4256ce(0x1bb),'stg-jp01':a82_0x4256ce(0x1e6),'stg-ap03':a82_0x4256ce(0x1c6)};export const WORKFLOW_ENDPOINTS={'us01':a82_0x4256ce(0x1d9),'jp01':a82_0x4256ce(0x1ee),'eu01':a82_0x4256ce(0x1ae),'ap02':a82_0x4256ce(0x199),'ap03':a82_0x4256ce(0x1a1),'dev-us01':a82_0x4256ce(0x1bf),'dev-eu01':a82_0x4256ce(0x1b2),'stg-us01':a82_0x4256ce(0x1e7),'stg-jp01':a82_0x4256ce(0x1d0),'stg-ap03':a82_0x4256ce(0x1d8)};export const TRINO_ENDPOINTS={'us01':a82_0x4256ce(0x1e5),'jp01':a82_0x4256ce(0x1aa),'eu01':a82_0x4256ce(0x19f),'ap02':a82_0x4256ce(0x1b0),'ap03':a82_0x4256ce(0x1da),'dev-us01':a82_0x4256ce(0x1d2),'dev-eu01':a82_0x4256ce(0x1d6),'stg-us01':a82_0x4256ce(0x1ce),'stg-jp01':a82_0x4256ce(0x1dd),'stg-ap03':'https://api-staging-presto.ap03.treasuredata.com'};export const LLM_ENDPOINTS={'us01':a82_0x4256ce(0x1b9),'jp01':a82_0x4256ce(0x1ad),'eu01':'https://llm-api.eu01.treasuredata.com','ap02':a82_0x4256ce(0x1c5),'ap03':a82_0x4256ce(0x1a7),'dev-us01':'https://llm-api-development.us01.treasuredata.com','dev-eu01':a82_0x4256ce(0x1e2),'stg-us01':a82_0x4256ce(0x1e3),'stg-jp01':a82_0x4256ce(0x1f2),'stg-ap03':a82_0x4256ce(0x1ba)};function a82_0x1abc(){const _0x333350=['https://api.ap03.treasuredata.com','https://api-presto.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://api-staging-workflow.us01.treasuredata.com','205900wMNJLD','https://console-development-next.us01.treasuredata.com','https://console-next.treasuredata.co.jp','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','/ag','https://llm-proxy-development.us01.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://console-staging-next.ap03.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://llm-proxy.eu01.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','https://api-cdp.treasuredata.com','https://console-next.eu01.treasuredata.com','https://api-development-cdp.us01.treasuredata.com','https://llm-proxy.ap03.treasuredata.com','/app/workflows/','https://api-workflow.ap02.treasuredata.com','https://engage-api.treasuredata.com','https://api-staging.ap03.treasuredata.com','https://api-development.eu01.treasuredata.com','/ag/','.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://console-staging-next.treasuredata.co.jp','https://api-workflow.ap03.treasuredata.com','\x27\x20and\x20site\x20\x27','https://llm-proxy-development.eu01.treasuredata.com','https://api.treasuredata.co.jp','https://console-staging.treasuredata.co.jp','https://engage-api.ap03.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','https://llm-proxy.ap02.treasuredata.com','https://api-presto.treasuredata.co.jp','https://engage-api-development.eu01.treasuredata.com','688737mtpSwK','https://llm-api.treasuredata.co.jp','https://api-workflow.eu01.treasuredata.com','/tc/','https://api-presto.ap02.treasuredata.com','https://console.treasuredata.co.jp','https://api-development-workflow.eu01.treasuredata.com','3944VKluvh','/info','https://console.','https://console-staging.us01.treasuredata.com','1075766wjpZMg','https://engage-api.ap02.treasuredata.com','https://llm-api.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','https://console-next.ap03.treasuredata.com','1133mpNLBI','3881155FjdkPs','https://api-development-workflow.us01.treasuredata.com','https://console-next.','10188063RGxBrl','https://console-staging-next.us01.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','8sWoZrA','https://llm-api.ap02.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','/app/af/','https://engage-api.treasuredata.co.jp','https://console-next.us01.treasuredata.com','https://console-development.eu01.treasuredata.com','/sessions/','https://api.ap02.treasuredata.com','https://console.treasuredata.com','https://api-staging-presto.treasuredata.com','https://api-cdp.ap02.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','https://api-staging.treasuredata.com','https://api-development-presto.treasuredata.com','https://engage-api.eu01.treasuredata.com','https://llm-proxy-staging.ap03.treasuredata.com','1IBUsSS','https://api-development-presto.eu01.treasuredata.com','/attempt/','https://api-staging-workflow.ap03.treasuredata.com','https://api-workflow.treasuredata.com','https://api-presto.ap03.treasuredata.com','https://api-cdp.treasuredata.co.jp','https://engage-api-staging.us01.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','2985kpzDnc','/tc','4739832IxUEFj','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://llm-api-development.eu01.treasuredata.com','https://llm-api-staging.us01.treasuredata.com'];a82_0x1abc=function(){return _0x333350;};return a82_0x1abc();}export const LLM_PROXY_ENDPOINTS={'us01':'https://llm-proxy.us01.treasuredata.com','jp01':'https://llm-proxy.treasuredata.co.jp','eu01':a82_0x4256ce(0x1f1),'ap02':a82_0x4256ce(0x1a9),'ap03':a82_0x4256ce(0x1f6),'dev-us01':a82_0x4256ce(0x1ed),'dev-eu01':a82_0x4256ce(0x1a3),'stg-us01':'https://llm-proxy-staging.us01.treasuredata.com','stg-jp01':'https://llm-proxy-staging.treasuredata.co.jp','stg-ap03':a82_0x4256ce(0x1d4)};export const ENGAGE_ENDPOINTS={'us01':a82_0x4256ce(0x19a),'jp01':a82_0x4256ce(0x1c8),'eu01':a82_0x4256ce(0x1d3),'ap02':a82_0x4256ce(0x1b8),'ap03':a82_0x4256ce(0x1a6),'dev-us01':'https://engage-api-development.us01.treasuredata.com','dev-eu01':a82_0x4256ce(0x1ab),'stg-us01':a82_0x4256ce(0x1dc),'stg-jp01':a82_0x4256ce(0x1c3),'stg-ap03':a82_0x4256ce(0x1f0)};export const CONSOLE_ENDPOINTS={'us01':a82_0x4256ce(0x1cd),'jp01':a82_0x4256ce(0x1b1),'eu01':'https://console.eu01.treasuredata.com','ap02':'https://console.ap02.treasuredata.com','ap03':'https://console.ap03.treasuredata.com','dev-us01':'https://console-development.treasuredata.com','dev-eu01':a82_0x4256ce(0x1ca),'stg-us01':a82_0x4256ce(0x1b6),'stg-jp01':a82_0x4256ce(0x1a5),'stg-ap03':'https://console-staging.ap03.treasuredata.com'};export const CONSOLE_NEXT_ENDPOINTS={'us01':a82_0x4256ce(0x1c9),'jp01':a82_0x4256ce(0x1ea),'eu01':a82_0x4256ce(0x1f4),'ap02':'https://console-next.ap02.treasuredata.com','ap03':a82_0x4256ce(0x1bc),'dev-us01':a82_0x4256ce(0x1e9),'dev-eu01':'https://console-development-next.eu01.treasuredata.com','stg-us01':a82_0x4256ce(0x1c2),'stg-jp01':a82_0x4256ce(0x1a0),'stg-ap03':a82_0x4256ce(0x1ef)};export function getConsoleUrl(_0xfb33e8,_0x59ae75){const _0x2531c4=a82_0x4256ce,_0x3bedba=CONSOLE_ENDPOINTS[_0xfb33e8]||_0x2531c4(0x1b5)+_0xfb33e8+'.treasuredata.com';return _0x59ae75?''+_0x3bedba+_0x59ae75:_0x3bedba;}export function getConsoleNextUrl(_0x2a6b0f,_0x2e6ffd){const _0x52afb3=a82_0x4256ce,_0x397b8e=CONSOLE_NEXT_ENDPOINTS[_0x2a6b0f]||_0x52afb3(0x1c0)+_0x2a6b0f+_0x52afb3(0x19e);return _0x2e6ffd?''+_0x397b8e+_0x2e6ffd:_0x397b8e;}export function getLLMProjectUrl(_0x27baae,_0x35cecd){const _0x158727=a82_0x4256ce;return getConsoleNextUrl(_0x27baae,_0x158727(0x1c7)+_0x35cecd+_0x158727(0x1ec));}export function getLLMAgentChatUrl(_0x429aa7,_0x3e9edf,_0x51b70d){const _0x1081ce=a82_0x4256ce;return getConsoleNextUrl(_0x429aa7,_0x1081ce(0x1c7)+_0x3e9edf+_0x1081ce(0x19d)+_0x51b70d+_0x1081ce(0x1df));}export function getLLMConversationUrl(_0x1761db,_0x26fc90,_0x1ccfd6,_0x175406){const _0x33a9b8=a82_0x4256ce;return getConsoleNextUrl(_0x1761db,_0x33a9b8(0x1c7)+_0x26fc90+_0x33a9b8(0x19d)+_0x1ccfd6+_0x33a9b8(0x1af)+_0x175406);}export function getWorkflowUrl(_0x23c95b,_0x2e8b18){const _0x390bdc=a82_0x4256ce;return getConsoleUrl(_0x23c95b,_0x390bdc(0x1f7)+_0x2e8b18+_0x390bdc(0x1b4));}export function getWorkflowSessionUrl(_0x39d2d4,_0x3e6737,_0x1b0e51){const _0x53f0c6=a82_0x4256ce;return getConsoleUrl(_0x39d2d4,_0x53f0c6(0x1f7)+_0x3e6737+'/sessions/'+_0x1b0e51);}export function getWorkflowAttemptUrl(_0x13a0f7,_0x2d0c75,_0x5305a7,_0x33303e){const _0x5b0fd0=a82_0x4256ce;return getConsoleUrl(_0x13a0f7,_0x5b0fd0(0x1f7)+_0x2d0c75+_0x5b0fd0(0x1cb)+_0x5305a7+_0x5b0fd0(0x1d7)+_0x33303e);}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS,'llm-proxy':LLM_PROXY_ENDPOINTS};export function getLLMProxyEndpoint(_0xb18de){const _0x4cfe60=a82_0x4256ce,_0x20b2cb=LLM_PROXY_ENDPOINTS[_0xb18de];if(!_0x20b2cb)throw new Error(_0x4cfe60(0x1e1)+_0xb18de);return _0x20b2cb;}export function getEndpoint(_0x59c3a2,_0x4ddbc1='td'){const _0x54f29f=a82_0x4256ce,_0xabf9a0=API_ENDPOINTS[_0x4ddbc1]?.[_0x59c3a2];if(!_0xabf9a0)throw new Error(_0x54f29f(0x1eb)+_0x4ddbc1+_0x54f29f(0x1a2)+_0x59c3a2+'\x27');return _0xabf9a0;}
@@ -1 +1 @@
1
- const a83_0x46c7df=a83_0x1d48;function a83_0x7aab(){const _0x56613e=['page[limit]','emailTemplates','deleteCampaign','DELETE','updateTemplate','include','listTemplates','/api/email_templates/','/pause','sort','createTemplate','filter[owner_user.name]','application/json','listCampaigns','name','limit','/launch','/api/email_templates?','218736MYnwiL','offset','request','1144fEudkK','duplicateCampaign','42KatYlh','apiKey','/api/campaigns?','resumeCampaign','getWorkspace','POST','181251lzwyUp','2914032fQZzkQ','launchCampaign','/api/workspaces/','/resume','campaignType','pauseCampaign','deleteWorkspace','workspaceId','/api/campaigns','updateWorkspace','getTemplate','9053690inFvDA','3228309BnOkpp','campaigns','page[offset]','httpClient','filter[workspaceId]','getCampaign','deleteTemplate','filter[campaignType]','50398uRJcbA','workspaces','PATCH','4870zIZFzN','stringify','ownerName','status','toString','GET','application/vnd.api+json','listWorkspaces','site','77QoJMur','filter[status]','/api/campaigns/','updateCampaign','append','/api/email_templates'];a83_0x7aab=function(){return _0x56613e;};return a83_0x7aab();}(function(_0x26af01,_0x151e79){const _0xed165a=a83_0x1d48,_0x46e9e8=_0x26af01();while(!![]){try{const _0x299460=parseInt(_0xed165a(0x18e))/0x1+parseInt(_0xed165a(0x1a3))/0x2*(parseInt(_0xed165a(0x188))/0x3)+parseInt(_0xed165a(0x1ca))/0x4*(parseInt(_0xed165a(0x1a6))/0x5)+-parseInt(_0xed165a(0x1c7))/0x6*(parseInt(_0xed165a(0x1af))/0x7)+parseInt(_0xed165a(0x18f))/0x8+parseInt(_0xed165a(0x19b))/0x9+-parseInt(_0xed165a(0x19a))/0xa;if(_0x299460===_0x151e79)break;else _0x46e9e8['push'](_0x46e9e8['shift']());}catch(_0x26c3e4){_0x46e9e8['push'](_0x46e9e8['shift']());}}}(a83_0x7aab,0x37f33));function a83_0x1d48(_0x5f335c,_0x5a45ab){_0x5f335c=_0x5f335c-0x187;const _0x7aabe7=a83_0x7aab();let _0x1d486c=_0x7aabe7[_0x5f335c];return _0x1d486c;}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a83_0x46c7df(0x19e)];constructor(_0x39bec8){const _0x5b4090=a83_0x46c7df,_0x5af1b8=getEndpoint(_0x39bec8[_0x5b4090(0x1ae)],'engage'),_0x5c41ba=toHeaderRecord(getAuthHeaders(_0x39bec8[_0x5b4090(0x1ae)],_0x39bec8[_0x5b4090(0x189)]));this[_0x5b4090(0x19e)]=new HTTPClient(_0x5af1b8,_0x5c41ba);}async[a83_0x46c7df(0x1c2)](_0x1c78d6={}){const _0x171e7e=a83_0x46c7df,_0x231df1=new URLSearchParams();_0x1c78d6['campaignType']&&_0x231df1['append'](_0x171e7e(0x1a2),_0x1c78d6[_0x171e7e(0x193)]);_0x1c78d6[_0x171e7e(0x1a9)]&&_0x231df1[_0x171e7e(0x1b3)](_0x171e7e(0x1b0),_0x1c78d6[_0x171e7e(0x1a9)]);_0x1c78d6[_0x171e7e(0x196)]&&_0x231df1['append'](_0x171e7e(0x19f),_0x1c78d6[_0x171e7e(0x196)]);_0x1c78d6[_0x171e7e(0x1c4)]!==undefined&&_0x231df1['append'](_0x171e7e(0x1b5),_0x1c78d6[_0x171e7e(0x1c4)][_0x171e7e(0x1aa)]());_0x1c78d6[_0x171e7e(0x1c8)]!==undefined&&_0x231df1['append'](_0x171e7e(0x19d),_0x1c78d6[_0x171e7e(0x1c8)]['toString']());_0x1c78d6['sort']&&_0x231df1['append'](_0x171e7e(0x1be),_0x1c78d6[_0x171e7e(0x1be)]);_0x1c78d6[_0x171e7e(0x1ba)]&&_0x231df1[_0x171e7e(0x1b3)]('include',_0x1c78d6[_0x171e7e(0x1ba)]);const _0xec7770=_0x231df1['toString'](),_0x1da0c8=_0xec7770?_0x171e7e(0x18a)+_0xec7770:_0x171e7e(0x197);return await this[_0x171e7e(0x19e)]['request'](_0x171e7e(0x1ab),_0x1da0c8,{'headers':{'Accept':_0x171e7e(0x1ac)}});}async[a83_0x46c7df(0x1a0)](_0x24f100){const _0x212295=a83_0x46c7df;return await this[_0x212295(0x19e)]['request'](_0x212295(0x1ab),_0x212295(0x1b1)+encodeURIComponent(_0x24f100),{'headers':{'Accept':_0x212295(0x1ac)}});}async['createCampaign'](_0xe876df){const _0x1c1ec3=a83_0x46c7df,_0x43a50d={'data':{'type':_0x1c1ec3(0x19c),'attributes':_0xe876df}};return await this[_0x1c1ec3(0x19e)][_0x1c1ec3(0x1c9)]('POST',_0x1c1ec3(0x197),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x1c1ec3(0x1ac)},'body':JSON[_0x1c1ec3(0x1a7)](_0x43a50d)});}async[a83_0x46c7df(0x1b2)](_0x224a39,_0x32fa46){const _0x3e425b=a83_0x46c7df,_0x5d0f34={'data':{'type':_0x3e425b(0x19c),'id':_0x224a39,'attributes':_0x32fa46}};return await this['httpClient'][_0x3e425b(0x1c9)]('PATCH','/api/campaigns/'+encodeURIComponent(_0x224a39),{'headers':{'Content-Type':_0x3e425b(0x1ac),'Accept':'application/vnd.api+json'},'body':JSON[_0x3e425b(0x1a7)](_0x5d0f34)});}async[a83_0x46c7df(0x1b7)](_0x37d065){const _0x4a6a16=a83_0x46c7df;await this[_0x4a6a16(0x19e)]['request'](_0x4a6a16(0x1b8),'/api/campaigns/'+encodeURIComponent(_0x37d065),{'headers':{'Accept':_0x4a6a16(0x1ac)}});}async[a83_0x46c7df(0x190)](_0x1cc4af){const _0x21a602=a83_0x46c7df;await this[_0x21a602(0x19e)]['request'](_0x21a602(0x18d),_0x21a602(0x1b1)+encodeURIComponent(_0x1cc4af)+_0x21a602(0x1c5),{'headers':{'Content-Type':_0x21a602(0x1c1),'Accept':_0x21a602(0x1c1)},'body':JSON[_0x21a602(0x1a7)]({})});}async[a83_0x46c7df(0x194)](_0x3803ad){const _0xb617b9=a83_0x46c7df;await this[_0xb617b9(0x19e)][_0xb617b9(0x1c9)](_0xb617b9(0x18d),'/api/campaigns/'+encodeURIComponent(_0x3803ad)+_0xb617b9(0x1bd),{'headers':{'Content-Type':_0xb617b9(0x1c1),'Accept':_0xb617b9(0x1c1)},'body':JSON[_0xb617b9(0x1a7)]({})});}async[a83_0x46c7df(0x18b)](_0x1c4194){const _0x32251a=a83_0x46c7df;await this['httpClient']['request'](_0x32251a(0x18d),'/api/campaigns/'+encodeURIComponent(_0x1c4194)+_0x32251a(0x192),{'headers':{'Content-Type':'application/json','Accept':'application/json'},'body':JSON['stringify']({})});}async[a83_0x46c7df(0x187)](_0x1c30fe){const _0x2e2552=a83_0x46c7df;return await this[_0x2e2552(0x19e)][_0x2e2552(0x1c9)]('POST',_0x2e2552(0x1b1)+encodeURIComponent(_0x1c30fe)+'/duplicate',{'headers':{'Content-Type':_0x2e2552(0x1c1),'Accept':_0x2e2552(0x1ac)},'body':JSON[_0x2e2552(0x1a7)]({})});}async[a83_0x46c7df(0x1bb)](_0x182b16={}){const _0x156ade=a83_0x46c7df,_0x2f6126=new URLSearchParams();_0x182b16[_0x156ade(0x196)]&&_0x2f6126[_0x156ade(0x1b3)](_0x156ade(0x19f),_0x182b16['workspaceId']);_0x182b16[_0x156ade(0x1c4)]!==undefined&&_0x2f6126['append'](_0x156ade(0x1b5),_0x182b16[_0x156ade(0x1c4)]['toString']());_0x182b16[_0x156ade(0x1c8)]!==undefined&&_0x2f6126[_0x156ade(0x1b3)](_0x156ade(0x19d),_0x182b16[_0x156ade(0x1c8)][_0x156ade(0x1aa)]());_0x182b16['sort']&&_0x2f6126[_0x156ade(0x1b3)](_0x156ade(0x1be),_0x182b16[_0x156ade(0x1be)]);const _0x4bb81f=_0x2f6126[_0x156ade(0x1aa)](),_0x136b44=_0x4bb81f?_0x156ade(0x1c6)+_0x4bb81f:'/api/email_templates';return await this[_0x156ade(0x19e)]['request'](_0x156ade(0x1ab),_0x136b44,{'headers':{'Accept':_0x156ade(0x1ac)}});}async[a83_0x46c7df(0x199)](_0x4e1017){const _0x574a7b=a83_0x46c7df;return await this[_0x574a7b(0x19e)][_0x574a7b(0x1c9)]('GET',_0x574a7b(0x1bc)+encodeURIComponent(_0x4e1017),{'headers':{'Accept':'application/vnd.api+json'}});}async[a83_0x46c7df(0x1bf)](_0x2dff5c){const _0x31e63d=a83_0x46c7df,_0x556143={'data':{'type':_0x31e63d(0x1b6),'attributes':_0x2dff5c}};return await this[_0x31e63d(0x19e)][_0x31e63d(0x1c9)](_0x31e63d(0x18d),_0x31e63d(0x1b4),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':JSON[_0x31e63d(0x1a7)](_0x556143)});}async[a83_0x46c7df(0x1b9)](_0x3a6eba,_0x46c36d){const _0xc987e8=a83_0x46c7df,_0x199cad={'data':{'type':_0xc987e8(0x1b6),'id':_0x3a6eba,'attributes':_0x46c36d}};return await this['httpClient']['request']('PATCH',_0xc987e8(0x1bc)+encodeURIComponent(_0x3a6eba),{'headers':{'Content-Type':_0xc987e8(0x1ac),'Accept':'application/vnd.api+json'},'body':JSON[_0xc987e8(0x1a7)](_0x199cad)});}async[a83_0x46c7df(0x1a1)](_0x1260e4){const _0x5106ea=a83_0x46c7df;await this[_0x5106ea(0x19e)][_0x5106ea(0x1c9)](_0x5106ea(0x1b8),_0x5106ea(0x1bc)+encodeURIComponent(_0x1260e4),{'headers':{'Accept':_0x5106ea(0x1ac)}});}async[a83_0x46c7df(0x1ad)](_0x49e6f3={}){const _0x52c619=a83_0x46c7df,_0x191e08=new URLSearchParams();_0x49e6f3[_0x52c619(0x1c3)]&&_0x191e08['append']('filter[name]',_0x49e6f3[_0x52c619(0x1c3)]);_0x49e6f3[_0x52c619(0x1a8)]&&_0x191e08[_0x52c619(0x1b3)](_0x52c619(0x1c0),_0x49e6f3[_0x52c619(0x1a8)]);_0x49e6f3['limit']!==undefined&&_0x191e08[_0x52c619(0x1b3)](_0x52c619(0x1b5),_0x49e6f3['limit'][_0x52c619(0x1aa)]());_0x49e6f3[_0x52c619(0x1c8)]!==undefined&&_0x191e08['append'](_0x52c619(0x19d),_0x49e6f3['offset']['toString']());_0x49e6f3['sort']&&_0x191e08[_0x52c619(0x1b3)](_0x52c619(0x1be),_0x49e6f3[_0x52c619(0x1be)]);const _0x8c3475=_0x191e08['toString'](),_0x5ac06f=_0x8c3475?'/api/workspaces?'+_0x8c3475:'/api/workspaces';return await this[_0x52c619(0x19e)]['request'](_0x52c619(0x1ab),_0x5ac06f,{'headers':{'Accept':_0x52c619(0x1ac)}});}async[a83_0x46c7df(0x18c)](_0x59c53f){const _0x4b89f7=a83_0x46c7df;return await this[_0x4b89f7(0x19e)][_0x4b89f7(0x1c9)]('GET','/api/workspaces/'+encodeURIComponent(_0x59c53f),{'headers':{'Accept':_0x4b89f7(0x1ac)}});}async['createWorkspace'](_0x2a1394){const _0x17f599=a83_0x46c7df,_0x3483bb={'data':{'type':_0x17f599(0x1a4),'attributes':_0x2a1394}};return await this['httpClient'][_0x17f599(0x1c9)](_0x17f599(0x18d),'/api/workspaces',{'headers':{'Content-Type':_0x17f599(0x1ac),'Accept':'application/vnd.api+json'},'body':JSON[_0x17f599(0x1a7)](_0x3483bb)});}async[a83_0x46c7df(0x198)](_0x3149be,_0x51c118){const _0x529835=a83_0x46c7df,_0x38c1b6={'data':{'type':_0x529835(0x1a4),'id':_0x3149be,'attributes':_0x51c118}};return await this[_0x529835(0x19e)][_0x529835(0x1c9)](_0x529835(0x1a5),'/api/workspaces/'+encodeURIComponent(_0x3149be),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x529835(0x1ac)},'body':JSON[_0x529835(0x1a7)](_0x38c1b6)});}async[a83_0x46c7df(0x195)](_0x1c0afc){const _0x40aefd=a83_0x46c7df;await this[_0x40aefd(0x19e)][_0x40aefd(0x1c9)](_0x40aefd(0x1b8),_0x40aefd(0x191)+encodeURIComponent(_0x1c0afc),{'headers':{'Accept':_0x40aefd(0x1ac)}});}}
1
+ const a83_0x1f18a6=a83_0x6d4d;function a83_0x6d4d(_0xbe8a03,_0x22ff14){_0xbe8a03=_0xbe8a03-0x127;const _0x332bae=a83_0x332b();let _0x6d4d4f=_0x332bae[_0xbe8a03];return _0x6d4d4f;}(function(_0x30b8d6,_0x4e69ee){const _0xf5ad5f=a83_0x6d4d,_0x503d04=_0x30b8d6();while(!![]){try{const _0x2eef30=parseInt(_0xf5ad5f(0x142))/0x1*(parseInt(_0xf5ad5f(0x168))/0x2)+parseInt(_0xf5ad5f(0x167))/0x3+parseInt(_0xf5ad5f(0x147))/0x4*(-parseInt(_0xf5ad5f(0x136))/0x5)+parseInt(_0xf5ad5f(0x129))/0x6*(-parseInt(_0xf5ad5f(0x157))/0x7)+-parseInt(_0xf5ad5f(0x154))/0x8*(parseInt(_0xf5ad5f(0x127))/0x9)+parseInt(_0xf5ad5f(0x151))/0xa+parseInt(_0xf5ad5f(0x14e))/0xb;if(_0x2eef30===_0x4e69ee)break;else _0x503d04['push'](_0x503d04['shift']());}catch(_0x1a7825){_0x503d04['push'](_0x503d04['shift']());}}}(a83_0x332b,0xbf9df));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';function a83_0x332b(){const _0x524f47=['createTemplate','createWorkspace','22725868objtQR','/api/email_templates/','emailTemplates','10380430rTZsnd','campaigns','/duplicate','5522560fxhgaB','filter[campaignType]','/pause','3332LwsqME','GET','/api/workspaces','sort','/api/email_templates','updateCampaign','apiKey','status','listTemplates','ownerName','httpClient','filter[status]','stringify','/api/campaigns?','request','deleteWorkspace','2133810BJYrcw','46oVUfUB','/api/campaigns','application/json','/launch','18ClJsJg','engage','9240SpqOxB','/resume','/api/email_templates?','pauseCampaign','getTemplate','getCampaign','application/vnd.api+json','offset','resumeCampaign','toString','PATCH','site','workspaceId','1631890nXEPlC','/api/workspaces?','DELETE','filter[owner_user.name]','page[offset]','/api/workspaces/','/api/campaigns/','updateWorkspace','campaignType','filter[workspaceId]','POST','duplicateCampaign','2712DzQLBv','launchCampaign','page[limit]','getWorkspace','workspaces','12ByLcXS','include','append','limit','listWorkspaces'];a83_0x332b=function(){return _0x524f47;};return a83_0x332b();}import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a83_0x1f18a6(0x161)];constructor(_0x3d8a60){const _0x372258=a83_0x1f18a6,_0x4f938e=getEndpoint(_0x3d8a60['site'],_0x372258(0x128)),_0x1c414a=toHeaderRecord(getAuthHeaders(_0x3d8a60[_0x372258(0x134)],_0x3d8a60[_0x372258(0x15d)]));this[_0x372258(0x161)]=new HTTPClient(_0x4f938e,_0x1c414a);}async['listCampaigns'](_0x1c8a2c={}){const _0x364b09=a83_0x1f18a6,_0x57134a=new URLSearchParams();_0x1c8a2c[_0x364b09(0x13e)]&&_0x57134a[_0x364b09(0x149)](_0x364b09(0x155),_0x1c8a2c[_0x364b09(0x13e)]);_0x1c8a2c[_0x364b09(0x15e)]&&_0x57134a[_0x364b09(0x149)](_0x364b09(0x162),_0x1c8a2c[_0x364b09(0x15e)]);_0x1c8a2c['workspaceId']&&_0x57134a[_0x364b09(0x149)](_0x364b09(0x13f),_0x1c8a2c[_0x364b09(0x135)]);_0x1c8a2c[_0x364b09(0x14a)]!==undefined&&_0x57134a[_0x364b09(0x149)](_0x364b09(0x144),_0x1c8a2c['limit']['toString']());_0x1c8a2c[_0x364b09(0x130)]!==undefined&&_0x57134a[_0x364b09(0x149)](_0x364b09(0x13a),_0x1c8a2c['offset'][_0x364b09(0x132)]());_0x1c8a2c[_0x364b09(0x15a)]&&_0x57134a[_0x364b09(0x149)](_0x364b09(0x15a),_0x1c8a2c[_0x364b09(0x15a)]);_0x1c8a2c[_0x364b09(0x148)]&&_0x57134a[_0x364b09(0x149)](_0x364b09(0x148),_0x1c8a2c['include']);const _0x5dbf5c=_0x57134a[_0x364b09(0x132)](),_0xa75c9d=_0x5dbf5c?_0x364b09(0x164)+_0x5dbf5c:_0x364b09(0x169);return await this['httpClient'][_0x364b09(0x165)](_0x364b09(0x158),_0xa75c9d,{'headers':{'Accept':_0x364b09(0x12f)}});}async[a83_0x1f18a6(0x12e)](_0x2ccb91){const _0x442d6a=a83_0x1f18a6;return await this['httpClient'][_0x442d6a(0x165)]('GET',_0x442d6a(0x13c)+encodeURIComponent(_0x2ccb91),{'headers':{'Accept':_0x442d6a(0x12f)}});}async['createCampaign'](_0x392a86){const _0x4dca3c=a83_0x1f18a6,_0x192907={'data':{'type':_0x4dca3c(0x152),'attributes':_0x392a86}};return await this['httpClient'][_0x4dca3c(0x165)](_0x4dca3c(0x140),_0x4dca3c(0x169),{'headers':{'Content-Type':_0x4dca3c(0x12f),'Accept':'application/vnd.api+json'},'body':JSON[_0x4dca3c(0x163)](_0x192907)});}async[a83_0x1f18a6(0x15c)](_0x4536b0,_0x4ca517){const _0x251b10=a83_0x1f18a6,_0x558c7b={'data':{'type':_0x251b10(0x152),'id':_0x4536b0,'attributes':_0x4ca517}};return await this[_0x251b10(0x161)][_0x251b10(0x165)](_0x251b10(0x133),_0x251b10(0x13c)+encodeURIComponent(_0x4536b0),{'headers':{'Content-Type':_0x251b10(0x12f),'Accept':_0x251b10(0x12f)},'body':JSON[_0x251b10(0x163)](_0x558c7b)});}async['deleteCampaign'](_0x69e221){const _0x20769f=a83_0x1f18a6;await this['httpClient'][_0x20769f(0x165)](_0x20769f(0x138),_0x20769f(0x13c)+encodeURIComponent(_0x69e221),{'headers':{'Accept':_0x20769f(0x12f)}});}async[a83_0x1f18a6(0x143)](_0x49c3f6){const _0x1ba737=a83_0x1f18a6;await this['httpClient'][_0x1ba737(0x165)](_0x1ba737(0x140),_0x1ba737(0x13c)+encodeURIComponent(_0x49c3f6)+_0x1ba737(0x16b),{'headers':{'Content-Type':_0x1ba737(0x16a),'Accept':_0x1ba737(0x16a)},'body':JSON[_0x1ba737(0x163)]({})});}async[a83_0x1f18a6(0x12c)](_0x3cd54b){const _0x512ae9=a83_0x1f18a6;await this['httpClient'][_0x512ae9(0x165)](_0x512ae9(0x140),'/api/campaigns/'+encodeURIComponent(_0x3cd54b)+_0x512ae9(0x156),{'headers':{'Content-Type':_0x512ae9(0x16a),'Accept':'application/json'},'body':JSON[_0x512ae9(0x163)]({})});}async[a83_0x1f18a6(0x131)](_0x47c741){const _0xb4ca85=a83_0x1f18a6;await this['httpClient'][_0xb4ca85(0x165)]('POST',_0xb4ca85(0x13c)+encodeURIComponent(_0x47c741)+_0xb4ca85(0x12a),{'headers':{'Content-Type':_0xb4ca85(0x16a),'Accept':_0xb4ca85(0x16a)},'body':JSON['stringify']({})});}async[a83_0x1f18a6(0x141)](_0x3b3797){const _0x2f0a82=a83_0x1f18a6;return await this['httpClient']['request'](_0x2f0a82(0x140),'/api/campaigns/'+encodeURIComponent(_0x3b3797)+_0x2f0a82(0x153),{'headers':{'Content-Type':_0x2f0a82(0x16a),'Accept':_0x2f0a82(0x12f)},'body':JSON[_0x2f0a82(0x163)]({})});}async[a83_0x1f18a6(0x15f)](_0x23af87={}){const _0x1f3aa3=a83_0x1f18a6,_0x54281a=new URLSearchParams();_0x23af87[_0x1f3aa3(0x135)]&&_0x54281a['append'](_0x1f3aa3(0x13f),_0x23af87['workspaceId']);_0x23af87[_0x1f3aa3(0x14a)]!==undefined&&_0x54281a[_0x1f3aa3(0x149)](_0x1f3aa3(0x144),_0x23af87[_0x1f3aa3(0x14a)]['toString']());_0x23af87['offset']!==undefined&&_0x54281a[_0x1f3aa3(0x149)](_0x1f3aa3(0x13a),_0x23af87[_0x1f3aa3(0x130)][_0x1f3aa3(0x132)]());_0x23af87['sort']&&_0x54281a[_0x1f3aa3(0x149)](_0x1f3aa3(0x15a),_0x23af87[_0x1f3aa3(0x15a)]);const _0x31e66c=_0x54281a[_0x1f3aa3(0x132)](),_0x553f44=_0x31e66c?_0x1f3aa3(0x12b)+_0x31e66c:_0x1f3aa3(0x15b);return await this[_0x1f3aa3(0x161)][_0x1f3aa3(0x165)](_0x1f3aa3(0x158),_0x553f44,{'headers':{'Accept':_0x1f3aa3(0x12f)}});}async[a83_0x1f18a6(0x12d)](_0x4822e8){const _0x77bd2e=a83_0x1f18a6;return await this[_0x77bd2e(0x161)][_0x77bd2e(0x165)](_0x77bd2e(0x158),_0x77bd2e(0x14f)+encodeURIComponent(_0x4822e8),{'headers':{'Accept':_0x77bd2e(0x12f)}});}async[a83_0x1f18a6(0x14c)](_0x2bffd8){const _0x551f14=a83_0x1f18a6,_0x3f9140={'data':{'type':'emailTemplates','attributes':_0x2bffd8}};return await this[_0x551f14(0x161)][_0x551f14(0x165)]('POST',_0x551f14(0x15b),{'headers':{'Content-Type':_0x551f14(0x12f),'Accept':_0x551f14(0x12f)},'body':JSON[_0x551f14(0x163)](_0x3f9140)});}async['updateTemplate'](_0x505421,_0x1bd0a6){const _0x245983=a83_0x1f18a6,_0x412ea4={'data':{'type':_0x245983(0x150),'id':_0x505421,'attributes':_0x1bd0a6}};return await this[_0x245983(0x161)][_0x245983(0x165)]('PATCH',_0x245983(0x14f)+encodeURIComponent(_0x505421),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x245983(0x12f)},'body':JSON[_0x245983(0x163)](_0x412ea4)});}async['deleteTemplate'](_0x2d1cf7){const _0x449115=a83_0x1f18a6;await this[_0x449115(0x161)][_0x449115(0x165)]('DELETE',_0x449115(0x14f)+encodeURIComponent(_0x2d1cf7),{'headers':{'Accept':_0x449115(0x12f)}});}async[a83_0x1f18a6(0x14b)](_0x4fb9cf={}){const _0x20ea73=a83_0x1f18a6,_0x4140b3=new URLSearchParams();_0x4fb9cf['name']&&_0x4140b3[_0x20ea73(0x149)]('filter[name]',_0x4fb9cf['name']);_0x4fb9cf[_0x20ea73(0x160)]&&_0x4140b3[_0x20ea73(0x149)](_0x20ea73(0x139),_0x4fb9cf['ownerName']);_0x4fb9cf[_0x20ea73(0x14a)]!==undefined&&_0x4140b3['append'](_0x20ea73(0x144),_0x4fb9cf[_0x20ea73(0x14a)][_0x20ea73(0x132)]());_0x4fb9cf[_0x20ea73(0x130)]!==undefined&&_0x4140b3[_0x20ea73(0x149)](_0x20ea73(0x13a),_0x4fb9cf[_0x20ea73(0x130)]['toString']());_0x4fb9cf['sort']&&_0x4140b3[_0x20ea73(0x149)](_0x20ea73(0x15a),_0x4fb9cf[_0x20ea73(0x15a)]);const _0x5c000d=_0x4140b3[_0x20ea73(0x132)](),_0x38241e=_0x5c000d?_0x20ea73(0x137)+_0x5c000d:_0x20ea73(0x159);return await this[_0x20ea73(0x161)][_0x20ea73(0x165)](_0x20ea73(0x158),_0x38241e,{'headers':{'Accept':_0x20ea73(0x12f)}});}async[a83_0x1f18a6(0x145)](_0x15aed0){const _0x602d78=a83_0x1f18a6;return await this[_0x602d78(0x161)]['request'](_0x602d78(0x158),'/api/workspaces/'+encodeURIComponent(_0x15aed0),{'headers':{'Accept':_0x602d78(0x12f)}});}async[a83_0x1f18a6(0x14d)](_0x157a0a){const _0x5c2e66=a83_0x1f18a6,_0x5d5dd6={'data':{'type':_0x5c2e66(0x146),'attributes':_0x157a0a}};return await this[_0x5c2e66(0x161)][_0x5c2e66(0x165)](_0x5c2e66(0x140),_0x5c2e66(0x159),{'headers':{'Content-Type':_0x5c2e66(0x12f),'Accept':'application/vnd.api+json'},'body':JSON[_0x5c2e66(0x163)](_0x5d5dd6)});}async[a83_0x1f18a6(0x13d)](_0x2216cc,_0x4757ba){const _0x3336a0=a83_0x1f18a6,_0x4ca2c2={'data':{'type':_0x3336a0(0x146),'id':_0x2216cc,'attributes':_0x4757ba}};return await this[_0x3336a0(0x161)]['request'](_0x3336a0(0x133),_0x3336a0(0x13b)+encodeURIComponent(_0x2216cc),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x3336a0(0x12f)},'body':JSON['stringify'](_0x4ca2c2)});}async[a83_0x1f18a6(0x166)](_0x3cb305){const _0x58edb7=a83_0x1f18a6;await this['httpClient'][_0x58edb7(0x165)]('DELETE',_0x58edb7(0x13b)+encodeURIComponent(_0x3cb305),{'headers':{'Accept':_0x58edb7(0x12f)}});}}