@treasuredata/tdx 2026.4.14 → 2026.4.16

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 (221) hide show
  1. package/README.md +1 -1
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/tools/work-create-item.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/cas/cas-api-client.js +1 -1
  94. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  95. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  96. package/dist/sdk/cas/index.js +1 -1
  97. package/dist/sdk/cas/pull-workflow.js +1 -1
  98. package/dist/sdk/cas/push-workflow.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js +1 -1
  100. package/dist/sdk/client/delivery-api-client.js +1 -1
  101. package/dist/sdk/client/endpoints.js +1 -1
  102. package/dist/sdk/client/engage-api-client.js +1 -1
  103. package/dist/sdk/client/http-client.js +1 -1
  104. package/dist/sdk/client/llm-api-client.js +1 -1
  105. package/dist/sdk/client/oauth-refresh.js +1 -1
  106. package/dist/sdk/client/rate-limiter.js +1 -1
  107. package/dist/sdk/client/td-api-client.js +1 -1
  108. package/dist/sdk/client/trino-api-client.js +1 -1
  109. package/dist/sdk/client/workflow-client.js +1 -1
  110. package/dist/sdk/connection-validator.js +1 -1
  111. package/dist/sdk/connection.js +1 -1
  112. package/dist/sdk/delivery.js +1 -1
  113. package/dist/sdk/engage/campaign-pull.js +1 -1
  114. package/dist/sdk/engage/campaign-push.js +1 -1
  115. package/dist/sdk/engage/campaign-validator.js +1 -1
  116. package/dist/sdk/engage/campaign-yaml.js +1 -1
  117. package/dist/sdk/engage/template-pull.js +1 -1
  118. package/dist/sdk/engage/template-push.js +1 -1
  119. package/dist/sdk/engage/template-validator.js +1 -1
  120. package/dist/sdk/engage/template-yaml.js +1 -1
  121. package/dist/sdk/engage/types/campaign-def.js +1 -1
  122. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  123. package/dist/sdk/engage/types/template-schema.js +1 -1
  124. package/dist/sdk/engage.js +1 -1
  125. package/dist/sdk/errors.js +1 -1
  126. package/dist/sdk/index.js +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/personalization.js +1 -1
  136. package/dist/sdk/policy.js +1 -1
  137. package/dist/sdk/query/index.js +1 -1
  138. package/dist/sdk/query/sql-parser.js +1 -1
  139. package/dist/sdk/realtime.js +1 -1
  140. package/dist/sdk/schedule.js +1 -1
  141. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  142. package/dist/sdk/segment/fields-display.js +1 -1
  143. package/dist/sdk/segment/file-discovery.js +1 -1
  144. package/dist/sdk/segment/journey-utils.js +1 -1
  145. package/dist/sdk/segment/journey-validator.js +1 -1
  146. package/dist/sdk/segment/journey-yaml.js +1 -1
  147. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  148. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  149. package/dist/sdk/segment/pull-workflow.js +1 -1
  150. package/dist/sdk/segment/push-recovery.js +1 -1
  151. package/dist/sdk/segment/push-workflow.js +1 -1
  152. package/dist/sdk/segment/resolution-context.js +1 -1
  153. package/dist/sdk/segment/segment-path-parser.js +1 -1
  154. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  155. package/dist/sdk/segment/segment-validator.js +1 -1
  156. package/dist/sdk/segment/target-resolution.js +1 -1
  157. package/dist/sdk/segment/tdx-config.js +1 -1
  158. package/dist/sdk/segment/types/activation-schema.js +1 -1
  159. package/dist/sdk/segment/types/journey-def.js +1 -1
  160. package/dist/sdk/segment/types/journey-schema.js +1 -1
  161. package/dist/sdk/segment/types/segment-def.js +1 -1
  162. package/dist/sdk/segment/types/segment-schema.js +1 -1
  163. package/dist/sdk/segment/validate-files.js +1 -1
  164. package/dist/sdk/segment/yaml-validator.js +1 -1
  165. package/dist/sdk/segment.js +1 -1
  166. package/dist/sdk/types/index.js +1 -1
  167. package/dist/sdk/types/progress.js +1 -1
  168. package/dist/sdk/types/workspace.js +1 -1
  169. package/dist/sdk/user.js +1 -1
  170. package/dist/sdk/util/format-detector.js +1 -1
  171. package/dist/sdk/util/formatters.js +1 -1
  172. package/dist/sdk/util/index.js +1 -1
  173. package/dist/sdk/util/paginate.js +1 -1
  174. package/dist/sdk/util/tree-formatter.js +1 -1
  175. package/dist/sdk/workflow/archive-validation.js +1 -1
  176. package/dist/sdk/workflow/clone-workflow.js +1 -1
  177. package/dist/sdk/workflow/index.js +1 -1
  178. package/dist/sdk/workflow/pull-workflow.js +1 -1
  179. package/dist/sdk/workflow/push-workflow.js +1 -1
  180. package/dist/sdk/workflow/tdx-config.js +1 -1
  181. package/dist/sdk/workflow/workflow-utils.js +1 -1
  182. package/dist/sdk/workspace/access-tracker.js +1 -1
  183. package/dist/sdk/workspace/frontmatter.js +1 -1
  184. package/dist/sdk/workspace/git.js +1 -1
  185. package/dist/sdk/workspace/index.js +1 -1
  186. package/dist/sdk/workspace/templates.js +1 -1
  187. package/dist/sdk/workspace/weekly.js +1 -1
  188. package/dist/sdk/workspace/wikilinks.js +1 -1
  189. package/dist/test-utils/command-runner.js +1 -1
  190. package/dist/test-utils/factories.js +1 -1
  191. package/dist/test-utils/fixtures.js +1 -1
  192. package/dist/test-utils/http-mock.js +1 -1
  193. package/dist/test-utils/index.js +1 -1
  194. package/dist/utils/async.js +1 -1
  195. package/dist/utils/colors.js +1 -1
  196. package/dist/utils/diff.js +1 -1
  197. package/dist/utils/file-permissions.js +1 -1
  198. package/dist/utils/file-reader.js +1 -1
  199. package/dist/utils/github-releases.js +1 -1
  200. package/dist/utils/global-cache.js +1 -1
  201. package/dist/utils/json-loader.js +1 -1
  202. package/dist/utils/local-cache.js +1 -1
  203. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  204. package/dist/utils/logger/formatters/index.js +1 -1
  205. package/dist/utils/logger/handlers/console-handler.js +1 -1
  206. package/dist/utils/logger/handlers/file-handler.js +1 -1
  207. package/dist/utils/logger/handlers/index.js +1 -1
  208. package/dist/utils/logger/handlers/null-handler.js +1 -1
  209. package/dist/utils/logger/index.js +1 -1
  210. package/dist/utils/logger/logger.js +1 -1
  211. package/dist/utils/logger/types.js +1 -1
  212. package/dist/utils/option-validation.js +1 -1
  213. package/dist/utils/process.js +1 -1
  214. package/dist/utils/prompt.js +1 -1
  215. package/dist/utils/spinner.js +1 -1
  216. package/dist/utils/sse-parser.js +1 -1
  217. package/dist/utils/string-utils.js +1 -1
  218. package/dist/utils/table-ref-parser.js +1 -1
  219. package/dist/utils/tdx-logger.js +1 -1
  220. package/dist/utils/version-check.js +1 -1
  221. package/package.json +30 -12
@@ -1 +1 @@
1
- const a54_0x1b534b=a54_0x1eec;(function(_0x52d8bf,_0x48f1e2){const _0x375ad3=a54_0x1eec,_0x1125f0=_0x52d8bf();while(!![]){try{const _0x536b2a=parseInt(_0x375ad3(0x19a))/0x1+-parseInt(_0x375ad3(0x20a))/0x2+parseInt(_0x375ad3(0x1b7))/0x3*(parseInt(_0x375ad3(0x242))/0x4)+parseInt(_0x375ad3(0x1af))/0x5*(-parseInt(_0x375ad3(0x17b))/0x6)+parseInt(_0x375ad3(0x18d))/0x7*(parseInt(_0x375ad3(0x1f5))/0x8)+-parseInt(_0x375ad3(0x1d4))/0x9*(parseInt(_0x375ad3(0x1b6))/0xa)+parseInt(_0x375ad3(0x24c))/0xb;if(_0x536b2a===_0x48f1e2)break;else _0x1125f0['push'](_0x1125f0['shift']());}catch(_0x2acf8a){_0x1125f0['push'](_0x1125f0['shift']());}}}(a54_0x2d23,0xdbfe1));import a54_0x371dc7 from'chalk';import{existsSync}from'fs';import a54_0x46b3f9 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x547977 from'prompts';function getAttemptStatusDisplay(_0xc1986e){const _0x4b8822=a54_0x1eec;if(!_0xc1986e)return{'icon':'⏳','text':''};const {done:_0x2c29d3,success:_0x24fa13,cancelRequested:_0x445c0f}=_0xc1986e;if(!_0x2c29d3)return _0x445c0f?{'icon':'🛑','text':a54_0x371dc7[_0x4b8822(0x27e)]('canceling')}:{'icon':'🔄','text':a54_0x371dc7[_0x4b8822(0x202)](_0x4b8822(0x104))};if(_0x24fa13)return{'icon':'✅','text':a54_0x371dc7[_0x4b8822(0x1cb)](_0x4b8822(0x1df))};return{'icon':'❌','text':a54_0x371dc7[_0x4b8822(0x16b)](_0x4b8822(0x289))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x1b534b(0x13d)](_0x55f71b,_0x5b7015,_0xe3d25c=0x0){const _0x26d85a=a54_0x1b534b;return _0x55f71b[_0xe3d25c]||_0x5b7015[_0x26d85a(0xf7)];}[a54_0x1b534b(0x28b)](_0x298ce4,_0x5a606f,_0xefaaa1=0x0){const _0x4eb149=a54_0x1b534b,_0x5117dc=this[_0x4eb149(0x13d)](_0x298ce4,_0x5a606f,_0xefaaa1);if(!_0x5117dc)return console['error'](a54_0x371dc7[_0x4eb149(0x16b)](_0x4eb149(0x1c8)),'Project\x20name\x20is\x20required'),console[_0x4eb149(0x289)](a54_0x371dc7[_0x4eb149(0x290)](_0x4eb149(0x26d))),null;return _0x5117dc;}['parseProjectWorkflowPattern'](_0xa96ba8,_0x33c876){const _0x31a461=a54_0x1b534b;if(_0xa96ba8[0x0]){const _0x46b7d6=_0xa96ba8[0x0][_0x31a461(0x1a4)]('.');if(_0x46b7d6['length']===0x1)return{'projectName':_0x46b7d6[0x0],'workflowName':undefined};else return _0x46b7d6['length']===0x2?{'projectName':_0x46b7d6[0x0],'workflowName':_0x46b7d6[0x1]}:(console[_0x31a461(0x289)](a54_0x371dc7[_0x31a461(0x16b)]('Error:'),_0x31a461(0x283)),null);}return{'projectName':_0x33c876['workflowProject'],'workflowName':undefined};}[a54_0x1b534b(0x221)](_0x44b314,_0x1d511f,_0x2665da=0x0){const _0x5b5fd3=a54_0x1b534b;if(_0x44b314[_0x2665da])return _0x44b314[_0x2665da];if(_0x1d511f[_0x5b5fd3(0xf7)]){const _0xe7c1a2=a54_0x46b3f9[_0x5b5fd3(0x133)](process['cwd'](),_0x5b5fd3(0x1ff),_0x1d511f[_0x5b5fd3(0xf7)]);if(existsSync(a54_0x46b3f9['join'](_0xe7c1a2,_0x5b5fd3(0x287))))return _0xe7c1a2;}return undefined;}async['showWorkflowConsoleUrl'](_0x2670c6,_0x214524,_0x1ccdca){const _0x5e6fde=a54_0x1b534b;try{const _0x5c4ac8=await _0x2670c6[_0x5e6fde(0x1ed)][_0x5e6fde(0x1ff)](_0x214524,{'limit':0x1});if(_0x5c4ac8[_0x5e6fde(0xfd)]>0x0){const _0x14973d=_0x5c4ac8[0x0]['id'],_0x41b51c=getWorkflowUrl(_0x1ccdca,_0x14973d);console[_0x5e6fde(0x289)]('\x20\x20Console:\x20'+a54_0x371dc7[_0x5e6fde(0x2a3)](_0x41b51c));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x26a);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x1e9);async[a54_0x1b534b(0x18a)](_0x1a1925){const _0x208dbe=a54_0x1b534b,{options:_0x11e932,args:_0xefb8c8,tdx:_0xccda3f}=_0x1a1925,_0x3cd725=_0xefb8c8[0x0],_0x39598f=_0x11e932[_0x208dbe(0x24b)];if(_0x39598f)return saveSessionContext({'workflow_project':undefined},_0x11e932[_0x208dbe(0x1a9)]),console[_0x208dbe(0x156)](a54_0x371dc7['green'](_0x208dbe(0x214))),0x0;if(!_0x3cd725)return console['error'](a54_0x371dc7[_0x208dbe(0x16b)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x208dbe(0x289)](a54_0x371dc7[_0x208dbe(0x290)](_0x208dbe(0x1c1))),console['error'](a54_0x371dc7[_0x208dbe(0x290)](_0x208dbe(0x105))),0x1;const _0x47b78a=await withSpinner(_0x208dbe(0x10e)+_0x3cd725+'\x27...',()=>_0xccda3f[_0x208dbe(0x1ed)][_0x208dbe(0x267)](_0x3cd725),{'verbose':_0x11e932[_0x208dbe(0x24a)]}),{name:_0x4765bc}=_0x47b78a['data'];return saveSessionContext({'workflow_project':_0x4765bc},_0x11e932[_0x208dbe(0x1a9)]),console[_0x208dbe(0x156)](a54_0x371dc7[_0x208dbe(0x1cb)](_0x208dbe(0x14f)+a54_0x371dc7[_0x208dbe(0x2a3)](_0x4765bc))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x1b534b(0x196)]='workflow:projects';[a54_0x1b534b(0x128)]='List\x20all\x20workflow\x20projects';async[a54_0x1b534b(0x18a)](_0x2fe697){const _0x1f9ac8=a54_0x1b534b,{options:_0x231edb,args:_0x1d6d94,tdx:_0x14d5af}=_0x2fe697,_0x25cf94=_0x1d6d94[0x0];_0x231edb[_0x1f9ac8(0x24a)]&&_0x25cf94&&console[_0x1f9ac8(0x289)]('Pattern:\x20'+_0x25cf94);const _0x1bc3ed=await withSpinner(_0x1f9ac8(0x147),()=>_0x14d5af[_0x1f9ac8(0x1ed)][_0x1f9ac8(0x1ef)](_0x25cf94,{'limit':_0x231edb['limit']}),{'verbose':_0x231edb['verbose']});let _0x131ae2=_0x1bc3ed['data'];_0x131ae2[_0x1f9ac8(0x136)]((_0x2d1458,_0x1c8bc0)=>_0x2d1458[_0x1f9ac8(0x196)][_0x1f9ac8(0x124)](_0x1c8bc0['name']));const _0xf28662=_0x231edb[_0x1f9ac8(0x12b)]||0x64,_0x4f7535=_0x131ae2['length']>=_0xf28662?a54_0x371dc7[_0x1f9ac8(0x290)](_0x1f9ac8(0x10a)):'';console[_0x1f9ac8(0x289)](_0x1f9ac8(0x27d)+_0x131ae2['length']+_0x1f9ac8(0x102)+(_0x131ae2[_0x1f9ac8(0xfd)]!==0x1?'s':'')+_0x4f7535);if(_0x231edb['format']===_0x1f9ac8(0x210)||_0x231edb[_0x1f9ac8(0x23a)]===_0x1f9ac8(0x118)||_0x231edb[_0x1f9ac8(0x23a)]===_0x1f9ac8(0x12c))await handleSDKOutput(_0x131ae2,_0x231edb);else{if(_0x131ae2[_0x1f9ac8(0xfd)]===0x0)_0x25cf94?console[_0x1f9ac8(0x156)]('No\x20projects\x20match\x20pattern:\x20'+_0x25cf94):console[_0x1f9ac8(0x156)]('No\x20workflow\x20projects\x20found');else{const _0x4571bb=_0x131ae2['map'](_0xf745e4=>{const _0x51698e=_0x1f9ac8,_0x2d2190=_0xf745e4[_0x51698e(0x27b)]?.['some'](_0x34b759=>_0x34b759['key']==='sys'),_0x2ad9c4=_0x2d2190?a54_0x371dc7[_0x51698e(0x290)]('\x20(system)'):'';return _0x51698e(0x174)+_0xf745e4[_0x51698e(0x196)]+_0x2ad9c4;});await writeOutput(_0x4571bb[_0x1f9ac8(0x133)]('\x0a'),_0x231edb[_0x1f9ac8(0x114)],_0x1f9ac8(0x154));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x297);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x27a);async[a54_0x1b534b(0x18a)](_0x532280){const _0x352141=a54_0x1b534b,{options:_0xa5a54,args:_0x2ce570,tdx:_0x180599}=_0x532280,_0x1e4029=this[_0x352141(0x13d)](_0x2ce570,_0xa5a54);_0xa5a54['verbose']&&_0x1e4029&&console['error'](_0x352141(0x1c4)+_0x1e4029);const _0x48b52b=await withSpinner(_0x352141(0x20e),()=>_0x180599[_0x352141(0x1ed)][_0x352141(0x1ff)](_0x1e4029,{'limit':_0xa5a54['limit']}),{'verbose':_0xa5a54['verbose']});let _0x14aed2=_0x48b52b['data'];_0x14aed2['sort']((_0x1dc49b,_0x4460b0)=>{const _0x3fe042=_0x352141,_0x5a82d4=_0x1dc49b['name']['localeCompare'](_0x4460b0[_0x3fe042(0x196)]);if(_0x5a82d4!==0x0)return _0x5a82d4;return(_0x1dc49b[_0x3fe042(0x13c)]?.[_0x3fe042(0x196)]||'')['localeCompare'](_0x4460b0['project']?.['name']||'');});const _0x23d0aa=_0xa5a54[_0x352141(0x12b)]||0x64,_0x5d2f9a=_0x14aed2[_0x352141(0xfd)]>=_0x23d0aa?a54_0x371dc7[_0x352141(0x290)](_0x352141(0x10a)):'';console[_0x352141(0x289)](_0x352141(0x27d)+_0x14aed2[_0x352141(0xfd)]+_0x352141(0x12e)+(_0x14aed2[_0x352141(0xfd)]!==0x1?'s':'')+_0x5d2f9a);if(_0xa5a54[_0x352141(0x23a)]===_0x352141(0x210)||_0xa5a54['format']===_0x352141(0x118)||_0xa5a54[_0x352141(0x23a)]===_0x352141(0x12c))await handleSDKOutput(_0x14aed2,_0xa5a54);else{if(_0x14aed2[_0x352141(0xfd)]===0x0)_0x1e4029?console['log'](_0x352141(0x220)+_0x1e4029):console[_0x352141(0x156)](_0x352141(0x1bc));else{const _0x330f50=_0xa5a54['site'],_0x51b34c=_0x14aed2[_0x352141(0x284)](_0x59d34b=>{const _0x2e1b89=_0x352141,_0x519f08=a54_0x371dc7[_0x2e1b89(0x290)]('#'+_0x59d34b['id']),_0x54ad60=hyperlink(_0x519f08,getWorkflowUrl(_0x330f50,_0x59d34b['id'])),_0x57485b=_0x59d34b[_0x2e1b89(0x13c)]?.[_0x2e1b89(0x196)]?a54_0x371dc7[_0x2e1b89(0x290)]('\x20('+_0x59d34b[_0x2e1b89(0x13c)][_0x2e1b89(0x196)]+')'):'';return _0x2e1b89(0x25e)+_0x54ad60+'\x20'+_0x59d34b[_0x2e1b89(0x196)]+_0x57485b;});await writeOutput(_0x51b34c['join']('\x0a'),_0xa5a54['output'],'list');}}return 0x0;}}function a54_0x2d23(){const _0xd09536=['param','toLocaleString','\x20secrets...','workflow:sessions','workflowProject','summary','min','✔\x20Deleted\x20project\x20','New\x20project\x20name:\x20','deleteSecret','length','Select\x20a\x20workflow\x20to\x20run','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','displayLine','\x20unchanged','\x20project','values','running','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Error:\x20Project\x20name\x20is\x20required','\x20\x20Session\x20context\x20set\x20to:\x20','basename','yes','\x20(use\x20--limit\x20to\x20show\x20more)','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','setSecrets','startTime','Resolving\x20project\x20\x27','Key\x20cannot\x20be\x20empty','find','Project\x20directory:\x20','Retrying\x20attempt...','\x0a✔\x20Already\x20up\x20to\x20date','output','workflow:push','Show\x20specific\x20attempt\x20details','\x20\x20Project:\x20','jsonl','fullName','Dry\x20run:\x20yes','end','Disable\x20a\x20workflow\x20schedule','Fetching\x20log\x20files...','\x20\x20Console:\x20','Getting\x20attempt\x20tasks...','includeSubtasks','.\x20Expected\x20format:\x20KEY=VALUE','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Listing\x20workflow\x20attempts...','localeCompare','run','...','getTime','description','taskName','Downloading\x20logs...','limit','table','\x22?\x20This\x20cannot\x20be\x20undone.','\x20workflow','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','renderSessionsTimeline','---\x20','stdout','join','enableSchedule','-\x20nothing\x20pushed','sort','size','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Params:\x20','Enable\x20a\x20workflow\x20schedule','List\x20workflow\x20execution\x20sessions','project','resolveProject','Getting\x20attempt\x20details...','✔\x20Project:\x20','buildTimelineData','Enabling\x20schedule\x20#','type','fromTask','(use\x20--limit\x20to\x20see\x20more)','Project:\x20','Analyzing\x20project...','Listing\x20workflow\x20projects...','trimEnd','existingProjectId','site','workflow:timeline','session_id','session:','\x27\x20from\x20project\x20\x27','✔\x20Workflow\x20project\x20set\x20to:\x20','workflow:attempt','No\x20sessions\x20found\x20in\x20project:\x20','Pushing\x20workflow\x20project...','From\x20task:\x20','list','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','log','List\x20workflow\x20attempts','Loading\x20session...','index','Attempt:\x20','Latest\x20session\x20has\x20no\x20attempt','Pull\x20workflow\x20project\x20to\x20local\x20folder','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x0aDry\x20run\x20-\x20no\x20files\x20written','getMonth','context','generateSessionTimelineRows','\x20\x20Changes:\x20','\x20\x20Session\x20ID:\x20','Analyzing\x20changes...','Listing\x20secrets...','Secrets\x20to\x20set:\x20','ICON_SPACING','Including\x20subtasks:\x20yes','💡\x20Tip:\x20Use\x20','GUTTER','red','floor','targetExists','logFiles','round','push','\x20enabled\x20(','message','\x20logs','📁\x20','Source\x20directory:\x20','No\x20workflow\x20sessions\x20found','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:pull','\x20from\x20session\x20','startedAt','18YBMZVY','includes','\x20session','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','retryAttemptName','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','max','MAX_LABEL_COUNT','unchanged','start','Source\x20project:\x20','preparePushProject','✔\x20Secret\x20\x27','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','⚠\x20Showing\x20first\x20','execute','autocomplete','workflow:run','124663eQTlKb','finishedAt','slice','MAX_POLL_ITERATIONS','\x20secrets\x20set\x20for\x20project\x20\x27','Project\x20name:\x20','✔\x20Project\x20updated','Deleting\x20project\x20','\x20modified','name','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','readFile','Reason:\x20','135821bXDnjC','pending','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','data','rows','delete',',\x20Workflow:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','applyPullProject','split','\x20\x20Location:\x20','state','projectName','No\x20sessions\x20with\x20timing\x20information','session','showWorkflowConsoleUrl','isTTY','\x0a✔\x20Attempt\x20complete','Downloading\x20project\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','1294395prRYHz','attemptId','padStart','group_error','Updating\x20','renderTimeline','isDirectory','1250xaMqIz','356121EXNRPg','trim','filesExtracted','pullProject','\x0aUpdate\x20existing\x20project\x20\x22','No\x20workflows\x20found','Setting\x20secret...','Writing\x20files...','columns','\x20-\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','Error:\x20Invalid\x20parameter\x20format:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Project\x20filter:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','planned','window','Error:','Filter:\x20project=','\x20deleted','green','msPerChar','attempt:','\x20schedule','✔\x20Downloaded\x20','set','→\x20New\x20project:\x20','No\x20attempts\x20found\x20in\x20project:\x20','all','19755LSkHNS','→\x20Project:\x20','Start\x20a\x20workflow\x20run','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x0aError:','Schedule\x20ID\x20is\x20required','listSchedules','kill','Session\x20not\x20found:\x20','status','navigateSessionsInteractive','success','workflow:clone','hasChanges','dryRun','unknown','key','params','Tip:\x20cd\x20to\x20workflows/','Filter:\x20','Warning:','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','skipValidation','Retrying\x20session...','follow','workflow','\x20\x20tdx\x20wf\x20use\x20<project>','projects','getFullYear','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','pollTimeline','disableSchedule','Pushing\x20project...','296EtoGSo','Killing\x20attempt...','createdAt','modified','white','✔\x20Showing\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','Revision:\x20','Loading\x20sessions...','workflow:delete','workflows','workflow:retry','\x20\x20Attempt\x20ID:\x20','blue','Show\x20tasks\x20for\x20an\x20attempt','lastAttempt','write','Target\x20directory:\x20','get','TASK_NAME_WIDTH','🔄\x20','1170674yeGkrC','repeat','✔\x20Schedule\x20#','text','Listing\x20workflows...','fill','json','\x0a⚠\x20Project\x20\x22','\x20new','\x20next:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','keys','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','cancelRequested','\x20\x20Source:\x20','resumeFrom','sessionTime','workflow:logs','sessionId','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','/app/workflows/','No\x20workflows\x20found\x20in\x20project:\x20','resolveProjectDir','path','tdx\x20wf\x20attempt\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x0aPush\x20these\x20changes?','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','No\x20log\x20content\x20found','stat','nextRunTime','✔\x20Pushed\x20','getDate','\x20tasks','executePushProject','select','(unknown)','\x0aPolling...\x20(','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflow:attempts','\x20disabled\x20(','\x20\x20Project\x20ID:\x20','sourceDir','\x22\x20already\x20exists\x20(ID:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Setting\x20','format','Using\x20attempt\x20','\x0aClone\x20\x22','No\x20log\x20files\x20found\x20for\x20this\x20attempt','workflow:kill','toLowerCase','toISOString','projectId','20wgIOJK','workflow:schedule:disable','workflow:tasks','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Cancelled','updatedAt','revision','substring','verbose','clear','12640639sbMygT','Retry\x20a\x20session\x20or\x20attempt','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','No\x20attempts\x20found\x20for:\x20','attempts','match','MAX_TASKS_DISPLAY','Validation:\x20skipped','relative','sourceProjectName','Listing\x20workflow\x20sessions...','renderSingleTimeline','/attempt/','fileSize','\x20\x20New\x20attempt\x20ID:\x20','title','✔\x20Pull\x20complete','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','📋\x20','durationMs','tasks','force','icon','Files\x20to\x20upload:\x20','targetDir','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','sessions','resolveProjectId','attempt','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','workflow:use','revision:\x20','No\x20sessions\x20found','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','getHours','No\x20workflow\x20tdx.json\x20found','\x22\x20with\x20new\x20revision?','total','ICON_WIDTH','Usage:\x20workflow:delete\x20<project-name-or-id>','Total:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','No\x20sessions\x20found\x20for:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','isArray','Task\x20name:\x20','List\x20workflows','metadata','startsWith','✔\x20Found\x20','yellow','\x20to\x20see\x20detailed\x20logs','deleted','\x20attempt','now','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','map','task','\x20(disabled)','tdx.json','\x20\x20Revision:\x20','error','resolve','requireProject','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Loading\x20workflows...','diff','newProjectName','dim','\x20sessions\x20','parse','disabledAt','Auto-selected\x20latest\x20session:\x20','Kill\x20a\x20running\x20attempt','\x20\x20Files\x20extracted:\x20','workflow:workflows','MAX_TIMELINE_WIDTH','workflow:schedules','fs/promises','MIN_TIMELINE_WIDTH','prepareCloneProject','parseProjectWorkflowPattern','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','changes','done','Output\x20directory:\x20','\x1b[1A\x1b[2K','cyan','Attempt\x20ID:\x20','listSecrets','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Parameters:\x20','Expected\x20format:\x20--param\x20key=value','executeCloneProject','canceling','Error:\x20Attempt\x20ID\x20is\x20required','/sessions/','includeRetried','\x22\x20to\x20new\x20project\x20\x22','LABEL_MIN_SPACING','filter','Listing\x20schedules...','duration','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','workflowName'];a54_0x2d23=function(){return _0xd09536;};return a54_0x2d23();}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0xf6);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x13b);async[a54_0x1b534b(0x18a)](_0x48bd52){const _0x33433a=a54_0x1b534b,{options:_0x406d80,args:_0x2bf66f,tdx:_0x3b5ad5}=_0x48bd52,_0x2e1b50=this[_0x33433a(0x29d)](_0x2bf66f,_0x406d80);if(!_0x2e1b50)return 0x1;const {projectName:_0x2ee20f,workflowName:_0x56bc80}=_0x2e1b50;if(_0x406d80[_0x33433a(0x24a)]){if(_0x2ee20f&&_0x56bc80)console[_0x33433a(0x289)](_0x33433a(0x1e7)+_0x2ee20f+'.'+_0x56bc80);else _0x2ee20f&&console['error']('Filter:\x20project='+_0x2ee20f);const _0x514430=_0x406d80[_0x33433a(0x1dd)];_0x514430&&console[_0x33433a(0x289)]('Status:\x20'+_0x514430);}let _0xa885bd=0x28;if(process[_0x33433a(0x132)][_0x33433a(0x1ab)]&&!_0x406d80[_0x33433a(0x114)]&&!_0x406d80[_0x33433a(0x23a)]){const _0x3b8261=process[_0x33433a(0x132)]['rows']||0x28;_0xa885bd=Math[_0x33433a(0x181)](0x14,Math[_0x33433a(0x16c)](_0x3b8261*0x2/0x3));}const _0x5aa56d=_0x406d80['limit']||_0xa885bd,_0x12e0ab=await withSpinner(_0x33433a(0x256),()=>_0x3b5ad5[_0x33433a(0x1ed)]['sessions']({'projectName':_0x2ee20f,'workflowName':_0x56bc80,'status':_0x406d80[_0x33433a(0x1dd)],'fromTime':_0x406d80['from'],'toTime':_0x406d80['to'],'limit':_0x5aa56d}),{'verbose':_0x406d80[_0x33433a(0x24a)]}),_0x5875c1=_0x12e0ab[_0x33433a(0x19d)];_0x5875c1[_0x33433a(0x136)]((_0x31f499,_0x7355fb)=>{const _0x42ea1e=_0x33433a,_0x4daac8=_0x31f499[_0x42ea1e(0x21b)]||'',_0x52626b=_0x7355fb[_0x42ea1e(0x21b)]||'';return _0x52626b[_0x42ea1e(0x124)](_0x4daac8);});_0x5875c1[_0x33433a(0xfd)]>=_0x5aa56d?console[_0x33433a(0x289)](_0x33433a(0x1fa)+_0x5875c1[_0x33433a(0xfd)]+_0x33433a(0x291)+a54_0x371dc7['dim'](_0x33433a(0x144))):console[_0x33433a(0x289)]('✔\x20Found\x20'+_0x5875c1['length']+_0x33433a(0x17d)+(_0x5875c1[_0x33433a(0xfd)]!==0x1?'s':''));if(_0x406d80[_0x33433a(0x23a)]===_0x33433a(0x210)||_0x406d80[_0x33433a(0x23a)]===_0x33433a(0x118)||_0x406d80['format']==='table')await handleSDKOutput(_0x5875c1,_0x406d80);else{if(!process['stdout'][_0x33433a(0x1ab)]||_0x406d80[_0x33433a(0x114)]){if(_0x5875c1[_0x33433a(0xfd)]===0x0){if(_0x2ee20f&&_0x56bc80)console[_0x33433a(0x156)]('No\x20sessions\x20found\x20for:\x20'+_0x2ee20f+'.'+_0x56bc80);else _0x2ee20f?console[_0x33433a(0x156)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2ee20f):console[_0x33433a(0x156)](_0x33433a(0x26c));}else{const _0x2daf6b=_0x406d80[_0x33433a(0x14a)],_0x318613=this[_0x33433a(0x130)](_0x5875c1,_0x2daf6b);_0x406d80[_0x33433a(0x114)]?await writeOutput(_0x318613,_0x406d80[_0x33433a(0x114)],_0x33433a(0x154)):console[_0x33433a(0x156)](_0x318613);}!_0x2ee20f&&(console[_0x33433a(0x289)](''),console['error'](a54_0x371dc7[_0x33433a(0x290)](_0x33433a(0x1d7))),console[_0x33433a(0x289)](a54_0x371dc7['dim'](_0x33433a(0x25d))+'or'+a54_0x371dc7[_0x33433a(0x290)](_0x33433a(0x1ee))));}else{if(_0x5875c1[_0x33433a(0xfd)]===0x0){if(_0x2ee20f&&_0x56bc80)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x2ee20f+'.'+_0x56bc80);else _0x2ee20f?console[_0x33433a(0x156)](_0x33433a(0x151)+_0x2ee20f):console['log'](_0x33433a(0x26c));}else await this[_0x33433a(0x1de)](_0x5875c1,_0x48bd52,_0x2ee20f);}}return 0x0;}[a54_0x1b534b(0x130)](_0x42fae0,_0x1af110){const _0x4f8ef6=a54_0x1b534b,_0x4ae9b7=[],_0x6fff9e=new Map();let _0xd937a2=Infinity,_0x322dd9=-Infinity;for(const _0x450f40 of _0x42fae0){if(_0x450f40[_0x4f8ef6(0x204)]?.[_0x4f8ef6(0x1f7)]){const _0x3c2a7b=new Date(_0x450f40[_0x4f8ef6(0x204)][_0x4f8ef6(0x1f7)])[_0x4f8ef6(0x127)](),_0x15c602=_0x450f40[_0x4f8ef6(0x204)][_0x4f8ef6(0x18e)]?new Date(_0x450f40[_0x4f8ef6(0x204)][_0x4f8ef6(0x18e)])[_0x4f8ef6(0x127)]():Date[_0x4f8ef6(0x282)](),_0x6319ac=_0x450f40['project']?.[_0x4f8ef6(0x196)]||_0x4f8ef6(0x22f);!_0x6fff9e['has'](_0x6319ac)&&_0x6fff9e[_0x4f8ef6(0x1d0)](_0x6319ac,[]),_0x6fff9e[_0x4f8ef6(0x207)](_0x6319ac)[_0x4f8ef6(0x170)]({'session':_0x450f40,'startTime':_0x3c2a7b,'endTime':_0x15c602,'duration':_0x15c602-_0x3c2a7b}),_0xd937a2=Math[_0x4f8ef6(0xf9)](_0xd937a2,_0x3c2a7b),_0x322dd9=Math[_0x4f8ef6(0x181)](_0x322dd9,_0x15c602);}}if(_0x6fff9e[_0x4f8ef6(0x137)]===0x0)return _0x4f8ef6(0x1a8);const _0x2d8245=process[_0x4f8ef6(0x132)][_0x4f8ef6(0x1bf)]||0x78,_0x19d16b=0x1e,_0x385979=0x32,_0x429db1=0x4,_0x112ba8=Math[_0x4f8ef6(0xf9)](_0x385979,Math[_0x4f8ef6(0x181)](_0x19d16b,Math[_0x4f8ef6(0x16c)](_0x2d8245*0.3))),_0x1462e9=_0x2d8245-_0x112ba8-TIMELINE_CONFIG[_0x4f8ef6(0x16a)]-0x3-_0x429db1,_0x4e16ce=_0x322dd9-_0xd937a2,_0x1d5680=_0x4e16ce/_0x112ba8,_0x102858=renderTimeAxis({'startTime':_0xd937a2,'endTime':_0x322dd9,'durationMs':_0x4e16ce,'msPerChar':_0x1d5680},_0x112ba8),_0x525bb6=[];for(const _0x4ac200 of _0x6fff9e[_0x4f8ef6(0x103)]()){_0x525bb6[_0x4f8ef6(0x170)](..._0x4ac200);}_0x525bb6[_0x4f8ef6(0x136)]((_0x3fa962,_0x341e5a)=>_0x341e5a['startTime']-_0x3fa962[_0x4f8ef6(0x10d)]);const _0x2c1dd2=new Date(_0xd937a2),_0x286d4e=formatDate(_0x2c1dd2),_0x28d533=_0x429db1+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x4f8ef6(0x167)]+_0x1462e9,_0x5f3ed9='\x20'[_0x4f8ef6(0x20b)](_0x28d533-_0x286d4e[_0x4f8ef6(0xfd)]),_0x438e94=_0x5f3ed9+a54_0x371dc7[_0x4f8ef6(0x290)](_0x286d4e)+'\x20'+_0x102858;_0x4ae9b7['push'](_0x438e94);const _0xa8147f=0x16;let _0x38a8b5=0x0;for(const _0x4a71d1 of _0x525bb6){const _0x267372=_0x4a71d1[_0x4f8ef6(0x1a9)][_0x4f8ef6(0x13c)]?.[_0x4f8ef6(0x196)]||'?',_0x532cd6=Math['min'](stringWidth(_0x267372),_0xa8147f);_0x38a8b5=Math[_0x4f8ef6(0x181)](_0x38a8b5,_0x532cd6);}for(const _0x24d27a of _0x525bb6){const {session:_0x178aa4,startTime:_0x34e145,endTime:_0x2855d0,duration:_0x1893b7}=_0x24d27a,_0x4ffcfd=_0x178aa4['project']?.['id'],_0x472974=_0x178aa4['id'],_0x3661ac=_0x178aa4['project']?.[_0x4f8ef6(0x196)]||'?',_0x474fec=_0x178aa4[_0x4f8ef6(0x1ed)]?.[_0x4f8ef6(0x196)]||'?';let _0x3ad554,_0x1a5e35;if(_0x178aa4[_0x4f8ef6(0x204)]){const _0x4bd2a3=_0x178aa4[_0x4f8ef6(0x204)];!_0x4bd2a3[_0x4f8ef6(0x2a0)]?(_0x3ad554=_0x4bd2a3['cancelRequested']?'🛑':'🔄',_0x1a5e35=_0x4bd2a3[_0x4f8ef6(0x218)]?a54_0x371dc7[_0x4f8ef6(0x27e)]:a54_0x371dc7[_0x4f8ef6(0x202)]):(_0x3ad554=_0x4bd2a3['success']?'✅':'❌',_0x1a5e35=_0x4bd2a3['success']?a54_0x371dc7[_0x4f8ef6(0x1cb)]:a54_0x371dc7[_0x4f8ef6(0x16b)]);}else _0x3ad554='⏳',_0x1a5e35=a54_0x371dc7['dim'];const _0x5b1162='#'+_0x472974,_0x47b189=_0x4ffcfd?hyperlink(_0x5b1162,getWorkflowSessionUrl(_0x1af110,_0x4ffcfd,_0x472974)):_0x5b1162;let _0x1aeaf0=_0x3661ac;stringWidth(_0x3661ac)>_0xa8147f&&(_0x1aeaf0=_0x3661ac[_0x4f8ef6(0x18f)](0x0,_0xa8147f-0x1)+'…');const _0x429443=a54_0x371dc7['dim'](_0x1aeaf0),_0x584f41=stringWidth(_0x1aeaf0),_0x698a65='\x20'['repeat'](_0x38a8b5-stringWidth(_0x1aeaf0)+0x2),_0x4c0887='('+formatElapsed(_0x1893b7)+')',_0x5b4899=stringWidth(_0x4c0887),_0x1bdbcd=stringWidth(_0x5b1162),_0x21de34=_0x1bdbcd+0x1+_0x584f41+_0x698a65[_0x4f8ef6(0xfd)],_0x39e555=_0x1462e9-_0x21de34-_0x5b4899-0x1-0x8;let _0x47d169=_0x474fec;stringWidth(_0x47d169)>_0x39e555&&(_0x47d169=_0x47d169[_0x4f8ef6(0x18f)](0x0,_0x39e555-0x1)+'…');const _0x23f90e=_0x47b189+'\x20'+_0x429443+_0x698a65+_0x47d169,_0x3cdec6=stringWidth(_0x23f90e),_0x3b4e4b=_0x1462e9-_0x3cdec6-_0x5b4899,_0xab9997=_0x23f90e+'\x20'[_0x4f8ef6(0x20b)](Math['max'](0x1,_0x3b4e4b))+a54_0x371dc7[_0x4f8ef6(0x290)](_0x4c0887),_0x4c1ff9=Math[_0x4f8ef6(0x16c)]((_0x34e145-_0xd937a2)/_0x1d5680),_0x224ba0=Math['floor']((_0x2855d0-_0xd937a2)/_0x1d5680),_0xf76343=Math[_0x4f8ef6(0x181)](_0x4c1ff9+0x1,_0x224ba0),_0x295ce2=new Array(_0x112ba8)[_0x4f8ef6(0x20f)]('\x20');for(let _0x4d084c=_0x4c1ff9;_0x4d084c<Math['min'](_0xf76343,_0x112ba8);_0x4d084c++){_0x295ce2[_0x4d084c]='─';}const _0x22d6fc=_0x295ce2[_0x4f8ef6(0x284)](_0x379217=>_0x379217==='\x20'?'\x20':_0x1a5e35(_0x379217))[_0x4f8ef6(0x133)]('');_0x4ae9b7[_0x4f8ef6(0x170)](_0x3ad554+'\x20'+_0xab9997+'│'+_0x22d6fc+'│');}return _0x4ae9b7['join']('\x0a');}async[a54_0x1b534b(0x1de)](_0x1060b5,_0x57616a,_0x1946fc){const _0x45fb03=a54_0x1b534b,{options:_0x298e99,tdx:_0x5e3b79}=_0x57616a,_0x459287=_0x298e99['site'],{timelineRows:_0x32adcb,timeAxisHeader:_0x14f687}=this['generateSessionTimelineRows'](_0x1060b5,_0x459287),_0x3f564d=_0x32adcb[_0x45fb03(0xee)](_0x3238b8=>_0x3238b8[_0x45fb03(0x1b0)]);if(_0x3f564d[_0x45fb03(0xfd)]===0x0){const _0x38024a=this[_0x45fb03(0x130)](_0x1060b5,_0x459287);console[_0x45fb03(0x156)](_0x38024a);!_0x1946fc&&(console[_0x45fb03(0x289)](''),console[_0x45fb03(0x289)](a54_0x371dc7['dim'](_0x45fb03(0x1d7))),console[_0x45fb03(0x289)](a54_0x371dc7['dim'](_0x45fb03(0x25d))+'or'+a54_0x371dc7[_0x45fb03(0x290)](_0x45fb03(0x1ee))));return;}_0x14f687&&console[_0x45fb03(0x156)](_0x14f687);const _0x32f373=_0x32adcb[_0x45fb03(0xee)](_0x19ba75=>_0x19ba75['attemptId'])['map'](_0x218f0f=>({'title':_0x218f0f[_0x45fb03(0x100)],'value':_0x218f0f['attemptId']})),_0x111f8b=process[_0x45fb03(0x132)][_0x45fb03(0x19e)]||0x3c,_0x4a96e5=Math[_0x45fb03(0x181)](0x28,Math[_0x45fb03(0x16c)](_0x111f8b*0x2/0x3)),_0x251710=await a54_0x547977({'type':_0x45fb03(0x18b),'name':_0x45fb03(0x1b0),'message':_0x45fb03(0x224),'choices':_0x32f373,'initial':-0x1,'limit':_0x4a96e5,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x366d67,_0x8ec23b)=>{const _0x4ec2f7=_0x45fb03;if(!_0x366d67)return Promise[_0x4ec2f7(0x28a)](_0x8ec23b);const _0x5eefe0=_0x8ec23b[_0x4ec2f7(0xee)](_0x80a430=>{const _0x476637=_0x4ec2f7,_0x3c24d9=_0x80a430;return _0x3c24d9[_0x476637(0x25b)]['toLowerCase']()[_0x476637(0x17c)](_0x366d67[_0x476637(0x23f)]());});return Promise[_0x4ec2f7(0x28a)](_0x5eefe0);}}),_0x18bf06=()=>{const _0x222761=_0x45fb03;process[_0x222761(0x132)][_0x222761(0x205)](_0x222761(0x2a2)),process[_0x222761(0x132)]['write'](_0x222761(0x2a2)),process['stdout'][_0x222761(0x205)](_0x222761(0x2a2));},_0x1f3af1=_0x251710&&_0x251710[_0x45fb03(0x1b0)]&&_0x251710[_0x45fb03(0x1b0)]!==null&&_0x251710[_0x45fb03(0x1b0)][_0x45fb03(0x1b8)]()!=='';if(!_0x1f3af1){_0x18bf06(),console[_0x45fb03(0x156)](a54_0x371dc7['dim']('Cancelled'));return;}_0x18bf06();const _0x453b33=_0x1060b5[_0x45fb03(0x110)](_0x157f6f=>_0x157f6f['lastAttempt']?.['id']===_0x251710[_0x45fb03(0x1b0)]);if(_0x453b33){const _0x373424=_0x453b33[_0x45fb03(0x13c)]?.[_0x45fb03(0x196)]||'?',_0x1972ce=_0x453b33[_0x45fb03(0x1ed)]?.[_0x45fb03(0x196)]||'?';console['log']('Project:\x20'+a54_0x371dc7[_0x45fb03(0x290)](_0x373424)+_0x45fb03(0x1a0)+a54_0x371dc7[_0x45fb03(0x290)](_0x1972ce));}const _0x142105=new WorkflowTimelineCommand();await _0x142105['execute']({'args':[],'options':{..._0x298e99,'attemptId':_0x251710[_0x45fb03(0x1b0)]},'tdx':_0x5e3b79});}[a54_0x1b534b(0x161)](_0x59f35b,_0x63f4b3){const _0x19709f=a54_0x1b534b,_0x35b0c4=new Map();for(const _0x1f86b9 of _0x59f35b){_0x1f86b9['id']&&_0x1f86b9[_0x19709f(0x204)]?.['id']&&_0x35b0c4[_0x19709f(0x1d0)](_0x1f86b9['id'],_0x1f86b9[_0x19709f(0x204)]['id']);}const _0x3700b9=[];let _0x17a0a4='';const _0x2c5414=this[_0x19709f(0x130)](_0x59f35b,_0x63f4b3),_0x2f1b65=_0x2c5414[_0x19709f(0x1a4)]('\x0a');for(const _0x1dfa77 of _0x2f1b65){if(_0x1dfa77['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x1dfa77[_0x19709f(0x251)](/^\s+\d{4}-\d{2}-\d{2}/))_0x17a0a4=_0x1dfa77;else{if(_0x1dfa77['match'](/^[✅❌🔄🛑⏳]/)){const _0x5a4889=_0x1dfa77[_0x19709f(0x251)](/#(\d+)/),_0x1d2cae=_0x5a4889?_0x5a4889[0x1]:null,_0x31dbf4=_0x1d2cae?_0x35b0c4[_0x19709f(0x207)](_0x1d2cae)||null:null,_0x38c47e=_0x59f35b[_0x19709f(0x110)](_0x4f2075=>_0x4f2075['id']===_0x1d2cae),_0x263b83=_0x38c47e?.['project']?.[_0x19709f(0x196)]||'';_0x3700b9[_0x19709f(0x170)]({'displayLine':_0x1dfa77,'attemptId':_0x31dbf4,'projectName':_0x263b83});}}}return{'timelineRows':_0x3700b9,'timeAxisHeader':_0x17a0a4};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x232);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x157);async[a54_0x1b534b(0x18a)](_0x3d8726){const _0x4eb552=a54_0x1b534b,{options:_0x2407ac,args:_0xa58ea3,tdx:_0x37210b}=_0x3d8726,_0x4e527e=this[_0x4eb552(0x29d)](_0xa58ea3,_0x2407ac);if(!_0x4e527e)return 0x1;const {projectName:_0x5a3914,workflowName:_0x46eed1}=_0x4e527e,_0x1ac7a2=_0x2407ac[_0x4eb552(0xeb)];if(_0x2407ac[_0x4eb552(0x24a)]){if(_0x5a3914&&_0x46eed1)console[_0x4eb552(0x289)]('Filter:\x20'+_0x5a3914+'.'+_0x46eed1);else _0x5a3914&&console[_0x4eb552(0x289)](_0x4eb552(0x1c9)+_0x5a3914);_0x1ac7a2&&console[_0x4eb552(0x289)]('Include\x20retried:\x20yes');}const _0x488528=await withSpinner(_0x4eb552(0x123),()=>_0x37210b[_0x4eb552(0x1ed)][_0x4eb552(0x250)]({'projectName':_0x5a3914,'workflowName':_0x46eed1,'includeRetried':_0x1ac7a2,'limit':_0x2407ac[_0x4eb552(0x12b)]}),{'verbose':_0x2407ac[_0x4eb552(0x24a)]}),_0x20f3af=_0x488528['data'],_0xc77821=_0x2407ac[_0x4eb552(0x12b)]||0x64,_0x5ab0b1=_0x20f3af[_0x4eb552(0xfd)]>=_0xc77821?a54_0x371dc7['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x4eb552(0x289)](_0x4eb552(0x27d)+_0x20f3af[_0x4eb552(0xfd)]+_0x4eb552(0x281)+(_0x20f3af[_0x4eb552(0xfd)]!==0x1?'s':'')+_0x5ab0b1);if(_0x2407ac[_0x4eb552(0x23a)]===_0x4eb552(0x210)||_0x2407ac['format']==='jsonl'||_0x2407ac[_0x4eb552(0x23a)]==='table')await handleSDKOutput(_0x20f3af,_0x2407ac);else{if(_0x20f3af['length']===0x0){if(_0x5a3914&&_0x46eed1)console[_0x4eb552(0x156)](_0x4eb552(0x24f)+_0x5a3914+'.'+_0x46eed1);else _0x5a3914?console['log'](_0x4eb552(0x1d2)+_0x5a3914):console[_0x4eb552(0x156)]('No\x20attempts\x20found');}else{const _0x32860e=_0x2407ac[_0x4eb552(0x14a)],_0x33fcd4=_0x20f3af[_0x4eb552(0x284)](_0x2f3bcf=>{const _0x309bd8=_0x4eb552,_0x58657f=a54_0x371dc7['dim']('#'+_0x2f3bcf['id']),_0x2b9fa3=_0x2f3bcf[_0x309bd8(0x13c)]?.['id'],_0x3ffcac=_0x2f3bcf[_0x309bd8(0x14c)]||_0x2f3bcf[_0x309bd8(0x21d)],_0x5b9d32=_0x2b9fa3&&_0x3ffcac?hyperlink(_0x58657f,getWorkflowAttemptUrl(_0x32860e,_0x2b9fa3,_0x3ffcac,_0x2f3bcf['id'])):_0x58657f,{icon:_0x2d2a81,text:_0x44e79e}=getAttemptStatusDisplay(_0x2f3bcf),_0x3d4105=(_0x2f3bcf[_0x309bd8(0x13c)]?.['name']||'?')+'.'+(_0x2f3bcf['workflow']?.[_0x309bd8(0x196)]||'?'),_0x47e844=_0x2f3bcf[_0x309bd8(0x21b)]?a54_0x371dc7[_0x309bd8(0x290)](_0x2f3bcf[_0x309bd8(0x21b)]):'';return(_0x5b9d32+'\x20'+_0x2d2a81+(_0x44e79e?'\x20'+_0x44e79e:'')+'\x20'+_0x3d4105+'\x20'+_0x47e844)[_0x309bd8(0x148)]();});await writeOutput(_0x33fcd4['join']('\x0a'),_0x2407ac[_0x4eb552(0x114)],_0x4eb552(0x154));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x150);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x116);async[a54_0x1b534b(0x18a)](_0x536af5){const _0x93be39=a54_0x1b534b,{options:_0x4767ba,args:_0x162635,tdx:_0x35997b}=_0x536af5,_0x4518e4=_0x162635[0x0];if(!_0x4518e4)return console[_0x93be39(0x289)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x4767ba['verbose']&&console[_0x93be39(0x289)](_0x93be39(0x2a4)+_0x4518e4);const _0x27f80c=await withSpinner(_0x93be39(0x13e),()=>_0x35997b[_0x93be39(0x1ed)]['attempt'](_0x4518e4),{'verbose':_0x4767ba['verbose']}),_0x507597=_0x27f80c[_0x93be39(0x19d)];let _0x4d3726;!_0x507597[_0x93be39(0x2a0)]?_0x4d3726=_0x507597[_0x93be39(0x218)]?_0x93be39(0x2aa):_0x93be39(0x104):_0x4d3726=_0x507597[_0x93be39(0x1df)]?_0x93be39(0x1df):'error';let _0x2b4f37;if(_0x507597[_0x93be39(0x1f7)]&&_0x507597[_0x93be39(0x18e)]){const _0x298574=new Date(_0x507597[_0x93be39(0x1f7)])[_0x93be39(0x127)](),_0x8fd5ab=new Date(_0x507597[_0x93be39(0x18e)])[_0x93be39(0x127)]();_0x2b4f37=Math[_0x93be39(0x16f)]((_0x8fd5ab-_0x298574)/0x3e8);}const _0x456e83={'attempt_id':_0x507597['id'],'status':_0x4d3726,..._0x507597[_0x93be39(0x159)]!==undefined&&{'index':_0x507597[_0x93be39(0x159)]},..._0x507597[_0x93be39(0x13c)]&&{'project':_0x507597['project'][_0x93be39(0x196)]},..._0x507597[_0x93be39(0x1ed)]&&{'workflow':_0x507597['workflow'][_0x93be39(0x196)]},..._0x507597[_0x93be39(0x21d)]&&{'session_id':_0x507597[_0x93be39(0x21d)]},..._0x507597[_0x93be39(0x21b)]&&{'session_time':_0x507597[_0x93be39(0x21b)]},..._0x507597[_0x93be39(0x17f)]&&{'retry_attempt':_0x507597[_0x93be39(0x17f)]},..._0x2b4f37!==undefined&&{'duration_sec':_0x2b4f37},..._0x507597[_0x93be39(0x1f7)]&&{'created_at':_0x507597['createdAt']},..._0x507597[_0x93be39(0x18e)]&&{'finished_at':_0x507597[_0x93be39(0x18e)]},...Object['keys'](_0x507597[_0x93be39(0x1e5)])[_0x93be39(0xfd)]>0x0&&{'params':_0x507597[_0x93be39(0x1e5)]}};return await handleSingleObjectOutput(_0x456e83,_0x4767ba),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x244);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x203);async[a54_0x1b534b(0x18a)](_0x3969ec){const _0x356eb9=a54_0x1b534b,{options:_0x377746,args:_0x5a162a,tdx:_0x445b94}=_0x3969ec,_0x580781=_0x5a162a[0x0];if(!_0x580781)return console[_0x356eb9(0x289)](_0x356eb9(0x2ab)),0x1;const _0x2d150e=_0x377746[_0x356eb9(0x120)];_0x377746[_0x356eb9(0x24a)]&&(console[_0x356eb9(0x289)](_0x356eb9(0x2a4)+_0x580781),_0x2d150e&&console['error'](_0x356eb9(0x168)));const _0x330040=await withSpinner(_0x356eb9(0x11f),()=>_0x445b94[_0x356eb9(0x1ed)][_0x356eb9(0x260)](_0x580781,_0x2d150e||![]),{'verbose':_0x377746[_0x356eb9(0x24a)]}),_0x59ee8b=_0x330040[_0x356eb9(0x19d)];return console['error'](_0x356eb9(0x27d)+_0x59ee8b[_0x356eb9(0xfd)]+'\x20task'+(_0x59ee8b[_0x356eb9(0xfd)]!==0x1?'s':'')),await handleSDKOutput(_0x59ee8b,_0x377746),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a54_0x1b534b(0x21c);[a54_0x1b534b(0x128)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a54_0x1b534b(0x18a)](_0x51c3ed){const _0x5d1bdc=a54_0x1b534b,{options:_0x4a156f,args:_0x4ef064,tdx:_0xc9f51d}=_0x51c3ed,_0x4ec788=_0x4ef064[0x0];let _0x4eb7f6=_0x4ef064[0x1];if(!_0x4ec788)return console[_0x5d1bdc(0x289)](_0x5d1bdc(0x2ab)),0x1;_0x4a156f['verbose']&&(console[_0x5d1bdc(0x289)](_0x5d1bdc(0x2a4)+_0x4ec788),_0x4eb7f6&&console['error'](_0x5d1bdc(0x279)+_0x4eb7f6));const _0x40e601=await withSpinner(_0x5d1bdc(0x11d),()=>_0xc9f51d[_0x5d1bdc(0x1ed)][_0x5d1bdc(0x16e)](_0x4ec788,_0x4eb7f6),{'verbose':_0x4a156f['verbose']}),_0x2ee1d5=_0x40e601[_0x5d1bdc(0x19d)];if(_0x2ee1d5[_0x5d1bdc(0xfd)]===0x0)return console[_0x5d1bdc(0x289)](_0x5d1bdc(0x23d)),0x0;if(!_0x4eb7f6&&(_0x4a156f[_0x5d1bdc(0x210)]||_0x4a156f[_0x5d1bdc(0x23a)]))return await handleSDKOutput(_0x2ee1d5,_0x4a156f),0x0;if(!_0x4eb7f6){const _0x4ff67e=_0x2ee1d5[_0x5d1bdc(0x284)](_0x15e0c9=>({'title':_0x15e0c9[_0x5d1bdc(0x129)]+'\x20('+formatBytes(_0x15e0c9[_0x5d1bdc(0x259)])+')','value':_0x15e0c9[_0x5d1bdc(0x129)]})),_0x5937a1=await a54_0x547977({'type':_0x5d1bdc(0x22e),'name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x4ff67e});if(!_0x5937a1[_0x5d1bdc(0x285)])return console[_0x5d1bdc(0x289)](_0x5d1bdc(0x246)),0x0;_0x4eb7f6=_0x5937a1[_0x5d1bdc(0x285)];}const _0x4e6a26=await withSpinner(_0x5d1bdc(0x12a),()=>_0xc9f51d[_0x5d1bdc(0x1ed)]['logs'](_0x4ec788,_0x4eb7f6),{'verbose':_0x4a156f[_0x5d1bdc(0x24a)]}),_0x4c67ce=_0x4e6a26['data'];return _0x4c67ce?console['log'](_0x4c67ce):console[_0x5d1bdc(0x289)](_0x5d1bdc(0x227)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x23e);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x295);async[a54_0x1b534b(0x18a)](_0x507298){const _0x3213ce=a54_0x1b534b,{options:_0x1dae83,args:_0x1c1cd6,tdx:_0x42d2b9}=_0x507298,_0x44f8b7=_0x1c1cd6[0x0];if(!_0x44f8b7)return console['error'](_0x3213ce(0x2ab)),0x1;const _0x7c57bc=_0x1dae83['reason'];_0x1dae83[_0x3213ce(0x24a)]&&(console[_0x3213ce(0x289)](_0x3213ce(0x2a4)+_0x44f8b7),_0x7c57bc&&console[_0x3213ce(0x289)](_0x3213ce(0x199)+_0x7c57bc));if(!_0x1dae83['yes']){if(!isInteractive())return console[_0x3213ce(0x289)](a54_0x371dc7['red'](_0x3213ce(0x1d8)),_0x3213ce(0x1c5)),console[_0x3213ce(0x289)](a54_0x371dc7[_0x3213ce(0x290)](_0x3213ce(0x138))),0x1;const _0x4f73fc=await confirmKey(_0x3213ce(0x238)+_0x44f8b7+'?');if(!_0x4f73fc)return console['error'](a54_0x371dc7[_0x3213ce(0x27e)](_0x3213ce(0x246))),0x1;}const _0x2bb434=await withSpinner(_0x3213ce(0x1f6),()=>_0x42d2b9[_0x3213ce(0x1ed)][_0x3213ce(0x1db)](_0x44f8b7,_0x7c57bc),{'verbose':_0x1dae83[_0x3213ce(0x24a)]}),_0x8662d8=_0x2bb434[_0x3213ce(0x19d)];return console[_0x3213ce(0x289)]('✔\x20'+_0x8662d8),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x200);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x24d);async[a54_0x1b534b(0x18a)](_0x26c728){const _0x28a724=a54_0x1b534b,{options:_0x4bab63,args:_0x51fceb,tdx:_0x41348d}=_0x26c728,_0x95ef06=_0x51fceb[0x0];if(!_0x95ef06)return console[_0x28a724(0x289)](_0x28a724(0x17e)),console['error'](_0x28a724(0x237)),0x1;let _0x1853dc=![],_0x55f5a1=_0x95ef06;if(_0x95ef06['startsWith'](_0x28a724(0x14d)))_0x1853dc=!![],_0x55f5a1=_0x95ef06[_0x28a724(0x249)](0x8);else{if(_0x95ef06[_0x28a724(0x27c)](_0x28a724(0x1cd)))_0x1853dc=![],_0x55f5a1=_0x95ef06['substring'](0x8);else return console[_0x28a724(0x289)](_0x28a724(0x265)),console[_0x28a724(0x289)](_0x28a724(0x237)),0x1;}const _0x6f21af=_0x4bab63[_0x28a724(0x143)],_0x224765=_0x4bab63[_0x28a724(0x21a)],_0x21a3c0=_0x4bab63['params'],_0x3dc465=_0x4bab63[_0x28a724(0x261)];_0x4bab63[_0x28a724(0x24a)]&&(console[_0x28a724(0x289)]('Target:\x20'+(_0x1853dc?'session':_0x28a724(0x268))+'\x20'+_0x55f5a1),_0x6f21af&&console['error'](_0x28a724(0x153)+_0x6f21af),_0x224765&&console[_0x28a724(0x289)]('Resume\x20from:\x20'+_0x224765),_0x21a3c0&&console[_0x28a724(0x289)](_0x28a724(0x139)+_0x21a3c0),_0x3dc465&&console[_0x28a724(0x289)]('Force:\x20yes'));let _0x5d69b4;if(_0x21a3c0)try{if(_0x21a3c0[_0x28a724(0x27c)]('@')){const _0x331639=await import(_0x28a724(0x29a)),_0x24f6e4=_0x21a3c0[_0x28a724(0x249)](0x1),_0x9b46d2=await _0x331639[_0x28a724(0x198)](_0x24f6e4,'utf-8');_0x5d69b4=JSON['parse'](_0x9b46d2);}else _0x5d69b4=JSON[_0x28a724(0x292)](_0x21a3c0);}catch{return console[_0x28a724(0x289)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4bab63[_0x28a724(0x109)]){if(!isInteractive())return console['error'](a54_0x371dc7[_0x28a724(0x16b)]('\x0aError:'),_0x28a724(0x1c5)),console[_0x28a724(0x289)](a54_0x371dc7['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x40d8dc=await confirmKey(_0x28a724(0x177)+(_0x1853dc?_0x28a724(0x1a9):_0x28a724(0x268))+'\x20'+_0x55f5a1+'?');if(!_0x40d8dc)return console[_0x28a724(0x289)](a54_0x371dc7['yellow']('Cancelled')),0x1;}let _0x1329d8;_0x1853dc?_0x1329d8=await withSpinner(_0x28a724(0x1eb),()=>_0x41348d[_0x28a724(0x1ed)]['retrySession'](_0x55f5a1,{'fromTask':_0x6f21af,'retryParams':_0x5d69b4}),{'verbose':_0x4bab63[_0x28a724(0x24a)]}):_0x1329d8=await withSpinner(_0x28a724(0x112),()=>_0x41348d[_0x28a724(0x1ed)]['retryAttempt'](_0x55f5a1,{'resumeFrom':_0x224765,'retryParams':_0x5d69b4,'force':_0x3dc465}),{'verbose':_0x4bab63['verbose']});const _0x38f42a=_0x1329d8[_0x28a724(0x19d)];return console[_0x28a724(0x289)]('✔\x20Retry\x20started'),console[_0x28a724(0x289)](_0x28a724(0x25a)+_0x38f42a[_0x28a724(0x1b0)]),console['error']('\x20\x20Session\x20ID:\x20'+_0x38f42a[_0x28a724(0x21d)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x18c);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x1d6);async[a54_0x1b534b(0x18a)](_0x208e0f){const _0x17c9ca=a54_0x1b534b,{options:_0x168ded,args:_0x12fe88,tdx:_0x1b2d65}=_0x208e0f;let _0x50735a=_0x12fe88[0x0];if(!_0x50735a){const _0x17ddc2=this[_0x17c9ca(0x13d)]([],_0x168ded),_0x4d4b7c=await withSpinner(_0x17c9ca(0x28d),()=>_0x1b2d65['workflow']['workflows'](_0x17ddc2,{'limit':_0x168ded[_0x17c9ca(0x12b)]}),{'verbose':_0x168ded['verbose']}),_0x287e74=_0x4d4b7c['data'];if(_0x287e74['length']===0x0)return console['error']('No\x20workflows\x20found'),!_0x17ddc2&&console[_0x17c9ca(0x289)](a54_0x371dc7[_0x17c9ca(0x290)](_0x17c9ca(0x26d))),0x1;const _0x30714e=_0x287e74[_0x17c9ca(0x284)](_0x5463ba=>({'title':_0x5463ba['project']?.[_0x17c9ca(0x196)]+'.'+_0x5463ba[_0x17c9ca(0x196)],'value':_0x5463ba[_0x17c9ca(0x13c)]?.['name']+'.'+_0x5463ba['name'],'description':_0x5463ba['revision']?_0x17c9ca(0x26b)+_0x5463ba[_0x17c9ca(0x248)]:undefined})),_0x4c42c8=await a54_0x547977({'type':_0x17c9ca(0x22e),'name':_0x17c9ca(0x1ed),'message':_0x17c9ca(0xfe),'choices':_0x30714e});if(!_0x4c42c8[_0x17c9ca(0x1ed)])return 0x1;_0x50735a=_0x4c42c8[_0x17c9ca(0x1ed)];}if(!_0x50735a[_0x17c9ca(0x17c)]('.')){const _0x29738c=this[_0x17c9ca(0x13d)]([],_0x168ded);if(_0x29738c)_0x50735a=_0x29738c+'.'+_0x50735a;else return console[_0x17c9ca(0x289)](a54_0x371dc7[_0x17c9ca(0x16b)](_0x17c9ca(0x1c8)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x17c9ca(0x289)](a54_0x371dc7[_0x17c9ca(0x290)](_0x17c9ca(0x26d))),0x1;}const _0x152d44=_0x168ded[_0x17c9ca(0xf3)],_0x568265=_0x168ded[_0x17c9ca(0x21b)],_0x261487={};if(_0x152d44&&Array[_0x17c9ca(0x278)](_0x152d44))for(const _0x112731 of _0x152d44){const _0x242696=_0x112731['indexOf']('=');if(_0x242696===-0x1)return console[_0x17c9ca(0x289)](_0x17c9ca(0x1c2)+_0x112731),console[_0x17c9ca(0x289)](_0x17c9ca(0x2a8)),0x1;const _0x49b892=_0x112731[_0x17c9ca(0x249)](0x0,_0x242696),_0x5ebf14=_0x112731[_0x17c9ca(0x249)](_0x242696+0x1);try{_0x261487[_0x49b892]=JSON[_0x17c9ca(0x292)](_0x5ebf14);}catch{_0x261487[_0x49b892]=_0x5ebf14;}}_0x168ded[_0x17c9ca(0x24a)]&&(console['error']('Workflow:\x20'+_0x50735a),Object['keys'](_0x261487)[_0x17c9ca(0xfd)]>0x0&&console['error'](_0x17c9ca(0x2a7)+JSON['stringify'](_0x261487)),_0x568265&&console[_0x17c9ca(0x289)]('Session\x20time:\x20'+_0x568265));const _0x1438e3=await withSpinner('Starting\x20workflow\x20run...',()=>_0x1b2d65['workflow'][_0x17c9ca(0x125)](_0x50735a,_0x261487,{'sessionTime':_0x568265}),{'verbose':_0x168ded[_0x17c9ca(0x24a)]}),_0x1477f4=_0x1438e3[_0x17c9ca(0x19d)];console[_0x17c9ca(0x289)]('✔\x20Workflow\x20run\x20started'),console[_0x17c9ca(0x289)](_0x17c9ca(0x201)+_0x1477f4['id']),console[_0x17c9ca(0x289)](_0x17c9ca(0x163)+_0x1477f4['sessionId']),console[_0x17c9ca(0x289)](_0x17c9ca(0x117)+_0x1477f4[_0x17c9ca(0x13c)]?.[_0x17c9ca(0x196)]),console['error']('\x20\x20Workflow:\x20'+_0x1477f4[_0x17c9ca(0x1ed)]?.[_0x17c9ca(0x196)]);if(_0x1477f4['project']?.['id']&&_0x1477f4[_0x17c9ca(0x21d)]&&_0x1477f4['id']){const _0x13cf05=_0x168ded[_0x17c9ca(0x14a)],_0x5b0320=getConsoleUrl(_0x13cf05,_0x17c9ca(0x21f)+_0x1477f4[_0x17c9ca(0x13c)]['id']+_0x17c9ca(0xea)+_0x1477f4[_0x17c9ca(0x21d)]+_0x17c9ca(0x258)+_0x1477f4['id']);console[_0x17c9ca(0x289)](_0x17c9ca(0x11e)+a54_0x371dc7[_0x17c9ca(0x2a3)](_0x5b0320));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x1b534b(0x196)]='workflow:download';[a54_0x1b534b(0x128)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x4090b1){const _0x3bd0bf=a54_0x1b534b,{options:_0x57012f,args:_0x27aa0b,tdx:_0x54f62b}=_0x4090b1,_0x77d04d=_0x27aa0b[0x0],_0x1c2a53=_0x27aa0b[0x1]||'.';if(!_0x77d04d)return console[_0x3bd0bf(0x289)](_0x3bd0bf(0x106)),console[_0x3bd0bf(0x289)](_0x3bd0bf(0x245)),0x1;const _0x491260=_0x57012f[_0x3bd0bf(0x248)];_0x57012f[_0x3bd0bf(0x24a)]&&(console[_0x3bd0bf(0x289)]('Project:\x20'+_0x77d04d),console['error'](_0x3bd0bf(0x2a1)+_0x1c2a53),_0x491260&&console[_0x3bd0bf(0x289)]('Revision:\x20'+_0x491260));const _0x265bb1=await withSpinner(_0x3bd0bf(0x1ad)+_0x77d04d+'...',()=>_0x54f62b[_0x3bd0bf(0x1ed)]['download'](_0x77d04d,_0x1c2a53,{'revision':_0x491260}),{'verbose':_0x57012f[_0x3bd0bf(0x24a)]}),_0x5e065a=_0x265bb1[_0x3bd0bf(0x19d)];return console[_0x3bd0bf(0x289)](_0x3bd0bf(0x1cf)+_0x5e065a[_0x3bd0bf(0x1a7)]),console['error'](_0x3bd0bf(0x288)+_0x5e065a[_0x3bd0bf(0x248)]),console[_0x3bd0bf(0x289)](_0x3bd0bf(0x296)+_0x5e065a[_0x3bd0bf(0x1b9)]),console[_0x3bd0bf(0x289)](_0x3bd0bf(0x1a5)+_0x1c2a53+'/'+_0x5e065a[_0x3bd0bf(0x1a7)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]='workflow:upload';[a54_0x1b534b(0x128)]=a54_0x1b534b(0x231);async[a54_0x1b534b(0x18a)](_0x456644){const _0x53f5fa=a54_0x1b534b,{options:_0x5a82c3,args:_0xc22463,tdx:_0x127886}=_0x456644;let _0x25259f='.',_0x5109a6=_0x5a82c3[_0x53f5fa(0x196)];if(_0xc22463[0x0]){const {promises:_0x52e672}=await import('fs');try{const _0x51eb49=await _0x52e672[_0x53f5fa(0x228)](_0xc22463[0x0]);if(_0x51eb49[_0x53f5fa(0x1b5)]())_0x25259f=_0xc22463[0x0];else return console[_0x53f5fa(0x289)]('Error:\x20'+_0xc22463[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x5109a6=_0xc22463[0x0],_0x25259f='.';}}const _0x3ccf89=_0x5a82c3[_0x53f5fa(0x248)],_0xada135=_0x5a82c3[_0x53f5fa(0x1ea)];_0x5a82c3['verbose']&&(console['error'](_0x53f5fa(0x111)+_0x25259f),_0x5109a6&&console[_0x53f5fa(0x289)](_0x53f5fa(0x192)+_0x5109a6),_0x3ccf89&&console[_0x53f5fa(0x289)](_0x53f5fa(0x1fc)+_0x3ccf89),_0xada135&&console[_0x53f5fa(0x289)]('Validation:\x20skipped'));const _0x56f66c=await withSpinner(_0x53f5fa(0x152),()=>_0x127886[_0x53f5fa(0x1ed)][_0x53f5fa(0x170)](_0x25259f,{'projectName':_0x5109a6,'revision':_0x3ccf89,'skipValidation':_0xada135}),{'verbose':_0x5a82c3[_0x53f5fa(0x24a)]}),_0x7f760b=_0x56f66c[_0x53f5fa(0x19d)];return console[_0x53f5fa(0x289)](_0x53f5fa(0x22a)+_0x7f760b['projectName']),console[_0x53f5fa(0x289)](_0x53f5fa(0x234)+_0x7f760b[_0x53f5fa(0x241)]),console[_0x53f5fa(0x289)]('\x20\x20Revision:\x20'+_0x7f760b[_0x53f5fa(0x248)]),await this[_0x53f5fa(0x1aa)](_0x127886,_0x7f760b[_0x53f5fa(0x1a7)],_0x5a82c3[_0x53f5fa(0x14a)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x178);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x15c);async[a54_0x1b534b(0x18a)](_0x726491){const _0x24ca11=a54_0x1b534b,{options:_0x1ca05d,args:_0x36230f,tdx:_0x5c182e}=_0x726491,_0x3816e7=_0x36230f[0x0],_0x32e29b=_0x36230f[0x1];if(!_0x3816e7)return console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x16b)](_0x24ca11(0x1c8)),'Project\x20name\x20is\x20required'),console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x290)](_0x24ca11(0x21e))),0x1;const _0x4f0216=_0x1ca05d[_0x24ca11(0x248)];_0x1ca05d[_0x24ca11(0x24a)]&&(console[_0x24ca11(0x289)](_0x24ca11(0x145)+_0x3816e7),_0x32e29b&&console[_0x24ca11(0x289)](_0x24ca11(0x206)+_0x32e29b),_0x4f0216&&console[_0x24ca11(0x289)]('Revision:\x20'+_0x4f0216),_0x1ca05d[_0x24ca11(0x1e2)]&&console[_0x24ca11(0x289)](_0x24ca11(0x11a)));const _0x38f65b=await withSpinner('Pulling\x20project\x20'+_0x3816e7+_0x24ca11(0x126),()=>_0x5c182e[_0x24ca11(0x1ed)][_0x24ca11(0x1ba)](_0x3816e7,{'targetDir':_0x32e29b,'revision':_0x4f0216}),{'verbose':_0x1ca05d[_0x24ca11(0x24a)]}),_0x22f923=_0x38f65b[_0x24ca11(0x19d)];_0x22f923['isNewProject']?console[_0x24ca11(0x289)](_0x24ca11(0x1d1)+_0x22f923[_0x24ca11(0x1a7)]):console[_0x24ca11(0x289)](_0x24ca11(0x1d5)+_0x22f923[_0x24ca11(0x1a7)]);console[_0x24ca11(0x289)](_0x24ca11(0x288)+_0x22f923['revision']),console[_0x24ca11(0x289)]('\x20\x20Target:\x20'+(a54_0x46b3f9[_0x24ca11(0x254)](process['cwd'](),_0x22f923['targetDir'])||'.')),console[_0x24ca11(0x289)](_0x24ca11(0x162)+a54_0x371dc7[_0x24ca11(0x1cb)]('+'+_0x22f923[_0x24ca11(0xf8)]['new']+_0x24ca11(0x212))+',\x20'+(a54_0x371dc7[_0x24ca11(0x27e)]('~'+_0x22f923['summary'][_0x24ca11(0x1f8)]+_0x24ca11(0x195))+',\x20')+(a54_0x371dc7[_0x24ca11(0x16b)]('-'+_0x22f923[_0x24ca11(0xf8)]['deleted']+_0x24ca11(0x1ca))+',\x20')+(''+a54_0x371dc7[_0x24ca11(0x290)](_0x22f923[_0x24ca11(0xf8)][_0x24ca11(0x183)]+_0x24ca11(0x101))));for(const _0x10cb46 of _0x22f923[_0x24ca11(0x29f)]){_0x10cb46[_0x24ca11(0x142)]===_0x24ca11(0x1f8)&&_0x10cb46['diff']&&(console[_0x24ca11(0x289)]('\x0a'+a54_0x371dc7[_0x24ca11(0x2a3)](_0x24ca11(0x131)+_0x10cb46[_0x24ca11(0x222)])),console[_0x24ca11(0x289)](_0x10cb46['diff']));}if(!_0x22f923['hasChanges'])return saveSessionContext({'workflow_project':_0x22f923[_0x24ca11(0x1a7)]},_0x1ca05d[_0x24ca11(0x1a9)]),console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x1cb)](_0x24ca11(0x113))),console[_0x24ca11(0x289)](a54_0x371dc7['dim'](_0x24ca11(0x107)+_0x22f923[_0x24ca11(0x1a7)])),0x0;if(_0x1ca05d[_0x24ca11(0x1e2)])return console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x27e)](_0x24ca11(0x15e))),0x0;if(!_0x1ca05d[_0x24ca11(0x109)]){if(!isInteractive())return console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x16b)]('\x0aError:'),_0x24ca11(0x1c5)),console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x290)](_0x24ca11(0x138))),0x1;const _0x13a639=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x13a639)return console[_0x24ca11(0x289)](a54_0x371dc7['yellow'](_0x24ca11(0x246)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x24ca11(0x1be),()=>_0x5c182e[_0x24ca11(0x1ed)][_0x24ca11(0x1a3)](_0x22f923,{'revision':_0x4f0216}),{'verbose':_0x1ca05d[_0x24ca11(0x24a)]}),saveSessionContext({'workflow_project':_0x22f923[_0x24ca11(0x1a7)]},_0x1ca05d[_0x24ca11(0x1a9)]),console['error'](a54_0x371dc7['green'](_0x24ca11(0x25c)));const _0xde0bb7=a54_0x46b3f9[_0x24ca11(0x254)](process['cwd'](),_0x22f923[_0x24ca11(0x264)])||'.';return console[_0x24ca11(0x289)](a54_0x371dc7[_0x24ca11(0x290)](_0x24ca11(0x1a5)+_0xde0bb7)),console['error'](a54_0x371dc7[_0x24ca11(0x290)](_0x24ca11(0x107)+_0x22f923[_0x24ca11(0x1a7)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x115);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x28c);async[a54_0x1b534b(0x18a)](_0x43dfbb){const _0x1eb6f=a54_0x1b534b,{options:_0x1eb2d2,args:_0x22b0b8,tdx:_0x53f74f}=_0x43dfbb,_0x5923ba=this[_0x1eb6f(0x221)](_0x22b0b8,_0x1eb2d2),_0x40f89d=_0x1eb2d2[_0x1eb6f(0x248)],_0x4af083=_0x1eb2d2['skipValidation'];_0x1eb2d2[_0x1eb6f(0x24a)]&&(_0x5923ba&&console[_0x1eb6f(0x289)](_0x1eb6f(0x175)+_0x5923ba),_0x40f89d&&console[_0x1eb6f(0x289)](_0x1eb6f(0x1fc)+_0x40f89d),_0x1eb2d2['dryRun']&&console[_0x1eb6f(0x289)](_0x1eb6f(0x11a)),_0x4af083&&console['error'](_0x1eb6f(0x253)));let _0x49301b;try{_0x49301b=await withSpinner(_0x1eb6f(0x164),()=>_0x53f74f[_0x1eb6f(0x1ed)][_0x1eb6f(0x186)]({'sourceDir':_0x5923ba,'revision':_0x40f89d,'skipValidation':_0x4af083}),{'verbose':_0x1eb2d2[_0x1eb6f(0x24a)]});}catch(_0x1c18c2){if(_0x1c18c2 instanceof Error&&_0x1c18c2[_0x1eb6f(0x172)][_0x1eb6f(0x17c)](_0x1eb6f(0x26f)))return console['error'](a54_0x371dc7[_0x1eb6f(0x16b)](_0x1eb6f(0x1c8)),_0x1eb6f(0x197)),_0x1eb2d2[_0x1eb6f(0xf7)]?console[_0x1eb6f(0x289)](a54_0x371dc7[_0x1eb6f(0x290)](_0x1eb6f(0x1e6)+_0x1eb2d2['workflowProject']+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x1eb2d2[_0x1eb6f(0xf7)]+'\x27')):console[_0x1eb6f(0x289)](a54_0x371dc7['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x1c18c2;}const _0xcbe483=_0x49301b[_0x1eb6f(0x19d)];console[_0x1eb6f(0x289)](_0x1eb6f(0x13f)+_0xcbe483[_0x1eb6f(0x1a7)]),console[_0x1eb6f(0x289)](_0x1eb6f(0x219)+_0xcbe483[_0x1eb6f(0x235)]),console[_0x1eb6f(0x289)](_0x1eb6f(0x288)+_0xcbe483['revision']),console[_0x1eb6f(0x289)](_0x1eb6f(0x162)+a54_0x371dc7[_0x1eb6f(0x1cb)]('+'+_0xcbe483['summary']['new']+'\x20new')+',\x20'+(a54_0x371dc7[_0x1eb6f(0x27e)]('~'+_0xcbe483[_0x1eb6f(0xf8)][_0x1eb6f(0x1f8)]+'\x20modified')+',\x20')+(a54_0x371dc7[_0x1eb6f(0x16b)]('-'+_0xcbe483['summary'][_0x1eb6f(0x280)]+'\x20deleted')+',\x20')+(''+a54_0x371dc7[_0x1eb6f(0x290)](_0xcbe483['summary'][_0x1eb6f(0x183)]+'\x20unchanged')));for(const _0xafe75d of _0xcbe483['changes']){_0xafe75d[_0x1eb6f(0x142)]===_0x1eb6f(0x1f8)&&_0xafe75d[_0x1eb6f(0x28e)]&&(console[_0x1eb6f(0x289)]('\x0a'+a54_0x371dc7[_0x1eb6f(0x2a3)](_0x1eb6f(0x131)+_0xafe75d['path'])),console[_0x1eb6f(0x289)](_0xafe75d[_0x1eb6f(0x28e)]));}if(!_0xcbe483[_0x1eb6f(0x1e1)])return console[_0x1eb6f(0x289)](a54_0x371dc7[_0x1eb6f(0x1cb)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x1eb6f(0x1aa)](_0x53f74f,_0xcbe483[_0x1eb6f(0x1a7)],_0x1eb2d2[_0x1eb6f(0x14a)]),0x0;if(_0x1eb2d2[_0x1eb6f(0x1e2)])return console[_0x1eb6f(0x289)](a54_0x371dc7['yellow'](_0x1eb6f(0x275))),0x0;if(!_0x1eb2d2[_0x1eb6f(0x109)]){if(!isInteractive())return console[_0x1eb6f(0x289)](a54_0x371dc7[_0x1eb6f(0x16b)](_0x1eb6f(0x1d8)),_0x1eb6f(0x1c5)),console[_0x1eb6f(0x289)](a54_0x371dc7['dim'](_0x1eb6f(0x138))),0x1;const _0x2ea676=await confirmKey(_0x1eb6f(0x225));if(!_0x2ea676)return console['error'](a54_0x371dc7[_0x1eb6f(0x27e)](_0x1eb6f(0x246)),_0x1eb6f(0x135)),0x1;}const _0x5d1453=await withSpinner(_0x1eb6f(0x1f4),()=>_0x53f74f[_0x1eb6f(0x1ed)][_0x1eb6f(0x22d)](_0xcbe483),{'verbose':_0x1eb2d2['verbose']}),_0xffd7fb=_0x5d1453[_0x1eb6f(0x19d)];return console[_0x1eb6f(0x289)](a54_0x371dc7[_0x1eb6f(0x1cb)]('✔\x20Push\x20complete')),console['error'](_0x1eb6f(0x234)+_0xffd7fb[_0x1eb6f(0x241)]),console[_0x1eb6f(0x289)]('\x20\x20Revision:\x20'+_0xffd7fb['revision']),await this['showWorkflowConsoleUrl'](_0x53f74f,_0xffd7fb[_0x1eb6f(0x1a7)],_0x1eb2d2[_0x1eb6f(0x14a)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x1e0);['description']=a54_0x1b534b(0x24e);async['execute'](_0x19090b){const _0xb33739=a54_0x1b534b,{options:_0x368191,args:_0x9b073e,tdx:_0x325622}=_0x19090b,_0x327cec=this[_0xb33739(0x221)](_0x9b073e,_0x368191),_0x3aae63=_0x368191[_0xb33739(0x196)],_0x261de8=_0x368191[_0xb33739(0x248)],_0x34e9ea=_0x368191['skipValidation'];if(!_0x327cec)return console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x16b)]('Error:'),'Source\x20directory\x20is\x20required'),console['error'](a54_0x371dc7[_0xb33739(0x290)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a54_0x371dc7[_0xb33739(0x290)](_0xb33739(0x19c))),0x1;if(!_0x3aae63)return console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x16b)]('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x290)](_0xb33739(0x29e))),0x1;_0x368191[_0xb33739(0x24a)]&&(console[_0xb33739(0x289)](_0xb33739(0x175)+_0x327cec),console[_0xb33739(0x289)](_0xb33739(0xfb)+_0x3aae63),_0x261de8&&console[_0xb33739(0x289)](_0xb33739(0x1fc)+_0x261de8),_0x368191[_0xb33739(0x1e2)]&&console[_0xb33739(0x289)](_0xb33739(0x11a)),_0x34e9ea&&console['error']('Validation:\x20skipped'));const _0x2ea8f7=await withSpinner(_0xb33739(0x146),()=>_0x325622[_0xb33739(0x1ed)][_0xb33739(0x29c)](_0x327cec,_0x3aae63,{'revision':_0x261de8,'skipValidation':_0x34e9ea}),{'verbose':_0x368191[_0xb33739(0x24a)]}),_0x3f5a06=_0x2ea8f7[_0xb33739(0x19d)];console[_0xb33739(0x289)]('Source:\x20'+_0x3f5a06[_0xb33739(0x235)]);_0x3f5a06[_0xb33739(0x255)]&&console[_0xb33739(0x289)](_0xb33739(0x185)+_0x3f5a06[_0xb33739(0x255)]);console[_0xb33739(0x289)](_0xb33739(0xfb)+_0x3f5a06[_0xb33739(0x28f)]),console[_0xb33739(0x289)](_0xb33739(0x1fc)+_0x3f5a06[_0xb33739(0x248)]),console[_0xb33739(0x289)](_0xb33739(0x263)+_0x3f5a06['fileCount']);_0x3f5a06[_0xb33739(0x16d)]&&(console['error'](a54_0x371dc7[_0xb33739(0x27e)](_0xb33739(0x211)+_0x3f5a06['newProjectName']+_0xb33739(0x236)+_0x3f5a06[_0xb33739(0x149)]+')')),console['error'](a54_0x371dc7[_0xb33739(0x27e)](_0xb33739(0x269))));if(_0x368191['dryRun'])return console['error'](a54_0x371dc7[_0xb33739(0x27e)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x368191[_0xb33739(0x109)]){if(!isInteractive())return console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x16b)]('\x0aError:'),_0xb33739(0x1c5)),console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x290)](_0xb33739(0x138))),0x1;const _0x545a55=_0x3f5a06[_0xb33739(0x255)]||a54_0x46b3f9[_0xb33739(0x108)](_0x327cec),_0x40a997=_0x3f5a06[_0xb33739(0x16d)]?_0xb33739(0x1bb)+_0x3aae63+_0xb33739(0x270):_0xb33739(0x23c)+_0x545a55+_0xb33739(0xec)+_0x3aae63+'\x22?',_0x57253d=await confirmKey(_0x40a997);if(!_0x57253d)return console[_0xb33739(0x289)](a54_0x371dc7[_0xb33739(0x27e)](_0xb33739(0x246))),0x1;}const _0x1bde30=await withSpinner(_0x3f5a06[_0xb33739(0x16d)]?_0xb33739(0x1b3)+_0x3aae63+_0xb33739(0x126):'Cloning\x20to\x20'+_0x3aae63+_0xb33739(0x126),()=>_0x325622['workflow'][_0xb33739(0x2a9)](_0x3f5a06),{'verbose':_0x368191[_0xb33739(0x24a)]}),_0x331c83=_0x1bde30[_0xb33739(0x19d)];return console['error'](a54_0x371dc7[_0xb33739(0x1cb)](_0x3f5a06['targetExists']?_0xb33739(0x193):'✔\x20Clone\x20complete')),console[_0xb33739(0x289)]('\x20\x20Project:\x20'+_0x331c83[_0xb33739(0x28f)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x331c83['newProjectId']),console[_0xb33739(0x289)](_0xb33739(0x288)+_0x331c83[_0xb33739(0x248)]),await this[_0xb33739(0x1aa)](_0x325622,_0x331c83[_0xb33739(0x28f)],_0x368191[_0xb33739(0x14a)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x1fe);[a54_0x1b534b(0x128)]=a54_0x1b534b(0x180);async[a54_0x1b534b(0x18a)](_0x4115a4){const _0x38211c=a54_0x1b534b,{options:_0x30056e,args:_0x32e420,tdx:_0x2cf559}=_0x4115a4,_0x2afd3d=_0x32e420[0x0];if(!_0x2afd3d)return console[_0x38211c(0x289)](_0x38211c(0x10b)),console[_0x38211c(0x289)](_0x38211c(0x273)),0x1;_0x30056e[_0x38211c(0x24a)]&&console[_0x38211c(0x289)](_0x38211c(0x145)+_0x2afd3d);if(!_0x30056e[_0x38211c(0x109)]){if(!isInteractive())return console[_0x38211c(0x289)](a54_0x371dc7[_0x38211c(0x16b)]('\x0aError:'),_0x38211c(0x1c5)),console[_0x38211c(0x289)](a54_0x371dc7[_0x38211c(0x290)](_0x38211c(0x138))),0x1;const _0x7164fa=await confirmKey(_0x38211c(0x1a2)+_0x2afd3d+_0x38211c(0x12d));if(!_0x7164fa)return console['error'](a54_0x371dc7[_0x38211c(0x27e)]('Cancelled')),0x1;}const _0x48a5fb=await withSpinner(_0x38211c(0x194)+_0x2afd3d+_0x38211c(0x126),()=>_0x2cf559['workflow'][_0x38211c(0x19f)](_0x2afd3d),{'verbose':_0x30056e[_0x38211c(0x24a)]}),_0x4ccd09=_0x48a5fb[_0x38211c(0x19d)];return console[_0x38211c(0x289)](_0x38211c(0xfa)+_0x4ccd09[_0x38211c(0x1a7)]),console[_0x38211c(0x289)]('\x20\x20Project\x20ID:\x20'+_0x4ccd09[_0x38211c(0x241)]),0x0;}}export function parseKeyValue(_0x5e2e5b){const _0x433501=a54_0x1b534b,_0x3171d2=_0x5e2e5b['indexOf']('=');if(_0x3171d2===-0x1)throw new Error('Invalid\x20format:\x20'+_0x5e2e5b+_0x433501(0x121));const _0x42ce5c=_0x5e2e5b[_0x433501(0x249)](0x0,_0x3171d2),_0x4ae5de=_0x5e2e5b[_0x433501(0x249)](_0x3171d2+0x1);if(!_0x42ce5c)throw new Error(_0x433501(0x10f));return{'key':_0x42ce5c,'value':_0x4ae5de};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]='workflow:secrets:list';[a54_0x1b534b(0x128)]=a54_0x1b534b(0x15d);async[a54_0x1b534b(0x18a)](_0xdfdd2c){const _0x419a3f=a54_0x1b534b,{options:_0x3d450a,args:_0x5abbe6,tdx:_0x3cace6}=_0xdfdd2c,_0x263b8f=this['requireProject'](_0x5abbe6,_0x3d450a);if(!_0x263b8f)return 0x1;_0x3d450a[_0x419a3f(0x24a)]&&console[_0x419a3f(0x289)](_0x419a3f(0x145)+_0x263b8f);const _0x537579=await withSpinner(_0x419a3f(0x165),()=>_0x3cace6[_0x419a3f(0x1ed)][_0x419a3f(0x2a5)](_0x263b8f),{'verbose':_0x3d450a['verbose']}),{secrets:_0x4dd03a}=_0x537579[_0x419a3f(0x19d)];return console[_0x419a3f(0x289)](_0x419a3f(0x27d)+_0x4dd03a['length']+'\x20secret'+(_0x4dd03a[_0x419a3f(0xfd)]!==0x1?'s':'')),await handleSDKOutput(_0x4dd03a,_0x3d450a),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]='workflow:secrets:set';[a54_0x1b534b(0x128)]=a54_0x1b534b(0x217);async[a54_0x1b534b(0x18a)](_0x5c4257){const _0x46e5af=a54_0x1b534b,{options:_0xd80eee,args:_0x37fc27,tdx:_0x1169f4}=_0x5c4257;let _0xce662e,_0x14c914;if(_0x37fc27[_0x46e5af(0xfd)]>=0x1&&!_0x37fc27[0x0][_0x46e5af(0x17c)]('='))_0xce662e=_0x37fc27[0x0],_0x14c914=_0x37fc27[_0x46e5af(0x18f)](0x1);else{if(_0x37fc27['length']>=0x1&&_0xd80eee[_0x46e5af(0xf7)])_0xce662e=_0xd80eee['workflowProject'],_0x14c914=_0x37fc27;else return _0x37fc27[_0x46e5af(0xfd)]>=0x1?(console[_0x46e5af(0x289)](_0x46e5af(0x106)),console[_0x46e5af(0x289)](_0x46e5af(0x26d)),0x1):(console[_0x46e5af(0x289)](_0x46e5af(0x188)),console[_0x46e5af(0x289)](_0x46e5af(0x1c3)),0x1);}if(_0x14c914[_0x46e5af(0xfd)]===0x0)return console[_0x46e5af(0x289)](_0x46e5af(0x188)),console[_0x46e5af(0x289)](_0x46e5af(0x1c3)),0x1;const _0x47c323={};try{for(const _0x4718d6 of _0x14c914){const {key:_0x346c5b,value:_0x4241f0}=parseKeyValue(_0x4718d6);_0x47c323[_0x346c5b]=_0x4241f0;}}catch(_0xe56b2a){return _0xe56b2a instanceof Error&&console['error'](a54_0x371dc7[_0x46e5af(0x16b)]('Error:'),_0xe56b2a[_0x46e5af(0x172)]),0x1;}const _0x4bae21=Object[_0x46e5af(0x215)](_0x47c323);_0xd80eee['verbose']&&(console[_0x46e5af(0x289)]('Project:\x20'+_0xce662e),console[_0x46e5af(0x289)](_0x46e5af(0x166)+_0x4bae21[_0x46e5af(0x133)](',\x20')));const _0xde51e2=await withSpinner(_0x4bae21['length']===0x1?_0x46e5af(0x1bd):_0x46e5af(0x239)+_0x4bae21['length']+_0x46e5af(0xf5),()=>_0x1169f4['workflow'][_0x46e5af(0x10c)](_0xce662e,_0x47c323),{'verbose':_0xd80eee[_0x46e5af(0x24a)]}),_0x31490d=_0xde51e2['data'];return console[_0x46e5af(0x289)](_0x4bae21[_0x46e5af(0xfd)]===0x1?_0x46e5af(0x187)+_0x31490d['keys'][0x0]+_0x46e5af(0xf1)+_0x31490d['projectName']+'\x27':'✔\x20'+_0x31490d[_0x46e5af(0x215)][_0x46e5af(0xfd)]+_0x46e5af(0x191)+_0x31490d[_0x46e5af(0x1a7)]+'\x27'),(_0xd80eee['json']||_0xd80eee[_0x46e5af(0x118)])&&await handleSingleObjectOutput(_0x31490d,_0xd80eee),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']='workflow:secrets:delete';[a54_0x1b534b(0x128)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a54_0x1b534b(0x18a)](_0x512b60){const _0x464fc6=a54_0x1b534b,{options:_0x4d8617,args:_0x3c20ee,tdx:_0x44e00d}=_0x512b60;let _0x1e97ee,_0x4c5488;if(_0x3c20ee[_0x464fc6(0xfd)]>=0x2)_0x1e97ee=_0x3c20ee[0x0],_0x4c5488=_0x3c20ee[0x1];else{if(_0x3c20ee[_0x464fc6(0xfd)]===0x1&&_0x4d8617[_0x464fc6(0xf7)])_0x1e97ee=_0x4d8617[_0x464fc6(0xf7)],_0x4c5488=_0x3c20ee[0x0];else return _0x3c20ee[_0x464fc6(0xfd)]===0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x464fc6(0x289)](_0x464fc6(0x26d)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x464fc6(0x1f1)),0x1);}_0x4d8617[_0x464fc6(0x24a)]&&(console[_0x464fc6(0x289)](_0x464fc6(0x145)+_0x1e97ee),console['error']('Key:\x20'+_0x4c5488));if(!_0x4d8617[_0x464fc6(0x109)]){if(!isInteractive())return console[_0x464fc6(0x289)](a54_0x371dc7[_0x464fc6(0x16b)](_0x464fc6(0x1d8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x464fc6(0x289)](a54_0x371dc7['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c4cfc=await confirmKey(_0x464fc6(0x216)+_0x4c5488+_0x464fc6(0x14e)+_0x1e97ee+'\x27?');if(!_0x4c4cfc)return console[_0x464fc6(0x289)](a54_0x371dc7['yellow'](_0x464fc6(0x246))),0x1;}const _0x1699af=await withSpinner('Deleting\x20secret...',()=>_0x44e00d[_0x464fc6(0x1ed)][_0x464fc6(0xfc)](_0x1e97ee,_0x4c5488),{'verbose':_0x4d8617[_0x464fc6(0x24a)]}),_0x5863a1=_0x1699af['data'];return console[_0x464fc6(0x289)](_0x464fc6(0x187)+_0x5863a1[_0x464fc6(0x1e4)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x5863a1['projectName']+'\x27'),(_0x4d8617['json']||_0x4d8617[_0x464fc6(0x118)])&&await handleSingleObjectOutput(_0x5863a1,_0x4d8617),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(_0x4817cd){const _0x2f59fd=a54_0x1b534b,_0x56a4d8=Math['floor'](_0x4817cd/0x3e8),_0x3c4075=Math[_0x2f59fd(0x16c)](_0x56a4d8/0x3c),_0xef565a=Math[_0x2f59fd(0x16c)](_0x3c4075/0x3c),_0x597689=Math['floor'](_0xef565a/0x18);if(_0x597689>0x0){const _0x74e058=_0xef565a%0x18;return _0x74e058>0x0?_0x597689+'d\x20'+_0x74e058+'h':_0x597689+'d';}else{if(_0xef565a>0x0){const _0x5244bb=_0x3c4075%0x3c;return _0x5244bb>0x0?_0xef565a+'h\x20'+_0x5244bb+'m':_0xef565a+'h';}else{if(_0x3c4075>0x0){const _0x5eaad3=_0x56a4d8%0x3c;return _0x5eaad3>0x0?_0x3c4075+'m\x20'+_0x5eaad3+'s':_0x3c4075+'m';}else return _0x56a4d8+'s';}}}function formatTimestamp(_0x10d63f,_0x2adcc7){const _0x58b939=a54_0x1b534b,_0x33eead=new Date(_0x10d63f),_0x338629=String(_0x33eead[_0x58b939(0x26e)]())[_0x58b939(0x1b1)](0x2,'0'),_0x5c6072=String(_0x33eead['getMinutes']())[_0x58b939(0x1b1)](0x2,'0'),_0x5e2288=_0x338629+':'+_0x5c6072,_0x2022fe=_0x33eead['getFullYear']()===_0x2adcc7[_0x58b939(0x1f0)]()&&_0x33eead[_0x58b939(0x15f)]()===_0x2adcc7[_0x58b939(0x15f)]()&&_0x33eead['getDate']()===_0x2adcc7[_0x58b939(0x22b)]();if(_0x2022fe)return _0x5e2288;else{const _0x9603f8=String(_0x33eead[_0x58b939(0x15f)]()+0x1)[_0x58b939(0x1b1)](0x2,'0'),_0x3f2eea=String(_0x33eead[_0x58b939(0x22b)]())['padStart'](0x2,'0');return _0x9603f8+'-'+_0x3f2eea+'\x20'+_0x5e2288;}}function formatDate(_0x49bbf1){const _0x20d0ae=a54_0x1b534b,_0x17d5a0=_0x49bbf1[_0x20d0ae(0x1f0)](),_0x1f8fdd=String(_0x49bbf1['getMonth']()+0x1)[_0x20d0ae(0x1b1)](0x2,'0'),_0x628387=String(_0x49bbf1[_0x20d0ae(0x22b)]())[_0x20d0ae(0x1b1)](0x2,'0');return _0x17d5a0+'-'+_0x1f8fdd+'-'+_0x628387;}function getTaskStateIcon(_0x1983f3){const _0x10a2e9={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x10a2e9[_0x1983f3]||'⚪';}function getBarChar(_0x4641e8){const _0x2ee9e2=a54_0x1b534b;return _0x4641e8===_0x2ee9e2(0x289)||_0x4641e8===_0x2ee9e2(0x1b2)?'×':'─';}function getBarColor(_0x5a3658){const _0x40ca4f=a54_0x1b534b,_0x1e0ab5={'success':a54_0x371dc7['green'],'error':a54_0x371dc7[_0x40ca4f(0x16b)],'group_error':a54_0x371dc7['red'],'running':a54_0x371dc7[_0x40ca4f(0x202)],'blocked':a54_0x371dc7[_0x40ca4f(0x27e)],'planned':a54_0x371dc7[_0x40ca4f(0x290)],'canceling':a54_0x371dc7[_0x40ca4f(0x27e)]};return _0x1e0ab5[_0x5a3658]||a54_0x371dc7[_0x40ca4f(0x1f9)];}function parseTaskName(_0x5ef1c4){const _0x5bf98d=a54_0x1b534b;let _0x22cc8e=_0x5ef1c4['replace'](/^\++/,'');const _0x3d2bb6=_0x22cc8e['split']('+'),_0xf6e28b=_0x3d2bb6['length']>0x1?_0x3d2bb6[_0x5bf98d(0xfd)]-0x2:0x0,_0x5ccae6=_0x3d2bb6[_0x3d2bb6[_0x5bf98d(0xfd)]-0x1]||_0x22cc8e;return{'level':_0xf6e28b,'name':'+'+_0x5ccae6};}function truncateTaskName(_0x483434,_0x3747ce){const _0x44111d=a54_0x1b534b,_0x11796a=stringWidth(_0x483434);if(_0x11796a<=_0x3747ce)return _0x483434;let _0x428698=_0x483434;while(stringWidth(_0x428698+'…')>_0x3747ce&&_0x428698[_0x44111d(0xfd)]>0x0){_0x428698=_0x428698['slice'](0x0,-0x1);}return _0x428698+'…';}function a54_0x1eec(_0x259604,_0x25cfc2){_0x259604=_0x259604-0xea;const _0x2d23dd=a54_0x2d23();let _0x1eec4c=_0x2d23dd[_0x259604];return _0x1eec4c;}function calculateTimeScale(_0x29de71,_0x106e26){const _0x564b0d=a54_0x1b534b;return{'startTime':_0x29de71[_0x564b0d(0x184)],'endTime':_0x29de71[_0x564b0d(0x11b)],'durationMs':_0x29de71[_0x564b0d(0xf0)],'msPerChar':_0x29de71[_0x564b0d(0xf0)]/_0x106e26};}function timeToPosition(_0x14665b,_0xd158f4,_0x43bd8e){const _0x124710=a54_0x1b534b,_0x325010=_0x14665b-_0xd158f4[_0x124710(0x10d)],_0x597002=Math[_0x124710(0x16c)](_0x325010/_0xd158f4[_0x124710(0x1cc)]);return Math[_0x124710(0x181)](0x0,Math['min'](_0x597002,_0x43bd8e));}function renderTimeAxis(_0x8b00ba,_0x31e6a1){const _0x54e790=a54_0x1b534b,_0x2b98bc=Math[_0x54e790(0xf9)](TIMELINE_CONFIG[_0x54e790(0x182)],Math[_0x54e790(0x181)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x54e790(0x16c)](_0x31e6a1/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x5916ee=_0x8b00ba[_0x54e790(0x25f)]/(_0x2b98bc-0x1),_0x353d46=new Date(_0x8b00ba['startTime']),_0x58efba=[];for(let _0x44d854=0x0;_0x44d854<_0x2b98bc;_0x44d854++){const _0x193004=_0x8b00ba['startTime']+_0x44d854*_0x5916ee,_0x376acf=timeToPosition(_0x193004,_0x8b00ba,_0x31e6a1),_0x5aa1f1=formatTimestamp(_0x193004,_0x353d46);_0x58efba[_0x54e790(0x170)]({'pos':_0x376acf,'text':_0x5aa1f1});}const _0x50914e=new Array(_0x31e6a1)[_0x54e790(0x20f)]('\x20');let _0x32ec2f=-0x1;for(const {pos:_0xb6ad5d,text:_0x54561b}of _0x58efba){let _0x1dbcee=Math[_0x54e790(0x181)](0x0,_0xb6ad5d-Math['floor'](_0x54561b['length']/0x2));_0x1dbcee<=_0x32ec2f+TIMELINE_CONFIG[_0x54e790(0xed)]&&(_0x1dbcee=_0x32ec2f+TIMELINE_CONFIG[_0x54e790(0xed)]+0x1);_0x1dbcee+_0x54561b[_0x54e790(0xfd)]>_0x31e6a1&&(_0x1dbcee=_0x31e6a1-_0x54561b[_0x54e790(0xfd)]);if(_0x1dbcee>=0x0&&_0x1dbcee+_0x54561b[_0x54e790(0xfd)]<=_0x31e6a1&&_0x1dbcee>_0x32ec2f){for(let _0x150615=0x0;_0x150615<_0x54561b[_0x54e790(0xfd)];_0x150615++){_0x50914e[_0x1dbcee+_0x150615]=_0x54561b[_0x150615];}_0x32ec2f=_0x1dbcee+_0x54561b[_0x54e790(0xfd)]-0x1;}}return _0x50914e['join']('');}function renderTaskRow(_0x1887ef,_0x1f3aea,_0x2d6032,_0xc1a1a4){const _0x37251c=a54_0x1b534b,{level:_0x5ec66f,name:_0xe66b5b}=parseTaskName(_0x1887ef[_0x37251c(0x196)]),_0x29997b='\x20'['repeat'](_0x5ec66f),_0x15f2bb=_0x1887ef[_0x37251c(0x1c7)]?'('+formatElapsed(_0x1887ef[_0x37251c(0x1c7)][_0x37251c(0xf0)])+')':'',_0x211ee9=stringWidth(_0x15f2bb),_0x3a5350=_0x5ec66f*0x1,_0x582645=_0xc1a1a4-_0x3a5350-_0x211ee9-0x1,_0x3a7668=truncateTaskName(_0xe66b5b,_0x582645),_0x44cfe6=_0x29997b+_0x3a7668,_0x47f51f=stringWidth(_0x44cfe6),_0x55ab9c=_0xc1a1a4-_0x47f51f-_0x211ee9,_0x17c6d0=_0x44cfe6+'\x20'[_0x37251c(0x20b)](Math[_0x37251c(0x181)](0x1,_0x55ab9c))+a54_0x371dc7[_0x37251c(0x290)](_0x15f2bb),_0x43919e=getTaskStateIcon(_0x1887ef['state']),_0x3e4cd6=new Array(_0x2d6032)['fill']('\x20');if(_0x1887ef[_0x37251c(0x1c7)]){const _0x12d8c5=timeToPosition(_0x1887ef[_0x37251c(0x1c7)]['start'],_0x1f3aea,_0x2d6032),_0x141383=timeToPosition(_0x1887ef[_0x37251c(0x1c7)][_0x37251c(0x11b)],_0x1f3aea,_0x2d6032),_0x33e737=getBarChar(_0x1887ef[_0x37251c(0x1a6)]),_0x14d2a=Math[_0x37251c(0x181)](_0x12d8c5+0x1,_0x141383);for(let _0x4181df=_0x12d8c5;_0x4181df<Math['min'](_0x14d2a,_0x2d6032);_0x4181df++){_0x3e4cd6[_0x4181df]=_0x33e737;}}const _0x979b0c=getBarColor(_0x1887ef['state']),_0x39911c=_0x3e4cd6['map'](_0x5da0ac=>_0x5da0ac==='\x20'?'\x20':_0x979b0c(_0x5da0ac))['join']('');return _0x43919e+'\x20'+_0x17c6d0+'│'+_0x39911c+'│';}function calculateStats(_0x2e1810){const _0x4ce964=a54_0x1b534b,_0x522fe8={'total':_0x2e1810[_0x4ce964(0xfd)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4c9f82 of _0x2e1810){if(_0x4c9f82[_0x4ce964(0x1a6)]===_0x4ce964(0x1df))_0x522fe8[_0x4ce964(0x1df)]++;else{if(_0x4c9f82['state']===_0x4ce964(0x289)||_0x4c9f82[_0x4ce964(0x1a6)]===_0x4ce964(0x1b2))_0x522fe8[_0x4ce964(0x289)]++;else _0x4c9f82[_0x4ce964(0x1a6)]==='running'?_0x522fe8[_0x4ce964(0x104)]++:_0x522fe8['pending']++;}}return _0x522fe8;}function formatStats(_0x353af4){const _0x2e6762=a54_0x1b534b;return[_0x2e6762(0x274)+_0x353af4[_0x2e6762(0x271)],'✅\x20'+_0x353af4['success'],'❌\x20'+_0x353af4[_0x2e6762(0x289)],_0x2e6762(0x209)+_0x353af4[_0x2e6762(0x104)],'⏳\x20'+_0x353af4[_0x2e6762(0x19b)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x14b);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x1b534b(0x18a)](_0x1fdb69){const _0x1ec420=a54_0x1b534b,{options:_0x26c747,args:_0x43aabd,tdx:_0x26e11c}=_0x1fdb69;let _0x399713,_0x4c0889,_0x148dab=![];if(_0x43aabd[0x0]){if(_0x43aabd[0x0][_0x1ec420(0x17c)]('.')){const _0x261901=this[_0x1ec420(0x29d)](_0x43aabd,_0x26c747);if(!_0x261901)return 0x1;_0x399713=_0x261901[_0x1ec420(0x1a7)],_0x4c0889=_0x261901[_0x1ec420(0xf2)];}else{_0x4c0889=_0x43aabd[0x0],_0x399713=_0x26c747['workflowProject'];if(!_0x399713)return console[_0x1ec420(0x289)](a54_0x371dc7[_0x1ec420(0x16b)]('Error:'),_0x1ec420(0xff)),0x1;_0x148dab=!![];}}else{const _0x454c3=this['parseProjectWorkflowPattern'](_0x43aabd,_0x26c747);if(!_0x454c3)return 0x1;_0x399713=_0x454c3[_0x1ec420(0x1a7)],_0x4c0889=_0x454c3[_0x1ec420(0xf2)];}if(_0x26c747[_0x1ec420(0x24a)]){if(_0x399713&&_0x4c0889)console[_0x1ec420(0x289)](_0x1ec420(0x1e7)+_0x399713+'.'+_0x4c0889);else _0x399713&&console['error'](_0x1ec420(0x1c9)+_0x399713);}const _0x100361=_0x26c747['attemptId'],_0x4fc054=_0x26c747['sessionId'];if(_0x100361){_0x4fc054&&console[_0x1ec420(0x289)](a54_0x371dc7[_0x1ec420(0x27e)](_0x1ec420(0x1e8)),_0x1ec420(0x226));const _0x35f807=_0x26c747[_0x1ec420(0x1ec)];return _0x35f807?await this['pollTimeline'](_0x1fdb69,_0x100361):await this[_0x1ec420(0x257)](_0x1fdb69,_0x100361,_0x26c747),0x0;}if(_0x4fc054){const _0x34af6b=await withSpinner(_0x1ec420(0x158),()=>_0x26e11c[_0x1ec420(0x1ed)][_0x1ec420(0x266)]({'projectName':_0x399713,'workflowName':_0x4c0889,'limit':0x64}),{'verbose':_0x26c747[_0x1ec420(0x24a)]}),_0x498264=_0x34af6b['data']['find'](_0x2e632a=>_0x2e632a['id']===_0x4fc054);if(!_0x498264)return console['error'](a54_0x371dc7[_0x1ec420(0x16b)](_0x1ec420(0x1c8)),_0x1ec420(0x1dc)+_0x4fc054),0x1;if(!_0x498264[_0x1ec420(0x204)]?.['id'])return console[_0x1ec420(0x289)](a54_0x371dc7[_0x1ec420(0x16b)](_0x1ec420(0x1c8)),'Session\x20'+_0x4fc054+'\x20has\x20no\x20attempts'),0x1;const _0x8b5008=_0x498264['lastAttempt']['id'];_0x26c747[_0x1ec420(0x24a)]&&console[_0x1ec420(0x289)](_0x1ec420(0x23b)+_0x8b5008+_0x1ec420(0x179)+_0x4fc054);const _0x75a5b2=_0x26c747['follow'];return _0x75a5b2?await this['pollTimeline'](_0x1fdb69,_0x8b5008):await this[_0x1ec420(0x257)](_0x1fdb69,_0x8b5008,_0x26c747),0x0;}const _0x45cb53=await withSpinner(_0x1ec420(0x1fd),()=>_0x26e11c[_0x1ec420(0x1ed)][_0x1ec420(0x266)]({'projectName':_0x399713,'workflowName':_0x4c0889,'limit':_0x26c747[_0x1ec420(0x12b)]||0x32}),{'verbose':_0x26c747[_0x1ec420(0x24a)]}),_0x43feb2=_0x45cb53[_0x1ec420(0x19d)];if(_0x43feb2[_0x1ec420(0xfd)]===0x0){if(_0x399713&&_0x4c0889)console[_0x1ec420(0x289)](_0x1ec420(0x276)+_0x399713+'.'+_0x4c0889);else _0x399713?console[_0x1ec420(0x289)](_0x1ec420(0x151)+_0x399713):(console[_0x1ec420(0x289)](_0x1ec420(0x176)),console[_0x1ec420(0x289)](a54_0x371dc7['dim']('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x43feb2[_0x1ec420(0x136)]((_0x151f91,_0x3ba96d)=>{const _0x462255=_0x1ec420,_0x250494=_0x151f91['sessionTime']||'',_0x40a06f=_0x3ba96d['sessionTime']||'';return _0x40a06f[_0x462255(0x124)](_0x250494);});if(_0x26c747['json']||_0x26c747[_0x1ec420(0x118)])return await handleSDKOutput(_0x43feb2,_0x26c747),0x0;let _0x27d395;if(_0x148dab){const _0x40107e=_0x43feb2[0x0];if(!_0x40107e[_0x1ec420(0x204)]?.['id'])return console[_0x1ec420(0x289)](_0x1ec420(0x15b)),0x0;_0x27d395=_0x40107e['lastAttempt']['id'],_0x26c747['verbose']&&console[_0x1ec420(0x289)](_0x1ec420(0x294)+_0x40107e[_0x1ec420(0x21b)]);}else{const _0x1c186e=_0x43feb2['map'](_0x2a0336=>{const _0x472b4b=_0x1ec420,_0x14ea47=getAttemptStatusDisplay(_0x2a0336['lastAttempt']);return{'title':_0x2a0336['project']?.['name']+'.'+_0x2a0336[_0x472b4b(0x1ed)]?.[_0x472b4b(0x196)]+_0x472b4b(0x1c0)+_0x2a0336[_0x472b4b(0x21b)]+'\x20'+_0x14ea47[_0x472b4b(0x262)],'value':_0x2a0336[_0x472b4b(0x204)]?.['id']||'','description':_0x14ea47[_0x472b4b(0x20d)]};}),_0x1fe435=await a54_0x547977({'type':_0x1ec420(0x22e),'name':_0x1ec420(0x1b0),'message':_0x1ec420(0x1fb),'choices':_0x1c186e[_0x1ec420(0xee)](_0xd6ca75=>_0xd6ca75['value']!=='')});if(!_0x1fe435['attemptId'])return 0x0;_0x27d395=_0x1fe435['attemptId'];}const _0x5ec799=_0x26c747[_0x1ec420(0x1ec)];return _0x5ec799?await this[_0x1ec420(0x1f2)](_0x1fdb69,_0x27d395):await this['renderSingleTimeline'](_0x1fdb69,_0x27d395,_0x26c747),0x0;}async[a54_0x1b534b(0x257)](_0x5a210f,_0x480c33,_0x40422a){const _0x72ae80=a54_0x1b534b,{tdx:_0x9ac133}=_0x5a210f;let _0x15cddb,_0x2896c1;try{[_0x15cddb,_0x2896c1]=await Promise[_0x72ae80(0x1d3)]([_0x9ac133[_0x72ae80(0x1ed)][_0x72ae80(0x268)](_0x480c33),_0x9ac133['workflow'][_0x72ae80(0x260)](_0x480c33,![])]);}catch(_0x266c4a){console['error'](a54_0x371dc7[_0x72ae80(0x16b)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x40422a[_0x72ae80(0x24a)]&&console[_0x72ae80(0x289)](_0x266c4a);throw _0x266c4a;}if(_0x40422a[_0x72ae80(0x210)]||_0x40422a[_0x72ae80(0x118)]){const _0x3a667c=this[_0x72ae80(0x140)](_0x15cddb,_0x2896c1);await handleSDKOutput([_0x3a667c],_0x40422a);return;}const _0x425fb5=_0x9ac133['context'][_0x72ae80(0x14a)],_0x47d40a=this[_0x72ae80(0x1b4)](_0x15cddb,_0x2896c1,_0x425fb5);console[_0x72ae80(0x156)](_0x47d40a);}async['pollTimeline'](_0x552d57,_0x2bc16d){const _0x3b03f5=a54_0x1b534b,{tdx:_0x3c2751}=_0x552d57,_0x2c8534=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x28d76d=TIMELINE_CONFIG[_0x3b03f5(0x190)];let _0x34d4ae=0x0;while(_0x34d4ae<_0x28d76d){process[_0x3b03f5(0x132)][_0x3b03f5(0x1ab)]&&process[_0x3b03f5(0x132)]['write']('\x1bc');let _0x339cd2,_0x30e21a;try{[_0x339cd2,_0x30e21a]=await Promise[_0x3b03f5(0x1d3)]([_0x3c2751['workflow'][_0x3b03f5(0x268)](_0x2bc16d),_0x3c2751[_0x3b03f5(0x1ed)]['tasks'](_0x2bc16d,![])]);}catch(_0x400c88){console[_0x3b03f5(0x289)](a54_0x371dc7[_0x3b03f5(0x16b)](_0x3b03f5(0x277)));_0x34d4ae>0x0&&console['error'](a54_0x371dc7[_0x3b03f5(0x290)](_0x3b03f5(0x122)+_0x34d4ae));throw _0x400c88;}const _0x25c408=_0x3c2751[_0x3b03f5(0x160)][_0x3b03f5(0x14a)],_0x8538d0=this['renderTimeline'](_0x339cd2,_0x30e21a,_0x25c408);console[_0x3b03f5(0x156)](_0x8538d0);const _0x207d93=_0x339cd2['done']&&_0x30e21a['every'](_0x34ec63=>_0x34ec63[_0x3b03f5(0x1a6)]!=='running'&&_0x34ec63['state']!==_0x3b03f5(0x1c6));if(_0x207d93){console['error'](a54_0x371dc7[_0x3b03f5(0x1cb)](_0x3b03f5(0x1ac)));break;}console[_0x3b03f5(0x289)](a54_0x371dc7[_0x3b03f5(0x290)](_0x3b03f5(0x230)+_0x34d4ae*0x2+_0x3b03f5(0x1a1))),await new Promise(_0x59878d=>setTimeout(_0x59878d,_0x2c8534)),_0x34d4ae++;}_0x34d4ae>=_0x28d76d&&console[_0x3b03f5(0x289)](a54_0x371dc7[_0x3b03f5(0x27e)](_0x3b03f5(0x2a6)));}['renderTimeline'](_0x442bf2,_0x4eeeb0,_0x5f30c5){const _0x3bb9ff=a54_0x1b534b,_0xead01a=[],_0x828f63=TIMELINE_CONFIG[_0x3bb9ff(0x208)],_0x5284b6=0x5,_0x3e0fa5=process[_0x3bb9ff(0x132)][_0x3bb9ff(0x1bf)]||0x78,_0x33212e=_0x3e0fa5-_0x828f63-_0x5284b6,_0x2e08ba=Math[_0x3bb9ff(0x181)](TIMELINE_CONFIG[_0x3bb9ff(0x29b)],Math[_0x3bb9ff(0xf9)](_0x33212e,TIMELINE_CONFIG[_0x3bb9ff(0x298)])),_0x25a55a=new Date(_0x442bf2[_0x3bb9ff(0x1f7)])[_0x3bb9ff(0x127)](),_0x26c947=_0x442bf2[_0x3bb9ff(0x18e)]?new Date(_0x442bf2[_0x3bb9ff(0x18e)])['getTime']():Date['now'](),_0x4ed2d9={'start':_0x25a55a,'end':_0x26c947,'duration':_0x26c947-_0x25a55a},_0x1fddad=new Map(),_0x4eb06d=[];for(const _0x465b81 of _0x4eeeb0){if(_0x465b81[_0x3bb9ff(0x17a)]){const _0x5d63d1=new Date(_0x465b81['startedAt'])[_0x3bb9ff(0x127)](),_0x30e6c0=_0x465b81['updatedAt']?new Date(_0x465b81[_0x3bb9ff(0x247)])[_0x3bb9ff(0x127)]():Date[_0x3bb9ff(0x282)](),_0x59de7b={'start':_0x5d63d1,'end':_0x30e6c0,'duration':_0x30e6c0-_0x5d63d1};_0x1fddad[_0x3bb9ff(0x1d0)](_0x465b81['id'],_0x59de7b),_0x4eb06d[_0x3bb9ff(0x170)]({'name':_0x465b81[_0x3bb9ff(0x119)],'state':_0x465b81[_0x3bb9ff(0x1a6)]||'unknown','window':_0x59de7b});}else _0x4eb06d[_0x3bb9ff(0x170)]({'name':_0x465b81[_0x3bb9ff(0x119)],'state':_0x465b81['state']||_0x3bb9ff(0x1c6),'window':undefined});}_0x4eb06d[_0x3bb9ff(0x136)]((_0x52e140,_0x129b3d)=>{const _0xc5fe17=_0x3bb9ff;if(!_0x52e140[_0xc5fe17(0x1c7)])return 0x1;if(!_0x129b3d['window'])return-0x1;return _0x52e140[_0xc5fe17(0x1c7)]['start']-_0x129b3d['window']['start'];});const _0x59c7ee=_0x4eb06d[_0x3bb9ff(0xfd)],_0x5566c7=_0x59c7ee>TIMELINE_CONFIG[_0x3bb9ff(0x252)];_0x5566c7&&_0x4eb06d['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0xdfb55f=calculateTimeScale(_0x4ed2d9,_0x2e08ba),_0x2069fd=_0x442bf2['done']?_0x442bf2[_0x3bb9ff(0x1df)]?a54_0x371dc7[_0x3bb9ff(0x1cb)](_0x3bb9ff(0x1df)):a54_0x371dc7['red'](_0x3bb9ff(0x289)):a54_0x371dc7[_0x3bb9ff(0x202)](_0x3bb9ff(0x104)),_0x294fe7=_0x442bf2[_0x3bb9ff(0x13c)]?.['id'],_0x5872c0=_0x442bf2['sessionId'];let _0x38e8d1;if(_0x294fe7&&_0x5872c0){const _0x5bfafe=getWorkflowAttemptUrl(_0x5f30c5,_0x294fe7,_0x5872c0,_0x442bf2['id']);_0x38e8d1=hyperlink(a54_0x371dc7[_0x3bb9ff(0x290)](_0x442bf2['id']),_0x5bfafe);}else _0x38e8d1=a54_0x371dc7[_0x3bb9ff(0x290)](_0x442bf2['id']);_0xead01a[_0x3bb9ff(0x170)](_0x3bb9ff(0x15a)+_0x38e8d1+_0x3bb9ff(0x1c0)+_0x2069fd+_0x3bb9ff(0x1c0)+formatElapsed(_0x4ed2d9[_0x3bb9ff(0xf0)]));if(_0x4eb06d[_0x3bb9ff(0xfd)]>0x0){const _0x3d206c=renderTimeAxis(_0xdfb55f,_0x2e08ba),_0x2c8d51=new Date(_0x4ed2d9[_0x3bb9ff(0x184)]),_0x2b9899=formatDate(_0x2c8d51),_0x280379=TIMELINE_CONFIG[_0x3bb9ff(0x272)]+TIMELINE_CONFIG[_0x3bb9ff(0x167)]+_0x828f63,_0x1a2eb7=_0x2b9899[_0x3bb9ff(0x1b1)](_0x280379),_0x42cca5=a54_0x371dc7['dim'](_0x1a2eb7);_0xead01a['push'](_0x42cca5+'\x20'+_0x3d206c);for(const _0x45c561 of _0x4eb06d){_0xead01a['push'](renderTaskRow(_0x45c561,_0xdfb55f,_0x2e08ba,_0x828f63));}const _0x2b8fac=calculateStats(_0x4eb06d);_0xead01a['push'](formatStats(_0x2b8fac)),_0x5566c7&&_0xead01a[_0x3bb9ff(0x170)](a54_0x371dc7['yellow'](_0x3bb9ff(0x189)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+'\x20of\x20'+_0x59c7ee+_0x3bb9ff(0x22c))),_0xead01a['push'](''),_0xead01a[_0x3bb9ff(0x170)](a54_0x371dc7[_0x3bb9ff(0x290)](_0x3bb9ff(0x169))+(_0x3bb9ff(0x223)+_0x442bf2['id']+_0x3bb9ff(0x173))+a54_0x371dc7[_0x3bb9ff(0x290)](_0x3bb9ff(0x27f)));}else _0xead01a[_0x3bb9ff(0x170)](_0x3bb9ff(0x1ae));return _0xead01a[_0x3bb9ff(0x133)]('\x0a');}[a54_0x1b534b(0x140)](_0x42c304,_0x144574){const _0x5bd517=a54_0x1b534b,_0x1fb4b9=new Date(_0x42c304['createdAt'])[_0x5bd517(0x127)](),_0x1740d7=_0x42c304[_0x5bd517(0x18e)]?new Date(_0x42c304[_0x5bd517(0x18e)])[_0x5bd517(0x127)]():Date[_0x5bd517(0x282)](),_0x23ab30=_0x1740d7-_0x1fb4b9,_0x3a11f5=[];for(const _0x157ac3 of _0x144574){if(_0x157ac3['startedAt']){const _0x47a22d=new Date(_0x157ac3[_0x5bd517(0x17a)])[_0x5bd517(0x127)](),_0x5d3176=_0x157ac3['updatedAt']?new Date(_0x157ac3[_0x5bd517(0x247)])[_0x5bd517(0x127)]():Date[_0x5bd517(0x282)]();_0x3a11f5[_0x5bd517(0x170)]({'name':_0x157ac3[_0x5bd517(0x119)],'state':_0x157ac3['state']||'unknown','window':{'start':_0x47a22d,'end':_0x5d3176,'duration':_0x5d3176-_0x47a22d}});}else _0x3a11f5[_0x5bd517(0x170)]({'name':_0x157ac3[_0x5bd517(0x119)],'state':_0x157ac3[_0x5bd517(0x1a6)]||_0x5bd517(0x1c6),'window':undefined});}const _0x4fa85e=calculateStats(_0x3a11f5);return{'attempt':{'id':_0x42c304['id'],'status':_0x42c304[_0x5bd517(0x2a0)]?_0x42c304[_0x5bd517(0x1df)]?'success':_0x5bd517(0x289):_0x5bd517(0x104),'createdAt':_0x42c304[_0x5bd517(0x1f7)],'finishedAt':_0x42c304['finishedAt'],'duration_ms':_0x23ab30},'tasks':_0x3a11f5[_0x5bd517(0x284)](_0x209bf6=>({'name':_0x209bf6['name'],'state':_0x209bf6[_0x5bd517(0x1a6)],'startedAt':_0x209bf6[_0x5bd517(0x1c7)]?new Date(_0x209bf6[_0x5bd517(0x1c7)][_0x5bd517(0x184)])[_0x5bd517(0x240)]():null,'updatedAt':_0x209bf6['window']?new Date(_0x209bf6['window'][_0x5bd517(0x11b)])[_0x5bd517(0x240)]():null,'duration_ms':_0x209bf6[_0x5bd517(0x1c7)]?.[_0x5bd517(0xf0)]||null})),'stats':_0x4fa85e};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x1b534b(0x196)]=a54_0x1b534b(0x299);['description']='List\x20workflow\x20schedules';async['execute'](_0x59459e){const _0x517b1e=a54_0x1b534b,{options:_0x3aa74a,tdx:_0x504f78}=_0x59459e,_0x26b5a7=await withSpinner(_0x517b1e(0xef),()=>_0x504f78[_0x517b1e(0x1ed)][_0x517b1e(0x1da)](),{'verbose':_0x3aa74a[_0x517b1e(0x24a)]}),_0x7c67fc=_0x26b5a7['data'];console[_0x517b1e(0x289)](_0x517b1e(0x27d)+_0x7c67fc[_0x517b1e(0xfd)]+_0x517b1e(0x1ce)+(_0x7c67fc['length']!==0x1?'s':''));if(isStructuredFormat(_0x3aa74a))await handleSDKOutput(_0x7c67fc,_0x3aa74a);else{if(_0x7c67fc[_0x517b1e(0xfd)]===0x0)console[_0x517b1e(0x156)]('No\x20schedules\x20found');else for(const _0x4afdaa of _0x7c67fc){const _0x19f7e5=_0x4afdaa[_0x517b1e(0x293)]?a54_0x371dc7['yellow'](_0x517b1e(0x286)):'',_0xfbb29=_0x4afdaa['project']?.[_0x517b1e(0x196)]?a54_0x371dc7['dim']('\x20['+_0x4afdaa[_0x517b1e(0x13c)]['name']+']'):'',_0xb3a5f=_0x4afdaa['nextRunTime']?a54_0x371dc7[_0x517b1e(0x290)](_0x517b1e(0x213)+new Date(_0x4afdaa['nextRunTime'])[_0x517b1e(0xf4)]()):'';console['log']('📅\x20#'+_0x4afdaa['id']+'\x20'+(_0x4afdaa['workflow']?.[_0x517b1e(0x196)]||_0x517b1e(0x22f))+_0xfbb29+_0x19f7e5+_0xb3a5f);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x1b534b(0x196)]='workflow:schedule:enable';[a54_0x1b534b(0x128)]=a54_0x1b534b(0x13a);async[a54_0x1b534b(0x18a)](_0x170429){const _0x476cca=a54_0x1b534b,{options:_0x1ee34c,args:_0x4bcf78,tdx:_0x29ad5a}=_0x170429,_0x426b12=_0x4bcf78[0x0];if(!_0x426b12)return console[_0x476cca(0x289)](a54_0x371dc7[_0x476cca(0x16b)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x476cca(0x289)](a54_0x371dc7[_0x476cca(0x290)](_0x476cca(0x12f))),console[_0x476cca(0x289)](a54_0x371dc7[_0x476cca(0x290)](_0x476cca(0x155))),0x1;const _0x4841f2=await withSpinner(_0x476cca(0x141)+_0x426b12+_0x476cca(0x126),()=>_0x29ad5a[_0x476cca(0x1ed)][_0x476cca(0x134)](_0x426b12),{'verbose':_0x1ee34c[_0x476cca(0x24a)]}),_0x544ece=_0x4841f2['data'];return isStructuredFormat(_0x1ee34c)?await handleSingleObjectOutput(_0x544ece,_0x1ee34c):(console['log'](_0x476cca(0x20c)+_0x426b12+_0x476cca(0x171)+(_0x544ece['workflow']?.[_0x476cca(0x196)]||'unknown')+')'),_0x544ece[_0x476cca(0x229)]&&console[_0x476cca(0x156)](a54_0x371dc7['dim']('\x20\x20Next\x20run:\x20'+new Date(_0x544ece[_0x476cca(0x229)])['toLocaleString']()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']=a54_0x1b534b(0x243);['description']=a54_0x1b534b(0x11c);async[a54_0x1b534b(0x18a)](_0x53b9f3){const _0x5c2033=a54_0x1b534b,{options:_0x2d69ec,args:_0x5d998d,tdx:_0x31314c}=_0x53b9f3,_0x3b2459=_0x5d998d[0x0];if(!_0x3b2459)return console['error'](a54_0x371dc7[_0x5c2033(0x16b)](_0x5c2033(0x1c8)),_0x5c2033(0x1d9)),console[_0x5c2033(0x289)](a54_0x371dc7[_0x5c2033(0x290)]('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console[_0x5c2033(0x289)](a54_0x371dc7['dim']('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x3c3947=await withSpinner('Disabling\x20schedule\x20#'+_0x3b2459+_0x5c2033(0x126),()=>_0x31314c[_0x5c2033(0x1ed)][_0x5c2033(0x1f3)](_0x3b2459),{'verbose':_0x2d69ec[_0x5c2033(0x24a)]}),_0x8851a1=_0x3c3947[_0x5c2033(0x19d)];return isStructuredFormat(_0x2d69ec)?await handleSingleObjectOutput(_0x8851a1,_0x2d69ec):console['log'](_0x5c2033(0x20c)+_0x3b2459+_0x5c2033(0x233)+(_0x8851a1['workflow']?.[_0x5c2033(0x196)]||_0x5c2033(0x1e3))+')'),0x0;}}
1
+ const a54_0x28aa77=a54_0xfee4;(function(_0x5d799d,_0x429eb4){const _0xa2b736=a54_0xfee4,_0x4927e7=_0x5d799d();while(!![]){try{const _0x320645=parseInt(_0xa2b736(0x2df))/0x1+-parseInt(_0xa2b736(0x31c))/0x2*(-parseInt(_0xa2b736(0x269))/0x3)+-parseInt(_0xa2b736(0x29f))/0x4*(parseInt(_0xa2b736(0x26b))/0x5)+parseInt(_0xa2b736(0x2c6))/0x6*(-parseInt(_0xa2b736(0x336))/0x7)+parseInt(_0xa2b736(0x21b))/0x8+parseInt(_0xa2b736(0x25a))/0x9*(-parseInt(_0xa2b736(0x229))/0xa)+-parseInt(_0xa2b736(0x29e))/0xb*(-parseInt(_0xa2b736(0x1ea))/0xc);if(_0x320645===_0x429eb4)break;else _0x4927e7['push'](_0x4927e7['shift']());}catch(_0xc2c749){_0x4927e7['push'](_0x4927e7['shift']());}}}(a54_0x9c38,0x4415c));import a54_0x438284 from'chalk';import{existsSync}from'fs';import a54_0x36036a from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x2740c1 from'prompts';function getAttemptStatusDisplay(_0x4adb03){const _0x4a1363=a54_0xfee4;if(!_0x4adb03)return{'icon':'⏳','text':''};const {done:_0x1ca5dd,success:_0x49d515,cancelRequested:_0x57d12e}=_0x4adb03;if(!_0x1ca5dd)return _0x57d12e?{'icon':'🛑','text':a54_0x438284['yellow'](_0x4a1363(0x210))}:{'icon':'🔄','text':a54_0x438284[_0x4a1363(0x2ab)]('running')};if(_0x49d515)return{'icon':'✅','text':a54_0x438284[_0x4a1363(0x1ba)](_0x4a1363(0x323))};return{'icon':'❌','text':a54_0x438284[_0x4a1363(0x282)](_0x4a1363(0x1f0))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x28aa77(0x255)](_0x5cfb25,_0x7f23da,_0x2c67a7=0x0){const _0x126c3f=a54_0x28aa77;return _0x5cfb25[_0x2c67a7]||_0x7f23da[_0x126c3f(0x218)];}[a54_0x28aa77(0x212)](_0x18b49a,_0xc15a06,_0x55e52d=0x0){const _0x215440=a54_0x28aa77,_0x1708b4=this[_0x215440(0x255)](_0x18b49a,_0xc15a06,_0x55e52d);if(!_0x1708b4)return console['error'](a54_0x438284['red'](_0x215440(0x2e6)),_0x215440(0x2cc)),console['error'](a54_0x438284[_0x215440(0x310)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x1708b4;}[a54_0x28aa77(0x272)](_0x1ca9c1,_0x43dd45){const _0x19ff46=a54_0x28aa77;if(_0x1ca9c1[0x0]){const _0x131589=_0x1ca9c1[0x0][_0x19ff46(0x1d3)]('.');if(_0x131589['length']===0x1)return{'projectName':_0x131589[0x0],'workflowName':undefined};else return _0x131589[_0x19ff46(0x191)]===0x2?{'projectName':_0x131589[0x0],'workflowName':_0x131589[0x1]}:(console['error'](a54_0x438284[_0x19ff46(0x282)](_0x19ff46(0x2e6)),_0x19ff46(0x2ce)),null);}return{'projectName':_0x43dd45[_0x19ff46(0x218)],'workflowName':undefined};}[a54_0x28aa77(0x2f0)](_0x4192f9,_0x48d4e7,_0x390466=0x0){const _0x541de1=a54_0x28aa77;if(_0x4192f9[_0x390466])return _0x4192f9[_0x390466];if(_0x48d4e7[_0x541de1(0x218)]){const _0x2347b0=a54_0x36036a[_0x541de1(0x1b2)](process['cwd'](),_0x541de1(0x1da),_0x48d4e7[_0x541de1(0x218)]);if(existsSync(a54_0x36036a['join'](_0x2347b0,'tdx.json')))return _0x2347b0;}return undefined;}async[a54_0x28aa77(0x2d5)](_0x1979da,_0x59eaeb,_0x2ffbb5){const _0x48c9ee=a54_0x28aa77;try{const _0x492323=await _0x1979da[_0x48c9ee(0x1bb)][_0x48c9ee(0x1da)](_0x59eaeb,{'limit':0x1});if(_0x492323['length']>0x0){const _0x12c6f6=_0x492323[0x0]['id'],_0x1d6a57=getWorkflowUrl(_0x2ffbb5,_0x12c6f6);console[_0x48c9ee(0x1f0)](_0x48c9ee(0x345)+a54_0x438284['cyan'](_0x1d6a57));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x24f);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x2bd);async[a54_0x28aa77(0x270)](_0x4f0622){const _0x70f1de=a54_0x28aa77,{options:_0x171946,args:_0x19e2cb,tdx:_0x325d8b}=_0x4f0622,_0x20db0d=_0x19e2cb[0x0],_0x30d970=_0x171946['clear'];if(_0x30d970)return saveSessionContext({'workflow_project':undefined},_0x171946[_0x70f1de(0x233)]),console['log'](a54_0x438284[_0x70f1de(0x1ba)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x20db0d)return console[_0x70f1de(0x1f0)](a54_0x438284[_0x70f1de(0x282)](_0x70f1de(0x2e6)),'Project\x20name\x20is\x20required'),console[_0x70f1de(0x1f0)](a54_0x438284['dim'](_0x70f1de(0x196))),console[_0x70f1de(0x1f0)](a54_0x438284['dim'](_0x70f1de(0x1b1))),0x1;const _0x1a637f=await withSpinner(_0x70f1de(0x2de)+_0x20db0d+_0x70f1de(0x276),()=>_0x325d8b[_0x70f1de(0x1bb)][_0x70f1de(0x1fc)](_0x20db0d),{'verbose':_0x171946[_0x70f1de(0x192)]}),{name:_0x52c1d0}=_0x1a637f[_0x70f1de(0x213)];return saveSessionContext({'workflow_project':_0x52c1d0},_0x171946[_0x70f1de(0x233)]),console['log'](a54_0x438284[_0x70f1de(0x1ba)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x438284[_0x70f1de(0x335)](_0x52c1d0))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x1ff);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x208);async['execute'](_0x4dbd60){const _0x41c286=a54_0x28aa77,{options:_0x31a4c9,args:_0x2ebf97,tdx:_0x5d61d9}=_0x4dbd60,_0xd29feb=_0x2ebf97[0x0];_0x31a4c9['verbose']&&_0xd29feb&&console[_0x41c286(0x1f0)](_0x41c286(0x187)+_0xd29feb);const _0x5b7fa1=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x5d61d9[_0x41c286(0x1bb)]['projects'](_0xd29feb,{'limit':_0x31a4c9[_0x41c286(0x1a3)]}),{'verbose':_0x31a4c9[_0x41c286(0x192)]});let _0x22428b=_0x5b7fa1[_0x41c286(0x213)];_0x22428b[_0x41c286(0x240)]((_0x451324,_0x16d232)=>_0x451324[_0x41c286(0x25c)]['localeCompare'](_0x16d232[_0x41c286(0x25c)]));const _0x375df8=_0x31a4c9[_0x41c286(0x1a3)]||0x64,_0x1fa842=_0x22428b['length']>=_0x375df8?a54_0x438284[_0x41c286(0x310)](_0x41c286(0x260)):'';console[_0x41c286(0x1f0)](_0x41c286(0x1d5)+_0x22428b[_0x41c286(0x191)]+_0x41c286(0x344)+(_0x22428b['length']!==0x1?'s':'')+_0x1fa842);if(_0x31a4c9[_0x41c286(0x337)]===_0x41c286(0x25f)||_0x31a4c9[_0x41c286(0x337)]===_0x41c286(0x2ae)||_0x31a4c9[_0x41c286(0x337)]==='table')await handleSDKOutput(_0x22428b,_0x31a4c9);else{if(_0x22428b[_0x41c286(0x191)]===0x0)_0xd29feb?console[_0x41c286(0x33f)](_0x41c286(0x1bc)+_0xd29feb):console[_0x41c286(0x33f)](_0x41c286(0x319));else{const _0x2ac022=_0x22428b[_0x41c286(0x268)](_0x54f870=>{const _0x36f05e=_0x41c286,_0x1f131c=_0x54f870[_0x36f05e(0x1a7)]?.[_0x36f05e(0x1d1)](_0x5a572e=>_0x5a572e[_0x36f05e(0x184)]==='sys'),_0x3dfff7=_0x1f131c?a54_0x438284['dim']('\x20(system)'):'';return'📁\x20'+_0x54f870[_0x36f05e(0x25c)]+_0x3dfff7;});await writeOutput(_0x2ac022['join']('\x0a'),_0x31a4c9['output'],_0x41c286(0x1a2));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a54_0x28aa77(0x247);['description']='List\x20workflows';async[a54_0x28aa77(0x270)](_0xa3a2aa){const _0x493c90=a54_0x28aa77,{options:_0x3ebfa5,args:_0x42552b,tdx:_0x5ea07c}=_0xa3a2aa,_0x271496=this[_0x493c90(0x255)](_0x42552b,_0x3ebfa5);_0x3ebfa5['verbose']&&_0x271496&&console['error'](_0x493c90(0x2a5)+_0x271496);const _0x17324b=await withSpinner(_0x493c90(0x1aa),()=>_0x5ea07c['workflow']['workflows'](_0x271496,{'limit':_0x3ebfa5[_0x493c90(0x1a3)]}),{'verbose':_0x3ebfa5[_0x493c90(0x192)]});let _0x212042=_0x17324b['data'];_0x212042['sort']((_0x379043,_0x2ccf1a)=>{const _0x3affb1=_0x493c90,_0x5ef39a=_0x379043[_0x3affb1(0x25c)][_0x3affb1(0x2a6)](_0x2ccf1a[_0x3affb1(0x25c)]);if(_0x5ef39a!==0x0)return _0x5ef39a;return(_0x379043[_0x3affb1(0x1f1)]?.['name']||'')[_0x3affb1(0x2a6)](_0x2ccf1a['project']?.[_0x3affb1(0x25c)]||'');});const _0x34065f=_0x3ebfa5[_0x493c90(0x1a3)]||0x64,_0x4d2557=_0x212042[_0x493c90(0x191)]>=_0x34065f?a54_0x438284[_0x493c90(0x310)](_0x493c90(0x260)):'';console[_0x493c90(0x1f0)]('✔\x20Found\x20'+_0x212042[_0x493c90(0x191)]+'\x20workflow'+(_0x212042['length']!==0x1?'s':'')+_0x4d2557);if(_0x3ebfa5[_0x493c90(0x337)]===_0x493c90(0x25f)||_0x3ebfa5[_0x493c90(0x337)]===_0x493c90(0x2ae)||_0x3ebfa5[_0x493c90(0x337)]===_0x493c90(0x1c9))await handleSDKOutput(_0x212042,_0x3ebfa5);else{if(_0x212042[_0x493c90(0x191)]===0x0)_0x271496?console[_0x493c90(0x33f)](_0x493c90(0x2e9)+_0x271496):console[_0x493c90(0x33f)](_0x493c90(0x1a4));else{const _0x2254ae=_0x3ebfa5[_0x493c90(0x312)],_0x3b4cb1=_0x212042[_0x493c90(0x268)](_0x31cde0=>{const _0x380067=_0x493c90,_0x266308=a54_0x438284[_0x380067(0x310)]('#'+_0x31cde0['id']),_0x91eea9=hyperlink(_0x266308,getWorkflowUrl(_0x2254ae,_0x31cde0['id'])),_0x4f7b17=_0x31cde0[_0x380067(0x1f1)]?.['name']?a54_0x438284['dim']('\x20('+_0x31cde0[_0x380067(0x1f1)][_0x380067(0x25c)]+')'):'';return _0x380067(0x193)+_0x91eea9+'\x20'+_0x31cde0[_0x380067(0x25c)]+_0x4f7b17;});await writeOutput(_0x3b4cb1[_0x493c90(0x1b2)]('\x0a'),_0x3ebfa5[_0x493c90(0x34b)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a54_0x28aa77(0x277);['description']=a54_0x28aa77(0x23a);async[a54_0x28aa77(0x270)](_0x1329ee){const _0xf4e8cd=a54_0x28aa77,{options:_0x5e58ab,args:_0x470c51,tdx:_0x1c86b1}=_0x1329ee,_0x4ba79a=this[_0xf4e8cd(0x272)](_0x470c51,_0x5e58ab);if(!_0x4ba79a)return 0x1;const {projectName:_0xba3536,workflowName:_0x17a2f7}=_0x4ba79a;if(_0x5e58ab[_0xf4e8cd(0x192)]){if(_0xba3536&&_0x17a2f7)console[_0xf4e8cd(0x1f0)](_0xf4e8cd(0x257)+_0xba3536+'.'+_0x17a2f7);else _0xba3536&&console[_0xf4e8cd(0x1f0)](_0xf4e8cd(0x200)+_0xba3536);const _0x5084d2=_0x5e58ab[_0xf4e8cd(0x2d6)];_0x5084d2&&console[_0xf4e8cd(0x1f0)](_0xf4e8cd(0x1f9)+_0x5084d2);}let _0x4fa3f6=0x28;if(process[_0xf4e8cd(0x2fc)][_0xf4e8cd(0x2ed)]&&!_0x5e58ab[_0xf4e8cd(0x34b)]&&!_0x5e58ab[_0xf4e8cd(0x337)]){const _0x56ba61=process[_0xf4e8cd(0x2fc)]['rows']||0x28;_0x4fa3f6=Math[_0xf4e8cd(0x316)](0x14,Math['floor'](_0x56ba61*0x2/0x3));}const _0x1bef7e=_0x5e58ab['limit']||_0x4fa3f6,_0xc94c9a=await withSpinner(_0xf4e8cd(0x2a0),()=>_0x1c86b1[_0xf4e8cd(0x1bb)][_0xf4e8cd(0x328)]({'projectName':_0xba3536,'workflowName':_0x17a2f7,'status':_0x5e58ab[_0xf4e8cd(0x2d6)],'fromTime':_0x5e58ab[_0xf4e8cd(0x24c)],'toTime':_0x5e58ab['to'],'limit':_0x1bef7e}),{'verbose':_0x5e58ab[_0xf4e8cd(0x192)]}),_0x565034=_0xc94c9a[_0xf4e8cd(0x213)];_0x565034[_0xf4e8cd(0x240)]((_0xde1654,_0x4be328)=>{const _0x5525be=_0xf4e8cd,_0x1731ba=_0xde1654[_0x5525be(0x1e3)]||'',_0x5e251e=_0x4be328[_0x5525be(0x1e3)]||'';return _0x5e251e[_0x5525be(0x2a6)](_0x1731ba);});_0x565034[_0xf4e8cd(0x191)]>=_0x1bef7e?console[_0xf4e8cd(0x1f0)](_0xf4e8cd(0x2d9)+_0x565034[_0xf4e8cd(0x191)]+_0xf4e8cd(0x332)+a54_0x438284[_0xf4e8cd(0x310)](_0xf4e8cd(0x1ab))):console[_0xf4e8cd(0x1f0)](_0xf4e8cd(0x1d5)+_0x565034[_0xf4e8cd(0x191)]+_0xf4e8cd(0x275)+(_0x565034[_0xf4e8cd(0x191)]!==0x1?'s':''));if(_0x5e58ab['format']==='json'||_0x5e58ab['format']==='jsonl'||_0x5e58ab['format']===_0xf4e8cd(0x1c9))await handleSDKOutput(_0x565034,_0x5e58ab);else{if(!process['stdout'][_0xf4e8cd(0x2ed)]||_0x5e58ab[_0xf4e8cd(0x34b)]){if(_0x565034[_0xf4e8cd(0x191)]===0x0){if(_0xba3536&&_0x17a2f7)console[_0xf4e8cd(0x33f)](_0xf4e8cd(0x23d)+_0xba3536+'.'+_0x17a2f7);else _0xba3536?console[_0xf4e8cd(0x33f)](_0xf4e8cd(0x30b)+_0xba3536):console[_0xf4e8cd(0x33f)](_0xf4e8cd(0x1fd));}else{const _0x364f91=_0x5e58ab[_0xf4e8cd(0x312)],_0x22d63d=this['renderSessionsTimeline'](_0x565034,_0x364f91);_0x5e58ab[_0xf4e8cd(0x34b)]?await writeOutput(_0x22d63d,_0x5e58ab[_0xf4e8cd(0x34b)],'list'):console[_0xf4e8cd(0x33f)](_0x22d63d);}!_0xba3536&&(console['error'](''),console['error'](a54_0x438284[_0xf4e8cd(0x310)](_0xf4e8cd(0x2ea))),console['error'](a54_0x438284[_0xf4e8cd(0x310)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x438284[_0xf4e8cd(0x310)](_0xf4e8cd(0x197))));}else{if(_0x565034[_0xf4e8cd(0x191)]===0x0){if(_0xba3536&&_0x17a2f7)console['log']('No\x20sessions\x20found\x20for:\x20'+_0xba3536+'.'+_0x17a2f7);else _0xba3536?console[_0xf4e8cd(0x33f)](_0xf4e8cd(0x30b)+_0xba3536):console[_0xf4e8cd(0x33f)](_0xf4e8cd(0x1fd));}else await this[_0xf4e8cd(0x207)](_0x565034,_0x1329ee,_0xba3536);}}return 0x0;}[a54_0x28aa77(0x2ff)](_0x2ba905,_0xa34bf4){const _0x48b601=a54_0x28aa77,_0x498d41=[],_0x252f0d=new Map();let _0x48cbec=Infinity,_0x2ee7a8=-Infinity;for(const _0x330676 of _0x2ba905){if(_0x330676['lastAttempt']?.['createdAt']){const _0x1b845b=new Date(_0x330676['lastAttempt'][_0x48b601(0x214)])[_0x48b601(0x2f3)](),_0x3f83d2=_0x330676[_0x48b601(0x2c9)][_0x48b601(0x1c8)]?new Date(_0x330676[_0x48b601(0x2c9)]['finishedAt'])['getTime']():Date[_0x48b601(0x290)](),_0x2e932e=_0x330676['project']?.[_0x48b601(0x25c)]||'(unknown)';!_0x252f0d[_0x48b601(0x18b)](_0x2e932e)&&_0x252f0d[_0x48b601(0x2f7)](_0x2e932e,[]),_0x252f0d[_0x48b601(0x186)](_0x2e932e)['push']({'session':_0x330676,'startTime':_0x1b845b,'endTime':_0x3f83d2,'duration':_0x3f83d2-_0x1b845b}),_0x48cbec=Math[_0x48b601(0x2c7)](_0x48cbec,_0x1b845b),_0x2ee7a8=Math[_0x48b601(0x316)](_0x2ee7a8,_0x3f83d2);}}if(_0x252f0d['size']===0x0)return _0x48b601(0x278);const _0xa618eb=process[_0x48b601(0x2fc)]['columns']||0x78,_0xf582e0=0x1e,_0x2391ea=0x32,_0x4b29bd=0x4,_0xe17ad4=Math['min'](_0x2391ea,Math[_0x48b601(0x316)](_0xf582e0,Math['floor'](_0xa618eb*0.3))),_0x4685c5=_0xa618eb-_0xe17ad4-TIMELINE_CONFIG['GUTTER']-0x3-_0x4b29bd,_0x3f7c06=_0x2ee7a8-_0x48cbec,_0x305e2e=_0x3f7c06/_0xe17ad4,_0x25205b=renderTimeAxis({'startTime':_0x48cbec,'endTime':_0x2ee7a8,'durationMs':_0x3f7c06,'msPerChar':_0x305e2e},_0xe17ad4),_0x29d97d=[];for(const _0x330ca9 of _0x252f0d[_0x48b601(0x28f)]()){_0x29d97d['push'](..._0x330ca9);}_0x29d97d[_0x48b601(0x240)]((_0x4d5360,_0x2be653)=>_0x2be653[_0x48b601(0x338)]-_0x4d5360[_0x48b601(0x338)]);const _0x14da1d=new Date(_0x48cbec),_0x9a27b=formatDate(_0x14da1d),_0x2acd9d=_0x4b29bd+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x48b601(0x24e)]+_0x4685c5,_0x2a7207='\x20'[_0x48b601(0x306)](_0x2acd9d-_0x9a27b['length']),_0x5720e6=_0x2a7207+a54_0x438284['dim'](_0x9a27b)+'\x20'+_0x25205b;_0x498d41[_0x48b601(0x223)](_0x5720e6);const _0x51a09c=0x16;let _0x29c902=0x0;for(const _0x4d8d54 of _0x29d97d){const _0xbf44d9=_0x4d8d54['session'][_0x48b601(0x1f1)]?.['name']||'?',_0x241d12=Math[_0x48b601(0x2c7)](stringWidth(_0xbf44d9),_0x51a09c);_0x29c902=Math['max'](_0x29c902,_0x241d12);}for(const _0x50aabe of _0x29d97d){const {session:_0x377ac7,startTime:_0x1528e1,endTime:_0x18f894,duration:_0x223e99}=_0x50aabe,_0x48b484=_0x377ac7['project']?.['id'],_0xf44127=_0x377ac7['id'],_0x398f5a=_0x377ac7[_0x48b601(0x1f1)]?.[_0x48b601(0x25c)]||'?',_0x83cb90=_0x377ac7['workflow']?.[_0x48b601(0x25c)]||'?';let _0x12e1ea,_0xd02145;if(_0x377ac7[_0x48b601(0x2c9)]){const _0x38622c=_0x377ac7[_0x48b601(0x2c9)];!_0x38622c['done']?(_0x12e1ea=_0x38622c['cancelRequested']?'🛑':'🔄',_0xd02145=_0x38622c[_0x48b601(0x24b)]?a54_0x438284[_0x48b601(0x264)]:a54_0x438284['blue']):(_0x12e1ea=_0x38622c[_0x48b601(0x323)]?'✅':'❌',_0xd02145=_0x38622c[_0x48b601(0x323)]?a54_0x438284[_0x48b601(0x1ba)]:a54_0x438284[_0x48b601(0x282)]);}else _0x12e1ea='⏳',_0xd02145=a54_0x438284[_0x48b601(0x310)];const _0xe3dfe6='#'+_0xf44127,_0x277708=_0x48b484?hyperlink(_0xe3dfe6,getWorkflowSessionUrl(_0xa34bf4,_0x48b484,_0xf44127)):_0xe3dfe6;let _0x128666=_0x398f5a;stringWidth(_0x398f5a)>_0x51a09c&&(_0x128666=_0x398f5a[_0x48b601(0x20e)](0x0,_0x51a09c-0x1)+'…');const _0x5729c2=a54_0x438284['dim'](_0x128666),_0x292bfd=stringWidth(_0x128666),_0x492bc9='\x20'['repeat'](_0x29c902-stringWidth(_0x128666)+0x2),_0x1d657f='('+formatElapsed(_0x223e99)+')',_0x4a2977=stringWidth(_0x1d657f),_0x3017a3=stringWidth(_0xe3dfe6),_0x2f914b=_0x3017a3+0x1+_0x292bfd+_0x492bc9[_0x48b601(0x191)],_0x436edc=_0x4685c5-_0x2f914b-_0x4a2977-0x1-0x8;let _0xeb8bf7=_0x83cb90;stringWidth(_0xeb8bf7)>_0x436edc&&(_0xeb8bf7=_0xeb8bf7['slice'](0x0,_0x436edc-0x1)+'…');const _0x9927bf=_0x277708+'\x20'+_0x5729c2+_0x492bc9+_0xeb8bf7,_0x2718db=stringWidth(_0x9927bf),_0x2f9c4c=_0x4685c5-_0x2718db-_0x4a2977,_0x1b2623=_0x9927bf+'\x20'['repeat'](Math[_0x48b601(0x316)](0x1,_0x2f9c4c))+a54_0x438284[_0x48b601(0x310)](_0x1d657f),_0xb276d4=Math[_0x48b601(0x19a)]((_0x1528e1-_0x48cbec)/_0x305e2e),_0x3a174f=Math[_0x48b601(0x19a)]((_0x18f894-_0x48cbec)/_0x305e2e),_0xb1033f=Math[_0x48b601(0x316)](_0xb276d4+0x1,_0x3a174f),_0x36d26d=new Array(_0xe17ad4)[_0x48b601(0x19c)]('\x20');for(let _0x58ab7e=_0xb276d4;_0x58ab7e<Math['min'](_0xb1033f,_0xe17ad4);_0x58ab7e++){_0x36d26d[_0x58ab7e]='─';}const _0x32f474=_0x36d26d[_0x48b601(0x268)](_0x33f114=>_0x33f114==='\x20'?'\x20':_0xd02145(_0x33f114))[_0x48b601(0x1b2)]('');_0x498d41[_0x48b601(0x223)](_0x12e1ea+'\x20'+_0x1b2623+'│'+_0x32f474+'│');}return _0x498d41['join']('\x0a');}async[a54_0x28aa77(0x207)](_0x20486e,_0x5e400a,_0xf21384){const _0x1d99ba=a54_0x28aa77,{options:_0x32bd2e,tdx:_0x1c7e76}=_0x5e400a,_0x3553eb=_0x32bd2e[_0x1d99ba(0x312)],{timelineRows:_0x58c47f,timeAxisHeader:_0x1949aa}=this[_0x1d99ba(0x1c7)](_0x20486e,_0x3553eb),_0x32b552=_0x58c47f[_0x1d99ba(0x2c0)](_0x5f09d3=>_0x5f09d3[_0x1d99ba(0x292)]);if(_0x32b552[_0x1d99ba(0x191)]===0x0){const _0x456e74=this[_0x1d99ba(0x2ff)](_0x20486e,_0x3553eb);console[_0x1d99ba(0x33f)](_0x456e74);!_0xf21384&&(console[_0x1d99ba(0x1f0)](''),console[_0x1d99ba(0x1f0)](a54_0x438284['dim'](_0x1d99ba(0x2ea))),console[_0x1d99ba(0x1f0)](a54_0x438284['dim'](_0x1d99ba(0x34d))+'or'+a54_0x438284[_0x1d99ba(0x310)](_0x1d99ba(0x197))));return;}_0x1949aa&&console[_0x1d99ba(0x33f)](_0x1949aa);const _0x104477=_0x58c47f['filter'](_0x3e8601=>_0x3e8601[_0x1d99ba(0x292)])[_0x1d99ba(0x268)](_0x402ac0=>({'title':_0x402ac0[_0x1d99ba(0x2c5)],'value':_0x402ac0[_0x1d99ba(0x292)]})),_0x29b295=process[_0x1d99ba(0x2fc)][_0x1d99ba(0x18a)]||0x3c,_0x413fc2=Math['max'](0x28,Math[_0x1d99ba(0x19a)](_0x29b295*0x2/0x3)),_0x56f2e1=await a54_0x2740c1({'type':_0x1d99ba(0x2cb),'name':_0x1d99ba(0x292),'message':_0x1d99ba(0x1fe),'choices':_0x104477,'initial':-0x1,'limit':_0x413fc2,'clearFirst':!![],'fallback':{'title':_0x1d99ba(0x2c1),'value':null},'suggest':(_0x195f94,_0x539e72)=>{const _0x363a4d=_0x1d99ba;if(!_0x195f94)return Promise[_0x363a4d(0x1fb)](_0x539e72);const _0x4cc14a=_0x539e72[_0x363a4d(0x2c0)](_0x181e9e=>{const _0x22f868=_0x363a4d,_0x2a9802=_0x181e9e;return _0x2a9802[_0x22f868(0x18f)][_0x22f868(0x32e)]()['includes'](_0x195f94[_0x22f868(0x32e)]());});return Promise[_0x363a4d(0x1fb)](_0x4cc14a);}}),_0x579761=()=>{const _0x342c2b=_0x1d99ba;process[_0x342c2b(0x2fc)][_0x342c2b(0x2ca)](_0x342c2b(0x254)),process[_0x342c2b(0x2fc)]['write'](_0x342c2b(0x254)),process['stdout'][_0x342c2b(0x2ca)](_0x342c2b(0x254));},_0x35f6f2=_0x56f2e1&&_0x56f2e1[_0x1d99ba(0x292)]&&_0x56f2e1[_0x1d99ba(0x292)]!==null&&_0x56f2e1[_0x1d99ba(0x292)][_0x1d99ba(0x2f8)]()!=='';if(!_0x35f6f2){_0x579761(),console[_0x1d99ba(0x33f)](a54_0x438284['dim'](_0x1d99ba(0x27a)));return;}_0x579761();const _0x1aaade=_0x20486e[_0x1d99ba(0x34c)](_0x461066=>_0x461066['lastAttempt']?.['id']===_0x56f2e1[_0x1d99ba(0x292)]);if(_0x1aaade){const _0x560d5b=_0x1aaade[_0x1d99ba(0x1f1)]?.[_0x1d99ba(0x25c)]||'?',_0x25f4aa=_0x1aaade[_0x1d99ba(0x1bb)]?.['name']||'?';console['log'](_0x1d99ba(0x1dd)+a54_0x438284[_0x1d99ba(0x310)](_0x560d5b)+',\x20Workflow:\x20'+a54_0x438284['dim'](_0x25f4aa));}const _0x596346=new WorkflowTimelineCommand();await _0x596346['execute']({'args':[],'options':{..._0x32bd2e,'attemptId':_0x56f2e1[_0x1d99ba(0x292)]},'tdx':_0x1c7e76});}['generateSessionTimelineRows'](_0x2bb9d3,_0x3b432c){const _0x449464=a54_0x28aa77,_0x366951=new Map();for(const _0xd68826 of _0x2bb9d3){_0xd68826['id']&&_0xd68826[_0x449464(0x2c9)]?.['id']&&_0x366951[_0x449464(0x2f7)](_0xd68826['id'],_0xd68826['lastAttempt']['id']);}const _0x455cfc=[];let _0x126a8c='';const _0x2eb72d=this[_0x449464(0x2ff)](_0x2bb9d3,_0x3b432c),_0x31ef87=_0x2eb72d['split']('\x0a');for(const _0x383ea0 of _0x31ef87){if(_0x383ea0[_0x449464(0x2b9)](_0x449464(0x2d2))||_0x383ea0['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x126a8c=_0x383ea0;else{if(_0x383ea0[_0x449464(0x201)](/^[✅❌🔄🛑⏳]/)){const _0x3b5068=_0x383ea0[_0x449464(0x201)](/#(\d+)/),_0x3f25c8=_0x3b5068?_0x3b5068[0x1]:null,_0x58a4be=_0x3f25c8?_0x366951[_0x449464(0x186)](_0x3f25c8)||null:null,_0x326377=_0x2bb9d3['find'](_0x1534f6=>_0x1534f6['id']===_0x3f25c8),_0xb0f8e4=_0x326377?.[_0x449464(0x1f1)]?.[_0x449464(0x25c)]||'';_0x455cfc['push']({'displayLine':_0x383ea0,'attemptId':_0x58a4be,'projectName':_0xb0f8e4});}}}return{'timelineRows':_0x455cfc,'timeAxisHeader':_0x126a8c};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a54_0x28aa77(0x29d);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x2c3);async[a54_0x28aa77(0x270)](_0x47ab4d){const _0x235871=a54_0x28aa77,{options:_0x3bd791,args:_0x178ed6,tdx:_0x596170}=_0x47ab4d,_0x3a43b8=this[_0x235871(0x272)](_0x178ed6,_0x3bd791);if(!_0x3a43b8)return 0x1;const {projectName:_0x53d4d0,workflowName:_0x47edcd}=_0x3a43b8,_0x3cc2df=_0x3bd791[_0x235871(0x1e1)];if(_0x3bd791[_0x235871(0x192)]){if(_0x53d4d0&&_0x47edcd)console['error']('Filter:\x20'+_0x53d4d0+'.'+_0x47edcd);else _0x53d4d0&&console[_0x235871(0x1f0)](_0x235871(0x200)+_0x53d4d0);_0x3cc2df&&console[_0x235871(0x1f0)]('Include\x20retried:\x20yes');}const _0x166996=await withSpinner(_0x235871(0x327),()=>_0x596170[_0x235871(0x1bb)]['attempts']({'projectName':_0x53d4d0,'workflowName':_0x47edcd,'includeRetried':_0x3cc2df,'limit':_0x3bd791['limit']}),{'verbose':_0x3bd791[_0x235871(0x192)]}),_0x5ad23e=_0x166996['data'],_0x43a3c4=_0x3bd791[_0x235871(0x1a3)]||0x64,_0x1d8d7f=_0x5ad23e['length']>=_0x43a3c4?a54_0x438284['dim'](_0x235871(0x260)):'';console[_0x235871(0x1f0)](_0x235871(0x1d5)+_0x5ad23e[_0x235871(0x191)]+_0x235871(0x25e)+(_0x5ad23e['length']!==0x1?'s':'')+_0x1d8d7f);if(_0x3bd791[_0x235871(0x337)]===_0x235871(0x25f)||_0x3bd791[_0x235871(0x337)]===_0x235871(0x2ae)||_0x3bd791[_0x235871(0x337)]===_0x235871(0x1c9))await handleSDKOutput(_0x5ad23e,_0x3bd791);else{if(_0x5ad23e[_0x235871(0x191)]===0x0){if(_0x53d4d0&&_0x47edcd)console[_0x235871(0x33f)]('No\x20attempts\x20found\x20for:\x20'+_0x53d4d0+'.'+_0x47edcd);else _0x53d4d0?console[_0x235871(0x33f)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x53d4d0):console[_0x235871(0x33f)](_0x235871(0x24a));}else{const _0x16854e=_0x3bd791[_0x235871(0x312)],_0x5c6395=_0x5ad23e[_0x235871(0x268)](_0x256da2=>{const _0x2a0ffa=_0x235871,_0x4b60b3=a54_0x438284[_0x2a0ffa(0x310)]('#'+_0x256da2['id']),_0x5244cb=_0x256da2[_0x2a0ffa(0x1f1)]?.['id'],_0x2aa651=_0x256da2[_0x2a0ffa(0x1b4)]||_0x256da2[_0x2a0ffa(0x287)],_0x1dbd35=_0x5244cb&&_0x2aa651?hyperlink(_0x4b60b3,getWorkflowAttemptUrl(_0x16854e,_0x5244cb,_0x2aa651,_0x256da2['id'])):_0x4b60b3,{icon:_0x1a37c6,text:_0x69be3e}=getAttemptStatusDisplay(_0x256da2),_0x17ba72=(_0x256da2[_0x2a0ffa(0x1f1)]?.[_0x2a0ffa(0x25c)]||'?')+'.'+(_0x256da2['workflow']?.['name']||'?'),_0x172dc8=_0x256da2['sessionTime']?a54_0x438284[_0x2a0ffa(0x310)](_0x256da2[_0x2a0ffa(0x1e3)]):'';return(_0x1dbd35+'\x20'+_0x1a37c6+(_0x69be3e?'\x20'+_0x69be3e:'')+'\x20'+_0x17ba72+'\x20'+_0x172dc8)[_0x2a0ffa(0x2dd)]();});await writeOutput(_0x5c6395[_0x235871(0x1b2)]('\x0a'),_0x3bd791[_0x235871(0x34b)],_0x235871(0x1a2));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a54_0x28aa77(0x317);['description']='Show\x20specific\x20attempt\x20details';async[a54_0x28aa77(0x270)](_0x3cf8b0){const _0x57ff45=a54_0x28aa77,{options:_0x1113f3,args:_0x4ef2d6,tdx:_0x329af2}=_0x3cf8b0,_0x5a8304=_0x4ef2d6[0x0];if(!_0x5a8304)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x1113f3[_0x57ff45(0x192)]&&console['error']('Attempt\x20ID:\x20'+_0x5a8304);const _0x76fdab=await withSpinner(_0x57ff45(0x22c),()=>_0x329af2[_0x57ff45(0x1bb)][_0x57ff45(0x225)](_0x5a8304),{'verbose':_0x1113f3['verbose']}),_0x207a5a=_0x76fdab[_0x57ff45(0x213)];let _0x5b5f5f;!_0x207a5a['done']?_0x5b5f5f=_0x207a5a[_0x57ff45(0x24b)]?_0x57ff45(0x210):_0x57ff45(0x2dc):_0x5b5f5f=_0x207a5a['success']?'success':'error';let _0x186c49;if(_0x207a5a[_0x57ff45(0x214)]&&_0x207a5a[_0x57ff45(0x1c8)]){const _0x5603be=new Date(_0x207a5a[_0x57ff45(0x214)])['getTime'](),_0x1730c6=new Date(_0x207a5a[_0x57ff45(0x1c8)])[_0x57ff45(0x2f3)]();_0x186c49=Math[_0x57ff45(0x27c)]((_0x1730c6-_0x5603be)/0x3e8);}const _0x4e3dd1={'attempt_id':_0x207a5a['id'],'status':_0x5b5f5f,..._0x207a5a[_0x57ff45(0x301)]!==undefined&&{'index':_0x207a5a[_0x57ff45(0x301)]},..._0x207a5a[_0x57ff45(0x1f1)]&&{'project':_0x207a5a[_0x57ff45(0x1f1)][_0x57ff45(0x25c)]},..._0x207a5a['workflow']&&{'workflow':_0x207a5a[_0x57ff45(0x1bb)][_0x57ff45(0x25c)]},..._0x207a5a['sessionId']&&{'session_id':_0x207a5a['sessionId']},..._0x207a5a['sessionTime']&&{'session_time':_0x207a5a[_0x57ff45(0x1e3)]},..._0x207a5a[_0x57ff45(0x2af)]&&{'retry_attempt':_0x207a5a['retryAttemptName']},..._0x186c49!==undefined&&{'duration_sec':_0x186c49},..._0x207a5a[_0x57ff45(0x214)]&&{'created_at':_0x207a5a[_0x57ff45(0x214)]},..._0x207a5a[_0x57ff45(0x1c8)]&&{'finished_at':_0x207a5a[_0x57ff45(0x1c8)]},...Object[_0x57ff45(0x273)](_0x207a5a[_0x57ff45(0x19f)])[_0x57ff45(0x191)]>0x0&&{'params':_0x207a5a[_0x57ff45(0x19f)]}};return await handleSingleObjectOutput(_0x4e3dd1,_0x1113f3),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x2ec);[a54_0x28aa77(0x205)]='Show\x20tasks\x20for\x20an\x20attempt';async[a54_0x28aa77(0x270)](_0x39fdc9){const _0x58ca8e=a54_0x28aa77,{options:_0x46218d,args:_0x2b6927,tdx:_0x195c43}=_0x39fdc9,_0x3a2710=_0x2b6927[0x0];if(!_0x3a2710)return console[_0x58ca8e(0x1f0)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x235dfa=_0x46218d[_0x58ca8e(0x246)];_0x46218d[_0x58ca8e(0x192)]&&(console[_0x58ca8e(0x1f0)](_0x58ca8e(0x1a6)+_0x3a2710),_0x235dfa&&console['error'](_0x58ca8e(0x281)));const _0x1a499e=await withSpinner(_0x58ca8e(0x1d9),()=>_0x195c43['workflow'][_0x58ca8e(0x2d1)](_0x3a2710,_0x235dfa||![]),{'verbose':_0x46218d[_0x58ca8e(0x192)]}),_0x487727=_0x1a499e[_0x58ca8e(0x213)];return console['error'](_0x58ca8e(0x1d5)+_0x487727[_0x58ca8e(0x191)]+_0x58ca8e(0x190)+(_0x487727[_0x58ca8e(0x191)]!==0x1?'s':'')),await handleSDKOutput(_0x487727,_0x46218d),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a54_0x28aa77(0x27f);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x20a);async[a54_0x28aa77(0x270)](_0x5ae576){const _0x337155=a54_0x28aa77,{options:_0x2b0757,args:_0x52a7d6,tdx:_0x1a8607}=_0x5ae576,_0x3bd374=_0x52a7d6[0x0];let _0x3256cd=_0x52a7d6[0x1];if(!_0x3bd374)return console[_0x337155(0x1f0)](_0x337155(0x1cd)),0x1;_0x2b0757[_0x337155(0x192)]&&(console[_0x337155(0x1f0)](_0x337155(0x1a6)+_0x3bd374),_0x3256cd&&console[_0x337155(0x1f0)](_0x337155(0x28b)+_0x3256cd));const _0x44f661=await withSpinner(_0x337155(0x31f),()=>_0x1a8607[_0x337155(0x1bb)][_0x337155(0x19b)](_0x3bd374,_0x3256cd),{'verbose':_0x2b0757[_0x337155(0x192)]}),_0x12ee5d=_0x44f661[_0x337155(0x213)];if(_0x12ee5d['length']===0x0)return console[_0x337155(0x1f0)](_0x337155(0x2b1)),0x0;if(!_0x3256cd&&(_0x2b0757[_0x337155(0x25f)]||_0x2b0757[_0x337155(0x337)]))return await handleSDKOutput(_0x12ee5d,_0x2b0757),0x0;if(!_0x3256cd){const _0x466fa9=_0x12ee5d[_0x337155(0x268)](_0x28ede6=>({'title':_0x28ede6[_0x337155(0x198)]+'\x20('+formatBytes(_0x28ede6[_0x337155(0x219)])+')','value':_0x28ede6[_0x337155(0x198)]})),_0x2a9523=await a54_0x2740c1({'type':'select','name':_0x337155(0x339),'message':_0x337155(0x2a7),'choices':_0x466fa9});if(!_0x2a9523[_0x337155(0x339)])return console[_0x337155(0x1f0)]('Cancelled'),0x0;_0x3256cd=_0x2a9523[_0x337155(0x339)];}const _0x142d48=await withSpinner(_0x337155(0x1bf),()=>_0x1a8607[_0x337155(0x1bb)][_0x337155(0x2e0)](_0x3bd374,_0x3256cd),{'verbose':_0x2b0757[_0x337155(0x192)]}),_0x4e832f=_0x142d48[_0x337155(0x213)];return _0x4e832f?console[_0x337155(0x33f)](_0x4e832f):console['error']('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x18d);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x1d6);async[a54_0x28aa77(0x270)](_0x399075){const _0x18a390=a54_0x28aa77,{options:_0x18981f,args:_0x556362,tdx:_0x589fca}=_0x399075,_0x5a8fb2=_0x556362[0x0];if(!_0x5a8fb2)return console[_0x18a390(0x1f0)](_0x18a390(0x1cd)),0x1;const _0x3d7889=_0x18981f[_0x18a390(0x1e7)];_0x18981f[_0x18a390(0x192)]&&(console[_0x18a390(0x1f0)](_0x18a390(0x1a6)+_0x5a8fb2),_0x3d7889&&console[_0x18a390(0x1f0)]('Reason:\x20'+_0x3d7889));if(!_0x18981f[_0x18a390(0x22f)]){if(!isInteractive())return console['error'](a54_0x438284[_0x18a390(0x282)](_0x18a390(0x2cd)),_0x18a390(0x2e4)),console[_0x18a390(0x1f0)](a54_0x438284['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4f5159=await confirmKey(_0x18a390(0x331)+_0x5a8fb2+'?');if(!_0x4f5159)return console[_0x18a390(0x1f0)](a54_0x438284[_0x18a390(0x264)](_0x18a390(0x27a))),0x1;}const _0x4ab137=await withSpinner(_0x18a390(0x1dc),()=>_0x589fca[_0x18a390(0x1bb)]['kill'](_0x5a8fb2,_0x3d7889),{'verbose':_0x18981f[_0x18a390(0x192)]}),_0x56974a=_0x4ab137[_0x18a390(0x213)];return console[_0x18a390(0x1f0)]('✔\x20'+_0x56974a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x28aa77(0x25c)]='workflow:retry';[a54_0x28aa77(0x205)]=a54_0x28aa77(0x1de);async[a54_0x28aa77(0x270)](_0x115044){const _0x2b6102=a54_0x28aa77,{options:_0x490958,args:_0x38cf4d,tdx:_0x3e85fd}=_0x115044,_0x21ec81=_0x38cf4d[0x0];if(!_0x21ec81)return console[_0x2b6102(0x1f0)](_0x2b6102(0x21f)),console[_0x2b6102(0x1f0)](_0x2b6102(0x259)),0x1;let _0x413b43=![],_0x21ad6f=_0x21ec81;if(_0x21ec81[_0x2b6102(0x2b9)]('session:'))_0x413b43=!![],_0x21ad6f=_0x21ec81[_0x2b6102(0x34e)](0x8);else{if(_0x21ec81['startsWith'](_0x2b6102(0x1a5)))_0x413b43=![],_0x21ad6f=_0x21ec81['substring'](0x8);else return console[_0x2b6102(0x1f0)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x2b6102(0x1f0)](_0x2b6102(0x259)),0x1;}const _0x50d482=_0x490958['fromTask'],_0x2563dd=_0x490958[_0x2b6102(0x245)],_0x197e20=_0x490958['params'],_0x37487d=_0x490958['force'];_0x490958[_0x2b6102(0x192)]&&(console['error'](_0x2b6102(0x221)+(_0x413b43?_0x2b6102(0x233):_0x2b6102(0x225))+'\x20'+_0x21ad6f),_0x50d482&&console[_0x2b6102(0x1f0)](_0x2b6102(0x2d8)+_0x50d482),_0x2563dd&&console[_0x2b6102(0x1f0)](_0x2b6102(0x20f)+_0x2563dd),_0x197e20&&console[_0x2b6102(0x1f0)](_0x2b6102(0x206)+_0x197e20),_0x37487d&&console[_0x2b6102(0x1f0)](_0x2b6102(0x188)));let _0x50c0bd;if(_0x197e20)try{if(_0x197e20[_0x2b6102(0x2b9)]('@')){const _0x2f4011=await import(_0x2b6102(0x311)),_0x4a6358=_0x197e20[_0x2b6102(0x34e)](0x1),_0x3709fd=await _0x2f4011['readFile'](_0x4a6358,_0x2b6102(0x256));_0x50c0bd=JSON[_0x2b6102(0x2c4)](_0x3709fd);}else _0x50c0bd=JSON[_0x2b6102(0x2c4)](_0x197e20);}catch{return console[_0x2b6102(0x1f0)](_0x2b6102(0x211)),0x1;}if(!_0x490958[_0x2b6102(0x22f)]){if(!isInteractive())return console[_0x2b6102(0x1f0)](a54_0x438284[_0x2b6102(0x282)](_0x2b6102(0x2cd)),_0x2b6102(0x2e4)),console[_0x2b6102(0x1f0)](a54_0x438284[_0x2b6102(0x310)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x22ca3=await confirmKey(_0x2b6102(0x2b8)+(_0x413b43?_0x2b6102(0x233):'attempt')+'\x20'+_0x21ad6f+'?');if(!_0x22ca3)return console[_0x2b6102(0x1f0)](a54_0x438284[_0x2b6102(0x264)](_0x2b6102(0x27a))),0x1;}let _0x1aa0a2;_0x413b43?_0x1aa0a2=await withSpinner(_0x2b6102(0x253),()=>_0x3e85fd[_0x2b6102(0x1bb)][_0x2b6102(0x248)](_0x21ad6f,{'fromTask':_0x50d482,'retryParams':_0x50c0bd}),{'verbose':_0x490958[_0x2b6102(0x192)]}):_0x1aa0a2=await withSpinner(_0x2b6102(0x2d4),()=>_0x3e85fd[_0x2b6102(0x1bb)][_0x2b6102(0x298)](_0x21ad6f,{'resumeFrom':_0x2563dd,'retryParams':_0x50c0bd,'force':_0x37487d}),{'verbose':_0x490958['verbose']});const _0x27819a=_0x1aa0a2[_0x2b6102(0x213)];return console['error'](_0x2b6102(0x333)),console['error'](_0x2b6102(0x2e5)+_0x27819a[_0x2b6102(0x292)]),console[_0x2b6102(0x1f0)](_0x2b6102(0x252)+_0x27819a['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']='workflow:run';[a54_0x28aa77(0x205)]=a54_0x28aa77(0x285);async[a54_0x28aa77(0x270)](_0x36ac54){const _0x1c0ec0=a54_0x28aa77,{options:_0x415cb7,args:_0x3a382a,tdx:_0x41ae61}=_0x36ac54;let _0x1099db=_0x3a382a[0x0];if(!_0x1099db){const _0x36967d=this['resolveProject']([],_0x415cb7),_0x171474=await withSpinner(_0x1c0ec0(0x2ac),()=>_0x41ae61[_0x1c0ec0(0x1bb)]['workflows'](_0x36967d,{'limit':_0x415cb7['limit']}),{'verbose':_0x415cb7[_0x1c0ec0(0x192)]}),_0x2d0d90=_0x171474[_0x1c0ec0(0x213)];if(_0x2d0d90[_0x1c0ec0(0x191)]===0x0)return console[_0x1c0ec0(0x1f0)]('No\x20workflows\x20found'),!_0x36967d&&console[_0x1c0ec0(0x1f0)](a54_0x438284[_0x1c0ec0(0x310)](_0x1c0ec0(0x20c))),0x1;const _0x11e9ac=_0x2d0d90['map'](_0x53a5f2=>({'title':_0x53a5f2['project']?.[_0x1c0ec0(0x25c)]+'.'+_0x53a5f2[_0x1c0ec0(0x25c)],'value':_0x53a5f2['project']?.['name']+'.'+_0x53a5f2[_0x1c0ec0(0x25c)],'description':_0x53a5f2['revision']?_0x1c0ec0(0x1ef)+_0x53a5f2[_0x1c0ec0(0x33b)]:undefined})),_0xcfef9a=await a54_0x2740c1({'type':'select','name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x11e9ac});if(!_0xcfef9a[_0x1c0ec0(0x1bb)])return 0x1;_0x1099db=_0xcfef9a[_0x1c0ec0(0x1bb)];}if(!_0x1099db['includes']('.')){const _0x24fff8=this[_0x1c0ec0(0x255)]([],_0x415cb7);if(_0x24fff8)_0x1099db=_0x24fff8+'.'+_0x1099db;else return console[_0x1c0ec0(0x1f0)](a54_0x438284['red'](_0x1c0ec0(0x2e6)),_0x1c0ec0(0x1c1)),console[_0x1c0ec0(0x1f0)](a54_0x438284[_0x1c0ec0(0x310)](_0x1c0ec0(0x20c))),0x1;}const _0x81a740=_0x415cb7['param'],_0x3d1d94=_0x415cb7[_0x1c0ec0(0x1e3)],_0x496a3e={};if(_0x81a740&&Array[_0x1c0ec0(0x1eb)](_0x81a740))for(const _0x4a170c of _0x81a740){const _0x4097b0=_0x4a170c[_0x1c0ec0(0x2e2)]('=');if(_0x4097b0===-0x1)return console[_0x1c0ec0(0x1f0)](_0x1c0ec0(0x2f5)+_0x4a170c),console[_0x1c0ec0(0x1f0)](_0x1c0ec0(0x1ee)),0x1;const _0x440b02=_0x4a170c[_0x1c0ec0(0x34e)](0x0,_0x4097b0),_0x30a54a=_0x4a170c[_0x1c0ec0(0x34e)](_0x4097b0+0x1);try{_0x496a3e[_0x440b02]=JSON[_0x1c0ec0(0x2c4)](_0x30a54a);}catch{_0x496a3e[_0x440b02]=_0x30a54a;}}_0x415cb7['verbose']&&(console[_0x1c0ec0(0x1f0)](_0x1c0ec0(0x235)+_0x1099db),Object[_0x1c0ec0(0x273)](_0x496a3e)[_0x1c0ec0(0x191)]>0x0&&console['error'](_0x1c0ec0(0x342)+JSON[_0x1c0ec0(0x318)](_0x496a3e)),_0x3d1d94&&console[_0x1c0ec0(0x1f0)](_0x1c0ec0(0x32f)+_0x3d1d94));const _0x175af1=await withSpinner(_0x1c0ec0(0x29a),()=>_0x41ae61['workflow'][_0x1c0ec0(0x1c6)](_0x1099db,_0x496a3e,{'sessionTime':_0x3d1d94}),{'verbose':_0x415cb7[_0x1c0ec0(0x192)]}),_0x5d2407=_0x175af1[_0x1c0ec0(0x213)];console[_0x1c0ec0(0x1f0)]('✔\x20Workflow\x20run\x20started'),console[_0x1c0ec0(0x1f0)](_0x1c0ec0(0x284)+_0x5d2407['id']),console[_0x1c0ec0(0x1f0)](_0x1c0ec0(0x252)+_0x5d2407['sessionId']),console[_0x1c0ec0(0x1f0)](_0x1c0ec0(0x32d)+_0x5d2407[_0x1c0ec0(0x1f1)]?.['name']),console[_0x1c0ec0(0x1f0)](_0x1c0ec0(0x2b7)+_0x5d2407[_0x1c0ec0(0x1bb)]?.[_0x1c0ec0(0x25c)]);if(_0x5d2407[_0x1c0ec0(0x1f1)]?.['id']&&_0x5d2407[_0x1c0ec0(0x287)]&&_0x5d2407['id']){const _0x1d9e3d=_0x415cb7[_0x1c0ec0(0x312)],_0x63f8fb=getConsoleUrl(_0x1d9e3d,_0x1c0ec0(0x334)+_0x5d2407[_0x1c0ec0(0x1f1)]['id']+_0x1c0ec0(0x22b)+_0x5d2407[_0x1c0ec0(0x287)]+'/attempt/'+_0x5d2407['id']);console[_0x1c0ec0(0x1f0)](_0x1c0ec0(0x345)+a54_0x438284[_0x1c0ec0(0x335)](_0x63f8fb));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x25b);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x224);async[a54_0x28aa77(0x270)](_0x290238){const _0x3bfef6=a54_0x28aa77,{options:_0x543e94,args:_0x207b71,tdx:_0x4fbafe}=_0x290238,_0x45d542=_0x207b71[0x0],_0x5b1043=_0x207b71[0x1]||'.';if(!_0x45d542)return console['error'](_0x3bfef6(0x32c)),console[_0x3bfef6(0x1f0)](_0x3bfef6(0x249)),0x1;const _0x45d6ac=_0x543e94[_0x3bfef6(0x33b)];_0x543e94[_0x3bfef6(0x192)]&&(console[_0x3bfef6(0x1f0)]('Project:\x20'+_0x45d542),console[_0x3bfef6(0x1f0)](_0x3bfef6(0x258)+_0x5b1043),_0x45d6ac&&console['error']('Revision:\x20'+_0x45d6ac));const _0x25a3b3=await withSpinner('Downloading\x20project\x20'+_0x45d542+_0x3bfef6(0x31e),()=>_0x4fbafe[_0x3bfef6(0x1bb)][_0x3bfef6(0x1d0)](_0x45d542,_0x5b1043,{'revision':_0x45d6ac}),{'verbose':_0x543e94[_0x3bfef6(0x192)]}),_0x77f0bd=_0x25a3b3[_0x3bfef6(0x213)];return console['error'](_0x3bfef6(0x314)+_0x77f0bd[_0x3bfef6(0x185)]),console['error'](_0x3bfef6(0x20d)+_0x77f0bd['revision']),console[_0x3bfef6(0x1f0)](_0x3bfef6(0x1a9)+_0x77f0bd['filesExtracted']),console[_0x3bfef6(0x1f0)](_0x3bfef6(0x2da)+_0x5b1043+'/'+_0x77f0bd[_0x3bfef6(0x185)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x28aa77(0x25c)]='workflow:upload';['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a54_0x28aa77(0x270)](_0xb8d8ab){const _0x30a0ea=a54_0x28aa77,{options:_0x17714e,args:_0x4872c2,tdx:_0x1a80ad}=_0xb8d8ab;let _0x3405dd='.',_0x19efec=_0x17714e['name'];if(_0x4872c2[0x0]){const {promises:_0x390823}=await import('fs');try{const _0x35231e=await _0x390823['stat'](_0x4872c2[0x0]);if(_0x35231e[_0x30a0ea(0x231)]())_0x3405dd=_0x4872c2[0x0];else return console['error']('Error:\x20'+_0x4872c2[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x19efec=_0x4872c2[0x0],_0x3405dd='.';}}const _0x1882c8=_0x17714e[_0x30a0ea(0x33b)],_0x5ef1fc=_0x17714e['skipValidation'];_0x17714e[_0x30a0ea(0x192)]&&(console['error'](_0x30a0ea(0x304)+_0x3405dd),_0x19efec&&console[_0x30a0ea(0x1f0)](_0x30a0ea(0x296)+_0x19efec),_0x1882c8&&console['error'](_0x30a0ea(0x1a0)+_0x1882c8),_0x5ef1fc&&console[_0x30a0ea(0x1f0)]('Validation:\x20skipped'));const _0x105603=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x1a80ad['workflow'][_0x30a0ea(0x223)](_0x3405dd,{'projectName':_0x19efec,'revision':_0x1882c8,'skipValidation':_0x5ef1fc}),{'verbose':_0x17714e[_0x30a0ea(0x192)]}),_0x1d4b56=_0x105603['data'];return console[_0x30a0ea(0x1f0)]('✔\x20Pushed\x20'+_0x1d4b56[_0x30a0ea(0x185)]),console[_0x30a0ea(0x1f0)](_0x30a0ea(0x31a)+_0x1d4b56[_0x30a0ea(0x236)]),console[_0x30a0ea(0x1f0)](_0x30a0ea(0x20d)+_0x1d4b56['revision']),await this[_0x30a0ea(0x2d5)](_0x1a80ad,_0x1d4b56[_0x30a0ea(0x185)],_0x17714e[_0x30a0ea(0x312)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x2a8);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x324);async[a54_0x28aa77(0x270)](_0x1fc905){const _0x254894=a54_0x28aa77,{options:_0x30367e,args:_0x5abe85,tdx:_0x425af2}=_0x1fc905,_0x3930cf=_0x5abe85[0x0],_0x2ad5bd=_0x5abe85[0x1];if(!_0x3930cf)return console[_0x254894(0x1f0)](a54_0x438284[_0x254894(0x282)]('Error:'),_0x254894(0x2cc)),console[_0x254894(0x1f0)](a54_0x438284[_0x254894(0x310)](_0x254894(0x1e6))),0x1;const _0x109ea6=_0x30367e['revision'];_0x30367e['verbose']&&(console[_0x254894(0x1f0)](_0x254894(0x1dd)+_0x3930cf),_0x2ad5bd&&console['error']('Target\x20directory:\x20'+_0x2ad5bd),_0x109ea6&&console[_0x254894(0x1f0)]('Revision:\x20'+_0x109ea6),_0x30367e[_0x254894(0x216)]&&console[_0x254894(0x1f0)](_0x254894(0x232)));const _0x36fb46=await withSpinner(_0x254894(0x321)+_0x3930cf+'...',()=>_0x425af2[_0x254894(0x1bb)][_0x254894(0x1af)](_0x3930cf,{'targetDir':_0x2ad5bd,'revision':_0x109ea6}),{'verbose':_0x30367e['verbose']}),_0x30e04e=_0x36fb46[_0x254894(0x213)];_0x30e04e[_0x254894(0x26c)]?console['error'](_0x254894(0x2a9)+_0x30e04e[_0x254894(0x185)]):console[_0x254894(0x1f0)](_0x254894(0x24d)+_0x30e04e[_0x254894(0x185)]);console['error']('\x20\x20Revision:\x20'+_0x30e04e[_0x254894(0x33b)]),console['error'](_0x254894(0x182)+(a54_0x36036a[_0x254894(0x21a)](process[_0x254894(0x26d)](),_0x30e04e[_0x254894(0x228)])||'.')),console[_0x254894(0x1f0)](_0x254894(0x183)+a54_0x438284[_0x254894(0x1ba)]('+'+_0x30e04e[_0x254894(0x288)][_0x254894(0x244)]+_0x254894(0x2fe))+',\x20'+(a54_0x438284['yellow']('~'+_0x30e04e['summary']['modified']+'\x20modified')+',\x20')+(a54_0x438284[_0x254894(0x282)]('-'+_0x30e04e[_0x254894(0x288)]['deleted']+_0x254894(0x1db))+',\x20')+(''+a54_0x438284[_0x254894(0x310)](_0x30e04e['summary']['unchanged']+_0x254894(0x2ba))));for(const _0xbdd157 of _0x30e04e[_0x254894(0x1d2)]){_0xbdd157[_0x254894(0x2f9)]==='modified'&&_0xbdd157['diff']&&(console['error']('\x0a'+a54_0x438284[_0x254894(0x335)]('---\x20'+_0xbdd157['path'])),console[_0x254894(0x1f0)](_0xbdd157[_0x254894(0x22e)]));}if(!_0x30e04e[_0x254894(0x2b5)])return saveSessionContext({'workflow_project':_0x30e04e[_0x254894(0x185)]},_0x30367e['session']),console[_0x254894(0x1f0)](a54_0x438284[_0x254894(0x1ba)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x254894(0x1f0)](a54_0x438284[_0x254894(0x310)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x30e04e[_0x254894(0x185)])),0x0;if(_0x30367e['dryRun'])return console[_0x254894(0x1f0)](a54_0x438284[_0x254894(0x264)](_0x254894(0x1bd))),0x0;if(!_0x30367e['yes']){if(!isInteractive())return console[_0x254894(0x1f0)](a54_0x438284['red'](_0x254894(0x2cd)),_0x254894(0x2e4)),console[_0x254894(0x1f0)](a54_0x438284['dim'](_0x254894(0x194))),0x1;const _0x191bdb=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x191bdb)return console['error'](a54_0x438284[_0x254894(0x264)]('Cancelled'),_0x254894(0x2fd)),0x1;}await withSpinner(_0x254894(0x2be),()=>_0x425af2['workflow']['applyPullProject'](_0x30e04e,{'revision':_0x109ea6}),{'verbose':_0x30367e[_0x254894(0x192)]}),saveSessionContext({'workflow_project':_0x30e04e['projectName']},_0x30367e[_0x254894(0x233)]),console[_0x254894(0x1f0)](a54_0x438284[_0x254894(0x1ba)](_0x254894(0x322)));const _0x3b27a5=a54_0x36036a[_0x254894(0x21a)](process[_0x254894(0x26d)](),_0x30e04e[_0x254894(0x228)])||'.';return console['error'](a54_0x438284['dim'](_0x254894(0x2da)+_0x3b27a5)),console[_0x254894(0x1f0)](a54_0x438284[_0x254894(0x310)](_0x254894(0x27d)+_0x30e04e[_0x254894(0x185)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x28aa77(0x25c)]='workflow:push';['description']=a54_0x28aa77(0x234);async[a54_0x28aa77(0x270)](_0x3f0e2e){const _0x3b8934=a54_0x28aa77,{options:_0x3713bd,args:_0x4c01ac,tdx:_0x1249cd}=_0x3f0e2e,_0x32f2ee=this[_0x3b8934(0x2f0)](_0x4c01ac,_0x3713bd),_0x1dbb39=_0x3713bd[_0x3b8934(0x33b)],_0x3368a3=_0x3713bd[_0x3b8934(0x1d7)];_0x3713bd['verbose']&&(_0x32f2ee&&console['error'](_0x3b8934(0x2b2)+_0x32f2ee),_0x1dbb39&&console['error'](_0x3b8934(0x1a0)+_0x1dbb39),_0x3713bd[_0x3b8934(0x216)]&&console[_0x3b8934(0x1f0)]('Dry\x20run:\x20yes'),_0x3368a3&&console[_0x3b8934(0x1f0)](_0x3b8934(0x2ad)));let _0x55542d;try{_0x55542d=await withSpinner(_0x3b8934(0x30a),()=>_0x1249cd[_0x3b8934(0x1bb)][_0x3b8934(0x217)]({'sourceDir':_0x32f2ee,'revision':_0x1dbb39,'skipValidation':_0x3368a3}),{'verbose':_0x3713bd[_0x3b8934(0x192)]});}catch(_0x4ad58d){if(_0x4ad58d instanceof Error&&_0x4ad58d[_0x3b8934(0x2a4)][_0x3b8934(0x2d7)](_0x3b8934(0x30d)))return console[_0x3b8934(0x1f0)](a54_0x438284[_0x3b8934(0x282)]('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x3713bd[_0x3b8934(0x218)]?console['error'](a54_0x438284[_0x3b8934(0x310)](_0x3b8934(0x1a8)+_0x3713bd[_0x3b8934(0x218)]+_0x3b8934(0x2f4)+_0x3713bd[_0x3b8934(0x218)]+'\x27')):console[_0x3b8934(0x1f0)](a54_0x438284[_0x3b8934(0x310)](_0x3b8934(0x2c8))),0x1;throw _0x4ad58d;}const _0x273e14=_0x55542d['data'];console[_0x3b8934(0x1f0)](_0x3b8934(0x1e5)+_0x273e14[_0x3b8934(0x185)]),console['error'](_0x3b8934(0x1f7)+_0x273e14[_0x3b8934(0x2a1)]),console[_0x3b8934(0x1f0)](_0x3b8934(0x20d)+_0x273e14[_0x3b8934(0x33b)]),console[_0x3b8934(0x1f0)]('\x20\x20Changes:\x20'+a54_0x438284[_0x3b8934(0x1ba)]('+'+_0x273e14[_0x3b8934(0x288)][_0x3b8934(0x244)]+_0x3b8934(0x2fe))+',\x20'+(a54_0x438284[_0x3b8934(0x264)]('~'+_0x273e14[_0x3b8934(0x288)]['modified']+_0x3b8934(0x203))+',\x20')+(a54_0x438284[_0x3b8934(0x282)]('-'+_0x273e14['summary'][_0x3b8934(0x1f8)]+'\x20deleted')+',\x20')+(''+a54_0x438284[_0x3b8934(0x310)](_0x273e14['summary'][_0x3b8934(0x2bf)]+_0x3b8934(0x2ba))));for(const _0x9b6f38 of _0x273e14[_0x3b8934(0x1d2)]){_0x9b6f38['type']===_0x3b8934(0x299)&&_0x9b6f38[_0x3b8934(0x22e)]&&(console['error']('\x0a'+a54_0x438284['cyan'](_0x3b8934(0x1c5)+_0x9b6f38[_0x3b8934(0x1be)])),console[_0x3b8934(0x1f0)](_0x9b6f38[_0x3b8934(0x22e)]));}if(!_0x273e14['hasChanges'])return console[_0x3b8934(0x1f0)](a54_0x438284[_0x3b8934(0x1ba)](_0x3b8934(0x1b7))),await this[_0x3b8934(0x2d5)](_0x1249cd,_0x273e14['projectName'],_0x3713bd['site']),0x0;if(_0x3713bd[_0x3b8934(0x216)])return console[_0x3b8934(0x1f0)](a54_0x438284[_0x3b8934(0x264)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x3713bd[_0x3b8934(0x22f)]){if(!isInteractive())return console[_0x3b8934(0x1f0)](a54_0x438284[_0x3b8934(0x282)](_0x3b8934(0x2cd)),_0x3b8934(0x2e4)),console[_0x3b8934(0x1f0)](a54_0x438284[_0x3b8934(0x310)](_0x3b8934(0x194))),0x1;const _0x3e0533=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x3e0533)return console[_0x3b8934(0x1f0)](a54_0x438284['yellow'](_0x3b8934(0x27a)),_0x3b8934(0x30e)),0x1;}const _0x19ab6e=await withSpinner(_0x3b8934(0x199),()=>_0x1249cd['workflow'][_0x3b8934(0x2b0)](_0x273e14),{'verbose':_0x3713bd[_0x3b8934(0x192)]}),_0x48f88e=_0x19ab6e[_0x3b8934(0x213)];return console[_0x3b8934(0x1f0)](a54_0x438284[_0x3b8934(0x1ba)](_0x3b8934(0x1cf))),console[_0x3b8934(0x1f0)](_0x3b8934(0x31a)+_0x48f88e[_0x3b8934(0x236)]),console[_0x3b8934(0x1f0)]('\x20\x20Revision:\x20'+_0x48f88e['revision']),await this['showWorkflowConsoleUrl'](_0x1249cd,_0x48f88e['projectName'],_0x3713bd['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x28aa77(0x25c)]='workflow:clone';[a54_0x28aa77(0x205)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x28aa77(0x270)](_0x4af95a){const _0x376c72=a54_0x28aa77,{options:_0x5bee00,args:_0xa97430,tdx:_0x10c756}=_0x4af95a,_0x49ca0c=this[_0x376c72(0x2f0)](_0xa97430,_0x5bee00),_0x496021=_0x5bee00['name'],_0x32c623=_0x5bee00['revision'],_0x2a2ca1=_0x5bee00[_0x376c72(0x1d7)];if(!_0x49ca0c)return console[_0x376c72(0x1f0)](a54_0x438284[_0x376c72(0x282)](_0x376c72(0x2e6)),_0x376c72(0x1e8)),console[_0x376c72(0x1f0)](a54_0x438284[_0x376c72(0x310)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x376c72(0x1f0)](a54_0x438284[_0x376c72(0x310)](_0x376c72(0x22a))),0x1;if(!_0x496021)return console[_0x376c72(0x1f0)](a54_0x438284[_0x376c72(0x282)](_0x376c72(0x2e6)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console['error'](a54_0x438284[_0x376c72(0x310)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5bee00[_0x376c72(0x192)]&&(console[_0x376c72(0x1f0)]('Source\x20directory:\x20'+_0x49ca0c),console['error'](_0x376c72(0x302)+_0x496021),_0x32c623&&console[_0x376c72(0x1f0)]('Revision:\x20'+_0x32c623),_0x5bee00[_0x376c72(0x216)]&&console[_0x376c72(0x1f0)]('Dry\x20run:\x20yes'),_0x2a2ca1&&console[_0x376c72(0x1f0)](_0x376c72(0x2ad)));const _0x30bd08=await withSpinner(_0x376c72(0x307),()=>_0x10c756[_0x376c72(0x1bb)][_0x376c72(0x2e7)](_0x49ca0c,_0x496021,{'revision':_0x32c623,'skipValidation':_0x2a2ca1}),{'verbose':_0x5bee00['verbose']}),_0x3dc227=_0x30bd08[_0x376c72(0x213)];console['error']('Source:\x20'+_0x3dc227[_0x376c72(0x2a1)]);_0x3dc227[_0x376c72(0x243)]&&console[_0x376c72(0x1f0)](_0x376c72(0x18c)+_0x3dc227['sourceProjectName']);console[_0x376c72(0x1f0)]('New\x20project\x20name:\x20'+_0x3dc227[_0x376c72(0x31b)]),console[_0x376c72(0x1f0)](_0x376c72(0x1a0)+_0x3dc227[_0x376c72(0x33b)]),console[_0x376c72(0x1f0)](_0x376c72(0x309)+_0x3dc227[_0x376c72(0x23b)]);_0x3dc227['targetExists']&&(console[_0x376c72(0x1f0)](a54_0x438284[_0x376c72(0x264)]('\x0a⚠\x20Project\x20\x22'+_0x3dc227['newProjectName']+'\x22\x20already\x20exists\x20(ID:\x20'+_0x3dc227[_0x376c72(0x1e4)]+')')),console['error'](a54_0x438284['yellow'](_0x376c72(0x1f6))));if(_0x5bee00['dryRun'])return console[_0x376c72(0x1f0)](a54_0x438284[_0x376c72(0x264)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x5bee00['yes']){if(!isInteractive())return console[_0x376c72(0x1f0)](a54_0x438284[_0x376c72(0x282)](_0x376c72(0x2cd)),_0x376c72(0x2e4)),console[_0x376c72(0x1f0)](a54_0x438284['dim'](_0x376c72(0x194))),0x1;const _0x4977cf=_0x3dc227[_0x376c72(0x243)]||a54_0x36036a[_0x376c72(0x28d)](_0x49ca0c),_0x19ca62=_0x3dc227['targetExists']?_0x376c72(0x1e0)+_0x496021+_0x376c72(0x238):_0x376c72(0x1d4)+_0x4977cf+_0x376c72(0x230)+_0x496021+'\x22?',_0x3b5e8b=await confirmKey(_0x19ca62);if(!_0x3b5e8b)return console[_0x376c72(0x1f0)](a54_0x438284[_0x376c72(0x264)](_0x376c72(0x27a))),0x1;}const _0x3119bb=await withSpinner(_0x3dc227[_0x376c72(0x280)]?'Updating\x20'+_0x496021+_0x376c72(0x31e):_0x376c72(0x1ca)+_0x496021+_0x376c72(0x31e),()=>_0x10c756['workflow'][_0x376c72(0x330)](_0x3dc227),{'verbose':_0x5bee00[_0x376c72(0x192)]}),_0x22aaa3=_0x3119bb[_0x376c72(0x213)];return console[_0x376c72(0x1f0)](a54_0x438284['green'](_0x3dc227[_0x376c72(0x280)]?_0x376c72(0x30f):_0x376c72(0x222))),console['error'](_0x376c72(0x32d)+_0x22aaa3[_0x376c72(0x31b)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x22aaa3[_0x376c72(0x346)]),console[_0x376c72(0x1f0)](_0x376c72(0x20d)+_0x22aaa3[_0x376c72(0x33b)]),await this['showWorkflowConsoleUrl'](_0x10c756,_0x22aaa3[_0x376c72(0x31b)],_0x5bee00['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x31d);['description']=a54_0x28aa77(0x308);async[a54_0x28aa77(0x270)](_0x4f5e6c){const _0x174236=a54_0x28aa77,{options:_0x51125b,args:_0x5ce395,tdx:_0x702c54}=_0x4f5e6c,_0x4ea489=_0x5ce395[0x0];if(!_0x4ea489)return console[_0x174236(0x1f0)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x174236(0x1f0)](_0x174236(0x28e)),0x1;_0x51125b[_0x174236(0x192)]&&console[_0x174236(0x1f0)]('Project:\x20'+_0x4ea489);if(!_0x51125b[_0x174236(0x22f)]){if(!isInteractive())return console[_0x174236(0x1f0)](a54_0x438284[_0x174236(0x282)](_0x174236(0x2cd)),_0x174236(0x2e4)),console['error'](a54_0x438284[_0x174236(0x310)](_0x174236(0x194))),0x1;const _0x29532a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x4ea489+_0x174236(0x293));if(!_0x29532a)return console[_0x174236(0x1f0)](a54_0x438284[_0x174236(0x264)](_0x174236(0x27a))),0x1;}const _0x52dd3b=await withSpinner(_0x174236(0x1c2)+_0x4ea489+_0x174236(0x31e),()=>_0x702c54[_0x174236(0x1bb)][_0x174236(0x33e)](_0x4ea489),{'verbose':_0x51125b[_0x174236(0x192)]}),_0x48abd4=_0x52dd3b[_0x174236(0x213)];return console[_0x174236(0x1f0)](_0x174236(0x237)+_0x48abd4[_0x174236(0x185)]),console[_0x174236(0x1f0)](_0x174236(0x31a)+_0x48abd4[_0x174236(0x236)]),0x0;}}export function parseKeyValue(_0x4b3b19){const _0x41bb82=a54_0x28aa77,_0x533d6f=_0x4b3b19[_0x41bb82(0x2e2)]('=');if(_0x533d6f===-0x1)throw new Error(_0x41bb82(0x2db)+_0x4b3b19+_0x41bb82(0x265));const _0x2b2d1f=_0x4b3b19['substring'](0x0,_0x533d6f),_0x18db7e=_0x4b3b19[_0x41bb82(0x34e)](_0x533d6f+0x1);if(!_0x2b2d1f)throw new Error(_0x41bb82(0x2f6));return{'key':_0x2b2d1f,'value':_0x18db7e};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a54_0x28aa77(0x1e9);['description']='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a54_0x28aa77(0x270)](_0x2623c4){const _0x35a83a=a54_0x28aa77,{options:_0x234642,args:_0x2668e1,tdx:_0x499a25}=_0x2623c4,_0x526326=this['requireProject'](_0x2668e1,_0x234642);if(!_0x526326)return 0x1;_0x234642[_0x35a83a(0x192)]&&console[_0x35a83a(0x1f0)](_0x35a83a(0x1dd)+_0x526326);const _0x4aed77=await withSpinner('Listing\x20secrets...',()=>_0x499a25['workflow'][_0x35a83a(0x1c0)](_0x526326),{'verbose':_0x234642[_0x35a83a(0x192)]}),{secrets:_0x4662e7}=_0x4aed77['data'];return console[_0x35a83a(0x1f0)](_0x35a83a(0x1d5)+_0x4662e7[_0x35a83a(0x191)]+_0x35a83a(0x23c)+(_0x4662e7[_0x35a83a(0x191)]!==0x1?'s':'')),await handleSDKOutput(_0x4662e7,_0x234642),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x1ae);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x286);async[a54_0x28aa77(0x270)](_0x2ebecd){const _0x2352ab=a54_0x28aa77,{options:_0x4cea21,args:_0x32c862,tdx:_0x48a7c6}=_0x2ebecd;let _0xba408f,_0x53f07e;if(_0x32c862[_0x2352ab(0x191)]>=0x1&&!_0x32c862[0x0]['includes']('='))_0xba408f=_0x32c862[0x0],_0x53f07e=_0x32c862['slice'](0x1);else{if(_0x32c862[_0x2352ab(0x191)]>=0x1&&_0x4cea21[_0x2352ab(0x218)])_0xba408f=_0x4cea21[_0x2352ab(0x218)],_0x53f07e=_0x32c862;else return _0x32c862[_0x2352ab(0x191)]>=0x1?(console[_0x2352ab(0x1f0)](_0x2352ab(0x32c)),console['error'](_0x2352ab(0x20c)),0x1):(console[_0x2352ab(0x1f0)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x2352ab(0x1f0)](_0x2352ab(0x2e1)),0x1);}if(_0x53f07e[_0x2352ab(0x191)]===0x0)return console[_0x2352ab(0x1f0)](_0x2352ab(0x220)),console[_0x2352ab(0x1f0)](_0x2352ab(0x2e1)),0x1;const _0x58ac8a={};try{for(const _0x15f75c of _0x53f07e){const {key:_0x5eb124,value:_0x2823e7}=parseKeyValue(_0x15f75c);_0x58ac8a[_0x5eb124]=_0x2823e7;}}catch(_0x379124){return _0x379124 instanceof Error&&console[_0x2352ab(0x1f0)](a54_0x438284['red'](_0x2352ab(0x2e6)),_0x379124[_0x2352ab(0x2a4)]),0x1;}const _0x342295=Object[_0x2352ab(0x273)](_0x58ac8a);_0x4cea21[_0x2352ab(0x192)]&&(console[_0x2352ab(0x1f0)](_0x2352ab(0x1dd)+_0xba408f),console[_0x2352ab(0x1f0)](_0x2352ab(0x21c)+_0x342295['join'](',\x20')));const _0x554c0f=await withSpinner(_0x342295[_0x2352ab(0x191)]===0x1?'Setting\x20secret...':_0x2352ab(0x300)+_0x342295['length']+'\x20secrets...',()=>_0x48a7c6[_0x2352ab(0x1bb)]['setSecrets'](_0xba408f,_0x58ac8a),{'verbose':_0x4cea21[_0x2352ab(0x192)]}),_0x163c5d=_0x554c0f[_0x2352ab(0x213)];return console[_0x2352ab(0x1f0)](_0x342295[_0x2352ab(0x191)]===0x1?_0x2352ab(0x2ef)+_0x163c5d[_0x2352ab(0x273)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x163c5d[_0x2352ab(0x185)]+'\x27':'✔\x20'+_0x163c5d[_0x2352ab(0x273)]['length']+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x163c5d[_0x2352ab(0x185)]+'\x27'),(_0x4cea21[_0x2352ab(0x25f)]||_0x4cea21[_0x2352ab(0x2ae)])&&await handleSingleObjectOutput(_0x163c5d,_0x4cea21),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x2aa);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x274);async[a54_0x28aa77(0x270)](_0x599c73){const _0x5a811f=a54_0x28aa77,{options:_0x192cc0,args:_0x5ad550,tdx:_0x46150b}=_0x599c73;let _0xaa9bbc,_0x253354;if(_0x5ad550[_0x5a811f(0x191)]>=0x2)_0xaa9bbc=_0x5ad550[0x0],_0x253354=_0x5ad550[0x1];else{if(_0x5ad550[_0x5a811f(0x191)]===0x1&&_0x192cc0['workflowProject'])_0xaa9bbc=_0x192cc0[_0x5a811f(0x218)],_0x253354=_0x5ad550[0x0];else return _0x5ad550[_0x5a811f(0x191)]===0x1?(console[_0x5a811f(0x1f0)](_0x5a811f(0x32c)),console['error'](_0x5a811f(0x20c)),0x1):(console[_0x5a811f(0x1f0)](_0x5a811f(0x1ed)),console[_0x5a811f(0x1f0)](_0x5a811f(0x305)),0x1);}_0x192cc0[_0x5a811f(0x192)]&&(console[_0x5a811f(0x1f0)]('Project:\x20'+_0xaa9bbc),console[_0x5a811f(0x1f0)](_0x5a811f(0x261)+_0x253354));if(!_0x192cc0['yes']){if(!isInteractive())return console['error'](a54_0x438284['red']('\x0aError:'),_0x5a811f(0x2e4)),console['error'](a54_0x438284['dim'](_0x5a811f(0x194))),0x1;const _0x1c9ca9=await confirmKey(_0x5a811f(0x32b)+_0x253354+_0x5a811f(0x251)+_0xaa9bbc+'\x27?');if(!_0x1c9ca9)return console[_0x5a811f(0x1f0)](a54_0x438284[_0x5a811f(0x264)]('Cancelled')),0x1;}const _0x16b9b2=await withSpinner(_0x5a811f(0x262),()=>_0x46150b[_0x5a811f(0x1bb)]['deleteSecret'](_0xaa9bbc,_0x253354),{'verbose':_0x192cc0[_0x5a811f(0x192)]}),_0x94344e=_0x16b9b2['data'];return console[_0x5a811f(0x1f0)](_0x5a811f(0x2ef)+_0x94344e[_0x5a811f(0x184)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x94344e['projectName']+'\x27'),(_0x192cc0[_0x5a811f(0x25f)]||_0x192cc0[_0x5a811f(0x2ae)])&&await handleSingleObjectOutput(_0x94344e,_0x192cc0),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 a54_0x9c38(){const _0x59eeea=['\x20\x20tdx\x20wf\x20use\x20<project>','taskName','Pushing\x20project...','floor','logFiles','fill','fullName','context','params','Revision:\x20','Session\x20not\x20found:\x20','list','limit','No\x20workflows\x20found','attempt:','Attempt\x20ID:\x20','metadata','Tip:\x20cd\x20to\x20workflows/','\x20\x20Files\x20extracted:\x20','Listing\x20workflows...','(use\x20--limit\x20to\x20see\x20more)','\x0a✔\x20Attempt\x20complete','tdx\x20wf\x20attempt\x20','workflow:secrets:set','pullProject','\x20from\x20session\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','join','splice','session_id','follow','ICON_WIDTH','\x0a✔\x20No\x20changes\x20to\x20push','planned','\x20tasks','green','workflow','No\x20projects\x20match\x20pattern:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','path','Downloading\x20logs...','listSecrets','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Deleting\x20project\x20','Loading\x20sessions...','💡\x20Tip:\x20Use\x20','---\x20','run','generateSessionTimelineRows','finishedAt','table','Cloning\x20to\x20','columns','Warning:','Error:\x20Attempt\x20ID\x20is\x20required','getFullYear','✔\x20Push\x20complete','download','some','changes','split','\x0aClone\x20\x22','✔\x20Found\x20','Kill\x20a\x20running\x20attempt','skipValidation','Enable\x20a\x20workflow\x20schedule','Getting\x20attempt\x20tasks...','workflows','\x20deleted','Killing\x20attempt...','Project:\x20','Retry\x20a\x20session\x20or\x20attempt','total','\x0aUpdate\x20existing\x20project\x20\x22','includeRetried','\x20enabled\x20(','sessionTime','existingProjectId','✔\x20Project:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','reason','Source\x20directory\x20is\x20required','workflow:secrets:list','268932VMncIu','isArray','workflowName','Error:\x20Secret\x20key\x20is\x20required','Expected\x20format:\x20--param\x20key=value','revision:\x20','error','project','Total:\x20','getMonth','MAX_TIMELINE_WIDTH','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20Source:\x20','deleted','Status:\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','resolve','resolveProjectId','No\x20sessions\x20found','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','workflow:projects','Filter:\x20project=','match','buildTimelineData','\x20modified','select','description','Params:\x20','navigateSessionsInteractive','List\x20all\x20workflow\x20projects','nextRunTime','Show\x20logs\x20for\x20a\x20workflow\x20attempt','MIN_LABEL_COUNT','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Revision:\x20','slice','Resume\x20from:\x20','canceling','Error:\x20Invalid\x20JSON\x20in\x20--params','requireProject','data','createdAt','\x20has\x20no\x20attempts','dryRun','preparePushProject','workflowProject','fileSize','relative','1661400mASMhJ','Secrets\x20to\x20set:\x20','getHours','Attempt:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Target:\x20','✔\x20Clone\x20complete','push','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','attempt','No\x20workflow\x20sessions\x20found','📅\x20#','targetDir','2080930FOndbD','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','/sessions/','Getting\x20attempt\x20details...','value','diff','yes','\x22\x20to\x20new\x20project\x20\x22','isDirectory','Dry\x20run:\x20yes','session','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Workflow:\x20','projectId','✔\x20Deleted\x20project\x20','\x22\x20with\x20new\x20revision?','toISOString','List\x20workflow\x20execution\x20sessions','fileCount','\x20secret','No\x20sessions\x20found\x20for:\x20','text','listSchedules','sort','\x20disabled\x20(','TASK_NAME_WIDTH','sourceProjectName','new','resumeFrom','includeSubtasks','workflow:workflows','retrySession','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','No\x20attempts\x20found','cancelRequested','from','→\x20Project:\x20','ICON_SPACING','workflow:use','durationMs','\x27\x20from\x20project\x20\x27','\x20\x20Session\x20ID:\x20','Retrying\x20session...','\x1b[1A\x1b[2K','resolveProject','utf-8','Filter:\x20','Output\x20directory:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','9jEcTOo','workflow:download','name','disabledAt','\x20attempt','json','\x20(use\x20--limit\x20to\x20show\x20more)','Key:\x20','Deleting\x20secret...','\x20schedule','yellow','.\x20Expected\x20format:\x20KEY=VALUE','List\x20workflow\x20schedules','✔\x20Schedule\x20#','map','6vrmgWb','Listing\x20schedules...','38590lOzvdl','isNewProject','cwd','workflow:timeline','state','execute','pollTimeline','parseProjectWorkflowPattern','keys','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x20session','\x27...','workflow:sessions','No\x20sessions\x20with\x20timing\x20information','Disable\x20a\x20workflow\x20schedule','Cancelled','every','round','\x20\x20Session\x20context\x20set\x20to:\x20','replace','workflow:logs','targetExists','Including\x20subtasks:\x20yes','red','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','\x20\x20Attempt\x20ID:\x20','Start\x20a\x20workflow\x20run','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','sessionId','summary','startedAt','all','Task\x20name:\x20','Schedule\x20ID\x20is\x20required','basename','Usage:\x20workflow:delete\x20<project-name-or-id>','values','now','padStart','attemptId','\x22?\x20This\x20cannot\x20be\x20undone.','getMinutes','Using\x20attempt\x20','Project\x20name:\x20','Disabling\x20schedule\x20#','retryAttempt','modified','Starting\x20workflow\x20run...','disableSchedule','Auto-selected\x20latest\x20session:\x20','workflow:attempts','165UuAner','104GvVOgg','Listing\x20workflow\x20sessions...','sourceDir','getDate','\x20(disabled)','message','Project\x20filter:\x20','localeCompare','Select\x20a\x20task\x20to\x20view\x20logs:','workflow:pull','→\x20New\x20project:\x20','workflow:secrets:delete','blue','Loading\x20workflows...','Validation:\x20skipped','jsonl','retryAttemptName','executePushProject','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Source\x20directory:\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','⚠\x20Showing\x20first\x20','hasChanges','renderTimeline','\x20\x20Workflow:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','startsWith','\x20unchanged','renderSingleTimeline','\x20\x20Next\x20run:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Writing\x20files...','unchanged','filter','No\x20matching\x20sessions\x20found','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','List\x20workflow\x20attempts','parse','displayLine','1271388FSetGp','min','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','lastAttempt','write','autocomplete','Project\x20name\x20is\x20required','\x0aError:','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','updatedAt','toLocaleString','tasks','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','unknown','Retrying\x20attempt...','showWorkflowConsoleUrl','status','includes','From\x20task:\x20','✔\x20Showing\x20','\x20\x20Location:\x20','Invalid\x20format:\x20','running','trimEnd','Resolving\x20project\x20\x27','386019XuXskh','logs','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','indexOf','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20New\x20attempt\x20ID:\x20','Error:','prepareCloneProject','white','No\x20workflows\x20found\x20in\x20project:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','POLL_INTERVAL_MS','workflow:tasks','isTTY','msPerChar','✔\x20Secret\x20\x27','resolveProjectDir','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','LABEL_WIDTH_DIVISOR','getTime','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Error:\x20Invalid\x20parameter\x20format:\x20','Key\x20cannot\x20be\x20empty','set','trim','type','Latest\x20session\x20has\x20no\x20attempt','MIN_TIMELINE_WIDTH','stdout','-\x20no\x20files\x20written','\x20new','renderSessionsTimeline','Setting\x20','index','New\x20project\x20name:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Project\x20directory:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','repeat','Analyzing\x20project...','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Files\x20to\x20upload:\x20','Analyzing\x20changes...','No\x20sessions\x20found\x20in\x20project:\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20workflow\x20tdx.json\x20found','-\x20nothing\x20pushed','✔\x20Project\x20updated','dim','fs/promises','site','MAX_POLL_ITERATIONS','✔\x20Downloaded\x20','window','max','workflow:attempt','stringify','No\x20workflow\x20projects\x20found','\x20\x20Project\x20ID:\x20','newProjectName','181574yWVqxh','workflow:delete','...','Fetching\x20log\x20files...','🔄\x20','Pulling\x20project\x20','✔\x20Pull\x20complete','success','Pull\x20workflow\x20project\x20to\x20local\x20folder','Loading\x20session...','workflow:schedule:disable','Listing\x20workflow\x20attempts...','sessions','group_error','\x20next:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Error:\x20Project\x20name\x20is\x20required','\x20\x20Project:\x20','toLowerCase','Session\x20time:\x20','executeCloneProject','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20sessions\x20','✔\x20Retry\x20started','/app/workflows/','cyan','14QivHgS','format','startTime','task','(unknown)','revision','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','workflow:schedules','delete','log','pending','\x20-\x20','Parameters:\x20','Enabling\x20schedule\x20#','\x20project','\x20\x20Console:\x20','newProjectId','MAX_TASKS_DISPLAY','Session\x20','start','Failed\x20to\x20fetch\x20attempt\x20data','output','find','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','substring','end','\x20\x20Target:\x20','\x20\x20Changes:\x20','key','projectName','get','Pattern:\x20','Force:\x20yes','duration','rows','has','Source\x20project:\x20','workflow:kill','icon','title','\x20task','length','verbose','📋\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','done','Usage:\x20tdx\x20wf\x20use\x20<project>'];a54_0x9c38=function(){return _0x59eeea;};return a54_0x9c38();}function formatElapsed(_0x3aded9){const _0x42ff05=a54_0x28aa77,_0x3c63b6=Math[_0x42ff05(0x19a)](_0x3aded9/0x3e8),_0x473711=Math[_0x42ff05(0x19a)](_0x3c63b6/0x3c),_0x3663ee=Math[_0x42ff05(0x19a)](_0x473711/0x3c),_0x45c043=Math[_0x42ff05(0x19a)](_0x3663ee/0x18);if(_0x45c043>0x0){const _0x15e154=_0x3663ee%0x18;return _0x15e154>0x0?_0x45c043+'d\x20'+_0x15e154+'h':_0x45c043+'d';}else{if(_0x3663ee>0x0){const _0x1e7b07=_0x473711%0x3c;return _0x1e7b07>0x0?_0x3663ee+'h\x20'+_0x1e7b07+'m':_0x3663ee+'h';}else{if(_0x473711>0x0){const _0x5e8146=_0x3c63b6%0x3c;return _0x5e8146>0x0?_0x473711+'m\x20'+_0x5e8146+'s':_0x473711+'m';}else return _0x3c63b6+'s';}}}function formatTimestamp(_0x491f5a,_0x376e1f){const _0x23ec12=a54_0x28aa77,_0xa06283=new Date(_0x491f5a),_0x54b7e4=String(_0xa06283[_0x23ec12(0x21d)]())[_0x23ec12(0x291)](0x2,'0'),_0xcee4ed=String(_0xa06283[_0x23ec12(0x294)]())['padStart'](0x2,'0'),_0x2000f9=_0x54b7e4+':'+_0xcee4ed,_0x1339d4=_0xa06283[_0x23ec12(0x1ce)]()===_0x376e1f[_0x23ec12(0x1ce)]()&&_0xa06283[_0x23ec12(0x1f3)]()===_0x376e1f[_0x23ec12(0x1f3)]()&&_0xa06283[_0x23ec12(0x2a2)]()===_0x376e1f['getDate']();if(_0x1339d4)return _0x2000f9;else{const _0x2d6c0a=String(_0xa06283[_0x23ec12(0x1f3)]()+0x1)[_0x23ec12(0x291)](0x2,'0'),_0x295929=String(_0xa06283[_0x23ec12(0x2a2)]())[_0x23ec12(0x291)](0x2,'0');return _0x2d6c0a+'-'+_0x295929+'\x20'+_0x2000f9;}}function a54_0xfee4(_0x14df2f,_0x57fc2e){_0x14df2f=_0x14df2f-0x182;const _0x9c383=a54_0x9c38();let _0xfee4b7=_0x9c383[_0x14df2f];return _0xfee4b7;}function formatDate(_0x8aadb0){const _0x2df3e1=a54_0x28aa77,_0x4333e2=_0x8aadb0[_0x2df3e1(0x1ce)](),_0xc52a2a=String(_0x8aadb0['getMonth']()+0x1)[_0x2df3e1(0x291)](0x2,'0'),_0x1f48d6=String(_0x8aadb0[_0x2df3e1(0x2a2)]())['padStart'](0x2,'0');return _0x4333e2+'-'+_0xc52a2a+'-'+_0x1f48d6;}function getTaskStateIcon(_0x1c1c5d){const _0x35cdbb={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x35cdbb[_0x1c1c5d]||'⚪';}function getBarChar(_0x4a3ec9){return _0x4a3ec9==='error'||_0x4a3ec9==='group_error'?'×':'─';}function getBarColor(_0x2eb2a7){const _0x542b74=a54_0x28aa77,_0x2630a8={'success':a54_0x438284[_0x542b74(0x1ba)],'error':a54_0x438284[_0x542b74(0x282)],'group_error':a54_0x438284['red'],'running':a54_0x438284[_0x542b74(0x2ab)],'blocked':a54_0x438284[_0x542b74(0x264)],'planned':a54_0x438284['dim'],'canceling':a54_0x438284[_0x542b74(0x264)]};return _0x2630a8[_0x2eb2a7]||a54_0x438284[_0x542b74(0x2e8)];}function parseTaskName(_0x304eed){const _0x12f8ae=a54_0x28aa77;let _0x875607=_0x304eed[_0x12f8ae(0x27e)](/^\++/,'');const _0x32e4ce=_0x875607['split']('+'),_0xc6e967=_0x32e4ce[_0x12f8ae(0x191)]>0x1?_0x32e4ce['length']-0x2:0x0,_0x4eb85d=_0x32e4ce[_0x32e4ce[_0x12f8ae(0x191)]-0x1]||_0x875607;return{'level':_0xc6e967,'name':'+'+_0x4eb85d};}function truncateTaskName(_0x192fda,_0xefa78c){const _0x46dcba=stringWidth(_0x192fda);if(_0x46dcba<=_0xefa78c)return _0x192fda;let _0x5ac2b8=_0x192fda;while(stringWidth(_0x5ac2b8+'…')>_0xefa78c&&_0x5ac2b8['length']>0x0){_0x5ac2b8=_0x5ac2b8['slice'](0x0,-0x1);}return _0x5ac2b8+'…';}function calculateTimeScale(_0x365591,_0x39e249){const _0x2854b0=a54_0x28aa77;return{'startTime':_0x365591[_0x2854b0(0x349)],'endTime':_0x365591[_0x2854b0(0x34f)],'durationMs':_0x365591[_0x2854b0(0x189)],'msPerChar':_0x365591[_0x2854b0(0x189)]/_0x39e249};}function timeToPosition(_0x26c724,_0x5ac63e,_0xc05f77){const _0x2c2054=a54_0x28aa77,_0x3f1034=_0x26c724-_0x5ac63e['startTime'],_0x3d126b=Math[_0x2c2054(0x19a)](_0x3f1034/_0x5ac63e[_0x2c2054(0x2ee)]);return Math['max'](0x0,Math[_0x2c2054(0x2c7)](_0x3d126b,_0xc05f77));}function renderTimeAxis(_0xdd5659,_0x5f4bf7){const _0x5faa2c=a54_0x28aa77,_0x13aa2d=Math[_0x5faa2c(0x2c7)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x5faa2c(0x316)](TIMELINE_CONFIG[_0x5faa2c(0x20b)],Math[_0x5faa2c(0x19a)](_0x5f4bf7/TIMELINE_CONFIG[_0x5faa2c(0x2f2)]))),_0x2a3e22=_0xdd5659[_0x5faa2c(0x250)]/(_0x13aa2d-0x1),_0x47f335=new Date(_0xdd5659[_0x5faa2c(0x338)]),_0x5543a2=[];for(let _0x349b6a=0x0;_0x349b6a<_0x13aa2d;_0x349b6a++){const _0x331823=_0xdd5659[_0x5faa2c(0x338)]+_0x349b6a*_0x2a3e22,_0x5a9d59=timeToPosition(_0x331823,_0xdd5659,_0x5f4bf7),_0x167382=formatTimestamp(_0x331823,_0x47f335);_0x5543a2[_0x5faa2c(0x223)]({'pos':_0x5a9d59,'text':_0x167382});}const _0x2b2796=new Array(_0x5f4bf7)['fill']('\x20');let _0x3d9e79=-0x1;for(const {pos:_0xedbe33,text:_0x2de65d}of _0x5543a2){let _0x1e0be4=Math[_0x5faa2c(0x316)](0x0,_0xedbe33-Math[_0x5faa2c(0x19a)](_0x2de65d[_0x5faa2c(0x191)]/0x2));_0x1e0be4<=_0x3d9e79+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x1e0be4=_0x3d9e79+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x1e0be4+_0x2de65d[_0x5faa2c(0x191)]>_0x5f4bf7&&(_0x1e0be4=_0x5f4bf7-_0x2de65d['length']);if(_0x1e0be4>=0x0&&_0x1e0be4+_0x2de65d[_0x5faa2c(0x191)]<=_0x5f4bf7&&_0x1e0be4>_0x3d9e79){for(let _0x2cff0f=0x0;_0x2cff0f<_0x2de65d[_0x5faa2c(0x191)];_0x2cff0f++){_0x2b2796[_0x1e0be4+_0x2cff0f]=_0x2de65d[_0x2cff0f];}_0x3d9e79=_0x1e0be4+_0x2de65d[_0x5faa2c(0x191)]-0x1;}}return _0x2b2796[_0x5faa2c(0x1b2)]('');}function renderTaskRow(_0x4e3b88,_0x3598ba,_0x5899ac,_0x27a8d3){const _0x40c4a5=a54_0x28aa77,{level:_0x33b59a,name:_0x10dd80}=parseTaskName(_0x4e3b88[_0x40c4a5(0x25c)]),_0x53f475='\x20'[_0x40c4a5(0x306)](_0x33b59a),_0x12c942=_0x4e3b88[_0x40c4a5(0x315)]?'('+formatElapsed(_0x4e3b88[_0x40c4a5(0x315)]['duration'])+')':'',_0x27da98=stringWidth(_0x12c942),_0x6c3617=_0x33b59a*0x1,_0x15922e=_0x27a8d3-_0x6c3617-_0x27da98-0x1,_0x537c66=truncateTaskName(_0x10dd80,_0x15922e),_0x119021=_0x53f475+_0x537c66,_0x142279=stringWidth(_0x119021),_0x4e0671=_0x27a8d3-_0x142279-_0x27da98,_0xf2fb5b=_0x119021+'\x20'[_0x40c4a5(0x306)](Math[_0x40c4a5(0x316)](0x1,_0x4e0671))+a54_0x438284[_0x40c4a5(0x310)](_0x12c942),_0x2ddb44=getTaskStateIcon(_0x4e3b88[_0x40c4a5(0x26f)]),_0x103340=new Array(_0x5899ac)[_0x40c4a5(0x19c)]('\x20');if(_0x4e3b88[_0x40c4a5(0x315)]){const _0x23b16f=timeToPosition(_0x4e3b88['window'][_0x40c4a5(0x349)],_0x3598ba,_0x5899ac),_0x4ef04b=timeToPosition(_0x4e3b88['window']['end'],_0x3598ba,_0x5899ac),_0x8bf7e9=getBarChar(_0x4e3b88[_0x40c4a5(0x26f)]),_0x214284=Math[_0x40c4a5(0x316)](_0x23b16f+0x1,_0x4ef04b);for(let _0x2c2814=_0x23b16f;_0x2c2814<Math[_0x40c4a5(0x2c7)](_0x214284,_0x5899ac);_0x2c2814++){_0x103340[_0x2c2814]=_0x8bf7e9;}}const _0x955398=getBarColor(_0x4e3b88[_0x40c4a5(0x26f)]),_0x241399=_0x103340[_0x40c4a5(0x268)](_0x51206a=>_0x51206a==='\x20'?'\x20':_0x955398(_0x51206a))[_0x40c4a5(0x1b2)]('');return _0x2ddb44+'\x20'+_0xf2fb5b+'│'+_0x241399+'│';}function calculateStats(_0x57e359){const _0x1a6b97=a54_0x28aa77,_0x140818={'total':_0x57e359[_0x1a6b97(0x191)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x54c5e1 of _0x57e359){if(_0x54c5e1['state']==='success')_0x140818[_0x1a6b97(0x323)]++;else{if(_0x54c5e1[_0x1a6b97(0x26f)]===_0x1a6b97(0x1f0)||_0x54c5e1[_0x1a6b97(0x26f)]===_0x1a6b97(0x329))_0x140818[_0x1a6b97(0x1f0)]++;else _0x54c5e1['state']==='running'?_0x140818[_0x1a6b97(0x2dc)]++:_0x140818[_0x1a6b97(0x340)]++;}}return _0x140818;}function formatStats(_0x105570){const _0x545359=a54_0x28aa77;return[_0x545359(0x1f2)+_0x105570[_0x545359(0x1df)],'✅\x20'+_0x105570[_0x545359(0x323)],'❌\x20'+_0x105570[_0x545359(0x1f0)],_0x545359(0x320)+_0x105570[_0x545359(0x2dc)],'⏳\x20'+_0x105570['pending']][_0x545359(0x1b2)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x26e);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x30c);async[a54_0x28aa77(0x270)](_0x50ee64){const _0x47e39c=a54_0x28aa77,{options:_0x12c96f,args:_0x4ae01a,tdx:_0x20b82a}=_0x50ee64;let _0x553213,_0x5aaf78,_0x5925bb=![];if(_0x4ae01a[0x0]){if(_0x4ae01a[0x0][_0x47e39c(0x2d7)]('.')){const _0x14b66e=this[_0x47e39c(0x272)](_0x4ae01a,_0x12c96f);if(!_0x14b66e)return 0x1;_0x553213=_0x14b66e['projectName'],_0x5aaf78=_0x14b66e[_0x47e39c(0x1ec)];}else{_0x5aaf78=_0x4ae01a[0x0],_0x553213=_0x12c96f[_0x47e39c(0x218)];if(!_0x553213)return console[_0x47e39c(0x1f0)](a54_0x438284[_0x47e39c(0x282)](_0x47e39c(0x2e6)),_0x47e39c(0x303)),0x1;_0x5925bb=!![];}}else{const _0xb1f829=this[_0x47e39c(0x272)](_0x4ae01a,_0x12c96f);if(!_0xb1f829)return 0x1;_0x553213=_0xb1f829[_0x47e39c(0x185)],_0x5aaf78=_0xb1f829[_0x47e39c(0x1ec)];}if(_0x12c96f['verbose']){if(_0x553213&&_0x5aaf78)console['error'](_0x47e39c(0x257)+_0x553213+'.'+_0x5aaf78);else _0x553213&&console[_0x47e39c(0x1f0)]('Filter:\x20project='+_0x553213);}const _0x58dcd0=_0x12c96f['attemptId'],_0x31b205=_0x12c96f[_0x47e39c(0x287)];if(_0x58dcd0){_0x31b205&&console[_0x47e39c(0x1f0)](a54_0x438284[_0x47e39c(0x264)](_0x47e39c(0x1cc)),_0x47e39c(0x33c));const _0x4e27eb=_0x12c96f[_0x47e39c(0x1b5)];return _0x4e27eb?await this[_0x47e39c(0x271)](_0x50ee64,_0x58dcd0):await this[_0x47e39c(0x2bb)](_0x50ee64,_0x58dcd0,_0x12c96f),0x0;}if(_0x31b205){const _0x510136=await withSpinner(_0x47e39c(0x325),()=>_0x20b82a['workflow'][_0x47e39c(0x328)]({'projectName':_0x553213,'workflowName':_0x5aaf78,'limit':0x64}),{'verbose':_0x12c96f[_0x47e39c(0x192)]}),_0x36fa2a=_0x510136[_0x47e39c(0x213)][_0x47e39c(0x34c)](_0x27be2d=>_0x27be2d['id']===_0x31b205);if(!_0x36fa2a)return console[_0x47e39c(0x1f0)](a54_0x438284[_0x47e39c(0x282)](_0x47e39c(0x2e6)),_0x47e39c(0x1a1)+_0x31b205),0x1;if(!_0x36fa2a[_0x47e39c(0x2c9)]?.['id'])return console[_0x47e39c(0x1f0)](a54_0x438284[_0x47e39c(0x282)](_0x47e39c(0x2e6)),_0x47e39c(0x348)+_0x31b205+_0x47e39c(0x215)),0x1;const _0x1abcf9=_0x36fa2a[_0x47e39c(0x2c9)]['id'];_0x12c96f[_0x47e39c(0x192)]&&console['error'](_0x47e39c(0x295)+_0x1abcf9+_0x47e39c(0x1b0)+_0x31b205);const _0x1f60a3=_0x12c96f[_0x47e39c(0x1b5)];return _0x1f60a3?await this['pollTimeline'](_0x50ee64,_0x1abcf9):await this[_0x47e39c(0x2bb)](_0x50ee64,_0x1abcf9,_0x12c96f),0x0;}const _0x288de3=await withSpinner(_0x47e39c(0x1c3),()=>_0x20b82a[_0x47e39c(0x1bb)]['sessions']({'projectName':_0x553213,'workflowName':_0x5aaf78,'limit':_0x12c96f['limit']||0x32}),{'verbose':_0x12c96f[_0x47e39c(0x192)]}),_0x4eff4a=_0x288de3[_0x47e39c(0x213)];if(_0x4eff4a[_0x47e39c(0x191)]===0x0){if(_0x553213&&_0x5aaf78)console[_0x47e39c(0x1f0)](_0x47e39c(0x23d)+_0x553213+'.'+_0x5aaf78);else _0x553213?console[_0x47e39c(0x1f0)](_0x47e39c(0x30b)+_0x553213):(console[_0x47e39c(0x1f0)](_0x47e39c(0x226)),console['error'](a54_0x438284['dim']('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x4eff4a[_0x47e39c(0x240)]((_0x3e37bd,_0x21dfde)=>{const _0x51f9e2=_0x47e39c,_0x10db20=_0x3e37bd[_0x51f9e2(0x1e3)]||'',_0x4b23b0=_0x21dfde[_0x51f9e2(0x1e3)]||'';return _0x4b23b0[_0x51f9e2(0x2a6)](_0x10db20);});if(_0x12c96f[_0x47e39c(0x25f)]||_0x12c96f[_0x47e39c(0x2ae)])return await handleSDKOutput(_0x4eff4a,_0x12c96f),0x0;let _0x4dcef1;if(_0x5925bb){const _0x598ae6=_0x4eff4a[0x0];if(!_0x598ae6[_0x47e39c(0x2c9)]?.['id'])return console[_0x47e39c(0x1f0)](_0x47e39c(0x2fa)),0x0;_0x4dcef1=_0x598ae6['lastAttempt']['id'],_0x12c96f['verbose']&&console[_0x47e39c(0x1f0)](_0x47e39c(0x29c)+_0x598ae6[_0x47e39c(0x1e3)]);}else{const _0x28d115=_0x4eff4a[_0x47e39c(0x268)](_0x5b1b96=>{const _0x2188d8=_0x47e39c,_0x4695e7=getAttemptStatusDisplay(_0x5b1b96[_0x2188d8(0x2c9)]);return{'title':_0x5b1b96[_0x2188d8(0x1f1)]?.[_0x2188d8(0x25c)]+'.'+_0x5b1b96[_0x2188d8(0x1bb)]?.[_0x2188d8(0x25c)]+_0x2188d8(0x341)+_0x5b1b96['sessionTime']+'\x20'+_0x4695e7[_0x2188d8(0x18e)],'value':_0x5b1b96[_0x2188d8(0x2c9)]?.['id']||'','description':_0x4695e7[_0x2188d8(0x23e)]};}),_0x6e3589=await a54_0x2740c1({'type':_0x47e39c(0x204),'name':_0x47e39c(0x292),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x28d115[_0x47e39c(0x2c0)](_0x2a55ac=>_0x2a55ac[_0x47e39c(0x22d)]!=='')});if(!_0x6e3589[_0x47e39c(0x292)])return 0x0;_0x4dcef1=_0x6e3589['attemptId'];}const _0x3e2996=_0x12c96f[_0x47e39c(0x1b5)];return _0x3e2996?await this[_0x47e39c(0x271)](_0x50ee64,_0x4dcef1):await this['renderSingleTimeline'](_0x50ee64,_0x4dcef1,_0x12c96f),0x0;}async[a54_0x28aa77(0x2bb)](_0x55552c,_0x4a943d,_0x224180){const _0x3f1f3a=a54_0x28aa77,{tdx:_0x1e8097}=_0x55552c;let _0xf395fb,_0x52f7f2;try{[_0xf395fb,_0x52f7f2]=await Promise[_0x3f1f3a(0x28a)]([_0x1e8097['workflow'][_0x3f1f3a(0x225)](_0x4a943d),_0x1e8097['workflow']['tasks'](_0x4a943d,![])]);}catch(_0x436eec){console['error'](a54_0x438284[_0x3f1f3a(0x282)](_0x3f1f3a(0x34a)));_0x224180[_0x3f1f3a(0x192)]&&console['error'](_0x436eec);throw _0x436eec;}if(_0x224180[_0x3f1f3a(0x25f)]||_0x224180[_0x3f1f3a(0x2ae)]){const _0x3af368=this[_0x3f1f3a(0x202)](_0xf395fb,_0x52f7f2);await handleSDKOutput([_0x3af368],_0x224180);return;}const _0x5dab97=_0x1e8097['context'][_0x3f1f3a(0x312)],_0x120d75=this[_0x3f1f3a(0x2b6)](_0xf395fb,_0x52f7f2,_0x5dab97);console[_0x3f1f3a(0x33f)](_0x120d75);}async[a54_0x28aa77(0x271)](_0xdffb11,_0x51538a){const _0x3dacb9=a54_0x28aa77,{tdx:_0x33cc28}=_0xdffb11,_0x59c0ff=TIMELINE_CONFIG[_0x3dacb9(0x2eb)],_0x265ce3=TIMELINE_CONFIG[_0x3dacb9(0x313)];let _0x4a637b=0x0;while(_0x4a637b<_0x265ce3){process[_0x3dacb9(0x2fc)][_0x3dacb9(0x2ed)]&&process[_0x3dacb9(0x2fc)][_0x3dacb9(0x2ca)]('\x1bc');let _0x27d9fb,_0x5a984a;try{[_0x27d9fb,_0x5a984a]=await Promise[_0x3dacb9(0x28a)]([_0x33cc28[_0x3dacb9(0x1bb)][_0x3dacb9(0x225)](_0x51538a),_0x33cc28[_0x3dacb9(0x1bb)][_0x3dacb9(0x2d1)](_0x51538a,![])]);}catch(_0x593100){console['error'](a54_0x438284['red'](_0x3dacb9(0x2e3)));_0x4a637b>0x0&&console[_0x3dacb9(0x1f0)](a54_0x438284[_0x3dacb9(0x310)](_0x3dacb9(0x2f1)+_0x4a637b));throw _0x593100;}const _0x4da232=_0x33cc28[_0x3dacb9(0x19e)][_0x3dacb9(0x312)],_0x2efe34=this['renderTimeline'](_0x27d9fb,_0x5a984a,_0x4da232);console[_0x3dacb9(0x33f)](_0x2efe34);const _0x30a35e=_0x27d9fb[_0x3dacb9(0x195)]&&_0x5a984a[_0x3dacb9(0x27b)](_0xbe5d67=>_0xbe5d67[_0x3dacb9(0x26f)]!==_0x3dacb9(0x2dc)&&_0xbe5d67[_0x3dacb9(0x26f)]!==_0x3dacb9(0x1b8));if(_0x30a35e){console[_0x3dacb9(0x1f0)](a54_0x438284['green'](_0x3dacb9(0x1ac)));break;}console[_0x3dacb9(0x1f0)](a54_0x438284[_0x3dacb9(0x310)]('\x0aPolling...\x20('+_0x4a637b*0x2+_0x3dacb9(0x1f5))),await new Promise(_0x17746a=>setTimeout(_0x17746a,_0x59c0ff)),_0x4a637b++;}_0x4a637b>=_0x265ce3&&console[_0x3dacb9(0x1f0)](a54_0x438284[_0x3dacb9(0x264)](_0x3dacb9(0x2b3)));}[a54_0x28aa77(0x2b6)](_0x42c4be,_0x4f9a44,_0xca150b){const _0x26206a=a54_0x28aa77,_0x3d6ea4=[],_0x4116e9=TIMELINE_CONFIG[_0x26206a(0x242)],_0x544e49=0x5,_0x487220=process['stdout'][_0x26206a(0x1cb)]||0x78,_0x32a1fd=_0x487220-_0x4116e9-_0x544e49,_0x60879b=Math[_0x26206a(0x316)](TIMELINE_CONFIG[_0x26206a(0x2fb)],Math['min'](_0x32a1fd,TIMELINE_CONFIG[_0x26206a(0x1f4)])),_0x531109=new Date(_0x42c4be['createdAt'])['getTime'](),_0x2cdd93=_0x42c4be[_0x26206a(0x1c8)]?new Date(_0x42c4be['finishedAt'])[_0x26206a(0x2f3)]():Date['now'](),_0x507055={'start':_0x531109,'end':_0x2cdd93,'duration':_0x2cdd93-_0x531109},_0x949f01=new Map(),_0xc3aded=[];for(const _0x5e7494 of _0x4f9a44){if(_0x5e7494['startedAt']){const _0xbda603=new Date(_0x5e7494[_0x26206a(0x289)])[_0x26206a(0x2f3)](),_0xc836e2=_0x5e7494['updatedAt']?new Date(_0x5e7494[_0x26206a(0x2cf)])[_0x26206a(0x2f3)]():Date[_0x26206a(0x290)](),_0x5c74d8={'start':_0xbda603,'end':_0xc836e2,'duration':_0xc836e2-_0xbda603};_0x949f01[_0x26206a(0x2f7)](_0x5e7494['id'],_0x5c74d8),_0xc3aded['push']({'name':_0x5e7494[_0x26206a(0x19d)],'state':_0x5e7494['state']||'unknown','window':_0x5c74d8});}else _0xc3aded[_0x26206a(0x223)]({'name':_0x5e7494[_0x26206a(0x19d)],'state':_0x5e7494[_0x26206a(0x26f)]||_0x26206a(0x1b8),'window':undefined});}_0xc3aded['sort']((_0x929037,_0x355372)=>{const _0x10b713=_0x26206a;if(!_0x929037[_0x10b713(0x315)])return 0x1;if(!_0x355372[_0x10b713(0x315)])return-0x1;return _0x929037[_0x10b713(0x315)][_0x10b713(0x349)]-_0x355372[_0x10b713(0x315)][_0x10b713(0x349)];});const _0x46c2cd=_0xc3aded[_0x26206a(0x191)],_0x5211f4=_0x46c2cd>TIMELINE_CONFIG[_0x26206a(0x347)];_0x5211f4&&_0xc3aded[_0x26206a(0x1b3)](TIMELINE_CONFIG[_0x26206a(0x347)]);const _0x4fb0f1=calculateTimeScale(_0x507055,_0x60879b),_0x317702=_0x42c4be[_0x26206a(0x195)]?_0x42c4be[_0x26206a(0x323)]?a54_0x438284[_0x26206a(0x1ba)](_0x26206a(0x323)):a54_0x438284['red'](_0x26206a(0x1f0)):a54_0x438284[_0x26206a(0x2ab)](_0x26206a(0x2dc)),_0xc357a=_0x42c4be['project']?.['id'],_0x6644a=_0x42c4be[_0x26206a(0x287)];let _0x377301;if(_0xc357a&&_0x6644a){const _0x281b4b=getWorkflowAttemptUrl(_0xca150b,_0xc357a,_0x6644a,_0x42c4be['id']);_0x377301=hyperlink(a54_0x438284[_0x26206a(0x310)](_0x42c4be['id']),_0x281b4b);}else _0x377301=a54_0x438284[_0x26206a(0x310)](_0x42c4be['id']);_0x3d6ea4[_0x26206a(0x223)](_0x26206a(0x21e)+_0x377301+_0x26206a(0x341)+_0x317702+_0x26206a(0x341)+formatElapsed(_0x507055[_0x26206a(0x189)]));if(_0xc3aded[_0x26206a(0x191)]>0x0){const _0x552233=renderTimeAxis(_0x4fb0f1,_0x60879b),_0x408930=new Date(_0x507055[_0x26206a(0x349)]),_0x17f98b=formatDate(_0x408930),_0x27c785=TIMELINE_CONFIG[_0x26206a(0x1b6)]+TIMELINE_CONFIG[_0x26206a(0x24e)]+_0x4116e9,_0xd7efec=_0x17f98b[_0x26206a(0x291)](_0x27c785),_0x4a15ff=a54_0x438284['dim'](_0xd7efec);_0x3d6ea4['push'](_0x4a15ff+'\x20'+_0x552233);for(const _0x5c4355 of _0xc3aded){_0x3d6ea4[_0x26206a(0x223)](renderTaskRow(_0x5c4355,_0x4fb0f1,_0x60879b,_0x4116e9));}const _0x97215d=calculateStats(_0xc3aded);_0x3d6ea4[_0x26206a(0x223)](formatStats(_0x97215d)),_0x5211f4&&_0x3d6ea4['push'](a54_0x438284['yellow'](_0x26206a(0x2b4)+TIMELINE_CONFIG[_0x26206a(0x347)]+'\x20of\x20'+_0x46c2cd+_0x26206a(0x1b9))),_0x3d6ea4[_0x26206a(0x223)](''),_0x3d6ea4[_0x26206a(0x223)](a54_0x438284[_0x26206a(0x310)](_0x26206a(0x1c4))+(_0x26206a(0x1ad)+_0x42c4be['id']+'\x20logs')+a54_0x438284[_0x26206a(0x310)]('\x20to\x20see\x20detailed\x20logs'));}else _0x3d6ea4[_0x26206a(0x223)](_0x26206a(0x2c2));return _0x3d6ea4[_0x26206a(0x1b2)]('\x0a');}[a54_0x28aa77(0x202)](_0x483085,_0x5703d5){const _0xa6e842=a54_0x28aa77,_0x445dd5=new Date(_0x483085[_0xa6e842(0x214)])[_0xa6e842(0x2f3)](),_0x1e14a6=_0x483085[_0xa6e842(0x1c8)]?new Date(_0x483085[_0xa6e842(0x1c8)])[_0xa6e842(0x2f3)]():Date[_0xa6e842(0x290)](),_0x2d751f=_0x1e14a6-_0x445dd5,_0x4f8b88=[];for(const _0x21ab2d of _0x5703d5){if(_0x21ab2d[_0xa6e842(0x289)]){const _0x86fa55=new Date(_0x21ab2d[_0xa6e842(0x289)])['getTime'](),_0x44ea9e=_0x21ab2d[_0xa6e842(0x2cf)]?new Date(_0x21ab2d[_0xa6e842(0x2cf)])[_0xa6e842(0x2f3)]():Date[_0xa6e842(0x290)]();_0x4f8b88[_0xa6e842(0x223)]({'name':_0x21ab2d[_0xa6e842(0x19d)],'state':_0x21ab2d['state']||_0xa6e842(0x2d3),'window':{'start':_0x86fa55,'end':_0x44ea9e,'duration':_0x44ea9e-_0x86fa55}});}else _0x4f8b88[_0xa6e842(0x223)]({'name':_0x21ab2d[_0xa6e842(0x19d)],'state':_0x21ab2d[_0xa6e842(0x26f)]||'planned','window':undefined});}const _0x48765e=calculateStats(_0x4f8b88);return{'attempt':{'id':_0x483085['id'],'status':_0x483085['done']?_0x483085['success']?'success':'error':_0xa6e842(0x2dc),'createdAt':_0x483085[_0xa6e842(0x214)],'finishedAt':_0x483085['finishedAt'],'duration_ms':_0x2d751f},'tasks':_0x4f8b88[_0xa6e842(0x268)](_0x5e150c=>({'name':_0x5e150c[_0xa6e842(0x25c)],'state':_0x5e150c[_0xa6e842(0x26f)],'startedAt':_0x5e150c['window']?new Date(_0x5e150c['window'][_0xa6e842(0x349)])[_0xa6e842(0x239)]():null,'updatedAt':_0x5e150c[_0xa6e842(0x315)]?new Date(_0x5e150c['window'][_0xa6e842(0x34f)])[_0xa6e842(0x239)]():null,'duration_ms':_0x5e150c[_0xa6e842(0x315)]?.[_0xa6e842(0x189)]||null})),'stats':_0x48765e};}}export class WorkflowSchedulesCommand extends BaseCommand{['name']=a54_0x28aa77(0x33d);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x266);async[a54_0x28aa77(0x270)](_0x163ba9){const _0x3243ca=a54_0x28aa77,{options:_0x53d03c,tdx:_0x57378b}=_0x163ba9,_0x5ed851=await withSpinner(_0x3243ca(0x26a),()=>_0x57378b[_0x3243ca(0x1bb)][_0x3243ca(0x23f)](),{'verbose':_0x53d03c[_0x3243ca(0x192)]}),_0xf1653=_0x5ed851[_0x3243ca(0x213)];console['error']('✔\x20Found\x20'+_0xf1653[_0x3243ca(0x191)]+_0x3243ca(0x263)+(_0xf1653['length']!==0x1?'s':''));if(isStructuredFormat(_0x53d03c))await handleSDKOutput(_0xf1653,_0x53d03c);else{if(_0xf1653[_0x3243ca(0x191)]===0x0)console[_0x3243ca(0x33f)]('No\x20schedules\x20found');else for(const _0x4668bf of _0xf1653){const _0x356dcb=_0x4668bf[_0x3243ca(0x25d)]?a54_0x438284[_0x3243ca(0x264)](_0x3243ca(0x2a3)):'',_0x18775a=_0x4668bf[_0x3243ca(0x1f1)]?.[_0x3243ca(0x25c)]?a54_0x438284[_0x3243ca(0x310)]('\x20['+_0x4668bf[_0x3243ca(0x1f1)][_0x3243ca(0x25c)]+']'):'',_0x891ec6=_0x4668bf[_0x3243ca(0x209)]?a54_0x438284['dim'](_0x3243ca(0x32a)+new Date(_0x4668bf[_0x3243ca(0x209)])[_0x3243ca(0x2d0)]()):'';console[_0x3243ca(0x33f)](_0x3243ca(0x227)+_0x4668bf['id']+'\x20'+(_0x4668bf[_0x3243ca(0x1bb)]?.['name']||_0x3243ca(0x33a))+_0x18775a+_0x356dcb+_0x891ec6);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']='workflow:schedule:enable';['description']=a54_0x28aa77(0x1d8);async[a54_0x28aa77(0x270)](_0x2f8c06){const _0x367c7b=a54_0x28aa77,{options:_0x529c3a,args:_0x54882d,tdx:_0x3ed7c2}=_0x2f8c06,_0x2edebf=_0x54882d[0x0];if(!_0x2edebf)return console[_0x367c7b(0x1f0)](a54_0x438284[_0x367c7b(0x282)](_0x367c7b(0x2e6)),'Schedule\x20ID\x20is\x20required'),console[_0x367c7b(0x1f0)](a54_0x438284[_0x367c7b(0x310)](_0x367c7b(0x1fa))),console[_0x367c7b(0x1f0)](a54_0x438284[_0x367c7b(0x310)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x54b5f8=await withSpinner(_0x367c7b(0x343)+_0x2edebf+_0x367c7b(0x31e),()=>_0x3ed7c2[_0x367c7b(0x1bb)]['enableSchedule'](_0x2edebf),{'verbose':_0x529c3a['verbose']}),_0x580589=_0x54b5f8[_0x367c7b(0x213)];return isStructuredFormat(_0x529c3a)?await handleSingleObjectOutput(_0x580589,_0x529c3a):(console[_0x367c7b(0x33f)](_0x367c7b(0x267)+_0x2edebf+_0x367c7b(0x1e2)+(_0x580589[_0x367c7b(0x1bb)]?.[_0x367c7b(0x25c)]||_0x367c7b(0x2d3))+')'),_0x580589[_0x367c7b(0x209)]&&console[_0x367c7b(0x33f)](a54_0x438284[_0x367c7b(0x310)](_0x367c7b(0x2bc)+new Date(_0x580589['nextRunTime'])[_0x367c7b(0x2d0)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x28aa77(0x25c)]=a54_0x28aa77(0x326);[a54_0x28aa77(0x205)]=a54_0x28aa77(0x279);async['execute'](_0x1f0ceb){const _0x5de523=a54_0x28aa77,{options:_0x443f1f,args:_0x11308,tdx:_0x396629}=_0x1f0ceb,_0xff00a4=_0x11308[0x0];if(!_0xff00a4)return console[_0x5de523(0x1f0)](a54_0x438284[_0x5de523(0x282)]('Error:'),_0x5de523(0x28c)),console[_0x5de523(0x1f0)](a54_0x438284[_0x5de523(0x310)]('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console['error'](a54_0x438284[_0x5de523(0x310)](_0x5de523(0x283))),0x1;const _0x427267=await withSpinner(_0x5de523(0x297)+_0xff00a4+_0x5de523(0x31e),()=>_0x396629[_0x5de523(0x1bb)][_0x5de523(0x29b)](_0xff00a4),{'verbose':_0x443f1f['verbose']}),_0x266a48=_0x427267[_0x5de523(0x213)];return isStructuredFormat(_0x443f1f)?await handleSingleObjectOutput(_0x266a48,_0x443f1f):console[_0x5de523(0x33f)](_0x5de523(0x267)+_0xff00a4+_0x5de523(0x241)+(_0x266a48[_0x5de523(0x1bb)]?.[_0x5de523(0x25c)]||_0x5de523(0x2d3))+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x2b738e,_0x22dc27){const _0x39c3c0=a55_0x48b3,_0x50ff02=_0x2b738e();while(!![]){try{const _0x7225ff=parseInt(_0x39c3c0(0x91))/0x1*(-parseInt(_0x39c3c0(0x8b))/0x2)+parseInt(_0x39c3c0(0x90))/0x3*(parseInt(_0x39c3c0(0x85))/0x4)+parseInt(_0x39c3c0(0x97))/0x5*(parseInt(_0x39c3c0(0x8f))/0x6)+parseInt(_0x39c3c0(0x8a))/0x7*(-parseInt(_0x39c3c0(0x87))/0x8)+parseInt(_0x39c3c0(0x8e))/0x9+-parseInt(_0x39c3c0(0x86))/0xa+parseInt(_0x39c3c0(0x89))/0xb*(parseInt(_0x39c3c0(0x8d))/0xc);if(_0x7225ff===_0x22dc27)break;else _0x50ff02['push'](_0x50ff02['shift']());}catch(_0x1880cc){_0x50ff02['push'](_0x50ff02['shift']());}}}(a55_0x3c7f,0x52ea3));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 _0x2f15e8=a55_0x48b3,_0x272e28=getVersion(),_0xa37af7=platform(),_0x42125c=process[_0x2f15e8(0x98)][_0x2f15e8(0x93)]('v','');return'tdx/'+_0x272e28+'\x20('+_0xa37af7+_0x2f15e8(0x92)+_0x42125c+')';}export function getAuthHeaders(_0x3c012f,_0x18cccc,_0x168a9f){const _0x2c5dea=a55_0x48b3,_0x2a5a58=getVersion(),_0x8d7b3={'User-Agent':getUserAgent(),'X-TD-Client':_0x2c5dea(0x88),'X-TD-Client-Version':_0x2a5a58};if(_0x168a9f)_0x8d7b3[_0x2c5dea(0x99)]='Bearer\x20'+_0x168a9f;else _0x18cccc&&(_0x8d7b3[_0x2c5dea(0x99)]=_0x2c5dea(0x96)+_0x18cccc);return _0x8d7b3;}function a55_0x48b3(_0x41751c,_0x2c1c00){_0x41751c=_0x41751c-0x85;const _0x3c7f50=a55_0x3c7f();let _0x48b3bb=_0x3c7f50[_0x41751c];return _0x48b3bb;}function a55_0x3c7f(){const _0x2311ec=['11nXkhOx','7nhuFwn','482zZBSCW','X-Trino-User','6209364qXIbaz','5529834EHVxWE','12MVxoWd','253971dXSnTP','2091PwEvAo',';\x20node/','replace','length','entries','TD1\x20','535615DCQXPG','version','Authorization','8fEnIbx','6625860ifaGkF','74376ruPoYA','tdx'];a55_0x3c7f=function(){return _0x2311ec;};return a55_0x3c7f();}export function toHeaderRecord(_0x2fe788){const _0x123212=a55_0x48b3,_0x4e42e4={};for(const [_0x19eed9,_0x25578c]of Object[_0x123212(0x95)](_0x2fe788)){_0x25578c!==undefined&&(_0x4e42e4[_0x19eed9]=_0x25578c);}return _0x4e42e4;}export function getTrinoHeaders(_0x18d688,_0xf702f7,_0x450ee6){const _0x4fbd38=a55_0x48b3,_0x265ed8=getAuthHeaders(_0x18d688),_0x897a44=toHeaderRecord(_0x265ed8);if(_0x450ee6)_0x897a44[_0x4fbd38(0x99)]='Bearer\x20'+_0x450ee6;else _0xf702f7&&(_0x897a44[_0x4fbd38(0x8c)]=_0xf702f7);return _0x897a44;}export function hasAPIKey(_0x5b9427){const _0x1f5731=a55_0x48b3,_0x11e110=getAPIKey();return _0x11e110!==undefined&&_0x11e110[_0x1f5731(0x94)]>0x0;}
1
+ (function(_0x1b3eaf,_0x114f34){const _0x2ebaa0=a55_0xadc5,_0xb9b82f=_0x1b3eaf();while(!![]){try{const _0x334457=-parseInt(_0x2ebaa0(0x1bd))/0x1*(parseInt(_0x2ebaa0(0x1b6))/0x2)+-parseInt(_0x2ebaa0(0x1bb))/0x3+parseInt(_0x2ebaa0(0x1ad))/0x4*(-parseInt(_0x2ebaa0(0x1ae))/0x5)+parseInt(_0x2ebaa0(0x1af))/0x6+parseInt(_0x2ebaa0(0x1bf))/0x7*(parseInt(_0x2ebaa0(0x1b2))/0x8)+-parseInt(_0x2ebaa0(0x1b0))/0x9*(parseInt(_0x2ebaa0(0x1b9))/0xa)+-parseInt(_0x2ebaa0(0x1ba))/0xb*(-parseInt(_0x2ebaa0(0x1ab))/0xc);if(_0x334457===_0x114f34)break;else _0xb9b82f['push'](_0xb9b82f['shift']());}catch(_0x244501){_0xb9b82f['push'](_0xb9b82f['shift']());}}}(a55_0x2d66,0x3605d));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a55_0x2d66(){const _0x17b533=['1129210rXjQCD','2079SRyTVX','682845nQQwMa','X-Trino-User','18tiKLMl','version','10339LGhdhQ','29604esSfPl','replace','4gGSnIa','1357145GCcWYs','938028OWJRCz','9SIGsTM','Bearer\x20','2200raBosq','Authorization','TD1\x20','tdx/','21726ZOFysE',';\x20node/','length'];a55_0x2d66=function(){return _0x17b533;};return a55_0x2d66();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x51dcbd=a55_0xadc5,_0x42c506=getVersion(),_0x1a589b=platform(),_0x167a44=process[_0x51dcbd(0x1be)][_0x51dcbd(0x1ac)]('v','');return _0x51dcbd(0x1b5)+_0x42c506+'\x20('+_0x1a589b+_0x51dcbd(0x1b7)+_0x167a44+')';}export function getAuthHeaders(_0x5aabd0,_0x5074d2,_0x556244){const _0x18fdf9=a55_0xadc5,_0x3b7987=getVersion(),_0x56b57a={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x3b7987};if(_0x556244)_0x56b57a[_0x18fdf9(0x1b3)]=_0x18fdf9(0x1b1)+_0x556244;else _0x5074d2&&(_0x56b57a[_0x18fdf9(0x1b3)]=_0x18fdf9(0x1b4)+_0x5074d2);return _0x56b57a;}function a55_0xadc5(_0x360d46,_0x469f8b){_0x360d46=_0x360d46-0x1ab;const _0x2d6602=a55_0x2d66();let _0xadc5be=_0x2d6602[_0x360d46];return _0xadc5be;}export function toHeaderRecord(_0x47767a){const _0x24a7e7={};for(const [_0x1f5714,_0x58ddf6]of Object['entries'](_0x47767a)){_0x58ddf6!==undefined&&(_0x24a7e7[_0x1f5714]=_0x58ddf6);}return _0x24a7e7;}export function getTrinoHeaders(_0x35088a,_0x22ffd8,_0x4a84ec){const _0x4deb0d=a55_0xadc5,_0x5aeff8=getAuthHeaders(_0x35088a),_0x5a9fe4=toHeaderRecord(_0x5aeff8);if(_0x4a84ec)_0x5a9fe4[_0x4deb0d(0x1b3)]='Bearer\x20'+_0x4a84ec;else _0x22ffd8&&(_0x5a9fe4[_0x4deb0d(0x1bc)]=_0x22ffd8);return _0x5a9fe4;}export function hasAPIKey(_0x4e264a){const _0x1be762=a55_0xadc5,_0x59da87=getAPIKey();return _0x59da87!==undefined&&_0x59da87[_0x1be762(0x1b8)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x30682f,_0x5d7574){const _0x220d00=a56_0x1b51,_0x245845=_0x30682f();while(!![]){try{const _0x337de7=-parseInt(_0x220d00(0x17f))/0x1*(-parseInt(_0x220d00(0x199))/0x2)+parseInt(_0x220d00(0x1ab))/0x3+-parseInt(_0x220d00(0x183))/0x4*(-parseInt(_0x220d00(0x19e))/0x5)+-parseInt(_0x220d00(0x198))/0x6*(parseInt(_0x220d00(0x191))/0x7)+-parseInt(_0x220d00(0x1c5))/0x8*(parseInt(_0x220d00(0x18e))/0x9)+-parseInt(_0x220d00(0x1be))/0xa*(parseInt(_0x220d00(0x1b7))/0xb)+parseInt(_0x220d00(0x195))/0xc*(-parseInt(_0x220d00(0x184))/0xd);if(_0x337de7===_0x5d7574)break;else _0x245845['push'](_0x245845['shift']());}catch(_0x7be254){_0x245845['push'](_0x245845['shift']());}}}(a56_0x6b42,0x3fa05));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 a56_0x5b6478 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a56_0x1b51(_0x1febfa,_0x3b988b){_0x1febfa=_0x1febfa-0x177;const _0x6b429d=a56_0x6b42();let _0x1b51bf=_0x6b429d[_0x1febfa];return _0x1b51bf;}export function isStructuredFormat(_0x42af43){const _0xbe1567=a56_0x1b51;return _0x42af43[_0xbe1567(0x18b)]===_0xbe1567(0x192)||_0x42af43[_0xbe1567(0x18b)]===_0xbe1567(0x1aa)||_0x42af43[_0xbe1567(0x18b)]==='tsv'||_0x42af43[_0xbe1567(0x18b)]==='table'||_0x42af43[_0xbe1567(0x192)]===!![]||_0x42af43['jsonl']===!![]||_0x42af43[_0xbe1567(0x1a1)]===!![]||_0x42af43[_0xbe1567(0x1a0)]===!![];}export function parseOutputOptions(_0x13eff0){const _0x27eddd=a56_0x1b51;return{'format':_0x13eff0['format']||'table','output':_0x13eff0[_0x27eddd(0x177)]||'','limit':_0x13eff0['limit'],'limitStructuredFormats':_0x13eff0[_0x27eddd(0x19d)],'color':_0x13eff0['color'],'noColor':_0x13eff0['noColor']};}function convertSDKResultToQueryResult(_0x7c6d8e){const _0x2b317a=a56_0x1b51,_0x2cd185=[];if(_0x7c6d8e[_0x2b317a(0x1a8)]>0x0){const _0x484ac8=_0x7c6d8e[0x0];for(const [_0x2e46d4,_0x3cc9ac]of Object['entries'](_0x484ac8)){let _0x41824d=_0x2b317a(0x1a9);if(typeof _0x3cc9ac==='number')_0x41824d=Number[_0x2b317a(0x1bd)](_0x3cc9ac)?_0x2b317a(0x194):_0x2b317a(0x17d);else{if(typeof _0x3cc9ac===_0x2b317a(0x180))_0x41824d=_0x2b317a(0x180);else _0x3cc9ac===null&&(_0x41824d=_0x2b317a(0x1a9));}_0x2cd185[_0x2b317a(0x1b1)]({'name':_0x2e46d4,'type':_0x41824d});}}return{'queryId':_0x2b317a(0x19a),'columns':_0x2cd185,'data':_0x7c6d8e,'stats':{'state':_0x2b317a(0x17b),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x7c6d8e['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1b86be,_0x1f48fb){const _0x962c5c=convertSDKResultToQueryResult(_0x1b86be);return formatQueryOutput(_0x962c5c,_0x1f48fb);}export async function formatQueryOutput(_0x1426f5,_0x2db9f3){const _0x3343dc=a56_0x1b51,{format:_0x29cd9e,limit:_0x355f3f,output:_0x553cba,color:_0x48d2e7,noColor:_0x15e9e,limitStructuredFormats:_0x43db2c}=_0x2db9f3,_0x5d1cac=Boolean(_0x553cba)&&!_0x48d2e7,_0x20a20d={'color':_0x48d2e7,'noColor':_0x15e9e||_0x5d1cac};if(_0x29cd9e===_0x3343dc(0x1a0)){const _0x464e81=shouldUseLess(_0x29cd9e,_0x553cba);return formatAsTable(_0x1426f5,_0x355f3f,_0x464e81,_0x20a20d);}const _0x58a972=_0x43db2c&&Number[_0x3343dc(0x182)](_0x355f3f)&&_0x1426f5[_0x3343dc(0x189)][_0x3343dc(0x1a8)]>_0x355f3f?{..._0x1426f5,'data':_0x1426f5[_0x3343dc(0x189)]['slice'](0x0,_0x355f3f)}:_0x1426f5;if(_0x29cd9e==='json')return formatAsJSON(_0x58a972,_0x20a20d);else return _0x29cd9e===_0x3343dc(0x1aa)?formatAsJSONL(_0x58a972,_0x20a20d):formatQueryResult(_0x58a972,_0x29cd9e);}function shouldUseLess(_0xfbf8f0,_0x1e4260){const _0x5dcc67=a56_0x1b51;return(_0xfbf8f0==='table'||_0xfbf8f0===_0x5dcc67(0x18f))&&process[_0x5dcc67(0x17a)][_0x5dcc67(0x1a2)]&&!_0x1e4260;}export function resolveOutputOptions(_0x1ec37b){const _0x17f1d8=a56_0x1b51,_0x5d6d4b=_0x1ec37b[_0x17f1d8(0x177)]||'',_0x1c2713=resolveOutputFormat(_0x1ec37b[_0x17f1d8(0x18b)],_0x5d6d4b,_0x17f1d8(0x1a0));let _0x30bcc5=typeof _0x1ec37b['limit']===_0x17f1d8(0x193)?_0x1ec37b['limit']:parseInt(_0x1ec37b[_0x17f1d8(0x188)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1ec37b['limit']===undefined&&shouldUseLess(_0x1c2713,_0x5d6d4b)&&(_0x30bcc5=Infinity),{'format':_0x1c2713,'output':_0x5d6d4b,'limit':_0x30bcc5,'limitStructuredFormats':_0x1ec37b[_0x17f1d8(0x19d)],'color':_0x1ec37b[_0x17f1d8(0x17e)],'noColor':_0x1ec37b[_0x17f1d8(0x1bf)]};}function a56_0x6b42(){const _0x16fb03=['3675951FPZHOr','list','query','238LxEYSh','json','number','bigint','447324HvCggT','write','stringify','1722QGnMAw','70plOnQJ','sdk-result','bold','entries','limitStructuredFormats','205xksQrH','less','table','tsv','isTTY','[error]','stdin','[query]','params','max','length','varchar','jsonl','1510509vZSSYj','keys','trim','join','padEnd','No\x20data','push','log','end','forEach','cmdout','─┴─','3718LUENqX','Results\x20saved\x20to\x20','[logs]','debug','blue','-FXRSn','isInteger','2090pBwuiF','noColor','error','[rule]','close','inherit','─┬─','8JXDmGa','output','repeat','split','stdout','FINISHED','cyan','double','color','4639wvFaMb','boolean','stderr','isFinite','33612PXKdbM','91FuOjgH','rule','magenta','red','limit','data','map','format','pipe','filter'];a56_0x6b42=function(){return _0x16fb03;};return a56_0x6b42();}export function writeOutput(_0x2814dc,_0x386c36,_0x57ff1c){const _0x33ae05=a56_0x1b51;return _0x386c36?(writeFileSync(_0x386c36,_0x2814dc),console[_0x33ae05(0x1c0)](_0x33ae05(0x1b8)+_0x386c36),Promise['resolve']()):shouldUseLess(_0x57ff1c||'','')?new Promise(_0x120fed=>{const _0x117fa3=_0x33ae05,_0xea0868=spawn(_0x117fa3(0x19f),[_0x117fa3(0x1bc)],{'stdio':[_0x117fa3(0x18c),_0x117fa3(0x1c3),_0x117fa3(0x1c3)]});let _0x528952=![];_0xea0868['on']('error',()=>{const _0x1dd688=_0x117fa3;!_0x528952&&(_0x528952=!![],console[_0x1dd688(0x1b2)](_0x2814dc),_0x120fed());}),_0xea0868['on'](_0x117fa3(0x1c2),()=>{!_0x528952&&(_0x528952=!![],_0x120fed());}),_0xea0868['on']('spawn',()=>{const _0x3ae71d=_0x117fa3;!_0x528952&&_0xea0868[_0x3ae71d(0x1a4)]&&(_0xea0868[_0x3ae71d(0x1a4)]['on'](_0x3ae71d(0x1c0),()=>{}),_0xea0868[_0x3ae71d(0x1a4)][_0x3ae71d(0x196)](_0x2814dc),_0xea0868[_0x3ae71d(0x1a4)][_0x3ae71d(0x1b3)]());}),!_0xea0868[_0x117fa3(0x1a4)]&&(!_0x528952&&(_0x528952=!![],console[_0x117fa3(0x1b2)](_0x2814dc),_0x120fed()));}):(console[_0x33ae05(0x1b2)](_0x2814dc),Promise['resolve']());}export async function handleSDKOutput(_0x282090,_0xc83c07){const _0xfaf114=a56_0x1b51,_0x31c303=resolveOutputOptions(_0xc83c07),_0x270444=await formatSDKOutput(_0x282090,_0x31c303);await writeOutput(_0x270444,_0x31c303[_0xfaf114(0x177)]||undefined,_0x31c303[_0xfaf114(0x18b)]);}export async function handleQueryOutput(_0x52071b,_0xe00e6f){const _0x531659=a56_0x1b51,_0x2222b8=resolveOutputOptions(_0xe00e6f),_0x5404c1=await formatQueryOutput(_0x52071b,_0x2222b8);await writeOutput(_0x5404c1,_0x2222b8[_0x531659(0x177)]||undefined,_0x2222b8[_0x531659(0x18b)]);}async function formatSingleObject(_0x1661e4,_0x1b8d60){const _0x20bb66=a56_0x1b51,{format:_0x445438,color:_0xd7ae8c,noColor:_0x58795}=_0x1b8d60,_0x5a913c={'color':_0xd7ae8c,'noColor':_0x58795};if(_0x445438==='json'){if(shouldUseColor(_0x5a913c))return colorizeJSON(_0x1661e4,_0x5a913c);return JSON['stringify'](_0x1661e4,null,0x2);}else{if(_0x445438===_0x20bb66(0x1aa)){if(shouldUseColor(_0x5a913c))return colorizeJSONCompact(_0x1661e4,_0x5a913c);return JSON[_0x20bb66(0x197)](_0x1661e4);}else{if(_0x445438===_0x20bb66(0x1a1))return Object['entries'](_0x1661e4)[_0x20bb66(0x18a)](([_0x37b179,_0x327d1f])=>_0x37b179+'\x09'+_0x327d1f)[_0x20bb66(0x1ae)]('\x0a');else{const _0x1d1dae=Object[_0x20bb66(0x19c)](_0x1661e4);if(_0x1d1dae[_0x20bb66(0x1a8)]===0x0)return _0x20bb66(0x1b0);const _0x335ccf=_0x1661e4[_0x20bb66(0x1ba)],_0x315a06=_0x1661e4[_0x20bb66(0x190)],_0x88a131=_0x1661e4[_0x20bb66(0x1a6)],_0x3cd7db=_0x1661e4[_0x20bb66(0x185)],_0x1bb998=_0x315a06?typeof _0x315a06==='string'?_0x315a06:JSON[_0x20bb66(0x197)](_0x315a06,null,0x2):undefined,_0xd92a1c=_0x88a131&&Object[_0x20bb66(0x1ac)](_0x88a131)['length']>0x0?JSON[_0x20bb66(0x197)](_0x88a131,null,0x2):undefined,_0x10b870=_0x3cd7db&&Object[_0x20bb66(0x1ac)](_0x3cd7db)['length']>0x0?JSON[_0x20bb66(0x197)](_0x3cd7db,null,0x2):undefined,_0x58dfe7=_0x1d1dae[_0x20bb66(0x18d)](([_0x470f87])=>_0x470f87!==_0x20bb66(0x1ba)&&_0x470f87!==_0x20bb66(0x190)&&_0x470f87!==_0x20bb66(0x1a6)&&_0x470f87!==_0x20bb66(0x185)),_0x4acefa=Math[_0x20bb66(0x1a7)](..._0x58dfe7[_0x20bb66(0x18a)](([_0x2df35f])=>_0x2df35f['length'])),_0x366bea=Math[_0x20bb66(0x1a7)](..._0x58dfe7['map'](([,_0x547208])=>{const _0x8184f=_0x20bb66;try{const _0x18e419=_0x547208===null||_0x547208===undefined?'':typeof _0x547208==='object'?JSON[_0x8184f(0x197)](_0x547208):String(_0x547208),_0x3d0425=_0x18e419[_0x8184f(0x179)]('\x0a');return Math[_0x8184f(0x1a7)](..._0x3d0425[_0x8184f(0x18a)](_0x5a4583=>_0x5a4583[_0x8184f(0x1a8)]),0x0);}catch{return 0x0;}}),0x14),_0x5a5434=[];_0x5a5434['push'](colorBorder('┌─'+'─'['repeat'](_0x4acefa)+_0x20bb66(0x1c4)+'─'['repeat'](_0x366bea)+'─┐',_0x5a913c)),_0x58dfe7['forEach'](([_0x235464,_0x52187b])=>{const _0x449b3a=_0x20bb66;let _0x333c63;try{_0x333c63=_0x52187b===null||_0x52187b===undefined?'':typeof _0x52187b==='object'?JSON[_0x449b3a(0x197)](_0x52187b):String(_0x52187b);}catch{_0x333c63='[Object]';}const _0x2eb28f=_0x235464[_0x449b3a(0x1af)](_0x4acefa),_0x4ff12c=_0x333c63[_0x449b3a(0x179)]('\x0a');_0x4ff12c[_0x449b3a(0x1b4)]((_0xb3c4c4,_0x528b06)=>{const _0x18e55e=_0x449b3a,_0xf54eaf=colorBorder('│',_0x5a913c);_0x528b06===0x0?_0x5a5434[_0x18e55e(0x1b1)](_0xf54eaf+'\x20'+_0x2eb28f+'\x20'+_0xf54eaf+'\x20'+_0xb3c4c4['padEnd'](_0x366bea)+'\x20'+_0xf54eaf):_0x5a5434[_0x18e55e(0x1b1)](_0xf54eaf+'\x20'+'\x20'[_0x18e55e(0x178)](_0x4acefa)+'\x20'+_0xf54eaf+'\x20'+_0xb3c4c4[_0x18e55e(0x1af)](_0x366bea)+'\x20'+_0xf54eaf);});}),_0x5a5434[_0x20bb66(0x1b1)](colorBorder('└─'+'─'[_0x20bb66(0x178)](_0x4acefa)+_0x20bb66(0x1b6)+'─'[_0x20bb66(0x178)](_0x366bea)+'─┘',_0x5a913c));_0x1bb998&&(_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478['yellow'][_0x20bb66(0x19b)](_0x20bb66(0x1a5)))),_0x5a5434[_0x20bb66(0x1b1)](_0x1bb998));_0xd92a1c&&(_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478[_0x20bb66(0x1bb)][_0x20bb66(0x19b)]('[params]'))),_0x5a5434[_0x20bb66(0x1b1)](_0xd92a1c));_0x10b870&&(_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478[_0x20bb66(0x186)]['bold'](_0x20bb66(0x1c1)))),_0x5a5434['push'](_0x10b870));if(_0x335ccf){if(_0x335ccf[_0x20bb66(0x181)]){_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478[_0x20bb66(0x187)][_0x20bb66(0x19b)](_0x20bb66(0x1a3))));const _0x2a0f3e=_0x335ccf[_0x20bb66(0x181)][_0x20bb66(0x179)]('\x0a');_0x2a0f3e[_0x20bb66(0x1b4)](_0xfd301d=>{const _0x553b9e=_0x20bb66;_0xfd301d[_0x553b9e(0x1ad)]()&&_0x5a5434[_0x553b9e(0x1b1)](_0xfd301d);});}if(_0x335ccf[_0x20bb66(0x1b5)]){_0x5a5434[_0x20bb66(0x1b1)](''),_0x5a5434[_0x20bb66(0x1b1)](String(a56_0x5b6478[_0x20bb66(0x17c)][_0x20bb66(0x19b)](_0x20bb66(0x1b9))));const _0x2d97d2=_0x335ccf[_0x20bb66(0x1b5)][_0x20bb66(0x179)]('\x0a');_0x2d97d2[_0x20bb66(0x1b4)](_0x1150d6=>{const _0x1fbfe4=_0x20bb66;_0x1150d6[_0x1fbfe4(0x1ad)]()&&_0x5a5434[_0x1fbfe4(0x1b1)](_0x1150d6);});}}return _0x5a5434[_0x20bb66(0x1ae)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2d6101,_0x505f45){const _0x228431=a56_0x1b51;if(_0x505f45[_0x228431(0x18b)]==='table'){await handleSDKOutput([_0x2d6101],_0x505f45);return;}const _0x3484ad=resolveOutputOptions(_0x505f45),_0x23c145=await formatSingleObject(_0x2d6101,_0x3484ad);await writeOutput(_0x23c145,_0x3484ad['output']||undefined,_0x3484ad[_0x228431(0x18b)]);}
1
+ (function(_0x589a77,_0x4bda73){const _0xfd8eb8=a56_0x465f,_0x203f5d=_0x589a77();while(!![]){try{const _0x175201=-parseInt(_0xfd8eb8(0xf1))/0x1+parseInt(_0xfd8eb8(0xd5))/0x2+-parseInt(_0xfd8eb8(0xd1))/0x3*(parseInt(_0xfd8eb8(0xb3))/0x4)+-parseInt(_0xfd8eb8(0xcb))/0x5+parseInt(_0xfd8eb8(0xce))/0x6+-parseInt(_0xfd8eb8(0xdb))/0x7+-parseInt(_0xfd8eb8(0xc7))/0x8;if(_0x175201===_0x4bda73)break;else _0x203f5d['push'](_0x203f5d['shift']());}catch(_0x38a390){_0x203f5d['push'](_0x203f5d['shift']());}}}(a56_0x4ae3,0x8520e));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 a56_0x8328b4 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x593080){const _0x21a1de=a56_0x465f;return _0x593080[_0x21a1de(0xf3)]==='json'||_0x593080['format']===_0x21a1de(0xba)||_0x593080[_0x21a1de(0xf3)]===_0x21a1de(0xc1)||_0x593080['format']===_0x21a1de(0xb5)||_0x593080[_0x21a1de(0xd2)]===!![]||_0x593080['jsonl']===!![]||_0x593080['tsv']===!![]||_0x593080['table']===!![];}export function parseOutputOptions(_0x418e4c){const _0x1921d2=a56_0x465f;return{'format':_0x418e4c['format']||_0x1921d2(0xb5),'output':_0x418e4c[_0x1921d2(0xbf)]||'','limit':_0x418e4c[_0x1921d2(0xcd)],'limitStructuredFormats':_0x418e4c['limitStructuredFormats'],'color':_0x418e4c[_0x1921d2(0xb2)],'noColor':_0x418e4c[_0x1921d2(0xc3)]};}function convertSDKResultToQueryResult(_0xbe5d64){const _0x310552=a56_0x465f,_0x1e7b8e=[];if(_0xbe5d64[_0x310552(0xb1)]>0x0){const _0x154e7b=_0xbe5d64[0x0];for(const [_0x48f3c5,_0x3f39af]of Object[_0x310552(0xca)](_0x154e7b)){let _0x266c67=_0x310552(0xdd);if(typeof _0x3f39af===_0x310552(0xe3))_0x266c67=Number[_0x310552(0xeb)](_0x3f39af)?_0x310552(0xbb):_0x310552(0xd4);else{if(typeof _0x3f39af===_0x310552(0xe7))_0x266c67=_0x310552(0xe7);else _0x3f39af===null&&(_0x266c67=_0x310552(0xdd));}_0x1e7b8e['push']({'name':_0x48f3c5,'type':_0x266c67});}}return{'queryId':_0x310552(0xe9),'columns':_0x1e7b8e,'data':_0xbe5d64,'stats':{'state':_0x310552(0xc9),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xbe5d64[_0x310552(0xb1)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2df045,_0x44bd98){const _0x558e4b=convertSDKResultToQueryResult(_0x2df045);return formatQueryOutput(_0x558e4b,_0x44bd98);}function a56_0x465f(_0x6e54a0,_0x4be0c6){_0x6e54a0=_0x6e54a0-0xb0;const _0x4ae3a8=a56_0x4ae3();let _0x465fe4=_0x4ae3a8[_0x6e54a0];return _0x465fe4;}export async function formatQueryOutput(_0x5e0347,_0x5e3c43){const _0x53aa47=a56_0x465f,{format:_0xd5843c,limit:_0x458dd9,output:_0x965562,color:_0x428a46,noColor:_0x14f72a,limitStructuredFormats:_0x570dd7}=_0x5e3c43,_0x3518cf=Boolean(_0x965562)&&!_0x428a46,_0x2e1f83={'color':_0x428a46,'noColor':_0x14f72a||_0x3518cf};if(_0xd5843c==='table'){const _0x56c5ef=shouldUseLess(_0xd5843c,_0x965562);return formatAsTable(_0x5e0347,_0x458dd9,_0x56c5ef,_0x2e1f83);}const _0x36b9e0=_0x570dd7&&Number[_0x53aa47(0xd8)](_0x458dd9)&&_0x5e0347['data']['length']>_0x458dd9?{..._0x5e0347,'data':_0x5e0347[_0x53aa47(0xf4)]['slice'](0x0,_0x458dd9)}:_0x5e0347;if(_0xd5843c===_0x53aa47(0xd2))return formatAsJSON(_0x36b9e0,_0x2e1f83);else return _0xd5843c===_0x53aa47(0xba)?formatAsJSONL(_0x36b9e0,_0x2e1f83):formatQueryResult(_0x36b9e0,_0xd5843c);}function shouldUseLess(_0x5b19b5,_0x23b02f){const _0x2742f5=a56_0x465f;return(_0x5b19b5==='table'||_0x5b19b5===_0x2742f5(0xf6))&&process['stdout'][_0x2742f5(0xe8)]&&!_0x23b02f;}function a56_0x4ae3(){const _0x4491f3=['table','error','spawn','No\x20data','push','jsonl','bigint','params','inherit','object','output','padEnd','tsv','cyan','noColor','─┬─','string','join','2265848QPSOlb','[Object]','FINISHED','entries','1640740GVMfUb','map','limit','6357168nWDuEh','write','-FXRSn','201ZGYPIZ','json','forEach','double','1122642Qqchng','filter','[rule]','isFinite','magenta','bold','783993RzLQVe','max','varchar','blue','keys','stdin','log','Results\x20saved\x20to\x20','number','[query]','resolve','red','boolean','isTTY','sdk-result','repeat','isInteger','query','trim','stringify','stderr','cmdout','243570mNkosg','[error]','format','data','rule','list','split','length','color','6484FUiYaE','debug'];a56_0x4ae3=function(){return _0x4491f3;};return a56_0x4ae3();}export function resolveOutputOptions(_0x215b49){const _0x5900fe=a56_0x465f,_0x1896c8=_0x215b49[_0x5900fe(0xbf)]||'',_0x12609c=resolveOutputFormat(_0x215b49[_0x5900fe(0xf3)],_0x1896c8,_0x5900fe(0xb5));let _0x4d9478=typeof _0x215b49[_0x5900fe(0xcd)]===_0x5900fe(0xe3)?_0x215b49[_0x5900fe(0xcd)]:parseInt(_0x215b49[_0x5900fe(0xcd)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x215b49[_0x5900fe(0xcd)]===undefined&&shouldUseLess(_0x12609c,_0x1896c8)&&(_0x4d9478=Infinity),{'format':_0x12609c,'output':_0x1896c8,'limit':_0x4d9478,'limitStructuredFormats':_0x215b49['limitStructuredFormats'],'color':_0x215b49[_0x5900fe(0xb2)],'noColor':_0x215b49[_0x5900fe(0xc3)]};}export function writeOutput(_0x4810e7,_0x217d04,_0xe9396b){const _0x52b68b=a56_0x465f;return _0x217d04?(writeFileSync(_0x217d04,_0x4810e7),console[_0x52b68b(0xb6)](_0x52b68b(0xe2)+_0x217d04),Promise[_0x52b68b(0xe5)]()):shouldUseLess(_0xe9396b||'','')?new Promise(_0x509a4a=>{const _0xc3bf1c=_0x52b68b,_0x568b23=spawn('less',[_0xc3bf1c(0xd0)],{'stdio':['pipe',_0xc3bf1c(0xbd),_0xc3bf1c(0xbd)]});let _0xe7dfbb=![];_0x568b23['on'](_0xc3bf1c(0xb6),()=>{const _0x26dbf3=_0xc3bf1c;!_0xe7dfbb&&(_0xe7dfbb=!![],console[_0x26dbf3(0xe1)](_0x4810e7),_0x509a4a());}),_0x568b23['on']('close',()=>{!_0xe7dfbb&&(_0xe7dfbb=!![],_0x509a4a());}),_0x568b23['on'](_0xc3bf1c(0xb7),()=>{const _0x4b81b9=_0xc3bf1c;!_0xe7dfbb&&_0x568b23[_0x4b81b9(0xe0)]&&(_0x568b23[_0x4b81b9(0xe0)]['on'](_0x4b81b9(0xb6),()=>{}),_0x568b23[_0x4b81b9(0xe0)][_0x4b81b9(0xcf)](_0x4810e7),_0x568b23[_0x4b81b9(0xe0)]['end']());}),!_0x568b23[_0xc3bf1c(0xe0)]&&(!_0xe7dfbb&&(_0xe7dfbb=!![],console[_0xc3bf1c(0xe1)](_0x4810e7),_0x509a4a()));}):(console[_0x52b68b(0xe1)](_0x4810e7),Promise['resolve']());}export async function handleSDKOutput(_0x107be3,_0x222ea0){const _0x22708d=a56_0x465f,_0x27a775=resolveOutputOptions(_0x222ea0),_0x364aff=await formatSDKOutput(_0x107be3,_0x27a775);await writeOutput(_0x364aff,_0x27a775[_0x22708d(0xbf)]||undefined,_0x27a775[_0x22708d(0xf3)]);}export async function handleQueryOutput(_0x320b47,_0x1fca90){const _0x5b3672=a56_0x465f,_0x1ecd72=resolveOutputOptions(_0x1fca90),_0x1b5e7b=await formatQueryOutput(_0x320b47,_0x1ecd72);await writeOutput(_0x1b5e7b,_0x1ecd72[_0x5b3672(0xbf)]||undefined,_0x1ecd72[_0x5b3672(0xf3)]);}async function formatSingleObject(_0x24554f,_0x422546){const _0x48733f=a56_0x465f,{format:_0xe4234f,color:_0xda1ade,noColor:_0x44d402}=_0x422546,_0x49a775={'color':_0xda1ade,'noColor':_0x44d402};if(_0xe4234f==='json'){if(shouldUseColor(_0x49a775))return colorizeJSON(_0x24554f,_0x49a775);return JSON[_0x48733f(0xee)](_0x24554f,null,0x2);}else{if(_0xe4234f==='jsonl'){if(shouldUseColor(_0x49a775))return colorizeJSONCompact(_0x24554f,_0x49a775);return JSON[_0x48733f(0xee)](_0x24554f);}else{if(_0xe4234f===_0x48733f(0xc1))return Object[_0x48733f(0xca)](_0x24554f)[_0x48733f(0xcc)](([_0x4d9042,_0x2f43a5])=>_0x4d9042+'\x09'+_0x2f43a5)[_0x48733f(0xc6)]('\x0a');else{const _0x32894c=Object[_0x48733f(0xca)](_0x24554f);if(_0x32894c[_0x48733f(0xb1)]===0x0)return _0x48733f(0xb8);const _0x185ae9=_0x24554f[_0x48733f(0xb4)],_0x5bf053=_0x24554f[_0x48733f(0xec)],_0x4d34f2=_0x24554f[_0x48733f(0xbc)],_0x39a9c0=_0x24554f[_0x48733f(0xf5)],_0xdf6774=_0x5bf053?typeof _0x5bf053===_0x48733f(0xc5)?_0x5bf053:JSON[_0x48733f(0xee)](_0x5bf053,null,0x2):undefined,_0x43e88c=_0x4d34f2&&Object[_0x48733f(0xdf)](_0x4d34f2)['length']>0x0?JSON[_0x48733f(0xee)](_0x4d34f2,null,0x2):undefined,_0x937829=_0x39a9c0&&Object[_0x48733f(0xdf)](_0x39a9c0)[_0x48733f(0xb1)]>0x0?JSON[_0x48733f(0xee)](_0x39a9c0,null,0x2):undefined,_0x1f08dd=_0x32894c[_0x48733f(0xd6)](([_0x2f5620])=>_0x2f5620!=='debug'&&_0x2f5620!==_0x48733f(0xec)&&_0x2f5620!=='params'&&_0x2f5620!=='rule'),_0x50cac6=Math[_0x48733f(0xdc)](..._0x1f08dd[_0x48733f(0xcc)](([_0x2b3d37])=>_0x2b3d37[_0x48733f(0xb1)])),_0x2ae546=Math[_0x48733f(0xdc)](..._0x1f08dd[_0x48733f(0xcc)](([,_0x2a8ee0])=>{const _0x2f8083=_0x48733f;try{const _0x463a04=_0x2a8ee0===null||_0x2a8ee0===undefined?'':typeof _0x2a8ee0==='object'?JSON[_0x2f8083(0xee)](_0x2a8ee0):String(_0x2a8ee0),_0x9c63b6=_0x463a04[_0x2f8083(0xb0)]('\x0a');return Math[_0x2f8083(0xdc)](..._0x9c63b6[_0x2f8083(0xcc)](_0x16ed75=>_0x16ed75[_0x2f8083(0xb1)]),0x0);}catch{return 0x0;}}),0x14),_0x1b34cf=[];_0x1b34cf[_0x48733f(0xb9)](colorBorder('┌─'+'─'[_0x48733f(0xea)](_0x50cac6)+_0x48733f(0xc4)+'─'[_0x48733f(0xea)](_0x2ae546)+'─┐',_0x49a775)),_0x1f08dd['forEach'](([_0x510e2a,_0x1c160c])=>{const _0x7756b3=_0x48733f;let _0x4f888d;try{_0x4f888d=_0x1c160c===null||_0x1c160c===undefined?'':typeof _0x1c160c===_0x7756b3(0xbe)?JSON[_0x7756b3(0xee)](_0x1c160c):String(_0x1c160c);}catch{_0x4f888d=_0x7756b3(0xc8);}const _0x74f547=_0x510e2a['padEnd'](_0x50cac6),_0x40f198=_0x4f888d[_0x7756b3(0xb0)]('\x0a');_0x40f198[_0x7756b3(0xd3)]((_0x41be53,_0x4ea50e)=>{const _0x247de0=_0x7756b3,_0x4d00b2=colorBorder('│',_0x49a775);_0x4ea50e===0x0?_0x1b34cf[_0x247de0(0xb9)](_0x4d00b2+'\x20'+_0x74f547+'\x20'+_0x4d00b2+'\x20'+_0x41be53[_0x247de0(0xc0)](_0x2ae546)+'\x20'+_0x4d00b2):_0x1b34cf[_0x247de0(0xb9)](_0x4d00b2+'\x20'+'\x20'[_0x247de0(0xea)](_0x50cac6)+'\x20'+_0x4d00b2+'\x20'+_0x41be53[_0x247de0(0xc0)](_0x2ae546)+'\x20'+_0x4d00b2);});}),_0x1b34cf[_0x48733f(0xb9)](colorBorder('└─'+'─'[_0x48733f(0xea)](_0x50cac6)+'─┴─'+'─'['repeat'](_0x2ae546)+'─┘',_0x49a775));_0xdf6774&&(_0x1b34cf['push'](''),_0x1b34cf[_0x48733f(0xb9)](String(a56_0x8328b4['yellow'][_0x48733f(0xda)](_0x48733f(0xe4)))),_0x1b34cf[_0x48733f(0xb9)](_0xdf6774));_0x43e88c&&(_0x1b34cf['push'](''),_0x1b34cf['push'](String(a56_0x8328b4[_0x48733f(0xde)][_0x48733f(0xda)]('[params]'))),_0x1b34cf[_0x48733f(0xb9)](_0x43e88c));_0x937829&&(_0x1b34cf['push'](''),_0x1b34cf[_0x48733f(0xb9)](String(a56_0x8328b4[_0x48733f(0xd9)][_0x48733f(0xda)](_0x48733f(0xd7)))),_0x1b34cf[_0x48733f(0xb9)](_0x937829));if(_0x185ae9){if(_0x185ae9[_0x48733f(0xef)]){_0x1b34cf[_0x48733f(0xb9)](''),_0x1b34cf['push'](String(a56_0x8328b4[_0x48733f(0xe6)][_0x48733f(0xda)](_0x48733f(0xf2))));const _0x51f085=_0x185ae9[_0x48733f(0xef)][_0x48733f(0xb0)]('\x0a');_0x51f085['forEach'](_0x54a180=>{const _0x58b327=_0x48733f;_0x54a180[_0x58b327(0xed)]()&&_0x1b34cf['push'](_0x54a180);});}if(_0x185ae9[_0x48733f(0xf0)]){_0x1b34cf[_0x48733f(0xb9)](''),_0x1b34cf['push'](String(a56_0x8328b4[_0x48733f(0xc2)][_0x48733f(0xda)]('[logs]')));const _0x3f7acd=_0x185ae9[_0x48733f(0xf0)]['split']('\x0a');_0x3f7acd[_0x48733f(0xd3)](_0x5c11a2=>{const _0x1ce0fa=_0x48733f;_0x5c11a2['trim']()&&_0x1b34cf[_0x1ce0fa(0xb9)](_0x5c11a2);});}}return _0x1b34cf['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x524f1b,_0x3c2fae){const _0x41f6be=a56_0x465f;if(_0x3c2fae['format']===_0x41f6be(0xb5)){await handleSDKOutput([_0x524f1b],_0x3c2fae);return;}const _0x512851=resolveOutputOptions(_0x3c2fae),_0x135239=await formatSingleObject(_0x524f1b,_0x512851);await writeOutput(_0x135239,_0x512851[_0x41f6be(0xbf)]||undefined,_0x512851['format']);}