@treasuredata/tdx 2026.3.19 → 2026.3.20

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 (204) 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/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/segment-validator.js.map +1 -1
  147. package/dist/sdk/segment/target-resolution.js +1 -1
  148. package/dist/sdk/segment/tdx-config.js +1 -1
  149. package/dist/sdk/segment/types/activation-schema.js +1 -1
  150. package/dist/sdk/segment/types/journey-def.js +1 -1
  151. package/dist/sdk/segment/types/journey-schema.js +1 -1
  152. package/dist/sdk/segment/types/segment-def.js +1 -1
  153. package/dist/sdk/segment/types/segment-schema.js +1 -1
  154. package/dist/sdk/segment/validate-files.js +1 -1
  155. package/dist/sdk/segment/yaml-validator.js +1 -1
  156. package/dist/sdk/segment.js +1 -1
  157. package/dist/sdk/types/index.js +1 -1
  158. package/dist/sdk/types/progress.js +1 -1
  159. package/dist/sdk/user.js +1 -1
  160. package/dist/sdk/util/format-detector.js +1 -1
  161. package/dist/sdk/util/formatters.js +1 -1
  162. package/dist/sdk/util/index.js +1 -1
  163. package/dist/sdk/util/paginate.js +1 -1
  164. package/dist/sdk/util/tree-formatter.js +1 -1
  165. package/dist/sdk/workflow/archive-validation.js +1 -1
  166. package/dist/sdk/workflow/clone-workflow.js +1 -1
  167. package/dist/sdk/workflow/index.js +1 -1
  168. package/dist/sdk/workflow/pull-workflow.js +1 -1
  169. package/dist/sdk/workflow/push-workflow.js +1 -1
  170. package/dist/sdk/workflow/tdx-config.js +1 -1
  171. package/dist/sdk/workflow/workflow-utils.js +1 -1
  172. package/dist/test-utils/command-runner.js +1 -1
  173. package/dist/test-utils/factories.js +1 -1
  174. package/dist/test-utils/fixtures.js +1 -1
  175. package/dist/test-utils/http-mock.js +1 -1
  176. package/dist/test-utils/index.js +1 -1
  177. package/dist/utils/async.js +1 -1
  178. package/dist/utils/colors.js +1 -1
  179. package/dist/utils/diff.js +1 -1
  180. package/dist/utils/file-permissions.js +1 -1
  181. package/dist/utils/file-reader.js +1 -1
  182. package/dist/utils/github-releases.js +1 -1
  183. package/dist/utils/global-cache.js +1 -1
  184. package/dist/utils/json-loader.js +1 -1
  185. package/dist/utils/local-cache.js +1 -1
  186. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  187. package/dist/utils/logger/formatters/index.js +1 -1
  188. package/dist/utils/logger/handlers/console-handler.js +1 -1
  189. package/dist/utils/logger/handlers/file-handler.js +1 -1
  190. package/dist/utils/logger/handlers/index.js +1 -1
  191. package/dist/utils/logger/handlers/null-handler.js +1 -1
  192. package/dist/utils/logger/index.js +1 -1
  193. package/dist/utils/logger/logger.js +1 -1
  194. package/dist/utils/logger/types.js +1 -1
  195. package/dist/utils/option-validation.js +1 -1
  196. package/dist/utils/process.js +1 -1
  197. package/dist/utils/prompt.js +1 -1
  198. package/dist/utils/spinner.js +1 -1
  199. package/dist/utils/sse-parser.js +1 -1
  200. package/dist/utils/string-utils.js +1 -1
  201. package/dist/utils/table-ref-parser.js +1 -1
  202. package/dist/utils/tdx-logger.js +1 -1
  203. package/dist/utils/version-check.js +1 -1
  204. package/package.json +1 -1
@@ -1 +1 @@
1
- const a51_0x198ccf=a51_0x2f39;(function(_0x11648d,_0x2c991b){const _0x531bf5=a51_0x2f39,_0x5a38a3=_0x11648d();while(!![]){try{const _0x31ef2a=-parseInt(_0x531bf5(0x352))/0x1+parseInt(_0x531bf5(0x314))/0x2+parseInt(_0x531bf5(0x27b))/0x3+parseInt(_0x531bf5(0x2b9))/0x4*(-parseInt(_0x531bf5(0x347))/0x5)+-parseInt(_0x531bf5(0x2dc))/0x6*(parseInt(_0x531bf5(0x2e4))/0x7)+parseInt(_0x531bf5(0x328))/0x8+parseInt(_0x531bf5(0x258))/0x9;if(_0x31ef2a===_0x2c991b)break;else _0x5a38a3['push'](_0x5a38a3['shift']());}catch(_0xb1fab){_0x5a38a3['push'](_0x5a38a3['shift']());}}}(a51_0x3170,0x81259));import a51_0x35b3be from'chalk';import{existsSync}from'fs';import a51_0x3ec8c4 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 a51_0x4141d8 from'prompts';function getAttemptStatusDisplay(_0x2043ba){const _0x548336=a51_0x2f39;if(!_0x2043ba)return{'icon':'⏳','text':''};const {done:_0x2c7ea2,success:_0x4c5093,cancelRequested:_0x4a8a2d}=_0x2043ba;if(!_0x2c7ea2)return _0x4a8a2d?{'icon':'🛑','text':a51_0x35b3be[_0x548336(0x35b)](_0x548336(0x31a))}:{'icon':'🔄','text':a51_0x35b3be[_0x548336(0x216)](_0x548336(0x2db))};if(_0x4c5093)return{'icon':'✅','text':a51_0x35b3be[_0x548336(0x2a4)]('success')};return{'icon':'❌','text':a51_0x35b3be[_0x548336(0x294)](_0x548336(0x358))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x198ccf(0x2fe)](_0x392051,_0x4162c5,_0x201e48=0x0){const _0x394a88=a51_0x198ccf;return _0x392051[_0x201e48]||_0x4162c5[_0x394a88(0x222)];}[a51_0x198ccf(0x267)](_0x4b77b6,_0x32d3dc,_0x339787=0x0){const _0x15aa1a=a51_0x198ccf,_0x14cd70=this[_0x15aa1a(0x2fe)](_0x4b77b6,_0x32d3dc,_0x339787);if(!_0x14cd70)return console['error'](a51_0x35b3be[_0x15aa1a(0x294)]('Error:'),_0x15aa1a(0x20c)),console[_0x15aa1a(0x358)](a51_0x35b3be[_0x15aa1a(0x344)](_0x15aa1a(0x33f))),null;return _0x14cd70;}[a51_0x198ccf(0x2af)](_0x2d746e,_0x377ce1){const _0x1f746c=a51_0x198ccf;if(_0x2d746e[0x0]){const _0x263a4b=_0x2d746e[0x0][_0x1f746c(0x356)]('.');if(_0x263a4b[_0x1f746c(0x252)]===0x1)return{'projectName':_0x263a4b[0x0],'workflowName':undefined};else return _0x263a4b['length']===0x2?{'projectName':_0x263a4b[0x0],'workflowName':_0x263a4b[0x1]}:(console[_0x1f746c(0x358)](a51_0x35b3be[_0x1f746c(0x294)](_0x1f746c(0x28e)),_0x1f746c(0x38d)),null);}return{'projectName':_0x377ce1[_0x1f746c(0x222)],'workflowName':undefined};}[a51_0x198ccf(0x286)](_0x3d8ebe,_0x3881f2,_0x102ac8=0x0){const _0x39c300=a51_0x198ccf;if(_0x3d8ebe[_0x102ac8])return _0x3d8ebe[_0x102ac8];if(_0x3881f2[_0x39c300(0x222)]){const _0x38b26e=a51_0x3ec8c4[_0x39c300(0x274)](process[_0x39c300(0x302)](),_0x39c300(0x262),_0x3881f2[_0x39c300(0x222)]);if(existsSync(a51_0x3ec8c4[_0x39c300(0x274)](_0x38b26e,'tdx.json')))return _0x38b26e;}return undefined;}async[a51_0x198ccf(0x27d)](_0x24fce4,_0x3dad69,_0x20ffd6){const _0xbdacdc=a51_0x198ccf;try{const _0x2ea89d=await _0x24fce4['workflow'][_0xbdacdc(0x262)](_0x3dad69,{'limit':0x1});if(_0x2ea89d[_0xbdacdc(0x252)]>0x0){const _0x323e95=_0x2ea89d[0x0]['id'],_0xc54b79=getWorkflowUrl(_0x20ffd6,_0x323e95);console['error'](_0xbdacdc(0x2d4)+a51_0x35b3be['cyan'](_0xc54b79));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x384);['description']=a51_0x198ccf(0x31b);async[a51_0x198ccf(0x1ff)](_0x549e34){const _0x199dfe=a51_0x198ccf,{options:_0xca7314,args:_0x19abb4,tdx:_0x565d2f}=_0x549e34,_0x9f392=_0x19abb4[0x0],_0x59c9e9=_0xca7314[_0x199dfe(0x375)];if(_0x59c9e9)return saveSessionContext({'workflow_project':undefined},_0xca7314[_0x199dfe(0x359)]),console[_0x199dfe(0x263)](a51_0x35b3be[_0x199dfe(0x2a4)](_0x199dfe(0x260))),0x0;if(!_0x9f392)return console[_0x199dfe(0x358)](a51_0x35b3be[_0x199dfe(0x294)](_0x199dfe(0x28e)),_0x199dfe(0x20c)),console['error'](a51_0x35b3be[_0x199dfe(0x344)](_0x199dfe(0x32f))),console[_0x199dfe(0x358)](a51_0x35b3be['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x3d3921=await withSpinner('Resolving\x20project\x20\x27'+_0x9f392+'\x27...',()=>_0x565d2f[_0x199dfe(0x2d3)][_0x199dfe(0x312)](_0x9f392),{'verbose':_0xca7314[_0x199dfe(0x2ce)]}),{name:_0x3e8e36}=_0x3d3921['data'];return saveSessionContext({'workflow_project':_0x3e8e36},_0xca7314['session']),console[_0x199dfe(0x263)](a51_0x35b3be[_0x199dfe(0x2a4)](_0x199dfe(0x36b)+a51_0x35b3be[_0x199dfe(0x37e)](_0x3e8e36))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a51_0x198ccf(0x2e0);['description']='List\x20all\x20workflow\x20projects';async['execute'](_0x249141){const _0x13c2ef=a51_0x198ccf,{options:_0x55db4b,args:_0x2d8fce,tdx:_0xfc7de2}=_0x249141,_0x2fad7f=_0x2d8fce[0x0];_0x55db4b[_0x13c2ef(0x2ce)]&&_0x2fad7f&&console[_0x13c2ef(0x358)](_0x13c2ef(0x27a)+_0x2fad7f);const _0x15166f=await withSpinner(_0x13c2ef(0x396),()=>_0xfc7de2[_0x13c2ef(0x2d3)][_0x13c2ef(0x23a)](_0x2fad7f,{'limit':_0x55db4b[_0x13c2ef(0x320)]}),{'verbose':_0x55db4b[_0x13c2ef(0x2ce)]});let _0x5ee41d=_0x15166f[_0x13c2ef(0x303)];_0x5ee41d[_0x13c2ef(0x224)]((_0x340048,_0x540381)=>_0x340048[_0x13c2ef(0x236)][_0x13c2ef(0x259)](_0x540381[_0x13c2ef(0x236)]));const _0x3fff3b=_0x55db4b[_0x13c2ef(0x320)]||0x64,_0x2fe8d6=_0x5ee41d[_0x13c2ef(0x252)]>=_0x3fff3b?a51_0x35b3be[_0x13c2ef(0x344)](_0x13c2ef(0x39c)):'';console['error'](_0x13c2ef(0x1f2)+_0x5ee41d['length']+_0x13c2ef(0x2e1)+(_0x5ee41d[_0x13c2ef(0x252)]!==0x1?'s':'')+_0x2fe8d6);if(_0x55db4b[_0x13c2ef(0x200)]===_0x13c2ef(0x21b)||_0x55db4b[_0x13c2ef(0x200)]==='jsonl'||_0x55db4b['format']===_0x13c2ef(0x211))await handleSDKOutput(_0x5ee41d,_0x55db4b);else{if(_0x5ee41d[_0x13c2ef(0x252)]===0x0)_0x2fad7f?console[_0x13c2ef(0x263)](_0x13c2ef(0x390)+_0x2fad7f):console[_0x13c2ef(0x263)]('No\x20workflow\x20projects\x20found');else{const _0x49cba5=_0x5ee41d[_0x13c2ef(0x316)](_0x31a551=>{const _0x45f72d=_0x13c2ef,_0x59298f=_0x31a551[_0x45f72d(0x2c0)]?.[_0x45f72d(0x2d5)](_0xf0f524=>_0xf0f524[_0x45f72d(0x2c8)]==='sys'),_0x2d1f81=_0x59298f?a51_0x35b3be[_0x45f72d(0x344)](_0x45f72d(0x2aa)):'';return _0x45f72d(0x33d)+_0x31a551[_0x45f72d(0x236)]+_0x2d1f81;});await writeOutput(_0x49cba5[_0x13c2ef(0x274)]('\x0a'),_0x55db4b[_0x13c2ef(0x264)],_0x13c2ef(0x226));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x255);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x388);async[a51_0x198ccf(0x1ff)](_0x2f3c26){const _0x15271a=a51_0x198ccf,{options:_0x16f1e9,args:_0x299e98,tdx:_0x518adf}=_0x2f3c26,_0x59457c=this['resolveProject'](_0x299e98,_0x16f1e9);_0x16f1e9[_0x15271a(0x2ce)]&&_0x59457c&&console[_0x15271a(0x358)](_0x15271a(0x39a)+_0x59457c);const _0x2a3681=await withSpinner('Listing\x20workflows...',()=>_0x518adf[_0x15271a(0x2d3)][_0x15271a(0x262)](_0x59457c,{'limit':_0x16f1e9[_0x15271a(0x320)]}),{'verbose':_0x16f1e9['verbose']});let _0x767e1d=_0x2a3681[_0x15271a(0x303)];_0x767e1d[_0x15271a(0x224)]((_0x15db8f,_0x425cbc)=>{const _0xed670=_0x15271a,_0x563e07=_0x15db8f[_0xed670(0x236)][_0xed670(0x259)](_0x425cbc[_0xed670(0x236)]);if(_0x563e07!==0x0)return _0x563e07;return(_0x15db8f[_0xed670(0x218)]?.['name']||'')[_0xed670(0x259)](_0x425cbc[_0xed670(0x218)]?.[_0xed670(0x236)]||'');});const _0x439f0f=_0x16f1e9[_0x15271a(0x320)]||0x64,_0x236a8d=_0x767e1d['length']>=_0x439f0f?a51_0x35b3be['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x15271a(0x358)](_0x15271a(0x1f2)+_0x767e1d[_0x15271a(0x252)]+_0x15271a(0x343)+(_0x767e1d[_0x15271a(0x252)]!==0x1?'s':'')+_0x236a8d);if(_0x16f1e9[_0x15271a(0x200)]==='json'||_0x16f1e9[_0x15271a(0x200)]===_0x15271a(0x28c)||_0x16f1e9[_0x15271a(0x200)]===_0x15271a(0x211))await handleSDKOutput(_0x767e1d,_0x16f1e9);else{if(_0x767e1d[_0x15271a(0x252)]===0x0)_0x59457c?console[_0x15271a(0x263)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x59457c):console[_0x15271a(0x263)](_0x15271a(0x2d7));else{const _0x51d8b5=_0x16f1e9[_0x15271a(0x208)],_0x57a310=_0x767e1d[_0x15271a(0x316)](_0x274157=>{const _0x110466=_0x15271a,_0x4152f6=a51_0x35b3be[_0x110466(0x344)]('#'+_0x274157['id']),_0x445d3d=hyperlink(_0x4152f6,getWorkflowUrl(_0x51d8b5,_0x274157['id'])),_0x3b0991=_0x274157['project']?.[_0x110466(0x236)]?a51_0x35b3be[_0x110466(0x344)]('\x20('+_0x274157[_0x110466(0x218)]['name']+')'):'';return _0x110466(0x337)+_0x445d3d+'\x20'+_0x274157[_0x110466(0x236)]+_0x3b0991;});await writeOutput(_0x57a310['join']('\x0a'),_0x16f1e9[_0x15271a(0x264)],_0x15271a(0x226));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]='workflow:sessions';[a51_0x198ccf(0x209)]=a51_0x198ccf(0x29b);async['execute'](_0x5141a7){const _0x1f466b=a51_0x198ccf,{options:_0x57ec7c,args:_0x110c29,tdx:_0x27c154}=_0x5141a7,_0xa2a771=this['parseProjectWorkflowPattern'](_0x110c29,_0x57ec7c);if(!_0xa2a771)return 0x1;const {projectName:_0x2543cb,workflowName:_0x5b6b60}=_0xa2a771;if(_0x57ec7c[_0x1f466b(0x2ce)]){if(_0x2543cb&&_0x5b6b60)console[_0x1f466b(0x358)](_0x1f466b(0x26e)+_0x2543cb+'.'+_0x5b6b60);else _0x2543cb&&console[_0x1f466b(0x358)](_0x1f466b(0x1fb)+_0x2543cb);const _0x4d5e44=_0x57ec7c['status'];_0x4d5e44&&console['error']('Status:\x20'+_0x4d5e44);}let _0x4fc331=0x28;if(process[_0x1f466b(0x2b5)][_0x1f466b(0x338)]&&!_0x57ec7c['output']&&!_0x57ec7c[_0x1f466b(0x200)]){const _0x325520=process[_0x1f466b(0x2b5)][_0x1f466b(0x37b)]||0x28;_0x4fc331=Math[_0x1f466b(0x217)](0x14,Math[_0x1f466b(0x271)](_0x325520*0x2/0x3));}const _0x2789b5=_0x57ec7c[_0x1f466b(0x320)]||_0x4fc331,_0x1133ac=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x27c154[_0x1f466b(0x2d3)][_0x1f466b(0x29f)]({'projectName':_0x2543cb,'workflowName':_0x5b6b60,'status':_0x57ec7c['status'],'fromTime':_0x57ec7c[_0x1f466b(0x2de)],'toTime':_0x57ec7c['to'],'limit':_0x2789b5}),{'verbose':_0x57ec7c['verbose']}),_0x4e8fbf=_0x1133ac[_0x1f466b(0x303)];_0x4e8fbf[_0x1f466b(0x224)]((_0x4bbc3b,_0x25364f)=>{const _0x5e0a6e=_0x1f466b,_0x25ec50=_0x4bbc3b[_0x5e0a6e(0x2eb)]||'',_0x598ba9=_0x25364f[_0x5e0a6e(0x2eb)]||'';return _0x598ba9[_0x5e0a6e(0x259)](_0x25ec50);});_0x4e8fbf[_0x1f466b(0x252)]>=_0x2789b5?console['error'](_0x1f466b(0x334)+_0x4e8fbf[_0x1f466b(0x252)]+_0x1f466b(0x1f9)+a51_0x35b3be[_0x1f466b(0x344)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x1f466b(0x1f2)+_0x4e8fbf[_0x1f466b(0x252)]+'\x20session'+(_0x4e8fbf[_0x1f466b(0x252)]!==0x1?'s':''));if(_0x57ec7c[_0x1f466b(0x200)]===_0x1f466b(0x21b)||_0x57ec7c[_0x1f466b(0x200)]===_0x1f466b(0x28c)||_0x57ec7c['format']===_0x1f466b(0x211))await handleSDKOutput(_0x4e8fbf,_0x57ec7c);else{if(!process['stdout'][_0x1f466b(0x338)]||_0x57ec7c[_0x1f466b(0x264)]){if(_0x4e8fbf[_0x1f466b(0x252)]===0x0){if(_0x2543cb&&_0x5b6b60)console[_0x1f466b(0x263)](_0x1f466b(0x2c5)+_0x2543cb+'.'+_0x5b6b60);else _0x2543cb?console[_0x1f466b(0x263)](_0x1f466b(0x2f8)+_0x2543cb):console[_0x1f466b(0x263)](_0x1f466b(0x361));}else{const _0x34b0f2=_0x57ec7c[_0x1f466b(0x208)],_0x105766=this[_0x1f466b(0x22b)](_0x4e8fbf,_0x34b0f2);_0x57ec7c[_0x1f466b(0x264)]?await writeOutput(_0x105766,_0x57ec7c[_0x1f466b(0x264)],_0x1f466b(0x226)):console[_0x1f466b(0x263)](_0x105766);}!_0x2543cb&&(console['error'](''),console['error'](a51_0x35b3be[_0x1f466b(0x344)](_0x1f466b(0x235))),console[_0x1f466b(0x358)](a51_0x35b3be['dim'](_0x1f466b(0x228))+'or'+a51_0x35b3be[_0x1f466b(0x344)](_0x1f466b(0x250))));}else{if(_0x4e8fbf[_0x1f466b(0x252)]===0x0){if(_0x2543cb&&_0x5b6b60)console[_0x1f466b(0x263)](_0x1f466b(0x2c5)+_0x2543cb+'.'+_0x5b6b60);else _0x2543cb?console[_0x1f466b(0x263)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2543cb):console[_0x1f466b(0x263)](_0x1f466b(0x361));}else await this[_0x1f466b(0x28b)](_0x4e8fbf,_0x5141a7,_0x2543cb);}}return 0x0;}['renderSessionsTimeline'](_0x4a5089,_0x198b8d){const _0x583d89=a51_0x198ccf,_0x34ae17=[],_0x6e5615=new Map();let _0x5c01ed=Infinity,_0x5608c8=-Infinity;for(const _0x535dc1 of _0x4a5089){if(_0x535dc1['lastAttempt']?.[_0x583d89(0x30b)]){const _0x347da5=new Date(_0x535dc1[_0x583d89(0x33c)][_0x583d89(0x30b)])[_0x583d89(0x2c3)](),_0x2e575e=_0x535dc1['lastAttempt'][_0x583d89(0x229)]?new Date(_0x535dc1[_0x583d89(0x33c)][_0x583d89(0x229)])[_0x583d89(0x2c3)]():Date['now'](),_0xca2da9=_0x535dc1[_0x583d89(0x218)]?.['name']||_0x583d89(0x28d);!_0x6e5615[_0x583d89(0x39b)](_0xca2da9)&&_0x6e5615[_0x583d89(0x227)](_0xca2da9,[]),_0x6e5615[_0x583d89(0x291)](_0xca2da9)['push']({'session':_0x535dc1,'startTime':_0x347da5,'endTime':_0x2e575e,'duration':_0x2e575e-_0x347da5}),_0x5c01ed=Math['min'](_0x5c01ed,_0x347da5),_0x5608c8=Math[_0x583d89(0x217)](_0x5608c8,_0x2e575e);}}if(_0x6e5615[_0x583d89(0x308)]===0x0)return _0x583d89(0x207);const _0x69f58d=process['stdout'][_0x583d89(0x32c)]||0x78,_0x36d950=0x1e,_0x16c516=0x32,_0x4e0101=0x4,_0x230a46=Math['min'](_0x16c516,Math[_0x583d89(0x217)](_0x36d950,Math[_0x583d89(0x271)](_0x69f58d*0.3))),_0x2f461c=_0x69f58d-_0x230a46-TIMELINE_CONFIG[_0x583d89(0x357)]-0x3-_0x4e0101,_0x220f75=_0x5608c8-_0x5c01ed,_0x2c9b5e=_0x220f75/_0x230a46,_0x408dbd=renderTimeAxis({'startTime':_0x5c01ed,'endTime':_0x5608c8,'durationMs':_0x220f75,'msPerChar':_0x2c9b5e},_0x230a46),_0x46f009=[];for(const _0x556ae4 of _0x6e5615[_0x583d89(0x242)]()){_0x46f009[_0x583d89(0x307)](..._0x556ae4);}_0x46f009[_0x583d89(0x224)]((_0x1dce73,_0xf5f9bb)=>_0xf5f9bb[_0x583d89(0x2bd)]-_0x1dce73[_0x583d89(0x2bd)]);const _0x3909ab=new Date(_0x5c01ed),_0x2b12d6=formatDate(_0x3909ab),_0x3603b6=_0x4e0101+TIMELINE_CONFIG[_0x583d89(0x251)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2f461c,_0x3e177e='\x20'[_0x583d89(0x24e)](_0x3603b6-_0x2b12d6[_0x583d89(0x252)]),_0x371547=_0x3e177e+a51_0x35b3be[_0x583d89(0x344)](_0x2b12d6)+'\x20'+_0x408dbd;_0x34ae17[_0x583d89(0x307)](_0x371547);const _0x24b7e7=0x16;let _0x1a246f=0x0;for(const _0x465bce of _0x46f009){const _0x2e855e=_0x465bce[_0x583d89(0x359)][_0x583d89(0x218)]?.[_0x583d89(0x236)]||'?',_0x34b6e8=Math[_0x583d89(0x332)](stringWidth(_0x2e855e),_0x24b7e7);_0x1a246f=Math[_0x583d89(0x217)](_0x1a246f,_0x34b6e8);}for(const _0x25d047 of _0x46f009){const {session:_0x263f60,startTime:_0x50543c,endTime:_0x414199,duration:_0x1cd035}=_0x25d047,_0x138c2c=_0x263f60[_0x583d89(0x218)]?.['id'],_0x135c6b=_0x263f60['id'],_0x422cd5=_0x263f60[_0x583d89(0x218)]?.[_0x583d89(0x236)]||'?',_0x2710fd=_0x263f60[_0x583d89(0x2d3)]?.['name']||'?';let _0xada69f,_0x2b7fdc;if(_0x263f60[_0x583d89(0x33c)]){const _0xd0fc4=_0x263f60[_0x583d89(0x33c)];!_0xd0fc4[_0x583d89(0x2a9)]?(_0xada69f=_0xd0fc4[_0x583d89(0x369)]?'🛑':'🔄',_0x2b7fdc=_0xd0fc4[_0x583d89(0x369)]?a51_0x35b3be[_0x583d89(0x35b)]:a51_0x35b3be[_0x583d89(0x216)]):(_0xada69f=_0xd0fc4['success']?'✅':'❌',_0x2b7fdc=_0xd0fc4[_0x583d89(0x245)]?a51_0x35b3be[_0x583d89(0x2a4)]:a51_0x35b3be[_0x583d89(0x294)]);}else _0xada69f='⏳',_0x2b7fdc=a51_0x35b3be[_0x583d89(0x344)];const _0x2ca5a3='#'+_0x135c6b,_0x51cf89=_0x138c2c?hyperlink(_0x2ca5a3,getWorkflowSessionUrl(_0x198b8d,_0x138c2c,_0x135c6b)):_0x2ca5a3;let _0x48ec56=_0x422cd5;stringWidth(_0x422cd5)>_0x24b7e7&&(_0x48ec56=_0x422cd5[_0x583d89(0x371)](0x0,_0x24b7e7-0x1)+'…');const _0x201c64=a51_0x35b3be[_0x583d89(0x344)](_0x48ec56),_0x3dd59d=stringWidth(_0x48ec56),_0xbbe6f4='\x20'[_0x583d89(0x24e)](_0x1a246f-stringWidth(_0x48ec56)+0x2),_0x27de94='('+formatElapsed(_0x1cd035)+')',_0xbca809=stringWidth(_0x27de94),_0x5edcfe=stringWidth(_0x2ca5a3),_0x187f9c=_0x5edcfe+0x1+_0x3dd59d+_0xbbe6f4[_0x583d89(0x252)],_0x4de83c=_0x2f461c-_0x187f9c-_0xbca809-0x1-0x8;let _0x45c5b5=_0x2710fd;stringWidth(_0x45c5b5)>_0x4de83c&&(_0x45c5b5=_0x45c5b5[_0x583d89(0x371)](0x0,_0x4de83c-0x1)+'…');const _0x53f642=_0x51cf89+'\x20'+_0x201c64+_0xbbe6f4+_0x45c5b5,_0x3c6ab5=stringWidth(_0x53f642),_0x5c0fba=_0x2f461c-_0x3c6ab5-_0xbca809,_0x11037d=_0x53f642+'\x20'[_0x583d89(0x24e)](Math[_0x583d89(0x217)](0x1,_0x5c0fba))+a51_0x35b3be['dim'](_0x27de94),_0x3f0c69=Math[_0x583d89(0x271)]((_0x50543c-_0x5c01ed)/_0x2c9b5e),_0x5724ed=Math[_0x583d89(0x271)]((_0x414199-_0x5c01ed)/_0x2c9b5e),_0x1ae35c=Math[_0x583d89(0x217)](_0x3f0c69+0x1,_0x5724ed),_0x2bc482=new Array(_0x230a46)[_0x583d89(0x2d0)]('\x20');for(let _0xcd28f6=_0x3f0c69;_0xcd28f6<Math[_0x583d89(0x332)](_0x1ae35c,_0x230a46);_0xcd28f6++){_0x2bc482[_0xcd28f6]='─';}const _0x36d4bf=_0x2bc482[_0x583d89(0x316)](_0x168015=>_0x168015==='\x20'?'\x20':_0x2b7fdc(_0x168015))[_0x583d89(0x274)]('');_0x34ae17[_0x583d89(0x307)](_0xada69f+'\x20'+_0x11037d+'│'+_0x36d4bf+'│');}return _0x34ae17[_0x583d89(0x274)]('\x0a');}async['navigateSessionsInteractive'](_0x35f257,_0x3b1599,_0x3233e9){const _0x36799b=a51_0x198ccf,{options:_0x1444c4,tdx:_0x67b3da}=_0x3b1599,_0x59b262=_0x1444c4[_0x36799b(0x208)],{timelineRows:_0x24ee24,timeAxisHeader:_0x279a21}=this[_0x36799b(0x254)](_0x35f257,_0x59b262),_0x22a77a=_0x24ee24[_0x36799b(0x346)](_0x2ad5b6=>_0x2ad5b6[_0x36799b(0x270)]);if(_0x22a77a[_0x36799b(0x252)]===0x0){const _0x3501be=this[_0x36799b(0x22b)](_0x35f257,_0x59b262);console['log'](_0x3501be);!_0x3233e9&&(console[_0x36799b(0x358)](''),console[_0x36799b(0x358)](a51_0x35b3be[_0x36799b(0x344)](_0x36799b(0x235))),console[_0x36799b(0x358)](a51_0x35b3be[_0x36799b(0x344)](_0x36799b(0x228))+'or'+a51_0x35b3be[_0x36799b(0x344)](_0x36799b(0x250))));return;}_0x279a21&&console[_0x36799b(0x263)](_0x279a21);const _0x5c36ff=_0x24ee24['filter'](_0x2aedf8=>_0x2aedf8['attemptId'])[_0x36799b(0x316)](_0x5189fd=>({'title':_0x5189fd[_0x36799b(0x23f)],'value':_0x5189fd[_0x36799b(0x270)]})),_0x2f05f4=process[_0x36799b(0x2b5)]['rows']||0x3c,_0x216cf6=Math[_0x36799b(0x217)](0x28,Math[_0x36799b(0x271)](_0x2f05f4*0x2/0x3)),_0x455dd2=await a51_0x4141d8({'type':_0x36799b(0x269),'name':_0x36799b(0x270),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x5c36ff,'initial':-0x1,'limit':_0x216cf6,'clearFirst':!![],'fallback':{'title':_0x36799b(0x2da),'value':null},'suggest':(_0x55ed86,_0x190305)=>{const _0x433869=_0x36799b;if(!_0x55ed86)return Promise[_0x433869(0x1f5)](_0x190305);const _0x1285da=_0x190305['filter'](_0x3ff42e=>{const _0x22be4a=_0x433869,_0x448e51=_0x3ff42e;return _0x448e51['title'][_0x22be4a(0x2d2)]()['includes'](_0x55ed86[_0x22be4a(0x2d2)]());});return Promise['resolve'](_0x1285da);}}),_0x3a0045=()=>{const _0x13ce47=_0x36799b;process[_0x13ce47(0x2b5)][_0x13ce47(0x35f)](_0x13ce47(0x2ee)),process[_0x13ce47(0x2b5)][_0x13ce47(0x35f)](_0x13ce47(0x2ee)),process[_0x13ce47(0x2b5)][_0x13ce47(0x35f)]('\x1b[1A\x1b[2K');},_0x192c41=_0x455dd2&&_0x455dd2[_0x36799b(0x270)]&&_0x455dd2['attemptId']!==null&&_0x455dd2[_0x36799b(0x270)][_0x36799b(0x2c1)]()!=='';if(!_0x192c41){_0x3a0045(),console[_0x36799b(0x263)](a51_0x35b3be['dim'](_0x36799b(0x2cb)));return;}_0x3a0045();const _0x26a60e=_0x35f257[_0x36799b(0x204)](_0x3651da=>_0x3651da['lastAttempt']?.['id']===_0x455dd2[_0x36799b(0x270)]);if(_0x26a60e){const _0x23bb28=_0x26a60e[_0x36799b(0x218)]?.['name']||'?',_0x14bdb9=_0x26a60e[_0x36799b(0x2d3)]?.['name']||'?';console[_0x36799b(0x263)](_0x36799b(0x1fa)+a51_0x35b3be[_0x36799b(0x344)](_0x23bb28)+',\x20Workflow:\x20'+a51_0x35b3be[_0x36799b(0x344)](_0x14bdb9));}const _0x3af145=new WorkflowTimelineCommand();await _0x3af145[_0x36799b(0x1ff)]({'args':[],'options':{..._0x1444c4,'attemptId':_0x455dd2['attemptId']},'tdx':_0x67b3da});}[a51_0x198ccf(0x254)](_0x4b59ca,_0x5476a8){const _0x529982=a51_0x198ccf,_0x8e2c7e=new Map();for(const _0x16dc3b of _0x4b59ca){_0x16dc3b['id']&&_0x16dc3b['lastAttempt']?.['id']&&_0x8e2c7e['set'](_0x16dc3b['id'],_0x16dc3b[_0x529982(0x33c)]['id']);}const _0x5f37f4=[];let _0x9fb3b5='';const _0x39c221=this[_0x529982(0x22b)](_0x4b59ca,_0x5476a8),_0x2da0b2=_0x39c221['split']('\x0a');for(const _0x116bf3 of _0x2da0b2){if(_0x116bf3[_0x529982(0x331)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x116bf3[_0x529982(0x21e)](/^\s+\d{4}-\d{2}-\d{2}/))_0x9fb3b5=_0x116bf3;else{if(_0x116bf3[_0x529982(0x21e)](/^[✅❌🔄🛑⏳]/)){const _0x328efd=_0x116bf3[_0x529982(0x21e)](/#(\d+)/),_0x4c76ae=_0x328efd?_0x328efd[0x1]:null,_0x116b24=_0x4c76ae?_0x8e2c7e[_0x529982(0x291)](_0x4c76ae)||null:null,_0x4e1b50=_0x4b59ca['find'](_0x1318ac=>_0x1318ac['id']===_0x4c76ae),_0x3008b9=_0x4e1b50?.[_0x529982(0x218)]?.[_0x529982(0x236)]||'';_0x5f37f4[_0x529982(0x307)]({'displayLine':_0x116bf3,'attemptId':_0x116b24,'projectName':_0x3008b9});}}}return{'timelineRows':_0x5f37f4,'timeAxisHeader':_0x9fb3b5};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]='workflow:attempts';['description']=a51_0x198ccf(0x22d);async[a51_0x198ccf(0x1ff)](_0x339fb9){const _0x24a8a2=a51_0x198ccf,{options:_0x46fecd,args:_0x2da694,tdx:_0x3ff8dc}=_0x339fb9,_0x5cf276=this[_0x24a8a2(0x2af)](_0x2da694,_0x46fecd);if(!_0x5cf276)return 0x1;const {projectName:_0x52d464,workflowName:_0x2335de}=_0x5cf276,_0x1a85db=_0x46fecd[_0x24a8a2(0x212)];if(_0x46fecd['verbose']){if(_0x52d464&&_0x2335de)console['error'](_0x24a8a2(0x26e)+_0x52d464+'.'+_0x2335de);else _0x52d464&&console[_0x24a8a2(0x358)]('Filter:\x20project='+_0x52d464);_0x1a85db&&console[_0x24a8a2(0x358)](_0x24a8a2(0x2a2));}const _0x4d3d9d=await withSpinner(_0x24a8a2(0x2f4),()=>_0x3ff8dc['workflow'][_0x24a8a2(0x329)]({'projectName':_0x52d464,'workflowName':_0x2335de,'includeRetried':_0x1a85db,'limit':_0x46fecd[_0x24a8a2(0x320)]}),{'verbose':_0x46fecd[_0x24a8a2(0x2ce)]}),_0x77345f=_0x4d3d9d[_0x24a8a2(0x303)],_0x334b24=_0x46fecd[_0x24a8a2(0x320)]||0x64,_0x327081=_0x77345f[_0x24a8a2(0x252)]>=_0x334b24?a51_0x35b3be[_0x24a8a2(0x344)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x24a8a2(0x1f2)+_0x77345f['length']+_0x24a8a2(0x335)+(_0x77345f['length']!==0x1?'s':'')+_0x327081);if(_0x46fecd[_0x24a8a2(0x200)]==='json'||_0x46fecd[_0x24a8a2(0x200)]===_0x24a8a2(0x28c)||_0x46fecd[_0x24a8a2(0x200)]===_0x24a8a2(0x211))await handleSDKOutput(_0x77345f,_0x46fecd);else{if(_0x77345f[_0x24a8a2(0x252)]===0x0){if(_0x52d464&&_0x2335de)console[_0x24a8a2(0x263)]('No\x20attempts\x20found\x20for:\x20'+_0x52d464+'.'+_0x2335de);else _0x52d464?console[_0x24a8a2(0x263)](_0x24a8a2(0x38a)+_0x52d464):console['log'](_0x24a8a2(0x233));}else{const _0x5b8313=_0x46fecd['site'],_0x36bdcd=_0x77345f['map'](_0x513755=>{const _0x10a13a=_0x24a8a2,_0x58535d=a51_0x35b3be[_0x10a13a(0x344)]('#'+_0x513755['id']),_0x5e18c8=_0x513755[_0x10a13a(0x218)]?.['id'],_0x5d310f=_0x513755[_0x10a13a(0x2a3)]||_0x513755[_0x10a13a(0x20e)],_0x44600d=_0x5e18c8&&_0x5d310f?hyperlink(_0x58535d,getWorkflowAttemptUrl(_0x5b8313,_0x5e18c8,_0x5d310f,_0x513755['id'])):_0x58535d,{icon:_0x1063e2,text:_0x4597a3}=getAttemptStatusDisplay(_0x513755),_0x52195f=(_0x513755['project']?.[_0x10a13a(0x236)]||'?')+'.'+(_0x513755[_0x10a13a(0x2d3)]?.['name']||'?'),_0x40e62c=_0x513755[_0x10a13a(0x2eb)]?a51_0x35b3be['dim'](_0x513755['sessionTime']):'';return(_0x44600d+'\x20'+_0x1063e2+(_0x4597a3?'\x20'+_0x4597a3:'')+'\x20'+_0x52195f+'\x20'+_0x40e62c)[_0x10a13a(0x1f0)]();});await writeOutput(_0x36bdcd[_0x24a8a2(0x274)]('\x0a'),_0x46fecd[_0x24a8a2(0x264)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x364);['description']=a51_0x198ccf(0x26a);async[a51_0x198ccf(0x1ff)](_0x471987){const _0x18b0d9=a51_0x198ccf,{options:_0x425d44,args:_0x2ad56d,tdx:_0x1b627e}=_0x471987,_0x1f8652=_0x2ad56d[0x0];if(!_0x1f8652)return console[_0x18b0d9(0x358)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x425d44['verbose']&&console[_0x18b0d9(0x358)](_0x18b0d9(0x351)+_0x1f8652);const _0x4d99cd=await withSpinner(_0x18b0d9(0x31c),()=>_0x1b627e['workflow']['attempt'](_0x1f8652),{'verbose':_0x425d44[_0x18b0d9(0x2ce)]}),_0x6a9db4=_0x4d99cd[_0x18b0d9(0x303)];let _0x301e27;!_0x6a9db4[_0x18b0d9(0x2a9)]?_0x301e27=_0x6a9db4[_0x18b0d9(0x369)]?'canceling':'running':_0x301e27=_0x6a9db4[_0x18b0d9(0x245)]?'success':_0x18b0d9(0x358);let _0x41acf9;if(_0x6a9db4[_0x18b0d9(0x30b)]&&_0x6a9db4['finishedAt']){const _0x12bfc9=new Date(_0x6a9db4[_0x18b0d9(0x30b)])['getTime'](),_0x4ecbcc=new Date(_0x6a9db4['finishedAt'])[_0x18b0d9(0x2c3)]();_0x41acf9=Math['round']((_0x4ecbcc-_0x12bfc9)/0x3e8);}const _0x2f3fe0={'attempt_id':_0x6a9db4['id'],'status':_0x301e27,..._0x6a9db4[_0x18b0d9(0x315)]!==undefined&&{'index':_0x6a9db4['index']},..._0x6a9db4[_0x18b0d9(0x218)]&&{'project':_0x6a9db4[_0x18b0d9(0x218)][_0x18b0d9(0x236)]},..._0x6a9db4['workflow']&&{'workflow':_0x6a9db4['workflow'][_0x18b0d9(0x236)]},..._0x6a9db4[_0x18b0d9(0x20e)]&&{'session_id':_0x6a9db4[_0x18b0d9(0x20e)]},..._0x6a9db4[_0x18b0d9(0x2eb)]&&{'session_time':_0x6a9db4[_0x18b0d9(0x2eb)]},..._0x6a9db4[_0x18b0d9(0x31d)]&&{'retry_attempt':_0x6a9db4[_0x18b0d9(0x31d)]},..._0x41acf9!==undefined&&{'duration_sec':_0x41acf9},..._0x6a9db4['createdAt']&&{'created_at':_0x6a9db4[_0x18b0d9(0x30b)]},..._0x6a9db4['finishedAt']&&{'finished_at':_0x6a9db4[_0x18b0d9(0x229)]},...Object['keys'](_0x6a9db4[_0x18b0d9(0x2a7)])[_0x18b0d9(0x252)]>0x0&&{'params':_0x6a9db4[_0x18b0d9(0x2a7)]}};return await handleSingleObjectOutput(_0x2f3fe0,_0x425d44),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x23b);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x387);async[a51_0x198ccf(0x1ff)](_0x4ca3ca){const _0xe4be8b=a51_0x198ccf,{options:_0x29aabf,args:_0xd6c6f9,tdx:_0x2fd041}=_0x4ca3ca,_0x50f066=_0xd6c6f9[0x0];if(!_0x50f066)return console['error'](_0xe4be8b(0x205)),0x1;const _0x1780e1=_0x29aabf[_0xe4be8b(0x324)];_0x29aabf[_0xe4be8b(0x2ce)]&&(console['error'](_0xe4be8b(0x351)+_0x50f066),_0x1780e1&&console[_0xe4be8b(0x358)](_0xe4be8b(0x339)));const _0x2ee9a3=await withSpinner(_0xe4be8b(0x25a),()=>_0x2fd041['workflow'][_0xe4be8b(0x27c)](_0x50f066,_0x1780e1||![]),{'verbose':_0x29aabf[_0xe4be8b(0x2ce)]}),_0xb5387b=_0x2ee9a3['data'];return console[_0xe4be8b(0x358)](_0xe4be8b(0x1f2)+_0xb5387b['length']+'\x20task'+(_0xb5387b[_0xe4be8b(0x252)]!==0x1?'s':'')),await handleSDKOutput(_0xb5387b,_0x29aabf),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a51_0x198ccf(0x209)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a51_0x198ccf(0x1ff)](_0x513f0e){const _0x2062b0=a51_0x198ccf,{options:_0x26dedd,args:_0x57edd1,tdx:_0x3a8972}=_0x513f0e,_0xc6318a=_0x57edd1[0x0];let _0x389917=_0x57edd1[0x1];if(!_0xc6318a)return console[_0x2062b0(0x358)](_0x2062b0(0x205)),0x1;_0x26dedd[_0x2062b0(0x2ce)]&&(console[_0x2062b0(0x358)](_0x2062b0(0x351)+_0xc6318a),_0x389917&&console[_0x2062b0(0x358)](_0x2062b0(0x20b)+_0x389917));const _0x2591ec=await withSpinner(_0x2062b0(0x2b3),()=>_0x3a8972[_0x2062b0(0x2d3)][_0x2062b0(0x30f)](_0xc6318a,_0x389917),{'verbose':_0x26dedd[_0x2062b0(0x2ce)]}),_0x15e491=_0x2591ec['data'];if(_0x15e491[_0x2062b0(0x252)]===0x0)return console[_0x2062b0(0x358)](_0x2062b0(0x38b)),0x0;if(!_0x389917&&(_0x26dedd[_0x2062b0(0x21b)]||_0x26dedd[_0x2062b0(0x200)]))return await handleSDKOutput(_0x15e491,_0x26dedd),0x0;if(!_0x389917){const _0x336f8d=_0x15e491[_0x2062b0(0x316)](_0xe3d3ea=>({'title':_0xe3d3ea[_0x2062b0(0x342)]+'\x20('+formatBytes(_0xe3d3ea['fileSize'])+')','value':_0xe3d3ea[_0x2062b0(0x342)]})),_0x505414=await a51_0x4141d8({'type':'select','name':'task','message':_0x2062b0(0x25c),'choices':_0x336f8d});if(!_0x505414['task'])return console['error']('Cancelled'),0x0;_0x389917=_0x505414[_0x2062b0(0x392)];}const _0x125c6f=await withSpinner(_0x2062b0(0x2ab),()=>_0x3a8972[_0x2062b0(0x2d3)][_0x2062b0(0x253)](_0xc6318a,_0x389917),{'verbose':_0x26dedd[_0x2062b0(0x2ce)]}),_0x4653a2=_0x125c6f[_0x2062b0(0x303)];return _0x4653a2?console[_0x2062b0(0x263)](_0x4653a2):console[_0x2062b0(0x358)](_0x2062b0(0x2c4)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a51_0x198ccf(0x21a);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x36c);async[a51_0x198ccf(0x1ff)](_0x4a50c6){const _0x1c77a9=a51_0x198ccf,{options:_0x3077f7,args:_0xdf394f,tdx:_0xfa99a1}=_0x4a50c6,_0x134b02=_0xdf394f[0x0];if(!_0x134b02)return console[_0x1c77a9(0x358)](_0x1c77a9(0x205)),0x1;const _0x494772=_0x3077f7['reason'];_0x3077f7[_0x1c77a9(0x2ce)]&&(console[_0x1c77a9(0x358)](_0x1c77a9(0x351)+_0x134b02),_0x494772&&console[_0x1c77a9(0x358)](_0x1c77a9(0x1f1)+_0x494772));if(!_0x3077f7[_0x1c77a9(0x2fc)]){if(!isInteractive())return console[_0x1c77a9(0x358)](a51_0x35b3be[_0x1c77a9(0x294)](_0x1c77a9(0x33b)),_0x1c77a9(0x37c)),console[_0x1c77a9(0x358)](a51_0x35b3be[_0x1c77a9(0x344)](_0x1c77a9(0x2f7))),0x1;const _0x5dc0eb=await confirmKey(_0x1c77a9(0x2ef)+_0x134b02+'?');if(!_0x5dc0eb)return console[_0x1c77a9(0x358)](a51_0x35b3be['yellow'](_0x1c77a9(0x2cb))),0x1;}const _0x22bb91=await withSpinner(_0x1c77a9(0x374),()=>_0xfa99a1['workflow'][_0x1c77a9(0x201)](_0x134b02,_0x494772),{'verbose':_0x3077f7['verbose']}),_0x215361=_0x22bb91[_0x1c77a9(0x303)];return console[_0x1c77a9(0x358)]('✔\x20'+_0x215361),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';[a51_0x198ccf(0x209)]='Retry\x20a\x20session\x20or\x20attempt';async[a51_0x198ccf(0x1ff)](_0x26557d){const _0xcff0aa=a51_0x198ccf,{options:_0x4921f6,args:_0x3cd81f,tdx:_0x2fb572}=_0x26557d,_0x3b5657=_0x3cd81f[0x0];if(!_0x3b5657)return console[_0xcff0aa(0x358)](_0xcff0aa(0x30e)),console[_0xcff0aa(0x358)](_0xcff0aa(0x2f3)),0x1;let _0x175e68=![],_0x181658=_0x3b5657;if(_0x3b5657['startsWith'](_0xcff0aa(0x2e5)))_0x175e68=!![],_0x181658=_0x3b5657[_0xcff0aa(0x2e9)](0x8);else{if(_0x3b5657[_0xcff0aa(0x331)](_0xcff0aa(0x287)))_0x175e68=![],_0x181658=_0x3b5657[_0xcff0aa(0x2e9)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0xcff0aa(0x358)](_0xcff0aa(0x2f3)),0x1;}const _0x5892db=_0x4921f6[_0xcff0aa(0x32a)],_0x597756=_0x4921f6[_0xcff0aa(0x36e)],_0x3d491c=_0x4921f6[_0xcff0aa(0x2a7)],_0x58d5b0=_0x4921f6[_0xcff0aa(0x32b)];_0x4921f6[_0xcff0aa(0x2ce)]&&(console[_0xcff0aa(0x358)]('Target:\x20'+(_0x175e68?'session':'attempt')+'\x20'+_0x181658),_0x5892db&&console[_0xcff0aa(0x358)](_0xcff0aa(0x319)+_0x5892db),_0x597756&&console[_0xcff0aa(0x358)]('Resume\x20from:\x20'+_0x597756),_0x3d491c&&console[_0xcff0aa(0x358)](_0xcff0aa(0x350)+_0x3d491c),_0x58d5b0&&console['error'](_0xcff0aa(0x24a)));let _0x57a3b5;if(_0x3d491c)try{if(_0x3d491c[_0xcff0aa(0x331)]('@')){const _0x22a8db=await import(_0xcff0aa(0x220)),_0xcf9b6d=_0x3d491c['substring'](0x1),_0x48c84e=await _0x22a8db[_0xcff0aa(0x34f)](_0xcf9b6d,_0xcff0aa(0x2bf));_0x57a3b5=JSON[_0xcff0aa(0x248)](_0x48c84e);}else _0x57a3b5=JSON[_0xcff0aa(0x248)](_0x3d491c);}catch{return console['error'](_0xcff0aa(0x306)),0x1;}if(!_0x4921f6['yes']){if(!isInteractive())return console['error'](a51_0x35b3be[_0xcff0aa(0x294)](_0xcff0aa(0x33b)),_0xcff0aa(0x37c)),console[_0xcff0aa(0x358)](a51_0x35b3be['dim'](_0xcff0aa(0x2f7))),0x1;const _0x31d35b=await confirmKey(_0xcff0aa(0x293)+(_0x175e68?_0xcff0aa(0x359):_0xcff0aa(0x298))+'\x20'+_0x181658+'?');if(!_0x31d35b)return console[_0xcff0aa(0x358)](a51_0x35b3be['yellow'](_0xcff0aa(0x2cb))),0x1;}let _0x511169;_0x175e68?_0x511169=await withSpinner(_0xcff0aa(0x249),()=>_0x2fb572[_0xcff0aa(0x2d3)][_0xcff0aa(0x223)](_0x181658,{'fromTask':_0x5892db,'retryParams':_0x57a3b5}),{'verbose':_0x4921f6['verbose']}):_0x511169=await withSpinner(_0xcff0aa(0x378),()=>_0x2fb572['workflow']['retryAttempt'](_0x181658,{'resumeFrom':_0x597756,'retryParams':_0x57a3b5,'force':_0x58d5b0}),{'verbose':_0x4921f6[_0xcff0aa(0x2ce)]});const _0x2b8f01=_0x511169[_0xcff0aa(0x303)];return console[_0xcff0aa(0x358)](_0xcff0aa(0x391)),console[_0xcff0aa(0x358)](_0xcff0aa(0x383)+_0x2b8f01[_0xcff0aa(0x270)]),console[_0xcff0aa(0x358)]('\x20\x20Session\x20ID:\x20'+_0x2b8f01[_0xcff0aa(0x20e)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x341);[a51_0x198ccf(0x209)]='Start\x20a\x20workflow\x20run';async[a51_0x198ccf(0x1ff)](_0x195378){const _0x21847d=a51_0x198ccf,{options:_0x5ce269,args:_0x22fdf4,tdx:_0x28274c}=_0x195378;let _0x2d6bb1=_0x22fdf4[0x0];if(!_0x2d6bb1){const _0x123bdf=this[_0x21847d(0x2fe)]([],_0x5ce269),_0x4a6862=await withSpinner('Loading\x20workflows...',()=>_0x28274c[_0x21847d(0x2d3)]['workflows'](_0x123bdf,{'limit':_0x5ce269[_0x21847d(0x320)]}),{'verbose':_0x5ce269[_0x21847d(0x2ce)]}),_0x37fdbf=_0x4a6862[_0x21847d(0x303)];if(_0x37fdbf[_0x21847d(0x252)]===0x0)return console[_0x21847d(0x358)]('No\x20workflows\x20found'),!_0x123bdf&&console[_0x21847d(0x358)](a51_0x35b3be[_0x21847d(0x344)](_0x21847d(0x33f))),0x1;const _0x104156=_0x37fdbf[_0x21847d(0x316)](_0x368811=>({'title':_0x368811['project']?.[_0x21847d(0x236)]+'.'+_0x368811['name'],'value':_0x368811[_0x21847d(0x218)]?.[_0x21847d(0x236)]+'.'+_0x368811['name'],'description':_0x368811[_0x21847d(0x230)]?_0x21847d(0x2a1)+_0x368811['revision']:undefined})),_0x456bb0=await a51_0x4141d8({'type':_0x21847d(0x1ef),'name':'workflow','message':_0x21847d(0x22f),'choices':_0x104156});if(!_0x456bb0['workflow'])return 0x1;_0x2d6bb1=_0x456bb0[_0x21847d(0x2d3)];}if(!_0x2d6bb1[_0x21847d(0x30a)]('.')){const _0x2b6c15=this['resolveProject']([],_0x5ce269);if(_0x2b6c15)_0x2d6bb1=_0x2b6c15+'.'+_0x2d6bb1;else return console[_0x21847d(0x358)](a51_0x35b3be[_0x21847d(0x294)]('Error:'),_0x21847d(0x28a)),console['error'](a51_0x35b3be['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x4f8c25=_0x5ce269[_0x21847d(0x215)],_0x4b78da=_0x5ce269[_0x21847d(0x2eb)],_0x3f65fe={};if(_0x4f8c25&&Array[_0x21847d(0x2cc)](_0x4f8c25))for(const _0x4bff94 of _0x4f8c25){const _0x5685ef=_0x4bff94['indexOf']('=');if(_0x5685ef===-0x1)return console[_0x21847d(0x358)](_0x21847d(0x348)+_0x4bff94),console[_0x21847d(0x358)](_0x21847d(0x234)),0x1;const _0x3f85fc=_0x4bff94[_0x21847d(0x2e9)](0x0,_0x5685ef),_0x32c2f2=_0x4bff94['substring'](_0x5685ef+0x1);try{_0x3f65fe[_0x3f85fc]=JSON[_0x21847d(0x248)](_0x32c2f2);}catch{_0x3f65fe[_0x3f85fc]=_0x32c2f2;}}_0x5ce269[_0x21847d(0x2ce)]&&(console['error'](_0x21847d(0x2ed)+_0x2d6bb1),Object[_0x21847d(0x295)](_0x3f65fe)[_0x21847d(0x252)]>0x0&&console['error'](_0x21847d(0x355)+JSON[_0x21847d(0x2a5)](_0x3f65fe)),_0x4b78da&&console[_0x21847d(0x358)]('Session\x20time:\x20'+_0x4b78da));const _0x344174=await withSpinner(_0x21847d(0x1f7),()=>_0x28274c[_0x21847d(0x2d3)][_0x21847d(0x2dd)](_0x2d6bb1,_0x3f65fe,{'sessionTime':_0x4b78da}),{'verbose':_0x5ce269[_0x21847d(0x2ce)]}),_0x3aff0e=_0x344174[_0x21847d(0x303)];console[_0x21847d(0x358)](_0x21847d(0x22e)),console[_0x21847d(0x358)](_0x21847d(0x381)+_0x3aff0e['id']),console[_0x21847d(0x358)](_0x21847d(0x397)+_0x3aff0e[_0x21847d(0x20e)]),console[_0x21847d(0x358)](_0x21847d(0x29c)+_0x3aff0e['project']?.[_0x21847d(0x236)]),console[_0x21847d(0x358)](_0x21847d(0x24c)+_0x3aff0e['workflow']?.[_0x21847d(0x236)]);if(_0x3aff0e['project']?.['id']&&_0x3aff0e[_0x21847d(0x20e)]&&_0x3aff0e['id']){const _0x866bb6=_0x5ce269[_0x21847d(0x208)],_0x524122=getConsoleUrl(_0x866bb6,'/app/workflows/'+_0x3aff0e[_0x21847d(0x218)]['id']+'/sessions/'+_0x3aff0e[_0x21847d(0x20e)]+_0x21847d(0x24b)+_0x3aff0e['id']);console[_0x21847d(0x358)](_0x21847d(0x2d4)+a51_0x35b3be[_0x21847d(0x37e)](_0x524122));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a51_0x198ccf(0x2e2);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x32d);async[a51_0x198ccf(0x1ff)](_0x5c2fe8){const _0x49a27d=a51_0x198ccf,{options:_0x53f61b,args:_0x1d7a76,tdx:_0x17bd22}=_0x5c2fe8,_0x33edb8=_0x1d7a76[0x0],_0xc21fcd=_0x1d7a76[0x1]||'.';if(!_0x33edb8)return console['error'](_0x49a27d(0x2d8)),console[_0x49a27d(0x358)](_0x49a27d(0x2a6)),0x1;const _0x490c37=_0x53f61b['revision'];_0x53f61b[_0x49a27d(0x2ce)]&&(console[_0x49a27d(0x358)](_0x49a27d(0x1fa)+_0x33edb8),console[_0x49a27d(0x358)](_0x49a27d(0x1ed)+_0xc21fcd),_0x490c37&&console['error']('Revision:\x20'+_0x490c37));const _0x5cc556=await withSpinner(_0x49a27d(0x24f)+_0x33edb8+'...',()=>_0x17bd22['workflow']['download'](_0x33edb8,_0xc21fcd,{'revision':_0x490c37}),{'verbose':_0x53f61b[_0x49a27d(0x2ce)]}),_0x1be2ad=_0x5cc556[_0x49a27d(0x303)];return console[_0x49a27d(0x358)]('✔\x20Downloaded\x20'+_0x1be2ad['projectName']),console[_0x49a27d(0x358)](_0x49a27d(0x280)+_0x1be2ad[_0x49a27d(0x230)]),console[_0x49a27d(0x358)](_0x49a27d(0x243)+_0x1be2ad[_0x49a27d(0x23e)]),console['error'](_0x49a27d(0x2ba)+_0xc21fcd+'/'+_0x1be2ad['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a51_0x198ccf(0x2fb);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x26c);async[a51_0x198ccf(0x1ff)](_0x266053){const _0x25aa16=a51_0x198ccf,{options:_0x5ce8fd,args:_0x524e91,tdx:_0x26116a}=_0x266053;let _0x47ef6e='.',_0x553bdf=_0x5ce8fd['name'];if(_0x524e91[0x0]){const {promises:_0x518500}=await import('fs');try{const _0x2132bb=await _0x518500[_0x25aa16(0x354)](_0x524e91[0x0]);if(_0x2132bb[_0x25aa16(0x214)]())_0x47ef6e=_0x524e91[0x0];else return console[_0x25aa16(0x358)](_0x25aa16(0x386)+_0x524e91[0x0]+_0x25aa16(0x25b)),0x1;}catch{_0x553bdf=_0x524e91[0x0],_0x47ef6e='.';}}const _0x1918e4=_0x5ce8fd[_0x25aa16(0x230)],_0x399aa8=_0x5ce8fd[_0x25aa16(0x394)];_0x5ce8fd[_0x25aa16(0x2ce)]&&(console[_0x25aa16(0x358)](_0x25aa16(0x33a)+_0x47ef6e),_0x553bdf&&console[_0x25aa16(0x358)](_0x25aa16(0x304)+_0x553bdf),_0x1918e4&&console[_0x25aa16(0x358)](_0x25aa16(0x283)+_0x1918e4),_0x399aa8&&console[_0x25aa16(0x358)](_0x25aa16(0x292)));const _0x238f44=await withSpinner(_0x25aa16(0x2fa),()=>_0x26116a[_0x25aa16(0x2d3)][_0x25aa16(0x307)](_0x47ef6e,{'projectName':_0x553bdf,'revision':_0x1918e4,'skipValidation':_0x399aa8}),{'verbose':_0x5ce8fd[_0x25aa16(0x2ce)]}),_0x1accf7=_0x238f44[_0x25aa16(0x303)];return console[_0x25aa16(0x358)](_0x25aa16(0x2bc)+_0x1accf7['projectName']),console[_0x25aa16(0x358)]('\x20\x20Project\x20ID:\x20'+_0x1accf7[_0x25aa16(0x246)]),console[_0x25aa16(0x358)](_0x25aa16(0x280)+_0x1accf7[_0x25aa16(0x230)]),await this[_0x25aa16(0x27d)](_0x26116a,_0x1accf7[_0x25aa16(0x2ae)],_0x5ce8fd['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x20a);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x35d);async['execute'](_0x530a46){const _0x307a4e=a51_0x198ccf,{options:_0x2eb833,args:_0x950a93,tdx:_0x16646d}=_0x530a46,_0x42c320=_0x950a93[0x0],_0x159c84=_0x950a93[0x1];if(!_0x42c320)return console[_0x307a4e(0x358)](a51_0x35b3be['red'](_0x307a4e(0x28e)),'Project\x20name\x20is\x20required'),console['error'](a51_0x35b3be['dim'](_0x307a4e(0x309))),0x1;const _0x1cb096=_0x2eb833[_0x307a4e(0x230)];_0x2eb833['verbose']&&(console[_0x307a4e(0x358)]('Project:\x20'+_0x42c320),_0x159c84&&console[_0x307a4e(0x358)](_0x307a4e(0x305)+_0x159c84),_0x1cb096&&console[_0x307a4e(0x358)](_0x307a4e(0x283)+_0x1cb096),_0x2eb833[_0x307a4e(0x34c)]&&console[_0x307a4e(0x358)]('Dry\x20run:\x20yes'));const _0x4dbdf6=await withSpinner(_0x307a4e(0x37d)+_0x42c320+_0x307a4e(0x239),()=>_0x16646d['workflow'][_0x307a4e(0x385)](_0x42c320,{'targetDir':_0x159c84,'revision':_0x1cb096}),{'verbose':_0x2eb833[_0x307a4e(0x2ce)]}),_0x95738e=_0x4dbdf6[_0x307a4e(0x303)];_0x95738e[_0x307a4e(0x232)]?console[_0x307a4e(0x358)]('→\x20New\x20project:\x20'+_0x95738e[_0x307a4e(0x2ae)]):console[_0x307a4e(0x358)](_0x307a4e(0x1f4)+_0x95738e['projectName']);console['error']('\x20\x20Revision:\x20'+_0x95738e['revision']),console[_0x307a4e(0x358)](_0x307a4e(0x1fe)+(a51_0x3ec8c4[_0x307a4e(0x2ff)](process[_0x307a4e(0x302)](),_0x95738e['targetDir'])||'.')),console['error'](_0x307a4e(0x268)+a51_0x35b3be[_0x307a4e(0x2a4)]('+'+_0x95738e[_0x307a4e(0x2f2)][_0x307a4e(0x281)]+_0x307a4e(0x2d6))+',\x20'+(a51_0x35b3be[_0x307a4e(0x35b)]('~'+_0x95738e[_0x307a4e(0x2f2)][_0x307a4e(0x398)]+_0x307a4e(0x22a))+',\x20')+(a51_0x35b3be['red']('-'+_0x95738e[_0x307a4e(0x2f2)][_0x307a4e(0x203)]+_0x307a4e(0x353))+',\x20')+(''+a51_0x35b3be[_0x307a4e(0x344)](_0x95738e[_0x307a4e(0x2f2)][_0x307a4e(0x373)]+_0x307a4e(0x210))));for(const _0x1611f6 of _0x95738e[_0x307a4e(0x275)]){_0x1611f6[_0x307a4e(0x349)]===_0x307a4e(0x398)&&_0x1611f6[_0x307a4e(0x35c)]&&(console[_0x307a4e(0x358)]('\x0a'+a51_0x35b3be['cyan'](_0x307a4e(0x2b6)+_0x1611f6[_0x307a4e(0x321)])),console[_0x307a4e(0x358)](_0x1611f6[_0x307a4e(0x35c)]));}if(!_0x95738e[_0x307a4e(0x366)])return saveSessionContext({'workflow_project':_0x95738e['projectName']},_0x2eb833['session']),console[_0x307a4e(0x358)](a51_0x35b3be['green']('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a51_0x35b3be['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x95738e['projectName'])),0x0;if(_0x2eb833['dryRun'])return console[_0x307a4e(0x358)](a51_0x35b3be['yellow'](_0x307a4e(0x2ea))),0x0;if(!_0x2eb833[_0x307a4e(0x2fc)]){if(!isInteractive())return console[_0x307a4e(0x358)](a51_0x35b3be[_0x307a4e(0x294)](_0x307a4e(0x33b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x307a4e(0x358)](a51_0x35b3be['dim'](_0x307a4e(0x2f7))),0x1;const _0xac680c=await confirmKey(_0x307a4e(0x310));if(!_0xac680c)return console[_0x307a4e(0x358)](a51_0x35b3be[_0x307a4e(0x35b)]('Cancelled'),_0x307a4e(0x370)),0x1;}await withSpinner('Writing\x20files...',()=>_0x16646d[_0x307a4e(0x2d3)][_0x307a4e(0x25f)](_0x95738e,{'revision':_0x1cb096}),{'verbose':_0x2eb833['verbose']}),saveSessionContext({'workflow_project':_0x95738e[_0x307a4e(0x2ae)]},_0x2eb833[_0x307a4e(0x359)]),console[_0x307a4e(0x358)](a51_0x35b3be[_0x307a4e(0x2a4)](_0x307a4e(0x379)));const _0x56c86f=a51_0x3ec8c4[_0x307a4e(0x2ff)](process[_0x307a4e(0x302)](),_0x95738e[_0x307a4e(0x395)])||'.';return console['error'](a51_0x35b3be[_0x307a4e(0x344)](_0x307a4e(0x2ba)+_0x56c86f)),console['error'](a51_0x35b3be[_0x307a4e(0x344)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x95738e[_0x307a4e(0x2ae)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x2cd);['description']=a51_0x198ccf(0x2f6);async[a51_0x198ccf(0x1ff)](_0x296e56){const _0x2f0550=a51_0x198ccf,{options:_0x194a04,args:_0x1246f6,tdx:_0x341cba}=_0x296e56,_0x33bfd3=this['resolveProjectDir'](_0x1246f6,_0x194a04),_0x129266=_0x194a04[_0x2f0550(0x230)],_0x1e1015=_0x194a04[_0x2f0550(0x394)];_0x194a04[_0x2f0550(0x2ce)]&&(_0x33bfd3&&console[_0x2f0550(0x358)](_0x2f0550(0x2c2)+_0x33bfd3),_0x129266&&console[_0x2f0550(0x358)](_0x2f0550(0x283)+_0x129266),_0x194a04[_0x2f0550(0x34c)]&&console[_0x2f0550(0x358)](_0x2f0550(0x1f8)),_0x1e1015&&console[_0x2f0550(0x358)]('Validation:\x20skipped'));let _0x27c49b;try{_0x27c49b=await withSpinner(_0x2f0550(0x367),()=>_0x341cba[_0x2f0550(0x2d3)]['preparePushProject']({'sourceDir':_0x33bfd3,'revision':_0x129266,'skipValidation':_0x1e1015}),{'verbose':_0x194a04[_0x2f0550(0x2ce)]});}catch(_0x27f6e8){if(_0x27f6e8 instanceof Error&&_0x27f6e8[_0x2f0550(0x1ec)][_0x2f0550(0x30a)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x294)]('Error:'),_0x2f0550(0x38f)),_0x194a04['workflowProject']?console['error'](a51_0x35b3be[_0x2f0550(0x344)]('Tip:\x20cd\x20to\x20workflows/'+_0x194a04[_0x2f0550(0x222)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x194a04['workflowProject']+'\x27')):console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x344)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x27f6e8;}const _0x2395a5=_0x27c49b[_0x2f0550(0x303)];console[_0x2f0550(0x358)](_0x2f0550(0x25e)+_0x2395a5[_0x2f0550(0x2ae)]),console['error'](_0x2f0550(0x2f5)+_0x2395a5['sourceDir']),console[_0x2f0550(0x358)](_0x2f0550(0x280)+_0x2395a5['revision']),console[_0x2f0550(0x358)](_0x2f0550(0x268)+a51_0x35b3be['green']('+'+_0x2395a5[_0x2f0550(0x2f2)][_0x2f0550(0x281)]+'\x20new')+',\x20'+(a51_0x35b3be['yellow']('~'+_0x2395a5['summary'][_0x2f0550(0x398)]+_0x2f0550(0x22a))+',\x20')+(a51_0x35b3be[_0x2f0550(0x294)]('-'+_0x2395a5[_0x2f0550(0x2f2)]['deleted']+_0x2f0550(0x353))+',\x20')+(''+a51_0x35b3be[_0x2f0550(0x344)](_0x2395a5[_0x2f0550(0x2f2)][_0x2f0550(0x373)]+_0x2f0550(0x210))));for(const _0x401b2a of _0x2395a5[_0x2f0550(0x275)]){_0x401b2a[_0x2f0550(0x349)]===_0x2f0550(0x398)&&_0x401b2a[_0x2f0550(0x35c)]&&(console['error']('\x0a'+a51_0x35b3be[_0x2f0550(0x37e)](_0x2f0550(0x2b6)+_0x401b2a[_0x2f0550(0x321)])),console[_0x2f0550(0x358)](_0x401b2a['diff']));}if(!_0x2395a5['hasChanges'])return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x2a4)](_0x2f0550(0x2df))),await this[_0x2f0550(0x27d)](_0x341cba,_0x2395a5[_0x2f0550(0x2ae)],_0x194a04[_0x2f0550(0x208)]),0x0;if(_0x194a04[_0x2f0550(0x34c)])return console['error'](a51_0x35b3be['yellow'](_0x2f0550(0x360))),0x0;if(!_0x194a04[_0x2f0550(0x2fc)]){if(!isInteractive())return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x294)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x344)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x463da7=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x463da7)return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x35b)]('Cancelled'),_0x2f0550(0x2be)),0x1;}const _0x23dba4=await withSpinner(_0x2f0550(0x237),()=>_0x341cba[_0x2f0550(0x2d3)][_0x2f0550(0x273)](_0x2395a5),{'verbose':_0x194a04[_0x2f0550(0x2ce)]}),_0x97a24=_0x23dba4['data'];return console[_0x2f0550(0x358)](a51_0x35b3be[_0x2f0550(0x2a4)](_0x2f0550(0x2b0))),console[_0x2f0550(0x358)](_0x2f0550(0x2c6)+_0x97a24[_0x2f0550(0x246)]),console[_0x2f0550(0x358)](_0x2f0550(0x280)+_0x97a24[_0x2f0550(0x230)]),await this['showWorkflowConsoleUrl'](_0x341cba,_0x97a24[_0x2f0550(0x2ae)],_0x194a04[_0x2f0550(0x208)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';['description']=a51_0x198ccf(0x362);async['execute'](_0x5913c8){const _0x429ee1=a51_0x198ccf,{options:_0x439792,args:_0x58b6ed,tdx:_0x1590c0}=_0x5913c8,_0x5ae96f=this[_0x429ee1(0x286)](_0x58b6ed,_0x439792),_0x3355c5=_0x439792[_0x429ee1(0x236)],_0x3982e3=_0x439792['revision'],_0x5982d5=_0x439792[_0x429ee1(0x394)];if(!_0x5ae96f)return console[_0x429ee1(0x358)](a51_0x35b3be['red']('Error:'),_0x429ee1(0x313)),console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x344)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a51_0x35b3be[_0x429ee1(0x344)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x3355c5)return console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x294)](_0x429ee1(0x28e)),_0x429ee1(0x35a)),console['error'](a51_0x35b3be['dim'](_0x429ee1(0x2d1))),0x1;_0x439792[_0x429ee1(0x2ce)]&&(console['error']('Source\x20directory:\x20'+_0x5ae96f),console[_0x429ee1(0x358)](_0x429ee1(0x393)+_0x3355c5),_0x3982e3&&console[_0x429ee1(0x358)](_0x429ee1(0x283)+_0x3982e3),_0x439792[_0x429ee1(0x34c)]&&console['error'](_0x429ee1(0x1f8)),_0x5982d5&&console[_0x429ee1(0x358)](_0x429ee1(0x292)));const _0x200326=await withSpinner(_0x429ee1(0x34d),()=>_0x1590c0[_0x429ee1(0x2d3)][_0x429ee1(0x23c)](_0x5ae96f,_0x3355c5,{'revision':_0x3982e3,'skipValidation':_0x5982d5}),{'verbose':_0x439792[_0x429ee1(0x2ce)]}),_0x3d62c4=_0x200326[_0x429ee1(0x303)];console[_0x429ee1(0x358)](_0x429ee1(0x2ad)+_0x3d62c4[_0x429ee1(0x340)]);_0x3d62c4[_0x429ee1(0x31e)]&&console[_0x429ee1(0x358)](_0x429ee1(0x38c)+_0x3d62c4['sourceProjectName']);console[_0x429ee1(0x358)](_0x429ee1(0x393)+_0x3d62c4[_0x429ee1(0x382)]),console[_0x429ee1(0x358)](_0x429ee1(0x283)+_0x3d62c4[_0x429ee1(0x230)]),console[_0x429ee1(0x358)](_0x429ee1(0x372)+_0x3d62c4[_0x429ee1(0x277)]);_0x3d62c4[_0x429ee1(0x323)]&&(console[_0x429ee1(0x358)](a51_0x35b3be['yellow']('\x0a⚠\x20Project\x20\x22'+_0x3d62c4[_0x429ee1(0x382)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x3d62c4['existingProjectId']+')')),console['error'](a51_0x35b3be[_0x429ee1(0x35b)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x439792[_0x429ee1(0x34c)])return console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x35b)](_0x429ee1(0x240))),0x0;if(!_0x439792[_0x429ee1(0x2fc)]){if(!isInteractive())return console['error'](a51_0x35b3be[_0x429ee1(0x294)](_0x429ee1(0x33b)),_0x429ee1(0x37c)),console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x344)](_0x429ee1(0x2f7))),0x1;const _0x1050b6=_0x3d62c4[_0x429ee1(0x31e)]||a51_0x3ec8c4[_0x429ee1(0x1fc)](_0x5ae96f),_0x4b735b=_0x3d62c4[_0x429ee1(0x323)]?_0x429ee1(0x36a)+_0x3355c5+_0x429ee1(0x2ec):'\x0aClone\x20\x22'+_0x1050b6+_0x429ee1(0x26f)+_0x3355c5+'\x22?',_0x5354b3=await confirmKey(_0x4b735b);if(!_0x5354b3)return console[_0x429ee1(0x358)](a51_0x35b3be[_0x429ee1(0x35b)](_0x429ee1(0x2cb))),0x1;}const _0x1059c5=await withSpinner(_0x3d62c4[_0x429ee1(0x323)]?_0x429ee1(0x28f)+_0x3355c5+'...':_0x429ee1(0x322)+_0x3355c5+'...',()=>_0x1590c0['workflow'][_0x429ee1(0x2c7)](_0x3d62c4),{'verbose':_0x439792['verbose']}),_0x446025=_0x1059c5[_0x429ee1(0x303)];return console[_0x429ee1(0x358)](a51_0x35b3be['green'](_0x3d62c4['targetExists']?_0x429ee1(0x202):_0x429ee1(0x231))),console[_0x429ee1(0x358)](_0x429ee1(0x29c)+_0x446025['newProjectName']),console[_0x429ee1(0x358)](_0x429ee1(0x2c6)+_0x446025[_0x429ee1(0x2cf)]),console['error'](_0x429ee1(0x280)+_0x446025[_0x429ee1(0x230)]),await this[_0x429ee1(0x27d)](_0x1590c0,_0x446025[_0x429ee1(0x382)],_0x439792['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a51_0x198ccf(0x25d);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x2e3);async['execute'](_0x4c1c50){const _0x594e8c=a51_0x198ccf,{options:_0x4841bd,args:_0xc271bf,tdx:_0x257991}=_0x4c1c50,_0x454c07=_0xc271bf[0x0];if(!_0x454c07)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x594e8c(0x2ca)),0x1;_0x4841bd[_0x594e8c(0x2ce)]&&console['error'](_0x594e8c(0x1fa)+_0x454c07);if(!_0x4841bd[_0x594e8c(0x2fc)]){if(!isInteractive())return console[_0x594e8c(0x358)](a51_0x35b3be['red'](_0x594e8c(0x33b)),_0x594e8c(0x37c)),console[_0x594e8c(0x358)](a51_0x35b3be[_0x594e8c(0x344)](_0x594e8c(0x2f7))),0x1;const _0x5e9c8c=await confirmKey(_0x594e8c(0x1f6)+_0x454c07+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x5e9c8c)return console[_0x594e8c(0x358)](a51_0x35b3be[_0x594e8c(0x35b)](_0x594e8c(0x2cb))),0x1;}const _0x5dcbc1=await withSpinner(_0x594e8c(0x2e7)+_0x454c07+_0x594e8c(0x239),()=>_0x257991['workflow']['delete'](_0x454c07),{'verbose':_0x4841bd[_0x594e8c(0x2ce)]}),_0x37dbc9=_0x5dcbc1[_0x594e8c(0x303)];return console[_0x594e8c(0x358)](_0x594e8c(0x221)+_0x37dbc9[_0x594e8c(0x2ae)]),console[_0x594e8c(0x358)](_0x594e8c(0x2c6)+_0x37dbc9[_0x594e8c(0x246)]),0x0;}}export function parseKeyValue(_0x38f270){const _0x15ed21=a51_0x198ccf,_0x5a3245=_0x38f270[_0x15ed21(0x299)]('=');if(_0x5a3245===-0x1)throw new Error(_0x15ed21(0x296)+_0x38f270+_0x15ed21(0x26d));const _0xfaf6c6=_0x38f270[_0x15ed21(0x2e9)](0x0,_0x5a3245),_0x383e4b=_0x38f270['substring'](_0x5a3245+0x1);if(!_0xfaf6c6)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0xfaf6c6,'value':_0x383e4b};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x26b);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x30d);async[a51_0x198ccf(0x1ff)](_0x36612b){const _0x425d60=a51_0x198ccf,{options:_0x231b64,args:_0x3c3f1a,tdx:_0x1a148a}=_0x36612b,_0x2be38a=this[_0x425d60(0x267)](_0x3c3f1a,_0x231b64);if(!_0x2be38a)return 0x1;_0x231b64[_0x425d60(0x2ce)]&&console[_0x425d60(0x358)](_0x425d60(0x1fa)+_0x2be38a);const _0x2ff6b0=await withSpinner(_0x425d60(0x29d),()=>_0x1a148a[_0x425d60(0x2d3)][_0x425d60(0x2b2)](_0x2be38a),{'verbose':_0x231b64[_0x425d60(0x2ce)]}),{secrets:_0x1afc21}=_0x2ff6b0[_0x425d60(0x303)];return console['error'](_0x425d60(0x1f2)+_0x1afc21['length']+_0x425d60(0x27e)+(_0x1afc21[_0x425d60(0x252)]!==0x1?'s':'')),await handleSDKOutput(_0x1afc21,_0x231b64),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x34b);['description']=a51_0x198ccf(0x301);async[a51_0x198ccf(0x1ff)](_0x1b709e){const _0x4285b9=a51_0x198ccf,{options:_0x270613,args:_0x1b3855,tdx:_0x518718}=_0x1b709e;let _0x582da6,_0x58ba63;if(_0x1b3855[_0x4285b9(0x252)]>=0x1&&!_0x1b3855[0x0][_0x4285b9(0x30a)]('='))_0x582da6=_0x1b3855[0x0],_0x58ba63=_0x1b3855['slice'](0x1);else{if(_0x1b3855[_0x4285b9(0x252)]>=0x1&&_0x270613[_0x4285b9(0x222)])_0x582da6=_0x270613[_0x4285b9(0x222)],_0x58ba63=_0x1b3855;else return _0x1b3855[_0x4285b9(0x252)]>=0x1?(console[_0x4285b9(0x358)](_0x4285b9(0x2d8)),console[_0x4285b9(0x358)](_0x4285b9(0x33f)),0x1):(console[_0x4285b9(0x358)](_0x4285b9(0x326)),console[_0x4285b9(0x358)](_0x4285b9(0x279)),0x1);}if(_0x58ba63[_0x4285b9(0x252)]===0x0)return console['error'](_0x4285b9(0x326)),console[_0x4285b9(0x358)](_0x4285b9(0x279)),0x1;const _0x102944={};try{for(const _0x574bfe of _0x58ba63){const {key:_0x78d1ed,value:_0x19cbdd}=parseKeyValue(_0x574bfe);_0x102944[_0x78d1ed]=_0x19cbdd;}}catch(_0x35fdba){return _0x35fdba instanceof Error&&console[_0x4285b9(0x358)](a51_0x35b3be[_0x4285b9(0x294)]('Error:'),_0x35fdba[_0x4285b9(0x1ec)]),0x1;}const _0x522fdf=Object[_0x4285b9(0x295)](_0x102944);_0x270613[_0x4285b9(0x2ce)]&&(console[_0x4285b9(0x358)](_0x4285b9(0x1fa)+_0x582da6),console[_0x4285b9(0x358)]('Secrets\x20to\x20set:\x20'+_0x522fdf[_0x4285b9(0x274)](',\x20')));const _0x479f79=await withSpinner(_0x522fdf['length']===0x1?_0x4285b9(0x2b4):_0x4285b9(0x2b8)+_0x522fdf[_0x4285b9(0x252)]+_0x4285b9(0x35e),()=>_0x518718[_0x4285b9(0x2d3)]['setSecrets'](_0x582da6,_0x102944),{'verbose':_0x270613[_0x4285b9(0x2ce)]}),_0x362eee=_0x479f79[_0x4285b9(0x303)];return console[_0x4285b9(0x358)](_0x522fdf['length']===0x1?'✔\x20Secret\x20\x27'+_0x362eee[_0x4285b9(0x295)][0x0]+_0x4285b9(0x266)+_0x362eee[_0x4285b9(0x2ae)]+'\x27':'✔\x20'+_0x362eee['keys'][_0x4285b9(0x252)]+_0x4285b9(0x21d)+_0x362eee[_0x4285b9(0x2ae)]+'\x27'),(_0x270613[_0x4285b9(0x21b)]||_0x270613[_0x4285b9(0x28c)])&&await handleSingleObjectOutput(_0x362eee,_0x270613),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x318);['description']=a51_0x198ccf(0x288);async[a51_0x198ccf(0x1ff)](_0x483671){const _0x8e4726=a51_0x198ccf,{options:_0x4cd4f4,args:_0x472a39,tdx:_0x302ec7}=_0x483671;let _0x1618a3,_0x45fb3e;if(_0x472a39[_0x8e4726(0x252)]>=0x2)_0x1618a3=_0x472a39[0x0],_0x45fb3e=_0x472a39[0x1];else{if(_0x472a39['length']===0x1&&_0x4cd4f4[_0x8e4726(0x222)])_0x1618a3=_0x4cd4f4[_0x8e4726(0x222)],_0x45fb3e=_0x472a39[0x0];else return _0x472a39[_0x8e4726(0x252)]===0x1?(console['error'](_0x8e4726(0x2d8)),console[_0x8e4726(0x358)](_0x8e4726(0x33f)),0x1):(console[_0x8e4726(0x358)](_0x8e4726(0x2bb)),console[_0x8e4726(0x358)](_0x8e4726(0x377)),0x1);}_0x4cd4f4[_0x8e4726(0x2ce)]&&(console[_0x8e4726(0x358)]('Project:\x20'+_0x1618a3),console[_0x8e4726(0x358)](_0x8e4726(0x2d9)+_0x45fb3e));if(!_0x4cd4f4[_0x8e4726(0x2fc)]){if(!isInteractive())return console[_0x8e4726(0x358)](a51_0x35b3be[_0x8e4726(0x294)](_0x8e4726(0x33b)),_0x8e4726(0x37c)),console[_0x8e4726(0x358)](a51_0x35b3be[_0x8e4726(0x344)](_0x8e4726(0x2f7))),0x1;const _0x1c4e38=await confirmKey(_0x8e4726(0x2b1)+_0x45fb3e+_0x8e4726(0x325)+_0x1618a3+'\x27?');if(!_0x1c4e38)return console[_0x8e4726(0x358)](a51_0x35b3be[_0x8e4726(0x35b)]('Cancelled')),0x1;}const _0x38da8d=await withSpinner(_0x8e4726(0x2f9),()=>_0x302ec7[_0x8e4726(0x2d3)][_0x8e4726(0x376)](_0x1618a3,_0x45fb3e),{'verbose':_0x4cd4f4[_0x8e4726(0x2ce)]}),_0x47f163=_0x38da8d['data'];return console[_0x8e4726(0x358)](_0x8e4726(0x22c)+_0x47f163['key']+_0x8e4726(0x272)+_0x47f163['projectName']+'\x27'),(_0x4cd4f4[_0x8e4726(0x21b)]||_0x4cd4f4['jsonl'])&&await handleSingleObjectOutput(_0x47f163,_0x4cd4f4),0x0;}}function a51_0x3170(){const _0x3b090a=['63NRWkzH','session:','renderSingleTimeline','Deleting\x20project\x20','ICON_SPACING','substring','\x0aDry\x20run\x20-\x20no\x20files\x20written','sessionTime','\x22\x20with\x20new\x20revision?','Workflow:\x20','\x1b[1A\x1b[2K','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','summary','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Listing\x20workflow\x20attempts...','\x20\x20Source:\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','No\x20sessions\x20found\x20in\x20project:\x20','Deleting\x20secret...','Pushing\x20workflow\x20project...','workflow:upload','yes','💡\x20Tip:\x20Use\x20','resolveProject','relative','state','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','cwd','data','Project\x20name:\x20','Target\x20directory:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','push','size','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','includes','createdAt','getDate','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','logFiles','\x0aApply\x20these\x20changes?','pollTimeline','resolveProjectId','Source\x20directory\x20is\x20required','1788200EkilLS','index','map','LABEL_MIN_SPACING','workflow:secrets:delete','From\x20task:\x20','canceling','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Getting\x20attempt\x20details...','retryAttemptName','sourceProjectName','window','limit','path','Cloning\x20to\x20','targetExists','includeSubtasks','\x27\x20from\x20project\x20\x27','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','startedAt','4608096gTEqlA','attempts','fromTask','force','columns','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:timeline','Usage:\x20tdx\x20wf\x20use\x20<project>','end','startsWith','min','text','✔\x20Showing\x20','\x20attempt','follow','📋\x20','isTTY','Including\x20subtasks:\x20yes','Project\x20directory:\x20','\x0aError:','lastAttempt','📁\x20','\x20logs','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','sourceDir','workflow:run','taskName','\x20workflow','dim','MIN_TIMELINE_WIDTH','filter','2182210gqxFuc','Error:\x20Invalid\x20parameter\x20format:\x20','type','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','workflow:secrets:set','dryRun','Analyzing\x20project...','start','readFile','Params:\x20','Attempt\x20ID:\x20','705386hdehhO','\x20deleted','stat','Parameters:\x20','split','GUTTER','error','session','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','yellow','diff','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x20secrets...','write','\x0aDry\x20run\x20-\x20nothing\x20pushed','No\x20sessions\x20found','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','getMonth','workflow:attempt','getFullYear','hasChanges','Analyzing\x20changes...','tdx\x20wf\x20attempt\x20','cancelRequested','\x0aUpdate\x20existing\x20project\x20\x22','✔\x20Workflow\x20project\x20set\x20to:\x20','Kill\x20a\x20running\x20attempt','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','resumeFrom','white','-\x20no\x20files\x20written','slice','Files\x20to\x20upload:\x20','unchanged','Killing\x20attempt...','clear','deleteSecret','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Retrying\x20attempt...','✔\x20Pull\x20complete','MAX_TASKS_DISPLAY','rows','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pulling\x20project\x20','cyan','msPerChar','durationMs','\x20\x20Attempt\x20ID:\x20','newProjectName','\x20\x20New\x20attempt\x20ID:\x20','workflow:use','pullProject','Error:\x20','Show\x20tasks\x20for\x20an\x20attempt','List\x20workflows','Latest\x20session\x20has\x20no\x20attempt','No\x20attempts\x20found\x20in\x20project:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Source\x20project:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Failed\x20to\x20fetch\x20attempt\x20data','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','No\x20projects\x20match\x20pattern:\x20','✔\x20Retry\x20started','task','New\x20project\x20name:\x20','skipValidation','targetDir','Listing\x20workflow\x20projects...','\x20\x20Session\x20ID:\x20','modified','fullName','Project\x20filter:\x20','has','\x20(use\x20--limit\x20to\x20show\x20more)','message','Output\x20directory:\x20','No\x20workflow\x20sessions\x20found','select','trimEnd','Reason:\x20','✔\x20Found\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','→\x20Project:\x20','resolve','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Starting\x20workflow\x20run...','Dry\x20run:\x20yes','\x20sessions\x20','Project:\x20','Filter:\x20project=','basename','padStart','\x20\x20Target:\x20','execute','format','kill','✔\x20Project\x20updated','deleted','find','Error:\x20Attempt\x20ID\x20is\x20required','unknown','No\x20sessions\x20with\x20timing\x20information','site','description','workflow:pull','Task\x20name:\x20','Project\x20name\x20is\x20required','buildTimelineData','sessionId','Total:\x20','\x20unchanged','table','includeRetried','MAX_TIMELINE_WIDTH','isDirectory','param','blue','max','project','toISOString','workflow:kill','json','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20secrets\x20set\x20for\x20project\x20\x27','match','Auto-selected\x20latest\x20session:\x20','fs/promises','✔\x20Deleted\x20project\x20','workflowProject','retrySession','sort','renderTimeline','list','set','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','finishedAt','\x20modified','renderSessionsTimeline','✔\x20Secret\x20\x27','List\x20workflow\x20attempts','✔\x20Workflow\x20run\x20started','Select\x20a\x20workflow\x20to\x20run','revision','✔\x20Clone\x20complete','isNewProject','No\x20attempts\x20found','Expected\x20format:\x20--param\x20key=value','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','name','Pushing\x20project...','LABEL_WIDTH_DIVISOR','...','projects','workflow:tasks','prepareCloneProject','Session\x20','filesExtracted','displayLine','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20-\x20','values','\x20\x20Files\x20extracted:\x20','total','success','projectId','updatedAt','parse','Retrying\x20session...','Force:\x20yes','/attempt/','\x20\x20Workflow:\x20','Warning:','repeat','Downloading\x20project\x20','\x20\x20tdx\x20wf\x20use\x20<project>','ICON_WIDTH','length','logs','generateSessionTimelineRows','workflow:workflows','planned','now','6181821gcKbYB','localeCompare','Getting\x20attempt\x20tasks...','\x20is\x20not\x20a\x20directory','Select\x20a\x20task\x20to\x20view\x20logs:','workflow:delete','✔\x20Project:\x20','applyPullProject','✔\x20Workflow\x20project\x20context\x20cleared.','Using\x20attempt\x20','workflows','log','output','Attempt:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','requireProject','\x20\x20Changes:\x20','autocomplete','Show\x20specific\x20attempt\x20details','workflow:secrets:list','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','.\x20Expected\x20format:\x20KEY=VALUE','Filter:\x20','\x22\x20to\x20new\x20project\x20\x22','attemptId','floor','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','executePushProject','join','changes','workflowName','fileCount','\x20has\x20no\x20attempts','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Pattern:\x20','1553319ySrGAP','tasks','showWorkflowConsoleUrl','\x20secret','⚠\x20Showing\x20first\x20','\x20\x20Revision:\x20','new','group_error','Revision:\x20','\x0a✔\x20Attempt\x20complete','all','resolveProjectDir','attempt:','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','replace','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','navigateSessionsInteractive','jsonl','(unknown)','Error:','Updating\x20','\x20of\x20','get','Validation:\x20skipped','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','red','keys','Invalid\x20format:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','attempt','indexOf','splice','List\x20workflow\x20execution\x20sessions','\x20\x20Project:\x20','Listing\x20secrets...','\x20tasks','sessions','context','revision:\x20','Include\x20retried:\x20yes','session_id','green','stringify','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','params','Session\x20not\x20found:\x20','done','\x20(system)','Downloading\x20logs...','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Source:\x20','projectName','parseProjectWorkflowPattern','✔\x20Push\x20complete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','listSecrets','Fetching\x20log\x20files...','Setting\x20secret...','stdout','---\x20','duration','Setting\x20','4bMITDI','\x20\x20Location:\x20','Error:\x20Secret\x20key\x20is\x20required','✔\x20Pushed\x20','startTime','-\x20nothing\x20pushed','utf-8','metadata','trim','Source\x20directory:\x20','getTime','No\x20log\x20content\x20found','No\x20sessions\x20found\x20for:\x20','\x20\x20Project\x20ID:\x20','executeCloneProject','key','Loading\x20sessions...','Usage:\x20workflow:delete\x20<project-name-or-id>','Cancelled','isArray','workflow:push','verbose','newProjectId','fill','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','toLowerCase','workflow','\x20\x20Console:\x20','some','\x20new','No\x20workflows\x20found','Error:\x20Project\x20name\x20is\x20required','Key:\x20','No\x20matching\x20sessions\x20found','running','669294JqaUsm','run','from','\x0a✔\x20No\x20changes\x20to\x20push','workflow:projects','\x20project','workflow:download','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data'];a51_0x3170=function(){return _0x3b090a;};return a51_0x3170();}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(_0x14e456){const _0x13bf7e=a51_0x198ccf,_0x5cfe04=Math[_0x13bf7e(0x271)](_0x14e456/0x3e8),_0x443980=Math[_0x13bf7e(0x271)](_0x5cfe04/0x3c),_0x32445f=Math['floor'](_0x443980/0x3c),_0x33f6b4=Math[_0x13bf7e(0x271)](_0x32445f/0x18);if(_0x33f6b4>0x0){const _0x89acce=_0x32445f%0x18;return _0x89acce>0x0?_0x33f6b4+'d\x20'+_0x89acce+'h':_0x33f6b4+'d';}else{if(_0x32445f>0x0){const _0x40072a=_0x443980%0x3c;return _0x40072a>0x0?_0x32445f+'h\x20'+_0x40072a+'m':_0x32445f+'h';}else{if(_0x443980>0x0){const _0x335113=_0x5cfe04%0x3c;return _0x335113>0x0?_0x443980+'m\x20'+_0x335113+'s':_0x443980+'m';}else return _0x5cfe04+'s';}}}function formatTimestamp(_0x2c7b18,_0xaa0cf){const _0x518102=a51_0x198ccf,_0x14672f=new Date(_0x2c7b18),_0x1c5403=String(_0x14672f['getHours']())[_0x518102(0x1fd)](0x2,'0'),_0x71429b=String(_0x14672f['getMinutes']())['padStart'](0x2,'0'),_0x252a96=_0x1c5403+':'+_0x71429b,_0x5a2261=_0x14672f['getFullYear']()===_0xaa0cf[_0x518102(0x365)]()&&_0x14672f['getMonth']()===_0xaa0cf['getMonth']()&&_0x14672f['getDate']()===_0xaa0cf[_0x518102(0x30c)]();if(_0x5a2261)return _0x252a96;else{const _0x1e8b2e=String(_0x14672f['getMonth']()+0x1)[_0x518102(0x1fd)](0x2,'0'),_0x342a62=String(_0x14672f[_0x518102(0x30c)]())['padStart'](0x2,'0');return _0x1e8b2e+'-'+_0x342a62+'\x20'+_0x252a96;}}function formatDate(_0x20986e){const _0x414cf0=a51_0x198ccf,_0x5e20af=_0x20986e[_0x414cf0(0x365)](),_0x1fddf7=String(_0x20986e[_0x414cf0(0x363)]()+0x1)['padStart'](0x2,'0'),_0x330b40=String(_0x20986e['getDate']())[_0x414cf0(0x1fd)](0x2,'0');return _0x5e20af+'-'+_0x1fddf7+'-'+_0x330b40;}function getTaskStateIcon(_0x533a26){const _0x147606={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x147606[_0x533a26]||'⚪';}function getBarChar(_0x2b7927){const _0x5de153=a51_0x198ccf;return _0x2b7927===_0x5de153(0x358)||_0x2b7927===_0x5de153(0x282)?'×':'─';}function getBarColor(_0x5903db){const _0x5e8958=a51_0x198ccf,_0x53d51d={'success':a51_0x35b3be[_0x5e8958(0x2a4)],'error':a51_0x35b3be['red'],'group_error':a51_0x35b3be[_0x5e8958(0x294)],'running':a51_0x35b3be[_0x5e8958(0x216)],'blocked':a51_0x35b3be['yellow'],'planned':a51_0x35b3be[_0x5e8958(0x344)],'canceling':a51_0x35b3be[_0x5e8958(0x35b)]};return _0x53d51d[_0x5903db]||a51_0x35b3be[_0x5e8958(0x36f)];}function parseTaskName(_0x3945b8){const _0x2e41b7=a51_0x198ccf;let _0x3dc96c=_0x3945b8[_0x2e41b7(0x289)](/^\++/,'');const _0x106ec3=_0x3dc96c['split']('+'),_0x208963=_0x106ec3[_0x2e41b7(0x252)]>0x1?_0x106ec3[_0x2e41b7(0x252)]-0x2:0x0,_0xe5fffb=_0x106ec3[_0x106ec3[_0x2e41b7(0x252)]-0x1]||_0x3dc96c;return{'level':_0x208963,'name':'+'+_0xe5fffb};}function a51_0x2f39(_0x4c0e29,_0x4abeff){_0x4c0e29=_0x4c0e29-0x1ec;const _0x3170d6=a51_0x3170();let _0x2f390f=_0x3170d6[_0x4c0e29];return _0x2f390f;}function truncateTaskName(_0x5f3b13,_0xc4222e){const _0x4b77c2=a51_0x198ccf,_0x85ef1=stringWidth(_0x5f3b13);if(_0x85ef1<=_0xc4222e)return _0x5f3b13;let _0x5c6ac0=_0x5f3b13;while(stringWidth(_0x5c6ac0+'…')>_0xc4222e&&_0x5c6ac0[_0x4b77c2(0x252)]>0x0){_0x5c6ac0=_0x5c6ac0[_0x4b77c2(0x371)](0x0,-0x1);}return _0x5c6ac0+'…';}function calculateTimeScale(_0x179abe,_0x49d6b5){const _0x422ef9=a51_0x198ccf;return{'startTime':_0x179abe[_0x422ef9(0x34e)],'endTime':_0x179abe[_0x422ef9(0x330)],'durationMs':_0x179abe['duration'],'msPerChar':_0x179abe['duration']/_0x49d6b5};}function timeToPosition(_0x3d27a5,_0x25b439,_0x24384b){const _0xf1b748=a51_0x198ccf,_0x57932f=_0x3d27a5-_0x25b439[_0xf1b748(0x2bd)],_0x2f56e5=Math[_0xf1b748(0x271)](_0x57932f/_0x25b439[_0xf1b748(0x37f)]);return Math['max'](0x0,Math[_0xf1b748(0x332)](_0x2f56e5,_0x24384b));}function renderTimeAxis(_0x217d2e,_0x4d10a7){const _0x7c694b=a51_0x198ccf,_0x3ffdad=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x7c694b(0x217)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x7c694b(0x271)](_0x4d10a7/TIMELINE_CONFIG[_0x7c694b(0x238)]))),_0x5dd6ca=_0x217d2e[_0x7c694b(0x380)]/(_0x3ffdad-0x1),_0x42f3fc=new Date(_0x217d2e[_0x7c694b(0x2bd)]),_0x46df93=[];for(let _0x4be46a=0x0;_0x4be46a<_0x3ffdad;_0x4be46a++){const _0x2d3a27=_0x217d2e['startTime']+_0x4be46a*_0x5dd6ca,_0x11a57a=timeToPosition(_0x2d3a27,_0x217d2e,_0x4d10a7),_0x33271b=formatTimestamp(_0x2d3a27,_0x42f3fc);_0x46df93[_0x7c694b(0x307)]({'pos':_0x11a57a,'text':_0x33271b});}const _0x41231a=new Array(_0x4d10a7)[_0x7c694b(0x2d0)]('\x20');let _0x2e1fbd=-0x1;for(const {pos:_0x1c2229,text:_0x4bda24}of _0x46df93){let _0x338fb9=Math[_0x7c694b(0x217)](0x0,_0x1c2229-Math[_0x7c694b(0x271)](_0x4bda24[_0x7c694b(0x252)]/0x2));_0x338fb9<=_0x2e1fbd+TIMELINE_CONFIG[_0x7c694b(0x317)]&&(_0x338fb9=_0x2e1fbd+TIMELINE_CONFIG[_0x7c694b(0x317)]+0x1);_0x338fb9+_0x4bda24['length']>_0x4d10a7&&(_0x338fb9=_0x4d10a7-_0x4bda24['length']);if(_0x338fb9>=0x0&&_0x338fb9+_0x4bda24[_0x7c694b(0x252)]<=_0x4d10a7&&_0x338fb9>_0x2e1fbd){for(let _0x4bbf65=0x0;_0x4bbf65<_0x4bda24[_0x7c694b(0x252)];_0x4bbf65++){_0x41231a[_0x338fb9+_0x4bbf65]=_0x4bda24[_0x4bbf65];}_0x2e1fbd=_0x338fb9+_0x4bda24['length']-0x1;}}return _0x41231a['join']('');}function renderTaskRow(_0x361353,_0x4886b0,_0x417bc5,_0x4ce3d7){const _0x558417=a51_0x198ccf,{level:_0x19fb9c,name:_0x4f511d}=parseTaskName(_0x361353[_0x558417(0x236)]),_0x5cec11='\x20'[_0x558417(0x24e)](_0x19fb9c),_0x228e98=_0x361353[_0x558417(0x31f)]?'('+formatElapsed(_0x361353[_0x558417(0x31f)][_0x558417(0x2b7)])+')':'',_0x16b8a3=stringWidth(_0x228e98),_0x54ace8=_0x19fb9c*0x1,_0x1dcc59=_0x4ce3d7-_0x54ace8-_0x16b8a3-0x1,_0x5c1d94=truncateTaskName(_0x4f511d,_0x1dcc59),_0x292db0=_0x5cec11+_0x5c1d94,_0x1ed588=stringWidth(_0x292db0),_0xd59576=_0x4ce3d7-_0x1ed588-_0x16b8a3,_0x21e83c=_0x292db0+'\x20'['repeat'](Math['max'](0x1,_0xd59576))+a51_0x35b3be['dim'](_0x228e98),_0x173477=getTaskStateIcon(_0x361353[_0x558417(0x300)]),_0x2ddb42=new Array(_0x417bc5)['fill']('\x20');if(_0x361353['window']){const _0x116217=timeToPosition(_0x361353[_0x558417(0x31f)][_0x558417(0x34e)],_0x4886b0,_0x417bc5),_0x4f897f=timeToPosition(_0x361353['window']['end'],_0x4886b0,_0x417bc5),_0x442fa2=getBarChar(_0x361353[_0x558417(0x300)]),_0x828278=Math[_0x558417(0x217)](_0x116217+0x1,_0x4f897f);for(let _0x2cee6c=_0x116217;_0x2cee6c<Math[_0x558417(0x332)](_0x828278,_0x417bc5);_0x2cee6c++){_0x2ddb42[_0x2cee6c]=_0x442fa2;}}const _0x3d6f03=getBarColor(_0x361353[_0x558417(0x300)]),_0x329557=_0x2ddb42[_0x558417(0x316)](_0x42619a=>_0x42619a==='\x20'?'\x20':_0x3d6f03(_0x42619a))[_0x558417(0x274)]('');return _0x173477+'\x20'+_0x21e83c+'│'+_0x329557+'│';}function calculateStats(_0x28c62a){const _0x521ee0=a51_0x198ccf,_0x537775={'total':_0x28c62a['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1d0f58 of _0x28c62a){if(_0x1d0f58[_0x521ee0(0x300)]===_0x521ee0(0x245))_0x537775[_0x521ee0(0x245)]++;else{if(_0x1d0f58[_0x521ee0(0x300)]===_0x521ee0(0x358)||_0x1d0f58[_0x521ee0(0x300)]===_0x521ee0(0x282))_0x537775[_0x521ee0(0x358)]++;else _0x1d0f58[_0x521ee0(0x300)]===_0x521ee0(0x2db)?_0x537775['running']++:_0x537775['pending']++;}}return _0x537775;}function formatStats(_0xe6d410){const _0x5f010c=a51_0x198ccf;return[_0x5f010c(0x20f)+_0xe6d410[_0x5f010c(0x244)],'✅\x20'+_0xe6d410[_0x5f010c(0x245)],'❌\x20'+_0xe6d410[_0x5f010c(0x358)],'🔄\x20'+_0xe6d410['running'],'⏳\x20'+_0xe6d410['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x198ccf(0x236)]=a51_0x198ccf(0x32e);[a51_0x198ccf(0x209)]=a51_0x198ccf(0x34a);async[a51_0x198ccf(0x1ff)](_0x519396){const _0x3b7cac=a51_0x198ccf,{options:_0x3ddff7,args:_0x1e229a,tdx:_0x41b8ab}=_0x519396;let _0x18556b,_0x28f79e,_0x388a64=![];if(_0x1e229a[0x0]){if(_0x1e229a[0x0][_0x3b7cac(0x30a)]('.')){const _0x4bcea9=this[_0x3b7cac(0x2af)](_0x1e229a,_0x3ddff7);if(!_0x4bcea9)return 0x1;_0x18556b=_0x4bcea9['projectName'],_0x28f79e=_0x4bcea9[_0x3b7cac(0x276)];}else{_0x28f79e=_0x1e229a[0x0],_0x18556b=_0x3ddff7[_0x3b7cac(0x222)];if(!_0x18556b)return console[_0x3b7cac(0x358)](a51_0x35b3be['red'](_0x3b7cac(0x28e)),_0x3b7cac(0x36d)),0x1;_0x388a64=!![];}}else{const _0x2b21e1=this['parseProjectWorkflowPattern'](_0x1e229a,_0x3ddff7);if(!_0x2b21e1)return 0x1;_0x18556b=_0x2b21e1['projectName'],_0x28f79e=_0x2b21e1['workflowName'];}if(_0x3ddff7[_0x3b7cac(0x2ce)]){if(_0x18556b&&_0x28f79e)console[_0x3b7cac(0x358)](_0x3b7cac(0x26e)+_0x18556b+'.'+_0x28f79e);else _0x18556b&&console['error'](_0x3b7cac(0x1fb)+_0x18556b);}const _0x421134=_0x3ddff7[_0x3b7cac(0x270)],_0x117642=_0x3ddff7[_0x3b7cac(0x20e)];if(_0x421134){_0x117642&&console[_0x3b7cac(0x358)](a51_0x35b3be[_0x3b7cac(0x35b)](_0x3b7cac(0x24d)),_0x3b7cac(0x1f3));const _0x1132bb=_0x3ddff7[_0x3b7cac(0x336)];return _0x1132bb?await this[_0x3b7cac(0x311)](_0x519396,_0x421134):await this[_0x3b7cac(0x2e6)](_0x519396,_0x421134,_0x3ddff7),0x0;}if(_0x117642){const _0x2f3efc=await withSpinner('Loading\x20session...',()=>_0x41b8ab[_0x3b7cac(0x2d3)][_0x3b7cac(0x29f)]({'projectName':_0x18556b,'workflowName':_0x28f79e,'limit':0x64}),{'verbose':_0x3ddff7['verbose']}),_0xa41260=_0x2f3efc[_0x3b7cac(0x303)][_0x3b7cac(0x204)](_0x3cb57f=>_0x3cb57f['id']===_0x117642);if(!_0xa41260)return console['error'](a51_0x35b3be[_0x3b7cac(0x294)](_0x3b7cac(0x28e)),_0x3b7cac(0x2a8)+_0x117642),0x1;if(!_0xa41260['lastAttempt']?.['id'])return console[_0x3b7cac(0x358)](a51_0x35b3be[_0x3b7cac(0x294)](_0x3b7cac(0x28e)),_0x3b7cac(0x23d)+_0x117642+_0x3b7cac(0x278)),0x1;const _0x108a91=_0xa41260[_0x3b7cac(0x33c)]['id'];_0x3ddff7[_0x3b7cac(0x2ce)]&&console[_0x3b7cac(0x358)](_0x3b7cac(0x261)+_0x108a91+'\x20from\x20session\x20'+_0x117642);const _0x265c3e=_0x3ddff7['follow'];return _0x265c3e?await this[_0x3b7cac(0x311)](_0x519396,_0x108a91):await this[_0x3b7cac(0x2e6)](_0x519396,_0x108a91,_0x3ddff7),0x0;}const _0x234bf6=await withSpinner(_0x3b7cac(0x2c9),()=>_0x41b8ab[_0x3b7cac(0x2d3)][_0x3b7cac(0x29f)]({'projectName':_0x18556b,'workflowName':_0x28f79e,'limit':_0x3ddff7['limit']||0x32}),{'verbose':_0x3ddff7['verbose']}),_0x4d0103=_0x234bf6[_0x3b7cac(0x303)];if(_0x4d0103[_0x3b7cac(0x252)]===0x0){if(_0x18556b&&_0x28f79e)console[_0x3b7cac(0x358)](_0x3b7cac(0x2c5)+_0x18556b+'.'+_0x28f79e);else _0x18556b?console[_0x3b7cac(0x358)](_0x3b7cac(0x2f8)+_0x18556b):(console['error'](_0x3b7cac(0x1ee)),console['error'](a51_0x35b3be[_0x3b7cac(0x344)](_0x3b7cac(0x2f0))));return 0x0;}_0x4d0103['sort']((_0x9452d0,_0xce8262)=>{const _0x2b5a3d=_0x3b7cac,_0xf6c215=_0x9452d0[_0x2b5a3d(0x2eb)]||'',_0x412ed5=_0xce8262[_0x2b5a3d(0x2eb)]||'';return _0x412ed5['localeCompare'](_0xf6c215);});if(_0x3ddff7[_0x3b7cac(0x21b)]||_0x3ddff7[_0x3b7cac(0x28c)])return await handleSDKOutput(_0x4d0103,_0x3ddff7),0x0;let _0x3debf6;if(_0x388a64){const _0x49d470=_0x4d0103[0x0];if(!_0x49d470[_0x3b7cac(0x33c)]?.['id'])return console[_0x3b7cac(0x358)](_0x3b7cac(0x389)),0x0;_0x3debf6=_0x49d470[_0x3b7cac(0x33c)]['id'],_0x3ddff7['verbose']&&console[_0x3b7cac(0x358)](_0x3b7cac(0x21f)+_0x49d470['sessionTime']);}else{const _0x5745d1=_0x4d0103['map'](_0x472c41=>{const _0x1df7f2=_0x3b7cac,_0x5e455d=getAttemptStatusDisplay(_0x472c41[_0x1df7f2(0x33c)]);return{'title':_0x472c41['project']?.[_0x1df7f2(0x236)]+'.'+_0x472c41['workflow']?.['name']+_0x1df7f2(0x241)+_0x472c41['sessionTime']+'\x20'+_0x5e455d['icon'],'value':_0x472c41[_0x1df7f2(0x33c)]?.['id']||'','description':_0x5e455d[_0x1df7f2(0x333)]};}),_0x17dc34=await a51_0x4141d8({'type':_0x3b7cac(0x1ef),'name':_0x3b7cac(0x270),'message':_0x3b7cac(0x297),'choices':_0x5745d1[_0x3b7cac(0x346)](_0x1784a1=>_0x1784a1['value']!=='')});if(!_0x17dc34['attemptId'])return 0x0;_0x3debf6=_0x17dc34[_0x3b7cac(0x270)];}const _0xbc2ab=_0x3ddff7[_0x3b7cac(0x336)];return _0xbc2ab?await this[_0x3b7cac(0x311)](_0x519396,_0x3debf6):await this[_0x3b7cac(0x2e6)](_0x519396,_0x3debf6,_0x3ddff7),0x0;}async[a51_0x198ccf(0x2e6)](_0x16839b,_0x3427e1,_0x5b54e6){const _0x52b63c=a51_0x198ccf,{tdx:_0xfc1c72}=_0x16839b;let _0x15fa0e,_0x363a7a;try{[_0x15fa0e,_0x363a7a]=await Promise[_0x52b63c(0x285)]([_0xfc1c72[_0x52b63c(0x2d3)]['attempt'](_0x3427e1),_0xfc1c72[_0x52b63c(0x2d3)][_0x52b63c(0x27c)](_0x3427e1,![])]);}catch(_0x1fe119){console['error'](a51_0x35b3be['red'](_0x52b63c(0x38e)));_0x5b54e6[_0x52b63c(0x2ce)]&&console[_0x52b63c(0x358)](_0x1fe119);throw _0x1fe119;}if(_0x5b54e6[_0x52b63c(0x21b)]||_0x5b54e6['jsonl']){const _0x10e85c=this[_0x52b63c(0x20d)](_0x15fa0e,_0x363a7a);await handleSDKOutput([_0x10e85c],_0x5b54e6);return;}const _0x38ae25=_0xfc1c72[_0x52b63c(0x2a0)][_0x52b63c(0x208)],_0x3e4b09=this[_0x52b63c(0x225)](_0x15fa0e,_0x363a7a,_0x38ae25);console[_0x52b63c(0x263)](_0x3e4b09);}async[a51_0x198ccf(0x311)](_0x15be8f,_0x222f2c){const _0x14522a=a51_0x198ccf,{tdx:_0x4b904b}=_0x15be8f,_0xa3c08c=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x174cb4=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x1edc51=0x0;while(_0x1edc51<_0x174cb4){process[_0x14522a(0x2b5)][_0x14522a(0x338)]&&process[_0x14522a(0x2b5)]['write']('\x1bc');let _0x5410dd,_0x5dc30d;try{[_0x5410dd,_0x5dc30d]=await Promise[_0x14522a(0x285)]([_0x4b904b[_0x14522a(0x2d3)]['attempt'](_0x222f2c),_0x4b904b[_0x14522a(0x2d3)][_0x14522a(0x27c)](_0x222f2c,![])]);}catch(_0x26be12){console['error'](a51_0x35b3be['red']('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x1edc51>0x0&&console[_0x14522a(0x358)](a51_0x35b3be[_0x14522a(0x344)](_0x14522a(0x21c)+_0x1edc51));throw _0x26be12;}const _0x10ae78=_0x4b904b[_0x14522a(0x2a0)][_0x14522a(0x208)],_0x1d4baa=this[_0x14522a(0x225)](_0x5410dd,_0x5dc30d,_0x10ae78);console[_0x14522a(0x263)](_0x1d4baa);const _0x2bda7a=_0x5410dd[_0x14522a(0x2a9)]&&_0x5dc30d['every'](_0x5c9b9e=>_0x5c9b9e[_0x14522a(0x300)]!==_0x14522a(0x2db)&&_0x5c9b9e[_0x14522a(0x300)]!==_0x14522a(0x256));if(_0x2bda7a){console[_0x14522a(0x358)](a51_0x35b3be[_0x14522a(0x2a4)](_0x14522a(0x284)));break;}console['error'](a51_0x35b3be[_0x14522a(0x344)]('\x0aPolling...\x20('+_0x1edc51*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0xa99849=>setTimeout(_0xa99849,_0xa3c08c)),_0x1edc51++;}_0x1edc51>=_0x174cb4&&console[_0x14522a(0x358)](a51_0x35b3be[_0x14522a(0x35b)](_0x14522a(0x2f1)));}['renderTimeline'](_0x231d79,_0x21505a,_0xd1a18a){const _0x2b84bb=a51_0x198ccf,_0x281ac1=[],_0x15bc27=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5ec288=0x5,_0x174234=process[_0x2b84bb(0x2b5)][_0x2b84bb(0x32c)]||0x78,_0x2134bb=_0x174234-_0x15bc27-_0x5ec288,_0x494de9=Math['max'](TIMELINE_CONFIG[_0x2b84bb(0x345)],Math[_0x2b84bb(0x332)](_0x2134bb,TIMELINE_CONFIG[_0x2b84bb(0x213)])),_0x179d1e=new Date(_0x231d79[_0x2b84bb(0x30b)])[_0x2b84bb(0x2c3)](),_0x1489bf=_0x231d79['finishedAt']?new Date(_0x231d79['finishedAt'])[_0x2b84bb(0x2c3)]():Date[_0x2b84bb(0x257)](),_0xec3046={'start':_0x179d1e,'end':_0x1489bf,'duration':_0x1489bf-_0x179d1e},_0x12d79a=new Map(),_0x583b1a=[];for(const _0x81a030 of _0x21505a){if(_0x81a030['startedAt']){const _0x3ea3de=new Date(_0x81a030['startedAt'])[_0x2b84bb(0x2c3)](),_0x3c98fe=_0x81a030[_0x2b84bb(0x247)]?new Date(_0x81a030[_0x2b84bb(0x247)])[_0x2b84bb(0x2c3)]():Date['now'](),_0x1608e5={'start':_0x3ea3de,'end':_0x3c98fe,'duration':_0x3c98fe-_0x3ea3de};_0x12d79a[_0x2b84bb(0x227)](_0x81a030['id'],_0x1608e5),_0x583b1a[_0x2b84bb(0x307)]({'name':_0x81a030[_0x2b84bb(0x399)],'state':_0x81a030[_0x2b84bb(0x300)]||'unknown','window':_0x1608e5});}else _0x583b1a['push']({'name':_0x81a030['fullName'],'state':_0x81a030[_0x2b84bb(0x300)]||_0x2b84bb(0x256),'window':undefined});}_0x583b1a[_0x2b84bb(0x224)]((_0x2d48fa,_0x3dc2eb)=>{const _0x1cf944=_0x2b84bb;if(!_0x2d48fa['window'])return 0x1;if(!_0x3dc2eb['window'])return-0x1;return _0x2d48fa[_0x1cf944(0x31f)][_0x1cf944(0x34e)]-_0x3dc2eb[_0x1cf944(0x31f)]['start'];});const _0x55a2b6=_0x583b1a['length'],_0x4b9961=_0x55a2b6>TIMELINE_CONFIG[_0x2b84bb(0x37a)];_0x4b9961&&_0x583b1a[_0x2b84bb(0x29a)](TIMELINE_CONFIG[_0x2b84bb(0x37a)]);const _0x42b39e=calculateTimeScale(_0xec3046,_0x494de9),_0x546910=_0x231d79[_0x2b84bb(0x2a9)]?_0x231d79[_0x2b84bb(0x245)]?a51_0x35b3be[_0x2b84bb(0x2a4)](_0x2b84bb(0x245)):a51_0x35b3be[_0x2b84bb(0x294)](_0x2b84bb(0x358)):a51_0x35b3be['blue']('running'),_0x2d0485=_0x231d79[_0x2b84bb(0x218)]?.['id'],_0x537594=_0x231d79[_0x2b84bb(0x20e)];let _0x1197c5;if(_0x2d0485&&_0x537594){const _0x7a0cab=getWorkflowAttemptUrl(_0xd1a18a,_0x2d0485,_0x537594,_0x231d79['id']);_0x1197c5=hyperlink(a51_0x35b3be[_0x2b84bb(0x344)](_0x231d79['id']),_0x7a0cab);}else _0x1197c5=a51_0x35b3be[_0x2b84bb(0x344)](_0x231d79['id']);_0x281ac1[_0x2b84bb(0x307)](_0x2b84bb(0x265)+_0x1197c5+_0x2b84bb(0x241)+_0x546910+_0x2b84bb(0x241)+formatElapsed(_0xec3046[_0x2b84bb(0x2b7)]));if(_0x583b1a[_0x2b84bb(0x252)]>0x0){const _0x2524ac=renderTimeAxis(_0x42b39e,_0x494de9),_0x3afd09=new Date(_0xec3046[_0x2b84bb(0x34e)]),_0x32a16b=formatDate(_0x3afd09),_0x577a2b=TIMELINE_CONFIG[_0x2b84bb(0x251)]+TIMELINE_CONFIG[_0x2b84bb(0x2e8)]+_0x15bc27,_0x4ced41=_0x32a16b['padStart'](_0x577a2b),_0x520664=a51_0x35b3be['dim'](_0x4ced41);_0x281ac1[_0x2b84bb(0x307)](_0x520664+'\x20'+_0x2524ac);for(const _0x1ec083 of _0x583b1a){_0x281ac1[_0x2b84bb(0x307)](renderTaskRow(_0x1ec083,_0x42b39e,_0x494de9,_0x15bc27));}const _0x443e5b=calculateStats(_0x583b1a);_0x281ac1[_0x2b84bb(0x307)](formatStats(_0x443e5b)),_0x4b9961&&_0x281ac1[_0x2b84bb(0x307)](a51_0x35b3be[_0x2b84bb(0x35b)](_0x2b84bb(0x27f)+TIMELINE_CONFIG[_0x2b84bb(0x37a)]+_0x2b84bb(0x290)+_0x55a2b6+_0x2b84bb(0x29e))),_0x281ac1[_0x2b84bb(0x307)](''),_0x281ac1[_0x2b84bb(0x307)](a51_0x35b3be['dim'](_0x2b84bb(0x2fd))+(_0x2b84bb(0x368)+_0x231d79['id']+_0x2b84bb(0x33e))+a51_0x35b3be[_0x2b84bb(0x344)]('\x20to\x20see\x20detailed\x20logs'));}else _0x281ac1[_0x2b84bb(0x307)](_0x2b84bb(0x2ac));return _0x281ac1[_0x2b84bb(0x274)]('\x0a');}['buildTimelineData'](_0x140a28,_0x30774d){const _0x2b74fd=a51_0x198ccf,_0x53b365=new Date(_0x140a28[_0x2b74fd(0x30b)])[_0x2b74fd(0x2c3)](),_0x50fa4f=_0x140a28[_0x2b74fd(0x229)]?new Date(_0x140a28[_0x2b74fd(0x229)])[_0x2b74fd(0x2c3)]():Date[_0x2b74fd(0x257)](),_0x149ffc=_0x50fa4f-_0x53b365,_0x4c0a5e=[];for(const _0x215c9e of _0x30774d){if(_0x215c9e[_0x2b74fd(0x327)]){const _0x27e196=new Date(_0x215c9e[_0x2b74fd(0x327)])[_0x2b74fd(0x2c3)](),_0x16daee=_0x215c9e[_0x2b74fd(0x247)]?new Date(_0x215c9e[_0x2b74fd(0x247)])[_0x2b74fd(0x2c3)]():Date[_0x2b74fd(0x257)]();_0x4c0a5e[_0x2b74fd(0x307)]({'name':_0x215c9e[_0x2b74fd(0x399)],'state':_0x215c9e['state']||_0x2b74fd(0x206),'window':{'start':_0x27e196,'end':_0x16daee,'duration':_0x16daee-_0x27e196}});}else _0x4c0a5e['push']({'name':_0x215c9e[_0x2b74fd(0x399)],'state':_0x215c9e[_0x2b74fd(0x300)]||_0x2b74fd(0x256),'window':undefined});}const _0x297b81=calculateStats(_0x4c0a5e);return{'attempt':{'id':_0x140a28['id'],'status':_0x140a28['done']?_0x140a28[_0x2b74fd(0x245)]?_0x2b74fd(0x245):_0x2b74fd(0x358):_0x2b74fd(0x2db),'createdAt':_0x140a28[_0x2b74fd(0x30b)],'finishedAt':_0x140a28[_0x2b74fd(0x229)],'duration_ms':_0x149ffc},'tasks':_0x4c0a5e[_0x2b74fd(0x316)](_0x1205ba=>({'name':_0x1205ba[_0x2b74fd(0x236)],'state':_0x1205ba[_0x2b74fd(0x300)],'startedAt':_0x1205ba[_0x2b74fd(0x31f)]?new Date(_0x1205ba[_0x2b74fd(0x31f)][_0x2b74fd(0x34e)])[_0x2b74fd(0x219)]():null,'updatedAt':_0x1205ba[_0x2b74fd(0x31f)]?new Date(_0x1205ba[_0x2b74fd(0x31f)][_0x2b74fd(0x330)])[_0x2b74fd(0x219)]():null,'duration_ms':_0x1205ba[_0x2b74fd(0x31f)]?.[_0x2b74fd(0x2b7)]||null})),'stats':_0x297b81};}}
1
+ const a51_0x22a388=a51_0x57ff;(function(_0x75908b,_0x4f2e71){const _0x510860=a51_0x57ff,_0xae360e=_0x75908b();while(!![]){try{const _0x1dd9da=parseInt(_0x510860(0x15e))/0x1+-parseInt(_0x510860(0x1ff))/0x2*(parseInt(_0x510860(0x137))/0x3)+parseInt(_0x510860(0x116))/0x4*(parseInt(_0x510860(0x185))/0x5)+-parseInt(_0x510860(0x19e))/0x6*(parseInt(_0x510860(0xc4))/0x7)+parseInt(_0x510860(0x230))/0x8*(-parseInt(_0x510860(0x16f))/0x9)+parseInt(_0x510860(0x181))/0xa*(parseInt(_0x510860(0x193))/0xb)+parseInt(_0x510860(0xfe))/0xc;if(_0x1dd9da===_0x4f2e71)break;else _0xae360e['push'](_0xae360e['shift']());}catch(_0x3a9057){_0xae360e['push'](_0xae360e['shift']());}}}(a51_0x15a1,0xb2c43));import a51_0x5bf18c from'chalk';import{existsSync}from'fs';import a51_0x108fb0 from'path';import{BaseCommand}from'./command.js';function a51_0x57ff(_0x313d8a,_0x4aa9fb){_0x313d8a=_0x313d8a-0x9a;const _0x15a1bc=a51_0x15a1();let _0x57ffb4=_0x15a1bc[_0x313d8a];return _0x57ffb4;}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 a51_0x4f4bd3 from'prompts';function getAttemptStatusDisplay(_0x36a70b){const _0x490647=a51_0x57ff;if(!_0x36a70b)return{'icon':'⏳','text':''};const {done:_0x2381d8,success:_0x5a91c8,cancelRequested:_0x3f8c7e}=_0x36a70b;if(!_0x2381d8)return _0x3f8c7e?{'icon':'🛑','text':a51_0x5bf18c['yellow'](_0x490647(0x18c))}:{'icon':'🔄','text':a51_0x5bf18c['blue'](_0x490647(0x15b))};if(_0x5a91c8)return{'icon':'✅','text':a51_0x5bf18c[_0x490647(0xf7)](_0x490647(0x179))};return{'icon':'❌','text':a51_0x5bf18c['red'](_0x490647(0xf6))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x22a388(0x202)](_0x24ac75,_0x17e688,_0x1768e9=0x0){return _0x24ac75[_0x1768e9]||_0x17e688['workflowProject'];}['requireProject'](_0x3fd8b4,_0x27de86,_0x228223=0x0){const _0x11a967=a51_0x22a388,_0x21ffd3=this['resolveProject'](_0x3fd8b4,_0x27de86,_0x228223);if(!_0x21ffd3)return console[_0x11a967(0xf6)](a51_0x5bf18c['red']('Error:'),'Project\x20name\x20is\x20required'),console[_0x11a967(0xf6)](a51_0x5bf18c['dim'](_0x11a967(0x10a))),null;return _0x21ffd3;}['parseProjectWorkflowPattern'](_0x136944,_0x640206){const _0x2be523=a51_0x22a388;if(_0x136944[0x0]){const _0x1b3948=_0x136944[0x0][_0x2be523(0x22c)]('.');if(_0x1b3948[_0x2be523(0x221)]===0x1)return{'projectName':_0x1b3948[0x0],'workflowName':undefined};else return _0x1b3948[_0x2be523(0x221)]===0x2?{'projectName':_0x1b3948[0x0],'workflowName':_0x1b3948[0x1]}:(console[_0x2be523(0xf6)](a51_0x5bf18c[_0x2be523(0xf3)](_0x2be523(0x1e0)),_0x2be523(0x13d)),null);}return{'projectName':_0x640206['workflowProject'],'workflowName':undefined};}['resolveProjectDir'](_0x590abb,_0x57a309,_0x273b87=0x0){const _0x339145=a51_0x22a388;if(_0x590abb[_0x273b87])return _0x590abb[_0x273b87];if(_0x57a309[_0x339145(0x1c1)]){const _0x221c83=a51_0x108fb0[_0x339145(0x192)](process[_0x339145(0x166)](),'workflows',_0x57a309['workflowProject']);if(existsSync(a51_0x108fb0[_0x339145(0x192)](_0x221c83,'tdx.json')))return _0x221c83;}return undefined;}async['showWorkflowConsoleUrl'](_0x46bdd0,_0xb5e62c,_0x4ece11){const _0x5f5da6=a51_0x22a388;try{const _0x14224f=await _0x46bdd0[_0x5f5da6(0x121)][_0x5f5da6(0xa7)](_0xb5e62c,{'limit':0x1});if(_0x14224f[_0x5f5da6(0x221)]>0x0){const _0x21089e=_0x14224f[0x0]['id'],_0x5865ad=getWorkflowUrl(_0x4ece11,_0x21089e);console[_0x5f5da6(0xf6)](_0x5f5da6(0xa4)+a51_0x5bf18c[_0x5f5da6(0xbb)](_0x5865ad));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x20d);[a51_0x22a388(0x1b4)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a51_0x22a388(0xd2)](_0x226f97){const _0x567a04=a51_0x22a388,{options:_0xf38846,args:_0x349c8d,tdx:_0x1ba47b}=_0x226f97,_0x1da4d4=_0x349c8d[0x0],_0x102391=_0xf38846['clear'];if(_0x102391)return saveSessionContext({'workflow_project':undefined},_0xf38846['session']),console[_0x567a04(0x204)](a51_0x5bf18c[_0x567a04(0xf7)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x1da4d4)return console[_0x567a04(0xf6)](a51_0x5bf18c[_0x567a04(0xf3)](_0x567a04(0x1e0)),_0x567a04(0x21b)),console['error'](a51_0x5bf18c[_0x567a04(0x1b0)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x567a04(0xf6)](a51_0x5bf18c[_0x567a04(0x1b0)](_0x567a04(0x1e7))),0x1;const _0x1f0879=await withSpinner(_0x567a04(0x1a8)+_0x1da4d4+_0x567a04(0xda),()=>_0x1ba47b[_0x567a04(0x121)][_0x567a04(0x14f)](_0x1da4d4),{'verbose':_0xf38846[_0x567a04(0xde)]}),{name:_0x17c47a}=_0x1f0879[_0x567a04(0x195)];return saveSessionContext({'workflow_project':_0x17c47a},_0xf38846['session']),console[_0x567a04(0x204)](a51_0x5bf18c[_0x567a04(0xf7)](_0x567a04(0x1e5)+a51_0x5bf18c[_0x567a04(0xbb)](_0x17c47a))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a51_0x22a388(0x147);[a51_0x22a388(0x1b4)]='List\x20all\x20workflow\x20projects';async['execute'](_0x5b25ab){const _0x1e683d=a51_0x22a388,{options:_0x45c5cc,args:_0x6e759f,tdx:_0x4e61a4}=_0x5b25ab,_0x4b686c=_0x6e759f[0x0];_0x45c5cc[_0x1e683d(0xde)]&&_0x4b686c&&console['error'](_0x1e683d(0x18d)+_0x4b686c);const _0x2bd287=await withSpinner(_0x1e683d(0x129),()=>_0x4e61a4['workflow'][_0x1e683d(0x126)](_0x4b686c,{'limit':_0x45c5cc[_0x1e683d(0xa9)]}),{'verbose':_0x45c5cc[_0x1e683d(0xde)]});let _0x4688ca=_0x2bd287[_0x1e683d(0x195)];_0x4688ca['sort']((_0x917c6b,_0x110f93)=>_0x917c6b['name'][_0x1e683d(0xa1)](_0x110f93[_0x1e683d(0x174)]));const _0x8d30fa=_0x45c5cc[_0x1e683d(0xa9)]||0x64,_0x376b5a=_0x4688ca[_0x1e683d(0x221)]>=_0x8d30fa?a51_0x5bf18c[_0x1e683d(0x1b0)](_0x1e683d(0x22a)):'';console[_0x1e683d(0xf6)]('✔\x20Found\x20'+_0x4688ca['length']+'\x20project'+(_0x4688ca[_0x1e683d(0x221)]!==0x1?'s':'')+_0x376b5a);if(_0x45c5cc[_0x1e683d(0x1d7)]===_0x1e683d(0x176)||_0x45c5cc[_0x1e683d(0x1d7)]==='jsonl'||_0x45c5cc['format']===_0x1e683d(0xd8))await handleSDKOutput(_0x4688ca,_0x45c5cc);else{if(_0x4688ca['length']===0x0)_0x4b686c?console[_0x1e683d(0x204)](_0x1e683d(0x17c)+_0x4b686c):console[_0x1e683d(0x204)](_0x1e683d(0x14c));else{const _0x2db132=_0x4688ca['map'](_0x5a5ed2=>{const _0x2bb51c=_0x1e683d,_0x585226=_0x5a5ed2[_0x2bb51c(0x24e)]?.[_0x2bb51c(0x11a)](_0x1a8afc=>_0x1a8afc[_0x2bb51c(0x1b2)]===_0x2bb51c(0x1c3)),_0x19e60f=_0x585226?a51_0x5bf18c['dim'](_0x2bb51c(0x1bc)):'';return _0x2bb51c(0x102)+_0x5a5ed2[_0x2bb51c(0x174)]+_0x19e60f;});await writeOutput(_0x2db132[_0x1e683d(0x192)]('\x0a'),_0x45c5cc['output'],_0x1e683d(0x19f));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a51_0x22a388(0x1a6);[a51_0x22a388(0x1b4)]='List\x20workflows';async[a51_0x22a388(0xd2)](_0x10a832){const _0x3378f6=a51_0x22a388,{options:_0x2910f9,args:_0x330238,tdx:_0x2fc716}=_0x10a832,_0x53a58c=this['resolveProject'](_0x330238,_0x2910f9);_0x2910f9[_0x3378f6(0xde)]&&_0x53a58c&&console[_0x3378f6(0xf6)]('Project\x20filter:\x20'+_0x53a58c);const _0x5f2776=await withSpinner('Listing\x20workflows...',()=>_0x2fc716[_0x3378f6(0x121)][_0x3378f6(0xa7)](_0x53a58c,{'limit':_0x2910f9[_0x3378f6(0xa9)]}),{'verbose':_0x2910f9[_0x3378f6(0xde)]});let _0x4b72d3=_0x5f2776[_0x3378f6(0x195)];_0x4b72d3[_0x3378f6(0x248)]((_0x3aea9c,_0x3b5aee)=>{const _0x463fa4=_0x3378f6,_0x168108=_0x3aea9c[_0x463fa4(0x174)][_0x463fa4(0xa1)](_0x3b5aee[_0x463fa4(0x174)]);if(_0x168108!==0x0)return _0x168108;return(_0x3aea9c['project']?.[_0x463fa4(0x174)]||'')[_0x463fa4(0xa1)](_0x3b5aee[_0x463fa4(0x1fe)]?.[_0x463fa4(0x174)]||'');});const _0x2f7199=_0x2910f9['limit']||0x64,_0x3c3822=_0x4b72d3[_0x3378f6(0x221)]>=_0x2f7199?a51_0x5bf18c[_0x3378f6(0x1b0)](_0x3378f6(0x22a)):'';console[_0x3378f6(0xf6)](_0x3378f6(0x17a)+_0x4b72d3['length']+'\x20workflow'+(_0x4b72d3['length']!==0x1?'s':'')+_0x3c3822);if(_0x2910f9[_0x3378f6(0x1d7)]==='json'||_0x2910f9['format']==='jsonl'||_0x2910f9[_0x3378f6(0x1d7)]===_0x3378f6(0xd8))await handleSDKOutput(_0x4b72d3,_0x2910f9);else{if(_0x4b72d3[_0x3378f6(0x221)]===0x0)_0x53a58c?console['log'](_0x3378f6(0x122)+_0x53a58c):console[_0x3378f6(0x204)]('No\x20workflows\x20found');else{const _0x13ccf4=_0x2910f9[_0x3378f6(0x1e3)],_0x2109b4=_0x4b72d3[_0x3378f6(0x1de)](_0x3c3668=>{const _0x57915e=_0x3378f6,_0x196327=a51_0x5bf18c['dim']('#'+_0x3c3668['id']),_0x26e025=hyperlink(_0x196327,getWorkflowUrl(_0x13ccf4,_0x3c3668['id'])),_0xc6b819=_0x3c3668[_0x57915e(0x1fe)]?.[_0x57915e(0x174)]?a51_0x5bf18c[_0x57915e(0x1b0)]('\x20('+_0x3c3668['project']['name']+')'):'';return _0x57915e(0x13c)+_0x26e025+'\x20'+_0x3c3668[_0x57915e(0x174)]+_0xc6b819;});await writeOutput(_0x2109b4[_0x3378f6(0x192)]('\x0a'),_0x2910f9[_0x3378f6(0x1fd)],_0x3378f6(0x19f));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0xa6);[a51_0x22a388(0x1b4)]='List\x20workflow\x20execution\x20sessions';async['execute'](_0x3c7144){const _0x49c80e=a51_0x22a388,{options:_0x3b3da4,args:_0x4f6e13,tdx:_0x1a70ed}=_0x3c7144,_0x2301c1=this[_0x49c80e(0x227)](_0x4f6e13,_0x3b3da4);if(!_0x2301c1)return 0x1;const {projectName:_0x3f24cb,workflowName:_0x45ee48}=_0x2301c1;if(_0x3b3da4['verbose']){if(_0x3f24cb&&_0x45ee48)console['error']('Filter:\x20'+_0x3f24cb+'.'+_0x45ee48);else _0x3f24cb&&console[_0x49c80e(0xf6)]('Filter:\x20project='+_0x3f24cb);const _0x3858f2=_0x3b3da4[_0x49c80e(0x196)];_0x3858f2&&console[_0x49c80e(0xf6)](_0x49c80e(0x22d)+_0x3858f2);}let _0x499bad=0x28;if(process[_0x49c80e(0x20b)]['isTTY']&&!_0x3b3da4[_0x49c80e(0x1fd)]&&!_0x3b3da4[_0x49c80e(0x1d7)]){const _0x29ee0f=process[_0x49c80e(0x20b)]['rows']||0x28;_0x499bad=Math[_0x49c80e(0x170)](0x14,Math[_0x49c80e(0xdd)](_0x29ee0f*0x2/0x3));}const _0x1235c1=_0x3b3da4[_0x49c80e(0xa9)]||_0x499bad,_0x290083=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x1a70ed[_0x49c80e(0x121)]['sessions']({'projectName':_0x3f24cb,'workflowName':_0x45ee48,'status':_0x3b3da4[_0x49c80e(0x196)],'fromTime':_0x3b3da4[_0x49c80e(0x111)],'toTime':_0x3b3da4['to'],'limit':_0x1235c1}),{'verbose':_0x3b3da4['verbose']}),_0x467f6a=_0x290083[_0x49c80e(0x195)];_0x467f6a[_0x49c80e(0x248)]((_0x4d7a18,_0x2615fc)=>{const _0x20fcd4=_0x49c80e,_0xa38de3=_0x4d7a18[_0x20fcd4(0x16a)]||'',_0xff59f9=_0x2615fc[_0x20fcd4(0x16a)]||'';return _0xff59f9[_0x20fcd4(0xa1)](_0xa38de3);});_0x467f6a[_0x49c80e(0x221)]>=_0x1235c1?console['error']('✔\x20Showing\x20'+_0x467f6a[_0x49c80e(0x221)]+_0x49c80e(0x1df)+a51_0x5bf18c[_0x49c80e(0x1b0)](_0x49c80e(0x1b1))):console['error'](_0x49c80e(0x17a)+_0x467f6a[_0x49c80e(0x221)]+_0x49c80e(0x165)+(_0x467f6a['length']!==0x1?'s':''));if(_0x3b3da4['format']===_0x49c80e(0x176)||_0x3b3da4[_0x49c80e(0x1d7)]===_0x49c80e(0x201)||_0x3b3da4['format']===_0x49c80e(0xd8))await handleSDKOutput(_0x467f6a,_0x3b3da4);else{if(!process['stdout']['isTTY']||_0x3b3da4[_0x49c80e(0x1fd)]){if(_0x467f6a[_0x49c80e(0x221)]===0x0){if(_0x3f24cb&&_0x45ee48)console[_0x49c80e(0x204)](_0x49c80e(0x177)+_0x3f24cb+'.'+_0x45ee48);else _0x3f24cb?console[_0x49c80e(0x204)](_0x49c80e(0x19d)+_0x3f24cb):console[_0x49c80e(0x204)](_0x49c80e(0x188));}else{const _0x3ea174=_0x3b3da4[_0x49c80e(0x1e3)],_0x5245b5=this[_0x49c80e(0xad)](_0x467f6a,_0x3ea174);_0x3b3da4[_0x49c80e(0x1fd)]?await writeOutput(_0x5245b5,_0x3b3da4[_0x49c80e(0x1fd)],_0x49c80e(0x19f)):console[_0x49c80e(0x204)](_0x5245b5);}!_0x3f24cb&&(console[_0x49c80e(0xf6)](''),console[_0x49c80e(0xf6)](a51_0x5bf18c['dim'](_0x49c80e(0x9d))),console[_0x49c80e(0xf6)](a51_0x5bf18c[_0x49c80e(0x1b0)](_0x49c80e(0x104))+'or'+a51_0x5bf18c[_0x49c80e(0x1b0)](_0x49c80e(0x229))));}else{if(_0x467f6a[_0x49c80e(0x221)]===0x0){if(_0x3f24cb&&_0x45ee48)console[_0x49c80e(0x204)](_0x49c80e(0x177)+_0x3f24cb+'.'+_0x45ee48);else _0x3f24cb?console[_0x49c80e(0x204)](_0x49c80e(0x19d)+_0x3f24cb):console[_0x49c80e(0x204)](_0x49c80e(0x188));}else await this['navigateSessionsInteractive'](_0x467f6a,_0x3c7144,_0x3f24cb);}}return 0x0;}[a51_0x22a388(0xad)](_0x229df5,_0x52968b){const _0x4ec16b=a51_0x22a388,_0x2eb8a1=[],_0x2be67f=new Map();let _0x9749ba=Infinity,_0x138cc8=-Infinity;for(const _0x1dad8f of _0x229df5){if(_0x1dad8f[_0x4ec16b(0x225)]?.[_0x4ec16b(0x151)]){const _0x3ca8cc=new Date(_0x1dad8f[_0x4ec16b(0x225)][_0x4ec16b(0x151)])[_0x4ec16b(0x1dc)](),_0x4202b9=_0x1dad8f[_0x4ec16b(0x225)]['finishedAt']?new Date(_0x1dad8f[_0x4ec16b(0x225)]['finishedAt'])[_0x4ec16b(0x1dc)]():Date[_0x4ec16b(0x23d)](),_0x76fdb3=_0x1dad8f[_0x4ec16b(0x1fe)]?.[_0x4ec16b(0x174)]||_0x4ec16b(0x22e);!_0x2be67f['has'](_0x76fdb3)&&_0x2be67f[_0x4ec16b(0x9a)](_0x76fdb3,[]),_0x2be67f[_0x4ec16b(0x17f)](_0x76fdb3)[_0x4ec16b(0x11e)]({'session':_0x1dad8f,'startTime':_0x3ca8cc,'endTime':_0x4202b9,'duration':_0x4202b9-_0x3ca8cc}),_0x9749ba=Math[_0x4ec16b(0x13a)](_0x9749ba,_0x3ca8cc),_0x138cc8=Math[_0x4ec16b(0x170)](_0x138cc8,_0x4202b9);}}if(_0x2be67f[_0x4ec16b(0x200)]===0x0)return _0x4ec16b(0x158);const _0x15d624=process[_0x4ec16b(0x20b)][_0x4ec16b(0x1e8)]||0x78,_0x537347=0x1e,_0x5dd3ee=0x32,_0xf58b3e=0x4,_0x20e46e=Math['min'](_0x5dd3ee,Math['max'](_0x537347,Math['floor'](_0x15d624*0.3))),_0x47e3ac=_0x15d624-_0x20e46e-TIMELINE_CONFIG[_0x4ec16b(0x220)]-0x3-_0xf58b3e,_0x3fd18f=_0x138cc8-_0x9749ba,_0x259096=_0x3fd18f/_0x20e46e,_0x10feb2=renderTimeAxis({'startTime':_0x9749ba,'endTime':_0x138cc8,'durationMs':_0x3fd18f,'msPerChar':_0x259096},_0x20e46e),_0x8b9f55=[];for(const _0x41d84a of _0x2be67f[_0x4ec16b(0x1d1)]()){_0x8b9f55['push'](..._0x41d84a);}_0x8b9f55[_0x4ec16b(0x248)]((_0x474e84,_0x538a67)=>_0x538a67[_0x4ec16b(0x240)]-_0x474e84[_0x4ec16b(0x240)]);const _0x5de4b5=new Date(_0x9749ba),_0x937d29=formatDate(_0x5de4b5),_0x597698=_0xf58b3e+TIMELINE_CONFIG[_0x4ec16b(0x1ae)]+TIMELINE_CONFIG['ICON_SPACING']+_0x47e3ac,_0xe29f27='\x20'['repeat'](_0x597698-_0x937d29['length']),_0x20065c=_0xe29f27+a51_0x5bf18c['dim'](_0x937d29)+'\x20'+_0x10feb2;_0x2eb8a1[_0x4ec16b(0x11e)](_0x20065c);const _0x3de083=0x16;let _0x433b5f=0x0;for(const _0x52044f of _0x8b9f55){const _0x139925=_0x52044f['session'][_0x4ec16b(0x1fe)]?.[_0x4ec16b(0x174)]||'?',_0x3d3b0e=Math[_0x4ec16b(0x13a)](stringWidth(_0x139925),_0x3de083);_0x433b5f=Math[_0x4ec16b(0x170)](_0x433b5f,_0x3d3b0e);}for(const _0x2473d0 of _0x8b9f55){const {session:_0x448cb7,startTime:_0x7f78ea,endTime:_0x2d5f10,duration:_0x89bf09}=_0x2473d0,_0x3d1f64=_0x448cb7[_0x4ec16b(0x1fe)]?.['id'],_0x44f96f=_0x448cb7['id'],_0x14f1bc=_0x448cb7[_0x4ec16b(0x1fe)]?.['name']||'?',_0x46b834=_0x448cb7[_0x4ec16b(0x121)]?.['name']||'?';let _0x1768b2,_0x114a89;if(_0x448cb7[_0x4ec16b(0x225)]){const _0x56742b=_0x448cb7[_0x4ec16b(0x225)];!_0x56742b[_0x4ec16b(0xe1)]?(_0x1768b2=_0x56742b[_0x4ec16b(0x1d4)]?'🛑':'🔄',_0x114a89=_0x56742b['cancelRequested']?a51_0x5bf18c[_0x4ec16b(0xfc)]:a51_0x5bf18c[_0x4ec16b(0x1ed)]):(_0x1768b2=_0x56742b['success']?'✅':'❌',_0x114a89=_0x56742b[_0x4ec16b(0x179)]?a51_0x5bf18c[_0x4ec16b(0xf7)]:a51_0x5bf18c[_0x4ec16b(0xf3)]);}else _0x1768b2='⏳',_0x114a89=a51_0x5bf18c[_0x4ec16b(0x1b0)];const _0x35c99a='#'+_0x44f96f,_0xa9cba1=_0x3d1f64?hyperlink(_0x35c99a,getWorkflowSessionUrl(_0x52968b,_0x3d1f64,_0x44f96f)):_0x35c99a;let _0x1fd997=_0x14f1bc;stringWidth(_0x14f1bc)>_0x3de083&&(_0x1fd997=_0x14f1bc[_0x4ec16b(0xe9)](0x0,_0x3de083-0x1)+'…');const _0x4dc9a8=a51_0x5bf18c[_0x4ec16b(0x1b0)](_0x1fd997),_0x4e1dd3=stringWidth(_0x1fd997),_0x191655='\x20'['repeat'](_0x433b5f-stringWidth(_0x1fd997)+0x2),_0x59926d='('+formatElapsed(_0x89bf09)+')',_0x262cfe=stringWidth(_0x59926d),_0xa3231f=stringWidth(_0x35c99a),_0x7109a5=_0xa3231f+0x1+_0x4e1dd3+_0x191655[_0x4ec16b(0x221)],_0x2c7970=_0x47e3ac-_0x7109a5-_0x262cfe-0x1-0x8;let _0x21c14a=_0x46b834;stringWidth(_0x21c14a)>_0x2c7970&&(_0x21c14a=_0x21c14a[_0x4ec16b(0xe9)](0x0,_0x2c7970-0x1)+'…');const _0x2381d9=_0xa9cba1+'\x20'+_0x4dc9a8+_0x191655+_0x21c14a,_0x3d2da6=stringWidth(_0x2381d9),_0x48ba72=_0x47e3ac-_0x3d2da6-_0x262cfe,_0x228462=_0x2381d9+'\x20'[_0x4ec16b(0x245)](Math['max'](0x1,_0x48ba72))+a51_0x5bf18c['dim'](_0x59926d),_0x24c29d=Math['floor']((_0x7f78ea-_0x9749ba)/_0x259096),_0x18afb7=Math[_0x4ec16b(0xdd)]((_0x2d5f10-_0x9749ba)/_0x259096),_0x24dd63=Math['max'](_0x24c29d+0x1,_0x18afb7),_0x3fe6ec=new Array(_0x20e46e)[_0x4ec16b(0x113)]('\x20');for(let _0x2e5e06=_0x24c29d;_0x2e5e06<Math['min'](_0x24dd63,_0x20e46e);_0x2e5e06++){_0x3fe6ec[_0x2e5e06]='─';}const _0x543fa8=_0x3fe6ec[_0x4ec16b(0x1de)](_0x4de6e3=>_0x4de6e3==='\x20'?'\x20':_0x114a89(_0x4de6e3))[_0x4ec16b(0x192)]('');_0x2eb8a1[_0x4ec16b(0x11e)](_0x1768b2+'\x20'+_0x228462+'│'+_0x543fa8+'│');}return _0x2eb8a1[_0x4ec16b(0x192)]('\x0a');}async[a51_0x22a388(0x241)](_0x3c74e5,_0x3d69df,_0x185e5f){const _0x4f93e2=a51_0x22a388,{options:_0x3456a1,tdx:_0x38e950}=_0x3d69df,_0x3300ad=_0x3456a1['site'],{timelineRows:_0x366dd7,timeAxisHeader:_0x3a62d7}=this['generateSessionTimelineRows'](_0x3c74e5,_0x3300ad),_0x111350=_0x366dd7[_0x4f93e2(0x183)](_0x41417b=>_0x41417b['attemptId']);if(_0x111350[_0x4f93e2(0x221)]===0x0){const _0x5d0d5e=this['renderSessionsTimeline'](_0x3c74e5,_0x3300ad);console[_0x4f93e2(0x204)](_0x5d0d5e);!_0x185e5f&&(console[_0x4f93e2(0xf6)](''),console[_0x4f93e2(0xf6)](a51_0x5bf18c[_0x4f93e2(0x1b0)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a51_0x5bf18c[_0x4f93e2(0x1b0)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x4f93e2(0x229))));return;}_0x3a62d7&&console[_0x4f93e2(0x204)](_0x3a62d7);const _0x2439c9=_0x366dd7['filter'](_0xb911bf=>_0xb911bf['attemptId'])['map'](_0x3c8d27=>({'title':_0x3c8d27[_0x4f93e2(0x231)],'value':_0x3c8d27[_0x4f93e2(0x173)]})),_0xa5005b=process[_0x4f93e2(0x20b)]['rows']||0x3c,_0x185de9=Math[_0x4f93e2(0x170)](0x28,Math[_0x4f93e2(0xdd)](_0xa5005b*0x2/0x3)),_0x503c90=await a51_0x4f4bd3({'type':_0x4f93e2(0x1b5),'name':_0x4f93e2(0x173),'message':_0x4f93e2(0xec),'choices':_0x2439c9,'initial':-0x1,'limit':_0x185de9,'clearFirst':!![],'fallback':{'title':_0x4f93e2(0xf1),'value':null},'suggest':(_0x1639bb,_0x1cb561)=>{const _0x510388=_0x4f93e2;if(!_0x1639bb)return Promise['resolve'](_0x1cb561);const _0x5cd9f3=_0x1cb561[_0x510388(0x183)](_0x43e407=>{const _0x235d15=_0x510388,_0x3d4a7d=_0x43e407;return _0x3d4a7d['title'][_0x235d15(0x14b)]()['includes'](_0x1639bb[_0x235d15(0x14b)]());});return Promise[_0x510388(0x154)](_0x5cd9f3);}}),_0x1843b7=()=>{const _0x1e9724=_0x4f93e2;process[_0x1e9724(0x20b)][_0x1e9724(0xbc)](_0x1e9724(0x1f1)),process[_0x1e9724(0x20b)][_0x1e9724(0xbc)](_0x1e9724(0x1f1)),process[_0x1e9724(0x20b)][_0x1e9724(0xbc)]('\x1b[1A\x1b[2K');},_0x5aa09d=_0x503c90&&_0x503c90[_0x4f93e2(0x173)]&&_0x503c90[_0x4f93e2(0x173)]!==null&&_0x503c90[_0x4f93e2(0x173)][_0x4f93e2(0xf4)]()!=='';if(!_0x5aa09d){_0x1843b7(),console['log'](a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x4f93e2(0x1cb)));return;}_0x1843b7();const _0x257f1c=_0x3c74e5[_0x4f93e2(0x20e)](_0x1feca3=>_0x1feca3[_0x4f93e2(0x225)]?.['id']===_0x503c90['attemptId']);if(_0x257f1c){const _0x22959d=_0x257f1c[_0x4f93e2(0x1fe)]?.[_0x4f93e2(0x174)]||'?',_0x13666c=_0x257f1c[_0x4f93e2(0x121)]?.['name']||'?';console['log'](_0x4f93e2(0xba)+a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x22959d)+_0x4f93e2(0x15c)+a51_0x5bf18c[_0x4f93e2(0x1b0)](_0x13666c));}const _0x34db10=new WorkflowTimelineCommand();await _0x34db10[_0x4f93e2(0xd2)]({'args':[],'options':{..._0x3456a1,'attemptId':_0x503c90[_0x4f93e2(0x173)]},'tdx':_0x38e950});}['generateSessionTimelineRows'](_0xeb1370,_0x2f648d){const _0x19d985=a51_0x22a388,_0x52b80b=new Map();for(const _0x5d25a2 of _0xeb1370){_0x5d25a2['id']&&_0x5d25a2[_0x19d985(0x225)]?.['id']&&_0x52b80b['set'](_0x5d25a2['id'],_0x5d25a2[_0x19d985(0x225)]['id']);}const _0x33e3c0=[];let _0x3e713d='';const _0x48b4e2=this['renderSessionsTimeline'](_0xeb1370,_0x2f648d),_0x13cea5=_0x48b4e2[_0x19d985(0x22c)]('\x0a');for(const _0x3cf390 of _0x13cea5){if(_0x3cf390[_0x19d985(0xb5)](_0x19d985(0x23c))||_0x3cf390[_0x19d985(0x239)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3e713d=_0x3cf390;else{if(_0x3cf390[_0x19d985(0x239)](/^[✅❌🔄🛑⏳]/)){const _0x1956da=_0x3cf390[_0x19d985(0x239)](/#(\d+)/),_0x2e5eb5=_0x1956da?_0x1956da[0x1]:null,_0x29decc=_0x2e5eb5?_0x52b80b['get'](_0x2e5eb5)||null:null,_0x42ccf1=_0xeb1370[_0x19d985(0x20e)](_0x126381=>_0x126381['id']===_0x2e5eb5),_0x4137d4=_0x42ccf1?.[_0x19d985(0x1fe)]?.[_0x19d985(0x174)]||'';_0x33e3c0[_0x19d985(0x11e)]({'displayLine':_0x3cf390,'attemptId':_0x29decc,'projectName':_0x4137d4});}}}return{'timelineRows':_0x33e3c0,'timeAxisHeader':_0x3e713d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x1c7);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x228);async[a51_0x22a388(0xd2)](_0x53799c){const _0x29a342=a51_0x22a388,{options:_0x3481fb,args:_0x3e5d36,tdx:_0x40ee2f}=_0x53799c,_0x82ea0c=this[_0x29a342(0x227)](_0x3e5d36,_0x3481fb);if(!_0x82ea0c)return 0x1;const {projectName:_0x537b6e,workflowName:_0x6d281b}=_0x82ea0c,_0x27f90a=_0x3481fb[_0x29a342(0xcf)];if(_0x3481fb[_0x29a342(0xde)]){if(_0x537b6e&&_0x6d281b)console[_0x29a342(0xf6)](_0x29a342(0x140)+_0x537b6e+'.'+_0x6d281b);else _0x537b6e&&console[_0x29a342(0xf6)](_0x29a342(0x123)+_0x537b6e);_0x27f90a&&console[_0x29a342(0xf6)](_0x29a342(0xd3));}const _0x15ae3d=await withSpinner(_0x29a342(0x13e),()=>_0x40ee2f[_0x29a342(0x121)][_0x29a342(0x103)]({'projectName':_0x537b6e,'workflowName':_0x6d281b,'includeRetried':_0x27f90a,'limit':_0x3481fb[_0x29a342(0xa9)]}),{'verbose':_0x3481fb['verbose']}),_0x241427=_0x15ae3d[_0x29a342(0x195)],_0xf6f20e=_0x3481fb[_0x29a342(0xa9)]||0x64,_0x47ab46=_0x241427[_0x29a342(0x221)]>=_0xf6f20e?a51_0x5bf18c[_0x29a342(0x1b0)](_0x29a342(0x22a)):'';console[_0x29a342(0xf6)]('✔\x20Found\x20'+_0x241427['length']+'\x20attempt'+(_0x241427[_0x29a342(0x221)]!==0x1?'s':'')+_0x47ab46);if(_0x3481fb['format']===_0x29a342(0x176)||_0x3481fb[_0x29a342(0x1d7)]===_0x29a342(0x201)||_0x3481fb[_0x29a342(0x1d7)]===_0x29a342(0xd8))await handleSDKOutput(_0x241427,_0x3481fb);else{if(_0x241427[_0x29a342(0x221)]===0x0){if(_0x537b6e&&_0x6d281b)console[_0x29a342(0x204)](_0x29a342(0x138)+_0x537b6e+'.'+_0x6d281b);else _0x537b6e?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x537b6e):console[_0x29a342(0x204)](_0x29a342(0x142));}else{const _0x3be5ae=_0x3481fb[_0x29a342(0x1e3)],_0x3b3173=_0x241427[_0x29a342(0x1de)](_0xc3e028=>{const _0x5b865b=_0x29a342,_0x4379cc=a51_0x5bf18c[_0x5b865b(0x1b0)]('#'+_0xc3e028['id']),_0x25a21a=_0xc3e028[_0x5b865b(0x1fe)]?.['id'],_0x5a9cff=_0xc3e028[_0x5b865b(0x131)]||_0xc3e028[_0x5b865b(0x214)],_0x22a284=_0x25a21a&&_0x5a9cff?hyperlink(_0x4379cc,getWorkflowAttemptUrl(_0x3be5ae,_0x25a21a,_0x5a9cff,_0xc3e028['id'])):_0x4379cc,{icon:_0x16655a,text:_0x3288f4}=getAttemptStatusDisplay(_0xc3e028),_0x4f26e7=(_0xc3e028[_0x5b865b(0x1fe)]?.[_0x5b865b(0x174)]||'?')+'.'+(_0xc3e028[_0x5b865b(0x121)]?.[_0x5b865b(0x174)]||'?'),_0x3e02e0=_0xc3e028['sessionTime']?a51_0x5bf18c[_0x5b865b(0x1b0)](_0xc3e028[_0x5b865b(0x16a)]):'';return(_0x22a284+'\x20'+_0x16655a+(_0x3288f4?'\x20'+_0x3288f4:'')+'\x20'+_0x4f26e7+'\x20'+_0x3e02e0)[_0x5b865b(0x101)]();});await writeOutput(_0x3b3173[_0x29a342(0x192)]('\x0a'),_0x3481fb['output'],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a51_0x22a388(0x1b4)]=a51_0x22a388(0x22f);async[a51_0x22a388(0xd2)](_0x4824a6){const _0x239b40=a51_0x22a388,{options:_0x44c040,args:_0x569136,tdx:_0x266b9d}=_0x4824a6,_0x3a5da1=_0x569136[0x0];if(!_0x3a5da1)return console[_0x239b40(0xf6)](_0x239b40(0x20c)),0x1;_0x44c040['verbose']&&console[_0x239b40(0xf6)]('Attempt\x20ID:\x20'+_0x3a5da1);const _0x2fe496=await withSpinner(_0x239b40(0x19c),()=>_0x266b9d[_0x239b40(0x121)][_0x239b40(0xfa)](_0x3a5da1),{'verbose':_0x44c040['verbose']}),_0x5f206c=_0x2fe496[_0x239b40(0x195)];let _0x32ee6e;!_0x5f206c['done']?_0x32ee6e=_0x5f206c[_0x239b40(0x1d4)]?_0x239b40(0x18c):_0x239b40(0x15b):_0x32ee6e=_0x5f206c[_0x239b40(0x179)]?_0x239b40(0x179):'error';let _0x156f81;if(_0x5f206c['createdAt']&&_0x5f206c[_0x239b40(0x1d3)]){const _0x3ee70e=new Date(_0x5f206c[_0x239b40(0x151)])[_0x239b40(0x1dc)](),_0x3c74a3=new Date(_0x5f206c['finishedAt'])[_0x239b40(0x1dc)]();_0x156f81=Math[_0x239b40(0x12d)]((_0x3c74a3-_0x3ee70e)/0x3e8);}const _0xf1a3df={'attempt_id':_0x5f206c['id'],'status':_0x32ee6e,..._0x5f206c[_0x239b40(0x1e4)]!==undefined&&{'index':_0x5f206c[_0x239b40(0x1e4)]},..._0x5f206c['project']&&{'project':_0x5f206c[_0x239b40(0x1fe)][_0x239b40(0x174)]},..._0x5f206c['workflow']&&{'workflow':_0x5f206c[_0x239b40(0x121)][_0x239b40(0x174)]},..._0x5f206c[_0x239b40(0x214)]&&{'session_id':_0x5f206c[_0x239b40(0x214)]},..._0x5f206c['sessionTime']&&{'session_time':_0x5f206c[_0x239b40(0x16a)]},..._0x5f206c[_0x239b40(0x21c)]&&{'retry_attempt':_0x5f206c['retryAttemptName']},..._0x156f81!==undefined&&{'duration_sec':_0x156f81},..._0x5f206c['createdAt']&&{'created_at':_0x5f206c[_0x239b40(0x151)]},..._0x5f206c[_0x239b40(0x1d3)]&&{'finished_at':_0x5f206c[_0x239b40(0x1d3)]},...Object[_0x239b40(0x244)](_0x5f206c[_0x239b40(0xb8)])[_0x239b40(0x221)]>0x0&&{'params':_0x5f206c[_0x239b40(0xb8)]}};return await handleSingleObjectOutput(_0xf1a3df,_0x44c040),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x22a388(0x174)]='workflow:tasks';['description']=a51_0x22a388(0xbd);async['execute'](_0x414455){const _0x364dcc=a51_0x22a388,{options:_0x3079a5,args:_0x5e3b07,tdx:_0x27e550}=_0x414455,_0x8bae87=_0x5e3b07[0x0];if(!_0x8bae87)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x52d603=_0x3079a5['includeSubtasks'];_0x3079a5[_0x364dcc(0xde)]&&(console[_0x364dcc(0xf6)](_0x364dcc(0x1ec)+_0x8bae87),_0x52d603&&console[_0x364dcc(0xf6)]('Including\x20subtasks:\x20yes'));const _0x28073b=await withSpinner(_0x364dcc(0x106),()=>_0x27e550[_0x364dcc(0x121)]['tasks'](_0x8bae87,_0x52d603||![]),{'verbose':_0x3079a5[_0x364dcc(0xde)]}),_0x17bbd7=_0x28073b[_0x364dcc(0x195)];return console['error'](_0x364dcc(0x17a)+_0x17bbd7[_0x364dcc(0x221)]+_0x364dcc(0xb7)+(_0x17bbd7['length']!==0x1?'s':'')),await handleSDKOutput(_0x17bbd7,_0x3079a5),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x1f2);[a51_0x22a388(0x1b4)]=a51_0x22a388(0xce);async[a51_0x22a388(0xd2)](_0x989bf6){const _0x226a9d=a51_0x22a388,{options:_0x443793,args:_0x4990c4,tdx:_0x4fd3a7}=_0x989bf6,_0x29d231=_0x4990c4[0x0];let _0xd40c28=_0x4990c4[0x1];if(!_0x29d231)return console['error'](_0x226a9d(0x20c)),0x1;_0x443793['verbose']&&(console[_0x226a9d(0xf6)]('Attempt\x20ID:\x20'+_0x29d231),_0xd40c28&&console[_0x226a9d(0xf6)](_0x226a9d(0x1c6)+_0xd40c28));const _0x262e93=await withSpinner(_0x226a9d(0x15a),()=>_0x4fd3a7[_0x226a9d(0x121)][_0x226a9d(0xaf)](_0x29d231,_0xd40c28),{'verbose':_0x443793[_0x226a9d(0xde)]}),_0x3cee2b=_0x262e93[_0x226a9d(0x195)];if(_0x3cee2b[_0x226a9d(0x221)]===0x0)return console['error'](_0x226a9d(0x12c)),0x0;if(!_0xd40c28&&(_0x443793[_0x226a9d(0x176)]||_0x443793[_0x226a9d(0x1d7)]))return await handleSDKOutput(_0x3cee2b,_0x443793),0x0;if(!_0xd40c28){const _0x16b476=_0x3cee2b[_0x226a9d(0x1de)](_0x550546=>({'title':_0x550546[_0x226a9d(0x146)]+'\x20('+formatBytes(_0x550546[_0x226a9d(0x1ce)])+')','value':_0x550546[_0x226a9d(0x146)]})),_0xbcb466=await a51_0x4f4bd3({'type':_0x226a9d(0xff),'name':_0x226a9d(0x1f4),'message':_0x226a9d(0x152),'choices':_0x16b476});if(!_0xbcb466['task'])return console[_0x226a9d(0xf6)](_0x226a9d(0x1cb)),0x0;_0xd40c28=_0xbcb466[_0x226a9d(0x1f4)];}const _0x1b4b70=await withSpinner('Downloading\x20logs...',()=>_0x4fd3a7[_0x226a9d(0x121)][_0x226a9d(0x1bd)](_0x29d231,_0xd40c28),{'verbose':_0x443793['verbose']}),_0x29d7b7=_0x1b4b70[_0x226a9d(0x195)];return _0x29d7b7?console[_0x226a9d(0x204)](_0x29d7b7):console['error']('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x1ad);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x24c);async[a51_0x22a388(0xd2)](_0x53ee6a){const _0x2c64b5=a51_0x22a388,{options:_0x5af752,args:_0x40db3a,tdx:_0x1297b0}=_0x53ee6a,_0x5b931b=_0x40db3a[0x0];if(!_0x5b931b)return console[_0x2c64b5(0xf6)](_0x2c64b5(0x20c)),0x1;const _0x28969d=_0x5af752[_0x2c64b5(0x23e)];_0x5af752[_0x2c64b5(0xde)]&&(console[_0x2c64b5(0xf6)](_0x2c64b5(0x1ec)+_0x5b931b),_0x28969d&&console[_0x2c64b5(0xf6)]('Reason:\x20'+_0x28969d));if(!_0x5af752[_0x2c64b5(0x117)]){if(!isInteractive())return console[_0x2c64b5(0xf6)](a51_0x5bf18c[_0x2c64b5(0xf3)]('\x0aError:'),_0x2c64b5(0x23f)),console[_0x2c64b5(0xf6)](a51_0x5bf18c[_0x2c64b5(0x1b0)](_0x2c64b5(0x119))),0x1;const _0x4ba5db=await confirmKey(_0x2c64b5(0x175)+_0x5b931b+'?');if(!_0x4ba5db)return console[_0x2c64b5(0xf6)](a51_0x5bf18c[_0x2c64b5(0xfc)]('Cancelled')),0x1;}const _0x3e9b77=await withSpinner(_0x2c64b5(0xc8),()=>_0x1297b0[_0x2c64b5(0x121)][_0x2c64b5(0x208)](_0x5b931b,_0x28969d),{'verbose':_0x5af752[_0x2c64b5(0xde)]}),_0x47a1b6=_0x3e9b77['data'];return console['error']('✔\x20'+_0x47a1b6),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x114);[a51_0x22a388(0x1b4)]=a51_0x22a388(0xb9);async['execute'](_0x5d675d){const _0x8de37a=a51_0x22a388,{options:_0x3e009a,args:_0x148bd4,tdx:_0xf3834c}=_0x5d675d,_0xb7674f=_0x148bd4[0x0];if(!_0xb7674f)return console['error'](_0x8de37a(0x237)),console[_0x8de37a(0xf6)](_0x8de37a(0xe4)),0x1;let _0x4c1d01=![],_0x2d171e=_0xb7674f;if(_0xb7674f[_0x8de37a(0xb5)](_0x8de37a(0x1c4)))_0x4c1d01=!![],_0x2d171e=_0xb7674f[_0x8de37a(0x24a)](0x8);else{if(_0xb7674f[_0x8de37a(0xb5)]('attempt:'))_0x4c1d01=![],_0x2d171e=_0xb7674f[_0x8de37a(0x24a)](0x8);else return console[_0x8de37a(0xf6)](_0x8de37a(0x222)),console[_0x8de37a(0xf6)](_0x8de37a(0xe4)),0x1;}const _0x3d8a8c=_0x3e009a[_0x8de37a(0x1e6)],_0x370553=_0x3e009a[_0x8de37a(0xac)],_0x40d8d8=_0x3e009a[_0x8de37a(0xb8)],_0x1cd0c2=_0x3e009a[_0x8de37a(0x211)];_0x3e009a[_0x8de37a(0xde)]&&(console['error'](_0x8de37a(0x197)+(_0x4c1d01?_0x8de37a(0xe7):_0x8de37a(0xfa))+'\x20'+_0x2d171e),_0x3d8a8c&&console['error'](_0x8de37a(0x238)+_0x3d8a8c),_0x370553&&console['error'](_0x8de37a(0x1ba)+_0x370553),_0x40d8d8&&console[_0x8de37a(0xf6)]('Params:\x20'+_0x40d8d8),_0x1cd0c2&&console[_0x8de37a(0xf6)]('Force:\x20yes'));let _0x3ba4f0;if(_0x40d8d8)try{if(_0x40d8d8[_0x8de37a(0xb5)]('@')){const _0x2d9f7f=await import('fs/promises'),_0x4c80e1=_0x40d8d8[_0x8de37a(0x24a)](0x1),_0x518e80=await _0x2d9f7f['readFile'](_0x4c80e1,_0x8de37a(0x16d));_0x3ba4f0=JSON[_0x8de37a(0xc6)](_0x518e80);}else _0x3ba4f0=JSON[_0x8de37a(0xc6)](_0x40d8d8);}catch{return console['error'](_0x8de37a(0xe3)),0x1;}if(!_0x3e009a[_0x8de37a(0x117)]){if(!isInteractive())return console['error'](a51_0x5bf18c[_0x8de37a(0xf3)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x8de37a(0xf6)](a51_0x5bf18c[_0x8de37a(0x1b0)](_0x8de37a(0x119))),0x1;const _0x4569f6=await confirmKey(_0x8de37a(0x242)+(_0x4c1d01?'session':_0x8de37a(0xfa))+'\x20'+_0x2d171e+'?');if(!_0x4569f6)return console[_0x8de37a(0xf6)](a51_0x5bf18c[_0x8de37a(0xfc)](_0x8de37a(0x1cb))),0x1;}let _0x13b8d5;_0x4c1d01?_0x13b8d5=await withSpinner(_0x8de37a(0x215),()=>_0xf3834c[_0x8de37a(0x121)][_0x8de37a(0x1ea)](_0x2d171e,{'fromTask':_0x3d8a8c,'retryParams':_0x3ba4f0}),{'verbose':_0x3e009a[_0x8de37a(0xde)]}):_0x13b8d5=await withSpinner(_0x8de37a(0x107),()=>_0xf3834c[_0x8de37a(0x121)][_0x8de37a(0x205)](_0x2d171e,{'resumeFrom':_0x370553,'retryParams':_0x3ba4f0,'force':_0x1cd0c2}),{'verbose':_0x3e009a['verbose']});const _0x42333e=_0x13b8d5[_0x8de37a(0x195)];return console[_0x8de37a(0xf6)]('✔\x20Retry\x20started'),console[_0x8de37a(0xf6)](_0x8de37a(0xc2)+_0x42333e[_0x8de37a(0x173)]),console[_0x8de37a(0xf6)](_0x8de37a(0x9c)+_0x42333e['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]='workflow:run';[a51_0x22a388(0x1b4)]=a51_0x22a388(0x157);async['execute'](_0x1a04d8){const _0x2bbec8=a51_0x22a388,{options:_0x3e63fa,args:_0x4b3b96,tdx:_0x59ee69}=_0x1a04d8;let _0x5e523d=_0x4b3b96[0x0];if(!_0x5e523d){const _0x48ca48=this[_0x2bbec8(0x202)]([],_0x3e63fa),_0x4224ad=await withSpinner('Loading\x20workflows...',()=>_0x59ee69[_0x2bbec8(0x121)][_0x2bbec8(0xa7)](_0x48ca48,{'limit':_0x3e63fa['limit']}),{'verbose':_0x3e63fa[_0x2bbec8(0xde)]}),_0x48dd40=_0x4224ad[_0x2bbec8(0x195)];if(_0x48dd40[_0x2bbec8(0x221)]===0x0)return console[_0x2bbec8(0xf6)](_0x2bbec8(0xe6)),!_0x48ca48&&console[_0x2bbec8(0xf6)](a51_0x5bf18c[_0x2bbec8(0x1b0)](_0x2bbec8(0x10a))),0x1;const _0x148529=_0x48dd40[_0x2bbec8(0x1de)](_0x27b663=>({'title':_0x27b663[_0x2bbec8(0x1fe)]?.[_0x2bbec8(0x174)]+'.'+_0x27b663['name'],'value':_0x27b663[_0x2bbec8(0x1fe)]?.[_0x2bbec8(0x174)]+'.'+_0x27b663['name'],'description':_0x27b663[_0x2bbec8(0xf2)]?_0x2bbec8(0xcc)+_0x27b663['revision']:undefined})),_0xa5b8dc=await a51_0x4f4bd3({'type':'select','name':_0x2bbec8(0x121),'message':_0x2bbec8(0x194),'choices':_0x148529});if(!_0xa5b8dc['workflow'])return 0x1;_0x5e523d=_0xa5b8dc[_0x2bbec8(0x121)];}if(!_0x5e523d[_0x2bbec8(0xe0)]('.')){const _0x1d16fe=this[_0x2bbec8(0x202)]([],_0x3e63fa);if(_0x1d16fe)_0x5e523d=_0x1d16fe+'.'+_0x5e523d;else return console[_0x2bbec8(0xf6)](a51_0x5bf18c[_0x2bbec8(0xf3)](_0x2bbec8(0x1e0)),_0x2bbec8(0x249)),console['error'](a51_0x5bf18c[_0x2bbec8(0x1b0)](_0x2bbec8(0x10a))),0x1;}const _0x14821b=_0x3e63fa[_0x2bbec8(0x128)],_0x535d86=_0x3e63fa[_0x2bbec8(0x16a)],_0x478260={};if(_0x14821b&&Array[_0x2bbec8(0x124)](_0x14821b))for(const _0x11b006 of _0x14821b){const _0x4d2dba=_0x11b006[_0x2bbec8(0xd7)]('=');if(_0x4d2dba===-0x1)return console[_0x2bbec8(0xf6)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x11b006),console[_0x2bbec8(0xf6)](_0x2bbec8(0x190)),0x1;const _0x369d55=_0x11b006[_0x2bbec8(0x24a)](0x0,_0x4d2dba),_0x1b171a=_0x11b006[_0x2bbec8(0x24a)](_0x4d2dba+0x1);try{_0x478260[_0x369d55]=JSON['parse'](_0x1b171a);}catch{_0x478260[_0x369d55]=_0x1b171a;}}_0x3e63fa[_0x2bbec8(0xde)]&&(console[_0x2bbec8(0xf6)](_0x2bbec8(0x162)+_0x5e523d),Object[_0x2bbec8(0x244)](_0x478260)[_0x2bbec8(0x221)]>0x0&&console[_0x2bbec8(0xf6)](_0x2bbec8(0x1b8)+JSON[_0x2bbec8(0x246)](_0x478260)),_0x535d86&&console[_0x2bbec8(0xf6)](_0x2bbec8(0x11b)+_0x535d86));const _0x44917b=await withSpinner('Starting\x20workflow\x20run...',()=>_0x59ee69[_0x2bbec8(0x121)][_0x2bbec8(0xe2)](_0x5e523d,_0x478260,{'sessionTime':_0x535d86}),{'verbose':_0x3e63fa[_0x2bbec8(0xde)]}),_0x3a706d=_0x44917b[_0x2bbec8(0x195)];console['error'](_0x2bbec8(0xa3)),console[_0x2bbec8(0xf6)](_0x2bbec8(0x161)+_0x3a706d['id']),console[_0x2bbec8(0xf6)]('\x20\x20Session\x20ID:\x20'+_0x3a706d['sessionId']),console['error'](_0x2bbec8(0x186)+_0x3a706d[_0x2bbec8(0x1fe)]?.[_0x2bbec8(0x174)]),console[_0x2bbec8(0xf6)]('\x20\x20Workflow:\x20'+_0x3a706d['workflow']?.[_0x2bbec8(0x174)]);if(_0x3a706d[_0x2bbec8(0x1fe)]?.['id']&&_0x3a706d['sessionId']&&_0x3a706d['id']){const _0x48a6f9=_0x3e63fa[_0x2bbec8(0x1e3)],_0x2194bf=getConsoleUrl(_0x48a6f9,_0x2bbec8(0xcd)+_0x3a706d[_0x2bbec8(0x1fe)]['id']+'/sessions/'+_0x3a706d[_0x2bbec8(0x214)]+_0x2bbec8(0x136)+_0x3a706d['id']);console['error']('\x20\x20Console:\x20'+a51_0x5bf18c['cyan'](_0x2194bf));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a51_0x22a388(0xb3);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x1ac);async['execute'](_0x8e89c9){const _0x28ddfc=a51_0x22a388,{options:_0x3c4370,args:_0x1751f5,tdx:_0x3296d0}=_0x8e89c9,_0x164e10=_0x1751f5[0x0],_0x5e04a8=_0x1751f5[0x1]||'.';if(!_0x164e10)return console[_0x28ddfc(0xf6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x28ddfc(0xf6)](_0x28ddfc(0xd1)),0x1;const _0x3a1f6a=_0x3c4370['revision'];_0x3c4370[_0x28ddfc(0xde)]&&(console['error'](_0x28ddfc(0xba)+_0x164e10),console[_0x28ddfc(0xf6)]('Output\x20directory:\x20'+_0x5e04a8),_0x3a1f6a&&console[_0x28ddfc(0xf6)]('Revision:\x20'+_0x3a1f6a));const _0x2c89f5=await withSpinner(_0x28ddfc(0x24d)+_0x164e10+_0x28ddfc(0x156),()=>_0x3296d0[_0x28ddfc(0x121)][_0x28ddfc(0x1cc)](_0x164e10,_0x5e04a8,{'revision':_0x3a1f6a}),{'verbose':_0x3c4370[_0x28ddfc(0xde)]}),_0xd008b1=_0x2c89f5[_0x28ddfc(0x195)];return console['error']('✔\x20Downloaded\x20'+_0xd008b1[_0x28ddfc(0xb4)]),console[_0x28ddfc(0xf6)](_0x28ddfc(0x182)+_0xd008b1['revision']),console[_0x28ddfc(0xf6)]('\x20\x20Files\x20extracted:\x20'+_0xd008b1['filesExtracted']),console['error'](_0x28ddfc(0x1c9)+_0x5e04a8+'/'+_0xd008b1['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a51_0x22a388(0xd4);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x172);async[a51_0x22a388(0xd2)](_0x1a3328){const _0x814c27=a51_0x22a388,{options:_0x1b95c2,args:_0x3dd527,tdx:_0x99fddd}=_0x1a3328;let _0x401bbe='.',_0x993034=_0x1b95c2[_0x814c27(0x174)];if(_0x3dd527[0x0]){const {promises:_0x4b9617}=await import('fs');try{const _0x5cd473=await _0x4b9617['stat'](_0x3dd527[0x0]);if(_0x5cd473[_0x814c27(0x153)]())_0x401bbe=_0x3dd527[0x0];else return console[_0x814c27(0xf6)](_0x814c27(0x12b)+_0x3dd527[0x0]+_0x814c27(0x168)),0x1;}catch{_0x993034=_0x3dd527[0x0],_0x401bbe='.';}}const _0xb43ffa=_0x1b95c2[_0x814c27(0xf2)],_0x1ae3cd=_0x1b95c2[_0x814c27(0xf9)];_0x1b95c2[_0x814c27(0xde)]&&(console[_0x814c27(0xf6)]('Project\x20directory:\x20'+_0x401bbe),_0x993034&&console[_0x814c27(0xf6)](_0x814c27(0x1bf)+_0x993034),_0xb43ffa&&console['error']('Revision:\x20'+_0xb43ffa),_0x1ae3cd&&console['error'](_0x814c27(0xd0)));const _0x34bb7a=await withSpinner(_0x814c27(0x171),()=>_0x99fddd[_0x814c27(0x121)][_0x814c27(0x11e)](_0x401bbe,{'projectName':_0x993034,'revision':_0xb43ffa,'skipValidation':_0x1ae3cd}),{'verbose':_0x1b95c2['verbose']}),_0x3ae6ba=_0x34bb7a[_0x814c27(0x195)];return console[_0x814c27(0xf6)]('✔\x20Pushed\x20'+_0x3ae6ba[_0x814c27(0xb4)]),console['error'](_0x814c27(0xca)+_0x3ae6ba[_0x814c27(0xb6)]),console['error'](_0x814c27(0x182)+_0x3ae6ba[_0x814c27(0xf2)]),await this[_0x814c27(0x134)](_0x99fddd,_0x3ae6ba[_0x814c27(0xb4)],_0x1b95c2[_0x814c27(0x1e3)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x23a);['description']=a51_0x22a388(0x217);async[a51_0x22a388(0xd2)](_0x5325ae){const _0x17afd8=a51_0x22a388,{options:_0x45591b,args:_0x1df2e5,tdx:_0x3707b1}=_0x5325ae,_0x4c5e64=_0x1df2e5[0x0],_0x4ef354=_0x1df2e5[0x1];if(!_0x4c5e64)return console['error'](a51_0x5bf18c[_0x17afd8(0xf3)](_0x17afd8(0x1e0)),_0x17afd8(0x21b)),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x133))),0x1;const _0x5495bf=_0x45591b[_0x17afd8(0xf2)];_0x45591b[_0x17afd8(0xde)]&&(console['error'](_0x17afd8(0xba)+_0x4c5e64),_0x4ef354&&console['error'](_0x17afd8(0x1f6)+_0x4ef354),_0x5495bf&&console[_0x17afd8(0xf6)](_0x17afd8(0xa2)+_0x5495bf),_0x45591b['dryRun']&&console[_0x17afd8(0xf6)](_0x17afd8(0x21f)));const _0x3c601b=await withSpinner(_0x17afd8(0x1ee)+_0x4c5e64+_0x17afd8(0x156),()=>_0x3707b1[_0x17afd8(0x121)][_0x17afd8(0x21a)](_0x4c5e64,{'targetDir':_0x4ef354,'revision':_0x5495bf}),{'verbose':_0x45591b[_0x17afd8(0xde)]}),_0x2b2ffa=_0x3c601b['data'];_0x2b2ffa[_0x17afd8(0x234)]?console[_0x17afd8(0xf6)](_0x17afd8(0x247)+_0x2b2ffa[_0x17afd8(0xb4)]):console[_0x17afd8(0xf6)](_0x17afd8(0xdc)+_0x2b2ffa['projectName']);console[_0x17afd8(0xf6)](_0x17afd8(0x182)+_0x2b2ffa[_0x17afd8(0xf2)]),console['error'](_0x17afd8(0x1c0)+(a51_0x108fb0[_0x17afd8(0x1d2)](process[_0x17afd8(0x166)](),_0x2b2ffa[_0x17afd8(0x1a4)])||'.')),console[_0x17afd8(0xf6)]('\x20\x20Changes:\x20'+a51_0x5bf18c[_0x17afd8(0xf7)]('+'+_0x2b2ffa[_0x17afd8(0x145)]['new']+'\x20new')+',\x20'+(a51_0x5bf18c['yellow']('~'+_0x2b2ffa[_0x17afd8(0x145)][_0x17afd8(0x109)]+_0x17afd8(0x115))+',\x20')+(a51_0x5bf18c[_0x17afd8(0xf3)]('-'+_0x2b2ffa['summary'][_0x17afd8(0xe5)]+_0x17afd8(0x1be))+',\x20')+(''+a51_0x5bf18c[_0x17afd8(0x1b0)](_0x2b2ffa[_0x17afd8(0x145)][_0x17afd8(0x19a)]+_0x17afd8(0x21e))));for(const _0x194f56 of _0x2b2ffa[_0x17afd8(0xa8)]){_0x194f56[_0x17afd8(0x1a5)]==='modified'&&_0x194f56[_0x17afd8(0x1d9)]&&(console[_0x17afd8(0xf6)]('\x0a'+a51_0x5bf18c[_0x17afd8(0xbb)]('---\x20'+_0x194f56[_0x17afd8(0x15d)])),console['error'](_0x194f56['diff']));}if(!_0x2b2ffa[_0x17afd8(0xd6)])return saveSessionContext({'workflow_project':_0x2b2ffa[_0x17afd8(0xb4)]},_0x45591b[_0x17afd8(0xe7)]),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xf7)](_0x17afd8(0x23b))),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x1cd)+_0x2b2ffa[_0x17afd8(0xb4)])),0x0;if(_0x45591b[_0x17afd8(0x164)])return console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xfc)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x45591b[_0x17afd8(0x117)]){if(!isInteractive())return console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xf3)](_0x17afd8(0xd9)),_0x17afd8(0x23f)),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x119))),0x1;const _0x20dc5b=await confirmKey(_0x17afd8(0xa5));if(!_0x20dc5b)return console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0xfc)](_0x17afd8(0x1cb)),_0x17afd8(0x9f)),0x1;}await withSpinner(_0x17afd8(0x130),()=>_0x3707b1['workflow'][_0x17afd8(0x1aa)](_0x2b2ffa,{'revision':_0x5495bf}),{'verbose':_0x45591b[_0x17afd8(0xde)]}),saveSessionContext({'workflow_project':_0x2b2ffa[_0x17afd8(0xb4)]},_0x45591b[_0x17afd8(0xe7)]),console['error'](a51_0x5bf18c['green'](_0x17afd8(0x15f)));const _0x30cb33=a51_0x108fb0[_0x17afd8(0x1d2)](process[_0x17afd8(0x166)](),_0x2b2ffa[_0x17afd8(0x1a4)])||'.';return console['error'](a51_0x5bf18c[_0x17afd8(0x1b0)]('\x20\x20Location:\x20'+_0x30cb33)),console[_0x17afd8(0xf6)](a51_0x5bf18c[_0x17afd8(0x1b0)](_0x17afd8(0x1cd)+_0x2b2ffa['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x224);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x135);async[a51_0x22a388(0xd2)](_0xcfdb24){const _0x5bf818=a51_0x22a388,{options:_0x2e0f7b,args:_0x545015,tdx:_0x29dff5}=_0xcfdb24,_0x4b88df=this[_0x5bf818(0x235)](_0x545015,_0x2e0f7b),_0x28b808=_0x2e0f7b[_0x5bf818(0xf2)],_0xe1ecd1=_0x2e0f7b[_0x5bf818(0xf9)];_0x2e0f7b['verbose']&&(_0x4b88df&&console[_0x5bf818(0xf6)](_0x5bf818(0x191)+_0x4b88df),_0x28b808&&console['error'](_0x5bf818(0xa2)+_0x28b808),_0x2e0f7b['dryRun']&&console[_0x5bf818(0xf6)](_0x5bf818(0x21f)),_0xe1ecd1&&console[_0x5bf818(0xf6)](_0x5bf818(0xd0)));let _0x281709;try{_0x281709=await withSpinner('Analyzing\x20changes...',()=>_0x29dff5['workflow'][_0x5bf818(0x127)]({'sourceDir':_0x4b88df,'revision':_0x28b808,'skipValidation':_0xe1ecd1}),{'verbose':_0x2e0f7b['verbose']});}catch(_0x159dc9){if(_0x159dc9 instanceof Error&&_0x159dc9[_0x5bf818(0x17b)]['includes'](_0x5bf818(0x10b)))return console[_0x5bf818(0xf6)](a51_0x5bf18c['red']('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2e0f7b[_0x5bf818(0x1c1)]?console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0x1b0)](_0x5bf818(0x1f3)+_0x2e0f7b[_0x5bf818(0x1c1)]+_0x5bf818(0x184)+_0x2e0f7b[_0x5bf818(0x1c1)]+'\x27')):console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0x1b0)](_0x5bf818(0x1da))),0x1;throw _0x159dc9;}const _0x2f05c3=_0x281709['data'];console['error'](_0x5bf818(0xfb)+_0x2f05c3[_0x5bf818(0xb4)]),console[_0x5bf818(0xf6)](_0x5bf818(0x20f)+_0x2f05c3[_0x5bf818(0x18e)]),console[_0x5bf818(0xf6)](_0x5bf818(0x182)+_0x2f05c3[_0x5bf818(0xf2)]),console['error'](_0x5bf818(0x150)+a51_0x5bf18c[_0x5bf818(0xf7)]('+'+_0x2f05c3[_0x5bf818(0x145)]['new']+'\x20new')+',\x20'+(a51_0x5bf18c[_0x5bf818(0xfc)]('~'+_0x2f05c3[_0x5bf818(0x145)][_0x5bf818(0x109)]+_0x5bf818(0x115))+',\x20')+(a51_0x5bf18c['red']('-'+_0x2f05c3[_0x5bf818(0x145)][_0x5bf818(0xe5)]+_0x5bf818(0x1be))+',\x20')+(''+a51_0x5bf18c['dim'](_0x2f05c3['summary'][_0x5bf818(0x19a)]+_0x5bf818(0x21e))));for(const _0xa673e5 of _0x2f05c3[_0x5bf818(0xa8)]){_0xa673e5[_0x5bf818(0x1a5)]===_0x5bf818(0x109)&&_0xa673e5[_0x5bf818(0x1d9)]&&(console[_0x5bf818(0xf6)]('\x0a'+a51_0x5bf18c[_0x5bf818(0xbb)]('---\x20'+_0xa673e5[_0x5bf818(0x15d)])),console[_0x5bf818(0xf6)](_0xa673e5[_0x5bf818(0x1d9)]));}if(!_0x2f05c3[_0x5bf818(0xd6)])return console['error'](a51_0x5bf18c[_0x5bf818(0xf7)](_0x5bf818(0x1b3))),await this['showWorkflowConsoleUrl'](_0x29dff5,_0x2f05c3['projectName'],_0x2e0f7b['site']),0x0;if(_0x2e0f7b[_0x5bf818(0x164)])return console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0xfc)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2e0f7b[_0x5bf818(0x117)]){if(!isInteractive())return console[_0x5bf818(0xf6)](a51_0x5bf18c['red'](_0x5bf818(0xd9)),_0x5bf818(0x23f)),console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0x1b0)](_0x5bf818(0x119))),0x1;const _0x14d59f=await confirmKey(_0x5bf818(0x1f0));if(!_0x14d59f)return console['error'](a51_0x5bf18c[_0x5bf818(0xfc)](_0x5bf818(0x1cb)),_0x5bf818(0x1c8)),0x1;}const _0x25fbdc=await withSpinner(_0x5bf818(0x21d),()=>_0x29dff5[_0x5bf818(0x121)]['executePushProject'](_0x2f05c3),{'verbose':_0x2e0f7b[_0x5bf818(0xde)]}),_0x2816c6=_0x25fbdc[_0x5bf818(0x195)];return console[_0x5bf818(0xf6)](a51_0x5bf18c[_0x5bf818(0xf7)](_0x5bf818(0x11c))),console['error'](_0x5bf818(0xca)+_0x2816c6[_0x5bf818(0xb6)]),console['error'](_0x5bf818(0x182)+_0x2816c6[_0x5bf818(0xf2)]),await this[_0x5bf818(0x134)](_0x29dff5,_0x2816c6['projectName'],_0x2e0f7b[_0x5bf818(0x1e3)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x12a);[a51_0x22a388(0x1b4)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a51_0x22a388(0xd2)](_0x205d9){const _0x41bfbc=a51_0x22a388,{options:_0x16244d,args:_0x1d629d,tdx:_0x13d357}=_0x205d9,_0x4913b0=this[_0x41bfbc(0x235)](_0x1d629d,_0x16244d),_0x471b19=_0x16244d[_0x41bfbc(0x174)],_0x15b7de=_0x16244d[_0x41bfbc(0xf2)],_0xbce095=_0x16244d[_0x41bfbc(0xf9)];if(!_0x4913b0)return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf3)]('Error:'),_0x41bfbc(0x1dd)),console[_0x41bfbc(0xf6)](a51_0x5bf18c['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0x1b0)](_0x41bfbc(0x1d5))),0x1;if(!_0x471b19)return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf3)](_0x41bfbc(0x1e0)),_0x41bfbc(0x10c)),console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0x1b0)](_0x41bfbc(0x1a9))),0x1;_0x16244d[_0x41bfbc(0xde)]&&(console['error'](_0x41bfbc(0x191)+_0x4913b0),console[_0x41bfbc(0xf6)](_0x41bfbc(0x206)+_0x471b19),_0x15b7de&&console['error'](_0x41bfbc(0xa2)+_0x15b7de),_0x16244d[_0x41bfbc(0x164)]&&console['error']('Dry\x20run:\x20yes'),_0xbce095&&console['error'](_0x41bfbc(0xd0)));const _0x36ef65=await withSpinner(_0x41bfbc(0x17e),()=>_0x13d357[_0x41bfbc(0x121)][_0x41bfbc(0x120)](_0x4913b0,_0x471b19,{'revision':_0x15b7de,'skipValidation':_0xbce095}),{'verbose':_0x16244d[_0x41bfbc(0xde)]}),_0xdb1c64=_0x36ef65[_0x41bfbc(0x195)];console['error'](_0x41bfbc(0x10d)+_0xdb1c64[_0x41bfbc(0x18e)]);_0xdb1c64['sourceProjectName']&&console[_0x41bfbc(0xf6)]('Source\x20project:\x20'+_0xdb1c64[_0x41bfbc(0xbf)]);console[_0x41bfbc(0xf6)](_0x41bfbc(0x206)+_0xdb1c64[_0x41bfbc(0xf0)]),console['error'](_0x41bfbc(0xa2)+_0xdb1c64[_0x41bfbc(0xf2)]),console[_0x41bfbc(0xf6)](_0x41bfbc(0x1b9)+_0xdb1c64[_0x41bfbc(0x1af)]);_0xdb1c64[_0x41bfbc(0x1d6)]&&(console['error'](a51_0x5bf18c[_0x41bfbc(0xfc)]('\x0a⚠\x20Project\x20\x22'+_0xdb1c64[_0x41bfbc(0xf0)]+_0x41bfbc(0x148)+_0xdb1c64[_0x41bfbc(0x10e)]+')')),console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xfc)](_0x41bfbc(0x209))));if(_0x16244d[_0x41bfbc(0x164)])return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xfc)](_0x41bfbc(0xc1))),0x0;if(!_0x16244d[_0x41bfbc(0x117)]){if(!isInteractive())return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf3)](_0x41bfbc(0xd9)),_0x41bfbc(0x23f)),console['error'](a51_0x5bf18c[_0x41bfbc(0x1b0)](_0x41bfbc(0x119))),0x1;const _0x5d9a0f=_0xdb1c64['sourceProjectName']||a51_0x108fb0[_0x41bfbc(0x144)](_0x4913b0),_0x29946d=_0xdb1c64['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x471b19+_0x41bfbc(0x1db):_0x41bfbc(0x1f5)+_0x5d9a0f+_0x41bfbc(0xdb)+_0x471b19+'\x22?',_0x88002b=await confirmKey(_0x29946d);if(!_0x88002b)return console['error'](a51_0x5bf18c[_0x41bfbc(0xfc)](_0x41bfbc(0x1cb))),0x1;}const _0x88b4d3=await withSpinner(_0xdb1c64[_0x41bfbc(0x1d6)]?_0x41bfbc(0x9b)+_0x471b19+_0x41bfbc(0x156):_0x41bfbc(0x1f7)+_0x471b19+'...',()=>_0x13d357[_0x41bfbc(0x121)]['executeCloneProject'](_0xdb1c64),{'verbose':_0x16244d[_0x41bfbc(0xde)]}),_0xeb1080=_0x88b4d3[_0x41bfbc(0x195)];return console[_0x41bfbc(0xf6)](a51_0x5bf18c[_0x41bfbc(0xf7)](_0xdb1c64['targetExists']?_0x41bfbc(0x11f):_0x41bfbc(0x1ca))),console[_0x41bfbc(0xf6)](_0x41bfbc(0x186)+_0xeb1080['newProjectName']),console[_0x41bfbc(0xf6)]('\x20\x20Project\x20ID:\x20'+_0xeb1080[_0x41bfbc(0xe8)]),console[_0x41bfbc(0xf6)](_0x41bfbc(0x182)+_0xeb1080[_0x41bfbc(0xf2)]),await this['showWorkflowConsoleUrl'](_0x13d357,_0xeb1080['newProjectName'],_0x16244d[_0x41bfbc(0x1e3)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x125);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x112);async[a51_0x22a388(0xd2)](_0x555115){const _0x4f4c8e=a51_0x22a388,{options:_0x1bc4d0,args:_0xb668c6,tdx:_0xa629f7}=_0x555115,_0x46f820=_0xb668c6[0x0];if(!_0x46f820)return console['error'](_0x4f4c8e(0x1d8)),console[_0x4f4c8e(0xf6)](_0x4f4c8e(0x1a2)),0x1;_0x1bc4d0[_0x4f4c8e(0xde)]&&console[_0x4f4c8e(0xf6)](_0x4f4c8e(0xba)+_0x46f820);if(!_0x1bc4d0[_0x4f4c8e(0x117)]){if(!isInteractive())return console[_0x4f4c8e(0xf6)](a51_0x5bf18c[_0x4f4c8e(0xf3)](_0x4f4c8e(0xd9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a51_0x5bf18c[_0x4f4c8e(0x1b0)](_0x4f4c8e(0x119))),0x1;const _0x37b925=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x46f820+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x37b925)return console[_0x4f4c8e(0xf6)](a51_0x5bf18c['yellow'](_0x4f4c8e(0x1cb))),0x1;}const _0x56d3b7=await withSpinner('Deleting\x20project\x20'+_0x46f820+_0x4f4c8e(0x156),()=>_0xa629f7['workflow'][_0x4f4c8e(0xc9)](_0x46f820),{'verbose':_0x1bc4d0[_0x4f4c8e(0xde)]}),_0x333b9e=_0x56d3b7['data'];return console['error'](_0x4f4c8e(0x1bb)+_0x333b9e['projectName']),console[_0x4f4c8e(0xf6)](_0x4f4c8e(0xca)+_0x333b9e[_0x4f4c8e(0xb6)]),0x0;}}export function parseKeyValue(_0x2455e0){const _0xdb6dfa=a51_0x22a388,_0x1678e0=_0x2455e0[_0xdb6dfa(0xd7)]('=');if(_0x1678e0===-0x1)throw new Error(_0xdb6dfa(0x159)+_0x2455e0+_0xdb6dfa(0x12f));const _0x33d1a5=_0x2455e0[_0xdb6dfa(0x24a)](0x0,_0x1678e0),_0x5a0004=_0x2455e0[_0xdb6dfa(0x24a)](_0x1678e0+0x1);if(!_0x33d1a5)throw new Error(_0xdb6dfa(0xed));return{'key':_0x33d1a5,'value':_0x5a0004};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x226);[a51_0x22a388(0x1b4)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a51_0x22a388(0xd2)](_0x5e2b52){const _0x2f6c79=a51_0x22a388,{options:_0x1bac9b,args:_0x2c53b5,tdx:_0x2e731d}=_0x5e2b52,_0x1dca4d=this[_0x2f6c79(0x118)](_0x2c53b5,_0x1bac9b);if(!_0x1dca4d)return 0x1;_0x1bac9b[_0x2f6c79(0xde)]&&console[_0x2f6c79(0xf6)]('Project:\x20'+_0x1dca4d);const _0x324164=await withSpinner(_0x2f6c79(0x18a),()=>_0x2e731d['workflow'][_0x2f6c79(0x105)](_0x1dca4d),{'verbose':_0x1bac9b[_0x2f6c79(0xde)]}),{secrets:_0x2db372}=_0x324164[_0x2f6c79(0x195)];return console['error'](_0x2f6c79(0x17a)+_0x2db372[_0x2f6c79(0x221)]+_0x2f6c79(0xf5)+(_0x2db372['length']!==0x1?'s':'')),await handleSDKOutput(_0x2db372,_0x1bac9b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x223);[a51_0x22a388(0x1b4)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a51_0x22a388(0xd2)](_0x1fbba7){const _0x2642c1=a51_0x22a388,{options:_0x4a89d2,args:_0x9a2265,tdx:_0x895a46}=_0x1fbba7;let _0x149a41,_0x5effae;if(_0x9a2265[_0x2642c1(0x221)]>=0x1&&!_0x9a2265[0x0]['includes']('='))_0x149a41=_0x9a2265[0x0],_0x5effae=_0x9a2265['slice'](0x1);else{if(_0x9a2265[_0x2642c1(0x221)]>=0x1&&_0x4a89d2[_0x2642c1(0x1c1)])_0x149a41=_0x4a89d2[_0x2642c1(0x1c1)],_0x5effae=_0x9a2265;else return _0x9a2265[_0x2642c1(0x221)]>=0x1?(console[_0x2642c1(0xf6)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x2642c1(0x10a)),0x1):(console['error'](_0x2642c1(0xb1)),console[_0x2642c1(0xf6)](_0x2642c1(0x1d0)),0x1);}if(_0x5effae[_0x2642c1(0x221)]===0x0)return console[_0x2642c1(0xf6)](_0x2642c1(0xb1)),console[_0x2642c1(0xf6)](_0x2642c1(0x1d0)),0x1;const _0x2a06c4={};try{for(const _0x4ef91d of _0x5effae){const {key:_0x147283,value:_0xcd7782}=parseKeyValue(_0x4ef91d);_0x2a06c4[_0x147283]=_0xcd7782;}}catch(_0x455620){return _0x455620 instanceof Error&&console[_0x2642c1(0xf6)](a51_0x5bf18c[_0x2642c1(0xf3)](_0x2642c1(0x1e0)),_0x455620[_0x2642c1(0x17b)]),0x1;}const _0x1c4890=Object['keys'](_0x2a06c4);_0x4a89d2['verbose']&&(console[_0x2642c1(0xf6)](_0x2642c1(0xba)+_0x149a41),console[_0x2642c1(0xf6)]('Secrets\x20to\x20set:\x20'+_0x1c4890['join'](',\x20')));const _0x3b6bef=await withSpinner(_0x1c4890['length']===0x1?_0x2642c1(0x178):_0x2642c1(0xeb)+_0x1c4890[_0x2642c1(0x221)]+'\x20secrets...',()=>_0x895a46[_0x2642c1(0x121)][_0x2642c1(0xbe)](_0x149a41,_0x2a06c4),{'verbose':_0x4a89d2['verbose']}),_0x4d72de=_0x3b6bef['data'];return console[_0x2642c1(0xf6)](_0x1c4890[_0x2642c1(0x221)]===0x1?_0x2642c1(0x243)+_0x4d72de[_0x2642c1(0x244)][0x0]+_0x2642c1(0x1c5)+_0x4d72de[_0x2642c1(0xb4)]+'\x27':'✔\x20'+_0x4d72de[_0x2642c1(0x244)][_0x2642c1(0x221)]+_0x2642c1(0x216)+_0x4d72de[_0x2642c1(0xb4)]+'\x27'),(_0x4a89d2[_0x2642c1(0x176)]||_0x4a89d2[_0x2642c1(0x201)])&&await handleSingleObjectOutput(_0x4d72de,_0x4a89d2),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0xaa);['description']=a51_0x22a388(0x16c);async[a51_0x22a388(0xd2)](_0x1b8163){const _0xa02d26=a51_0x22a388,{options:_0x20afcb,args:_0x2bf17d,tdx:_0x2aa889}=_0x1b8163;let _0x2751ad,_0xa531f1;if(_0x2bf17d[_0xa02d26(0x221)]>=0x2)_0x2751ad=_0x2bf17d[0x0],_0xa531f1=_0x2bf17d[0x1];else{if(_0x2bf17d[_0xa02d26(0x221)]===0x1&&_0x20afcb[_0xa02d26(0x1c1)])_0x2751ad=_0x20afcb['workflowProject'],_0xa531f1=_0x2bf17d[0x0];else return _0x2bf17d[_0xa02d26(0x221)]===0x1?(console[_0xa02d26(0xf6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0xa02d26(0xf6)](_0xa02d26(0x10a)),0x1):(console[_0xa02d26(0xf6)](_0xa02d26(0x203)),console[_0xa02d26(0xf6)](_0xa02d26(0xc0)),0x1);}_0x20afcb[_0xa02d26(0xde)]&&(console[_0xa02d26(0xf6)](_0xa02d26(0xba)+_0x2751ad),console['error']('Key:\x20'+_0xa531f1));if(!_0x20afcb[_0xa02d26(0x117)]){if(!isInteractive())return console[_0xa02d26(0xf6)](a51_0x5bf18c['red'](_0xa02d26(0xd9)),_0xa02d26(0x23f)),console[_0xa02d26(0xf6)](a51_0x5bf18c[_0xa02d26(0x1b0)](_0xa02d26(0x119))),0x1;const _0x5eed28=await confirmKey(_0xa02d26(0x22b)+_0xa531f1+_0xa02d26(0x1fc)+_0x2751ad+'\x27?');if(!_0x5eed28)return console['error'](a51_0x5bf18c[_0xa02d26(0xfc)](_0xa02d26(0x1cb))),0x1;}const _0x5c1535=await withSpinner(_0xa02d26(0x141),()=>_0x2aa889[_0xa02d26(0x121)][_0xa02d26(0xd5)](_0x2751ad,_0xa531f1),{'verbose':_0x20afcb['verbose']}),_0x381d4e=_0x5c1535[_0xa02d26(0x195)];return console['error']('✔\x20Secret\x20\x27'+_0x381d4e[_0xa02d26(0x1b2)]+_0xa02d26(0x132)+_0x381d4e[_0xa02d26(0xb4)]+'\x27'),(_0x20afcb[_0xa02d26(0x176)]||_0x20afcb['jsonl'])&&await handleSingleObjectOutput(_0x381d4e,_0x20afcb),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(_0x1428a6){const _0x278aab=a51_0x22a388,_0x451e0c=Math['floor'](_0x1428a6/0x3e8),_0x36c19a=Math['floor'](_0x451e0c/0x3c),_0x14f753=Math[_0x278aab(0xdd)](_0x36c19a/0x3c),_0x1ce6ac=Math[_0x278aab(0xdd)](_0x14f753/0x18);if(_0x1ce6ac>0x0){const _0x101211=_0x14f753%0x18;return _0x101211>0x0?_0x1ce6ac+'d\x20'+_0x101211+'h':_0x1ce6ac+'d';}else{if(_0x14f753>0x0){const _0x2572b9=_0x36c19a%0x3c;return _0x2572b9>0x0?_0x14f753+'h\x20'+_0x2572b9+'m':_0x14f753+'h';}else{if(_0x36c19a>0x0){const _0x4a0f4c=_0x451e0c%0x3c;return _0x4a0f4c>0x0?_0x36c19a+'m\x20'+_0x4a0f4c+'s':_0x36c19a+'m';}else return _0x451e0c+'s';}}}function formatTimestamp(_0x4acb03,_0x6b69ea){const _0x54f91e=a51_0x22a388,_0x29127f=new Date(_0x4acb03),_0x58c0a7=String(_0x29127f[_0x54f91e(0x1fa)]())[_0x54f91e(0x17d)](0x2,'0'),_0x5e4109=String(_0x29127f[_0x54f91e(0x14d)]())[_0x54f91e(0x17d)](0x2,'0'),_0x1683f1=_0x58c0a7+':'+_0x5e4109,_0x5e6762=_0x29127f[_0x54f91e(0x1e9)]()===_0x6b69ea[_0x54f91e(0x1e9)]()&&_0x29127f[_0x54f91e(0x187)]()===_0x6b69ea['getMonth']()&&_0x29127f['getDate']()===_0x6b69ea[_0x54f91e(0x149)]();if(_0x5e6762)return _0x1683f1;else{const _0x2262e4=String(_0x29127f['getMonth']()+0x1)[_0x54f91e(0x17d)](0x2,'0'),_0x381b9f=String(_0x29127f[_0x54f91e(0x149)]())['padStart'](0x2,'0');return _0x2262e4+'-'+_0x381b9f+'\x20'+_0x1683f1;}}function formatDate(_0x22af93){const _0x4ba063=a51_0x22a388,_0x37df52=_0x22af93[_0x4ba063(0x1e9)](),_0x478199=String(_0x22af93['getMonth']()+0x1)[_0x4ba063(0x17d)](0x2,'0'),_0x5d30b0=String(_0x22af93[_0x4ba063(0x149)]())[_0x4ba063(0x17d)](0x2,'0');return _0x37df52+'-'+_0x478199+'-'+_0x5d30b0;}function getTaskStateIcon(_0x52646e){const _0x90fac7={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x90fac7[_0x52646e]||'⚪';}function getBarChar(_0x54c532){const _0x53af6c=a51_0x22a388;return _0x54c532===_0x53af6c(0xf6)||_0x54c532==='group_error'?'×':'─';}function a51_0x15a1(){const _0x38f735=['getDate','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','toLowerCase','No\x20workflow\x20projects\x20found','getMinutes','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','resolveProjectId','\x20\x20Changes:\x20','createdAt','Select\x20a\x20task\x20to\x20view\x20logs:','isDirectory','resolve','\x20logs','...','Start\x20a\x20workflow\x20run','No\x20sessions\x20with\x20timing\x20information','Invalid\x20format:\x20','Fetching\x20log\x20files...','running',',\x20Workflow:\x20','path','764923JSlXkI','✔\x20Pull\x20complete','sessions','\x20\x20Attempt\x20ID:\x20','Workflow:\x20','fullName','dryRun','\x20session','cwd','ICON_SPACING','\x20is\x20not\x20a\x20directory','\x0aPolling...\x20(','sessionTime','\x20tasks','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','utf-8','Warning:','9FoyEzQ','max','Pushing\x20workflow\x20project...','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','attemptId','name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','json','No\x20sessions\x20found\x20for:\x20','Setting\x20secret...','success','✔\x20Found\x20','message','No\x20projects\x20match\x20pattern:\x20','padStart','Analyzing\x20project...','get','MIN_TIMELINE_WIDTH','130VhtFrZ','\x20\x20Revision:\x20','filter','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','12960FhlFLr','\x20\x20Project:\x20','getMonth','No\x20sessions\x20found','text','Listing\x20secrets...','Loading\x20sessions...','canceling','Pattern:\x20','sourceDir','Auto-selected\x20latest\x20session:\x20','Expected\x20format:\x20--param\x20key=value','Source\x20directory:\x20','join','1177055sIldPh','Select\x20a\x20workflow\x20to\x20run','data','status','Target:\x20','duration','follow','unchanged','startedAt','Getting\x20attempt\x20details...','No\x20sessions\x20found\x20in\x20project:\x20','439818ECCzdr','list','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Usage:\x20workflow:delete\x20<project-name-or-id>','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','targetDir','type','workflow:workflows','MAX_TASKS_DISPLAY','Resolving\x20project\x20\x27','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','applyPullProject','TASK_NAME_WIDTH','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','workflow:kill','ICON_WIDTH','fileCount','dim','(use\x20--limit\x20to\x20see\x20more)','key','\x0a✔\x20No\x20changes\x20to\x20push','description','autocomplete','workflowName','renderSingleTimeline','Parameters:\x20','Files\x20to\x20upload:\x20','Resume\x20from:\x20','✔\x20Deleted\x20project\x20','\x20(system)','logs','\x20deleted','Project\x20name:\x20','\x20\x20Target:\x20','workflowProject','\x0aFailed\x20to\x20fetch\x20attempt\x20data','sys','session:','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Task\x20name:\x20','workflow:attempts','-\x20nothing\x20pushed','\x20\x20Location:\x20','✔\x20Clone\x20complete','Cancelled','download','\x20\x20Session\x20context\x20set\x20to:\x20','fileSize','value','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','values','relative','finishedAt','cancelRequested','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','targetExists','format','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','diff','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x22\x20with\x20new\x20revision?','getTime','Source\x20directory\x20is\x20required','map','\x20sessions\x20','Error:','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Attempt:\x20','site','index','✔\x20Workflow\x20project\x20set\x20to:\x20','fromTask','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','columns','getFullYear','retrySession','Total:\x20','Attempt\x20ID:\x20','blue','Pulling\x20project\x20','isTTY','\x0aPush\x20these\x20changes?','\x1b[1A\x1b[2K','workflow:logs','Tip:\x20cd\x20to\x20workflows/','task','\x0aClone\x20\x22','Target\x20directory:\x20','Cloning\x20to\x20','toISOString','Loading\x20session...','getHours','Session\x20','\x27\x20from\x20project\x20\x27','output','project','2fXfHev','size','jsonl','resolveProject','Error:\x20Secret\x20key\x20is\x20required','log','retryAttempt','New\x20project\x20name:\x20','durationMs','kill','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','planned','stdout','Error:\x20Attempt\x20ID\x20is\x20required','workflow:use','find','\x20\x20Source:\x20','state','force','updatedAt','🔄\x20','sessionId','Retrying\x20session...','\x20secrets\x20set\x20for\x20project\x20\x27','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x0a✔\x20Attempt\x20complete','MAX_LABEL_COUNT','pullProject','Project\x20name\x20is\x20required','retryAttemptName','Pushing\x20project...','\x20unchanged','Dry\x20run:\x20yes','GUTTER','length','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','workflow:secrets:set','workflow:push','lastAttempt','workflow:secrets:list','parseProjectWorkflowPattern','List\x20workflow\x20attempts','\x20\x20tdx\x20wf\x20use\x20<project>','\x20(use\x20--limit\x20to\x20show\x20more)','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','split','Status:\x20','(unknown)','Show\x20specific\x20attempt\x20details','5945640cVAfVm','displayLine','end','\x20from\x20session\x20','isNewProject','resolveProjectDir','all','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','From\x20task:\x20','match','workflow:pull','\x0a✔\x20Already\x20up\x20to\x20date','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','now','reason','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','startTime','navigateSessionsInteractive','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','✔\x20Secret\x20\x27','keys','repeat','stringify','→\x20New\x20project:\x20','sort','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','substring','context','Kill\x20a\x20running\x20attempt','Downloading\x20project\x20','metadata','replace','unknown','set','Updating\x20','\x20\x20Session\x20ID:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','tdx\x20wf\x20attempt\x20','-\x20no\x20files\x20written','total','localeCompare','Revision:\x20','✔\x20Workflow\x20run\x20started','\x20\x20Console:\x20','\x0aApply\x20these\x20changes?','workflow:sessions','workflows','changes','limit','workflow:secrets:delete','renderTimeline','resumeFrom','renderSessionsTimeline','Latest\x20session\x20has\x20no\x20attempt','logFiles','\x20of\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','window','workflow:download','projectName','startsWith','projectId','\x20task','params','Retry\x20a\x20session\x20or\x20attempt','Project:\x20','cyan','write','Show\x20tasks\x20for\x20an\x20attempt','setSecrets','sourceProjectName','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20\x20New\x20attempt\x20ID:\x20','group_error','42SgXLyd','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','parse','pollTimeline','Killing\x20attempt...','delete','\x20\x20Project\x20ID:\x20','start','revision:\x20','/app/workflows/','Show\x20logs\x20for\x20a\x20workflow\x20attempt','includeRetried','Validation:\x20skipped','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','execute','Include\x20retried:\x20yes','workflow:upload','deleteSecret','hasChanges','indexOf','table','\x0aError:','\x27...','\x22\x20to\x20new\x20project\x20\x22','→\x20Project:\x20','floor','verbose','white','includes','done','run','Error:\x20Invalid\x20JSON\x20in\x20--params','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','deleted','No\x20workflows\x20found','session','newProjectId','slice','tasks','Setting\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Key\x20cannot\x20be\x20empty','splice','Failed\x20to\x20fetch\x20attempt\x20data','newProjectName','No\x20matching\x20sessions\x20found','revision','red','trim','\x20secret','error','green','LABEL_WIDTH_DIVISOR','skipValidation','attempt','✔\x20Project:\x20','yellow','pending','4745652klNLnU','select','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','trimEnd','📁\x20','attempts','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','listSecrets','Getting\x20attempt\x20tasks...','Retrying\x20attempt...','every','modified','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','No\x20workflow\x20tdx.json\x20found','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Source:\x20','existingProjectId','msPerChar','\x20has\x20no\x20attempts','from','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','fill','workflow:retry','\x20modified','868FhWAQL','yes','requireProject','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','some','Session\x20time:\x20','✔\x20Push\x20complete','MIN_LABEL_COUNT','push','✔\x20Project\x20updated','prepareCloneProject','workflow','No\x20workflows\x20found\x20in\x20project:\x20','Filter:\x20project=','isArray','workflow:delete','projects','preparePushProject','param','Listing\x20workflow\x20projects...','workflow:clone','Error:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','round','icon','.\x20Expected\x20format:\x20KEY=VALUE','Writing\x20files...','session_id','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','showWorkflowConsoleUrl','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','/attempt/','3596019clpXQF','No\x20attempts\x20found\x20for:\x20','workflow:timeline','min','Using\x20attempt\x20','📋\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Listing\x20workflow\x20attempts...','⚠\x20Showing\x20first\x20','Filter:\x20','Deleting\x20secret...','No\x20attempts\x20found','buildTimelineData','basename','summary','taskName','workflow:projects','\x22\x20already\x20exists\x20(ID:\x20'];a51_0x15a1=function(){return _0x38f735;};return a51_0x15a1();}function getBarColor(_0x5ef56b){const _0x22292a=a51_0x22a388,_0x3c9c10={'success':a51_0x5bf18c['green'],'error':a51_0x5bf18c[_0x22292a(0xf3)],'group_error':a51_0x5bf18c['red'],'running':a51_0x5bf18c[_0x22292a(0x1ed)],'blocked':a51_0x5bf18c[_0x22292a(0xfc)],'planned':a51_0x5bf18c[_0x22292a(0x1b0)],'canceling':a51_0x5bf18c[_0x22292a(0xfc)]};return _0x3c9c10[_0x5ef56b]||a51_0x5bf18c[_0x22292a(0xdf)];}function parseTaskName(_0x3baa75){const _0x4cb243=a51_0x22a388;let _0xf280cf=_0x3baa75[_0x4cb243(0x24f)](/^\++/,'');const _0x4f6d6f=_0xf280cf[_0x4cb243(0x22c)]('+'),_0xf94e53=_0x4f6d6f[_0x4cb243(0x221)]>0x1?_0x4f6d6f[_0x4cb243(0x221)]-0x2:0x0,_0x1ebcc0=_0x4f6d6f[_0x4f6d6f[_0x4cb243(0x221)]-0x1]||_0xf280cf;return{'level':_0xf94e53,'name':'+'+_0x1ebcc0};}function truncateTaskName(_0x8c2696,_0x3ed74c){const _0x342955=a51_0x22a388,_0x7b2fe4=stringWidth(_0x8c2696);if(_0x7b2fe4<=_0x3ed74c)return _0x8c2696;let _0x3e3a78=_0x8c2696;while(stringWidth(_0x3e3a78+'…')>_0x3ed74c&&_0x3e3a78[_0x342955(0x221)]>0x0){_0x3e3a78=_0x3e3a78['slice'](0x0,-0x1);}return _0x3e3a78+'…';}function calculateTimeScale(_0x1be0e0,_0x1b1ded){const _0x547c1f=a51_0x22a388;return{'startTime':_0x1be0e0[_0x547c1f(0xcb)],'endTime':_0x1be0e0[_0x547c1f(0x232)],'durationMs':_0x1be0e0[_0x547c1f(0x198)],'msPerChar':_0x1be0e0['duration']/_0x1b1ded};}function timeToPosition(_0xf050d0,_0x2e746d,_0x330eb4){const _0x309ec8=a51_0x22a388,_0x3cafe3=_0xf050d0-_0x2e746d[_0x309ec8(0x240)],_0x398b87=Math[_0x309ec8(0xdd)](_0x3cafe3/_0x2e746d[_0x309ec8(0x10f)]);return Math[_0x309ec8(0x170)](0x0,Math[_0x309ec8(0x13a)](_0x398b87,_0x330eb4));}function renderTimeAxis(_0x833dc2,_0x17cb8a){const _0x58cafe=a51_0x22a388,_0x4c6d9e=Math[_0x58cafe(0x13a)](TIMELINE_CONFIG[_0x58cafe(0x219)],Math[_0x58cafe(0x170)](TIMELINE_CONFIG[_0x58cafe(0x11d)],Math[_0x58cafe(0xdd)](_0x17cb8a/TIMELINE_CONFIG[_0x58cafe(0xf8)]))),_0x2896b7=_0x833dc2[_0x58cafe(0x207)]/(_0x4c6d9e-0x1),_0x3a9c8c=new Date(_0x833dc2['startTime']),_0x5964ec=[];for(let _0x2cdd58=0x0;_0x2cdd58<_0x4c6d9e;_0x2cdd58++){const _0x36ae95=_0x833dc2[_0x58cafe(0x240)]+_0x2cdd58*_0x2896b7,_0x20c2cf=timeToPosition(_0x36ae95,_0x833dc2,_0x17cb8a),_0x2a0dc2=formatTimestamp(_0x36ae95,_0x3a9c8c);_0x5964ec[_0x58cafe(0x11e)]({'pos':_0x20c2cf,'text':_0x2a0dc2});}const _0x292427=new Array(_0x17cb8a)['fill']('\x20');let _0x101a2c=-0x1;for(const {pos:_0x21ed09,text:_0x23d630}of _0x5964ec){let _0x233eb8=Math[_0x58cafe(0x170)](0x0,_0x21ed09-Math[_0x58cafe(0xdd)](_0x23d630[_0x58cafe(0x221)]/0x2));_0x233eb8<=_0x101a2c+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x233eb8=_0x101a2c+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x233eb8+_0x23d630[_0x58cafe(0x221)]>_0x17cb8a&&(_0x233eb8=_0x17cb8a-_0x23d630[_0x58cafe(0x221)]);if(_0x233eb8>=0x0&&_0x233eb8+_0x23d630['length']<=_0x17cb8a&&_0x233eb8>_0x101a2c){for(let _0x92766c=0x0;_0x92766c<_0x23d630['length'];_0x92766c++){_0x292427[_0x233eb8+_0x92766c]=_0x23d630[_0x92766c];}_0x101a2c=_0x233eb8+_0x23d630[_0x58cafe(0x221)]-0x1;}}return _0x292427['join']('');}function renderTaskRow(_0x1128de,_0x599c37,_0x3dc06b,_0x5cdd99){const _0x197ae4=a51_0x22a388,{level:_0x1085f0,name:_0x577bce}=parseTaskName(_0x1128de[_0x197ae4(0x174)]),_0x3b00d2='\x20'[_0x197ae4(0x245)](_0x1085f0),_0x471e4c=_0x1128de[_0x197ae4(0xb2)]?'('+formatElapsed(_0x1128de[_0x197ae4(0xb2)][_0x197ae4(0x198)])+')':'',_0x461c04=stringWidth(_0x471e4c),_0x163e85=_0x1085f0*0x1,_0x12d7b8=_0x5cdd99-_0x163e85-_0x461c04-0x1,_0x48db3e=truncateTaskName(_0x577bce,_0x12d7b8),_0x4da87e=_0x3b00d2+_0x48db3e,_0x4414ef=stringWidth(_0x4da87e),_0x1ce73a=_0x5cdd99-_0x4414ef-_0x461c04,_0x43a7d4=_0x4da87e+'\x20'[_0x197ae4(0x245)](Math['max'](0x1,_0x1ce73a))+a51_0x5bf18c['dim'](_0x471e4c),_0x192944=getTaskStateIcon(_0x1128de[_0x197ae4(0x210)]),_0x2fa108=new Array(_0x3dc06b)[_0x197ae4(0x113)]('\x20');if(_0x1128de[_0x197ae4(0xb2)]){const _0x25a88a=timeToPosition(_0x1128de[_0x197ae4(0xb2)]['start'],_0x599c37,_0x3dc06b),_0x458229=timeToPosition(_0x1128de[_0x197ae4(0xb2)][_0x197ae4(0x232)],_0x599c37,_0x3dc06b),_0x4b2c83=getBarChar(_0x1128de[_0x197ae4(0x210)]),_0xc585f8=Math['max'](_0x25a88a+0x1,_0x458229);for(let _0x243c73=_0x25a88a;_0x243c73<Math[_0x197ae4(0x13a)](_0xc585f8,_0x3dc06b);_0x243c73++){_0x2fa108[_0x243c73]=_0x4b2c83;}}const _0xb179ce=getBarColor(_0x1128de['state']),_0x19d77e=_0x2fa108[_0x197ae4(0x1de)](_0x432d7e=>_0x432d7e==='\x20'?'\x20':_0xb179ce(_0x432d7e))[_0x197ae4(0x192)]('');return _0x192944+'\x20'+_0x43a7d4+'│'+_0x19d77e+'│';}function calculateStats(_0x41b1cf){const _0x386e64=a51_0x22a388,_0x19d088={'total':_0x41b1cf['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x367ae1 of _0x41b1cf){if(_0x367ae1['state']===_0x386e64(0x179))_0x19d088[_0x386e64(0x179)]++;else{if(_0x367ae1[_0x386e64(0x210)]==='error'||_0x367ae1[_0x386e64(0x210)]===_0x386e64(0xc3))_0x19d088['error']++;else _0x367ae1[_0x386e64(0x210)]===_0x386e64(0x15b)?_0x19d088[_0x386e64(0x15b)]++:_0x19d088[_0x386e64(0xfd)]++;}}return _0x19d088;}function formatStats(_0x22b928){const _0x43738b=a51_0x22a388;return[_0x43738b(0x1eb)+_0x22b928[_0x43738b(0xa0)],'✅\x20'+_0x22b928[_0x43738b(0x179)],'❌\x20'+_0x22b928[_0x43738b(0xf6)],_0x43738b(0x213)+_0x22b928['running'],'⏳\x20'+_0x22b928[_0x43738b(0xfd)]][_0x43738b(0x192)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x22a388(0x174)]=a51_0x22a388(0x139);[a51_0x22a388(0x1b4)]=a51_0x22a388(0x100);async[a51_0x22a388(0xd2)](_0x5fdb59){const _0xf412ea=a51_0x22a388,{options:_0x530412,args:_0x40c661,tdx:_0x113432}=_0x5fdb59;let _0xfdbae8,_0x49e519,_0x1218c6=![];if(_0x40c661[0x0]){if(_0x40c661[0x0][_0xf412ea(0xe0)]('.')){const _0x12f5c7=this[_0xf412ea(0x227)](_0x40c661,_0x530412);if(!_0x12f5c7)return 0x1;_0xfdbae8=_0x12f5c7[_0xf412ea(0xb4)],_0x49e519=_0x12f5c7[_0xf412ea(0x1b6)];}else{_0x49e519=_0x40c661[0x0],_0xfdbae8=_0x530412['workflowProject'];if(!_0xfdbae8)return console[_0xf412ea(0xf6)](a51_0x5bf18c[_0xf412ea(0xf3)](_0xf412ea(0x1e0)),_0xf412ea(0x14e)),0x1;_0x1218c6=!![];}}else{const _0x28e7cc=this[_0xf412ea(0x227)](_0x40c661,_0x530412);if(!_0x28e7cc)return 0x1;_0xfdbae8=_0x28e7cc[_0xf412ea(0xb4)],_0x49e519=_0x28e7cc[_0xf412ea(0x1b6)];}if(_0x530412[_0xf412ea(0xde)]){if(_0xfdbae8&&_0x49e519)console[_0xf412ea(0xf6)]('Filter:\x20'+_0xfdbae8+'.'+_0x49e519);else _0xfdbae8&&console[_0xf412ea(0xf6)](_0xf412ea(0x123)+_0xfdbae8);}const _0x1bc6b7=_0x530412[_0xf412ea(0x173)],_0x4cbc63=_0x530412[_0xf412ea(0x214)];if(_0x1bc6b7){_0x4cbc63&&console[_0xf412ea(0xf6)](a51_0x5bf18c[_0xf412ea(0xfc)](_0xf412ea(0x16e)),_0xf412ea(0xc5));const _0x50132b=_0x530412[_0xf412ea(0x199)];return _0x50132b?await this[_0xf412ea(0xc7)](_0x5fdb59,_0x1bc6b7):await this[_0xf412ea(0x1b7)](_0x5fdb59,_0x1bc6b7,_0x530412),0x0;}if(_0x4cbc63){const _0x1b7101=await withSpinner(_0xf412ea(0x1f9),()=>_0x113432[_0xf412ea(0x121)][_0xf412ea(0x160)]({'projectName':_0xfdbae8,'workflowName':_0x49e519,'limit':0x64}),{'verbose':_0x530412[_0xf412ea(0xde)]}),_0x1d78cc=_0x1b7101[_0xf412ea(0x195)][_0xf412ea(0x20e)](_0x298ee6=>_0x298ee6['id']===_0x4cbc63);if(!_0x1d78cc)return console['error'](a51_0x5bf18c[_0xf412ea(0xf3)]('Error:'),'Session\x20not\x20found:\x20'+_0x4cbc63),0x1;if(!_0x1d78cc[_0xf412ea(0x225)]?.['id'])return console['error'](a51_0x5bf18c[_0xf412ea(0xf3)]('Error:'),_0xf412ea(0x1fb)+_0x4cbc63+_0xf412ea(0x110)),0x1;const _0x5eb2f6=_0x1d78cc['lastAttempt']['id'];_0x530412[_0xf412ea(0xde)]&&console[_0xf412ea(0xf6)](_0xf412ea(0x13b)+_0x5eb2f6+_0xf412ea(0x233)+_0x4cbc63);const _0x23a67a=_0x530412['follow'];return _0x23a67a?await this[_0xf412ea(0xc7)](_0x5fdb59,_0x5eb2f6):await this[_0xf412ea(0x1b7)](_0x5fdb59,_0x5eb2f6,_0x530412),0x0;}const _0x4dc11d=await withSpinner(_0xf412ea(0x18b),()=>_0x113432[_0xf412ea(0x121)]['sessions']({'projectName':_0xfdbae8,'workflowName':_0x49e519,'limit':_0x530412[_0xf412ea(0xa9)]||0x32}),{'verbose':_0x530412['verbose']}),_0x55a8b9=_0x4dc11d[_0xf412ea(0x195)];if(_0x55a8b9['length']===0x0){if(_0xfdbae8&&_0x49e519)console[_0xf412ea(0xf6)](_0xf412ea(0x177)+_0xfdbae8+'.'+_0x49e519);else _0xfdbae8?console[_0xf412ea(0xf6)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0xfdbae8):(console[_0xf412ea(0xf6)]('No\x20workflow\x20sessions\x20found'),console[_0xf412ea(0xf6)](a51_0x5bf18c[_0xf412ea(0x1b0)](_0xf412ea(0x1a0))));return 0x0;}_0x55a8b9['sort']((_0x2ab334,_0x422c27)=>{const _0x489a3e=_0xf412ea,_0x3569df=_0x2ab334[_0x489a3e(0x16a)]||'',_0x59f2af=_0x422c27[_0x489a3e(0x16a)]||'';return _0x59f2af[_0x489a3e(0xa1)](_0x3569df);});if(_0x530412[_0xf412ea(0x176)]||_0x530412['jsonl'])return await handleSDKOutput(_0x55a8b9,_0x530412),0x0;let _0x5c77c1;if(_0x1218c6){const _0x1c906e=_0x55a8b9[0x0];if(!_0x1c906e[_0xf412ea(0x225)]?.['id'])return console['error'](_0xf412ea(0xae)),0x0;_0x5c77c1=_0x1c906e[_0xf412ea(0x225)]['id'],_0x530412[_0xf412ea(0xde)]&&console['error'](_0xf412ea(0x18f)+_0x1c906e[_0xf412ea(0x16a)]);}else{const _0x2147ec=_0x55a8b9[_0xf412ea(0x1de)](_0x5b4679=>{const _0x1c46f3=_0xf412ea,_0x352be2=getAttemptStatusDisplay(_0x5b4679[_0x1c46f3(0x225)]);return{'title':_0x5b4679[_0x1c46f3(0x1fe)]?.[_0x1c46f3(0x174)]+'.'+_0x5b4679['workflow']?.['name']+'\x20-\x20'+_0x5b4679[_0x1c46f3(0x16a)]+'\x20'+_0x352be2[_0x1c46f3(0x12e)],'value':_0x5b4679[_0x1c46f3(0x225)]?.['id']||'','description':_0x352be2[_0x1c46f3(0x189)]};}),_0x2d0dab=await a51_0x4f4bd3({'type':_0xf412ea(0xff),'name':_0xf412ea(0x173),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2147ec['filter'](_0x170b7b=>_0x170b7b[_0xf412ea(0x1cf)]!=='')});if(!_0x2d0dab[_0xf412ea(0x173)])return 0x0;_0x5c77c1=_0x2d0dab[_0xf412ea(0x173)];}const _0x2621dd=_0x530412[_0xf412ea(0x199)];return _0x2621dd?await this[_0xf412ea(0xc7)](_0x5fdb59,_0x5c77c1):await this['renderSingleTimeline'](_0x5fdb59,_0x5c77c1,_0x530412),0x0;}async[a51_0x22a388(0x1b7)](_0x5ba2f8,_0x4411ac,_0x4e928c){const _0x2496ab=a51_0x22a388,{tdx:_0x3842bd}=_0x5ba2f8;let _0x47ba86,_0x540252;try{[_0x47ba86,_0x540252]=await Promise[_0x2496ab(0x236)]([_0x3842bd['workflow'][_0x2496ab(0xfa)](_0x4411ac),_0x3842bd[_0x2496ab(0x121)][_0x2496ab(0xea)](_0x4411ac,![])]);}catch(_0x46d48d){console['error'](a51_0x5bf18c[_0x2496ab(0xf3)](_0x2496ab(0xef)));_0x4e928c[_0x2496ab(0xde)]&&console[_0x2496ab(0xf6)](_0x46d48d);throw _0x46d48d;}if(_0x4e928c['json']||_0x4e928c['jsonl']){const _0x5dc369=this['buildTimelineData'](_0x47ba86,_0x540252);await handleSDKOutput([_0x5dc369],_0x4e928c);return;}const _0x398d2d=_0x3842bd[_0x2496ab(0x24b)][_0x2496ab(0x1e3)],_0x20abcc=this[_0x2496ab(0xab)](_0x47ba86,_0x540252,_0x398d2d);console[_0x2496ab(0x204)](_0x20abcc);}async['pollTimeline'](_0x599ba9,_0x4c8fa0){const _0x2710c5=a51_0x22a388,{tdx:_0x2967fb}=_0x599ba9,_0x633545=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x4db982=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x46b5fb=0x0;while(_0x46b5fb<_0x4db982){process[_0x2710c5(0x20b)][_0x2710c5(0x1ef)]&&process['stdout'][_0x2710c5(0xbc)]('\x1bc');let _0x192b6e,_0x3043fd;try{[_0x192b6e,_0x3043fd]=await Promise['all']([_0x2967fb[_0x2710c5(0x121)][_0x2710c5(0xfa)](_0x4c8fa0),_0x2967fb[_0x2710c5(0x121)][_0x2710c5(0xea)](_0x4c8fa0,![])]);}catch(_0x449b55){console[_0x2710c5(0xf6)](a51_0x5bf18c['red'](_0x2710c5(0x1c2)));_0x46b5fb>0x0&&console[_0x2710c5(0xf6)](a51_0x5bf18c[_0x2710c5(0x1b0)](_0x2710c5(0x1a3)+_0x46b5fb));throw _0x449b55;}const _0x21189b=_0x2967fb['context']['site'],_0x164116=this[_0x2710c5(0xab)](_0x192b6e,_0x3043fd,_0x21189b);console[_0x2710c5(0x204)](_0x164116);const _0x431c36=_0x192b6e['done']&&_0x3043fd[_0x2710c5(0x108)](_0x3e7268=>_0x3e7268[_0x2710c5(0x210)]!==_0x2710c5(0x15b)&&_0x3e7268[_0x2710c5(0x210)]!==_0x2710c5(0x20a));if(_0x431c36){console[_0x2710c5(0xf6)](a51_0x5bf18c['green'](_0x2710c5(0x218)));break;}console['error'](a51_0x5bf18c[_0x2710c5(0x1b0)](_0x2710c5(0x169)+_0x46b5fb*0x2+_0x2710c5(0x1e1))),await new Promise(_0x32808d=>setTimeout(_0x32808d,_0x633545)),_0x46b5fb++;}_0x46b5fb>=_0x4db982&&console[_0x2710c5(0xf6)](a51_0x5bf18c['yellow'](_0x2710c5(0x14a)));}['renderTimeline'](_0x389b06,_0x293148,_0x300f97){const _0x41e783=a51_0x22a388,_0x404767=[],_0x428e9c=TIMELINE_CONFIG[_0x41e783(0x1ab)],_0x56930f=0x5,_0x1e7aeb=process[_0x41e783(0x20b)]['columns']||0x78,_0x58487a=_0x1e7aeb-_0x428e9c-_0x56930f,_0x437dbf=Math[_0x41e783(0x170)](TIMELINE_CONFIG[_0x41e783(0x180)],Math['min'](_0x58487a,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x41223d=new Date(_0x389b06['createdAt'])[_0x41e783(0x1dc)](),_0x223a40=_0x389b06['finishedAt']?new Date(_0x389b06['finishedAt'])[_0x41e783(0x1dc)]():Date[_0x41e783(0x23d)](),_0x40ecac={'start':_0x41223d,'end':_0x223a40,'duration':_0x223a40-_0x41223d},_0x4702db=new Map(),_0x5a1e7c=[];for(const _0x29195c of _0x293148){if(_0x29195c[_0x41e783(0x19b)]){const _0x4a8f90=new Date(_0x29195c[_0x41e783(0x19b)])['getTime'](),_0x3719dd=_0x29195c[_0x41e783(0x212)]?new Date(_0x29195c[_0x41e783(0x212)])[_0x41e783(0x1dc)]():Date[_0x41e783(0x23d)](),_0x45519d={'start':_0x4a8f90,'end':_0x3719dd,'duration':_0x3719dd-_0x4a8f90};_0x4702db[_0x41e783(0x9a)](_0x29195c['id'],_0x45519d),_0x5a1e7c[_0x41e783(0x11e)]({'name':_0x29195c[_0x41e783(0x163)],'state':_0x29195c['state']||_0x41e783(0x250),'window':_0x45519d});}else _0x5a1e7c[_0x41e783(0x11e)]({'name':_0x29195c[_0x41e783(0x163)],'state':_0x29195c[_0x41e783(0x210)]||'planned','window':undefined});}_0x5a1e7c[_0x41e783(0x248)]((_0x314cf8,_0x5ac8a6)=>{const _0x5e6741=_0x41e783;if(!_0x314cf8['window'])return 0x1;if(!_0x5ac8a6[_0x5e6741(0xb2)])return-0x1;return _0x314cf8[_0x5e6741(0xb2)]['start']-_0x5ac8a6[_0x5e6741(0xb2)][_0x5e6741(0xcb)];});const _0x47d01e=_0x5a1e7c['length'],_0x103da3=_0x47d01e>TIMELINE_CONFIG[_0x41e783(0x1a7)];_0x103da3&&_0x5a1e7c[_0x41e783(0xee)](TIMELINE_CONFIG[_0x41e783(0x1a7)]);const _0xd56400=calculateTimeScale(_0x40ecac,_0x437dbf),_0x16d7b7=_0x389b06[_0x41e783(0xe1)]?_0x389b06['success']?a51_0x5bf18c[_0x41e783(0xf7)](_0x41e783(0x179)):a51_0x5bf18c[_0x41e783(0xf3)]('error'):a51_0x5bf18c[_0x41e783(0x1ed)](_0x41e783(0x15b)),_0x352435=_0x389b06['project']?.['id'],_0x4dc04c=_0x389b06[_0x41e783(0x214)];let _0x2adc11;if(_0x352435&&_0x4dc04c){const _0x74c979=getWorkflowAttemptUrl(_0x300f97,_0x352435,_0x4dc04c,_0x389b06['id']);_0x2adc11=hyperlink(a51_0x5bf18c[_0x41e783(0x1b0)](_0x389b06['id']),_0x74c979);}else _0x2adc11=a51_0x5bf18c[_0x41e783(0x1b0)](_0x389b06['id']);_0x404767[_0x41e783(0x11e)](_0x41e783(0x1e2)+_0x2adc11+'\x20-\x20'+_0x16d7b7+'\x20-\x20'+formatElapsed(_0x40ecac[_0x41e783(0x198)]));if(_0x5a1e7c['length']>0x0){const _0x283e7f=renderTimeAxis(_0xd56400,_0x437dbf),_0x1f1934=new Date(_0x40ecac[_0x41e783(0xcb)]),_0x8f474=formatDate(_0x1f1934),_0x35475b=TIMELINE_CONFIG[_0x41e783(0x1ae)]+TIMELINE_CONFIG[_0x41e783(0x167)]+_0x428e9c,_0x374828=_0x8f474[_0x41e783(0x17d)](_0x35475b),_0x198669=a51_0x5bf18c[_0x41e783(0x1b0)](_0x374828);_0x404767[_0x41e783(0x11e)](_0x198669+'\x20'+_0x283e7f);for(const _0x508d6e of _0x5a1e7c){_0x404767['push'](renderTaskRow(_0x508d6e,_0xd56400,_0x437dbf,_0x428e9c));}const _0x30e6dc=calculateStats(_0x5a1e7c);_0x404767[_0x41e783(0x11e)](formatStats(_0x30e6dc)),_0x103da3&&_0x404767[_0x41e783(0x11e)](a51_0x5bf18c[_0x41e783(0xfc)](_0x41e783(0x13f)+TIMELINE_CONFIG[_0x41e783(0x1a7)]+_0x41e783(0xb0)+_0x47d01e+_0x41e783(0x16b))),_0x404767[_0x41e783(0x11e)](''),_0x404767[_0x41e783(0x11e)](a51_0x5bf18c[_0x41e783(0x1b0)]('💡\x20Tip:\x20Use\x20')+(_0x41e783(0x9e)+_0x389b06['id']+_0x41e783(0x155))+a51_0x5bf18c[_0x41e783(0x1b0)]('\x20to\x20see\x20detailed\x20logs'));}else _0x404767[_0x41e783(0x11e)](_0x41e783(0x1a1));return _0x404767[_0x41e783(0x192)]('\x0a');}[a51_0x22a388(0x143)](_0x4deb58,_0xabdca1){const _0x3a31bc=a51_0x22a388,_0x14f863=new Date(_0x4deb58['createdAt'])[_0x3a31bc(0x1dc)](),_0x393b96=_0x4deb58[_0x3a31bc(0x1d3)]?new Date(_0x4deb58[_0x3a31bc(0x1d3)])[_0x3a31bc(0x1dc)]():Date[_0x3a31bc(0x23d)](),_0x2d0707=_0x393b96-_0x14f863,_0x34df82=[];for(const _0x451573 of _0xabdca1){if(_0x451573[_0x3a31bc(0x19b)]){const _0x6e2d6=new Date(_0x451573[_0x3a31bc(0x19b)])['getTime'](),_0x3df4ab=_0x451573['updatedAt']?new Date(_0x451573[_0x3a31bc(0x212)])[_0x3a31bc(0x1dc)]():Date['now']();_0x34df82[_0x3a31bc(0x11e)]({'name':_0x451573[_0x3a31bc(0x163)],'state':_0x451573[_0x3a31bc(0x210)]||_0x3a31bc(0x250),'window':{'start':_0x6e2d6,'end':_0x3df4ab,'duration':_0x3df4ab-_0x6e2d6}});}else _0x34df82[_0x3a31bc(0x11e)]({'name':_0x451573[_0x3a31bc(0x163)],'state':_0x451573[_0x3a31bc(0x210)]||'planned','window':undefined});}const _0x215478=calculateStats(_0x34df82);return{'attempt':{'id':_0x4deb58['id'],'status':_0x4deb58[_0x3a31bc(0xe1)]?_0x4deb58[_0x3a31bc(0x179)]?'success':'error':'running','createdAt':_0x4deb58[_0x3a31bc(0x151)],'finishedAt':_0x4deb58['finishedAt'],'duration_ms':_0x2d0707},'tasks':_0x34df82[_0x3a31bc(0x1de)](_0x3ef098=>({'name':_0x3ef098[_0x3a31bc(0x174)],'state':_0x3ef098[_0x3a31bc(0x210)],'startedAt':_0x3ef098['window']?new Date(_0x3ef098[_0x3a31bc(0xb2)][_0x3a31bc(0xcb)])[_0x3a31bc(0x1f8)]():null,'updatedAt':_0x3ef098[_0x3a31bc(0xb2)]?new Date(_0x3ef098[_0x3a31bc(0xb2)]['end'])[_0x3a31bc(0x1f8)]():null,'duration_ms':_0x3ef098[_0x3a31bc(0xb2)]?.[_0x3a31bc(0x198)]||null})),'stats':_0x215478};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- function a52_0x28fb(){const _0xeb2c86=['8CswmFL','5286cPAJzx','4770PUyjsn','version','3054921httbaS',';\x20node/','tdx','X-Trino-User','entries','length','10429038Tymsba','TD1\x20','3956909WFMhAJ','Authorization','10okTQzi','456842AtQorj','Bearer\x20','5236574ukgLIz','4ODAaAD','21108216pZRSPo','1tgLbbe'];a52_0x28fb=function(){return _0xeb2c86;};return a52_0x28fb();}(function(_0x57edd7,_0x3a3ef1){const _0x35dca0=a52_0x8b7e,_0x38ec39=_0x57edd7();while(!![]){try{const _0x18e10b=-parseInt(_0x35dca0(0x1ba))/0x1*(parseInt(_0x35dca0(0x1b5))/0x2)+parseInt(_0x35dca0(0x1aa))/0x3*(-parseInt(_0x35dca0(0x1b8))/0x4)+-parseInt(_0x35dca0(0x1bd))/0x5*(-parseInt(_0x35dca0(0x1bc))/0x6)+parseInt(_0x35dca0(0x1b7))/0x7*(parseInt(_0x35dca0(0x1bb))/0x8)+-parseInt(_0x35dca0(0x1b0))/0x9+parseInt(_0x35dca0(0x1b4))/0xa*(-parseInt(_0x35dca0(0x1b2))/0xb)+parseInt(_0x35dca0(0x1b9))/0xc;if(_0x18e10b===_0x3a3ef1)break;else _0x38ec39['push'](_0x38ec39['shift']());}catch(_0x20ede8){_0x38ec39['push'](_0x38ec39['shift']());}}}(a52_0x28fb,0x8e2c9));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x538826=a52_0x8b7e,_0x5e95cd=getVersion(),_0x232dfb=platform(),_0x4b76dd=process[_0x538826(0x1a9)]['replace']('v','');return'tdx/'+_0x5e95cd+'\x20('+_0x232dfb+_0x538826(0x1ab)+_0x4b76dd+')';}function a52_0x8b7e(_0x8e3f36,_0x269502){_0x8e3f36=_0x8e3f36-0x1a9;const _0x28fb1a=a52_0x28fb();let _0x8b7ea8=_0x28fb1a[_0x8e3f36];return _0x8b7ea8;}export function getAuthHeaders(_0x2e3775,_0x2205f3,_0x1a1adc){const _0x2bfe1c=a52_0x8b7e,_0x1f12a0=getVersion(),_0x385cc5={'User-Agent':getUserAgent(),'X-TD-Client':_0x2bfe1c(0x1ac),'X-TD-Client-Version':_0x1f12a0};if(_0x1a1adc)_0x385cc5[_0x2bfe1c(0x1b3)]=_0x2bfe1c(0x1b6)+_0x1a1adc;else _0x2205f3&&(_0x385cc5['Authorization']=_0x2bfe1c(0x1b1)+_0x2205f3);return _0x385cc5;}export function toHeaderRecord(_0x27fd1c){const _0xeb1adc=a52_0x8b7e,_0x6126d3={};for(const [_0x319f01,_0x1ed4ca]of Object[_0xeb1adc(0x1ae)](_0x27fd1c)){_0x1ed4ca!==undefined&&(_0x6126d3[_0x319f01]=_0x1ed4ca);}return _0x6126d3;}export function getTrinoHeaders(_0x38476d,_0x2afbce,_0x14af7a){const _0x56a1d0=a52_0x8b7e,_0x54f38b=getAuthHeaders(_0x38476d),_0x491aa9=toHeaderRecord(_0x54f38b);if(_0x14af7a)_0x491aa9['Authorization']=_0x56a1d0(0x1b6)+_0x14af7a;else _0x2afbce&&(_0x491aa9[_0x56a1d0(0x1ad)]=_0x2afbce);return _0x491aa9;}export function hasAPIKey(_0x9d584){const _0x1c5480=a52_0x8b7e,_0xe3ccf2=getAPIKey();return _0xe3ccf2!==undefined&&_0xe3ccf2[_0x1c5480(0x1af)]>0x0;}
1
+ (function(_0x3fbb44,_0x58b8ca){const _0x47b0d4=a52_0x242e,_0x48396e=_0x3fbb44();while(!![]){try{const _0x3f6c1d=-parseInt(_0x47b0d4(0x16a))/0x1*(parseInt(_0x47b0d4(0x164))/0x2)+-parseInt(_0x47b0d4(0x173))/0x3+parseInt(_0x47b0d4(0x172))/0x4*(parseInt(_0x47b0d4(0x16c))/0x5)+-parseInt(_0x47b0d4(0x16d))/0x6*(parseInt(_0x47b0d4(0x168))/0x7)+parseInt(_0x47b0d4(0x16f))/0x8*(-parseInt(_0x47b0d4(0x167))/0x9)+parseInt(_0x47b0d4(0x174))/0xa+-parseInt(_0x47b0d4(0x162))/0xb*(-parseInt(_0x47b0d4(0x169))/0xc);if(_0x3f6c1d===_0x58b8ca)break;else _0x48396e['push'](_0x48396e['shift']());}catch(_0x297984){_0x48396e['push'](_0x48396e['shift']());}}}(a52_0x15e1,0xc4c95));import{platform}from'os';function a52_0x242e(_0x2c233e,_0x5c9922){_0x2c233e=_0x2c233e-0x161;const _0x15e15e=a52_0x15e1();let _0x242e45=_0x15e15e[_0x2c233e];return _0x242e45;}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a52_0x15e1(){const _0x545f87=['X-Trino-User','898020jpHeux','3829119sRaGzQ','7695580dyNziT','replace','52367656bLURRC','Bearer\x20','2707596HjnVdM','entries','version','13806OPFvrO','8763783kNmjRh','12JmhWgg','1jpKQQg','length','15fxbpjK','6qvEIvc','Authorization','7904dVZINx','TD1\x20'];a52_0x15e1=function(){return _0x545f87;};return a52_0x15e1();}export function getUserAgent(){const _0x459d6e=a52_0x242e,_0x43966e=getVersion(),_0x1b9ed7=platform(),_0x31f743=process[_0x459d6e(0x166)][_0x459d6e(0x161)]('v','');return'tdx/'+_0x43966e+'\x20('+_0x1b9ed7+';\x20node/'+_0x31f743+')';}export function getAuthHeaders(_0x2b9c67,_0x390ebf,_0x2b4229){const _0x1f5b08=a52_0x242e,_0x442127=getVersion(),_0x41bb72={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x442127};if(_0x2b4229)_0x41bb72[_0x1f5b08(0x16e)]=_0x1f5b08(0x163)+_0x2b4229;else _0x390ebf&&(_0x41bb72[_0x1f5b08(0x16e)]=_0x1f5b08(0x170)+_0x390ebf);return _0x41bb72;}export function toHeaderRecord(_0x2f8bc2){const _0x3cc974=a52_0x242e,_0x3d2ec9={};for(const [_0x520420,_0x4826c3]of Object[_0x3cc974(0x165)](_0x2f8bc2)){_0x4826c3!==undefined&&(_0x3d2ec9[_0x520420]=_0x4826c3);}return _0x3d2ec9;}export function getTrinoHeaders(_0x4ae0a3,_0x18a2bb,_0x1dfa5d){const _0x19cee0=a52_0x242e,_0x58aad4=getAuthHeaders(_0x4ae0a3),_0xa1e1fa=toHeaderRecord(_0x58aad4);if(_0x1dfa5d)_0xa1e1fa[_0x19cee0(0x16e)]=_0x19cee0(0x163)+_0x1dfa5d;else _0x18a2bb&&(_0xa1e1fa[_0x19cee0(0x171)]=_0x18a2bb);return _0xa1e1fa;}export function hasAPIKey(_0x2340a2){const _0x5f2e23=a52_0x242e,_0x1523ad=getAPIKey();return _0x1523ad!==undefined&&_0x1523ad[_0x5f2e23(0x16b)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x56f4b3,_0x12ebd8){const _0x57e244=a53_0xa97c,_0x272af1=_0x56f4b3();while(!![]){try{const _0x580e4f=parseInt(_0x57e244(0x11d))/0x1*(parseInt(_0x57e244(0xf3))/0x2)+-parseInt(_0x57e244(0x10d))/0x3+parseInt(_0x57e244(0xe2))/0x4+-parseInt(_0x57e244(0x126))/0x5+parseInt(_0x57e244(0xf9))/0x6+parseInt(_0x57e244(0x108))/0x7+-parseInt(_0x57e244(0x11f))/0x8*(parseInt(_0x57e244(0x101))/0x9);if(_0x580e4f===_0x12ebd8)break;else _0x272af1['push'](_0x272af1['shift']());}catch(_0x146bac){_0x272af1['push'](_0x272af1['shift']());}}}(a53_0x5b27,0x9dd0c));function a53_0xa97c(_0x4d6961,_0x136193){_0x4d6961=_0x4d6961-0xdc;const _0x5b27c2=a53_0x5b27();let _0xa97c17=_0x5b27c2[_0x4d6961];return _0xa97c17;}import{writeFileSync}from'fs';import{spawn}from'child_process';function a53_0x5b27(){const _0x5d45e0=['object','stderr','7700220XIfPxA','jsonl','join','double','push','stringify','json','varchar','3658815fIlZgY','red','FINISHED','[error]','limit','[params]','isTTY','4081189yJbHsq','Results\x20saved\x20to\x20','pipe','log','stdin','2465250nzOZZx','repeat','query','─┴─','[rule]','color','limitStructuredFormats','less','padEnd','trim','list','number','end','forEach','bigint','spawn','2ijDfXj','close','16xjubxS','entries','sdk-result','split','stdout','cyan','params','3423630rOVhaw','string','table','filter','rule','boolean','max','2044908LfzNKb','isFinite','keys','noColor','format','length','─┬─','yellow','debug','bold','data','map','resolve','-FXRSn','tsv','error','cmdout','588334OeynYL','blue','slice','output'];a53_0x5b27=function(){return _0x5d45e0;};return a53_0x5b27();}import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a53_0x204530 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xfe13b8){const _0x328e25=a53_0xa97c;return _0xfe13b8['format']===_0x328e25(0xff)||_0xfe13b8[_0x328e25(0xe6)]===_0x328e25(0xfa)||_0xfe13b8[_0x328e25(0xe6)]===_0x328e25(0xf0)||_0xfe13b8['format']===_0x328e25(0xdd)||_0xfe13b8[_0x328e25(0xff)]===!![]||_0xfe13b8[_0x328e25(0xfa)]===!![]||_0xfe13b8[_0x328e25(0xf0)]===!![]||_0xfe13b8[_0x328e25(0xdd)]===!![];}export function parseOutputOptions(_0x228bb5){const _0x124477=a53_0xa97c;return{'format':_0x228bb5[_0x124477(0xe6)]||_0x124477(0xdd),'output':_0x228bb5[_0x124477(0xf6)]||'','limit':_0x228bb5[_0x124477(0x105)],'limitStructuredFormats':_0x228bb5[_0x124477(0x113)],'color':_0x228bb5[_0x124477(0x112)],'noColor':_0x228bb5[_0x124477(0xe5)]};}function convertSDKResultToQueryResult(_0x2600ad){const _0x2e999c=a53_0xa97c,_0x948c23=[];if(_0x2600ad[_0x2e999c(0xe7)]>0x0){const _0x2fd086=_0x2600ad[0x0];for(const [_0x6d802a,_0x1de6ac]of Object['entries'](_0x2fd086)){let _0x23c5f4=_0x2e999c(0x100);if(typeof _0x1de6ac===_0x2e999c(0x118))_0x23c5f4=Number['isInteger'](_0x1de6ac)?_0x2e999c(0x11b):_0x2e999c(0xfc);else{if(typeof _0x1de6ac===_0x2e999c(0xe0))_0x23c5f4=_0x2e999c(0xe0);else _0x1de6ac===null&&(_0x23c5f4=_0x2e999c(0x100));}_0x948c23['push']({'name':_0x6d802a,'type':_0x23c5f4});}}return{'queryId':_0x2e999c(0x121),'columns':_0x948c23,'data':_0x2600ad,'stats':{'state':_0x2e999c(0x103),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2600ad['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0xdc61c9,_0x16cacc){const _0x5126fc=convertSDKResultToQueryResult(_0xdc61c9);return formatQueryOutput(_0x5126fc,_0x16cacc);}export async function formatQueryOutput(_0x284746,_0x32cf5e){const _0x5865c0=a53_0xa97c,{format:_0x118d5c,limit:_0x4426a2,output:_0x45783c,color:_0x1b937d,noColor:_0xca9de7,limitStructuredFormats:_0x411125}=_0x32cf5e,_0x5378a9=Boolean(_0x45783c)&&!_0x1b937d,_0x39417b={'color':_0x1b937d,'noColor':_0xca9de7||_0x5378a9};if(_0x118d5c===_0x5865c0(0xdd)){const _0x62da82=shouldUseLess(_0x118d5c,_0x45783c);return formatAsTable(_0x284746,_0x4426a2,_0x62da82,_0x39417b);}const _0x1e83d7=_0x411125&&Number[_0x5865c0(0xe3)](_0x4426a2)&&_0x284746['data'][_0x5865c0(0xe7)]>_0x4426a2?{..._0x284746,'data':_0x284746[_0x5865c0(0xec)][_0x5865c0(0xf5)](0x0,_0x4426a2)}:_0x284746;if(_0x118d5c===_0x5865c0(0xff))return formatAsJSON(_0x1e83d7,_0x39417b);else return _0x118d5c===_0x5865c0(0xfa)?formatAsJSONL(_0x1e83d7,_0x39417b):formatQueryResult(_0x1e83d7,_0x118d5c);}function shouldUseLess(_0x346ff4,_0x46456f){const _0x1b73cb=a53_0xa97c;return(_0x346ff4===_0x1b73cb(0xdd)||_0x346ff4===_0x1b73cb(0x117))&&process[_0x1b73cb(0x123)][_0x1b73cb(0x107)]&&!_0x46456f;}export function resolveOutputOptions(_0x429532){const _0x2f4e06=a53_0xa97c,_0x23be91=_0x429532[_0x2f4e06(0xf6)]||'',_0x166327=resolveOutputFormat(_0x429532[_0x2f4e06(0xe6)],_0x23be91,_0x2f4e06(0xdd));let _0x557107=typeof _0x429532[_0x2f4e06(0x105)]===_0x2f4e06(0x118)?_0x429532['limit']:parseInt(_0x429532[_0x2f4e06(0x105)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x429532[_0x2f4e06(0x105)]===undefined&&shouldUseLess(_0x166327,_0x23be91)&&(_0x557107=Infinity),{'format':_0x166327,'output':_0x23be91,'limit':_0x557107,'limitStructuredFormats':_0x429532[_0x2f4e06(0x113)],'color':_0x429532[_0x2f4e06(0x112)],'noColor':_0x429532[_0x2f4e06(0xe5)]};}export function writeOutput(_0x4d1be7,_0x58ccc9,_0xc24c37){const _0x2bd318=a53_0xa97c;return _0x58ccc9?(writeFileSync(_0x58ccc9,_0x4d1be7),console[_0x2bd318(0xf1)](_0x2bd318(0x109)+_0x58ccc9),Promise[_0x2bd318(0xee)]()):shouldUseLess(_0xc24c37||'','')?new Promise(_0x46b871=>{const _0x38c5a9=_0x2bd318,_0x892729=spawn(_0x38c5a9(0x114),[_0x38c5a9(0xef)],{'stdio':[_0x38c5a9(0x10a),'inherit','inherit']});let _0x91f547=![];_0x892729['on'](_0x38c5a9(0xf1),()=>{const _0x57c8ad=_0x38c5a9;!_0x91f547&&(_0x91f547=!![],console[_0x57c8ad(0x10b)](_0x4d1be7),_0x46b871());}),_0x892729['on'](_0x38c5a9(0x11e),()=>{!_0x91f547&&(_0x91f547=!![],_0x46b871());}),_0x892729['on'](_0x38c5a9(0x11c),()=>{const _0x2dbc81=_0x38c5a9;!_0x91f547&&_0x892729[_0x2dbc81(0x10c)]&&(_0x892729[_0x2dbc81(0x10c)]['on'](_0x2dbc81(0xf1),()=>{}),_0x892729[_0x2dbc81(0x10c)]['write'](_0x4d1be7),_0x892729[_0x2dbc81(0x10c)][_0x2dbc81(0x119)]());}),!_0x892729[_0x38c5a9(0x10c)]&&(!_0x91f547&&(_0x91f547=!![],console[_0x38c5a9(0x10b)](_0x4d1be7),_0x46b871()));}):(console[_0x2bd318(0x10b)](_0x4d1be7),Promise[_0x2bd318(0xee)]());}export async function handleSDKOutput(_0x15d6f5,_0x1ba47f){const _0x2ade90=a53_0xa97c,_0xf57143=resolveOutputOptions(_0x1ba47f),_0x241028=await formatSDKOutput(_0x15d6f5,_0xf57143);await writeOutput(_0x241028,_0xf57143[_0x2ade90(0xf6)]||undefined,_0xf57143[_0x2ade90(0xe6)]);}export async function handleQueryOutput(_0x3182ff,_0x556a17){const _0x4926bd=a53_0xa97c,_0x538206=resolveOutputOptions(_0x556a17),_0x3d0c79=await formatQueryOutput(_0x3182ff,_0x538206);await writeOutput(_0x3d0c79,_0x538206[_0x4926bd(0xf6)]||undefined,_0x538206[_0x4926bd(0xe6)]);}async function formatSingleObject(_0x455cd7,_0x3b2e0c){const _0x580c04=a53_0xa97c,{format:_0x1eec20,color:_0x538626,noColor:_0x3cdfd1}=_0x3b2e0c,_0x23f04f={'color':_0x538626,'noColor':_0x3cdfd1};if(_0x1eec20===_0x580c04(0xff)){if(shouldUseColor(_0x23f04f))return colorizeJSON(_0x455cd7,_0x23f04f);return JSON[_0x580c04(0xfe)](_0x455cd7,null,0x2);}else{if(_0x1eec20===_0x580c04(0xfa)){if(shouldUseColor(_0x23f04f))return colorizeJSONCompact(_0x455cd7,_0x23f04f);return JSON[_0x580c04(0xfe)](_0x455cd7);}else{if(_0x1eec20===_0x580c04(0xf0))return Object[_0x580c04(0x120)](_0x455cd7)[_0x580c04(0xed)](([_0x28492d,_0x240142])=>_0x28492d+'\x09'+_0x240142)['join']('\x0a');else{const _0x3bb4d3=Object[_0x580c04(0x120)](_0x455cd7);if(_0x3bb4d3[_0x580c04(0xe7)]===0x0)return'No\x20data';const _0x28d596=_0x455cd7[_0x580c04(0xea)],_0x498d2d=_0x455cd7[_0x580c04(0x10f)],_0x495985=_0x455cd7[_0x580c04(0x125)],_0xfb9760=_0x455cd7[_0x580c04(0xdf)],_0x5a731d=_0x498d2d?typeof _0x498d2d===_0x580c04(0xdc)?_0x498d2d:JSON[_0x580c04(0xfe)](_0x498d2d,null,0x2):undefined,_0x312b01=_0x495985&&Object['keys'](_0x495985)[_0x580c04(0xe7)]>0x0?JSON[_0x580c04(0xfe)](_0x495985,null,0x2):undefined,_0x2743ee=_0xfb9760&&Object[_0x580c04(0xe4)](_0xfb9760)[_0x580c04(0xe7)]>0x0?JSON[_0x580c04(0xfe)](_0xfb9760,null,0x2):undefined,_0x429a24=_0x3bb4d3[_0x580c04(0xde)](([_0x567ae4])=>_0x567ae4!==_0x580c04(0xea)&&_0x567ae4!==_0x580c04(0x10f)&&_0x567ae4!==_0x580c04(0x125)&&_0x567ae4!==_0x580c04(0xdf)),_0x4bec1b=Math[_0x580c04(0xe1)](..._0x429a24[_0x580c04(0xed)](([_0x24cf04])=>_0x24cf04['length'])),_0x2028ef=Math[_0x580c04(0xe1)](..._0x429a24['map'](([,_0x495018])=>{const _0x19623a=_0x580c04;try{const _0x30e80f=_0x495018===null||_0x495018===undefined?'':typeof _0x495018===_0x19623a(0xf7)?JSON[_0x19623a(0xfe)](_0x495018):String(_0x495018),_0x2a94ad=_0x30e80f['split']('\x0a');return Math[_0x19623a(0xe1)](..._0x2a94ad[_0x19623a(0xed)](_0x34414b=>_0x34414b['length']),0x0);}catch{return 0x0;}}),0x14),_0x129f08=[];_0x129f08[_0x580c04(0xfd)](colorBorder('┌─'+'─'[_0x580c04(0x10e)](_0x4bec1b)+_0x580c04(0xe8)+'─'[_0x580c04(0x10e)](_0x2028ef)+'─┐',_0x23f04f)),_0x429a24[_0x580c04(0x11a)](([_0x481225,_0x2ede15])=>{const _0x53438c=_0x580c04;let _0x78844a;try{_0x78844a=_0x2ede15===null||_0x2ede15===undefined?'':typeof _0x2ede15==='object'?JSON[_0x53438c(0xfe)](_0x2ede15):String(_0x2ede15);}catch{_0x78844a='[Object]';}const _0x285dcb=_0x481225[_0x53438c(0x115)](_0x4bec1b),_0x92269b=_0x78844a[_0x53438c(0x122)]('\x0a');_0x92269b[_0x53438c(0x11a)]((_0x47e081,_0x57905d)=>{const _0xc8fe82=_0x53438c,_0x2711ea=colorBorder('│',_0x23f04f);_0x57905d===0x0?_0x129f08[_0xc8fe82(0xfd)](_0x2711ea+'\x20'+_0x285dcb+'\x20'+_0x2711ea+'\x20'+_0x47e081['padEnd'](_0x2028ef)+'\x20'+_0x2711ea):_0x129f08[_0xc8fe82(0xfd)](_0x2711ea+'\x20'+'\x20'[_0xc8fe82(0x10e)](_0x4bec1b)+'\x20'+_0x2711ea+'\x20'+_0x47e081[_0xc8fe82(0x115)](_0x2028ef)+'\x20'+_0x2711ea);});}),_0x129f08[_0x580c04(0xfd)](colorBorder('└─'+'─'[_0x580c04(0x10e)](_0x4bec1b)+_0x580c04(0x110)+'─'[_0x580c04(0x10e)](_0x2028ef)+'─┘',_0x23f04f));_0x5a731d&&(_0x129f08[_0x580c04(0xfd)](''),_0x129f08[_0x580c04(0xfd)](String(a53_0x204530[_0x580c04(0xe9)]['bold']('[query]'))),_0x129f08[_0x580c04(0xfd)](_0x5a731d));_0x312b01&&(_0x129f08[_0x580c04(0xfd)](''),_0x129f08['push'](String(a53_0x204530[_0x580c04(0xf4)][_0x580c04(0xeb)](_0x580c04(0x106)))),_0x129f08[_0x580c04(0xfd)](_0x312b01));_0x2743ee&&(_0x129f08[_0x580c04(0xfd)](''),_0x129f08[_0x580c04(0xfd)](String(a53_0x204530['magenta'][_0x580c04(0xeb)](_0x580c04(0x111)))),_0x129f08[_0x580c04(0xfd)](_0x2743ee));if(_0x28d596){if(_0x28d596['stderr']){_0x129f08[_0x580c04(0xfd)](''),_0x129f08[_0x580c04(0xfd)](String(a53_0x204530[_0x580c04(0x102)]['bold'](_0x580c04(0x104))));const _0x175409=_0x28d596[_0x580c04(0xf8)]['split']('\x0a');_0x175409['forEach'](_0xdf2c5d=>{const _0x4c6309=_0x580c04;_0xdf2c5d['trim']()&&_0x129f08[_0x4c6309(0xfd)](_0xdf2c5d);});}if(_0x28d596['cmdout']){_0x129f08[_0x580c04(0xfd)](''),_0x129f08[_0x580c04(0xfd)](String(a53_0x204530[_0x580c04(0x124)][_0x580c04(0xeb)]('[logs]')));const _0x596e8e=_0x28d596[_0x580c04(0xf2)]['split']('\x0a');_0x596e8e[_0x580c04(0x11a)](_0x3ad5bc=>{const _0x4f65c5=_0x580c04;_0x3ad5bc[_0x4f65c5(0x116)]()&&_0x129f08[_0x4f65c5(0xfd)](_0x3ad5bc);});}}return _0x129f08[_0x580c04(0xfb)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x37a2a5,_0x1487d0){const _0x5013b5=a53_0xa97c;if(_0x1487d0[_0x5013b5(0xe6)]===_0x5013b5(0xdd)){await handleSDKOutput([_0x37a2a5],_0x1487d0);return;}const _0x3f9cb2=resolveOutputOptions(_0x1487d0),_0x1b3f1b=await formatSingleObject(_0x37a2a5,_0x3f9cb2);await writeOutput(_0x1b3f1b,_0x3f9cb2[_0x5013b5(0xf6)]||undefined,_0x3f9cb2[_0x5013b5(0xe6)]);}
1
+ (function(_0x44f65f,_0xe75728){const _0x2e3210=a53_0x5ef9,_0x233248=_0x44f65f();while(!![]){try{const _0x418919=-parseInt(_0x2e3210(0x1bb))/0x1+parseInt(_0x2e3210(0x1c3))/0x2+-parseInt(_0x2e3210(0x197))/0x3*(-parseInt(_0x2e3210(0x1a0))/0x4)+parseInt(_0x2e3210(0x1bf))/0x5*(-parseInt(_0x2e3210(0x188))/0x6)+parseInt(_0x2e3210(0x18e))/0x7*(-parseInt(_0x2e3210(0x193))/0x8)+-parseInt(_0x2e3210(0x19a))/0x9*(-parseInt(_0x2e3210(0x196))/0xa)+parseInt(_0x2e3210(0x19c))/0xb;if(_0x418919===_0xe75728)break;else _0x233248['push'](_0x233248['shift']());}catch(_0x29f9c8){_0x233248['push'](_0x233248['shift']());}}}(a53_0x1d70,0x48722));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 a53_0x187921 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1cc55c){const _0x156f42=a53_0x5ef9;return _0x1cc55c[_0x156f42(0x1c1)]==='json'||_0x1cc55c[_0x156f42(0x1c1)]===_0x156f42(0x1a2)||_0x1cc55c[_0x156f42(0x1c1)]===_0x156f42(0x195)||_0x1cc55c['format']==='table'||_0x1cc55c[_0x156f42(0x194)]===!![]||_0x1cc55c[_0x156f42(0x1a2)]===!![]||_0x1cc55c[_0x156f42(0x195)]===!![]||_0x1cc55c[_0x156f42(0x1be)]===!![];}function a53_0x1d70(){const _0x3ae2d5=['error','length','push','limit','resolve','[error]','inherit','[rule]','object','─┴─','152671SEMZyN','limitStructuredFormats','repeat','table','415ttBhmz','spawn','format','No\x20data','890934YOfdmK','close','params','cyan','bigint','blue','trim','list','bold','pipe','cmdout','end','filter','write','less','noColor','14604GzntGw','FINISHED','rule','max','number','-FXRSn','112cCRCJk','varchar','split','padEnd','map','176744UZNTSc','json','tsv','17300iDNAZY','3PYoqUF','red','join','711cXjSPz','debug','1338359BmmDqz','stdin','stringify','forEach','1204452SqOdfc','color','jsonl','log','boolean','[logs]','entries','data','isInteger','query','keys','isFinite','stderr','output','string','Results\x20saved\x20to\x20','[query]'];a53_0x1d70=function(){return _0x3ae2d5;};return a53_0x1d70();}export function parseOutputOptions(_0x472f8b){const _0x4f5f1c=a53_0x5ef9;return{'format':_0x472f8b[_0x4f5f1c(0x1c1)]||'table','output':_0x472f8b['output']||'','limit':_0x472f8b[_0x4f5f1c(0x1b4)],'limitStructuredFormats':_0x472f8b[_0x4f5f1c(0x1bc)],'color':_0x472f8b[_0x4f5f1c(0x1a1)],'noColor':_0x472f8b[_0x4f5f1c(0x187)]};}function convertSDKResultToQueryResult(_0x30f7fa){const _0x51534d=a53_0x5ef9,_0xb1ecd6=[];if(_0x30f7fa[_0x51534d(0x1b2)]>0x0){const _0x1044d6=_0x30f7fa[0x0];for(const [_0x36a06b,_0x39fe73]of Object[_0x51534d(0x1a6)](_0x1044d6)){let _0x47698d=_0x51534d(0x18f);if(typeof _0x39fe73===_0x51534d(0x18c))_0x47698d=Number[_0x51534d(0x1a8)](_0x39fe73)?_0x51534d(0x1c7):'double';else{if(typeof _0x39fe73==='boolean')_0x47698d=_0x51534d(0x1a4);else _0x39fe73===null&&(_0x47698d='varchar');}_0xb1ecd6[_0x51534d(0x1b3)]({'name':_0x36a06b,'type':_0x47698d});}}return{'queryId':'sdk-result','columns':_0xb1ecd6,'data':_0x30f7fa,'stats':{'state':_0x51534d(0x189),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x30f7fa[_0x51534d(0x1b2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x193f05,_0xabd7e4){const _0x44a09a=convertSDKResultToQueryResult(_0x193f05);return formatQueryOutput(_0x44a09a,_0xabd7e4);}export async function formatQueryOutput(_0x337db1,_0x15b64d){const _0x18af89=a53_0x5ef9,{format:_0x1e2fab,limit:_0x221370,output:_0x2e523e,color:_0x22de72,noColor:_0x3f7673,limitStructuredFormats:_0x28ab22}=_0x15b64d,_0xe68817=Boolean(_0x2e523e)&&!_0x22de72,_0x289016={'color':_0x22de72,'noColor':_0x3f7673||_0xe68817};if(_0x1e2fab===_0x18af89(0x1be)){const _0x4a2205=shouldUseLess(_0x1e2fab,_0x2e523e);return formatAsTable(_0x337db1,_0x221370,_0x4a2205,_0x289016);}const _0x28d30e=_0x28ab22&&Number[_0x18af89(0x1ab)](_0x221370)&&_0x337db1[_0x18af89(0x1a7)]['length']>_0x221370?{..._0x337db1,'data':_0x337db1[_0x18af89(0x1a7)]['slice'](0x0,_0x221370)}:_0x337db1;if(_0x1e2fab===_0x18af89(0x194))return formatAsJSON(_0x28d30e,_0x289016);else return _0x1e2fab==='jsonl'?formatAsJSONL(_0x28d30e,_0x289016):formatQueryResult(_0x28d30e,_0x1e2fab);}function shouldUseLess(_0x18d216,_0x3c183d){const _0x422c8b=a53_0x5ef9;return(_0x18d216===_0x422c8b(0x1be)||_0x18d216===_0x422c8b(0x1ca))&&process['stdout']['isTTY']&&!_0x3c183d;}export function resolveOutputOptions(_0x3dd2e3){const _0x9c341=a53_0x5ef9,_0x216e65=_0x3dd2e3['output']||'',_0x13a95a=resolveOutputFormat(_0x3dd2e3[_0x9c341(0x1c1)],_0x216e65,'table');let _0x247e25=typeof _0x3dd2e3[_0x9c341(0x1b4)]===_0x9c341(0x18c)?_0x3dd2e3[_0x9c341(0x1b4)]:parseInt(_0x3dd2e3[_0x9c341(0x1b4)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x3dd2e3[_0x9c341(0x1b4)]===undefined&&shouldUseLess(_0x13a95a,_0x216e65)&&(_0x247e25=Infinity),{'format':_0x13a95a,'output':_0x216e65,'limit':_0x247e25,'limitStructuredFormats':_0x3dd2e3['limitStructuredFormats'],'color':_0x3dd2e3[_0x9c341(0x1a1)],'noColor':_0x3dd2e3[_0x9c341(0x187)]};}export function writeOutput(_0x44414b,_0xd54b1b,_0x735ff8){const _0x29bee1=a53_0x5ef9;return _0xd54b1b?(writeFileSync(_0xd54b1b,_0x44414b),console[_0x29bee1(0x1b1)](_0x29bee1(0x1af)+_0xd54b1b),Promise[_0x29bee1(0x1b5)]()):shouldUseLess(_0x735ff8||'','')?new Promise(_0x2b1cd4=>{const _0x2fb0fa=_0x29bee1,_0x2264ac=spawn(_0x2fb0fa(0x186),[_0x2fb0fa(0x18d)],{'stdio':[_0x2fb0fa(0x1cc),_0x2fb0fa(0x1b7),_0x2fb0fa(0x1b7)]});let _0x5de27a=![];_0x2264ac['on']('error',()=>{const _0x1e0812=_0x2fb0fa;!_0x5de27a&&(_0x5de27a=!![],console[_0x1e0812(0x1a3)](_0x44414b),_0x2b1cd4());}),_0x2264ac['on'](_0x2fb0fa(0x1c4),()=>{!_0x5de27a&&(_0x5de27a=!![],_0x2b1cd4());}),_0x2264ac['on'](_0x2fb0fa(0x1c0),()=>{const _0x51593d=_0x2fb0fa;!_0x5de27a&&_0x2264ac['stdin']&&(_0x2264ac[_0x51593d(0x19d)]['on'](_0x51593d(0x1b1),()=>{}),_0x2264ac['stdin'][_0x51593d(0x185)](_0x44414b),_0x2264ac[_0x51593d(0x19d)][_0x51593d(0x183)]());}),!_0x2264ac[_0x2fb0fa(0x19d)]&&(!_0x5de27a&&(_0x5de27a=!![],console[_0x2fb0fa(0x1a3)](_0x44414b),_0x2b1cd4()));}):(console[_0x29bee1(0x1a3)](_0x44414b),Promise[_0x29bee1(0x1b5)]());}export async function handleSDKOutput(_0x4fcb8b,_0xcaaf86){const _0x14e085=a53_0x5ef9,_0x1f3639=resolveOutputOptions(_0xcaaf86),_0x5bc09b=await formatSDKOutput(_0x4fcb8b,_0x1f3639);await writeOutput(_0x5bc09b,_0x1f3639[_0x14e085(0x1ad)]||undefined,_0x1f3639[_0x14e085(0x1c1)]);}export async function handleQueryOutput(_0x330860,_0x38ed13){const _0x18879a=a53_0x5ef9,_0x451ad5=resolveOutputOptions(_0x38ed13),_0x3b34e1=await formatQueryOutput(_0x330860,_0x451ad5);await writeOutput(_0x3b34e1,_0x451ad5[_0x18879a(0x1ad)]||undefined,_0x451ad5[_0x18879a(0x1c1)]);}function a53_0x5ef9(_0x24be92,_0x378a95){_0x24be92=_0x24be92-0x183;const _0x1d70e9=a53_0x1d70();let _0x5ef986=_0x1d70e9[_0x24be92];return _0x5ef986;}async function formatSingleObject(_0x52b0f0,_0x4dbdc0){const _0x2170bb=a53_0x5ef9,{format:_0x33e1ba,color:_0x154650,noColor:_0x1e67a3}=_0x4dbdc0,_0x155f0e={'color':_0x154650,'noColor':_0x1e67a3};if(_0x33e1ba===_0x2170bb(0x194)){if(shouldUseColor(_0x155f0e))return colorizeJSON(_0x52b0f0,_0x155f0e);return JSON[_0x2170bb(0x19e)](_0x52b0f0,null,0x2);}else{if(_0x33e1ba===_0x2170bb(0x1a2)){if(shouldUseColor(_0x155f0e))return colorizeJSONCompact(_0x52b0f0,_0x155f0e);return JSON[_0x2170bb(0x19e)](_0x52b0f0);}else{if(_0x33e1ba===_0x2170bb(0x195))return Object[_0x2170bb(0x1a6)](_0x52b0f0)[_0x2170bb(0x192)](([_0x153c02,_0x4e458f])=>_0x153c02+'\x09'+_0x4e458f)[_0x2170bb(0x199)]('\x0a');else{const _0x1a2a66=Object[_0x2170bb(0x1a6)](_0x52b0f0);if(_0x1a2a66[_0x2170bb(0x1b2)]===0x0)return _0x2170bb(0x1c2);const _0x419c28=_0x52b0f0[_0x2170bb(0x19b)],_0x5664e8=_0x52b0f0['query'],_0x194282=_0x52b0f0[_0x2170bb(0x1c5)],_0x58b3db=_0x52b0f0[_0x2170bb(0x18a)],_0x289d24=_0x5664e8?typeof _0x5664e8===_0x2170bb(0x1ae)?_0x5664e8:JSON[_0x2170bb(0x19e)](_0x5664e8,null,0x2):undefined,_0x377cbe=_0x194282&&Object[_0x2170bb(0x1aa)](_0x194282)[_0x2170bb(0x1b2)]>0x0?JSON['stringify'](_0x194282,null,0x2):undefined,_0xae9b7d=_0x58b3db&&Object['keys'](_0x58b3db)[_0x2170bb(0x1b2)]>0x0?JSON[_0x2170bb(0x19e)](_0x58b3db,null,0x2):undefined,_0x2e6e32=_0x1a2a66[_0x2170bb(0x184)](([_0x1d0c37])=>_0x1d0c37!==_0x2170bb(0x19b)&&_0x1d0c37!==_0x2170bb(0x1a9)&&_0x1d0c37!=='params'&&_0x1d0c37!==_0x2170bb(0x18a)),_0xf7a253=Math[_0x2170bb(0x18b)](..._0x2e6e32[_0x2170bb(0x192)](([_0x3d2e76])=>_0x3d2e76[_0x2170bb(0x1b2)])),_0xb25567=Math[_0x2170bb(0x18b)](..._0x2e6e32[_0x2170bb(0x192)](([,_0x3baea4])=>{const _0x2fa8ce=_0x2170bb;try{const _0x487b18=_0x3baea4===null||_0x3baea4===undefined?'':typeof _0x3baea4===_0x2fa8ce(0x1b9)?JSON[_0x2fa8ce(0x19e)](_0x3baea4):String(_0x3baea4),_0x5e6d9c=_0x487b18[_0x2fa8ce(0x190)]('\x0a');return Math[_0x2fa8ce(0x18b)](..._0x5e6d9c[_0x2fa8ce(0x192)](_0x191aa5=>_0x191aa5[_0x2fa8ce(0x1b2)]),0x0);}catch{return 0x0;}}),0x14),_0x29f0ce=[];_0x29f0ce[_0x2170bb(0x1b3)](colorBorder('┌─'+'─'['repeat'](_0xf7a253)+'─┬─'+'─'[_0x2170bb(0x1bd)](_0xb25567)+'─┐',_0x155f0e)),_0x2e6e32[_0x2170bb(0x19f)](([_0x38ef06,_0x130a66])=>{const _0x54e95e=_0x2170bb;let _0x4bcafb;try{_0x4bcafb=_0x130a66===null||_0x130a66===undefined?'':typeof _0x130a66===_0x54e95e(0x1b9)?JSON[_0x54e95e(0x19e)](_0x130a66):String(_0x130a66);}catch{_0x4bcafb='[Object]';}const _0x12cff6=_0x38ef06[_0x54e95e(0x191)](_0xf7a253),_0x1cf1a5=_0x4bcafb[_0x54e95e(0x190)]('\x0a');_0x1cf1a5[_0x54e95e(0x19f)]((_0x54b269,_0x2daadc)=>{const _0x247256=_0x54e95e,_0x1e8940=colorBorder('│',_0x155f0e);_0x2daadc===0x0?_0x29f0ce[_0x247256(0x1b3)](_0x1e8940+'\x20'+_0x12cff6+'\x20'+_0x1e8940+'\x20'+_0x54b269[_0x247256(0x191)](_0xb25567)+'\x20'+_0x1e8940):_0x29f0ce[_0x247256(0x1b3)](_0x1e8940+'\x20'+'\x20'[_0x247256(0x1bd)](_0xf7a253)+'\x20'+_0x1e8940+'\x20'+_0x54b269[_0x247256(0x191)](_0xb25567)+'\x20'+_0x1e8940);});}),_0x29f0ce[_0x2170bb(0x1b3)](colorBorder('└─'+'─'[_0x2170bb(0x1bd)](_0xf7a253)+_0x2170bb(0x1ba)+'─'[_0x2170bb(0x1bd)](_0xb25567)+'─┘',_0x155f0e));_0x289d24&&(_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921['yellow'][_0x2170bb(0x1cb)](_0x2170bb(0x1b0)))),_0x29f0ce[_0x2170bb(0x1b3)](_0x289d24));_0x377cbe&&(_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921[_0x2170bb(0x1c8)][_0x2170bb(0x1cb)]('[params]'))),_0x29f0ce[_0x2170bb(0x1b3)](_0x377cbe));_0xae9b7d&&(_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921['magenta']['bold'](_0x2170bb(0x1b8)))),_0x29f0ce[_0x2170bb(0x1b3)](_0xae9b7d));if(_0x419c28){if(_0x419c28[_0x2170bb(0x1ac)]){_0x29f0ce['push'](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921[_0x2170bb(0x198)][_0x2170bb(0x1cb)](_0x2170bb(0x1b6))));const _0x40fdcf=_0x419c28['stderr'][_0x2170bb(0x190)]('\x0a');_0x40fdcf[_0x2170bb(0x19f)](_0xc41bf5=>{const _0x12f282=_0x2170bb;_0xc41bf5['trim']()&&_0x29f0ce[_0x12f282(0x1b3)](_0xc41bf5);});}if(_0x419c28[_0x2170bb(0x1cd)]){_0x29f0ce[_0x2170bb(0x1b3)](''),_0x29f0ce[_0x2170bb(0x1b3)](String(a53_0x187921[_0x2170bb(0x1c6)][_0x2170bb(0x1cb)](_0x2170bb(0x1a5))));const _0xbb045c=_0x419c28['cmdout']['split']('\x0a');_0xbb045c[_0x2170bb(0x19f)](_0x47b97f=>{const _0x323aeb=_0x2170bb;_0x47b97f[_0x323aeb(0x1c9)]()&&_0x29f0ce['push'](_0x47b97f);});}}return _0x29f0ce[_0x2170bb(0x199)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x335603,_0x2df130){const _0x408f4d=a53_0x5ef9;if(_0x2df130[_0x408f4d(0x1c1)]===_0x408f4d(0x1be)){await handleSDKOutput([_0x335603],_0x2df130);return;}const _0x2e27f2=resolveOutputOptions(_0x2df130),_0x3eedd4=await formatSingleObject(_0x335603,_0x2e27f2);await writeOutput(_0x3eedd4,_0x2e27f2[_0x408f4d(0x1ad)]||undefined,_0x2e27f2[_0x408f4d(0x1c1)]);}