@treasuredata/tdx 0.16.1 → 0.16.3

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 (162) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/unset-command.js +1 -1
  41. package/dist/commands/use-command.js +1 -1
  42. package/dist/commands/user-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/command-output.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/connection-cache.js +1 -1
  48. package/dist/core/constants.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/core/user-cache.js +1 -1
  56. package/dist/core/version.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/mcp/server.js +1 -1
  59. package/dist/mcp/tools/index.js +1 -1
  60. package/dist/mcp/tools/tdx-run.js +1 -1
  61. package/dist/mcp/tools/tdx-search.js +1 -1
  62. package/dist/mcp/utils.js +1 -1
  63. package/dist/proxy/anthropic-adapter.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/context-signature.js +1 -1
  66. package/dist/proxy/conversation-utils.js +1 -1
  67. package/dist/proxy/passthrough-server.js +1 -1
  68. package/dist/proxy/server.js +1 -1
  69. package/dist/proxy/session-cache.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/api.js +1 -1
  80. package/dist/sdk/claude-agent/claude-agent-client.d.ts +19 -1
  81. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  82. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  83. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  84. package/dist/sdk/claude-agent/environment.d.ts +9 -0
  85. package/dist/sdk/claude-agent/environment.d.ts.map +1 -1
  86. package/dist/sdk/claude-agent/environment.js +1 -1
  87. package/dist/sdk/claude-agent/environment.js.map +1 -1
  88. package/dist/sdk/claude-agent/index.js +1 -1
  89. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  90. package/dist/sdk/claude-agent/types.d.ts +26 -0
  91. package/dist/sdk/claude-agent/types.d.ts.map +1 -1
  92. package/dist/sdk/client/cdp-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/rate-limiter.js +1 -1
  98. package/dist/sdk/client/td-api-client.js +1 -1
  99. package/dist/sdk/client/trino-api-client.js +1 -1
  100. package/dist/sdk/client/workflow-client.js +1 -1
  101. package/dist/sdk/connection-validator.js +1 -1
  102. package/dist/sdk/connection.js +1 -1
  103. package/dist/sdk/engage.js +1 -1
  104. package/dist/sdk/errors.js +1 -1
  105. package/dist/sdk/index.js +1 -1
  106. package/dist/sdk/io/index.js +1 -1
  107. package/dist/sdk/io/node-filesystem.js +1 -1
  108. package/dist/sdk/job.js +1 -1
  109. package/dist/sdk/journey.js +1 -1
  110. package/dist/sdk/llm/chat-cache.js +1 -1
  111. package/dist/sdk/llm/index.js +1 -1
  112. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  113. package/dist/sdk/llm/model-aliases.js +1 -1
  114. package/dist/sdk/llm/model-factors.js +1 -1
  115. package/dist/sdk/query/index.js +1 -1
  116. package/dist/sdk/query/sql-parser.js +1 -1
  117. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/fields-display.js +1 -1
  119. package/dist/sdk/segment/file-discovery.js +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-yaml.js +1 -1
  122. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  123. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  124. package/dist/sdk/segment/pull-workflow.js +1 -1
  125. package/dist/sdk/segment/push-workflow.js +1 -1
  126. package/dist/sdk/segment/resolution-context.js +1 -1
  127. package/dist/sdk/segment/segment-path-parser.js +1 -1
  128. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  129. package/dist/sdk/segment/target-resolution.js +1 -1
  130. package/dist/sdk/segment/tdx-config.js +1 -1
  131. package/dist/sdk/segment/validate-files.js +1 -1
  132. package/dist/sdk/segment/yaml-validator.js +1 -1
  133. package/dist/sdk/segment.js +1 -1
  134. package/dist/sdk/types/index.js +1 -1
  135. package/dist/sdk/types/progress.js +1 -1
  136. package/dist/sdk/user.js +1 -1
  137. package/dist/sdk/util/format-detector.js +1 -1
  138. package/dist/sdk/util/formatters.js +1 -1
  139. package/dist/sdk/util/index.js +1 -1
  140. package/dist/sdk/util/tree-formatter.js +1 -1
  141. package/dist/sdk/workflow/clone-workflow.js +1 -1
  142. package/dist/sdk/workflow/index.js +1 -1
  143. package/dist/sdk/workflow/pull-workflow.js +1 -1
  144. package/dist/sdk/workflow/push-workflow.js +1 -1
  145. package/dist/sdk/workflow/tdx-config.js +1 -1
  146. package/dist/sdk/workflow/workflow-utils.js +1 -1
  147. package/dist/utils/async.js +1 -1
  148. package/dist/utils/colors.js +1 -1
  149. package/dist/utils/diff.js +1 -1
  150. package/dist/utils/file-permissions.js +1 -1
  151. package/dist/utils/json-loader.js +1 -1
  152. package/dist/utils/option-validation.js +1 -1
  153. package/dist/utils/port.js +1 -1
  154. package/dist/utils/process.js +1 -1
  155. package/dist/utils/prompt.js +1 -1
  156. package/dist/utils/spinner.js +1 -1
  157. package/dist/utils/sse-parser.js +1 -1
  158. package/dist/utils/string-utils.js +1 -1
  159. package/dist/utils/table-ref-parser.js +1 -1
  160. package/dist/utils/tdx-logger.js +1 -1
  161. package/dist/utils/version-check.js +1 -1
  162. package/package.json +1 -1
@@ -1 +1 @@
1
- const a41_0x949368=a41_0x4a92;function a41_0x4a92(_0x342809,_0x221179){_0x342809=_0x342809-0x166;const _0x56aa5b=a41_0x56aa();let _0x4a92a1=_0x56aa5b[_0x342809];return _0x4a92a1;}(function(_0x317512,_0x13e5fc){const _0x35d072=a41_0x4a92,_0x47070d=_0x317512();while(!![]){try{const _0x1d06f0=-parseInt(_0x35d072(0x189))/0x1*(parseInt(_0x35d072(0x16e))/0x2)+-parseInt(_0x35d072(0x2cd))/0x3*(parseInt(_0x35d072(0x1bc))/0x4)+-parseInt(_0x35d072(0x2f0))/0x5+-parseInt(_0x35d072(0x1a9))/0x6*(-parseInt(_0x35d072(0x167))/0x7)+-parseInt(_0x35d072(0x2c1))/0x8+-parseInt(_0x35d072(0x2a3))/0x9+parseInt(_0x35d072(0x21a))/0xa;if(_0x1d06f0===_0x13e5fc)break;else _0x47070d['push'](_0x47070d['shift']());}catch(_0x28c1ff){_0x47070d['push'](_0x47070d['shift']());}}}(a41_0x56aa,0x766e1));import a41_0x114f43 from'chalk';import{existsSync}from'fs';import a41_0x4e3ac0 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}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 a41_0x2b3a80 from'prompts';function getAttemptStatusDisplay(_0x66553f){const _0x1d85aa=a41_0x4a92;if(!_0x66553f)return{'icon':'⏳','text':''};const {done:_0x24d5bd,success:_0x53f44b,cancelRequested:_0x212272}=_0x66553f;if(!_0x24d5bd)return _0x212272?{'icon':'🛑','text':a41_0x114f43[_0x1d85aa(0x2de)](_0x1d85aa(0x1b6))}:{'icon':'🔄','text':a41_0x114f43['blue'](_0x1d85aa(0x1d5))};if(_0x53f44b)return{'icon':'✅','text':a41_0x114f43[_0x1d85aa(0x2ad)](_0x1d85aa(0x2d7))};return{'icon':'❌','text':a41_0x114f43['red'](_0x1d85aa(0x24e))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x54d6ac,_0x27e4dc,_0x554001=0x0){const _0x174f2f=a41_0x4a92;return _0x54d6ac[_0x554001]||_0x27e4dc[_0x174f2f(0x2b2)];}[a41_0x949368(0x264)](_0x5577b7,_0x51ea13,_0x444ea0=0x0){const _0x1fdda3=a41_0x949368,_0x279ab8=this['resolveProject'](_0x5577b7,_0x51ea13,_0x444ea0);if(!_0x279ab8)return console[_0x1fdda3(0x24e)](a41_0x114f43[_0x1fdda3(0x1c7)](_0x1fdda3(0x1ee)),_0x1fdda3(0x1c8)),console['error'](a41_0x114f43[_0x1fdda3(0x229)](_0x1fdda3(0x183))),null;return _0x279ab8;}['parseProjectWorkflowPattern'](_0x5dcd20,_0x55191d){const _0x35f3a7=a41_0x949368;if(_0x5dcd20[0x0]){const _0x51f6a5=_0x5dcd20[0x0][_0x35f3a7(0x2b8)]('.');if(_0x51f6a5[_0x35f3a7(0x19a)]===0x1)return{'projectName':_0x51f6a5[0x0],'workflowName':undefined};else return _0x51f6a5['length']===0x2?{'projectName':_0x51f6a5[0x0],'workflowName':_0x51f6a5[0x1]}:(console[_0x35f3a7(0x24e)](a41_0x114f43['red']('Error:'),_0x35f3a7(0x19b)),null);}return{'projectName':_0x55191d['workflowProject'],'workflowName':undefined};}[a41_0x949368(0x1dc)](_0x556736,_0x356a84,_0x1af227=0x0){const _0x589b58=a41_0x949368;if(_0x556736[_0x1af227])return _0x556736[_0x1af227];if(_0x356a84[_0x589b58(0x2b2)]){const _0x21615c=a41_0x4e3ac0[_0x589b58(0x1a7)](process['cwd'](),_0x589b58(0x2c2),_0x356a84[_0x589b58(0x2b2)]);if(existsSync(a41_0x4e3ac0[_0x589b58(0x1a7)](_0x21615c,_0x589b58(0x2bc))))return _0x21615c;}return undefined;}async[a41_0x949368(0x287)](_0x54f831,_0x83fc0c,_0x534870){const _0x32df11=a41_0x949368;try{const _0x371b67=await _0x54f831['workflow'][_0x32df11(0x2c2)](_0x83fc0c,{'limit':0x1});if(_0x371b67[_0x32df11(0x19a)]>0x0){const _0x191258=_0x371b67[0x0]['id'],_0x21b5a1=getWorkflowUrl(_0x534870,_0x191258);console[_0x32df11(0x24e)](_0x32df11(0x177)+a41_0x114f43['cyan'](_0x21b5a1));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x214);['description']=a41_0x949368(0x2e2);async[a41_0x949368(0x252)](_0x119d1e){const _0x3d7515=a41_0x949368,{options:_0x219070,args:_0x171953,tdx:_0x1d20b4}=_0x119d1e,_0x5e124d=_0x171953[0x0],_0x18e0b1=_0x219070[_0x3d7515(0x244)];if(_0x18e0b1)return saveSessionContext({'workflow_project':undefined},_0x219070[_0x3d7515(0x20e)]),console[_0x3d7515(0x22a)](a41_0x114f43[_0x3d7515(0x2ad)](_0x3d7515(0x2d3))),0x0;if(!_0x5e124d)return console[_0x3d7515(0x24e)](a41_0x114f43[_0x3d7515(0x1c7)](_0x3d7515(0x1ee)),_0x3d7515(0x1c8)),console[_0x3d7515(0x24e)](a41_0x114f43[_0x3d7515(0x229)](_0x3d7515(0x19e))),console['error'](a41_0x114f43[_0x3d7515(0x229)](_0x3d7515(0x1f2))),0x1;const _0x1489ad=await withSpinner(_0x3d7515(0x304)+_0x5e124d+_0x3d7515(0x232),()=>_0x1d20b4[_0x3d7515(0x1db)][_0x3d7515(0x218)](_0x5e124d),{'verbose':_0x219070[_0x3d7515(0x2ef)]}),{name:_0x304087}=_0x1489ad[_0x3d7515(0x297)];return saveSessionContext({'workflow_project':_0x304087},_0x219070[_0x3d7515(0x20e)]),console[_0x3d7515(0x22a)](a41_0x114f43[_0x3d7515(0x2ad)](_0x3d7515(0x25e)+a41_0x114f43[_0x3d7515(0x2f7)](_0x304087))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a41_0x949368(0x26f);[a41_0x949368(0x27c)]=a41_0x949368(0x1d2);async['execute'](_0x311a4d){const _0x3c125e=a41_0x949368,{options:_0x11a67c,args:_0x9ebfc3,tdx:_0x281b1d}=_0x311a4d,_0x4d44af=_0x9ebfc3[0x0];_0x11a67c[_0x3c125e(0x2ef)]&&_0x4d44af&&console[_0x3c125e(0x24e)](_0x3c125e(0x260)+_0x4d44af);const _0x406517=await withSpinner(_0x3c125e(0x237),()=>_0x281b1d[_0x3c125e(0x1db)][_0x3c125e(0x171)](_0x4d44af,{'limit':_0x11a67c[_0x3c125e(0x20c)]}),{'verbose':_0x11a67c[_0x3c125e(0x2ef)]});let _0x356af2=_0x406517[_0x3c125e(0x297)];_0x356af2[_0x3c125e(0x280)]((_0x6a5592,_0x417d30)=>_0x6a5592[_0x3c125e(0x179)]['localeCompare'](_0x417d30[_0x3c125e(0x179)]));const _0x2936a4=_0x11a67c[_0x3c125e(0x20c)]||0x64,_0x1b8ceb=_0x356af2['length']>=_0x2936a4?a41_0x114f43['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x3c125e(0x1ac)+_0x356af2[_0x3c125e(0x19a)]+'\x20project'+(_0x356af2['length']!==0x1?'s':'')+_0x1b8ceb);if(_0x11a67c[_0x3c125e(0x181)]===_0x3c125e(0x195)||_0x11a67c['format']===_0x3c125e(0x26d)||_0x11a67c[_0x3c125e(0x181)]===_0x3c125e(0x21e))await handleSDKOutput(_0x356af2,_0x11a67c);else{if(_0x356af2[_0x3c125e(0x19a)]===0x0)_0x4d44af?console[_0x3c125e(0x22a)]('No\x20projects\x20match\x20pattern:\x20'+_0x4d44af):console[_0x3c125e(0x22a)](_0x3c125e(0x21d));else{const _0x43e7ed=_0x356af2[_0x3c125e(0x290)](_0x30d244=>{const _0x44e5f7=_0x3c125e,_0x267cd9=_0x30d244[_0x44e5f7(0x24d)]?.[_0x44e5f7(0x198)](_0x6c6038=>_0x6c6038[_0x44e5f7(0x307)]==='sys'),_0x50ff1a=_0x267cd9?a41_0x114f43[_0x44e5f7(0x229)]('\x20(system)'):'';return _0x44e5f7(0x2aa)+_0x30d244[_0x44e5f7(0x179)]+_0x50ff1a;});await writeOutput(_0x43e7ed['join']('\x0a'),_0x11a67c[_0x3c125e(0x1f9)],_0x3c125e(0x28f));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x255);['description']=a41_0x949368(0x1a8);async[a41_0x949368(0x252)](_0x348457){const _0x533cf1=a41_0x949368,{options:_0x172e3b,args:_0x4b7175,tdx:_0x55b9db}=_0x348457,_0x119485=this[_0x533cf1(0x28c)](_0x4b7175,_0x172e3b);_0x172e3b['verbose']&&_0x119485&&console['error'](_0x533cf1(0x193)+_0x119485);const _0xc886a0=await withSpinner(_0x533cf1(0x22e),()=>_0x55b9db[_0x533cf1(0x1db)]['workflows'](_0x119485,{'limit':_0x172e3b['limit']}),{'verbose':_0x172e3b['verbose']});let _0x4d0eef=_0xc886a0[_0x533cf1(0x297)];_0x4d0eef['sort']((_0x2764e5,_0x52fc0b)=>{const _0x7ffa0d=_0x533cf1,_0x26d5c6=_0x2764e5[_0x7ffa0d(0x179)][_0x7ffa0d(0x2f3)](_0x52fc0b[_0x7ffa0d(0x179)]);if(_0x26d5c6!==0x0)return _0x26d5c6;return(_0x2764e5['project']?.['name']||'')[_0x7ffa0d(0x2f3)](_0x52fc0b[_0x7ffa0d(0x20a)]?.[_0x7ffa0d(0x179)]||'');});const _0x14966a=_0x172e3b['limit']||0x64,_0x2fb63b=_0x4d0eef[_0x533cf1(0x19a)]>=_0x14966a?a41_0x114f43[_0x533cf1(0x229)](_0x533cf1(0x1d3)):'';console['error']('✔\x20Found\x20'+_0x4d0eef[_0x533cf1(0x19a)]+_0x533cf1(0x220)+(_0x4d0eef[_0x533cf1(0x19a)]!==0x1?'s':'')+_0x2fb63b);if(_0x172e3b['format']===_0x533cf1(0x195)||_0x172e3b[_0x533cf1(0x181)]===_0x533cf1(0x26d)||_0x172e3b[_0x533cf1(0x181)]===_0x533cf1(0x21e))await handleSDKOutput(_0x4d0eef,_0x172e3b);else{if(_0x4d0eef[_0x533cf1(0x19a)]===0x0)_0x119485?console[_0x533cf1(0x22a)](_0x533cf1(0x180)+_0x119485):console['log'](_0x533cf1(0x2d4));else{const _0x1f0200=_0x172e3b[_0x533cf1(0x1aa)],_0x43b7e7=_0x4d0eef['map'](_0x382712=>{const _0xc07fb3=_0x533cf1,_0xc539f=a41_0x114f43[_0xc07fb3(0x229)]('#'+_0x382712['id']),_0x2af178=hyperlink(_0xc539f,getWorkflowUrl(_0x1f0200,_0x382712['id'])),_0xefd7a2=_0x382712[_0xc07fb3(0x20a)]?.[_0xc07fb3(0x179)]?a41_0x114f43['dim']('\x20('+_0x382712[_0xc07fb3(0x20a)][_0xc07fb3(0x179)]+')'):'';return _0xc07fb3(0x2fd)+_0x2af178+'\x20'+_0x382712[_0xc07fb3(0x179)]+_0xefd7a2;});await writeOutput(_0x43b7e7[_0x533cf1(0x1a7)]('\x0a'),_0x172e3b[_0x533cf1(0x1f9)],_0x533cf1(0x28f));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x949368(0x179)]='workflow:sessions';[a41_0x949368(0x27c)]=a41_0x949368(0x1a3);async[a41_0x949368(0x252)](_0x5f4e20){const _0xbdac41=a41_0x949368,{options:_0x5c7eb1,args:_0x14e839,tdx:_0x2c294a}=_0x5f4e20,_0x26987e=this[_0xbdac41(0x278)](_0x14e839,_0x5c7eb1);if(!_0x26987e)return 0x1;const {projectName:_0x1cac2f,workflowName:_0x1fc67b}=_0x26987e;if(_0x5c7eb1[_0xbdac41(0x2ef)]){if(_0x1cac2f&&_0x1fc67b)console[_0xbdac41(0x24e)]('Filter:\x20'+_0x1cac2f+'.'+_0x1fc67b);else _0x1cac2f&&console[_0xbdac41(0x24e)](_0xbdac41(0x1a5)+_0x1cac2f);const _0x1cf866=_0x5c7eb1[_0xbdac41(0x27a)];_0x1cf866&&console['error']('Status:\x20'+_0x1cf866);}let _0x24fb18=0x28;if(process[_0xbdac41(0x1fa)][_0xbdac41(0x26e)]&&!_0x5c7eb1[_0xbdac41(0x1f9)]&&!_0x5c7eb1['format']){const _0x4ba9c8=process[_0xbdac41(0x1fa)][_0xbdac41(0x1ad)]||0x28;_0x24fb18=Math['max'](0x14,Math[_0xbdac41(0x2c0)](_0x4ba9c8*0x2/0x3));}const _0x2aa04b=_0x5c7eb1[_0xbdac41(0x20c)]||_0x24fb18,_0x1b0005=await withSpinner(_0xbdac41(0x2a0),()=>_0x2c294a[_0xbdac41(0x1db)][_0xbdac41(0x28b)]({'projectName':_0x1cac2f,'workflowName':_0x1fc67b,'status':_0x5c7eb1[_0xbdac41(0x27a)],'fromTime':_0x5c7eb1[_0xbdac41(0x2b4)],'toTime':_0x5c7eb1['to'],'limit':_0x2aa04b}),{'verbose':_0x5c7eb1[_0xbdac41(0x2ef)]}),_0xe1b722=_0x1b0005[_0xbdac41(0x297)];_0xe1b722['sort']((_0x31beec,_0x2bcbe6)=>{const _0x36da00=_0xbdac41,_0x483c61=_0x31beec[_0x36da00(0x175)]||'',_0x7109df=_0x2bcbe6[_0x36da00(0x175)]||'';return _0x7109df[_0x36da00(0x2f3)](_0x483c61);});_0xe1b722[_0xbdac41(0x19a)]>=_0x2aa04b?console[_0xbdac41(0x24e)]('✔\x20Showing\x20'+_0xe1b722['length']+_0xbdac41(0x1bb)+a41_0x114f43[_0xbdac41(0x229)](_0xbdac41(0x2eb))):console[_0xbdac41(0x24e)](_0xbdac41(0x1ac)+_0xe1b722[_0xbdac41(0x19a)]+_0xbdac41(0x2dd)+(_0xe1b722['length']!==0x1?'s':''));if(_0x5c7eb1[_0xbdac41(0x181)]===_0xbdac41(0x195)||_0x5c7eb1['format']===_0xbdac41(0x26d)||_0x5c7eb1[_0xbdac41(0x181)]===_0xbdac41(0x21e))await handleSDKOutput(_0xe1b722,_0x5c7eb1);else{if(!process[_0xbdac41(0x1fa)][_0xbdac41(0x26e)]||_0x5c7eb1['output']){if(_0xe1b722[_0xbdac41(0x19a)]===0x0){if(_0x1cac2f&&_0x1fc67b)console[_0xbdac41(0x22a)](_0xbdac41(0x168)+_0x1cac2f+'.'+_0x1fc67b);else _0x1cac2f?console[_0xbdac41(0x22a)](_0xbdac41(0x2e6)+_0x1cac2f):console[_0xbdac41(0x22a)](_0xbdac41(0x205));}else{const _0x1e1f0d=_0x5c7eb1[_0xbdac41(0x1aa)],_0xcd3b77=this[_0xbdac41(0x1c5)](_0xe1b722,_0x1e1f0d);_0x5c7eb1[_0xbdac41(0x1f9)]?await writeOutput(_0xcd3b77,_0x5c7eb1['output'],'list'):console[_0xbdac41(0x22a)](_0xcd3b77);}!_0x1cac2f&&(console['error'](''),console[_0xbdac41(0x24e)](a41_0x114f43['dim'](_0xbdac41(0x23c))),console[_0xbdac41(0x24e)](a41_0x114f43[_0xbdac41(0x229)](_0xbdac41(0x2fc))+'or'+a41_0x114f43['dim'](_0xbdac41(0x306))));}else{if(_0xe1b722[_0xbdac41(0x19a)]===0x0){if(_0x1cac2f&&_0x1fc67b)console[_0xbdac41(0x22a)]('No\x20sessions\x20found\x20for:\x20'+_0x1cac2f+'.'+_0x1fc67b);else _0x1cac2f?console[_0xbdac41(0x22a)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x1cac2f):console[_0xbdac41(0x22a)](_0xbdac41(0x205));}else await this['navigateSessionsInteractive'](_0xe1b722,_0x5f4e20,_0x1cac2f);}}return 0x0;}[a41_0x949368(0x1c5)](_0x5adb7e,_0x4aa932){const _0x178512=a41_0x949368,_0x228e98=[],_0x592aa1=new Map();let _0x1527be=Infinity,_0x1f86b9=-Infinity;for(const _0xacc6d6 of _0x5adb7e){if(_0xacc6d6[_0x178512(0x19d)]?.[_0x178512(0x201)]){const _0x4cad2d=new Date(_0xacc6d6[_0x178512(0x19d)][_0x178512(0x201)])[_0x178512(0x265)](),_0x102b97=_0xacc6d6[_0x178512(0x19d)]['finishedAt']?new Date(_0xacc6d6['lastAttempt'][_0x178512(0x235)])[_0x178512(0x265)]():Date['now'](),_0x25adb6=_0xacc6d6['project']?.[_0x178512(0x179)]||_0x178512(0x1fc);!_0x592aa1[_0x178512(0x1da)](_0x25adb6)&&_0x592aa1[_0x178512(0x1e0)](_0x25adb6,[]),_0x592aa1[_0x178512(0x22d)](_0x25adb6)[_0x178512(0x2d0)]({'session':_0xacc6d6,'startTime':_0x4cad2d,'endTime':_0x102b97,'duration':_0x102b97-_0x4cad2d}),_0x1527be=Math[_0x178512(0x215)](_0x1527be,_0x4cad2d),_0x1f86b9=Math[_0x178512(0x1f6)](_0x1f86b9,_0x102b97);}}if(_0x592aa1[_0x178512(0x2ab)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x154946=process['stdout'][_0x178512(0x254)]||0x78,_0x32a630=0x1e,_0x4bff63=0x32,_0x66b4b7=0x4,_0x324f50=Math[_0x178512(0x215)](_0x4bff63,Math['max'](_0x32a630,Math[_0x178512(0x2c0)](_0x154946*0.3))),_0xbdab69=_0x154946-_0x324f50-TIMELINE_CONFIG[_0x178512(0x282)]-0x3-_0x66b4b7,_0x502239=_0x1f86b9-_0x1527be,_0x3ff1d3=_0x502239/_0x324f50,_0x47afe2=renderTimeAxis({'startTime':_0x1527be,'endTime':_0x1f86b9,'durationMs':_0x502239,'msPerChar':_0x3ff1d3},_0x324f50),_0x3ce11e=[];for(const _0x23306 of _0x592aa1[_0x178512(0x184)]()){_0x3ce11e['push'](..._0x23306);}_0x3ce11e[_0x178512(0x280)]((_0x1155e6,_0x6b4b7a)=>_0x6b4b7a['startTime']-_0x1155e6['startTime']);const _0x2ba72c=new Date(_0x1527be),_0x57df5d=formatDate(_0x2ba72c),_0x49f3fc=_0x66b4b7+TIMELINE_CONFIG[_0x178512(0x1e8)]+TIMELINE_CONFIG[_0x178512(0x2e1)]+_0xbdab69,_0x466f9d='\x20'[_0x178512(0x26b)](_0x49f3fc-_0x57df5d[_0x178512(0x19a)]),_0x52fde1=_0x466f9d+a41_0x114f43[_0x178512(0x229)](_0x57df5d)+'\x20'+_0x47afe2;_0x228e98[_0x178512(0x2d0)](_0x52fde1);const _0x4a9ad1=0x16;let _0xc06b1b=0x0;for(const _0x5d3eed of _0x3ce11e){const _0x327e2d=_0x5d3eed['session'][_0x178512(0x20a)]?.['name']||'?',_0x41a9ad=Math[_0x178512(0x215)](stringWidth(_0x327e2d),_0x4a9ad1);_0xc06b1b=Math[_0x178512(0x1f6)](_0xc06b1b,_0x41a9ad);}for(const _0x55804b of _0x3ce11e){const {session:_0x22a57a,startTime:_0x212e57,endTime:_0xa68bbc,duration:_0x93c19e}=_0x55804b,_0x1f3933=_0x22a57a[_0x178512(0x20a)]?.['id'],_0x290707=_0x22a57a['id'],_0x11ae79=_0x22a57a[_0x178512(0x20a)]?.[_0x178512(0x179)]||'?',_0x5f2399=_0x22a57a[_0x178512(0x1db)]?.[_0x178512(0x179)]||'?';let _0x438812,_0x8c562a;if(_0x22a57a[_0x178512(0x19d)]){const _0x17d36b=_0x22a57a['lastAttempt'];!_0x17d36b['done']?(_0x438812=_0x17d36b[_0x178512(0x251)]?'🛑':'🔄',_0x8c562a=_0x17d36b[_0x178512(0x251)]?a41_0x114f43[_0x178512(0x2de)]:a41_0x114f43[_0x178512(0x17f)]):(_0x438812=_0x17d36b[_0x178512(0x2d7)]?'✅':'❌',_0x8c562a=_0x17d36b[_0x178512(0x2d7)]?a41_0x114f43[_0x178512(0x2ad)]:a41_0x114f43[_0x178512(0x1c7)]);}else _0x438812='⏳',_0x8c562a=a41_0x114f43[_0x178512(0x229)];const _0x29d087='#'+_0x290707,_0x2e3b04=_0x1f3933?hyperlink(_0x29d087,getWorkflowSessionUrl(_0x4aa932,_0x1f3933,_0x290707)):_0x29d087;let _0x309e53=_0x11ae79;stringWidth(_0x11ae79)>_0x4a9ad1&&(_0x309e53=_0x11ae79[_0x178512(0x1c0)](0x0,_0x4a9ad1-0x1)+'…');const _0x16a44d=a41_0x114f43[_0x178512(0x229)](_0x309e53),_0x1d3db9=stringWidth(_0x309e53),_0x319727='\x20'[_0x178512(0x26b)](_0xc06b1b-stringWidth(_0x309e53)+0x2),_0x1f315f='('+formatElapsed(_0x93c19e)+')',_0x3d22bf=stringWidth(_0x1f315f),_0x43dd71=stringWidth(_0x29d087),_0x370d92=_0x43dd71+0x1+_0x1d3db9+_0x319727[_0x178512(0x19a)],_0x442c25=_0xbdab69-_0x370d92-_0x3d22bf-0x1-0x8;let _0x521fef=_0x5f2399;stringWidth(_0x521fef)>_0x442c25&&(_0x521fef=_0x521fef['slice'](0x0,_0x442c25-0x1)+'…');const _0x3205f4=_0x2e3b04+'\x20'+_0x16a44d+_0x319727+_0x521fef,_0x498259=stringWidth(_0x3205f4),_0x103c0a=_0xbdab69-_0x498259-_0x3d22bf,_0x40d760=_0x3205f4+'\x20'[_0x178512(0x26b)](Math['max'](0x1,_0x103c0a))+a41_0x114f43['dim'](_0x1f315f),_0x80c44e=Math['floor']((_0x212e57-_0x1527be)/_0x3ff1d3),_0x31e52f=Math[_0x178512(0x2c0)]((_0xa68bbc-_0x1527be)/_0x3ff1d3),_0x447972=Math[_0x178512(0x1f6)](_0x80c44e+0x1,_0x31e52f),_0x131a73=new Array(_0x324f50)[_0x178512(0x1f5)]('\x20');for(let _0x337aa6=_0x80c44e;_0x337aa6<Math[_0x178512(0x215)](_0x447972,_0x324f50);_0x337aa6++){_0x131a73[_0x337aa6]='─';}const _0x4fa77d=_0x131a73[_0x178512(0x290)](_0x46d2c2=>_0x46d2c2==='\x20'?'\x20':_0x8c562a(_0x46d2c2))[_0x178512(0x1a7)]('');_0x228e98[_0x178512(0x2d0)](_0x438812+'\x20'+_0x40d760+'│'+_0x4fa77d+'│');}return _0x228e98['join']('\x0a');}async[a41_0x949368(0x1cf)](_0x4671f7,_0x1ea8d8,_0x132be4){const _0x4a21e0=a41_0x949368,{options:_0x476c35,tdx:_0x23130c}=_0x1ea8d8,_0x5f55c6=_0x476c35['site'],{timelineRows:_0x3c4a5d,timeAxisHeader:_0x58da7b}=this[_0x4a21e0(0x169)](_0x4671f7,_0x5f55c6),_0x5862d=_0x3c4a5d[_0x4a21e0(0x172)](_0xa1ba0b=>_0xa1ba0b[_0x4a21e0(0x2a6)]);if(_0x5862d[_0x4a21e0(0x19a)]===0x0){const _0x730967=this[_0x4a21e0(0x1c5)](_0x4671f7,_0x5f55c6);console[_0x4a21e0(0x22a)](_0x730967);!_0x132be4&&(console[_0x4a21e0(0x24e)](''),console[_0x4a21e0(0x24e)](a41_0x114f43['dim'](_0x4a21e0(0x23c))),console[_0x4a21e0(0x24e)](a41_0x114f43[_0x4a21e0(0x229)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a41_0x114f43[_0x4a21e0(0x229)](_0x4a21e0(0x306))));return;}_0x58da7b&&console['log'](_0x58da7b);const _0x23f521=_0x3c4a5d[_0x4a21e0(0x172)](_0x1141ab=>_0x1141ab[_0x4a21e0(0x2a6)])['map'](_0x44efaa=>({'title':_0x44efaa['displayLine'],'value':_0x44efaa['attemptId']})),_0x3ecf0b=process['stdout'][_0x4a21e0(0x1ad)]||0x3c,_0x468af8=Math[_0x4a21e0(0x1f6)](0x28,Math[_0x4a21e0(0x2c0)](_0x3ecf0b*0x2/0x3)),_0xbc4619=await a41_0x2b3a80({'type':_0x4a21e0(0x2d5),'name':_0x4a21e0(0x2a6),'message':_0x4a21e0(0x219),'choices':_0x23f521,'initial':-0x1,'limit':_0x468af8,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x2e5dfc,_0x240d35)=>{const _0x1e4e9a=_0x4a21e0;if(!_0x2e5dfc)return Promise[_0x1e4e9a(0x27e)](_0x240d35);const _0xa9b131=_0x240d35[_0x1e4e9a(0x172)](_0x3f1157=>{const _0x30d763=_0x1e4e9a,_0x58a2d6=_0x3f1157;return _0x58a2d6[_0x30d763(0x217)][_0x30d763(0x1bd)]()['includes'](_0x2e5dfc['toLowerCase']());});return Promise[_0x1e4e9a(0x27e)](_0xa9b131);}}),_0x350d10=()=>{const _0x1f2fde=_0x4a21e0;process[_0x1f2fde(0x1fa)][_0x1f2fde(0x256)](_0x1f2fde(0x2f6)),process[_0x1f2fde(0x1fa)][_0x1f2fde(0x256)]('\x1b[1A\x1b[2K'),process[_0x1f2fde(0x1fa)]['write'](_0x1f2fde(0x2f6));},_0x1c6163=_0xbc4619&&_0xbc4619[_0x4a21e0(0x2a6)]&&_0xbc4619[_0x4a21e0(0x2a6)]!==null&&_0xbc4619[_0x4a21e0(0x2a6)]['trim']()!=='';if(!_0x1c6163){_0x350d10(),console[_0x4a21e0(0x22a)](a41_0x114f43[_0x4a21e0(0x229)](_0x4a21e0(0x2b1)));return;}_0x350d10();const _0x56c0f6=_0x4671f7[_0x4a21e0(0x2f1)](_0x3a8ee1=>_0x3a8ee1[_0x4a21e0(0x19d)]?.['id']===_0xbc4619['attemptId']);if(_0x56c0f6){const _0xf31675=_0x56c0f6[_0x4a21e0(0x20a)]?.[_0x4a21e0(0x179)]||'?',_0x4708d8=_0x56c0f6[_0x4a21e0(0x1db)]?.[_0x4a21e0(0x179)]||'?';console[_0x4a21e0(0x22a)](_0x4a21e0(0x2b3)+a41_0x114f43['dim'](_0xf31675)+_0x4a21e0(0x1d1)+a41_0x114f43['dim'](_0x4708d8));}const _0x58d9f2=new WorkflowTimelineCommand();await _0x58d9f2[_0x4a21e0(0x252)]({'args':[],'options':{..._0x476c35,'attemptId':_0xbc4619[_0x4a21e0(0x2a6)]},'tdx':_0x23130c});}[a41_0x949368(0x169)](_0x14b2d2,_0x52390f){const _0x24ad24=a41_0x949368,_0x5c4d1a=new Map();for(const _0x580336 of _0x14b2d2){_0x580336['id']&&_0x580336[_0x24ad24(0x19d)]?.['id']&&_0x5c4d1a[_0x24ad24(0x1e0)](_0x580336['id'],_0x580336[_0x24ad24(0x19d)]['id']);}const _0x1d7a45=[];let _0xf32817='';const _0x4e994a=this[_0x24ad24(0x1c5)](_0x14b2d2,_0x52390f),_0x20d680=_0x4e994a['split']('\x0a');for(const _0x3cbc0e of _0x20d680){if(_0x3cbc0e[_0x24ad24(0x2a5)](_0x24ad24(0x28a))||_0x3cbc0e[_0x24ad24(0x1dd)](/^\s+\d{4}-\d{2}-\d{2}/))_0xf32817=_0x3cbc0e;else{if(_0x3cbc0e[_0x24ad24(0x1dd)](/^[✅❌🔄🛑⏳]/)){const _0x5f2cf3=_0x3cbc0e[_0x24ad24(0x1dd)](/#(\d+)/),_0x5ccc05=_0x5f2cf3?_0x5f2cf3[0x1]:null,_0x400c5d=_0x5ccc05?_0x5c4d1a[_0x24ad24(0x22d)](_0x5ccc05)||null:null,_0x3e99b1=_0x14b2d2['find'](_0x2c56b3=>_0x2c56b3['id']===_0x5ccc05),_0x3d0ee=_0x3e99b1?.['project']?.[_0x24ad24(0x179)]||'';_0x1d7a45['push']({'displayLine':_0x3cbc0e,'attemptId':_0x400c5d,'projectName':_0x3d0ee});}}}return{'timelineRows':_0x1d7a45,'timeAxisHeader':_0xf32817};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x1e3);[a41_0x949368(0x27c)]=a41_0x949368(0x23b);async[a41_0x949368(0x252)](_0x4d3505){const _0x5e8aa4=a41_0x949368,{options:_0x4d6667,args:_0x436f5e,tdx:_0x24bc33}=_0x4d3505,_0x3bdc23=this['parseProjectWorkflowPattern'](_0x436f5e,_0x4d6667);if(!_0x3bdc23)return 0x1;const {projectName:_0x11ebee,workflowName:_0x24eaee}=_0x3bdc23,_0x1846a6=_0x4d6667['includeRetried'];if(_0x4d6667[_0x5e8aa4(0x2ef)]){if(_0x11ebee&&_0x24eaee)console[_0x5e8aa4(0x24e)](_0x5e8aa4(0x2bd)+_0x11ebee+'.'+_0x24eaee);else _0x11ebee&&console['error'](_0x5e8aa4(0x1a5)+_0x11ebee);_0x1846a6&&console[_0x5e8aa4(0x24e)](_0x5e8aa4(0x2e4));}const _0x4731c5=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x24bc33[_0x5e8aa4(0x1db)][_0x5e8aa4(0x1e6)]({'projectName':_0x11ebee,'workflowName':_0x24eaee,'includeRetried':_0x1846a6,'limit':_0x4d6667[_0x5e8aa4(0x20c)]}),{'verbose':_0x4d6667[_0x5e8aa4(0x2ef)]}),_0x5beab2=_0x4731c5[_0x5e8aa4(0x297)],_0x157d15=_0x4d6667[_0x5e8aa4(0x20c)]||0x64,_0x425e01=_0x5beab2[_0x5e8aa4(0x19a)]>=_0x157d15?a41_0x114f43[_0x5e8aa4(0x229)](_0x5e8aa4(0x1d3)):'';console['error'](_0x5e8aa4(0x1ac)+_0x5beab2[_0x5e8aa4(0x19a)]+_0x5e8aa4(0x2b7)+(_0x5beab2[_0x5e8aa4(0x19a)]!==0x1?'s':'')+_0x425e01);if(_0x4d6667['format']==='json'||_0x4d6667['format']===_0x5e8aa4(0x26d)||_0x4d6667[_0x5e8aa4(0x181)]===_0x5e8aa4(0x21e))await handleSDKOutput(_0x5beab2,_0x4d6667);else{if(_0x5beab2[_0x5e8aa4(0x19a)]===0x0){if(_0x11ebee&&_0x24eaee)console['log'](_0x5e8aa4(0x2ce)+_0x11ebee+'.'+_0x24eaee);else _0x11ebee?console[_0x5e8aa4(0x22a)](_0x5e8aa4(0x23d)+_0x11ebee):console[_0x5e8aa4(0x22a)]('No\x20attempts\x20found');}else{const _0x1303c7=_0x4d6667['site'],_0x1c3acd=_0x5beab2['map'](_0x5617e4=>{const _0x42eaed=_0x5e8aa4,_0x3e22e1=a41_0x114f43[_0x42eaed(0x229)]('#'+_0x5617e4['id']),_0x53b45f=_0x5617e4[_0x42eaed(0x20a)]?.['id'],_0x7911bf=_0x5617e4[_0x42eaed(0x25f)]||_0x5617e4['sessionId'],_0xb6c79c=_0x53b45f&&_0x7911bf?hyperlink(_0x3e22e1,getWorkflowAttemptUrl(_0x1303c7,_0x53b45f,_0x7911bf,_0x5617e4['id'])):_0x3e22e1,{icon:_0x360380,text:_0x1fe2ae}=getAttemptStatusDisplay(_0x5617e4),_0x152562=(_0x5617e4[_0x42eaed(0x20a)]?.[_0x42eaed(0x179)]||'?')+'.'+(_0x5617e4[_0x42eaed(0x1db)]?.[_0x42eaed(0x179)]||'?'),_0x42cc83=_0x5617e4[_0x42eaed(0x175)]?a41_0x114f43[_0x42eaed(0x229)](_0x5617e4[_0x42eaed(0x175)]):'';return(_0xb6c79c+'\x20'+_0x360380+(_0x1fe2ae?'\x20'+_0x1fe2ae:'')+'\x20'+_0x152562+'\x20'+_0x42cc83)[_0x42eaed(0x26c)]();});await writeOutput(_0x1c3acd[_0x5e8aa4(0x1a7)]('\x0a'),_0x4d6667['output'],_0x5e8aa4(0x28f));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a41_0x949368(0x210);[a41_0x949368(0x27c)]=a41_0x949368(0x18d);async[a41_0x949368(0x252)](_0x495e78){const _0x5700aa=a41_0x949368,{options:_0x2a5985,args:_0x506701,tdx:_0x706792}=_0x495e78,_0x120719=_0x506701[0x0];if(!_0x120719)return console[_0x5700aa(0x24e)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x2a5985['verbose']&&console['error']('Attempt\x20ID:\x20'+_0x120719);const _0x544dfa=await withSpinner(_0x5700aa(0x1e7),()=>_0x706792[_0x5700aa(0x1db)][_0x5700aa(0x242)](_0x120719),{'verbose':_0x2a5985[_0x5700aa(0x2ef)]}),_0x4ce9d7=_0x544dfa['data'];let _0x133c17;!_0x4ce9d7[_0x5700aa(0x1ce)]?_0x133c17=_0x4ce9d7[_0x5700aa(0x251)]?'canceling':_0x5700aa(0x1d5):_0x133c17=_0x4ce9d7[_0x5700aa(0x2d7)]?'success':_0x5700aa(0x24e);let _0xf62f95;if(_0x4ce9d7['createdAt']&&_0x4ce9d7['finishedAt']){const _0x31f64c=new Date(_0x4ce9d7[_0x5700aa(0x201)])[_0x5700aa(0x265)](),_0x55bdc6=new Date(_0x4ce9d7[_0x5700aa(0x235)])['getTime']();_0xf62f95=Math['round']((_0x55bdc6-_0x31f64c)/0x3e8);}const _0x40261a={'attempt_id':_0x4ce9d7['id'],'status':_0x133c17,..._0x4ce9d7['index']!==undefined&&{'index':_0x4ce9d7[_0x5700aa(0x23f)]},..._0x4ce9d7[_0x5700aa(0x20a)]&&{'project':_0x4ce9d7[_0x5700aa(0x20a)]['name']},..._0x4ce9d7['workflow']&&{'workflow':_0x4ce9d7[_0x5700aa(0x1db)][_0x5700aa(0x179)]},..._0x4ce9d7[_0x5700aa(0x1f4)]&&{'session_id':_0x4ce9d7[_0x5700aa(0x1f4)]},..._0x4ce9d7[_0x5700aa(0x175)]&&{'session_time':_0x4ce9d7[_0x5700aa(0x175)]},..._0x4ce9d7['retryAttemptName']&&{'retry_attempt':_0x4ce9d7[_0x5700aa(0x188)]},..._0xf62f95!==undefined&&{'duration_sec':_0xf62f95},..._0x4ce9d7[_0x5700aa(0x201)]&&{'created_at':_0x4ce9d7[_0x5700aa(0x201)]},..._0x4ce9d7[_0x5700aa(0x235)]&&{'finished_at':_0x4ce9d7['finishedAt']},...Object[_0x5700aa(0x2d1)](_0x4ce9d7[_0x5700aa(0x2bb)])[_0x5700aa(0x19a)]>0x0&&{'params':_0x4ce9d7[_0x5700aa(0x2bb)]}};return await handleSingleObjectOutput(_0x40261a,_0x2a5985),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a41_0x949368(0x1ff);[a41_0x949368(0x27c)]=a41_0x949368(0x302);async[a41_0x949368(0x252)](_0x567b6f){const _0x20cd4d=a41_0x949368,{options:_0x5da35a,args:_0x59d5ce,tdx:_0xaaf7fd}=_0x567b6f,_0x95a225=_0x59d5ce[0x0];if(!_0x95a225)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x51b8cb=_0x5da35a[_0x20cd4d(0x240)];_0x5da35a['verbose']&&(console[_0x20cd4d(0x24e)](_0x20cd4d(0x1f0)+_0x95a225),_0x51b8cb&&console[_0x20cd4d(0x24e)](_0x20cd4d(0x2dc)));const _0x1bc9de=await withSpinner(_0x20cd4d(0x186),()=>_0xaaf7fd[_0x20cd4d(0x1db)][_0x20cd4d(0x2e0)](_0x95a225,_0x51b8cb||![]),{'verbose':_0x5da35a[_0x20cd4d(0x2ef)]}),_0x51f1e7=_0x1bc9de[_0x20cd4d(0x297)];return console[_0x20cd4d(0x24e)](_0x20cd4d(0x1ac)+_0x51f1e7[_0x20cd4d(0x19a)]+_0x20cd4d(0x2a2)+(_0x51f1e7[_0x20cd4d(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x51f1e7,_0x5da35a),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x1d0);[a41_0x949368(0x27c)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a41_0x949368(0x252)](_0x2a469c){const _0x375a00=a41_0x949368,{options:_0x5578cf,args:_0x4e3a58,tdx:_0x49d632}=_0x2a469c,_0x342fb3=_0x4e3a58[0x0];let _0x1e056c=_0x4e3a58[0x1];if(!_0x342fb3)return console[_0x375a00(0x24e)](_0x375a00(0x268)),0x1;_0x5578cf[_0x375a00(0x2ef)]&&(console[_0x375a00(0x24e)](_0x375a00(0x1f0)+_0x342fb3),_0x1e056c&&console[_0x375a00(0x24e)](_0x375a00(0x1d8)+_0x1e056c));const _0x7a9e7e=await withSpinner('Fetching\x20log\x20files...',()=>_0x49d632[_0x375a00(0x1db)][_0x375a00(0x269)](_0x342fb3,_0x1e056c),{'verbose':_0x5578cf[_0x375a00(0x2ef)]}),_0x287979=_0x7a9e7e[_0x375a00(0x297)];if(_0x287979[_0x375a00(0x19a)]===0x0)return console[_0x375a00(0x24e)](_0x375a00(0x284)),0x0;if(!_0x1e056c&&(_0x5578cf['json']||_0x5578cf['format']))return await handleSDKOutput(_0x287979,_0x5578cf),0x0;if(!_0x1e056c){const _0x55d297=_0x287979[_0x375a00(0x290)](_0x15cb2d=>({'title':_0x15cb2d[_0x375a00(0x286)]+'\x20('+formatBytes(_0x15cb2d[_0x375a00(0x182)])+')','value':_0x15cb2d[_0x375a00(0x286)]})),_0x782075=await a41_0x2b3a80({'type':'select','name':_0x375a00(0x1ec),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x55d297});if(!_0x782075[_0x375a00(0x1ec)])return console[_0x375a00(0x24e)](_0x375a00(0x2b1)),0x0;_0x1e056c=_0x782075[_0x375a00(0x1ec)];}const _0x4d51d0=await withSpinner(_0x375a00(0x1c6),()=>_0x49d632[_0x375a00(0x1db)][_0x375a00(0x221)](_0x342fb3,_0x1e056c),{'verbose':_0x5578cf[_0x375a00(0x2ef)]}),_0x2d58b8=_0x4d51d0['data'];return _0x2d58b8?console[_0x375a00(0x22a)](_0x2d58b8):console[_0x375a00(0x24e)](_0x375a00(0x1f8)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x949368(0x179)]='workflow:kill';['description']=a41_0x949368(0x1bf);async[a41_0x949368(0x252)](_0x2f786d){const _0x54b0df=a41_0x949368,{options:_0x7fe35d,args:_0x57f157,tdx:_0x11ec20}=_0x2f786d,_0x558198=_0x57f157[0x0];if(!_0x558198)return console[_0x54b0df(0x24e)](_0x54b0df(0x268)),0x1;const _0x48eddf=_0x7fe35d['reason'];_0x7fe35d[_0x54b0df(0x2ef)]&&(console[_0x54b0df(0x24e)](_0x54b0df(0x1f0)+_0x558198),_0x48eddf&&console[_0x54b0df(0x24e)]('Reason:\x20'+_0x48eddf));if(!_0x7fe35d[_0x54b0df(0x2af)]){const _0x43c7d1=await confirmKey(_0x54b0df(0x170)+_0x558198+'?');if(!_0x43c7d1)return console[_0x54b0df(0x24e)](_0x54b0df(0x2b1)),0x0;}const _0x578419=await withSpinner(_0x54b0df(0x281),()=>_0x11ec20[_0x54b0df(0x1db)][_0x54b0df(0x20f)](_0x558198,_0x48eddf),{'verbose':_0x7fe35d['verbose']}),_0x156434=_0x578419[_0x54b0df(0x297)];return console[_0x54b0df(0x24e)]('✔\x20'+_0x156434),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a41_0x949368(0x179)]='workflow:retry';[a41_0x949368(0x27c)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x240eae){const _0x325df3=a41_0x949368,{options:_0x5d15f1,args:_0x51ddb9,tdx:_0x338bc5}=_0x240eae,_0x1b5d7d=_0x51ddb9[0x0];if(!_0x1b5d7d)return console['error'](_0x325df3(0x216)),console[_0x325df3(0x24e)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x37111a=![],_0x21a21b=_0x1b5d7d;if(_0x1b5d7d[_0x325df3(0x2a5)](_0x325df3(0x266)))_0x37111a=!![],_0x21a21b=_0x1b5d7d[_0x325df3(0x16a)](0x8);else{if(_0x1b5d7d['startsWith'](_0x325df3(0x1c9)))_0x37111a=![],_0x21a21b=_0x1b5d7d[_0x325df3(0x16a)](0x8);else return console[_0x325df3(0x24e)](_0x325df3(0x18e)),console['error'](_0x325df3(0x2db)),0x1;}const _0xf582a6=_0x5d15f1[_0x325df3(0x250)],_0x1a7839=_0x5d15f1['resumeFrom'],_0x539521=_0x5d15f1['params'],_0x538e88=_0x5d15f1[_0x325df3(0x1af)];_0x5d15f1[_0x325df3(0x2ef)]&&(console['error'](_0x325df3(0x18b)+(_0x37111a?_0x325df3(0x20e):_0x325df3(0x242))+'\x20'+_0x21a21b),_0xf582a6&&console[_0x325df3(0x24e)]('From\x20task:\x20'+_0xf582a6),_0x1a7839&&console[_0x325df3(0x24e)]('Resume\x20from:\x20'+_0x1a7839),_0x539521&&console[_0x325df3(0x24e)](_0x325df3(0x1e1)+_0x539521),_0x538e88&&console[_0x325df3(0x24e)]('Force:\x20yes'));let _0x2c80b5;if(_0x539521)try{if(_0x539521[_0x325df3(0x2a5)]('@')){const _0x1ba387=await import(_0x325df3(0x295)),_0x8cc7f9=_0x539521[_0x325df3(0x16a)](0x1),_0x4cea48=await _0x1ba387[_0x325df3(0x245)](_0x8cc7f9,_0x325df3(0x298));_0x2c80b5=JSON[_0x325df3(0x199)](_0x4cea48);}else _0x2c80b5=JSON['parse'](_0x539521);}catch{return console[_0x325df3(0x24e)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x5d15f1[_0x325df3(0x2af)]){const _0x2a200e=await confirmKey(_0x325df3(0x25d)+(_0x37111a?_0x325df3(0x20e):'attempt')+'\x20'+_0x21a21b+'?');if(!_0x2a200e)return console[_0x325df3(0x24e)](_0x325df3(0x2b1)),0x0;}let _0x1fc2b6;_0x37111a?_0x1fc2b6=await withSpinner(_0x325df3(0x246),()=>_0x338bc5[_0x325df3(0x1db)]['retrySession'](_0x21a21b,{'fromTask':_0xf582a6,'retryParams':_0x2c80b5}),{'verbose':_0x5d15f1[_0x325df3(0x2ef)]}):_0x1fc2b6=await withSpinner(_0x325df3(0x270),()=>_0x338bc5[_0x325df3(0x1db)][_0x325df3(0x2e8)](_0x21a21b,{'resumeFrom':_0x1a7839,'retryParams':_0x2c80b5,'force':_0x538e88}),{'verbose':_0x5d15f1['verbose']});const _0x345fee=_0x1fc2b6[_0x325df3(0x297)];return console[_0x325df3(0x24e)](_0x325df3(0x1cc)),console[_0x325df3(0x24e)](_0x325df3(0x1eb)+_0x345fee[_0x325df3(0x2a6)]),console[_0x325df3(0x24e)](_0x325df3(0x291)+_0x345fee[_0x325df3(0x1f4)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x272);['description']=a41_0x949368(0x2fa);async['execute'](_0x227e09){const _0x43d6cd=a41_0x949368,{options:_0x3d878e,args:_0x99d1d6,tdx:_0x5b3cf4}=_0x227e09;let _0x3f3ccd=_0x99d1d6[0x0];if(!_0x3f3ccd){const _0x241704=this['resolveProject']([],_0x3d878e),_0x542130=await withSpinner('Loading\x20workflows...',()=>_0x5b3cf4[_0x43d6cd(0x1db)][_0x43d6cd(0x2c2)](_0x241704,{'limit':_0x3d878e[_0x43d6cd(0x20c)]}),{'verbose':_0x3d878e[_0x43d6cd(0x2ef)]}),_0x1bde5f=_0x542130[_0x43d6cd(0x297)];if(_0x1bde5f[_0x43d6cd(0x19a)]===0x0)return console[_0x43d6cd(0x24e)]('No\x20workflows\x20found'),!_0x241704&&console[_0x43d6cd(0x24e)](a41_0x114f43[_0x43d6cd(0x229)](_0x43d6cd(0x183))),0x1;const _0x2b0f79=_0x1bde5f[_0x43d6cd(0x290)](_0x5bcd63=>({'title':_0x5bcd63[_0x43d6cd(0x20a)]?.[_0x43d6cd(0x179)]+'.'+_0x5bcd63['name'],'value':_0x5bcd63[_0x43d6cd(0x20a)]?.[_0x43d6cd(0x179)]+'.'+_0x5bcd63[_0x43d6cd(0x179)],'description':_0x5bcd63[_0x43d6cd(0x1fd)]?'revision:\x20'+_0x5bcd63[_0x43d6cd(0x1fd)]:undefined})),_0x234187=await a41_0x2b3a80({'type':_0x43d6cd(0x204),'name':'workflow','message':_0x43d6cd(0x276),'choices':_0x2b0f79});if(!_0x234187[_0x43d6cd(0x1db)])return 0x1;_0x3f3ccd=_0x234187[_0x43d6cd(0x1db)];}if(!_0x3f3ccd[_0x43d6cd(0x28e)]('.')){const _0x5798c0=this[_0x43d6cd(0x28c)]([],_0x3d878e);if(_0x5798c0)_0x3f3ccd=_0x5798c0+'.'+_0x3f3ccd;else return console['error'](a41_0x114f43[_0x43d6cd(0x1c7)](_0x43d6cd(0x1ee)),_0x43d6cd(0x2ed)),console[_0x43d6cd(0x24e)](a41_0x114f43[_0x43d6cd(0x229)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x537c6f=_0x3d878e[_0x43d6cd(0x2ee)],_0x40d44f=_0x3d878e[_0x43d6cd(0x175)],_0x2cf886={};if(_0x537c6f&&Array[_0x43d6cd(0x2ac)](_0x537c6f))for(const _0x20e2c7 of _0x537c6f){const _0x144c39=_0x20e2c7[_0x43d6cd(0x21c)]('=');if(_0x144c39===-0x1)return console[_0x43d6cd(0x24e)](_0x43d6cd(0x233)+_0x20e2c7),console[_0x43d6cd(0x24e)](_0x43d6cd(0x1ba)),0x1;const _0xcf49bc=_0x20e2c7[_0x43d6cd(0x16a)](0x0,_0x144c39),_0x167c5b=_0x20e2c7['substring'](_0x144c39+0x1);try{_0x2cf886[_0xcf49bc]=JSON[_0x43d6cd(0x199)](_0x167c5b);}catch{_0x2cf886[_0xcf49bc]=_0x167c5b;}}_0x3d878e['verbose']&&(console[_0x43d6cd(0x24e)](_0x43d6cd(0x1ca)+_0x3f3ccd),Object[_0x43d6cd(0x2d1)](_0x2cf886)['length']>0x0&&console[_0x43d6cd(0x24e)]('Parameters:\x20'+JSON['stringify'](_0x2cf886)),_0x40d44f&&console[_0x43d6cd(0x24e)](_0x43d6cd(0x261)+_0x40d44f));const _0x240a12=await withSpinner(_0x43d6cd(0x2b9),()=>_0x5b3cf4[_0x43d6cd(0x1db)][_0x43d6cd(0x23a)](_0x3f3ccd,_0x2cf886,{'sessionTime':_0x40d44f}),{'verbose':_0x3d878e['verbose']}),_0x2aba54=_0x240a12[_0x43d6cd(0x297)];console['error'](_0x43d6cd(0x2e3)),console[_0x43d6cd(0x24e)]('\x20\x20Attempt\x20ID:\x20'+_0x2aba54['id']),console['error'](_0x43d6cd(0x291)+_0x2aba54[_0x43d6cd(0x1f4)]),console[_0x43d6cd(0x24e)](_0x43d6cd(0x1a4)+_0x2aba54[_0x43d6cd(0x20a)]?.[_0x43d6cd(0x179)]),console[_0x43d6cd(0x24e)](_0x43d6cd(0x273)+_0x2aba54['workflow']?.[_0x43d6cd(0x179)]);if(_0x2aba54[_0x43d6cd(0x20a)]?.['id']&&_0x2aba54[_0x43d6cd(0x1f4)]&&_0x2aba54['id']){const _0x2a62a0=_0x3d878e['site'],_0x3d9c80=getConsoleUrl(_0x2a62a0,'/app/workflows/'+_0x2aba54['project']['id']+_0x43d6cd(0x1fb)+_0x2aba54[_0x43d6cd(0x1f4)]+'/attempt/'+_0x2aba54['id']);console[_0x43d6cd(0x24e)]('\x20\x20Console:\x20'+a41_0x114f43[_0x43d6cd(0x2f7)](_0x3d9c80));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x236);[a41_0x949368(0x27c)]=a41_0x949368(0x1b7);async['execute'](_0x3d5f48){const _0x151691=a41_0x949368,{options:_0x1d447c,args:_0x5abbbd,tdx:_0xdfdc96}=_0x3d5f48,_0x3016f7=_0x5abbbd[0x0],_0x3680fa=_0x5abbbd[0x1]||'.';if(!_0x3016f7)return console[_0x151691(0x24e)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x151691(0x24e)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x242c27=_0x1d447c['revision'];_0x1d447c[_0x151691(0x2ef)]&&(console[_0x151691(0x24e)]('Project:\x20'+_0x3016f7),console[_0x151691(0x24e)](_0x151691(0x22c)+_0x3680fa),_0x242c27&&console[_0x151691(0x24e)](_0x151691(0x26a)+_0x242c27));const _0x11c96f=await withSpinner(_0x151691(0x25a)+_0x3016f7+_0x151691(0x212),()=>_0xdfdc96[_0x151691(0x1db)][_0x151691(0x2df)](_0x3016f7,_0x3680fa,{'revision':_0x242c27}),{'verbose':_0x1d447c[_0x151691(0x2ef)]}),_0x32dc62=_0x11c96f[_0x151691(0x297)];return console['error']('✔\x20Downloaded\x20'+_0x32dc62[_0x151691(0x285)]),console['error'](_0x151691(0x19f)+_0x32dc62[_0x151691(0x1fd)]),console[_0x151691(0x24e)](_0x151691(0x1b0)+_0x32dc62[_0x151691(0x29d)]),console[_0x151691(0x24e)](_0x151691(0x2cf)+_0x3680fa+'/'+_0x32dc62[_0x151691(0x285)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x1d4);[a41_0x949368(0x27c)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a41_0x949368(0x252)](_0x144f74){const _0x53f49e=a41_0x949368,{options:_0x39be90,args:_0x484261,tdx:_0x3d1cbb}=_0x144f74;let _0x54bb4d='.',_0x4c324f=_0x39be90[_0x53f49e(0x179)];if(_0x484261[0x0]){const {promises:_0x241d4b}=await import('fs');try{const _0x2c351a=await _0x241d4b['stat'](_0x484261[0x0]);if(_0x2c351a[_0x53f49e(0x271)]())_0x54bb4d=_0x484261[0x0];else return console[_0x53f49e(0x24e)](_0x53f49e(0x18c)+_0x484261[0x0]+_0x53f49e(0x288)),0x1;}catch{_0x4c324f=_0x484261[0x0],_0x54bb4d='.';}}const _0x3d3833=_0x39be90[_0x53f49e(0x1fd)],_0x6f4d24=_0x39be90['skipValidation'];_0x39be90[_0x53f49e(0x2ef)]&&(console[_0x53f49e(0x24e)](_0x53f49e(0x1f3)+_0x54bb4d),_0x4c324f&&console['error']('Project\x20name:\x20'+_0x4c324f),_0x3d3833&&console[_0x53f49e(0x24e)](_0x53f49e(0x26a)+_0x3d3833),_0x6f4d24&&console[_0x53f49e(0x24e)](_0x53f49e(0x294)));const _0x2f776b=await withSpinner(_0x53f49e(0x248),()=>_0x3d1cbb['workflow']['push'](_0x54bb4d,{'projectName':_0x4c324f,'revision':_0x3d3833,'skipValidation':_0x6f4d24}),{'verbose':_0x39be90[_0x53f49e(0x2ef)]}),_0x1dca25=_0x2f776b[_0x53f49e(0x297)];return console['error']('✔\x20Pushed\x20'+_0x1dca25[_0x53f49e(0x285)]),console[_0x53f49e(0x24e)]('\x20\x20Project\x20ID:\x20'+_0x1dca25[_0x53f49e(0x16d)]),console[_0x53f49e(0x24e)](_0x53f49e(0x19f)+_0x1dca25[_0x53f49e(0x1fd)]),await this[_0x53f49e(0x287)](_0x3d1cbb,_0x1dca25['projectName'],_0x39be90['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x21b);[a41_0x949368(0x27c)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a41_0x949368(0x252)](_0x43dc07){const _0xf0ef1d=a41_0x949368,{options:_0x2bdd9f,args:_0x1eb7f7,tdx:_0xf5c3e7}=_0x43dc07,_0x53fed4=_0x1eb7f7[0x0],_0x2f4490=_0x1eb7f7[0x1];if(!_0x53fed4)return console[_0xf0ef1d(0x24e)](a41_0x114f43[_0xf0ef1d(0x1c7)](_0xf0ef1d(0x1ee)),_0xf0ef1d(0x1c8)),console[_0xf0ef1d(0x24e)](a41_0x114f43[_0xf0ef1d(0x229)](_0xf0ef1d(0x234))),0x1;const _0x578e6e=_0x2bdd9f['revision'];_0x2bdd9f['verbose']&&(console[_0xf0ef1d(0x24e)](_0xf0ef1d(0x2b3)+_0x53fed4),_0x2f4490&&console[_0xf0ef1d(0x24e)](_0xf0ef1d(0x1c4)+_0x2f4490),_0x578e6e&&console[_0xf0ef1d(0x24e)]('Revision:\x20'+_0x578e6e),_0x2bdd9f[_0xf0ef1d(0x1fe)]&&console[_0xf0ef1d(0x24e)](_0xf0ef1d(0x29a)));const _0x35d6a2=await withSpinner('Pulling\x20project\x20'+_0x53fed4+_0xf0ef1d(0x212),()=>_0xf5c3e7[_0xf0ef1d(0x1db)]['pullProject'](_0x53fed4,{'targetDir':_0x2f4490,'revision':_0x578e6e}),{'verbose':_0x2bdd9f[_0xf0ef1d(0x2ef)]}),_0x1c554a=_0x35d6a2[_0xf0ef1d(0x297)];_0x1c554a[_0xf0ef1d(0x253)]?console[_0xf0ef1d(0x24e)](_0xf0ef1d(0x1b5)+_0x1c554a['projectName']):console['error']('✔\x20Project:\x20'+_0x1c554a[_0xf0ef1d(0x285)]);console['error'](_0xf0ef1d(0x19f)+_0x1c554a['revision']),console['error'](_0xf0ef1d(0x1b4)+(a41_0x4e3ac0[_0xf0ef1d(0x200)](process[_0xf0ef1d(0x18f)](),_0x1c554a['targetDir'])||'.')),console[_0xf0ef1d(0x24e)](_0xf0ef1d(0x1e2)+a41_0x114f43[_0xf0ef1d(0x2ad)]('+'+_0x1c554a[_0xf0ef1d(0x283)]['new']+_0xf0ef1d(0x194))+',\x20'+(a41_0x114f43['yellow']('~'+_0x1c554a[_0xf0ef1d(0x283)][_0xf0ef1d(0x1d9)]+'\x20modified')+',\x20')+(a41_0x114f43[_0xf0ef1d(0x1c7)]('-'+_0x1c554a[_0xf0ef1d(0x283)][_0xf0ef1d(0x202)]+_0xf0ef1d(0x24a))+',\x20')+(''+a41_0x114f43['dim'](_0x1c554a['summary'][_0xf0ef1d(0x1b2)]+'\x20unchanged')));for(const _0x15ea9d of _0x1c554a[_0xf0ef1d(0x299)]){_0x15ea9d[_0xf0ef1d(0x1ed)]===_0xf0ef1d(0x1d9)&&_0x15ea9d[_0xf0ef1d(0x1d6)]&&(console[_0xf0ef1d(0x24e)]('\x0a'+a41_0x114f43[_0xf0ef1d(0x2f7)](_0xf0ef1d(0x262)+_0x15ea9d[_0xf0ef1d(0x2f8)])),console[_0xf0ef1d(0x24e)](_0x15ea9d[_0xf0ef1d(0x1d6)]));}if(!_0x1c554a['hasChanges'])return saveSessionContext({'workflow_project':_0x1c554a[_0xf0ef1d(0x285)]},_0x2bdd9f[_0xf0ef1d(0x20e)]),console[_0xf0ef1d(0x24e)](a41_0x114f43[_0xf0ef1d(0x2ad)](_0xf0ef1d(0x2a8))),console[_0xf0ef1d(0x24e)](a41_0x114f43[_0xf0ef1d(0x229)](_0xf0ef1d(0x2fb)+_0x1c554a[_0xf0ef1d(0x285)])),0x0;if(_0x2bdd9f[_0xf0ef1d(0x1fe)])return console[_0xf0ef1d(0x24e)](a41_0x114f43[_0xf0ef1d(0x2de)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x2bdd9f['yes']){const _0x44f59d=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x44f59d)return console['error'](_0xf0ef1d(0x2b1)),0x0;}await withSpinner(_0xf0ef1d(0x2c8),()=>_0xf5c3e7[_0xf0ef1d(0x1db)]['applyPullProject'](_0x1c554a,{'revision':_0x578e6e}),{'verbose':_0x2bdd9f[_0xf0ef1d(0x2ef)]}),saveSessionContext({'workflow_project':_0x1c554a[_0xf0ef1d(0x285)]},_0x2bdd9f[_0xf0ef1d(0x20e)]),console[_0xf0ef1d(0x24e)](a41_0x114f43['green'](_0xf0ef1d(0x1b3)));const _0x5b75d7=a41_0x4e3ac0[_0xf0ef1d(0x200)](process[_0xf0ef1d(0x18f)](),_0x1c554a[_0xf0ef1d(0x211)])||'.';return console['error'](a41_0x114f43[_0xf0ef1d(0x229)]('\x20\x20Location:\x20'+_0x5b75d7)),console[_0xf0ef1d(0x24e)](a41_0x114f43['dim'](_0xf0ef1d(0x2fb)+_0x1c554a['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a41_0x949368(0x179)]='workflow:push';[a41_0x949368(0x27c)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a41_0x949368(0x252)](_0x1f25af){const _0x190390=a41_0x949368,{options:_0x4f0075,args:_0x58348b,tdx:_0xfbb4e4}=_0x1f25af,_0x5db160=this[_0x190390(0x1dc)](_0x58348b,_0x4f0075),_0x280620=_0x4f0075[_0x190390(0x1fd)],_0x520df4=_0x4f0075[_0x190390(0x29b)];_0x4f0075[_0x190390(0x2ef)]&&(_0x5db160&&console[_0x190390(0x24e)]('Source\x20directory:\x20'+_0x5db160),_0x280620&&console[_0x190390(0x24e)](_0x190390(0x26a)+_0x280620),_0x4f0075['dryRun']&&console[_0x190390(0x24e)]('Dry\x20run:\x20yes'),_0x520df4&&console['error'](_0x190390(0x294)));let _0x152276;try{_0x152276=await withSpinner(_0x190390(0x1de),()=>_0xfbb4e4[_0x190390(0x1db)][_0x190390(0x2c5)]({'sourceDir':_0x5db160,'revision':_0x280620,'skipValidation':_0x520df4}),{'verbose':_0x4f0075[_0x190390(0x2ef)]});}catch(_0x118853){if(_0x118853 instanceof Error&&_0x118853[_0x190390(0x24c)]['includes'](_0x190390(0x176)))return console[_0x190390(0x24e)](a41_0x114f43['red'](_0x190390(0x1ee)),_0x190390(0x1e9)),_0x4f0075[_0x190390(0x2b2)]?console[_0x190390(0x24e)](a41_0x114f43[_0x190390(0x229)](_0x190390(0x1f7)+_0x4f0075[_0x190390(0x2b2)]+_0x190390(0x267)+_0x4f0075[_0x190390(0x2b2)]+'\x27')):console[_0x190390(0x24e)](a41_0x114f43[_0x190390(0x229)](_0x190390(0x1a6))),0x1;throw _0x118853;}const _0x3f0dc1=_0x152276[_0x190390(0x297)];console[_0x190390(0x24e)](_0x190390(0x28d)+_0x3f0dc1[_0x190390(0x285)]),console[_0x190390(0x24e)](_0x190390(0x292)+_0x3f0dc1[_0x190390(0x207)]),console['error']('\x20\x20Revision:\x20'+_0x3f0dc1[_0x190390(0x1fd)]),console[_0x190390(0x24e)](_0x190390(0x1e2)+a41_0x114f43[_0x190390(0x2ad)]('+'+_0x3f0dc1[_0x190390(0x283)]['new']+'\x20new')+',\x20'+(a41_0x114f43[_0x190390(0x2de)]('~'+_0x3f0dc1['summary'][_0x190390(0x1d9)]+_0x190390(0x257))+',\x20')+(a41_0x114f43[_0x190390(0x1c7)]('-'+_0x3f0dc1[_0x190390(0x283)][_0x190390(0x202)]+_0x190390(0x24a))+',\x20')+(''+a41_0x114f43[_0x190390(0x229)](_0x3f0dc1[_0x190390(0x283)]['unchanged']+_0x190390(0x166))));for(const _0xd16a51 of _0x3f0dc1[_0x190390(0x299)]){_0xd16a51[_0x190390(0x1ed)]==='modified'&&_0xd16a51[_0x190390(0x1d6)]&&(console[_0x190390(0x24e)]('\x0a'+a41_0x114f43[_0x190390(0x2f7)](_0x190390(0x262)+_0xd16a51[_0x190390(0x2f8)])),console[_0x190390(0x24e)](_0xd16a51['diff']));}if(!_0x3f0dc1[_0x190390(0x20b)])return console['error'](a41_0x114f43['green'](_0x190390(0x173))),await this[_0x190390(0x287)](_0xfbb4e4,_0x3f0dc1[_0x190390(0x285)],_0x4f0075[_0x190390(0x1aa)]),0x0;if(_0x4f0075[_0x190390(0x1fe)])return console[_0x190390(0x24e)](a41_0x114f43[_0x190390(0x2de)](_0x190390(0x185))),0x0;if(!_0x4f0075[_0x190390(0x2af)]){const _0x4d9c39=await confirmKey(_0x190390(0x2d6));if(!_0x4d9c39)return console[_0x190390(0x24e)](_0x190390(0x2b1)),0x0;}const _0x1c3f1e=await withSpinner(_0x190390(0x247),()=>_0xfbb4e4[_0x190390(0x1db)][_0x190390(0x277)](_0x3f0dc1),{'verbose':_0x4f0075['verbose']}),_0x164eaf=_0x1c3f1e[_0x190390(0x297)];return console['error'](a41_0x114f43[_0x190390(0x2ad)]('✔\x20Push\x20complete')),console['error']('\x20\x20Project\x20ID:\x20'+_0x164eaf['projectId']),console[_0x190390(0x24e)](_0x190390(0x19f)+_0x164eaf[_0x190390(0x1fd)]),await this['showWorkflowConsoleUrl'](_0xfbb4e4,_0x164eaf[_0x190390(0x285)],_0x4f0075['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a41_0x949368(0x213);[a41_0x949368(0x27c)]=a41_0x949368(0x228);async[a41_0x949368(0x252)](_0x278931){const _0x428ada=a41_0x949368,{options:_0x27ac2f,args:_0x11595c,tdx:_0x9af15e}=_0x278931,_0x3ffe07=this[_0x428ada(0x1dc)](_0x11595c,_0x27ac2f),_0x4c4cf9=_0x27ac2f[_0x428ada(0x179)],_0x23429b=_0x27ac2f[_0x428ada(0x1fd)],_0x22b83e=_0x27ac2f[_0x428ada(0x29b)];if(!_0x3ffe07)return console[_0x428ada(0x24e)](a41_0x114f43[_0x428ada(0x1c7)](_0x428ada(0x1ee)),'Source\x20directory\x20is\x20required'),console['error'](a41_0x114f43['dim'](_0x428ada(0x191))),console['error'](a41_0x114f43[_0x428ada(0x229)](_0x428ada(0x27b))),0x1;if(!_0x4c4cf9)return console['error'](a41_0x114f43[_0x428ada(0x1c7)](_0x428ada(0x1ee)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x428ada(0x24e)](a41_0x114f43[_0x428ada(0x229)](_0x428ada(0x191))),0x1;_0x27ac2f[_0x428ada(0x2ef)]&&(console[_0x428ada(0x24e)]('Source\x20directory:\x20'+_0x3ffe07),console['error'](_0x428ada(0x178)+_0x4c4cf9),_0x23429b&&console[_0x428ada(0x24e)](_0x428ada(0x26a)+_0x23429b),_0x27ac2f[_0x428ada(0x1fe)]&&console[_0x428ada(0x24e)](_0x428ada(0x29a)),_0x22b83e&&console['error'](_0x428ada(0x294)));const _0xe39521=await withSpinner(_0x428ada(0x1cd),()=>_0x9af15e[_0x428ada(0x1db)][_0x428ada(0x2b5)](_0x3ffe07,_0x4c4cf9,{'revision':_0x23429b,'skipValidation':_0x22b83e}),{'verbose':_0x27ac2f[_0x428ada(0x2ef)]}),_0x2a0f79=_0xe39521[_0x428ada(0x297)];console[_0x428ada(0x24e)](_0x428ada(0x203)+_0x2a0f79[_0x428ada(0x207)]);_0x2a0f79[_0x428ada(0x224)]&&console['error'](_0x428ada(0x239)+_0x2a0f79[_0x428ada(0x224)]);console['error']('New\x20project\x20name:\x20'+_0x2a0f79[_0x428ada(0x2f2)]),console[_0x428ada(0x24e)](_0x428ada(0x26a)+_0x2a0f79['revision']),console[_0x428ada(0x24e)]('Files\x20to\x20upload:\x20'+_0x2a0f79[_0x428ada(0x243)]);_0x2a0f79[_0x428ada(0x305)]&&(console[_0x428ada(0x24e)](a41_0x114f43['yellow'](_0x428ada(0x17c)+_0x2a0f79[_0x428ada(0x2f2)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x2a0f79[_0x428ada(0x1f1)]+')')),console['error'](a41_0x114f43[_0x428ada(0x2de)](_0x428ada(0x24b))));if(_0x27ac2f[_0x428ada(0x1fe)])return console[_0x428ada(0x24e)](a41_0x114f43[_0x428ada(0x2de)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x27ac2f[_0x428ada(0x2af)]){const _0x7f6e90=_0x2a0f79['sourceProjectName']||a41_0x4e3ac0[_0x428ada(0x2cb)](_0x3ffe07),_0x179af4=_0x2a0f79['targetExists']?_0x428ada(0x1cb)+_0x4c4cf9+_0x428ada(0x2e7):_0x428ada(0x16f)+_0x7f6e90+_0x428ada(0x274)+_0x4c4cf9+'\x22?',_0x327619=await confirmKey(_0x179af4);if(!_0x327619)return console['error']('Cancelled'),0x0;}const _0x53745d=await withSpinner(_0x2a0f79['targetExists']?_0x428ada(0x18a)+_0x4c4cf9+'...':_0x428ada(0x258)+_0x4c4cf9+_0x428ada(0x212),()=>_0x9af15e[_0x428ada(0x1db)]['executeCloneProject'](_0x2a0f79),{'verbose':_0x27ac2f[_0x428ada(0x2ef)]}),_0x51c808=_0x53745d['data'];return console[_0x428ada(0x24e)](a41_0x114f43['green'](_0x2a0f79[_0x428ada(0x305)]?_0x428ada(0x1be):'✔\x20Clone\x20complete')),console[_0x428ada(0x24e)](_0x428ada(0x1a4)+_0x51c808['newProjectName']),console[_0x428ada(0x24e)](_0x428ada(0x174)+_0x51c808['newProjectId']),console[_0x428ada(0x24e)]('\x20\x20Revision:\x20'+_0x51c808[_0x428ada(0x1fd)]),await this[_0x428ada(0x287)](_0x9af15e,_0x51c808[_0x428ada(0x2f2)],_0x27ac2f[_0x428ada(0x1aa)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x2c4);[a41_0x949368(0x27c)]=a41_0x949368(0x2b0);async[a41_0x949368(0x252)](_0x27780b){const _0x7ce411=a41_0x949368,{options:_0x2eb8ae,args:_0x52d390,tdx:_0x441c29}=_0x27780b,_0x5d998d=_0x52d390[0x0];if(!_0x5d998d)return console[_0x7ce411(0x24e)](_0x7ce411(0x1a2)),console[_0x7ce411(0x24e)](_0x7ce411(0x2ff)),0x1;_0x2eb8ae[_0x7ce411(0x2ef)]&&console[_0x7ce411(0x24e)](_0x7ce411(0x2b3)+_0x5d998d);if(!_0x2eb8ae[_0x7ce411(0x2af)]){const _0x39cc14=await confirmKey(_0x7ce411(0x29c)+_0x5d998d+_0x7ce411(0x20d));if(!_0x39cc14)return console[_0x7ce411(0x24e)](_0x7ce411(0x2b1)),0x0;}const _0x52afe3=await withSpinner(_0x7ce411(0x2fe)+_0x5d998d+_0x7ce411(0x212),()=>_0x441c29[_0x7ce411(0x1db)][_0x7ce411(0x231)](_0x5d998d),{'verbose':_0x2eb8ae['verbose']}),_0x12953d=_0x52afe3[_0x7ce411(0x297)];return console[_0x7ce411(0x24e)](_0x7ce411(0x17e)+_0x12953d['projectName']),console[_0x7ce411(0x24e)](_0x7ce411(0x174)+_0x12953d[_0x7ce411(0x16d)]),0x0;}}export function parseKeyValue(_0x5a342c){const _0x31f6e5=a41_0x949368,_0x48d7db=_0x5a342c['indexOf']('=');if(_0x48d7db===-0x1)throw new Error('Invalid\x20format:\x20'+_0x5a342c+_0x31f6e5(0x1b8));const _0x39485=_0x5a342c[_0x31f6e5(0x16a)](0x0,_0x48d7db),_0x32f5ac=_0x5a342c[_0x31f6e5(0x16a)](_0x48d7db+0x1);if(!_0x39485)throw new Error(_0x31f6e5(0x2be));return{'key':_0x39485,'value':_0x32f5ac};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a41_0x949368(0x179)]='workflow:secrets:list';[a41_0x949368(0x27c)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async['execute'](_0x19f9ee){const _0x26e649=a41_0x949368,{options:_0x48f737,args:_0xe80c4d,tdx:_0x22fd13}=_0x19f9ee,_0x55230f=this[_0x26e649(0x264)](_0xe80c4d,_0x48f737);if(!_0x55230f)return 0x1;_0x48f737['verbose']&&console[_0x26e649(0x24e)](_0x26e649(0x2b3)+_0x55230f);const _0x5f589f=await withSpinner('Listing\x20secrets...',()=>_0x22fd13[_0x26e649(0x1db)][_0x26e649(0x27f)](_0x55230f),{'verbose':_0x48f737['verbose']}),{secrets:_0x2db657}=_0x5f589f['data'];return console[_0x26e649(0x24e)](_0x26e649(0x1ac)+_0x2db657['length']+'\x20secret'+(_0x2db657[_0x26e649(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x2db657,_0x48f737),0x0;}}function a41_0x56aa(){const _0x10069c=['\x0a✔\x20No\x20changes\x20to\x20push','\x20\x20Project\x20ID:\x20','sessionTime','No\x20workflow\x20tdx.json\x20found','\x20\x20Console:\x20','New\x20project\x20name:\x20','name','getMonth','msPerChar','\x0a⚠\x20Project\x20\x22','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','✔\x20Deleted\x20project\x20','blue','No\x20workflows\x20found\x20in\x20project:\x20','format','fileSize','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','values','\x0aDry\x20run\x20-\x20nothing\x20pushed','Getting\x20attempt\x20tasks...','icon','retryAttemptName','34955UEJjNT','Updating\x20','Target:\x20','Error:\x20','Show\x20specific\x20attempt\x20details','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','cwd','Using\x20attempt\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','getFullYear','Project\x20filter:\x20','\x20new','json','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','buildTimelineData','some','parse','length','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','all','lastAttempt','Usage:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Revision:\x20','unknown','\x20has\x20no\x20attempts','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','List\x20workflow\x20execution\x20sessions','\x20\x20Project:\x20','Filter:\x20project=','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','join','List\x20workflows','478302bcpKUP','site','workflow:secrets:set','✔\x20Found\x20','rows','LABEL_WIDTH_DIVISOR','force','\x20\x20Files\x20extracted:\x20','planned','unchanged','✔\x20Pull\x20complete','\x20\x20Target:\x20','✔\x20New\x20project:\x20','canceling','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','.\x20Expected\x20format:\x20KEY=VALUE','Error:\x20Secret\x20key\x20is\x20required','Expected\x20format:\x20--param\x20key=value','\x20sessions\x20','24sRQXpg','toLowerCase','✔\x20Project\x20updated','Kill\x20a\x20running\x20attempt','slice','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','state','updatedAt','Target\x20directory:\x20','renderSessionsTimeline','Downloading\x20logs...','red','Project\x20name\x20is\x20required','attempt:','Workflow:\x20','\x0aUpdate\x20existing\x20project\x20\x22','✔\x20Retry\x20started','Analyzing\x20project...','done','navigateSessionsInteractive','workflow:logs',',\x20Workflow:\x20','List\x20all\x20workflow\x20projects','\x20(use\x20--limit\x20to\x20show\x20more)','workflow:upload','running','diff','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Task\x20name:\x20','modified','has','workflow','resolveProjectDir','match','Analyzing\x20changes...','context','set','Params:\x20','\x20\x20Changes:\x20','workflow:attempts','Total:\x20','Loading\x20session...','attempts','Getting\x20attempt\x20details...','ICON_WIDTH','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20\x20New\x20attempt\x20ID:\x20','task','type','Error:','fullName','Attempt\x20ID:\x20','existingProjectId','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Project\x20directory:\x20','sessionId','fill','max','Tip:\x20cd\x20to\x20workflows/','No\x20log\x20content\x20found','output','stdout','/sessions/','(unknown)','revision','dryRun','workflow:tasks','relative','createdAt','deleted','Source:\x20','select','No\x20sessions\x20found','Attempt:\x20','sourceDir','TASK_NAME_WIDTH','end','project','hasChanges','limit','\x22?\x20This\x20cannot\x20be\x20undone.','session','kill','workflow:attempt','targetDir','...','workflow:clone','workflow:use','min','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','title','resolveProjectId','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','14338140wzDVQa','workflow:pull','indexOf','No\x20workflow\x20projects\x20found','table','renderSingleTimeline','\x20workflow','logs','white','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','sourceProjectName','\x27\x20from\x20project\x20\x27','Key:\x20','getDate','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','dim','log','\x20of\x20','Output\x20directory:\x20','get','Listing\x20workflows...','window','getMinutes','delete','\x27...','Error:\x20Invalid\x20parameter\x20format:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','finishedAt','workflow:download','Listing\x20workflow\x20projects...','duration','Source\x20project:\x20','run','List\x20workflow\x20attempts','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','No\x20attempts\x20found\x20in\x20project:\x20','\x20to\x20see\x20detailed\x20logs','index','includeSubtasks','Session\x20','attempt','fileCount','clear','readFile','Retrying\x20session...','Pushing\x20project...','Pushing\x20workflow\x20project...','Setting\x20secret...','\x20deleted','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','message','metadata','error','LABEL_MIN_SPACING','fromTask','cancelRequested','execute','isNewProject','columns','workflow:workflows','write','\x20modified','Cloning\x20to\x20','Session\x20not\x20found:\x20','Downloading\x20project\x20','start','POLL_INTERVAL_MS','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','session_id','Pattern:\x20','Session\x20time:\x20','---\x20','\x20tasks','requireProject','getTime','session:','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Error:\x20Attempt\x20ID\x20is\x20required','logFiles','Revision:\x20','repeat','trimEnd','jsonl','isTTY','workflow:projects','Retrying\x20attempt...','isDirectory','workflow:run','\x20\x20Workflow:\x20','\x22\x20to\x20new\x20project\x20\x22','Loading\x20sessions...','Select\x20a\x20workflow\x20to\x20run','executePushProject','parseProjectWorkflowPattern','pending','status','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','description','MAX_LABEL_COUNT','resolve','listSecrets','sort','Killing\x20attempt...','GUTTER','summary','No\x20log\x20files\x20found\x20for\x20this\x20attempt','projectName','taskName','showWorkflowConsoleUrl','\x20is\x20not\x20a\x20directory','Failed\x20to\x20fetch\x20attempt\x20data','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','sessions','resolveProject','✔\x20Project:\x20','includes','list','map','\x20\x20Session\x20ID:\x20','\x20\x20Source:\x20','value','Validation:\x20skipped','fs/promises','Latest\x20session\x20has\x20no\x20attempt','data','utf-8','changes','Dry\x20run:\x20yes','skipValidation','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','filesExtracted','pollTimeline','MAX_POLL_ITERATIONS','Listing\x20workflow\x20sessions...','MIN_LABEL_COUNT','\x20task','3222324sOxFib','workflowName','startsWith','attemptId','text','\x0a✔\x20Already\x20up\x20to\x20date','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','📁\x20','size','isArray','green','padStart','yes','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Cancelled','workflowProject','Project:\x20','from','prepareCloneProject','getHours','\x20attempt','split','Starting\x20workflow\x20run...','renderTimeline','params','tdx.json','Filter:\x20','Key\x20cannot\x20be\x20empty','MAX_TASKS_DISPLAY','floor','2490744XuLepU','workflows','MAX_TIMELINE_WIDTH','workflow:delete','preparePushProject','group_error','follow','Writing\x20files...','startedAt','Select\x20a\x20session\x20to\x20view\x20timeline:','basename','workflow:timeline','369033LlJQTI','No\x20attempts\x20found\x20for:\x20','\x20\x20Location:\x20','push','keys','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','✔\x20Workflow\x20project\x20context\x20cleared.','No\x20workflows\x20found','autocomplete','\x0aPush\x20these\x20changes?','success','startTime','every','✔\x20Secret\x20\x27','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Including\x20subtasks:\x20yes','\x20session','yellow','download','tasks','ICON_SPACING','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','✔\x20Workflow\x20run\x20started','Include\x20retried:\x20yes','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','No\x20sessions\x20found\x20in\x20project:\x20','\x22\x20with\x20new\x20revision?','retryAttempt','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x0aFailed\x20to\x20fetch\x20attempt\x20data','(use\x20--limit\x20to\x20see\x20more)','MIN_TIMELINE_WIDTH','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','param','verbose','1391735buOnuW','find','newProjectName','localeCompare','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x20from\x20session\x20','\x1b[1A\x1b[2K','cyan','path','Error:\x20Project\x20name\x20is\x20required','Start\x20a\x20workflow\x20run','\x20\x20Session\x20context\x20set\x20to:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','📋\x20','Deleting\x20project\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','toISOString','total','Show\x20tasks\x20for\x20an\x20attempt','🔄\x20','Resolving\x20project\x20\x27','targetExists','\x20\x20tdx\x20wf\x20use\x20<project>','key','\x20unchanged','77qCrBTW','No\x20sessions\x20found\x20for:\x20','generateSessionTimelineRows','substring','\x20-\x20','now','projectId','8ntdJIf','\x0aClone\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','projects','filter'];a41_0x56aa=function(){return _0x10069c;};return a41_0x56aa();}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x949368(0x179)]=a41_0x949368(0x1ab);[a41_0x949368(0x27c)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a41_0x949368(0x252)](_0x60cf06){const _0x1e8017=a41_0x949368,{options:_0x2fbe18,args:_0x3fed81,tdx:_0x5ab0d3}=_0x60cf06;let _0x248281,_0x3a2447;if(_0x3fed81['length']>=0x2)_0x248281=_0x3fed81[0x0],_0x3a2447=_0x3fed81[0x1];else{if(_0x3fed81[_0x1e8017(0x19a)]===0x1&&_0x2fbe18[_0x1e8017(0x2b2)])_0x248281=_0x2fbe18[_0x1e8017(0x2b2)],_0x3a2447=_0x3fed81[0x0];else return _0x3fed81[_0x1e8017(0x19a)]===0x1?(console['error'](_0x1e8017(0x2f9)),console['error'](_0x1e8017(0x183)),0x1):(console[_0x1e8017(0x24e)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x1e8017(0x24e)](_0x1e8017(0x223)),0x1);}let _0x26bf7f,_0x3b4c68;try{({key:_0x26bf7f,value:_0x3b4c68}=parseKeyValue(_0x3a2447));}catch(_0x553206){return _0x553206 instanceof Error&&console['error'](a41_0x114f43[_0x1e8017(0x1c7)](_0x1e8017(0x1ee)),_0x553206[_0x1e8017(0x24c)]),0x1;}_0x2fbe18['verbose']&&(console[_0x1e8017(0x24e)]('Project:\x20'+_0x248281),console[_0x1e8017(0x24e)](_0x1e8017(0x226)+_0x26bf7f));const _0x49d762=await withSpinner(_0x1e8017(0x249),()=>_0x5ab0d3[_0x1e8017(0x1db)]['setSecret'](_0x248281,_0x26bf7f,_0x3b4c68),{'verbose':_0x2fbe18[_0x1e8017(0x2ef)]}),_0x4f2f3f=_0x49d762[_0x1e8017(0x297)];return console[_0x1e8017(0x24e)](_0x1e8017(0x2da)+_0x4f2f3f[_0x1e8017(0x307)]+_0x1e8017(0x1c1)+_0x4f2f3f['projectName']+'\x27'),(_0x2fbe18[_0x1e8017(0x195)]||_0x2fbe18[_0x1e8017(0x26d)])&&await handleSingleObjectOutput(_0x4f2f3f,_0x2fbe18),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a41_0x949368(0x179)]='workflow:secrets:delete';[a41_0x949368(0x27c)]=a41_0x949368(0x2e9);async[a41_0x949368(0x252)](_0x3881f1){const _0xbe08ea=a41_0x949368,{options:_0x1c20bd,args:_0xac916b,tdx:_0x15fa00}=_0x3881f1;let _0x7021fd,_0x4c1851;if(_0xac916b[_0xbe08ea(0x19a)]>=0x2)_0x7021fd=_0xac916b[0x0],_0x4c1851=_0xac916b[0x1];else{if(_0xac916b[_0xbe08ea(0x19a)]===0x1&&_0x1c20bd['workflowProject'])_0x7021fd=_0x1c20bd[_0xbe08ea(0x2b2)],_0x4c1851=_0xac916b[0x0];else return _0xac916b[_0xbe08ea(0x19a)]===0x1?(console[_0xbe08ea(0x24e)]('Error:\x20Project\x20name\x20is\x20required'),console[_0xbe08ea(0x24e)](_0xbe08ea(0x183)),0x1):(console['error'](_0xbe08ea(0x1b9)),console[_0xbe08ea(0x24e)](_0xbe08ea(0x17d)),0x1);}_0x1c20bd[_0xbe08ea(0x2ef)]&&(console[_0xbe08ea(0x24e)]('Project:\x20'+_0x7021fd),console[_0xbe08ea(0x24e)](_0xbe08ea(0x226)+_0x4c1851));if(!_0x1c20bd['yes']){const _0x55797d=await confirmKey(_0xbe08ea(0x2d2)+_0x4c1851+_0xbe08ea(0x225)+_0x7021fd+'\x27?');if(!_0x55797d)return console[_0xbe08ea(0x24e)]('Cancelled'),0x0;}const _0x476854=await withSpinner('Deleting\x20secret...',()=>_0x15fa00[_0xbe08ea(0x1db)]['deleteSecret'](_0x7021fd,_0x4c1851),{'verbose':_0x1c20bd[_0xbe08ea(0x2ef)]}),_0x10afe7=_0x476854['data'];return console[_0xbe08ea(0x24e)](_0xbe08ea(0x2da)+_0x10afe7[_0xbe08ea(0x307)]+_0xbe08ea(0x196)+_0x10afe7[_0xbe08ea(0x285)]+'\x27'),(_0x1c20bd[_0xbe08ea(0x195)]||_0x1c20bd[_0xbe08ea(0x26d)])&&await handleSingleObjectOutput(_0x10afe7,_0x1c20bd),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(_0x5aa526){const _0x2f0ac0=a41_0x949368,_0x39ffeb=Math['floor'](_0x5aa526/0x3e8),_0xd88583=Math[_0x2f0ac0(0x2c0)](_0x39ffeb/0x3c),_0x216915=Math[_0x2f0ac0(0x2c0)](_0xd88583/0x3c),_0xbfe3c4=Math[_0x2f0ac0(0x2c0)](_0x216915/0x18);if(_0xbfe3c4>0x0){const _0x4e3454=_0x216915%0x18;return _0x4e3454>0x0?_0xbfe3c4+'d\x20'+_0x4e3454+'h':_0xbfe3c4+'d';}else{if(_0x216915>0x0){const _0xed8ae=_0xd88583%0x3c;return _0xed8ae>0x0?_0x216915+'h\x20'+_0xed8ae+'m':_0x216915+'h';}else{if(_0xd88583>0x0){const _0x56b100=_0x39ffeb%0x3c;return _0x56b100>0x0?_0xd88583+'m\x20'+_0x56b100+'s':_0xd88583+'m';}else return _0x39ffeb+'s';}}}function formatTimestamp(_0x682ade,_0x5ffd6){const _0x1457d7=a41_0x949368,_0x344948=new Date(_0x682ade),_0x51ddbd=String(_0x344948[_0x1457d7(0x2b6)]())['padStart'](0x2,'0'),_0x3977ef=String(_0x344948[_0x1457d7(0x230)]())[_0x1457d7(0x2ae)](0x2,'0'),_0xe31573=_0x51ddbd+':'+_0x3977ef,_0x93f869=_0x344948[_0x1457d7(0x192)]()===_0x5ffd6[_0x1457d7(0x192)]()&&_0x344948['getMonth']()===_0x5ffd6['getMonth']()&&_0x344948['getDate']()===_0x5ffd6['getDate']();if(_0x93f869)return _0xe31573;else{const _0x26c0de=String(_0x344948[_0x1457d7(0x17a)]()+0x1)[_0x1457d7(0x2ae)](0x2,'0'),_0x4bf639=String(_0x344948[_0x1457d7(0x227)]())[_0x1457d7(0x2ae)](0x2,'0');return _0x26c0de+'-'+_0x4bf639+'\x20'+_0xe31573;}}function formatDate(_0x93700f){const _0x275ec3=a41_0x949368,_0x1b9f7d=_0x93700f['getFullYear'](),_0x30b0f2=String(_0x93700f[_0x275ec3(0x17a)]()+0x1)[_0x275ec3(0x2ae)](0x2,'0'),_0x4a93ef=String(_0x93700f[_0x275ec3(0x227)]())['padStart'](0x2,'0');return _0x1b9f7d+'-'+_0x30b0f2+'-'+_0x4a93ef;}function getTaskStateIcon(_0x35d432){const _0x518d09={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x518d09[_0x35d432]||'⚪';}function getBarChar(_0x2da7e1){const _0x2151e0=a41_0x949368;return _0x2da7e1===_0x2151e0(0x24e)||_0x2da7e1===_0x2151e0(0x2c6)?'×':'─';}function getBarColor(_0x466840){const _0xf2b437=a41_0x949368,_0xf78afc={'success':a41_0x114f43[_0xf2b437(0x2ad)],'error':a41_0x114f43['red'],'group_error':a41_0x114f43[_0xf2b437(0x1c7)],'running':a41_0x114f43[_0xf2b437(0x17f)],'blocked':a41_0x114f43[_0xf2b437(0x2de)],'planned':a41_0x114f43[_0xf2b437(0x229)],'canceling':a41_0x114f43[_0xf2b437(0x2de)]};return _0xf78afc[_0x466840]||a41_0x114f43[_0xf2b437(0x222)];}function parseTaskName(_0x211c2a){const _0x3d403a=a41_0x949368;let _0x9fc6bf=_0x211c2a['replace'](/^\++/,'');const _0x876389=_0x9fc6bf[_0x3d403a(0x2b8)]('+'),_0x5cdc3f=_0x876389[_0x3d403a(0x19a)]>0x1?_0x876389[_0x3d403a(0x19a)]-0x2:0x0,_0x4dbc99=_0x876389[_0x876389[_0x3d403a(0x19a)]-0x1]||_0x9fc6bf;return{'level':_0x5cdc3f,'name':'+'+_0x4dbc99};}function truncateTaskName(_0x46f188,_0x44c243){const _0x518982=a41_0x949368,_0x57c56f=stringWidth(_0x46f188);if(_0x57c56f<=_0x44c243)return _0x46f188;let _0x5e3b95=_0x46f188;while(stringWidth(_0x5e3b95+'…')>_0x44c243&&_0x5e3b95[_0x518982(0x19a)]>0x0){_0x5e3b95=_0x5e3b95[_0x518982(0x1c0)](0x0,-0x1);}return _0x5e3b95+'…';}function calculateTimeScale(_0x25e1f0,_0x29f85b){const _0x52a141=a41_0x949368;return{'startTime':_0x25e1f0['start'],'endTime':_0x25e1f0['end'],'durationMs':_0x25e1f0[_0x52a141(0x238)],'msPerChar':_0x25e1f0[_0x52a141(0x238)]/_0x29f85b};}function timeToPosition(_0x4ef881,_0x4c59f0,_0x147ede){const _0x51d2fd=a41_0x949368,_0x50a6e3=_0x4ef881-_0x4c59f0['startTime'],_0x5609b3=Math[_0x51d2fd(0x2c0)](_0x50a6e3/_0x4c59f0[_0x51d2fd(0x17b)]);return Math[_0x51d2fd(0x1f6)](0x0,Math[_0x51d2fd(0x215)](_0x5609b3,_0x147ede));}function renderTimeAxis(_0x47ebdc,_0x30bfe3){const _0x62ff5=a41_0x949368,_0x53f85d=Math[_0x62ff5(0x215)](TIMELINE_CONFIG[_0x62ff5(0x27d)],Math[_0x62ff5(0x1f6)](TIMELINE_CONFIG[_0x62ff5(0x2a1)],Math[_0x62ff5(0x2c0)](_0x30bfe3/TIMELINE_CONFIG[_0x62ff5(0x1ae)]))),_0x32bea5=_0x47ebdc['durationMs']/(_0x53f85d-0x1),_0x3a9ba3=new Date(_0x47ebdc[_0x62ff5(0x2d8)]),_0x216c8d=[];for(let _0x57ae14=0x0;_0x57ae14<_0x53f85d;_0x57ae14++){const _0x26e53e=_0x47ebdc['startTime']+_0x57ae14*_0x32bea5,_0x5649b9=timeToPosition(_0x26e53e,_0x47ebdc,_0x30bfe3),_0x577776=formatTimestamp(_0x26e53e,_0x3a9ba3);_0x216c8d[_0x62ff5(0x2d0)]({'pos':_0x5649b9,'text':_0x577776});}const _0xb2c0f0=new Array(_0x30bfe3)[_0x62ff5(0x1f5)]('\x20');let _0x399f40=-0x1;for(const {pos:_0x570107,text:_0x4a4db0}of _0x216c8d){let _0x427416=Math[_0x62ff5(0x1f6)](0x0,_0x570107-Math[_0x62ff5(0x2c0)](_0x4a4db0[_0x62ff5(0x19a)]/0x2));_0x427416<=_0x399f40+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x427416=_0x399f40+TIMELINE_CONFIG[_0x62ff5(0x24f)]+0x1);_0x427416+_0x4a4db0['length']>_0x30bfe3&&(_0x427416=_0x30bfe3-_0x4a4db0['length']);if(_0x427416>=0x0&&_0x427416+_0x4a4db0[_0x62ff5(0x19a)]<=_0x30bfe3&&_0x427416>_0x399f40){for(let _0x342f53=0x0;_0x342f53<_0x4a4db0[_0x62ff5(0x19a)];_0x342f53++){_0xb2c0f0[_0x427416+_0x342f53]=_0x4a4db0[_0x342f53];}_0x399f40=_0x427416+_0x4a4db0[_0x62ff5(0x19a)]-0x1;}}return _0xb2c0f0[_0x62ff5(0x1a7)]('');}function renderTaskRow(_0xa94fa9,_0x45dd14,_0xea7a60,_0x1af4d2){const _0x5aa37f=a41_0x949368,{level:_0x3d74d5,name:_0x59922a}=parseTaskName(_0xa94fa9[_0x5aa37f(0x179)]),_0x1e7eb8='\x20'[_0x5aa37f(0x26b)](_0x3d74d5),_0x4915fb=_0xa94fa9[_0x5aa37f(0x22f)]?'('+formatElapsed(_0xa94fa9[_0x5aa37f(0x22f)][_0x5aa37f(0x238)])+')':'',_0x2f170d=stringWidth(_0x4915fb),_0xdbcbc2=_0x3d74d5*0x1,_0x2b47db=_0x1af4d2-_0xdbcbc2-_0x2f170d-0x1,_0x38189d=truncateTaskName(_0x59922a,_0x2b47db),_0x29e7ff=_0x1e7eb8+_0x38189d,_0x325b5f=stringWidth(_0x29e7ff),_0x5b2247=_0x1af4d2-_0x325b5f-_0x2f170d,_0x2a52e9=_0x29e7ff+'\x20'['repeat'](Math[_0x5aa37f(0x1f6)](0x1,_0x5b2247))+a41_0x114f43[_0x5aa37f(0x229)](_0x4915fb),_0x3fd56e=getTaskStateIcon(_0xa94fa9[_0x5aa37f(0x1c2)]),_0x3b58b3=new Array(_0xea7a60)[_0x5aa37f(0x1f5)]('\x20');if(_0xa94fa9[_0x5aa37f(0x22f)]){const _0x1c2890=timeToPosition(_0xa94fa9[_0x5aa37f(0x22f)][_0x5aa37f(0x25b)],_0x45dd14,_0xea7a60),_0x37c2d8=timeToPosition(_0xa94fa9[_0x5aa37f(0x22f)][_0x5aa37f(0x209)],_0x45dd14,_0xea7a60),_0x42e758=getBarChar(_0xa94fa9['state']),_0x120539=Math[_0x5aa37f(0x1f6)](_0x1c2890+0x1,_0x37c2d8);for(let _0x2bb905=_0x1c2890;_0x2bb905<Math[_0x5aa37f(0x215)](_0x120539,_0xea7a60);_0x2bb905++){_0x3b58b3[_0x2bb905]=_0x42e758;}}const _0x19d499=getBarColor(_0xa94fa9[_0x5aa37f(0x1c2)]),_0x277af4=_0x3b58b3[_0x5aa37f(0x290)](_0x57e362=>_0x57e362==='\x20'?'\x20':_0x19d499(_0x57e362))[_0x5aa37f(0x1a7)]('');return _0x3fd56e+'\x20'+_0x2a52e9+'│'+_0x277af4+'│';}function calculateStats(_0x22990d){const _0x49c2fd=a41_0x949368,_0x40f469={'total':_0x22990d[_0x49c2fd(0x19a)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x17402b of _0x22990d){if(_0x17402b[_0x49c2fd(0x1c2)]===_0x49c2fd(0x2d7))_0x40f469['success']++;else{if(_0x17402b['state']===_0x49c2fd(0x24e)||_0x17402b[_0x49c2fd(0x1c2)]==='group_error')_0x40f469[_0x49c2fd(0x24e)]++;else _0x17402b['state']===_0x49c2fd(0x1d5)?_0x40f469['running']++:_0x40f469['pending']++;}}return _0x40f469;}function formatStats(_0x998d95){const _0x2d8cda=a41_0x949368;return[_0x2d8cda(0x1e4)+_0x998d95[_0x2d8cda(0x301)],'✅\x20'+_0x998d95[_0x2d8cda(0x2d7)],'❌\x20'+_0x998d95[_0x2d8cda(0x24e)],_0x2d8cda(0x303)+_0x998d95[_0x2d8cda(0x1d5)],'⏳\x20'+_0x998d95[_0x2d8cda(0x279)]][_0x2d8cda(0x1a7)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a41_0x949368(0x2cc);[a41_0x949368(0x27c)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a41_0x949368(0x252)](_0x306557){const _0x50617e=a41_0x949368,{options:_0x43d5df,args:_0x6b7288,tdx:_0x4a1ce7}=_0x306557;let _0x2bce5e,_0xb61c48,_0x16ca95=![];if(_0x6b7288[0x0]){if(_0x6b7288[0x0][_0x50617e(0x28e)]('.')){const _0xf559c1=this['parseProjectWorkflowPattern'](_0x6b7288,_0x43d5df);if(!_0xf559c1)return 0x1;_0x2bce5e=_0xf559c1[_0x50617e(0x285)],_0xb61c48=_0xf559c1[_0x50617e(0x2a4)];}else{_0xb61c48=_0x6b7288[0x0],_0x2bce5e=_0x43d5df[_0x50617e(0x2b2)];if(!_0x2bce5e)return console['error'](a41_0x114f43['red'](_0x50617e(0x1ee)),_0x50617e(0x2e5)),0x1;_0x16ca95=!![];}}else{const _0xff596c=this[_0x50617e(0x278)](_0x6b7288,_0x43d5df);if(!_0xff596c)return 0x1;_0x2bce5e=_0xff596c[_0x50617e(0x285)],_0xb61c48=_0xff596c['workflowName'];}if(_0x43d5df[_0x50617e(0x2ef)]){if(_0x2bce5e&&_0xb61c48)console['error'](_0x50617e(0x2bd)+_0x2bce5e+'.'+_0xb61c48);else _0x2bce5e&&console[_0x50617e(0x24e)](_0x50617e(0x1a5)+_0x2bce5e);}const _0x5a6572=_0x43d5df[_0x50617e(0x2a6)],_0x554b4b=_0x43d5df[_0x50617e(0x1f4)];if(_0x5a6572){_0x554b4b&&console[_0x50617e(0x24e)](a41_0x114f43['yellow']('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x3df0b2=_0x43d5df[_0x50617e(0x2c7)];return _0x3df0b2?await this[_0x50617e(0x29e)](_0x306557,_0x5a6572):await this[_0x50617e(0x21f)](_0x306557,_0x5a6572,_0x43d5df),0x0;}if(_0x554b4b){const _0x498777=await withSpinner(_0x50617e(0x1e5),()=>_0x4a1ce7[_0x50617e(0x1db)][_0x50617e(0x28b)]({'projectName':_0x2bce5e,'workflowName':_0xb61c48,'limit':0x64}),{'verbose':_0x43d5df[_0x50617e(0x2ef)]}),_0x58e6c6=_0x498777[_0x50617e(0x297)][_0x50617e(0x2f1)](_0x586861=>_0x586861['id']===_0x554b4b);if(!_0x58e6c6)return console[_0x50617e(0x24e)](a41_0x114f43[_0x50617e(0x1c7)]('Error:'),_0x50617e(0x259)+_0x554b4b),0x1;if(!_0x58e6c6[_0x50617e(0x19d)]?.['id'])return console[_0x50617e(0x24e)](a41_0x114f43[_0x50617e(0x1c7)](_0x50617e(0x1ee)),_0x50617e(0x241)+_0x554b4b+_0x50617e(0x1a1)),0x1;const _0xb6c437=_0x58e6c6[_0x50617e(0x19d)]['id'];_0x43d5df[_0x50617e(0x2ef)]&&console['error'](_0x50617e(0x190)+_0xb6c437+_0x50617e(0x2f5)+_0x554b4b);const _0x12a8cd=_0x43d5df[_0x50617e(0x2c7)];return _0x12a8cd?await this[_0x50617e(0x29e)](_0x306557,_0xb6c437):await this[_0x50617e(0x21f)](_0x306557,_0xb6c437,_0x43d5df),0x0;}const _0x3e6cf9=await withSpinner(_0x50617e(0x275),()=>_0x4a1ce7['workflow'][_0x50617e(0x28b)]({'projectName':_0x2bce5e,'workflowName':_0xb61c48,'limit':_0x43d5df['limit']||0x32}),{'verbose':_0x43d5df[_0x50617e(0x2ef)]}),_0x4a7fd6=_0x3e6cf9['data'];if(_0x4a7fd6['length']===0x0){if(_0x2bce5e&&_0xb61c48)console[_0x50617e(0x24e)](_0x50617e(0x168)+_0x2bce5e+'.'+_0xb61c48);else _0x2bce5e?console[_0x50617e(0x24e)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2bce5e):(console['error']('No\x20workflow\x20sessions\x20found'),console['error'](a41_0x114f43['dim'](_0x50617e(0x1d7))));return 0x0;}_0x4a7fd6[_0x50617e(0x280)]((_0x2efc2a,_0xe310da)=>{const _0x42f2c8=_0x50617e,_0x21b98a=_0x2efc2a[_0x42f2c8(0x175)]||'',_0x3b55ca=_0xe310da[_0x42f2c8(0x175)]||'';return _0x3b55ca[_0x42f2c8(0x2f3)](_0x21b98a);});if(_0x43d5df['json']||_0x43d5df[_0x50617e(0x26d)])return await handleSDKOutput(_0x4a7fd6,_0x43d5df),0x0;let _0x4a266d;if(_0x16ca95){const _0x22add7=_0x4a7fd6[0x0];if(!_0x22add7[_0x50617e(0x19d)]?.['id'])return console[_0x50617e(0x24e)](_0x50617e(0x296)),0x0;_0x4a266d=_0x22add7[_0x50617e(0x19d)]['id'],_0x43d5df[_0x50617e(0x2ef)]&&console['error']('Auto-selected\x20latest\x20session:\x20'+_0x22add7[_0x50617e(0x175)]);}else{const _0x557e81=_0x4a7fd6[_0x50617e(0x290)](_0x14d691=>{const _0x53dcc0=_0x50617e,_0x44d79b=getAttemptStatusDisplay(_0x14d691['lastAttempt']);return{'title':_0x14d691[_0x53dcc0(0x20a)]?.[_0x53dcc0(0x179)]+'.'+_0x14d691['workflow']?.[_0x53dcc0(0x179)]+_0x53dcc0(0x16b)+_0x14d691[_0x53dcc0(0x175)]+'\x20'+_0x44d79b[_0x53dcc0(0x187)],'value':_0x14d691[_0x53dcc0(0x19d)]?.['id']||'','description':_0x44d79b[_0x53dcc0(0x2a7)]};}),_0x268a6c=await a41_0x2b3a80({'type':_0x50617e(0x204),'name':_0x50617e(0x2a6),'message':_0x50617e(0x2ca),'choices':_0x557e81[_0x50617e(0x172)](_0x1f27ed=>_0x1f27ed[_0x50617e(0x293)]!=='')});if(!_0x268a6c[_0x50617e(0x2a6)])return 0x0;_0x4a266d=_0x268a6c[_0x50617e(0x2a6)];}const _0x1c0c22=_0x43d5df[_0x50617e(0x2c7)];return _0x1c0c22?await this[_0x50617e(0x29e)](_0x306557,_0x4a266d):await this[_0x50617e(0x21f)](_0x306557,_0x4a266d,_0x43d5df),0x0;}async[a41_0x949368(0x21f)](_0x174948,_0x4fb845,_0x464ae9){const _0x3a5cdd=a41_0x949368,{tdx:_0x165f39}=_0x174948;let _0x48bb69,_0x3af5dd;try{[_0x48bb69,_0x3af5dd]=await Promise[_0x3a5cdd(0x19c)]([_0x165f39[_0x3a5cdd(0x1db)][_0x3a5cdd(0x242)](_0x4fb845),_0x165f39[_0x3a5cdd(0x1db)]['tasks'](_0x4fb845,![])]);}catch(_0x145cf2){console[_0x3a5cdd(0x24e)](a41_0x114f43[_0x3a5cdd(0x1c7)](_0x3a5cdd(0x289)));_0x464ae9['verbose']&&console[_0x3a5cdd(0x24e)](_0x145cf2);throw _0x145cf2;}if(_0x464ae9['json']||_0x464ae9[_0x3a5cdd(0x26d)]){const _0x18a541=this[_0x3a5cdd(0x197)](_0x48bb69,_0x3af5dd);await handleSDKOutput([_0x18a541],_0x464ae9);return;}const _0xf7e83a=_0x165f39[_0x3a5cdd(0x1df)][_0x3a5cdd(0x1aa)],_0x2dcd66=this['renderTimeline'](_0x48bb69,_0x3af5dd,_0xf7e83a);console['log'](_0x2dcd66);}async[a41_0x949368(0x29e)](_0x49df93,_0x2f1e76){const _0x2cf7bc=a41_0x949368,{tdx:_0x2c9f16}=_0x49df93,_0x488968=TIMELINE_CONFIG[_0x2cf7bc(0x25c)],_0x57822e=TIMELINE_CONFIG[_0x2cf7bc(0x29f)];let _0x4bb8fa=0x0;while(_0x4bb8fa<_0x57822e){process[_0x2cf7bc(0x1fa)][_0x2cf7bc(0x26e)]&&process['stdout'][_0x2cf7bc(0x256)]('\x1bc');let _0x592ec1,_0x5f3d20;try{[_0x592ec1,_0x5f3d20]=await Promise[_0x2cf7bc(0x19c)]([_0x2c9f16['workflow'][_0x2cf7bc(0x242)](_0x2f1e76),_0x2c9f16[_0x2cf7bc(0x1db)][_0x2cf7bc(0x2e0)](_0x2f1e76,![])]);}catch(_0x8add2c){console[_0x2cf7bc(0x24e)](a41_0x114f43[_0x2cf7bc(0x1c7)](_0x2cf7bc(0x2ea)));_0x4bb8fa>0x0&&console['error'](a41_0x114f43[_0x2cf7bc(0x229)](_0x2cf7bc(0x1ea)+_0x4bb8fa));throw _0x8add2c;}const _0xe7ecfa=_0x2c9f16[_0x2cf7bc(0x1df)][_0x2cf7bc(0x1aa)],_0x516c6e=this[_0x2cf7bc(0x2ba)](_0x592ec1,_0x5f3d20,_0xe7ecfa);console[_0x2cf7bc(0x22a)](_0x516c6e);const _0x53b260=_0x592ec1[_0x2cf7bc(0x1ce)]&&_0x5f3d20[_0x2cf7bc(0x2d9)](_0x3cf829=>_0x3cf829[_0x2cf7bc(0x1c2)]!=='running'&&_0x3cf829[_0x2cf7bc(0x1c2)]!=='planned');if(_0x53b260){console['error'](a41_0x114f43['green']('\x0a✔\x20Attempt\x20complete'));break;}console[_0x2cf7bc(0x24e)](a41_0x114f43[_0x2cf7bc(0x229)]('\x0aPolling...\x20('+_0x4bb8fa*0x2+_0x2cf7bc(0x2f4))),await new Promise(_0x337ad9=>setTimeout(_0x337ad9,_0x488968)),_0x4bb8fa++;}_0x4bb8fa>=_0x57822e&&console['error'](a41_0x114f43['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a41_0x949368(0x2ba)](_0xab6e10,_0x4a292c,_0x122d41){const _0xdf3744=a41_0x949368,_0x85c573=[],_0x3f6752=TIMELINE_CONFIG[_0xdf3744(0x208)],_0x78387c=0x5,_0x10fc7a=process[_0xdf3744(0x1fa)][_0xdf3744(0x254)]||0x78,_0x59148b=_0x10fc7a-_0x3f6752-_0x78387c,_0x5b2632=Math[_0xdf3744(0x1f6)](TIMELINE_CONFIG[_0xdf3744(0x2ec)],Math[_0xdf3744(0x215)](_0x59148b,TIMELINE_CONFIG[_0xdf3744(0x2c3)])),_0x3e3dd2=new Date(_0xab6e10[_0xdf3744(0x201)])['getTime'](),_0x5e84b2=_0xab6e10[_0xdf3744(0x235)]?new Date(_0xab6e10[_0xdf3744(0x235)])[_0xdf3744(0x265)]():Date[_0xdf3744(0x16c)](),_0x4d699={'start':_0x3e3dd2,'end':_0x5e84b2,'duration':_0x5e84b2-_0x3e3dd2},_0x21f67b=new Map(),_0x47d418=[];for(const _0x2a6831 of _0x4a292c){if(_0x2a6831[_0xdf3744(0x2c9)]){const _0x8972d6=new Date(_0x2a6831[_0xdf3744(0x2c9)])['getTime'](),_0x5b3d81=_0x2a6831[_0xdf3744(0x1c3)]?new Date(_0x2a6831['updatedAt'])[_0xdf3744(0x265)]():Date[_0xdf3744(0x16c)](),_0xbe8ca1={'start':_0x8972d6,'end':_0x5b3d81,'duration':_0x5b3d81-_0x8972d6};_0x21f67b[_0xdf3744(0x1e0)](_0x2a6831['id'],_0xbe8ca1),_0x47d418[_0xdf3744(0x2d0)]({'name':_0x2a6831[_0xdf3744(0x1ef)],'state':_0x2a6831[_0xdf3744(0x1c2)]||_0xdf3744(0x1a0),'window':_0xbe8ca1});}else _0x47d418[_0xdf3744(0x2d0)]({'name':_0x2a6831[_0xdf3744(0x1ef)],'state':_0x2a6831[_0xdf3744(0x1c2)]||_0xdf3744(0x1b1),'window':undefined});}_0x47d418[_0xdf3744(0x280)]((_0x1e69dc,_0x4998c2)=>{const _0xfcd7b8=_0xdf3744;if(!_0x1e69dc[_0xfcd7b8(0x22f)])return 0x1;if(!_0x4998c2[_0xfcd7b8(0x22f)])return-0x1;return _0x1e69dc[_0xfcd7b8(0x22f)][_0xfcd7b8(0x25b)]-_0x4998c2[_0xfcd7b8(0x22f)][_0xfcd7b8(0x25b)];});const _0x54e918=_0x47d418['length'],_0x52c799=_0x54e918>TIMELINE_CONFIG[_0xdf3744(0x2bf)];_0x52c799&&_0x47d418['splice'](TIMELINE_CONFIG[_0xdf3744(0x2bf)]);const _0x25ab2a=calculateTimeScale(_0x4d699,_0x5b2632),_0x1d52e1=_0xab6e10['done']?_0xab6e10[_0xdf3744(0x2d7)]?a41_0x114f43['green'](_0xdf3744(0x2d7)):a41_0x114f43['red'](_0xdf3744(0x24e)):a41_0x114f43[_0xdf3744(0x17f)](_0xdf3744(0x1d5)),_0x2dbb6b=_0xab6e10[_0xdf3744(0x20a)]?.['id'],_0x2782e2=_0xab6e10[_0xdf3744(0x1f4)];let _0x203245;if(_0x2dbb6b&&_0x2782e2){const _0x8cb145=getWorkflowAttemptUrl(_0x122d41,_0x2dbb6b,_0x2782e2,_0xab6e10['id']);_0x203245=hyperlink(a41_0x114f43['dim'](_0xab6e10['id']),_0x8cb145);}else _0x203245=a41_0x114f43[_0xdf3744(0x229)](_0xab6e10['id']);_0x85c573[_0xdf3744(0x2d0)](_0xdf3744(0x206)+_0x203245+'\x20-\x20'+_0x1d52e1+'\x20-\x20'+formatElapsed(_0x4d699[_0xdf3744(0x238)]));if(_0x47d418[_0xdf3744(0x19a)]>0x0){const _0x31c627=renderTimeAxis(_0x25ab2a,_0x5b2632),_0x27e77b=new Date(_0x4d699[_0xdf3744(0x25b)]),_0x2c0418=formatDate(_0x27e77b),_0x3a462a=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0xdf3744(0x2e1)]+_0x3f6752,_0x48b335=_0x2c0418[_0xdf3744(0x2ae)](_0x3a462a),_0x3eabb2=a41_0x114f43['dim'](_0x48b335);_0x85c573['push'](_0x3eabb2+'\x20'+_0x31c627);for(const _0xfba975 of _0x47d418){_0x85c573[_0xdf3744(0x2d0)](renderTaskRow(_0xfba975,_0x25ab2a,_0x5b2632,_0x3f6752));}const _0x44e9be=calculateStats(_0x47d418);_0x85c573[_0xdf3744(0x2d0)](formatStats(_0x44e9be)),_0x52c799&&_0x85c573['push'](a41_0x114f43[_0xdf3744(0x2de)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0xdf3744(0x2bf)]+_0xdf3744(0x22b)+_0x54e918+_0xdf3744(0x263))),_0x85c573['push'](''),_0x85c573[_0xdf3744(0x2d0)](a41_0x114f43[_0xdf3744(0x229)]('💡\x20Tip:\x20Use\x20')+('tdx\x20wf\x20attempt\x20'+_0xab6e10['id']+'\x20logs')+a41_0x114f43[_0xdf3744(0x229)](_0xdf3744(0x23e)));}else _0x85c573[_0xdf3744(0x2d0)](_0xdf3744(0x2a9));return _0x85c573[_0xdf3744(0x1a7)]('\x0a');}[a41_0x949368(0x197)](_0x3c3c12,_0x136c3d){const _0x16eff5=a41_0x949368,_0x41342c=new Date(_0x3c3c12[_0x16eff5(0x201)])[_0x16eff5(0x265)](),_0x15e4cf=_0x3c3c12[_0x16eff5(0x235)]?new Date(_0x3c3c12['finishedAt'])[_0x16eff5(0x265)]():Date[_0x16eff5(0x16c)](),_0x1aa766=_0x15e4cf-_0x41342c,_0x5fe8f1=[];for(const _0x521b47 of _0x136c3d){if(_0x521b47[_0x16eff5(0x2c9)]){const _0xc09fe3=new Date(_0x521b47[_0x16eff5(0x2c9)])['getTime'](),_0x43aa96=_0x521b47[_0x16eff5(0x1c3)]?new Date(_0x521b47['updatedAt'])[_0x16eff5(0x265)]():Date['now']();_0x5fe8f1[_0x16eff5(0x2d0)]({'name':_0x521b47['fullName'],'state':_0x521b47['state']||_0x16eff5(0x1a0),'window':{'start':_0xc09fe3,'end':_0x43aa96,'duration':_0x43aa96-_0xc09fe3}});}else _0x5fe8f1[_0x16eff5(0x2d0)]({'name':_0x521b47[_0x16eff5(0x1ef)],'state':_0x521b47[_0x16eff5(0x1c2)]||_0x16eff5(0x1b1),'window':undefined});}const _0x3e08b6=calculateStats(_0x5fe8f1);return{'attempt':{'id':_0x3c3c12['id'],'status':_0x3c3c12[_0x16eff5(0x1ce)]?_0x3c3c12[_0x16eff5(0x2d7)]?_0x16eff5(0x2d7):'error':_0x16eff5(0x1d5),'createdAt':_0x3c3c12['createdAt'],'finishedAt':_0x3c3c12[_0x16eff5(0x235)],'duration_ms':_0x1aa766},'tasks':_0x5fe8f1[_0x16eff5(0x290)](_0x5ac645=>({'name':_0x5ac645[_0x16eff5(0x179)],'state':_0x5ac645[_0x16eff5(0x1c2)],'startedAt':_0x5ac645[_0x16eff5(0x22f)]?new Date(_0x5ac645[_0x16eff5(0x22f)]['start'])[_0x16eff5(0x300)]():null,'updatedAt':_0x5ac645[_0x16eff5(0x22f)]?new Date(_0x5ac645[_0x16eff5(0x22f)]['end'])[_0x16eff5(0x300)]():null,'duration_ms':_0x5ac645[_0x16eff5(0x22f)]?.['duration']||null})),'stats':_0x3e08b6};}}
1
+ const a41_0x448846=a41_0x141e;(function(_0xa10281,_0x1d701d){const _0x106aa7=a41_0x141e,_0x313f6d=_0xa10281();while(!![]){try{const _0x3e3a80=parseInt(_0x106aa7(0x199))/0x1*(parseInt(_0x106aa7(0x226))/0x2)+-parseInt(_0x106aa7(0x179))/0x3+-parseInt(_0x106aa7(0x1dc))/0x4+parseInt(_0x106aa7(0x1ef))/0x5*(-parseInt(_0x106aa7(0xc5))/0x6)+parseInt(_0x106aa7(0x1fd))/0x7*(-parseInt(_0x106aa7(0x126))/0x8)+parseInt(_0x106aa7(0x1cb))/0x9*(parseInt(_0x106aa7(0x215))/0xa)+parseInt(_0x106aa7(0xc6))/0xb*(parseInt(_0x106aa7(0x1a8))/0xc);if(_0x3e3a80===_0x1d701d)break;else _0x313f6d['push'](_0x313f6d['shift']());}catch(_0x4dee77){_0x313f6d['push'](_0x313f6d['shift']());}}}(a41_0x13e8,0x62f9d));import a41_0x402fbc from'chalk';import{existsSync}from'fs';import a41_0xf5d811 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}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 a41_0x131ac0 from'prompts';function getAttemptStatusDisplay(_0xee5bb){const _0x7a9c23=a41_0x141e;if(!_0xee5bb)return{'icon':'⏳','text':''};const {done:_0x42a066,success:_0xd62942,cancelRequested:_0x20b3b5}=_0xee5bb;if(!_0x42a066)return _0x20b3b5?{'icon':'🛑','text':a41_0x402fbc['yellow'](_0x7a9c23(0x9c))}:{'icon':'🔄','text':a41_0x402fbc[_0x7a9c23(0x15a)](_0x7a9c23(0x1eb))};if(_0xd62942)return{'icon':'✅','text':a41_0x402fbc[_0x7a9c23(0x142)](_0x7a9c23(0xbf))};return{'icon':'❌','text':a41_0x402fbc[_0x7a9c23(0x95)]('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x3a4f8c,_0x2a24f9,_0x5aa623=0x0){const _0x3934d5=a41_0x141e;return _0x3a4f8c[_0x5aa623]||_0x2a24f9[_0x3934d5(0x1b9)];}[a41_0x448846(0x9b)](_0x5cfa5c,_0x2d6e37,_0x350013=0x0){const _0x4f595a=a41_0x448846,_0x53fc81=this[_0x4f595a(0x1f5)](_0x5cfa5c,_0x2d6e37,_0x350013);if(!_0x53fc81)return console['error'](a41_0x402fbc[_0x4f595a(0x95)](_0x4f595a(0x9a)),_0x4f595a(0x21c)),console[_0x4f595a(0x154)](a41_0x402fbc[_0x4f595a(0x16c)](_0x4f595a(0xf9))),null;return _0x53fc81;}[a41_0x448846(0xea)](_0x1bd7be,_0x2d1ac3){const _0x523510=a41_0x448846;if(_0x1bd7be[0x0]){const _0x2d27b0=_0x1bd7be[0x0][_0x523510(0x19b)]('.');if(_0x2d27b0[_0x523510(0x1c5)]===0x1)return{'projectName':_0x2d27b0[0x0],'workflowName':undefined};else return _0x2d27b0[_0x523510(0x1c5)]===0x2?{'projectName':_0x2d27b0[0x0],'workflowName':_0x2d27b0[0x1]}:(console['error'](a41_0x402fbc[_0x523510(0x95)](_0x523510(0x9a)),_0x523510(0x139)),null);}return{'projectName':_0x2d1ac3[_0x523510(0x1b9)],'workflowName':undefined};}[a41_0x448846(0x10c)](_0x174d90,_0x5c0dd1,_0x5945fa=0x0){const _0x1e4b4e=a41_0x448846;if(_0x174d90[_0x5945fa])return _0x174d90[_0x5945fa];if(_0x5c0dd1['workflowProject']){const _0x25962d=a41_0xf5d811[_0x1e4b4e(0xdb)](process[_0x1e4b4e(0x191)](),_0x1e4b4e(0xfb),_0x5c0dd1[_0x1e4b4e(0x1b9)]);if(existsSync(a41_0xf5d811[_0x1e4b4e(0xdb)](_0x25962d,'tdx.json')))return _0x25962d;}return undefined;}async[a41_0x448846(0x1c6)](_0x101447,_0x5bd1e1,_0x68dd0d){const _0x5e174d=a41_0x448846;try{const _0xc0ce43=await _0x101447[_0x5e174d(0x13f)][_0x5e174d(0xfb)](_0x5bd1e1,{'limit':0x1});if(_0xc0ce43[_0x5e174d(0x1c5)]>0x0){const _0x45ac79=_0xc0ce43[0x0]['id'],_0xe748f1=getWorkflowUrl(_0x68dd0d,_0x45ac79);console[_0x5e174d(0x154)]('\x20\x20Console:\x20'+a41_0x402fbc[_0x5e174d(0x18c)](_0xe748f1));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a41_0x448846(0xb1);['description']=a41_0x448846(0xd9);async[a41_0x448846(0x1f9)](_0x34f4a8){const _0x2df43a=a41_0x448846,{options:_0x2927af,args:_0x4eeb93,tdx:_0x71d278}=_0x34f4a8,_0x2408bd=_0x4eeb93[0x0],_0x18cce2=_0x2927af[_0x2df43a(0x1d1)];if(_0x18cce2)return saveSessionContext({'workflow_project':undefined},_0x2927af[_0x2df43a(0x1ff)]),console[_0x2df43a(0x12f)](a41_0x402fbc[_0x2df43a(0x142)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x2408bd)return console[_0x2df43a(0x154)](a41_0x402fbc[_0x2df43a(0x95)](_0x2df43a(0x9a)),_0x2df43a(0x21c)),console['error'](a41_0x402fbc[_0x2df43a(0x16c)](_0x2df43a(0x1fe))),console[_0x2df43a(0x154)](a41_0x402fbc[_0x2df43a(0x16c)](_0x2df43a(0x188))),0x1;const _0x1eb14d=await withSpinner(_0x2df43a(0xa1)+_0x2408bd+_0x2df43a(0x161),()=>_0x71d278['workflow'][_0x2df43a(0x144)](_0x2408bd),{'verbose':_0x2927af[_0x2df43a(0x138)]}),{name:_0x1de996}=_0x1eb14d[_0x2df43a(0x104)];return saveSessionContext({'workflow_project':_0x1de996},_0x2927af[_0x2df43a(0x1ff)]),console[_0x2df43a(0x12f)](a41_0x402fbc['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a41_0x402fbc['cyan'](_0x1de996))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a41_0x448846(0x18a)]='workflow:projects';['description']=a41_0x448846(0x160);async['execute'](_0x5810b3){const _0x29aaf1=a41_0x448846,{options:_0x3bbb76,args:_0x4ba405,tdx:_0x5438c9}=_0x5810b3,_0x2c818f=_0x4ba405[0x0];_0x3bbb76['verbose']&&_0x2c818f&&console['error'](_0x29aaf1(0x1ad)+_0x2c818f);const _0x317ee6=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x5438c9[_0x29aaf1(0x13f)][_0x29aaf1(0x122)](_0x2c818f,{'limit':_0x3bbb76['limit']}),{'verbose':_0x3bbb76[_0x29aaf1(0x138)]});let _0x1ac37d=_0x317ee6[_0x29aaf1(0x104)];_0x1ac37d['sort']((_0x548851,_0x37d714)=>_0x548851[_0x29aaf1(0x18a)]['localeCompare'](_0x37d714['name']));const _0x2ef1c7=_0x3bbb76['limit']||0x64,_0x41fd63=_0x1ac37d[_0x29aaf1(0x1c5)]>=_0x2ef1c7?a41_0x402fbc[_0x29aaf1(0x16c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x29aaf1(0x154)](_0x29aaf1(0x111)+_0x1ac37d[_0x29aaf1(0x1c5)]+_0x29aaf1(0xf4)+(_0x1ac37d[_0x29aaf1(0x1c5)]!==0x1?'s':'')+_0x41fd63);if(_0x3bbb76[_0x29aaf1(0x177)]==='json'||_0x3bbb76[_0x29aaf1(0x177)]===_0x29aaf1(0x168)||_0x3bbb76['format']===_0x29aaf1(0x221))await handleSDKOutput(_0x1ac37d,_0x3bbb76);else{if(_0x1ac37d[_0x29aaf1(0x1c5)]===0x0)_0x2c818f?console['log'](_0x29aaf1(0xab)+_0x2c818f):console[_0x29aaf1(0x12f)](_0x29aaf1(0x210));else{const _0x5900da=_0x1ac37d[_0x29aaf1(0x1bc)](_0x2cbc12=>{const _0x59345b=_0x29aaf1,_0x1c16eb=_0x2cbc12[_0x59345b(0x207)]?.[_0x59345b(0x189)](_0x283ecf=>_0x283ecf[_0x59345b(0x218)]==='sys'),_0x21f96b=_0x1c16eb?a41_0x402fbc[_0x59345b(0x16c)](_0x59345b(0xf8)):'';return _0x59345b(0xd3)+_0x2cbc12[_0x59345b(0x18a)]+_0x21f96b;});await writeOutput(_0x5900da[_0x29aaf1(0xdb)]('\x0a'),_0x3bbb76[_0x29aaf1(0xbb)],_0x29aaf1(0x1d8));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]='workflow:workflows';[a41_0x448846(0xd0)]=a41_0x448846(0xff);async['execute'](_0x5303d8){const _0x13cad6=a41_0x448846,{options:_0x31b178,args:_0x30a214,tdx:_0x55a6bd}=_0x5303d8,_0x4b08bd=this[_0x13cad6(0x1f5)](_0x30a214,_0x31b178);_0x31b178[_0x13cad6(0x138)]&&_0x4b08bd&&console[_0x13cad6(0x154)]('Project\x20filter:\x20'+_0x4b08bd);const _0x4e0455=await withSpinner(_0x13cad6(0x11d),()=>_0x55a6bd[_0x13cad6(0x13f)][_0x13cad6(0xfb)](_0x4b08bd,{'limit':_0x31b178['limit']}),{'verbose':_0x31b178[_0x13cad6(0x138)]});let _0x3fa504=_0x4e0455[_0x13cad6(0x104)];_0x3fa504['sort']((_0x3926c0,_0x4cc502)=>{const _0x1a349f=_0x13cad6,_0x338ecd=_0x3926c0[_0x1a349f(0x18a)][_0x1a349f(0x170)](_0x4cc502[_0x1a349f(0x18a)]);if(_0x338ecd!==0x0)return _0x338ecd;return(_0x3926c0[_0x1a349f(0x1b2)]?.[_0x1a349f(0x18a)]||'')['localeCompare'](_0x4cc502['project']?.[_0x1a349f(0x18a)]||'');});const _0x25f4a3=_0x31b178[_0x13cad6(0x222)]||0x64,_0x297e66=_0x3fa504[_0x13cad6(0x1c5)]>=_0x25f4a3?a41_0x402fbc['dim'](_0x13cad6(0x101)):'';console[_0x13cad6(0x154)](_0x13cad6(0x111)+_0x3fa504[_0x13cad6(0x1c5)]+_0x13cad6(0x10f)+(_0x3fa504[_0x13cad6(0x1c5)]!==0x1?'s':'')+_0x297e66);if(_0x31b178[_0x13cad6(0x177)]===_0x13cad6(0x143)||_0x31b178[_0x13cad6(0x177)]===_0x13cad6(0x168)||_0x31b178['format']===_0x13cad6(0x221))await handleSDKOutput(_0x3fa504,_0x31b178);else{if(_0x3fa504[_0x13cad6(0x1c5)]===0x0)_0x4b08bd?console[_0x13cad6(0x12f)](_0x13cad6(0x8e)+_0x4b08bd):console[_0x13cad6(0x12f)](_0x13cad6(0x1d7));else{const _0x3c7e17=_0x31b178[_0x13cad6(0x91)],_0x471a23=_0x3fa504['map'](_0x3c148a=>{const _0x5b42b3=_0x13cad6,_0x2d31f9=a41_0x402fbc[_0x5b42b3(0x16c)]('#'+_0x3c148a['id']),_0x482655=hyperlink(_0x2d31f9,getWorkflowUrl(_0x3c7e17,_0x3c148a['id'])),_0xa75a38=_0x3c148a[_0x5b42b3(0x1b2)]?.[_0x5b42b3(0x18a)]?a41_0x402fbc[_0x5b42b3(0x16c)]('\x20('+_0x3c148a[_0x5b42b3(0x1b2)][_0x5b42b3(0x18a)]+')'):'';return _0x5b42b3(0x22d)+_0x482655+'\x20'+_0x3c148a[_0x5b42b3(0x18a)]+_0xa75a38;});await writeOutput(_0x471a23[_0x13cad6(0xdb)]('\x0a'),_0x31b178[_0x13cad6(0xbb)],_0x13cad6(0x1d8));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0xa8);[a41_0x448846(0xd0)]=a41_0x448846(0xe0);async[a41_0x448846(0x1f9)](_0x3dd673){const _0x2a2369=a41_0x448846,{options:_0x20ccc8,args:_0xcef21f,tdx:_0x55610b}=_0x3dd673,_0x5edfe6=this[_0x2a2369(0xea)](_0xcef21f,_0x20ccc8);if(!_0x5edfe6)return 0x1;const {projectName:_0x20a104,workflowName:_0x4cbfc7}=_0x5edfe6;if(_0x20ccc8['verbose']){if(_0x20a104&&_0x4cbfc7)console[_0x2a2369(0x154)](_0x2a2369(0x12d)+_0x20a104+'.'+_0x4cbfc7);else _0x20a104&&console['error']('Filter:\x20project='+_0x20a104);const _0x43745d=_0x20ccc8[_0x2a2369(0xa9)];_0x43745d&&console[_0x2a2369(0x154)]('Status:\x20'+_0x43745d);}let _0x183bd3=0x28;if(process[_0x2a2369(0x163)][_0x2a2369(0x148)]&&!_0x20ccc8[_0x2a2369(0xbb)]&&!_0x20ccc8[_0x2a2369(0x177)]){const _0x2c4585=process[_0x2a2369(0x163)][_0x2a2369(0x1a5)]||0x28;_0x183bd3=Math[_0x2a2369(0x11f)](0x14,Math[_0x2a2369(0x123)](_0x2c4585*0x2/0x3));}const _0x4e8bd5=_0x20ccc8[_0x2a2369(0x222)]||_0x183bd3,_0x9d25b=await withSpinner(_0x2a2369(0xcd),()=>_0x55610b[_0x2a2369(0x13f)][_0x2a2369(0xb9)]({'projectName':_0x20a104,'workflowName':_0x4cbfc7,'status':_0x20ccc8[_0x2a2369(0xa9)],'fromTime':_0x20ccc8[_0x2a2369(0x220)],'toTime':_0x20ccc8['to'],'limit':_0x4e8bd5}),{'verbose':_0x20ccc8[_0x2a2369(0x138)]}),_0x1c77dd=_0x9d25b[_0x2a2369(0x104)];_0x1c77dd[_0x2a2369(0x205)]((_0x383361,_0x12ac9e)=>{const _0xbbaf3d=_0x2a2369,_0x1d7b61=_0x383361[_0xbbaf3d(0x1ce)]||'',_0x266b62=_0x12ac9e[_0xbbaf3d(0x1ce)]||'';return _0x266b62[_0xbbaf3d(0x170)](_0x1d7b61);});_0x1c77dd[_0x2a2369(0x1c5)]>=_0x4e8bd5?console[_0x2a2369(0x154)]('✔\x20Showing\x20'+_0x1c77dd[_0x2a2369(0x1c5)]+_0x2a2369(0xe9)+a41_0x402fbc['dim']('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x2a2369(0x111)+_0x1c77dd[_0x2a2369(0x1c5)]+'\x20session'+(_0x1c77dd[_0x2a2369(0x1c5)]!==0x1?'s':''));if(_0x20ccc8[_0x2a2369(0x177)]==='json'||_0x20ccc8['format']==='jsonl'||_0x20ccc8[_0x2a2369(0x177)]===_0x2a2369(0x221))await handleSDKOutput(_0x1c77dd,_0x20ccc8);else{if(!process[_0x2a2369(0x163)][_0x2a2369(0x148)]||_0x20ccc8['output']){if(_0x1c77dd[_0x2a2369(0x1c5)]===0x0){if(_0x20a104&&_0x4cbfc7)console['log'](_0x2a2369(0x176)+_0x20a104+'.'+_0x4cbfc7);else _0x20a104?console[_0x2a2369(0x12f)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x20a104):console['log']('No\x20sessions\x20found');}else{const _0x2a37e3=_0x20ccc8[_0x2a2369(0x91)],_0x4c4b29=this[_0x2a2369(0xc1)](_0x1c77dd,_0x2a37e3);_0x20ccc8[_0x2a2369(0xbb)]?await writeOutput(_0x4c4b29,_0x20ccc8['output'],_0x2a2369(0x1d8)):console[_0x2a2369(0x12f)](_0x4c4b29);}!_0x20a104&&(console[_0x2a2369(0x154)](''),console[_0x2a2369(0x154)](a41_0x402fbc[_0x2a2369(0x16c)](_0x2a2369(0x223))),console['error'](a41_0x402fbc['dim'](_0x2a2369(0x225))+'or'+a41_0x402fbc[_0x2a2369(0x16c)](_0x2a2369(0x1aa))));}else{if(_0x1c77dd['length']===0x0){if(_0x20a104&&_0x4cbfc7)console[_0x2a2369(0x12f)](_0x2a2369(0x176)+_0x20a104+'.'+_0x4cbfc7);else _0x20a104?console[_0x2a2369(0x12f)](_0x2a2369(0x118)+_0x20a104):console[_0x2a2369(0x12f)]('No\x20sessions\x20found');}else await this[_0x2a2369(0xb4)](_0x1c77dd,_0x3dd673,_0x20a104);}}return 0x0;}[a41_0x448846(0xc1)](_0x2c0ba0,_0x2e0b41){const _0x3ee455=a41_0x448846,_0x351d73=[],_0x5b76bb=new Map();let _0x5c16d6=Infinity,_0xa60a01=-Infinity;for(const _0x467e30 of _0x2c0ba0){if(_0x467e30[_0x3ee455(0x190)]?.[_0x3ee455(0x97)]){const _0x5340ab=new Date(_0x467e30[_0x3ee455(0x190)][_0x3ee455(0x97)])['getTime'](),_0x5f3946=_0x467e30[_0x3ee455(0x190)][_0x3ee455(0xb7)]?new Date(_0x467e30[_0x3ee455(0x190)][_0x3ee455(0xb7)])['getTime']():Date['now'](),_0x4c9fa4=_0x467e30[_0x3ee455(0x1b2)]?.[_0x3ee455(0x18a)]||_0x3ee455(0x227);!_0x5b76bb[_0x3ee455(0x147)](_0x4c9fa4)&&_0x5b76bb['set'](_0x4c9fa4,[]),_0x5b76bb['get'](_0x4c9fa4)[_0x3ee455(0x194)]({'session':_0x467e30,'startTime':_0x5340ab,'endTime':_0x5f3946,'duration':_0x5f3946-_0x5340ab}),_0x5c16d6=Math[_0x3ee455(0x121)](_0x5c16d6,_0x5340ab),_0xa60a01=Math[_0x3ee455(0x11f)](_0xa60a01,_0x5f3946);}}if(_0x5b76bb[_0x3ee455(0x22e)]===0x0)return _0x3ee455(0x175);const _0x133b04=process['stdout']['columns']||0x78,_0x2885ff=0x1e,_0x4078d3=0x32,_0x288085=0x4,_0xc7e45a=Math['min'](_0x4078d3,Math[_0x3ee455(0x11f)](_0x2885ff,Math[_0x3ee455(0x123)](_0x133b04*0.3))),_0x1f30f6=_0x133b04-_0xc7e45a-TIMELINE_CONFIG[_0x3ee455(0xf0)]-0x3-_0x288085,_0x3396aa=_0xa60a01-_0x5c16d6,_0x2d1524=_0x3396aa/_0xc7e45a,_0x24c438=renderTimeAxis({'startTime':_0x5c16d6,'endTime':_0xa60a01,'durationMs':_0x3396aa,'msPerChar':_0x2d1524},_0xc7e45a),_0xedd448=[];for(const _0x1d6f3a of _0x5b76bb[_0x3ee455(0x202)]()){_0xedd448[_0x3ee455(0x194)](..._0x1d6f3a);}_0xedd448[_0x3ee455(0x205)]((_0x6ef863,_0x84e85d)=>_0x84e85d[_0x3ee455(0x151)]-_0x6ef863[_0x3ee455(0x151)]);const _0x23bb3b=new Date(_0x5c16d6),_0x2c36b2=formatDate(_0x23bb3b),_0x44ccca=_0x288085+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x3ee455(0xc9)]+_0x1f30f6,_0x16f345='\x20'[_0x3ee455(0xb3)](_0x44ccca-_0x2c36b2[_0x3ee455(0x1c5)]),_0x421ea0=_0x16f345+a41_0x402fbc[_0x3ee455(0x16c)](_0x2c36b2)+'\x20'+_0x24c438;_0x351d73['push'](_0x421ea0);const _0x50b51d=0x16;let _0x205302=0x0;for(const _0x1311fc of _0xedd448){const _0x22c0cb=_0x1311fc[_0x3ee455(0x1ff)][_0x3ee455(0x1b2)]?.[_0x3ee455(0x18a)]||'?',_0x1a4559=Math['min'](stringWidth(_0x22c0cb),_0x50b51d);_0x205302=Math[_0x3ee455(0x11f)](_0x205302,_0x1a4559);}for(const _0x43d0c2 of _0xedd448){const {session:_0x4eb0ee,startTime:_0x274867,endTime:_0x1e2a0a,duration:_0x2a32df}=_0x43d0c2,_0x8e8975=_0x4eb0ee[_0x3ee455(0x1b2)]?.['id'],_0x2cbd06=_0x4eb0ee['id'],_0x14e530=_0x4eb0ee[_0x3ee455(0x1b2)]?.['name']||'?',_0x4ec558=_0x4eb0ee['workflow']?.[_0x3ee455(0x18a)]||'?';let _0x5a37a7,_0x5e75d7;if(_0x4eb0ee[_0x3ee455(0x190)]){const _0x80888=_0x4eb0ee['lastAttempt'];!_0x80888[_0x3ee455(0x186)]?(_0x5a37a7=_0x80888[_0x3ee455(0x185)]?'🛑':'🔄',_0x5e75d7=_0x80888[_0x3ee455(0x185)]?a41_0x402fbc[_0x3ee455(0x1f6)]:a41_0x402fbc[_0x3ee455(0x15a)]):(_0x5a37a7=_0x80888['success']?'✅':'❌',_0x5e75d7=_0x80888[_0x3ee455(0xbf)]?a41_0x402fbc['green']:a41_0x402fbc[_0x3ee455(0x95)]);}else _0x5a37a7='⏳',_0x5e75d7=a41_0x402fbc[_0x3ee455(0x16c)];const _0x5d6bba='#'+_0x2cbd06,_0x41330c=_0x8e8975?hyperlink(_0x5d6bba,getWorkflowSessionUrl(_0x2e0b41,_0x8e8975,_0x2cbd06)):_0x5d6bba;let _0x760f2c=_0x14e530;stringWidth(_0x14e530)>_0x50b51d&&(_0x760f2c=_0x14e530[_0x3ee455(0x1ea)](0x0,_0x50b51d-0x1)+'…');const _0x2c9d32=a41_0x402fbc[_0x3ee455(0x16c)](_0x760f2c),_0x1f5fb4=stringWidth(_0x760f2c),_0x46c60b='\x20'[_0x3ee455(0xb3)](_0x205302-stringWidth(_0x760f2c)+0x2),_0x1b91ed='('+formatElapsed(_0x2a32df)+')',_0x5d301f=stringWidth(_0x1b91ed),_0x10ec51=stringWidth(_0x5d6bba),_0x798178=_0x10ec51+0x1+_0x1f5fb4+_0x46c60b[_0x3ee455(0x1c5)],_0x5a590d=_0x1f30f6-_0x798178-_0x5d301f-0x1-0x8;let _0x18aea4=_0x4ec558;stringWidth(_0x18aea4)>_0x5a590d&&(_0x18aea4=_0x18aea4['slice'](0x0,_0x5a590d-0x1)+'…');const _0x329310=_0x41330c+'\x20'+_0x2c9d32+_0x46c60b+_0x18aea4,_0x284b08=stringWidth(_0x329310),_0x5dda6c=_0x1f30f6-_0x284b08-_0x5d301f,_0x575f3c=_0x329310+'\x20'[_0x3ee455(0xb3)](Math[_0x3ee455(0x11f)](0x1,_0x5dda6c))+a41_0x402fbc[_0x3ee455(0x16c)](_0x1b91ed),_0x461f20=Math[_0x3ee455(0x123)]((_0x274867-_0x5c16d6)/_0x2d1524),_0x46f700=Math[_0x3ee455(0x123)]((_0x1e2a0a-_0x5c16d6)/_0x2d1524),_0x4233bb=Math[_0x3ee455(0x11f)](_0x461f20+0x1,_0x46f700),_0x54a008=new Array(_0xc7e45a)[_0x3ee455(0x15c)]('\x20');for(let _0x540671=_0x461f20;_0x540671<Math[_0x3ee455(0x121)](_0x4233bb,_0xc7e45a);_0x540671++){_0x54a008[_0x540671]='─';}const _0x413fe2=_0x54a008['map'](_0x6080c5=>_0x6080c5==='\x20'?'\x20':_0x5e75d7(_0x6080c5))[_0x3ee455(0xdb)]('');_0x351d73[_0x3ee455(0x194)](_0x5a37a7+'\x20'+_0x575f3c+'│'+_0x413fe2+'│');}return _0x351d73[_0x3ee455(0xdb)]('\x0a');}async[a41_0x448846(0xb4)](_0x1cfe7d,_0x3dbb6d,_0xe24907){const _0x336862=a41_0x448846,{options:_0x3d1002,tdx:_0x71a447}=_0x3dbb6d,_0x48e1f9=_0x3d1002[_0x336862(0x91)],{timelineRows:_0x2dddbf,timeAxisHeader:_0x28122d}=this[_0x336862(0x136)](_0x1cfe7d,_0x48e1f9),_0x3e9d0a=_0x2dddbf['filter'](_0xc0b944=>_0xc0b944[_0x336862(0xce)]);if(_0x3e9d0a[_0x336862(0x1c5)]===0x0){const _0x4b801a=this[_0x336862(0xc1)](_0x1cfe7d,_0x48e1f9);console[_0x336862(0x12f)](_0x4b801a);!_0xe24907&&(console['error'](''),console[_0x336862(0x154)](a41_0x402fbc[_0x336862(0x16c)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x336862(0x154)](a41_0x402fbc[_0x336862(0x16c)](_0x336862(0x225))+'or'+a41_0x402fbc[_0x336862(0x16c)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x28122d&&console[_0x336862(0x12f)](_0x28122d);const _0x58aab1=_0x2dddbf[_0x336862(0x183)](_0x2aa5fc=>_0x2aa5fc[_0x336862(0xce)])[_0x336862(0x1bc)](_0xb22f2e=>({'title':_0xb22f2e[_0x336862(0x1f3)],'value':_0xb22f2e[_0x336862(0xce)]})),_0x50ec32=process[_0x336862(0x163)][_0x336862(0x1a5)]||0x3c,_0x1c2373=Math['max'](0x28,Math[_0x336862(0x123)](_0x50ec32*0x2/0x3)),_0xcea6d4=await a41_0x131ac0({'type':_0x336862(0x1c7),'name':_0x336862(0xce),'message':_0x336862(0xc7),'choices':_0x58aab1,'initial':-0x1,'limit':_0x1c2373,'clearFirst':!![],'fallback':{'title':_0x336862(0x146),'value':null},'suggest':(_0x3590fc,_0x39ca78)=>{const _0x36c350=_0x336862;if(!_0x3590fc)return Promise[_0x36c350(0x1d5)](_0x39ca78);const _0xd32b3b=_0x39ca78[_0x36c350(0x183)](_0x532cfd=>{const _0x5d70ef=_0x36c350,_0x1ffd35=_0x532cfd;return _0x1ffd35[_0x5d70ef(0x22b)][_0x5d70ef(0x1d6)]()['includes'](_0x3590fc[_0x5d70ef(0x1d6)]());});return Promise[_0x36c350(0x1d5)](_0xd32b3b);}}),_0x475ed7=()=>{const _0x1b57df=_0x336862;process[_0x1b57df(0x163)][_0x1b57df(0x22a)](_0x1b57df(0x1d3)),process[_0x1b57df(0x163)][_0x1b57df(0x22a)]('\x1b[1A\x1b[2K'),process[_0x1b57df(0x163)][_0x1b57df(0x22a)]('\x1b[1A\x1b[2K');},_0x49d18c=_0xcea6d4&&_0xcea6d4[_0x336862(0xce)]&&_0xcea6d4['attemptId']!==null&&_0xcea6d4['attemptId']['trim']()!=='';if(!_0x49d18c){_0x475ed7(),console[_0x336862(0x12f)](a41_0x402fbc[_0x336862(0x16c)](_0x336862(0x165)));return;}_0x475ed7();const _0xdac7cd=_0x1cfe7d[_0x336862(0x16b)](_0x5a6068=>_0x5a6068[_0x336862(0x190)]?.['id']===_0xcea6d4[_0x336862(0xce)]);if(_0xdac7cd){const _0x46d84e=_0xdac7cd['project']?.[_0x336862(0x18a)]||'?',_0x26cbf7=_0xdac7cd[_0x336862(0x13f)]?.['name']||'?';console[_0x336862(0x12f)](_0x336862(0x108)+a41_0x402fbc['dim'](_0x46d84e)+_0x336862(0x1d9)+a41_0x402fbc[_0x336862(0x16c)](_0x26cbf7));}const _0x15dd50=new WorkflowTimelineCommand();await _0x15dd50['execute']({'args':[],'options':{..._0x3d1002,'attemptId':_0xcea6d4[_0x336862(0xce)]},'tdx':_0x71a447});}[a41_0x448846(0x136)](_0x1a018a,_0x3ae393){const _0x5ac66c=a41_0x448846,_0x2c677b=new Map();for(const _0x3f1f64 of _0x1a018a){_0x3f1f64['id']&&_0x3f1f64[_0x5ac66c(0x190)]?.['id']&&_0x2c677b['set'](_0x3f1f64['id'],_0x3f1f64[_0x5ac66c(0x190)]['id']);}const _0x4a72fe=[];let _0xe138a7='';const _0x2d02ad=this[_0x5ac66c(0xc1)](_0x1a018a,_0x3ae393),_0x5999b8=_0x2d02ad[_0x5ac66c(0x19b)]('\x0a');for(const _0x52ffd4 of _0x5999b8){if(_0x52ffd4['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x52ffd4[_0x5ac66c(0x208)](/^\s+\d{4}-\d{2}-\d{2}/))_0xe138a7=_0x52ffd4;else{if(_0x52ffd4[_0x5ac66c(0x208)](/^[✅❌🔄🛑⏳]/)){const _0x4403c0=_0x52ffd4[_0x5ac66c(0x208)](/#(\d+)/),_0x2b5569=_0x4403c0?_0x4403c0[0x1]:null,_0x164bc9=_0x2b5569?_0x2c677b[_0x5ac66c(0x16d)](_0x2b5569)||null:null,_0x1274d4=_0x1a018a['find'](_0x1f7c2e=>_0x1f7c2e['id']===_0x2b5569),_0x4a0d88=_0x1274d4?.[_0x5ac66c(0x1b2)]?.['name']||'';_0x4a72fe[_0x5ac66c(0x194)]({'displayLine':_0x52ffd4,'attemptId':_0x164bc9,'projectName':_0x4a0d88});}}}return{'timelineRows':_0x4a72fe,'timeAxisHeader':_0xe138a7};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x1bb);[a41_0x448846(0xd0)]=a41_0x448846(0x145);async[a41_0x448846(0x1f9)](_0x188577){const _0x1707bc=a41_0x448846,{options:_0x5a3444,args:_0x569f77,tdx:_0x1171ac}=_0x188577,_0x3d4ad8=this[_0x1707bc(0xea)](_0x569f77,_0x5a3444);if(!_0x3d4ad8)return 0x1;const {projectName:_0x577b9a,workflowName:_0x5306de}=_0x3d4ad8,_0x159bea=_0x5a3444['includeRetried'];if(_0x5a3444[_0x1707bc(0x138)]){if(_0x577b9a&&_0x5306de)console['error']('Filter:\x20'+_0x577b9a+'.'+_0x5306de);else _0x577b9a&&console[_0x1707bc(0x154)](_0x1707bc(0x1fa)+_0x577b9a);_0x159bea&&console[_0x1707bc(0x154)]('Include\x20retried:\x20yes');}const _0x1074d2=await withSpinner(_0x1707bc(0x20e),()=>_0x1171ac[_0x1707bc(0x13f)]['attempts']({'projectName':_0x577b9a,'workflowName':_0x5306de,'includeRetried':_0x159bea,'limit':_0x5a3444['limit']}),{'verbose':_0x5a3444['verbose']}),_0x45efcf=_0x1074d2[_0x1707bc(0x104)],_0x2859f2=_0x5a3444[_0x1707bc(0x222)]||0x64,_0x249f5f=_0x45efcf[_0x1707bc(0x1c5)]>=_0x2859f2?a41_0x402fbc[_0x1707bc(0x16c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x45efcf[_0x1707bc(0x1c5)]+'\x20attempt'+(_0x45efcf[_0x1707bc(0x1c5)]!==0x1?'s':'')+_0x249f5f);if(_0x5a3444[_0x1707bc(0x177)]===_0x1707bc(0x143)||_0x5a3444[_0x1707bc(0x177)]===_0x1707bc(0x168)||_0x5a3444[_0x1707bc(0x177)]===_0x1707bc(0x221))await handleSDKOutput(_0x45efcf,_0x5a3444);else{if(_0x45efcf[_0x1707bc(0x1c5)]===0x0){if(_0x577b9a&&_0x5306de)console[_0x1707bc(0x12f)](_0x1707bc(0xa6)+_0x577b9a+'.'+_0x5306de);else _0x577b9a?console[_0x1707bc(0x12f)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x577b9a):console[_0x1707bc(0x12f)]('No\x20attempts\x20found');}else{const _0x81932b=_0x5a3444[_0x1707bc(0x91)],_0x2a78d5=_0x45efcf[_0x1707bc(0x1bc)](_0x15e5d7=>{const _0x3567d6=_0x1707bc,_0x4b23fe=a41_0x402fbc[_0x3567d6(0x16c)]('#'+_0x15e5d7['id']),_0x36c322=_0x15e5d7['project']?.['id'],_0xdcac2e=_0x15e5d7[_0x3567d6(0xe1)]||_0x15e5d7[_0x3567d6(0x13b)],_0x4eaaef=_0x36c322&&_0xdcac2e?hyperlink(_0x4b23fe,getWorkflowAttemptUrl(_0x81932b,_0x36c322,_0xdcac2e,_0x15e5d7['id'])):_0x4b23fe,{icon:_0x54d303,text:_0x419c7b}=getAttemptStatusDisplay(_0x15e5d7),_0x4a699c=(_0x15e5d7[_0x3567d6(0x1b2)]?.[_0x3567d6(0x18a)]||'?')+'.'+(_0x15e5d7[_0x3567d6(0x13f)]?.[_0x3567d6(0x18a)]||'?'),_0x5151d2=_0x15e5d7[_0x3567d6(0x1ce)]?a41_0x402fbc[_0x3567d6(0x16c)](_0x15e5d7['sessionTime']):'';return(_0x4eaaef+'\x20'+_0x54d303+(_0x419c7b?'\x20'+_0x419c7b:'')+'\x20'+_0x4a699c+'\x20'+_0x5151d2)[_0x3567d6(0x18f)]();});await writeOutput(_0x2a78d5[_0x1707bc(0xdb)]('\x0a'),_0x5a3444[_0x1707bc(0xbb)],_0x1707bc(0x1d8));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a41_0x448846(0x1e5);[a41_0x448846(0xd0)]=a41_0x448846(0x1f0);async[a41_0x448846(0x1f9)](_0xbb38bc){const _0x29ec14=a41_0x448846,{options:_0x58cdae,args:_0x1b11fb,tdx:_0x283d00}=_0xbb38bc,_0x504c6a=_0x1b11fb[0x0];if(!_0x504c6a)return console[_0x29ec14(0x154)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x58cdae['verbose']&&console[_0x29ec14(0x154)]('Attempt\x20ID:\x20'+_0x504c6a);const _0x40051b=await withSpinner('Getting\x20attempt\x20details...',()=>_0x283d00[_0x29ec14(0x13f)]['attempt'](_0x504c6a),{'verbose':_0x58cdae[_0x29ec14(0x138)]}),_0x49389e=_0x40051b['data'];let _0xafb3e5;!_0x49389e['done']?_0xafb3e5=_0x49389e['cancelRequested']?_0x29ec14(0x9c):'running':_0xafb3e5=_0x49389e[_0x29ec14(0xbf)]?_0x29ec14(0xbf):'error';let _0x17be56;if(_0x49389e[_0x29ec14(0x97)]&&_0x49389e[_0x29ec14(0xb7)]){const _0x5d7786=new Date(_0x49389e[_0x29ec14(0x97)])['getTime'](),_0x2ed547=new Date(_0x49389e['finishedAt'])[_0x29ec14(0x1a9)]();_0x17be56=Math[_0x29ec14(0x1fc)]((_0x2ed547-_0x5d7786)/0x3e8);}const _0x2ac434={'attempt_id':_0x49389e['id'],'status':_0xafb3e5,..._0x49389e[_0x29ec14(0x10e)]!==undefined&&{'index':_0x49389e[_0x29ec14(0x10e)]},..._0x49389e['project']&&{'project':_0x49389e['project'][_0x29ec14(0x18a)]},..._0x49389e[_0x29ec14(0x13f)]&&{'workflow':_0x49389e['workflow'][_0x29ec14(0x18a)]},..._0x49389e[_0x29ec14(0x13b)]&&{'session_id':_0x49389e[_0x29ec14(0x13b)]},..._0x49389e[_0x29ec14(0x1ce)]&&{'session_time':_0x49389e[_0x29ec14(0x1ce)]},..._0x49389e[_0x29ec14(0x1b1)]&&{'retry_attempt':_0x49389e[_0x29ec14(0x1b1)]},..._0x17be56!==undefined&&{'duration_sec':_0x17be56},..._0x49389e[_0x29ec14(0x97)]&&{'created_at':_0x49389e[_0x29ec14(0x97)]},..._0x49389e['finishedAt']&&{'finished_at':_0x49389e[_0x29ec14(0xb7)]},...Object[_0x29ec14(0xd2)](_0x49389e['params'])['length']>0x0&&{'params':_0x49389e['params']}};return await handleSingleObjectOutput(_0x2ac434,_0x58cdae),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x448846(0x18a)]='workflow:tasks';[a41_0x448846(0xd0)]=a41_0x448846(0x197);async[a41_0x448846(0x1f9)](_0x1703b9){const _0x4ba2fe=a41_0x448846,{options:_0x56c3ce,args:_0x17e964,tdx:_0x1ad09e}=_0x1703b9,_0x12005a=_0x17e964[0x0];if(!_0x12005a)return console[_0x4ba2fe(0x154)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x1c9556=_0x56c3ce[_0x4ba2fe(0xfe)];_0x56c3ce['verbose']&&(console[_0x4ba2fe(0x154)](_0x4ba2fe(0x1ac)+_0x12005a),_0x1c9556&&console[_0x4ba2fe(0x154)](_0x4ba2fe(0x12a)));const _0x21bf6a=await withSpinner(_0x4ba2fe(0xb2),()=>_0x1ad09e[_0x4ba2fe(0x13f)][_0x4ba2fe(0x113)](_0x12005a,_0x1c9556||![]),{'verbose':_0x56c3ce['verbose']}),_0x12424f=_0x21bf6a[_0x4ba2fe(0x104)];return console['error'](_0x4ba2fe(0x111)+_0x12424f['length']+_0x4ba2fe(0x1fb)+(_0x12424f[_0x4ba2fe(0x1c5)]!==0x1?'s':'')),await handleSDKOutput(_0x12424f,_0x56c3ce),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x448846(0x18a)]='workflow:logs';[a41_0x448846(0xd0)]=a41_0x448846(0x209);async[a41_0x448846(0x1f9)](_0x397a0f){const _0x3b4529=a41_0x448846,{options:_0x188cd6,args:_0x4fff39,tdx:_0x3a21e3}=_0x397a0f,_0x4e1fff=_0x4fff39[0x0];let _0xcb9209=_0x4fff39[0x1];if(!_0x4e1fff)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x188cd6[_0x3b4529(0x138)]&&(console[_0x3b4529(0x154)]('Attempt\x20ID:\x20'+_0x4e1fff),_0xcb9209&&console[_0x3b4529(0x154)](_0x3b4529(0x1e0)+_0xcb9209));const _0x44cd88=await withSpinner('Fetching\x20log\x20files...',()=>_0x3a21e3[_0x3b4529(0x13f)]['logFiles'](_0x4e1fff,_0xcb9209),{'verbose':_0x188cd6['verbose']}),_0x596299=_0x44cd88[_0x3b4529(0x104)];if(_0x596299[_0x3b4529(0x1c5)]===0x0)return console[_0x3b4529(0x154)](_0x3b4529(0xe8)),0x0;if(!_0xcb9209&&(_0x188cd6[_0x3b4529(0x143)]||_0x188cd6[_0x3b4529(0x177)]))return await handleSDKOutput(_0x596299,_0x188cd6),0x0;if(!_0xcb9209){const _0x4ad1bb=_0x596299[_0x3b4529(0x1bc)](_0x1e16a5=>({'title':_0x1e16a5[_0x3b4529(0x203)]+'\x20('+formatBytes(_0x1e16a5[_0x3b4529(0x117)])+')','value':_0x1e16a5[_0x3b4529(0x203)]})),_0x4980de=await a41_0x131ac0({'type':_0x3b4529(0x21d),'name':'task','message':_0x3b4529(0x1df),'choices':_0x4ad1bb});if(!_0x4980de['task'])return console[_0x3b4529(0x154)](_0x3b4529(0x165)),0x0;_0xcb9209=_0x4980de['task'];}const _0x1bfb05=await withSpinner(_0x3b4529(0x20a),()=>_0x3a21e3[_0x3b4529(0x13f)][_0x3b4529(0x125)](_0x4e1fff,_0xcb9209),{'verbose':_0x188cd6[_0x3b4529(0x138)]}),_0x395c5b=_0x1bfb05['data'];return _0x395c5b?console[_0x3b4529(0x12f)](_0x395c5b):console['error'](_0x3b4529(0x11c)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0xcc);['description']=a41_0x448846(0x19a);async[a41_0x448846(0x1f9)](_0x278474){const _0xa61a0=a41_0x448846,{options:_0x4eaa29,args:_0x13f2b4,tdx:_0x58c27b}=_0x278474,_0x139648=_0x13f2b4[0x0];if(!_0x139648)return console[_0xa61a0(0x154)](_0xa61a0(0xba)),0x1;const _0xfe41f5=_0x4eaa29[_0xa61a0(0x13a)];_0x4eaa29[_0xa61a0(0x138)]&&(console[_0xa61a0(0x154)](_0xa61a0(0x1ac)+_0x139648),_0xfe41f5&&console[_0xa61a0(0x154)]('Reason:\x20'+_0xfe41f5));if(!_0x4eaa29[_0xa61a0(0x228)]){const _0x14757e=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x139648+'?');if(!_0x14757e)return console['error']('Cancelled'),0x0;}const _0x194635=await withSpinner(_0xa61a0(0xfa),()=>_0x58c27b[_0xa61a0(0x13f)][_0xa61a0(0x8f)](_0x139648,_0xfe41f5),{'verbose':_0x4eaa29[_0xa61a0(0x138)]}),_0x384645=_0x194635[_0xa61a0(0x104)];return console[_0xa61a0(0x154)]('✔\x20'+_0x384645),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a41_0x448846(0x18a)]='workflow:retry';['description']=a41_0x448846(0xb8);async[a41_0x448846(0x1f9)](_0x2f4945){const _0x511ad1=a41_0x448846,{options:_0x45eb0b,args:_0x4ed404,tdx:_0x78ccfb}=_0x2f4945,_0x18747a=_0x4ed404[0x0];if(!_0x18747a)return console['error'](_0x511ad1(0x1f2)),console[_0x511ad1(0x154)](_0x511ad1(0xd8)),0x1;let _0x4ad834=![],_0x5810c8=_0x18747a;if(_0x18747a[_0x511ad1(0x1bf)](_0x511ad1(0x162)))_0x4ad834=!![],_0x5810c8=_0x18747a[_0x511ad1(0x14c)](0x8);else{if(_0x18747a[_0x511ad1(0x1bf)](_0x511ad1(0x1ee)))_0x4ad834=![],_0x5810c8=_0x18747a[_0x511ad1(0x14c)](0x8);else return console[_0x511ad1(0x154)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x511ad1(0x154)](_0x511ad1(0xd8)),0x1;}const _0x510b01=_0x45eb0b[_0x511ad1(0x99)],_0xf512c7=_0x45eb0b[_0x511ad1(0x169)],_0x9120ef=_0x45eb0b[_0x511ad1(0x229)],_0x4dd049=_0x45eb0b[_0x511ad1(0xa5)];_0x45eb0b[_0x511ad1(0x138)]&&(console[_0x511ad1(0x154)](_0x511ad1(0xd4)+(_0x4ad834?_0x511ad1(0x1ff):'attempt')+'\x20'+_0x5810c8),_0x510b01&&console[_0x511ad1(0x154)]('From\x20task:\x20'+_0x510b01),_0xf512c7&&console[_0x511ad1(0x154)]('Resume\x20from:\x20'+_0xf512c7),_0x9120ef&&console[_0x511ad1(0x154)](_0x511ad1(0x1c0)+_0x9120ef),_0x4dd049&&console[_0x511ad1(0x154)](_0x511ad1(0x21a)));let _0x5e7656;if(_0x9120ef)try{if(_0x9120ef[_0x511ad1(0x1bf)]('@')){const _0x82ecf0=await import(_0x511ad1(0x15d)),_0x5c8ab3=_0x9120ef[_0x511ad1(0x14c)](0x1),_0x110679=await _0x82ecf0['readFile'](_0x5c8ab3,_0x511ad1(0x15b));_0x5e7656=JSON[_0x511ad1(0xed)](_0x110679);}else _0x5e7656=JSON[_0x511ad1(0xed)](_0x9120ef);}catch{return console[_0x511ad1(0x154)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x45eb0b[_0x511ad1(0x228)]){const _0x304f7d=await confirmKey(_0x511ad1(0x16a)+(_0x4ad834?_0x511ad1(0x1ff):'attempt')+'\x20'+_0x5810c8+'?');if(!_0x304f7d)return console[_0x511ad1(0x154)](_0x511ad1(0x165)),0x0;}let _0x200ed4;_0x4ad834?_0x200ed4=await withSpinner(_0x511ad1(0x141),()=>_0x78ccfb['workflow'][_0x511ad1(0xfc)](_0x5810c8,{'fromTask':_0x510b01,'retryParams':_0x5e7656}),{'verbose':_0x45eb0b[_0x511ad1(0x138)]}):_0x200ed4=await withSpinner(_0x511ad1(0x18d),()=>_0x78ccfb[_0x511ad1(0x13f)][_0x511ad1(0x19d)](_0x5810c8,{'resumeFrom':_0xf512c7,'retryParams':_0x5e7656,'force':_0x4dd049}),{'verbose':_0x45eb0b[_0x511ad1(0x138)]});const _0xa1909=_0x200ed4[_0x511ad1(0x104)];return console[_0x511ad1(0x154)](_0x511ad1(0xc3)),console['error'](_0x511ad1(0xcb)+_0xa1909[_0x511ad1(0xce)]),console[_0x511ad1(0x154)](_0x511ad1(0x224)+_0xa1909[_0x511ad1(0x13b)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x11b);[a41_0x448846(0xd0)]=a41_0x448846(0x1ed);async['execute'](_0x51e6d5){const _0x5b5ef8=a41_0x448846,{options:_0x3f48c9,args:_0x4e0778,tdx:_0x4a9cf2}=_0x51e6d5;let _0x46d076=_0x4e0778[0x0];if(!_0x46d076){const _0x5695eb=this[_0x5b5ef8(0x1f5)]([],_0x3f48c9),_0x57b779=await withSpinner(_0x5b5ef8(0x20b),()=>_0x4a9cf2[_0x5b5ef8(0x13f)]['workflows'](_0x5695eb,{'limit':_0x3f48c9[_0x5b5ef8(0x222)]}),{'verbose':_0x3f48c9[_0x5b5ef8(0x138)]}),_0x2de15f=_0x57b779[_0x5b5ef8(0x104)];if(_0x2de15f[_0x5b5ef8(0x1c5)]===0x0)return console[_0x5b5ef8(0x154)](_0x5b5ef8(0x1d7)),!_0x5695eb&&console[_0x5b5ef8(0x154)](a41_0x402fbc[_0x5b5ef8(0x16c)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x5bc8e2=_0x2de15f[_0x5b5ef8(0x1bc)](_0x914be7=>({'title':_0x914be7['project']?.['name']+'.'+_0x914be7[_0x5b5ef8(0x18a)],'value':_0x914be7[_0x5b5ef8(0x1b2)]?.['name']+'.'+_0x914be7['name'],'description':_0x914be7[_0x5b5ef8(0x124)]?'revision:\x20'+_0x914be7['revision']:undefined})),_0x58c2fb=await a41_0x131ac0({'type':_0x5b5ef8(0x21d),'name':_0x5b5ef8(0x13f),'message':_0x5b5ef8(0xef),'choices':_0x5bc8e2});if(!_0x58c2fb['workflow'])return 0x1;_0x46d076=_0x58c2fb['workflow'];}if(!_0x46d076[_0x5b5ef8(0x14b)]('.')){const _0x300d92=this['resolveProject']([],_0x3f48c9);if(_0x300d92)_0x46d076=_0x300d92+'.'+_0x46d076;else return console['error'](a41_0x402fbc[_0x5b5ef8(0x95)](_0x5b5ef8(0x9a)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x5b5ef8(0x154)](a41_0x402fbc[_0x5b5ef8(0x16c)](_0x5b5ef8(0xf9))),0x1;}const _0x457168=_0x3f48c9[_0x5b5ef8(0x10d)],_0x1aa785=_0x3f48c9[_0x5b5ef8(0x1ce)],_0x5be559={};if(_0x457168&&Array[_0x5b5ef8(0x1b0)](_0x457168))for(const _0x3f8228 of _0x457168){const _0x459b12=_0x3f8228[_0x5b5ef8(0x15e)]('=');if(_0x459b12===-0x1)return console['error'](_0x5b5ef8(0x1b8)+_0x3f8228),console[_0x5b5ef8(0x154)](_0x5b5ef8(0x1d2)),0x1;const _0x14f61d=_0x3f8228[_0x5b5ef8(0x14c)](0x0,_0x459b12),_0x18cfa7=_0x3f8228[_0x5b5ef8(0x14c)](_0x459b12+0x1);try{_0x5be559[_0x14f61d]=JSON['parse'](_0x18cfa7);}catch{_0x5be559[_0x14f61d]=_0x18cfa7;}}_0x3f48c9[_0x5b5ef8(0x138)]&&(console[_0x5b5ef8(0x154)](_0x5b5ef8(0xb0)+_0x46d076),Object[_0x5b5ef8(0xd2)](_0x5be559)['length']>0x0&&console[_0x5b5ef8(0x154)]('Parameters:\x20'+JSON['stringify'](_0x5be559)),_0x1aa785&&console[_0x5b5ef8(0x154)](_0x5b5ef8(0x94)+_0x1aa785));const _0x54beb9=await withSpinner('Starting\x20workflow\x20run...',()=>_0x4a9cf2['workflow'][_0x5b5ef8(0x18e)](_0x46d076,_0x5be559,{'sessionTime':_0x1aa785}),{'verbose':_0x3f48c9[_0x5b5ef8(0x138)]}),_0x20c644=_0x54beb9['data'];console['error'](_0x5b5ef8(0x171)),console['error'](_0x5b5ef8(0xe4)+_0x20c644['id']),console[_0x5b5ef8(0x154)](_0x5b5ef8(0x224)+_0x20c644[_0x5b5ef8(0x13b)]),console[_0x5b5ef8(0x154)](_0x5b5ef8(0x1b5)+_0x20c644[_0x5b5ef8(0x1b2)]?.[_0x5b5ef8(0x18a)]),console['error'](_0x5b5ef8(0x137)+_0x20c644[_0x5b5ef8(0x13f)]?.[_0x5b5ef8(0x18a)]);if(_0x20c644[_0x5b5ef8(0x1b2)]?.['id']&&_0x20c644[_0x5b5ef8(0x13b)]&&_0x20c644['id']){const _0x23593d=_0x3f48c9[_0x5b5ef8(0x91)],_0x112d94=getConsoleUrl(_0x23593d,_0x5b5ef8(0x112)+_0x20c644[_0x5b5ef8(0x1b2)]['id']+'/sessions/'+_0x20c644[_0x5b5ef8(0x13b)]+_0x5b5ef8(0x133)+_0x20c644['id']);console[_0x5b5ef8(0x154)](_0x5b5ef8(0x17c)+a41_0x402fbc[_0x5b5ef8(0x18c)](_0x112d94));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';[a41_0x448846(0xd0)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a41_0x448846(0x1f9)](_0x122b24){const _0x39fa9a=a41_0x448846,{options:_0x5364e5,args:_0x208a84,tdx:_0x505252}=_0x122b24,_0x59fcd2=_0x208a84[0x0],_0x34e7bc=_0x208a84[0x1]||'.';if(!_0x59fcd2)return console[_0x39fa9a(0x154)](_0x39fa9a(0x14a)),console[_0x39fa9a(0x154)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x33ace8=_0x5364e5[_0x39fa9a(0x124)];_0x5364e5[_0x39fa9a(0x138)]&&(console[_0x39fa9a(0x154)]('Project:\x20'+_0x59fcd2),console[_0x39fa9a(0x154)]('Output\x20directory:\x20'+_0x34e7bc),_0x33ace8&&console[_0x39fa9a(0x154)](_0x39fa9a(0x1c3)+_0x33ace8));const _0x4c16f8=await withSpinner('Downloading\x20project\x20'+_0x59fcd2+_0x39fa9a(0xeb),()=>_0x505252[_0x39fa9a(0x13f)][_0x39fa9a(0x109)](_0x59fcd2,_0x34e7bc,{'revision':_0x33ace8}),{'verbose':_0x5364e5[_0x39fa9a(0x138)]}),_0xce6550=_0x4c16f8['data'];return console[_0x39fa9a(0x154)](_0x39fa9a(0x1be)+_0xce6550[_0x39fa9a(0x9e)]),console['error'](_0x39fa9a(0x201)+_0xce6550[_0x39fa9a(0x124)]),console[_0x39fa9a(0x154)](_0x39fa9a(0x18b)+_0xce6550[_0x39fa9a(0x9f)]),console[_0x39fa9a(0x154)]('\x20\x20Location:\x20'+_0x34e7bc+'/'+_0xce6550[_0x39fa9a(0x9e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x15f);[a41_0x448846(0xd0)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x27e257){const _0x196018=a41_0x448846,{options:_0x2dcf45,args:_0x3f6a87,tdx:_0x3d7b91}=_0x27e257;let _0x23cbd0='.',_0x175a17=_0x2dcf45[_0x196018(0x18a)];if(_0x3f6a87[0x0]){const {promises:_0x8d31c7}=await import('fs');try{const _0x47da2a=await _0x8d31c7['stat'](_0x3f6a87[0x0]);if(_0x47da2a['isDirectory']())_0x23cbd0=_0x3f6a87[0x0];else return console[_0x196018(0x154)]('Error:\x20'+_0x3f6a87[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x175a17=_0x3f6a87[0x0],_0x23cbd0='.';}}const _0x24d734=_0x2dcf45[_0x196018(0x124)],_0x5952c2=_0x2dcf45[_0x196018(0x129)];_0x2dcf45[_0x196018(0x138)]&&(console[_0x196018(0x154)](_0x196018(0x140)+_0x23cbd0),_0x175a17&&console[_0x196018(0x154)]('Project\x20name:\x20'+_0x175a17),_0x24d734&&console['error'](_0x196018(0x1c3)+_0x24d734),_0x5952c2&&console[_0x196018(0x154)](_0x196018(0x173)));const _0x5d7ddd=await withSpinner(_0x196018(0x1d0),()=>_0x3d7b91[_0x196018(0x13f)][_0x196018(0x194)](_0x23cbd0,{'projectName':_0x175a17,'revision':_0x24d734,'skipValidation':_0x5952c2}),{'verbose':_0x2dcf45[_0x196018(0x138)]}),_0x5e66c1=_0x5d7ddd[_0x196018(0x104)];return console[_0x196018(0x154)](_0x196018(0x119)+_0x5e66c1['projectName']),console['error']('\x20\x20Project\x20ID:\x20'+_0x5e66c1[_0x196018(0xbe)]),console[_0x196018(0x154)](_0x196018(0x201)+_0x5e66c1[_0x196018(0x124)]),await this[_0x196018(0x1c6)](_0x3d7b91,_0x5e66c1[_0x196018(0x9e)],_0x2dcf45['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a41_0x448846(0x1dd);[a41_0x448846(0xd0)]=a41_0x448846(0x164);async[a41_0x448846(0x1f9)](_0x17ee99){const _0xd7720c=a41_0x448846,{options:_0x5574d4,args:_0x83adf6,tdx:_0x4ce241}=_0x17ee99,_0x4829f4=_0x83adf6[0x0],_0x140899=_0x83adf6[0x1];if(!_0x4829f4)return console['error'](a41_0x402fbc[_0xd7720c(0x95)]('Error:'),'Project\x20name\x20is\x20required'),console[_0xd7720c(0x154)](a41_0x402fbc[_0xd7720c(0x16c)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x30a42d=_0x5574d4[_0xd7720c(0x124)];_0x5574d4['verbose']&&(console[_0xd7720c(0x154)](_0xd7720c(0x108)+_0x4829f4),_0x140899&&console[_0xd7720c(0x154)](_0xd7720c(0x21f)+_0x140899),_0x30a42d&&console[_0xd7720c(0x154)](_0xd7720c(0x1c3)+_0x30a42d),_0x5574d4[_0xd7720c(0x22c)]&&console['error'](_0xd7720c(0x178)));const _0x4eb63d=await withSpinner(_0xd7720c(0x11e)+_0x4829f4+_0xd7720c(0xeb),()=>_0x4ce241[_0xd7720c(0x13f)][_0xd7720c(0x127)](_0x4829f4,{'targetDir':_0x140899,'revision':_0x30a42d}),{'verbose':_0x5574d4[_0xd7720c(0x138)]}),_0x55d1f7=_0x4eb63d[_0xd7720c(0x104)];_0x55d1f7[_0xd7720c(0x153)]?console[_0xd7720c(0x154)](_0xd7720c(0x1ec)+_0x55d1f7[_0xd7720c(0x9e)]):console['error'](_0xd7720c(0xd6)+_0x55d1f7[_0xd7720c(0x9e)]);console['error']('\x20\x20Revision:\x20'+_0x55d1f7['revision']),console[_0xd7720c(0x154)]('\x20\x20Target:\x20'+(a41_0xf5d811['relative'](process['cwd'](),_0x55d1f7[_0xd7720c(0x107)])||'.')),console[_0xd7720c(0x154)](_0xd7720c(0x1e7)+a41_0x402fbc['green']('+'+_0x55d1f7[_0xd7720c(0x1f7)][_0xd7720c(0x20c)]+_0xd7720c(0xc0))+',\x20'+(a41_0x402fbc['yellow']('~'+_0x55d1f7[_0xd7720c(0x1f7)]['modified']+_0xd7720c(0x1cc))+',\x20')+(a41_0x402fbc['red']('-'+_0x55d1f7[_0xd7720c(0x1f7)][_0xd7720c(0x114)]+'\x20deleted')+',\x20')+(''+a41_0x402fbc['dim'](_0x55d1f7[_0xd7720c(0x1f7)][_0xd7720c(0xd7)]+_0xd7720c(0x1e2))));for(const _0x3e2709 of _0x55d1f7[_0xd7720c(0x17e)]){_0x3e2709[_0xd7720c(0x128)]===_0xd7720c(0x1d4)&&_0x3e2709[_0xd7720c(0x1e8)]&&(console[_0xd7720c(0x154)]('\x0a'+a41_0x402fbc['cyan'](_0xd7720c(0x150)+_0x3e2709[_0xd7720c(0x192)])),console['error'](_0x3e2709[_0xd7720c(0x1e8)]));}if(!_0x55d1f7[_0xd7720c(0x213)])return saveSessionContext({'workflow_project':_0x55d1f7['projectName']},_0x5574d4[_0xd7720c(0x1ff)]),console['error'](a41_0x402fbc[_0xd7720c(0x142)](_0xd7720c(0x131))),console[_0xd7720c(0x154)](a41_0x402fbc[_0xd7720c(0x16c)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x55d1f7['projectName'])),0x0;if(_0x5574d4[_0xd7720c(0x22c)])return console['error'](a41_0x402fbc[_0xd7720c(0x1f6)](_0xd7720c(0xec))),0x0;if(!_0x5574d4['yes']){const _0x49c765=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x49c765)return console[_0xd7720c(0x154)](_0xd7720c(0x165)),0x0;}await withSpinner(_0xd7720c(0x166),()=>_0x4ce241[_0xd7720c(0x13f)][_0xd7720c(0x1e9)](_0x55d1f7,{'revision':_0x30a42d}),{'verbose':_0x5574d4[_0xd7720c(0x138)]}),saveSessionContext({'workflow_project':_0x55d1f7['projectName']},_0x5574d4[_0xd7720c(0x1ff)]),console[_0xd7720c(0x154)](a41_0x402fbc['green'](_0xd7720c(0xa4)));const _0x2dca7f=a41_0xf5d811[_0xd7720c(0x217)](process[_0xd7720c(0x191)](),_0x55d1f7[_0xd7720c(0x107)])||'.';return console[_0xd7720c(0x154)](a41_0x402fbc[_0xd7720c(0x16c)](_0xd7720c(0xad)+_0x2dca7f)),console[_0xd7720c(0x154)](a41_0x402fbc[_0xd7720c(0x16c)](_0xd7720c(0x13d)+_0x55d1f7[_0xd7720c(0x9e)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0xfd);[a41_0x448846(0xd0)]=a41_0x448846(0x13c);async[a41_0x448846(0x1f9)](_0x8dc4ba){const _0x3457ba=a41_0x448846,{options:_0x3dc68a,args:_0x5a698d,tdx:_0x1c790b}=_0x8dc4ba,_0x5ce5bc=this[_0x3457ba(0x10c)](_0x5a698d,_0x3dc68a),_0x5e52c0=_0x3dc68a['revision'],_0x4c9dbd=_0x3dc68a[_0x3457ba(0x129)];_0x3dc68a['verbose']&&(_0x5ce5bc&&console[_0x3457ba(0x154)]('Source\x20directory:\x20'+_0x5ce5bc),_0x5e52c0&&console['error'](_0x3457ba(0x1c3)+_0x5e52c0),_0x3dc68a[_0x3457ba(0x22c)]&&console['error']('Dry\x20run:\x20yes'),_0x4c9dbd&&console['error']('Validation:\x20skipped'));let _0x205640;try{_0x205640=await withSpinner(_0x3457ba(0xaa),()=>_0x1c790b['workflow'][_0x3457ba(0x120)]({'sourceDir':_0x5ce5bc,'revision':_0x5e52c0,'skipValidation':_0x4c9dbd}),{'verbose':_0x3dc68a['verbose']});}catch(_0x3b5f60){if(_0x3b5f60 instanceof Error&&_0x3b5f60['message'][_0x3457ba(0x14b)](_0x3457ba(0xbd)))return console['error'](a41_0x402fbc[_0x3457ba(0x95)](_0x3457ba(0x9a)),_0x3457ba(0x90)),_0x3dc68a[_0x3457ba(0x1b9)]?console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x16c)]('Tip:\x20cd\x20to\x20workflows/'+_0x3dc68a[_0x3457ba(0x1b9)]+_0x3457ba(0x1a7)+_0x3dc68a[_0x3457ba(0x1b9)]+'\x27')):console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x16c)](_0x3457ba(0x206))),0x1;throw _0x3b5f60;}const _0x1bd393=_0x205640[_0x3457ba(0x104)];console['error'](_0x3457ba(0xd6)+_0x1bd393[_0x3457ba(0x9e)]),console[_0x3457ba(0x154)]('\x20\x20Source:\x20'+_0x1bd393[_0x3457ba(0x134)]),console[_0x3457ba(0x154)](_0x3457ba(0x201)+_0x1bd393[_0x3457ba(0x124)]),console[_0x3457ba(0x154)]('\x20\x20Changes:\x20'+a41_0x402fbc[_0x3457ba(0x142)]('+'+_0x1bd393['summary'][_0x3457ba(0x20c)]+_0x3457ba(0xc0))+',\x20'+(a41_0x402fbc[_0x3457ba(0x1f6)]('~'+_0x1bd393['summary'][_0x3457ba(0x1d4)]+_0x3457ba(0x1cc))+',\x20')+(a41_0x402fbc[_0x3457ba(0x95)]('-'+_0x1bd393[_0x3457ba(0x1f7)][_0x3457ba(0x114)]+_0x3457ba(0xb6))+',\x20')+(''+a41_0x402fbc[_0x3457ba(0x16c)](_0x1bd393[_0x3457ba(0x1f7)]['unchanged']+_0x3457ba(0x1e2))));for(const _0x59c529 of _0x1bd393[_0x3457ba(0x17e)]){_0x59c529[_0x3457ba(0x128)]===_0x3457ba(0x1d4)&&_0x59c529[_0x3457ba(0x1e8)]&&(console[_0x3457ba(0x154)]('\x0a'+a41_0x402fbc['cyan']('---\x20'+_0x59c529['path'])),console[_0x3457ba(0x154)](_0x59c529[_0x3457ba(0x1e8)]));}if(!_0x1bd393['hasChanges'])return console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x142)](_0x3457ba(0x1b7))),await this[_0x3457ba(0x1c6)](_0x1c790b,_0x1bd393[_0x3457ba(0x9e)],_0x3dc68a['site']),0x0;if(_0x3dc68a['dryRun'])return console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x1f6)](_0x3457ba(0x1db))),0x0;if(!_0x3dc68a['yes']){const _0x4cec8d=await confirmKey(_0x3457ba(0x1de));if(!_0x4cec8d)return console[_0x3457ba(0x154)](_0x3457ba(0x165)),0x0;}const _0x22482d=await withSpinner('Pushing\x20project...',()=>_0x1c790b[_0x3457ba(0x13f)][_0x3457ba(0x9d)](_0x1bd393),{'verbose':_0x3dc68a[_0x3457ba(0x138)]}),_0x4a7dbf=_0x22482d[_0x3457ba(0x104)];return console[_0x3457ba(0x154)](a41_0x402fbc[_0x3457ba(0x142)](_0x3457ba(0x98))),console[_0x3457ba(0x154)]('\x20\x20Project\x20ID:\x20'+_0x4a7dbf['projectId']),console[_0x3457ba(0x154)]('\x20\x20Revision:\x20'+_0x4a7dbf[_0x3457ba(0x124)]),await this['showWorkflowConsoleUrl'](_0x1c790b,_0x4a7dbf['projectName'],_0x3dc68a[_0x3457ba(0x91)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x1e1);[a41_0x448846(0xd0)]=a41_0x448846(0xc4);async['execute'](_0x1cb587){const _0x5af8c9=a41_0x448846,{options:_0xfcd070,args:_0x44d45b,tdx:_0x27e05a}=_0x1cb587,_0x3fe29b=this[_0x5af8c9(0x10c)](_0x44d45b,_0xfcd070),_0x1655ed=_0xfcd070[_0x5af8c9(0x18a)],_0x3e2cd7=_0xfcd070[_0x5af8c9(0x124)],_0x156d5f=_0xfcd070['skipValidation'];if(!_0x3fe29b)return console[_0x5af8c9(0x154)](a41_0x402fbc[_0x5af8c9(0x95)](_0x5af8c9(0x9a)),_0x5af8c9(0x211)),console[_0x5af8c9(0x154)](a41_0x402fbc[_0x5af8c9(0x16c)](_0x5af8c9(0x159))),console[_0x5af8c9(0x154)](a41_0x402fbc['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x1655ed)return console['error'](a41_0x402fbc[_0x5af8c9(0x95)](_0x5af8c9(0x9a)),_0x5af8c9(0x167)),console['error'](a41_0x402fbc[_0x5af8c9(0x16c)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0xfcd070[_0x5af8c9(0x138)]&&(console['error'](_0x5af8c9(0x1e4)+_0x3fe29b),console['error'](_0x5af8c9(0x106)+_0x1655ed),_0x3e2cd7&&console['error'](_0x5af8c9(0x1c3)+_0x3e2cd7),_0xfcd070['dryRun']&&console[_0x5af8c9(0x154)](_0x5af8c9(0x178)),_0x156d5f&&console[_0x5af8c9(0x154)](_0x5af8c9(0x173)));const _0x15c46e=await withSpinner(_0x5af8c9(0x17d),()=>_0x27e05a['workflow']['prepareCloneProject'](_0x3fe29b,_0x1655ed,{'revision':_0x3e2cd7,'skipValidation':_0x156d5f}),{'verbose':_0xfcd070[_0x5af8c9(0x138)]}),_0x2f910f=_0x15c46e[_0x5af8c9(0x104)];console[_0x5af8c9(0x154)](_0x5af8c9(0x1cf)+_0x2f910f[_0x5af8c9(0x134)]);_0x2f910f[_0x5af8c9(0xc8)]&&console[_0x5af8c9(0x154)](_0x5af8c9(0x12c)+_0x2f910f[_0x5af8c9(0xc8)]);console[_0x5af8c9(0x154)](_0x5af8c9(0x106)+_0x2f910f[_0x5af8c9(0x214)]),console[_0x5af8c9(0x154)]('Revision:\x20'+_0x2f910f[_0x5af8c9(0x124)]),console[_0x5af8c9(0x154)](_0x5af8c9(0x132)+_0x2f910f['fileCount']);_0x2f910f['targetExists']&&(console[_0x5af8c9(0x154)](a41_0x402fbc[_0x5af8c9(0x1f6)](_0x5af8c9(0x1a1)+_0x2f910f[_0x5af8c9(0x214)]+_0x5af8c9(0x17f)+_0x2f910f[_0x5af8c9(0x1e6)]+')')),console[_0x5af8c9(0x154)](a41_0x402fbc[_0x5af8c9(0x1f6)](_0x5af8c9(0x1c2))));if(_0xfcd070['dryRun'])return console['error'](a41_0x402fbc[_0x5af8c9(0x1f6)](_0x5af8c9(0xf2))),0x0;if(!_0xfcd070[_0x5af8c9(0x228)]){const _0x57c3bc=_0x2f910f[_0x5af8c9(0xc8)]||a41_0xf5d811[_0x5af8c9(0x105)](_0x3fe29b),_0x5a0f38=_0x2f910f[_0x5af8c9(0x182)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x1655ed+_0x5af8c9(0x1c4):_0x5af8c9(0x181)+_0x57c3bc+_0x5af8c9(0x1b6)+_0x1655ed+'\x22?',_0x3462cf=await confirmKey(_0x5a0f38);if(!_0x3462cf)return console[_0x5af8c9(0x154)]('Cancelled'),0x0;}const _0x5123de=await withSpinner(_0x2f910f[_0x5af8c9(0x182)]?'Updating\x20'+_0x1655ed+'...':_0x5af8c9(0x115)+_0x1655ed+_0x5af8c9(0xeb),()=>_0x27e05a[_0x5af8c9(0x13f)][_0x5af8c9(0xbc)](_0x2f910f),{'verbose':_0xfcd070[_0x5af8c9(0x138)]}),_0x269c92=_0x5123de[_0x5af8c9(0x104)];return console[_0x5af8c9(0x154)](a41_0x402fbc['green'](_0x2f910f[_0x5af8c9(0x182)]?_0x5af8c9(0x1c9):'✔\x20Clone\x20complete')),console['error'](_0x5af8c9(0x1b5)+_0x269c92[_0x5af8c9(0x214)]),console[_0x5af8c9(0x154)](_0x5af8c9(0xe3)+_0x269c92[_0x5af8c9(0x152)]),console[_0x5af8c9(0x154)](_0x5af8c9(0x201)+_0x269c92['revision']),await this[_0x5af8c9(0x1c6)](_0x27e05a,_0x269c92[_0x5af8c9(0x214)],_0xfcd070['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x20f);[a41_0x448846(0xd0)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0xe82962){const _0x4e06f5=a41_0x448846,{options:_0x17056b,args:_0x5c1668,tdx:_0x2454bc}=_0xe82962,_0x314647=_0x5c1668[0x0];if(!_0x314647)return console[_0x4e06f5(0x154)](_0x4e06f5(0x195)),console[_0x4e06f5(0x154)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x17056b[_0x4e06f5(0x138)]&&console[_0x4e06f5(0x154)]('Project:\x20'+_0x314647);if(!_0x17056b[_0x4e06f5(0x228)]){const _0x31f055=await confirmKey(_0x4e06f5(0x17b)+_0x314647+_0x4e06f5(0x158));if(!_0x31f055)return console[_0x4e06f5(0x154)](_0x4e06f5(0x165)),0x0;}const _0x8a26ae=await withSpinner('Deleting\x20project\x20'+_0x314647+_0x4e06f5(0xeb),()=>_0x2454bc['workflow']['delete'](_0x314647),{'verbose':_0x17056b[_0x4e06f5(0x138)]}),_0x3c0988=_0x8a26ae['data'];return console[_0x4e06f5(0x154)](_0x4e06f5(0x193)+_0x3c0988[_0x4e06f5(0x9e)]),console[_0x4e06f5(0x154)](_0x4e06f5(0xe3)+_0x3c0988[_0x4e06f5(0xbe)]),0x0;}}export function parseKeyValue(_0x4d0c84){const _0x2bf9b3=a41_0x448846,_0x4d1094=_0x4d0c84['indexOf']('=');if(_0x4d1094===-0x1)throw new Error(_0x2bf9b3(0x1a4)+_0x4d0c84+_0x2bf9b3(0x174));const _0x410877=_0x4d0c84[_0x2bf9b3(0x14c)](0x0,_0x4d1094),_0xeaa1cf=_0x4d0c84[_0x2bf9b3(0x14c)](_0x4d1094+0x1);if(!_0x410877)throw new Error(_0x2bf9b3(0x100));return{'key':_0x410877,'value':_0xeaa1cf};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x180);[a41_0x448846(0xd0)]=a41_0x448846(0x198);async[a41_0x448846(0x1f9)](_0x3ff918){const _0x2fb773=a41_0x448846,{options:_0x4126ab,args:_0x4c04f9,tdx:_0x5a3856}=_0x3ff918,_0xa53bc3=this[_0x2fb773(0x9b)](_0x4c04f9,_0x4126ab);if(!_0xa53bc3)return 0x1;_0x4126ab[_0x2fb773(0x138)]&&console[_0x2fb773(0x154)](_0x2fb773(0x108)+_0xa53bc3);const _0x536570=await withSpinner(_0x2fb773(0xf6),()=>_0x5a3856[_0x2fb773(0x13f)][_0x2fb773(0x200)](_0xa53bc3),{'verbose':_0x4126ab[_0x2fb773(0x138)]}),{secrets:_0x53fffd}=_0x536570[_0x2fb773(0x104)];return console[_0x2fb773(0x154)](_0x2fb773(0x111)+_0x53fffd[_0x2fb773(0x1c5)]+'\x20secret'+(_0x53fffd['length']!==0x1?'s':'')),await handleSDKOutput(_0x53fffd,_0x4126ab),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]='workflow:secrets:set';['description']=a41_0x448846(0x1e3);async[a41_0x448846(0x1f9)](_0x1187c1){const _0x10c8cc=a41_0x448846,{options:_0xafdc52,args:_0xea600,tdx:_0x4741a8}=_0x1187c1;let _0x265b3c,_0x418b1e;if(_0xea600[_0x10c8cc(0x1c5)]>=0x2)_0x265b3c=_0xea600[0x0],_0x418b1e=_0xea600[0x1];else{if(_0xea600['length']===0x1&&_0xafdc52[_0x10c8cc(0x1b9)])_0x265b3c=_0xafdc52[_0x10c8cc(0x1b9)],_0x418b1e=_0xea600[0x0];else return _0xea600[_0x10c8cc(0x1c5)]===0x1?(console[_0x10c8cc(0x154)](_0x10c8cc(0x14a)),console['error'](_0x10c8cc(0xf9)),0x1):(console[_0x10c8cc(0x154)](_0x10c8cc(0xee)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x5e3656,_0x4dfd96;try{({key:_0x5e3656,value:_0x4dfd96}=parseKeyValue(_0x418b1e));}catch(_0x33b9b1){return _0x33b9b1 instanceof Error&&console[_0x10c8cc(0x154)](a41_0x402fbc[_0x10c8cc(0x95)](_0x10c8cc(0x9a)),_0x33b9b1[_0x10c8cc(0x19f)]),0x1;}_0xafdc52['verbose']&&(console[_0x10c8cc(0x154)](_0x10c8cc(0x108)+_0x265b3c),console[_0x10c8cc(0x154)](_0x10c8cc(0x19c)+_0x5e3656));const _0x18d645=await withSpinner(_0x10c8cc(0x1da),()=>_0x4741a8['workflow']['setSecret'](_0x265b3c,_0x5e3656,_0x4dfd96),{'verbose':_0xafdc52[_0x10c8cc(0x138)]}),_0x188cc3=_0x18d645[_0x10c8cc(0x104)];return console[_0x10c8cc(0x154)](_0x10c8cc(0x16e)+_0x188cc3[_0x10c8cc(0x218)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x188cc3['projectName']+'\x27'),(_0xafdc52[_0x10c8cc(0x143)]||_0xafdc52[_0x10c8cc(0x168)])&&await handleSingleObjectOutput(_0x188cc3,_0xafdc52),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]='workflow:secrets:delete';['description']=a41_0x448846(0x1a3);async[a41_0x448846(0x1f9)](_0x104fab){const _0xccc1ca=a41_0x448846,{options:_0x50483b,args:_0x7fe3c7,tdx:_0x3e3951}=_0x104fab;let _0x5bf1dd,_0x4f2761;if(_0x7fe3c7[_0xccc1ca(0x1c5)]>=0x2)_0x5bf1dd=_0x7fe3c7[0x0],_0x4f2761=_0x7fe3c7[0x1];else{if(_0x7fe3c7[_0xccc1ca(0x1c5)]===0x1&&_0x50483b[_0xccc1ca(0x1b9)])_0x5bf1dd=_0x50483b[_0xccc1ca(0x1b9)],_0x4f2761=_0x7fe3c7[0x0];else return _0x7fe3c7[_0xccc1ca(0x1c5)]===0x1?(console[_0xccc1ca(0x154)](_0xccc1ca(0x14a)),console[_0xccc1ca(0x154)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0xccc1ca(0x1af)),console[_0xccc1ca(0x154)](_0xccc1ca(0xa0)),0x1);}_0x50483b[_0xccc1ca(0x138)]&&(console[_0xccc1ca(0x154)](_0xccc1ca(0x108)+_0x5bf1dd),console[_0xccc1ca(0x154)](_0xccc1ca(0x19c)+_0x4f2761));if(!_0x50483b[_0xccc1ca(0x228)]){const _0x112a93=await confirmKey(_0xccc1ca(0xca)+_0x4f2761+'\x27\x20from\x20project\x20\x27'+_0x5bf1dd+'\x27?');if(!_0x112a93)return console[_0xccc1ca(0x154)]('Cancelled'),0x0;}const _0x473561=await withSpinner(_0xccc1ca(0x12b),()=>_0x3e3951['workflow'][_0xccc1ca(0x21e)](_0x5bf1dd,_0x4f2761),{'verbose':_0x50483b[_0xccc1ca(0x138)]}),_0xddb3f2=_0x473561[_0xccc1ca(0x104)];return console['error']('✔\x20Secret\x20\x27'+_0xddb3f2[_0xccc1ca(0x218)]+_0xccc1ca(0x14d)+_0xddb3f2[_0xccc1ca(0x9e)]+'\x27'),(_0x50483b[_0xccc1ca(0x143)]||_0x50483b[_0xccc1ca(0x168)])&&await handleSingleObjectOutput(_0xddb3f2,_0x50483b),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(_0x41e7d6){const _0x32c223=a41_0x448846,_0x46ccae=Math[_0x32c223(0x123)](_0x41e7d6/0x3e8),_0x264ec6=Math[_0x32c223(0x123)](_0x46ccae/0x3c),_0x45cbfa=Math[_0x32c223(0x123)](_0x264ec6/0x3c),_0x49ca82=Math[_0x32c223(0x123)](_0x45cbfa/0x18);if(_0x49ca82>0x0){const _0xe977cb=_0x45cbfa%0x18;return _0xe977cb>0x0?_0x49ca82+'d\x20'+_0xe977cb+'h':_0x49ca82+'d';}else{if(_0x45cbfa>0x0){const _0x483f1e=_0x264ec6%0x3c;return _0x483f1e>0x0?_0x45cbfa+'h\x20'+_0x483f1e+'m':_0x45cbfa+'h';}else{if(_0x264ec6>0x0){const _0x3de81b=_0x46ccae%0x3c;return _0x3de81b>0x0?_0x264ec6+'m\x20'+_0x3de81b+'s':_0x264ec6+'m';}else return _0x46ccae+'s';}}}function formatTimestamp(_0x48bcee,_0x83374b){const _0x12a850=a41_0x448846,_0x2b28db=new Date(_0x48bcee),_0x494d9e=String(_0x2b28db[_0x12a850(0xde)]())[_0x12a850(0x1b4)](0x2,'0'),_0x20f75b=String(_0x2b28db[_0x12a850(0x1ae)]())['padStart'](0x2,'0'),_0x18f4bc=_0x494d9e+':'+_0x20f75b,_0x15555f=_0x2b28db[_0x12a850(0xd1)]()===_0x83374b['getFullYear']()&&_0x2b28db[_0x12a850(0x130)]()===_0x83374b['getMonth']()&&_0x2b28db[_0x12a850(0x1a2)]()===_0x83374b[_0x12a850(0x1a2)]();if(_0x15555f)return _0x18f4bc;else{const _0x1ef9fc=String(_0x2b28db[_0x12a850(0x130)]()+0x1)[_0x12a850(0x1b4)](0x2,'0'),_0x3e5e59=String(_0x2b28db['getDate']())['padStart'](0x2,'0');return _0x1ef9fc+'-'+_0x3e5e59+'\x20'+_0x18f4bc;}}function formatDate(_0x587899){const _0xcf851=a41_0x448846,_0x2f34ce=_0x587899['getFullYear'](),_0x41ffe7=String(_0x587899[_0xcf851(0x130)]()+0x1)[_0xcf851(0x1b4)](0x2,'0'),_0x191d47=String(_0x587899[_0xcf851(0x1a2)]())['padStart'](0x2,'0');return _0x2f34ce+'-'+_0x41ffe7+'-'+_0x191d47;}function getTaskStateIcon(_0x17c5ff){const _0x2e5563={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2e5563[_0x17c5ff]||'⚪';}function a41_0x13e8(){const _0x5c87ca=['No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20sessions\x20','parseProjectWorkflowPattern','...','\x0aDry\x20run\x20-\x20no\x20files\x20written','parse','Error:\x20KEY=VALUE\x20is\x20required','Select\x20a\x20workflow\x20to\x20run','GUTTER','No\x20workflow\x20sessions\x20found','\x0aDry\x20run\x20-\x20no\x20project\x20created','context','\x20project','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Listing\x20secrets...','\x0aPolling...\x20(','\x20(system)','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Killing\x20attempt...','workflows','retrySession','workflow:push','includeSubtasks','List\x20workflows','Key\x20cannot\x20be\x20empty','\x20(use\x20--limit\x20to\x20show\x20more)','msPerChar','window','data','basename','New\x20project\x20name:\x20','targetDir','Project:\x20','download','MAX_LABEL_COUNT','renderTimeline','resolveProjectDir','param','index','\x20workflow','MAX_POLL_ITERATIONS','✔\x20Found\x20','/app/workflows/','tasks','deleted','Cloning\x20to\x20','splice','fileSize','No\x20sessions\x20found\x20in\x20project:\x20','✔\x20Pushed\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','workflow:run','No\x20log\x20content\x20found','Listing\x20workflows...','Pulling\x20project\x20','max','preparePushProject','min','projects','floor','revision','logs','144qZFKYS','pullProject','type','skipValidation','Including\x20subtasks:\x20yes','Deleting\x20secret...','Source\x20project:\x20','Filter:\x20','white','log','getMonth','\x0a✔\x20Already\x20up\x20to\x20date','Files\x20to\x20upload:\x20','/attempt/','sourceDir','⚠\x20Showing\x20first\x20','generateSessionTimelineRows','\x20\x20Workflow:\x20','verbose','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','reason','sessionId','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x20\x20Session\x20context\x20set\x20to:\x20','now','workflow','Project\x20directory:\x20','Retrying\x20session...','green','json','resolveProjectId','List\x20workflow\x20attempts','No\x20matching\x20sessions\x20found','has','isTTY','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Error:\x20Project\x20name\x20is\x20required','includes','substring','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Auto-selected\x20latest\x20session:\x20','---\x20','startTime','newProjectId','isNewProject','error','icon','Total:\x20','state','\x22?\x20This\x20cannot\x20be\x20undone.','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','blue','utf-8','fill','fs/promises','indexOf','workflow:upload','List\x20all\x20workflow\x20projects','\x27...','session:','stdout','Pull\x20workflow\x20project\x20to\x20local\x20folder','Cancelled','Writing\x20files...','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','jsonl','resumeFrom','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','find','dim','get','✔\x20Secret\x20\x27','\x0a✔\x20Attempt\x20complete','localeCompare','✔\x20Workflow\x20run\x20started','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Validation:\x20skipped','.\x20Expected\x20format:\x20KEY=VALUE','No\x20sessions\x20with\x20timing\x20information','No\x20sessions\x20found\x20for:\x20','format','Dry\x20run:\x20yes','48357rdpjkz','tdx\x20wf\x20attempt\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20\x20Console:\x20','Analyzing\x20project...','changes','\x22\x20already\x20exists\x20(ID:\x20','workflow:secrets:list','\x0aClone\x20\x22','targetExists','filter','MAX_TASKS_DISPLAY','cancelRequested','done','start','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','some','name','\x20\x20Files\x20extracted:\x20','cyan','Retrying\x20attempt...','run','trimEnd','lastAttempt','cwd','path','✔\x20Deleted\x20project\x20','push','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','unknown','Show\x20tasks\x20for\x20an\x20attempt','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','1369vSbzsW','Kill\x20a\x20running\x20attempt','split','Key:\x20','retryAttempt','POLL_INTERVAL_MS','message','every','\x0a⚠\x20Project\x20\x22','getDate','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Invalid\x20format:\x20','rows','duration','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','12354084GhtIHL','getTime','\x20\x20tdx\x20wf\x20use\x20<project>','workflowName','Attempt\x20ID:\x20','Pattern:\x20','getMinutes','Error:\x20Secret\x20key\x20is\x20required','isArray','retryAttemptName','project','set','padStart','\x20\x20Project:\x20','\x22\x20to\x20new\x20project\x20\x22','\x0a✔\x20No\x20changes\x20to\x20push','Error:\x20Invalid\x20parameter\x20format:\x20','workflowProject','group_error','workflow:attempts','map','text','✔\x20Downloaded\x20','startsWith','Params:\x20','end','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Revision:\x20','\x22\x20with\x20new\x20revision?','length','showWorkflowConsoleUrl','autocomplete','columns','✔\x20Project\x20updated','durationMs','1244934njXhzJ','\x20modified','Warning:','sessionTime','Source:\x20','Pushing\x20workflow\x20project...','clear','Expected\x20format:\x20--param\x20key=value','\x1b[1A\x1b[2K','modified','resolve','toLowerCase','No\x20workflows\x20found','list',',\x20Workflow:\x20','Setting\x20secret...','\x0aDry\x20run\x20-\x20nothing\x20pushed','2541076HNwjjS','workflow:pull','\x0aPush\x20these\x20changes?','Select\x20a\x20task\x20to\x20view\x20logs:','Task\x20name:\x20','workflow:clone','\x20unchanged','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Source\x20directory:\x20','workflow:attempt','existingProjectId','\x20\x20Changes:\x20','diff','applyPullProject','slice','running','✔\x20New\x20project:\x20','Start\x20a\x20workflow\x20run','attempt:','2656175AMKUvh','Show\x20specific\x20attempt\x20details','MIN_TIMELINE_WIDTH','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','displayLine','Failed\x20to\x20fetch\x20attempt\x20data','resolveProject','yellow','summary','total','execute','Filter:\x20project=','\x20task','round','93779RMRGCD','Usage:\x20tdx\x20wf\x20use\x20<project>','session','listSecrets','\x20\x20Revision:\x20','values','taskName','\x20to\x20see\x20detailed\x20logs','sort','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','metadata','match','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Downloading\x20logs...','Loading\x20workflows...','new','follow','Listing\x20workflow\x20attempts...','workflow:delete','No\x20workflow\x20projects\x20found','Source\x20directory\x20is\x20required','workflow:timeline','hasChanges','newProjectName','30JfDinL','🔄\x20','relative','key','💡\x20Tip:\x20Use\x20','Force:\x20yes','Using\x20attempt\x20','Project\x20name\x20is\x20required','select','deleteSecret','Target\x20directory:\x20','from','table','limit','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20Session\x20ID:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','562dNoHTS','(unknown)','yes','params','write','title','dryRun','📋\x20','size','renderSingleTimeline','No\x20workflows\x20found\x20in\x20project:\x20','kill','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','site','ICON_WIDTH','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Session\x20time:\x20','red','Loading\x20sessions...','createdAt','✔\x20Push\x20complete','fromTask','Error:','requireProject','canceling','executePushProject','projectName','filesExtracted','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Resolving\x20project\x20\x27','pollTimeline','LABEL_MIN_SPACING','✔\x20Pull\x20complete','force','No\x20attempts\x20found\x20for:\x20','Latest\x20session\x20has\x20no\x20attempt','workflow:sessions','status','Analyzing\x20changes...','No\x20projects\x20match\x20pattern:\x20','pending','\x20\x20Location:\x20','fullName','toISOString','Workflow:\x20','workflow:use','Getting\x20attempt\x20tasks...','repeat','navigateSessionsInteractive','updatedAt','\x20deleted','finishedAt','Retry\x20a\x20session\x20or\x20attempt','sessions','Error:\x20Attempt\x20ID\x20is\x20required','output','executeCloneProject','No\x20workflow\x20tdx.json\x20found','projectId','success','\x20new','renderSessionsTimeline','\x20from\x20session\x20','✔\x20Retry\x20started','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','6HsebWY','11UbaUNq','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','sourceProjectName','ICON_SPACING','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20\x20New\x20attempt\x20ID:\x20','workflow:kill','Listing\x20workflow\x20sessions...','attemptId','startedAt','description','getFullYear','keys','📁\x20','Target:\x20','MIN_LABEL_COUNT','✔\x20Project:\x20','unchanged','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Session\x20','join','\x20-\x20','Attempt:\x20','getHours','buildTimelineData','List\x20workflow\x20execution\x20sessions','session_id','planned','\x20\x20Project\x20ID:\x20','\x20\x20Attempt\x20ID:\x20','Session\x20not\x20found:\x20','\x20logs','TASK_NAME_WIDTH'];a41_0x13e8=function(){return _0x5c87ca;};return a41_0x13e8();}function getBarChar(_0x4d0b91){const _0x245056=a41_0x448846;return _0x4d0b91===_0x245056(0x154)||_0x4d0b91===_0x245056(0x1ba)?'×':'─';}function a41_0x141e(_0x5365b0,_0x2e2e18){_0x5365b0=_0x5365b0-0x8e;const _0x13e8a0=a41_0x13e8();let _0x141e30=_0x13e8a0[_0x5365b0];return _0x141e30;}function getBarColor(_0x5373f0){const _0x4fb77e=a41_0x448846,_0x479c7d={'success':a41_0x402fbc[_0x4fb77e(0x142)],'error':a41_0x402fbc[_0x4fb77e(0x95)],'group_error':a41_0x402fbc[_0x4fb77e(0x95)],'running':a41_0x402fbc[_0x4fb77e(0x15a)],'blocked':a41_0x402fbc[_0x4fb77e(0x1f6)],'planned':a41_0x402fbc[_0x4fb77e(0x16c)],'canceling':a41_0x402fbc[_0x4fb77e(0x1f6)]};return _0x479c7d[_0x5373f0]||a41_0x402fbc[_0x4fb77e(0x12e)];}function parseTaskName(_0x5b9b04){const _0x4d1ad9=a41_0x448846;let _0xbb26ef=_0x5b9b04['replace'](/^\++/,'');const _0x49841f=_0xbb26ef[_0x4d1ad9(0x19b)]('+'),_0x545e79=_0x49841f[_0x4d1ad9(0x1c5)]>0x1?_0x49841f[_0x4d1ad9(0x1c5)]-0x2:0x0,_0x3ef90c=_0x49841f[_0x49841f[_0x4d1ad9(0x1c5)]-0x1]||_0xbb26ef;return{'level':_0x545e79,'name':'+'+_0x3ef90c};}function truncateTaskName(_0x57e0dc,_0x1eb727){const _0x1a8140=a41_0x448846,_0x10a160=stringWidth(_0x57e0dc);if(_0x10a160<=_0x1eb727)return _0x57e0dc;let _0x278d70=_0x57e0dc;while(stringWidth(_0x278d70+'…')>_0x1eb727&&_0x278d70[_0x1a8140(0x1c5)]>0x0){_0x278d70=_0x278d70[_0x1a8140(0x1ea)](0x0,-0x1);}return _0x278d70+'…';}function calculateTimeScale(_0x13be7b,_0xe1d805){const _0x336f2f=a41_0x448846;return{'startTime':_0x13be7b[_0x336f2f(0x187)],'endTime':_0x13be7b[_0x336f2f(0x1c1)],'durationMs':_0x13be7b[_0x336f2f(0x1a6)],'msPerChar':_0x13be7b[_0x336f2f(0x1a6)]/_0xe1d805};}function timeToPosition(_0x4c5c74,_0x1ae5b9,_0x142cdc){const _0x53bee1=a41_0x448846,_0x542e51=_0x4c5c74-_0x1ae5b9[_0x53bee1(0x151)],_0x36520a=Math[_0x53bee1(0x123)](_0x542e51/_0x1ae5b9[_0x53bee1(0x102)]);return Math[_0x53bee1(0x11f)](0x0,Math['min'](_0x36520a,_0x142cdc));}function renderTimeAxis(_0x48ec9a,_0x3fbf75){const _0x55ecd8=a41_0x448846,_0x48a99a=Math['min'](TIMELINE_CONFIG[_0x55ecd8(0x10a)],Math[_0x55ecd8(0x11f)](TIMELINE_CONFIG[_0x55ecd8(0xd5)],Math[_0x55ecd8(0x123)](_0x3fbf75/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x4ed722=_0x48ec9a[_0x55ecd8(0x1ca)]/(_0x48a99a-0x1),_0x3c5bf5=new Date(_0x48ec9a[_0x55ecd8(0x151)]),_0x932b87=[];for(let _0x25b73e=0x0;_0x25b73e<_0x48a99a;_0x25b73e++){const _0x36f62d=_0x48ec9a['startTime']+_0x25b73e*_0x4ed722,_0x497069=timeToPosition(_0x36f62d,_0x48ec9a,_0x3fbf75),_0x197f7b=formatTimestamp(_0x36f62d,_0x3c5bf5);_0x932b87[_0x55ecd8(0x194)]({'pos':_0x497069,'text':_0x197f7b});}const _0xa0c04c=new Array(_0x3fbf75)[_0x55ecd8(0x15c)]('\x20');let _0x1ec28c=-0x1;for(const {pos:_0x50872b,text:_0x3f17d8}of _0x932b87){let _0x4536c8=Math[_0x55ecd8(0x11f)](0x0,_0x50872b-Math[_0x55ecd8(0x123)](_0x3f17d8[_0x55ecd8(0x1c5)]/0x2));_0x4536c8<=_0x1ec28c+TIMELINE_CONFIG[_0x55ecd8(0xa3)]&&(_0x4536c8=_0x1ec28c+TIMELINE_CONFIG[_0x55ecd8(0xa3)]+0x1);_0x4536c8+_0x3f17d8[_0x55ecd8(0x1c5)]>_0x3fbf75&&(_0x4536c8=_0x3fbf75-_0x3f17d8[_0x55ecd8(0x1c5)]);if(_0x4536c8>=0x0&&_0x4536c8+_0x3f17d8[_0x55ecd8(0x1c5)]<=_0x3fbf75&&_0x4536c8>_0x1ec28c){for(let _0x3e4270=0x0;_0x3e4270<_0x3f17d8[_0x55ecd8(0x1c5)];_0x3e4270++){_0xa0c04c[_0x4536c8+_0x3e4270]=_0x3f17d8[_0x3e4270];}_0x1ec28c=_0x4536c8+_0x3f17d8[_0x55ecd8(0x1c5)]-0x1;}}return _0xa0c04c[_0x55ecd8(0xdb)]('');}function renderTaskRow(_0x24e25f,_0x4387a9,_0x6c203d,_0x4473d3){const _0x4689cd=a41_0x448846,{level:_0x5a7897,name:_0x438da8}=parseTaskName(_0x24e25f[_0x4689cd(0x18a)]),_0x3416d3='\x20'[_0x4689cd(0xb3)](_0x5a7897),_0x33a0cc=_0x24e25f[_0x4689cd(0x103)]?'('+formatElapsed(_0x24e25f['window'][_0x4689cd(0x1a6)])+')':'',_0x5aad5d=stringWidth(_0x33a0cc),_0x311741=_0x5a7897*0x1,_0x9d8d4e=_0x4473d3-_0x311741-_0x5aad5d-0x1,_0x968d30=truncateTaskName(_0x438da8,_0x9d8d4e),_0x4c6ec5=_0x3416d3+_0x968d30,_0x39c9ed=stringWidth(_0x4c6ec5),_0x5a84ce=_0x4473d3-_0x39c9ed-_0x5aad5d,_0x206e4d=_0x4c6ec5+'\x20'[_0x4689cd(0xb3)](Math[_0x4689cd(0x11f)](0x1,_0x5a84ce))+a41_0x402fbc[_0x4689cd(0x16c)](_0x33a0cc),_0x4a7f0a=getTaskStateIcon(_0x24e25f[_0x4689cd(0x157)]),_0x70409b=new Array(_0x6c203d)[_0x4689cd(0x15c)]('\x20');if(_0x24e25f[_0x4689cd(0x103)]){const _0x32fffe=timeToPosition(_0x24e25f[_0x4689cd(0x103)]['start'],_0x4387a9,_0x6c203d),_0x5c9c92=timeToPosition(_0x24e25f[_0x4689cd(0x103)][_0x4689cd(0x1c1)],_0x4387a9,_0x6c203d),_0x29928a=getBarChar(_0x24e25f[_0x4689cd(0x157)]),_0x5511e5=Math[_0x4689cd(0x11f)](_0x32fffe+0x1,_0x5c9c92);for(let _0xaae1d3=_0x32fffe;_0xaae1d3<Math['min'](_0x5511e5,_0x6c203d);_0xaae1d3++){_0x70409b[_0xaae1d3]=_0x29928a;}}const _0x4da351=getBarColor(_0x24e25f['state']),_0x65e7ff=_0x70409b['map'](_0x5d4664=>_0x5d4664==='\x20'?'\x20':_0x4da351(_0x5d4664))['join']('');return _0x4a7f0a+'\x20'+_0x206e4d+'│'+_0x65e7ff+'│';}function calculateStats(_0x5de29e){const _0x5efe45=a41_0x448846,_0x309189={'total':_0x5de29e['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4f1191 of _0x5de29e){if(_0x4f1191[_0x5efe45(0x157)]===_0x5efe45(0xbf))_0x309189['success']++;else{if(_0x4f1191['state']===_0x5efe45(0x154)||_0x4f1191['state']===_0x5efe45(0x1ba))_0x309189['error']++;else _0x4f1191['state']===_0x5efe45(0x1eb)?_0x309189[_0x5efe45(0x1eb)]++:_0x309189[_0x5efe45(0xac)]++;}}return _0x309189;}function formatStats(_0x13d91a){const _0x5bceb8=a41_0x448846;return[_0x5bceb8(0x156)+_0x13d91a[_0x5bceb8(0x1f8)],'✅\x20'+_0x13d91a[_0x5bceb8(0xbf)],'❌\x20'+_0x13d91a['error'],_0x5bceb8(0x216)+_0x13d91a[_0x5bceb8(0x1eb)],'⏳\x20'+_0x13d91a[_0x5bceb8(0xac)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a41_0x448846(0x18a)]=a41_0x448846(0x212);[a41_0x448846(0xd0)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a41_0x448846(0x1f9)](_0x1fb4ba){const _0x2d2927=a41_0x448846,{options:_0x26d387,args:_0x572214,tdx:_0x18d964}=_0x1fb4ba;let _0x6b2a51,_0x3e4e92,_0xf1e515=![];if(_0x572214[0x0]){if(_0x572214[0x0]['includes']('.')){const _0x4c52c3=this[_0x2d2927(0xea)](_0x572214,_0x26d387);if(!_0x4c52c3)return 0x1;_0x6b2a51=_0x4c52c3['projectName'],_0x3e4e92=_0x4c52c3['workflowName'];}else{_0x3e4e92=_0x572214[0x0],_0x6b2a51=_0x26d387[_0x2d2927(0x1b9)];if(!_0x6b2a51)return console['error'](a41_0x402fbc[_0x2d2927(0x95)](_0x2d2927(0x9a)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0xf1e515=!![];}}else{const _0x4f7a7d=this['parseProjectWorkflowPattern'](_0x572214,_0x26d387);if(!_0x4f7a7d)return 0x1;_0x6b2a51=_0x4f7a7d[_0x2d2927(0x9e)],_0x3e4e92=_0x4f7a7d[_0x2d2927(0x1ab)];}if(_0x26d387[_0x2d2927(0x138)]){if(_0x6b2a51&&_0x3e4e92)console[_0x2d2927(0x154)](_0x2d2927(0x12d)+_0x6b2a51+'.'+_0x3e4e92);else _0x6b2a51&&console[_0x2d2927(0x154)](_0x2d2927(0x1fa)+_0x6b2a51);}const _0x2622db=_0x26d387[_0x2d2927(0xce)],_0x39a72e=_0x26d387[_0x2d2927(0x13b)];if(_0x2622db){_0x39a72e&&console[_0x2d2927(0x154)](a41_0x402fbc[_0x2d2927(0x1f6)](_0x2d2927(0x1cd)),_0x2d2927(0x172));const _0x2491f0=_0x26d387[_0x2d2927(0x20d)];return _0x2491f0?await this[_0x2d2927(0xa2)](_0x1fb4ba,_0x2622db):await this[_0x2d2927(0x22f)](_0x1fb4ba,_0x2622db,_0x26d387),0x0;}if(_0x39a72e){const _0x200576=await withSpinner('Loading\x20session...',()=>_0x18d964['workflow'][_0x2d2927(0xb9)]({'projectName':_0x6b2a51,'workflowName':_0x3e4e92,'limit':0x64}),{'verbose':_0x26d387[_0x2d2927(0x138)]}),_0x59c021=_0x200576['data'][_0x2d2927(0x16b)](_0x5774e1=>_0x5774e1['id']===_0x39a72e);if(!_0x59c021)return console[_0x2d2927(0x154)](a41_0x402fbc[_0x2d2927(0x95)](_0x2d2927(0x9a)),_0x2d2927(0xe5)+_0x39a72e),0x1;if(!_0x59c021['lastAttempt']?.['id'])return console[_0x2d2927(0x154)](a41_0x402fbc[_0x2d2927(0x95)](_0x2d2927(0x9a)),_0x2d2927(0xda)+_0x39a72e+'\x20has\x20no\x20attempts'),0x1;const _0x48695c=_0x59c021[_0x2d2927(0x190)]['id'];_0x26d387[_0x2d2927(0x138)]&&console[_0x2d2927(0x154)](_0x2d2927(0x21b)+_0x48695c+_0x2d2927(0xc2)+_0x39a72e);const _0xb67e25=_0x26d387[_0x2d2927(0x20d)];return _0xb67e25?await this[_0x2d2927(0xa2)](_0x1fb4ba,_0x48695c):await this[_0x2d2927(0x22f)](_0x1fb4ba,_0x48695c,_0x26d387),0x0;}const _0x4b6de2=await withSpinner(_0x2d2927(0x96),()=>_0x18d964[_0x2d2927(0x13f)][_0x2d2927(0xb9)]({'projectName':_0x6b2a51,'workflowName':_0x3e4e92,'limit':_0x26d387[_0x2d2927(0x222)]||0x32}),{'verbose':_0x26d387[_0x2d2927(0x138)]}),_0x53844b=_0x4b6de2[_0x2d2927(0x104)];if(_0x53844b[_0x2d2927(0x1c5)]===0x0){if(_0x6b2a51&&_0x3e4e92)console[_0x2d2927(0x154)](_0x2d2927(0x176)+_0x6b2a51+'.'+_0x3e4e92);else _0x6b2a51?console[_0x2d2927(0x154)](_0x2d2927(0x118)+_0x6b2a51):(console[_0x2d2927(0x154)](_0x2d2927(0xf1)),console[_0x2d2927(0x154)](a41_0x402fbc[_0x2d2927(0x16c)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x53844b[_0x2d2927(0x205)]((_0x547119,_0x3d329f)=>{const _0x331aff=_0x2d2927,_0x269509=_0x547119[_0x331aff(0x1ce)]||'',_0x34e0ce=_0x3d329f[_0x331aff(0x1ce)]||'';return _0x34e0ce[_0x331aff(0x170)](_0x269509);});if(_0x26d387[_0x2d2927(0x143)]||_0x26d387[_0x2d2927(0x168)])return await handleSDKOutput(_0x53844b,_0x26d387),0x0;let _0x5dff07;if(_0xf1e515){const _0x599d5d=_0x53844b[0x0];if(!_0x599d5d[_0x2d2927(0x190)]?.['id'])return console[_0x2d2927(0x154)](_0x2d2927(0xa7)),0x0;_0x5dff07=_0x599d5d[_0x2d2927(0x190)]['id'],_0x26d387[_0x2d2927(0x138)]&&console['error'](_0x2d2927(0x14f)+_0x599d5d[_0x2d2927(0x1ce)]);}else{const _0x214525=_0x53844b['map'](_0x4e0c94=>{const _0x3fea4f=_0x2d2927,_0x5c74c9=getAttemptStatusDisplay(_0x4e0c94[_0x3fea4f(0x190)]);return{'title':_0x4e0c94[_0x3fea4f(0x1b2)]?.['name']+'.'+_0x4e0c94['workflow']?.[_0x3fea4f(0x18a)]+_0x3fea4f(0xdc)+_0x4e0c94[_0x3fea4f(0x1ce)]+'\x20'+_0x5c74c9[_0x3fea4f(0x155)],'value':_0x4e0c94[_0x3fea4f(0x190)]?.['id']||'','description':_0x5c74c9[_0x3fea4f(0x1bd)]};}),_0x5defc8=await a41_0x131ac0({'type':_0x2d2927(0x21d),'name':_0x2d2927(0xce),'message':_0x2d2927(0x11a),'choices':_0x214525[_0x2d2927(0x183)](_0x1d75e3=>_0x1d75e3['value']!=='')});if(!_0x5defc8[_0x2d2927(0xce)])return 0x0;_0x5dff07=_0x5defc8[_0x2d2927(0xce)];}const _0x1d52fc=_0x26d387['follow'];return _0x1d52fc?await this[_0x2d2927(0xa2)](_0x1fb4ba,_0x5dff07):await this[_0x2d2927(0x22f)](_0x1fb4ba,_0x5dff07,_0x26d387),0x0;}async['renderSingleTimeline'](_0x4cdc8a,_0x175c2e,_0x23b86a){const _0x5dc0d5=a41_0x448846,{tdx:_0x2059a3}=_0x4cdc8a;let _0x1a8a67,_0x47d9c8;try{[_0x1a8a67,_0x47d9c8]=await Promise['all']([_0x2059a3[_0x5dc0d5(0x13f)]['attempt'](_0x175c2e),_0x2059a3['workflow'][_0x5dc0d5(0x113)](_0x175c2e,![])]);}catch(_0x4bb1d4){console[_0x5dc0d5(0x154)](a41_0x402fbc['red'](_0x5dc0d5(0x1f4)));_0x23b86a[_0x5dc0d5(0x138)]&&console[_0x5dc0d5(0x154)](_0x4bb1d4);throw _0x4bb1d4;}if(_0x23b86a[_0x5dc0d5(0x143)]||_0x23b86a[_0x5dc0d5(0x168)]){const _0x5b2208=this[_0x5dc0d5(0xdf)](_0x1a8a67,_0x47d9c8);await handleSDKOutput([_0x5b2208],_0x23b86a);return;}const _0x949eb3=_0x2059a3['context']['site'],_0x436ecc=this['renderTimeline'](_0x1a8a67,_0x47d9c8,_0x949eb3);console['log'](_0x436ecc);}async[a41_0x448846(0xa2)](_0x3fa035,_0x45e283){const _0x4cbab3=a41_0x448846,{tdx:_0x1415b8}=_0x3fa035,_0x282893=TIMELINE_CONFIG[_0x4cbab3(0x19e)],_0x4b5275=TIMELINE_CONFIG[_0x4cbab3(0x110)];let _0x48855c=0x0;while(_0x48855c<_0x4b5275){process['stdout']['isTTY']&&process[_0x4cbab3(0x163)][_0x4cbab3(0x22a)]('\x1bc');let _0x2fcc97,_0x5ad939;try{[_0x2fcc97,_0x5ad939]=await Promise['all']([_0x1415b8[_0x4cbab3(0x13f)]['attempt'](_0x45e283),_0x1415b8[_0x4cbab3(0x13f)][_0x4cbab3(0x113)](_0x45e283,![])]);}catch(_0x3be08f){console['error'](a41_0x402fbc[_0x4cbab3(0x95)](_0x4cbab3(0xf5)));_0x48855c>0x0&&console['error'](a41_0x402fbc['dim'](_0x4cbab3(0x93)+_0x48855c));throw _0x3be08f;}const _0x34f79c=_0x1415b8[_0x4cbab3(0xf3)][_0x4cbab3(0x91)],_0x24ab3a=this[_0x4cbab3(0x10b)](_0x2fcc97,_0x5ad939,_0x34f79c);console[_0x4cbab3(0x12f)](_0x24ab3a);const _0x48a94f=_0x2fcc97[_0x4cbab3(0x186)]&&_0x5ad939[_0x4cbab3(0x1a0)](_0x3db636=>_0x3db636[_0x4cbab3(0x157)]!==_0x4cbab3(0x1eb)&&_0x3db636['state']!=='planned');if(_0x48a94f){console[_0x4cbab3(0x154)](a41_0x402fbc[_0x4cbab3(0x142)](_0x4cbab3(0x16f)));break;}console['error'](a41_0x402fbc[_0x4cbab3(0x16c)](_0x4cbab3(0xf7)+_0x48855c*0x2+_0x4cbab3(0x149))),await new Promise(_0x179488=>setTimeout(_0x179488,_0x282893)),_0x48855c++;}_0x48855c>=_0x4b5275&&console['error'](a41_0x402fbc[_0x4cbab3(0x1f6)](_0x4cbab3(0x14e)));}[a41_0x448846(0x10b)](_0x4f64e5,_0x2fb282,_0x334e3a){const _0x5b42db=a41_0x448846,_0x55c331=[],_0x59ee45=TIMELINE_CONFIG[_0x5b42db(0xe7)],_0x319971=0x5,_0x257348=process['stdout'][_0x5b42db(0x1c8)]||0x78,_0x1cac53=_0x257348-_0x59ee45-_0x319971,_0xb67f78=Math[_0x5b42db(0x11f)](TIMELINE_CONFIG[_0x5b42db(0x1f1)],Math[_0x5b42db(0x121)](_0x1cac53,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0xdc4a51=new Date(_0x4f64e5['createdAt'])[_0x5b42db(0x1a9)](),_0x2bf4af=_0x4f64e5[_0x5b42db(0xb7)]?new Date(_0x4f64e5[_0x5b42db(0xb7)])[_0x5b42db(0x1a9)]():Date[_0x5b42db(0x13e)](),_0x4cfa5f={'start':_0xdc4a51,'end':_0x2bf4af,'duration':_0x2bf4af-_0xdc4a51},_0x1b8db3=new Map(),_0x371b80=[];for(const _0x4cb12a of _0x2fb282){if(_0x4cb12a[_0x5b42db(0xcf)]){const _0x5cd331=new Date(_0x4cb12a[_0x5b42db(0xcf)])[_0x5b42db(0x1a9)](),_0x396c51=_0x4cb12a['updatedAt']?new Date(_0x4cb12a[_0x5b42db(0xb5)])[_0x5b42db(0x1a9)]():Date[_0x5b42db(0x13e)](),_0x18f4e5={'start':_0x5cd331,'end':_0x396c51,'duration':_0x396c51-_0x5cd331};_0x1b8db3[_0x5b42db(0x1b3)](_0x4cb12a['id'],_0x18f4e5),_0x371b80['push']({'name':_0x4cb12a[_0x5b42db(0xae)],'state':_0x4cb12a['state']||_0x5b42db(0x196),'window':_0x18f4e5});}else _0x371b80[_0x5b42db(0x194)]({'name':_0x4cb12a[_0x5b42db(0xae)],'state':_0x4cb12a['state']||_0x5b42db(0xe2),'window':undefined});}_0x371b80['sort']((_0x4daac9,_0x39f0f6)=>{const _0x5a927d=_0x5b42db;if(!_0x4daac9[_0x5a927d(0x103)])return 0x1;if(!_0x39f0f6[_0x5a927d(0x103)])return-0x1;return _0x4daac9[_0x5a927d(0x103)][_0x5a927d(0x187)]-_0x39f0f6[_0x5a927d(0x103)][_0x5a927d(0x187)];});const _0x5ab1b5=_0x371b80['length'],_0x153d04=_0x5ab1b5>TIMELINE_CONFIG[_0x5b42db(0x184)];_0x153d04&&_0x371b80[_0x5b42db(0x116)](TIMELINE_CONFIG[_0x5b42db(0x184)]);const _0xc17d5e=calculateTimeScale(_0x4cfa5f,_0xb67f78),_0x1bd0b0=_0x4f64e5[_0x5b42db(0x186)]?_0x4f64e5[_0x5b42db(0xbf)]?a41_0x402fbc['green'](_0x5b42db(0xbf)):a41_0x402fbc['red']('error'):a41_0x402fbc['blue'](_0x5b42db(0x1eb)),_0x18dbd4=_0x4f64e5['project']?.['id'],_0x4ec49c=_0x4f64e5[_0x5b42db(0x13b)];let _0x5b1214;if(_0x18dbd4&&_0x4ec49c){const _0x3fef56=getWorkflowAttemptUrl(_0x334e3a,_0x18dbd4,_0x4ec49c,_0x4f64e5['id']);_0x5b1214=hyperlink(a41_0x402fbc['dim'](_0x4f64e5['id']),_0x3fef56);}else _0x5b1214=a41_0x402fbc[_0x5b42db(0x16c)](_0x4f64e5['id']);_0x55c331[_0x5b42db(0x194)](_0x5b42db(0xdd)+_0x5b1214+'\x20-\x20'+_0x1bd0b0+_0x5b42db(0xdc)+formatElapsed(_0x4cfa5f[_0x5b42db(0x1a6)]));if(_0x371b80[_0x5b42db(0x1c5)]>0x0){const _0x6c7f5b=renderTimeAxis(_0xc17d5e,_0xb67f78),_0x3d0150=new Date(_0x4cfa5f['start']),_0x43806c=formatDate(_0x3d0150),_0x25fcbf=TIMELINE_CONFIG[_0x5b42db(0x92)]+TIMELINE_CONFIG[_0x5b42db(0xc9)]+_0x59ee45,_0x367812=_0x43806c[_0x5b42db(0x1b4)](_0x25fcbf),_0x4b3189=a41_0x402fbc['dim'](_0x367812);_0x55c331[_0x5b42db(0x194)](_0x4b3189+'\x20'+_0x6c7f5b);for(const _0x5f456f of _0x371b80){_0x55c331[_0x5b42db(0x194)](renderTaskRow(_0x5f456f,_0xc17d5e,_0xb67f78,_0x59ee45));}const _0x5518a1=calculateStats(_0x371b80);_0x55c331[_0x5b42db(0x194)](formatStats(_0x5518a1)),_0x153d04&&_0x55c331[_0x5b42db(0x194)](a41_0x402fbc[_0x5b42db(0x1f6)](_0x5b42db(0x135)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+'\x20of\x20'+_0x5ab1b5+'\x20tasks')),_0x55c331[_0x5b42db(0x194)](''),_0x55c331[_0x5b42db(0x194)](a41_0x402fbc['dim'](_0x5b42db(0x219))+(_0x5b42db(0x17a)+_0x4f64e5['id']+_0x5b42db(0xe6))+a41_0x402fbc['dim'](_0x5b42db(0x204)));}else _0x55c331[_0x5b42db(0x194)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x55c331[_0x5b42db(0xdb)]('\x0a');}['buildTimelineData'](_0x2ff160,_0x1952b1){const _0x58415f=a41_0x448846,_0x46ed0a=new Date(_0x2ff160[_0x58415f(0x97)])['getTime'](),_0x3ba542=_0x2ff160[_0x58415f(0xb7)]?new Date(_0x2ff160['finishedAt'])[_0x58415f(0x1a9)]():Date['now'](),_0x3e8884=_0x3ba542-_0x46ed0a,_0x4ee3f7=[];for(const _0x21fa25 of _0x1952b1){if(_0x21fa25['startedAt']){const _0x7f83e0=new Date(_0x21fa25[_0x58415f(0xcf)])[_0x58415f(0x1a9)](),_0x210f58=_0x21fa25[_0x58415f(0xb5)]?new Date(_0x21fa25[_0x58415f(0xb5)])[_0x58415f(0x1a9)]():Date[_0x58415f(0x13e)]();_0x4ee3f7['push']({'name':_0x21fa25['fullName'],'state':_0x21fa25[_0x58415f(0x157)]||_0x58415f(0x196),'window':{'start':_0x7f83e0,'end':_0x210f58,'duration':_0x210f58-_0x7f83e0}});}else _0x4ee3f7[_0x58415f(0x194)]({'name':_0x21fa25['fullName'],'state':_0x21fa25[_0x58415f(0x157)]||'planned','window':undefined});}const _0x19c9ee=calculateStats(_0x4ee3f7);return{'attempt':{'id':_0x2ff160['id'],'status':_0x2ff160[_0x58415f(0x186)]?_0x2ff160[_0x58415f(0xbf)]?_0x58415f(0xbf):_0x58415f(0x154):_0x58415f(0x1eb),'createdAt':_0x2ff160[_0x58415f(0x97)],'finishedAt':_0x2ff160['finishedAt'],'duration_ms':_0x3e8884},'tasks':_0x4ee3f7[_0x58415f(0x1bc)](_0xec408a=>({'name':_0xec408a[_0x58415f(0x18a)],'state':_0xec408a[_0x58415f(0x157)],'startedAt':_0xec408a[_0x58415f(0x103)]?new Date(_0xec408a[_0x58415f(0x103)][_0x58415f(0x187)])[_0x58415f(0xaf)]():null,'updatedAt':_0xec408a[_0x58415f(0x103)]?new Date(_0xec408a[_0x58415f(0x103)]['end'])[_0x58415f(0xaf)]():null,'duration_ms':_0xec408a[_0x58415f(0x103)]?.['duration']||null})),'stats':_0x19c9ee};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x489bd1,_0x19cf2a){const _0x53db91=a42_0x594d,_0x213d7b=_0x489bd1();while(!![]){try{const _0x1eff57=parseInt(_0x53db91(0x85))/0x1+parseInt(_0x53db91(0x82))/0x2*(parseInt(_0x53db91(0x83))/0x3)+-parseInt(_0x53db91(0x91))/0x4*(parseInt(_0x53db91(0x8d))/0x5)+-parseInt(_0x53db91(0x8f))/0x6+parseInt(_0x53db91(0x8e))/0x7*(parseInt(_0x53db91(0x8a))/0x8)+-parseInt(_0x53db91(0x87))/0x9+-parseInt(_0x53db91(0x90))/0xa;if(_0x1eff57===_0x19cf2a)break;else _0x213d7b['push'](_0x213d7b['shift']());}catch(_0x50a6b0){_0x213d7b['push'](_0x213d7b['shift']());}}}(a42_0x3c3d,0x24dea));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 _0x59cf7d=a42_0x594d,_0x176ab2=getVersion(),_0x22a59e=platform(),_0x2da898=process['version']['replace']('v','');return _0x59cf7d(0x86)+_0x176ab2+'\x20('+_0x22a59e+_0x59cf7d(0x88)+_0x2da898+')';}export function getAuthHeaders(_0x5c4143,_0x1fc9c3){const _0x4307ba=a42_0x594d,_0x36ff86=getVersion(),_0x4571e7={'User-Agent':getUserAgent(),'X-TD-Client':_0x4307ba(0x93),'X-TD-Client-Version':_0x36ff86};return _0x1fc9c3&&(_0x4571e7[_0x4307ba(0x8b)]=_0x4307ba(0x84)+_0x1fc9c3),_0x4571e7;}function a42_0x594d(_0x1dc8d8,_0x319bed){_0x1dc8d8=_0x1dc8d8-0x82;const _0x3c3d76=a42_0x3c3d();let _0x594d82=_0x3c3d76[_0x1dc8d8];return _0x594d82;}export function toHeaderRecord(_0x1a1778){const _0x5ec73=a42_0x594d,_0xc43e46={};for(const [_0x89d01c,_0x5e359a]of Object[_0x5ec73(0x8c)](_0x1a1778)){_0x5e359a!==undefined&&(_0xc43e46[_0x89d01c]=_0x5e359a);}return _0xc43e46;}export function getTrinoHeaders(_0x3163f3,_0x243bdc){const _0xb7854f=a42_0x594d,_0x301735=getAuthHeaders(_0x3163f3,_0x243bdc),_0x3ab593=toHeaderRecord(_0x301735);return delete _0x3ab593['Authorization'],_0x243bdc&&(_0x3ab593[_0xb7854f(0x89)]=_0x243bdc),_0x3ab593;}function a42_0x3c3d(){const _0x2ca88f=[';\x20node/','X-Trino-User','8SnQzxe','Authorization','entries','265145DUTfbf','1608257iYaOQW','569244wcljGt','3320360UfdOnN','4VMhiuv','length','tdx','6mhYMyc','249621wMmOFi','TD1\x20','183133rZvFhQ','tdx/','283932GHuCiG'];a42_0x3c3d=function(){return _0x2ca88f;};return a42_0x3c3d();}export function hasAPIKey(_0x1314e5){const _0x49acfe=a42_0x594d,_0x33d85a=getAPIKey(_0x1314e5);return _0x33d85a!==undefined&&_0x33d85a[_0x49acfe(0x92)]>0x0;}
1
+ (function(_0x564775,_0x4cb27d){const _0xcd1734=a42_0x2418,_0x53c9f7=_0x564775();while(!![]){try{const _0x46e592=parseInt(_0xcd1734(0x1b7))/0x1*(parseInt(_0xcd1734(0x1b0))/0x2)+-parseInt(_0xcd1734(0x1ba))/0x3+-parseInt(_0xcd1734(0x1b1))/0x4+-parseInt(_0xcd1734(0x1b5))/0x5+-parseInt(_0xcd1734(0x1af))/0x6+-parseInt(_0xcd1734(0x1bc))/0x7+parseInt(_0xcd1734(0x1b8))/0x8;if(_0x46e592===_0x4cb27d)break;else _0x53c9f7['push'](_0x53c9f7['shift']());}catch(_0x19773a){_0x53c9f7['push'](_0x53c9f7['shift']());}}}(a42_0x5dbf,0x20775));function a42_0x2418(_0x5e2992,_0x5f5032){_0x5e2992=_0x5e2992-0x1ad;const _0x5dbf21=a42_0x5dbf();let _0x241823=_0x5dbf21[_0x5e2992];return _0x241823;}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a42_0x5dbf(){const _0x4e124f=['Authorization','738670TTQpGl',';\x20node/','191uMNZMd','5773736pMOAOL','TD1\x20','355128ucRnxi','version','1170127atvtOi','replace','entries','tdx/','298704FjvIjf','1486fesBeo','990376FzJDep','length','X-Trino-User'];a42_0x5dbf=function(){return _0x4e124f;};return a42_0x5dbf();}export function getUserAgent(){const _0x92cff9=a42_0x2418,_0x2d9c54=getVersion(),_0x2bf8c9=platform(),_0x3f1b10=process[_0x92cff9(0x1bb)][_0x92cff9(0x1bd)]('v','');return _0x92cff9(0x1ae)+_0x2d9c54+'\x20('+_0x2bf8c9+_0x92cff9(0x1b6)+_0x3f1b10+')';}export function getAuthHeaders(_0x3085a3,_0x524a9d){const _0x348176=a42_0x2418,_0x16c342=getVersion(),_0xf9132={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x16c342};return _0x524a9d&&(_0xf9132[_0x348176(0x1b4)]=_0x348176(0x1b9)+_0x524a9d),_0xf9132;}export function toHeaderRecord(_0x4350fd){const _0x559726=a42_0x2418,_0x5ddb43={};for(const [_0x31d031,_0x3a94b0]of Object[_0x559726(0x1ad)](_0x4350fd)){_0x3a94b0!==undefined&&(_0x5ddb43[_0x31d031]=_0x3a94b0);}return _0x5ddb43;}export function getTrinoHeaders(_0x482804,_0x58457c){const _0x31e190=a42_0x2418,_0x54b9f8=getAuthHeaders(_0x482804,_0x58457c),_0x10ab8d=toHeaderRecord(_0x54b9f8);return delete _0x10ab8d[_0x31e190(0x1b4)],_0x58457c&&(_0x10ab8d[_0x31e190(0x1b3)]=_0x58457c),_0x10ab8d;}export function hasAPIKey(_0x313f79){const _0x52d03e=a42_0x2418,_0x29fa56=getAPIKey(_0x313f79);return _0x29fa56!==undefined&&_0x29fa56[_0x52d03e(0x1b2)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x3f196b,_0x1bdccd){const _0x4d5ae3=a43_0x4a96,_0x5c96ff=_0x3f196b();while(!![]){try{const _0x4dfbd8=-parseInt(_0x4d5ae3(0xa7))/0x1+-parseInt(_0x4d5ae3(0xb7))/0x2+parseInt(_0x4d5ae3(0x8b))/0x3*(parseInt(_0x4d5ae3(0xb4))/0x4)+-parseInt(_0x4d5ae3(0xba))/0x5*(parseInt(_0x4d5ae3(0x98))/0x6)+-parseInt(_0x4d5ae3(0x8c))/0x7+parseInt(_0x4d5ae3(0xae))/0x8+parseInt(_0x4d5ae3(0xa5))/0x9*(parseInt(_0x4d5ae3(0x83))/0xa);if(_0x4dfbd8===_0x1bdccd)break;else _0x5c96ff['push'](_0x5c96ff['shift']());}catch(_0xe9b7b4){_0x5c96ff['push'](_0x5c96ff['shift']());}}}(a43_0x2ae5,0x62ee1));function a43_0x2ae5(){const _0x3d6aee=['table','2021556MoZQTa','length','max','log','blue','color','varchar','error','limit','stdout','[logs]','tsv','isInteger','18945sRILlI','Results\x20saved\x20to\x20','576142wTonTJ','repeat','bold','isTTY','params','resolve','trim','5862792sUBcSP','list','format','rule','output','noColor','16zIrzut','split','number','1483290KqMsTZ','write','end','10xacDVl','cyan','No\x20data','[rule]','query','stdin','stderr','jsonl','stringify','forEach','map','cmdout','10760avXkFz','double','pipe','push','entries','boolean','inherit','join','60567wjYkWr','4772103LzCUki','-FXRSn','FINISHED','keys','close','object','─┴─','padEnd','[params]','json','─┬─'];a43_0x2ae5=function(){return _0x3d6aee;};return a43_0x2ae5();}import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a43_0x4603df from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x4dfcd3){const _0x4c1680=a43_0x4a96;return _0x4dfcd3['format']===_0x4c1680(0x95)||_0x4dfcd3[_0x4c1680(0xb0)]==='jsonl'||_0x4dfcd3[_0x4c1680(0xb0)]==='tsv'||_0x4dfcd3[_0x4c1680(0xb0)]===_0x4c1680(0x97)||_0x4dfcd3[_0x4c1680(0x95)]===!![]||_0x4dfcd3[_0x4c1680(0x7e)]===!![]||_0x4dfcd3[_0x4c1680(0xa3)]===!![]||_0x4dfcd3[_0x4c1680(0x97)]===!![];}function a43_0x4a96(_0x41f004,_0x1c9fe4){_0x41f004=_0x41f004-0x78;const _0x2ae515=a43_0x2ae5();let _0x4a9689=_0x2ae515[_0x41f004];return _0x4a9689;}export function parseOutputOptions(_0x2b3416){const _0x1f7c63=a43_0x4a96;return{'format':_0x2b3416['format']||'table','output':_0x2b3416[_0x1f7c63(0xb2)]||'','limit':_0x2b3416[_0x1f7c63(0xa0)],'color':_0x2b3416[_0x1f7c63(0x9d)],'noColor':_0x2b3416[_0x1f7c63(0xb3)]};}function convertSDKResultToQueryResult(_0x1b4d90){const _0x589f8c=a43_0x4a96,_0x2d04c4=[];if(_0x1b4d90['length']>0x0){const _0x281dca=_0x1b4d90[0x0];for(const [_0x16984a,_0x3860d0]of Object['entries'](_0x281dca)){let _0x5f4396=_0x589f8c(0x9e);if(typeof _0x3860d0===_0x589f8c(0xb6))_0x5f4396=Number[_0x589f8c(0xa4)](_0x3860d0)?'bigint':_0x589f8c(0x84);else{if(typeof _0x3860d0===_0x589f8c(0x88))_0x5f4396='boolean';else _0x3860d0===null&&(_0x5f4396=_0x589f8c(0x9e));}_0x2d04c4['push']({'name':_0x16984a,'type':_0x5f4396});}}return{'queryId':'sdk-result','columns':_0x2d04c4,'data':_0x1b4d90,'stats':{'state':_0x589f8c(0x8e),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1b4d90['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x439191,_0x29e3c4){const _0x654e03=convertSDKResultToQueryResult(_0x439191);return formatQueryOutput(_0x654e03,_0x29e3c4);}export async function formatQueryOutput(_0x131f9f,_0x40fbab){const _0x17040b=a43_0x4a96,{format:_0x127527,limit:_0x560268,output:_0xb6d276,color:_0x906187,noColor:_0x10c00b}=_0x40fbab,_0x51be89=Boolean(_0xb6d276)&&!_0x906187,_0x4bc30f={'color':_0x906187,'noColor':_0x10c00b||_0x51be89};if(_0x127527==='table'){const _0x2da009=shouldUseLess(_0x127527,_0xb6d276);return formatAsTable(_0x131f9f,_0x560268,_0x2da009,_0x4bc30f);}else{if(_0x127527===_0x17040b(0x95))return formatAsJSON(_0x131f9f,_0x4bc30f);else return _0x127527===_0x17040b(0x7e)?formatAsJSONL(_0x131f9f,_0x4bc30f):formatQueryResult(_0x131f9f,_0x127527);}}function shouldUseLess(_0x4b3cf8,_0x13ee81){const _0x10d974=a43_0x4a96;return(_0x4b3cf8===_0x10d974(0x97)||_0x4b3cf8===_0x10d974(0xaf))&&process[_0x10d974(0xa1)][_0x10d974(0xaa)]&&!_0x13ee81;}export function resolveOutputOptions(_0x3ace0c){const _0xe924a1=a43_0x4a96,_0xd016ca=resolveOutputFormat(_0x3ace0c[_0xe924a1(0xb0)],_0x3ace0c[_0xe924a1(0xb2)],_0xe924a1(0x97));let _0x914b17=typeof _0x3ace0c['limit']===_0xe924a1(0xb6)?_0x3ace0c[_0xe924a1(0xa0)]:parseInt(_0x3ace0c[_0xe924a1(0xa0)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x1f961e=_0x3ace0c[_0xe924a1(0xb2)]||'';return shouldUseLess(_0xd016ca,_0x1f961e)&&(_0x914b17=Infinity),{'format':_0xd016ca,'output':_0x1f961e,'limit':_0x914b17,'color':_0x3ace0c['color'],'noColor':_0x3ace0c[_0xe924a1(0xb3)]};}export function writeOutput(_0xa2d879,_0xb91fbc,_0x1eef91){const _0x1a2bfe=a43_0x4a96;return _0xb91fbc?(writeFileSync(_0xb91fbc,_0xa2d879),console[_0x1a2bfe(0x9f)](_0x1a2bfe(0xa6)+_0xb91fbc),Promise[_0x1a2bfe(0xac)]()):shouldUseLess(_0x1eef91||'','')?new Promise(_0x18644a=>{const _0xefc879=_0x1a2bfe,_0x36e1d0=spawn('less',[_0xefc879(0x8d)],{'stdio':[_0xefc879(0x85),_0xefc879(0x89),_0xefc879(0x89)]});let _0xdc3a40=![];_0x36e1d0['on'](_0xefc879(0x9f),()=>{const _0xe11075=_0xefc879;!_0xdc3a40&&(_0xdc3a40=!![],console[_0xe11075(0x9b)](_0xa2d879),_0x18644a());}),_0x36e1d0['on'](_0xefc879(0x90),()=>{!_0xdc3a40&&(_0xdc3a40=!![],_0x18644a());}),_0x36e1d0['on']('spawn',()=>{const _0x507e64=_0xefc879;!_0xdc3a40&&_0x36e1d0[_0x507e64(0x7c)]&&(_0x36e1d0[_0x507e64(0x7c)]['on'](_0x507e64(0x9f),()=>{}),_0x36e1d0[_0x507e64(0x7c)][_0x507e64(0xb8)](_0xa2d879),_0x36e1d0[_0x507e64(0x7c)][_0x507e64(0xb9)]());}),!_0x36e1d0[_0xefc879(0x7c)]&&(!_0xdc3a40&&(_0xdc3a40=!![],console[_0xefc879(0x9b)](_0xa2d879),_0x18644a()));}):(console[_0x1a2bfe(0x9b)](_0xa2d879),Promise[_0x1a2bfe(0xac)]());}export async function handleSDKOutput(_0x45aac8,_0x4fb9f6){const _0x93f79e=a43_0x4a96,_0x5e7d88=resolveOutputOptions(_0x4fb9f6),_0x519ce2=await formatSDKOutput(_0x45aac8,_0x5e7d88);await writeOutput(_0x519ce2,_0x5e7d88[_0x93f79e(0xb2)]||undefined,_0x5e7d88[_0x93f79e(0xb0)]);}export async function handleQueryOutput(_0x354f20,_0x5b146a){const _0x325384=a43_0x4a96,_0x392f84=resolveOutputOptions(_0x5b146a),_0x2d4090=await formatQueryOutput(_0x354f20,_0x392f84);await writeOutput(_0x2d4090,_0x392f84['output']||undefined,_0x392f84[_0x325384(0xb0)]);}async function formatSingleObject(_0x5144b3,_0x170063){const _0x98c804=a43_0x4a96,{format:_0xd466aa,color:_0x2e2d10,noColor:_0x4cdd5}=_0x170063,_0x2ac03b={'color':_0x2e2d10,'noColor':_0x4cdd5};if(_0xd466aa===_0x98c804(0x95)){if(shouldUseColor(_0x2ac03b))return colorizeJSON(_0x5144b3,_0x2ac03b);return JSON[_0x98c804(0x7f)](_0x5144b3,null,0x2);}else{if(_0xd466aa==='jsonl'){if(shouldUseColor(_0x2ac03b))return colorizeJSONCompact(_0x5144b3,_0x2ac03b);return JSON[_0x98c804(0x7f)](_0x5144b3);}else{if(_0xd466aa===_0x98c804(0xa3))return Object[_0x98c804(0x87)](_0x5144b3)[_0x98c804(0x81)](([_0x42ca36,_0x4b47ab])=>_0x42ca36+'\x09'+_0x4b47ab)[_0x98c804(0x8a)]('\x0a');else{const _0x49587d=Object['entries'](_0x5144b3);if(_0x49587d['length']===0x0)return _0x98c804(0x79);const _0x1b0f32=_0x5144b3['debug'],_0x518b30=_0x5144b3[_0x98c804(0x7b)],_0x52033b=_0x5144b3[_0x98c804(0xab)],_0x1a6031=_0x5144b3[_0x98c804(0xb1)],_0x49c62b=_0x518b30?typeof _0x518b30==='string'?_0x518b30:JSON[_0x98c804(0x7f)](_0x518b30,null,0x2):undefined,_0x522fc5=_0x52033b&&Object[_0x98c804(0x8f)](_0x52033b)[_0x98c804(0x99)]>0x0?JSON[_0x98c804(0x7f)](_0x52033b,null,0x2):undefined,_0x414814=_0x1a6031&&Object[_0x98c804(0x8f)](_0x1a6031)[_0x98c804(0x99)]>0x0?JSON[_0x98c804(0x7f)](_0x1a6031,null,0x2):undefined,_0x29bde2=_0x49587d['filter'](([_0x3a201f])=>_0x3a201f!=='debug'&&_0x3a201f!=='query'&&_0x3a201f!==_0x98c804(0xab)&&_0x3a201f!==_0x98c804(0xb1)),_0x39a885=Math['max'](..._0x29bde2['map'](([_0x1545ce])=>_0x1545ce[_0x98c804(0x99)])),_0x145230=Math[_0x98c804(0x9a)](..._0x29bde2[_0x98c804(0x81)](([,_0x4c9f14])=>{const _0x254406=_0x98c804;try{const _0xaa3dd7=_0x4c9f14===null||_0x4c9f14===undefined?'':typeof _0x4c9f14===_0x254406(0x91)?JSON[_0x254406(0x7f)](_0x4c9f14):String(_0x4c9f14),_0x2ab9ce=_0xaa3dd7[_0x254406(0xb5)]('\x0a');return Math[_0x254406(0x9a)](..._0x2ab9ce['map'](_0x2a21fe=>_0x2a21fe[_0x254406(0x99)]),0x0);}catch{return 0x0;}}),0x14),_0x33f545=[];_0x33f545[_0x98c804(0x86)](colorBorder('┌─'+'─'[_0x98c804(0xa8)](_0x39a885)+_0x98c804(0x96)+'─'[_0x98c804(0xa8)](_0x145230)+'─┐',_0x2ac03b)),_0x29bde2[_0x98c804(0x80)](([_0x2c8026,_0x473757])=>{const _0x3ebdfc=_0x98c804;let _0xc4b438;try{_0xc4b438=_0x473757===null||_0x473757===undefined?'':typeof _0x473757===_0x3ebdfc(0x91)?JSON['stringify'](_0x473757):String(_0x473757);}catch{_0xc4b438='[Object]';}const _0x1d8c1e=_0x2c8026[_0x3ebdfc(0x93)](_0x39a885),_0x21e274=_0xc4b438[_0x3ebdfc(0xb5)]('\x0a');_0x21e274[_0x3ebdfc(0x80)]((_0x567f1a,_0x10e260)=>{const _0x87aed2=_0x3ebdfc,_0x4bb20a=colorBorder('│',_0x2ac03b);_0x10e260===0x0?_0x33f545[_0x87aed2(0x86)](_0x4bb20a+'\x20'+_0x1d8c1e+'\x20'+_0x4bb20a+'\x20'+_0x567f1a[_0x87aed2(0x93)](_0x145230)+'\x20'+_0x4bb20a):_0x33f545['push'](_0x4bb20a+'\x20'+'\x20'[_0x87aed2(0xa8)](_0x39a885)+'\x20'+_0x4bb20a+'\x20'+_0x567f1a['padEnd'](_0x145230)+'\x20'+_0x4bb20a);});}),_0x33f545['push'](colorBorder('└─'+'─'[_0x98c804(0xa8)](_0x39a885)+_0x98c804(0x92)+'─'['repeat'](_0x145230)+'─┘',_0x2ac03b));_0x49c62b&&(_0x33f545['push'](''),_0x33f545[_0x98c804(0x86)](String(a43_0x4603df['yellow'][_0x98c804(0xa9)]('[query]'))),_0x33f545[_0x98c804(0x86)](_0x49c62b));_0x522fc5&&(_0x33f545[_0x98c804(0x86)](''),_0x33f545['push'](String(a43_0x4603df[_0x98c804(0x9c)]['bold'](_0x98c804(0x94)))),_0x33f545['push'](_0x522fc5));_0x414814&&(_0x33f545[_0x98c804(0x86)](''),_0x33f545[_0x98c804(0x86)](String(a43_0x4603df['magenta']['bold'](_0x98c804(0x7a)))),_0x33f545[_0x98c804(0x86)](_0x414814));if(_0x1b0f32){if(_0x1b0f32[_0x98c804(0x7d)]){_0x33f545[_0x98c804(0x86)](''),_0x33f545[_0x98c804(0x86)](String(a43_0x4603df['red'][_0x98c804(0xa9)]('[error]')));const _0x2c5dce=_0x1b0f32[_0x98c804(0x7d)][_0x98c804(0xb5)]('\x0a');_0x2c5dce[_0x98c804(0x80)](_0xf05f6d=>{const _0x5606a2=_0x98c804;_0xf05f6d[_0x5606a2(0xad)]()&&_0x33f545[_0x5606a2(0x86)](_0xf05f6d);});}if(_0x1b0f32[_0x98c804(0x82)]){_0x33f545[_0x98c804(0x86)](''),_0x33f545[_0x98c804(0x86)](String(a43_0x4603df[_0x98c804(0x78)][_0x98c804(0xa9)](_0x98c804(0xa2))));const _0x234910=_0x1b0f32['cmdout'][_0x98c804(0xb5)]('\x0a');_0x234910[_0x98c804(0x80)](_0x11356f=>{const _0x2a3d76=_0x98c804;_0x11356f[_0x2a3d76(0xad)]()&&_0x33f545[_0x2a3d76(0x86)](_0x11356f);});}}return _0x33f545['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x2ddd57,_0x3385ab){const _0x34bd61=a43_0x4a96;if(_0x3385ab[_0x34bd61(0xb0)]===_0x34bd61(0x97)){await handleSDKOutput([_0x2ddd57],_0x3385ab);return;}const _0x2b6158=resolveOutputOptions(_0x3385ab),_0xa3c8a7=await formatSingleObject(_0x2ddd57,_0x2b6158);await writeOutput(_0xa3c8a7,_0x2b6158['output']||undefined,_0x2b6158['format']);}
1
+ (function(_0x5bcb31,_0x202c51){const _0xffca70=a43_0x32a3,_0x2c9693=_0x5bcb31();while(!![]){try{const _0x4569b5=parseInt(_0xffca70(0xa0))/0x1+parseInt(_0xffca70(0x8e))/0x2+-parseInt(_0xffca70(0xad))/0x3*(parseInt(_0xffca70(0x92))/0x4)+-parseInt(_0xffca70(0x94))/0x5+parseInt(_0xffca70(0xb3))/0x6+parseInt(_0xffca70(0xa3))/0x7+parseInt(_0xffca70(0x85))/0x8*(-parseInt(_0xffca70(0x90))/0x9);if(_0x4569b5===_0x202c51)break;else _0x2c9693['push'](_0x2c9693['shift']());}catch(_0x547a2d){_0x2c9693['push'](_0x2c9693['shift']());}}}(a43_0x398e,0x878c3));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a43_0x2e6788 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x3cedb5){const _0x2e727d=a43_0x32a3;return _0x3cedb5[_0x2e727d(0xb8)]===_0x2e727d(0xa5)||_0x3cedb5[_0x2e727d(0xb8)]==='jsonl'||_0x3cedb5['format']===_0x2e727d(0x78)||_0x3cedb5[_0x2e727d(0xb8)]===_0x2e727d(0x9d)||_0x3cedb5['json']===!![]||_0x3cedb5['jsonl']===!![]||_0x3cedb5[_0x2e727d(0x78)]===!![]||_0x3cedb5[_0x2e727d(0x9d)]===!![];}export function parseOutputOptions(_0x479080){const _0x33ec64=a43_0x32a3;return{'format':_0x479080['format']||'table','output':_0x479080[_0x33ec64(0xa4)]||'','limit':_0x479080[_0x33ec64(0x86)],'color':_0x479080['color'],'noColor':_0x479080[_0x33ec64(0x7a)]};}function convertSDKResultToQueryResult(_0x13b674){const _0x1047a9=a43_0x32a3,_0x407036=[];if(_0x13b674['length']>0x0){const _0x43e6af=_0x13b674[0x0];for(const [_0x44ec00,_0xeb3a05]of Object[_0x1047a9(0x7d)](_0x43e6af)){let _0x37f5f4='varchar';if(typeof _0xeb3a05===_0x1047a9(0xb6))_0x37f5f4=Number[_0x1047a9(0xaf)](_0xeb3a05)?_0x1047a9(0x79):_0x1047a9(0x89);else{if(typeof _0xeb3a05===_0x1047a9(0x9c))_0x37f5f4='boolean';else _0xeb3a05===null&&(_0x37f5f4=_0x1047a9(0xae));}_0x407036['push']({'name':_0x44ec00,'type':_0x37f5f4});}}return{'queryId':_0x1047a9(0x87),'columns':_0x407036,'data':_0x13b674,'stats':{'state':_0x1047a9(0xa8),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x13b674[_0x1047a9(0xaa)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x50b668,_0x17d915){const _0x3c5247=convertSDKResultToQueryResult(_0x50b668);return formatQueryOutput(_0x3c5247,_0x17d915);}export async function formatQueryOutput(_0x5804f4,_0x44eed0){const _0x473ad2=a43_0x32a3,{format:_0x1393e4,limit:_0x50cf31,output:_0x182a0c,color:_0x2f7369,noColor:_0x41f3ae}=_0x44eed0,_0x26f11b=Boolean(_0x182a0c)&&!_0x2f7369,_0x54e4f3={'color':_0x2f7369,'noColor':_0x41f3ae||_0x26f11b};if(_0x1393e4===_0x473ad2(0x9d)){const _0x320108=shouldUseLess(_0x1393e4,_0x182a0c);return formatAsTable(_0x5804f4,_0x50cf31,_0x320108,_0x54e4f3);}else{if(_0x1393e4==='json')return formatAsJSON(_0x5804f4,_0x54e4f3);else return _0x1393e4===_0x473ad2(0xb9)?formatAsJSONL(_0x5804f4,_0x54e4f3):formatQueryResult(_0x5804f4,_0x1393e4);}}function shouldUseLess(_0x1c98d5,_0x4e86c6){const _0x16b926=a43_0x32a3;return(_0x1c98d5===_0x16b926(0x9d)||_0x1c98d5==='list')&&process['stdout'][_0x16b926(0x8f)]&&!_0x4e86c6;}export function resolveOutputOptions(_0x7e99f9){const _0x1d54ef=a43_0x32a3,_0x34273a=resolveOutputFormat(_0x7e99f9[_0x1d54ef(0xb8)],_0x7e99f9[_0x1d54ef(0xa4)],_0x1d54ef(0x9d));let _0x345391=typeof _0x7e99f9[_0x1d54ef(0x86)]==='number'?_0x7e99f9[_0x1d54ef(0x86)]:parseInt(_0x7e99f9[_0x1d54ef(0x86)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xfbaaa6=_0x7e99f9[_0x1d54ef(0xa4)]||'';return shouldUseLess(_0x34273a,_0xfbaaa6)&&(_0x345391=Infinity),{'format':_0x34273a,'output':_0xfbaaa6,'limit':_0x345391,'color':_0x7e99f9['color'],'noColor':_0x7e99f9[_0x1d54ef(0x7a)]};}export function writeOutput(_0x4a06d6,_0x22917a,_0x3a855c){const _0x20f106=a43_0x32a3;return _0x22917a?(writeFileSync(_0x22917a,_0x4a06d6),console[_0x20f106(0xb7)]('Results\x20saved\x20to\x20'+_0x22917a),Promise[_0x20f106(0x98)]()):shouldUseLess(_0x3a855c||'','')?new Promise(_0x1020d0=>{const _0x27a093=_0x20f106,_0x502751=spawn('less',[_0x27a093(0xb2)],{'stdio':[_0x27a093(0x8b),'inherit','inherit']});let _0x3d4d27=![];_0x502751['on'](_0x27a093(0xb7),()=>{const _0x56eb58=_0x27a093;!_0x3d4d27&&(_0x3d4d27=!![],console[_0x56eb58(0xb5)](_0x4a06d6),_0x1020d0());}),_0x502751['on']('close',()=>{!_0x3d4d27&&(_0x3d4d27=!![],_0x1020d0());}),_0x502751['on'](_0x27a093(0xa2),()=>{const _0x16e90f=_0x27a093;!_0x3d4d27&&_0x502751[_0x16e90f(0x97)]&&(_0x502751[_0x16e90f(0x97)]['on']('error',()=>{}),_0x502751[_0x16e90f(0x97)]['write'](_0x4a06d6),_0x502751[_0x16e90f(0x97)][_0x16e90f(0x91)]());}),!_0x502751[_0x27a093(0x97)]&&(!_0x3d4d27&&(_0x3d4d27=!![],console[_0x27a093(0xb5)](_0x4a06d6),_0x1020d0()));}):(console['log'](_0x4a06d6),Promise[_0x20f106(0x98)]());}export async function handleSDKOutput(_0x9f3596,_0xa70c1e){const _0x3fffda=a43_0x32a3,_0x409afe=resolveOutputOptions(_0xa70c1e),_0x1343e8=await formatSDKOutput(_0x9f3596,_0x409afe);await writeOutput(_0x1343e8,_0x409afe[_0x3fffda(0xa4)]||undefined,_0x409afe[_0x3fffda(0xb8)]);}function a43_0x32a3(_0x58a222,_0x3f73af){_0x58a222=_0x58a222-0x77;const _0x398eb8=a43_0x398e();let _0x32a395=_0x398eb8[_0x58a222];return _0x32a395;}export async function handleQueryOutput(_0x3d2f7e,_0x3c0de2){const _0x10f7cc=a43_0x32a3,_0x13ae4a=resolveOutputOptions(_0x3c0de2),_0x3d396b=await formatQueryOutput(_0x3d2f7e,_0x13ae4a);await writeOutput(_0x3d396b,_0x13ae4a['output']||undefined,_0x13ae4a[_0x10f7cc(0xb8)]);}async function formatSingleObject(_0x2956bc,_0x330e9d){const _0x42cb7b=a43_0x32a3,{format:_0x52ad3e,color:_0x1a9eed,noColor:_0x196da8}=_0x330e9d,_0x5bda4e={'color':_0x1a9eed,'noColor':_0x196da8};if(_0x52ad3e===_0x42cb7b(0xa5)){if(shouldUseColor(_0x5bda4e))return colorizeJSON(_0x2956bc,_0x5bda4e);return JSON[_0x42cb7b(0x9b)](_0x2956bc,null,0x2);}else{if(_0x52ad3e===_0x42cb7b(0xb9)){if(shouldUseColor(_0x5bda4e))return colorizeJSONCompact(_0x2956bc,_0x5bda4e);return JSON[_0x42cb7b(0x9b)](_0x2956bc);}else{if(_0x52ad3e===_0x42cb7b(0x78))return Object[_0x42cb7b(0x7d)](_0x2956bc)[_0x42cb7b(0x9a)](([_0x47ae61,_0x20d5d8])=>_0x47ae61+'\x09'+_0x20d5d8)[_0x42cb7b(0x8a)]('\x0a');else{const _0x4c3e33=Object[_0x42cb7b(0x7d)](_0x2956bc);if(_0x4c3e33[_0x42cb7b(0xaa)]===0x0)return _0x42cb7b(0xa6);const _0xbc6eef=_0x2956bc[_0x42cb7b(0x7f)],_0x587671=_0x2956bc[_0x42cb7b(0x7b)],_0x26ce00=_0x2956bc[_0x42cb7b(0xa7)],_0x144bdc=_0x2956bc['rule'],_0x1448d8=_0x587671?typeof _0x587671===_0x42cb7b(0xa9)?_0x587671:JSON[_0x42cb7b(0x9b)](_0x587671,null,0x2):undefined,_0x56a3b1=_0x26ce00&&Object[_0x42cb7b(0x8c)](_0x26ce00)['length']>0x0?JSON['stringify'](_0x26ce00,null,0x2):undefined,_0x4d23eb=_0x144bdc&&Object['keys'](_0x144bdc)[_0x42cb7b(0xaa)]>0x0?JSON[_0x42cb7b(0x9b)](_0x144bdc,null,0x2):undefined,_0x4c35d8=_0x4c3e33[_0x42cb7b(0x84)](([_0x75ad80])=>_0x75ad80!=='debug'&&_0x75ad80!==_0x42cb7b(0x7b)&&_0x75ad80!==_0x42cb7b(0xa7)&&_0x75ad80!==_0x42cb7b(0x7e)),_0x373efa=Math[_0x42cb7b(0x77)](..._0x4c35d8['map'](([_0x1ad2a5])=>_0x1ad2a5[_0x42cb7b(0xaa)])),_0x36c940=Math[_0x42cb7b(0x77)](..._0x4c35d8[_0x42cb7b(0x9a)](([,_0x1d3292])=>{const _0x34a695=_0x42cb7b;try{const _0x311a34=_0x1d3292===null||_0x1d3292===undefined?'':typeof _0x1d3292===_0x34a695(0x7c)?JSON['stringify'](_0x1d3292):String(_0x1d3292),_0x393489=_0x311a34[_0x34a695(0x82)]('\x0a');return Math['max'](..._0x393489[_0x34a695(0x9a)](_0x5e4fb6=>_0x5e4fb6[_0x34a695(0xaa)]),0x0);}catch{return 0x0;}}),0x14),_0x5b6993=[];_0x5b6993[_0x42cb7b(0xb1)](colorBorder('┌─'+'─'[_0x42cb7b(0xac)](_0x373efa)+_0x42cb7b(0x96)+'─'['repeat'](_0x36c940)+'─┐',_0x5bda4e)),_0x4c35d8['forEach'](([_0x2a8a01,_0x51f2c9])=>{const _0x36d12a=_0x42cb7b;let _0x6372c5;try{_0x6372c5=_0x51f2c9===null||_0x51f2c9===undefined?'':typeof _0x51f2c9==='object'?JSON[_0x36d12a(0x9b)](_0x51f2c9):String(_0x51f2c9);}catch{_0x6372c5=_0x36d12a(0x9e);}const _0x58010b=_0x2a8a01[_0x36d12a(0x80)](_0x373efa),_0x110e32=_0x6372c5[_0x36d12a(0x82)]('\x0a');_0x110e32['forEach']((_0x158285,_0x3356d4)=>{const _0x519fe4=_0x36d12a,_0x44533d=colorBorder('│',_0x5bda4e);_0x3356d4===0x0?_0x5b6993[_0x519fe4(0xb1)](_0x44533d+'\x20'+_0x58010b+'\x20'+_0x44533d+'\x20'+_0x158285['padEnd'](_0x36c940)+'\x20'+_0x44533d):_0x5b6993[_0x519fe4(0xb1)](_0x44533d+'\x20'+'\x20'[_0x519fe4(0xac)](_0x373efa)+'\x20'+_0x44533d+'\x20'+_0x158285[_0x519fe4(0x80)](_0x36c940)+'\x20'+_0x44533d);});}),_0x5b6993[_0x42cb7b(0xb1)](colorBorder('└─'+'─'['repeat'](_0x373efa)+'─┴─'+'─'['repeat'](_0x36c940)+'─┘',_0x5bda4e));_0x1448d8&&(_0x5b6993['push'](''),_0x5b6993[_0x42cb7b(0xb1)](String(a43_0x2e6788[_0x42cb7b(0x99)][_0x42cb7b(0x9f)](_0x42cb7b(0x95)))),_0x5b6993[_0x42cb7b(0xb1)](_0x1448d8));_0x56a3b1&&(_0x5b6993[_0x42cb7b(0xb1)](''),_0x5b6993['push'](String(a43_0x2e6788[_0x42cb7b(0xa1)][_0x42cb7b(0x9f)](_0x42cb7b(0xab)))),_0x5b6993[_0x42cb7b(0xb1)](_0x56a3b1));_0x4d23eb&&(_0x5b6993[_0x42cb7b(0xb1)](''),_0x5b6993[_0x42cb7b(0xb1)](String(a43_0x2e6788[_0x42cb7b(0x93)]['bold'](_0x42cb7b(0xb0)))),_0x5b6993[_0x42cb7b(0xb1)](_0x4d23eb));if(_0xbc6eef){if(_0xbc6eef[_0x42cb7b(0x88)]){_0x5b6993[_0x42cb7b(0xb1)](''),_0x5b6993[_0x42cb7b(0xb1)](String(a43_0x2e6788[_0x42cb7b(0x8d)][_0x42cb7b(0x9f)]('[error]')));const _0x409f97=_0xbc6eef[_0x42cb7b(0x88)]['split']('\x0a');_0x409f97[_0x42cb7b(0xb4)](_0x4b4ccc=>{const _0x503a36=_0x42cb7b;_0x4b4ccc[_0x503a36(0x83)]()&&_0x5b6993[_0x503a36(0xb1)](_0x4b4ccc);});}if(_0xbc6eef['cmdout']){_0x5b6993[_0x42cb7b(0xb1)](''),_0x5b6993[_0x42cb7b(0xb1)](String(a43_0x2e6788['cyan'][_0x42cb7b(0x9f)](_0x42cb7b(0x81))));const _0x4677da=_0xbc6eef['cmdout'][_0x42cb7b(0x82)]('\x0a');_0x4677da['forEach'](_0x520607=>{const _0x497342=_0x42cb7b;_0x520607[_0x497342(0x83)]()&&_0x5b6993['push'](_0x520607);});}}return _0x5b6993['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0xc9e4cf,_0x2c9cf4){const _0x2eb6b5=a43_0x32a3;if(_0x2c9cf4[_0x2eb6b5(0xb8)]===_0x2eb6b5(0x9d)){await handleSDKOutput([_0xc9e4cf],_0x2c9cf4);return;}const _0x1cb434=resolveOutputOptions(_0x2c9cf4),_0x23540b=await formatSingleObject(_0xc9e4cf,_0x1cb434);await writeOutput(_0x23540b,_0x1cb434[_0x2eb6b5(0xa4)]||undefined,_0x1cb434[_0x2eb6b5(0xb8)]);}function a43_0x398e(){const _0x2c4f09=['bigint','noColor','query','object','entries','rule','debug','padEnd','[logs]','split','trim','filter','12911504PCqfNu','limit','sdk-result','stderr','double','join','pipe','keys','red','1865868XkCvpw','isTTY','9lDZird','end','941444CgectM','magenta','3371685fRvuem','[query]','─┬─','stdin','resolve','yellow','map','stringify','boolean','table','[Object]','bold','1037772evypGH','blue','spawn','3356521bcluLn','output','json','No\x20data','params','FINISHED','string','length','[params]','repeat','3XHSGrc','varchar','isInteger','[rule]','push','-FXRSn','3771780FKOfUe','forEach','log','number','error','format','jsonl','max','tsv'];a43_0x398e=function(){return _0x2c4f09;};return a43_0x398e();}