@treasuredata/tdx 2026.3.26 → 2026.3.27

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 (205) 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/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.d.ts.map +1 -1
  65. package/dist/core/oauth.js +1 -1
  66. package/dist/core/oauth.js.map +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/template-pull.js +1 -1
  110. package/dist/sdk/engage/template-push.js +1 -1
  111. package/dist/sdk/engage/template-validator.js +1 -1
  112. package/dist/sdk/engage/template-yaml.js +1 -1
  113. package/dist/sdk/engage/types/campaign-def.js +1 -1
  114. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  115. package/dist/sdk/engage/types/template-schema.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.js +1 -1
  118. package/dist/sdk/index.js +1 -1
  119. package/dist/sdk/io/index.js +1 -1
  120. package/dist/sdk/io/node-filesystem.js +1 -1
  121. package/dist/sdk/job.js +1 -1
  122. package/dist/sdk/journey.js +1 -1
  123. package/dist/sdk/llm/chat-cache.js +1 -1
  124. package/dist/sdk/llm/index.js +1 -1
  125. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  126. package/dist/sdk/llm/model-factors.js +1 -1
  127. package/dist/sdk/personalization.js +1 -1
  128. package/dist/sdk/policy.js +1 -1
  129. package/dist/sdk/query/index.js +1 -1
  130. package/dist/sdk/query/sql-parser.js +1 -1
  131. package/dist/sdk/realtime.js +1 -1
  132. package/dist/sdk/schedule.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.js +1 -1
  137. package/dist/sdk/segment/journey-validator.js +1 -1
  138. package/dist/sdk/segment/journey-yaml.js +1 -1
  139. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  140. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/pull-workflow.js +1 -1
  142. package/dist/sdk/segment/push-recovery.js +1 -1
  143. package/dist/sdk/segment/push-workflow.js +1 -1
  144. package/dist/sdk/segment/resolution-context.js +1 -1
  145. package/dist/sdk/segment/segment-path-parser.js +1 -1
  146. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  147. package/dist/sdk/segment/segment-validator.js +1 -1
  148. package/dist/sdk/segment/target-resolution.js +1 -1
  149. package/dist/sdk/segment/tdx-config.js +1 -1
  150. package/dist/sdk/segment/types/activation-schema.js +1 -1
  151. package/dist/sdk/segment/types/journey-def.js +1 -1
  152. package/dist/sdk/segment/types/journey-schema.js +1 -1
  153. package/dist/sdk/segment/types/segment-def.js +1 -1
  154. package/dist/sdk/segment/types/segment-schema.js +1 -1
  155. package/dist/sdk/segment/validate-files.js +1 -1
  156. package/dist/sdk/segment/yaml-validator.js +1 -1
  157. package/dist/sdk/segment.js +1 -1
  158. package/dist/sdk/types/index.js +1 -1
  159. package/dist/sdk/types/progress.js +1 -1
  160. package/dist/sdk/user.js +1 -1
  161. package/dist/sdk/util/format-detector.js +1 -1
  162. package/dist/sdk/util/formatters.js +1 -1
  163. package/dist/sdk/util/index.js +1 -1
  164. package/dist/sdk/util/paginate.js +1 -1
  165. package/dist/sdk/util/tree-formatter.js +1 -1
  166. package/dist/sdk/workflow/archive-validation.js +1 -1
  167. package/dist/sdk/workflow/clone-workflow.js +1 -1
  168. package/dist/sdk/workflow/index.js +1 -1
  169. package/dist/sdk/workflow/pull-workflow.js +1 -1
  170. package/dist/sdk/workflow/push-workflow.js +1 -1
  171. package/dist/sdk/workflow/tdx-config.js +1 -1
  172. package/dist/sdk/workflow/workflow-utils.js +1 -1
  173. package/dist/test-utils/command-runner.js +1 -1
  174. package/dist/test-utils/factories.js +1 -1
  175. package/dist/test-utils/fixtures.js +1 -1
  176. package/dist/test-utils/http-mock.js +1 -1
  177. package/dist/test-utils/index.js +1 -1
  178. package/dist/utils/async.js +1 -1
  179. package/dist/utils/colors.js +1 -1
  180. package/dist/utils/diff.js +1 -1
  181. package/dist/utils/file-permissions.js +1 -1
  182. package/dist/utils/file-reader.js +1 -1
  183. package/dist/utils/github-releases.js +1 -1
  184. package/dist/utils/global-cache.js +1 -1
  185. package/dist/utils/json-loader.js +1 -1
  186. package/dist/utils/local-cache.js +1 -1
  187. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  188. package/dist/utils/logger/formatters/index.js +1 -1
  189. package/dist/utils/logger/handlers/console-handler.js +1 -1
  190. package/dist/utils/logger/handlers/file-handler.js +1 -1
  191. package/dist/utils/logger/handlers/index.js +1 -1
  192. package/dist/utils/logger/handlers/null-handler.js +1 -1
  193. package/dist/utils/logger/index.js +1 -1
  194. package/dist/utils/logger/logger.js +1 -1
  195. package/dist/utils/logger/types.js +1 -1
  196. package/dist/utils/option-validation.js +1 -1
  197. package/dist/utils/process.js +1 -1
  198. package/dist/utils/prompt.js +1 -1
  199. package/dist/utils/spinner.js +1 -1
  200. package/dist/utils/sse-parser.js +1 -1
  201. package/dist/utils/string-utils.js +1 -1
  202. package/dist/utils/table-ref-parser.js +1 -1
  203. package/dist/utils/tdx-logger.js +1 -1
  204. package/dist/utils/version-check.js +1 -1
  205. package/package.json +1 -1
@@ -1 +1 @@
1
- const a52_0x588e3b=a52_0x353d;(function(_0x3a8c02,_0x5330fd){const _0x482232=a52_0x353d,_0x5d3445=_0x3a8c02();while(!![]){try{const _0x335cae=parseInt(_0x482232(0x19c))/0x1*(-parseInt(_0x482232(0x1d0))/0x2)+-parseInt(_0x482232(0xf8))/0x3+parseInt(_0x482232(0xe8))/0x4*(-parseInt(_0x482232(0x9d))/0x5)+parseInt(_0x482232(0x11c))/0x6+-parseInt(_0x482232(0x1a9))/0x7+parseInt(_0x482232(0x18a))/0x8+parseInt(_0x482232(0x12c))/0x9;if(_0x335cae===_0x5330fd)break;else _0x5d3445['push'](_0x5d3445['shift']());}catch(_0xac1338){_0x5d3445['push'](_0x5d3445['shift']());}}}(a52_0x4562,0x87c72));import a52_0x37d01b from'chalk';import{existsSync}from'fs';import a52_0xf38e1a from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a52_0x4f62b4 from'prompts';function getAttemptStatusDisplay(_0x53e62e){const _0x2d885d=a52_0x353d;if(!_0x53e62e)return{'icon':'⏳','text':''};const {done:_0x455f48,success:_0x191a50,cancelRequested:_0x1f3af0}=_0x53e62e;if(!_0x455f48)return _0x1f3af0?{'icon':'🛑','text':a52_0x37d01b[_0x2d885d(0x201)](_0x2d885d(0x221))}:{'icon':'🔄','text':a52_0x37d01b[_0x2d885d(0x13d)](_0x2d885d(0x150))};if(_0x191a50)return{'icon':'✅','text':a52_0x37d01b[_0x2d885d(0x1b3)](_0x2d885d(0x1e9))};return{'icon':'❌','text':a52_0x37d01b['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x9bd926,_0x5740e8,_0x510af1=0x0){return _0x9bd926[_0x510af1]||_0x5740e8['workflowProject'];}[a52_0x588e3b(0xba)](_0x288178,_0x35003b,_0xf8f3b9=0x0){const _0x41b0c1=a52_0x588e3b,_0x4c8e81=this[_0x41b0c1(0x1aa)](_0x288178,_0x35003b,_0xf8f3b9);if(!_0x4c8e81)return console['error'](a52_0x37d01b['red'](_0x41b0c1(0x162)),'Project\x20name\x20is\x20required'),console[_0x41b0c1(0x14b)](a52_0x37d01b['dim'](_0x41b0c1(0xa3))),null;return _0x4c8e81;}[a52_0x588e3b(0x166)](_0x25a10c,_0x1140cd){const _0x403f7e=a52_0x588e3b;if(_0x25a10c[0x0]){const _0x14774c=_0x25a10c[0x0][_0x403f7e(0x8e)]('.');if(_0x14774c[_0x403f7e(0xfc)]===0x1)return{'projectName':_0x14774c[0x0],'workflowName':undefined};else return _0x14774c[_0x403f7e(0xfc)]===0x2?{'projectName':_0x14774c[0x0],'workflowName':_0x14774c[0x1]}:(console['error'](a52_0x37d01b[_0x403f7e(0x138)](_0x403f7e(0x162)),_0x403f7e(0x18c)),null);}return{'projectName':_0x1140cd[_0x403f7e(0x127)],'workflowName':undefined};}[a52_0x588e3b(0xf5)](_0x169d97,_0x233bbf,_0x2c35cb=0x0){const _0x294946=a52_0x588e3b;if(_0x169d97[_0x2c35cb])return _0x169d97[_0x2c35cb];if(_0x233bbf[_0x294946(0x127)]){const _0x339d6a=a52_0xf38e1a[_0x294946(0x17f)](process[_0x294946(0x12e)](),'workflows',_0x233bbf[_0x294946(0x127)]);if(existsSync(a52_0xf38e1a[_0x294946(0x17f)](_0x339d6a,'tdx.json')))return _0x339d6a;}return undefined;}async[a52_0x588e3b(0xe5)](_0x4f1194,_0x10453c,_0x57985e){const _0x105dec=a52_0x588e3b;try{const _0x52ffda=await _0x4f1194['workflow'][_0x105dec(0xeb)](_0x10453c,{'limit':0x1});if(_0x52ffda['length']>0x0){const _0x917716=_0x52ffda[0x0]['id'],_0x2f2072=getWorkflowUrl(_0x57985e,_0x917716);console[_0x105dec(0x14b)](_0x105dec(0xfb)+a52_0x37d01b[_0x105dec(0xae)](_0x2f2072));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0x145);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x188);async[a52_0x588e3b(0x93)](_0x410421){const _0xb2f2e=a52_0x588e3b,{options:_0x31a117,args:_0x84193,tdx:_0x5894ba}=_0x410421,_0x14fc46=_0x84193[0x0],_0x32d686=_0x31a117[_0xb2f2e(0x18e)];if(_0x32d686)return saveSessionContext({'workflow_project':undefined},_0x31a117['session']),console[_0xb2f2e(0xcf)](a52_0x37d01b[_0xb2f2e(0x1b3)](_0xb2f2e(0xa4))),0x0;if(!_0x14fc46)return console[_0xb2f2e(0x14b)](a52_0x37d01b['red'](_0xb2f2e(0x162)),_0xb2f2e(0x207)),console[_0xb2f2e(0x14b)](a52_0x37d01b[_0xb2f2e(0x126)](_0xb2f2e(0x8b))),console[_0xb2f2e(0x14b)](a52_0x37d01b[_0xb2f2e(0x126)](_0xb2f2e(0x22c))),0x1;const _0x3ea5ee=await withSpinner(_0xb2f2e(0x14f)+_0x14fc46+'\x27...',()=>_0x5894ba['workflow'][_0xb2f2e(0x11d)](_0x14fc46),{'verbose':_0x31a117[_0xb2f2e(0x9a)]}),{name:_0x3bff08}=_0x3ea5ee[_0xb2f2e(0x94)];return saveSessionContext({'workflow_project':_0x3bff08},_0x31a117[_0xb2f2e(0x156)]),console[_0xb2f2e(0xcf)](a52_0x37d01b[_0xb2f2e(0x1b3)](_0xb2f2e(0x1ce)+a52_0x37d01b['cyan'](_0x3bff08))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a52_0x588e3b(0x18d);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x121);async[a52_0x588e3b(0x93)](_0x1e6449){const _0xc6debb=a52_0x588e3b,{options:_0x1e8e93,args:_0x3992b7,tdx:_0x3b0cde}=_0x1e6449,_0x2e67f4=_0x3992b7[0x0];_0x1e8e93[_0xc6debb(0x9a)]&&_0x2e67f4&&console[_0xc6debb(0x14b)](_0xc6debb(0x1db)+_0x2e67f4);const _0x50c884=await withSpinner(_0xc6debb(0x1be),()=>_0x3b0cde[_0xc6debb(0x1ee)][_0xc6debb(0x21e)](_0x2e67f4,{'limit':_0x1e8e93['limit']}),{'verbose':_0x1e8e93[_0xc6debb(0x9a)]});let _0x1ad0e7=_0x50c884['data'];_0x1ad0e7[_0xc6debb(0x107)]((_0x52ca34,_0xb73e09)=>_0x52ca34['name'][_0xc6debb(0x1f6)](_0xb73e09['name']));const _0x530fb3=_0x1e8e93[_0xc6debb(0x1cc)]||0x64,_0x429c09=_0x1ad0e7[_0xc6debb(0xfc)]>=_0x530fb3?a52_0x37d01b[_0xc6debb(0x126)](_0xc6debb(0x132)):'';console[_0xc6debb(0x14b)]('✔\x20Found\x20'+_0x1ad0e7[_0xc6debb(0xfc)]+_0xc6debb(0x12d)+(_0x1ad0e7['length']!==0x1?'s':'')+_0x429c09);if(_0x1e8e93[_0xc6debb(0x14c)]==='json'||_0x1e8e93[_0xc6debb(0x14c)]===_0xc6debb(0x21a)||_0x1e8e93['format']===_0xc6debb(0x20d))await handleSDKOutput(_0x1ad0e7,_0x1e8e93);else{if(_0x1ad0e7[_0xc6debb(0xfc)]===0x0)_0x2e67f4?console['log'](_0xc6debb(0x8a)+_0x2e67f4):console[_0xc6debb(0xcf)]('No\x20workflow\x20projects\x20found');else{const _0x7c048=_0x1ad0e7[_0xc6debb(0x11b)](_0x5df299=>{const _0x1cc4b5=_0xc6debb,_0x59de1a=_0x5df299[_0x1cc4b5(0xb1)]?.[_0x1cc4b5(0x1ff)](_0x287de0=>_0x287de0[_0x1cc4b5(0x19a)]==='sys'),_0x5d8302=_0x59de1a?a52_0x37d01b[_0x1cc4b5(0x126)](_0x1cc4b5(0x10d)):'';return _0x1cc4b5(0xe0)+_0x5df299[_0x1cc4b5(0x158)]+_0x5d8302;});await writeOutput(_0x7c048['join']('\x0a'),_0x1e8e93[_0xc6debb(0x1ad)],_0xc6debb(0xb8));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a52_0x588e3b(0x110);[a52_0x588e3b(0x1f3)]='List\x20workflows';async['execute'](_0x5d35a3){const _0x5b150e=a52_0x588e3b,{options:_0x7c0872,args:_0x456983,tdx:_0x2d77e4}=_0x5d35a3,_0x435f7b=this['resolveProject'](_0x456983,_0x7c0872);_0x7c0872[_0x5b150e(0x9a)]&&_0x435f7b&&console['error']('Project\x20filter:\x20'+_0x435f7b);const _0x41b13c=await withSpinner(_0x5b150e(0x1a8),()=>_0x2d77e4['workflow'][_0x5b150e(0xeb)](_0x435f7b,{'limit':_0x7c0872[_0x5b150e(0x1cc)]}),{'verbose':_0x7c0872[_0x5b150e(0x9a)]});let _0x315c18=_0x41b13c[_0x5b150e(0x94)];_0x315c18[_0x5b150e(0x107)]((_0xe429f1,_0x5c48dd)=>{const _0x2770ba=_0x5b150e,_0x4faf1e=_0xe429f1[_0x2770ba(0x158)][_0x2770ba(0x1f6)](_0x5c48dd[_0x2770ba(0x158)]);if(_0x4faf1e!==0x0)return _0x4faf1e;return(_0xe429f1[_0x2770ba(0xea)]?.[_0x2770ba(0x158)]||'')[_0x2770ba(0x1f6)](_0x5c48dd[_0x2770ba(0xea)]?.['name']||'');});const _0x18fcb3=_0x7c0872[_0x5b150e(0x1cc)]||0x64,_0x4dd12c=_0x315c18['length']>=_0x18fcb3?a52_0x37d01b[_0x5b150e(0x126)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x5b150e(0x14b)](_0x5b150e(0xa1)+_0x315c18[_0x5b150e(0xfc)]+_0x5b150e(0x15d)+(_0x315c18[_0x5b150e(0xfc)]!==0x1?'s':'')+_0x4dd12c);if(_0x7c0872[_0x5b150e(0x14c)]===_0x5b150e(0x189)||_0x7c0872['format']===_0x5b150e(0x21a)||_0x7c0872['format']===_0x5b150e(0x20d))await handleSDKOutput(_0x315c18,_0x7c0872);else{if(_0x315c18['length']===0x0)_0x435f7b?console[_0x5b150e(0xcf)](_0x5b150e(0x1f0)+_0x435f7b):console[_0x5b150e(0xcf)]('No\x20workflows\x20found');else{const _0x2db7f0=_0x7c0872[_0x5b150e(0xa0)],_0x1e4c91=_0x315c18['map'](_0xe1c4c4=>{const _0x5b388b=_0x5b150e,_0xe0eb67=a52_0x37d01b['dim']('#'+_0xe1c4c4['id']),_0x1b377c=hyperlink(_0xe0eb67,getWorkflowUrl(_0x2db7f0,_0xe1c4c4['id'])),_0x31d8e2=_0xe1c4c4[_0x5b388b(0xea)]?.[_0x5b388b(0x158)]?a52_0x37d01b[_0x5b388b(0x126)]('\x20('+_0xe1c4c4[_0x5b388b(0xea)]['name']+')'):'';return'📋\x20'+_0x1b377c+'\x20'+_0xe1c4c4[_0x5b388b(0x158)]+_0x31d8e2;});await writeOutput(_0x1e4c91[_0x5b150e(0x17f)]('\x0a'),_0x7c0872[_0x5b150e(0x1ad)],_0x5b150e(0xb8));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a52_0x588e3b(0x158)]='workflow:sessions';[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x9c);async[a52_0x588e3b(0x93)](_0x32f32b){const _0x59e182=a52_0x588e3b,{options:_0x56401a,args:_0x3157a1,tdx:_0xf3bddd}=_0x32f32b,_0x57e4b0=this[_0x59e182(0x166)](_0x3157a1,_0x56401a);if(!_0x57e4b0)return 0x1;const {projectName:_0x62e219,workflowName:_0x2d4b26}=_0x57e4b0;if(_0x56401a[_0x59e182(0x9a)]){if(_0x62e219&&_0x2d4b26)console[_0x59e182(0x14b)](_0x59e182(0x16e)+_0x62e219+'.'+_0x2d4b26);else _0x62e219&&console[_0x59e182(0x14b)](_0x59e182(0x13a)+_0x62e219);const _0x22b6c6=_0x56401a[_0x59e182(0x99)];_0x22b6c6&&console[_0x59e182(0x14b)](_0x59e182(0x1b0)+_0x22b6c6);}let _0x4bcb59=0x28;if(process[_0x59e182(0x212)]['isTTY']&&!_0x56401a[_0x59e182(0x1ad)]&&!_0x56401a[_0x59e182(0x14c)]){const _0x253ea2=process['stdout'][_0x59e182(0x20c)]||0x28;_0x4bcb59=Math[_0x59e182(0x1c6)](0x14,Math['floor'](_0x253ea2*0x2/0x3));}const _0x4ee3d7=_0x56401a[_0x59e182(0x1cc)]||_0x4bcb59,_0x263d6a=await withSpinner(_0x59e182(0x1b2),()=>_0xf3bddd['workflow'][_0x59e182(0x146)]({'projectName':_0x62e219,'workflowName':_0x2d4b26,'status':_0x56401a[_0x59e182(0x99)],'fromTime':_0x56401a[_0x59e182(0x217)],'toTime':_0x56401a['to'],'limit':_0x4ee3d7}),{'verbose':_0x56401a['verbose']}),_0x55c1ad=_0x263d6a[_0x59e182(0x94)];_0x55c1ad[_0x59e182(0x107)]((_0x268d19,_0x7c35ec)=>{const _0xf9f4af=_0x59e182,_0x495a98=_0x268d19[_0xf9f4af(0x190)]||'',_0x321d37=_0x7c35ec[_0xf9f4af(0x190)]||'';return _0x321d37[_0xf9f4af(0x1f6)](_0x495a98);});_0x55c1ad[_0x59e182(0xfc)]>=_0x4ee3d7?console[_0x59e182(0x14b)](_0x59e182(0xd5)+_0x55c1ad['length']+_0x59e182(0x18f)+a52_0x37d01b[_0x59e182(0x126)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x59e182(0xa1)+_0x55c1ad[_0x59e182(0xfc)]+'\x20session'+(_0x55c1ad[_0x59e182(0xfc)]!==0x1?'s':''));if(_0x56401a[_0x59e182(0x14c)]===_0x59e182(0x189)||_0x56401a[_0x59e182(0x14c)]==='jsonl'||_0x56401a[_0x59e182(0x14c)]===_0x59e182(0x20d))await handleSDKOutput(_0x55c1ad,_0x56401a);else{if(!process[_0x59e182(0x212)][_0x59e182(0xec)]||_0x56401a[_0x59e182(0x1ad)]){if(_0x55c1ad[_0x59e182(0xfc)]===0x0){if(_0x62e219&&_0x2d4b26)console[_0x59e182(0xcf)](_0x59e182(0x102)+_0x62e219+'.'+_0x2d4b26);else _0x62e219?console[_0x59e182(0xcf)](_0x59e182(0x91)+_0x62e219):console[_0x59e182(0xcf)](_0x59e182(0x21c));}else{const _0x35849a=_0x56401a[_0x59e182(0xa0)],_0x23723c=this['renderSessionsTimeline'](_0x55c1ad,_0x35849a);_0x56401a[_0x59e182(0x1ad)]?await writeOutput(_0x23723c,_0x56401a[_0x59e182(0x1ad)],_0x59e182(0xb8)):console['log'](_0x23723c);}!_0x62e219&&(console[_0x59e182(0x14b)](''),console['error'](a52_0x37d01b['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x59e182(0x14b)](a52_0x37d01b['dim'](_0x59e182(0xdc))+'or'+a52_0x37d01b['dim'](_0x59e182(0xcd))));}else{if(_0x55c1ad[_0x59e182(0xfc)]===0x0){if(_0x62e219&&_0x2d4b26)console[_0x59e182(0xcf)](_0x59e182(0x102)+_0x62e219+'.'+_0x2d4b26);else _0x62e219?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x62e219):console[_0x59e182(0xcf)](_0x59e182(0x21c));}else await this[_0x59e182(0xc1)](_0x55c1ad,_0x32f32b,_0x62e219);}}return 0x0;}[a52_0x588e3b(0x1ae)](_0x34d5fd,_0x321af2){const _0x1fc90e=a52_0x588e3b,_0x318f42=[],_0x26b8ea=new Map();let _0x40ea81=Infinity,_0x3e1a11=-Infinity;for(const _0xa8e7d0 of _0x34d5fd){if(_0xa8e7d0[_0x1fc90e(0xca)]?.[_0x1fc90e(0x233)]){const _0x265c02=new Date(_0xa8e7d0['lastAttempt'][_0x1fc90e(0x233)])[_0x1fc90e(0x1f7)](),_0x39decc=_0xa8e7d0[_0x1fc90e(0xca)]['finishedAt']?new Date(_0xa8e7d0[_0x1fc90e(0xca)]['finishedAt'])['getTime']():Date['now'](),_0x1bb159=_0xa8e7d0[_0x1fc90e(0xea)]?.[_0x1fc90e(0x158)]||'(unknown)';!_0x26b8ea[_0x1fc90e(0x122)](_0x1bb159)&&_0x26b8ea[_0x1fc90e(0xb3)](_0x1bb159,[]),_0x26b8ea['get'](_0x1bb159)[_0x1fc90e(0x195)]({'session':_0xa8e7d0,'startTime':_0x265c02,'endTime':_0x39decc,'duration':_0x39decc-_0x265c02}),_0x40ea81=Math[_0x1fc90e(0x200)](_0x40ea81,_0x265c02),_0x3e1a11=Math[_0x1fc90e(0x1c6)](_0x3e1a11,_0x39decc);}}if(_0x26b8ea['size']===0x0)return _0x1fc90e(0x157);const _0x4cd7a0=process[_0x1fc90e(0x212)]['columns']||0x78,_0x5452fb=0x1e,_0x3e020a=0x32,_0xa6c3f=0x4,_0x367078=Math[_0x1fc90e(0x200)](_0x3e020a,Math[_0x1fc90e(0x1c6)](_0x5452fb,Math[_0x1fc90e(0x123)](_0x4cd7a0*0.3))),_0x41c961=_0x4cd7a0-_0x367078-TIMELINE_CONFIG['GUTTER']-0x3-_0xa6c3f,_0x5e50e2=_0x3e1a11-_0x40ea81,_0x3c916a=_0x5e50e2/_0x367078,_0x5280f9=renderTimeAxis({'startTime':_0x40ea81,'endTime':_0x3e1a11,'durationMs':_0x5e50e2,'msPerChar':_0x3c916a},_0x367078),_0x5abe36=[];for(const _0x549192 of _0x26b8ea[_0x1fc90e(0x17d)]()){_0x5abe36[_0x1fc90e(0x195)](..._0x549192);}_0x5abe36['sort']((_0x4f8c1d,_0x31c0ce)=>_0x31c0ce[_0x1fc90e(0x215)]-_0x4f8c1d['startTime']);const _0x52611a=new Date(_0x40ea81),_0x3dda58=formatDate(_0x52611a),_0x2ab661=_0xa6c3f+TIMELINE_CONFIG[_0x1fc90e(0x15f)]+TIMELINE_CONFIG[_0x1fc90e(0x8d)]+_0x41c961,_0x59e156='\x20'['repeat'](_0x2ab661-_0x3dda58[_0x1fc90e(0xfc)]),_0x39a9ca=_0x59e156+a52_0x37d01b['dim'](_0x3dda58)+'\x20'+_0x5280f9;_0x318f42[_0x1fc90e(0x195)](_0x39a9ca);const _0x1faaa1=0x16;let _0x4c69b7=0x0;for(const _0x183e86 of _0x5abe36){const _0x4a3f26=_0x183e86[_0x1fc90e(0x156)]['project']?.[_0x1fc90e(0x158)]||'?',_0x3ea7bc=Math[_0x1fc90e(0x200)](stringWidth(_0x4a3f26),_0x1faaa1);_0x4c69b7=Math[_0x1fc90e(0x1c6)](_0x4c69b7,_0x3ea7bc);}for(const _0x4ab66e of _0x5abe36){const {session:_0x2692fd,startTime:_0x5d20dc,endTime:_0x572089,duration:_0x539a9b}=_0x4ab66e,_0x45a2f5=_0x2692fd[_0x1fc90e(0xea)]?.['id'],_0xb9b9b8=_0x2692fd['id'],_0x1d6edd=_0x2692fd['project']?.[_0x1fc90e(0x158)]||'?',_0x133014=_0x2692fd['workflow']?.[_0x1fc90e(0x158)]||'?';let _0x424cd0,_0x461bec;if(_0x2692fd[_0x1fc90e(0xca)]){const _0x26ea1d=_0x2692fd[_0x1fc90e(0xca)];!_0x26ea1d['done']?(_0x424cd0=_0x26ea1d['cancelRequested']?'🛑':'🔄',_0x461bec=_0x26ea1d[_0x1fc90e(0x1c4)]?a52_0x37d01b[_0x1fc90e(0x201)]:a52_0x37d01b[_0x1fc90e(0x13d)]):(_0x424cd0=_0x26ea1d[_0x1fc90e(0x1e9)]?'✅':'❌',_0x461bec=_0x26ea1d[_0x1fc90e(0x1e9)]?a52_0x37d01b[_0x1fc90e(0x1b3)]:a52_0x37d01b['red']);}else _0x424cd0='⏳',_0x461bec=a52_0x37d01b[_0x1fc90e(0x126)];const _0x328846='#'+_0xb9b9b8,_0x152dc0=_0x45a2f5?hyperlink(_0x328846,getWorkflowSessionUrl(_0x321af2,_0x45a2f5,_0xb9b9b8)):_0x328846;let _0x1c0c03=_0x1d6edd;stringWidth(_0x1d6edd)>_0x1faaa1&&(_0x1c0c03=_0x1d6edd[_0x1fc90e(0x181)](0x0,_0x1faaa1-0x1)+'…');const _0x89f087=a52_0x37d01b[_0x1fc90e(0x126)](_0x1c0c03),_0x19bac4=stringWidth(_0x1c0c03),_0x34cbfd='\x20'[_0x1fc90e(0x1c1)](_0x4c69b7-stringWidth(_0x1c0c03)+0x2),_0x3008d0='('+formatElapsed(_0x539a9b)+')',_0x4db77c=stringWidth(_0x3008d0),_0x3047a8=stringWidth(_0x328846),_0x2b617c=_0x3047a8+0x1+_0x19bac4+_0x34cbfd[_0x1fc90e(0xfc)],_0x500959=_0x41c961-_0x2b617c-_0x4db77c-0x1-0x8;let _0x35be21=_0x133014;stringWidth(_0x35be21)>_0x500959&&(_0x35be21=_0x35be21[_0x1fc90e(0x181)](0x0,_0x500959-0x1)+'…');const _0x2a02d9=_0x152dc0+'\x20'+_0x89f087+_0x34cbfd+_0x35be21,_0x3c2e91=stringWidth(_0x2a02d9),_0x457aaf=_0x41c961-_0x3c2e91-_0x4db77c,_0x4b9f57=_0x2a02d9+'\x20'['repeat'](Math[_0x1fc90e(0x1c6)](0x1,_0x457aaf))+a52_0x37d01b[_0x1fc90e(0x126)](_0x3008d0),_0x10b6f9=Math[_0x1fc90e(0x123)]((_0x5d20dc-_0x40ea81)/_0x3c916a),_0x1384aa=Math['floor']((_0x572089-_0x40ea81)/_0x3c916a),_0x53f947=Math[_0x1fc90e(0x1c6)](_0x10b6f9+0x1,_0x1384aa),_0xc4a60=new Array(_0x367078)[_0x1fc90e(0xa5)]('\x20');for(let _0x42f343=_0x10b6f9;_0x42f343<Math['min'](_0x53f947,_0x367078);_0x42f343++){_0xc4a60[_0x42f343]='─';}const _0x381527=_0xc4a60['map'](_0x46652e=>_0x46652e==='\x20'?'\x20':_0x461bec(_0x46652e))['join']('');_0x318f42[_0x1fc90e(0x195)](_0x424cd0+'\x20'+_0x4b9f57+'│'+_0x381527+'│');}return _0x318f42[_0x1fc90e(0x17f)]('\x0a');}async[a52_0x588e3b(0xc1)](_0x3ae631,_0x52ff43,_0x25c2b6){const _0x4fb1cf=a52_0x588e3b,{options:_0x325d1d,tdx:_0x4d55b5}=_0x52ff43,_0x3cc6b7=_0x325d1d[_0x4fb1cf(0xa0)],{timelineRows:_0xb9a2ee,timeAxisHeader:_0xd348fc}=this[_0x4fb1cf(0x100)](_0x3ae631,_0x3cc6b7),_0x3143f7=_0xb9a2ee[_0x4fb1cf(0xce)](_0x30d52e=>_0x30d52e['attemptId']);if(_0x3143f7['length']===0x0){const _0x3c3347=this['renderSessionsTimeline'](_0x3ae631,_0x3cc6b7);console['log'](_0x3c3347);!_0x25c2b6&&(console[_0x4fb1cf(0x14b)](''),console[_0x4fb1cf(0x14b)](a52_0x37d01b[_0x4fb1cf(0x126)](_0x4fb1cf(0x1d5))),console[_0x4fb1cf(0x14b)](a52_0x37d01b[_0x4fb1cf(0x126)](_0x4fb1cf(0xdc))+'or'+a52_0x37d01b[_0x4fb1cf(0x126)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xd348fc&&console[_0x4fb1cf(0xcf)](_0xd348fc);const _0x8c7ca6=_0xb9a2ee[_0x4fb1cf(0xce)](_0x295239=>_0x295239['attemptId'])['map'](_0x563fd7=>({'title':_0x563fd7['displayLine'],'value':_0x563fd7['attemptId']})),_0x2772bd=process[_0x4fb1cf(0x212)][_0x4fb1cf(0x20c)]||0x3c,_0x25443d=Math[_0x4fb1cf(0x1c6)](0x28,Math[_0x4fb1cf(0x123)](_0x2772bd*0x2/0x3)),_0x56f4d2=await a52_0x4f62b4({'type':_0x4fb1cf(0x21f),'name':_0x4fb1cf(0x1f4),'message':_0x4fb1cf(0x1d6),'choices':_0x8c7ca6,'initial':-0x1,'limit':_0x25443d,'clearFirst':!![],'fallback':{'title':_0x4fb1cf(0x1d3),'value':null},'suggest':(_0x559a6d,_0x390aeb)=>{const _0x430169=_0x4fb1cf;if(!_0x559a6d)return Promise[_0x430169(0x142)](_0x390aeb);const _0x58f342=_0x390aeb[_0x430169(0xce)](_0x4066e8=>{const _0x404b5a=_0x430169,_0x106995=_0x4066e8;return _0x106995[_0x404b5a(0x90)][_0x404b5a(0x1b8)]()[_0x404b5a(0x111)](_0x559a6d[_0x404b5a(0x1b8)]());});return Promise['resolve'](_0x58f342);}}),_0x3712c3=()=>{const _0x18bc13=_0x4fb1cf;process[_0x18bc13(0x212)][_0x18bc13(0x89)]('\x1b[1A\x1b[2K'),process[_0x18bc13(0x212)]['write'](_0x18bc13(0x222)),process['stdout']['write'](_0x18bc13(0x222));},_0x54ce91=_0x56f4d2&&_0x56f4d2[_0x4fb1cf(0x1f4)]&&_0x56f4d2[_0x4fb1cf(0x1f4)]!==null&&_0x56f4d2[_0x4fb1cf(0x1f4)][_0x4fb1cf(0xa9)]()!=='';if(!_0x54ce91){_0x3712c3(),console[_0x4fb1cf(0xcf)](a52_0x37d01b[_0x4fb1cf(0x126)]('Cancelled'));return;}_0x3712c3();const _0x5a9a93=_0x3ae631['find'](_0x2bfecd=>_0x2bfecd[_0x4fb1cf(0xca)]?.['id']===_0x56f4d2[_0x4fb1cf(0x1f4)]);if(_0x5a9a93){const _0x25c3b2=_0x5a9a93[_0x4fb1cf(0xea)]?.['name']||'?',_0x39776f=_0x5a9a93[_0x4fb1cf(0x1ee)]?.[_0x4fb1cf(0x158)]||'?';console[_0x4fb1cf(0xcf)](_0x4fb1cf(0x1f1)+a52_0x37d01b[_0x4fb1cf(0x126)](_0x25c3b2)+_0x4fb1cf(0x1e2)+a52_0x37d01b[_0x4fb1cf(0x126)](_0x39776f));}const _0x420aba=new WorkflowTimelineCommand();await _0x420aba[_0x4fb1cf(0x93)]({'args':[],'options':{..._0x325d1d,'attemptId':_0x56f4d2['attemptId']},'tdx':_0x4d55b5});}[a52_0x588e3b(0x100)](_0x5d6aa4,_0x486f9b){const _0x2615d5=a52_0x588e3b,_0x5eaa41=new Map();for(const _0x3f5a1d of _0x5d6aa4){_0x3f5a1d['id']&&_0x3f5a1d[_0x2615d5(0xca)]?.['id']&&_0x5eaa41[_0x2615d5(0xb3)](_0x3f5a1d['id'],_0x3f5a1d[_0x2615d5(0xca)]['id']);}const _0x5ec9de=[];let _0x444df6='';const _0x34487b=this[_0x2615d5(0x1ae)](_0x5d6aa4,_0x486f9b),_0x7b6330=_0x34487b['split']('\x0a');for(const _0xf2f2f0 of _0x7b6330){if(_0xf2f2f0[_0x2615d5(0xed)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0xf2f2f0[_0x2615d5(0x22f)](/^\s+\d{4}-\d{2}-\d{2}/))_0x444df6=_0xf2f2f0;else{if(_0xf2f2f0[_0x2615d5(0x22f)](/^[✅❌🔄🛑⏳]/)){const _0x29176b=_0xf2f2f0[_0x2615d5(0x22f)](/#(\d+)/),_0x441a25=_0x29176b?_0x29176b[0x1]:null,_0x2b3d87=_0x441a25?_0x5eaa41[_0x2615d5(0x187)](_0x441a25)||null:null,_0x342ad3=_0x5d6aa4[_0x2615d5(0xc9)](_0x67be2=>_0x67be2['id']===_0x441a25),_0x393a9f=_0x342ad3?.[_0x2615d5(0xea)]?.['name']||'';_0x5ec9de['push']({'displayLine':_0xf2f2f0,'attemptId':_0x2b3d87,'projectName':_0x393a9f});}}}return{'timelineRows':_0x5ec9de,'timeAxisHeader':_0x444df6};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a52_0x588e3b(0x158)]='workflow:attempts';[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x194);async['execute'](_0x190a77){const _0x5f03fa=a52_0x588e3b,{options:_0x4b9b43,args:_0x1e4902,tdx:_0x4f498e}=_0x190a77,_0x470d22=this[_0x5f03fa(0x166)](_0x1e4902,_0x4b9b43);if(!_0x470d22)return 0x1;const {projectName:_0x1dd90b,workflowName:_0x421632}=_0x470d22,_0x35fe50=_0x4b9b43[_0x5f03fa(0xa7)];if(_0x4b9b43[_0x5f03fa(0x9a)]){if(_0x1dd90b&&_0x421632)console[_0x5f03fa(0x14b)](_0x5f03fa(0x16e)+_0x1dd90b+'.'+_0x421632);else _0x1dd90b&&console[_0x5f03fa(0x14b)]('Filter:\x20project='+_0x1dd90b);_0x35fe50&&console['error']('Include\x20retried:\x20yes');}const _0x444672=await withSpinner(_0x5f03fa(0x229),()=>_0x4f498e['workflow'][_0x5f03fa(0x1ec)]({'projectName':_0x1dd90b,'workflowName':_0x421632,'includeRetried':_0x35fe50,'limit':_0x4b9b43[_0x5f03fa(0x1cc)]}),{'verbose':_0x4b9b43['verbose']}),_0xbb1be4=_0x444672[_0x5f03fa(0x94)],_0x3264c4=_0x4b9b43[_0x5f03fa(0x1cc)]||0x64,_0x17e4de=_0xbb1be4[_0x5f03fa(0xfc)]>=_0x3264c4?a52_0x37d01b[_0x5f03fa(0x126)](_0x5f03fa(0x132)):'';console[_0x5f03fa(0x14b)](_0x5f03fa(0xa1)+_0xbb1be4[_0x5f03fa(0xfc)]+'\x20attempt'+(_0xbb1be4[_0x5f03fa(0xfc)]!==0x1?'s':'')+_0x17e4de);if(_0x4b9b43['format']===_0x5f03fa(0x189)||_0x4b9b43[_0x5f03fa(0x14c)]===_0x5f03fa(0x21a)||_0x4b9b43[_0x5f03fa(0x14c)]==='table')await handleSDKOutput(_0xbb1be4,_0x4b9b43);else{if(_0xbb1be4['length']===0x0){if(_0x1dd90b&&_0x421632)console['log'](_0x5f03fa(0x137)+_0x1dd90b+'.'+_0x421632);else _0x1dd90b?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x1dd90b):console[_0x5f03fa(0xcf)](_0x5f03fa(0x230));}else{const _0x413240=_0x4b9b43[_0x5f03fa(0xa0)],_0x18085b=_0xbb1be4[_0x5f03fa(0x11b)](_0x259b64=>{const _0x2acd13=_0x5f03fa,_0x4a1d1d=a52_0x37d01b[_0x2acd13(0x126)]('#'+_0x259b64['id']),_0x3de71a=_0x259b64[_0x2acd13(0xea)]?.['id'],_0x4d999d=_0x259b64[_0x2acd13(0xcc)]||_0x259b64[_0x2acd13(0xe6)],_0x3755e9=_0x3de71a&&_0x4d999d?hyperlink(_0x4a1d1d,getWorkflowAttemptUrl(_0x413240,_0x3de71a,_0x4d999d,_0x259b64['id'])):_0x4a1d1d,{icon:_0x1244d2,text:_0x53a95f}=getAttemptStatusDisplay(_0x259b64),_0x2f1ca0=(_0x259b64[_0x2acd13(0xea)]?.['name']||'?')+'.'+(_0x259b64[_0x2acd13(0x1ee)]?.[_0x2acd13(0x158)]||'?'),_0x468671=_0x259b64[_0x2acd13(0x190)]?a52_0x37d01b[_0x2acd13(0x126)](_0x259b64[_0x2acd13(0x190)]):'';return(_0x3755e9+'\x20'+_0x1244d2+(_0x53a95f?'\x20'+_0x53a95f:'')+'\x20'+_0x2f1ca0+'\x20'+_0x468671)[_0x2acd13(0xc0)]();});await writeOutput(_0x18085b[_0x5f03fa(0x17f)]('\x0a'),_0x4b9b43['output'],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0x169);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x168);async[a52_0x588e3b(0x93)](_0x6fe947){const _0x37681f=a52_0x588e3b,{options:_0x41cb21,args:_0x2633f4,tdx:_0x5b06b9}=_0x6fe947,_0x215340=_0x2633f4[0x0];if(!_0x215340)return console[_0x37681f(0x14b)](_0x37681f(0x1a7)),0x1;_0x41cb21[_0x37681f(0x9a)]&&console[_0x37681f(0x14b)](_0x37681f(0xfd)+_0x215340);const _0x12f8cf=await withSpinner('Getting\x20attempt\x20details...',()=>_0x5b06b9[_0x37681f(0x1ee)][_0x37681f(0x1d9)](_0x215340),{'verbose':_0x41cb21['verbose']}),_0x2596e9=_0x12f8cf[_0x37681f(0x94)];let _0x3b44c9;!_0x2596e9[_0x37681f(0x180)]?_0x3b44c9=_0x2596e9[_0x37681f(0x1c4)]?_0x37681f(0x221):_0x37681f(0x150):_0x3b44c9=_0x2596e9[_0x37681f(0x1e9)]?_0x37681f(0x1e9):'error';let _0x2dec1b;if(_0x2596e9[_0x37681f(0x233)]&&_0x2596e9[_0x37681f(0x202)]){const _0x37e9a8=new Date(_0x2596e9[_0x37681f(0x233)])[_0x37681f(0x1f7)](),_0x367060=new Date(_0x2596e9['finishedAt'])[_0x37681f(0x1f7)]();_0x2dec1b=Math['round']((_0x367060-_0x37e9a8)/0x3e8);}const _0x3197a4={'attempt_id':_0x2596e9['id'],'status':_0x3b44c9,..._0x2596e9['index']!==undefined&&{'index':_0x2596e9[_0x37681f(0x197)]},..._0x2596e9[_0x37681f(0xea)]&&{'project':_0x2596e9[_0x37681f(0xea)][_0x37681f(0x158)]},..._0x2596e9['workflow']&&{'workflow':_0x2596e9[_0x37681f(0x1ee)][_0x37681f(0x158)]},..._0x2596e9[_0x37681f(0xe6)]&&{'session_id':_0x2596e9[_0x37681f(0xe6)]},..._0x2596e9[_0x37681f(0x190)]&&{'session_time':_0x2596e9[_0x37681f(0x190)]},..._0x2596e9[_0x37681f(0x22e)]&&{'retry_attempt':_0x2596e9[_0x37681f(0x22e)]},..._0x2dec1b!==undefined&&{'duration_sec':_0x2dec1b},..._0x2596e9[_0x37681f(0x233)]&&{'created_at':_0x2596e9[_0x37681f(0x233)]},..._0x2596e9[_0x37681f(0x202)]&&{'finished_at':_0x2596e9[_0x37681f(0x202)]},...Object['keys'](_0x2596e9[_0x37681f(0x98)])[_0x37681f(0xfc)]>0x0&&{'params':_0x2596e9[_0x37681f(0x98)]}};return await handleSingleObjectOutput(_0x3197a4,_0x41cb21),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0x96);[a52_0x588e3b(0x1f3)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x1f4d78){const _0x5bfd6e=a52_0x588e3b,{options:_0x192d25,args:_0x4e9c52,tdx:_0x1c4a2d}=_0x1f4d78,_0x4b64a3=_0x4e9c52[0x0];if(!_0x4b64a3)return console[_0x5bfd6e(0x14b)](_0x5bfd6e(0x1a7)),0x1;const _0x22ead8=_0x192d25['includeSubtasks'];_0x192d25['verbose']&&(console[_0x5bfd6e(0x14b)](_0x5bfd6e(0xfd)+_0x4b64a3),_0x22ead8&&console[_0x5bfd6e(0x14b)](_0x5bfd6e(0xf6)));const _0x39d7db=await withSpinner(_0x5bfd6e(0x167),()=>_0x1c4a2d['workflow'][_0x5bfd6e(0x15b)](_0x4b64a3,_0x22ead8||![]),{'verbose':_0x192d25[_0x5bfd6e(0x9a)]}),_0x41126b=_0x39d7db[_0x5bfd6e(0x94)];return console[_0x5bfd6e(0x14b)](_0x5bfd6e(0xa1)+_0x41126b[_0x5bfd6e(0xfc)]+'\x20task'+(_0x41126b[_0x5bfd6e(0xfc)]!==0x1?'s':'')),await handleSDKOutput(_0x41126b,_0x192d25),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a52_0x588e3b(0xbd);['description']=a52_0x588e3b(0x136);async['execute'](_0x4352ff){const _0x17019f=a52_0x588e3b,{options:_0x1a6024,args:_0x5ba3ed,tdx:_0x58c65e}=_0x4352ff,_0x4ff203=_0x5ba3ed[0x0];let _0xc752f6=_0x5ba3ed[0x1];if(!_0x4ff203)return console[_0x17019f(0x14b)](_0x17019f(0x1a7)),0x1;_0x1a6024[_0x17019f(0x9a)]&&(console[_0x17019f(0x14b)](_0x17019f(0xfd)+_0x4ff203),_0xc752f6&&console[_0x17019f(0x14b)]('Task\x20name:\x20'+_0xc752f6));const _0x150919=await withSpinner('Fetching\x20log\x20files...',()=>_0x58c65e[_0x17019f(0x1ee)][_0x17019f(0x185)](_0x4ff203,_0xc752f6),{'verbose':_0x1a6024[_0x17019f(0x9a)]}),_0x13e8d9=_0x150919[_0x17019f(0x94)];if(_0x13e8d9[_0x17019f(0xfc)]===0x0)return console[_0x17019f(0x14b)](_0x17019f(0x17a)),0x0;if(!_0xc752f6&&(_0x1a6024[_0x17019f(0x189)]||_0x1a6024[_0x17019f(0x14c)]))return await handleSDKOutput(_0x13e8d9,_0x1a6024),0x0;if(!_0xc752f6){const _0xf35e07=_0x13e8d9[_0x17019f(0x11b)](_0x42ed00=>({'title':_0x42ed00[_0x17019f(0x163)]+'\x20('+formatBytes(_0x42ed00[_0x17019f(0x147)])+')','value':_0x42ed00['taskName']})),_0x47d7e7=await a52_0x4f62b4({'type':_0x17019f(0x1a2),'name':_0x17019f(0x19e),'message':_0x17019f(0x115),'choices':_0xf35e07});if(!_0x47d7e7['task'])return console['error'](_0x17019f(0x16f)),0x0;_0xc752f6=_0x47d7e7[_0x17019f(0x19e)];}const _0x270c33=await withSpinner(_0x17019f(0x10a),()=>_0x58c65e[_0x17019f(0x1ee)][_0x17019f(0x104)](_0x4ff203,_0xc752f6),{'verbose':_0x1a6024[_0x17019f(0x9a)]}),_0x35a0e0=_0x270c33[_0x17019f(0x94)];return _0x35a0e0?console[_0x17019f(0xcf)](_0x35a0e0):console[_0x17019f(0x14b)](_0x17019f(0x10e)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a52_0x588e3b(0x158)]='workflow:kill';[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x171);async[a52_0x588e3b(0x93)](_0x24ca93){const _0xabfea0=a52_0x588e3b,{options:_0x350e4b,args:_0x28e94f,tdx:_0x3c3e12}=_0x24ca93,_0x53d9e7=_0x28e94f[0x0];if(!_0x53d9e7)return console[_0xabfea0(0x14b)](_0xabfea0(0x1a7)),0x1;const _0x14b47f=_0x350e4b[_0xabfea0(0xf9)];_0x350e4b['verbose']&&(console[_0xabfea0(0x14b)]('Attempt\x20ID:\x20'+_0x53d9e7),_0x14b47f&&console[_0xabfea0(0x14b)](_0xabfea0(0x141)+_0x14b47f));if(!_0x350e4b[_0xabfea0(0x22d)]){if(!isInteractive())return console[_0xabfea0(0x14b)](a52_0x37d01b[_0xabfea0(0x138)]('\x0aError:'),_0xabfea0(0xac)),console[_0xabfea0(0x14b)](a52_0x37d01b['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4fcff2=await confirmKey(_0xabfea0(0xa6)+_0x53d9e7+'?');if(!_0x4fcff2)return console['error'](a52_0x37d01b['yellow']('Cancelled')),0x1;}const _0x5b1db4=await withSpinner('Killing\x20attempt...',()=>_0x3c3e12[_0xabfea0(0x1ee)]['kill'](_0x53d9e7,_0x14b47f),{'verbose':_0x350e4b[_0xabfea0(0x9a)]}),_0x3c8d48=_0x5b1db4[_0xabfea0(0x94)];return console[_0xabfea0(0x14b)]('✔\x20'+_0x3c8d48),0x0;}}function a52_0x353d(_0x254d45,_0x2d89a9){_0x254d45=_0x254d45-0x89;const _0x4562b4=a52_0x4562();let _0x353d3d=_0x4562b4[_0x254d45];return _0x353d3d;}export class WorkflowRetryCommand extends BaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0x19b);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x129);async[a52_0x588e3b(0x93)](_0x29dc54){const _0x115704=a52_0x588e3b,{options:_0x6f70ba,args:_0x3f6892,tdx:_0x10c685}=_0x29dc54,_0xc278bc=_0x3f6892[0x0];if(!_0xc278bc)return console[_0x115704(0x14b)](_0x115704(0xb4)),console[_0x115704(0x14b)](_0x115704(0x1ca)),0x1;let _0x11cb4a=![],_0x51d959=_0xc278bc;if(_0xc278bc[_0x115704(0xed)](_0x115704(0x18b)))_0x11cb4a=!![],_0x51d959=_0xc278bc[_0x115704(0x12a)](0x8);else{if(_0xc278bc[_0x115704(0xed)](_0x115704(0x1b7)))_0x11cb4a=![],_0x51d959=_0xc278bc['substring'](0x8);else return console[_0x115704(0x14b)](_0x115704(0x226)),console[_0x115704(0x14b)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x5875c6=_0x6f70ba[_0x115704(0x120)],_0x3722aa=_0x6f70ba['resumeFrom'],_0x4b577e=_0x6f70ba['params'],_0xad9214=_0x6f70ba[_0x115704(0x1d1)];_0x6f70ba[_0x115704(0x9a)]&&(console[_0x115704(0x14b)](_0x115704(0x10b)+(_0x11cb4a?_0x115704(0x156):'attempt')+'\x20'+_0x51d959),_0x5875c6&&console[_0x115704(0x14b)](_0x115704(0x1c9)+_0x5875c6),_0x3722aa&&console[_0x115704(0x14b)](_0x115704(0x161)+_0x3722aa),_0x4b577e&&console[_0x115704(0x14b)](_0x115704(0x124)+_0x4b577e),_0xad9214&&console['error'](_0x115704(0x178)));let _0x2d29eb;if(_0x4b577e)try{if(_0x4b577e[_0x115704(0xed)]('@')){const _0x3efa34=await import(_0x115704(0xd8)),_0x276702=_0x4b577e[_0x115704(0x12a)](0x1),_0xc0ad1a=await _0x3efa34[_0x115704(0x105)](_0x276702,_0x115704(0x1fc));_0x2d29eb=JSON['parse'](_0xc0ad1a);}else _0x2d29eb=JSON[_0x115704(0x155)](_0x4b577e);}catch{return console[_0x115704(0x14b)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x6f70ba[_0x115704(0x22d)]){if(!isInteractive())return console[_0x115704(0x14b)](a52_0x37d01b['red'](_0x115704(0x211)),_0x115704(0xac)),console['error'](a52_0x37d01b[_0x115704(0x126)](_0x115704(0x16b))),0x1;const _0x4f9afe=await confirmKey(_0x115704(0x170)+(_0x11cb4a?_0x115704(0x156):'attempt')+'\x20'+_0x51d959+'?');if(!_0x4f9afe)return console[_0x115704(0x14b)](a52_0x37d01b['yellow'](_0x115704(0x16f))),0x1;}let _0x41e487;_0x11cb4a?_0x41e487=await withSpinner('Retrying\x20session...',()=>_0x10c685[_0x115704(0x1ee)][_0x115704(0x205)](_0x51d959,{'fromTask':_0x5875c6,'retryParams':_0x2d29eb}),{'verbose':_0x6f70ba[_0x115704(0x9a)]}):_0x41e487=await withSpinner(_0x115704(0x8f),()=>_0x10c685[_0x115704(0x1ee)]['retryAttempt'](_0x51d959,{'resumeFrom':_0x3722aa,'retryParams':_0x2d29eb,'force':_0xad9214}),{'verbose':_0x6f70ba[_0x115704(0x9a)]});const _0x1bdbcd=_0x41e487[_0x115704(0x94)];return console[_0x115704(0x14b)](_0x115704(0x128)),console[_0x115704(0x14b)](_0x115704(0xb0)+_0x1bdbcd['attemptId']),console[_0x115704(0x14b)](_0x115704(0x235)+_0x1bdbcd['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a52_0x588e3b(0x11f);['description']=a52_0x588e3b(0x1bc);async[a52_0x588e3b(0x93)](_0x53acbc){const _0x2ab8ec=a52_0x588e3b,{options:_0x11f877,args:_0x5ec713,tdx:_0x51bd15}=_0x53acbc;let _0x5d0a87=_0x5ec713[0x0];if(!_0x5d0a87){const _0x4495d8=this[_0x2ab8ec(0x1aa)]([],_0x11f877),_0x2ec304=await withSpinner(_0x2ab8ec(0x1f9),()=>_0x51bd15[_0x2ab8ec(0x1ee)]['workflows'](_0x4495d8,{'limit':_0x11f877[_0x2ab8ec(0x1cc)]}),{'verbose':_0x11f877['verbose']}),_0x19e8c8=_0x2ec304[_0x2ab8ec(0x94)];if(_0x19e8c8[_0x2ab8ec(0xfc)]===0x0)return console[_0x2ab8ec(0x14b)](_0x2ab8ec(0xd9)),!_0x4495d8&&console[_0x2ab8ec(0x14b)](a52_0x37d01b[_0x2ab8ec(0x126)](_0x2ab8ec(0xa3))),0x1;const _0x1177c0=_0x19e8c8[_0x2ab8ec(0x11b)](_0xc22122=>({'title':_0xc22122[_0x2ab8ec(0xea)]?.[_0x2ab8ec(0x158)]+'.'+_0xc22122[_0x2ab8ec(0x158)],'value':_0xc22122[_0x2ab8ec(0xea)]?.['name']+'.'+_0xc22122['name'],'description':_0xc22122[_0x2ab8ec(0xb6)]?'revision:\x20'+_0xc22122[_0x2ab8ec(0xb6)]:undefined})),_0x334ba4=await a52_0x4f62b4({'type':_0x2ab8ec(0x1a2),'name':_0x2ab8ec(0x1ee),'message':_0x2ab8ec(0xc7),'choices':_0x1177c0});if(!_0x334ba4[_0x2ab8ec(0x1ee)])return 0x1;_0x5d0a87=_0x334ba4[_0x2ab8ec(0x1ee)];}if(!_0x5d0a87[_0x2ab8ec(0x111)]('.')){const _0x13989d=this[_0x2ab8ec(0x1aa)]([],_0x11f877);if(_0x13989d)_0x5d0a87=_0x13989d+'.'+_0x5d0a87;else return console[_0x2ab8ec(0x14b)](a52_0x37d01b[_0x2ab8ec(0x138)](_0x2ab8ec(0x162)),_0x2ab8ec(0x113)),console[_0x2ab8ec(0x14b)](a52_0x37d01b['dim'](_0x2ab8ec(0xa3))),0x1;}const _0x189655=_0x11f877[_0x2ab8ec(0xbc)],_0x2b9c58=_0x11f877[_0x2ab8ec(0x190)],_0x592629={};if(_0x189655&&Array['isArray'](_0x189655))for(const _0x31bf6b of _0x189655){const _0x31a263=_0x31bf6b[_0x2ab8ec(0x1d7)]('=');if(_0x31a263===-0x1)return console[_0x2ab8ec(0x14b)](_0x2ab8ec(0x125)+_0x31bf6b),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x847cbc=_0x31bf6b[_0x2ab8ec(0x12a)](0x0,_0x31a263),_0x401b69=_0x31bf6b[_0x2ab8ec(0x12a)](_0x31a263+0x1);try{_0x592629[_0x847cbc]=JSON['parse'](_0x401b69);}catch{_0x592629[_0x847cbc]=_0x401b69;}}_0x11f877['verbose']&&(console[_0x2ab8ec(0x14b)](_0x2ab8ec(0xb9)+_0x5d0a87),Object['keys'](_0x592629)[_0x2ab8ec(0xfc)]>0x0&&console[_0x2ab8ec(0x14b)]('Parameters:\x20'+JSON['stringify'](_0x592629)),_0x2b9c58&&console[_0x2ab8ec(0x14b)](_0x2ab8ec(0xc6)+_0x2b9c58));const _0x582403=await withSpinner('Starting\x20workflow\x20run...',()=>_0x51bd15['workflow'][_0x2ab8ec(0x1ba)](_0x5d0a87,_0x592629,{'sessionTime':_0x2b9c58}),{'verbose':_0x11f877[_0x2ab8ec(0x9a)]}),_0xa77553=_0x582403[_0x2ab8ec(0x94)];console['error'](_0x2ab8ec(0x160)),console[_0x2ab8ec(0x14b)]('\x20\x20Attempt\x20ID:\x20'+_0xa77553['id']),console[_0x2ab8ec(0x14b)](_0x2ab8ec(0x235)+_0xa77553[_0x2ab8ec(0xe6)]),console['error'](_0x2ab8ec(0x1e3)+_0xa77553[_0x2ab8ec(0xea)]?.[_0x2ab8ec(0x158)]),console['error'](_0x2ab8ec(0x1f2)+_0xa77553[_0x2ab8ec(0x1ee)]?.[_0x2ab8ec(0x158)]);if(_0xa77553[_0x2ab8ec(0xea)]?.['id']&&_0xa77553[_0x2ab8ec(0xe6)]&&_0xa77553['id']){const _0xbb4be6=_0x11f877['site'],_0x370563=getConsoleUrl(_0xbb4be6,_0x2ab8ec(0x16a)+_0xa77553[_0x2ab8ec(0xea)]['id']+'/sessions/'+_0xa77553['sessionId']+'/attempt/'+_0xa77553['id']);console[_0x2ab8ec(0x14b)](_0x2ab8ec(0xfb)+a52_0x37d01b['cyan'](_0x370563));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a52_0x588e3b(0x1c7);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0xd3);async[a52_0x588e3b(0x93)](_0x341671){const _0x4aeb98=a52_0x588e3b,{options:_0x3ef234,args:_0x20c7c2,tdx:_0x12acf9}=_0x341671,_0x4fe78f=_0x20c7c2[0x0],_0x19cae5=_0x20c7c2[0x1]||'.';if(!_0x4fe78f)return console['error'](_0x4aeb98(0xe2)),console[_0x4aeb98(0x14b)](_0x4aeb98(0x1b9)),0x1;const _0x23e430=_0x3ef234[_0x4aeb98(0xb6)];_0x3ef234[_0x4aeb98(0x9a)]&&(console[_0x4aeb98(0x14b)](_0x4aeb98(0x1f1)+_0x4fe78f),console[_0x4aeb98(0x14b)](_0x4aeb98(0x227)+_0x19cae5),_0x23e430&&console['error'](_0x4aeb98(0xf1)+_0x23e430));const _0x29b628=await withSpinner(_0x4aeb98(0x14e)+_0x4fe78f+'...',()=>_0x12acf9[_0x4aeb98(0x1ee)][_0x4aeb98(0x97)](_0x4fe78f,_0x19cae5,{'revision':_0x23e430}),{'verbose':_0x3ef234[_0x4aeb98(0x9a)]}),_0x29ff61=_0x29b628['data'];return console[_0x4aeb98(0x14b)](_0x4aeb98(0x13c)+_0x29ff61[_0x4aeb98(0x164)]),console[_0x4aeb98(0x14b)](_0x4aeb98(0xff)+_0x29ff61['revision']),console[_0x4aeb98(0x14b)]('\x20\x20Files\x20extracted:\x20'+_0x29ff61[_0x4aeb98(0xb5)]),console[_0x4aeb98(0x14b)](_0x4aeb98(0x1ea)+_0x19cae5+'/'+_0x29ff61[_0x4aeb98(0x164)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0x193);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x191);async[a52_0x588e3b(0x93)](_0x2bd40f){const _0x2962ad=a52_0x588e3b,{options:_0xc933d0,args:_0x2dfce6,tdx:_0x3b288f}=_0x2bd40f;let _0x579cda='.',_0x154479=_0xc933d0[_0x2962ad(0x158)];if(_0x2dfce6[0x0]){const {promises:_0x35e404}=await import('fs');try{const _0x3750de=await _0x35e404[_0x2962ad(0x1d8)](_0x2dfce6[0x0]);if(_0x3750de['isDirectory']())_0x579cda=_0x2dfce6[0x0];else return console['error'](_0x2962ad(0x174)+_0x2dfce6[0x0]+_0x2962ad(0x13b)),0x1;}catch{_0x154479=_0x2dfce6[0x0],_0x579cda='.';}}const _0x529495=_0xc933d0[_0x2962ad(0xb6)],_0x2b5ce3=_0xc933d0['skipValidation'];_0xc933d0[_0x2962ad(0x9a)]&&(console[_0x2962ad(0x14b)](_0x2962ad(0x17c)+_0x579cda),_0x154479&&console[_0x2962ad(0x14b)](_0x2962ad(0xef)+_0x154479),_0x529495&&console['error'](_0x2962ad(0xf1)+_0x529495),_0x2b5ce3&&console[_0x2962ad(0x14b)](_0x2962ad(0x228)));const _0x1d7672=await withSpinner(_0x2962ad(0x131),()=>_0x3b288f[_0x2962ad(0x1ee)][_0x2962ad(0x195)](_0x579cda,{'projectName':_0x154479,'revision':_0x529495,'skipValidation':_0x2b5ce3}),{'verbose':_0xc933d0[_0x2962ad(0x9a)]}),_0x4b1ce5=_0x1d7672[_0x2962ad(0x94)];return console[_0x2962ad(0x14b)](_0x2962ad(0x1bd)+_0x4b1ce5[_0x2962ad(0x164)]),console[_0x2962ad(0x14b)](_0x2962ad(0x112)+_0x4b1ce5[_0x2962ad(0xbf)]),console[_0x2962ad(0x14b)](_0x2962ad(0xff)+_0x4b1ce5[_0x2962ad(0xb6)]),await this[_0x2962ad(0xe5)](_0x3b288f,_0x4b1ce5['projectName'],_0xc933d0['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0x20a);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x1de);async['execute'](_0x36ba1d){const _0x56fc89=a52_0x588e3b,{options:_0x30a9a9,args:_0x1acea6,tdx:_0x5a0b3b}=_0x36ba1d,_0x5bad38=_0x1acea6[0x0],_0x2483b5=_0x1acea6[0x1];if(!_0x5bad38)return console[_0x56fc89(0x14b)](a52_0x37d01b[_0x56fc89(0x138)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x56fc89(0x14b)](a52_0x37d01b[_0x56fc89(0x126)](_0x56fc89(0x1e6))),0x1;const _0x5006da=_0x30a9a9[_0x56fc89(0xb6)];_0x30a9a9[_0x56fc89(0x9a)]&&(console[_0x56fc89(0x14b)](_0x56fc89(0x1f1)+_0x5bad38),_0x2483b5&&console[_0x56fc89(0x14b)](_0x56fc89(0x1af)+_0x2483b5),_0x5006da&&console[_0x56fc89(0x14b)]('Revision:\x20'+_0x5006da),_0x30a9a9['dryRun']&&console[_0x56fc89(0x14b)](_0x56fc89(0x17e)));const _0x2619a4=await withSpinner(_0x56fc89(0x1a3)+_0x5bad38+_0x56fc89(0x208),()=>_0x5a0b3b[_0x56fc89(0x1ee)][_0x56fc89(0xe7)](_0x5bad38,{'targetDir':_0x2483b5,'revision':_0x5006da}),{'verbose':_0x30a9a9[_0x56fc89(0x9a)]}),_0x2098a1=_0x2619a4[_0x56fc89(0x94)];_0x2098a1['isNewProject']?console[_0x56fc89(0x14b)](_0x56fc89(0x13e)+_0x2098a1['projectName']):console[_0x56fc89(0x14b)](_0x56fc89(0x1bb)+_0x2098a1['projectName']);console[_0x56fc89(0x14b)](_0x56fc89(0xff)+_0x2098a1[_0x56fc89(0xb6)]),console[_0x56fc89(0x14b)](_0x56fc89(0x9f)+(a52_0xf38e1a['relative'](process['cwd'](),_0x2098a1['targetDir'])||'.')),console[_0x56fc89(0x14b)](_0x56fc89(0x22b)+a52_0x37d01b[_0x56fc89(0x1b3)]('+'+_0x2098a1['summary']['new']+_0x56fc89(0x172))+',\x20'+(a52_0x37d01b[_0x56fc89(0x201)]('~'+_0x2098a1[_0x56fc89(0xc5)][_0x56fc89(0xe1)]+'\x20modified')+',\x20')+(a52_0x37d01b[_0x56fc89(0x138)]('-'+_0x2098a1[_0x56fc89(0xc5)][_0x56fc89(0x1ef)]+_0x56fc89(0x173))+',\x20')+(''+a52_0x37d01b[_0x56fc89(0x126)](_0x2098a1[_0x56fc89(0xc5)][_0x56fc89(0xf3)]+'\x20unchanged')));for(const _0x2a8c3e of _0x2098a1[_0x56fc89(0x1a4)]){_0x2a8c3e[_0x56fc89(0x232)]==='modified'&&_0x2a8c3e[_0x56fc89(0x1a5)]&&(console[_0x56fc89(0x14b)]('\x0a'+a52_0x37d01b[_0x56fc89(0xae)]('---\x20'+_0x2a8c3e['path'])),console['error'](_0x2a8c3e[_0x56fc89(0x1a5)]));}if(!_0x2098a1[_0x56fc89(0x1c2)])return saveSessionContext({'workflow_project':_0x2098a1[_0x56fc89(0x164)]},_0x30a9a9[_0x56fc89(0x156)]),console[_0x56fc89(0x14b)](a52_0x37d01b[_0x56fc89(0x1b3)](_0x56fc89(0xdb))),console[_0x56fc89(0x14b)](a52_0x37d01b[_0x56fc89(0x126)](_0x56fc89(0x106)+_0x2098a1[_0x56fc89(0x164)])),0x0;if(_0x30a9a9[_0x56fc89(0xcb)])return console[_0x56fc89(0x14b)](a52_0x37d01b[_0x56fc89(0x201)](_0x56fc89(0x1ac))),0x0;if(!_0x30a9a9[_0x56fc89(0x22d)]){if(!isInteractive())return console[_0x56fc89(0x14b)](a52_0x37d01b[_0x56fc89(0x138)](_0x56fc89(0x211)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a52_0x37d01b[_0x56fc89(0x126)](_0x56fc89(0x16b))),0x1;const _0x2a0f15=await confirmKey(_0x56fc89(0x234));if(!_0x2a0f15)return console[_0x56fc89(0x14b)](a52_0x37d01b[_0x56fc89(0x201)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}await withSpinner('Writing\x20files...',()=>_0x5a0b3b[_0x56fc89(0x1ee)]['applyPullProject'](_0x2098a1,{'revision':_0x5006da}),{'verbose':_0x30a9a9[_0x56fc89(0x9a)]}),saveSessionContext({'workflow_project':_0x2098a1['projectName']},_0x30a9a9[_0x56fc89(0x156)]),console[_0x56fc89(0x14b)](a52_0x37d01b[_0x56fc89(0x1b3)](_0x56fc89(0x151)));const _0x5cf370=a52_0xf38e1a['relative'](process['cwd'](),_0x2098a1['targetDir'])||'.';return console[_0x56fc89(0x14b)](a52_0x37d01b['dim'](_0x56fc89(0x1ea)+_0x5cf370)),console[_0x56fc89(0x14b)](a52_0x37d01b[_0x56fc89(0x126)](_0x56fc89(0x106)+_0x2098a1[_0x56fc89(0x164)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0xab);['description']='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a52_0x588e3b(0x93)](_0xab9cf5){const _0x553b7f=a52_0x588e3b,{options:_0x46579a,args:_0x5f3ab8,tdx:_0xd1f5eb}=_0xab9cf5,_0x317152=this[_0x553b7f(0xf5)](_0x5f3ab8,_0x46579a),_0x28a420=_0x46579a[_0x553b7f(0xb6)],_0x50c555=_0x46579a[_0x553b7f(0x1c5)];_0x46579a[_0x553b7f(0x9a)]&&(_0x317152&&console[_0x553b7f(0x14b)](_0x553b7f(0x165)+_0x317152),_0x28a420&&console[_0x553b7f(0x14b)](_0x553b7f(0xf1)+_0x28a420),_0x46579a[_0x553b7f(0xcb)]&&console[_0x553b7f(0x14b)](_0x553b7f(0x17e)),_0x50c555&&console[_0x553b7f(0x14b)](_0x553b7f(0x228)));let _0x8b64d9;try{_0x8b64d9=await withSpinner(_0x553b7f(0xd7),()=>_0xd1f5eb['workflow']['preparePushProject']({'sourceDir':_0x317152,'revision':_0x28a420,'skipValidation':_0x50c555}),{'verbose':_0x46579a[_0x553b7f(0x9a)]});}catch(_0x399650){if(_0x399650 instanceof Error&&_0x399650[_0x553b7f(0x177)]['includes'](_0x553b7f(0x203)))return console['error'](a52_0x37d01b[_0x553b7f(0x138)]('Error:'),_0x553b7f(0x1da)),_0x46579a['workflowProject']?console[_0x553b7f(0x14b)](a52_0x37d01b[_0x553b7f(0x126)](_0x553b7f(0x92)+_0x46579a[_0x553b7f(0x127)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x46579a[_0x553b7f(0x127)]+'\x27')):console[_0x553b7f(0x14b)](a52_0x37d01b[_0x553b7f(0x126)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x399650;}const _0xf178cd=_0x8b64d9[_0x553b7f(0x94)];console['error']('✔\x20Project:\x20'+_0xf178cd['projectName']),console[_0x553b7f(0x14b)]('\x20\x20Source:\x20'+_0xf178cd[_0x553b7f(0x220)]),console[_0x553b7f(0x14b)](_0x553b7f(0xff)+_0xf178cd['revision']),console[_0x553b7f(0x14b)](_0x553b7f(0x22b)+a52_0x37d01b[_0x553b7f(0x1b3)]('+'+_0xf178cd[_0x553b7f(0xc5)]['new']+'\x20new')+',\x20'+(a52_0x37d01b[_0x553b7f(0x201)]('~'+_0xf178cd['summary'][_0x553b7f(0xe1)]+_0x553b7f(0x184))+',\x20')+(a52_0x37d01b[_0x553b7f(0x138)]('-'+_0xf178cd['summary'][_0x553b7f(0x1ef)]+_0x553b7f(0x173))+',\x20')+(''+a52_0x37d01b[_0x553b7f(0x126)](_0xf178cd[_0x553b7f(0xc5)]['unchanged']+'\x20unchanged')));for(const _0x3694fe of _0xf178cd['changes']){_0x3694fe[_0x553b7f(0x232)]===_0x553b7f(0xe1)&&_0x3694fe[_0x553b7f(0x1a5)]&&(console[_0x553b7f(0x14b)]('\x0a'+a52_0x37d01b[_0x553b7f(0xae)](_0x553b7f(0x179)+_0x3694fe[_0x553b7f(0x225)])),console[_0x553b7f(0x14b)](_0x3694fe[_0x553b7f(0x1a5)]));}if(!_0xf178cd['hasChanges'])return console[_0x553b7f(0x14b)](a52_0x37d01b[_0x553b7f(0x1b3)](_0x553b7f(0x1dd))),await this[_0x553b7f(0xe5)](_0xd1f5eb,_0xf178cd[_0x553b7f(0x164)],_0x46579a['site']),0x0;if(_0x46579a['dryRun'])return console['error'](a52_0x37d01b[_0x553b7f(0x201)](_0x553b7f(0x11a))),0x0;if(!_0x46579a[_0x553b7f(0x22d)]){if(!isInteractive())return console['error'](a52_0x37d01b[_0x553b7f(0x138)](_0x553b7f(0x211)),_0x553b7f(0xac)),console['error'](a52_0x37d01b[_0x553b7f(0x126)](_0x553b7f(0x16b))),0x1;const _0x7cee2f=await confirmKey(_0x553b7f(0x116));if(!_0x7cee2f)return console[_0x553b7f(0x14b)](a52_0x37d01b[_0x553b7f(0x201)](_0x553b7f(0x16f)),_0x553b7f(0xfe)),0x1;}const _0x190d74=await withSpinner('Pushing\x20project...',()=>_0xd1f5eb[_0x553b7f(0x1ee)][_0x553b7f(0xe3)](_0xf178cd),{'verbose':_0x46579a[_0x553b7f(0x9a)]}),_0x20e220=_0x190d74[_0x553b7f(0x94)];return console[_0x553b7f(0x14b)](a52_0x37d01b[_0x553b7f(0x1b3)](_0x553b7f(0x183))),console[_0x553b7f(0x14b)]('\x20\x20Project\x20ID:\x20'+_0x20e220[_0x553b7f(0xbf)]),console[_0x553b7f(0x14b)](_0x553b7f(0xff)+_0x20e220[_0x553b7f(0xb6)]),await this[_0x553b7f(0xe5)](_0xd1f5eb,_0x20e220[_0x553b7f(0x164)],_0x46579a[_0x553b7f(0xa0)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0x15e);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0xf0);async['execute'](_0x22021){const _0xa8a25e=a52_0x588e3b,{options:_0x538ce9,args:_0x37e8dc,tdx:_0x467f4b}=_0x22021,_0x4e4565=this['resolveProjectDir'](_0x37e8dc,_0x538ce9),_0x2064e7=_0x538ce9['name'],_0x18ee84=_0x538ce9[_0xa8a25e(0xb6)],_0x1636bf=_0x538ce9[_0xa8a25e(0x1c5)];if(!_0x4e4565)return console['error'](a52_0x37d01b[_0xa8a25e(0x138)]('Error:'),_0xa8a25e(0x1c3)),console[_0xa8a25e(0x14b)](a52_0x37d01b[_0xa8a25e(0x126)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0xa8a25e(0x14b)](a52_0x37d01b[_0xa8a25e(0x126)](_0xa8a25e(0x1cd))),0x1;if(!_0x2064e7)return console[_0xa8a25e(0x14b)](a52_0x37d01b[_0xa8a25e(0x138)](_0xa8a25e(0x162)),_0xa8a25e(0xe9)),console['error'](a52_0x37d01b[_0xa8a25e(0x126)](_0xa8a25e(0x231))),0x1;_0x538ce9[_0xa8a25e(0x9a)]&&(console[_0xa8a25e(0x14b)](_0xa8a25e(0x165)+_0x4e4565),console[_0xa8a25e(0x14b)](_0xa8a25e(0x103)+_0x2064e7),_0x18ee84&&console[_0xa8a25e(0x14b)](_0xa8a25e(0xf1)+_0x18ee84),_0x538ce9[_0xa8a25e(0xcb)]&&console['error'](_0xa8a25e(0x17e)),_0x1636bf&&console[_0xa8a25e(0x14b)]('Validation:\x20skipped'));const _0x469e6f=await withSpinner(_0xa8a25e(0xaf),()=>_0x467f4b['workflow']['prepareCloneProject'](_0x4e4565,_0x2064e7,{'revision':_0x18ee84,'skipValidation':_0x1636bf}),{'verbose':_0x538ce9[_0xa8a25e(0x9a)]}),_0x3b5030=_0x469e6f[_0xa8a25e(0x94)];console[_0xa8a25e(0x14b)](_0xa8a25e(0x1b6)+_0x3b5030[_0xa8a25e(0x220)]);_0x3b5030[_0xa8a25e(0xde)]&&console[_0xa8a25e(0x14b)]('Source\x20project:\x20'+_0x3b5030['sourceProjectName']);console[_0xa8a25e(0x14b)]('New\x20project\x20name:\x20'+_0x3b5030['newProjectName']),console[_0xa8a25e(0x14b)]('Revision:\x20'+_0x3b5030[_0xa8a25e(0xb6)]),console[_0xa8a25e(0x14b)](_0xa8a25e(0x1fd)+_0x3b5030[_0xa8a25e(0x214)]);_0x3b5030['targetExists']&&(console[_0xa8a25e(0x14b)](a52_0x37d01b[_0xa8a25e(0x201)]('\x0a⚠\x20Project\x20\x22'+_0x3b5030[_0xa8a25e(0x9b)]+_0xa8a25e(0x134)+_0x3b5030[_0xa8a25e(0x1e4)]+')')),console[_0xa8a25e(0x14b)](a52_0x37d01b[_0xa8a25e(0x201)](_0xa8a25e(0x1fe))));if(_0x538ce9[_0xa8a25e(0xcb)])return console['error'](a52_0x37d01b[_0xa8a25e(0x201)](_0xa8a25e(0x1e5))),0x0;if(!_0x538ce9[_0xa8a25e(0x22d)]){if(!isInteractive())return console[_0xa8a25e(0x14b)](a52_0x37d01b['red'](_0xa8a25e(0x211)),_0xa8a25e(0xac)),console[_0xa8a25e(0x14b)](a52_0x37d01b['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4e494f=_0x3b5030['sourceProjectName']||a52_0xf38e1a[_0xa8a25e(0x198)](_0x4e4565),_0x5a90fc=_0x3b5030[_0xa8a25e(0x1cb)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x2064e7+_0xa8a25e(0x22a):_0xa8a25e(0x95)+_0x4e494f+'\x22\x20to\x20new\x20project\x20\x22'+_0x2064e7+'\x22?',_0x324335=await confirmKey(_0x5a90fc);if(!_0x324335)return console[_0xa8a25e(0x14b)](a52_0x37d01b['yellow'](_0xa8a25e(0x16f))),0x1;}const _0x1def38=await withSpinner(_0x3b5030['targetExists']?_0xa8a25e(0x144)+_0x2064e7+_0xa8a25e(0x208):_0xa8a25e(0x1e8)+_0x2064e7+'...',()=>_0x467f4b[_0xa8a25e(0x1ee)][_0xa8a25e(0x1b4)](_0x3b5030),{'verbose':_0x538ce9[_0xa8a25e(0x9a)]}),_0x9fc77=_0x1def38[_0xa8a25e(0x94)];return console[_0xa8a25e(0x14b)](a52_0x37d01b[_0xa8a25e(0x1b3)](_0x3b5030[_0xa8a25e(0x1cb)]?_0xa8a25e(0xa2):_0xa8a25e(0xdf))),console['error'](_0xa8a25e(0x1e3)+_0x9fc77[_0xa8a25e(0x9b)]),console['error'](_0xa8a25e(0x112)+_0x9fc77[_0xa8a25e(0x153)]),console[_0xa8a25e(0x14b)]('\x20\x20Revision:\x20'+_0x9fc77[_0xa8a25e(0xb6)]),await this[_0xa8a25e(0xe5)](_0x467f4b,_0x9fc77[_0xa8a25e(0x9b)],_0x538ce9['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0xbb);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x218);async[a52_0x588e3b(0x93)](_0x399451){const _0x1e0a39=a52_0x588e3b,{options:_0x2acb7a,args:_0x1b1bb1,tdx:_0xa82bc6}=_0x399451,_0x50a983=_0x1b1bb1[0x0];if(!_0x50a983)return console[_0x1e0a39(0x14b)](_0x1e0a39(0x14d)),console[_0x1e0a39(0x14b)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x2acb7a['verbose']&&console['error'](_0x1e0a39(0x1f1)+_0x50a983);if(!_0x2acb7a[_0x1e0a39(0x22d)]){if(!isInteractive())return console['error'](a52_0x37d01b[_0x1e0a39(0x138)](_0x1e0a39(0x211)),_0x1e0a39(0xac)),console['error'](a52_0x37d01b[_0x1e0a39(0x126)](_0x1e0a39(0x16b))),0x1;const _0x553c84=await confirmKey(_0x1e0a39(0x152)+_0x50a983+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x553c84)return console[_0x1e0a39(0x14b)](a52_0x37d01b[_0x1e0a39(0x201)](_0x1e0a39(0x16f))),0x1;}const _0x49ef91=await withSpinner(_0x1e0a39(0x1f8)+_0x50a983+_0x1e0a39(0x208),()=>_0xa82bc6['workflow'][_0x1e0a39(0xf7)](_0x50a983),{'verbose':_0x2acb7a[_0x1e0a39(0x9a)]}),_0x408479=_0x49ef91[_0x1e0a39(0x94)];return console['error'](_0x1e0a39(0xa8)+_0x408479['projectName']),console[_0x1e0a39(0x14b)]('\x20\x20Project\x20ID:\x20'+_0x408479[_0x1e0a39(0xbf)]),0x0;}}export function parseKeyValue(_0x205502){const _0x5ce6e2=a52_0x588e3b,_0x4d54ae=_0x205502[_0x5ce6e2(0x1d7)]('=');if(_0x4d54ae===-0x1)throw new Error(_0x5ce6e2(0xad)+_0x205502+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x4b3d5b=_0x205502[_0x5ce6e2(0x12a)](0x0,_0x4d54ae),_0x18d491=_0x205502['substring'](_0x4d54ae+0x1);if(!_0x4b3d5b)throw new Error(_0x5ce6e2(0xaa));return{'key':_0x4b3d5b,'value':_0x18d491};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a52_0x588e3b(0xbe);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x12b);async['execute'](_0x3c877d){const _0x5209d6=a52_0x588e3b,{options:_0x35b4c8,args:_0x194fd7,tdx:_0x759f68}=_0x3c877d,_0x2c0a60=this[_0x5209d6(0xba)](_0x194fd7,_0x35b4c8);if(!_0x2c0a60)return 0x1;_0x35b4c8['verbose']&&console['error'](_0x5209d6(0x1f1)+_0x2c0a60);const _0x22a663=await withSpinner('Listing\x20secrets...',()=>_0x759f68[_0x5209d6(0x1ee)][_0x5209d6(0x149)](_0x2c0a60),{'verbose':_0x35b4c8['verbose']}),{secrets:_0x32d115}=_0x22a663[_0x5209d6(0x94)];return console[_0x5209d6(0x14b)]('✔\x20Found\x20'+_0x32d115[_0x5209d6(0xfc)]+_0x5209d6(0x209)+(_0x32d115[_0x5209d6(0xfc)]!==0x1?'s':'')),await handleSDKOutput(_0x32d115,_0x35b4c8),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a52_0x588e3b(0x158)]=a52_0x588e3b(0x219);[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x135);async['execute'](_0x5eda96){const _0xdcc7aa=a52_0x588e3b,{options:_0x302101,args:_0xe23cf2,tdx:_0x385df7}=_0x5eda96;let _0x2638e2,_0x3985ed;if(_0xe23cf2['length']>=0x1&&!_0xe23cf2[0x0][_0xdcc7aa(0x111)]('='))_0x2638e2=_0xe23cf2[0x0],_0x3985ed=_0xe23cf2['slice'](0x1);else{if(_0xe23cf2[_0xdcc7aa(0xfc)]>=0x1&&_0x302101['workflowProject'])_0x2638e2=_0x302101[_0xdcc7aa(0x127)],_0x3985ed=_0xe23cf2;else return _0xe23cf2[_0xdcc7aa(0xfc)]>=0x1?(console['error'](_0xdcc7aa(0xe2)),console[_0xdcc7aa(0x14b)](_0xdcc7aa(0xa3)),0x1):(console[_0xdcc7aa(0x14b)](_0xdcc7aa(0x1cf)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x3985ed['length']===0x0)return console[_0xdcc7aa(0x14b)](_0xdcc7aa(0x1cf)),console[_0xdcc7aa(0x14b)](_0xdcc7aa(0xd0)),0x1;const _0x176452={};try{for(const _0x4e7e7d of _0x3985ed){const {key:_0x2908ce,value:_0x52eb32}=parseKeyValue(_0x4e7e7d);_0x176452[_0x2908ce]=_0x52eb32;}}catch(_0x2cc514){return _0x2cc514 instanceof Error&&console[_0xdcc7aa(0x14b)](a52_0x37d01b[_0xdcc7aa(0x138)]('Error:'),_0x2cc514[_0xdcc7aa(0x177)]),0x1;}const _0x107bd2=Object[_0xdcc7aa(0x1e1)](_0x176452);_0x302101[_0xdcc7aa(0x9a)]&&(console[_0xdcc7aa(0x14b)](_0xdcc7aa(0x1f1)+_0x2638e2),console['error'](_0xdcc7aa(0x224)+_0x107bd2[_0xdcc7aa(0x17f)](',\x20')));const _0x2924d6=await withSpinner(_0x107bd2[_0xdcc7aa(0xfc)]===0x1?_0xdcc7aa(0x1fa):_0xdcc7aa(0x206)+_0x107bd2[_0xdcc7aa(0xfc)]+_0xdcc7aa(0xd4),()=>_0x385df7['workflow'][_0xdcc7aa(0x196)](_0x2638e2,_0x176452),{'verbose':_0x302101[_0xdcc7aa(0x9a)]}),_0x39cbae=_0x2924d6['data'];return console[_0xdcc7aa(0x14b)](_0x107bd2['length']===0x1?_0xdcc7aa(0x139)+_0x39cbae[_0xdcc7aa(0x1e1)][0x0]+_0xdcc7aa(0x8c)+_0x39cbae[_0xdcc7aa(0x164)]+'\x27':'✔\x20'+_0x39cbae[_0xdcc7aa(0x1e1)][_0xdcc7aa(0xfc)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x39cbae[_0xdcc7aa(0x164)]+'\x27'),(_0x302101[_0xdcc7aa(0x189)]||_0x302101[_0xdcc7aa(0x21a)])&&await handleSingleObjectOutput(_0x39cbae,_0x302101),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a52_0x588e3b(0x158)]='workflow:secrets:delete';[a52_0x588e3b(0x1f3)]=a52_0x588e3b(0x108);async[a52_0x588e3b(0x93)](_0x29a5c7){const _0xce00ff=a52_0x588e3b,{options:_0x1bfdfc,args:_0x499faa,tdx:_0x1d90c7}=_0x29a5c7;let _0x2fc068,_0x29ac5f;if(_0x499faa['length']>=0x2)_0x2fc068=_0x499faa[0x0],_0x29ac5f=_0x499faa[0x1];else{if(_0x499faa[_0xce00ff(0xfc)]===0x1&&_0x1bfdfc[_0xce00ff(0x127)])_0x2fc068=_0x1bfdfc['workflowProject'],_0x29ac5f=_0x499faa[0x0];else return _0x499faa[_0xce00ff(0xfc)]===0x1?(console[_0xce00ff(0x14b)](_0xce00ff(0xe2)),console[_0xce00ff(0x14b)](_0xce00ff(0xa3)),0x1):(console[_0xce00ff(0x14b)](_0xce00ff(0x16d)),console[_0xce00ff(0x14b)](_0xce00ff(0x175)),0x1);}_0x1bfdfc[_0xce00ff(0x9a)]&&(console['error'](_0xce00ff(0x1f1)+_0x2fc068),console[_0xce00ff(0x14b)]('Key:\x20'+_0x29ac5f));if(!_0x1bfdfc[_0xce00ff(0x22d)]){if(!isInteractive())return console['error'](a52_0x37d01b['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xce00ff(0x14b)](a52_0x37d01b['dim'](_0xce00ff(0x16b))),0x1;const _0x79f476=await confirmKey(_0xce00ff(0x21d)+_0x29ac5f+_0xce00ff(0x19d)+_0x2fc068+'\x27?');if(!_0x79f476)return console['error'](a52_0x37d01b['yellow']('Cancelled')),0x1;}const _0x9726e8=await withSpinner(_0xce00ff(0x1b5),()=>_0x1d90c7[_0xce00ff(0x1ee)][_0xce00ff(0xd6)](_0x2fc068,_0x29ac5f),{'verbose':_0x1bfdfc[_0xce00ff(0x9a)]}),_0x26117a=_0x9726e8[_0xce00ff(0x94)];return console[_0xce00ff(0x14b)](_0xce00ff(0x139)+_0x26117a[_0xce00ff(0x19a)]+_0xce00ff(0x130)+_0x26117a[_0xce00ff(0x164)]+'\x27'),(_0x1bfdfc[_0xce00ff(0x189)]||_0x1bfdfc[_0xce00ff(0x21a)])&&await handleSingleObjectOutput(_0x26117a,_0x1bfdfc),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function a52_0x4562(){const _0x5269b2=['sessionId','pullProject','4KKcveH','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','project','workflows','isTTY','startsWith','getDate','Project\x20name:\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Revision:\x20','end','unchanged','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','resolveProjectDir','Including\x20subtasks:\x20yes','delete','780465Mabzua','reason','updatedAt','\x20\x20Console:\x20','length','Attempt\x20ID:\x20','-\x20nothing\x20pushed','\x20\x20Revision:\x20','generateSessionTimelineRows','TASK_NAME_WIDTH','No\x20sessions\x20found\x20for:\x20','New\x20project\x20name:\x20','logs','readFile','\x20\x20Session\x20context\x20set\x20to:\x20','sort','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','No\x20workflow\x20sessions\x20found','Downloading\x20logs...','Target:\x20','renderSingleTimeline','\x20(system)','No\x20log\x20content\x20found','group_error','workflow:workflows','includes','\x20\x20Project\x20ID:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','window','Select\x20a\x20task\x20to\x20view\x20logs:','\x0aPush\x20these\x20changes?','\x0a✔\x20Attempt\x20complete','MIN_TIMELINE_WIDTH','getMonth','\x0aDry\x20run\x20-\x20nothing\x20pushed','map','369594YPNNgc','resolveProjectId','toISOString','workflow:run','fromTask','List\x20all\x20workflow\x20projects','has','floor','Params:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','dim','workflowProject','✔\x20Retry\x20started','Retry\x20a\x20session\x20or\x20attempt','substring','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','28422171jbfwoj','\x20project','cwd','\x20from\x20session\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Pushing\x20workflow\x20project...','\x20(use\x20--limit\x20to\x20show\x20more)','context','\x22\x20already\x20exists\x20(ID:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Show\x20logs\x20for\x20a\x20workflow\x20attempt','No\x20attempts\x20found\x20for:\x20','red','✔\x20Secret\x20\x27','Filter:\x20project=','\x20is\x20not\x20a\x20directory','✔\x20Downloaded\x20','blue','→\x20New\x20project:\x20','duration','planned','Reason:\x20','resolve','💡\x20Tip:\x20Use\x20','Updating\x20','workflow:use','sessions','fileSize','value','listSecrets','renderTimeline','error','format','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Downloading\x20project\x20','Resolving\x20project\x20\x27','running','✔\x20Pull\x20complete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','newProjectId','buildTimelineData','parse','session','No\x20sessions\x20with\x20timing\x20information','name','splice','Select\x20a\x20session\x20to\x20view\x20timeline:','tasks','MAX_POLL_ITERATIONS','\x20workflow','workflow:clone','ICON_WIDTH','✔\x20Workflow\x20run\x20started','Resume\x20from:\x20','Error:','taskName','projectName','Source\x20directory:\x20','parseProjectWorkflowPattern','Getting\x20attempt\x20tasks...','Show\x20specific\x20attempt\x20details','workflow:attempt','/app/workflows/','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20has\x20no\x20attempts','Error:\x20Secret\x20key\x20is\x20required','Filter:\x20','Cancelled','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Kill\x20a\x20running\x20attempt','\x20new','\x20deleted','Error:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x20logs','message','Force:\x20yes','---\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Project\x20directory:\x20','values','Dry\x20run:\x20yes','join','done','slice','getHours','✔\x20Push\x20complete','\x20modified','logFiles','MIN_LABEL_COUNT','get','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','json','28504JVBBsl','session:','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:projects','clear','\x20sessions\x20','sessionTime','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Warning:','workflow:upload','List\x20workflow\x20attempts','push','setSecrets','index','basename','MAX_TIMELINE_WIDTH','key','workflow:retry','2vPqEDo','\x27\x20from\x20project\x20\x27','task','msPerChar','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','now','select','Pulling\x20project\x20','changes','diff','Session\x20','Error:\x20Attempt\x20ID\x20is\x20required','Listing\x20workflows...','5727722yHTIag','resolveProject','🔄\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','output','renderSessionsTimeline','Target\x20directory:\x20','Status:\x20','state','Listing\x20workflow\x20sessions...','green','executeCloneProject','Deleting\x20secret...','Source:\x20','attempt:','toLowerCase','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','run','→\x20Project:\x20','Start\x20a\x20workflow\x20run','✔\x20Pushed\x20','Listing\x20workflow\x20projects...','MAX_LABEL_COUNT','replace','repeat','hasChanges','Source\x20directory\x20is\x20required','cancelRequested','skipValidation','max','workflow:download','white','From\x20task:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','targetExists','limit','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','✔\x20Workflow\x20project\x20set\x20to:\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','1100566tzsSHC','force','\x20-\x20','No\x20matching\x20sessions\x20found','Session\x20not\x20found:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','indexOf','stat','attempt','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Pattern:\x20','padStart','\x0a✔\x20No\x20changes\x20to\x20push','Pull\x20workflow\x20project\x20to\x20local\x20folder','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','columns','keys',',\x20Workflow:\x20','\x20\x20Project:\x20','existingProjectId','\x0aDry\x20run\x20-\x20no\x20project\x20created','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','unknown','Cloning\x20to\x20','success','\x20\x20Location:\x20','total','attempts','Total:\x20','workflow','deleted','No\x20workflows\x20found\x20in\x20project:\x20','Project:\x20','\x20\x20Workflow:\x20','description','attemptId','follow','localeCompare','getTime','Deleting\x20project\x20','Loading\x20workflows...','Setting\x20secret...','fullName','utf-8','Files\x20to\x20upload:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','some','min','yellow','finishedAt','No\x20workflow\x20tdx.json\x20found','pollTimeline','retrySession','Setting\x20','Project\x20name\x20is\x20required','...','\x20secret','workflow:pull','text','rows','table','getFullYear','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','icon','\x0aError:','stdout','Loading\x20sessions...','fileCount','startTime','all','from','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:secrets:set','jsonl','durationMs','No\x20sessions\x20found','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','projects','autocomplete','sourceDir','canceling','\x1b[1A\x1b[2K','Auto-selected\x20latest\x20session:\x20','Secrets\x20to\x20set:\x20','path','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Output\x20directory:\x20','Validation:\x20skipped','Listing\x20workflow\x20attempts...','\x22\x20with\x20new\x20revision?','\x20\x20Changes:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','yes','retryAttemptName','match','No\x20attempts\x20found','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','type','createdAt','\x0aApply\x20these\x20changes?','\x20\x20Session\x20ID:\x20','write','No\x20projects\x20match\x20pattern:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','ICON_SPACING','split','Retrying\x20attempt...','title','No\x20sessions\x20found\x20in\x20project:\x20','Tip:\x20cd\x20to\x20workflows/','execute','data','\x0aClone\x20\x22','workflow:tasks','download','params','status','verbose','newProjectName','List\x20workflow\x20execution\x20sessions','2440340aaSYiA','Latest\x20session\x20has\x20no\x20attempt','\x20\x20Target:\x20','site','✔\x20Found\x20','✔\x20Project\x20updated','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','✔\x20Workflow\x20project\x20context\x20cleared.','fill','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','includeRetried','✔\x20Deleted\x20project\x20','trim','Key\x20cannot\x20be\x20empty','workflow:push','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Invalid\x20format:\x20','cyan','Analyzing\x20project...','\x20\x20New\x20attempt\x20ID:\x20','metadata','⚠\x20Showing\x20first\x20','set','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','filesExtracted','revision','MAX_TASKS_DISPLAY','list','Workflow:\x20','requireProject','workflow:delete','param','workflow:logs','workflow:secrets:list','projectId','trimEnd','navigateSessionsInteractive','startedAt','pending','getMinutes','summary','Session\x20time:\x20','Select\x20a\x20workflow\x20to\x20run','every','find','lastAttempt','dryRun','session_id','\x20\x20tdx\x20wf\x20use\x20<project>','filter','log','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','start','LABEL_MIN_SPACING','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20secrets...','✔\x20Showing\x20','deleteSecret','Analyzing\x20changes...','fs/promises','No\x20workflows\x20found','Failed\x20to\x20fetch\x20attempt\x20data','\x0a✔\x20Already\x20up\x20to\x20date','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','sourceProjectName','✔\x20Clone\x20complete','📁\x20','modified','Error:\x20Project\x20name\x20is\x20required','executePushProject','tdx\x20wf\x20attempt\x20','showWorkflowConsoleUrl'];a52_0x4562=function(){return _0x5269b2;};return a52_0x4562();}function formatElapsed(_0x239f9f){const _0x4bc2bf=a52_0x588e3b,_0x5632c3=Math[_0x4bc2bf(0x123)](_0x239f9f/0x3e8),_0x244378=Math[_0x4bc2bf(0x123)](_0x5632c3/0x3c),_0x411649=Math[_0x4bc2bf(0x123)](_0x244378/0x3c),_0x2f916a=Math[_0x4bc2bf(0x123)](_0x411649/0x18);if(_0x2f916a>0x0){const _0x39166f=_0x411649%0x18;return _0x39166f>0x0?_0x2f916a+'d\x20'+_0x39166f+'h':_0x2f916a+'d';}else{if(_0x411649>0x0){const _0x19ccb1=_0x244378%0x3c;return _0x19ccb1>0x0?_0x411649+'h\x20'+_0x19ccb1+'m':_0x411649+'h';}else{if(_0x244378>0x0){const _0x1247b0=_0x5632c3%0x3c;return _0x1247b0>0x0?_0x244378+'m\x20'+_0x1247b0+'s':_0x244378+'m';}else return _0x5632c3+'s';}}}function formatTimestamp(_0x4d23bb,_0x16dfa3){const _0x3eb906=a52_0x588e3b,_0x12c13f=new Date(_0x4d23bb),_0x370d8b=String(_0x12c13f[_0x3eb906(0x182)]())['padStart'](0x2,'0'),_0x5a83f2=String(_0x12c13f[_0x3eb906(0xc4)]())['padStart'](0x2,'0'),_0x123106=_0x370d8b+':'+_0x5a83f2,_0x302af6=_0x12c13f['getFullYear']()===_0x16dfa3[_0x3eb906(0x20e)]()&&_0x12c13f['getMonth']()===_0x16dfa3[_0x3eb906(0x119)]()&&_0x12c13f['getDate']()===_0x16dfa3['getDate']();if(_0x302af6)return _0x123106;else{const _0x4a4d3e=String(_0x12c13f['getMonth']()+0x1)['padStart'](0x2,'0'),_0xd97428=String(_0x12c13f[_0x3eb906(0xee)]())[_0x3eb906(0x1dc)](0x2,'0');return _0x4a4d3e+'-'+_0xd97428+'\x20'+_0x123106;}}function formatDate(_0x482317){const _0xf46923=a52_0x588e3b,_0x699b34=_0x482317[_0xf46923(0x20e)](),_0x2c63d7=String(_0x482317[_0xf46923(0x119)]()+0x1)[_0xf46923(0x1dc)](0x2,'0'),_0x22c3a6=String(_0x482317[_0xf46923(0xee)]())[_0xf46923(0x1dc)](0x2,'0');return _0x699b34+'-'+_0x2c63d7+'-'+_0x22c3a6;}function getTaskStateIcon(_0xe3f269){const _0x47f821={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x47f821[_0xe3f269]||'⚪';}function getBarChar(_0x380005){const _0x428bc1=a52_0x588e3b;return _0x380005===_0x428bc1(0x14b)||_0x380005===_0x428bc1(0x10f)?'×':'─';}function getBarColor(_0x1b0d90){const _0x373f3d=a52_0x588e3b,_0x68a63d={'success':a52_0x37d01b[_0x373f3d(0x1b3)],'error':a52_0x37d01b[_0x373f3d(0x138)],'group_error':a52_0x37d01b['red'],'running':a52_0x37d01b[_0x373f3d(0x13d)],'blocked':a52_0x37d01b[_0x373f3d(0x201)],'planned':a52_0x37d01b[_0x373f3d(0x126)],'canceling':a52_0x37d01b['yellow']};return _0x68a63d[_0x1b0d90]||a52_0x37d01b[_0x373f3d(0x1c8)];}function parseTaskName(_0x4b3444){const _0x1514d8=a52_0x588e3b;let _0x5991c6=_0x4b3444[_0x1514d8(0x1c0)](/^\++/,'');const _0x5eafd2=_0x5991c6[_0x1514d8(0x8e)]('+'),_0xc35702=_0x5eafd2[_0x1514d8(0xfc)]>0x1?_0x5eafd2['length']-0x2:0x0,_0x3403b9=_0x5eafd2[_0x5eafd2['length']-0x1]||_0x5991c6;return{'level':_0xc35702,'name':'+'+_0x3403b9};}function truncateTaskName(_0x4106e1,_0x124d5a){const _0x151c9a=a52_0x588e3b,_0x18138e=stringWidth(_0x4106e1);if(_0x18138e<=_0x124d5a)return _0x4106e1;let _0x270dda=_0x4106e1;while(stringWidth(_0x270dda+'…')>_0x124d5a&&_0x270dda[_0x151c9a(0xfc)]>0x0){_0x270dda=_0x270dda[_0x151c9a(0x181)](0x0,-0x1);}return _0x270dda+'…';}function calculateTimeScale(_0x54e3dd,_0x2c2292){const _0x1ac122=a52_0x588e3b;return{'startTime':_0x54e3dd[_0x1ac122(0xd1)],'endTime':_0x54e3dd[_0x1ac122(0xf2)],'durationMs':_0x54e3dd['duration'],'msPerChar':_0x54e3dd[_0x1ac122(0x13f)]/_0x2c2292};}function timeToPosition(_0x344d8b,_0x15f096,_0x154c70){const _0x541e5d=a52_0x588e3b,_0xb2ab10=_0x344d8b-_0x15f096[_0x541e5d(0x215)],_0xfea4ce=Math[_0x541e5d(0x123)](_0xb2ab10/_0x15f096[_0x541e5d(0x19f)]);return Math[_0x541e5d(0x1c6)](0x0,Math[_0x541e5d(0x200)](_0xfea4ce,_0x154c70));}function renderTimeAxis(_0x2df787,_0x55c543){const _0x4be50e=a52_0x588e3b,_0x3d3ecd=Math[_0x4be50e(0x200)](TIMELINE_CONFIG[_0x4be50e(0x1bf)],Math[_0x4be50e(0x1c6)](TIMELINE_CONFIG[_0x4be50e(0x186)],Math[_0x4be50e(0x123)](_0x55c543/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x46a3a2=_0x2df787[_0x4be50e(0x21b)]/(_0x3d3ecd-0x1),_0x263a81=new Date(_0x2df787[_0x4be50e(0x215)]),_0x48a713=[];for(let _0x4db79f=0x0;_0x4db79f<_0x3d3ecd;_0x4db79f++){const _0x407a04=_0x2df787[_0x4be50e(0x215)]+_0x4db79f*_0x46a3a2,_0x214bf1=timeToPosition(_0x407a04,_0x2df787,_0x55c543),_0x1af782=formatTimestamp(_0x407a04,_0x263a81);_0x48a713[_0x4be50e(0x195)]({'pos':_0x214bf1,'text':_0x1af782});}const _0x2528c5=new Array(_0x55c543)[_0x4be50e(0xa5)]('\x20');let _0x28e4d4=-0x1;for(const {pos:_0x448c40,text:_0x1d04ff}of _0x48a713){let _0x147ff2=Math[_0x4be50e(0x1c6)](0x0,_0x448c40-Math[_0x4be50e(0x123)](_0x1d04ff[_0x4be50e(0xfc)]/0x2));_0x147ff2<=_0x28e4d4+TIMELINE_CONFIG[_0x4be50e(0xd2)]&&(_0x147ff2=_0x28e4d4+TIMELINE_CONFIG[_0x4be50e(0xd2)]+0x1);_0x147ff2+_0x1d04ff[_0x4be50e(0xfc)]>_0x55c543&&(_0x147ff2=_0x55c543-_0x1d04ff['length']);if(_0x147ff2>=0x0&&_0x147ff2+_0x1d04ff[_0x4be50e(0xfc)]<=_0x55c543&&_0x147ff2>_0x28e4d4){for(let _0x13004b=0x0;_0x13004b<_0x1d04ff[_0x4be50e(0xfc)];_0x13004b++){_0x2528c5[_0x147ff2+_0x13004b]=_0x1d04ff[_0x13004b];}_0x28e4d4=_0x147ff2+_0x1d04ff[_0x4be50e(0xfc)]-0x1;}}return _0x2528c5[_0x4be50e(0x17f)]('');}function renderTaskRow(_0x5cb53a,_0x1e9a34,_0x249f9c,_0x1e2ae6){const _0x3bc88c=a52_0x588e3b,{level:_0x1bdd91,name:_0x600b4b}=parseTaskName(_0x5cb53a[_0x3bc88c(0x158)]),_0x517616='\x20'[_0x3bc88c(0x1c1)](_0x1bdd91),_0x4663cb=_0x5cb53a[_0x3bc88c(0x114)]?'('+formatElapsed(_0x5cb53a[_0x3bc88c(0x114)][_0x3bc88c(0x13f)])+')':'',_0x52b9f1=stringWidth(_0x4663cb),_0x2488ad=_0x1bdd91*0x1,_0x2ffae3=_0x1e2ae6-_0x2488ad-_0x52b9f1-0x1,_0x2ff5f5=truncateTaskName(_0x600b4b,_0x2ffae3),_0x98e56d=_0x517616+_0x2ff5f5,_0x1ff4b8=stringWidth(_0x98e56d),_0x390acb=_0x1e2ae6-_0x1ff4b8-_0x52b9f1,_0xc76e00=_0x98e56d+'\x20'[_0x3bc88c(0x1c1)](Math['max'](0x1,_0x390acb))+a52_0x37d01b[_0x3bc88c(0x126)](_0x4663cb),_0x2a0a66=getTaskStateIcon(_0x5cb53a[_0x3bc88c(0x1b1)]),_0x164b87=new Array(_0x249f9c)[_0x3bc88c(0xa5)]('\x20');if(_0x5cb53a['window']){const _0x3230fe=timeToPosition(_0x5cb53a[_0x3bc88c(0x114)][_0x3bc88c(0xd1)],_0x1e9a34,_0x249f9c),_0x952951=timeToPosition(_0x5cb53a[_0x3bc88c(0x114)][_0x3bc88c(0xf2)],_0x1e9a34,_0x249f9c),_0x5eb3c8=getBarChar(_0x5cb53a[_0x3bc88c(0x1b1)]),_0x107e23=Math['max'](_0x3230fe+0x1,_0x952951);for(let _0x40b9ab=_0x3230fe;_0x40b9ab<Math[_0x3bc88c(0x200)](_0x107e23,_0x249f9c);_0x40b9ab++){_0x164b87[_0x40b9ab]=_0x5eb3c8;}}const _0x468c8e=getBarColor(_0x5cb53a[_0x3bc88c(0x1b1)]),_0x4d4eb2=_0x164b87[_0x3bc88c(0x11b)](_0x4daef5=>_0x4daef5==='\x20'?'\x20':_0x468c8e(_0x4daef5))[_0x3bc88c(0x17f)]('');return _0x2a0a66+'\x20'+_0xc76e00+'│'+_0x4d4eb2+'│';}function calculateStats(_0x32f948){const _0x149998=a52_0x588e3b,_0x27aae3={'total':_0x32f948['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5e0c17 of _0x32f948){if(_0x5e0c17[_0x149998(0x1b1)]===_0x149998(0x1e9))_0x27aae3[_0x149998(0x1e9)]++;else{if(_0x5e0c17[_0x149998(0x1b1)]===_0x149998(0x14b)||_0x5e0c17[_0x149998(0x1b1)]==='group_error')_0x27aae3['error']++;else _0x5e0c17['state']===_0x149998(0x150)?_0x27aae3[_0x149998(0x150)]++:_0x27aae3[_0x149998(0xc3)]++;}}return _0x27aae3;}function formatStats(_0x3d8426){const _0x2bf7f1=a52_0x588e3b;return[_0x2bf7f1(0x1ed)+_0x3d8426[_0x2bf7f1(0x1eb)],'✅\x20'+_0x3d8426['success'],'❌\x20'+_0x3d8426[_0x2bf7f1(0x14b)],_0x2bf7f1(0x1ab)+_0x3d8426[_0x2bf7f1(0x150)],'⏳\x20'+_0x3d8426[_0x2bf7f1(0xc3)]][_0x2bf7f1(0x17f)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']='workflow:timeline';[a52_0x588e3b(0x1f3)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a52_0x588e3b(0x93)](_0x4a1812){const _0x585675=a52_0x588e3b,{options:_0xa3c23b,args:_0x344119,tdx:_0x3cb6eb}=_0x4a1812;let _0x58e372,_0x130119,_0x37461e=![];if(_0x344119[0x0]){if(_0x344119[0x0][_0x585675(0x111)]('.')){const _0x3aa2cd=this[_0x585675(0x166)](_0x344119,_0xa3c23b);if(!_0x3aa2cd)return 0x1;_0x58e372=_0x3aa2cd['projectName'],_0x130119=_0x3aa2cd['workflowName'];}else{_0x130119=_0x344119[0x0],_0x58e372=_0xa3c23b[_0x585675(0x127)];if(!_0x58e372)return console[_0x585675(0x14b)](a52_0x37d01b[_0x585675(0x138)](_0x585675(0x162)),_0x585675(0x1df)),0x1;_0x37461e=!![];}}else{const _0x379da2=this[_0x585675(0x166)](_0x344119,_0xa3c23b);if(!_0x379da2)return 0x1;_0x58e372=_0x379da2[_0x585675(0x164)],_0x130119=_0x379da2['workflowName'];}if(_0xa3c23b[_0x585675(0x9a)]){if(_0x58e372&&_0x130119)console[_0x585675(0x14b)](_0x585675(0x16e)+_0x58e372+'.'+_0x130119);else _0x58e372&&console[_0x585675(0x14b)]('Filter:\x20project='+_0x58e372);}const _0xb07f9a=_0xa3c23b[_0x585675(0x1f4)],_0x224cc6=_0xa3c23b[_0x585675(0xe6)];if(_0xb07f9a){_0x224cc6&&console['error'](a52_0x37d01b[_0x585675(0x201)](_0x585675(0x192)),_0x585675(0xf4));const _0x1c11cb=_0xa3c23b[_0x585675(0x1f5)];return _0x1c11cb?await this[_0x585675(0x204)](_0x4a1812,_0xb07f9a):await this[_0x585675(0x10c)](_0x4a1812,_0xb07f9a,_0xa3c23b),0x0;}if(_0x224cc6){const _0x26c837=await withSpinner('Loading\x20session...',()=>_0x3cb6eb[_0x585675(0x1ee)][_0x585675(0x146)]({'projectName':_0x58e372,'workflowName':_0x130119,'limit':0x64}),{'verbose':_0xa3c23b['verbose']}),_0x3bdba1=_0x26c837[_0x585675(0x94)]['find'](_0x4c36d7=>_0x4c36d7['id']===_0x224cc6);if(!_0x3bdba1)return console[_0x585675(0x14b)](a52_0x37d01b[_0x585675(0x138)]('Error:'),_0x585675(0x1d4)+_0x224cc6),0x1;if(!_0x3bdba1[_0x585675(0xca)]?.['id'])return console[_0x585675(0x14b)](a52_0x37d01b[_0x585675(0x138)]('Error:'),_0x585675(0x1a6)+_0x224cc6+_0x585675(0x16c)),0x1;const _0x146de4=_0x3bdba1['lastAttempt']['id'];_0xa3c23b[_0x585675(0x9a)]&&console['error']('Using\x20attempt\x20'+_0x146de4+_0x585675(0x12f)+_0x224cc6);const _0x2864dc=_0xa3c23b[_0x585675(0x1f5)];return _0x2864dc?await this[_0x585675(0x204)](_0x4a1812,_0x146de4):await this[_0x585675(0x10c)](_0x4a1812,_0x146de4,_0xa3c23b),0x0;}const _0x675be1=await withSpinner(_0x585675(0x213),()=>_0x3cb6eb[_0x585675(0x1ee)][_0x585675(0x146)]({'projectName':_0x58e372,'workflowName':_0x130119,'limit':_0xa3c23b[_0x585675(0x1cc)]||0x32}),{'verbose':_0xa3c23b[_0x585675(0x9a)]}),_0x68b33d=_0x675be1[_0x585675(0x94)];if(_0x68b33d['length']===0x0){if(_0x58e372&&_0x130119)console[_0x585675(0x14b)](_0x585675(0x102)+_0x58e372+'.'+_0x130119);else _0x58e372?console[_0x585675(0x14b)](_0x585675(0x91)+_0x58e372):(console[_0x585675(0x14b)](_0x585675(0x109)),console[_0x585675(0x14b)](a52_0x37d01b[_0x585675(0x126)](_0x585675(0x20f))));return 0x0;}_0x68b33d[_0x585675(0x107)]((_0x36605c,_0x3d2b3f)=>{const _0x48af40=_0x585675,_0x4979bb=_0x36605c[_0x48af40(0x190)]||'',_0xe22072=_0x3d2b3f['sessionTime']||'';return _0xe22072[_0x48af40(0x1f6)](_0x4979bb);});if(_0xa3c23b['json']||_0xa3c23b['jsonl'])return await handleSDKOutput(_0x68b33d,_0xa3c23b),0x0;let _0x2707c5;if(_0x37461e){const _0x5a81df=_0x68b33d[0x0];if(!_0x5a81df[_0x585675(0xca)]?.['id'])return console[_0x585675(0x14b)](_0x585675(0x9e)),0x0;_0x2707c5=_0x5a81df['lastAttempt']['id'],_0xa3c23b[_0x585675(0x9a)]&&console[_0x585675(0x14b)](_0x585675(0x223)+_0x5a81df[_0x585675(0x190)]);}else{const _0x43142e=_0x68b33d['map'](_0x3afd6d=>{const _0x4545b7=_0x585675,_0x5eebe0=getAttemptStatusDisplay(_0x3afd6d['lastAttempt']);return{'title':_0x3afd6d['project']?.[_0x4545b7(0x158)]+'.'+_0x3afd6d[_0x4545b7(0x1ee)]?.[_0x4545b7(0x158)]+'\x20-\x20'+_0x3afd6d['sessionTime']+'\x20'+_0x5eebe0[_0x4545b7(0x210)],'value':_0x3afd6d[_0x4545b7(0xca)]?.['id']||'','description':_0x5eebe0[_0x4545b7(0x20b)]};}),_0x325e08=await a52_0x4f62b4({'type':_0x585675(0x1a2),'name':'attemptId','message':_0x585675(0x15a),'choices':_0x43142e[_0x585675(0xce)](_0xff4b36=>_0xff4b36[_0x585675(0x148)]!=='')});if(!_0x325e08[_0x585675(0x1f4)])return 0x0;_0x2707c5=_0x325e08[_0x585675(0x1f4)];}const _0x19f4dc=_0xa3c23b[_0x585675(0x1f5)];return _0x19f4dc?await this['pollTimeline'](_0x4a1812,_0x2707c5):await this[_0x585675(0x10c)](_0x4a1812,_0x2707c5,_0xa3c23b),0x0;}async[a52_0x588e3b(0x10c)](_0x579443,_0x5428f5,_0x51cf02){const _0x57d785=a52_0x588e3b,{tdx:_0x1b9bde}=_0x579443;let _0x434fc1,_0x894508;try{[_0x434fc1,_0x894508]=await Promise[_0x57d785(0x216)]([_0x1b9bde[_0x57d785(0x1ee)][_0x57d785(0x1d9)](_0x5428f5),_0x1b9bde['workflow']['tasks'](_0x5428f5,![])]);}catch(_0x30bfeb){console[_0x57d785(0x14b)](a52_0x37d01b[_0x57d785(0x138)](_0x57d785(0xda)));_0x51cf02[_0x57d785(0x9a)]&&console[_0x57d785(0x14b)](_0x30bfeb);throw _0x30bfeb;}if(_0x51cf02[_0x57d785(0x189)]||_0x51cf02['jsonl']){const _0xb627ce=this[_0x57d785(0x154)](_0x434fc1,_0x894508);await handleSDKOutput([_0xb627ce],_0x51cf02);return;}const _0x43942c=_0x1b9bde[_0x57d785(0x133)][_0x57d785(0xa0)],_0x492977=this[_0x57d785(0x14a)](_0x434fc1,_0x894508,_0x43942c);console[_0x57d785(0xcf)](_0x492977);}async[a52_0x588e3b(0x204)](_0x2f3793,_0x4484e6){const _0x473911=a52_0x588e3b,{tdx:_0x2b83fe}=_0x2f3793,_0x373c5f=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x55eae3=TIMELINE_CONFIG[_0x473911(0x15c)];let _0x541874=0x0;while(_0x541874<_0x55eae3){process[_0x473911(0x212)][_0x473911(0xec)]&&process[_0x473911(0x212)][_0x473911(0x89)]('\x1bc');let _0xe4c61e,_0x9aba96;try{[_0xe4c61e,_0x9aba96]=await Promise[_0x473911(0x216)]([_0x2b83fe[_0x473911(0x1ee)]['attempt'](_0x4484e6),_0x2b83fe[_0x473911(0x1ee)][_0x473911(0x15b)](_0x4484e6,![])]);}catch(_0x36cefd){console['error'](a52_0x37d01b[_0x473911(0x138)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x541874>0x0&&console[_0x473911(0x14b)](a52_0x37d01b[_0x473911(0x126)](_0x473911(0x1a0)+_0x541874));throw _0x36cefd;}const _0x56aeca=_0x2b83fe[_0x473911(0x133)][_0x473911(0xa0)],_0x3a3ac3=this[_0x473911(0x14a)](_0xe4c61e,_0x9aba96,_0x56aeca);console['log'](_0x3a3ac3);const _0x437e5a=_0xe4c61e[_0x473911(0x180)]&&_0x9aba96[_0x473911(0xc8)](_0x49ae2e=>_0x49ae2e['state']!==_0x473911(0x150)&&_0x49ae2e['state']!==_0x473911(0x140));if(_0x437e5a){console[_0x473911(0x14b)](a52_0x37d01b[_0x473911(0x1b3)](_0x473911(0x117)));break;}console[_0x473911(0x14b)](a52_0x37d01b[_0x473911(0x126)]('\x0aPolling...\x20('+_0x541874*0x2+_0x473911(0xdd))),await new Promise(_0x2f11fe=>setTimeout(_0x2f11fe,_0x373c5f)),_0x541874++;}_0x541874>=_0x55eae3&&console['error'](a52_0x37d01b[_0x473911(0x201)](_0x473911(0x17b)));}['renderTimeline'](_0x45fc16,_0x44bbc3,_0x2a860c){const _0x44738a=a52_0x588e3b,_0x460407=[],_0x3e13ec=TIMELINE_CONFIG[_0x44738a(0x101)],_0x480136=0x5,_0x3cbb57=process[_0x44738a(0x212)][_0x44738a(0x1e0)]||0x78,_0x27307b=_0x3cbb57-_0x3e13ec-_0x480136,_0x4eee66=Math['max'](TIMELINE_CONFIG[_0x44738a(0x118)],Math[_0x44738a(0x200)](_0x27307b,TIMELINE_CONFIG[_0x44738a(0x199)])),_0x12960d=new Date(_0x45fc16['createdAt'])[_0x44738a(0x1f7)](),_0x2eb9ab=_0x45fc16['finishedAt']?new Date(_0x45fc16[_0x44738a(0x202)])[_0x44738a(0x1f7)]():Date[_0x44738a(0x1a1)](),_0x34c083={'start':_0x12960d,'end':_0x2eb9ab,'duration':_0x2eb9ab-_0x12960d},_0x4fd60b=new Map(),_0x5b999f=[];for(const _0x173579 of _0x44bbc3){if(_0x173579[_0x44738a(0xc2)]){const _0x537d61=new Date(_0x173579['startedAt'])['getTime'](),_0x4f06a4=_0x173579[_0x44738a(0xfa)]?new Date(_0x173579[_0x44738a(0xfa)])[_0x44738a(0x1f7)]():Date[_0x44738a(0x1a1)](),_0x2ca3a9={'start':_0x537d61,'end':_0x4f06a4,'duration':_0x4f06a4-_0x537d61};_0x4fd60b['set'](_0x173579['id'],_0x2ca3a9),_0x5b999f[_0x44738a(0x195)]({'name':_0x173579[_0x44738a(0x1fb)],'state':_0x173579[_0x44738a(0x1b1)]||_0x44738a(0x1e7),'window':_0x2ca3a9});}else _0x5b999f[_0x44738a(0x195)]({'name':_0x173579[_0x44738a(0x1fb)],'state':_0x173579[_0x44738a(0x1b1)]||_0x44738a(0x140),'window':undefined});}_0x5b999f[_0x44738a(0x107)]((_0x55b4bd,_0x42fa86)=>{const _0x37796e=_0x44738a;if(!_0x55b4bd[_0x37796e(0x114)])return 0x1;if(!_0x42fa86[_0x37796e(0x114)])return-0x1;return _0x55b4bd[_0x37796e(0x114)]['start']-_0x42fa86['window']['start'];});const _0x4d7674=_0x5b999f[_0x44738a(0xfc)],_0x369007=_0x4d7674>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x369007&&_0x5b999f[_0x44738a(0x159)](TIMELINE_CONFIG[_0x44738a(0xb7)]);const _0x6b47f8=calculateTimeScale(_0x34c083,_0x4eee66),_0x42b947=_0x45fc16['done']?_0x45fc16[_0x44738a(0x1e9)]?a52_0x37d01b[_0x44738a(0x1b3)](_0x44738a(0x1e9)):a52_0x37d01b[_0x44738a(0x138)]('error'):a52_0x37d01b['blue']('running'),_0x34d099=_0x45fc16['project']?.['id'],_0x537648=_0x45fc16[_0x44738a(0xe6)];let _0xddc2f9;if(_0x34d099&&_0x537648){const _0x46932f=getWorkflowAttemptUrl(_0x2a860c,_0x34d099,_0x537648,_0x45fc16['id']);_0xddc2f9=hyperlink(a52_0x37d01b[_0x44738a(0x126)](_0x45fc16['id']),_0x46932f);}else _0xddc2f9=a52_0x37d01b[_0x44738a(0x126)](_0x45fc16['id']);_0x460407[_0x44738a(0x195)]('Attempt:\x20'+_0xddc2f9+'\x20-\x20'+_0x42b947+_0x44738a(0x1d2)+formatElapsed(_0x34c083['duration']));if(_0x5b999f['length']>0x0){const _0x210846=renderTimeAxis(_0x6b47f8,_0x4eee66),_0x14fca5=new Date(_0x34c083[_0x44738a(0xd1)]),_0x337d05=formatDate(_0x14fca5),_0x3b78e7=TIMELINE_CONFIG[_0x44738a(0x15f)]+TIMELINE_CONFIG['ICON_SPACING']+_0x3e13ec,_0x21d089=_0x337d05[_0x44738a(0x1dc)](_0x3b78e7),_0x5c51ee=a52_0x37d01b[_0x44738a(0x126)](_0x21d089);_0x460407[_0x44738a(0x195)](_0x5c51ee+'\x20'+_0x210846);for(const _0x1cb3e7 of _0x5b999f){_0x460407['push'](renderTaskRow(_0x1cb3e7,_0x6b47f8,_0x4eee66,_0x3e13ec));}const _0x1fb358=calculateStats(_0x5b999f);_0x460407[_0x44738a(0x195)](formatStats(_0x1fb358)),_0x369007&&_0x460407[_0x44738a(0x195)](a52_0x37d01b[_0x44738a(0x201)](_0x44738a(0xb2)+TIMELINE_CONFIG[_0x44738a(0xb7)]+'\x20of\x20'+_0x4d7674+'\x20tasks')),_0x460407[_0x44738a(0x195)](''),_0x460407[_0x44738a(0x195)](a52_0x37d01b['dim'](_0x44738a(0x143))+(_0x44738a(0xe4)+_0x45fc16['id']+_0x44738a(0x176))+a52_0x37d01b['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x460407[_0x44738a(0x195)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x460407[_0x44738a(0x17f)]('\x0a');}[a52_0x588e3b(0x154)](_0x2d853f,_0x26b4c8){const _0x5e3007=a52_0x588e3b,_0x19f50c=new Date(_0x2d853f[_0x5e3007(0x233)])[_0x5e3007(0x1f7)](),_0x4da5d6=_0x2d853f[_0x5e3007(0x202)]?new Date(_0x2d853f[_0x5e3007(0x202)])[_0x5e3007(0x1f7)]():Date['now'](),_0x445715=_0x4da5d6-_0x19f50c,_0xbd8055=[];for(const _0x2c93e3 of _0x26b4c8){if(_0x2c93e3['startedAt']){const _0x507563=new Date(_0x2c93e3[_0x5e3007(0xc2)])[_0x5e3007(0x1f7)](),_0x39dd3b=_0x2c93e3[_0x5e3007(0xfa)]?new Date(_0x2c93e3[_0x5e3007(0xfa)])[_0x5e3007(0x1f7)]():Date[_0x5e3007(0x1a1)]();_0xbd8055['push']({'name':_0x2c93e3[_0x5e3007(0x1fb)],'state':_0x2c93e3[_0x5e3007(0x1b1)]||_0x5e3007(0x1e7),'window':{'start':_0x507563,'end':_0x39dd3b,'duration':_0x39dd3b-_0x507563}});}else _0xbd8055[_0x5e3007(0x195)]({'name':_0x2c93e3[_0x5e3007(0x1fb)],'state':_0x2c93e3['state']||'planned','window':undefined});}const _0x5d688e=calculateStats(_0xbd8055);return{'attempt':{'id':_0x2d853f['id'],'status':_0x2d853f[_0x5e3007(0x180)]?_0x2d853f[_0x5e3007(0x1e9)]?_0x5e3007(0x1e9):'error':_0x5e3007(0x150),'createdAt':_0x2d853f[_0x5e3007(0x233)],'finishedAt':_0x2d853f[_0x5e3007(0x202)],'duration_ms':_0x445715},'tasks':_0xbd8055[_0x5e3007(0x11b)](_0x2c36a0=>({'name':_0x2c36a0[_0x5e3007(0x158)],'state':_0x2c36a0[_0x5e3007(0x1b1)],'startedAt':_0x2c36a0[_0x5e3007(0x114)]?new Date(_0x2c36a0[_0x5e3007(0x114)][_0x5e3007(0xd1)])[_0x5e3007(0x11e)]():null,'updatedAt':_0x2c36a0[_0x5e3007(0x114)]?new Date(_0x2c36a0[_0x5e3007(0x114)][_0x5e3007(0xf2)])[_0x5e3007(0x11e)]():null,'duration_ms':_0x2c36a0[_0x5e3007(0x114)]?.[_0x5e3007(0x13f)]||null})),'stats':_0x5d688e};}}
1
+ function a52_0x2669(){const _0x3cae2b=['table','No\x20sessions\x20found','From\x20task:\x20','attempts','⚠\x20Showing\x20first\x20','ICON_SPACING','Show\x20tasks\x20for\x20an\x20attempt','workflow:upload','getDate','start','all','Kill\x20a\x20running\x20attempt','TASK_NAME_WIDTH','type','Key:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','targetExists','✔\x20Project\x20updated','keys','createdAt','applyPullProject','workflow:download','verbose','Retry\x20a\x20session\x20or\x20attempt','456gVUljX','error','task','Revision:\x20','3266000dabwOB','Pushing\x20workflow\x20project...','log','\x22\x20to\x20new\x20project\x20\x22','revision:\x20','indexOf','lastAttempt','jsonl','slice','cancelRequested','write','Expected\x20format:\x20--param\x20key=value','output','\x20logs','Project:\x20','MIN_TIMELINE_WIDTH','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20deleted','data','Setting\x20secret...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','pollTimeline','resumeFrom','now','isNewProject','🔄\x20','isArray','Using\x20attempt\x20','\x20modified','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','readFile','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x0aClone\x20\x22','/attempt/','min','dim','description','logs','Attempt\x20ID:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x0aError:','duration','Force:\x20yes','GUTTER','preparePushProject','workflow:push','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','deleteSecret','Error:\x20Project\x20name\x20is\x20required','set','Resume\x20from:\x20','workflow:use','LABEL_MIN_SPACING','Downloading\x20project\x20','fullName','-\x20no\x20files\x20written','\x0aPolling...\x20(','Getting\x20attempt\x20tasks...','deleted','path','summary','workflow:attempt','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','values','No\x20projects\x20match\x20pattern:\x20','\x20secret','fill','from','Filter:\x20project=','\x0a✔\x20Attempt\x20complete','Latest\x20session\x20has\x20no\x20attempt','\x0a✔\x20No\x20changes\x20to\x20push','index','window','Secrets\x20to\x20set:\x20','pullProject','clear','4HzZTaI','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Project\x20name:\x20','\x0aUpdate\x20existing\x20project\x20\x22','\x0a⚠\x20Project\x20\x22','674eaGjxJ','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Project\x20directory:\x20','workflow:kill','Target:\x20','Listing\x20workflow\x20attempts...','logFiles','updatedAt','Resolving\x20project\x20\x27','workflow:pull','No\x20workflows\x20found\x20in\x20project:\x20','navigateSessionsInteractive','Pulling\x20project\x20','Error:\x20Attempt\x20ID\x20is\x20required','size','✔\x20Secret\x20\x27','parse','No\x20sessions\x20found\x20in\x20project:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','projectId','startedAt','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','key',',\x20Workflow:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','projectName','find','state','\x0aPush\x20these\x20changes?','join','workflow','sys','563717MCKVNj','sessionId','sessionTime','\x20secrets\x20set\x20for\x20project\x20\x27','workflowProject','No\x20attempts\x20found\x20in\x20project:\x20','workflow:clone','name','\x20unchanged','Status:\x20','Starting\x20workflow\x20run...','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','padStart','→\x20New\x20project:\x20','title','total','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20Revision:\x20','5YSvePt','list','isTTY','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Source:\x20','attemptId','workflow:tasks','Listing\x20workflow\x20projects...','taskName','MAX_POLL_ITERATIONS','\x20to\x20see\x20detailed\x20logs','(unknown)','changes','Error:','execute','replace','startsWith','Params:\x20','Project\x20name\x20is\x20required','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Dry\x20run:\x20yes','project','No\x20sessions\x20with\x20timing\x20information','No\x20attempts\x20found\x20for:\x20','listSecrets','startTime','\x20\x20Project\x20ID:\x20','📋\x20','Fetching\x20log\x20files...','context','some','newProjectName','Analyzing\x20changes...','parseProjectWorkflowPattern','No\x20workflow\x20sessions\x20found','red','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','/sessions/','\x22?\x20This\x20cannot\x20be\x20undone.','text','\x20\x20tdx\x20wf\x20use\x20<project>','unknown','Filter:\x20','cwd','Failed\x20to\x20fetch\x20attempt\x20data','workflow:workflows','List\x20workflow\x20attempts','Listing\x20workflow\x20sessions...','Target\x20directory:\x20','Key\x20cannot\x20be\x20empty','max','stat','projects','💡\x20Tip:\x20Use\x20','attempt:','\x20sessions\x20','\x20workflow','\x20session','renderSingleTimeline','get','sort','Loading\x20session...','\x20\x20Session\x20context\x20set\x20to:\x20','No\x20sessions\x20found\x20for:\x20','isDirectory','Error:\x20Invalid\x20JSON\x20in\x20--params','Updating\x20','-\x20nothing\x20pushed','Error:\x20Invalid\x20parameter\x20format:\x20','success','columns','\x20project','yes','push','Show\x20specific\x20attempt\x20details','Show\x20logs\x20for\x20a\x20workflow\x20attempt','msPerChar','\x20\x20Files\x20extracted:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','...','workflow:sessions','\x20-\x20','MAX_LABEL_COUNT','stdout','sourceProjectName','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','432366BoZOrO','✔\x20Found\x20','resolveProject','session:','Source\x20directory:\x20','Reason:\x20','modified','workflow:secrets:set','basename','done','every','workflow:secrets:delete','cyan','MAX_TIMELINE_WIDTH','targetDir','requireProject','hasChanges','Select\x20a\x20session\x20to\x20view\x20timeline:','round','workflow:secrets:list','download','revision','params','Validation:\x20skipped','\x22\x20with\x20new\x20revision?','Listing\x20secrets...','✔\x20Push\x20complete','Deleting\x20project\x20','blue','group_error','Total:\x20','session','\x20\x20Project:\x20','executeCloneProject','status','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','resolveProjectDir','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:timeline','No\x20matching\x20sessions\x20found','autocomplete','52677xfEiIo','36vSMobX','substring','→\x20Project:\x20','workflows','List\x20workflow\x20execution\x20sessions','Parameters:\x20','workflow:retry','limit','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Project\x20filter:\x20','run','\x0aDry\x20run\x20-\x20no\x20project\x20created','fileSize','\x20\x20Session\x20ID:\x20','Include\x20retried:\x20yes','value','renderTimeline','---\x20','Listing\x20workflows...','\x20\x20Changes:\x20','No\x20workflow\x20projects\x20found','\x20\x20Console:\x20','✔\x20Clone\x20complete','87384uqFHfB','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','message','Analyzing\x20project...','Killing\x20attempt...','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Session\x20not\x20found:\x20','getTime','icon','\x22\x20already\x20exists\x20(ID:\x20','getHours','✔\x20Retry\x20started','\x0a✔\x20Already\x20up\x20to\x20date','tasks','diff','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','List\x20all\x20workflow\x20projects','127mgAyGD','List\x20workflows','tdx\x20wf\x20attempt\x20','new','includes','Invalid\x20format:\x20','newProjectId','Task\x20name:\x20','\x20(system)','unchanged','map','sourceDir','yellow','filesExtracted','site','\x20secrets...','.\x20Expected\x20format:\x20KEY=VALUE','New\x20project\x20name:\x20','generateSessionTimelineRows','format','splice','match','Deleting\x20secret...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20\x20Target:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','workflow:attempts','existingProjectId','showWorkflowConsoleUrl','select','canceling','Tip:\x20cd\x20to\x20workflows/','attempt','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20tasks','26971aGLQSu','\x20(use\x20--limit\x20to\x20show\x20more)','skipValidation','filter','\x20attempt','prepareCloneProject','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','relative','displayLine','retryAttemptName','pending','Attempt:\x20','running','\x20\x20Location:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x0aDry\x20run\x20-\x20nothing\x20pushed','getFullYear','No\x20attempts\x20found','Session\x20time:\x20','fs/promises','floor','follow','finishedAt','fileCount','\x1b[1A\x1b[2K','\x27\x20from\x20project\x20\x27','localeCompare','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','workflowName','session_id','fromTask','Usage:\x20workflow:delete\x20<project-name-or-id>','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','has','green','No\x20log\x20content\x20found','getMonth','Usage:\x20tdx\x20wf\x20use\x20<project>','Downloading\x20logs...','✔\x20Pushed\x20','dryRun','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Cancelled','✔\x20Downloaded\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20new','end','Output\x20directory:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','split','MAX_TASKS_DISPLAY','tdx.json','repeat','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','sessions','Getting\x20attempt\x20details...','✔\x20Workflow\x20project\x20context\x20cleared.','No\x20log\x20files\x20found\x20for\x20this\x20attempt','No\x20workflow\x20tdx.json\x20found','getMinutes','Select\x20a\x20workflow\x20to\x20run','kill','\x20\x20New\x20attempt\x20ID:\x20','planned','Including\x20subtasks:\x20yes','ICON_WIDTH','resolveProjectId','toISOString','(use\x20--limit\x20to\x20see\x20more)','buildTimelineData','json','renderSessionsTimeline'];a52_0x2669=function(){return _0x3cae2b;};return a52_0x2669();}const a52_0x4f3203=a52_0xcd02;(function(_0x19e21a,_0x257f51){const _0x803b6c=a52_0xcd02,_0x4c8834=_0x19e21a();while(!![]){try{const _0x4ba9ce=parseInt(_0x803b6c(0x237))/0x1*(-parseInt(_0x803b6c(0x15d))/0x2)+-parseInt(_0x803b6c(0x226))/0x3*(parseInt(_0x803b6c(0x158))/0x4)+parseInt(_0x803b6c(0x18f))/0x5*(-parseInt(_0x803b6c(0x1e5))/0x6)+parseInt(_0x803b6c(0x25a))/0x7*(parseInt(_0x803b6c(0x105))/0x8)+parseInt(_0x803b6c(0x20e))/0x9+parseInt(_0x803b6c(0x109))/0xa+-parseInt(_0x803b6c(0x17d))/0xb*(parseInt(_0x803b6c(0x20f))/0xc);if(_0x4ba9ce===_0x257f51)break;else _0x4c8834['push'](_0x4c8834['shift']());}catch(_0x48c475){_0x4c8834['push'](_0x4c8834['shift']());}}}(a52_0x2669,0x3e189));import a52_0x4d046d from'chalk';import{existsSync}from'fs';import a52_0x59b294 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a52_0x42cbf7 from'prompts';function getAttemptStatusDisplay(_0x4b38b4){const _0x2401ec=a52_0xcd02;if(!_0x4b38b4)return{'icon':'⏳','text':''};const {done:_0x5d90bc,success:_0x1c8715,cancelRequested:_0x4b1712}=_0x4b38b4;if(!_0x5d90bc)return _0x4b1712?{'icon':'🛑','text':a52_0x4d046d[_0x2401ec(0x243)](_0x2401ec(0x255))}:{'icon':'🔄','text':a52_0x4d046d[_0x2401ec(0x201)](_0x2401ec(0x266))};if(_0x1c8715)return{'icon':'✅','text':a52_0x4d046d[_0x2401ec(0x27d)]('success')};return{'icon':'❌','text':a52_0x4d046d['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x195547,_0x1023a2,_0x1f8f51=0x0){const _0x1f7894=a52_0xcd02;return _0x195547[_0x1f8f51]||_0x1023a2[_0x1f7894(0x181)];}[a52_0x4f3203(0x1f4)](_0x444711,_0x4a7228,_0x310d98=0x0){const _0x410abd=a52_0x4f3203,_0x5372d6=this[_0x410abd(0x1e7)](_0x444711,_0x4a7228,_0x310d98);if(!_0x5372d6)return console[_0x410abd(0x106)](a52_0x4d046d[_0x410abd(0x1b2)](_0x410abd(0x19c)),_0x410abd(0x1a1)),console['error'](a52_0x4d046d['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x5372d6;}[a52_0x4f3203(0x1b0)](_0x204fa2,_0x45bcb2){const _0x5d774a=a52_0x4f3203;if(_0x204fa2[0x0]){const _0x478186=_0x204fa2[0x0][_0x5d774a(0x28e)]('.');if(_0x478186[_0x5d774a(0x276)]===0x1)return{'projectName':_0x478186[0x0],'workflowName':undefined};else return _0x478186[_0x5d774a(0x276)]===0x2?{'projectName':_0x478186[0x0],'workflowName':_0x478186[0x1]}:(console[_0x5d774a(0x106)](a52_0x4d046d['red']('Error:'),_0x5d774a(0x22b)),null);}return{'projectName':_0x45bcb2[_0x5d774a(0x181)],'workflowName':undefined};}[a52_0x4f3203(0x209)](_0x259a00,_0x4dc5c5,_0x2b2068=0x0){const _0x15233b=a52_0x4f3203;if(_0x259a00[_0x2b2068])return _0x259a00[_0x2b2068];if(_0x4dc5c5['workflowProject']){const _0x25c1f7=a52_0x59b294[_0x15233b(0x17a)](process[_0x15233b(0x1ba)](),_0x15233b(0x212),_0x4dc5c5[_0x15233b(0x181)]);if(existsSync(a52_0x59b294[_0x15233b(0x17a)](_0x25c1f7,_0x15233b(0x290))))return _0x25c1f7;}return undefined;}async[a52_0x4f3203(0x253)](_0xbe539f,_0x3fa236,_0x1f4d06){const _0x297008=a52_0x4f3203;try{const _0x36535f=await _0xbe539f['workflow']['workflows'](_0x3fa236,{'limit':0x1});if(_0x36535f[_0x297008(0x276)]>0x0){const _0x2bc557=_0x36535f[0x0]['id'],_0x2ea0ac=getWorkflowUrl(_0x1f4d06,_0x2bc557);console['error'](_0x297008(0x224)+a52_0x4d046d[_0x297008(0x1f1)](_0x2ea0ac));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x13d);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x175);async[a52_0x4f3203(0x19d)](_0x11c677){const _0x1a09d8=a52_0x4f3203,{options:_0x5677d5,args:_0x557687,tdx:_0xc332de}=_0x11c677,_0x5675f7=_0x557687[0x0],_0x427e9e=_0x5677d5[_0x1a09d8(0x157)];if(_0x427e9e)return saveSessionContext({'workflow_project':undefined},_0x5677d5[_0x1a09d8(0x204)]),console[_0x1a09d8(0x10b)](a52_0x4d046d['green'](_0x1a09d8(0x295))),0x0;if(!_0x5675f7)return console[_0x1a09d8(0x106)](a52_0x4d046d[_0x1a09d8(0x1b2)](_0x1a09d8(0x19c)),_0x1a09d8(0x1a1)),console[_0x1a09d8(0x106)](a52_0x4d046d[_0x1a09d8(0x12c)](_0x1a09d8(0x280))),console[_0x1a09d8(0x106)](a52_0x4d046d[_0x1a09d8(0x12c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x271878=await withSpinner(_0x1a09d8(0x165)+_0x5675f7+'\x27...',()=>_0xc332de[_0x1a09d8(0x17b)][_0x1a09d8(0x29f)](_0x5675f7),{'verbose':_0x5677d5[_0x1a09d8(0x103)]}),{name:_0x2e5122}=_0x271878[_0x1a09d8(0x11b)];return saveSessionContext({'workflow_project':_0x2e5122},_0x5677d5[_0x1a09d8(0x204)]),console[_0x1a09d8(0x10b)](a52_0x4d046d['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a52_0x4d046d[_0x1a09d8(0x1f1)](_0x2e5122))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a52_0x4f3203(0x184)]='workflow:projects';[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x236);async[a52_0x4f3203(0x19d)](_0x1179b4){const _0x2a8490=a52_0x4f3203,{options:_0x442025,args:_0x479557,tdx:_0x2379d5}=_0x1179b4,_0x27c589=_0x479557[0x0];_0x442025[_0x2a8490(0x103)]&&_0x27c589&&console[_0x2a8490(0x106)]('Pattern:\x20'+_0x27c589);const _0x3aee78=await withSpinner(_0x2a8490(0x196),()=>_0x2379d5[_0x2a8490(0x17b)][_0x2a8490(0x1c3)](_0x27c589,{'limit':_0x442025[_0x2a8490(0x216)]}),{'verbose':_0x442025[_0x2a8490(0x103)]});let _0x56f028=_0x3aee78[_0x2a8490(0x11b)];_0x56f028[_0x2a8490(0x1cb)]((_0x1b94b2,_0x4f56b0)=>_0x1b94b2[_0x2a8490(0x184)]['localeCompare'](_0x4f56b0['name']));const _0x379360=_0x442025[_0x2a8490(0x216)]||0x64,_0x35b2dc=_0x56f028[_0x2a8490(0x276)]>=_0x379360?a52_0x4d046d[_0x2a8490(0x12c)](_0x2a8490(0x25b)):'';console[_0x2a8490(0x106)](_0x2a8490(0x1e6)+_0x56f028[_0x2a8490(0x276)]+_0x2a8490(0x1d6)+(_0x56f028[_0x2a8490(0x276)]!==0x1?'s':'')+_0x35b2dc);if(_0x442025[_0x2a8490(0x24a)]===_0x2a8490(0xea)||_0x442025[_0x2a8490(0x24a)]===_0x2a8490(0x110)||_0x442025['format']===_0x2a8490(0xec))await handleSDKOutput(_0x56f028,_0x442025);else{if(_0x56f028[_0x2a8490(0x276)]===0x0)_0x27c589?console[_0x2a8490(0x10b)](_0x2a8490(0x14b)+_0x27c589):console['log'](_0x2a8490(0x223));else{const _0x291059=_0x56f028[_0x2a8490(0x241)](_0x18e239=>{const _0x3e39a7=_0x2a8490,_0x181182=_0x18e239['metadata']?.[_0x3e39a7(0x1ad)](_0xafe8a=>_0xafe8a[_0x3e39a7(0x173)]===_0x3e39a7(0x17c)),_0xbc1119=_0x181182?a52_0x4d046d[_0x3e39a7(0x12c)](_0x3e39a7(0x23f)):'';return'📁\x20'+_0x18e239['name']+_0xbc1119;});await writeOutput(_0x291059[_0x2a8490(0x17a)]('\x0a'),_0x442025[_0x2a8490(0x115)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a52_0x4f3203(0x1bc);['description']=a52_0x4f3203(0x238);async[a52_0x4f3203(0x19d)](_0x3de35b){const _0x46546b=a52_0x4f3203,{options:_0x32e537,args:_0x272210,tdx:_0x5ce999}=_0x3de35b,_0x2de0d4=this[_0x46546b(0x1e7)](_0x272210,_0x32e537);_0x32e537[_0x46546b(0x103)]&&_0x2de0d4&&console[_0x46546b(0x106)](_0x46546b(0x218)+_0x2de0d4);const _0x28a995=await withSpinner(_0x46546b(0x221),()=>_0x5ce999[_0x46546b(0x17b)][_0x46546b(0x212)](_0x2de0d4,{'limit':_0x32e537[_0x46546b(0x216)]}),{'verbose':_0x32e537[_0x46546b(0x103)]});let _0x29672e=_0x28a995[_0x46546b(0x11b)];_0x29672e[_0x46546b(0x1cb)]((_0x5887cc,_0x1a0db9)=>{const _0x315b0e=_0x46546b,_0x2f724a=_0x5887cc[_0x315b0e(0x184)][_0x315b0e(0x274)](_0x1a0db9[_0x315b0e(0x184)]);if(_0x2f724a!==0x0)return _0x2f724a;return(_0x5887cc[_0x315b0e(0x1a4)]?.[_0x315b0e(0x184)]||'')[_0x315b0e(0x274)](_0x1a0db9['project']?.[_0x315b0e(0x184)]||'');});const _0x5eeacc=_0x32e537['limit']||0x64,_0x3546bf=_0x29672e[_0x46546b(0x276)]>=_0x5eeacc?a52_0x4d046d[_0x46546b(0x12c)](_0x46546b(0x25b)):'';console[_0x46546b(0x106)](_0x46546b(0x1e6)+_0x29672e[_0x46546b(0x276)]+_0x46546b(0x1c7)+(_0x29672e['length']!==0x1?'s':'')+_0x3546bf);if(_0x32e537[_0x46546b(0x24a)]==='json'||_0x32e537[_0x46546b(0x24a)]===_0x46546b(0x110)||_0x32e537[_0x46546b(0x24a)]===_0x46546b(0xec))await handleSDKOutput(_0x29672e,_0x32e537);else{if(_0x29672e[_0x46546b(0x276)]===0x0)_0x2de0d4?console[_0x46546b(0x10b)](_0x46546b(0x167)+_0x2de0d4):console[_0x46546b(0x10b)]('No\x20workflows\x20found');else{const _0x2b0937=_0x32e537[_0x46546b(0x245)],_0xe24f18=_0x29672e[_0x46546b(0x241)](_0x394ff7=>{const _0x3939f0=_0x46546b,_0x10581a=a52_0x4d046d[_0x3939f0(0x12c)]('#'+_0x394ff7['id']),_0x2f2902=hyperlink(_0x10581a,getWorkflowUrl(_0x2b0937,_0x394ff7['id'])),_0x592888=_0x394ff7[_0x3939f0(0x1a4)]?.['name']?a52_0x4d046d['dim']('\x20('+_0x394ff7[_0x3939f0(0x1a4)][_0x3939f0(0x184)]+')'):'';return _0x3939f0(0x1aa)+_0x2f2902+'\x20'+_0x394ff7[_0x3939f0(0x184)]+_0x592888;});await writeOutput(_0xe24f18['join']('\x0a'),_0x32e537[_0x46546b(0x115)],_0x46546b(0x190));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x1df);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x213);async[a52_0x4f3203(0x19d)](_0x1a00c1){const _0x4825bc=a52_0x4f3203,{options:_0x1fb9e7,args:_0x23ca1c,tdx:_0x42aa3b}=_0x1a00c1,_0x2b9d03=this[_0x4825bc(0x1b0)](_0x23ca1c,_0x1fb9e7);if(!_0x2b9d03)return 0x1;const {projectName:_0x5cbbd0,workflowName:_0x5e9a03}=_0x2b9d03;if(_0x1fb9e7[_0x4825bc(0x103)]){if(_0x5cbbd0&&_0x5e9a03)console[_0x4825bc(0x106)](_0x4825bc(0x1b9)+_0x5cbbd0+'.'+_0x5e9a03);else _0x5cbbd0&&console[_0x4825bc(0x106)](_0x4825bc(0x14f)+_0x5cbbd0);const _0x1ab2fe=_0x1fb9e7[_0x4825bc(0x207)];_0x1ab2fe&&console[_0x4825bc(0x106)](_0x4825bc(0x186)+_0x1ab2fe);}let _0x33534e=0x28;if(process[_0x4825bc(0x1e2)][_0x4825bc(0x191)]&&!_0x1fb9e7[_0x4825bc(0x115)]&&!_0x1fb9e7[_0x4825bc(0x24a)]){const _0x41dbf2=process[_0x4825bc(0x1e2)]['rows']||0x28;_0x33534e=Math[_0x4825bc(0x1c1)](0x14,Math[_0x4825bc(0x26e)](_0x41dbf2*0x2/0x3));}const _0x23c8e7=_0x1fb9e7[_0x4825bc(0x216)]||_0x33534e,_0x1e913f=await withSpinner(_0x4825bc(0x1be),()=>_0x42aa3b[_0x4825bc(0x17b)][_0x4825bc(0x293)]({'projectName':_0x5cbbd0,'workflowName':_0x5e9a03,'status':_0x1fb9e7[_0x4825bc(0x207)],'fromTime':_0x1fb9e7[_0x4825bc(0x14e)],'toTime':_0x1fb9e7['to'],'limit':_0x23c8e7}),{'verbose':_0x1fb9e7['verbose']}),_0x121a86=_0x1e913f[_0x4825bc(0x11b)];_0x121a86[_0x4825bc(0x1cb)]((_0x94e817,_0x262f9d)=>{const _0x11434f=_0x4825bc,_0x47711d=_0x94e817['sessionTime']||'',_0x531e67=_0x262f9d['sessionTime']||'';return _0x531e67[_0x11434f(0x274)](_0x47711d);});_0x121a86['length']>=_0x23c8e7?console[_0x4825bc(0x106)]('✔\x20Showing\x20'+_0x121a86[_0x4825bc(0x276)]+_0x4825bc(0x1c6)+a52_0x4d046d[_0x4825bc(0x12c)](_0x4825bc(0x2a1))):console[_0x4825bc(0x106)](_0x4825bc(0x1e6)+_0x121a86[_0x4825bc(0x276)]+_0x4825bc(0x1c8)+(_0x121a86[_0x4825bc(0x276)]!==0x1?'s':''));if(_0x1fb9e7['format']===_0x4825bc(0xea)||_0x1fb9e7[_0x4825bc(0x24a)]===_0x4825bc(0x110)||_0x1fb9e7[_0x4825bc(0x24a)]===_0x4825bc(0xec))await handleSDKOutput(_0x121a86,_0x1fb9e7);else{if(!process[_0x4825bc(0x1e2)][_0x4825bc(0x191)]||_0x1fb9e7['output']){if(_0x121a86['length']===0x0){if(_0x5cbbd0&&_0x5e9a03)console[_0x4825bc(0x10b)](_0x4825bc(0x1ce)+_0x5cbbd0+'.'+_0x5e9a03);else _0x5cbbd0?console[_0x4825bc(0x10b)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x5cbbd0):console[_0x4825bc(0x10b)](_0x4825bc(0xed));}else{const _0x194f45=_0x1fb9e7[_0x4825bc(0x245)],_0x4ec2ee=this[_0x4825bc(0xeb)](_0x121a86,_0x194f45);_0x1fb9e7['output']?await writeOutput(_0x4ec2ee,_0x1fb9e7['output'],_0x4825bc(0x190)):console[_0x4825bc(0x10b)](_0x4ec2ee);}!_0x5cbbd0&&(console[_0x4825bc(0x106)](''),console[_0x4825bc(0x106)](a52_0x4d046d[_0x4825bc(0x12c)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x4825bc(0x106)](a52_0x4d046d[_0x4825bc(0x12c)](_0x4825bc(0x149))+'or'+a52_0x4d046d[_0x4825bc(0x12c)](_0x4825bc(0x1b7))));}else{if(_0x121a86['length']===0x0){if(_0x5cbbd0&&_0x5e9a03)console[_0x4825bc(0x10b)]('No\x20sessions\x20found\x20for:\x20'+_0x5cbbd0+'.'+_0x5e9a03);else _0x5cbbd0?console[_0x4825bc(0x10b)](_0x4825bc(0x16e)+_0x5cbbd0):console[_0x4825bc(0x10b)](_0x4825bc(0xed));}else await this[_0x4825bc(0x168)](_0x121a86,_0x1a00c1,_0x5cbbd0);}}return 0x0;}[a52_0x4f3203(0xeb)](_0x408316,_0xb2587d){const _0x190bf7=a52_0x4f3203,_0xf84fe5=[],_0x3c0ec9=new Map();let _0xa0704a=Infinity,_0x302901=-Infinity;for(const _0x59c512 of _0x408316){if(_0x59c512['lastAttempt']?.['createdAt']){const _0x392933=new Date(_0x59c512[_0x190bf7(0x10f)][_0x190bf7(0x100)])[_0x190bf7(0x22d)](),_0x30329d=_0x59c512['lastAttempt'][_0x190bf7(0x270)]?new Date(_0x59c512[_0x190bf7(0x10f)][_0x190bf7(0x270)])[_0x190bf7(0x22d)]():Date[_0x190bf7(0x120)](),_0x2544bd=_0x59c512[_0x190bf7(0x1a4)]?.[_0x190bf7(0x184)]||_0x190bf7(0x19a);!_0x3c0ec9[_0x190bf7(0x27c)](_0x2544bd)&&_0x3c0ec9[_0x190bf7(0x13b)](_0x2544bd,[]),_0x3c0ec9[_0x190bf7(0x1ca)](_0x2544bd)[_0x190bf7(0x1d8)]({'session':_0x59c512,'startTime':_0x392933,'endTime':_0x30329d,'duration':_0x30329d-_0x392933}),_0xa0704a=Math['min'](_0xa0704a,_0x392933),_0x302901=Math[_0x190bf7(0x1c1)](_0x302901,_0x30329d);}}if(_0x3c0ec9[_0x190bf7(0x16b)]===0x0)return _0x190bf7(0x1a5);const _0x43a99d=process[_0x190bf7(0x1e2)][_0x190bf7(0x1d5)]||0x78,_0x136fdf=0x1e,_0x352f3d=0x32,_0x11b58b=0x4,_0x1c4c83=Math[_0x190bf7(0x12b)](_0x352f3d,Math['max'](_0x136fdf,Math[_0x190bf7(0x26e)](_0x43a99d*0.3))),_0x272d55=_0x43a99d-_0x1c4c83-TIMELINE_CONFIG[_0x190bf7(0x134)]-0x3-_0x11b58b,_0x428454=_0x302901-_0xa0704a,_0x5b4a73=_0x428454/_0x1c4c83,_0x4046e9=renderTimeAxis({'startTime':_0xa0704a,'endTime':_0x302901,'durationMs':_0x428454,'msPerChar':_0x5b4a73},_0x1c4c83),_0x3c4a5e=[];for(const _0xee2443 of _0x3c0ec9[_0x190bf7(0x14a)]()){_0x3c4a5e[_0x190bf7(0x1d8)](..._0xee2443);}_0x3c4a5e[_0x190bf7(0x1cb)]((_0x5ae470,_0x4f3687)=>_0x4f3687[_0x190bf7(0x1a8)]-_0x5ae470['startTime']);const _0x3446a1=new Date(_0xa0704a),_0x5ed204=formatDate(_0x3446a1),_0x460c2d=_0x11b58b+TIMELINE_CONFIG[_0x190bf7(0x29e)]+TIMELINE_CONFIG[_0x190bf7(0xf1)]+_0x272d55,_0x2c2375='\x20'[_0x190bf7(0x291)](_0x460c2d-_0x5ed204['length']),_0x246786=_0x2c2375+a52_0x4d046d[_0x190bf7(0x12c)](_0x5ed204)+'\x20'+_0x4046e9;_0xf84fe5['push'](_0x246786);const _0x5e70c5=0x16;let _0x4f8ce6=0x0;for(const _0x32db97 of _0x3c4a5e){const _0x5d09e9=_0x32db97['session'][_0x190bf7(0x1a4)]?.[_0x190bf7(0x184)]||'?',_0x29f6b6=Math[_0x190bf7(0x12b)](stringWidth(_0x5d09e9),_0x5e70c5);_0x4f8ce6=Math[_0x190bf7(0x1c1)](_0x4f8ce6,_0x29f6b6);}for(const _0xbc9f25 of _0x3c4a5e){const {session:_0x235d4f,startTime:_0x291c06,endTime:_0x2bdd4d,duration:_0x2bdb3a}=_0xbc9f25,_0x4e4048=_0x235d4f[_0x190bf7(0x1a4)]?.['id'],_0x164aa7=_0x235d4f['id'],_0x10a511=_0x235d4f[_0x190bf7(0x1a4)]?.[_0x190bf7(0x184)]||'?',_0x3f8bcc=_0x235d4f[_0x190bf7(0x17b)]?.['name']||'?';let _0x26d695,_0x62a6f6;if(_0x235d4f[_0x190bf7(0x10f)]){const _0xf513a3=_0x235d4f[_0x190bf7(0x10f)];!_0xf513a3['done']?(_0x26d695=_0xf513a3[_0x190bf7(0x112)]?'🛑':'🔄',_0x62a6f6=_0xf513a3[_0x190bf7(0x112)]?a52_0x4d046d[_0x190bf7(0x243)]:a52_0x4d046d[_0x190bf7(0x201)]):(_0x26d695=_0xf513a3[_0x190bf7(0x1d4)]?'✅':'❌',_0x62a6f6=_0xf513a3[_0x190bf7(0x1d4)]?a52_0x4d046d[_0x190bf7(0x27d)]:a52_0x4d046d[_0x190bf7(0x1b2)]);}else _0x26d695='⏳',_0x62a6f6=a52_0x4d046d[_0x190bf7(0x12c)];const _0x5cdac9='#'+_0x164aa7,_0x714beb=_0x4e4048?hyperlink(_0x5cdac9,getWorkflowSessionUrl(_0xb2587d,_0x4e4048,_0x164aa7)):_0x5cdac9;let _0x4a4a7d=_0x10a511;stringWidth(_0x10a511)>_0x5e70c5&&(_0x4a4a7d=_0x10a511[_0x190bf7(0x111)](0x0,_0x5e70c5-0x1)+'…');const _0x515200=a52_0x4d046d['dim'](_0x4a4a7d),_0x2fb4f5=stringWidth(_0x4a4a7d),_0x4cfcc3='\x20'['repeat'](_0x4f8ce6-stringWidth(_0x4a4a7d)+0x2),_0x3a8d5e='('+formatElapsed(_0x2bdb3a)+')',_0x14055b=stringWidth(_0x3a8d5e),_0x15ea08=stringWidth(_0x5cdac9),_0x175f4b=_0x15ea08+0x1+_0x2fb4f5+_0x4cfcc3[_0x190bf7(0x276)],_0x29233d=_0x272d55-_0x175f4b-_0x14055b-0x1-0x8;let _0x1c9b90=_0x3f8bcc;stringWidth(_0x1c9b90)>_0x29233d&&(_0x1c9b90=_0x1c9b90[_0x190bf7(0x111)](0x0,_0x29233d-0x1)+'…');const _0x261808=_0x714beb+'\x20'+_0x515200+_0x4cfcc3+_0x1c9b90,_0x52e6e9=stringWidth(_0x261808),_0x9bdca4=_0x272d55-_0x52e6e9-_0x14055b,_0x5106e7=_0x261808+'\x20'[_0x190bf7(0x291)](Math[_0x190bf7(0x1c1)](0x1,_0x9bdca4))+a52_0x4d046d[_0x190bf7(0x12c)](_0x3a8d5e),_0x92d361=Math[_0x190bf7(0x26e)]((_0x291c06-_0xa0704a)/_0x5b4a73),_0x599393=Math[_0x190bf7(0x26e)]((_0x2bdd4d-_0xa0704a)/_0x5b4a73),_0x18339c=Math[_0x190bf7(0x1c1)](_0x92d361+0x1,_0x599393),_0x452b41=new Array(_0x1c4c83)['fill']('\x20');for(let _0x294403=_0x92d361;_0x294403<Math['min'](_0x18339c,_0x1c4c83);_0x294403++){_0x452b41[_0x294403]='─';}const _0x4cafc0=_0x452b41[_0x190bf7(0x241)](_0x52ff39=>_0x52ff39==='\x20'?'\x20':_0x62a6f6(_0x52ff39))[_0x190bf7(0x17a)]('');_0xf84fe5[_0x190bf7(0x1d8)](_0x26d695+'\x20'+_0x5106e7+'│'+_0x4cafc0+'│');}return _0xf84fe5[_0x190bf7(0x17a)]('\x0a');}async['navigateSessionsInteractive'](_0x2f9ce1,_0x43ca0c,_0x3db76c){const _0x158faf=a52_0x4f3203,{options:_0x45f39d,tdx:_0x2c32ff}=_0x43ca0c,_0x439a64=_0x45f39d[_0x158faf(0x245)],{timelineRows:_0x2a88b9,timeAxisHeader:_0x462250}=this[_0x158faf(0x249)](_0x2f9ce1,_0x439a64),_0xe644f7=_0x2a88b9[_0x158faf(0x25d)](_0x3f148b=>_0x3f148b[_0x158faf(0x194)]);if(_0xe644f7[_0x158faf(0x276)]===0x0){const _0x1f537e=this[_0x158faf(0xeb)](_0x2f9ce1,_0x439a64);console['log'](_0x1f537e);!_0x3db76c&&(console[_0x158faf(0x106)](''),console[_0x158faf(0x106)](a52_0x4d046d[_0x158faf(0x12c)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a52_0x4d046d[_0x158faf(0x12c)](_0x158faf(0x149))+'or'+a52_0x4d046d[_0x158faf(0x12c)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x462250&&console[_0x158faf(0x10b)](_0x462250);const _0x1ebe72=_0x2a88b9[_0x158faf(0x25d)](_0xa44f92=>_0xa44f92['attemptId'])[_0x158faf(0x241)](_0x10dc53=>({'title':_0x10dc53[_0x158faf(0x262)],'value':_0x10dc53[_0x158faf(0x194)]})),_0xe63433=process[_0x158faf(0x1e2)]['rows']||0x3c,_0x24ada8=Math[_0x158faf(0x1c1)](0x28,Math[_0x158faf(0x26e)](_0xe63433*0x2/0x3)),_0x197151=await a52_0x42cbf7({'type':_0x158faf(0x20d),'name':_0x158faf(0x194),'message':_0x158faf(0x258),'choices':_0x1ebe72,'initial':-0x1,'limit':_0x24ada8,'clearFirst':!![],'fallback':{'title':_0x158faf(0x20c),'value':null},'suggest':(_0x2f01a4,_0x55113b)=>{if(!_0x2f01a4)return Promise['resolve'](_0x55113b);const _0x399a63=_0x55113b['filter'](_0x35169d=>{const _0x36d741=a52_0xcd02,_0x529f21=_0x35169d;return _0x529f21[_0x36d741(0x18b)]['toLowerCase']()[_0x36d741(0x23b)](_0x2f01a4['toLowerCase']());});return Promise['resolve'](_0x399a63);}}),_0x5ce3a5=()=>{const _0x224d07=_0x158faf;process[_0x224d07(0x1e2)][_0x224d07(0x113)](_0x224d07(0x272)),process[_0x224d07(0x1e2)][_0x224d07(0x113)](_0x224d07(0x272)),process['stdout'][_0x224d07(0x113)](_0x224d07(0x272));},_0x1b644f=_0x197151&&_0x197151[_0x158faf(0x194)]&&_0x197151[_0x158faf(0x194)]!==null&&_0x197151['attemptId']['trim']()!=='';if(!_0x1b644f){_0x5ce3a5(),console[_0x158faf(0x10b)](a52_0x4d046d[_0x158faf(0x12c)](_0x158faf(0x286)));return;}_0x5ce3a5();const _0x3d580a=_0x2f9ce1[_0x158faf(0x177)](_0x4e3fbe=>_0x4e3fbe[_0x158faf(0x10f)]?.['id']===_0x197151[_0x158faf(0x194)]);if(_0x3d580a){const _0xbc2a82=_0x3d580a[_0x158faf(0x1a4)]?.[_0x158faf(0x184)]||'?',_0x21937b=_0x3d580a[_0x158faf(0x17b)]?.['name']||'?';console[_0x158faf(0x10b)](_0x158faf(0x117)+a52_0x4d046d['dim'](_0xbc2a82)+_0x158faf(0x174)+a52_0x4d046d[_0x158faf(0x12c)](_0x21937b));}const _0x1736c9=new WorkflowTimelineCommand();await _0x1736c9['execute']({'args':[],'options':{..._0x45f39d,'attemptId':_0x197151[_0x158faf(0x194)]},'tdx':_0x2c32ff});}[a52_0x4f3203(0x249)](_0x5f52a5,_0xef4808){const _0x4a9650=a52_0x4f3203,_0x30197a=new Map();for(const _0x56229d of _0x5f52a5){_0x56229d['id']&&_0x56229d[_0x4a9650(0x10f)]?.['id']&&_0x30197a[_0x4a9650(0x13b)](_0x56229d['id'],_0x56229d['lastAttempt']['id']);}const _0x22d905=[];let _0x4eff15='';const _0x1101aa=this[_0x4a9650(0xeb)](_0x5f52a5,_0xef4808),_0x5d3b82=_0x1101aa['split']('\x0a');for(const _0x59e807 of _0x5d3b82){if(_0x59e807['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x59e807['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x4eff15=_0x59e807;else{if(_0x59e807['match'](/^[✅❌🔄🛑⏳]/)){const _0x4ec7cd=_0x59e807[_0x4a9650(0x24c)](/#(\d+)/),_0x43a711=_0x4ec7cd?_0x4ec7cd[0x1]:null,_0xe92744=_0x43a711?_0x30197a[_0x4a9650(0x1ca)](_0x43a711)||null:null,_0x5e78e0=_0x5f52a5[_0x4a9650(0x177)](_0x27a2b4=>_0x27a2b4['id']===_0x43a711),_0x278496=_0x5e78e0?.[_0x4a9650(0x1a4)]?.[_0x4a9650(0x184)]||'';_0x22d905[_0x4a9650(0x1d8)]({'displayLine':_0x59e807,'attemptId':_0xe92744,'projectName':_0x278496});}}}return{'timelineRows':_0x22d905,'timeAxisHeader':_0x4eff15};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a52_0x4f3203(0x251);['description']=a52_0x4f3203(0x1bd);async[a52_0x4f3203(0x19d)](_0xe3485){const _0x2ee7cc=a52_0x4f3203,{options:_0x2d56b6,args:_0x2f395c,tdx:_0x1117d1}=_0xe3485,_0x1a6716=this[_0x2ee7cc(0x1b0)](_0x2f395c,_0x2d56b6);if(!_0x1a6716)return 0x1;const {projectName:_0x4c6998,workflowName:_0x56b82a}=_0x1a6716,_0x1ebf47=_0x2d56b6['includeRetried'];if(_0x2d56b6[_0x2ee7cc(0x103)]){if(_0x4c6998&&_0x56b82a)console['error'](_0x2ee7cc(0x1b9)+_0x4c6998+'.'+_0x56b82a);else _0x4c6998&&console[_0x2ee7cc(0x106)]('Filter:\x20project='+_0x4c6998);_0x1ebf47&&console[_0x2ee7cc(0x106)](_0x2ee7cc(0x21d));}const _0x3cd4cc=await withSpinner(_0x2ee7cc(0x162),()=>_0x1117d1[_0x2ee7cc(0x17b)][_0x2ee7cc(0xef)]({'projectName':_0x4c6998,'workflowName':_0x56b82a,'includeRetried':_0x1ebf47,'limit':_0x2d56b6['limit']}),{'verbose':_0x2d56b6[_0x2ee7cc(0x103)]}),_0x317403=_0x3cd4cc['data'],_0x297741=_0x2d56b6[_0x2ee7cc(0x216)]||0x64,_0x8b8bf1=_0x317403[_0x2ee7cc(0x276)]>=_0x297741?a52_0x4d046d[_0x2ee7cc(0x12c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x2ee7cc(0x106)]('✔\x20Found\x20'+_0x317403['length']+_0x2ee7cc(0x25e)+(_0x317403[_0x2ee7cc(0x276)]!==0x1?'s':'')+_0x8b8bf1);if(_0x2d56b6[_0x2ee7cc(0x24a)]===_0x2ee7cc(0xea)||_0x2d56b6['format']==='jsonl'||_0x2d56b6['format']==='table')await handleSDKOutput(_0x317403,_0x2d56b6);else{if(_0x317403[_0x2ee7cc(0x276)]===0x0){if(_0x4c6998&&_0x56b82a)console[_0x2ee7cc(0x10b)](_0x2ee7cc(0x1a6)+_0x4c6998+'.'+_0x56b82a);else _0x4c6998?console[_0x2ee7cc(0x10b)](_0x2ee7cc(0x182)+_0x4c6998):console[_0x2ee7cc(0x10b)](_0x2ee7cc(0x26b));}else{const _0x3617ad=_0x2d56b6[_0x2ee7cc(0x245)],_0x39c042=_0x317403[_0x2ee7cc(0x241)](_0x319247=>{const _0x37b130=_0x2ee7cc,_0x27d593=a52_0x4d046d[_0x37b130(0x12c)]('#'+_0x319247['id']),_0x102908=_0x319247[_0x37b130(0x1a4)]?.['id'],_0x10d056=_0x319247[_0x37b130(0x278)]||_0x319247[_0x37b130(0x17e)],_0x16e0c5=_0x102908&&_0x10d056?hyperlink(_0x27d593,getWorkflowAttemptUrl(_0x3617ad,_0x102908,_0x10d056,_0x319247['id'])):_0x27d593,{icon:_0xbd2f86,text:_0x37dd04}=getAttemptStatusDisplay(_0x319247),_0x56bf43=(_0x319247['project']?.[_0x37b130(0x184)]||'?')+'.'+(_0x319247[_0x37b130(0x17b)]?.[_0x37b130(0x184)]||'?'),_0x3df81b=_0x319247['sessionTime']?a52_0x4d046d[_0x37b130(0x12c)](_0x319247[_0x37b130(0x17f)]):'';return(_0x16e0c5+'\x20'+_0xbd2f86+(_0x37dd04?'\x20'+_0x37dd04:'')+'\x20'+_0x56bf43+'\x20'+_0x3df81b)['trimEnd']();});await writeOutput(_0x39c042[_0x2ee7cc(0x17a)]('\x0a'),_0x2d56b6[_0x2ee7cc(0x115)],_0x2ee7cc(0x190));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a52_0x4f3203(0x147);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x1d9);async['execute'](_0x3e01bd){const _0x2cf74b=a52_0x4f3203,{options:_0x1e51e7,args:_0x523340,tdx:_0x48a6ab}=_0x3e01bd,_0x5cbc4d=_0x523340[0x0];if(!_0x5cbc4d)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x1e51e7[_0x2cf74b(0x103)]&&console[_0x2cf74b(0x106)](_0x2cf74b(0x12f)+_0x5cbc4d);const _0x2cd915=await withSpinner(_0x2cf74b(0x294),()=>_0x48a6ab[_0x2cf74b(0x17b)][_0x2cf74b(0x257)](_0x5cbc4d),{'verbose':_0x1e51e7['verbose']}),_0x1bc24c=_0x2cd915['data'];let _0xd4d7d5;!_0x1bc24c[_0x2cf74b(0x1ee)]?_0xd4d7d5=_0x1bc24c['cancelRequested']?_0x2cf74b(0x255):_0x2cf74b(0x266):_0xd4d7d5=_0x1bc24c['success']?_0x2cf74b(0x1d4):_0x2cf74b(0x106);let _0x318e36;if(_0x1bc24c[_0x2cf74b(0x100)]&&_0x1bc24c['finishedAt']){const _0x2a971a=new Date(_0x1bc24c[_0x2cf74b(0x100)])[_0x2cf74b(0x22d)](),_0x560280=new Date(_0x1bc24c[_0x2cf74b(0x270)])[_0x2cf74b(0x22d)]();_0x318e36=Math[_0x2cf74b(0x1f7)]((_0x560280-_0x2a971a)/0x3e8);}const _0x52996f={'attempt_id':_0x1bc24c['id'],'status':_0xd4d7d5,..._0x1bc24c['index']!==undefined&&{'index':_0x1bc24c[_0x2cf74b(0x153)]},..._0x1bc24c[_0x2cf74b(0x1a4)]&&{'project':_0x1bc24c['project']['name']},..._0x1bc24c['workflow']&&{'workflow':_0x1bc24c[_0x2cf74b(0x17b)][_0x2cf74b(0x184)]},..._0x1bc24c[_0x2cf74b(0x17e)]&&{'session_id':_0x1bc24c[_0x2cf74b(0x17e)]},..._0x1bc24c['sessionTime']&&{'session_time':_0x1bc24c[_0x2cf74b(0x17f)]},..._0x1bc24c[_0x2cf74b(0x263)]&&{'retry_attempt':_0x1bc24c['retryAttemptName']},..._0x318e36!==undefined&&{'duration_sec':_0x318e36},..._0x1bc24c[_0x2cf74b(0x100)]&&{'created_at':_0x1bc24c[_0x2cf74b(0x100)]},..._0x1bc24c['finishedAt']&&{'finished_at':_0x1bc24c[_0x2cf74b(0x270)]},...Object['keys'](_0x1bc24c['params'])[_0x2cf74b(0x276)]>0x0&&{'params':_0x1bc24c[_0x2cf74b(0x1fb)]}};return await handleSingleObjectOutput(_0x52996f,_0x1e51e7),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x195);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0xf2);async['execute'](_0x18fa8e){const _0x39cb2a=a52_0x4f3203,{options:_0x1a1191,args:_0x3a90ac,tdx:_0x90cf84}=_0x18fa8e,_0x31a2ce=_0x3a90ac[0x0];if(!_0x31a2ce)return console[_0x39cb2a(0x106)](_0x39cb2a(0x16a)),0x1;const _0x5c7d1b=_0x1a1191['includeSubtasks'];_0x1a1191['verbose']&&(console[_0x39cb2a(0x106)](_0x39cb2a(0x12f)+_0x31a2ce),_0x5c7d1b&&console['error'](_0x39cb2a(0x29d)));const _0x3826f7=await withSpinner(_0x39cb2a(0x143),()=>_0x90cf84[_0x39cb2a(0x17b)][_0x39cb2a(0x233)](_0x31a2ce,_0x5c7d1b||![]),{'verbose':_0x1a1191[_0x39cb2a(0x103)]}),_0xbca83f=_0x3826f7[_0x39cb2a(0x11b)];return console[_0x39cb2a(0x106)](_0x39cb2a(0x1e6)+_0xbca83f[_0x39cb2a(0x276)]+'\x20task'+(_0xbca83f[_0x39cb2a(0x276)]!==0x1?'s':'')),await handleSDKOutput(_0xbca83f,_0x1a1191),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a52_0x4f3203(0x184)]='workflow:logs';[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x1da);async['execute'](_0x3c03c2){const _0x7801a2=a52_0x4f3203,{options:_0x65f893,args:_0x33c41f,tdx:_0x3f1916}=_0x3c03c2,_0x2a426b=_0x33c41f[0x0];let _0x121432=_0x33c41f[0x1];if(!_0x2a426b)return console[_0x7801a2(0x106)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x65f893[_0x7801a2(0x103)]&&(console['error'](_0x7801a2(0x12f)+_0x2a426b),_0x121432&&console['error'](_0x7801a2(0x23e)+_0x121432));const _0x24ac97=await withSpinner(_0x7801a2(0x1ab),()=>_0x3f1916['workflow'][_0x7801a2(0x163)](_0x2a426b,_0x121432),{'verbose':_0x65f893[_0x7801a2(0x103)]}),_0x226fc0=_0x24ac97[_0x7801a2(0x11b)];if(_0x226fc0[_0x7801a2(0x276)]===0x0)return console['error'](_0x7801a2(0x296)),0x0;if(!_0x121432&&(_0x65f893[_0x7801a2(0xea)]||_0x65f893[_0x7801a2(0x24a)]))return await handleSDKOutput(_0x226fc0,_0x65f893),0x0;if(!_0x121432){const _0x11dc63=_0x226fc0[_0x7801a2(0x241)](_0x469291=>({'title':_0x469291[_0x7801a2(0x197)]+'\x20('+formatBytes(_0x469291[_0x7801a2(0x21b)])+')','value':_0x469291[_0x7801a2(0x197)]})),_0x3c1f58=await a52_0x42cbf7({'type':_0x7801a2(0x254),'name':_0x7801a2(0x107),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x11dc63});if(!_0x3c1f58['task'])return console['error'](_0x7801a2(0x286)),0x0;_0x121432=_0x3c1f58[_0x7801a2(0x107)];}const _0x1c3744=await withSpinner(_0x7801a2(0x281),()=>_0x3f1916[_0x7801a2(0x17b)][_0x7801a2(0x12e)](_0x2a426b,_0x121432),{'verbose':_0x65f893[_0x7801a2(0x103)]}),_0x16e2a0=_0x1c3744[_0x7801a2(0x11b)];return _0x16e2a0?console[_0x7801a2(0x10b)](_0x16e2a0):console[_0x7801a2(0x106)](_0x7801a2(0x27e)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x160);['description']=a52_0x4f3203(0xf7);async['execute'](_0x531fca){const _0x23c95e=a52_0x4f3203,{options:_0x52dac8,args:_0x574e66,tdx:_0x2bfe1e}=_0x531fca,_0x16211f=_0x574e66[0x0];if(!_0x16211f)return console[_0x23c95e(0x106)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x3e9d7a=_0x52dac8['reason'];_0x52dac8[_0x23c95e(0x103)]&&(console[_0x23c95e(0x106)](_0x23c95e(0x12f)+_0x16211f),_0x3e9d7a&&console['error'](_0x23c95e(0x1ea)+_0x3e9d7a));if(!_0x52dac8[_0x23c95e(0x1d7)]){if(!isInteractive())return console[_0x23c95e(0x106)](a52_0x4d046d['red'](_0x23c95e(0x131)),_0x23c95e(0x275)),console['error'](a52_0x4d046d[_0x23c95e(0x12c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4a3035=await confirmKey(_0x23c95e(0x18d)+_0x16211f+'?');if(!_0x4a3035)return console[_0x23c95e(0x106)](a52_0x4d046d['yellow'](_0x23c95e(0x286))),0x1;}const _0x3e4381=await withSpinner(_0x23c95e(0x22a),()=>_0x2bfe1e[_0x23c95e(0x17b)][_0x23c95e(0x29a)](_0x16211f,_0x3e9d7a),{'verbose':_0x52dac8[_0x23c95e(0x103)]}),_0x3c5b20=_0x3e4381[_0x23c95e(0x11b)];return console[_0x23c95e(0x106)]('✔\x20'+_0x3c5b20),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x215);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x104);async[a52_0x4f3203(0x19d)](_0x3bd31b){const _0x1f3ce3=a52_0x4f3203,{options:_0x15d76b,args:_0x14758a,tdx:_0x2b530c}=_0x3bd31b,_0x163f3b=_0x14758a[0x0];if(!_0x163f3b)return console[_0x1f3ce3(0x106)](_0x1f3ce3(0x227)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x9005d3=![],_0x2aa543=_0x163f3b;if(_0x163f3b[_0x1f3ce3(0x19f)](_0x1f3ce3(0x1e8)))_0x9005d3=!![],_0x2aa543=_0x163f3b['substring'](0x8);else{if(_0x163f3b[_0x1f3ce3(0x19f)](_0x1f3ce3(0x1c5)))_0x9005d3=![],_0x2aa543=_0x163f3b[_0x1f3ce3(0x210)](0x8);else return console[_0x1f3ce3(0x106)](_0x1f3ce3(0x126)),console['error'](_0x1f3ce3(0x1e4)),0x1;}const _0x45cfc4=_0x15d76b[_0x1f3ce3(0x279)],_0x54d646=_0x15d76b[_0x1f3ce3(0x11f)],_0x25eedd=_0x15d76b[_0x1f3ce3(0x1fb)],_0x3418e2=_0x15d76b['force'];_0x15d76b[_0x1f3ce3(0x103)]&&(console[_0x1f3ce3(0x106)](_0x1f3ce3(0x161)+(_0x9005d3?_0x1f3ce3(0x204):'attempt')+'\x20'+_0x2aa543),_0x45cfc4&&console[_0x1f3ce3(0x106)](_0x1f3ce3(0xee)+_0x45cfc4),_0x54d646&&console[_0x1f3ce3(0x106)](_0x1f3ce3(0x13c)+_0x54d646),_0x25eedd&&console[_0x1f3ce3(0x106)](_0x1f3ce3(0x1a0)+_0x25eedd),_0x3418e2&&console[_0x1f3ce3(0x106)](_0x1f3ce3(0x133)));let _0x33d2c2;if(_0x25eedd)try{if(_0x25eedd[_0x1f3ce3(0x19f)]('@')){const _0x3894b3=await import(_0x1f3ce3(0x26d)),_0x374a45=_0x25eedd[_0x1f3ce3(0x210)](0x1),_0x3fd63d=await _0x3894b3[_0x1f3ce3(0x127)](_0x374a45,'utf-8');_0x33d2c2=JSON['parse'](_0x3fd63d);}else _0x33d2c2=JSON[_0x1f3ce3(0x16d)](_0x25eedd);}catch{return console[_0x1f3ce3(0x106)](_0x1f3ce3(0x1d0)),0x1;}if(!_0x15d76b[_0x1f3ce3(0x1d7)]){if(!isInteractive())return console[_0x1f3ce3(0x106)](a52_0x4d046d['red']('\x0aError:'),_0x1f3ce3(0x275)),console[_0x1f3ce3(0x106)](a52_0x4d046d[_0x1f3ce3(0x12c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x510e71=await confirmKey(_0x1f3ce3(0x292)+(_0x9005d3?'session':_0x1f3ce3(0x257))+'\x20'+_0x2aa543+'?');if(!_0x510e71)return console[_0x1f3ce3(0x106)](a52_0x4d046d['yellow'](_0x1f3ce3(0x286))),0x1;}let _0xf86c0a;_0x9005d3?_0xf86c0a=await withSpinner('Retrying\x20session...',()=>_0x2b530c[_0x1f3ce3(0x17b)]['retrySession'](_0x2aa543,{'fromTask':_0x45cfc4,'retryParams':_0x33d2c2}),{'verbose':_0x15d76b['verbose']}):_0xf86c0a=await withSpinner('Retrying\x20attempt...',()=>_0x2b530c[_0x1f3ce3(0x17b)]['retryAttempt'](_0x2aa543,{'resumeFrom':_0x54d646,'retryParams':_0x33d2c2,'force':_0x3418e2}),{'verbose':_0x15d76b[_0x1f3ce3(0x103)]});const _0x21c3ab=_0xf86c0a['data'];return console[_0x1f3ce3(0x106)](_0x1f3ce3(0x231)),console['error'](_0x1f3ce3(0x29b)+_0x21c3ab[_0x1f3ce3(0x194)]),console[_0x1f3ce3(0x106)](_0x1f3ce3(0x21c)+_0x21c3ab[_0x1f3ce3(0x17e)]),0x0;}}function a52_0xcd02(_0x41c625,_0x350abf){_0x41c625=_0x41c625-0xe9;const _0x2669bd=a52_0x2669();let _0xcd0252=_0x2669bd[_0x41c625];return _0xcd0252;}export class WorkflowRunCommand extends WorkflowBaseCommand{[a52_0x4f3203(0x184)]='workflow:run';[a52_0x4f3203(0x12d)]='Start\x20a\x20workflow\x20run';async[a52_0x4f3203(0x19d)](_0x507136){const _0x31cf19=a52_0x4f3203,{options:_0x384f7a,args:_0x190d69,tdx:_0x180102}=_0x507136;let _0x17e642=_0x190d69[0x0];if(!_0x17e642){const _0x10fc59=this[_0x31cf19(0x1e7)]([],_0x384f7a),_0x73ce87=await withSpinner('Loading\x20workflows...',()=>_0x180102[_0x31cf19(0x17b)]['workflows'](_0x10fc59,{'limit':_0x384f7a['limit']}),{'verbose':_0x384f7a[_0x31cf19(0x103)]}),_0x108fd8=_0x73ce87[_0x31cf19(0x11b)];if(_0x108fd8[_0x31cf19(0x276)]===0x0)return console[_0x31cf19(0x106)]('No\x20workflows\x20found'),!_0x10fc59&&console[_0x31cf19(0x106)](a52_0x4d046d[_0x31cf19(0x12c)](_0x31cf19(0x1dd))),0x1;const _0x299f10=_0x108fd8[_0x31cf19(0x241)](_0x382388=>({'title':_0x382388[_0x31cf19(0x1a4)]?.['name']+'.'+_0x382388[_0x31cf19(0x184)],'value':_0x382388[_0x31cf19(0x1a4)]?.[_0x31cf19(0x184)]+'.'+_0x382388['name'],'description':_0x382388[_0x31cf19(0x1fa)]?_0x31cf19(0x10d)+_0x382388[_0x31cf19(0x1fa)]:undefined})),_0x54cf80=await a52_0x42cbf7({'type':_0x31cf19(0x254),'name':_0x31cf19(0x17b),'message':_0x31cf19(0x299),'choices':_0x299f10});if(!_0x54cf80['workflow'])return 0x1;_0x17e642=_0x54cf80[_0x31cf19(0x17b)];}if(!_0x17e642[_0x31cf19(0x23b)]('.')){const _0x351ca5=this[_0x31cf19(0x1e7)]([],_0x384f7a);if(_0x351ca5)_0x17e642=_0x351ca5+'.'+_0x17e642;else return console[_0x31cf19(0x106)](a52_0x4d046d['red'](_0x31cf19(0x19c)),_0x31cf19(0x284)),console[_0x31cf19(0x106)](a52_0x4d046d[_0x31cf19(0x12c)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0xb4e2b0=_0x384f7a['param'],_0x5e5aeb=_0x384f7a[_0x31cf19(0x17f)],_0x782b68={};if(_0xb4e2b0&&Array[_0x31cf19(0x123)](_0xb4e2b0))for(const _0xe12d15 of _0xb4e2b0){const _0x50ba93=_0xe12d15[_0x31cf19(0x10e)]('=');if(_0x50ba93===-0x1)return console['error'](_0x31cf19(0x1d3)+_0xe12d15),console[_0x31cf19(0x106)](_0x31cf19(0x114)),0x1;const _0x344a5f=_0xe12d15['substring'](0x0,_0x50ba93),_0xd0d74a=_0xe12d15['substring'](_0x50ba93+0x1);try{_0x782b68[_0x344a5f]=JSON['parse'](_0xd0d74a);}catch{_0x782b68[_0x344a5f]=_0xd0d74a;}}_0x384f7a['verbose']&&(console[_0x31cf19(0x106)]('Workflow:\x20'+_0x17e642),Object[_0x31cf19(0xff)](_0x782b68)[_0x31cf19(0x276)]>0x0&&console[_0x31cf19(0x106)](_0x31cf19(0x214)+JSON['stringify'](_0x782b68)),_0x5e5aeb&&console['error'](_0x31cf19(0x26c)+_0x5e5aeb));const _0x34b253=await withSpinner(_0x31cf19(0x187),()=>_0x180102['workflow'][_0x31cf19(0x219)](_0x17e642,_0x782b68,{'sessionTime':_0x5e5aeb}),{'verbose':_0x384f7a['verbose']}),_0x2fdded=_0x34b253[_0x31cf19(0x11b)];console['error']('✔\x20Workflow\x20run\x20started'),console[_0x31cf19(0x106)]('\x20\x20Attempt\x20ID:\x20'+_0x2fdded['id']),console[_0x31cf19(0x106)](_0x31cf19(0x21c)+_0x2fdded[_0x31cf19(0x17e)]),console[_0x31cf19(0x106)](_0x31cf19(0x205)+_0x2fdded[_0x31cf19(0x1a4)]?.[_0x31cf19(0x184)]),console[_0x31cf19(0x106)]('\x20\x20Workflow:\x20'+_0x2fdded[_0x31cf19(0x17b)]?.[_0x31cf19(0x184)]);if(_0x2fdded[_0x31cf19(0x1a4)]?.['id']&&_0x2fdded[_0x31cf19(0x17e)]&&_0x2fdded['id']){const _0x3c9b31=_0x384f7a[_0x31cf19(0x245)],_0x3bb331=getConsoleUrl(_0x3c9b31,'/app/workflows/'+_0x2fdded[_0x31cf19(0x1a4)]['id']+_0x31cf19(0x1b4)+_0x2fdded['sessionId']+_0x31cf19(0x12a)+_0x2fdded['id']);console[_0x31cf19(0x106)]('\x20\x20Console:\x20'+a52_0x4d046d[_0x31cf19(0x1f1)](_0x3bb331));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a52_0x4f3203(0x102);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x172);async[a52_0x4f3203(0x19d)](_0x297015){const _0x50673a=a52_0x4f3203,{options:_0x474df5,args:_0x4faa9f,tdx:_0xd33bdb}=_0x297015,_0x5ada5c=_0x4faa9f[0x0],_0xeb318a=_0x4faa9f[0x1]||'.';if(!_0x5ada5c)return console[_0x50673a(0x106)](_0x50673a(0x13a)),console[_0x50673a(0x106)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x46e111=_0x474df5[_0x50673a(0x1fa)];_0x474df5[_0x50673a(0x103)]&&(console['error'](_0x50673a(0x117)+_0x5ada5c),console[_0x50673a(0x106)](_0x50673a(0x28b)+_0xeb318a),_0x46e111&&console[_0x50673a(0x106)](_0x50673a(0x108)+_0x46e111));const _0x446791=await withSpinner(_0x50673a(0x13f)+_0x5ada5c+_0x50673a(0x1de),()=>_0xd33bdb[_0x50673a(0x17b)][_0x50673a(0x1f9)](_0x5ada5c,_0xeb318a,{'revision':_0x46e111}),{'verbose':_0x474df5[_0x50673a(0x103)]}),_0x36b69=_0x446791[_0x50673a(0x11b)];return console[_0x50673a(0x106)](_0x50673a(0x287)+_0x36b69[_0x50673a(0x176)]),console['error'](_0x50673a(0x18e)+_0x36b69[_0x50673a(0x1fa)]),console[_0x50673a(0x106)](_0x50673a(0x1dc)+_0x36b69[_0x50673a(0x244)]),console['error']('\x20\x20Location:\x20'+_0xeb318a+'/'+_0x36b69[_0x50673a(0x176)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0xf3);['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x502b18){const _0x281fc4=a52_0x4f3203,{options:_0x2e68c0,args:_0x2ba304,tdx:_0x2f91ec}=_0x502b18;let _0x5adeec='.',_0x5c6e91=_0x2e68c0[_0x281fc4(0x184)];if(_0x2ba304[0x0]){const {promises:_0x473027}=await import('fs');try{const _0x5dea48=await _0x473027[_0x281fc4(0x1c2)](_0x2ba304[0x0]);if(_0x5dea48[_0x281fc4(0x1cf)]())_0x5adeec=_0x2ba304[0x0];else return console[_0x281fc4(0x106)]('Error:\x20'+_0x2ba304[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x5c6e91=_0x2ba304[0x0],_0x5adeec='.';}}const _0x5d2095=_0x2e68c0['revision'],_0x31c6d7=_0x2e68c0[_0x281fc4(0x25c)];_0x2e68c0[_0x281fc4(0x103)]&&(console[_0x281fc4(0x106)](_0x281fc4(0x15f)+_0x5adeec),_0x5c6e91&&console[_0x281fc4(0x106)](_0x281fc4(0x15a)+_0x5c6e91),_0x5d2095&&console[_0x281fc4(0x106)](_0x281fc4(0x108)+_0x5d2095),_0x31c6d7&&console[_0x281fc4(0x106)]('Validation:\x20skipped'));const _0x322e78=await withSpinner(_0x281fc4(0x10a),()=>_0x2f91ec[_0x281fc4(0x17b)][_0x281fc4(0x1d8)](_0x5adeec,{'projectName':_0x5c6e91,'revision':_0x5d2095,'skipValidation':_0x31c6d7}),{'verbose':_0x2e68c0['verbose']}),_0xfe1f7=_0x322e78[_0x281fc4(0x11b)];return console[_0x281fc4(0x106)](_0x281fc4(0x282)+_0xfe1f7[_0x281fc4(0x176)]),console[_0x281fc4(0x106)](_0x281fc4(0x1a9)+_0xfe1f7[_0x281fc4(0x170)]),console[_0x281fc4(0x106)](_0x281fc4(0x18e)+_0xfe1f7[_0x281fc4(0x1fa)]),await this[_0x281fc4(0x253)](_0x2f91ec,_0xfe1f7[_0x281fc4(0x176)],_0x2e68c0['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x166);[a52_0x4f3203(0x12d)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a52_0x4f3203(0x19d)](_0x296366){const _0x24fed5=a52_0x4f3203,{options:_0x13502d,args:_0x19d111,tdx:_0x3b35cf}=_0x296366,_0x5d5f06=_0x19d111[0x0],_0x64259f=_0x19d111[0x1];if(!_0x5d5f06)return console[_0x24fed5(0x106)](a52_0x4d046d['red'](_0x24fed5(0x19c)),_0x24fed5(0x1a1)),console['error'](a52_0x4d046d[_0x24fed5(0x12c)](_0x24fed5(0x119))),0x1;const _0x32d8b3=_0x13502d['revision'];_0x13502d[_0x24fed5(0x103)]&&(console[_0x24fed5(0x106)](_0x24fed5(0x117)+_0x5d5f06),_0x64259f&&console['error'](_0x24fed5(0x1bf)+_0x64259f),_0x32d8b3&&console['error'](_0x24fed5(0x108)+_0x32d8b3),_0x13502d[_0x24fed5(0x283)]&&console[_0x24fed5(0x106)](_0x24fed5(0x1a3)));const _0x391396=await withSpinner(_0x24fed5(0x169)+_0x5d5f06+'...',()=>_0x3b35cf['workflow'][_0x24fed5(0x156)](_0x5d5f06,{'targetDir':_0x64259f,'revision':_0x32d8b3}),{'verbose':_0x13502d[_0x24fed5(0x103)]}),_0x4785c1=_0x391396[_0x24fed5(0x11b)];_0x4785c1[_0x24fed5(0x121)]?console['error'](_0x24fed5(0x18a)+_0x4785c1['projectName']):console['error'](_0x24fed5(0x211)+_0x4785c1[_0x24fed5(0x176)]);console['error'](_0x24fed5(0x18e)+_0x4785c1[_0x24fed5(0x1fa)]),console[_0x24fed5(0x106)](_0x24fed5(0x24f)+(a52_0x59b294[_0x24fed5(0x261)](process[_0x24fed5(0x1ba)](),_0x4785c1[_0x24fed5(0x1f3)])||'.')),console[_0x24fed5(0x106)](_0x24fed5(0x222)+a52_0x4d046d[_0x24fed5(0x27d)]('+'+_0x4785c1[_0x24fed5(0x146)][_0x24fed5(0x23a)]+_0x24fed5(0x289))+',\x20'+(a52_0x4d046d['yellow']('~'+_0x4785c1[_0x24fed5(0x146)][_0x24fed5(0x1eb)]+_0x24fed5(0x125))+',\x20')+(a52_0x4d046d[_0x24fed5(0x1b2)]('-'+_0x4785c1['summary'][_0x24fed5(0x144)]+_0x24fed5(0x11a))+',\x20')+(''+a52_0x4d046d[_0x24fed5(0x12c)](_0x4785c1[_0x24fed5(0x146)]['unchanged']+_0x24fed5(0x185))));for(const _0x1f96f8 of _0x4785c1[_0x24fed5(0x19b)]){_0x1f96f8[_0x24fed5(0xf9)]==='modified'&&_0x1f96f8[_0x24fed5(0x234)]&&(console[_0x24fed5(0x106)]('\x0a'+a52_0x4d046d[_0x24fed5(0x1f1)](_0x24fed5(0x220)+_0x1f96f8[_0x24fed5(0x145)])),console[_0x24fed5(0x106)](_0x1f96f8[_0x24fed5(0x234)]));}if(!_0x4785c1[_0x24fed5(0x1f5)])return saveSessionContext({'workflow_project':_0x4785c1[_0x24fed5(0x176)]},_0x13502d['session']),console[_0x24fed5(0x106)](a52_0x4d046d[_0x24fed5(0x27d)](_0x24fed5(0x232))),console[_0x24fed5(0x106)](a52_0x4d046d[_0x24fed5(0x12c)](_0x24fed5(0x1cd)+_0x4785c1[_0x24fed5(0x176)])),0x0;if(_0x13502d[_0x24fed5(0x283)])return console[_0x24fed5(0x106)](a52_0x4d046d['yellow'](_0x24fed5(0x250))),0x0;if(!_0x13502d[_0x24fed5(0x1d7)]){if(!isInteractive())return console[_0x24fed5(0x106)](a52_0x4d046d['red'](_0x24fed5(0x131)),_0x24fed5(0x275)),console['error'](a52_0x4d046d[_0x24fed5(0x12c)](_0x24fed5(0x28c))),0x1;const _0x5ad1d7=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x5ad1d7)return console[_0x24fed5(0x106)](a52_0x4d046d[_0x24fed5(0x243)](_0x24fed5(0x286)),_0x24fed5(0x141)),0x1;}await withSpinner('Writing\x20files...',()=>_0x3b35cf[_0x24fed5(0x17b)][_0x24fed5(0x101)](_0x4785c1,{'revision':_0x32d8b3}),{'verbose':_0x13502d[_0x24fed5(0x103)]}),saveSessionContext({'workflow_project':_0x4785c1['projectName']},_0x13502d[_0x24fed5(0x204)]),console[_0x24fed5(0x106)](a52_0x4d046d[_0x24fed5(0x27d)]('✔\x20Pull\x20complete'));const _0x47a85b=a52_0x59b294[_0x24fed5(0x261)](process['cwd'](),_0x4785c1[_0x24fed5(0x1f3)])||'.';return console[_0x24fed5(0x106)](a52_0x4d046d[_0x24fed5(0x12c)](_0x24fed5(0x267)+_0x47a85b)),console['error'](a52_0x4d046d['dim'](_0x24fed5(0x1cd)+_0x4785c1[_0x24fed5(0x176)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a52_0x4f3203(0x136);[a52_0x4f3203(0x12d)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a52_0x4f3203(0x19d)](_0x310e0b){const _0x23763e=a52_0x4f3203,{options:_0x229dd2,args:_0x3d7737,tdx:_0x5ccd70}=_0x310e0b,_0x21d3fe=this[_0x23763e(0x209)](_0x3d7737,_0x229dd2),_0x38240e=_0x229dd2[_0x23763e(0x1fa)],_0x2bac18=_0x229dd2[_0x23763e(0x25c)];_0x229dd2[_0x23763e(0x103)]&&(_0x21d3fe&&console[_0x23763e(0x106)](_0x23763e(0x1e9)+_0x21d3fe),_0x38240e&&console['error'](_0x23763e(0x108)+_0x38240e),_0x229dd2[_0x23763e(0x283)]&&console[_0x23763e(0x106)]('Dry\x20run:\x20yes'),_0x2bac18&&console[_0x23763e(0x106)](_0x23763e(0x1fc)));let _0x1c48bd;try{_0x1c48bd=await withSpinner(_0x23763e(0x1af),()=>_0x5ccd70[_0x23763e(0x17b)][_0x23763e(0x135)]({'sourceDir':_0x21d3fe,'revision':_0x38240e,'skipValidation':_0x2bac18}),{'verbose':_0x229dd2[_0x23763e(0x103)]});}catch(_0x48df3b){if(_0x48df3b instanceof Error&&_0x48df3b[_0x23763e(0x228)][_0x23763e(0x23b)](_0x23763e(0x297)))return console[_0x23763e(0x106)](a52_0x4d046d[_0x23763e(0x1b2)]('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x229dd2[_0x23763e(0x181)]?console[_0x23763e(0x106)](a52_0x4d046d['dim'](_0x23763e(0x256)+_0x229dd2[_0x23763e(0x181)]+_0x23763e(0x138)+_0x229dd2['workflowProject']+'\x27')):console[_0x23763e(0x106)](a52_0x4d046d[_0x23763e(0x12c)](_0x23763e(0x285))),0x1;throw _0x48df3b;}const _0x37bc5b=_0x1c48bd['data'];console[_0x23763e(0x106)]('✔\x20Project:\x20'+_0x37bc5b['projectName']),console[_0x23763e(0x106)]('\x20\x20Source:\x20'+_0x37bc5b[_0x23763e(0x242)]),console[_0x23763e(0x106)](_0x23763e(0x18e)+_0x37bc5b[_0x23763e(0x1fa)]),console['error'](_0x23763e(0x222)+a52_0x4d046d[_0x23763e(0x27d)]('+'+_0x37bc5b[_0x23763e(0x146)][_0x23763e(0x23a)]+'\x20new')+',\x20'+(a52_0x4d046d[_0x23763e(0x243)]('~'+_0x37bc5b['summary'][_0x23763e(0x1eb)]+_0x23763e(0x125))+',\x20')+(a52_0x4d046d[_0x23763e(0x1b2)]('-'+_0x37bc5b['summary']['deleted']+_0x23763e(0x11a))+',\x20')+(''+a52_0x4d046d[_0x23763e(0x12c)](_0x37bc5b[_0x23763e(0x146)][_0x23763e(0x240)]+_0x23763e(0x185))));for(const _0x2c2c80 of _0x37bc5b[_0x23763e(0x19b)]){_0x2c2c80[_0x23763e(0xf9)]==='modified'&&_0x2c2c80[_0x23763e(0x234)]&&(console[_0x23763e(0x106)]('\x0a'+a52_0x4d046d[_0x23763e(0x1f1)](_0x23763e(0x220)+_0x2c2c80[_0x23763e(0x145)])),console[_0x23763e(0x106)](_0x2c2c80['diff']));}if(!_0x37bc5b['hasChanges'])return console['error'](a52_0x4d046d[_0x23763e(0x27d)](_0x23763e(0x152))),await this[_0x23763e(0x253)](_0x5ccd70,_0x37bc5b[_0x23763e(0x176)],_0x229dd2[_0x23763e(0x245)]),0x0;if(_0x229dd2[_0x23763e(0x283)])return console[_0x23763e(0x106)](a52_0x4d046d[_0x23763e(0x243)](_0x23763e(0x269))),0x0;if(!_0x229dd2[_0x23763e(0x1d7)]){if(!isInteractive())return console['error'](a52_0x4d046d[_0x23763e(0x1b2)](_0x23763e(0x131)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x23763e(0x106)](a52_0x4d046d[_0x23763e(0x12c)](_0x23763e(0x28c))),0x1;const _0x322321=await confirmKey(_0x23763e(0x179));if(!_0x322321)return console[_0x23763e(0x106)](a52_0x4d046d[_0x23763e(0x243)](_0x23763e(0x286)),_0x23763e(0x1d2)),0x1;}const _0x318d4b=await withSpinner('Pushing\x20project...',()=>_0x5ccd70[_0x23763e(0x17b)]['executePushProject'](_0x37bc5b),{'verbose':_0x229dd2['verbose']}),_0x598e32=_0x318d4b[_0x23763e(0x11b)];return console['error'](a52_0x4d046d[_0x23763e(0x27d)](_0x23763e(0x1ff))),console['error']('\x20\x20Project\x20ID:\x20'+_0x598e32[_0x23763e(0x170)]),console[_0x23763e(0x106)](_0x23763e(0x18e)+_0x598e32[_0x23763e(0x1fa)]),await this[_0x23763e(0x253)](_0x5ccd70,_0x598e32[_0x23763e(0x176)],_0x229dd2['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x183);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x15e);async['execute'](_0x5ede57){const _0x138df2=a52_0x4f3203,{options:_0x3ef355,args:_0x4fc681,tdx:_0x1dc5f3}=_0x5ede57,_0x4c12d8=this[_0x138df2(0x209)](_0x4fc681,_0x3ef355),_0x1b0fc3=_0x3ef355['name'],_0x4f67ea=_0x3ef355[_0x138df2(0x1fa)],_0x3a3d6a=_0x3ef355[_0x138df2(0x25c)];if(!_0x4c12d8)return console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x1b2)](_0x138df2(0x19c)),'Source\x20directory\x20is\x20required'),console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x12c)](_0x138df2(0x1b3))),console[_0x138df2(0x106)](a52_0x4d046d['dim'](_0x138df2(0x137))),0x1;if(!_0x1b0fc3)return console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x1b2)](_0x138df2(0x19c)),_0x138df2(0x148)),console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x12c)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x3ef355['verbose']&&(console[_0x138df2(0x106)]('Source\x20directory:\x20'+_0x4c12d8),console[_0x138df2(0x106)](_0x138df2(0x248)+_0x1b0fc3),_0x4f67ea&&console[_0x138df2(0x106)](_0x138df2(0x108)+_0x4f67ea),_0x3ef355[_0x138df2(0x283)]&&console[_0x138df2(0x106)]('Dry\x20run:\x20yes'),_0x3a3d6a&&console['error'](_0x138df2(0x1fc)));const _0xa0d2a4=await withSpinner(_0x138df2(0x229),()=>_0x1dc5f3[_0x138df2(0x17b)][_0x138df2(0x25f)](_0x4c12d8,_0x1b0fc3,{'revision':_0x4f67ea,'skipValidation':_0x3a3d6a}),{'verbose':_0x3ef355[_0x138df2(0x103)]}),_0x81c734=_0xa0d2a4['data'];console[_0x138df2(0x106)](_0x138df2(0x193)+_0x81c734[_0x138df2(0x242)]);_0x81c734[_0x138df2(0x1e3)]&&console[_0x138df2(0x106)]('Source\x20project:\x20'+_0x81c734[_0x138df2(0x1e3)]);console[_0x138df2(0x106)](_0x138df2(0x248)+_0x81c734[_0x138df2(0x1ae)]),console[_0x138df2(0x106)](_0x138df2(0x108)+_0x81c734['revision']),console['error']('Files\x20to\x20upload:\x20'+_0x81c734[_0x138df2(0x271)]);_0x81c734['targetExists']&&(console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x243)](_0x138df2(0x15c)+_0x81c734['newProjectName']+_0x138df2(0x22f)+_0x81c734[_0x138df2(0x252)]+')')),console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x243)](_0x138df2(0x130))));if(_0x3ef355[_0x138df2(0x283)])return console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x243)](_0x138df2(0x21a))),0x0;if(!_0x3ef355[_0x138df2(0x1d7)]){if(!isInteractive())return console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x1b2)]('\x0aError:'),_0x138df2(0x275)),console['error'](a52_0x4d046d[_0x138df2(0x12c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x59aefa=_0x81c734['sourceProjectName']||a52_0x59b294[_0x138df2(0x1ed)](_0x4c12d8),_0x3ea821=_0x81c734['targetExists']?_0x138df2(0x15b)+_0x1b0fc3+_0x138df2(0x1fd):_0x138df2(0x129)+_0x59aefa+_0x138df2(0x10c)+_0x1b0fc3+'\x22?',_0x49488d=await confirmKey(_0x3ea821);if(!_0x49488d)return console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x243)](_0x138df2(0x286))),0x1;}const _0x295184=await withSpinner(_0x81c734[_0x138df2(0xfd)]?_0x138df2(0x1d1)+_0x1b0fc3+_0x138df2(0x1de):'Cloning\x20to\x20'+_0x1b0fc3+_0x138df2(0x1de),()=>_0x1dc5f3['workflow'][_0x138df2(0x206)](_0x81c734),{'verbose':_0x3ef355['verbose']}),_0x420c0c=_0x295184[_0x138df2(0x11b)];return console[_0x138df2(0x106)](a52_0x4d046d[_0x138df2(0x27d)](_0x81c734[_0x138df2(0xfd)]?_0x138df2(0xfe):_0x138df2(0x225))),console[_0x138df2(0x106)]('\x20\x20Project:\x20'+_0x420c0c[_0x138df2(0x1ae)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x420c0c[_0x138df2(0x23d)]),console[_0x138df2(0x106)](_0x138df2(0x18e)+_0x420c0c[_0x138df2(0x1fa)]),await this[_0x138df2(0x253)](_0x1dc5f3,_0x420c0c[_0x138df2(0x1ae)],_0x3ef355[_0x138df2(0x245)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a52_0x4f3203(0x184)]='workflow:delete';[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x20a);async['execute'](_0x24fd10){const _0x5da3d4=a52_0x4f3203,{options:_0x49a376,args:_0xa51481,tdx:_0x2f1396}=_0x24fd10,_0x217602=_0xa51481[0x0];if(!_0x217602)return console['error'](_0x5da3d4(0x11d)),console[_0x5da3d4(0x106)](_0x5da3d4(0x27a)),0x1;_0x49a376[_0x5da3d4(0x103)]&&console[_0x5da3d4(0x106)]('Project:\x20'+_0x217602);if(!_0x49a376[_0x5da3d4(0x1d7)]){if(!isInteractive())return console[_0x5da3d4(0x106)](a52_0x4d046d['red']('\x0aError:'),_0x5da3d4(0x275)),console[_0x5da3d4(0x106)](a52_0x4d046d[_0x5da3d4(0x12c)](_0x5da3d4(0x28c))),0x1;const _0x58ec41=await confirmKey(_0x5da3d4(0x24e)+_0x217602+_0x5da3d4(0x1b5));if(!_0x58ec41)return console[_0x5da3d4(0x106)](a52_0x4d046d['yellow'](_0x5da3d4(0x286))),0x1;}const _0x2e1428=await withSpinner(_0x5da3d4(0x200)+_0x217602+_0x5da3d4(0x1de),()=>_0x2f1396[_0x5da3d4(0x17b)]['delete'](_0x217602),{'verbose':_0x49a376[_0x5da3d4(0x103)]}),_0x8a4e4b=_0x2e1428[_0x5da3d4(0x11b)];return console[_0x5da3d4(0x106)]('✔\x20Deleted\x20project\x20'+_0x8a4e4b[_0x5da3d4(0x176)]),console[_0x5da3d4(0x106)](_0x5da3d4(0x1a9)+_0x8a4e4b[_0x5da3d4(0x170)]),0x0;}}export function parseKeyValue(_0x137669){const _0x299621=a52_0x4f3203,_0x20f316=_0x137669[_0x299621(0x10e)]('=');if(_0x20f316===-0x1)throw new Error(_0x299621(0x23c)+_0x137669+_0x299621(0x247));const _0x3a3955=_0x137669[_0x299621(0x210)](0x0,_0x20f316),_0x2278f9=_0x137669['substring'](_0x20f316+0x1);if(!_0x3a3955)throw new Error(_0x299621(0x1c0));return{'key':_0x3a3955,'value':_0x2278f9};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x1f8);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x268);async[a52_0x4f3203(0x19d)](_0x4edc0b){const _0x3e6bae=a52_0x4f3203,{options:_0x37c68a,args:_0x504ad9,tdx:_0x42bf5d}=_0x4edc0b,_0x440d5c=this[_0x3e6bae(0x1f4)](_0x504ad9,_0x37c68a);if(!_0x440d5c)return 0x1;_0x37c68a[_0x3e6bae(0x103)]&&console[_0x3e6bae(0x106)]('Project:\x20'+_0x440d5c);const _0x526ebb=await withSpinner(_0x3e6bae(0x1fe),()=>_0x42bf5d['workflow'][_0x3e6bae(0x1a7)](_0x440d5c),{'verbose':_0x37c68a[_0x3e6bae(0x103)]}),{secrets:_0x1c9c97}=_0x526ebb[_0x3e6bae(0x11b)];return console[_0x3e6bae(0x106)]('✔\x20Found\x20'+_0x1c9c97[_0x3e6bae(0x276)]+_0x3e6bae(0x14c)+(_0x1c9c97[_0x3e6bae(0x276)]!==0x1?'s':'')),await handleSDKOutput(_0x1c9c97,_0x37c68a),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x1ec);['description']=a52_0x4f3203(0x288);async['execute'](_0x4f1a71){const _0x3e1ec4=a52_0x4f3203,{options:_0x2ec13a,args:_0x1ac4b4,tdx:_0x4ae4a7}=_0x4f1a71;let _0x84a5ee,_0x27cc96;if(_0x1ac4b4[_0x3e1ec4(0x276)]>=0x1&&!_0x1ac4b4[0x0][_0x3e1ec4(0x23b)]('='))_0x84a5ee=_0x1ac4b4[0x0],_0x27cc96=_0x1ac4b4[_0x3e1ec4(0x111)](0x1);else{if(_0x1ac4b4[_0x3e1ec4(0x276)]>=0x1&&_0x2ec13a['workflowProject'])_0x84a5ee=_0x2ec13a[_0x3e1ec4(0x181)],_0x27cc96=_0x1ac4b4;else return _0x1ac4b4[_0x3e1ec4(0x276)]>=0x1?(console[_0x3e1ec4(0x106)](_0x3e1ec4(0x13a)),console['error'](_0x3e1ec4(0x1dd)),0x1):(console[_0x3e1ec4(0x106)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error'](_0x3e1ec4(0x188)),0x1);}if(_0x27cc96['length']===0x0)return console[_0x3e1ec4(0x106)](_0x3e1ec4(0x217)),console[_0x3e1ec4(0x106)](_0x3e1ec4(0x188)),0x1;const _0x52ead7={};try{for(const _0x3988cb of _0x27cc96){const {key:_0x4f941c,value:_0xd1c7de}=parseKeyValue(_0x3988cb);_0x52ead7[_0x4f941c]=_0xd1c7de;}}catch(_0x44cd27){return _0x44cd27 instanceof Error&&console[_0x3e1ec4(0x106)](a52_0x4d046d[_0x3e1ec4(0x1b2)](_0x3e1ec4(0x19c)),_0x44cd27[_0x3e1ec4(0x228)]),0x1;}const _0x28d5d8=Object[_0x3e1ec4(0xff)](_0x52ead7);_0x2ec13a[_0x3e1ec4(0x103)]&&(console[_0x3e1ec4(0x106)](_0x3e1ec4(0x117)+_0x84a5ee),console['error'](_0x3e1ec4(0x155)+_0x28d5d8['join'](',\x20')));const _0x512622=await withSpinner(_0x28d5d8[_0x3e1ec4(0x276)]===0x1?_0x3e1ec4(0x11c):'Setting\x20'+_0x28d5d8[_0x3e1ec4(0x276)]+_0x3e1ec4(0x246),()=>_0x4ae4a7[_0x3e1ec4(0x17b)]['setSecrets'](_0x84a5ee,_0x52ead7),{'verbose':_0x2ec13a['verbose']}),_0x288c68=_0x512622[_0x3e1ec4(0x11b)];return console[_0x3e1ec4(0x106)](_0x28d5d8[_0x3e1ec4(0x276)]===0x1?_0x3e1ec4(0x16c)+_0x288c68[_0x3e1ec4(0xff)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x288c68['projectName']+'\x27':'✔\x20'+_0x288c68['keys']['length']+_0x3e1ec4(0x180)+_0x288c68[_0x3e1ec4(0x176)]+'\x27'),(_0x2ec13a[_0x3e1ec4(0xea)]||_0x2ec13a[_0x3e1ec4(0x110)])&&await handleSingleObjectOutput(_0x288c68,_0x2ec13a),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x1f0);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x16f);async[a52_0x4f3203(0x19d)](_0x4726bf){const _0x54a877=a52_0x4f3203,{options:_0xdf19c6,args:_0x20d4a5,tdx:_0x5d1894}=_0x4726bf;let _0x44d869,_0x1ed64b;if(_0x20d4a5[_0x54a877(0x276)]>=0x2)_0x44d869=_0x20d4a5[0x0],_0x1ed64b=_0x20d4a5[0x1];else{if(_0x20d4a5['length']===0x1&&_0xdf19c6[_0x54a877(0x181)])_0x44d869=_0xdf19c6[_0x54a877(0x181)],_0x1ed64b=_0x20d4a5[0x0];else return _0x20d4a5[_0x54a877(0x276)]===0x1?(console[_0x54a877(0x106)](_0x54a877(0x13a)),console[_0x54a877(0x106)](_0x54a877(0x1dd)),0x1):(console[_0x54a877(0x106)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x54a877(0x106)](_0x54a877(0x235)),0x1);}_0xdf19c6['verbose']&&(console[_0x54a877(0x106)](_0x54a877(0x117)+_0x44d869),console[_0x54a877(0x106)](_0x54a877(0xfa)+_0x1ed64b));if(!_0xdf19c6[_0x54a877(0x1d7)]){if(!isInteractive())return console[_0x54a877(0x106)](a52_0x4d046d['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a52_0x4d046d[_0x54a877(0x12c)](_0x54a877(0x28c))),0x1;const _0x120982=await confirmKey(_0x54a877(0x260)+_0x1ed64b+_0x54a877(0x273)+_0x44d869+'\x27?');if(!_0x120982)return console['error'](a52_0x4d046d[_0x54a877(0x243)](_0x54a877(0x286))),0x1;}const _0x3c6078=await withSpinner(_0x54a877(0x24d),()=>_0x5d1894[_0x54a877(0x17b)][_0x54a877(0x139)](_0x44d869,_0x1ed64b),{'verbose':_0xdf19c6['verbose']}),_0x895c34=_0x3c6078['data'];return console[_0x54a877(0x106)](_0x54a877(0x16c)+_0x895c34['key']+_0x54a877(0xfb)+_0x895c34[_0x54a877(0x176)]+'\x27'),(_0xdf19c6[_0x54a877(0xea)]||_0xdf19c6[_0x54a877(0x110)])&&await handleSingleObjectOutput(_0x895c34,_0xdf19c6),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0x185d57){const _0x5a8ef2=a52_0x4f3203,_0xbf361b=Math[_0x5a8ef2(0x26e)](_0x185d57/0x3e8),_0x11bdbf=Math[_0x5a8ef2(0x26e)](_0xbf361b/0x3c),_0x394e6b=Math[_0x5a8ef2(0x26e)](_0x11bdbf/0x3c),_0x3eaf71=Math[_0x5a8ef2(0x26e)](_0x394e6b/0x18);if(_0x3eaf71>0x0){const _0x3bb319=_0x394e6b%0x18;return _0x3bb319>0x0?_0x3eaf71+'d\x20'+_0x3bb319+'h':_0x3eaf71+'d';}else{if(_0x394e6b>0x0){const _0x2c2aac=_0x11bdbf%0x3c;return _0x2c2aac>0x0?_0x394e6b+'h\x20'+_0x2c2aac+'m':_0x394e6b+'h';}else{if(_0x11bdbf>0x0){const _0x503650=_0xbf361b%0x3c;return _0x503650>0x0?_0x11bdbf+'m\x20'+_0x503650+'s':_0x11bdbf+'m';}else return _0xbf361b+'s';}}}function formatTimestamp(_0x3190ed,_0x38f3b3){const _0x60ac71=a52_0x4f3203,_0x333f94=new Date(_0x3190ed),_0x35e0de=String(_0x333f94[_0x60ac71(0x230)]())[_0x60ac71(0x189)](0x2,'0'),_0xb6cd9e=String(_0x333f94[_0x60ac71(0x298)]())['padStart'](0x2,'0'),_0x26ccc4=_0x35e0de+':'+_0xb6cd9e,_0x1d9b24=_0x333f94[_0x60ac71(0x26a)]()===_0x38f3b3['getFullYear']()&&_0x333f94['getMonth']()===_0x38f3b3[_0x60ac71(0x27f)]()&&_0x333f94[_0x60ac71(0xf4)]()===_0x38f3b3[_0x60ac71(0xf4)]();if(_0x1d9b24)return _0x26ccc4;else{const _0x4a727e=String(_0x333f94['getMonth']()+0x1)[_0x60ac71(0x189)](0x2,'0'),_0x3ba02e=String(_0x333f94[_0x60ac71(0xf4)]())[_0x60ac71(0x189)](0x2,'0');return _0x4a727e+'-'+_0x3ba02e+'\x20'+_0x26ccc4;}}function formatDate(_0x5bd8f3){const _0x9cb717=a52_0x4f3203,_0x443913=_0x5bd8f3['getFullYear'](),_0x44365c=String(_0x5bd8f3[_0x9cb717(0x27f)]()+0x1)[_0x9cb717(0x189)](0x2,'0'),_0x520d75=String(_0x5bd8f3[_0x9cb717(0xf4)]())[_0x9cb717(0x189)](0x2,'0');return _0x443913+'-'+_0x44365c+'-'+_0x520d75;}function getTaskStateIcon(_0x1a62a9){const _0x3156da={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3156da[_0x1a62a9]||'⚪';}function getBarChar(_0x27f346){const _0x59f649=a52_0x4f3203;return _0x27f346==='error'||_0x27f346===_0x59f649(0x202)?'×':'─';}function getBarColor(_0x337366){const _0x4d6286=a52_0x4f3203,_0x1b25b0={'success':a52_0x4d046d[_0x4d6286(0x27d)],'error':a52_0x4d046d[_0x4d6286(0x1b2)],'group_error':a52_0x4d046d[_0x4d6286(0x1b2)],'running':a52_0x4d046d['blue'],'blocked':a52_0x4d046d[_0x4d6286(0x243)],'planned':a52_0x4d046d[_0x4d6286(0x12c)],'canceling':a52_0x4d046d[_0x4d6286(0x243)]};return _0x1b25b0[_0x337366]||a52_0x4d046d['white'];}function parseTaskName(_0xd2970e){const _0x359453=a52_0x4f3203;let _0x1bef05=_0xd2970e[_0x359453(0x19e)](/^\++/,'');const _0x11d268=_0x1bef05[_0x359453(0x28e)]('+'),_0x416653=_0x11d268[_0x359453(0x276)]>0x1?_0x11d268[_0x359453(0x276)]-0x2:0x0,_0x5af7eb=_0x11d268[_0x11d268[_0x359453(0x276)]-0x1]||_0x1bef05;return{'level':_0x416653,'name':'+'+_0x5af7eb};}function truncateTaskName(_0x562771,_0x14cb0b){const _0x132d88=a52_0x4f3203,_0x4f1def=stringWidth(_0x562771);if(_0x4f1def<=_0x14cb0b)return _0x562771;let _0x4f0055=_0x562771;while(stringWidth(_0x4f0055+'…')>_0x14cb0b&&_0x4f0055[_0x132d88(0x276)]>0x0){_0x4f0055=_0x4f0055[_0x132d88(0x111)](0x0,-0x1);}return _0x4f0055+'…';}function calculateTimeScale(_0x22a3e5,_0x217454){const _0x1887e1=a52_0x4f3203;return{'startTime':_0x22a3e5[_0x1887e1(0xf5)],'endTime':_0x22a3e5[_0x1887e1(0x28a)],'durationMs':_0x22a3e5[_0x1887e1(0x132)],'msPerChar':_0x22a3e5['duration']/_0x217454};}function timeToPosition(_0x230c13,_0x7c2417,_0x4e4549){const _0x2a4ec4=a52_0x4f3203,_0x57aff1=_0x230c13-_0x7c2417[_0x2a4ec4(0x1a8)],_0x3285b8=Math['floor'](_0x57aff1/_0x7c2417[_0x2a4ec4(0x1db)]);return Math[_0x2a4ec4(0x1c1)](0x0,Math[_0x2a4ec4(0x12b)](_0x3285b8,_0x4e4549));}function renderTimeAxis(_0x10fabe,_0xd54159){const _0x779ace=a52_0x4f3203,_0x285796=Math[_0x779ace(0x12b)](TIMELINE_CONFIG[_0x779ace(0x1e1)],Math['max'](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x779ace(0x26e)](_0xd54159/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x4d25e3=_0x10fabe['durationMs']/(_0x285796-0x1),_0x2fbed3=new Date(_0x10fabe[_0x779ace(0x1a8)]),_0x185dd2=[];for(let _0x336285=0x0;_0x336285<_0x285796;_0x336285++){const _0x4241eb=_0x10fabe['startTime']+_0x336285*_0x4d25e3,_0x3f725b=timeToPosition(_0x4241eb,_0x10fabe,_0xd54159),_0x506b61=formatTimestamp(_0x4241eb,_0x2fbed3);_0x185dd2[_0x779ace(0x1d8)]({'pos':_0x3f725b,'text':_0x506b61});}const _0x2cb4ce=new Array(_0xd54159)[_0x779ace(0x14d)]('\x20');let _0x3330cd=-0x1;for(const {pos:_0x578b57,text:_0x1a2ecd}of _0x185dd2){let _0x7d4111=Math[_0x779ace(0x1c1)](0x0,_0x578b57-Math['floor'](_0x1a2ecd[_0x779ace(0x276)]/0x2));_0x7d4111<=_0x3330cd+TIMELINE_CONFIG[_0x779ace(0x13e)]&&(_0x7d4111=_0x3330cd+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x7d4111+_0x1a2ecd[_0x779ace(0x276)]>_0xd54159&&(_0x7d4111=_0xd54159-_0x1a2ecd[_0x779ace(0x276)]);if(_0x7d4111>=0x0&&_0x7d4111+_0x1a2ecd[_0x779ace(0x276)]<=_0xd54159&&_0x7d4111>_0x3330cd){for(let _0x23290b=0x0;_0x23290b<_0x1a2ecd[_0x779ace(0x276)];_0x23290b++){_0x2cb4ce[_0x7d4111+_0x23290b]=_0x1a2ecd[_0x23290b];}_0x3330cd=_0x7d4111+_0x1a2ecd['length']-0x1;}}return _0x2cb4ce[_0x779ace(0x17a)]('');}function renderTaskRow(_0x4c2759,_0x4e1f5c,_0x1cd372,_0x24fde9){const _0x112e64=a52_0x4f3203,{level:_0x17f8ae,name:_0x4542be}=parseTaskName(_0x4c2759[_0x112e64(0x184)]),_0x2bc63e='\x20'[_0x112e64(0x291)](_0x17f8ae),_0x208dc6=_0x4c2759[_0x112e64(0x154)]?'('+formatElapsed(_0x4c2759[_0x112e64(0x154)][_0x112e64(0x132)])+')':'',_0x3744f1=stringWidth(_0x208dc6),_0x5c8fca=_0x17f8ae*0x1,_0x557d98=_0x24fde9-_0x5c8fca-_0x3744f1-0x1,_0x5d6d08=truncateTaskName(_0x4542be,_0x557d98),_0x3d4147=_0x2bc63e+_0x5d6d08,_0x37bd78=stringWidth(_0x3d4147),_0x4f3e0e=_0x24fde9-_0x37bd78-_0x3744f1,_0x43707e=_0x3d4147+'\x20'[_0x112e64(0x291)](Math[_0x112e64(0x1c1)](0x1,_0x4f3e0e))+a52_0x4d046d[_0x112e64(0x12c)](_0x208dc6),_0x3090c8=getTaskStateIcon(_0x4c2759[_0x112e64(0x178)]),_0x19bb68=new Array(_0x1cd372)[_0x112e64(0x14d)]('\x20');if(_0x4c2759[_0x112e64(0x154)]){const _0x259748=timeToPosition(_0x4c2759['window'][_0x112e64(0xf5)],_0x4e1f5c,_0x1cd372),_0x2bc59c=timeToPosition(_0x4c2759[_0x112e64(0x154)][_0x112e64(0x28a)],_0x4e1f5c,_0x1cd372),_0xe1be90=getBarChar(_0x4c2759[_0x112e64(0x178)]),_0x2631b4=Math['max'](_0x259748+0x1,_0x2bc59c);for(let _0x39ce84=_0x259748;_0x39ce84<Math[_0x112e64(0x12b)](_0x2631b4,_0x1cd372);_0x39ce84++){_0x19bb68[_0x39ce84]=_0xe1be90;}}const _0x11cc8e=getBarColor(_0x4c2759[_0x112e64(0x178)]),_0x581794=_0x19bb68['map'](_0x5dc403=>_0x5dc403==='\x20'?'\x20':_0x11cc8e(_0x5dc403))[_0x112e64(0x17a)]('');return _0x3090c8+'\x20'+_0x43707e+'│'+_0x581794+'│';}function calculateStats(_0x984ba3){const _0x5b25ec=a52_0x4f3203,_0x410e06={'total':_0x984ba3[_0x5b25ec(0x276)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x3674f8 of _0x984ba3){if(_0x3674f8[_0x5b25ec(0x178)]===_0x5b25ec(0x1d4))_0x410e06[_0x5b25ec(0x1d4)]++;else{if(_0x3674f8[_0x5b25ec(0x178)]===_0x5b25ec(0x106)||_0x3674f8[_0x5b25ec(0x178)]===_0x5b25ec(0x202))_0x410e06['error']++;else _0x3674f8[_0x5b25ec(0x178)]===_0x5b25ec(0x266)?_0x410e06[_0x5b25ec(0x266)]++:_0x410e06[_0x5b25ec(0x264)]++;}}return _0x410e06;}function formatStats(_0x28d726){const _0x4ab8e5=a52_0x4f3203;return[_0x4ab8e5(0x203)+_0x28d726[_0x4ab8e5(0x18c)],'✅\x20'+_0x28d726['success'],'❌\x20'+_0x28d726[_0x4ab8e5(0x106)],_0x4ab8e5(0x122)+_0x28d726[_0x4ab8e5(0x266)],'⏳\x20'+_0x28d726['pending']][_0x4ab8e5(0x17a)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a52_0x4f3203(0x184)]=a52_0x4f3203(0x20b);[a52_0x4f3203(0x12d)]=a52_0x4f3203(0x159);async['execute'](_0x1dd750){const _0x3889d2=a52_0x4f3203,{options:_0x397bc0,args:_0x231e1b,tdx:_0x1be546}=_0x1dd750;let _0x37b1b4,_0x140e9c,_0x25b056=![];if(_0x231e1b[0x0]){if(_0x231e1b[0x0][_0x3889d2(0x23b)]('.')){const _0x7e6d56=this[_0x3889d2(0x1b0)](_0x231e1b,_0x397bc0);if(!_0x7e6d56)return 0x1;_0x37b1b4=_0x7e6d56[_0x3889d2(0x176)],_0x140e9c=_0x7e6d56[_0x3889d2(0x277)];}else{_0x140e9c=_0x231e1b[0x0],_0x37b1b4=_0x397bc0[_0x3889d2(0x181)];if(!_0x37b1b4)return console['error'](a52_0x4d046d[_0x3889d2(0x1b2)](_0x3889d2(0x19c)),_0x3889d2(0xfc)),0x1;_0x25b056=!![];}}else{const _0x1d3718=this['parseProjectWorkflowPattern'](_0x231e1b,_0x397bc0);if(!_0x1d3718)return 0x1;_0x37b1b4=_0x1d3718[_0x3889d2(0x176)],_0x140e9c=_0x1d3718['workflowName'];}if(_0x397bc0[_0x3889d2(0x103)]){if(_0x37b1b4&&_0x140e9c)console[_0x3889d2(0x106)](_0x3889d2(0x1b9)+_0x37b1b4+'.'+_0x140e9c);else _0x37b1b4&&console['error']('Filter:\x20project='+_0x37b1b4);}const _0x4cfd07=_0x397bc0[_0x3889d2(0x194)],_0x29f05e=_0x397bc0[_0x3889d2(0x17e)];if(_0x4cfd07){_0x29f05e&&console[_0x3889d2(0x106)](a52_0x4d046d['yellow']('Warning:'),_0x3889d2(0x208));const _0x912d2a=_0x397bc0['follow'];return _0x912d2a?await this['pollTimeline'](_0x1dd750,_0x4cfd07):await this[_0x3889d2(0x1c9)](_0x1dd750,_0x4cfd07,_0x397bc0),0x0;}if(_0x29f05e){const _0x243eba=await withSpinner(_0x3889d2(0x1cc),()=>_0x1be546[_0x3889d2(0x17b)][_0x3889d2(0x293)]({'projectName':_0x37b1b4,'workflowName':_0x140e9c,'limit':0x64}),{'verbose':_0x397bc0[_0x3889d2(0x103)]}),_0x27d98a=_0x243eba[_0x3889d2(0x11b)][_0x3889d2(0x177)](_0x202c97=>_0x202c97['id']===_0x29f05e);if(!_0x27d98a)return console[_0x3889d2(0x106)](a52_0x4d046d[_0x3889d2(0x1b2)]('Error:'),_0x3889d2(0x22c)+_0x29f05e),0x1;if(!_0x27d98a[_0x3889d2(0x10f)]?.['id'])return console[_0x3889d2(0x106)](a52_0x4d046d[_0x3889d2(0x1b2)](_0x3889d2(0x19c)),'Session\x20'+_0x29f05e+'\x20has\x20no\x20attempts'),0x1;const _0x2cf4b7=_0x27d98a[_0x3889d2(0x10f)]['id'];_0x397bc0[_0x3889d2(0x103)]&&console['error'](_0x3889d2(0x124)+_0x2cf4b7+'\x20from\x20session\x20'+_0x29f05e);const _0x47a2e3=_0x397bc0[_0x3889d2(0x26f)];return _0x47a2e3?await this[_0x3889d2(0x11e)](_0x1dd750,_0x2cf4b7):await this[_0x3889d2(0x1c9)](_0x1dd750,_0x2cf4b7,_0x397bc0),0x0;}const _0x34f4f4=await withSpinner('Loading\x20sessions...',()=>_0x1be546[_0x3889d2(0x17b)][_0x3889d2(0x293)]({'projectName':_0x37b1b4,'workflowName':_0x140e9c,'limit':_0x397bc0[_0x3889d2(0x216)]||0x32}),{'verbose':_0x397bc0['verbose']}),_0x11129b=_0x34f4f4['data'];if(_0x11129b[_0x3889d2(0x276)]===0x0){if(_0x37b1b4&&_0x140e9c)console[_0x3889d2(0x106)](_0x3889d2(0x1ce)+_0x37b1b4+'.'+_0x140e9c);else _0x37b1b4?console[_0x3889d2(0x106)](_0x3889d2(0x16e)+_0x37b1b4):(console[_0x3889d2(0x106)](_0x3889d2(0x1b1)),console[_0x3889d2(0x106)](a52_0x4d046d[_0x3889d2(0x12c)](_0x3889d2(0x28d))));return 0x0;}_0x11129b[_0x3889d2(0x1cb)]((_0x199d0b,_0x591e18)=>{const _0x5de525=_0x199d0b['sessionTime']||'',_0x5f08ac=_0x591e18['sessionTime']||'';return _0x5f08ac['localeCompare'](_0x5de525);});if(_0x397bc0[_0x3889d2(0xea)]||_0x397bc0[_0x3889d2(0x110)])return await handleSDKOutput(_0x11129b,_0x397bc0),0x0;let _0x3236b2;if(_0x25b056){const _0x41bf79=_0x11129b[0x0];if(!_0x41bf79['lastAttempt']?.['id'])return console[_0x3889d2(0x106)](_0x3889d2(0x151)),0x0;_0x3236b2=_0x41bf79[_0x3889d2(0x10f)]['id'],_0x397bc0[_0x3889d2(0x103)]&&console[_0x3889d2(0x106)]('Auto-selected\x20latest\x20session:\x20'+_0x41bf79[_0x3889d2(0x17f)]);}else{const _0x1f1db9=_0x11129b[_0x3889d2(0x241)](_0x1e191f=>{const _0x572399=_0x3889d2,_0x57c94d=getAttemptStatusDisplay(_0x1e191f[_0x572399(0x10f)]);return{'title':_0x1e191f['project']?.['name']+'.'+_0x1e191f['workflow']?.[_0x572399(0x184)]+'\x20-\x20'+_0x1e191f[_0x572399(0x17f)]+'\x20'+_0x57c94d[_0x572399(0x22e)],'value':_0x1e191f[_0x572399(0x10f)]?.['id']||'','description':_0x57c94d[_0x572399(0x1b6)]};}),_0x495272=await a52_0x42cbf7({'type':_0x3889d2(0x254),'name':_0x3889d2(0x194),'message':_0x3889d2(0x1f6),'choices':_0x1f1db9[_0x3889d2(0x25d)](_0x568f82=>_0x568f82[_0x3889d2(0x21e)]!=='')});if(!_0x495272[_0x3889d2(0x194)])return 0x0;_0x3236b2=_0x495272['attemptId'];}const _0x323096=_0x397bc0[_0x3889d2(0x26f)];return _0x323096?await this[_0x3889d2(0x11e)](_0x1dd750,_0x3236b2):await this[_0x3889d2(0x1c9)](_0x1dd750,_0x3236b2,_0x397bc0),0x0;}async[a52_0x4f3203(0x1c9)](_0x1f77dd,_0x100f5f,_0x20f49d){const _0xa0b21=a52_0x4f3203,{tdx:_0x33d9bb}=_0x1f77dd;let _0x26f060,_0x19f0fa;try{[_0x26f060,_0x19f0fa]=await Promise[_0xa0b21(0xf6)]([_0x33d9bb[_0xa0b21(0x17b)]['attempt'](_0x100f5f),_0x33d9bb[_0xa0b21(0x17b)][_0xa0b21(0x233)](_0x100f5f,![])]);}catch(_0x1aadaa){console[_0xa0b21(0x106)](a52_0x4d046d[_0xa0b21(0x1b2)](_0xa0b21(0x1bb)));_0x20f49d[_0xa0b21(0x103)]&&console[_0xa0b21(0x106)](_0x1aadaa);throw _0x1aadaa;}if(_0x20f49d['json']||_0x20f49d[_0xa0b21(0x110)]){const _0x32dbcf=this[_0xa0b21(0xe9)](_0x26f060,_0x19f0fa);await handleSDKOutput([_0x32dbcf],_0x20f49d);return;}const _0x571f93=_0x33d9bb[_0xa0b21(0x1ac)][_0xa0b21(0x245)],_0x310788=this[_0xa0b21(0x21f)](_0x26f060,_0x19f0fa,_0x571f93);console['log'](_0x310788);}async[a52_0x4f3203(0x11e)](_0x517fb2,_0x50f442){const _0x2f5aff=a52_0x4f3203,{tdx:_0x3e56ca}=_0x517fb2,_0x287ad8=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x227624=TIMELINE_CONFIG[_0x2f5aff(0x198)];let _0x5a6c75=0x0;while(_0x5a6c75<_0x227624){process[_0x2f5aff(0x1e2)]['isTTY']&&process[_0x2f5aff(0x1e2)][_0x2f5aff(0x113)]('\x1bc');let _0x540780,_0x39a2a9;try{[_0x540780,_0x39a2a9]=await Promise['all']([_0x3e56ca[_0x2f5aff(0x17b)][_0x2f5aff(0x257)](_0x50f442),_0x3e56ca[_0x2f5aff(0x17b)][_0x2f5aff(0x233)](_0x50f442,![])]);}catch(_0x5f5687){console[_0x2f5aff(0x106)](a52_0x4d046d[_0x2f5aff(0x1b2)](_0x2f5aff(0x1a2)));_0x5a6c75>0x0&&console['error'](a52_0x4d046d['dim'](_0x2f5aff(0x192)+_0x5a6c75));throw _0x5f5687;}const _0x5f0e39=_0x3e56ca[_0x2f5aff(0x1ac)][_0x2f5aff(0x245)],_0x2a642c=this[_0x2f5aff(0x21f)](_0x540780,_0x39a2a9,_0x5f0e39);console[_0x2f5aff(0x10b)](_0x2a642c);const _0x401bd2=_0x540780[_0x2f5aff(0x1ee)]&&_0x39a2a9[_0x2f5aff(0x1ef)](_0x15b55f=>_0x15b55f[_0x2f5aff(0x178)]!==_0x2f5aff(0x266)&&_0x15b55f[_0x2f5aff(0x178)]!==_0x2f5aff(0x29c));if(_0x401bd2){console['error'](a52_0x4d046d[_0x2f5aff(0x27d)](_0x2f5aff(0x150)));break;}console[_0x2f5aff(0x106)](a52_0x4d046d['dim'](_0x2f5aff(0x142)+_0x5a6c75*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x5b9bcf=>setTimeout(_0x5b9bcf,_0x287ad8)),_0x5a6c75++;}_0x5a6c75>=_0x227624&&console['error'](a52_0x4d046d[_0x2f5aff(0x243)](_0x2f5aff(0x128)));}[a52_0x4f3203(0x21f)](_0x2ddf59,_0x136b84,_0x4adf80){const _0x524eef=a52_0x4f3203,_0x350822=[],_0x444e19=TIMELINE_CONFIG[_0x524eef(0xf8)],_0x5105f1=0x5,_0x467208=process['stdout'][_0x524eef(0x1d5)]||0x78,_0x138776=_0x467208-_0x444e19-_0x5105f1,_0x4fab21=Math[_0x524eef(0x1c1)](TIMELINE_CONFIG[_0x524eef(0x118)],Math['min'](_0x138776,TIMELINE_CONFIG[_0x524eef(0x1f2)])),_0x4a83ce=new Date(_0x2ddf59[_0x524eef(0x100)])[_0x524eef(0x22d)](),_0x23615c=_0x2ddf59[_0x524eef(0x270)]?new Date(_0x2ddf59[_0x524eef(0x270)])[_0x524eef(0x22d)]():Date[_0x524eef(0x120)](),_0x4d4b7b={'start':_0x4a83ce,'end':_0x23615c,'duration':_0x23615c-_0x4a83ce},_0x3f4061=new Map(),_0x4a0b92=[];for(const _0x22941b of _0x136b84){if(_0x22941b[_0x524eef(0x171)]){const _0x315127=new Date(_0x22941b[_0x524eef(0x171)])['getTime'](),_0x1cdad2=_0x22941b[_0x524eef(0x164)]?new Date(_0x22941b[_0x524eef(0x164)])[_0x524eef(0x22d)]():Date[_0x524eef(0x120)](),_0x37bba7={'start':_0x315127,'end':_0x1cdad2,'duration':_0x1cdad2-_0x315127};_0x3f4061['set'](_0x22941b['id'],_0x37bba7),_0x4a0b92['push']({'name':_0x22941b[_0x524eef(0x140)],'state':_0x22941b['state']||_0x524eef(0x1b8),'window':_0x37bba7});}else _0x4a0b92[_0x524eef(0x1d8)]({'name':_0x22941b['fullName'],'state':_0x22941b[_0x524eef(0x178)]||_0x524eef(0x29c),'window':undefined});}_0x4a0b92[_0x524eef(0x1cb)]((_0x385d60,_0x5ca2c0)=>{const _0x352ab4=_0x524eef;if(!_0x385d60[_0x352ab4(0x154)])return 0x1;if(!_0x5ca2c0[_0x352ab4(0x154)])return-0x1;return _0x385d60['window']['start']-_0x5ca2c0[_0x352ab4(0x154)][_0x352ab4(0xf5)];});const _0x131f4a=_0x4a0b92[_0x524eef(0x276)],_0x3776a2=_0x131f4a>TIMELINE_CONFIG[_0x524eef(0x28f)];_0x3776a2&&_0x4a0b92[_0x524eef(0x24b)](TIMELINE_CONFIG[_0x524eef(0x28f)]);const _0x425f8d=calculateTimeScale(_0x4d4b7b,_0x4fab21),_0x1ccc89=_0x2ddf59[_0x524eef(0x1ee)]?_0x2ddf59[_0x524eef(0x1d4)]?a52_0x4d046d[_0x524eef(0x27d)](_0x524eef(0x1d4)):a52_0x4d046d[_0x524eef(0x1b2)](_0x524eef(0x106)):a52_0x4d046d[_0x524eef(0x201)](_0x524eef(0x266)),_0x3c6959=_0x2ddf59[_0x524eef(0x1a4)]?.['id'],_0x4cd702=_0x2ddf59[_0x524eef(0x17e)];let _0x3120f1;if(_0x3c6959&&_0x4cd702){const _0x4a458a=getWorkflowAttemptUrl(_0x4adf80,_0x3c6959,_0x4cd702,_0x2ddf59['id']);_0x3120f1=hyperlink(a52_0x4d046d[_0x524eef(0x12c)](_0x2ddf59['id']),_0x4a458a);}else _0x3120f1=a52_0x4d046d['dim'](_0x2ddf59['id']);_0x350822[_0x524eef(0x1d8)](_0x524eef(0x265)+_0x3120f1+_0x524eef(0x1e0)+_0x1ccc89+_0x524eef(0x1e0)+formatElapsed(_0x4d4b7b[_0x524eef(0x132)]));if(_0x4a0b92[_0x524eef(0x276)]>0x0){const _0x37e783=renderTimeAxis(_0x425f8d,_0x4fab21),_0x2a1c40=new Date(_0x4d4b7b[_0x524eef(0xf5)]),_0x5a7aa5=formatDate(_0x2a1c40),_0x54cf3c=TIMELINE_CONFIG[_0x524eef(0x29e)]+TIMELINE_CONFIG[_0x524eef(0xf1)]+_0x444e19,_0x1ac33a=_0x5a7aa5[_0x524eef(0x189)](_0x54cf3c),_0x457ae1=a52_0x4d046d[_0x524eef(0x12c)](_0x1ac33a);_0x350822['push'](_0x457ae1+'\x20'+_0x37e783);for(const _0x59ab3d of _0x4a0b92){_0x350822[_0x524eef(0x1d8)](renderTaskRow(_0x59ab3d,_0x425f8d,_0x4fab21,_0x444e19));}const _0x5cb3c1=calculateStats(_0x4a0b92);_0x350822[_0x524eef(0x1d8)](formatStats(_0x5cb3c1)),_0x3776a2&&_0x350822['push'](a52_0x4d046d['yellow'](_0x524eef(0xf0)+TIMELINE_CONFIG[_0x524eef(0x28f)]+'\x20of\x20'+_0x131f4a+_0x524eef(0x259))),_0x350822[_0x524eef(0x1d8)](''),_0x350822['push'](a52_0x4d046d['dim'](_0x524eef(0x1c4))+(_0x524eef(0x239)+_0x2ddf59['id']+_0x524eef(0x116))+a52_0x4d046d[_0x524eef(0x12c)](_0x524eef(0x199)));}else _0x350822[_0x524eef(0x1d8)](_0x524eef(0x27b));return _0x350822[_0x524eef(0x17a)]('\x0a');}['buildTimelineData'](_0x29e55f,_0x3e77cd){const _0x488158=a52_0x4f3203,_0x2616ba=new Date(_0x29e55f[_0x488158(0x100)])[_0x488158(0x22d)](),_0x2c76b7=_0x29e55f['finishedAt']?new Date(_0x29e55f[_0x488158(0x270)])[_0x488158(0x22d)]():Date[_0x488158(0x120)](),_0x2aca4d=_0x2c76b7-_0x2616ba,_0x2cc1d8=[];for(const _0x1b8ade of _0x3e77cd){if(_0x1b8ade[_0x488158(0x171)]){const _0x947eb0=new Date(_0x1b8ade[_0x488158(0x171)])[_0x488158(0x22d)](),_0x1ae321=_0x1b8ade[_0x488158(0x164)]?new Date(_0x1b8ade['updatedAt'])[_0x488158(0x22d)]():Date[_0x488158(0x120)]();_0x2cc1d8[_0x488158(0x1d8)]({'name':_0x1b8ade[_0x488158(0x140)],'state':_0x1b8ade['state']||'unknown','window':{'start':_0x947eb0,'end':_0x1ae321,'duration':_0x1ae321-_0x947eb0}});}else _0x2cc1d8[_0x488158(0x1d8)]({'name':_0x1b8ade['fullName'],'state':_0x1b8ade['state']||_0x488158(0x29c),'window':undefined});}const _0x5bec74=calculateStats(_0x2cc1d8);return{'attempt':{'id':_0x29e55f['id'],'status':_0x29e55f['done']?_0x29e55f[_0x488158(0x1d4)]?_0x488158(0x1d4):_0x488158(0x106):_0x488158(0x266),'createdAt':_0x29e55f[_0x488158(0x100)],'finishedAt':_0x29e55f[_0x488158(0x270)],'duration_ms':_0x2aca4d},'tasks':_0x2cc1d8[_0x488158(0x241)](_0x9696ea=>({'name':_0x9696ea[_0x488158(0x184)],'state':_0x9696ea[_0x488158(0x178)],'startedAt':_0x9696ea[_0x488158(0x154)]?new Date(_0x9696ea[_0x488158(0x154)]['start'])[_0x488158(0x2a0)]():null,'updatedAt':_0x9696ea['window']?new Date(_0x9696ea[_0x488158(0x154)][_0x488158(0x28a)])[_0x488158(0x2a0)]():null,'duration_ms':_0x9696ea[_0x488158(0x154)]?.['duration']||null})),'stats':_0x5bec74};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x14bf27,_0xe87c14){const _0x2297d0=a53_0x412f,_0x5674a4=_0x14bf27();while(!![]){try{const _0x3f091d=parseInt(_0x2297d0(0xd7))/0x1+parseInt(_0x2297d0(0xd3))/0x2*(-parseInt(_0x2297d0(0xdd))/0x3)+parseInt(_0x2297d0(0xd0))/0x4+parseInt(_0x2297d0(0xd4))/0x5+-parseInt(_0x2297d0(0xd9))/0x6+parseInt(_0x2297d0(0xd2))/0x7+parseInt(_0x2297d0(0xd1))/0x8*(-parseInt(_0x2297d0(0xcd))/0x9);if(_0x3f091d===_0xe87c14)break;else _0x5674a4['push'](_0x5674a4['shift']());}catch(_0x43bad9){_0x5674a4['push'](_0x5674a4['shift']());}}}(a53_0x1cb4,0x5caf5));import{platform}from'os';import{getAPIKey}from'./config.js';function a53_0x412f(_0x5426eb,_0x3645a8){_0x5426eb=_0x5426eb-0xcd;const _0x1cb412=a53_0x1cb4();let _0x412f2b=_0x1cb412[_0x5426eb];return _0x412f2b;}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x4e2ebc=a53_0x412f,_0x107fd6=getVersion(),_0x147624=platform(),_0x1c07ab=process['version'][_0x4e2ebc(0xce)]('v','');return _0x4e2ebc(0xdc)+_0x107fd6+'\x20('+_0x147624+_0x4e2ebc(0xd5)+_0x1c07ab+')';}export function getAuthHeaders(_0xe35184,_0x2787c4,_0x40f365){const _0x508bc7=a53_0x412f,_0x3d7f08=getVersion(),_0x41f96b={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x3d7f08};if(_0x40f365)_0x41f96b[_0x508bc7(0xd8)]=_0x508bc7(0xd6)+_0x40f365;else _0x2787c4&&(_0x41f96b[_0x508bc7(0xd8)]=_0x508bc7(0xda)+_0x2787c4);return _0x41f96b;}export function toHeaderRecord(_0x4d2339){const _0x49b124=a53_0x412f,_0x36b036={};for(const [_0x1b12ca,_0x42e2d8]of Object[_0x49b124(0xcf)](_0x4d2339)){_0x42e2d8!==undefined&&(_0x36b036[_0x1b12ca]=_0x42e2d8);}return _0x36b036;}export function getTrinoHeaders(_0x144d97,_0x5404cb,_0x5c7dd6){const _0x4a3212=a53_0x412f,_0x12995f=getAuthHeaders(_0x144d97),_0x3889ab=toHeaderRecord(_0x12995f);if(_0x5c7dd6)_0x3889ab[_0x4a3212(0xd8)]=_0x4a3212(0xd6)+_0x5c7dd6;else _0x5404cb&&(_0x3889ab[_0x4a3212(0xdb)]=_0x5404cb);return _0x3889ab;}export function hasAPIKey(_0x2925a4){const _0x296648=getAPIKey();return _0x296648!==undefined&&_0x296648['length']>0x0;}function a53_0x1cb4(){const _0xc2c103=['479462iWSMNP','3540845CttmCo',';\x20node/','Bearer\x20','328047FenOic','Authorization','1339890ThawSR','TD1\x20','X-Trino-User','tdx/','9WSLCGu','5554872KmuYwg','replace','entries','2435264bSflWD','8PKpvKG','2060247GmAVkz'];a53_0x1cb4=function(){return _0xc2c103;};return a53_0x1cb4();}
1
+ (function(_0x41985b,_0x57ce26){const _0x47a4fc=a53_0x12de,_0x1d8b88=_0x41985b();while(!![]){try{const _0x299b8f=parseInt(_0x47a4fc(0xf8))/0x1*(-parseInt(_0x47a4fc(0x106))/0x2)+-parseInt(_0x47a4fc(0xfb))/0x3*(-parseInt(_0x47a4fc(0xfc))/0x4)+-parseInt(_0x47a4fc(0x103))/0x5*(parseInt(_0x47a4fc(0xfe))/0x6)+-parseInt(_0x47a4fc(0x101))/0x7+-parseInt(_0x47a4fc(0x102))/0x8*(-parseInt(_0x47a4fc(0xff))/0x9)+-parseInt(_0x47a4fc(0xf6))/0xa*(-parseInt(_0x47a4fc(0xf0))/0xb)+-parseInt(_0x47a4fc(0x100))/0xc*(-parseInt(_0x47a4fc(0xf2))/0xd);if(_0x299b8f===_0x57ce26)break;else _0x1d8b88['push'](_0x1d8b88['shift']());}catch(_0x27f61c){_0x1d8b88['push'](_0x1d8b88['shift']());}}}(a53_0x3845,0xd515a));import{platform}from'os';function a53_0x3845(){const _0x1a9450=['464aTibXF','64795chwdGV','Bearer\x20','version','120682wvkOer','11CDAxQJ','tdx/','104glQnXM',';\x20node/','entries','X-Trino-User','6903110WyJWOV','Authorization','7CjzpOz','length','tdx','525XzfuxA','2708FjxmWx','replace','348TthXpV','248499FsKRJn','101148YvUQus','3015971WUyOiK'];a53_0x3845=function(){return _0x1a9450;};return a53_0x3845();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x49beab=a53_0x12de,_0x11e6a3=getVersion(),_0xf1dca2=platform(),_0x586e4d=process[_0x49beab(0x105)][_0x49beab(0xfd)]('v','');return _0x49beab(0xf1)+_0x11e6a3+'\x20('+_0xf1dca2+_0x49beab(0xf3)+_0x586e4d+')';}function a53_0x12de(_0x45edbd,_0x185ddf){_0x45edbd=_0x45edbd-0xf0;const _0x3845ff=a53_0x3845();let _0x12de2c=_0x3845ff[_0x45edbd];return _0x12de2c;}export function getAuthHeaders(_0xd9bf97,_0x12ca3a,_0x1a7ef7){const _0x222d18=a53_0x12de,_0x5d0999=getVersion(),_0x52d9a8={'User-Agent':getUserAgent(),'X-TD-Client':_0x222d18(0xfa),'X-TD-Client-Version':_0x5d0999};if(_0x1a7ef7)_0x52d9a8['Authorization']=_0x222d18(0x104)+_0x1a7ef7;else _0x12ca3a&&(_0x52d9a8[_0x222d18(0xf7)]='TD1\x20'+_0x12ca3a);return _0x52d9a8;}export function toHeaderRecord(_0x2c9b32){const _0x2678ee=a53_0x12de,_0x3c8b65={};for(const [_0x361b84,_0x3fb290]of Object[_0x2678ee(0xf4)](_0x2c9b32)){_0x3fb290!==undefined&&(_0x3c8b65[_0x361b84]=_0x3fb290);}return _0x3c8b65;}export function getTrinoHeaders(_0xa224e0,_0x546b76,_0x17b62e){const _0xc33315=a53_0x12de,_0x5cdc0b=getAuthHeaders(_0xa224e0),_0x57ed2c=toHeaderRecord(_0x5cdc0b);if(_0x17b62e)_0x57ed2c['Authorization']=_0xc33315(0x104)+_0x17b62e;else _0x546b76&&(_0x57ed2c[_0xc33315(0xf5)]=_0x546b76);return _0x57ed2c;}export function hasAPIKey(_0x362348){const _0x10a0c0=a53_0x12de,_0x421b60=getAPIKey();return _0x421b60!==undefined&&_0x421b60[_0x10a0c0(0xf9)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x397ad8,_0x3b0ac2){const _0x476004=a54_0xb95e,_0x3f3d60=_0x397ad8();while(!![]){try{const _0x2a234d=-parseInt(_0x476004(0x115))/0x1+-parseInt(_0x476004(0x141))/0x2+-parseInt(_0x476004(0x12d))/0x3+parseInt(_0x476004(0x107))/0x4*(parseInt(_0x476004(0x130))/0x5)+-parseInt(_0x476004(0x109))/0x6+-parseInt(_0x476004(0x14a))/0x7*(parseInt(_0x476004(0x143))/0x8)+parseInt(_0x476004(0x103))/0x9;if(_0x2a234d===_0x3b0ac2)break;else _0x3f3d60['push'](_0x3f3d60['shift']());}catch(_0x97b86d){_0x3f3d60['push'](_0x3f3d60['shift']());}}}(a54_0x1b74,0xbfe29));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a54_0xb95e(_0x519dbd,_0x3e42c3){_0x519dbd=_0x519dbd-0x102;const _0x1b74c0=a54_0x1b74();let _0xb95ea=_0x1b74c0[_0x519dbd];return _0xb95ea;}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a54_0x3be855 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x3c332e){const _0x239a9f=a54_0xb95e;return _0x3c332e[_0x239a9f(0x148)]===_0x239a9f(0x128)||_0x3c332e[_0x239a9f(0x148)]===_0x239a9f(0x12f)||_0x3c332e[_0x239a9f(0x148)]===_0x239a9f(0x129)||_0x3c332e['format']===_0x239a9f(0x13f)||_0x3c332e[_0x239a9f(0x128)]===!![]||_0x3c332e[_0x239a9f(0x12f)]===!![]||_0x3c332e[_0x239a9f(0x129)]===!![]||_0x3c332e[_0x239a9f(0x13f)]===!![];}export function parseOutputOptions(_0x2f27b4){const _0x4d01ca=a54_0xb95e;return{'format':_0x2f27b4[_0x4d01ca(0x148)]||_0x4d01ca(0x13f),'output':_0x2f27b4[_0x4d01ca(0x11b)]||'','limit':_0x2f27b4['limit'],'limitStructuredFormats':_0x2f27b4['limitStructuredFormats'],'color':_0x2f27b4[_0x4d01ca(0x134)],'noColor':_0x2f27b4['noColor']};}function convertSDKResultToQueryResult(_0x269c4c){const _0x282c64=a54_0xb95e,_0x4ba1b3=[];if(_0x269c4c['length']>0x0){const _0x60448a=_0x269c4c[0x0];for(const [_0x3fd5c2,_0x5b7145]of Object[_0x282c64(0x111)](_0x60448a)){let _0x3aa9ab=_0x282c64(0x142);if(typeof _0x5b7145==='number')_0x3aa9ab=Number[_0x282c64(0x146)](_0x5b7145)?_0x282c64(0x136):'double';else{if(typeof _0x5b7145===_0x282c64(0x122))_0x3aa9ab=_0x282c64(0x122);else _0x5b7145===null&&(_0x3aa9ab=_0x282c64(0x142));}_0x4ba1b3[_0x282c64(0x138)]({'name':_0x3fd5c2,'type':_0x3aa9ab});}}return{'queryId':'sdk-result','columns':_0x4ba1b3,'data':_0x269c4c,'stats':{'state':_0x282c64(0x132),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x269c4c[_0x282c64(0x149)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5e3e3b,_0x3ef837){const _0x8b0368=convertSDKResultToQueryResult(_0x5e3e3b);return formatQueryOutput(_0x8b0368,_0x3ef837);}export async function formatQueryOutput(_0x430c64,_0xc3d7d2){const _0x50bcf5=a54_0xb95e,{format:_0x18c6cf,limit:_0x38498c,output:_0x40317e,color:_0x557484,noColor:_0x8f2eb1,limitStructuredFormats:_0x19f318}=_0xc3d7d2,_0x59cd34=Boolean(_0x40317e)&&!_0x557484,_0x1a0bef={'color':_0x557484,'noColor':_0x8f2eb1||_0x59cd34};if(_0x18c6cf===_0x50bcf5(0x13f)){const _0x1d54d7=shouldUseLess(_0x18c6cf,_0x40317e);return formatAsTable(_0x430c64,_0x38498c,_0x1d54d7,_0x1a0bef);}const _0x373129=_0x19f318&&Number[_0x50bcf5(0x11a)](_0x38498c)&&_0x430c64[_0x50bcf5(0x114)][_0x50bcf5(0x149)]>_0x38498c?{..._0x430c64,'data':_0x430c64['data'][_0x50bcf5(0x11c)](0x0,_0x38498c)}:_0x430c64;if(_0x18c6cf===_0x50bcf5(0x128))return formatAsJSON(_0x373129,_0x1a0bef);else return _0x18c6cf===_0x50bcf5(0x12f)?formatAsJSONL(_0x373129,_0x1a0bef):formatQueryResult(_0x373129,_0x18c6cf);}function shouldUseLess(_0x36213f,_0x585ed2){const _0x74faa5=a54_0xb95e;return(_0x36213f===_0x74faa5(0x13f)||_0x36213f===_0x74faa5(0x113))&&process[_0x74faa5(0x11e)][_0x74faa5(0x118)]&&!_0x585ed2;}function a54_0x1b74(){const _0x1dcd2b=['data','422846srNRDF','end','write','isTTY','[logs]','isFinite','output','slice','cmdout','stdout','map','stringify','resolve','boolean','bold','red','limitStructuredFormats','less','max','json','tsv','string','[params]','object','4408713JVNVFE','debug','jsonl','30rmahMM','error','FINISHED','stderr','color','keys','bigint','-FXRSn','push','filter','query','rule','[rule]','blue','repeat','table','Results\x20saved\x20to\x20','1582790NkJYrX','varchar','16LoXLca','forEach','magenta','isInteger','trim','format','length','3810667kMZRHc','inherit','close','40601223fTLPql','padEnd','log','noColor','68056wAlfKq','yellow','328776lKzvAP','join','split','limit','number','[error]','stdin','No\x20data','entries','─┬─','list'];a54_0x1b74=function(){return _0x1dcd2b;};return a54_0x1b74();}export function resolveOutputOptions(_0x1430b1){const _0x19684b=a54_0xb95e,_0x1e1fd4=_0x1430b1[_0x19684b(0x11b)]||'',_0x3d092e=resolveOutputFormat(_0x1430b1[_0x19684b(0x148)],_0x1e1fd4,'table');let _0x578929=typeof _0x1430b1[_0x19684b(0x10c)]===_0x19684b(0x10d)?_0x1430b1['limit']:parseInt(_0x1430b1[_0x19684b(0x10c)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1430b1[_0x19684b(0x10c)]===undefined&&shouldUseLess(_0x3d092e,_0x1e1fd4)&&(_0x578929=Infinity),{'format':_0x3d092e,'output':_0x1e1fd4,'limit':_0x578929,'limitStructuredFormats':_0x1430b1[_0x19684b(0x125)],'color':_0x1430b1[_0x19684b(0x134)],'noColor':_0x1430b1[_0x19684b(0x106)]};}export function writeOutput(_0x56ee88,_0x5551db,_0x5edfbf){const _0x46502c=a54_0xb95e;return _0x5551db?(writeFileSync(_0x5551db,_0x56ee88),console[_0x46502c(0x131)](_0x46502c(0x140)+_0x5551db),Promise[_0x46502c(0x121)]()):shouldUseLess(_0x5edfbf||'','')?new Promise(_0x25e584=>{const _0x2bce5f=_0x46502c,_0x3972fb=spawn(_0x2bce5f(0x126),[_0x2bce5f(0x137)],{'stdio':['pipe',_0x2bce5f(0x14b),_0x2bce5f(0x14b)]});let _0x4b5ed5=![];_0x3972fb['on'](_0x2bce5f(0x131),()=>{const _0x342760=_0x2bce5f;!_0x4b5ed5&&(_0x4b5ed5=!![],console[_0x342760(0x105)](_0x56ee88),_0x25e584());}),_0x3972fb['on'](_0x2bce5f(0x102),()=>{!_0x4b5ed5&&(_0x4b5ed5=!![],_0x25e584());}),_0x3972fb['on']('spawn',()=>{const _0x29c57d=_0x2bce5f;!_0x4b5ed5&&_0x3972fb[_0x29c57d(0x10f)]&&(_0x3972fb[_0x29c57d(0x10f)]['on'](_0x29c57d(0x131),()=>{}),_0x3972fb[_0x29c57d(0x10f)][_0x29c57d(0x117)](_0x56ee88),_0x3972fb['stdin'][_0x29c57d(0x116)]());}),!_0x3972fb[_0x2bce5f(0x10f)]&&(!_0x4b5ed5&&(_0x4b5ed5=!![],console['log'](_0x56ee88),_0x25e584()));}):(console['log'](_0x56ee88),Promise[_0x46502c(0x121)]());}export async function handleSDKOutput(_0x5da1fe,_0x6f0e43){const _0x397ff3=a54_0xb95e,_0x3528e5=resolveOutputOptions(_0x6f0e43),_0x24ce46=await formatSDKOutput(_0x5da1fe,_0x3528e5);await writeOutput(_0x24ce46,_0x3528e5[_0x397ff3(0x11b)]||undefined,_0x3528e5['format']);}export async function handleQueryOutput(_0x4a73c9,_0x4b9f50){const _0x68ce15=a54_0xb95e,_0x32558a=resolveOutputOptions(_0x4b9f50),_0x2f00c8=await formatQueryOutput(_0x4a73c9,_0x32558a);await writeOutput(_0x2f00c8,_0x32558a[_0x68ce15(0x11b)]||undefined,_0x32558a['format']);}async function formatSingleObject(_0x1711ca,_0x3f1b35){const _0x20e4c5=a54_0xb95e,{format:_0x315028,color:_0x352e17,noColor:_0x4b719e}=_0x3f1b35,_0x423072={'color':_0x352e17,'noColor':_0x4b719e};if(_0x315028===_0x20e4c5(0x128)){if(shouldUseColor(_0x423072))return colorizeJSON(_0x1711ca,_0x423072);return JSON[_0x20e4c5(0x120)](_0x1711ca,null,0x2);}else{if(_0x315028===_0x20e4c5(0x12f)){if(shouldUseColor(_0x423072))return colorizeJSONCompact(_0x1711ca,_0x423072);return JSON[_0x20e4c5(0x120)](_0x1711ca);}else{if(_0x315028===_0x20e4c5(0x129))return Object[_0x20e4c5(0x111)](_0x1711ca)['map'](([_0x2fae13,_0x1b81a6])=>_0x2fae13+'\x09'+_0x1b81a6)[_0x20e4c5(0x10a)]('\x0a');else{const _0x101747=Object['entries'](_0x1711ca);if(_0x101747[_0x20e4c5(0x149)]===0x0)return _0x20e4c5(0x110);const _0xb1f2a9=_0x1711ca[_0x20e4c5(0x12e)],_0x30e5cd=_0x1711ca['query'],_0x2c9a4b=_0x1711ca['params'],_0x57de97=_0x1711ca['rule'],_0x322515=_0x30e5cd?typeof _0x30e5cd===_0x20e4c5(0x12a)?_0x30e5cd:JSON['stringify'](_0x30e5cd,null,0x2):undefined,_0x30d884=_0x2c9a4b&&Object[_0x20e4c5(0x135)](_0x2c9a4b)[_0x20e4c5(0x149)]>0x0?JSON[_0x20e4c5(0x120)](_0x2c9a4b,null,0x2):undefined,_0x5bc429=_0x57de97&&Object['keys'](_0x57de97)[_0x20e4c5(0x149)]>0x0?JSON[_0x20e4c5(0x120)](_0x57de97,null,0x2):undefined,_0x34f767=_0x101747[_0x20e4c5(0x139)](([_0x335f02])=>_0x335f02!=='debug'&&_0x335f02!==_0x20e4c5(0x13a)&&_0x335f02!=='params'&&_0x335f02!==_0x20e4c5(0x13b)),_0x3b7273=Math['max'](..._0x34f767[_0x20e4c5(0x11f)](([_0x133693])=>_0x133693[_0x20e4c5(0x149)])),_0x204c3d=Math['max'](..._0x34f767[_0x20e4c5(0x11f)](([,_0x96466c])=>{const _0x239a5a=_0x20e4c5;try{const _0x12dce9=_0x96466c===null||_0x96466c===undefined?'':typeof _0x96466c===_0x239a5a(0x12c)?JSON[_0x239a5a(0x120)](_0x96466c):String(_0x96466c),_0x1d632f=_0x12dce9[_0x239a5a(0x10b)]('\x0a');return Math[_0x239a5a(0x127)](..._0x1d632f[_0x239a5a(0x11f)](_0x3f1d1c=>_0x3f1d1c[_0x239a5a(0x149)]),0x0);}catch{return 0x0;}}),0x14),_0x199848=[];_0x199848[_0x20e4c5(0x138)](colorBorder('┌─'+'─'[_0x20e4c5(0x13e)](_0x3b7273)+_0x20e4c5(0x112)+'─'[_0x20e4c5(0x13e)](_0x204c3d)+'─┐',_0x423072)),_0x34f767[_0x20e4c5(0x144)](([_0x14886c,_0x126828])=>{const _0x3a183a=_0x20e4c5;let _0xb4ae8a;try{_0xb4ae8a=_0x126828===null||_0x126828===undefined?'':typeof _0x126828===_0x3a183a(0x12c)?JSON['stringify'](_0x126828):String(_0x126828);}catch{_0xb4ae8a='[Object]';}const _0x2a739f=_0x14886c[_0x3a183a(0x104)](_0x3b7273),_0x305f34=_0xb4ae8a[_0x3a183a(0x10b)]('\x0a');_0x305f34[_0x3a183a(0x144)]((_0x345cc1,_0x46b58e)=>{const _0x458647=_0x3a183a,_0x563a52=colorBorder('│',_0x423072);_0x46b58e===0x0?_0x199848[_0x458647(0x138)](_0x563a52+'\x20'+_0x2a739f+'\x20'+_0x563a52+'\x20'+_0x345cc1['padEnd'](_0x204c3d)+'\x20'+_0x563a52):_0x199848[_0x458647(0x138)](_0x563a52+'\x20'+'\x20'['repeat'](_0x3b7273)+'\x20'+_0x563a52+'\x20'+_0x345cc1[_0x458647(0x104)](_0x204c3d)+'\x20'+_0x563a52);});}),_0x199848[_0x20e4c5(0x138)](colorBorder('└─'+'─'['repeat'](_0x3b7273)+'─┴─'+'─'['repeat'](_0x204c3d)+'─┘',_0x423072));_0x322515&&(_0x199848[_0x20e4c5(0x138)](''),_0x199848[_0x20e4c5(0x138)](String(a54_0x3be855[_0x20e4c5(0x108)][_0x20e4c5(0x123)]('[query]'))),_0x199848[_0x20e4c5(0x138)](_0x322515));_0x30d884&&(_0x199848[_0x20e4c5(0x138)](''),_0x199848['push'](String(a54_0x3be855[_0x20e4c5(0x13d)][_0x20e4c5(0x123)](_0x20e4c5(0x12b)))),_0x199848[_0x20e4c5(0x138)](_0x30d884));_0x5bc429&&(_0x199848[_0x20e4c5(0x138)](''),_0x199848[_0x20e4c5(0x138)](String(a54_0x3be855[_0x20e4c5(0x145)][_0x20e4c5(0x123)](_0x20e4c5(0x13c)))),_0x199848[_0x20e4c5(0x138)](_0x5bc429));if(_0xb1f2a9){if(_0xb1f2a9[_0x20e4c5(0x133)]){_0x199848[_0x20e4c5(0x138)](''),_0x199848[_0x20e4c5(0x138)](String(a54_0x3be855[_0x20e4c5(0x124)]['bold'](_0x20e4c5(0x10e))));const _0x443b3c=_0xb1f2a9[_0x20e4c5(0x133)]['split']('\x0a');_0x443b3c[_0x20e4c5(0x144)](_0x43132a=>{const _0x33a6b9=_0x20e4c5;_0x43132a['trim']()&&_0x199848[_0x33a6b9(0x138)](_0x43132a);});}if(_0xb1f2a9[_0x20e4c5(0x11d)]){_0x199848[_0x20e4c5(0x138)](''),_0x199848['push'](String(a54_0x3be855['cyan']['bold'](_0x20e4c5(0x119))));const _0xb510ab=_0xb1f2a9[_0x20e4c5(0x11d)][_0x20e4c5(0x10b)]('\x0a');_0xb510ab[_0x20e4c5(0x144)](_0x43fe55=>{const _0x8b8550=_0x20e4c5;_0x43fe55[_0x8b8550(0x147)]()&&_0x199848[_0x8b8550(0x138)](_0x43fe55);});}}return _0x199848['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x8e6df6,_0x1b5fde){const _0x553f07=a54_0xb95e;if(_0x1b5fde['format']===_0x553f07(0x13f)){await handleSDKOutput([_0x8e6df6],_0x1b5fde);return;}const _0x5279ce=resolveOutputOptions(_0x1b5fde),_0x3a8314=await formatSingleObject(_0x8e6df6,_0x5279ce);await writeOutput(_0x3a8314,_0x5279ce[_0x553f07(0x11b)]||undefined,_0x5279ce[_0x553f07(0x148)]);}
1
+ (function(_0x256df4,_0xab7fe1){const _0x5a0609=a54_0x10e7,_0x3216a1=_0x256df4();while(!![]){try{const _0x44125d=-parseInt(_0x5a0609(0x170))/0x1+-parseInt(_0x5a0609(0x19d))/0x2+-parseInt(_0x5a0609(0x16a))/0x3+-parseInt(_0x5a0609(0x182))/0x4*(parseInt(_0x5a0609(0x174))/0x5)+parseInt(_0x5a0609(0x194))/0x6+parseInt(_0x5a0609(0x193))/0x7+parseInt(_0x5a0609(0x16e))/0x8;if(_0x44125d===_0xab7fe1)break;else _0x3216a1['push'](_0x3216a1['shift']());}catch(_0x3e7526){_0x3216a1['push'](_0x3216a1['shift']());}}}(a54_0x302d,0x65ca8));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a54_0x5e45cd from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a54_0x302d(){const _0x324c27=['bigint','[error]','repeat','3878021JshkkU','2551626rlJocr','stringify','keys','blue','map','table','tsv','[query]','FINISHED','458442XUnfnv','less','string','entries','resolve','bold','format','[rule]','limitStructuredFormats','stderr','log','split','double','varchar','query','2035314aFqAWa','join','stdout','─┬─','13076976uouHzZ','noColor','606580cwEDhw','yellow','params','stdin','262585yIUAZc','[logs]','object','data','trim','list','limit','boolean','error','inherit','jsonl','[params]','rule','slice','52dfjfna','pipe','number','forEach','padEnd','write','max','push','sdk-result','length','output','json','debug','color'];a54_0x302d=function(){return _0x324c27;};return a54_0x302d();}export function isStructuredFormat(_0x52494b){const _0x3192d3=a54_0x10e7;return _0x52494b[_0x3192d3(0x1a3)]==='json'||_0x52494b['format']===_0x3192d3(0x17e)||_0x52494b['format']===_0x3192d3(0x19a)||_0x52494b[_0x3192d3(0x1a3)]===_0x3192d3(0x199)||_0x52494b['json']===!![]||_0x52494b[_0x3192d3(0x17e)]===!![]||_0x52494b[_0x3192d3(0x19a)]===!![]||_0x52494b['table']===!![];}function a54_0x10e7(_0xeecfb5,_0x346dca){_0xeecfb5=_0xeecfb5-0x163;const _0x302d04=a54_0x302d();let _0x10e75f=_0x302d04[_0xeecfb5];return _0x10e75f;}export function parseOutputOptions(_0x528f23){const _0xd8ddf1=a54_0x10e7;return{'format':_0x528f23[_0xd8ddf1(0x1a3)]||_0xd8ddf1(0x199),'output':_0x528f23[_0xd8ddf1(0x18c)]||'','limit':_0x528f23['limit'],'limitStructuredFormats':_0x528f23[_0xd8ddf1(0x163)],'color':_0x528f23[_0xd8ddf1(0x18f)],'noColor':_0x528f23[_0xd8ddf1(0x16f)]};}function convertSDKResultToQueryResult(_0x277db1){const _0x325aff=a54_0x10e7,_0x403cf5=[];if(_0x277db1[_0x325aff(0x18b)]>0x0){const _0x4bfd32=_0x277db1[0x0];for(const [_0x164b8b,_0x57390f]of Object[_0x325aff(0x1a0)](_0x4bfd32)){let _0xd15934=_0x325aff(0x168);if(typeof _0x57390f===_0x325aff(0x184))_0xd15934=Number['isInteger'](_0x57390f)?_0x325aff(0x190):_0x325aff(0x167);else{if(typeof _0x57390f===_0x325aff(0x17b))_0xd15934=_0x325aff(0x17b);else _0x57390f===null&&(_0xd15934='varchar');}_0x403cf5['push']({'name':_0x164b8b,'type':_0xd15934});}}return{'queryId':_0x325aff(0x18a),'columns':_0x403cf5,'data':_0x277db1,'stats':{'state':_0x325aff(0x19c),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x277db1['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x14242e,_0x5b5b7b){const _0x5bef88=convertSDKResultToQueryResult(_0x14242e);return formatQueryOutput(_0x5bef88,_0x5b5b7b);}export async function formatQueryOutput(_0x5817e4,_0x3e545a){const _0x173545=a54_0x10e7,{format:_0x5efcc2,limit:_0x2c5686,output:_0x55bb2c,color:_0x56d413,noColor:_0xb80f7,limitStructuredFormats:_0x1477fb}=_0x3e545a,_0xb1b4a5=Boolean(_0x55bb2c)&&!_0x56d413,_0x1d1183={'color':_0x56d413,'noColor':_0xb80f7||_0xb1b4a5};if(_0x5efcc2===_0x173545(0x199)){const _0x59aa4d=shouldUseLess(_0x5efcc2,_0x55bb2c);return formatAsTable(_0x5817e4,_0x2c5686,_0x59aa4d,_0x1d1183);}const _0x22d94d=_0x1477fb&&Number['isFinite'](_0x2c5686)&&_0x5817e4[_0x173545(0x177)]['length']>_0x2c5686?{..._0x5817e4,'data':_0x5817e4['data'][_0x173545(0x181)](0x0,_0x2c5686)}:_0x5817e4;if(_0x5efcc2===_0x173545(0x18d))return formatAsJSON(_0x22d94d,_0x1d1183);else return _0x5efcc2==='jsonl'?formatAsJSONL(_0x22d94d,_0x1d1183):formatQueryResult(_0x22d94d,_0x5efcc2);}function shouldUseLess(_0x52ad6c,_0x40e238){const _0x5334e7=a54_0x10e7;return(_0x52ad6c===_0x5334e7(0x199)||_0x52ad6c===_0x5334e7(0x179))&&process[_0x5334e7(0x16c)]['isTTY']&&!_0x40e238;}export function resolveOutputOptions(_0x2e7b3b){const _0x3ee823=a54_0x10e7,_0x998971=_0x2e7b3b[_0x3ee823(0x18c)]||'',_0x54180c=resolveOutputFormat(_0x2e7b3b['format'],_0x998971,'table');let _0x226f35=typeof _0x2e7b3b[_0x3ee823(0x17a)]===_0x3ee823(0x184)?_0x2e7b3b[_0x3ee823(0x17a)]:parseInt(_0x2e7b3b[_0x3ee823(0x17a)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x2e7b3b['limit']===undefined&&shouldUseLess(_0x54180c,_0x998971)&&(_0x226f35=Infinity),{'format':_0x54180c,'output':_0x998971,'limit':_0x226f35,'limitStructuredFormats':_0x2e7b3b[_0x3ee823(0x163)],'color':_0x2e7b3b[_0x3ee823(0x18f)],'noColor':_0x2e7b3b[_0x3ee823(0x16f)]};}export function writeOutput(_0x23116e,_0x1702e9,_0x3fc1fb){const _0x3ef0a9=a54_0x10e7;return _0x1702e9?(writeFileSync(_0x1702e9,_0x23116e),console[_0x3ef0a9(0x17c)]('Results\x20saved\x20to\x20'+_0x1702e9),Promise[_0x3ef0a9(0x1a1)]()):shouldUseLess(_0x3fc1fb||'','')?new Promise(_0x1bb013=>{const _0x11c326=_0x3ef0a9,_0x1b1849=spawn(_0x11c326(0x19e),['-FXRSn'],{'stdio':[_0x11c326(0x183),_0x11c326(0x17d),_0x11c326(0x17d)]});let _0x29d624=![];_0x1b1849['on']('error',()=>{const _0x3e5bda=_0x11c326;!_0x29d624&&(_0x29d624=!![],console[_0x3e5bda(0x165)](_0x23116e),_0x1bb013());}),_0x1b1849['on']('close',()=>{!_0x29d624&&(_0x29d624=!![],_0x1bb013());}),_0x1b1849['on']('spawn',()=>{const _0xab805e=_0x11c326;!_0x29d624&&_0x1b1849['stdin']&&(_0x1b1849[_0xab805e(0x173)]['on']('error',()=>{}),_0x1b1849[_0xab805e(0x173)][_0xab805e(0x187)](_0x23116e),_0x1b1849[_0xab805e(0x173)]['end']());}),!_0x1b1849[_0x11c326(0x173)]&&(!_0x29d624&&(_0x29d624=!![],console[_0x11c326(0x165)](_0x23116e),_0x1bb013()));}):(console[_0x3ef0a9(0x165)](_0x23116e),Promise['resolve']());}export async function handleSDKOutput(_0x4727d9,_0x5e7661){const _0x3cd315=a54_0x10e7,_0x522cd1=resolveOutputOptions(_0x5e7661),_0x382363=await formatSDKOutput(_0x4727d9,_0x522cd1);await writeOutput(_0x382363,_0x522cd1[_0x3cd315(0x18c)]||undefined,_0x522cd1['format']);}export async function handleQueryOutput(_0x270ad6,_0xc00baf){const _0x2f7aab=a54_0x10e7,_0x4005a0=resolveOutputOptions(_0xc00baf),_0x27f7d3=await formatQueryOutput(_0x270ad6,_0x4005a0);await writeOutput(_0x27f7d3,_0x4005a0[_0x2f7aab(0x18c)]||undefined,_0x4005a0['format']);}async function formatSingleObject(_0x5db317,_0x5121d2){const _0x52a4a5=a54_0x10e7,{format:_0x5ae82f,color:_0x1aeb20,noColor:_0x1093cb}=_0x5121d2,_0x1e5abc={'color':_0x1aeb20,'noColor':_0x1093cb};if(_0x5ae82f===_0x52a4a5(0x18d)){if(shouldUseColor(_0x1e5abc))return colorizeJSON(_0x5db317,_0x1e5abc);return JSON['stringify'](_0x5db317,null,0x2);}else{if(_0x5ae82f===_0x52a4a5(0x17e)){if(shouldUseColor(_0x1e5abc))return colorizeJSONCompact(_0x5db317,_0x1e5abc);return JSON['stringify'](_0x5db317);}else{if(_0x5ae82f==='tsv')return Object[_0x52a4a5(0x1a0)](_0x5db317)['map'](([_0x19ff42,_0x44fbff])=>_0x19ff42+'\x09'+_0x44fbff)[_0x52a4a5(0x16b)]('\x0a');else{const _0x27d45b=Object[_0x52a4a5(0x1a0)](_0x5db317);if(_0x27d45b['length']===0x0)return'No\x20data';const _0xc9d8dd=_0x5db317[_0x52a4a5(0x18e)],_0x550646=_0x5db317[_0x52a4a5(0x169)],_0x5c2f0d=_0x5db317[_0x52a4a5(0x172)],_0x17ceb9=_0x5db317[_0x52a4a5(0x180)],_0x3ed3e3=_0x550646?typeof _0x550646===_0x52a4a5(0x19f)?_0x550646:JSON['stringify'](_0x550646,null,0x2):undefined,_0x44e5a3=_0x5c2f0d&&Object[_0x52a4a5(0x196)](_0x5c2f0d)['length']>0x0?JSON[_0x52a4a5(0x195)](_0x5c2f0d,null,0x2):undefined,_0x434057=_0x17ceb9&&Object[_0x52a4a5(0x196)](_0x17ceb9)[_0x52a4a5(0x18b)]>0x0?JSON[_0x52a4a5(0x195)](_0x17ceb9,null,0x2):undefined,_0x2d2423=_0x27d45b['filter'](([_0x4c4f1b])=>_0x4c4f1b!==_0x52a4a5(0x18e)&&_0x4c4f1b!==_0x52a4a5(0x169)&&_0x4c4f1b!=='params'&&_0x4c4f1b!==_0x52a4a5(0x180)),_0x33ce31=Math[_0x52a4a5(0x188)](..._0x2d2423['map'](([_0x229ac])=>_0x229ac[_0x52a4a5(0x18b)])),_0x4d3ab2=Math[_0x52a4a5(0x188)](..._0x2d2423[_0x52a4a5(0x198)](([,_0x33bb5f])=>{const _0x36c389=_0x52a4a5;try{const _0x4009c9=_0x33bb5f===null||_0x33bb5f===undefined?'':typeof _0x33bb5f==='object'?JSON['stringify'](_0x33bb5f):String(_0x33bb5f),_0x13eced=_0x4009c9[_0x36c389(0x166)]('\x0a');return Math[_0x36c389(0x188)](..._0x13eced['map'](_0x4099f2=>_0x4099f2[_0x36c389(0x18b)]),0x0);}catch{return 0x0;}}),0x14),_0x3d2d4c=[];_0x3d2d4c[_0x52a4a5(0x189)](colorBorder('┌─'+'─'['repeat'](_0x33ce31)+_0x52a4a5(0x16d)+'─'[_0x52a4a5(0x192)](_0x4d3ab2)+'─┐',_0x1e5abc)),_0x2d2423[_0x52a4a5(0x185)](([_0x22e0cc,_0x415f8e])=>{const _0x3325d3=_0x52a4a5;let _0x5f3e24;try{_0x5f3e24=_0x415f8e===null||_0x415f8e===undefined?'':typeof _0x415f8e===_0x3325d3(0x176)?JSON[_0x3325d3(0x195)](_0x415f8e):String(_0x415f8e);}catch{_0x5f3e24='[Object]';}const _0x522f26=_0x22e0cc[_0x3325d3(0x186)](_0x33ce31),_0x2f1140=_0x5f3e24[_0x3325d3(0x166)]('\x0a');_0x2f1140[_0x3325d3(0x185)]((_0xc2ef54,_0x45bcf5)=>{const _0x247b87=_0x3325d3,_0x471467=colorBorder('│',_0x1e5abc);_0x45bcf5===0x0?_0x3d2d4c['push'](_0x471467+'\x20'+_0x522f26+'\x20'+_0x471467+'\x20'+_0xc2ef54[_0x247b87(0x186)](_0x4d3ab2)+'\x20'+_0x471467):_0x3d2d4c[_0x247b87(0x189)](_0x471467+'\x20'+'\x20'['repeat'](_0x33ce31)+'\x20'+_0x471467+'\x20'+_0xc2ef54[_0x247b87(0x186)](_0x4d3ab2)+'\x20'+_0x471467);});}),_0x3d2d4c[_0x52a4a5(0x189)](colorBorder('└─'+'─'['repeat'](_0x33ce31)+'─┴─'+'─'[_0x52a4a5(0x192)](_0x4d3ab2)+'─┘',_0x1e5abc));_0x3ed3e3&&(_0x3d2d4c[_0x52a4a5(0x189)](''),_0x3d2d4c['push'](String(a54_0x5e45cd[_0x52a4a5(0x171)][_0x52a4a5(0x1a2)](_0x52a4a5(0x19b)))),_0x3d2d4c[_0x52a4a5(0x189)](_0x3ed3e3));_0x44e5a3&&(_0x3d2d4c['push'](''),_0x3d2d4c[_0x52a4a5(0x189)](String(a54_0x5e45cd[_0x52a4a5(0x197)][_0x52a4a5(0x1a2)](_0x52a4a5(0x17f)))),_0x3d2d4c[_0x52a4a5(0x189)](_0x44e5a3));_0x434057&&(_0x3d2d4c[_0x52a4a5(0x189)](''),_0x3d2d4c['push'](String(a54_0x5e45cd['magenta'][_0x52a4a5(0x1a2)](_0x52a4a5(0x1a4)))),_0x3d2d4c[_0x52a4a5(0x189)](_0x434057));if(_0xc9d8dd){if(_0xc9d8dd['stderr']){_0x3d2d4c[_0x52a4a5(0x189)](''),_0x3d2d4c['push'](String(a54_0x5e45cd['red'][_0x52a4a5(0x1a2)](_0x52a4a5(0x191))));const _0x2c39b6=_0xc9d8dd[_0x52a4a5(0x164)][_0x52a4a5(0x166)]('\x0a');_0x2c39b6[_0x52a4a5(0x185)](_0x487b39=>{const _0x95465a=_0x52a4a5;_0x487b39[_0x95465a(0x178)]()&&_0x3d2d4c[_0x95465a(0x189)](_0x487b39);});}if(_0xc9d8dd['cmdout']){_0x3d2d4c[_0x52a4a5(0x189)](''),_0x3d2d4c['push'](String(a54_0x5e45cd['cyan'][_0x52a4a5(0x1a2)](_0x52a4a5(0x175))));const _0x5d99ba=_0xc9d8dd['cmdout'][_0x52a4a5(0x166)]('\x0a');_0x5d99ba[_0x52a4a5(0x185)](_0x58cc30=>{const _0x1f7866=_0x52a4a5;_0x58cc30[_0x1f7866(0x178)]()&&_0x3d2d4c['push'](_0x58cc30);});}}return _0x3d2d4c[_0x52a4a5(0x16b)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2be005,_0x179968){const _0x5d95d2=a54_0x10e7;if(_0x179968['format']===_0x5d95d2(0x199)){await handleSDKOutput([_0x2be005],_0x179968);return;}const _0x58e965=resolveOutputOptions(_0x179968),_0x17bb29=await formatSingleObject(_0x2be005,_0x58e965);await writeOutput(_0x17bb29,_0x58e965['output']||undefined,_0x58e965['format']);}