@treasuredata/tdx 2026.3.22 → 2026.3.24

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 (203) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +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/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a52_0xa13f07=a52_0x5468;function a52_0x5468(_0x241ac2,_0x350a62){_0x241ac2=_0x241ac2-0x7c;const _0x2d2f2a=a52_0x2d2f();let _0x5468ba=_0x2d2f2a[_0x241ac2];return _0x5468ba;}(function(_0x297f4a,_0x32eda9){const _0x28faff=a52_0x5468,_0x6b02f3=_0x297f4a();while(!![]){try{const _0x1e9956=-parseInt(_0x28faff(0x1f8))/0x1+-parseInt(_0x28faff(0x183))/0x2+-parseInt(_0x28faff(0x18c))/0x3*(parseInt(_0x28faff(0x205))/0x4)+-parseInt(_0x28faff(0x185))/0x5+-parseInt(_0x28faff(0x216))/0x6*(parseInt(_0x28faff(0x18e))/0x7)+-parseInt(_0x28faff(0x167))/0x8*(parseInt(_0x28faff(0xb4))/0x9)+parseInt(_0x28faff(0x15b))/0xa*(parseInt(_0x28faff(0x22e))/0xb);if(_0x1e9956===_0x32eda9)break;else _0x6b02f3['push'](_0x6b02f3['shift']());}catch(_0x1eb7cd){_0x6b02f3['push'](_0x6b02f3['shift']());}}}(a52_0x2d2f,0x2bb38));import a52_0x89d45 from'chalk';import{existsSync}from'fs';import a52_0x2ac51d from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a52_0x4bedff from'prompts';function getAttemptStatusDisplay(_0x40898){const _0x549dce=a52_0x5468;if(!_0x40898)return{'icon':'⏳','text':''};const {done:_0x275342,success:_0x547b5f,cancelRequested:_0x25f834}=_0x40898;if(!_0x275342)return _0x25f834?{'icon':'🛑','text':a52_0x89d45[_0x549dce(0xd4)]('canceling')}:{'icon':'🔄','text':a52_0x89d45[_0x549dce(0xd2)]('running')};if(_0x547b5f)return{'icon':'✅','text':a52_0x89d45[_0x549dce(0x118)]('success')};return{'icon':'❌','text':a52_0x89d45[_0x549dce(0xb3)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a52_0xa13f07(0x174)](_0x4df023,_0x246ba9,_0x20a808=0x0){return _0x4df023[_0x20a808]||_0x246ba9['workflowProject'];}['requireProject'](_0x29a648,_0x5c8bd6,_0x544e24=0x0){const _0x489b5b=a52_0xa13f07,_0x589fea=this[_0x489b5b(0x174)](_0x29a648,_0x5c8bd6,_0x544e24);if(!_0x589fea)return console[_0x489b5b(0xa9)](a52_0x89d45[_0x489b5b(0xb3)](_0x489b5b(0x1a0)),_0x489b5b(0x161)),console[_0x489b5b(0xa9)](a52_0x89d45[_0x489b5b(0x20e)](_0x489b5b(0xbc))),null;return _0x589fea;}[a52_0xa13f07(0x1ab)](_0x493c73,_0x3777ee){const _0x3e579f=a52_0xa13f07;if(_0x493c73[0x0]){const _0x24455f=_0x493c73[0x0][_0x3e579f(0xdd)]('.');if(_0x24455f['length']===0x1)return{'projectName':_0x24455f[0x0],'workflowName':undefined};else return _0x24455f[_0x3e579f(0x86)]===0x2?{'projectName':_0x24455f[0x0],'workflowName':_0x24455f[0x1]}:(console[_0x3e579f(0xa9)](a52_0x89d45[_0x3e579f(0xb3)](_0x3e579f(0x1a0)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x3777ee[_0x3e579f(0x125)],'workflowName':undefined};}['resolveProjectDir'](_0x1fa97d,_0x40c8d0,_0x1ed02a=0x0){const _0x4996ff=a52_0xa13f07;if(_0x1fa97d[_0x1ed02a])return _0x1fa97d[_0x1ed02a];if(_0x40c8d0[_0x4996ff(0x125)]){const _0x39087a=a52_0x2ac51d[_0x4996ff(0x11c)](process[_0x4996ff(0xb9)](),_0x4996ff(0xec),_0x40c8d0['workflowProject']);if(existsSync(a52_0x2ac51d[_0x4996ff(0x11c)](_0x39087a,'tdx.json')))return _0x39087a;}return undefined;}async[a52_0xa13f07(0x1c2)](_0x115eac,_0x6caaa2,_0x27a977){const _0x8155eb=a52_0xa13f07;try{const _0x44f43a=await _0x115eac[_0x8155eb(0xfc)][_0x8155eb(0xec)](_0x6caaa2,{'limit':0x1});if(_0x44f43a['length']>0x0){const _0xc1959c=_0x44f43a[0x0]['id'],_0x508a62=getWorkflowUrl(_0x27a977,_0xc1959c);console[_0x8155eb(0xa9)](_0x8155eb(0x210)+a52_0x89d45[_0x8155eb(0x184)](_0x508a62));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a52_0xa13f07(0xb7);[a52_0xa13f07(0x122)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x13017c){const _0x13aa48=a52_0xa13f07,{options:_0x1390bb,args:_0x463002,tdx:_0x1dfeb6}=_0x13017c,_0x5a6a64=_0x463002[0x0],_0x52dca9=_0x1390bb[_0x13aa48(0xd0)];if(_0x52dca9)return saveSessionContext({'workflow_project':undefined},_0x1390bb[_0x13aa48(0x17e)]),console['log'](a52_0x89d45[_0x13aa48(0x118)](_0x13aa48(0x81))),0x0;if(!_0x5a6a64)return console[_0x13aa48(0xa9)](a52_0x89d45[_0x13aa48(0xb3)](_0x13aa48(0x1a0)),'Project\x20name\x20is\x20required'),console['error'](a52_0x89d45[_0x13aa48(0x20e)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x13aa48(0xa9)](a52_0x89d45['dim'](_0x13aa48(0xca))),0x1;const _0x2a4aa7=await withSpinner(_0x13aa48(0x22b)+_0x5a6a64+_0x13aa48(0x140),()=>_0x1dfeb6[_0x13aa48(0xfc)][_0x13aa48(0x19e)](_0x5a6a64),{'verbose':_0x1390bb[_0x13aa48(0x1e3)]}),{name:_0x2ee133}=_0x2a4aa7['data'];return saveSessionContext({'workflow_project':_0x2ee133},_0x1390bb['session']),console['log'](a52_0x89d45[_0x13aa48(0x118)](_0x13aa48(0x156)+a52_0x89d45[_0x13aa48(0x184)](_0x2ee133))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a52_0xa13f07(0x20d)]='workflow:projects';['description']='List\x20all\x20workflow\x20projects';async[a52_0xa13f07(0x22f)](_0x1b68bc){const _0x362824=a52_0xa13f07,{options:_0x2c2397,args:_0x472e91,tdx:_0x55030b}=_0x1b68bc,_0x3c18b5=_0x472e91[0x0];_0x2c2397[_0x362824(0x1e3)]&&_0x3c18b5&&console[_0x362824(0xa9)](_0x362824(0x11a)+_0x3c18b5);const _0x530e6e=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x55030b[_0x362824(0xfc)][_0x362824(0x201)](_0x3c18b5,{'limit':_0x2c2397[_0x362824(0x91)]}),{'verbose':_0x2c2397[_0x362824(0x1e3)]});let _0x52c282=_0x530e6e['data'];_0x52c282['sort']((_0x326bb6,_0x15c9e3)=>_0x326bb6[_0x362824(0x20d)]['localeCompare'](_0x15c9e3[_0x362824(0x20d)]));const _0x79033a=_0x2c2397[_0x362824(0x91)]||0x64,_0x1ec00b=_0x52c282[_0x362824(0x86)]>=_0x79033a?a52_0x89d45[_0x362824(0x20e)](_0x362824(0x1a5)):'';console[_0x362824(0xa9)](_0x362824(0x8a)+_0x52c282[_0x362824(0x86)]+_0x362824(0xe8)+(_0x52c282[_0x362824(0x86)]!==0x1?'s':'')+_0x1ec00b);if(_0x2c2397[_0x362824(0x99)]===_0x362824(0xd5)||_0x2c2397['format']==='jsonl'||_0x2c2397[_0x362824(0x99)]==='table')await handleSDKOutput(_0x52c282,_0x2c2397);else{if(_0x52c282[_0x362824(0x86)]===0x0)_0x3c18b5?console[_0x362824(0x1b2)](_0x362824(0xa2)+_0x3c18b5):console[_0x362824(0x1b2)](_0x362824(0xba));else{const _0x866c93=_0x52c282[_0x362824(0xd7)](_0x10722c=>{const _0x65463a=_0x362824,_0x3e16a9=_0x10722c[_0x65463a(0x113)]?.[_0x65463a(0x1f5)](_0x44ba0d=>_0x44ba0d[_0x65463a(0x176)]===_0x65463a(0x144)),_0x662d7b=_0x3e16a9?a52_0x89d45['dim'](_0x65463a(0x102)):'';return'📁\x20'+_0x10722c[_0x65463a(0x20d)]+_0x662d7b;});await writeOutput(_0x866c93[_0x362824(0x11c)]('\x0a'),_0x2c2397[_0x362824(0x20b)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a52_0xa13f07(0xd3);['description']='List\x20workflows';async['execute'](_0x193656){const _0x2ca701=a52_0xa13f07,{options:_0x1e8700,args:_0x417b15,tdx:_0x24641d}=_0x193656,_0x428e14=this[_0x2ca701(0x174)](_0x417b15,_0x1e8700);_0x1e8700[_0x2ca701(0x1e3)]&&_0x428e14&&console['error'](_0x2ca701(0x1a9)+_0x428e14);const _0x5648c1=await withSpinner(_0x2ca701(0x8b),()=>_0x24641d['workflow']['workflows'](_0x428e14,{'limit':_0x1e8700[_0x2ca701(0x91)]}),{'verbose':_0x1e8700[_0x2ca701(0x1e3)]});let _0x2cb9df=_0x5648c1[_0x2ca701(0x14b)];_0x2cb9df[_0x2ca701(0xc7)]((_0x249dcb,_0x2c18c6)=>{const _0x360f67=_0x2ca701,_0x48cfb7=_0x249dcb['name']['localeCompare'](_0x2c18c6[_0x360f67(0x20d)]);if(_0x48cfb7!==0x0)return _0x48cfb7;return(_0x249dcb[_0x360f67(0x1af)]?.['name']||'')['localeCompare'](_0x2c18c6[_0x360f67(0x1af)]?.[_0x360f67(0x20d)]||'');});const _0x3db498=_0x1e8700[_0x2ca701(0x91)]||0x64,_0x49e5c5=_0x2cb9df['length']>=_0x3db498?a52_0x89d45[_0x2ca701(0x20e)](_0x2ca701(0x1a5)):'';console[_0x2ca701(0xa9)](_0x2ca701(0x8a)+_0x2cb9df[_0x2ca701(0x86)]+_0x2ca701(0x84)+(_0x2cb9df[_0x2ca701(0x86)]!==0x1?'s':'')+_0x49e5c5);if(_0x1e8700[_0x2ca701(0x99)]===_0x2ca701(0xd5)||_0x1e8700[_0x2ca701(0x99)]===_0x2ca701(0x175)||_0x1e8700[_0x2ca701(0x99)]===_0x2ca701(0xc3))await handleSDKOutput(_0x2cb9df,_0x1e8700);else{if(_0x2cb9df[_0x2ca701(0x86)]===0x0)_0x428e14?console[_0x2ca701(0x1b2)](_0x2ca701(0x130)+_0x428e14):console['log'](_0x2ca701(0xf0));else{const _0x2639e4=_0x1e8700['site'],_0x337cc1=_0x2cb9df[_0x2ca701(0xd7)](_0x3a1ffc=>{const _0x440694=_0x2ca701,_0x2a8683=a52_0x89d45['dim']('#'+_0x3a1ffc['id']),_0x3cc2bb=hyperlink(_0x2a8683,getWorkflowUrl(_0x2639e4,_0x3a1ffc['id'])),_0x42602e=_0x3a1ffc[_0x440694(0x1af)]?.[_0x440694(0x20d)]?a52_0x89d45[_0x440694(0x20e)]('\x20('+_0x3a1ffc[_0x440694(0x1af)][_0x440694(0x20d)]+')'):'';return _0x440694(0x1f0)+_0x3cc2bb+'\x20'+_0x3a1ffc[_0x440694(0x20d)]+_0x42602e;});await writeOutput(_0x337cc1[_0x2ca701(0x11c)]('\x0a'),_0x1e8700[_0x2ca701(0x20b)],_0x2ca701(0xc0));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x8d);['description']='List\x20workflow\x20execution\x20sessions';async[a52_0xa13f07(0x22f)](_0x2edfd4){const _0x5ea514=a52_0xa13f07,{options:_0x5766ab,args:_0x43d26f,tdx:_0x1a57ac}=_0x2edfd4,_0x86efe9=this['parseProjectWorkflowPattern'](_0x43d26f,_0x5766ab);if(!_0x86efe9)return 0x1;const {projectName:_0x3feb22,workflowName:_0x34c354}=_0x86efe9;if(_0x5766ab[_0x5ea514(0x1e3)]){if(_0x3feb22&&_0x34c354)console[_0x5ea514(0xa9)]('Filter:\x20'+_0x3feb22+'.'+_0x34c354);else _0x3feb22&&console[_0x5ea514(0xa9)]('Filter:\x20project='+_0x3feb22);const _0x430420=_0x5766ab['status'];_0x430420&&console['error']('Status:\x20'+_0x430420);}let _0x42e4f3=0x28;if(process['stdout']['isTTY']&&!_0x5766ab[_0x5ea514(0x20b)]&&!_0x5766ab['format']){const _0x5c900d=process['stdout']['rows']||0x28;_0x42e4f3=Math[_0x5ea514(0x1fa)](0x14,Math['floor'](_0x5c900d*0x2/0x3));}const _0x5d11f2=_0x5766ab[_0x5ea514(0x91)]||_0x42e4f3,_0x3501fe=await withSpinner(_0x5ea514(0x111),()=>_0x1a57ac['workflow'][_0x5ea514(0xa3)]({'projectName':_0x3feb22,'workflowName':_0x34c354,'status':_0x5766ab['status'],'fromTime':_0x5766ab[_0x5ea514(0x92)],'toTime':_0x5766ab['to'],'limit':_0x5d11f2}),{'verbose':_0x5766ab[_0x5ea514(0x1e3)]}),_0x29cc2e=_0x3501fe[_0x5ea514(0x14b)];_0x29cc2e[_0x5ea514(0xc7)]((_0x58e8a6,_0x3994bf)=>{const _0x1f756c=_0x5ea514,_0x596a78=_0x58e8a6[_0x1f756c(0xa6)]||'',_0x5b63d2=_0x3994bf['sessionTime']||'';return _0x5b63d2[_0x1f756c(0x177)](_0x596a78);});_0x29cc2e[_0x5ea514(0x86)]>=_0x5d11f2?console[_0x5ea514(0xa9)](_0x5ea514(0x203)+_0x29cc2e[_0x5ea514(0x86)]+_0x5ea514(0x12f)+a52_0x89d45[_0x5ea514(0x20e)](_0x5ea514(0x181))):console[_0x5ea514(0xa9)]('✔\x20Found\x20'+_0x29cc2e[_0x5ea514(0x86)]+'\x20session'+(_0x29cc2e['length']!==0x1?'s':''));if(_0x5766ab[_0x5ea514(0x99)]===_0x5ea514(0xd5)||_0x5766ab[_0x5ea514(0x99)]===_0x5ea514(0x175)||_0x5766ab['format']===_0x5ea514(0xc3))await handleSDKOutput(_0x29cc2e,_0x5766ab);else{if(!process['stdout'][_0x5ea514(0xfa)]||_0x5766ab[_0x5ea514(0x20b)]){if(_0x29cc2e[_0x5ea514(0x86)]===0x0){if(_0x3feb22&&_0x34c354)console[_0x5ea514(0x1b2)]('No\x20sessions\x20found\x20for:\x20'+_0x3feb22+'.'+_0x34c354);else _0x3feb22?console[_0x5ea514(0x1b2)](_0x5ea514(0x189)+_0x3feb22):console['log'](_0x5ea514(0xa1));}else{const _0x310229=_0x5766ab[_0x5ea514(0x179)],_0x5ee615=this['renderSessionsTimeline'](_0x29cc2e,_0x310229);_0x5766ab[_0x5ea514(0x20b)]?await writeOutput(_0x5ee615,_0x5766ab[_0x5ea514(0x20b)],'list'):console['log'](_0x5ee615);}!_0x3feb22&&(console[_0x5ea514(0xa9)](''),console[_0x5ea514(0xa9)](a52_0x89d45[_0x5ea514(0x20e)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x5ea514(0xa9)](a52_0x89d45['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a52_0x89d45[_0x5ea514(0x20e)](_0x5ea514(0x104))));}else{if(_0x29cc2e[_0x5ea514(0x86)]===0x0){if(_0x3feb22&&_0x34c354)console[_0x5ea514(0x1b2)](_0x5ea514(0x131)+_0x3feb22+'.'+_0x34c354);else _0x3feb22?console[_0x5ea514(0x1b2)](_0x5ea514(0x189)+_0x3feb22):console['log'](_0x5ea514(0xa1));}else await this[_0x5ea514(0x87)](_0x29cc2e,_0x2edfd4,_0x3feb22);}}return 0x0;}[a52_0xa13f07(0x1ae)](_0x162d46,_0x52bf64){const _0x45125d=a52_0xa13f07,_0x3c1be3=[],_0x1883ea=new Map();let _0x55ac56=Infinity,_0x261f6b=-Infinity;for(const _0x4f335d of _0x162d46){if(_0x4f335d[_0x45125d(0xce)]?.[_0x45125d(0x85)]){const _0x3b69f4=new Date(_0x4f335d[_0x45125d(0xce)][_0x45125d(0x85)])[_0x45125d(0xe0)](),_0x22263d=_0x4f335d[_0x45125d(0xce)][_0x45125d(0x18a)]?new Date(_0x4f335d[_0x45125d(0xce)][_0x45125d(0x18a)])[_0x45125d(0xe0)]():Date[_0x45125d(0x13d)](),_0x5f30a0=_0x4f335d[_0x45125d(0x1af)]?.['name']||_0x45125d(0x106);!_0x1883ea['has'](_0x5f30a0)&&_0x1883ea[_0x45125d(0x16d)](_0x5f30a0,[]),_0x1883ea[_0x45125d(0x19c)](_0x5f30a0)['push']({'session':_0x4f335d,'startTime':_0x3b69f4,'endTime':_0x22263d,'duration':_0x22263d-_0x3b69f4}),_0x55ac56=Math[_0x45125d(0x190)](_0x55ac56,_0x3b69f4),_0x261f6b=Math[_0x45125d(0x1fa)](_0x261f6b,_0x22263d);}}if(_0x1883ea[_0x45125d(0x215)]===0x0)return _0x45125d(0x1cf);const _0x10b737=process['stdout'][_0x45125d(0x1bb)]||0x78,_0x36e0a6=0x1e,_0x10f4cc=0x32,_0xd7b06=0x4,_0x2b62c5=Math[_0x45125d(0x190)](_0x10f4cc,Math[_0x45125d(0x1fa)](_0x36e0a6,Math[_0x45125d(0x21a)](_0x10b737*0.3))),_0x13aa06=_0x10b737-_0x2b62c5-TIMELINE_CONFIG[_0x45125d(0x142)]-0x3-_0xd7b06,_0x407ce0=_0x261f6b-_0x55ac56,_0x3f5786=_0x407ce0/_0x2b62c5,_0x578d73=renderTimeAxis({'startTime':_0x55ac56,'endTime':_0x261f6b,'durationMs':_0x407ce0,'msPerChar':_0x3f5786},_0x2b62c5),_0x5d2eb4=[];for(const _0x1b8df6 of _0x1883ea['values']()){_0x5d2eb4['push'](..._0x1b8df6);}_0x5d2eb4[_0x45125d(0xc7)]((_0xe6028,_0x4979a3)=>_0x4979a3['startTime']-_0xe6028[_0x45125d(0x1a1)]);const _0x556d54=new Date(_0x55ac56),_0x2ea49a=formatDate(_0x556d54),_0x3ed2e9=_0xd7b06+TIMELINE_CONFIG[_0x45125d(0x1c1)]+TIMELINE_CONFIG[_0x45125d(0x13f)]+_0x13aa06,_0x280f39='\x20'[_0x45125d(0xb5)](_0x3ed2e9-_0x2ea49a[_0x45125d(0x86)]),_0x4f65e5=_0x280f39+a52_0x89d45[_0x45125d(0x20e)](_0x2ea49a)+'\x20'+_0x578d73;_0x3c1be3[_0x45125d(0xdc)](_0x4f65e5);const _0xa5231c=0x16;let _0x2b2729=0x0;for(const _0x2992d5 of _0x5d2eb4){const _0x410bcb=_0x2992d5[_0x45125d(0x17e)][_0x45125d(0x1af)]?.[_0x45125d(0x20d)]||'?',_0x23f32a=Math[_0x45125d(0x190)](stringWidth(_0x410bcb),_0xa5231c);_0x2b2729=Math[_0x45125d(0x1fa)](_0x2b2729,_0x23f32a);}for(const _0x586232 of _0x5d2eb4){const {session:_0x369e57,startTime:_0x4cbc77,endTime:_0x2b727d,duration:_0x558336}=_0x586232,_0x24a074=_0x369e57['project']?.['id'],_0x5c2565=_0x369e57['id'],_0x4050da=_0x369e57['project']?.[_0x45125d(0x20d)]||'?',_0x14d106=_0x369e57[_0x45125d(0xfc)]?.[_0x45125d(0x20d)]||'?';let _0x495a3e,_0x5a7e72;if(_0x369e57['lastAttempt']){const _0x49fa63=_0x369e57[_0x45125d(0xce)];!_0x49fa63['done']?(_0x495a3e=_0x49fa63[_0x45125d(0x1b0)]?'🛑':'🔄',_0x5a7e72=_0x49fa63[_0x45125d(0x1b0)]?a52_0x89d45[_0x45125d(0xd4)]:a52_0x89d45[_0x45125d(0xd2)]):(_0x495a3e=_0x49fa63[_0x45125d(0x1ba)]?'✅':'❌',_0x5a7e72=_0x49fa63['success']?a52_0x89d45[_0x45125d(0x118)]:a52_0x89d45['red']);}else _0x495a3e='⏳',_0x5a7e72=a52_0x89d45[_0x45125d(0x20e)];const _0x126a23='#'+_0x5c2565,_0x4aabd8=_0x24a074?hyperlink(_0x126a23,getWorkflowSessionUrl(_0x52bf64,_0x24a074,_0x5c2565)):_0x126a23;let _0x270c51=_0x4050da;stringWidth(_0x4050da)>_0xa5231c&&(_0x270c51=_0x4050da['slice'](0x0,_0xa5231c-0x1)+'…');const _0x45caf2=a52_0x89d45['dim'](_0x270c51),_0x5e80db=stringWidth(_0x270c51),_0x2e737a='\x20'[_0x45125d(0xb5)](_0x2b2729-stringWidth(_0x270c51)+0x2),_0x399255='('+formatElapsed(_0x558336)+')',_0x5c55a7=stringWidth(_0x399255),_0x1bcbda=stringWidth(_0x126a23),_0x103202=_0x1bcbda+0x1+_0x5e80db+_0x2e737a[_0x45125d(0x86)],_0x24882b=_0x13aa06-_0x103202-_0x5c55a7-0x1-0x8;let _0x3e3bba=_0x14d106;stringWidth(_0x3e3bba)>_0x24882b&&(_0x3e3bba=_0x3e3bba['slice'](0x0,_0x24882b-0x1)+'…');const _0x5e63f2=_0x4aabd8+'\x20'+_0x45caf2+_0x2e737a+_0x3e3bba,_0x5aa760=stringWidth(_0x5e63f2),_0x31717f=_0x13aa06-_0x5aa760-_0x5c55a7,_0x1bf182=_0x5e63f2+'\x20'[_0x45125d(0xb5)](Math[_0x45125d(0x1fa)](0x1,_0x31717f))+a52_0x89d45[_0x45125d(0x20e)](_0x399255),_0x20924c=Math['floor']((_0x4cbc77-_0x55ac56)/_0x3f5786),_0x5e5b5c=Math[_0x45125d(0x21a)]((_0x2b727d-_0x55ac56)/_0x3f5786),_0x27131a=Math[_0x45125d(0x1fa)](_0x20924c+0x1,_0x5e5b5c),_0x5931d4=new Array(_0x2b62c5)[_0x45125d(0x16f)]('\x20');for(let _0x2ec5da=_0x20924c;_0x2ec5da<Math[_0x45125d(0x190)](_0x27131a,_0x2b62c5);_0x2ec5da++){_0x5931d4[_0x2ec5da]='─';}const _0x5a5de9=_0x5931d4['map'](_0x1a4ce1=>_0x1a4ce1==='\x20'?'\x20':_0x5a7e72(_0x1a4ce1))['join']('');_0x3c1be3['push'](_0x495a3e+'\x20'+_0x1bf182+'│'+_0x5a5de9+'│');}return _0x3c1be3['join']('\x0a');}async[a52_0xa13f07(0x87)](_0x2d2f4c,_0x559f08,_0x3357c1){const _0x11d2ed=a52_0xa13f07,{options:_0x1750ea,tdx:_0x517f3c}=_0x559f08,_0x4ea279=_0x1750ea[_0x11d2ed(0x179)],{timelineRows:_0x27eed6,timeAxisHeader:_0x20b2df}=this['generateSessionTimelineRows'](_0x2d2f4c,_0x4ea279),_0x5088dd=_0x27eed6[_0x11d2ed(0x80)](_0xb4890f=>_0xb4890f[_0x11d2ed(0x10b)]);if(_0x5088dd[_0x11d2ed(0x86)]===0x0){const _0x59d880=this[_0x11d2ed(0x1ae)](_0x2d2f4c,_0x4ea279);console[_0x11d2ed(0x1b2)](_0x59d880);!_0x3357c1&&(console[_0x11d2ed(0xa9)](''),console[_0x11d2ed(0xa9)](a52_0x89d45[_0x11d2ed(0x20e)](_0x11d2ed(0xef))),console[_0x11d2ed(0xa9)](a52_0x89d45[_0x11d2ed(0x20e)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a52_0x89d45[_0x11d2ed(0x20e)](_0x11d2ed(0x104))));return;}_0x20b2df&&console[_0x11d2ed(0x1b2)](_0x20b2df);const _0x3706b8=_0x27eed6[_0x11d2ed(0x80)](_0x44142a=>_0x44142a[_0x11d2ed(0x10b)])[_0x11d2ed(0xd7)](_0x4285bf=>({'title':_0x4285bf[_0x11d2ed(0x1c3)],'value':_0x4285bf[_0x11d2ed(0x10b)]})),_0x358ace=process[_0x11d2ed(0x15c)][_0x11d2ed(0x15f)]||0x3c,_0x208237=Math[_0x11d2ed(0x1fa)](0x28,Math[_0x11d2ed(0x21a)](_0x358ace*0x2/0x3)),_0x22c51c=await a52_0x4bedff({'type':'autocomplete','name':_0x11d2ed(0x10b),'message':_0x11d2ed(0x226),'choices':_0x3706b8,'initial':-0x1,'limit':_0x208237,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x1946b0,_0x37cf75)=>{const _0x398b62=_0x11d2ed;if(!_0x1946b0)return Promise['resolve'](_0x37cf75);const _0x3d802e=_0x37cf75[_0x398b62(0x80)](_0x1cbd69=>{const _0x930504=_0x398b62,_0x472b2e=_0x1cbd69;return _0x472b2e[_0x930504(0xcc)][_0x930504(0x116)]()[_0x930504(0x1bd)](_0x1946b0[_0x930504(0x116)]());});return Promise[_0x398b62(0x187)](_0x3d802e);}}),_0x13cff5=()=>{const _0x31f681=_0x11d2ed;process['stdout'][_0x31f681(0x129)](_0x31f681(0x229)),process['stdout'][_0x31f681(0x129)](_0x31f681(0x229)),process[_0x31f681(0x15c)][_0x31f681(0x129)](_0x31f681(0x229));},_0x1aacc3=_0x22c51c&&_0x22c51c['attemptId']&&_0x22c51c['attemptId']!==null&&_0x22c51c[_0x11d2ed(0x10b)][_0x11d2ed(0x1b6)]()!=='';if(!_0x1aacc3){_0x13cff5(),console[_0x11d2ed(0x1b2)](a52_0x89d45[_0x11d2ed(0x20e)](_0x11d2ed(0xeb)));return;}_0x13cff5();const _0x49c550=_0x2d2f4c[_0x11d2ed(0x100)](_0x22e31b=>_0x22e31b[_0x11d2ed(0xce)]?.['id']===_0x22c51c[_0x11d2ed(0x10b)]);if(_0x49c550){const _0x42bfdb=_0x49c550[_0x11d2ed(0x1af)]?.[_0x11d2ed(0x20d)]||'?',_0x3d4572=_0x49c550[_0x11d2ed(0xfc)]?.[_0x11d2ed(0x20d)]||'?';console[_0x11d2ed(0x1b2)](_0x11d2ed(0xaa)+a52_0x89d45[_0x11d2ed(0x20e)](_0x42bfdb)+',\x20Workflow:\x20'+a52_0x89d45[_0x11d2ed(0x20e)](_0x3d4572));}const _0x4a20b0=new WorkflowTimelineCommand();await _0x4a20b0['execute']({'args':[],'options':{..._0x1750ea,'attemptId':_0x22c51c[_0x11d2ed(0x10b)]},'tdx':_0x517f3c});}[a52_0xa13f07(0x101)](_0x543e64,_0xa3dd3f){const _0x27a47d=a52_0xa13f07,_0x3aa6ac=new Map();for(const _0x5c2f01 of _0x543e64){_0x5c2f01['id']&&_0x5c2f01[_0x27a47d(0xce)]?.['id']&&_0x3aa6ac[_0x27a47d(0x16d)](_0x5c2f01['id'],_0x5c2f01[_0x27a47d(0xce)]['id']);}const _0x3bb551=[];let _0x3eef7b='';const _0x3819f4=this[_0x27a47d(0x1ae)](_0x543e64,_0xa3dd3f),_0x4203c4=_0x3819f4[_0x27a47d(0xdd)]('\x0a');for(const _0x3cfeb0 of _0x4203c4){if(_0x3cfeb0['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x3cfeb0[_0x27a47d(0x1bc)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3eef7b=_0x3cfeb0;else{if(_0x3cfeb0[_0x27a47d(0x1bc)](/^[✅❌🔄🛑⏳]/)){const _0x557342=_0x3cfeb0[_0x27a47d(0x1bc)](/#(\d+)/),_0x22422a=_0x557342?_0x557342[0x1]:null,_0xe8a089=_0x22422a?_0x3aa6ac[_0x27a47d(0x19c)](_0x22422a)||null:null,_0x5bad2a=_0x543e64[_0x27a47d(0x100)](_0x1037c3=>_0x1037c3['id']===_0x22422a),_0x2ecd59=_0x5bad2a?.['project']?.[_0x27a47d(0x20d)]||'';_0x3bb551[_0x27a47d(0xdc)]({'displayLine':_0x3cfeb0,'attemptId':_0xe8a089,'projectName':_0x2ecd59});}}}return{'timelineRows':_0x3bb551,'timeAxisHeader':_0x3eef7b};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x19f);[a52_0xa13f07(0x122)]=a52_0xa13f07(0x138);async[a52_0xa13f07(0x22f)](_0x30d23d){const _0x21df52=a52_0xa13f07,{options:_0x390eeb,args:_0x55bdd5,tdx:_0x1bf5ec}=_0x30d23d,_0x1ab403=this[_0x21df52(0x1ab)](_0x55bdd5,_0x390eeb);if(!_0x1ab403)return 0x1;const {projectName:_0x31a158,workflowName:_0x415d27}=_0x1ab403,_0x320164=_0x390eeb['includeRetried'];if(_0x390eeb['verbose']){if(_0x31a158&&_0x415d27)console[_0x21df52(0xa9)]('Filter:\x20'+_0x31a158+'.'+_0x415d27);else _0x31a158&&console[_0x21df52(0xa9)](_0x21df52(0x1b9)+_0x31a158);_0x320164&&console[_0x21df52(0xa9)](_0x21df52(0x1e0));}const _0x4c3e93=await withSpinner(_0x21df52(0x1e6),()=>_0x1bf5ec[_0x21df52(0xfc)]['attempts']({'projectName':_0x31a158,'workflowName':_0x415d27,'includeRetried':_0x320164,'limit':_0x390eeb[_0x21df52(0x91)]}),{'verbose':_0x390eeb[_0x21df52(0x1e3)]}),_0x423bad=_0x4c3e93[_0x21df52(0x14b)],_0x459ff8=_0x390eeb[_0x21df52(0x91)]||0x64,_0x406c30=_0x423bad['length']>=_0x459ff8?a52_0x89d45[_0x21df52(0x20e)](_0x21df52(0x1a5)):'';console[_0x21df52(0xa9)](_0x21df52(0x8a)+_0x423bad['length']+'\x20attempt'+(_0x423bad[_0x21df52(0x86)]!==0x1?'s':'')+_0x406c30);if(_0x390eeb['format']===_0x21df52(0xd5)||_0x390eeb[_0x21df52(0x99)]===_0x21df52(0x175)||_0x390eeb[_0x21df52(0x99)]===_0x21df52(0xc3))await handleSDKOutput(_0x423bad,_0x390eeb);else{if(_0x423bad[_0x21df52(0x86)]===0x0){if(_0x31a158&&_0x415d27)console['log'](_0x21df52(0x16e)+_0x31a158+'.'+_0x415d27);else _0x31a158?console[_0x21df52(0x1b2)](_0x21df52(0x136)+_0x31a158):console['log'](_0x21df52(0x199));}else{const _0x30996c=_0x390eeb[_0x21df52(0x179)],_0x144c67=_0x423bad['map'](_0x489746=>{const _0x2392a0=_0x21df52,_0x521b21=a52_0x89d45[_0x2392a0(0x20e)]('#'+_0x489746['id']),_0x34583b=_0x489746[_0x2392a0(0x1af)]?.['id'],_0x1026ff=_0x489746['session_id']||_0x489746[_0x2392a0(0xc8)],_0x283521=_0x34583b&&_0x1026ff?hyperlink(_0x521b21,getWorkflowAttemptUrl(_0x30996c,_0x34583b,_0x1026ff,_0x489746['id'])):_0x521b21,{icon:_0xe74b15,text:_0x328b25}=getAttemptStatusDisplay(_0x489746),_0x47f3e1=(_0x489746['project']?.[_0x2392a0(0x20d)]||'?')+'.'+(_0x489746['workflow']?.['name']||'?'),_0x14a182=_0x489746[_0x2392a0(0xa6)]?a52_0x89d45[_0x2392a0(0x20e)](_0x489746['sessionTime']):'';return(_0x283521+'\x20'+_0xe74b15+(_0x328b25?'\x20'+_0x328b25:'')+'\x20'+_0x47f3e1+'\x20'+_0x14a182)['trimEnd']();});await writeOutput(_0x144c67[_0x21df52(0x11c)]('\x0a'),_0x390eeb[_0x21df52(0x20b)],_0x21df52(0xc0));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a52_0xa13f07(0x20d)]='workflow:attempt';['description']=a52_0xa13f07(0x12b);async[a52_0xa13f07(0x22f)](_0x868cb6){const _0x3d79d1=a52_0xa13f07,{options:_0x41767,args:_0x1b4bfc,tdx:_0x196073}=_0x868cb6,_0x5cc5e9=_0x1b4bfc[0x0];if(!_0x5cc5e9)return console['error'](_0x3d79d1(0x222)),0x1;_0x41767[_0x3d79d1(0x1e3)]&&console[_0x3d79d1(0xa9)](_0x3d79d1(0xda)+_0x5cc5e9);const _0x2f8a67=await withSpinner(_0x3d79d1(0x20f),()=>_0x196073[_0x3d79d1(0xfc)][_0x3d79d1(0xc6)](_0x5cc5e9),{'verbose':_0x41767['verbose']}),_0x3848bd=_0x2f8a67[_0x3d79d1(0x14b)];let _0x56a987;!_0x3848bd[_0x3d79d1(0x178)]?_0x56a987=_0x3848bd[_0x3d79d1(0x1b0)]?_0x3d79d1(0x168):_0x3d79d1(0x1b8):_0x56a987=_0x3848bd[_0x3d79d1(0x1ba)]?_0x3d79d1(0x1ba):_0x3d79d1(0xa9);let _0x19cf70;if(_0x3848bd[_0x3d79d1(0x85)]&&_0x3848bd['finishedAt']){const _0xb2defe=new Date(_0x3848bd['createdAt'])[_0x3d79d1(0xe0)](),_0x1553da=new Date(_0x3848bd[_0x3d79d1(0x18a)])[_0x3d79d1(0xe0)]();_0x19cf70=Math[_0x3d79d1(0x19b)]((_0x1553da-_0xb2defe)/0x3e8);}const _0x1f96fd={'attempt_id':_0x3848bd['id'],'status':_0x56a987,..._0x3848bd[_0x3d79d1(0x95)]!==undefined&&{'index':_0x3848bd[_0x3d79d1(0x95)]},..._0x3848bd[_0x3d79d1(0x1af)]&&{'project':_0x3848bd['project'][_0x3d79d1(0x20d)]},..._0x3848bd[_0x3d79d1(0xfc)]&&{'workflow':_0x3848bd[_0x3d79d1(0xfc)][_0x3d79d1(0x20d)]},..._0x3848bd['sessionId']&&{'session_id':_0x3848bd[_0x3d79d1(0xc8)]},..._0x3848bd['sessionTime']&&{'session_time':_0x3848bd[_0x3d79d1(0xa6)]},..._0x3848bd[_0x3d79d1(0x1cc)]&&{'retry_attempt':_0x3848bd[_0x3d79d1(0x1cc)]},..._0x19cf70!==undefined&&{'duration_sec':_0x19cf70},..._0x3848bd['createdAt']&&{'created_at':_0x3848bd[_0x3d79d1(0x85)]},..._0x3848bd[_0x3d79d1(0x18a)]&&{'finished_at':_0x3848bd[_0x3d79d1(0x18a)]},...Object['keys'](_0x3848bd[_0x3d79d1(0x151)])[_0x3d79d1(0x86)]>0x0&&{'params':_0x3848bd['params']}};return await handleSingleObjectOutput(_0x1f96fd,_0x41767),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x198);[a52_0xa13f07(0x122)]=a52_0xa13f07(0x88);async[a52_0xa13f07(0x22f)](_0x50f17a){const _0xedabc0=a52_0xa13f07,{options:_0x1f107c,args:_0x1c4820,tdx:_0x4bc73e}=_0x50f17a,_0x4bc847=_0x1c4820[0x0];if(!_0x4bc847)return console[_0xedabc0(0xa9)](_0xedabc0(0x222)),0x1;const _0x4da6f4=_0x1f107c[_0xedabc0(0x1f2)];_0x1f107c['verbose']&&(console[_0xedabc0(0xa9)](_0xedabc0(0xda)+_0x4bc847),_0x4da6f4&&console['error'](_0xedabc0(0x1df)));const _0x3846e7=await withSpinner(_0xedabc0(0x1c6),()=>_0x4bc73e['workflow'][_0xedabc0(0xe7)](_0x4bc847,_0x4da6f4||![]),{'verbose':_0x1f107c['verbose']}),_0x3d89b5=_0x3846e7[_0xedabc0(0x14b)];return console['error'](_0xedabc0(0x8a)+_0x3d89b5[_0xedabc0(0x86)]+_0xedabc0(0x206)+(_0x3d89b5[_0xedabc0(0x86)]!==0x1?'s':'')),await handleSDKOutput(_0x3d89b5,_0x1f107c),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a52_0xa13f07(0x20d)]='workflow:logs';['description']=a52_0xa13f07(0x225);async[a52_0xa13f07(0x22f)](_0xe15186){const _0x28efb0=a52_0xa13f07,{options:_0xc9ca,args:_0x501163,tdx:_0x44c2ed}=_0xe15186,_0x291bc4=_0x501163[0x0];let _0x2aad1f=_0x501163[0x1];if(!_0x291bc4)return console['error'](_0x28efb0(0x222)),0x1;_0xc9ca['verbose']&&(console[_0x28efb0(0xa9)](_0x28efb0(0xda)+_0x291bc4),_0x2aad1f&&console[_0x28efb0(0xa9)](_0x28efb0(0xf2)+_0x2aad1f));const _0x32e171=await withSpinner('Fetching\x20log\x20files...',()=>_0x44c2ed['workflow'][_0x28efb0(0xb2)](_0x291bc4,_0x2aad1f),{'verbose':_0xc9ca[_0x28efb0(0x1e3)]}),_0xe124ea=_0x32e171['data'];if(_0xe124ea['length']===0x0)return console[_0x28efb0(0xa9)](_0x28efb0(0x16a)),0x0;if(!_0x2aad1f&&(_0xc9ca[_0x28efb0(0xd5)]||_0xc9ca[_0x28efb0(0x99)]))return await handleSDKOutput(_0xe124ea,_0xc9ca),0x0;if(!_0x2aad1f){const _0x251dd8=_0xe124ea[_0x28efb0(0xd7)](_0x284ca9=>({'title':_0x284ca9[_0x28efb0(0x1fb)]+'\x20('+formatBytes(_0x284ca9[_0x28efb0(0x197)])+')','value':_0x284ca9['taskName']})),_0x535bd2=await a52_0x4bedff({'type':'select','name':_0x28efb0(0xd6),'message':_0x28efb0(0x13b),'choices':_0x251dd8});if(!_0x535bd2[_0x28efb0(0xd6)])return console[_0x28efb0(0xa9)](_0x28efb0(0xeb)),0x0;_0x2aad1f=_0x535bd2[_0x28efb0(0xd6)];}const _0x4baebc=await withSpinner(_0x28efb0(0x150),()=>_0x44c2ed[_0x28efb0(0xfc)][_0x28efb0(0x218)](_0x291bc4,_0x2aad1f),{'verbose':_0xc9ca[_0x28efb0(0x1e3)]}),_0x33cad9=_0x4baebc[_0x28efb0(0x14b)];return _0x33cad9?console[_0x28efb0(0x1b2)](_0x33cad9):console['error'](_0x28efb0(0xf8)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0xde);['description']=a52_0xa13f07(0x124);async['execute'](_0x14a456){const _0x3559d3=a52_0xa13f07,{options:_0x502402,args:_0xd11448,tdx:_0x331cfb}=_0x14a456,_0x3b934f=_0xd11448[0x0];if(!_0x3b934f)return console[_0x3559d3(0xa9)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x445bd5=_0x502402['reason'];_0x502402[_0x3559d3(0x1e3)]&&(console[_0x3559d3(0xa9)]('Attempt\x20ID:\x20'+_0x3b934f),_0x445bd5&&console[_0x3559d3(0xa9)](_0x3559d3(0x152)+_0x445bd5));if(!_0x502402['yes']){if(!isInteractive())return console['error'](a52_0x89d45[_0x3559d3(0xb3)](_0x3559d3(0x162)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3559d3(0xa9)](a52_0x89d45[_0x3559d3(0x20e)](_0x3559d3(0x1ad))),0x1;const _0x1a2a5b=await confirmKey(_0x3559d3(0x115)+_0x3b934f+'?');if(!_0x1a2a5b)return console[_0x3559d3(0xa9)](a52_0x89d45[_0x3559d3(0xd4)](_0x3559d3(0xeb))),0x1;}const _0x2b8d52=await withSpinner(_0x3559d3(0xac),()=>_0x331cfb[_0x3559d3(0xfc)][_0x3559d3(0x186)](_0x3b934f,_0x445bd5),{'verbose':_0x502402[_0x3559d3(0x1e3)]}),_0x385200=_0x2b8d52[_0x3559d3(0x14b)];return console[_0x3559d3(0xa9)]('✔\x20'+_0x385200),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x9c);[a52_0xa13f07(0x122)]=a52_0xa13f07(0x165);async['execute'](_0x2edf14){const _0xf6fe6f=a52_0xa13f07,{options:_0x1496b9,args:_0x3f7722,tdx:_0x2d3698}=_0x2edf14,_0x33a894=_0x3f7722[0x0];if(!_0x33a894)return console[_0xf6fe6f(0xa9)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console['error'](_0xf6fe6f(0x158)),0x1;let _0x528e84=![],_0x47dae5=_0x33a894;if(_0x33a894[_0xf6fe6f(0x107)]('session:'))_0x528e84=!![],_0x47dae5=_0x33a894[_0xf6fe6f(0x135)](0x8);else{if(_0x33a894[_0xf6fe6f(0x107)](_0xf6fe6f(0x143)))_0x528e84=![],_0x47dae5=_0x33a894['substring'](0x8);else return console[_0xf6fe6f(0xa9)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0xf6fe6f(0xa9)](_0xf6fe6f(0x158)),0x1;}const _0x32f6ce=_0x1496b9[_0xf6fe6f(0x128)],_0x1d2e2f=_0x1496b9[_0xf6fe6f(0x213)],_0x2de253=_0x1496b9[_0xf6fe6f(0x151)],_0x714a3c=_0x1496b9[_0xf6fe6f(0x1cd)];_0x1496b9[_0xf6fe6f(0x1e3)]&&(console[_0xf6fe6f(0xa9)](_0xf6fe6f(0x93)+(_0x528e84?_0xf6fe6f(0x17e):_0xf6fe6f(0xc6))+'\x20'+_0x47dae5),_0x32f6ce&&console[_0xf6fe6f(0xa9)](_0xf6fe6f(0x202)+_0x32f6ce),_0x1d2e2f&&console[_0xf6fe6f(0xa9)]('Resume\x20from:\x20'+_0x1d2e2f),_0x2de253&&console[_0xf6fe6f(0xa9)](_0xf6fe6f(0x172)+_0x2de253),_0x714a3c&&console[_0xf6fe6f(0xa9)]('Force:\x20yes'));let _0x30d937;if(_0x2de253)try{if(_0x2de253[_0xf6fe6f(0x107)]('@')){const _0x22bb9c=await import(_0xf6fe6f(0x105)),_0x5cd0a6=_0x2de253[_0xf6fe6f(0x135)](0x1),_0x528abd=await _0x22bb9c[_0xf6fe6f(0x19d)](_0x5cd0a6,'utf-8');_0x30d937=JSON[_0xf6fe6f(0x7f)](_0x528abd);}else _0x30d937=JSON['parse'](_0x2de253);}catch{return console[_0xf6fe6f(0xa9)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x1496b9[_0xf6fe6f(0x9f)]){if(!isInteractive())return console['error'](a52_0x89d45['red'](_0xf6fe6f(0x162)),_0xf6fe6f(0x21b)),console[_0xf6fe6f(0xa9)](a52_0x89d45[_0xf6fe6f(0x20e)](_0xf6fe6f(0x1ad))),0x1;const _0x27126e=await confirmKey(_0xf6fe6f(0x1d9)+(_0x528e84?_0xf6fe6f(0x17e):'attempt')+'\x20'+_0x47dae5+'?');if(!_0x27126e)return console[_0xf6fe6f(0xa9)](a52_0x89d45[_0xf6fe6f(0xd4)](_0xf6fe6f(0xeb))),0x1;}let _0x18ef6b;_0x528e84?_0x18ef6b=await withSpinner('Retrying\x20session...',()=>_0x2d3698[_0xf6fe6f(0xfc)][_0xf6fe6f(0xa7)](_0x47dae5,{'fromTask':_0x32f6ce,'retryParams':_0x30d937}),{'verbose':_0x1496b9[_0xf6fe6f(0x1e3)]}):_0x18ef6b=await withSpinner(_0xf6fe6f(0x9a),()=>_0x2d3698[_0xf6fe6f(0xfc)][_0xf6fe6f(0x1fc)](_0x47dae5,{'resumeFrom':_0x1d2e2f,'retryParams':_0x30d937,'force':_0x714a3c}),{'verbose':_0x1496b9[_0xf6fe6f(0x1e3)]});const _0xacab29=_0x18ef6b['data'];return console['error'](_0xf6fe6f(0x11b)),console[_0xf6fe6f(0xa9)](_0xf6fe6f(0x20c)+_0xacab29['attemptId']),console[_0xf6fe6f(0xa9)]('\x20\x20Session\x20ID:\x20'+_0xacab29[_0xf6fe6f(0xc8)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]='workflow:run';[a52_0xa13f07(0x122)]=a52_0xa13f07(0x1c7);async[a52_0xa13f07(0x22f)](_0x30baeb){const _0x23f50b=a52_0xa13f07,{options:_0x4b08be,args:_0x1b4494,tdx:_0x3514a6}=_0x30baeb;let _0x886c77=_0x1b4494[0x0];if(!_0x886c77){const _0x386265=this[_0x23f50b(0x174)]([],_0x4b08be),_0x109d69=await withSpinner(_0x23f50b(0x1da),()=>_0x3514a6[_0x23f50b(0xfc)][_0x23f50b(0xec)](_0x386265,{'limit':_0x4b08be[_0x23f50b(0x91)]}),{'verbose':_0x4b08be['verbose']}),_0x3528d5=_0x109d69[_0x23f50b(0x14b)];if(_0x3528d5[_0x23f50b(0x86)]===0x0)return console[_0x23f50b(0xa9)](_0x23f50b(0xf0)),!_0x386265&&console[_0x23f50b(0xa9)](a52_0x89d45[_0x23f50b(0x20e)](_0x23f50b(0xbc))),0x1;const _0x10b463=_0x3528d5[_0x23f50b(0xd7)](_0xd93412=>({'title':_0xd93412['project']?.['name']+'.'+_0xd93412[_0x23f50b(0x20d)],'value':_0xd93412[_0x23f50b(0x1af)]?.[_0x23f50b(0x20d)]+'.'+_0xd93412['name'],'description':_0xd93412[_0x23f50b(0x204)]?_0x23f50b(0x21f)+_0xd93412[_0x23f50b(0x204)]:undefined})),_0xa62bd8=await a52_0x4bedff({'type':'select','name':_0x23f50b(0xfc),'message':_0x23f50b(0x1c9),'choices':_0x10b463});if(!_0xa62bd8['workflow'])return 0x1;_0x886c77=_0xa62bd8['workflow'];}if(!_0x886c77['includes']('.')){const _0x1d24bf=this[_0x23f50b(0x174)]([],_0x4b08be);if(_0x1d24bf)_0x886c77=_0x1d24bf+'.'+_0x886c77;else return console[_0x23f50b(0xa9)](a52_0x89d45[_0x23f50b(0xb3)](_0x23f50b(0x1a0)),_0x23f50b(0x1d6)),console[_0x23f50b(0xa9)](a52_0x89d45[_0x23f50b(0x20e)](_0x23f50b(0xbc))),0x1;}const _0x14cdc3=_0x4b08be[_0x23f50b(0xcd)],_0x4d89fe=_0x4b08be[_0x23f50b(0xa6)],_0x1eb669={};if(_0x14cdc3&&Array[_0x23f50b(0x1ac)](_0x14cdc3))for(const _0x4f641d of _0x14cdc3){const _0x51acfb=_0x4f641d[_0x23f50b(0x155)]('=');if(_0x51acfb===-0x1)return console[_0x23f50b(0xa9)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4f641d),console[_0x23f50b(0xa9)](_0x23f50b(0x1ff)),0x1;const _0x251b51=_0x4f641d[_0x23f50b(0x135)](0x0,_0x51acfb),_0x7100d5=_0x4f641d[_0x23f50b(0x135)](_0x51acfb+0x1);try{_0x1eb669[_0x251b51]=JSON[_0x23f50b(0x7f)](_0x7100d5);}catch{_0x1eb669[_0x251b51]=_0x7100d5;}}_0x4b08be[_0x23f50b(0x1e3)]&&(console[_0x23f50b(0xa9)](_0x23f50b(0x137)+_0x886c77),Object[_0x23f50b(0x10e)](_0x1eb669)[_0x23f50b(0x86)]>0x0&&console[_0x23f50b(0xa9)](_0x23f50b(0x127)+JSON[_0x23f50b(0xab)](_0x1eb669)),_0x4d89fe&&console[_0x23f50b(0xa9)]('Session\x20time:\x20'+_0x4d89fe));const _0x1910b9=await withSpinner(_0x23f50b(0xee),()=>_0x3514a6[_0x23f50b(0xfc)][_0x23f50b(0x223)](_0x886c77,_0x1eb669,{'sessionTime':_0x4d89fe}),{'verbose':_0x4b08be['verbose']}),_0x103869=_0x1910b9[_0x23f50b(0x14b)];console['error'](_0x23f50b(0x188)),console[_0x23f50b(0xa9)]('\x20\x20Attempt\x20ID:\x20'+_0x103869['id']),console[_0x23f50b(0xa9)](_0x23f50b(0x219)+_0x103869[_0x23f50b(0xc8)]),console[_0x23f50b(0xa9)](_0x23f50b(0x1c8)+_0x103869[_0x23f50b(0x1af)]?.[_0x23f50b(0x20d)]),console[_0x23f50b(0xa9)](_0x23f50b(0x7d)+_0x103869[_0x23f50b(0xfc)]?.['name']);if(_0x103869[_0x23f50b(0x1af)]?.['id']&&_0x103869[_0x23f50b(0xc8)]&&_0x103869['id']){const _0x22d36b=_0x4b08be['site'],_0x95de61=getConsoleUrl(_0x22d36b,_0x23f50b(0xf5)+_0x103869[_0x23f50b(0x1af)]['id']+_0x23f50b(0x9e)+_0x103869[_0x23f50b(0xc8)]+_0x23f50b(0x194)+_0x103869['id']);console['error'](_0x23f50b(0x210)+a52_0x89d45[_0x23f50b(0x184)](_0x95de61));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x1b5);[a52_0xa13f07(0x122)]=a52_0xa13f07(0xd8);async[a52_0xa13f07(0x22f)](_0xc64a6f){const _0x20b903=a52_0xa13f07,{options:_0x79f393,args:_0x2eab4b,tdx:_0x480b4b}=_0xc64a6f,_0x27683a=_0x2eab4b[0x0],_0x417c77=_0x2eab4b[0x1]||'.';if(!_0x27683a)return console[_0x20b903(0xa9)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x20b903(0x196)),0x1;const _0x2699d3=_0x79f393[_0x20b903(0x204)];_0x79f393[_0x20b903(0x1e3)]&&(console[_0x20b903(0xa9)](_0x20b903(0xaa)+_0x27683a),console['error'](_0x20b903(0x148)+_0x417c77),_0x2699d3&&console['error']('Revision:\x20'+_0x2699d3));const _0x2795e0=await withSpinner(_0x20b903(0xe6)+_0x27683a+_0x20b903(0xe1),()=>_0x480b4b[_0x20b903(0xfc)][_0x20b903(0x227)](_0x27683a,_0x417c77,{'revision':_0x2699d3}),{'verbose':_0x79f393[_0x20b903(0x1e3)]}),_0x228c54=_0x2795e0[_0x20b903(0x14b)];return console[_0x20b903(0xa9)](_0x20b903(0x221)+_0x228c54[_0x20b903(0x120)]),console[_0x20b903(0xa9)](_0x20b903(0xc5)+_0x228c54['revision']),console[_0x20b903(0xa9)](_0x20b903(0xbd)+_0x228c54[_0x20b903(0x139)]),console[_0x20b903(0xa9)](_0x20b903(0xff)+_0x417c77+'/'+_0x228c54[_0x20b903(0x120)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x112);[a52_0xa13f07(0x122)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a52_0xa13f07(0x22f)](_0x4534b5){const _0x52e53f=a52_0xa13f07,{options:_0x3e35af,args:_0x53551b,tdx:_0xf8ea5f}=_0x4534b5;let _0x172006='.',_0x25f299=_0x3e35af[_0x52e53f(0x20d)];if(_0x53551b[0x0]){const {promises:_0x21751e}=await import('fs');try{const _0x49ed26=await _0x21751e[_0x52e53f(0x1dc)](_0x53551b[0x0]);if(_0x49ed26['isDirectory']())_0x172006=_0x53551b[0x0];else return console[_0x52e53f(0xa9)](_0x52e53f(0x1aa)+_0x53551b[0x0]+_0x52e53f(0x1f3)),0x1;}catch{_0x25f299=_0x53551b[0x0],_0x172006='.';}}const _0x1c750b=_0x3e35af['revision'],_0x21cda3=_0x3e35af[_0x52e53f(0x1d7)];_0x3e35af[_0x52e53f(0x1e3)]&&(console['error'](_0x52e53f(0x145)+_0x172006),_0x25f299&&console[_0x52e53f(0xa9)](_0x52e53f(0xbe)+_0x25f299),_0x1c750b&&console[_0x52e53f(0xa9)](_0x52e53f(0x193)+_0x1c750b),_0x21cda3&&console['error'](_0x52e53f(0x10a)));const _0xbd6f6=await withSpinner('Pushing\x20workflow\x20project...',()=>_0xf8ea5f[_0x52e53f(0xfc)]['push'](_0x172006,{'projectName':_0x25f299,'revision':_0x1c750b,'skipValidation':_0x21cda3}),{'verbose':_0x3e35af[_0x52e53f(0x1e3)]}),_0x3538fc=_0xbd6f6[_0x52e53f(0x14b)];return console[_0x52e53f(0xa9)]('✔\x20Pushed\x20'+_0x3538fc[_0x52e53f(0x120)]),console[_0x52e53f(0xa9)]('\x20\x20Project\x20ID:\x20'+_0x3538fc[_0x52e53f(0x1d5)]),console[_0x52e53f(0xa9)](_0x52e53f(0xc5)+_0x3538fc[_0x52e53f(0x204)]),await this[_0x52e53f(0x1c2)](_0xf8ea5f,_0x3538fc[_0x52e53f(0x120)],_0x3e35af[_0x52e53f(0x179)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x1d3);[a52_0xa13f07(0x122)]=a52_0xa13f07(0xa0);async['execute'](_0x4075d7){const _0x1aed71=a52_0xa13f07,{options:_0x3dc0ad,args:_0x11d1c6,tdx:_0x9c8b78}=_0x4075d7,_0x395215=_0x11d1c6[0x0],_0x5abc6f=_0x11d1c6[0x1];if(!_0x395215)return console[_0x1aed71(0xa9)](a52_0x89d45[_0x1aed71(0xb3)](_0x1aed71(0x1a0)),_0x1aed71(0x161)),console[_0x1aed71(0xa9)](a52_0x89d45['dim'](_0x1aed71(0x1cb))),0x1;const _0x5db21b=_0x3dc0ad[_0x1aed71(0x204)];_0x3dc0ad['verbose']&&(console[_0x1aed71(0xa9)](_0x1aed71(0xaa)+_0x395215),_0x5abc6f&&console[_0x1aed71(0xa9)]('Target\x20directory:\x20'+_0x5abc6f),_0x5db21b&&console[_0x1aed71(0xa9)](_0x1aed71(0x193)+_0x5db21b),_0x3dc0ad[_0x1aed71(0xf1)]&&console['error'](_0x1aed71(0xe9)));const _0xa4f3be=await withSpinner(_0x1aed71(0x208)+_0x395215+_0x1aed71(0xe1),()=>_0x9c8b78[_0x1aed71(0xfc)]['pullProject'](_0x395215,{'targetDir':_0x5abc6f,'revision':_0x5db21b}),{'verbose':_0x3dc0ad[_0x1aed71(0x1e3)]}),_0x3533b0=_0xa4f3be[_0x1aed71(0x14b)];_0x3533b0[_0x1aed71(0x1ea)]?console[_0x1aed71(0xa9)](_0x1aed71(0x14c)+_0x3533b0[_0x1aed71(0x120)]):console[_0x1aed71(0xa9)](_0x1aed71(0xf9)+_0x3533b0[_0x1aed71(0x120)]);console[_0x1aed71(0xa9)]('\x20\x20Revision:\x20'+_0x3533b0[_0x1aed71(0x204)]),console[_0x1aed71(0xa9)](_0x1aed71(0x17b)+(a52_0x2ac51d[_0x1aed71(0x13c)](process[_0x1aed71(0xb9)](),_0x3533b0[_0x1aed71(0x10c)])||'.')),console['error'](_0x1aed71(0x9b)+a52_0x89d45[_0x1aed71(0x118)]('+'+_0x3533b0[_0x1aed71(0x182)][_0x1aed71(0x1bf)]+_0x1aed71(0x166))+',\x20'+(a52_0x89d45[_0x1aed71(0xd4)]('~'+_0x3533b0[_0x1aed71(0x182)][_0x1aed71(0x211)]+_0x1aed71(0xb6))+',\x20')+(a52_0x89d45[_0x1aed71(0xb3)]('-'+_0x3533b0[_0x1aed71(0x182)]['deleted']+'\x20deleted')+',\x20')+(''+a52_0x89d45[_0x1aed71(0x20e)](_0x3533b0[_0x1aed71(0x182)][_0x1aed71(0x228)]+_0x1aed71(0x1f1))));for(const _0xe0e3e3 of _0x3533b0[_0x1aed71(0xd1)]){_0xe0e3e3['type']===_0x1aed71(0x211)&&_0xe0e3e3[_0x1aed71(0x141)]&&(console[_0x1aed71(0xa9)]('\x0a'+a52_0x89d45[_0x1aed71(0x184)](_0x1aed71(0x18f)+_0xe0e3e3['path'])),console['error'](_0xe0e3e3[_0x1aed71(0x141)]));}if(!_0x3533b0[_0x1aed71(0x16b)])return saveSessionContext({'workflow_project':_0x3533b0[_0x1aed71(0x120)]},_0x3dc0ad['session']),console[_0x1aed71(0xa9)](a52_0x89d45[_0x1aed71(0x118)](_0x1aed71(0x94))),console[_0x1aed71(0xa9)](a52_0x89d45[_0x1aed71(0x20e)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3533b0[_0x1aed71(0x120)])),0x0;if(_0x3dc0ad[_0x1aed71(0xf1)])return console[_0x1aed71(0xa9)](a52_0x89d45[_0x1aed71(0xd4)](_0x1aed71(0x17a))),0x0;if(!_0x3dc0ad[_0x1aed71(0x9f)]){if(!isInteractive())return console[_0x1aed71(0xa9)](a52_0x89d45[_0x1aed71(0xb3)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1aed71(0xa9)](a52_0x89d45[_0x1aed71(0x20e)](_0x1aed71(0x1ad))),0x1;const _0x4c8a88=await confirmKey(_0x1aed71(0x16c));if(!_0x4c8a88)return console[_0x1aed71(0xa9)](a52_0x89d45['yellow']('Cancelled'),_0x1aed71(0x22a)),0x1;}await withSpinner('Writing\x20files...',()=>_0x9c8b78['workflow'][_0x1aed71(0x11f)](_0x3533b0,{'revision':_0x5db21b}),{'verbose':_0x3dc0ad[_0x1aed71(0x1e3)]}),saveSessionContext({'workflow_project':_0x3533b0[_0x1aed71(0x120)]},_0x3dc0ad[_0x1aed71(0x17e)]),console[_0x1aed71(0xa9)](a52_0x89d45[_0x1aed71(0x118)]('✔\x20Pull\x20complete'));const _0x40a29b=a52_0x2ac51d['relative'](process[_0x1aed71(0xb9)](),_0x3533b0[_0x1aed71(0x10c)])||'.';return console[_0x1aed71(0xa9)](a52_0x89d45[_0x1aed71(0x20e)](_0x1aed71(0xff)+_0x40a29b)),console[_0x1aed71(0xa9)](a52_0x89d45['dim'](_0x1aed71(0x22d)+_0x3533b0['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x13e);[a52_0xa13f07(0x122)]=a52_0xa13f07(0x146);async['execute'](_0x57e0d5){const _0x46d30d=a52_0xa13f07,{options:_0xb35810,args:_0x5a4d28,tdx:_0xe271f5}=_0x57e0d5,_0x5e0161=this[_0x46d30d(0x1e4)](_0x5a4d28,_0xb35810),_0x4edacc=_0xb35810[_0x46d30d(0x204)],_0x3c2152=_0xb35810['skipValidation'];_0xb35810['verbose']&&(_0x5e0161&&console[_0x46d30d(0xa9)](_0x46d30d(0x1d0)+_0x5e0161),_0x4edacc&&console['error']('Revision:\x20'+_0x4edacc),_0xb35810[_0x46d30d(0xf1)]&&console[_0x46d30d(0xa9)]('Dry\x20run:\x20yes'),_0x3c2152&&console[_0x46d30d(0xa9)](_0x46d30d(0x10a)));let _0x2691c3;try{_0x2691c3=await withSpinner('Analyzing\x20changes...',()=>_0xe271f5[_0x46d30d(0xfc)]['preparePushProject']({'sourceDir':_0x5e0161,'revision':_0x4edacc,'skipValidation':_0x3c2152}),{'verbose':_0xb35810['verbose']});}catch(_0x5e71df){if(_0x5e71df instanceof Error&&_0x5e71df[_0x46d30d(0xe5)]['includes'](_0x46d30d(0x1a8)))return console['error'](a52_0x89d45['red']('Error:'),_0x46d30d(0x1ec)),_0xb35810['workflowProject']?console[_0x46d30d(0xa9)](a52_0x89d45['dim'](_0x46d30d(0x170)+_0xb35810[_0x46d30d(0x125)]+_0x46d30d(0x14f)+_0xb35810['workflowProject']+'\x27')):console['error'](a52_0x89d45[_0x46d30d(0x20e)](_0x46d30d(0x147))),0x1;throw _0x5e71df;}const _0x48e44c=_0x2691c3[_0x46d30d(0x14b)];console[_0x46d30d(0xa9)](_0x46d30d(0x14d)+_0x48e44c[_0x46d30d(0x120)]),console['error'](_0x46d30d(0x1e2)+_0x48e44c[_0x46d30d(0x1b1)]),console['error'](_0x46d30d(0xc5)+_0x48e44c['revision']),console[_0x46d30d(0xa9)]('\x20\x20Changes:\x20'+a52_0x89d45[_0x46d30d(0x118)]('+'+_0x48e44c[_0x46d30d(0x182)][_0x46d30d(0x1bf)]+'\x20new')+',\x20'+(a52_0x89d45[_0x46d30d(0xd4)]('~'+_0x48e44c['summary']['modified']+'\x20modified')+',\x20')+(a52_0x89d45['red']('-'+_0x48e44c['summary'][_0x46d30d(0x21d)]+_0x46d30d(0x153))+',\x20')+(''+a52_0x89d45['dim'](_0x48e44c[_0x46d30d(0x182)]['unchanged']+_0x46d30d(0x1f1))));for(const _0xfe34ff of _0x48e44c['changes']){_0xfe34ff[_0x46d30d(0x209)]===_0x46d30d(0x211)&&_0xfe34ff[_0x46d30d(0x141)]&&(console[_0x46d30d(0xa9)]('\x0a'+a52_0x89d45[_0x46d30d(0x184)](_0x46d30d(0x18f)+_0xfe34ff[_0x46d30d(0x11d)])),console[_0x46d30d(0xa9)](_0xfe34ff['diff']));}if(!_0x48e44c[_0x46d30d(0x16b)])return console[_0x46d30d(0xa9)](a52_0x89d45[_0x46d30d(0x118)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x46d30d(0x1c2)](_0xe271f5,_0x48e44c[_0x46d30d(0x120)],_0xb35810['site']),0x0;if(_0xb35810[_0x46d30d(0xf1)])return console['error'](a52_0x89d45[_0x46d30d(0xd4)](_0x46d30d(0x110))),0x0;if(!_0xb35810[_0x46d30d(0x9f)]){if(!isInteractive())return console[_0x46d30d(0xa9)](a52_0x89d45[_0x46d30d(0xb3)](_0x46d30d(0x162)),_0x46d30d(0x21b)),console['error'](a52_0x89d45[_0x46d30d(0x20e)](_0x46d30d(0x1ad))),0x1;const _0x505a25=await confirmKey(_0x46d30d(0x19a));if(!_0x505a25)return console[_0x46d30d(0xa9)](a52_0x89d45[_0x46d30d(0xd4)](_0x46d30d(0xeb)),_0x46d30d(0x12a)),0x1;}const _0xf5ffc4=await withSpinner(_0x46d30d(0x1a7),()=>_0xe271f5['workflow']['executePushProject'](_0x48e44c),{'verbose':_0xb35810[_0x46d30d(0x1e3)]}),_0x3bfa73=_0xf5ffc4['data'];return console[_0x46d30d(0xa9)](a52_0x89d45[_0x46d30d(0x118)]('✔\x20Push\x20complete')),console[_0x46d30d(0xa9)](_0x46d30d(0x180)+_0x3bfa73[_0x46d30d(0x1d5)]),console['error'](_0x46d30d(0xc5)+_0x3bfa73[_0x46d30d(0x204)]),await this['showWorkflowConsoleUrl'](_0xe271f5,_0x3bfa73['projectName'],_0xb35810['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]='workflow:clone';['description']=a52_0xa13f07(0x1f7);async[a52_0xa13f07(0x22f)](_0x52f764){const _0x31a14e=a52_0xa13f07,{options:_0xdc9063,args:_0x42179b,tdx:_0xbcba99}=_0x52f764,_0xe0ff03=this[_0x31a14e(0x1e4)](_0x42179b,_0xdc9063),_0x41900d=_0xdc9063['name'],_0x332016=_0xdc9063['revision'],_0x51e6a8=_0xdc9063[_0x31a14e(0x1d7)];if(!_0xe0ff03)return console[_0x31a14e(0xa9)](a52_0x89d45[_0x31a14e(0xb3)](_0x31a14e(0x1a0)),_0x31a14e(0xea)),console[_0x31a14e(0xa9)](a52_0x89d45[_0x31a14e(0x20e)](_0x31a14e(0x15a))),console['error'](a52_0x89d45['dim'](_0x31a14e(0x82))),0x1;if(!_0x41900d)return console[_0x31a14e(0xa9)](a52_0x89d45[_0x31a14e(0xb3)]('Error:'),_0x31a14e(0xe4)),console[_0x31a14e(0xa9)](a52_0x89d45['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0xdc9063['verbose']&&(console[_0x31a14e(0xa9)](_0x31a14e(0x1d0)+_0xe0ff03),console[_0x31a14e(0xa9)](_0x31a14e(0x1c0)+_0x41900d),_0x332016&&console[_0x31a14e(0xa9)](_0x31a14e(0x193)+_0x332016),_0xdc9063[_0x31a14e(0xf1)]&&console[_0x31a14e(0xa9)](_0x31a14e(0xe9)),_0x51e6a8&&console['error'](_0x31a14e(0x10a)));const _0x38e6fa=await withSpinner('Analyzing\x20project...',()=>_0xbcba99[_0x31a14e(0xfc)][_0x31a14e(0x134)](_0xe0ff03,_0x41900d,{'revision':_0x332016,'skipValidation':_0x51e6a8}),{'verbose':_0xdc9063[_0x31a14e(0x1e3)]}),_0x2391e6=_0x38e6fa['data'];console[_0x31a14e(0xa9)]('Source:\x20'+_0x2391e6['sourceDir']);_0x2391e6[_0x31a14e(0xe2)]&&console[_0x31a14e(0xa9)](_0x31a14e(0x1c5)+_0x2391e6[_0x31a14e(0xe2)]);console['error'](_0x31a14e(0x1c0)+_0x2391e6[_0x31a14e(0xbb)]),console[_0x31a14e(0xa9)]('Revision:\x20'+_0x2391e6[_0x31a14e(0x204)]),console[_0x31a14e(0xa9)](_0x31a14e(0xb8)+_0x2391e6[_0x31a14e(0x126)]);_0x2391e6[_0x31a14e(0x18b)]&&(console[_0x31a14e(0xa9)](a52_0x89d45[_0x31a14e(0xd4)](_0x31a14e(0xaf)+_0x2391e6[_0x31a14e(0xbb)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x2391e6[_0x31a14e(0x1ef)]+')')),console[_0x31a14e(0xa9)](a52_0x89d45[_0x31a14e(0xd4)](_0x31a14e(0x1de))));if(_0xdc9063['dryRun'])return console['error'](a52_0x89d45[_0x31a14e(0xd4)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0xdc9063[_0x31a14e(0x9f)]){if(!isInteractive())return console[_0x31a14e(0xa9)](a52_0x89d45[_0x31a14e(0xb3)](_0x31a14e(0x162)),_0x31a14e(0x21b)),console[_0x31a14e(0xa9)](a52_0x89d45[_0x31a14e(0x20e)](_0x31a14e(0x1ad))),0x1;const _0x30f634=_0x2391e6[_0x31a14e(0xe2)]||a52_0x2ac51d[_0x31a14e(0xfd)](_0xe0ff03),_0x5f32fe=_0x2391e6[_0x31a14e(0x18b)]?_0x31a14e(0xc1)+_0x41900d+_0x31a14e(0x17c):'\x0aClone\x20\x22'+_0x30f634+_0x31a14e(0xe3)+_0x41900d+'\x22?',_0x460cb4=await confirmKey(_0x5f32fe);if(!_0x460cb4)return console[_0x31a14e(0xa9)](a52_0x89d45['yellow'](_0x31a14e(0xeb))),0x1;}const _0x28926a=await withSpinner(_0x2391e6[_0x31a14e(0x18b)]?'Updating\x20'+_0x41900d+_0x31a14e(0xe1):_0x31a14e(0x1e8)+_0x41900d+'...',()=>_0xbcba99['workflow'][_0x31a14e(0xcb)](_0x2391e6),{'verbose':_0xdc9063[_0x31a14e(0x1e3)]}),_0x63b03e=_0x28926a[_0x31a14e(0x14b)];return console[_0x31a14e(0xa9)](a52_0x89d45['green'](_0x2391e6[_0x31a14e(0x18b)]?_0x31a14e(0x1eb):_0x31a14e(0x192))),console[_0x31a14e(0xa9)](_0x31a14e(0x1c8)+_0x63b03e[_0x31a14e(0xbb)]),console['error'](_0x31a14e(0x180)+_0x63b03e[_0x31a14e(0x96)]),console[_0x31a14e(0xa9)](_0x31a14e(0xc5)+_0x63b03e['revision']),await this[_0x31a14e(0x1c2)](_0xbcba99,_0x63b03e[_0x31a14e(0xbb)],_0xdc9063[_0x31a14e(0x179)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x108);[a52_0xa13f07(0x122)]=a52_0xa13f07(0x12c);async[a52_0xa13f07(0x22f)](_0x39ddc4){const _0x304809=a52_0xa13f07,{options:_0x157842,args:_0x4ac2a1,tdx:_0xeb521c}=_0x39ddc4,_0x13136e=_0x4ac2a1[0x0];if(!_0x13136e)return console['error'](_0x304809(0x7c)),console[_0x304809(0xa9)](_0x304809(0x11e)),0x1;_0x157842[_0x304809(0x1e3)]&&console[_0x304809(0xa9)](_0x304809(0xaa)+_0x13136e);if(!_0x157842[_0x304809(0x9f)]){if(!isInteractive())return console[_0x304809(0xa9)](a52_0x89d45['red'](_0x304809(0x162)),_0x304809(0x21b)),console[_0x304809(0xa9)](a52_0x89d45[_0x304809(0x20e)](_0x304809(0x1ad))),0x1;const _0x57d80d=await confirmKey(_0x304809(0x160)+_0x13136e+_0x304809(0x157));if(!_0x57d80d)return console[_0x304809(0xa9)](a52_0x89d45['yellow'](_0x304809(0xeb))),0x1;}const _0x2181c1=await withSpinner(_0x304809(0x7e)+_0x13136e+'...',()=>_0xeb521c[_0x304809(0xfc)]['delete'](_0x13136e),{'verbose':_0x157842['verbose']}),_0x57203d=_0x2181c1[_0x304809(0x14b)];return console[_0x304809(0xa9)](_0x304809(0x119)+_0x57203d[_0x304809(0x120)]),console[_0x304809(0xa9)](_0x304809(0x180)+_0x57203d[_0x304809(0x1d5)]),0x0;}}export function parseKeyValue(_0x3e0b98){const _0x3b9159=a52_0xa13f07,_0x41f2f0=_0x3e0b98[_0x3b9159(0x155)]('=');if(_0x41f2f0===-0x1)throw new Error(_0x3b9159(0x1f6)+_0x3e0b98+_0x3b9159(0x212));const _0xf7a105=_0x3e0b98[_0x3b9159(0x135)](0x0,_0x41f2f0),_0x27c077=_0x3e0b98[_0x3b9159(0x135)](_0x41f2f0+0x1);if(!_0xf7a105)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0xf7a105,'value':_0x27c077};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0xed);[a52_0xa13f07(0x122)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a52_0xa13f07(0x22f)](_0x409399){const _0x5e9c7c=a52_0xa13f07,{options:_0x3cae1e,args:_0x541b6a,tdx:_0x8cac46}=_0x409399,_0x54624e=this[_0x5e9c7c(0x21e)](_0x541b6a,_0x3cae1e);if(!_0x54624e)return 0x1;_0x3cae1e[_0x5e9c7c(0x1e3)]&&console['error']('Project:\x20'+_0x54624e);const _0x12561b=await withSpinner(_0x5e9c7c(0xd9),()=>_0x8cac46[_0x5e9c7c(0xfc)][_0x5e9c7c(0x10d)](_0x54624e),{'verbose':_0x3cae1e[_0x5e9c7c(0x1e3)]}),{secrets:_0x2ee386}=_0x12561b[_0x5e9c7c(0x14b)];return console[_0x5e9c7c(0xa9)](_0x5e9c7c(0x8a)+_0x2ee386[_0x5e9c7c(0x86)]+_0x5e9c7c(0x1e7)+(_0x2ee386[_0x5e9c7c(0x86)]!==0x1?'s':'')),await handleSDKOutput(_0x2ee386,_0x3cae1e),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x20a);[a52_0xa13f07(0x122)]=a52_0xa13f07(0xf6);async[a52_0xa13f07(0x22f)](_0x552e29){const _0x3836b2=a52_0xa13f07,{options:_0x1872b2,args:_0xf037a3,tdx:_0x4514eb}=_0x552e29;let _0x354fae,_0x305d76;if(_0xf037a3['length']>=0x1&&!_0xf037a3[0x0][_0x3836b2(0x1bd)]('='))_0x354fae=_0xf037a3[0x0],_0x305d76=_0xf037a3[_0x3836b2(0xb0)](0x1);else{if(_0xf037a3['length']>=0x1&&_0x1872b2['workflowProject'])_0x354fae=_0x1872b2[_0x3836b2(0x125)],_0x305d76=_0xf037a3;else return _0xf037a3[_0x3836b2(0x86)]>=0x1?(console[_0x3836b2(0xa9)](_0x3836b2(0x14a)),console['error'](_0x3836b2(0xbc)),0x1):(console[_0x3836b2(0xa9)](_0x3836b2(0x230)),console[_0x3836b2(0xa9)](_0x3836b2(0x22c)),0x1);}if(_0x305d76['length']===0x0)return console[_0x3836b2(0xa9)](_0x3836b2(0x230)),console['error'](_0x3836b2(0x22c)),0x1;const _0xcd29c6={};try{for(const _0x5d2220 of _0x305d76){const {key:_0x59856d,value:_0x3b5974}=parseKeyValue(_0x5d2220);_0xcd29c6[_0x59856d]=_0x3b5974;}}catch(_0x53d4db){return _0x53d4db instanceof Error&&console[_0x3836b2(0xa9)](a52_0x89d45[_0x3836b2(0xb3)]('Error:'),_0x53d4db[_0x3836b2(0xe5)]),0x1;}const _0x2a7b17=Object[_0x3836b2(0x10e)](_0xcd29c6);_0x1872b2[_0x3836b2(0x1e3)]&&(console['error'](_0x3836b2(0xaa)+_0x354fae),console[_0x3836b2(0xa9)]('Secrets\x20to\x20set:\x20'+_0x2a7b17[_0x3836b2(0x11c)](',\x20')));const _0x3d0832=await withSpinner(_0x2a7b17[_0x3836b2(0x86)]===0x1?'Setting\x20secret...':_0x3836b2(0x220)+_0x2a7b17['length']+_0x3836b2(0x1b3),()=>_0x4514eb[_0x3836b2(0xfc)][_0x3836b2(0x1ed)](_0x354fae,_0xcd29c6),{'verbose':_0x1872b2['verbose']}),_0x14f2e8=_0x3d0832[_0x3836b2(0x14b)];return console['error'](_0x2a7b17[_0x3836b2(0x86)]===0x1?_0x3836b2(0x1dd)+_0x14f2e8[_0x3836b2(0x10e)][0x0]+_0x3836b2(0x12e)+_0x14f2e8[_0x3836b2(0x120)]+'\x27':'✔\x20'+_0x14f2e8[_0x3836b2(0x10e)]['length']+_0x3836b2(0x224)+_0x14f2e8['projectName']+'\x27'),(_0x1872b2['json']||_0x1872b2[_0x3836b2(0x175)])&&await handleSingleObjectOutput(_0x14f2e8,_0x1872b2),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]='workflow:secrets:delete';[a52_0xa13f07(0x122)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a52_0xa13f07(0x22f)](_0x4eb90c){const _0x41a9c2=a52_0xa13f07,{options:_0x1fe2a8,args:_0x4a4215,tdx:_0x7cd6a0}=_0x4eb90c;let _0xc95dbc,_0x1a2f8d;if(_0x4a4215[_0x41a9c2(0x86)]>=0x2)_0xc95dbc=_0x4a4215[0x0],_0x1a2f8d=_0x4a4215[0x1];else{if(_0x4a4215[_0x41a9c2(0x86)]===0x1&&_0x1fe2a8[_0x41a9c2(0x125)])_0xc95dbc=_0x1fe2a8[_0x41a9c2(0x125)],_0x1a2f8d=_0x4a4215[0x0];else return _0x4a4215[_0x41a9c2(0x86)]===0x1?(console[_0x41a9c2(0xa9)](_0x41a9c2(0x14a)),console[_0x41a9c2(0xa9)](_0x41a9c2(0xbc)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console[_0x41a9c2(0xa9)](_0x41a9c2(0x154)),0x1);}_0x1fe2a8[_0x41a9c2(0x1e3)]&&(console['error'](_0x41a9c2(0xaa)+_0xc95dbc),console[_0x41a9c2(0xa9)](_0x41a9c2(0x103)+_0x1a2f8d));if(!_0x1fe2a8[_0x41a9c2(0x9f)]){if(!isInteractive())return console['error'](a52_0x89d45[_0x41a9c2(0xb3)](_0x41a9c2(0x162)),_0x41a9c2(0x21b)),console[_0x41a9c2(0xa9)](a52_0x89d45['dim'](_0x41a9c2(0x1ad))),0x1;const _0x297106=await confirmKey(_0x41a9c2(0x195)+_0x1a2f8d+'\x27\x20from\x20project\x20\x27'+_0xc95dbc+'\x27?');if(!_0x297106)return console[_0x41a9c2(0xa9)](a52_0x89d45[_0x41a9c2(0xd4)](_0x41a9c2(0xeb))),0x1;}const _0xbd93d6=await withSpinner(_0x41a9c2(0x1e1),()=>_0x7cd6a0[_0x41a9c2(0xfc)][_0x41a9c2(0x14e)](_0xc95dbc,_0x1a2f8d),{'verbose':_0x1fe2a8[_0x41a9c2(0x1e3)]}),_0x5d6a56=_0xbd93d6[_0x41a9c2(0x14b)];return console[_0x41a9c2(0xa9)](_0x41a9c2(0x1dd)+_0x5d6a56[_0x41a9c2(0x176)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x5d6a56[_0x41a9c2(0x120)]+'\x27'),(_0x1fe2a8[_0x41a9c2(0xd5)]||_0x1fe2a8[_0x41a9c2(0x175)])&&await handleSingleObjectOutput(_0x5d6a56,_0x1fe2a8),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function a52_0x2d2f(){const _0x251d6b=['/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Downloading\x20logs...','params','Reason:\x20','\x20deleted','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','indexOf','✔\x20Workflow\x20project\x20set\x20to:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','window','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','10aQTXef','stdout','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','workflow:timeline','rows','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Project\x20name\x20is\x20required','\x0aError:','\x20logs','context','Retry\x20a\x20session\x20or\x20attempt','\x20new','12936wPhvvR','canceling','LABEL_MIN_SPACING','No\x20log\x20files\x20found\x20for\x20this\x20attempt','hasChanges','\x0aApply\x20these\x20changes?','set','No\x20attempts\x20found\x20for:\x20','fill','Tip:\x20cd\x20to\x20workflows/','Session\x20not\x20found:\x20','Params:\x20','text','resolveProject','jsonl','key','localeCompare','done','site','\x0aDry\x20run\x20-\x20no\x20files\x20written','\x20\x20Target:\x20','\x22\x20with\x20new\x20revision?','durationMs','session','Warning:','\x20\x20Project\x20ID:\x20','(use\x20--limit\x20to\x20see\x20more)','summary','194938gieElo','cyan','599210CGmTzs','kill','resolve','✔\x20Workflow\x20run\x20started','No\x20sessions\x20found\x20in\x20project:\x20','finishedAt','targetExists','12393CDJhlX','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','133waeiBd','---\x20','min','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','✔\x20Clone\x20complete','Revision:\x20','/attempt/','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','fileSize','workflow:tasks','No\x20attempts\x20found','\x0aPush\x20these\x20changes?','round','get','readFile','resolveProjectId','workflow:attempts','Error:','startTime','No\x20workflow\x20sessions\x20found','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','pending','\x20(use\x20--limit\x20to\x20show\x20more)','end','Pushing\x20project...','No\x20workflow\x20tdx.json\x20found','Project\x20filter:\x20','Error:\x20','parseProjectWorkflowPattern','isArray','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','renderSessionsTimeline','project','cancelRequested','sourceDir','log','\x20secrets...','💡\x20Tip:\x20Use\x20','workflow:download','trim','POLL_INTERVAL_MS','running','Filter:\x20project=','success','columns','match','includes','buildTimelineData','new','New\x20project\x20name:\x20','ICON_WIDTH','showWorkflowConsoleUrl','displayLine','state','Source\x20project:\x20','Getting\x20attempt\x20tasks...','Start\x20a\x20workflow\x20run','\x20\x20Project:\x20','Select\x20a\x20workflow\x20to\x20run','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','retryAttemptName','force','renderSingleTimeline','No\x20sessions\x20with\x20timing\x20information','Source\x20directory:\x20','MIN_LABEL_COUNT','MAX_LABEL_COUNT','workflow:pull','⚠\x20Showing\x20first\x20','projectId','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','skipValidation','Latest\x20session\x20has\x20no\x20attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Loading\x20workflows...','Select\x20a\x20session\x20to\x20view\x20timeline:','stat','✔\x20Secret\x20\x27','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Including\x20subtasks:\x20yes','Include\x20retried:\x20yes','Deleting\x20secret...','\x20\x20Source:\x20','verbose','resolveProjectDir','unknown','Listing\x20workflow\x20attempts...','\x20secret','Cloning\x20to\x20','tdx\x20wf\x20attempt\x20','isNewProject','✔\x20Project\x20updated','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','setSecrets','Loading\x20session...','existingProjectId','📋\x20','\x20unchanged','includeSubtasks','\x20is\x20not\x20a\x20directory','follow','some','Invalid\x20format:\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','212312qmhxbi','updatedAt','max','taskName','retryAttempt','🔄\x20','\x0a✔\x20Attempt\x20complete','Expected\x20format:\x20--param\x20key=value','Session\x20','projects','From\x20task:\x20','✔\x20Showing\x20','revision','88ejtaOf','\x20task','MAX_TIMELINE_WIDTH','Pulling\x20project\x20','type','workflow:secrets:set','output','\x20\x20New\x20attempt\x20ID:\x20','name','dim','Getting\x20attempt\x20details...','\x20\x20Console:\x20','modified','.\x20Expected\x20format:\x20KEY=VALUE','resumeFrom','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','size','66090kyuonI','Using\x20attempt\x20','logs','\x20\x20Session\x20ID:\x20','floor','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','group_error','deleted','requireProject','revision:\x20','Setting\x20','✔\x20Downloaded\x20','Error:\x20Attempt\x20ID\x20is\x20required','run','\x20secrets\x20set\x20for\x20project\x20\x27','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','download','unchanged','\x1b[1A\x1b[2K','-\x20no\x20files\x20written','Resolving\x20project\x20\x27','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x20\x20Session\x20context\x20set\x20to:\x20','11046123RHuLbC','execute','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Workflow:\x20','Deleting\x20project\x20','parse','filter','✔\x20Workflow\x20project\x20context\x20cleared.','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','workflowName','\x20workflow','createdAt','length','navigateSessionsInteractive','Show\x20tasks\x20for\x20an\x20attempt','startedAt','✔\x20Found\x20','Listing\x20workflows...','getFullYear','workflow:sessions','\x20to\x20see\x20detailed\x20logs','select','MAX_TASKS_DISPLAY','limit','from','Target:\x20','\x0a✔\x20Already\x20up\x20to\x20date','index','newProjectId','pollTimeline','padStart','format','Retrying\x20attempt...','\x20\x20Changes:\x20','workflow:retry','\x20of\x20','/sessions/','yes','Pull\x20workflow\x20project\x20to\x20local\x20folder','No\x20sessions\x20found','No\x20projects\x20match\x20pattern:\x20','sessions','planned','value','sessionTime','retrySession','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','error','Project:\x20','stringify','Killing\x20attempt...','all','getDate','\x0a⚠\x20Project\x20\x22','slice','getMonth','logFiles','red','531OwhroE','repeat','\x20modified','workflow:use','Files\x20to\x20upload:\x20','cwd','No\x20workflow\x20projects\x20found','newProjectName','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Files\x20extracted:\x20','Project\x20name:\x20','Failed\x20to\x20fetch\x20attempt\x20data','list','\x0aUpdate\x20existing\x20project\x20\x22','Attempt:\x20','table','fullName','\x20\x20Revision:\x20','attempt','sort','sessionId','white','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','executeCloneProject','title','param','lastAttempt','renderTimeline','clear','changes','blue','workflow:workflows','yellow','json','task','map','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Listing\x20secrets...','Attempt\x20ID:\x20','duration','push','split','workflow:kill','\x20from\x20session\x20','getTime','...','sourceProjectName','\x22\x20to\x20new\x20project\x20\x22','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','message','Downloading\x20project\x20','tasks','\x20project','Dry\x20run:\x20yes','Source\x20directory\x20is\x20required','Cancelled','workflows','workflow:secrets:list','Starting\x20workflow\x20run...','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','No\x20workflows\x20found','dryRun','Task\x20name:\x20','icon','Filter:\x20','/app/workflows/','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x0aPolling...\x20(','No\x20log\x20content\x20found','→\x20Project:\x20','isTTY','every','workflow','basename','MIN_TIMELINE_WIDTH','\x20\x20Location:\x20','find','generateSessionTimelineRows','\x20(system)','Key:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','fs/promises','(unknown)','startsWith','workflow:delete','getHours','Validation:\x20skipped','attemptId','targetDir','listSecrets','keys','MAX_POLL_ITERATIONS','\x0aDry\x20run\x20-\x20nothing\x20pushed','Listing\x20workflow\x20sessions...','workflow:upload','metadata','splice','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','toLowerCase','\x0aFailed\x20to\x20fetch\x20attempt\x20data','green','✔\x20Deleted\x20project\x20','Pattern:\x20','✔\x20Retry\x20started','join','path','Usage:\x20workflow:delete\x20<project-name-or-id>','applyPullProject','projectName','toISOString','description','TASK_NAME_WIDTH','Kill\x20a\x20running\x20attempt','workflowProject','fileCount','Parameters:\x20','fromTask','write','-\x20nothing\x20pushed','Show\x20specific\x20attempt\x20details','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','msPerChar','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20sessions\x20','No\x20workflows\x20found\x20in\x20project:\x20','No\x20sessions\x20found\x20for:\x20','\x20-\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','prepareCloneProject','substring','No\x20attempts\x20found\x20in\x20project:\x20','Workflow:\x20','List\x20workflow\x20attempts','filesExtracted','start','Select\x20a\x20task\x20to\x20view\x20logs:','relative','now','workflow:push','ICON_SPACING','\x27...','diff','GUTTER','attempt:','sys','Project\x20directory:\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Output\x20directory:\x20','Auto-selected\x20latest\x20session:\x20','Error:\x20Project\x20name\x20is\x20required','data','→\x20New\x20project:\x20','✔\x20Project:\x20','deleteSecret'];a52_0x2d2f=function(){return _0x251d6b;};return a52_0x2d2f();}function formatElapsed(_0x5439d6){const _0x2ed820=a52_0xa13f07,_0x2849d0=Math[_0x2ed820(0x21a)](_0x5439d6/0x3e8),_0x281726=Math[_0x2ed820(0x21a)](_0x2849d0/0x3c),_0x2c077a=Math[_0x2ed820(0x21a)](_0x281726/0x3c),_0x445392=Math['floor'](_0x2c077a/0x18);if(_0x445392>0x0){const _0x24d1a3=_0x2c077a%0x18;return _0x24d1a3>0x0?_0x445392+'d\x20'+_0x24d1a3+'h':_0x445392+'d';}else{if(_0x2c077a>0x0){const _0x5eb734=_0x281726%0x3c;return _0x5eb734>0x0?_0x2c077a+'h\x20'+_0x5eb734+'m':_0x2c077a+'h';}else{if(_0x281726>0x0){const _0x46ccf4=_0x2849d0%0x3c;return _0x46ccf4>0x0?_0x281726+'m\x20'+_0x46ccf4+'s':_0x281726+'m';}else return _0x2849d0+'s';}}}function formatTimestamp(_0x54944a,_0x79d75e){const _0x365598=a52_0xa13f07,_0x54372d=new Date(_0x54944a),_0x47bfaf=String(_0x54372d[_0x365598(0x109)]())[_0x365598(0x98)](0x2,'0'),_0x3a71dd=String(_0x54372d['getMinutes']())[_0x365598(0x98)](0x2,'0'),_0x95f7c1=_0x47bfaf+':'+_0x3a71dd,_0x3c96da=_0x54372d[_0x365598(0x8c)]()===_0x79d75e[_0x365598(0x8c)]()&&_0x54372d[_0x365598(0xb1)]()===_0x79d75e[_0x365598(0xb1)]()&&_0x54372d[_0x365598(0xae)]()===_0x79d75e['getDate']();if(_0x3c96da)return _0x95f7c1;else{const _0x4f3b9c=String(_0x54372d[_0x365598(0xb1)]()+0x1)[_0x365598(0x98)](0x2,'0'),_0x10773d=String(_0x54372d[_0x365598(0xae)]())['padStart'](0x2,'0');return _0x4f3b9c+'-'+_0x10773d+'\x20'+_0x95f7c1;}}function formatDate(_0x426c20){const _0x1886a9=a52_0xa13f07,_0x182b86=_0x426c20[_0x1886a9(0x8c)](),_0x7bf82d=String(_0x426c20['getMonth']()+0x1)[_0x1886a9(0x98)](0x2,'0'),_0x4af8ab=String(_0x426c20['getDate']())['padStart'](0x2,'0');return _0x182b86+'-'+_0x7bf82d+'-'+_0x4af8ab;}function getTaskStateIcon(_0x4259a7){const _0x32aed2={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x32aed2[_0x4259a7]||'⚪';}function getBarChar(_0x2d6259){const _0x5f7663=a52_0xa13f07;return _0x2d6259===_0x5f7663(0xa9)||_0x2d6259===_0x5f7663(0x21c)?'×':'─';}function getBarColor(_0xc6afab){const _0x5298e=a52_0xa13f07,_0x5c449a={'success':a52_0x89d45['green'],'error':a52_0x89d45[_0x5298e(0xb3)],'group_error':a52_0x89d45['red'],'running':a52_0x89d45[_0x5298e(0xd2)],'blocked':a52_0x89d45[_0x5298e(0xd4)],'planned':a52_0x89d45[_0x5298e(0x20e)],'canceling':a52_0x89d45[_0x5298e(0xd4)]};return _0x5c449a[_0xc6afab]||a52_0x89d45[_0x5298e(0xc9)];}function parseTaskName(_0x103ebe){const _0x53e5c7=a52_0xa13f07;let _0x35842b=_0x103ebe['replace'](/^\++/,'');const _0x40fbde=_0x35842b['split']('+'),_0x16f6b2=_0x40fbde[_0x53e5c7(0x86)]>0x1?_0x40fbde['length']-0x2:0x0,_0x51f1e8=_0x40fbde[_0x40fbde[_0x53e5c7(0x86)]-0x1]||_0x35842b;return{'level':_0x16f6b2,'name':'+'+_0x51f1e8};}function truncateTaskName(_0x3934fe,_0x3772e3){const _0x32d8f3=a52_0xa13f07,_0x54fa66=stringWidth(_0x3934fe);if(_0x54fa66<=_0x3772e3)return _0x3934fe;let _0x4ebe7a=_0x3934fe;while(stringWidth(_0x4ebe7a+'…')>_0x3772e3&&_0x4ebe7a[_0x32d8f3(0x86)]>0x0){_0x4ebe7a=_0x4ebe7a[_0x32d8f3(0xb0)](0x0,-0x1);}return _0x4ebe7a+'…';}function calculateTimeScale(_0x76f760,_0x5fc72b){const _0x162826=a52_0xa13f07;return{'startTime':_0x76f760[_0x162826(0x13a)],'endTime':_0x76f760[_0x162826(0x1a6)],'durationMs':_0x76f760[_0x162826(0xdb)],'msPerChar':_0x76f760['duration']/_0x5fc72b};}function timeToPosition(_0x4cba2a,_0x54bad0,_0x1b9ba0){const _0x2d319f=a52_0xa13f07,_0xfb6b18=_0x4cba2a-_0x54bad0[_0x2d319f(0x1a1)],_0x29ac2c=Math[_0x2d319f(0x21a)](_0xfb6b18/_0x54bad0[_0x2d319f(0x12d)]);return Math[_0x2d319f(0x1fa)](0x0,Math[_0x2d319f(0x190)](_0x29ac2c,_0x1b9ba0));}function renderTimeAxis(_0x101575,_0x3c2698){const _0x6256a8=a52_0xa13f07,_0x41e269=Math[_0x6256a8(0x190)](TIMELINE_CONFIG[_0x6256a8(0x1d2)],Math[_0x6256a8(0x1fa)](TIMELINE_CONFIG[_0x6256a8(0x1d1)],Math[_0x6256a8(0x21a)](_0x3c2698/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x1c5ae3=_0x101575[_0x6256a8(0x17d)]/(_0x41e269-0x1),_0x1dc094=new Date(_0x101575['startTime']),_0x4850ec=[];for(let _0x2b9b93=0x0;_0x2b9b93<_0x41e269;_0x2b9b93++){const _0x292343=_0x101575[_0x6256a8(0x1a1)]+_0x2b9b93*_0x1c5ae3,_0x57509c=timeToPosition(_0x292343,_0x101575,_0x3c2698),_0x5dfefc=formatTimestamp(_0x292343,_0x1dc094);_0x4850ec['push']({'pos':_0x57509c,'text':_0x5dfefc});}const _0x42d706=new Array(_0x3c2698)[_0x6256a8(0x16f)]('\x20');let _0x35da30=-0x1;for(const {pos:_0x1130f6,text:_0x2fcf5e}of _0x4850ec){let _0x42acec=Math[_0x6256a8(0x1fa)](0x0,_0x1130f6-Math[_0x6256a8(0x21a)](_0x2fcf5e['length']/0x2));_0x42acec<=_0x35da30+TIMELINE_CONFIG[_0x6256a8(0x169)]&&(_0x42acec=_0x35da30+TIMELINE_CONFIG[_0x6256a8(0x169)]+0x1);_0x42acec+_0x2fcf5e[_0x6256a8(0x86)]>_0x3c2698&&(_0x42acec=_0x3c2698-_0x2fcf5e[_0x6256a8(0x86)]);if(_0x42acec>=0x0&&_0x42acec+_0x2fcf5e[_0x6256a8(0x86)]<=_0x3c2698&&_0x42acec>_0x35da30){for(let _0x59e14b=0x0;_0x59e14b<_0x2fcf5e[_0x6256a8(0x86)];_0x59e14b++){_0x42d706[_0x42acec+_0x59e14b]=_0x2fcf5e[_0x59e14b];}_0x35da30=_0x42acec+_0x2fcf5e[_0x6256a8(0x86)]-0x1;}}return _0x42d706['join']('');}function renderTaskRow(_0x1d95a6,_0x464593,_0x2b68c5,_0x1eeff9){const _0x529ed7=a52_0xa13f07,{level:_0x16a465,name:_0x2f093c}=parseTaskName(_0x1d95a6[_0x529ed7(0x20d)]),_0xb3ab2='\x20'[_0x529ed7(0xb5)](_0x16a465),_0x2c83c4=_0x1d95a6['window']?'('+formatElapsed(_0x1d95a6[_0x529ed7(0x159)]['duration'])+')':'',_0x8fd18d=stringWidth(_0x2c83c4),_0x5ab7ed=_0x16a465*0x1,_0x53e3e2=_0x1eeff9-_0x5ab7ed-_0x8fd18d-0x1,_0x36d119=truncateTaskName(_0x2f093c,_0x53e3e2),_0xc9588d=_0xb3ab2+_0x36d119,_0x2e3041=stringWidth(_0xc9588d),_0x111a69=_0x1eeff9-_0x2e3041-_0x8fd18d,_0x44a610=_0xc9588d+'\x20'[_0x529ed7(0xb5)](Math[_0x529ed7(0x1fa)](0x1,_0x111a69))+a52_0x89d45[_0x529ed7(0x20e)](_0x2c83c4),_0x5ea4f9=getTaskStateIcon(_0x1d95a6[_0x529ed7(0x1c4)]),_0x8ed5be=new Array(_0x2b68c5)[_0x529ed7(0x16f)]('\x20');if(_0x1d95a6[_0x529ed7(0x159)]){const _0x2b59ce=timeToPosition(_0x1d95a6[_0x529ed7(0x159)][_0x529ed7(0x13a)],_0x464593,_0x2b68c5),_0x1f8d8d=timeToPosition(_0x1d95a6[_0x529ed7(0x159)]['end'],_0x464593,_0x2b68c5),_0x1b6f92=getBarChar(_0x1d95a6['state']),_0x298f3e=Math[_0x529ed7(0x1fa)](_0x2b59ce+0x1,_0x1f8d8d);for(let _0x4ac7a5=_0x2b59ce;_0x4ac7a5<Math[_0x529ed7(0x190)](_0x298f3e,_0x2b68c5);_0x4ac7a5++){_0x8ed5be[_0x4ac7a5]=_0x1b6f92;}}const _0x91d0b2=getBarColor(_0x1d95a6[_0x529ed7(0x1c4)]),_0x2c04dd=_0x8ed5be[_0x529ed7(0xd7)](_0x1f7150=>_0x1f7150==='\x20'?'\x20':_0x91d0b2(_0x1f7150))['join']('');return _0x5ea4f9+'\x20'+_0x44a610+'│'+_0x2c04dd+'│';}function calculateStats(_0x138090){const _0x57b0b9=a52_0xa13f07,_0x1b688c={'total':_0x138090[_0x57b0b9(0x86)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x58e571 of _0x138090){if(_0x58e571['state']===_0x57b0b9(0x1ba))_0x1b688c['success']++;else{if(_0x58e571[_0x57b0b9(0x1c4)]===_0x57b0b9(0xa9)||_0x58e571[_0x57b0b9(0x1c4)]==='group_error')_0x1b688c['error']++;else _0x58e571[_0x57b0b9(0x1c4)]==='running'?_0x1b688c[_0x57b0b9(0x1b8)]++:_0x1b688c[_0x57b0b9(0x1a4)]++;}}return _0x1b688c;}function formatStats(_0x1c4c54){const _0x440c29=a52_0xa13f07;return['Total:\x20'+_0x1c4c54['total'],'✅\x20'+_0x1c4c54[_0x440c29(0x1ba)],'❌\x20'+_0x1c4c54['error'],_0x440c29(0x1fd)+_0x1c4c54[_0x440c29(0x1b8)],'⏳\x20'+_0x1c4c54[_0x440c29(0x1a4)]][_0x440c29(0x11c)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a52_0xa13f07(0x20d)]=a52_0xa13f07(0x15e);[a52_0xa13f07(0x122)]=a52_0xa13f07(0x18d);async['execute'](_0x1f8f91){const _0xf4c989=a52_0xa13f07,{options:_0x3a17df,args:_0x13eb4d,tdx:_0x359c05}=_0x1f8f91;let _0x4c6d1e,_0x539f9f,_0x13d3c1=![];if(_0x13eb4d[0x0]){if(_0x13eb4d[0x0][_0xf4c989(0x1bd)]('.')){const _0x2af1ee=this['parseProjectWorkflowPattern'](_0x13eb4d,_0x3a17df);if(!_0x2af1ee)return 0x1;_0x4c6d1e=_0x2af1ee['projectName'],_0x539f9f=_0x2af1ee[_0xf4c989(0x83)];}else{_0x539f9f=_0x13eb4d[0x0],_0x4c6d1e=_0x3a17df[_0xf4c989(0x125)];if(!_0x4c6d1e)return console['error'](a52_0x89d45[_0xf4c989(0xb3)]('Error:'),_0xf4c989(0x191)),0x1;_0x13d3c1=!![];}}else{const _0x1e60b6=this[_0xf4c989(0x1ab)](_0x13eb4d,_0x3a17df);if(!_0x1e60b6)return 0x1;_0x4c6d1e=_0x1e60b6['projectName'],_0x539f9f=_0x1e60b6[_0xf4c989(0x83)];}if(_0x3a17df['verbose']){if(_0x4c6d1e&&_0x539f9f)console[_0xf4c989(0xa9)](_0xf4c989(0xf4)+_0x4c6d1e+'.'+_0x539f9f);else _0x4c6d1e&&console[_0xf4c989(0xa9)]('Filter:\x20project='+_0x4c6d1e);}const _0x304ce9=_0x3a17df[_0xf4c989(0x10b)],_0x3ad4ae=_0x3a17df[_0xf4c989(0xc8)];if(_0x304ce9){_0x3ad4ae&&console[_0xf4c989(0xa9)](a52_0x89d45[_0xf4c989(0xd4)](_0xf4c989(0x17f)),_0xf4c989(0x15d));const _0x488904=_0x3a17df[_0xf4c989(0x1f4)];return _0x488904?await this['pollTimeline'](_0x1f8f91,_0x304ce9):await this[_0xf4c989(0x1ce)](_0x1f8f91,_0x304ce9,_0x3a17df),0x0;}if(_0x3ad4ae){const _0x182d27=await withSpinner(_0xf4c989(0x1ee),()=>_0x359c05[_0xf4c989(0xfc)][_0xf4c989(0xa3)]({'projectName':_0x4c6d1e,'workflowName':_0x539f9f,'limit':0x64}),{'verbose':_0x3a17df[_0xf4c989(0x1e3)]}),_0x28d646=_0x182d27[_0xf4c989(0x14b)][_0xf4c989(0x100)](_0x1d47a6=>_0x1d47a6['id']===_0x3ad4ae);if(!_0x28d646)return console[_0xf4c989(0xa9)](a52_0x89d45[_0xf4c989(0xb3)]('Error:'),_0xf4c989(0x171)+_0x3ad4ae),0x1;if(!_0x28d646[_0xf4c989(0xce)]?.['id'])return console[_0xf4c989(0xa9)](a52_0x89d45['red'](_0xf4c989(0x1a0)),_0xf4c989(0x200)+_0x3ad4ae+'\x20has\x20no\x20attempts'),0x1;const _0x430093=_0x28d646[_0xf4c989(0xce)]['id'];_0x3a17df['verbose']&&console[_0xf4c989(0xa9)](_0xf4c989(0x217)+_0x430093+_0xf4c989(0xdf)+_0x3ad4ae);const _0x3deb68=_0x3a17df[_0xf4c989(0x1f4)];return _0x3deb68?await this[_0xf4c989(0x97)](_0x1f8f91,_0x430093):await this[_0xf4c989(0x1ce)](_0x1f8f91,_0x430093,_0x3a17df),0x0;}const _0x2e9a34=await withSpinner('Loading\x20sessions...',()=>_0x359c05[_0xf4c989(0xfc)][_0xf4c989(0xa3)]({'projectName':_0x4c6d1e,'workflowName':_0x539f9f,'limit':_0x3a17df[_0xf4c989(0x91)]||0x32}),{'verbose':_0x3a17df['verbose']}),_0x1d4897=_0x2e9a34[_0xf4c989(0x14b)];if(_0x1d4897[_0xf4c989(0x86)]===0x0){if(_0x4c6d1e&&_0x539f9f)console[_0xf4c989(0xa9)](_0xf4c989(0x131)+_0x4c6d1e+'.'+_0x539f9f);else _0x4c6d1e?console[_0xf4c989(0xa9)](_0xf4c989(0x189)+_0x4c6d1e):(console[_0xf4c989(0xa9)](_0xf4c989(0x1a2)),console[_0xf4c989(0xa9)](a52_0x89d45['dim'](_0xf4c989(0x214))));return 0x0;}_0x1d4897[_0xf4c989(0xc7)]((_0xdf7ca7,_0x19c185)=>{const _0x1581a9=_0xf4c989,_0x21810f=_0xdf7ca7[_0x1581a9(0xa6)]||'',_0x3f8185=_0x19c185['sessionTime']||'';return _0x3f8185[_0x1581a9(0x177)](_0x21810f);});if(_0x3a17df[_0xf4c989(0xd5)]||_0x3a17df[_0xf4c989(0x175)])return await handleSDKOutput(_0x1d4897,_0x3a17df),0x0;let _0x594757;if(_0x13d3c1){const _0x2813de=_0x1d4897[0x0];if(!_0x2813de[_0xf4c989(0xce)]?.['id'])return console[_0xf4c989(0xa9)](_0xf4c989(0x1d8)),0x0;_0x594757=_0x2813de['lastAttempt']['id'],_0x3a17df[_0xf4c989(0x1e3)]&&console[_0xf4c989(0xa9)](_0xf4c989(0x149)+_0x2813de[_0xf4c989(0xa6)]);}else{const _0x3fcabb=_0x1d4897[_0xf4c989(0xd7)](_0x346691=>{const _0x271d3a=_0xf4c989,_0x3b5a48=getAttemptStatusDisplay(_0x346691[_0x271d3a(0xce)]);return{'title':_0x346691[_0x271d3a(0x1af)]?.[_0x271d3a(0x20d)]+'.'+_0x346691['workflow']?.[_0x271d3a(0x20d)]+'\x20-\x20'+_0x346691[_0x271d3a(0xa6)]+'\x20'+_0x3b5a48[_0x271d3a(0xf3)],'value':_0x346691['lastAttempt']?.['id']||'','description':_0x3b5a48[_0x271d3a(0x173)]};}),_0x394b6f=await a52_0x4bedff({'type':_0xf4c989(0x8f),'name':_0xf4c989(0x10b),'message':_0xf4c989(0x1db),'choices':_0x3fcabb[_0xf4c989(0x80)](_0x39c6c2=>_0x39c6c2[_0xf4c989(0xa5)]!=='')});if(!_0x394b6f['attemptId'])return 0x0;_0x594757=_0x394b6f['attemptId'];}const _0x5d127a=_0x3a17df[_0xf4c989(0x1f4)];return _0x5d127a?await this['pollTimeline'](_0x1f8f91,_0x594757):await this['renderSingleTimeline'](_0x1f8f91,_0x594757,_0x3a17df),0x0;}async[a52_0xa13f07(0x1ce)](_0x582131,_0x51fe90,_0x52a062){const _0x539c68=a52_0xa13f07,{tdx:_0x56df05}=_0x582131;let _0x2a09c6,_0x4d8169;try{[_0x2a09c6,_0x4d8169]=await Promise[_0x539c68(0xad)]([_0x56df05['workflow']['attempt'](_0x51fe90),_0x56df05[_0x539c68(0xfc)][_0x539c68(0xe7)](_0x51fe90,![])]);}catch(_0x382108){console[_0x539c68(0xa9)](a52_0x89d45['red'](_0x539c68(0xbf)));_0x52a062[_0x539c68(0x1e3)]&&console[_0x539c68(0xa9)](_0x382108);throw _0x382108;}if(_0x52a062[_0x539c68(0xd5)]||_0x52a062[_0x539c68(0x175)]){const _0x1dfb5c=this[_0x539c68(0x1be)](_0x2a09c6,_0x4d8169);await handleSDKOutput([_0x1dfb5c],_0x52a062);return;}const _0x368e19=_0x56df05[_0x539c68(0x164)]['site'],_0x17cc76=this[_0x539c68(0xcf)](_0x2a09c6,_0x4d8169,_0x368e19);console[_0x539c68(0x1b2)](_0x17cc76);}async[a52_0xa13f07(0x97)](_0x528be9,_0x4cd34a){const _0x1ea866=a52_0xa13f07,{tdx:_0x597360}=_0x528be9,_0x2b012=TIMELINE_CONFIG[_0x1ea866(0x1b7)],_0x26a4e4=TIMELINE_CONFIG[_0x1ea866(0x10f)];let _0x20975e=0x0;while(_0x20975e<_0x26a4e4){process['stdout'][_0x1ea866(0xfa)]&&process[_0x1ea866(0x15c)][_0x1ea866(0x129)]('\x1bc');let _0x3d6282,_0x1e7db0;try{[_0x3d6282,_0x1e7db0]=await Promise['all']([_0x597360['workflow']['attempt'](_0x4cd34a),_0x597360['workflow'][_0x1ea866(0xe7)](_0x4cd34a,![])]);}catch(_0x545221){console[_0x1ea866(0xa9)](a52_0x89d45[_0x1ea866(0xb3)](_0x1ea866(0x117)));_0x20975e>0x0&&console[_0x1ea866(0xa9)](a52_0x89d45[_0x1ea866(0x20e)](_0x1ea866(0x1ca)+_0x20975e));throw _0x545221;}const _0x3a8bb1=_0x597360['context'][_0x1ea866(0x179)],_0x29b13a=this['renderTimeline'](_0x3d6282,_0x1e7db0,_0x3a8bb1);console[_0x1ea866(0x1b2)](_0x29b13a);const _0xe1c5f9=_0x3d6282['done']&&_0x1e7db0[_0x1ea866(0xfb)](_0x4f7f08=>_0x4f7f08[_0x1ea866(0x1c4)]!==_0x1ea866(0x1b8)&&_0x4f7f08[_0x1ea866(0x1c4)]!=='planned');if(_0xe1c5f9){console[_0x1ea866(0xa9)](a52_0x89d45[_0x1ea866(0x118)](_0x1ea866(0x1fe)));break;}console[_0x1ea866(0xa9)](a52_0x89d45[_0x1ea866(0x20e)](_0x1ea866(0xf7)+_0x20975e*0x2+_0x1ea866(0x133))),await new Promise(_0x232791=>setTimeout(_0x232791,_0x2b012)),_0x20975e++;}_0x20975e>=_0x26a4e4&&console[_0x1ea866(0xa9)](a52_0x89d45[_0x1ea866(0xd4)](_0x1ea866(0x1a3)));}[a52_0xa13f07(0xcf)](_0x2fa615,_0x4482bc,_0x1ef76a){const _0x41ce9e=a52_0xa13f07,_0x1ac4b2=[],_0x562995=TIMELINE_CONFIG[_0x41ce9e(0x123)],_0x5d2f4e=0x5,_0x13caef=process['stdout'][_0x41ce9e(0x1bb)]||0x78,_0x15d545=_0x13caef-_0x562995-_0x5d2f4e,_0x4084f0=Math['max'](TIMELINE_CONFIG[_0x41ce9e(0xfe)],Math[_0x41ce9e(0x190)](_0x15d545,TIMELINE_CONFIG[_0x41ce9e(0x207)])),_0x21c64a=new Date(_0x2fa615[_0x41ce9e(0x85)])[_0x41ce9e(0xe0)](),_0x3ef030=_0x2fa615[_0x41ce9e(0x18a)]?new Date(_0x2fa615[_0x41ce9e(0x18a)])['getTime']():Date[_0x41ce9e(0x13d)](),_0x2ab90d={'start':_0x21c64a,'end':_0x3ef030,'duration':_0x3ef030-_0x21c64a},_0x2d4b44=new Map(),_0xacb5c8=[];for(const _0x276caa of _0x4482bc){if(_0x276caa[_0x41ce9e(0x89)]){const _0x109cb3=new Date(_0x276caa[_0x41ce9e(0x89)])[_0x41ce9e(0xe0)](),_0x416ec6=_0x276caa['updatedAt']?new Date(_0x276caa[_0x41ce9e(0x1f9)])[_0x41ce9e(0xe0)]():Date[_0x41ce9e(0x13d)](),_0x127096={'start':_0x109cb3,'end':_0x416ec6,'duration':_0x416ec6-_0x109cb3};_0x2d4b44[_0x41ce9e(0x16d)](_0x276caa['id'],_0x127096),_0xacb5c8[_0x41ce9e(0xdc)]({'name':_0x276caa[_0x41ce9e(0xc4)],'state':_0x276caa[_0x41ce9e(0x1c4)]||_0x41ce9e(0x1e5),'window':_0x127096});}else _0xacb5c8[_0x41ce9e(0xdc)]({'name':_0x276caa[_0x41ce9e(0xc4)],'state':_0x276caa['state']||_0x41ce9e(0xa4),'window':undefined});}_0xacb5c8['sort']((_0x5e1b4e,_0x48688e)=>{const _0x5abea4=_0x41ce9e;if(!_0x5e1b4e[_0x5abea4(0x159)])return 0x1;if(!_0x48688e[_0x5abea4(0x159)])return-0x1;return _0x5e1b4e[_0x5abea4(0x159)][_0x5abea4(0x13a)]-_0x48688e['window'][_0x5abea4(0x13a)];});const _0x4e8192=_0xacb5c8[_0x41ce9e(0x86)],_0x44c205=_0x4e8192>TIMELINE_CONFIG[_0x41ce9e(0x90)];_0x44c205&&_0xacb5c8[_0x41ce9e(0x114)](TIMELINE_CONFIG[_0x41ce9e(0x90)]);const _0x2dc6bc=calculateTimeScale(_0x2ab90d,_0x4084f0),_0x4c5487=_0x2fa615[_0x41ce9e(0x178)]?_0x2fa615[_0x41ce9e(0x1ba)]?a52_0x89d45[_0x41ce9e(0x118)](_0x41ce9e(0x1ba)):a52_0x89d45[_0x41ce9e(0xb3)](_0x41ce9e(0xa9)):a52_0x89d45['blue'](_0x41ce9e(0x1b8)),_0x2ce9a9=_0x2fa615['project']?.['id'],_0x5cab6b=_0x2fa615[_0x41ce9e(0xc8)];let _0x906885;if(_0x2ce9a9&&_0x5cab6b){const _0x4dd600=getWorkflowAttemptUrl(_0x1ef76a,_0x2ce9a9,_0x5cab6b,_0x2fa615['id']);_0x906885=hyperlink(a52_0x89d45[_0x41ce9e(0x20e)](_0x2fa615['id']),_0x4dd600);}else _0x906885=a52_0x89d45[_0x41ce9e(0x20e)](_0x2fa615['id']);_0x1ac4b2[_0x41ce9e(0xdc)](_0x41ce9e(0xc2)+_0x906885+_0x41ce9e(0x132)+_0x4c5487+_0x41ce9e(0x132)+formatElapsed(_0x2ab90d[_0x41ce9e(0xdb)]));if(_0xacb5c8[_0x41ce9e(0x86)]>0x0){const _0xf9a236=renderTimeAxis(_0x2dc6bc,_0x4084f0),_0x4e5aa3=new Date(_0x2ab90d['start']),_0x4c5a5a=formatDate(_0x4e5aa3),_0x4874f4=TIMELINE_CONFIG[_0x41ce9e(0x1c1)]+TIMELINE_CONFIG['ICON_SPACING']+_0x562995,_0x450c4e=_0x4c5a5a[_0x41ce9e(0x98)](_0x4874f4),_0x4f3eef=a52_0x89d45[_0x41ce9e(0x20e)](_0x450c4e);_0x1ac4b2[_0x41ce9e(0xdc)](_0x4f3eef+'\x20'+_0xf9a236);for(const _0x9e70c0 of _0xacb5c8){_0x1ac4b2[_0x41ce9e(0xdc)](renderTaskRow(_0x9e70c0,_0x2dc6bc,_0x4084f0,_0x562995));}const _0x52cf61=calculateStats(_0xacb5c8);_0x1ac4b2[_0x41ce9e(0xdc)](formatStats(_0x52cf61)),_0x44c205&&_0x1ac4b2[_0x41ce9e(0xdc)](a52_0x89d45['yellow'](_0x41ce9e(0x1d4)+TIMELINE_CONFIG[_0x41ce9e(0x90)]+_0x41ce9e(0x9d)+_0x4e8192+'\x20tasks')),_0x1ac4b2[_0x41ce9e(0xdc)](''),_0x1ac4b2[_0x41ce9e(0xdc)](a52_0x89d45['dim'](_0x41ce9e(0x1b4))+(_0x41ce9e(0x1e9)+_0x2fa615['id']+_0x41ce9e(0x163))+a52_0x89d45[_0x41ce9e(0x20e)](_0x41ce9e(0x8e)));}else _0x1ac4b2[_0x41ce9e(0xdc)](_0x41ce9e(0xa8));return _0x1ac4b2[_0x41ce9e(0x11c)]('\x0a');}[a52_0xa13f07(0x1be)](_0x298370,_0x169517){const _0x2e369f=a52_0xa13f07,_0x28a5a9=new Date(_0x298370[_0x2e369f(0x85)])[_0x2e369f(0xe0)](),_0x3b39d6=_0x298370[_0x2e369f(0x18a)]?new Date(_0x298370[_0x2e369f(0x18a)])[_0x2e369f(0xe0)]():Date[_0x2e369f(0x13d)](),_0x5f012b=_0x3b39d6-_0x28a5a9,_0x10a908=[];for(const _0xf1dce0 of _0x169517){if(_0xf1dce0[_0x2e369f(0x89)]){const _0x58fad1=new Date(_0xf1dce0[_0x2e369f(0x89)])[_0x2e369f(0xe0)](),_0x4def82=_0xf1dce0['updatedAt']?new Date(_0xf1dce0[_0x2e369f(0x1f9)])[_0x2e369f(0xe0)]():Date[_0x2e369f(0x13d)]();_0x10a908[_0x2e369f(0xdc)]({'name':_0xf1dce0[_0x2e369f(0xc4)],'state':_0xf1dce0[_0x2e369f(0x1c4)]||'unknown','window':{'start':_0x58fad1,'end':_0x4def82,'duration':_0x4def82-_0x58fad1}});}else _0x10a908[_0x2e369f(0xdc)]({'name':_0xf1dce0[_0x2e369f(0xc4)],'state':_0xf1dce0[_0x2e369f(0x1c4)]||'planned','window':undefined});}const _0x523fc2=calculateStats(_0x10a908);return{'attempt':{'id':_0x298370['id'],'status':_0x298370['done']?_0x298370['success']?_0x2e369f(0x1ba):_0x2e369f(0xa9):_0x2e369f(0x1b8),'createdAt':_0x298370[_0x2e369f(0x85)],'finishedAt':_0x298370[_0x2e369f(0x18a)],'duration_ms':_0x5f012b},'tasks':_0x10a908[_0x2e369f(0xd7)](_0x5b6388=>({'name':_0x5b6388[_0x2e369f(0x20d)],'state':_0x5b6388[_0x2e369f(0x1c4)],'startedAt':_0x5b6388['window']?new Date(_0x5b6388[_0x2e369f(0x159)]['start'])['toISOString']():null,'updatedAt':_0x5b6388[_0x2e369f(0x159)]?new Date(_0x5b6388[_0x2e369f(0x159)]['end'])[_0x2e369f(0x121)]():null,'duration_ms':_0x5b6388[_0x2e369f(0x159)]?.[_0x2e369f(0xdb)]||null})),'stats':_0x523fc2};}}
1
+ const a52_0x1a0e08=a52_0x2d22;(function(_0x156ab0,_0x4b87e5){const _0x383c7e=a52_0x2d22,_0x761fa=_0x156ab0();while(!![]){try{const _0x2b2831=-parseInt(_0x383c7e(0x2c4))/0x1*(-parseInt(_0x383c7e(0x29c))/0x2)+parseInt(_0x383c7e(0x296))/0x3+parseInt(_0x383c7e(0x32b))/0x4+-parseInt(_0x383c7e(0x356))/0x5+-parseInt(_0x383c7e(0x316))/0x6*(parseInt(_0x383c7e(0x2ef))/0x7)+parseInt(_0x383c7e(0x344))/0x8*(-parseInt(_0x383c7e(0x34e))/0x9)+parseInt(_0x383c7e(0x2b9))/0xa;if(_0x2b2831===_0x4b87e5)break;else _0x761fa['push'](_0x761fa['shift']());}catch(_0x2261fd){_0x761fa['push'](_0x761fa['shift']());}}}(a52_0x2bd1,0xa29da));function a52_0x2d22(_0x1653bd,_0x3712c7){_0x1653bd=_0x1653bd-0x1bc;const _0x2bd127=a52_0x2bd1();let _0x2d2207=_0x2bd127[_0x1653bd];return _0x2d2207;}import a52_0x3e3b2b from'chalk';import{existsSync}from'fs';import a52_0x47f7f2 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a52_0xfc59b7 from'prompts';function getAttemptStatusDisplay(_0x1f6e05){const _0x22a638=a52_0x2d22;if(!_0x1f6e05)return{'icon':'⏳','text':''};const {done:_0x507167,success:_0x507a56,cancelRequested:_0xc3c0ee}=_0x1f6e05;if(!_0x507167)return _0xc3c0ee?{'icon':'🛑','text':a52_0x3e3b2b[_0x22a638(0x310)](_0x22a638(0x262))}:{'icon':'🔄','text':a52_0x3e3b2b[_0x22a638(0x333)](_0x22a638(0x205))};if(_0x507a56)return{'icon':'✅','text':a52_0x3e3b2b['green']('success')};return{'icon':'❌','text':a52_0x3e3b2b[_0x22a638(0x2e4)]('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x2a383b,_0x1c6e31,_0x2f22d6=0x0){const _0x94be0=a52_0x2d22;return _0x2a383b[_0x2f22d6]||_0x1c6e31[_0x94be0(0x1e8)];}['requireProject'](_0x1d3158,_0x303014,_0x5acf02=0x0){const _0x17b163=a52_0x2d22,_0x4d7b5f=this[_0x17b163(0x300)](_0x1d3158,_0x303014,_0x5acf02);if(!_0x4d7b5f)return console['error'](a52_0x3e3b2b[_0x17b163(0x2e4)](_0x17b163(0x227)),_0x17b163(0x2b2)),console['error'](a52_0x3e3b2b[_0x17b163(0x204)](_0x17b163(0x240))),null;return _0x4d7b5f;}[a52_0x1a0e08(0x1f9)](_0x420ba1,_0x138485){const _0x56bba8=a52_0x1a0e08;if(_0x420ba1[0x0]){const _0xfa6ce2=_0x420ba1[0x0]['split']('.');if(_0xfa6ce2[_0x56bba8(0x2ab)]===0x1)return{'projectName':_0xfa6ce2[0x0],'workflowName':undefined};else return _0xfa6ce2[_0x56bba8(0x2ab)]===0x2?{'projectName':_0xfa6ce2[0x0],'workflowName':_0xfa6ce2[0x1]}:(console[_0x56bba8(0x30d)](a52_0x3e3b2b[_0x56bba8(0x2e4)](_0x56bba8(0x227)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x138485[_0x56bba8(0x1e8)],'workflowName':undefined};}[a52_0x1a0e08(0x1fb)](_0x1eb41e,_0x221e5e,_0x179480=0x0){const _0x42a677=a52_0x1a0e08;if(_0x1eb41e[_0x179480])return _0x1eb41e[_0x179480];if(_0x221e5e['workflowProject']){const _0x358ee8=a52_0x47f7f2['join'](process[_0x42a677(0x340)](),_0x42a677(0x261),_0x221e5e['workflowProject']);if(existsSync(a52_0x47f7f2[_0x42a677(0x25a)](_0x358ee8,'tdx.json')))return _0x358ee8;}return undefined;}async[a52_0x1a0e08(0x25c)](_0x5b0b3d,_0x3b539a,_0x1e9ebe){const _0x562757=a52_0x1a0e08;try{const _0xd8aa98=await _0x5b0b3d[_0x562757(0x246)][_0x562757(0x261)](_0x3b539a,{'limit':0x1});if(_0xd8aa98[_0x562757(0x2ab)]>0x0){const _0x96d964=_0xd8aa98[0x0]['id'],_0xa6f2e6=getWorkflowUrl(_0x1e9ebe,_0x96d964);console['error'](_0x562757(0x326)+a52_0x3e3b2b[_0x562757(0x1fa)](_0xa6f2e6));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x5021dd){const _0x3ee80e=a52_0x1a0e08,{options:_0x548d8a,args:_0x4778b9,tdx:_0xb180c9}=_0x5021dd,_0x1ddaa1=_0x4778b9[0x0],_0x3e2ccc=_0x548d8a['clear'];if(_0x3e2ccc)return saveSessionContext({'workflow_project':undefined},_0x548d8a[_0x3ee80e(0x2f9)]),console[_0x3ee80e(0x30c)](a52_0x3e3b2b['green'](_0x3ee80e(0x27b))),0x0;if(!_0x1ddaa1)return console[_0x3ee80e(0x30d)](a52_0x3e3b2b[_0x3ee80e(0x2e4)](_0x3ee80e(0x227)),'Project\x20name\x20is\x20required'),console['error'](a52_0x3e3b2b[_0x3ee80e(0x204)](_0x3ee80e(0x24d))),console[_0x3ee80e(0x30d)](a52_0x3e3b2b[_0x3ee80e(0x204)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5da304=await withSpinner('Resolving\x20project\x20\x27'+_0x1ddaa1+'\x27...',()=>_0xb180c9['workflow']['resolveProjectId'](_0x1ddaa1),{'verbose':_0x548d8a['verbose']}),{name:_0x391c29}=_0x5da304['data'];return saveSessionContext({'workflow_project':_0x391c29},_0x548d8a[_0x3ee80e(0x2f9)]),console[_0x3ee80e(0x30c)](a52_0x3e3b2b[_0x3ee80e(0x1c1)](_0x3ee80e(0x2fe)+a52_0x3e3b2b[_0x3ee80e(0x1fa)](_0x391c29))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x2f3);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x35a);async[a52_0x1a0e08(0x2fc)](_0x422bf6){const _0x3708e6=a52_0x1a0e08,{options:_0xc3cc24,args:_0x4f2850,tdx:_0x590375}=_0x422bf6,_0x378eaf=_0x4f2850[0x0];_0xc3cc24['verbose']&&_0x378eaf&&console['error']('Pattern:\x20'+_0x378eaf);const _0x441af4=await withSpinner(_0x3708e6(0x1ee),()=>_0x590375['workflow'][_0x3708e6(0x2cf)](_0x378eaf,{'limit':_0xc3cc24[_0x3708e6(0x2a4)]}),{'verbose':_0xc3cc24['verbose']});let _0x104746=_0x441af4[_0x3708e6(0x224)];_0x104746['sort']((_0x2e751e,_0x26c37b)=>_0x2e751e[_0x3708e6(0x1cf)][_0x3708e6(0x31d)](_0x26c37b[_0x3708e6(0x1cf)]));const _0x4bc0c5=_0xc3cc24['limit']||0x64,_0x199aaa=_0x104746[_0x3708e6(0x2ab)]>=_0x4bc0c5?a52_0x3e3b2b[_0x3708e6(0x204)](_0x3708e6(0x1c5)):'';console[_0x3708e6(0x30d)](_0x3708e6(0x27f)+_0x104746[_0x3708e6(0x2ab)]+'\x20project'+(_0x104746['length']!==0x1?'s':'')+_0x199aaa);if(_0xc3cc24[_0x3708e6(0x2d8)]===_0x3708e6(0x309)||_0xc3cc24['format']==='jsonl'||_0xc3cc24['format']===_0x3708e6(0x33c))await handleSDKOutput(_0x104746,_0xc3cc24);else{if(_0x104746[_0x3708e6(0x2ab)]===0x0)_0x378eaf?console[_0x3708e6(0x30c)](_0x3708e6(0x252)+_0x378eaf):console[_0x3708e6(0x30c)](_0x3708e6(0x1d4));else{const _0x5e7880=_0x104746[_0x3708e6(0x2e0)](_0x443344=>{const _0x100a0b=_0x3708e6,_0x424101=_0x443344['metadata']?.[_0x100a0b(0x290)](_0x9aedc6=>_0x9aedc6['key']===_0x100a0b(0x28e)),_0x418d69=_0x424101?a52_0x3e3b2b['dim'](_0x100a0b(0x247)):'';return _0x100a0b(0x2ac)+_0x443344[_0x100a0b(0x1cf)]+_0x418d69;});await writeOutput(_0x5e7880[_0x3708e6(0x25a)]('\x0a'),_0xc3cc24[_0x3708e6(0x2bb)],_0x3708e6(0x26c));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x222);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x1f6);async[a52_0x1a0e08(0x2fc)](_0x380e5c){const _0x2d9228=a52_0x1a0e08,{options:_0x35b42d,args:_0x3ace05,tdx:_0x1f60a5}=_0x380e5c,_0x5e3ad6=this['resolveProject'](_0x3ace05,_0x35b42d);_0x35b42d[_0x2d9228(0x258)]&&_0x5e3ad6&&console[_0x2d9228(0x30d)]('Project\x20filter:\x20'+_0x5e3ad6);const _0x342b7a=await withSpinner(_0x2d9228(0x2d0),()=>_0x1f60a5[_0x2d9228(0x246)][_0x2d9228(0x261)](_0x5e3ad6,{'limit':_0x35b42d['limit']}),{'verbose':_0x35b42d[_0x2d9228(0x258)]});let _0x33a955=_0x342b7a[_0x2d9228(0x224)];_0x33a955[_0x2d9228(0x1e6)]((_0x22c48c,_0x3fa57a)=>{const _0x3bc4ca=_0x2d9228,_0x50dab2=_0x22c48c[_0x3bc4ca(0x1cf)][_0x3bc4ca(0x31d)](_0x3fa57a[_0x3bc4ca(0x1cf)]);if(_0x50dab2!==0x0)return _0x50dab2;return(_0x22c48c[_0x3bc4ca(0x2ca)]?.[_0x3bc4ca(0x1cf)]||'')[_0x3bc4ca(0x31d)](_0x3fa57a[_0x3bc4ca(0x2ca)]?.[_0x3bc4ca(0x1cf)]||'');});const _0x17ddd4=_0x35b42d[_0x2d9228(0x2a4)]||0x64,_0x5b93f2=_0x33a955[_0x2d9228(0x2ab)]>=_0x17ddd4?a52_0x3e3b2b['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x2d9228(0x30d)](_0x2d9228(0x27f)+_0x33a955[_0x2d9228(0x2ab)]+'\x20workflow'+(_0x33a955[_0x2d9228(0x2ab)]!==0x1?'s':'')+_0x5b93f2);if(_0x35b42d[_0x2d9228(0x2d8)]===_0x2d9228(0x309)||_0x35b42d['format']===_0x2d9228(0x232)||_0x35b42d[_0x2d9228(0x2d8)]===_0x2d9228(0x33c))await handleSDKOutput(_0x33a955,_0x35b42d);else{if(_0x33a955[_0x2d9228(0x2ab)]===0x0)_0x5e3ad6?console[_0x2d9228(0x30c)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x5e3ad6):console[_0x2d9228(0x30c)](_0x2d9228(0x1d6));else{const _0x569501=_0x35b42d['site'],_0x193eb1=_0x33a955[_0x2d9228(0x2e0)](_0x467153=>{const _0x10c622=_0x2d9228,_0x14a2fd=a52_0x3e3b2b['dim']('#'+_0x467153['id']),_0x319e31=hyperlink(_0x14a2fd,getWorkflowUrl(_0x569501,_0x467153['id'])),_0x4831be=_0x467153[_0x10c622(0x2ca)]?.[_0x10c622(0x1cf)]?a52_0x3e3b2b[_0x10c622(0x204)]('\x20('+_0x467153[_0x10c622(0x2ca)]['name']+')'):'';return _0x10c622(0x21b)+_0x319e31+'\x20'+_0x467153[_0x10c622(0x1cf)]+_0x4831be;});await writeOutput(_0x193eb1[_0x2d9228(0x25a)]('\x0a'),_0x35b42d[_0x2d9228(0x2bb)],_0x2d9228(0x26c));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x28a);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x353);async[a52_0x1a0e08(0x2fc)](_0x6931af){const _0x5e1597=a52_0x1a0e08,{options:_0x2f8c74,args:_0x5a83b5,tdx:_0x4a5998}=_0x6931af,_0x22820f=this['parseProjectWorkflowPattern'](_0x5a83b5,_0x2f8c74);if(!_0x22820f)return 0x1;const {projectName:_0x392ced,workflowName:_0x157e6b}=_0x22820f;if(_0x2f8c74['verbose']){if(_0x392ced&&_0x157e6b)console[_0x5e1597(0x30d)]('Filter:\x20'+_0x392ced+'.'+_0x157e6b);else _0x392ced&&console[_0x5e1597(0x30d)](_0x5e1597(0x260)+_0x392ced);const _0x388ed6=_0x2f8c74['status'];_0x388ed6&&console[_0x5e1597(0x30d)](_0x5e1597(0x22f)+_0x388ed6);}let _0xf8a674=0x28;if(process['stdout'][_0x5e1597(0x2ee)]&&!_0x2f8c74[_0x5e1597(0x2bb)]&&!_0x2f8c74[_0x5e1597(0x2d8)]){const _0x2e59b8=process[_0x5e1597(0x345)]['rows']||0x28;_0xf8a674=Math[_0x5e1597(0x334)](0x14,Math['floor'](_0x2e59b8*0x2/0x3));}const _0x4ae206=_0x2f8c74['limit']||_0xf8a674,_0xd10b4e=await withSpinner(_0x5e1597(0x22d),()=>_0x4a5998[_0x5e1597(0x246)][_0x5e1597(0x301)]({'projectName':_0x392ced,'workflowName':_0x157e6b,'status':_0x2f8c74[_0x5e1597(0x1f1)],'fromTime':_0x2f8c74[_0x5e1597(0x342)],'toTime':_0x2f8c74['to'],'limit':_0x4ae206}),{'verbose':_0x2f8c74[_0x5e1597(0x258)]}),_0x2fe8e9=_0xd10b4e[_0x5e1597(0x224)];_0x2fe8e9[_0x5e1597(0x1e6)]((_0x5dc940,_0x2d78ee)=>{const _0x3a3775=_0x5e1597,_0x52f4d=_0x5dc940[_0x3a3775(0x292)]||'',_0x2189d1=_0x2d78ee[_0x3a3775(0x292)]||'';return _0x2189d1[_0x3a3775(0x31d)](_0x52f4d);});_0x2fe8e9[_0x5e1597(0x2ab)]>=_0x4ae206?console[_0x5e1597(0x30d)]('✔\x20Showing\x20'+_0x2fe8e9[_0x5e1597(0x2ab)]+_0x5e1597(0x2cc)+a52_0x3e3b2b['dim'](_0x5e1597(0x211))):console[_0x5e1597(0x30d)]('✔\x20Found\x20'+_0x2fe8e9[_0x5e1597(0x2ab)]+_0x5e1597(0x2f6)+(_0x2fe8e9[_0x5e1597(0x2ab)]!==0x1?'s':''));if(_0x2f8c74[_0x5e1597(0x2d8)]===_0x5e1597(0x309)||_0x2f8c74[_0x5e1597(0x2d8)]===_0x5e1597(0x232)||_0x2f8c74[_0x5e1597(0x2d8)]===_0x5e1597(0x33c))await handleSDKOutput(_0x2fe8e9,_0x2f8c74);else{if(!process[_0x5e1597(0x345)][_0x5e1597(0x2ee)]||_0x2f8c74[_0x5e1597(0x2bb)]){if(_0x2fe8e9[_0x5e1597(0x2ab)]===0x0){if(_0x392ced&&_0x157e6b)console[_0x5e1597(0x30c)]('No\x20sessions\x20found\x20for:\x20'+_0x392ced+'.'+_0x157e6b);else _0x392ced?console['log'](_0x5e1597(0x2c2)+_0x392ced):console[_0x5e1597(0x30c)]('No\x20sessions\x20found');}else{const _0x1dd1b5=_0x2f8c74['site'],_0x14838d=this[_0x5e1597(0x239)](_0x2fe8e9,_0x1dd1b5);_0x2f8c74[_0x5e1597(0x2bb)]?await writeOutput(_0x14838d,_0x2f8c74[_0x5e1597(0x2bb)],_0x5e1597(0x26c)):console['log'](_0x14838d);}!_0x392ced&&(console[_0x5e1597(0x30d)](''),console[_0x5e1597(0x30d)](a52_0x3e3b2b['dim'](_0x5e1597(0x1e5))),console[_0x5e1597(0x30d)](a52_0x3e3b2b['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a52_0x3e3b2b[_0x5e1597(0x204)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x2fe8e9[_0x5e1597(0x2ab)]===0x0){if(_0x392ced&&_0x157e6b)console[_0x5e1597(0x30c)]('No\x20sessions\x20found\x20for:\x20'+_0x392ced+'.'+_0x157e6b);else _0x392ced?console[_0x5e1597(0x30c)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x392ced):console['log'](_0x5e1597(0x212));}else await this[_0x5e1597(0x249)](_0x2fe8e9,_0x6931af,_0x392ced);}}return 0x0;}['renderSessionsTimeline'](_0x290c74,_0x1fa99d){const _0x1c4a15=a52_0x1a0e08,_0x4dc1e8=[],_0x210112=new Map();let _0x1b2641=Infinity,_0x2656fa=-Infinity;for(const _0x35559d of _0x290c74){if(_0x35559d[_0x1c4a15(0x294)]?.[_0x1c4a15(0x273)]){const _0x49cfd7=new Date(_0x35559d[_0x1c4a15(0x294)][_0x1c4a15(0x273)])[_0x1c4a15(0x348)](),_0x44fa70=_0x35559d[_0x1c4a15(0x294)][_0x1c4a15(0x26a)]?new Date(_0x35559d[_0x1c4a15(0x294)]['finishedAt'])['getTime']():Date[_0x1c4a15(0x248)](),_0x1af21a=_0x35559d['project']?.[_0x1c4a15(0x1cf)]||_0x1c4a15(0x2c3);!_0x210112[_0x1c4a15(0x2f1)](_0x1af21a)&&_0x210112[_0x1c4a15(0x33b)](_0x1af21a,[]),_0x210112[_0x1c4a15(0x293)](_0x1af21a)['push']({'session':_0x35559d,'startTime':_0x49cfd7,'endTime':_0x44fa70,'duration':_0x44fa70-_0x49cfd7}),_0x1b2641=Math['min'](_0x1b2641,_0x49cfd7),_0x2656fa=Math[_0x1c4a15(0x334)](_0x2656fa,_0x44fa70);}}if(_0x210112[_0x1c4a15(0x221)]===0x0)return _0x1c4a15(0x200);const _0x482587=process[_0x1c4a15(0x345)][_0x1c4a15(0x2bc)]||0x78,_0x524a60=0x1e,_0x271ac9=0x32,_0x55fad3=0x4,_0xaca0c3=Math[_0x1c4a15(0x2ea)](_0x271ac9,Math[_0x1c4a15(0x334)](_0x524a60,Math[_0x1c4a15(0x26f)](_0x482587*0.3))),_0x22729e=_0x482587-_0xaca0c3-TIMELINE_CONFIG[_0x1c4a15(0x339)]-0x3-_0x55fad3,_0x5f565e=_0x2656fa-_0x1b2641,_0x57a5ab=_0x5f565e/_0xaca0c3,_0x18f22d=renderTimeAxis({'startTime':_0x1b2641,'endTime':_0x2656fa,'durationMs':_0x5f565e,'msPerChar':_0x57a5ab},_0xaca0c3),_0x2b9764=[];for(const _0x4bf859 of _0x210112['values']()){_0x2b9764[_0x1c4a15(0x281)](..._0x4bf859);}_0x2b9764[_0x1c4a15(0x1e6)]((_0x3a27fd,_0x453bd6)=>_0x453bd6[_0x1c4a15(0x23a)]-_0x3a27fd[_0x1c4a15(0x23a)]);const _0x5ae4dd=new Date(_0x1b2641),_0x272db7=formatDate(_0x5ae4dd),_0x4e146c=_0x55fad3+TIMELINE_CONFIG[_0x1c4a15(0x2d4)]+TIMELINE_CONFIG['ICON_SPACING']+_0x22729e,_0x3e8a08='\x20'['repeat'](_0x4e146c-_0x272db7[_0x1c4a15(0x2ab)]),_0x24786e=_0x3e8a08+a52_0x3e3b2b[_0x1c4a15(0x204)](_0x272db7)+'\x20'+_0x18f22d;_0x4dc1e8[_0x1c4a15(0x281)](_0x24786e);const _0x11f190=0x16;let _0x1efe96=0x0;for(const _0x3c894e of _0x2b9764){const _0x4c2966=_0x3c894e[_0x1c4a15(0x2f9)]['project']?.[_0x1c4a15(0x1cf)]||'?',_0x5a490b=Math[_0x1c4a15(0x2ea)](stringWidth(_0x4c2966),_0x11f190);_0x1efe96=Math[_0x1c4a15(0x334)](_0x1efe96,_0x5a490b);}for(const _0x385489 of _0x2b9764){const {session:_0x295cc4,startTime:_0x32d22a,endTime:_0xff21b3,duration:_0xf3b6de}=_0x385489,_0x1d8dbc=_0x295cc4[_0x1c4a15(0x2ca)]?.['id'],_0x37b25e=_0x295cc4['id'],_0x35b768=_0x295cc4[_0x1c4a15(0x2ca)]?.['name']||'?',_0x402a5f=_0x295cc4['workflow']?.[_0x1c4a15(0x1cf)]||'?';let _0x49473e,_0xdcada6;if(_0x295cc4[_0x1c4a15(0x294)]){const _0x3a59be=_0x295cc4[_0x1c4a15(0x294)];!_0x3a59be['done']?(_0x49473e=_0x3a59be[_0x1c4a15(0x1ec)]?'🛑':'🔄',_0xdcada6=_0x3a59be[_0x1c4a15(0x1ec)]?a52_0x3e3b2b[_0x1c4a15(0x310)]:a52_0x3e3b2b['blue']):(_0x49473e=_0x3a59be[_0x1c4a15(0x305)]?'✅':'❌',_0xdcada6=_0x3a59be[_0x1c4a15(0x305)]?a52_0x3e3b2b[_0x1c4a15(0x1c1)]:a52_0x3e3b2b['red']);}else _0x49473e='⏳',_0xdcada6=a52_0x3e3b2b[_0x1c4a15(0x204)];const _0x316ce0='#'+_0x37b25e,_0x1c95f0=_0x1d8dbc?hyperlink(_0x316ce0,getWorkflowSessionUrl(_0x1fa99d,_0x1d8dbc,_0x37b25e)):_0x316ce0;let _0x1ae5e0=_0x35b768;stringWidth(_0x35b768)>_0x11f190&&(_0x1ae5e0=_0x35b768[_0x1c4a15(0x34f)](0x0,_0x11f190-0x1)+'…');const _0x31b4f7=a52_0x3e3b2b[_0x1c4a15(0x204)](_0x1ae5e0),_0x1cb4a6=stringWidth(_0x1ae5e0),_0x69c5a1='\x20'[_0x1c4a15(0x2bf)](_0x1efe96-stringWidth(_0x1ae5e0)+0x2),_0x2c66a7='('+formatElapsed(_0xf3b6de)+')',_0x526b84=stringWidth(_0x2c66a7),_0x1d96fe=stringWidth(_0x316ce0),_0x3af497=_0x1d96fe+0x1+_0x1cb4a6+_0x69c5a1[_0x1c4a15(0x2ab)],_0x3ae221=_0x22729e-_0x3af497-_0x526b84-0x1-0x8;let _0x1c202f=_0x402a5f;stringWidth(_0x1c202f)>_0x3ae221&&(_0x1c202f=_0x1c202f['slice'](0x0,_0x3ae221-0x1)+'…');const _0x3ba0d1=_0x1c95f0+'\x20'+_0x31b4f7+_0x69c5a1+_0x1c202f,_0x54b3b6=stringWidth(_0x3ba0d1),_0x29a932=_0x22729e-_0x54b3b6-_0x526b84,_0x4ddc2f=_0x3ba0d1+'\x20'[_0x1c4a15(0x2bf)](Math['max'](0x1,_0x29a932))+a52_0x3e3b2b[_0x1c4a15(0x204)](_0x2c66a7),_0x4dc564=Math[_0x1c4a15(0x26f)]((_0x32d22a-_0x1b2641)/_0x57a5ab),_0x4e3275=Math[_0x1c4a15(0x26f)]((_0xff21b3-_0x1b2641)/_0x57a5ab),_0x371f2b=Math[_0x1c4a15(0x334)](_0x4dc564+0x1,_0x4e3275),_0x3d36e7=new Array(_0xaca0c3)[_0x1c4a15(0x2a5)]('\x20');for(let _0x9690b2=_0x4dc564;_0x9690b2<Math[_0x1c4a15(0x2ea)](_0x371f2b,_0xaca0c3);_0x9690b2++){_0x3d36e7[_0x9690b2]='─';}const _0x5b3d85=_0x3d36e7[_0x1c4a15(0x2e0)](_0x31672a=>_0x31672a==='\x20'?'\x20':_0xdcada6(_0x31672a))[_0x1c4a15(0x25a)]('');_0x4dc1e8[_0x1c4a15(0x281)](_0x49473e+'\x20'+_0x4ddc2f+'│'+_0x5b3d85+'│');}return _0x4dc1e8[_0x1c4a15(0x25a)]('\x0a');}async[a52_0x1a0e08(0x249)](_0x5d54b8,_0x5eb6e5,_0x36da62){const _0x2456aa=a52_0x1a0e08,{options:_0x227b62,tdx:_0xf0823}=_0x5eb6e5,_0x39c761=_0x227b62[_0x2456aa(0x1c0)],{timelineRows:_0x267a9f,timeAxisHeader:_0x483511}=this[_0x2456aa(0x2af)](_0x5d54b8,_0x39c761),_0x65f081=_0x267a9f[_0x2456aa(0x2e7)](_0x359107=>_0x359107[_0x2456aa(0x241)]);if(_0x65f081[_0x2456aa(0x2ab)]===0x0){const _0x529285=this[_0x2456aa(0x239)](_0x5d54b8,_0x39c761);console[_0x2456aa(0x30c)](_0x529285);!_0x36da62&&(console[_0x2456aa(0x30d)](''),console[_0x2456aa(0x30d)](a52_0x3e3b2b[_0x2456aa(0x204)](_0x2456aa(0x1e5))),console[_0x2456aa(0x30d)](a52_0x3e3b2b[_0x2456aa(0x204)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a52_0x3e3b2b[_0x2456aa(0x204)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x483511&&console[_0x2456aa(0x30c)](_0x483511);const _0x2f70d1=_0x267a9f[_0x2456aa(0x2e7)](_0x289f58=>_0x289f58[_0x2456aa(0x241)])[_0x2456aa(0x2e0)](_0x46d3a8=>({'title':_0x46d3a8[_0x2456aa(0x20c)],'value':_0x46d3a8[_0x2456aa(0x241)]})),_0x287c20=process[_0x2456aa(0x345)][_0x2456aa(0x298)]||0x3c,_0x2587bc=Math[_0x2456aa(0x334)](0x28,Math['floor'](_0x287c20*0x2/0x3)),_0x498c20=await a52_0xfc59b7({'type':'autocomplete','name':_0x2456aa(0x241),'message':_0x2456aa(0x20b),'choices':_0x2f70d1,'initial':-0x1,'limit':_0x2587bc,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x3c771d,_0x33a8bd)=>{const _0x2ded66=_0x2456aa;if(!_0x3c771d)return Promise['resolve'](_0x33a8bd);const _0x248eac=_0x33a8bd[_0x2ded66(0x2e7)](_0x10eeec=>{const _0x3330f8=_0x2ded66,_0x5664b5=_0x10eeec;return _0x5664b5[_0x3330f8(0x206)][_0x3330f8(0x307)]()['includes'](_0x3c771d['toLowerCase']());});return Promise[_0x2ded66(0x216)](_0x248eac);}}),_0x1904ac=()=>{const _0x2d3e9c=_0x2456aa;process['stdout'][_0x2d3e9c(0x25f)]('\x1b[1A\x1b[2K'),process['stdout'][_0x2d3e9c(0x25f)](_0x2d3e9c(0x343)),process[_0x2d3e9c(0x345)][_0x2d3e9c(0x25f)](_0x2d3e9c(0x343));},_0x211011=_0x498c20&&_0x498c20[_0x2456aa(0x241)]&&_0x498c20[_0x2456aa(0x241)]!==null&&_0x498c20[_0x2456aa(0x241)][_0x2456aa(0x282)]()!=='';if(!_0x211011){_0x1904ac(),console[_0x2456aa(0x30c)](a52_0x3e3b2b[_0x2456aa(0x204)](_0x2456aa(0x288)));return;}_0x1904ac();const _0x2fe567=_0x5d54b8[_0x2456aa(0x2c8)](_0x490794=>_0x490794[_0x2456aa(0x294)]?.['id']===_0x498c20[_0x2456aa(0x241)]);if(_0x2fe567){const _0x1aeef7=_0x2fe567[_0x2456aa(0x2ca)]?.[_0x2456aa(0x1cf)]||'?',_0x55e87f=_0x2fe567['workflow']?.['name']||'?';console[_0x2456aa(0x30c)](_0x2456aa(0x2a6)+a52_0x3e3b2b['dim'](_0x1aeef7)+',\x20Workflow:\x20'+a52_0x3e3b2b[_0x2456aa(0x204)](_0x55e87f));}const _0x33460e=new WorkflowTimelineCommand();await _0x33460e[_0x2456aa(0x2fc)]({'args':[],'options':{..._0x227b62,'attemptId':_0x498c20[_0x2456aa(0x241)]},'tdx':_0xf0823});}[a52_0x1a0e08(0x2af)](_0x2101f5,_0x469af9){const _0x24b563=a52_0x1a0e08,_0x2e21d7=new Map();for(const _0x11d25b of _0x2101f5){_0x11d25b['id']&&_0x11d25b[_0x24b563(0x294)]?.['id']&&_0x2e21d7[_0x24b563(0x33b)](_0x11d25b['id'],_0x11d25b[_0x24b563(0x294)]['id']);}const _0x26bc45=[];let _0xa0a8ad='';const _0x271795=this['renderSessionsTimeline'](_0x2101f5,_0x469af9),_0x2099af=_0x271795[_0x24b563(0x266)]('\x0a');for(const _0x1e83c1 of _0x2099af){if(_0x1e83c1[_0x24b563(0x27e)](_0x24b563(0x220))||_0x1e83c1[_0x24b563(0x2a9)](/^\s+\d{4}-\d{2}-\d{2}/))_0xa0a8ad=_0x1e83c1;else{if(_0x1e83c1['match'](/^[✅❌🔄🛑⏳]/)){const _0x1c2ba9=_0x1e83c1[_0x24b563(0x2a9)](/#(\d+)/),_0x525167=_0x1c2ba9?_0x1c2ba9[0x1]:null,_0x1cde21=_0x525167?_0x2e21d7[_0x24b563(0x293)](_0x525167)||null:null,_0x3c1b89=_0x2101f5['find'](_0x3169f7=>_0x3169f7['id']===_0x525167),_0x123736=_0x3c1b89?.[_0x24b563(0x2ca)]?.['name']||'';_0x26bc45[_0x24b563(0x281)]({'displayLine':_0x1e83c1,'attemptId':_0x1cde21,'projectName':_0x123736});}}}return{'timelineRows':_0x26bc45,'timeAxisHeader':_0xa0a8ad};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x268);[a52_0x1a0e08(0x331)]='List\x20workflow\x20attempts';async[a52_0x1a0e08(0x2fc)](_0x1063e3){const _0x5ab0fc=a52_0x1a0e08,{options:_0x23c3ed,args:_0x5251b7,tdx:_0x422080}=_0x1063e3,_0x2adfa7=this[_0x5ab0fc(0x1f9)](_0x5251b7,_0x23c3ed);if(!_0x2adfa7)return 0x1;const {projectName:_0x5e2448,workflowName:_0x4e29d2}=_0x2adfa7,_0xcc5792=_0x23c3ed[_0x5ab0fc(0x2f5)];if(_0x23c3ed[_0x5ab0fc(0x258)]){if(_0x5e2448&&_0x4e29d2)console['error'](_0x5ab0fc(0x2da)+_0x5e2448+'.'+_0x4e29d2);else _0x5e2448&&console[_0x5ab0fc(0x30d)](_0x5ab0fc(0x260)+_0x5e2448);_0xcc5792&&console['error'](_0x5ab0fc(0x226));}const _0x46e601=await withSpinner(_0x5ab0fc(0x2c1),()=>_0x422080[_0x5ab0fc(0x246)][_0x5ab0fc(0x21a)]({'projectName':_0x5e2448,'workflowName':_0x4e29d2,'includeRetried':_0xcc5792,'limit':_0x23c3ed[_0x5ab0fc(0x2a4)]}),{'verbose':_0x23c3ed[_0x5ab0fc(0x258)]}),_0x4c9388=_0x46e601[_0x5ab0fc(0x224)],_0x34af0=_0x23c3ed[_0x5ab0fc(0x2a4)]||0x64,_0x314749=_0x4c9388[_0x5ab0fc(0x2ab)]>=_0x34af0?a52_0x3e3b2b[_0x5ab0fc(0x204)](_0x5ab0fc(0x1c5)):'';console[_0x5ab0fc(0x30d)]('✔\x20Found\x20'+_0x4c9388[_0x5ab0fc(0x2ab)]+_0x5ab0fc(0x2bd)+(_0x4c9388['length']!==0x1?'s':'')+_0x314749);if(_0x23c3ed[_0x5ab0fc(0x2d8)]==='json'||_0x23c3ed[_0x5ab0fc(0x2d8)]===_0x5ab0fc(0x232)||_0x23c3ed['format']===_0x5ab0fc(0x33c))await handleSDKOutput(_0x4c9388,_0x23c3ed);else{if(_0x4c9388[_0x5ab0fc(0x2ab)]===0x0){if(_0x5e2448&&_0x4e29d2)console[_0x5ab0fc(0x30c)](_0x5ab0fc(0x30a)+_0x5e2448+'.'+_0x4e29d2);else _0x5e2448?console['log'](_0x5ab0fc(0x22c)+_0x5e2448):console[_0x5ab0fc(0x30c)](_0x5ab0fc(0x355));}else{const _0x196ca5=_0x23c3ed[_0x5ab0fc(0x1c0)],_0x4fbc1a=_0x4c9388['map'](_0xe5fbe7=>{const _0x66f11e=_0x5ab0fc,_0x46fd9b=a52_0x3e3b2b[_0x66f11e(0x204)]('#'+_0xe5fbe7['id']),_0x53180a=_0xe5fbe7[_0x66f11e(0x2ca)]?.['id'],_0x955a59=_0xe5fbe7['session_id']||_0xe5fbe7[_0x66f11e(0x24b)],_0x50a645=_0x53180a&&_0x955a59?hyperlink(_0x46fd9b,getWorkflowAttemptUrl(_0x196ca5,_0x53180a,_0x955a59,_0xe5fbe7['id'])):_0x46fd9b,{icon:_0xb5ad76,text:_0x27d4aa}=getAttemptStatusDisplay(_0xe5fbe7),_0x223c34=(_0xe5fbe7[_0x66f11e(0x2ca)]?.[_0x66f11e(0x1cf)]||'?')+'.'+(_0xe5fbe7[_0x66f11e(0x246)]?.[_0x66f11e(0x1cf)]||'?'),_0x4a7918=_0xe5fbe7[_0x66f11e(0x292)]?a52_0x3e3b2b[_0x66f11e(0x204)](_0xe5fbe7[_0x66f11e(0x292)]):'';return(_0x50a645+'\x20'+_0xb5ad76+(_0x27d4aa?'\x20'+_0x27d4aa:'')+'\x20'+_0x223c34+'\x20'+_0x4a7918)[_0x66f11e(0x320)]();});await writeOutput(_0x4fbc1a[_0x5ab0fc(0x25a)]('\x0a'),_0x23c3ed[_0x5ab0fc(0x2bb)],_0x5ab0fc(0x26c));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a52_0x1a0e08(0x1cf)]='workflow:attempt';[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x24f);async[a52_0x1a0e08(0x2fc)](_0x48661e){const _0x2795b5=a52_0x1a0e08,{options:_0x2b0d77,args:_0x1f9381,tdx:_0xf5a2bb}=_0x48661e,_0x590bf6=_0x1f9381[0x0];if(!_0x590bf6)return console[_0x2795b5(0x30d)](_0x2795b5(0x358)),0x1;_0x2b0d77['verbose']&&console[_0x2795b5(0x30d)](_0x2795b5(0x24a)+_0x590bf6);const _0x1211d9=await withSpinner(_0x2795b5(0x26b),()=>_0xf5a2bb[_0x2795b5(0x246)][_0x2795b5(0x1d7)](_0x590bf6),{'verbose':_0x2b0d77[_0x2795b5(0x258)]}),_0x52305a=_0x1211d9[_0x2795b5(0x224)];let _0x34a1ba;!_0x52305a[_0x2795b5(0x23e)]?_0x34a1ba=_0x52305a['cancelRequested']?'canceling':_0x2795b5(0x205):_0x34a1ba=_0x52305a['success']?'success':_0x2795b5(0x30d);let _0x910dc3;if(_0x52305a[_0x2795b5(0x273)]&&_0x52305a[_0x2795b5(0x26a)]){const _0x2fab64=new Date(_0x52305a[_0x2795b5(0x273)])[_0x2795b5(0x348)](),_0x5abc75=new Date(_0x52305a[_0x2795b5(0x26a)])['getTime']();_0x910dc3=Math[_0x2795b5(0x20d)]((_0x5abc75-_0x2fab64)/0x3e8);}const _0x86183a={'attempt_id':_0x52305a['id'],'status':_0x34a1ba,..._0x52305a['index']!==undefined&&{'index':_0x52305a[_0x2795b5(0x34b)]},..._0x52305a[_0x2795b5(0x2ca)]&&{'project':_0x52305a[_0x2795b5(0x2ca)][_0x2795b5(0x1cf)]},..._0x52305a[_0x2795b5(0x246)]&&{'workflow':_0x52305a[_0x2795b5(0x246)]['name']},..._0x52305a['sessionId']&&{'session_id':_0x52305a[_0x2795b5(0x24b)]},..._0x52305a[_0x2795b5(0x292)]&&{'session_time':_0x52305a[_0x2795b5(0x292)]},..._0x52305a[_0x2795b5(0x31f)]&&{'retry_attempt':_0x52305a[_0x2795b5(0x31f)]},..._0x910dc3!==undefined&&{'duration_sec':_0x910dc3},..._0x52305a[_0x2795b5(0x273)]&&{'created_at':_0x52305a[_0x2795b5(0x273)]},..._0x52305a['finishedAt']&&{'finished_at':_0x52305a[_0x2795b5(0x26a)]},...Object['keys'](_0x52305a[_0x2795b5(0x1c7)])[_0x2795b5(0x2ab)]>0x0&&{'params':_0x52305a[_0x2795b5(0x1c7)]}};return await handleSingleObjectOutput(_0x86183a,_0x2b0d77),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a52_0x1a0e08(0x277);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x2ce);async[a52_0x1a0e08(0x2fc)](_0xa86b6c){const _0x5c9896=a52_0x1a0e08,{options:_0x1c4d39,args:_0x55bf06,tdx:_0xffeb1f}=_0xa86b6c,_0x64ecfd=_0x55bf06[0x0];if(!_0x64ecfd)return console['error'](_0x5c9896(0x358)),0x1;const _0x32ec92=_0x1c4d39[_0x5c9896(0x1e3)];_0x1c4d39[_0x5c9896(0x258)]&&(console[_0x5c9896(0x30d)]('Attempt\x20ID:\x20'+_0x64ecfd),_0x32ec92&&console[_0x5c9896(0x30d)]('Including\x20subtasks:\x20yes'));const _0x507e11=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0xffeb1f['workflow'][_0x5c9896(0x2f8)](_0x64ecfd,_0x32ec92||![]),{'verbose':_0x1c4d39['verbose']}),_0x5d2883=_0x507e11['data'];return console[_0x5c9896(0x30d)](_0x5c9896(0x27f)+_0x5d2883['length']+_0x5c9896(0x354)+(_0x5d2883[_0x5c9896(0x2ab)]!==0x1?'s':'')),await handleSDKOutput(_0x5d2883,_0x1c4d39),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x33e);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x1e0);async['execute'](_0x3a17e1){const _0x56846b=a52_0x1a0e08,{options:_0x1255b9,args:_0x142e08,tdx:_0x50dcee}=_0x3a17e1,_0x158614=_0x142e08[0x0];let _0x278e39=_0x142e08[0x1];if(!_0x158614)return console[_0x56846b(0x30d)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x1255b9[_0x56846b(0x258)]&&(console[_0x56846b(0x30d)]('Attempt\x20ID:\x20'+_0x158614),_0x278e39&&console[_0x56846b(0x30d)](_0x56846b(0x315)+_0x278e39));const _0x5d9775=await withSpinner(_0x56846b(0x20a),()=>_0x50dcee[_0x56846b(0x246)][_0x56846b(0x327)](_0x158614,_0x278e39),{'verbose':_0x1255b9[_0x56846b(0x258)]}),_0x2fa9a6=_0x5d9775[_0x56846b(0x224)];if(_0x2fa9a6[_0x56846b(0x2ab)]===0x0)return console['error'](_0x56846b(0x202)),0x0;if(!_0x278e39&&(_0x1255b9[_0x56846b(0x309)]||_0x1255b9[_0x56846b(0x2d8)]))return await handleSDKOutput(_0x2fa9a6,_0x1255b9),0x0;if(!_0x278e39){const _0x29af80=_0x2fa9a6['map'](_0x3499f3=>({'title':_0x3499f3['taskName']+'\x20('+formatBytes(_0x3499f3[_0x56846b(0x1d3)])+')','value':_0x3499f3['taskName']})),_0xdcd826=await a52_0xfc59b7({'type':_0x56846b(0x29f),'name':'task','message':_0x56846b(0x322),'choices':_0x29af80});if(!_0xdcd826['task'])return console[_0x56846b(0x30d)](_0x56846b(0x288)),0x0;_0x278e39=_0xdcd826[_0x56846b(0x32a)];}const _0x166f54=await withSpinner(_0x56846b(0x337),()=>_0x50dcee[_0x56846b(0x246)][_0x56846b(0x233)](_0x158614,_0x278e39),{'verbose':_0x1255b9[_0x56846b(0x258)]}),_0x59bd58=_0x166f54['data'];return _0x59bd58?console[_0x56846b(0x30c)](_0x59bd58):console[_0x56846b(0x30d)](_0x56846b(0x35c)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x332);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x1f2);async['execute'](_0x52e3f0){const _0x59f6b5=a52_0x1a0e08,{options:_0x344c44,args:_0x48f2c3,tdx:_0x4398de}=_0x52e3f0,_0x4babaa=_0x48f2c3[0x0];if(!_0x4babaa)return console[_0x59f6b5(0x30d)](_0x59f6b5(0x358)),0x1;const _0x5ad05f=_0x344c44[_0x59f6b5(0x27a)];_0x344c44[_0x59f6b5(0x258)]&&(console[_0x59f6b5(0x30d)](_0x59f6b5(0x24a)+_0x4babaa),_0x5ad05f&&console['error']('Reason:\x20'+_0x5ad05f));if(!_0x344c44['yes']){if(!isInteractive())return console[_0x59f6b5(0x30d)](a52_0x3e3b2b[_0x59f6b5(0x2e4)]('\x0aError:'),_0x59f6b5(0x215)),console[_0x59f6b5(0x30d)](a52_0x3e3b2b[_0x59f6b5(0x204)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3aa710=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x4babaa+'?');if(!_0x3aa710)return console[_0x59f6b5(0x30d)](a52_0x3e3b2b['yellow'](_0x59f6b5(0x288))),0x1;}const _0x272d3a=await withSpinner('Killing\x20attempt...',()=>_0x4398de['workflow'][_0x59f6b5(0x209)](_0x4babaa,_0x5ad05f),{'verbose':_0x344c44[_0x59f6b5(0x258)]}),_0x389f31=_0x272d3a['data'];return console['error']('✔\x20'+_0x389f31),0x0;}}function a52_0x2bd1(){const _0x1d7065=['parse','white','workflow:retry','workflow','\x20(system)','now','navigateSessionsInteractive','Attempt\x20ID:\x20','sessionId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Usage:\x20tdx\x20wf\x20use\x20<project>','preparePushProject','Show\x20specific\x20attempt\x20details','Source:\x20','all','No\x20projects\x20match\x20pattern:\x20','Start\x20a\x20workflow\x20run','getHours','Retrying\x20session...','getMonth','replace','verbose','resumeFrom','join','✔\x20Secret\x20\x27','showWorkflowConsoleUrl','value','start','write','Filter:\x20project=','workflows','canceling','✔\x20Workflow\x20run\x20started','type','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','split','\x20tasks','workflow:attempts','dryRun','finishedAt','Getting\x20attempt\x20details...','list','Downloading\x20project\x20','durationMs','floor','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','message','revision','createdAt','basename','isArray','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','workflow:tasks','Usage:\x20workflow:delete\x20<project-name-or-id>','Dry\x20run:\x20yes','reason','✔\x20Workflow\x20project\x20context\x20cleared.','yes','Force:\x20yes','startsWith','✔\x20Found\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','push','trim','---\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','MAX_POLL_ITERATIONS','workflow:run','renderSingleTimeline','Cancelled','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','workflow:sessions','attempt:','\x20\x20Session\x20context\x20set\x20to:\x20','MIN_LABEL_COUNT','sys','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','some','MAX_LABEL_COUNT','sessionTime','get','lastAttempt','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','2677764ZCQjhB','Updating\x20','rows','✔\x20Project:\x20','\x20\x20Files\x20extracted:\x20','⚠\x20Showing\x20first\x20','628812sCEBnA','workflow:secrets:set','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','select','\x20\x20Location:\x20','Session\x20not\x20found:\x20','modified','getDate','limit','fill','Project:\x20','targetDir','Retry\x20a\x20session\x20or\x20attempt','match','\x22?\x20This\x20cannot\x20be\x20undone.','length','📁\x20','substring','🔄\x20','generateSessionTimelineRows','Listing\x20secrets...','path','Project\x20name\x20is\x20required','ICON_SPACING','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','renderTimeline','\x27\x20from\x20project\x20\x27','Error:\x20','Auto-selected\x20latest\x20session:\x20','10525680BdQFCY','projectName','output','columns','\x20attempt','LABEL_WIDTH_DIVISOR','repeat','fullName','Listing\x20workflow\x20attempts...','No\x20sessions\x20found\x20in\x20project:\x20','(unknown)','1LtEoVB','\x20\x20Session\x20ID:\x20','\x20deleted','applyPullProject','find','filesExtracted','project','Params:\x20','\x20sessions\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Show\x20tasks\x20for\x20an\x20attempt','projects','Listing\x20workflows...','end','No\x20workflow\x20tdx.json\x20found','workflow:secrets:list','ICON_WIDTH','Loading\x20sessions...','No\x20workflow\x20sessions\x20found','force','format','Workflow:\x20','Filter:\x20','summary','\x0aFailed\x20to\x20fetch\x20attempt\x20data','workflow:pull','key','getFullYear','map','\x20\x20Target:\x20','\x0aPolling...\x20(','TASK_NAME_WIDTH','red','utf-8','Revision:\x20','filter','✔\x20Pull\x20complete','changes','min','/app/workflows/','tdx\x20wf\x20attempt\x20','.\x20Expected\x20format:\x20KEY=VALUE','isTTY','83125pbspaL','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','has','retryAttempt','workflow:projects','projectId','includeRetried','\x20session','workflow:timeline','tasks','session','padStart','Files\x20to\x20upload:\x20','execute','New\x20project\x20name:\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','revision:\x20','resolveProject','sessions','skipValidation','context','MAX_TIMELINE_WIDTH','success','Target\x20directory:\x20','toLowerCase','hasChanges','json','No\x20attempts\x20found\x20for:\x20','Target:\x20','log','error','group_error','Cloning\x20to\x20','yellow','Pulling\x20project\x20','\x20logs','\x20-\x20','relative','Task\x20name:\x20','402pLlmYk','Analyzing\x20project...','MIN_TIMELINE_WIDTH','\x0aError:','sourceDir','startedAt','includes','localeCompare','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','retryAttemptName','trimEnd','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Select\x20a\x20task\x20to\x20view\x20logs:','sourceProjectName','Validation:\x20skipped','indexOf','\x20\x20Console:\x20','logFiles','\x20of\x20','Session\x20','task','3609208uLcieN','icon','\x20secrets...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Secrets\x20to\x20set:\x20','description','workflow:kill','blue','max','/sessions/','Latest\x20session\x20has\x20no\x20attempt','Downloading\x20logs...','Deleting\x20project\x20','GUTTER','✔\x20Clone\x20complete','set','table','newProjectName','workflow:logs','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','cwd','Deleting\x20secret...','from','\x1b[1A\x1b[2K','3569656VoIhMO','stdout','param','unchanged','getTime','window','-\x20nothing\x20pushed','index','\x20unchanged','diff','18BOatXr','slice','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','deleted','readFile','List\x20workflow\x20execution\x20sessions','\x20task','No\x20attempts\x20found','4038755gGvOHM','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Error:\x20Attempt\x20ID\x20is\x20required','new','List\x20all\x20workflow\x20projects','\x0a⚠\x20Project\x20\x22','No\x20log\x20content\x20found','newProjectId','unknown','fromTask','✔\x20Downloaded\x20','\x20\x20Project:\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','\x20\x20Revision:\x20','site','green','every','download','\x20to\x20see\x20detailed\x20logs','\x20(use\x20--limit\x20to\x20show\x20more)','run','params','workflow:upload','toISOString','Source\x20directory:\x20','keys','MAX_TASKS_DISPLAY','Key\x20cannot\x20be\x20empty','\x20\x20New\x20attempt\x20ID:\x20','name','workflow:push','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','fileSize','No\x20workflow\x20projects\x20found','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','No\x20workflows\x20found','attempt','Error:\x20Invalid\x20parameter\x20format:\x20','duration','...','isDirectory','setSecrets','Error:\x20Secret\x20key\x20is\x20required','\x20new','session:','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Project\x20name:\x20','prepareCloneProject','includeSubtasks','→\x20Project:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','sort','\x20\x20Project\x20ID:\x20','workflowProject','workflow:download','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Error:\x20Project\x20name\x20is\x20required','cancelRequested','Loading\x20workflows...','Listing\x20workflow\x20projects...','planned','\x0aClone\x20\x22','status','Kill\x20a\x20running\x20attempt','stat','state','pollTimeline','List\x20workflows','\x22\x20already\x20exists\x20(ID:\x20','fs/promises','parseProjectWorkflowPattern','cyan','resolveProjectDir','pullProject','💡\x20Tip:\x20Use\x20','\x20has\x20no\x20attempts','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','No\x20sessions\x20with\x20timing\x20information','pending','No\x20log\x20files\x20found\x20for\x20this\x20attempt','LABEL_MIN_SPACING','dim','running','title','msPerChar','✔\x20Push\x20complete','kill','Fetching\x20log\x20files...','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','displayLine','round','✔\x20Retry\x20started','\x0aApply\x20these\x20changes?','follow','(use\x20--limit\x20to\x20see\x20more)','No\x20sessions\x20found','Pushing\x20workflow\x20project...','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','resolve','delete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Retrying\x20attempt...','attempts','📋\x20','\x0aPush\x20these\x20changes?','updatedAt','\x0a✔\x20Attempt\x20complete','\x22\x20to\x20new\x20project\x20\x22','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','size','workflow:workflows','\x20\x20Source:\x20','data','\x20\x20Changes:\x20','Include\x20retried:\x20yes','Error:','Setting\x20','/attempt/','Project\x20directory:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','No\x20attempts\x20found\x20in\x20project:\x20','Listing\x20workflow\x20sessions...','\x0a✔\x20Already\x20up\x20to\x20date','Status:\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','jsonl','logs','targetExists','\x20\x20Workflow:\x20','buildTimelineData','Tip:\x20cd\x20to\x20workflows/','Source\x20directory\x20is\x20required','renderSessionsTimeline','startTime','deleteSecret','\x20modified','Writing\x20files...','done','Setting\x20secret...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','attemptId','Expected\x20format:\x20--param\x20key=value'];a52_0x2bd1=function(){return _0x1d7065;};return a52_0x2bd1();}export class WorkflowRetryCommand extends BaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x245);['description']=a52_0x1a0e08(0x2a8);async[a52_0x1a0e08(0x2fc)](_0x3c77c3){const _0x4aaff6=a52_0x1a0e08,{options:_0x53ef24,args:_0x287086,tdx:_0x213444}=_0x3c77c3,_0x5465c1=_0x287086[0x0];if(!_0x5465c1)return console[_0x4aaff6(0x30d)](_0x4aaff6(0x265)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x169391=![],_0xd14443=_0x5465c1;if(_0x5465c1[_0x4aaff6(0x27e)](_0x4aaff6(0x1df)))_0x169391=!![],_0xd14443=_0x5465c1[_0x4aaff6(0x2ad)](0x8);else{if(_0x5465c1[_0x4aaff6(0x27e)](_0x4aaff6(0x28b)))_0x169391=![],_0xd14443=_0x5465c1['substring'](0x8);else return console[_0x4aaff6(0x30d)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x4aaff6(0x30d)](_0x4aaff6(0x280)),0x1;}const _0x116087=_0x53ef24[_0x4aaff6(0x35f)],_0x1b0bc4=_0x53ef24[_0x4aaff6(0x259)],_0x23aa8e=_0x53ef24[_0x4aaff6(0x1c7)],_0x1c27e5=_0x53ef24[_0x4aaff6(0x2d7)];_0x53ef24[_0x4aaff6(0x258)]&&(console[_0x4aaff6(0x30d)](_0x4aaff6(0x30b)+(_0x169391?'session':'attempt')+'\x20'+_0xd14443),_0x116087&&console[_0x4aaff6(0x30d)]('From\x20task:\x20'+_0x116087),_0x1b0bc4&&console[_0x4aaff6(0x30d)]('Resume\x20from:\x20'+_0x1b0bc4),_0x23aa8e&&console['error'](_0x4aaff6(0x2cb)+_0x23aa8e),_0x1c27e5&&console[_0x4aaff6(0x30d)](_0x4aaff6(0x27d)));let _0x404025;if(_0x23aa8e)try{if(_0x23aa8e[_0x4aaff6(0x27e)]('@')){const _0x45ea4d=await import(_0x4aaff6(0x1f8)),_0x50d9bc=_0x23aa8e[_0x4aaff6(0x2ad)](0x1),_0x2cd2d8=await _0x45ea4d[_0x4aaff6(0x352)](_0x50d9bc,_0x4aaff6(0x2e5));_0x404025=JSON[_0x4aaff6(0x243)](_0x2cd2d8);}else _0x404025=JSON[_0x4aaff6(0x243)](_0x23aa8e);}catch{return console[_0x4aaff6(0x30d)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x53ef24[_0x4aaff6(0x27c)]){if(!isInteractive())return console[_0x4aaff6(0x30d)](a52_0x3e3b2b[_0x4aaff6(0x2e4)]('\x0aError:'),_0x4aaff6(0x215)),console[_0x4aaff6(0x30d)](a52_0x3e3b2b[_0x4aaff6(0x204)](_0x4aaff6(0x24c))),0x1;const _0x181baa=await confirmKey(_0x4aaff6(0x2f0)+(_0x169391?_0x4aaff6(0x2f9):'attempt')+'\x20'+_0xd14443+'?');if(!_0x181baa)return console[_0x4aaff6(0x30d)](a52_0x3e3b2b[_0x4aaff6(0x310)](_0x4aaff6(0x288))),0x1;}let _0x24e4a0;_0x169391?_0x24e4a0=await withSpinner(_0x4aaff6(0x255),()=>_0x213444[_0x4aaff6(0x246)]['retrySession'](_0xd14443,{'fromTask':_0x116087,'retryParams':_0x404025}),{'verbose':_0x53ef24[_0x4aaff6(0x258)]}):_0x24e4a0=await withSpinner(_0x4aaff6(0x219),()=>_0x213444[_0x4aaff6(0x246)][_0x4aaff6(0x2f2)](_0xd14443,{'resumeFrom':_0x1b0bc4,'retryParams':_0x404025,'force':_0x1c27e5}),{'verbose':_0x53ef24['verbose']});const _0x4db71d=_0x24e4a0[_0x4aaff6(0x224)];return console[_0x4aaff6(0x30d)](_0x4aaff6(0x20e)),console[_0x4aaff6(0x30d)](_0x4aaff6(0x1ce)+_0x4db71d[_0x4aaff6(0x241)]),console[_0x4aaff6(0x30d)](_0x4aaff6(0x2c5)+_0x4db71d[_0x4aaff6(0x24b)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x286);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x253);async[a52_0x1a0e08(0x2fc)](_0x3c041c){const _0x5b8ed9=a52_0x1a0e08,{options:_0x5b0d49,args:_0x2b9065,tdx:_0x59ce1a}=_0x3c041c;let _0x4abd28=_0x2b9065[0x0];if(!_0x4abd28){const _0x243554=this[_0x5b8ed9(0x300)]([],_0x5b0d49),_0x2c3030=await withSpinner(_0x5b8ed9(0x1ed),()=>_0x59ce1a[_0x5b8ed9(0x246)][_0x5b8ed9(0x261)](_0x243554,{'limit':_0x5b0d49[_0x5b8ed9(0x2a4)]}),{'verbose':_0x5b0d49[_0x5b8ed9(0x258)]}),_0x16b1d0=_0x2c3030[_0x5b8ed9(0x224)];if(_0x16b1d0['length']===0x0)return console[_0x5b8ed9(0x30d)](_0x5b8ed9(0x1d6)),!_0x243554&&console['error'](a52_0x3e3b2b[_0x5b8ed9(0x204)](_0x5b8ed9(0x240))),0x1;const _0x1200c7=_0x16b1d0[_0x5b8ed9(0x2e0)](_0x5d2c45=>({'title':_0x5d2c45[_0x5b8ed9(0x2ca)]?.['name']+'.'+_0x5d2c45['name'],'value':_0x5d2c45[_0x5b8ed9(0x2ca)]?.['name']+'.'+_0x5d2c45['name'],'description':_0x5d2c45['revision']?_0x5b8ed9(0x2ff)+_0x5d2c45[_0x5b8ed9(0x272)]:undefined})),_0x1790d3=await a52_0xfc59b7({'type':'select','name':_0x5b8ed9(0x246),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x1200c7});if(!_0x1790d3[_0x5b8ed9(0x246)])return 0x1;_0x4abd28=_0x1790d3[_0x5b8ed9(0x246)];}if(!_0x4abd28[_0x5b8ed9(0x31c)]('.')){const _0x301989=this[_0x5b8ed9(0x300)]([],_0x5b0d49);if(_0x301989)_0x4abd28=_0x301989+'.'+_0x4abd28;else return console['error'](a52_0x3e3b2b[_0x5b8ed9(0x2e4)](_0x5b8ed9(0x227)),_0x5b8ed9(0x28f)),console[_0x5b8ed9(0x30d)](a52_0x3e3b2b[_0x5b8ed9(0x204)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x2a0ba4=_0x5b0d49[_0x5b8ed9(0x346)],_0x36d2ab=_0x5b0d49[_0x5b8ed9(0x292)],_0x32c423={};if(_0x2a0ba4&&Array[_0x5b8ed9(0x275)](_0x2a0ba4))for(const _0x44bb1e of _0x2a0ba4){const _0xe3eae3=_0x44bb1e[_0x5b8ed9(0x325)]('=');if(_0xe3eae3===-0x1)return console['error'](_0x5b8ed9(0x1d8)+_0x44bb1e),console[_0x5b8ed9(0x30d)](_0x5b8ed9(0x242)),0x1;const _0x581f21=_0x44bb1e[_0x5b8ed9(0x2ad)](0x0,_0xe3eae3),_0x21a7a7=_0x44bb1e['substring'](_0xe3eae3+0x1);try{_0x32c423[_0x581f21]=JSON[_0x5b8ed9(0x243)](_0x21a7a7);}catch{_0x32c423[_0x581f21]=_0x21a7a7;}}_0x5b0d49[_0x5b8ed9(0x258)]&&(console[_0x5b8ed9(0x30d)](_0x5b8ed9(0x2d9)+_0x4abd28),Object[_0x5b8ed9(0x1cb)](_0x32c423)[_0x5b8ed9(0x2ab)]>0x0&&console[_0x5b8ed9(0x30d)]('Parameters:\x20'+JSON['stringify'](_0x32c423)),_0x36d2ab&&console[_0x5b8ed9(0x30d)]('Session\x20time:\x20'+_0x36d2ab));const _0x4ccf3b=await withSpinner('Starting\x20workflow\x20run...',()=>_0x59ce1a[_0x5b8ed9(0x246)][_0x5b8ed9(0x1c6)](_0x4abd28,_0x32c423,{'sessionTime':_0x36d2ab}),{'verbose':_0x5b0d49[_0x5b8ed9(0x258)]}),_0x55c630=_0x4ccf3b[_0x5b8ed9(0x224)];console['error'](_0x5b8ed9(0x263)),console[_0x5b8ed9(0x30d)]('\x20\x20Attempt\x20ID:\x20'+_0x55c630['id']),console[_0x5b8ed9(0x30d)]('\x20\x20Session\x20ID:\x20'+_0x55c630[_0x5b8ed9(0x24b)]),console['error']('\x20\x20Project:\x20'+_0x55c630[_0x5b8ed9(0x2ca)]?.['name']),console[_0x5b8ed9(0x30d)](_0x5b8ed9(0x235)+_0x55c630['workflow']?.[_0x5b8ed9(0x1cf)]);if(_0x55c630[_0x5b8ed9(0x2ca)]?.['id']&&_0x55c630[_0x5b8ed9(0x24b)]&&_0x55c630['id']){const _0x3c6faf=_0x5b0d49[_0x5b8ed9(0x1c0)],_0x3efd78=getConsoleUrl(_0x3c6faf,_0x5b8ed9(0x2eb)+_0x55c630[_0x5b8ed9(0x2ca)]['id']+_0x5b8ed9(0x335)+_0x55c630[_0x5b8ed9(0x24b)]+_0x5b8ed9(0x229)+_0x55c630['id']);console[_0x5b8ed9(0x30d)]('\x20\x20Console:\x20'+a52_0x3e3b2b[_0x5b8ed9(0x1fa)](_0x3efd78));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a52_0x1a0e08(0x1e9);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x2cd);async[a52_0x1a0e08(0x2fc)](_0x5ab7a8){const _0x2b710f=a52_0x1a0e08,{options:_0xb7abaa,args:_0x10cee9,tdx:_0x444acd}=_0x5ab7a8,_0x5c4618=_0x10cee9[0x0],_0x4fdce2=_0x10cee9[0x1]||'.';if(!_0x5c4618)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x2b710f(0x270)),0x1;const _0x4d4623=_0xb7abaa[_0x2b710f(0x272)];_0xb7abaa[_0x2b710f(0x258)]&&(console['error'](_0x2b710f(0x2a6)+_0x5c4618),console['error']('Output\x20directory:\x20'+_0x4fdce2),_0x4d4623&&console[_0x2b710f(0x30d)](_0x2b710f(0x2e6)+_0x4d4623));const _0x4e984d=await withSpinner(_0x2b710f(0x26d)+_0x5c4618+_0x2b710f(0x1da),()=>_0x444acd['workflow'][_0x2b710f(0x1c3)](_0x5c4618,_0x4fdce2,{'revision':_0x4d4623}),{'verbose':_0xb7abaa['verbose']}),_0x63d7eb=_0x4e984d[_0x2b710f(0x224)];return console[_0x2b710f(0x30d)](_0x2b710f(0x1bc)+_0x63d7eb[_0x2b710f(0x2ba)]),console[_0x2b710f(0x30d)](_0x2b710f(0x1bf)+_0x63d7eb[_0x2b710f(0x272)]),console['error'](_0x2b710f(0x29a)+_0x63d7eb[_0x2b710f(0x2c9)]),console[_0x2b710f(0x30d)]('\x20\x20Location:\x20'+_0x4fdce2+'/'+_0x63d7eb[_0x2b710f(0x2ba)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x1c8);['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a52_0x1a0e08(0x2fc)](_0xa9576d){const _0x1fc98c=a52_0x1a0e08,{options:_0x407e19,args:_0x13a81c,tdx:_0x1ff613}=_0xa9576d;let _0x4b25b2='.',_0x1257de=_0x407e19[_0x1fc98c(0x1cf)];if(_0x13a81c[0x0]){const {promises:_0xcd4496}=await import('fs');try{const _0x3098d7=await _0xcd4496[_0x1fc98c(0x1f3)](_0x13a81c[0x0]);if(_0x3098d7[_0x1fc98c(0x1db)]())_0x4b25b2=_0x13a81c[0x0];else return console[_0x1fc98c(0x30d)](_0x1fc98c(0x2b7)+_0x13a81c[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x1257de=_0x13a81c[0x0],_0x4b25b2='.';}}const _0x443d60=_0x407e19[_0x1fc98c(0x272)],_0x5305ad=_0x407e19['skipValidation'];_0x407e19[_0x1fc98c(0x258)]&&(console[_0x1fc98c(0x30d)](_0x1fc98c(0x22a)+_0x4b25b2),_0x1257de&&console[_0x1fc98c(0x30d)](_0x1fc98c(0x1e1)+_0x1257de),_0x443d60&&console['error'](_0x1fc98c(0x2e6)+_0x443d60),_0x5305ad&&console[_0x1fc98c(0x30d)](_0x1fc98c(0x324)));const _0x1b5b1b=await withSpinner(_0x1fc98c(0x213),()=>_0x1ff613['workflow'][_0x1fc98c(0x281)](_0x4b25b2,{'projectName':_0x1257de,'revision':_0x443d60,'skipValidation':_0x5305ad}),{'verbose':_0x407e19[_0x1fc98c(0x258)]}),_0x1cfd1c=_0x1b5b1b[_0x1fc98c(0x224)];return console[_0x1fc98c(0x30d)]('✔\x20Pushed\x20'+_0x1cfd1c[_0x1fc98c(0x2ba)]),console[_0x1fc98c(0x30d)](_0x1fc98c(0x1e7)+_0x1cfd1c['projectId']),console[_0x1fc98c(0x30d)](_0x1fc98c(0x1bf)+_0x1cfd1c['revision']),await this[_0x1fc98c(0x25c)](_0x1ff613,_0x1cfd1c[_0x1fc98c(0x2ba)],_0x407e19[_0x1fc98c(0x1c0)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x2dd);[a52_0x1a0e08(0x331)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a52_0x1a0e08(0x2fc)](_0x544631){const _0x5d8597=a52_0x1a0e08,{options:_0x2b61a9,args:_0x2a33ef,tdx:_0x294326}=_0x544631,_0x2024e0=_0x2a33ef[0x0],_0x31ce00=_0x2a33ef[0x1];if(!_0x2024e0)return console[_0x5d8597(0x30d)](a52_0x3e3b2b[_0x5d8597(0x2e4)](_0x5d8597(0x227)),_0x5d8597(0x2b2)),console[_0x5d8597(0x30d)](a52_0x3e3b2b['dim'](_0x5d8597(0x2b4))),0x1;const _0x3af4bb=_0x2b61a9[_0x5d8597(0x272)];_0x2b61a9['verbose']&&(console[_0x5d8597(0x30d)](_0x5d8597(0x2a6)+_0x2024e0),_0x31ce00&&console[_0x5d8597(0x30d)](_0x5d8597(0x306)+_0x31ce00),_0x3af4bb&&console['error'](_0x5d8597(0x2e6)+_0x3af4bb),_0x2b61a9[_0x5d8597(0x269)]&&console[_0x5d8597(0x30d)](_0x5d8597(0x279)));const _0xeb268a=await withSpinner(_0x5d8597(0x311)+_0x2024e0+_0x5d8597(0x1da),()=>_0x294326[_0x5d8597(0x246)][_0x5d8597(0x1fc)](_0x2024e0,{'targetDir':_0x31ce00,'revision':_0x3af4bb}),{'verbose':_0x2b61a9[_0x5d8597(0x258)]}),_0x54f008=_0xeb268a[_0x5d8597(0x224)];_0x54f008['isNewProject']?console[_0x5d8597(0x30d)]('→\x20New\x20project:\x20'+_0x54f008['projectName']):console[_0x5d8597(0x30d)](_0x5d8597(0x1e4)+_0x54f008[_0x5d8597(0x2ba)]);console[_0x5d8597(0x30d)](_0x5d8597(0x1bf)+_0x54f008[_0x5d8597(0x272)]),console[_0x5d8597(0x30d)](_0x5d8597(0x2e1)+(a52_0x47f7f2[_0x5d8597(0x314)](process[_0x5d8597(0x340)](),_0x54f008[_0x5d8597(0x2a7)])||'.')),console[_0x5d8597(0x30d)]('\x20\x20Changes:\x20'+a52_0x3e3b2b[_0x5d8597(0x1c1)]('+'+_0x54f008[_0x5d8597(0x2db)][_0x5d8597(0x359)]+_0x5d8597(0x1de))+',\x20'+(a52_0x3e3b2b[_0x5d8597(0x310)]('~'+_0x54f008['summary'][_0x5d8597(0x2a2)]+_0x5d8597(0x23c))+',\x20')+(a52_0x3e3b2b[_0x5d8597(0x2e4)]('-'+_0x54f008[_0x5d8597(0x2db)][_0x5d8597(0x351)]+_0x5d8597(0x2c6))+',\x20')+(''+a52_0x3e3b2b[_0x5d8597(0x204)](_0x54f008['summary'][_0x5d8597(0x347)]+_0x5d8597(0x34c))));for(const _0x94f875 of _0x54f008[_0x5d8597(0x2e9)]){_0x94f875['type']===_0x5d8597(0x2a2)&&_0x94f875[_0x5d8597(0x34d)]&&(console[_0x5d8597(0x30d)]('\x0a'+a52_0x3e3b2b['cyan'](_0x5d8597(0x283)+_0x94f875[_0x5d8597(0x2b1)])),console[_0x5d8597(0x30d)](_0x94f875[_0x5d8597(0x34d)]));}if(!_0x54f008[_0x5d8597(0x308)])return saveSessionContext({'workflow_project':_0x54f008[_0x5d8597(0x2ba)]},_0x2b61a9[_0x5d8597(0x2f9)]),console[_0x5d8597(0x30d)](a52_0x3e3b2b[_0x5d8597(0x1c1)](_0x5d8597(0x22e))),console[_0x5d8597(0x30d)](a52_0x3e3b2b[_0x5d8597(0x204)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x54f008[_0x5d8597(0x2ba)])),0x0;if(_0x2b61a9[_0x5d8597(0x269)])return console['error'](a52_0x3e3b2b['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x2b61a9['yes']){if(!isInteractive())return console[_0x5d8597(0x30d)](a52_0x3e3b2b['red'](_0x5d8597(0x319)),_0x5d8597(0x215)),console['error'](a52_0x3e3b2b[_0x5d8597(0x204)](_0x5d8597(0x24c))),0x1;const _0x5029c8=await confirmKey(_0x5d8597(0x20f));if(!_0x5029c8)return console[_0x5d8597(0x30d)](a52_0x3e3b2b['yellow'](_0x5d8597(0x288)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x5d8597(0x23d),()=>_0x294326[_0x5d8597(0x246)][_0x5d8597(0x2c7)](_0x54f008,{'revision':_0x3af4bb}),{'verbose':_0x2b61a9[_0x5d8597(0x258)]}),saveSessionContext({'workflow_project':_0x54f008[_0x5d8597(0x2ba)]},_0x2b61a9['session']),console[_0x5d8597(0x30d)](a52_0x3e3b2b[_0x5d8597(0x1c1)](_0x5d8597(0x2e8)));const _0x3e1581=a52_0x47f7f2[_0x5d8597(0x314)](process['cwd'](),_0x54f008[_0x5d8597(0x2a7)])||'.';return console['error'](a52_0x3e3b2b['dim'](_0x5d8597(0x2a0)+_0x3e1581)),console['error'](a52_0x3e3b2b[_0x5d8597(0x204)](_0x5d8597(0x28c)+_0x54f008['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a52_0x1a0e08(0x1d0);['description']=a52_0x1a0e08(0x321);async['execute'](_0x3a7ff9){const _0x51a83e=a52_0x1a0e08,{options:_0x2ae42,args:_0x4b066b,tdx:_0x1fe590}=_0x3a7ff9,_0xa8268f=this[_0x51a83e(0x1fb)](_0x4b066b,_0x2ae42),_0x3764fb=_0x2ae42[_0x51a83e(0x272)],_0x1a2671=_0x2ae42[_0x51a83e(0x302)];_0x2ae42[_0x51a83e(0x258)]&&(_0xa8268f&&console[_0x51a83e(0x30d)](_0x51a83e(0x1ca)+_0xa8268f),_0x3764fb&&console[_0x51a83e(0x30d)]('Revision:\x20'+_0x3764fb),_0x2ae42[_0x51a83e(0x269)]&&console[_0x51a83e(0x30d)]('Dry\x20run:\x20yes'),_0x1a2671&&console['error'](_0x51a83e(0x324)));let _0x17f191;try{_0x17f191=await withSpinner('Analyzing\x20changes...',()=>_0x1fe590[_0x51a83e(0x246)][_0x51a83e(0x24e)]({'sourceDir':_0xa8268f,'revision':_0x3764fb,'skipValidation':_0x1a2671}),{'verbose':_0x2ae42[_0x51a83e(0x258)]});}catch(_0x30c64e){if(_0x30c64e instanceof Error&&_0x30c64e[_0x51a83e(0x271)][_0x51a83e(0x31c)](_0x51a83e(0x2d2)))return console[_0x51a83e(0x30d)](a52_0x3e3b2b[_0x51a83e(0x2e4)](_0x51a83e(0x227)),_0x51a83e(0x295)),_0x2ae42[_0x51a83e(0x1e8)]?console['error'](a52_0x3e3b2b[_0x51a83e(0x204)](_0x51a83e(0x237)+_0x2ae42[_0x51a83e(0x1e8)]+_0x51a83e(0x350)+_0x2ae42['workflowProject']+'\x27')):console[_0x51a83e(0x30d)](a52_0x3e3b2b[_0x51a83e(0x204)](_0x51a83e(0x33f))),0x1;throw _0x30c64e;}const _0x1bb56d=_0x17f191[_0x51a83e(0x224)];console[_0x51a83e(0x30d)](_0x51a83e(0x299)+_0x1bb56d[_0x51a83e(0x2ba)]),console[_0x51a83e(0x30d)](_0x51a83e(0x223)+_0x1bb56d[_0x51a83e(0x31a)]),console['error'](_0x51a83e(0x1bf)+_0x1bb56d[_0x51a83e(0x272)]),console[_0x51a83e(0x30d)](_0x51a83e(0x225)+a52_0x3e3b2b[_0x51a83e(0x1c1)]('+'+_0x1bb56d['summary'][_0x51a83e(0x359)]+_0x51a83e(0x1de))+',\x20'+(a52_0x3e3b2b[_0x51a83e(0x310)]('~'+_0x1bb56d[_0x51a83e(0x2db)]['modified']+'\x20modified')+',\x20')+(a52_0x3e3b2b[_0x51a83e(0x2e4)]('-'+_0x1bb56d['summary']['deleted']+'\x20deleted')+',\x20')+(''+a52_0x3e3b2b[_0x51a83e(0x204)](_0x1bb56d[_0x51a83e(0x2db)][_0x51a83e(0x347)]+_0x51a83e(0x34c))));for(const _0x496b0d of _0x1bb56d[_0x51a83e(0x2e9)]){_0x496b0d[_0x51a83e(0x264)]===_0x51a83e(0x2a2)&&_0x496b0d[_0x51a83e(0x34d)]&&(console[_0x51a83e(0x30d)]('\x0a'+a52_0x3e3b2b[_0x51a83e(0x1fa)](_0x51a83e(0x283)+_0x496b0d[_0x51a83e(0x2b1)])),console['error'](_0x496b0d['diff']));}if(!_0x1bb56d['hasChanges'])return console[_0x51a83e(0x30d)](a52_0x3e3b2b[_0x51a83e(0x1c1)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x51a83e(0x25c)](_0x1fe590,_0x1bb56d[_0x51a83e(0x2ba)],_0x2ae42['site']),0x0;if(_0x2ae42['dryRun'])return console[_0x51a83e(0x30d)](a52_0x3e3b2b[_0x51a83e(0x310)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2ae42['yes']){if(!isInteractive())return console[_0x51a83e(0x30d)](a52_0x3e3b2b[_0x51a83e(0x2e4)](_0x51a83e(0x319)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x51a83e(0x30d)](a52_0x3e3b2b[_0x51a83e(0x204)](_0x51a83e(0x24c))),0x1;const _0x4b0172=await confirmKey(_0x51a83e(0x21c));if(!_0x4b0172)return console['error'](a52_0x3e3b2b[_0x51a83e(0x310)](_0x51a83e(0x288)),_0x51a83e(0x34a)),0x1;}const _0x1b5d7b=await withSpinner('Pushing\x20project...',()=>_0x1fe590[_0x51a83e(0x246)]['executePushProject'](_0x1bb56d),{'verbose':_0x2ae42['verbose']}),_0x1a23fb=_0x1b5d7b['data'];return console[_0x51a83e(0x30d)](a52_0x3e3b2b[_0x51a83e(0x1c1)](_0x51a83e(0x208))),console[_0x51a83e(0x30d)](_0x51a83e(0x1e7)+_0x1a23fb[_0x51a83e(0x2f4)]),console[_0x51a83e(0x30d)](_0x51a83e(0x1bf)+_0x1a23fb[_0x51a83e(0x272)]),await this[_0x51a83e(0x25c)](_0x1fe590,_0x1a23fb[_0x51a83e(0x2ba)],_0x2ae42[_0x51a83e(0x1c0)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0x24e5bd){const _0x3f56db=a52_0x1a0e08,{options:_0x3f54c4,args:_0x5bfd05,tdx:_0x45330d}=_0x24e5bd,_0x41c009=this['resolveProjectDir'](_0x5bfd05,_0x3f54c4),_0x1b9fc5=_0x3f54c4[_0x3f56db(0x1cf)],_0x179258=_0x3f54c4[_0x3f56db(0x272)],_0x5b923f=_0x3f54c4[_0x3f56db(0x302)];if(!_0x41c009)return console[_0x3f56db(0x30d)](a52_0x3e3b2b[_0x3f56db(0x2e4)](_0x3f56db(0x227)),_0x3f56db(0x238)),console[_0x3f56db(0x30d)](a52_0x3e3b2b['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a52_0x3e3b2b[_0x3f56db(0x204)](_0x3f56db(0x231))),0x1;if(!_0x1b9fc5)return console[_0x3f56db(0x30d)](a52_0x3e3b2b[_0x3f56db(0x2e4)](_0x3f56db(0x227)),_0x3f56db(0x230)),console[_0x3f56db(0x30d)](a52_0x3e3b2b[_0x3f56db(0x204)](_0x3f56db(0x32f))),0x1;_0x3f54c4['verbose']&&(console[_0x3f56db(0x30d)](_0x3f56db(0x1ca)+_0x41c009),console[_0x3f56db(0x30d)](_0x3f56db(0x2fd)+_0x1b9fc5),_0x179258&&console[_0x3f56db(0x30d)]('Revision:\x20'+_0x179258),_0x3f54c4[_0x3f56db(0x269)]&&console[_0x3f56db(0x30d)](_0x3f56db(0x279)),_0x5b923f&&console[_0x3f56db(0x30d)](_0x3f56db(0x324)));const _0x1de42f=await withSpinner(_0x3f56db(0x317),()=>_0x45330d[_0x3f56db(0x246)][_0x3f56db(0x1e2)](_0x41c009,_0x1b9fc5,{'revision':_0x179258,'skipValidation':_0x5b923f}),{'verbose':_0x3f54c4[_0x3f56db(0x258)]}),_0x2f1748=_0x1de42f[_0x3f56db(0x224)];console['error'](_0x3f56db(0x250)+_0x2f1748[_0x3f56db(0x31a)]);_0x2f1748['sourceProjectName']&&console['error']('Source\x20project:\x20'+_0x2f1748[_0x3f56db(0x323)]);console['error']('New\x20project\x20name:\x20'+_0x2f1748['newProjectName']),console[_0x3f56db(0x30d)]('Revision:\x20'+_0x2f1748['revision']),console['error'](_0x3f56db(0x2fb)+_0x2f1748['fileCount']);_0x2f1748[_0x3f56db(0x234)]&&(console[_0x3f56db(0x30d)](a52_0x3e3b2b[_0x3f56db(0x310)](_0x3f56db(0x35b)+_0x2f1748['newProjectName']+_0x3f56db(0x1f7)+_0x2f1748['existingProjectId']+')')),console[_0x3f56db(0x30d)](a52_0x3e3b2b[_0x3f56db(0x310)](_0x3f56db(0x22b))));if(_0x3f54c4[_0x3f56db(0x269)])return console[_0x3f56db(0x30d)](a52_0x3e3b2b['yellow']('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x3f54c4['yes']){if(!isInteractive())return console[_0x3f56db(0x30d)](a52_0x3e3b2b[_0x3f56db(0x2e4)]('\x0aError:'),_0x3f56db(0x215)),console[_0x3f56db(0x30d)](a52_0x3e3b2b[_0x3f56db(0x204)](_0x3f56db(0x24c))),0x1;const _0x3e8a13=_0x2f1748[_0x3f56db(0x323)]||a52_0x47f7f2[_0x3f56db(0x274)](_0x41c009),_0x4a91df=_0x2f1748[_0x3f56db(0x234)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x1b9fc5+'\x22\x20with\x20new\x20revision?':_0x3f56db(0x1f0)+_0x3e8a13+_0x3f56db(0x21f)+_0x1b9fc5+'\x22?',_0x2da728=await confirmKey(_0x4a91df);if(!_0x2da728)return console[_0x3f56db(0x30d)](a52_0x3e3b2b[_0x3f56db(0x310)](_0x3f56db(0x288))),0x1;}const _0x1baf51=await withSpinner(_0x2f1748['targetExists']?_0x3f56db(0x297)+_0x1b9fc5+_0x3f56db(0x1da):_0x3f56db(0x30f)+_0x1b9fc5+_0x3f56db(0x1da),()=>_0x45330d['workflow']['executeCloneProject'](_0x2f1748),{'verbose':_0x3f54c4[_0x3f56db(0x258)]}),_0x487f5b=_0x1baf51[_0x3f56db(0x224)];return console[_0x3f56db(0x30d)](a52_0x3e3b2b[_0x3f56db(0x1c1)](_0x2f1748[_0x3f56db(0x234)]?'✔\x20Project\x20updated':_0x3f56db(0x33a))),console['error'](_0x3f56db(0x1bd)+_0x487f5b['newProjectName']),console[_0x3f56db(0x30d)](_0x3f56db(0x1e7)+_0x487f5b[_0x3f56db(0x35d)]),console[_0x3f56db(0x30d)](_0x3f56db(0x1bf)+_0x487f5b[_0x3f56db(0x272)]),await this['showWorkflowConsoleUrl'](_0x45330d,_0x487f5b[_0x3f56db(0x33d)],_0x3f54c4['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a52_0x1a0e08(0x331)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a52_0x1a0e08(0x2fc)](_0x380bba){const _0x50f7ed=a52_0x1a0e08,{options:_0x2d7fd0,args:_0x38707b,tdx:_0x1d4b2e}=_0x380bba,_0x5d0e3d=_0x38707b[0x0];if(!_0x5d0e3d)return console[_0x50f7ed(0x30d)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x50f7ed(0x278)),0x1;_0x2d7fd0[_0x50f7ed(0x258)]&&console[_0x50f7ed(0x30d)](_0x50f7ed(0x2a6)+_0x5d0e3d);if(!_0x2d7fd0['yes']){if(!isInteractive())return console[_0x50f7ed(0x30d)](a52_0x3e3b2b[_0x50f7ed(0x2e4)]('\x0aError:'),_0x50f7ed(0x215)),console[_0x50f7ed(0x30d)](a52_0x3e3b2b[_0x50f7ed(0x204)](_0x50f7ed(0x24c))),0x1;const _0x419022=await confirmKey(_0x50f7ed(0x1d1)+_0x5d0e3d+_0x50f7ed(0x2aa));if(!_0x419022)return console['error'](a52_0x3e3b2b[_0x50f7ed(0x310)](_0x50f7ed(0x288))),0x1;}const _0xd5b92c=await withSpinner(_0x50f7ed(0x338)+_0x5d0e3d+_0x50f7ed(0x1da),()=>_0x1d4b2e[_0x50f7ed(0x246)][_0x50f7ed(0x217)](_0x5d0e3d),{'verbose':_0x2d7fd0[_0x50f7ed(0x258)]}),_0x9ccb90=_0xd5b92c[_0x50f7ed(0x224)];return console[_0x50f7ed(0x30d)]('✔\x20Deleted\x20project\x20'+_0x9ccb90[_0x50f7ed(0x2ba)]),console[_0x50f7ed(0x30d)](_0x50f7ed(0x1e7)+_0x9ccb90['projectId']),0x0;}}export function parseKeyValue(_0x4238fa){const _0x121e2e=a52_0x1a0e08,_0x33c08b=_0x4238fa[_0x121e2e(0x325)]('=');if(_0x33c08b===-0x1)throw new Error('Invalid\x20format:\x20'+_0x4238fa+_0x121e2e(0x2ed));const _0x44c9c7=_0x4238fa[_0x121e2e(0x2ad)](0x0,_0x33c08b),_0x530ec6=_0x4238fa[_0x121e2e(0x2ad)](_0x33c08b+0x1);if(!_0x44c9c7)throw new Error(_0x121e2e(0x1cd));return{'key':_0x44c9c7,'value':_0x530ec6};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x2d3);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x1d2);async['execute'](_0x495b9b){const _0x41dbbc=a52_0x1a0e08,{options:_0x3ab648,args:_0x1e6ef4,tdx:_0x583405}=_0x495b9b,_0x265bfb=this['requireProject'](_0x1e6ef4,_0x3ab648);if(!_0x265bfb)return 0x1;_0x3ab648['verbose']&&console[_0x41dbbc(0x30d)]('Project:\x20'+_0x265bfb);const _0xd7d9c0=await withSpinner(_0x41dbbc(0x2b0),()=>_0x583405[_0x41dbbc(0x246)]['listSecrets'](_0x265bfb),{'verbose':_0x3ab648[_0x41dbbc(0x258)]}),{secrets:_0x49b584}=_0xd7d9c0[_0x41dbbc(0x224)];return console[_0x41dbbc(0x30d)](_0x41dbbc(0x27f)+_0x49b584[_0x41dbbc(0x2ab)]+'\x20secret'+(_0x49b584[_0x41dbbc(0x2ab)]!==0x1?'s':'')),await handleSDKOutput(_0x49b584,_0x3ab648),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a52_0x1a0e08(0x29d);['description']=a52_0x1a0e08(0x32e);async[a52_0x1a0e08(0x2fc)](_0x1a4fb9){const _0x54d7c5=a52_0x1a0e08,{options:_0x4cbe0,args:_0x4e635e,tdx:_0x21f569}=_0x1a4fb9;let _0x14911e,_0x294472;if(_0x4e635e[_0x54d7c5(0x2ab)]>=0x1&&!_0x4e635e[0x0]['includes']('='))_0x14911e=_0x4e635e[0x0],_0x294472=_0x4e635e[_0x54d7c5(0x34f)](0x1);else{if(_0x4e635e['length']>=0x1&&_0x4cbe0[_0x54d7c5(0x1e8)])_0x14911e=_0x4cbe0[_0x54d7c5(0x1e8)],_0x294472=_0x4e635e;else return _0x4e635e['length']>=0x1?(console[_0x54d7c5(0x30d)](_0x54d7c5(0x1eb)),console['error'](_0x54d7c5(0x240)),0x1):(console[_0x54d7c5(0x30d)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error'](_0x54d7c5(0x276)),0x1);}if(_0x294472[_0x54d7c5(0x2ab)]===0x0)return console[_0x54d7c5(0x30d)](_0x54d7c5(0x1be)),console['error'](_0x54d7c5(0x276)),0x1;const _0x3e8922={};try{for(const _0x4ad77c of _0x294472){const {key:_0x22e1c9,value:_0x5c573b}=parseKeyValue(_0x4ad77c);_0x3e8922[_0x22e1c9]=_0x5c573b;}}catch(_0x53ac99){return _0x53ac99 instanceof Error&&console[_0x54d7c5(0x30d)](a52_0x3e3b2b[_0x54d7c5(0x2e4)](_0x54d7c5(0x227)),_0x53ac99[_0x54d7c5(0x271)]),0x1;}const _0x12f0ea=Object[_0x54d7c5(0x1cb)](_0x3e8922);_0x4cbe0['verbose']&&(console['error']('Project:\x20'+_0x14911e),console[_0x54d7c5(0x30d)](_0x54d7c5(0x330)+_0x12f0ea[_0x54d7c5(0x25a)](',\x20')));const _0x23c5ae=await withSpinner(_0x12f0ea['length']===0x1?_0x54d7c5(0x23f):_0x54d7c5(0x228)+_0x12f0ea[_0x54d7c5(0x2ab)]+_0x54d7c5(0x32d),()=>_0x21f569['workflow'][_0x54d7c5(0x1dc)](_0x14911e,_0x3e8922),{'verbose':_0x4cbe0['verbose']}),_0x239e6c=_0x23c5ae[_0x54d7c5(0x224)];return console['error'](_0x12f0ea['length']===0x1?_0x54d7c5(0x25b)+_0x239e6c[_0x54d7c5(0x1cb)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x239e6c[_0x54d7c5(0x2ba)]+'\x27':'✔\x20'+_0x239e6c['keys']['length']+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x239e6c['projectName']+'\x27'),(_0x4cbe0[_0x54d7c5(0x309)]||_0x4cbe0['jsonl'])&&await handleSingleObjectOutput(_0x239e6c,_0x4cbe0),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']='workflow:secrets:delete';[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x214);async[a52_0x1a0e08(0x2fc)](_0x3a7395){const _0x201eda=a52_0x1a0e08,{options:_0x24ed77,args:_0x19a8d9,tdx:_0x43fc3c}=_0x3a7395;let _0x57ddb5,_0x583fbc;if(_0x19a8d9[_0x201eda(0x2ab)]>=0x2)_0x57ddb5=_0x19a8d9[0x0],_0x583fbc=_0x19a8d9[0x1];else{if(_0x19a8d9[_0x201eda(0x2ab)]===0x1&&_0x24ed77['workflowProject'])_0x57ddb5=_0x24ed77[_0x201eda(0x1e8)],_0x583fbc=_0x19a8d9[0x0];else return _0x19a8d9['length']===0x1?(console[_0x201eda(0x30d)](_0x201eda(0x1eb)),console[_0x201eda(0x30d)](_0x201eda(0x240)),0x1):(console[_0x201eda(0x30d)](_0x201eda(0x1dd)),console[_0x201eda(0x30d)](_0x201eda(0x289)),0x1);}_0x24ed77[_0x201eda(0x258)]&&(console[_0x201eda(0x30d)]('Project:\x20'+_0x57ddb5),console[_0x201eda(0x30d)]('Key:\x20'+_0x583fbc));if(!_0x24ed77[_0x201eda(0x27c)]){if(!isInteractive())return console[_0x201eda(0x30d)](a52_0x3e3b2b[_0x201eda(0x2e4)](_0x201eda(0x319)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x201eda(0x30d)](a52_0x3e3b2b[_0x201eda(0x204)](_0x201eda(0x24c))),0x1;const _0x44fa7c=await confirmKey(_0x201eda(0x218)+_0x583fbc+_0x201eda(0x2b6)+_0x57ddb5+'\x27?');if(!_0x44fa7c)return console[_0x201eda(0x30d)](a52_0x3e3b2b[_0x201eda(0x310)](_0x201eda(0x288))),0x1;}const _0x1659d7=await withSpinner(_0x201eda(0x341),()=>_0x43fc3c[_0x201eda(0x246)][_0x201eda(0x23b)](_0x57ddb5,_0x583fbc),{'verbose':_0x24ed77[_0x201eda(0x258)]}),_0x494da0=_0x1659d7[_0x201eda(0x224)];return console['error'](_0x201eda(0x25b)+_0x494da0[_0x201eda(0x2de)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x494da0[_0x201eda(0x2ba)]+'\x27'),(_0x24ed77[_0x201eda(0x309)]||_0x24ed77[_0x201eda(0x232)])&&await handleSingleObjectOutput(_0x494da0,_0x24ed77),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(_0x829671){const _0x4f3714=a52_0x1a0e08,_0x5d7850=Math[_0x4f3714(0x26f)](_0x829671/0x3e8),_0x44d93c=Math['floor'](_0x5d7850/0x3c),_0x3b4dc9=Math[_0x4f3714(0x26f)](_0x44d93c/0x3c),_0x52f4e8=Math['floor'](_0x3b4dc9/0x18);if(_0x52f4e8>0x0){const _0x3c3da7=_0x3b4dc9%0x18;return _0x3c3da7>0x0?_0x52f4e8+'d\x20'+_0x3c3da7+'h':_0x52f4e8+'d';}else{if(_0x3b4dc9>0x0){const _0x4fafa1=_0x44d93c%0x3c;return _0x4fafa1>0x0?_0x3b4dc9+'h\x20'+_0x4fafa1+'m':_0x3b4dc9+'h';}else{if(_0x44d93c>0x0){const _0x530df0=_0x5d7850%0x3c;return _0x530df0>0x0?_0x44d93c+'m\x20'+_0x530df0+'s':_0x44d93c+'m';}else return _0x5d7850+'s';}}}function formatTimestamp(_0x5f23d9,_0x3a7b86){const _0x51d892=a52_0x1a0e08,_0x33b9bd=new Date(_0x5f23d9),_0x55f74f=String(_0x33b9bd[_0x51d892(0x254)]())[_0x51d892(0x2fa)](0x2,'0'),_0xe2f62e=String(_0x33b9bd['getMinutes']())['padStart'](0x2,'0'),_0x4eca1a=_0x55f74f+':'+_0xe2f62e,_0x4ce462=_0x33b9bd[_0x51d892(0x2df)]()===_0x3a7b86[_0x51d892(0x2df)]()&&_0x33b9bd['getMonth']()===_0x3a7b86[_0x51d892(0x256)]()&&_0x33b9bd[_0x51d892(0x2a3)]()===_0x3a7b86[_0x51d892(0x2a3)]();if(_0x4ce462)return _0x4eca1a;else{const _0x188e0c=String(_0x33b9bd[_0x51d892(0x256)]()+0x1)[_0x51d892(0x2fa)](0x2,'0'),_0x75a442=String(_0x33b9bd[_0x51d892(0x2a3)]())['padStart'](0x2,'0');return _0x188e0c+'-'+_0x75a442+'\x20'+_0x4eca1a;}}function formatDate(_0x389b13){const _0x4c637e=a52_0x1a0e08,_0x5f0a21=_0x389b13['getFullYear'](),_0x2236d0=String(_0x389b13[_0x4c637e(0x256)]()+0x1)[_0x4c637e(0x2fa)](0x2,'0'),_0x7a3f77=String(_0x389b13[_0x4c637e(0x2a3)]())[_0x4c637e(0x2fa)](0x2,'0');return _0x5f0a21+'-'+_0x2236d0+'-'+_0x7a3f77;}function getTaskStateIcon(_0x28d578){const _0x4686a2={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4686a2[_0x28d578]||'⚪';}function getBarChar(_0xd12a54){const _0x53f4c2=a52_0x1a0e08;return _0xd12a54==='error'||_0xd12a54===_0x53f4c2(0x30e)?'×':'─';}function getBarColor(_0x5bcc7b){const _0x3bd764=a52_0x1a0e08,_0x232e04={'success':a52_0x3e3b2b['green'],'error':a52_0x3e3b2b[_0x3bd764(0x2e4)],'group_error':a52_0x3e3b2b[_0x3bd764(0x2e4)],'running':a52_0x3e3b2b[_0x3bd764(0x333)],'blocked':a52_0x3e3b2b['yellow'],'planned':a52_0x3e3b2b[_0x3bd764(0x204)],'canceling':a52_0x3e3b2b[_0x3bd764(0x310)]};return _0x232e04[_0x5bcc7b]||a52_0x3e3b2b[_0x3bd764(0x244)];}function parseTaskName(_0x570bc3){const _0x2e628f=a52_0x1a0e08;let _0x51bc80=_0x570bc3[_0x2e628f(0x257)](/^\++/,'');const _0x3db043=_0x51bc80['split']('+'),_0x30ac95=_0x3db043[_0x2e628f(0x2ab)]>0x1?_0x3db043[_0x2e628f(0x2ab)]-0x2:0x0,_0x3fcfe7=_0x3db043[_0x3db043['length']-0x1]||_0x51bc80;return{'level':_0x30ac95,'name':'+'+_0x3fcfe7};}function truncateTaskName(_0x304775,_0xaf60cf){const _0x3ee500=a52_0x1a0e08,_0x3f0952=stringWidth(_0x304775);if(_0x3f0952<=_0xaf60cf)return _0x304775;let _0x3022b1=_0x304775;while(stringWidth(_0x3022b1+'…')>_0xaf60cf&&_0x3022b1[_0x3ee500(0x2ab)]>0x0){_0x3022b1=_0x3022b1[_0x3ee500(0x34f)](0x0,-0x1);}return _0x3022b1+'…';}function calculateTimeScale(_0xba7eb1,_0x12883a){const _0x3cf3ba=a52_0x1a0e08;return{'startTime':_0xba7eb1['start'],'endTime':_0xba7eb1[_0x3cf3ba(0x2d1)],'durationMs':_0xba7eb1[_0x3cf3ba(0x1d9)],'msPerChar':_0xba7eb1['duration']/_0x12883a};}function timeToPosition(_0x53b9a2,_0x13206d,_0x448156){const _0x38f075=a52_0x1a0e08,_0x3a77e9=_0x53b9a2-_0x13206d[_0x38f075(0x23a)],_0x2445b3=Math[_0x38f075(0x26f)](_0x3a77e9/_0x13206d[_0x38f075(0x207)]);return Math['max'](0x0,Math['min'](_0x2445b3,_0x448156));}function renderTimeAxis(_0x3a2697,_0x582b6b){const _0x34d8ef=a52_0x1a0e08,_0x389b1c=Math[_0x34d8ef(0x2ea)](TIMELINE_CONFIG[_0x34d8ef(0x291)],Math[_0x34d8ef(0x334)](TIMELINE_CONFIG[_0x34d8ef(0x28d)],Math['floor'](_0x582b6b/TIMELINE_CONFIG[_0x34d8ef(0x2be)]))),_0x3a37cb=_0x3a2697[_0x34d8ef(0x26e)]/(_0x389b1c-0x1),_0xc7211c=new Date(_0x3a2697[_0x34d8ef(0x23a)]),_0xfa4965=[];for(let _0x5022ee=0x0;_0x5022ee<_0x389b1c;_0x5022ee++){const _0x578ecc=_0x3a2697[_0x34d8ef(0x23a)]+_0x5022ee*_0x3a37cb,_0x208ca2=timeToPosition(_0x578ecc,_0x3a2697,_0x582b6b),_0x2b5869=formatTimestamp(_0x578ecc,_0xc7211c);_0xfa4965['push']({'pos':_0x208ca2,'text':_0x2b5869});}const _0xcf2c50=new Array(_0x582b6b)['fill']('\x20');let _0x26a47e=-0x1;for(const {pos:_0x25f910,text:_0x5e2df4}of _0xfa4965){let _0x4bd271=Math[_0x34d8ef(0x334)](0x0,_0x25f910-Math[_0x34d8ef(0x26f)](_0x5e2df4[_0x34d8ef(0x2ab)]/0x2));_0x4bd271<=_0x26a47e+TIMELINE_CONFIG[_0x34d8ef(0x203)]&&(_0x4bd271=_0x26a47e+TIMELINE_CONFIG[_0x34d8ef(0x203)]+0x1);_0x4bd271+_0x5e2df4[_0x34d8ef(0x2ab)]>_0x582b6b&&(_0x4bd271=_0x582b6b-_0x5e2df4['length']);if(_0x4bd271>=0x0&&_0x4bd271+_0x5e2df4['length']<=_0x582b6b&&_0x4bd271>_0x26a47e){for(let _0xf173b6=0x0;_0xf173b6<_0x5e2df4['length'];_0xf173b6++){_0xcf2c50[_0x4bd271+_0xf173b6]=_0x5e2df4[_0xf173b6];}_0x26a47e=_0x4bd271+_0x5e2df4[_0x34d8ef(0x2ab)]-0x1;}}return _0xcf2c50[_0x34d8ef(0x25a)]('');}function renderTaskRow(_0x2af108,_0x18c750,_0x1776b8,_0x443366){const _0x334a25=a52_0x1a0e08,{level:_0x406ff7,name:_0x5421a6}=parseTaskName(_0x2af108[_0x334a25(0x1cf)]),_0x2025e0='\x20'['repeat'](_0x406ff7),_0x3e2e92=_0x2af108[_0x334a25(0x349)]?'('+formatElapsed(_0x2af108['window'][_0x334a25(0x1d9)])+')':'',_0x397251=stringWidth(_0x3e2e92),_0x48c134=_0x406ff7*0x1,_0x5d9ad7=_0x443366-_0x48c134-_0x397251-0x1,_0x40bb23=truncateTaskName(_0x5421a6,_0x5d9ad7),_0x1fed5e=_0x2025e0+_0x40bb23,_0x322a39=stringWidth(_0x1fed5e),_0x30cec2=_0x443366-_0x322a39-_0x397251,_0x15d72a=_0x1fed5e+'\x20'[_0x334a25(0x2bf)](Math[_0x334a25(0x334)](0x1,_0x30cec2))+a52_0x3e3b2b['dim'](_0x3e2e92),_0x3f2da7=getTaskStateIcon(_0x2af108['state']),_0xc69145=new Array(_0x1776b8)[_0x334a25(0x2a5)]('\x20');if(_0x2af108[_0x334a25(0x349)]){const _0xe5484c=timeToPosition(_0x2af108[_0x334a25(0x349)][_0x334a25(0x25e)],_0x18c750,_0x1776b8),_0x1c43bc=timeToPosition(_0x2af108[_0x334a25(0x349)][_0x334a25(0x2d1)],_0x18c750,_0x1776b8),_0x390d9c=getBarChar(_0x2af108[_0x334a25(0x1f4)]),_0x6536a=Math[_0x334a25(0x334)](_0xe5484c+0x1,_0x1c43bc);for(let _0x481ceb=_0xe5484c;_0x481ceb<Math[_0x334a25(0x2ea)](_0x6536a,_0x1776b8);_0x481ceb++){_0xc69145[_0x481ceb]=_0x390d9c;}}const _0x5aa185=getBarColor(_0x2af108[_0x334a25(0x1f4)]),_0x57ff9a=_0xc69145[_0x334a25(0x2e0)](_0x12fb4f=>_0x12fb4f==='\x20'?'\x20':_0x5aa185(_0x12fb4f))[_0x334a25(0x25a)]('');return _0x3f2da7+'\x20'+_0x15d72a+'│'+_0x57ff9a+'│';}function calculateStats(_0x1d5b85){const _0x1475ea=a52_0x1a0e08,_0x531ee8={'total':_0x1d5b85[_0x1475ea(0x2ab)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x315d72 of _0x1d5b85){if(_0x315d72['state']===_0x1475ea(0x305))_0x531ee8[_0x1475ea(0x305)]++;else{if(_0x315d72[_0x1475ea(0x1f4)]===_0x1475ea(0x30d)||_0x315d72['state']===_0x1475ea(0x30e))_0x531ee8['error']++;else _0x315d72[_0x1475ea(0x1f4)]===_0x1475ea(0x205)?_0x531ee8[_0x1475ea(0x205)]++:_0x531ee8[_0x1475ea(0x201)]++;}}return _0x531ee8;}function formatStats(_0x3c897e){const _0x1def81=a52_0x1a0e08;return['Total:\x20'+_0x3c897e['total'],'✅\x20'+_0x3c897e[_0x1def81(0x305)],'❌\x20'+_0x3c897e[_0x1def81(0x30d)],_0x1def81(0x2ae)+_0x3c897e[_0x1def81(0x205)],'⏳\x20'+_0x3c897e[_0x1def81(0x201)]][_0x1def81(0x25a)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a52_0x1a0e08(0x1cf)]=a52_0x1a0e08(0x2f7);[a52_0x1a0e08(0x331)]=a52_0x1a0e08(0x1ea);async[a52_0x1a0e08(0x2fc)](_0x3cb643){const _0x3d0900=a52_0x1a0e08,{options:_0x5ae634,args:_0xd99c69,tdx:_0x50709c}=_0x3cb643;let _0x387a29,_0x44dab4,_0x265206=![];if(_0xd99c69[0x0]){if(_0xd99c69[0x0][_0x3d0900(0x31c)]('.')){const _0x385369=this['parseProjectWorkflowPattern'](_0xd99c69,_0x5ae634);if(!_0x385369)return 0x1;_0x387a29=_0x385369[_0x3d0900(0x2ba)],_0x44dab4=_0x385369['workflowName'];}else{_0x44dab4=_0xd99c69[0x0],_0x387a29=_0x5ae634[_0x3d0900(0x1e8)];if(!_0x387a29)return console['error'](a52_0x3e3b2b[_0x3d0900(0x2e4)]('Error:'),_0x3d0900(0x31e)),0x1;_0x265206=!![];}}else{const _0x7649f4=this[_0x3d0900(0x1f9)](_0xd99c69,_0x5ae634);if(!_0x7649f4)return 0x1;_0x387a29=_0x7649f4[_0x3d0900(0x2ba)],_0x44dab4=_0x7649f4['workflowName'];}if(_0x5ae634[_0x3d0900(0x258)]){if(_0x387a29&&_0x44dab4)console[_0x3d0900(0x30d)](_0x3d0900(0x2da)+_0x387a29+'.'+_0x44dab4);else _0x387a29&&console['error'](_0x3d0900(0x260)+_0x387a29);}const _0x3c000a=_0x5ae634[_0x3d0900(0x241)],_0x3da860=_0x5ae634['sessionId'];if(_0x3c000a){_0x3da860&&console['error'](a52_0x3e3b2b[_0x3d0900(0x310)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x34383b=_0x5ae634[_0x3d0900(0x210)];return _0x34383b?await this[_0x3d0900(0x1f5)](_0x3cb643,_0x3c000a):await this['renderSingleTimeline'](_0x3cb643,_0x3c000a,_0x5ae634),0x0;}if(_0x3da860){const _0x4a7910=await withSpinner('Loading\x20session...',()=>_0x50709c['workflow'][_0x3d0900(0x301)]({'projectName':_0x387a29,'workflowName':_0x44dab4,'limit':0x64}),{'verbose':_0x5ae634['verbose']}),_0x39698c=_0x4a7910['data'][_0x3d0900(0x2c8)](_0x39979a=>_0x39979a['id']===_0x3da860);if(!_0x39698c)return console[_0x3d0900(0x30d)](a52_0x3e3b2b[_0x3d0900(0x2e4)](_0x3d0900(0x227)),_0x3d0900(0x2a1)+_0x3da860),0x1;if(!_0x39698c[_0x3d0900(0x294)]?.['id'])return console['error'](a52_0x3e3b2b[_0x3d0900(0x2e4)]('Error:'),_0x3d0900(0x329)+_0x3da860+_0x3d0900(0x1fe)),0x1;const _0x51a075=_0x39698c[_0x3d0900(0x294)]['id'];_0x5ae634['verbose']&&console['error']('Using\x20attempt\x20'+_0x51a075+'\x20from\x20session\x20'+_0x3da860);const _0x1b2c4=_0x5ae634[_0x3d0900(0x210)];return _0x1b2c4?await this['pollTimeline'](_0x3cb643,_0x51a075):await this[_0x3d0900(0x287)](_0x3cb643,_0x51a075,_0x5ae634),0x0;}const _0xf6a69f=await withSpinner(_0x3d0900(0x2d5),()=>_0x50709c[_0x3d0900(0x246)]['sessions']({'projectName':_0x387a29,'workflowName':_0x44dab4,'limit':_0x5ae634['limit']||0x32}),{'verbose':_0x5ae634[_0x3d0900(0x258)]}),_0xbf7229=_0xf6a69f[_0x3d0900(0x224)];if(_0xbf7229[_0x3d0900(0x2ab)]===0x0){if(_0x387a29&&_0x44dab4)console[_0x3d0900(0x30d)]('No\x20sessions\x20found\x20for:\x20'+_0x387a29+'.'+_0x44dab4);else _0x387a29?console[_0x3d0900(0x30d)](_0x3d0900(0x2c2)+_0x387a29):(console[_0x3d0900(0x30d)](_0x3d0900(0x2d6)),console['error'](a52_0x3e3b2b[_0x3d0900(0x204)](_0x3d0900(0x357))));return 0x0;}_0xbf7229['sort']((_0x54b167,_0x5ec380)=>{const _0x566786=_0x3d0900,_0x14f04e=_0x54b167['sessionTime']||'',_0x55d8d3=_0x5ec380[_0x566786(0x292)]||'';return _0x55d8d3[_0x566786(0x31d)](_0x14f04e);});if(_0x5ae634[_0x3d0900(0x309)]||_0x5ae634[_0x3d0900(0x232)])return await handleSDKOutput(_0xbf7229,_0x5ae634),0x0;let _0x23f8b3;if(_0x265206){const _0xe62271=_0xbf7229[0x0];if(!_0xe62271[_0x3d0900(0x294)]?.['id'])return console[_0x3d0900(0x30d)](_0x3d0900(0x336)),0x0;_0x23f8b3=_0xe62271['lastAttempt']['id'],_0x5ae634['verbose']&&console[_0x3d0900(0x30d)](_0x3d0900(0x2b8)+_0xe62271[_0x3d0900(0x292)]);}else{const _0x29c820=_0xbf7229[_0x3d0900(0x2e0)](_0xc3067f=>{const _0x3b1983=_0x3d0900,_0x2300db=getAttemptStatusDisplay(_0xc3067f[_0x3b1983(0x294)]);return{'title':_0xc3067f['project']?.['name']+'.'+_0xc3067f['workflow']?.['name']+_0x3b1983(0x313)+_0xc3067f[_0x3b1983(0x292)]+'\x20'+_0x2300db[_0x3b1983(0x32c)],'value':_0xc3067f['lastAttempt']?.['id']||'','description':_0x2300db['text']};}),_0x177c32=await a52_0xfc59b7({'type':_0x3d0900(0x29f),'name':_0x3d0900(0x241),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x29c820[_0x3d0900(0x2e7)](_0xe8a379=>_0xe8a379[_0x3d0900(0x25d)]!=='')});if(!_0x177c32[_0x3d0900(0x241)])return 0x0;_0x23f8b3=_0x177c32[_0x3d0900(0x241)];}const _0x47deaa=_0x5ae634[_0x3d0900(0x210)];return _0x47deaa?await this[_0x3d0900(0x1f5)](_0x3cb643,_0x23f8b3):await this[_0x3d0900(0x287)](_0x3cb643,_0x23f8b3,_0x5ae634),0x0;}async[a52_0x1a0e08(0x287)](_0x4f1ff8,_0x22e290,_0x59adcc){const _0x5a39be=a52_0x1a0e08,{tdx:_0x595abd}=_0x4f1ff8;let _0x238fe5,_0x8678ae;try{[_0x238fe5,_0x8678ae]=await Promise['all']([_0x595abd[_0x5a39be(0x246)]['attempt'](_0x22e290),_0x595abd[_0x5a39be(0x246)][_0x5a39be(0x2f8)](_0x22e290,![])]);}catch(_0x5a8c99){console['error'](a52_0x3e3b2b[_0x5a39be(0x2e4)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x59adcc['verbose']&&console[_0x5a39be(0x30d)](_0x5a8c99);throw _0x5a8c99;}if(_0x59adcc['json']||_0x59adcc[_0x5a39be(0x232)]){const _0x14818f=this[_0x5a39be(0x236)](_0x238fe5,_0x8678ae);await handleSDKOutput([_0x14818f],_0x59adcc);return;}const _0x56f3c6=_0x595abd[_0x5a39be(0x303)]['site'],_0x2a045f=this[_0x5a39be(0x2b5)](_0x238fe5,_0x8678ae,_0x56f3c6);console['log'](_0x2a045f);}async[a52_0x1a0e08(0x1f5)](_0x3dcdb9,_0xc95660){const _0x41ed28=a52_0x1a0e08,{tdx:_0x1d38dd}=_0x3dcdb9,_0x391046=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x3c8555=TIMELINE_CONFIG[_0x41ed28(0x285)];let _0x221611=0x0;while(_0x221611<_0x3c8555){process[_0x41ed28(0x345)][_0x41ed28(0x2ee)]&&process[_0x41ed28(0x345)][_0x41ed28(0x25f)]('\x1bc');let _0x2f974d,_0x200f63;try{[_0x2f974d,_0x200f63]=await Promise[_0x41ed28(0x251)]([_0x1d38dd[_0x41ed28(0x246)][_0x41ed28(0x1d7)](_0xc95660),_0x1d38dd[_0x41ed28(0x246)]['tasks'](_0xc95660,![])]);}catch(_0x4b5b01){console[_0x41ed28(0x30d)](a52_0x3e3b2b[_0x41ed28(0x2e4)](_0x41ed28(0x2dc)));_0x221611>0x0&&console[_0x41ed28(0x30d)](a52_0x3e3b2b[_0x41ed28(0x204)](_0x41ed28(0x284)+_0x221611));throw _0x4b5b01;}const _0xcd273a=_0x1d38dd[_0x41ed28(0x303)][_0x41ed28(0x1c0)],_0x1ed89f=this[_0x41ed28(0x2b5)](_0x2f974d,_0x200f63,_0xcd273a);console[_0x41ed28(0x30c)](_0x1ed89f);const _0x20ff0e=_0x2f974d[_0x41ed28(0x23e)]&&_0x200f63[_0x41ed28(0x1c2)](_0x214ec3=>_0x214ec3['state']!==_0x41ed28(0x205)&&_0x214ec3['state']!==_0x41ed28(0x1ef));if(_0x20ff0e){console[_0x41ed28(0x30d)](a52_0x3e3b2b[_0x41ed28(0x1c1)](_0x41ed28(0x21e)));break;}console[_0x41ed28(0x30d)](a52_0x3e3b2b['dim'](_0x41ed28(0x2e2)+_0x221611*0x2+_0x41ed28(0x1ff))),await new Promise(_0x42f189=>setTimeout(_0x42f189,_0x391046)),_0x221611++;}_0x221611>=_0x3c8555&&console['error'](a52_0x3e3b2b[_0x41ed28(0x310)](_0x41ed28(0x29e)));}[a52_0x1a0e08(0x2b5)](_0x136f7f,_0x525f55,_0x29c3ee){const _0x5cf3e8=a52_0x1a0e08,_0x52114a=[],_0x4c6bb6=TIMELINE_CONFIG[_0x5cf3e8(0x2e3)],_0x59c590=0x5,_0x6158dc=process['stdout']['columns']||0x78,_0x5bd95c=_0x6158dc-_0x4c6bb6-_0x59c590,_0xb7ae4e=Math['max'](TIMELINE_CONFIG[_0x5cf3e8(0x318)],Math['min'](_0x5bd95c,TIMELINE_CONFIG[_0x5cf3e8(0x304)])),_0x7d2cf8=new Date(_0x136f7f[_0x5cf3e8(0x273)])[_0x5cf3e8(0x348)](),_0x1bd071=_0x136f7f[_0x5cf3e8(0x26a)]?new Date(_0x136f7f[_0x5cf3e8(0x26a)])[_0x5cf3e8(0x348)]():Date[_0x5cf3e8(0x248)](),_0x1fa20a={'start':_0x7d2cf8,'end':_0x1bd071,'duration':_0x1bd071-_0x7d2cf8},_0x45e42a=new Map(),_0x7f7efb=[];for(const _0x45a9ff of _0x525f55){if(_0x45a9ff['startedAt']){const _0x597aa0=new Date(_0x45a9ff[_0x5cf3e8(0x31b)])[_0x5cf3e8(0x348)](),_0x4dfb3b=_0x45a9ff[_0x5cf3e8(0x21d)]?new Date(_0x45a9ff['updatedAt'])[_0x5cf3e8(0x348)]():Date[_0x5cf3e8(0x248)](),_0xba662d={'start':_0x597aa0,'end':_0x4dfb3b,'duration':_0x4dfb3b-_0x597aa0};_0x45e42a[_0x5cf3e8(0x33b)](_0x45a9ff['id'],_0xba662d),_0x7f7efb[_0x5cf3e8(0x281)]({'name':_0x45a9ff['fullName'],'state':_0x45a9ff[_0x5cf3e8(0x1f4)]||_0x5cf3e8(0x35e),'window':_0xba662d});}else _0x7f7efb[_0x5cf3e8(0x281)]({'name':_0x45a9ff['fullName'],'state':_0x45a9ff[_0x5cf3e8(0x1f4)]||_0x5cf3e8(0x1ef),'window':undefined});}_0x7f7efb[_0x5cf3e8(0x1e6)]((_0x3b1f68,_0x2190ef)=>{const _0x2d893c=_0x5cf3e8;if(!_0x3b1f68[_0x2d893c(0x349)])return 0x1;if(!_0x2190ef[_0x2d893c(0x349)])return-0x1;return _0x3b1f68[_0x2d893c(0x349)][_0x2d893c(0x25e)]-_0x2190ef[_0x2d893c(0x349)][_0x2d893c(0x25e)];});const _0x33967b=_0x7f7efb['length'],_0x2ace89=_0x33967b>TIMELINE_CONFIG[_0x5cf3e8(0x1cc)];_0x2ace89&&_0x7f7efb['splice'](TIMELINE_CONFIG[_0x5cf3e8(0x1cc)]);const _0x35b5ad=calculateTimeScale(_0x1fa20a,_0xb7ae4e),_0x57376a=_0x136f7f[_0x5cf3e8(0x23e)]?_0x136f7f[_0x5cf3e8(0x305)]?a52_0x3e3b2b[_0x5cf3e8(0x1c1)](_0x5cf3e8(0x305)):a52_0x3e3b2b[_0x5cf3e8(0x2e4)](_0x5cf3e8(0x30d)):a52_0x3e3b2b[_0x5cf3e8(0x333)](_0x5cf3e8(0x205)),_0x44f18d=_0x136f7f[_0x5cf3e8(0x2ca)]?.['id'],_0x7a5b5f=_0x136f7f['sessionId'];let _0x553f78;if(_0x44f18d&&_0x7a5b5f){const _0x1594a3=getWorkflowAttemptUrl(_0x29c3ee,_0x44f18d,_0x7a5b5f,_0x136f7f['id']);_0x553f78=hyperlink(a52_0x3e3b2b[_0x5cf3e8(0x204)](_0x136f7f['id']),_0x1594a3);}else _0x553f78=a52_0x3e3b2b[_0x5cf3e8(0x204)](_0x136f7f['id']);_0x52114a[_0x5cf3e8(0x281)]('Attempt:\x20'+_0x553f78+_0x5cf3e8(0x313)+_0x57376a+'\x20-\x20'+formatElapsed(_0x1fa20a[_0x5cf3e8(0x1d9)]));if(_0x7f7efb[_0x5cf3e8(0x2ab)]>0x0){const _0x20fd47=renderTimeAxis(_0x35b5ad,_0xb7ae4e),_0x46cf09=new Date(_0x1fa20a[_0x5cf3e8(0x25e)]),_0x3e9c46=formatDate(_0x46cf09),_0x4f7218=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x5cf3e8(0x2b3)]+_0x4c6bb6,_0xa7c64b=_0x3e9c46['padStart'](_0x4f7218),_0xb0af87=a52_0x3e3b2b[_0x5cf3e8(0x204)](_0xa7c64b);_0x52114a[_0x5cf3e8(0x281)](_0xb0af87+'\x20'+_0x20fd47);for(const _0x1be89e of _0x7f7efb){_0x52114a[_0x5cf3e8(0x281)](renderTaskRow(_0x1be89e,_0x35b5ad,_0xb7ae4e,_0x4c6bb6));}const _0x499c71=calculateStats(_0x7f7efb);_0x52114a['push'](formatStats(_0x499c71)),_0x2ace89&&_0x52114a[_0x5cf3e8(0x281)](a52_0x3e3b2b['yellow'](_0x5cf3e8(0x29b)+TIMELINE_CONFIG[_0x5cf3e8(0x1cc)]+_0x5cf3e8(0x328)+_0x33967b+_0x5cf3e8(0x267))),_0x52114a[_0x5cf3e8(0x281)](''),_0x52114a[_0x5cf3e8(0x281)](a52_0x3e3b2b[_0x5cf3e8(0x204)](_0x5cf3e8(0x1fd))+(_0x5cf3e8(0x2ec)+_0x136f7f['id']+_0x5cf3e8(0x312))+a52_0x3e3b2b[_0x5cf3e8(0x204)](_0x5cf3e8(0x1c4)));}else _0x52114a[_0x5cf3e8(0x281)](_0x5cf3e8(0x1d5));return _0x52114a[_0x5cf3e8(0x25a)]('\x0a');}[a52_0x1a0e08(0x236)](_0x37ce39,_0x52f29a){const _0xc90384=a52_0x1a0e08,_0x2c8f2b=new Date(_0x37ce39[_0xc90384(0x273)])['getTime'](),_0x4c138=_0x37ce39[_0xc90384(0x26a)]?new Date(_0x37ce39[_0xc90384(0x26a)])[_0xc90384(0x348)]():Date[_0xc90384(0x248)](),_0x50e0f6=_0x4c138-_0x2c8f2b,_0xb17f41=[];for(const _0x20a340 of _0x52f29a){if(_0x20a340['startedAt']){const _0x191b91=new Date(_0x20a340[_0xc90384(0x31b)])[_0xc90384(0x348)](),_0x5de7d2=_0x20a340[_0xc90384(0x21d)]?new Date(_0x20a340[_0xc90384(0x21d)])['getTime']():Date[_0xc90384(0x248)]();_0xb17f41[_0xc90384(0x281)]({'name':_0x20a340['fullName'],'state':_0x20a340[_0xc90384(0x1f4)]||_0xc90384(0x35e),'window':{'start':_0x191b91,'end':_0x5de7d2,'duration':_0x5de7d2-_0x191b91}});}else _0xb17f41[_0xc90384(0x281)]({'name':_0x20a340[_0xc90384(0x2c0)],'state':_0x20a340['state']||_0xc90384(0x1ef),'window':undefined});}const _0x2bc487=calculateStats(_0xb17f41);return{'attempt':{'id':_0x37ce39['id'],'status':_0x37ce39['done']?_0x37ce39[_0xc90384(0x305)]?_0xc90384(0x305):_0xc90384(0x30d):_0xc90384(0x205),'createdAt':_0x37ce39[_0xc90384(0x273)],'finishedAt':_0x37ce39[_0xc90384(0x26a)],'duration_ms':_0x50e0f6},'tasks':_0xb17f41['map'](_0x21f2bc=>({'name':_0x21f2bc[_0xc90384(0x1cf)],'state':_0x21f2bc['state'],'startedAt':_0x21f2bc[_0xc90384(0x349)]?new Date(_0x21f2bc[_0xc90384(0x349)][_0xc90384(0x25e)])['toISOString']():null,'updatedAt':_0x21f2bc[_0xc90384(0x349)]?new Date(_0x21f2bc[_0xc90384(0x349)][_0xc90384(0x2d1)])[_0xc90384(0x1c9)]():null,'duration_ms':_0x21f2bc[_0xc90384(0x349)]?.['duration']||null})),'stats':_0x2bc487};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- function a53_0x2016(_0x701254,_0xa537ed){_0x701254=_0x701254-0x89;const _0x8ad862=a53_0x8ad8();let _0x2016eb=_0x8ad862[_0x701254];return _0x2016eb;}(function(_0x91cff1,_0x5b8e9b){const _0x811c5d=a53_0x2016,_0x323c16=_0x91cff1();while(!![]){try{const _0x5f1bf0=parseInt(_0x811c5d(0x91))/0x1+-parseInt(_0x811c5d(0x92))/0x2*(parseInt(_0x811c5d(0x99))/0x3)+-parseInt(_0x811c5d(0x97))/0x4+-parseInt(_0x811c5d(0x8a))/0x5+-parseInt(_0x811c5d(0x90))/0x6*(-parseInt(_0x811c5d(0x94))/0x7)+-parseInt(_0x811c5d(0x8d))/0x8+parseInt(_0x811c5d(0x93))/0x9;if(_0x5f1bf0===_0x5b8e9b)break;else _0x323c16['push'](_0x323c16['shift']());}catch(_0x4d4aeb){_0x323c16['push'](_0x323c16['shift']());}}}(a53_0x8ad8,0xeaaab));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a53_0x8ad8(){const _0x302494=['32osrbVf','48155733YuvtLz','70dIirYA','Authorization','entries','6465684ISqSJZ','tdx/','212916XobWsh','tdx','2451700hjUdtX','replace','TD1\x20','11661504sIBFMd','X-Trino-User','version','43986vxeKFX','237249CYMSYq'];a53_0x8ad8=function(){return _0x302494;};return a53_0x8ad8();}export function getUserAgent(){const _0x5d4691=a53_0x2016,_0xdf5848=getVersion(),_0x1dda2b=platform(),_0xa26602=process[_0x5d4691(0x8f)][_0x5d4691(0x8b)]('v','');return _0x5d4691(0x98)+_0xdf5848+'\x20('+_0x1dda2b+';\x20node/'+_0xa26602+')';}export function getAuthHeaders(_0x4ffa59,_0x3a9352,_0x101248){const _0x3f685b=a53_0x2016,_0x38746d=getVersion(),_0x1d93e8={'User-Agent':getUserAgent(),'X-TD-Client':_0x3f685b(0x89),'X-TD-Client-Version':_0x38746d};if(_0x101248)_0x1d93e8[_0x3f685b(0x95)]='Bearer\x20'+_0x101248;else _0x3a9352&&(_0x1d93e8[_0x3f685b(0x95)]=_0x3f685b(0x8c)+_0x3a9352);return _0x1d93e8;}export function toHeaderRecord(_0x23c304){const _0x5e6bb0=a53_0x2016,_0xb8e4e7={};for(const [_0x4c1e7d,_0x437969]of Object[_0x5e6bb0(0x96)](_0x23c304)){_0x437969!==undefined&&(_0xb8e4e7[_0x4c1e7d]=_0x437969);}return _0xb8e4e7;}export function getTrinoHeaders(_0x3c8676,_0x361df8,_0x3c4019){const _0x4a9125=a53_0x2016,_0x43fd5a=getAuthHeaders(_0x3c8676),_0x47e64c=toHeaderRecord(_0x43fd5a);if(_0x3c4019)_0x47e64c['Authorization']='Bearer\x20'+_0x3c4019;else _0x361df8&&(_0x47e64c[_0x4a9125(0x8e)]=_0x361df8);return _0x47e64c;}export function hasAPIKey(_0x556051){const _0x38d787=getAPIKey();return _0x38d787!==undefined&&_0x38d787['length']>0x0;}
1
+ (function(_0x35fa17,_0x2a1eb5){const _0x299867=a53_0x3788,_0x3b9bfa=_0x35fa17();while(!![]){try{const _0x284b0f=parseInt(_0x299867(0x151))/0x1+parseInt(_0x299867(0x150))/0x2+-parseInt(_0x299867(0x147))/0x3*(-parseInt(_0x299867(0x155))/0x4)+parseInt(_0x299867(0x153))/0x5+-parseInt(_0x299867(0x145))/0x6*(parseInt(_0x299867(0x142))/0x7)+parseInt(_0x299867(0x143))/0x8*(-parseInt(_0x299867(0x14f))/0x9)+-parseInt(_0x299867(0x14d))/0xa;if(_0x284b0f===_0x2a1eb5)break;else _0x3b9bfa['push'](_0x3b9bfa['shift']());}catch(_0x566b9e){_0x3b9bfa['push'](_0x3b9bfa['shift']());}}}(a53_0x58c9,0xc2f70));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 _0x5ceaea=a53_0x3788,_0x1a0236=getVersion(),_0x16bde5=platform(),_0x56096d=process[_0x5ceaea(0x14b)][_0x5ceaea(0x146)]('v','');return _0x5ceaea(0x14c)+_0x1a0236+'\x20('+_0x16bde5+_0x5ceaea(0x154)+_0x56096d+')';}export function getAuthHeaders(_0x1727b3,_0x268243,_0x51c80e){const _0x22876e=a53_0x3788,_0x4018f4=getVersion(),_0x3a23d3={'User-Agent':getUserAgent(),'X-TD-Client':_0x22876e(0x149),'X-TD-Client-Version':_0x4018f4};if(_0x51c80e)_0x3a23d3[_0x22876e(0x14a)]=_0x22876e(0x148)+_0x51c80e;else _0x268243&&(_0x3a23d3[_0x22876e(0x14a)]=_0x22876e(0x14e)+_0x268243);return _0x3a23d3;}function a53_0x3788(_0x30dbbe,_0x932d6d){_0x30dbbe=_0x30dbbe-0x141;const _0x58c98b=a53_0x58c9();let _0x3788b9=_0x58c98b[_0x30dbbe];return _0x3788b9;}export function toHeaderRecord(_0x23cf21){const _0x242dc9=a53_0x3788,_0x19a223={};for(const [_0x16798f,_0x566b16]of Object[_0x242dc9(0x152)](_0x23cf21)){_0x566b16!==undefined&&(_0x19a223[_0x16798f]=_0x566b16);}return _0x19a223;}export function getTrinoHeaders(_0x24b3a7,_0x1f662d,_0x2ef93f){const _0x181cfb=a53_0x3788,_0x1bc6c1=getAuthHeaders(_0x24b3a7),_0x5fd450=toHeaderRecord(_0x1bc6c1);if(_0x2ef93f)_0x5fd450[_0x181cfb(0x14a)]=_0x181cfb(0x148)+_0x2ef93f;else _0x1f662d&&(_0x5fd450[_0x181cfb(0x141)]=_0x1f662d);return _0x5fd450;}function a53_0x58c9(){const _0x52b02b=['tdx/','17616160RPcDFA','TD1\x20','802305cDzkRz','2123394ImBfqu','1251782bMsVMt','entries','7087665qkUkzG',';\x20node/','5097832eymXej','X-Trino-User','7756721ORMIOk','120gKDdfU','length','6QcZSAM','replace','3DyUwdy','Bearer\x20','tdx','Authorization','version'];a53_0x58c9=function(){return _0x52b02b;};return a53_0x58c9();}export function hasAPIKey(_0x78beec){const _0x245205=a53_0x3788,_0xeae6b9=getAPIKey();return _0xeae6b9!==undefined&&_0xeae6b9[_0x245205(0x144)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x207f4d,_0x54cd9b){const _0x577e1a=a54_0x2630,_0x26bcb3=_0x207f4d();while(!![]){try{const _0x3dd471=-parseInt(_0x577e1a(0x135))/0x1+parseInt(_0x577e1a(0x117))/0x2*(parseInt(_0x577e1a(0x109))/0x3)+-parseInt(_0x577e1a(0xfe))/0x4+-parseInt(_0x577e1a(0x113))/0x5*(parseInt(_0x577e1a(0x12b))/0x6)+parseInt(_0x577e1a(0x13f))/0x7+-parseInt(_0x577e1a(0x111))/0x8+parseInt(_0x577e1a(0x129))/0x9;if(_0x3dd471===_0x54cd9b)break;else _0x26bcb3['push'](_0x26bcb3['shift']());}catch(_0x3891e5){_0x26bcb3['push'](_0x26bcb3['shift']());}}}(a54_0x57fa,0x89fa6));import{writeFileSync}from'fs';import{spawn}from'child_process';function a54_0x57fa(){const _0xa956e3=['pipe','isInteger','filter','query','output','magenta','rule','json','color','map','tsv','11581965fujbTI','join','6IoKdIR','blue','red','isTTY','yellow','cmdout','inherit','repeat','string','spawn','871789wmpzdq','trim','debug','object','varchar','length','[params]','stderr','split','─┴─','6601196mVUdZY','forEach','sdk-result','close','[query]','params','less','cyan','1482452BUwJxa','No\x20data','stringify','list','jsonl','table','bigint','[rule]','limitStructuredFormats','isFinite','data','3EUSDzw','format','write','boolean','error','limit','padEnd','double','7963856bZhElQ','push','1308230NPTXdX','entries','end','max','1669550sZploP','[error]','[logs]','bold','stdin','-FXRSn','stdout'];a54_0x57fa=function(){return _0xa956e3;};return a54_0x57fa();}import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a54_0x113e18 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x49963e){const _0x448bb4=a54_0x2630;return _0x49963e[_0x448bb4(0x10a)]==='json'||_0x49963e['format']===_0x448bb4(0x102)||_0x49963e[_0x448bb4(0x10a)]===_0x448bb4(0x128)||_0x49963e['format']===_0x448bb4(0x103)||_0x49963e['json']===!![]||_0x49963e[_0x448bb4(0x102)]===!![]||_0x49963e[_0x448bb4(0x128)]===!![]||_0x49963e[_0x448bb4(0x103)]===!![];}export function parseOutputOptions(_0x509427){const _0x57962d=a54_0x2630;return{'format':_0x509427[_0x57962d(0x10a)]||_0x57962d(0x103),'output':_0x509427[_0x57962d(0x122)]||'','limit':_0x509427[_0x57962d(0x10e)],'limitStructuredFormats':_0x509427['limitStructuredFormats'],'color':_0x509427['color'],'noColor':_0x509427['noColor']};}function convertSDKResultToQueryResult(_0x218c70){const _0x17ef14=a54_0x2630,_0x1e6754=[];if(_0x218c70[_0x17ef14(0x13a)]>0x0){const _0x173869=_0x218c70[0x0];for(const [_0x4484fb,_0x34cc27]of Object['entries'](_0x173869)){let _0x327f45=_0x17ef14(0x139);if(typeof _0x34cc27==='number')_0x327f45=Number[_0x17ef14(0x11f)](_0x34cc27)?_0x17ef14(0x104):_0x17ef14(0x110);else{if(typeof _0x34cc27===_0x17ef14(0x10c))_0x327f45=_0x17ef14(0x10c);else _0x34cc27===null&&(_0x327f45=_0x17ef14(0x139));}_0x1e6754[_0x17ef14(0x112)]({'name':_0x4484fb,'type':_0x327f45});}}return{'queryId':_0x17ef14(0x141),'columns':_0x1e6754,'data':_0x218c70,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x218c70[_0x17ef14(0x13a)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3832e9,_0x3f6a04){const _0x3424f5=convertSDKResultToQueryResult(_0x3832e9);return formatQueryOutput(_0x3424f5,_0x3f6a04);}export async function formatQueryOutput(_0x37f89b,_0x5e1575){const _0x3873e5=a54_0x2630,{format:_0x1df409,limit:_0x45e768,output:_0x44b8b2,color:_0x1d2215,noColor:_0x12a0a7,limitStructuredFormats:_0x18180e}=_0x5e1575,_0x5b14e1=Boolean(_0x44b8b2)&&!_0x1d2215,_0x2034d9={'color':_0x1d2215,'noColor':_0x12a0a7||_0x5b14e1};if(_0x1df409===_0x3873e5(0x103)){const _0x1e5eb9=shouldUseLess(_0x1df409,_0x44b8b2);return formatAsTable(_0x37f89b,_0x45e768,_0x1e5eb9,_0x2034d9);}const _0x6d45f8=_0x18180e&&Number[_0x3873e5(0x107)](_0x45e768)&&_0x37f89b[_0x3873e5(0x108)]['length']>_0x45e768?{..._0x37f89b,'data':_0x37f89b[_0x3873e5(0x108)]['slice'](0x0,_0x45e768)}:_0x37f89b;if(_0x1df409===_0x3873e5(0x125))return formatAsJSON(_0x6d45f8,_0x2034d9);else return _0x1df409===_0x3873e5(0x102)?formatAsJSONL(_0x6d45f8,_0x2034d9):formatQueryResult(_0x6d45f8,_0x1df409);}function a54_0x2630(_0x38bbc0,_0x1464e7){_0x38bbc0=_0x38bbc0-0xfd;const _0x57fadb=a54_0x57fa();let _0x263039=_0x57fadb[_0x38bbc0];return _0x263039;}function shouldUseLess(_0x5e31f4,_0x476832){const _0x462664=a54_0x2630;return(_0x5e31f4===_0x462664(0x103)||_0x5e31f4===_0x462664(0x101))&&process[_0x462664(0x11d)][_0x462664(0x12e)]&&!_0x476832;}export function resolveOutputOptions(_0x395e0c){const _0x22dcc7=a54_0x2630,_0x1d0504=_0x395e0c[_0x22dcc7(0x122)]||'',_0x36bd03=resolveOutputFormat(_0x395e0c[_0x22dcc7(0x10a)],_0x1d0504,_0x22dcc7(0x103));let _0x5391b2=typeof _0x395e0c[_0x22dcc7(0x10e)]==='number'?_0x395e0c[_0x22dcc7(0x10e)]:parseInt(_0x395e0c[_0x22dcc7(0x10e)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x395e0c[_0x22dcc7(0x10e)]===undefined&&shouldUseLess(_0x36bd03,_0x1d0504)&&(_0x5391b2=Infinity),{'format':_0x36bd03,'output':_0x1d0504,'limit':_0x5391b2,'limitStructuredFormats':_0x395e0c[_0x22dcc7(0x106)],'color':_0x395e0c[_0x22dcc7(0x126)],'noColor':_0x395e0c['noColor']};}export function writeOutput(_0x39c946,_0x129e10,_0x13df78){return _0x129e10?(writeFileSync(_0x129e10,_0x39c946),console['error']('Results\x20saved\x20to\x20'+_0x129e10),Promise['resolve']()):shouldUseLess(_0x13df78||'','')?new Promise(_0x5b2ec6=>{const _0x18cd26=a54_0x2630,_0x514ea5=spawn(_0x18cd26(0x145),[_0x18cd26(0x11c)],{'stdio':[_0x18cd26(0x11e),_0x18cd26(0x131),_0x18cd26(0x131)]});let _0xdf3521=![];_0x514ea5['on'](_0x18cd26(0x10d),()=>{!_0xdf3521&&(_0xdf3521=!![],console['log'](_0x39c946),_0x5b2ec6());}),_0x514ea5['on'](_0x18cd26(0x142),()=>{!_0xdf3521&&(_0xdf3521=!![],_0x5b2ec6());}),_0x514ea5['on'](_0x18cd26(0x134),()=>{const _0x18a167=_0x18cd26;!_0xdf3521&&_0x514ea5[_0x18a167(0x11b)]&&(_0x514ea5['stdin']['on'](_0x18a167(0x10d),()=>{}),_0x514ea5[_0x18a167(0x11b)][_0x18a167(0x10b)](_0x39c946),_0x514ea5[_0x18a167(0x11b)][_0x18a167(0x115)]());}),!_0x514ea5[_0x18cd26(0x11b)]&&(!_0xdf3521&&(_0xdf3521=!![],console['log'](_0x39c946),_0x5b2ec6()));}):(console['log'](_0x39c946),Promise['resolve']());}export async function handleSDKOutput(_0x3a5732,_0x5d0193){const _0x1d32c8=a54_0x2630,_0x1449fd=resolveOutputOptions(_0x5d0193),_0x717b13=await formatSDKOutput(_0x3a5732,_0x1449fd);await writeOutput(_0x717b13,_0x1449fd[_0x1d32c8(0x122)]||undefined,_0x1449fd['format']);}export async function handleQueryOutput(_0x494120,_0x145a03){const _0x4be501=a54_0x2630,_0x37af72=resolveOutputOptions(_0x145a03),_0x547ee1=await formatQueryOutput(_0x494120,_0x37af72);await writeOutput(_0x547ee1,_0x37af72[_0x4be501(0x122)]||undefined,_0x37af72[_0x4be501(0x10a)]);}async function formatSingleObject(_0x424de5,_0x550416){const _0x11c102=a54_0x2630,{format:_0x4ef76b,color:_0x916ac,noColor:_0xc9acdf}=_0x550416,_0x15811b={'color':_0x916ac,'noColor':_0xc9acdf};if(_0x4ef76b===_0x11c102(0x125)){if(shouldUseColor(_0x15811b))return colorizeJSON(_0x424de5,_0x15811b);return JSON[_0x11c102(0x100)](_0x424de5,null,0x2);}else{if(_0x4ef76b===_0x11c102(0x102)){if(shouldUseColor(_0x15811b))return colorizeJSONCompact(_0x424de5,_0x15811b);return JSON[_0x11c102(0x100)](_0x424de5);}else{if(_0x4ef76b===_0x11c102(0x128))return Object[_0x11c102(0x114)](_0x424de5)[_0x11c102(0x127)](([_0x216c8e,_0x173334])=>_0x216c8e+'\x09'+_0x173334)[_0x11c102(0x12a)]('\x0a');else{const _0xd47c40=Object[_0x11c102(0x114)](_0x424de5);if(_0xd47c40[_0x11c102(0x13a)]===0x0)return _0x11c102(0xff);const _0x136255=_0x424de5['debug'],_0x26ed63=_0x424de5[_0x11c102(0x121)],_0x47cafd=_0x424de5[_0x11c102(0x144)],_0x40a3cf=_0x424de5[_0x11c102(0x124)],_0x108c05=_0x26ed63?typeof _0x26ed63===_0x11c102(0x133)?_0x26ed63:JSON[_0x11c102(0x100)](_0x26ed63,null,0x2):undefined,_0x2f9718=_0x47cafd&&Object['keys'](_0x47cafd)[_0x11c102(0x13a)]>0x0?JSON['stringify'](_0x47cafd,null,0x2):undefined,_0x321b6f=_0x40a3cf&&Object['keys'](_0x40a3cf)['length']>0x0?JSON[_0x11c102(0x100)](_0x40a3cf,null,0x2):undefined,_0xa945bf=_0xd47c40[_0x11c102(0x120)](([_0x20fbf9])=>_0x20fbf9!==_0x11c102(0x137)&&_0x20fbf9!==_0x11c102(0x121)&&_0x20fbf9!==_0x11c102(0x144)&&_0x20fbf9!=='rule'),_0x443f65=Math['max'](..._0xa945bf[_0x11c102(0x127)](([_0x511a5a])=>_0x511a5a['length'])),_0x5d04d8=Math[_0x11c102(0x116)](..._0xa945bf[_0x11c102(0x127)](([,_0x5ddd22])=>{const _0x305d63=_0x11c102;try{const _0x583d90=_0x5ddd22===null||_0x5ddd22===undefined?'':typeof _0x5ddd22==='object'?JSON[_0x305d63(0x100)](_0x5ddd22):String(_0x5ddd22),_0x26026a=_0x583d90[_0x305d63(0x13d)]('\x0a');return Math[_0x305d63(0x116)](..._0x26026a[_0x305d63(0x127)](_0x541b01=>_0x541b01['length']),0x0);}catch{return 0x0;}}),0x14),_0x2cc39e=[];_0x2cc39e[_0x11c102(0x112)](colorBorder('┌─'+'─'[_0x11c102(0x132)](_0x443f65)+'─┬─'+'─'[_0x11c102(0x132)](_0x5d04d8)+'─┐',_0x15811b)),_0xa945bf['forEach'](([_0xbf70e2,_0x3723ce])=>{const _0x19f64c=_0x11c102;let _0x240cf8;try{_0x240cf8=_0x3723ce===null||_0x3723ce===undefined?'':typeof _0x3723ce===_0x19f64c(0x138)?JSON[_0x19f64c(0x100)](_0x3723ce):String(_0x3723ce);}catch{_0x240cf8='[Object]';}const _0x5544a8=_0xbf70e2[_0x19f64c(0x10f)](_0x443f65),_0x2a9c61=_0x240cf8[_0x19f64c(0x13d)]('\x0a');_0x2a9c61['forEach']((_0x114472,_0x179bd1)=>{const _0x528a06=_0x19f64c,_0x457bf0=colorBorder('│',_0x15811b);_0x179bd1===0x0?_0x2cc39e[_0x528a06(0x112)](_0x457bf0+'\x20'+_0x5544a8+'\x20'+_0x457bf0+'\x20'+_0x114472[_0x528a06(0x10f)](_0x5d04d8)+'\x20'+_0x457bf0):_0x2cc39e['push'](_0x457bf0+'\x20'+'\x20'[_0x528a06(0x132)](_0x443f65)+'\x20'+_0x457bf0+'\x20'+_0x114472[_0x528a06(0x10f)](_0x5d04d8)+'\x20'+_0x457bf0);});}),_0x2cc39e[_0x11c102(0x112)](colorBorder('└─'+'─'['repeat'](_0x443f65)+_0x11c102(0x13e)+'─'['repeat'](_0x5d04d8)+'─┘',_0x15811b));_0x108c05&&(_0x2cc39e[_0x11c102(0x112)](''),_0x2cc39e[_0x11c102(0x112)](String(a54_0x113e18[_0x11c102(0x12f)][_0x11c102(0x11a)](_0x11c102(0x143)))),_0x2cc39e[_0x11c102(0x112)](_0x108c05));_0x2f9718&&(_0x2cc39e[_0x11c102(0x112)](''),_0x2cc39e[_0x11c102(0x112)](String(a54_0x113e18[_0x11c102(0x12c)][_0x11c102(0x11a)](_0x11c102(0x13b)))),_0x2cc39e[_0x11c102(0x112)](_0x2f9718));_0x321b6f&&(_0x2cc39e[_0x11c102(0x112)](''),_0x2cc39e['push'](String(a54_0x113e18[_0x11c102(0x123)][_0x11c102(0x11a)](_0x11c102(0x105)))),_0x2cc39e['push'](_0x321b6f));if(_0x136255){if(_0x136255[_0x11c102(0x13c)]){_0x2cc39e[_0x11c102(0x112)](''),_0x2cc39e[_0x11c102(0x112)](String(a54_0x113e18[_0x11c102(0x12d)][_0x11c102(0x11a)](_0x11c102(0x118))));const _0x5499d6=_0x136255[_0x11c102(0x13c)][_0x11c102(0x13d)]('\x0a');_0x5499d6['forEach'](_0x280ad4=>{const _0x10fdd1=_0x11c102;_0x280ad4[_0x10fdd1(0x136)]()&&_0x2cc39e[_0x10fdd1(0x112)](_0x280ad4);});}if(_0x136255[_0x11c102(0x130)]){_0x2cc39e[_0x11c102(0x112)](''),_0x2cc39e[_0x11c102(0x112)](String(a54_0x113e18[_0x11c102(0xfd)]['bold'](_0x11c102(0x119))));const _0x4eb34d=_0x136255['cmdout'][_0x11c102(0x13d)]('\x0a');_0x4eb34d[_0x11c102(0x140)](_0x51628a=>{const _0x4950be=_0x11c102;_0x51628a[_0x4950be(0x136)]()&&_0x2cc39e[_0x4950be(0x112)](_0x51628a);});}}return _0x2cc39e[_0x11c102(0x12a)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x415d5c,_0x3523d6){const _0x51bb71=a54_0x2630;if(_0x3523d6[_0x51bb71(0x10a)]==='table'){await handleSDKOutput([_0x415d5c],_0x3523d6);return;}const _0x561f1b=resolveOutputOptions(_0x3523d6),_0x5066ca=await formatSingleObject(_0x415d5c,_0x561f1b);await writeOutput(_0x5066ca,_0x561f1b[_0x51bb71(0x122)]||undefined,_0x561f1b[_0x51bb71(0x10a)]);}
1
+ (function(_0x2bda14,_0x897e42){const _0x48f452=a54_0x1d6e,_0x4e15fd=_0x2bda14();while(!![]){try{const _0x418305=-parseInt(_0x48f452(0x108))/0x1*(-parseInt(_0x48f452(0x11e))/0x2)+-parseInt(_0x48f452(0xeb))/0x3*(parseInt(_0x48f452(0xdc))/0x4)+-parseInt(_0x48f452(0x119))/0x5+parseInt(_0x48f452(0xe6))/0x6*(-parseInt(_0x48f452(0x124))/0x7)+-parseInt(_0x48f452(0xf1))/0x8*(-parseInt(_0x48f452(0x115))/0x9)+parseInt(_0x48f452(0xfe))/0xa+parseInt(_0x48f452(0xf7))/0xb*(parseInt(_0x48f452(0xda))/0xc);if(_0x418305===_0x897e42)break;else _0x4e15fd['push'](_0x4e15fd['shift']());}catch(_0x5f2013){_0x4e15fd['push'](_0x4e15fd['shift']());}}}(a54_0x2605,0xe343f));import{writeFileSync}from'fs';import{spawn}from'child_process';function a54_0x2605(){const _0x565ad2=['stderr','[error]','612031wlRGXD','string','36trRPXP','log','208368DTedYx','double','rule','isInteger','Results\x20saved\x20to\x20','params','limit','[query]','entries','slice','54TnlYYs','join','data','map','keys','90unkNPg','output','[Object]','query','limitStructuredFormats','table','11672viBFxx','isFinite','forEach','format','split','end','5037483XqNvvl','noColor','varchar','blue','tsv','error','padEnd','6885290kSXiZb','resolve','cmdout','trim','─┴─','-FXRSn','repeat','cyan','red','bold','1dvxuHD','spawn','magenta','stdin','close','isTTY','object','max','boolean','push','number','yellow','inherit','10125pyrvfM','write','jsonl','length','8394375xlzbLZ','debug','json','[rule]','bigint','2511296eligGk','sdk-result','stringify','pipe'];a54_0x2605=function(){return _0x565ad2;};return a54_0x2605();}import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a54_0xb3d840 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x4f0c31){const _0x36ae2f=a54_0x1d6e;return _0x4f0c31['format']===_0x36ae2f(0x11b)||_0x4f0c31[_0x36ae2f(0xf4)]===_0x36ae2f(0x117)||_0x4f0c31[_0x36ae2f(0xf4)]===_0x36ae2f(0xfb)||_0x4f0c31['format']===_0x36ae2f(0xf0)||_0x4f0c31[_0x36ae2f(0x11b)]===!![]||_0x4f0c31['jsonl']===!![]||_0x4f0c31[_0x36ae2f(0xfb)]===!![]||_0x4f0c31[_0x36ae2f(0xf0)]===!![];}export function parseOutputOptions(_0xfb0724){const _0x4c10f0=a54_0x1d6e;return{'format':_0xfb0724[_0x4c10f0(0xf4)]||_0x4c10f0(0xf0),'output':_0xfb0724[_0x4c10f0(0xec)]||'','limit':_0xfb0724[_0x4c10f0(0xe2)],'limitStructuredFormats':_0xfb0724[_0x4c10f0(0xef)],'color':_0xfb0724['color'],'noColor':_0xfb0724['noColor']};}function convertSDKResultToQueryResult(_0x17f459){const _0x1c4993=a54_0x1d6e,_0x1cf487=[];if(_0x17f459[_0x1c4993(0x118)]>0x0){const _0x5e655e=_0x17f459[0x0];for(const [_0x186f82,_0x55287c]of Object[_0x1c4993(0xe4)](_0x5e655e)){let _0x4219dc='varchar';if(typeof _0x55287c==='number')_0x4219dc=Number[_0x1c4993(0xdf)](_0x55287c)?_0x1c4993(0x11d):_0x1c4993(0xdd);else{if(typeof _0x55287c===_0x1c4993(0x110))_0x4219dc=_0x1c4993(0x110);else _0x55287c===null&&(_0x4219dc=_0x1c4993(0xf9));}_0x1cf487[_0x1c4993(0x111)]({'name':_0x186f82,'type':_0x4219dc});}}return{'queryId':_0x1c4993(0x11f),'columns':_0x1cf487,'data':_0x17f459,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x17f459[_0x1c4993(0x118)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x66be5a,_0x56737c){const _0x5df451=convertSDKResultToQueryResult(_0x66be5a);return formatQueryOutput(_0x5df451,_0x56737c);}function a54_0x1d6e(_0x59fa8d,_0x58fea0){_0x59fa8d=_0x59fa8d-0xd9;const _0x260523=a54_0x2605();let _0x1d6eb2=_0x260523[_0x59fa8d];return _0x1d6eb2;}export async function formatQueryOutput(_0x586415,_0x3b20dd){const _0x5a4e22=a54_0x1d6e,{format:_0x47a946,limit:_0x3d2adf,output:_0x49d5d9,color:_0x138dbe,noColor:_0x53a182,limitStructuredFormats:_0x514bfd}=_0x3b20dd,_0xb8975c=Boolean(_0x49d5d9)&&!_0x138dbe,_0x185a54={'color':_0x138dbe,'noColor':_0x53a182||_0xb8975c};if(_0x47a946===_0x5a4e22(0xf0)){const _0x2983a1=shouldUseLess(_0x47a946,_0x49d5d9);return formatAsTable(_0x586415,_0x3d2adf,_0x2983a1,_0x185a54);}const _0x6748b3=_0x514bfd&&Number[_0x5a4e22(0xf2)](_0x3d2adf)&&_0x586415[_0x5a4e22(0xe8)][_0x5a4e22(0x118)]>_0x3d2adf?{..._0x586415,'data':_0x586415[_0x5a4e22(0xe8)][_0x5a4e22(0xe5)](0x0,_0x3d2adf)}:_0x586415;if(_0x47a946==='json')return formatAsJSON(_0x6748b3,_0x185a54);else return _0x47a946===_0x5a4e22(0x117)?formatAsJSONL(_0x6748b3,_0x185a54):formatQueryResult(_0x6748b3,_0x47a946);}function shouldUseLess(_0x97c077,_0x3ec564){const _0x5aab39=a54_0x1d6e;return(_0x97c077===_0x5aab39(0xf0)||_0x97c077==='list')&&process['stdout'][_0x5aab39(0x10d)]&&!_0x3ec564;}export function resolveOutputOptions(_0x2bfb2a){const _0x5be918=a54_0x1d6e,_0x4eb230=_0x2bfb2a[_0x5be918(0xec)]||'',_0x44ee57=resolveOutputFormat(_0x2bfb2a[_0x5be918(0xf4)],_0x4eb230,'table');let _0x449f8a=typeof _0x2bfb2a['limit']===_0x5be918(0x112)?_0x2bfb2a[_0x5be918(0xe2)]:parseInt(_0x2bfb2a[_0x5be918(0xe2)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x2bfb2a['limit']===undefined&&shouldUseLess(_0x44ee57,_0x4eb230)&&(_0x449f8a=Infinity),{'format':_0x44ee57,'output':_0x4eb230,'limit':_0x449f8a,'limitStructuredFormats':_0x2bfb2a[_0x5be918(0xef)],'color':_0x2bfb2a['color'],'noColor':_0x2bfb2a[_0x5be918(0xf8)]};}export function writeOutput(_0x5273fd,_0x2ab1f1,_0x58cdd9){const _0x209f7c=a54_0x1d6e;return _0x2ab1f1?(writeFileSync(_0x2ab1f1,_0x5273fd),console['error'](_0x209f7c(0xe0)+_0x2ab1f1),Promise[_0x209f7c(0xff)]()):shouldUseLess(_0x58cdd9||'','')?new Promise(_0x109548=>{const _0x1673b7=_0x209f7c,_0x454e85=spawn('less',[_0x1673b7(0x103)],{'stdio':[_0x1673b7(0x121),'inherit',_0x1673b7(0x114)]});let _0x5b597f=![];_0x454e85['on'](_0x1673b7(0xfc),()=>{const _0x1b5b4d=_0x1673b7;!_0x5b597f&&(_0x5b597f=!![],console[_0x1b5b4d(0xdb)](_0x5273fd),_0x109548());}),_0x454e85['on'](_0x1673b7(0x10c),()=>{!_0x5b597f&&(_0x5b597f=!![],_0x109548());}),_0x454e85['on'](_0x1673b7(0x109),()=>{const _0x1d2888=_0x1673b7;!_0x5b597f&&_0x454e85['stdin']&&(_0x454e85[_0x1d2888(0x10b)]['on'](_0x1d2888(0xfc),()=>{}),_0x454e85[_0x1d2888(0x10b)][_0x1d2888(0x116)](_0x5273fd),_0x454e85[_0x1d2888(0x10b)][_0x1d2888(0xf6)]());}),!_0x454e85[_0x1673b7(0x10b)]&&(!_0x5b597f&&(_0x5b597f=!![],console[_0x1673b7(0xdb)](_0x5273fd),_0x109548()));}):(console[_0x209f7c(0xdb)](_0x5273fd),Promise[_0x209f7c(0xff)]());}export async function handleSDKOutput(_0x563aba,_0x1dce68){const _0x45091c=a54_0x1d6e,_0x8657f7=resolveOutputOptions(_0x1dce68),_0x1959f2=await formatSDKOutput(_0x563aba,_0x8657f7);await writeOutput(_0x1959f2,_0x8657f7[_0x45091c(0xec)]||undefined,_0x8657f7['format']);}export async function handleQueryOutput(_0x2cc60a,_0x84633d){const _0x1aab4c=a54_0x1d6e,_0x439e67=resolveOutputOptions(_0x84633d),_0x3301cd=await formatQueryOutput(_0x2cc60a,_0x439e67);await writeOutput(_0x3301cd,_0x439e67[_0x1aab4c(0xec)]||undefined,_0x439e67['format']);}async function formatSingleObject(_0x3c2fc9,_0x2c8b2a){const _0x1a3a6f=a54_0x1d6e,{format:_0x4f0bba,color:_0x5bfb5d,noColor:_0x5e0515}=_0x2c8b2a,_0x59f4e2={'color':_0x5bfb5d,'noColor':_0x5e0515};if(_0x4f0bba===_0x1a3a6f(0x11b)){if(shouldUseColor(_0x59f4e2))return colorizeJSON(_0x3c2fc9,_0x59f4e2);return JSON[_0x1a3a6f(0x120)](_0x3c2fc9,null,0x2);}else{if(_0x4f0bba===_0x1a3a6f(0x117)){if(shouldUseColor(_0x59f4e2))return colorizeJSONCompact(_0x3c2fc9,_0x59f4e2);return JSON['stringify'](_0x3c2fc9);}else{if(_0x4f0bba==='tsv')return Object[_0x1a3a6f(0xe4)](_0x3c2fc9)[_0x1a3a6f(0xe9)](([_0x284386,_0x106a06])=>_0x284386+'\x09'+_0x106a06)[_0x1a3a6f(0xe7)]('\x0a');else{const _0x283dad=Object[_0x1a3a6f(0xe4)](_0x3c2fc9);if(_0x283dad[_0x1a3a6f(0x118)]===0x0)return'No\x20data';const _0x59730f=_0x3c2fc9[_0x1a3a6f(0x11a)],_0x4e6882=_0x3c2fc9[_0x1a3a6f(0xee)],_0x181855=_0x3c2fc9[_0x1a3a6f(0xe1)],_0x1ab896=_0x3c2fc9[_0x1a3a6f(0xde)],_0x242486=_0x4e6882?typeof _0x4e6882===_0x1a3a6f(0xd9)?_0x4e6882:JSON['stringify'](_0x4e6882,null,0x2):undefined,_0x4c5009=_0x181855&&Object['keys'](_0x181855)[_0x1a3a6f(0x118)]>0x0?JSON[_0x1a3a6f(0x120)](_0x181855,null,0x2):undefined,_0x378630=_0x1ab896&&Object[_0x1a3a6f(0xea)](_0x1ab896)['length']>0x0?JSON['stringify'](_0x1ab896,null,0x2):undefined,_0x5431e9=_0x283dad['filter'](([_0x7aad90])=>_0x7aad90!==_0x1a3a6f(0x11a)&&_0x7aad90!==_0x1a3a6f(0xee)&&_0x7aad90!==_0x1a3a6f(0xe1)&&_0x7aad90!==_0x1a3a6f(0xde)),_0x3176fe=Math[_0x1a3a6f(0x10f)](..._0x5431e9['map'](([_0x46a88f])=>_0x46a88f[_0x1a3a6f(0x118)])),_0x4007b0=Math['max'](..._0x5431e9[_0x1a3a6f(0xe9)](([,_0x2c2641])=>{const _0x41155a=_0x1a3a6f;try{const _0x498bb0=_0x2c2641===null||_0x2c2641===undefined?'':typeof _0x2c2641===_0x41155a(0x10e)?JSON[_0x41155a(0x120)](_0x2c2641):String(_0x2c2641),_0x48d9e9=_0x498bb0[_0x41155a(0xf5)]('\x0a');return Math[_0x41155a(0x10f)](..._0x48d9e9[_0x41155a(0xe9)](_0x46a054=>_0x46a054[_0x41155a(0x118)]),0x0);}catch{return 0x0;}}),0x14),_0x10b019=[];_0x10b019[_0x1a3a6f(0x111)](colorBorder('┌─'+'─'['repeat'](_0x3176fe)+'─┬─'+'─'['repeat'](_0x4007b0)+'─┐',_0x59f4e2)),_0x5431e9[_0x1a3a6f(0xf3)](([_0x45f96e,_0x5656db])=>{const _0x283a72=_0x1a3a6f;let _0x3b8380;try{_0x3b8380=_0x5656db===null||_0x5656db===undefined?'':typeof _0x5656db===_0x283a72(0x10e)?JSON[_0x283a72(0x120)](_0x5656db):String(_0x5656db);}catch{_0x3b8380=_0x283a72(0xed);}const _0x4288a0=_0x45f96e[_0x283a72(0xfd)](_0x3176fe),_0x263edf=_0x3b8380[_0x283a72(0xf5)]('\x0a');_0x263edf[_0x283a72(0xf3)]((_0x464ed3,_0x31de00)=>{const _0x212af9=_0x283a72,_0x33e636=colorBorder('│',_0x59f4e2);_0x31de00===0x0?_0x10b019[_0x212af9(0x111)](_0x33e636+'\x20'+_0x4288a0+'\x20'+_0x33e636+'\x20'+_0x464ed3['padEnd'](_0x4007b0)+'\x20'+_0x33e636):_0x10b019[_0x212af9(0x111)](_0x33e636+'\x20'+'\x20'[_0x212af9(0x104)](_0x3176fe)+'\x20'+_0x33e636+'\x20'+_0x464ed3[_0x212af9(0xfd)](_0x4007b0)+'\x20'+_0x33e636);});}),_0x10b019[_0x1a3a6f(0x111)](colorBorder('└─'+'─'[_0x1a3a6f(0x104)](_0x3176fe)+_0x1a3a6f(0x102)+'─'[_0x1a3a6f(0x104)](_0x4007b0)+'─┘',_0x59f4e2));_0x242486&&(_0x10b019[_0x1a3a6f(0x111)](''),_0x10b019[_0x1a3a6f(0x111)](String(a54_0xb3d840[_0x1a3a6f(0x113)][_0x1a3a6f(0x107)](_0x1a3a6f(0xe3)))),_0x10b019[_0x1a3a6f(0x111)](_0x242486));_0x4c5009&&(_0x10b019[_0x1a3a6f(0x111)](''),_0x10b019[_0x1a3a6f(0x111)](String(a54_0xb3d840[_0x1a3a6f(0xfa)][_0x1a3a6f(0x107)]('[params]'))),_0x10b019[_0x1a3a6f(0x111)](_0x4c5009));_0x378630&&(_0x10b019[_0x1a3a6f(0x111)](''),_0x10b019[_0x1a3a6f(0x111)](String(a54_0xb3d840[_0x1a3a6f(0x10a)][_0x1a3a6f(0x107)](_0x1a3a6f(0x11c)))),_0x10b019[_0x1a3a6f(0x111)](_0x378630));if(_0x59730f){if(_0x59730f[_0x1a3a6f(0x122)]){_0x10b019[_0x1a3a6f(0x111)](''),_0x10b019[_0x1a3a6f(0x111)](String(a54_0xb3d840[_0x1a3a6f(0x106)][_0x1a3a6f(0x107)](_0x1a3a6f(0x123))));const _0x1e417a=_0x59730f['stderr'][_0x1a3a6f(0xf5)]('\x0a');_0x1e417a['forEach'](_0x5731f3=>{const _0x394dc8=_0x1a3a6f;_0x5731f3[_0x394dc8(0x101)]()&&_0x10b019[_0x394dc8(0x111)](_0x5731f3);});}if(_0x59730f['cmdout']){_0x10b019['push'](''),_0x10b019[_0x1a3a6f(0x111)](String(a54_0xb3d840[_0x1a3a6f(0x105)][_0x1a3a6f(0x107)]('[logs]')));const _0x4013e6=_0x59730f[_0x1a3a6f(0x100)][_0x1a3a6f(0xf5)]('\x0a');_0x4013e6[_0x1a3a6f(0xf3)](_0x39322d=>{const _0x1bf82d=_0x1a3a6f;_0x39322d[_0x1bf82d(0x101)]()&&_0x10b019['push'](_0x39322d);});}}return _0x10b019['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x1c02d5,_0x11e9f1){const _0x3da4bd=a54_0x1d6e;if(_0x11e9f1[_0x3da4bd(0xf4)]==='table'){await handleSDKOutput([_0x1c02d5],_0x11e9f1);return;}const _0x155962=resolveOutputOptions(_0x11e9f1),_0x50bc0f=await formatSingleObject(_0x1c02d5,_0x155962);await writeOutput(_0x50bc0f,_0x155962[_0x3da4bd(0xec)]||undefined,_0x155962[_0x3da4bd(0xf4)]);}